@kalamba/sdk 0.6.1 → 0.8.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.
- package/dist/errors-358575c3.cjs +5 -0
- package/dist/errors-afd9f527.js +90 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +90 -78
- package/dist/index.js +88 -91
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.d.ts +97 -69
- package/dist/plugins.js +1002 -1043
- package/dist/wrapper.cjs +1 -1
- package/dist/wrapper.d.ts +99 -69
- package/dist/wrapper.js +669 -629
- package/package.json +1 -1
- package/dist/errors-66b5612a.cjs +0 -5
- package/dist/errors-96eb18f7.js +0 -52
package/dist/plugins.js
CHANGED
|
@@ -2,61 +2,62 @@
|
|
|
2
2
|
* BSD 3-Clause License
|
|
3
3
|
* Copyright (c) 2024, Kalamba Games Limited
|
|
4
4
|
*/
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var b = (i,
|
|
8
|
-
if (!
|
|
9
|
-
throw TypeError("Cannot " +
|
|
5
|
+
var Ht = Object.defineProperty;
|
|
6
|
+
var Vt = (i, t, e) => t in i ? Ht(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
7
|
+
var b = (i, t, e) => (Vt(i, typeof t != "symbol" ? t + "" : t, e), e), rt = (i, t, e) => {
|
|
8
|
+
if (!t.has(i))
|
|
9
|
+
throw TypeError("Cannot " + e);
|
|
10
10
|
};
|
|
11
|
-
var
|
|
12
|
-
if (
|
|
11
|
+
var y = (i, t, e) => (rt(i, t, "read from private field"), e ? e.call(i) : t.get(i)), C = (i, t, e) => {
|
|
12
|
+
if (t.has(i))
|
|
13
13
|
throw TypeError("Cannot add the same private member more than once");
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
import { a as
|
|
17
|
-
import { a as
|
|
18
|
-
function
|
|
19
|
-
return (
|
|
20
|
-
console.log(`[%c${i}\x1B[m] %s`,
|
|
14
|
+
t instanceof WeakSet ? t.add(i) : t.set(i, e);
|
|
15
|
+
}, v = (i, t, e, a) => (rt(i, t, "write to private field"), a ? a.call(i, e) : t.set(i, e), e);
|
|
16
|
+
import { a as Ne } from "./errors-afd9f527.js";
|
|
17
|
+
import { a as ct } from "./noop-3336849b.js";
|
|
18
|
+
function U(i, t) {
|
|
19
|
+
return (e, ...a) => {
|
|
20
|
+
console.log(`[%c${i}\x1B[m] %s`, t, e, ...a);
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
return Math.round(i * 100 /
|
|
23
|
+
function Bt(i, t) {
|
|
24
|
+
return Math.round(i * 100 / t);
|
|
25
25
|
}
|
|
26
|
-
class
|
|
27
|
-
constructor(e) {
|
|
26
|
+
class j {
|
|
27
|
+
constructor(t, e) {
|
|
28
28
|
b(this, "config");
|
|
29
|
-
this
|
|
29
|
+
b(this, "sdkConfig");
|
|
30
|
+
this.config = t, this.sdkConfig = e;
|
|
30
31
|
}
|
|
31
|
-
on(
|
|
32
|
-
const
|
|
33
|
-
s.data.message !== `kalamba:wrapper-casino:${
|
|
32
|
+
on(t, e, a) {
|
|
33
|
+
const n = function(s) {
|
|
34
|
+
s.data.message !== `kalamba:wrapper-casino:${t}` && s.data.message !== `kalamba:wrapper:${t}` || e(s.data.payload);
|
|
34
35
|
};
|
|
35
|
-
window.addEventListener("message",
|
|
36
|
+
window.addEventListener("message", n, a);
|
|
36
37
|
}
|
|
37
|
-
send(
|
|
38
|
+
send(t, ...[e]) {
|
|
38
39
|
window.postMessage({
|
|
39
|
-
message: `kalamba:casino:${
|
|
40
|
-
payload:
|
|
40
|
+
message: `kalamba:casino:${t}`,
|
|
41
|
+
payload: e
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
|
-
const
|
|
45
|
-
class
|
|
46
|
-
constructor(...
|
|
47
|
-
super(...
|
|
45
|
+
const zt = U("BasicPlugin", "color:#000000;font-weight:bold;");
|
|
46
|
+
class _i extends j {
|
|
47
|
+
constructor(...t) {
|
|
48
|
+
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), zt("configured");
|
|
48
49
|
}
|
|
49
50
|
registerToSdkEvents() {
|
|
50
|
-
window.addEventListener("message", (
|
|
51
|
+
window.addEventListener("message", (t) => {
|
|
51
52
|
try {
|
|
52
|
-
const { type:
|
|
53
|
-
switch (
|
|
53
|
+
const { type: e, payload: a } = t.data;
|
|
54
|
+
switch (e) {
|
|
54
55
|
case "doAudioSettings":
|
|
55
|
-
this.send("settings", { music:
|
|
56
|
+
this.send("settings", { music: a == null ? void 0 : a.musicEnabled, sounds: a == null ? void 0 : a.soundEnabled });
|
|
56
57
|
return;
|
|
57
58
|
case "doBalanceUpdate":
|
|
58
|
-
const { currency:
|
|
59
|
-
|
|
59
|
+
const { currency: n, coinValueInCents: r } = this.sdkConfig.api;
|
|
60
|
+
a.currency === n && typeof a.balanceInCurrency == "number" ? this.send("balance", { balance: Bt(a.balanceInCurrency, r) }) : (a.balanceInCoins, this.send("balance", { balance: a.balanceInCoins }));
|
|
60
61
|
return;
|
|
61
62
|
case "doGamePause":
|
|
62
63
|
this.send("freeze");
|
|
@@ -76,11 +77,11 @@ class Bi extends Q {
|
|
|
76
77
|
}
|
|
77
78
|
registerFromSdkEvents() {
|
|
78
79
|
this.on("close", () => {
|
|
79
|
-
if (this.
|
|
80
|
+
if (this.sdkConfig.api.homeUrl)
|
|
80
81
|
try {
|
|
81
|
-
window.top.location = this.
|
|
82
|
+
window.top.location = this.sdkConfig.api.homeUrl;
|
|
82
83
|
} catch {
|
|
83
|
-
window.location = this.
|
|
84
|
+
window.location = this.sdkConfig.api.homeUrl;
|
|
84
85
|
}
|
|
85
86
|
else
|
|
86
87
|
try {
|
|
@@ -91,50 +92,50 @@ class Bi extends Q {
|
|
|
91
92
|
});
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
|
-
const
|
|
95
|
-
class Fi extends
|
|
96
|
-
constructor(...
|
|
97
|
-
super(...
|
|
95
|
+
const k = U("▼ DebuggingPlugin IN ▼", "color:#444444;font-weight:bold;"), qt = U("▲ DebuggingPlugin OUT ▲", "color:#444444;font-weight:bold;");
|
|
96
|
+
class Fi extends j {
|
|
97
|
+
constructor(...t) {
|
|
98
|
+
super(...t), this.registerDebugToSdkEvents(), this.registerSdkToDebugEvents();
|
|
98
99
|
}
|
|
99
100
|
// TODO add types
|
|
100
101
|
registerDebugToSdkEvents() {
|
|
101
102
|
window.DebuggingPlugin = {
|
|
102
|
-
balance: (
|
|
103
|
-
bet: (
|
|
104
|
-
choice: (
|
|
105
|
-
close: (
|
|
106
|
-
help: (
|
|
107
|
-
history: (
|
|
108
|
-
freeze: (
|
|
109
|
-
paytable: (
|
|
110
|
-
settings: (
|
|
111
|
-
suspend: (
|
|
112
|
-
unfreeze: (
|
|
103
|
+
balance: (t) => this._send("balance", t),
|
|
104
|
+
bet: (t) => this._send("bet", t),
|
|
105
|
+
choice: (t) => this._send("choice", t),
|
|
106
|
+
close: (t) => this._send("close", t),
|
|
107
|
+
help: (t) => this._send("help", t),
|
|
108
|
+
history: (t) => this._send("history", t),
|
|
109
|
+
freeze: (t) => this._send("freeze", t),
|
|
110
|
+
paytable: (t) => this._send("paytable", t),
|
|
111
|
+
settings: (t) => this._send("settings", t),
|
|
112
|
+
suspend: (t) => this._send("suspend", t),
|
|
113
|
+
unfreeze: (t) => this._send("unfreeze", t)
|
|
113
114
|
};
|
|
114
115
|
}
|
|
115
116
|
registerSdkToDebugEvents() {
|
|
116
|
-
this.on("autoplay", (
|
|
117
|
+
this.on("autoplay", (t) => k("autoplay", t)), this.on("balance", (t) => k("balance", t)), this.on("bet", (t) => k("bet", t)), this.on("cashier", (t) => k("cashier", t)), this.on("choice", (t) => k("choice", t)), this.on("close", (t) => k("close", t)), this.on("error", (t) => k("error", t)), this.on("loadEnd", (t) => k("loadEnd", t)), this.on("loadProgress", (t) => k("loadProgress", t)), this.on("loadStart", (t) => k("loadStart", t)), this.on("playCycleStart", (t) => k("playCycleStart", t)), this.on("playCycleEnd", (t) => k("playCycleEnd", t)), this.on("playEnd", (t) => k("playEnd", t)), this.on("playError", (t) => k("playError", t)), this.on("playReady", (t) => k("playReady", t)), this.on("playStart", (t) => k("playStart", t)), this.on("settings", (t) => k("settings", t));
|
|
117
118
|
}
|
|
118
|
-
_send(...
|
|
119
|
-
qt(...
|
|
119
|
+
_send(...t) {
|
|
120
|
+
qt(...t), this.send(...t);
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
|
-
const
|
|
123
|
-
class
|
|
124
|
-
constructor(...
|
|
125
|
-
super(...
|
|
123
|
+
const Gt = U("GigPlugin", "color:#000000;font-weight:bold;");
|
|
124
|
+
class Di extends j {
|
|
125
|
+
constructor(...t) {
|
|
126
|
+
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), Gt("configured");
|
|
126
127
|
}
|
|
127
|
-
postMessage(
|
|
128
|
-
const
|
|
129
|
-
event:
|
|
128
|
+
postMessage(t) {
|
|
129
|
+
const e = {
|
|
130
|
+
event: t
|
|
130
131
|
};
|
|
131
|
-
window.top.postMessage(
|
|
132
|
+
window.top.postMessage(e, "*");
|
|
132
133
|
}
|
|
133
134
|
registerToSdkEvents() {
|
|
134
|
-
window.addEventListener("message", (
|
|
135
|
+
window.addEventListener("message", (t) => {
|
|
135
136
|
try {
|
|
136
|
-
const { data:
|
|
137
|
-
switch (
|
|
137
|
+
const { data: e } = t;
|
|
138
|
+
switch (e) {
|
|
138
139
|
case "STOP_AUTO_PLAY":
|
|
139
140
|
this.send("suspend");
|
|
140
141
|
return;
|
|
@@ -153,11 +154,11 @@ class Ni extends Q {
|
|
|
153
154
|
}
|
|
154
155
|
registerFromSdkEvents() {
|
|
155
156
|
this.on("close", () => {
|
|
156
|
-
if (this.
|
|
157
|
+
if (this.sdkConfig.api.homeUrl)
|
|
157
158
|
try {
|
|
158
|
-
window.top.location = this.
|
|
159
|
+
window.top.location = this.sdkConfig.api.homeUrl;
|
|
159
160
|
} catch {
|
|
160
|
-
window.location = this.
|
|
161
|
+
window.location = this.sdkConfig.api.homeUrl;
|
|
161
162
|
}
|
|
162
163
|
else
|
|
163
164
|
try {
|
|
@@ -170,18 +171,18 @@ class Ni extends Q {
|
|
|
170
171
|
});
|
|
171
172
|
}
|
|
172
173
|
}
|
|
173
|
-
const
|
|
174
|
-
class
|
|
175
|
-
constructor(...
|
|
176
|
-
super(...
|
|
174
|
+
const Wt = U("OryxPlugin", "color:#000000;font-weight:bold;");
|
|
175
|
+
class Ni extends j {
|
|
176
|
+
constructor(...t) {
|
|
177
|
+
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), Wt("configured");
|
|
177
178
|
}
|
|
178
179
|
registerToSdkEvents() {
|
|
179
|
-
window.addEventListener("message", (
|
|
180
|
+
window.addEventListener("message", (t) => {
|
|
180
181
|
try {
|
|
181
|
-
const { type:
|
|
182
|
-
switch (
|
|
182
|
+
const { type: e, param: a } = t.data;
|
|
183
|
+
switch (e) {
|
|
183
184
|
case "doBalanceUpdate":
|
|
184
|
-
this.send("balance", { balance:
|
|
185
|
+
this.send("balance", { balance: a });
|
|
185
186
|
return;
|
|
186
187
|
case "doGamePause":
|
|
187
188
|
this.send("freeze");
|
|
@@ -200,11 +201,11 @@ class Hi extends Q {
|
|
|
200
201
|
});
|
|
201
202
|
}
|
|
202
203
|
registerFromSdkEvents() {
|
|
203
|
-
let
|
|
204
|
+
let t = 0;
|
|
204
205
|
this.on("close", () => {
|
|
205
206
|
window.top.postMessage({ wpgaction: "close" }, "*"), window.parent.postMessage({ wpgaction: "close.parent" }, "*");
|
|
206
|
-
}), this.on("balance", ({ balance:
|
|
207
|
-
|
|
207
|
+
}), this.on("balance", ({ balance: e }) => {
|
|
208
|
+
t !== e && (t = e, window.top.postMessage({ param: {}, wpgaction: "balance" }, "*"), window.parent.postMessage({ param: {}, wpgaction: "balance.parent" }, "*"));
|
|
208
209
|
}), this.on("loadStart", () => {
|
|
209
210
|
window.top.postMessage({ wpgaction: "loadStart" }, "*"), window.parent.postMessage({ wpgaction: "loadStart.parent" }, "*");
|
|
210
211
|
}), this.on("loadEnd", () => {
|
|
@@ -213,8 +214,8 @@ class Hi extends Q {
|
|
|
213
214
|
window.top.postMessage({ wpgaction: "gameSpinStart" }, "*"), window.parent.postMessage({ wpgaction: "gameSpinStart.parent" }, "*");
|
|
214
215
|
}), this.on("playEnd", () => {
|
|
215
216
|
window.top.postMessage({ wpgaction: "gameSpinEnd" }, "*"), window.parent.postMessage({ wpgaction: "gameSpinEnd.parent" }, "*");
|
|
216
|
-
}), this.on("cashier", ({ type:
|
|
217
|
-
switch (
|
|
217
|
+
}), this.on("cashier", ({ type: e }) => {
|
|
218
|
+
switch (e) {
|
|
218
219
|
case "BALANCE_LOW":
|
|
219
220
|
window.top.postMessage({ wpgaction: "cashier" }, "*"), window.parent.postMessage({ wpgaction: "cashier.parent" }, "*");
|
|
220
221
|
break;
|
|
@@ -225,92 +226,92 @@ class Hi extends Q {
|
|
|
225
226
|
});
|
|
226
227
|
}
|
|
227
228
|
}
|
|
228
|
-
const
|
|
229
|
-
function
|
|
229
|
+
const dt = U("PariplayPlugin", "color:#000000;font-weight:bold;");
|
|
230
|
+
function Ve(i) {
|
|
230
231
|
try {
|
|
231
232
|
window.top.location = i;
|
|
232
233
|
} catch {
|
|
233
234
|
window.location = i;
|
|
234
235
|
}
|
|
235
236
|
}
|
|
236
|
-
function
|
|
237
|
-
return new Promise(function(
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
},
|
|
237
|
+
function ze(i, t) {
|
|
238
|
+
return new Promise(function(a, n) {
|
|
239
|
+
const r = new XMLHttpRequest();
|
|
240
|
+
r.onload = function() {
|
|
241
|
+
r.status >= 200 && r.status < 300 ? a(r.responseText) : n(r.responseText);
|
|
242
|
+
}, r.open(i, t), r.send();
|
|
242
243
|
});
|
|
243
244
|
}
|
|
244
|
-
function
|
|
245
|
+
function qe() {
|
|
245
246
|
}
|
|
246
|
-
function
|
|
247
|
-
return i.filter(function(
|
|
248
|
-
return
|
|
247
|
+
function $t(i) {
|
|
248
|
+
return i.filter(function(e) {
|
|
249
|
+
return e.messageType.toUpperCase() === "DATA";
|
|
249
250
|
});
|
|
250
251
|
}
|
|
251
|
-
function
|
|
252
|
-
return i.filter(function(
|
|
253
|
-
return ["NOTIFICATION", "POPUP"].includes(
|
|
252
|
+
function Ge(i) {
|
|
253
|
+
return i.filter(function(e) {
|
|
254
|
+
return ["NOTIFICATION", "POPUP"].includes(e.messageType.toUpperCase());
|
|
254
255
|
});
|
|
255
256
|
}
|
|
256
|
-
function
|
|
257
|
+
function _t(i) {
|
|
257
258
|
try {
|
|
258
259
|
return JSON.parse(i.text);
|
|
259
260
|
} catch {
|
|
260
261
|
return {};
|
|
261
262
|
}
|
|
262
263
|
}
|
|
263
|
-
function
|
|
264
|
-
return i.map(
|
|
265
|
-
return
|
|
264
|
+
function jt(i) {
|
|
265
|
+
return i.map(_t).filter(Boolean).find(function(e) {
|
|
266
|
+
return e.betId != null && e.winId != null;
|
|
266
267
|
}) || {};
|
|
267
268
|
}
|
|
268
|
-
function
|
|
269
|
-
return i.map(
|
|
270
|
-
return
|
|
269
|
+
function Qt(i) {
|
|
270
|
+
return i.map(_t).filter(Boolean).find(function(e) {
|
|
271
|
+
return e.TotalBet != null && e.TotalWin != null;
|
|
271
272
|
}) || {};
|
|
272
273
|
}
|
|
273
|
-
class
|
|
274
|
-
constructor(...
|
|
275
|
-
super(...
|
|
274
|
+
class Ri extends j {
|
|
275
|
+
constructor(...t) {
|
|
276
|
+
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), dt("configured");
|
|
276
277
|
}
|
|
277
|
-
postMessage(
|
|
278
|
-
const
|
|
279
|
-
lang: this.
|
|
280
|
-
sender: this.
|
|
281
|
-
type:
|
|
278
|
+
postMessage(t, e) {
|
|
279
|
+
const a = {
|
|
280
|
+
lang: this.sdkConfig.ui.language,
|
|
281
|
+
sender: this.sdkConfig.api.game,
|
|
282
|
+
type: t
|
|
282
283
|
};
|
|
283
|
-
|
|
284
|
+
e != null && (a.data = e), dt("postMessage", a), window.parent.postMessage(a, "*");
|
|
284
285
|
}
|
|
285
|
-
coinsToCurrency(
|
|
286
|
-
return
|
|
286
|
+
coinsToCurrency(t) {
|
|
287
|
+
return t * this.sdkConfig.api.coinValueInCents / 100;
|
|
287
288
|
}
|
|
288
|
-
handleContinueButton(
|
|
289
|
-
|
|
289
|
+
handleContinueButton(t, e) {
|
|
290
|
+
t.link && ze("GET", t.link), e();
|
|
290
291
|
}
|
|
291
|
-
handleLinkButton(
|
|
292
|
-
switch (
|
|
292
|
+
handleLinkButton(t, e) {
|
|
293
|
+
switch (t.linkType.toUpperCase()) {
|
|
293
294
|
case "AJAX":
|
|
294
|
-
|
|
295
|
+
ze("GET", t.link), e();
|
|
295
296
|
return;
|
|
296
297
|
case "AJAXRESPONSE":
|
|
297
|
-
|
|
298
|
-
|
|
298
|
+
ze("GET", t.link).then(() => {
|
|
299
|
+
e();
|
|
299
300
|
});
|
|
300
301
|
return;
|
|
301
302
|
case "REDIRECT":
|
|
302
|
-
|
|
303
|
+
Ve(t.link), e();
|
|
303
304
|
return;
|
|
304
305
|
}
|
|
305
306
|
}
|
|
306
|
-
handleQuitButton(
|
|
307
|
-
this.send("close"),
|
|
307
|
+
handleQuitButton(t, e) {
|
|
308
|
+
this.send("close"), e();
|
|
308
309
|
}
|
|
309
|
-
handleCashierButton(
|
|
310
|
-
this.send("cashier", { type: "ON_DEMAND" }),
|
|
310
|
+
handleCashierButton(t, e) {
|
|
311
|
+
this.send("cashier", { type: "ON_DEMAND" }), e();
|
|
311
312
|
}
|
|
312
|
-
handleHistoryButton(
|
|
313
|
-
this.send("history", { source: "casino" }),
|
|
313
|
+
handleHistoryButton(t, e) {
|
|
314
|
+
this.send("history", { source: "casino" }), e();
|
|
314
315
|
}
|
|
315
316
|
get buttonActions() {
|
|
316
317
|
return {
|
|
@@ -321,24 +322,24 @@ class Vi extends Q {
|
|
|
321
322
|
QUIT: this.handleQuitButton
|
|
322
323
|
};
|
|
323
324
|
}
|
|
324
|
-
processInfoUiMessages(
|
|
325
|
-
return
|
|
326
|
-
Object.assign({},
|
|
327
|
-
buttons:
|
|
325
|
+
processInfoUiMessages(t) {
|
|
326
|
+
return t.reduce((e, a) => e.then(() => new Promise((n) => {
|
|
327
|
+
Object.assign({}, a, {
|
|
328
|
+
buttons: a.buttons.filter((r) => r.action.toUpperCase() === "CASHIER" ? !!this.sdkConfig.api.cashierUrl : !0).map((r) => Object.assign({}, r, {
|
|
328
329
|
onRelease: () => {
|
|
329
|
-
const s =
|
|
330
|
-
h ? h(
|
|
330
|
+
const s = a.messageType.toUpperCase() === "POPUP" ? qe : n, h = this.buttonActions[r.action.toUpperCase()];
|
|
331
|
+
h ? h(r, s) : s();
|
|
331
332
|
}
|
|
332
333
|
}))
|
|
333
334
|
});
|
|
334
|
-
}).catch(
|
|
335
|
-
}).catch(
|
|
335
|
+
}).catch(qe)), Promise.resolve()).then(() => {
|
|
336
|
+
}).catch(qe);
|
|
336
337
|
}
|
|
337
338
|
registerToSdkEvents() {
|
|
338
|
-
window.addEventListener("message", (
|
|
339
|
+
window.addEventListener("message", (t) => {
|
|
339
340
|
try {
|
|
340
|
-
const { type:
|
|
341
|
-
switch (
|
|
341
|
+
const { type: e } = t.data;
|
|
342
|
+
switch (e) {
|
|
342
343
|
case "pause":
|
|
343
344
|
case "disableSpin":
|
|
344
345
|
this.send("freeze");
|
|
@@ -358,127 +359,127 @@ class Vi extends Q {
|
|
|
358
359
|
});
|
|
359
360
|
}
|
|
360
361
|
registerFromSdkEvents() {
|
|
361
|
-
let
|
|
362
|
-
this.on("openGameResponse", (
|
|
363
|
-
let
|
|
362
|
+
let t = 0;
|
|
363
|
+
this.on("openGameResponse", (e) => {
|
|
364
|
+
let a;
|
|
364
365
|
try {
|
|
365
|
-
const
|
|
366
|
-
JSON.parse(atob(this.
|
|
367
|
-
),
|
|
368
|
-
|
|
369
|
-
ClientToken:
|
|
370
|
-
CurrencyCode:
|
|
371
|
-
PlayerTokenId:
|
|
372
|
-
SessionData:
|
|
366
|
+
const n = JSON.parse(
|
|
367
|
+
JSON.parse(atob(this.sdkConfig.api.integrationData.token.split(".")[1])).token
|
|
368
|
+
), r = JSON.parse(n.integrationSpecificAttributes.sessionData || "{}");
|
|
369
|
+
a = {
|
|
370
|
+
ClientToken: n.integrationSpecificAttributes.clientToken,
|
|
371
|
+
CurrencyCode: n.currency,
|
|
372
|
+
PlayerTokenId: n.user,
|
|
373
|
+
SessionData: r
|
|
373
374
|
};
|
|
374
375
|
} catch {
|
|
375
|
-
|
|
376
|
+
a = void 0;
|
|
376
377
|
}
|
|
377
378
|
this.postMessage("gameDataLoaded", {
|
|
378
|
-
LoadGameData:
|
|
379
|
+
LoadGameData: a,
|
|
379
380
|
success: !0
|
|
380
381
|
});
|
|
381
382
|
try {
|
|
382
|
-
const
|
|
383
|
-
this.processInfoUiMessages(
|
|
383
|
+
const n = Ge(e.contract.uiMessages);
|
|
384
|
+
this.processInfoUiMessages(n);
|
|
384
385
|
} catch {
|
|
385
386
|
}
|
|
386
|
-
}), this.on("balance", ({ balance:
|
|
387
|
-
|
|
388
|
-
amount: this.coinsToCurrency(
|
|
387
|
+
}), this.on("balance", ({ balance: e }) => {
|
|
388
|
+
t !== e && (t = e, this.postMessage("balance", {
|
|
389
|
+
amount: this.coinsToCurrency(e)
|
|
389
390
|
}));
|
|
390
391
|
}), this.on("close", () => {
|
|
391
|
-
if (this.
|
|
392
|
-
if (this.
|
|
392
|
+
if (this.sdkConfig.api.homeUrl)
|
|
393
|
+
if (this.sdkConfig.api.homeUrl === "(back)")
|
|
393
394
|
try {
|
|
394
395
|
window.top.history.back();
|
|
395
396
|
} catch {
|
|
396
397
|
window.history.back();
|
|
397
398
|
}
|
|
398
399
|
else
|
|
399
|
-
this.
|
|
400
|
-
}), this.on("playEnd", (
|
|
400
|
+
this.sdkConfig.api.homeUrl === "(api)" ? this.postMessage("quit") : Ve(this.sdkConfig.api.homeUrl);
|
|
401
|
+
}), this.on("playEnd", (e) => {
|
|
401
402
|
this.postMessage("roundEnded", {
|
|
402
|
-
balanceAfter: this.coinsToCurrency(
|
|
403
|
-
win: this.coinsToCurrency(
|
|
403
|
+
balanceAfter: this.coinsToCurrency(e.contract.balance.coins),
|
|
404
|
+
win: this.coinsToCurrency(e.contract.win.round)
|
|
404
405
|
});
|
|
405
406
|
try {
|
|
406
|
-
const
|
|
407
|
-
this.processInfoUiMessages(
|
|
407
|
+
const a = Ge(e.contract.uiMessages);
|
|
408
|
+
this.processInfoUiMessages(a);
|
|
408
409
|
} catch {
|
|
409
410
|
}
|
|
410
|
-
}), this.on("playError", (
|
|
411
|
-
var
|
|
411
|
+
}), this.on("playError", (e) => {
|
|
412
|
+
var a, n;
|
|
412
413
|
this.postMessage("ticketReceived", {
|
|
413
414
|
// TODO: Operator specific error code and message
|
|
414
|
-
ErrorCode: (
|
|
415
|
+
ErrorCode: (a = e.data) == null ? void 0 : a.code,
|
|
415
416
|
ErrorMessage: "ERROR",
|
|
416
417
|
Status: {
|
|
417
|
-
ErrCode: (
|
|
418
|
+
ErrCode: (n = e.data) == null ? void 0 : n.code
|
|
418
419
|
}
|
|
419
420
|
});
|
|
420
|
-
}), this.on("playResponse", (
|
|
421
|
+
}), this.on("playResponse", (e) => {
|
|
421
422
|
this.postMessage("roundStarted", {
|
|
422
423
|
balanceBefore: this.coinsToCurrency(
|
|
423
|
-
|
|
424
|
+
e.contract.balance.coins + e.contract.bet.lastPaid.base * e.contract.bet.lastPaid.multiplier
|
|
424
425
|
)
|
|
425
426
|
});
|
|
426
|
-
const
|
|
427
|
+
const a = ["BaseGame", "PaidSpin"].includes(e.contract.stateType.thisRound), n = $t(e.contract.uiMessages), r = Ge(e.contract.uiMessages), s = jt(n), h = Qt(n);
|
|
427
428
|
this.postMessage("ticketReceived", {
|
|
428
|
-
Balance: this.coinsToCurrency(
|
|
429
|
-
BetAmount:
|
|
429
|
+
Balance: this.coinsToCurrency(e.contract.balance.coins),
|
|
430
|
+
BetAmount: a ? this.coinsToCurrency(e.contract.bet.lastPaid.base * e.contract.bet.lastPaid.multiplier) : 0,
|
|
430
431
|
CreditTransactionId: s.betId,
|
|
431
432
|
DebitTransactionId: s.winId,
|
|
432
|
-
Message:
|
|
433
|
+
Message: r,
|
|
433
434
|
SessionData: h,
|
|
434
435
|
Status: {
|
|
435
436
|
ErrCode: 0
|
|
436
437
|
},
|
|
437
|
-
WinAmount: this.coinsToCurrency(
|
|
438
|
+
WinAmount: this.coinsToCurrency(e.contract.win.round)
|
|
438
439
|
});
|
|
439
|
-
}), this.on("playStart", (
|
|
440
|
-
|
|
441
|
-
totalBet: this.coinsToCurrency(
|
|
440
|
+
}), this.on("playStart", (e) => {
|
|
441
|
+
e.bet && this.postMessage("roundStart", {
|
|
442
|
+
totalBet: this.coinsToCurrency(e.bet.base * e.bet.multiplier)
|
|
442
443
|
});
|
|
443
444
|
}), this.on("loadEnd", () => {
|
|
444
445
|
this.postMessage("gameReady");
|
|
445
446
|
}), this.on("loadStart", () => {
|
|
446
447
|
this.postMessage("onAppFrameReady");
|
|
447
448
|
}), this.on("cashier", () => {
|
|
448
|
-
this.
|
|
449
|
+
this.sdkConfig.api.cashierUrl && (this.sdkConfig.api.cashierUrl === "(api)" ? this.postMessage("cashier") : Ve(this.sdkConfig.api.cashierUrl));
|
|
449
450
|
});
|
|
450
451
|
}
|
|
451
452
|
}
|
|
452
|
-
const
|
|
453
|
-
class
|
|
454
|
-
constructor(...
|
|
455
|
-
super(...
|
|
453
|
+
const ge = U("RelaxFEIMPlugin", "color:#000000;font-weight:bold;");
|
|
454
|
+
class Hi extends j {
|
|
455
|
+
constructor(...e) {
|
|
456
|
+
super(...e);
|
|
456
457
|
b(this, "VERSION", "1.15.0");
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
|
|
458
|
+
const a = document.createElement("script");
|
|
459
|
+
a.src = `https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`, a.onload = () => {
|
|
460
|
+
ge("loaded"), window.FEIM.configure({
|
|
460
461
|
p2pConfig: {
|
|
461
|
-
currency: this.
|
|
462
|
+
currency: this.sdkConfig.api.currency,
|
|
462
463
|
launchParams: {
|
|
463
464
|
// unified with KalambaSdkConfig
|
|
464
465
|
homeurl: "homeUrl"
|
|
465
466
|
}
|
|
466
467
|
}
|
|
467
|
-
}),
|
|
468
|
-
}, document.body.appendChild(
|
|
468
|
+
}), ge("configured"), this.registerToSdkEvents(), this.registerFromSdkEvents();
|
|
469
|
+
}, document.body.appendChild(a);
|
|
469
470
|
}
|
|
470
471
|
registerToSdkEvents() {
|
|
471
|
-
window.FEIM.on.errorMessageDismissed(() => this.send("unfreeze")), window.FEIM.on.errorMessageDisplayed(() => this.send("freeze")), window.FEIM.on.exitingGame(() =>
|
|
472
|
+
window.FEIM.on.errorMessageDismissed(() => this.send("unfreeze")), window.FEIM.on.errorMessageDisplayed(() => this.send("freeze")), window.FEIM.on.exitingGame(() => ge("!!! NOT IMPLEMENTED: exitingGame !!!")), window.FEIM.on.freeze(() => this.send("freeze")), window.FEIM.on.initialized(() => ge("!!! NOT IMPLEMENTED: initialized !!!")), window.FEIM.on.pauseAutoPlay(() => this.send("suspend")), window.FEIM.on.refreshBalance(() => ge("!!! NOT IMPLEMENTED: refreshBalance !!!")), window.FEIM.on.toggleGameHelp(() => {
|
|
472
473
|
this.send("help", {});
|
|
473
474
|
}), window.FEIM.on.togglePaytable(() => {
|
|
474
475
|
this.send("paytable", {});
|
|
475
476
|
}), window.FEIM.on.unfreeze(() => this.send("unfreeze")), window.FEIM.on.updateSettings(
|
|
476
|
-
({ payload: [
|
|
477
|
+
({ payload: [e] }) => this.send("settings", { sounds: e.sounds, fastPlay: e.fastPlay })
|
|
477
478
|
);
|
|
478
479
|
}
|
|
479
480
|
registerFromSdkEvents() {
|
|
480
|
-
this.on("autoplay", ({ action:
|
|
481
|
-
switch (
|
|
481
|
+
this.on("autoplay", ({ action: e }) => {
|
|
482
|
+
switch (e) {
|
|
482
483
|
case "start":
|
|
483
484
|
window.FEIM.send.autoPlayStarted();
|
|
484
485
|
break;
|
|
@@ -486,71 +487,71 @@ class zi extends Q {
|
|
|
486
487
|
window.FEIM.send.autoPlayFinished();
|
|
487
488
|
break;
|
|
488
489
|
}
|
|
489
|
-
}), this.on("balance", ({ balance:
|
|
490
|
-
window.FEIM.send.balanceUpdate(
|
|
491
|
-
}), this.on("bet", ({ base:
|
|
492
|
-
window.FEIM.send.betUpdate(
|
|
493
|
-
}), this.on("error", ({ message:
|
|
494
|
-
window.FEIM.send.errorMessage(
|
|
490
|
+
}), this.on("balance", ({ balance: e }) => {
|
|
491
|
+
window.FEIM.send.balanceUpdate(e);
|
|
492
|
+
}), this.on("bet", ({ base: e, multiplier: a }) => {
|
|
493
|
+
window.FEIM.send.betUpdate(e * a);
|
|
494
|
+
}), this.on("error", ({ message: e }) => {
|
|
495
|
+
window.FEIM.send.errorMessage(e);
|
|
495
496
|
}), this.on("close", () => {
|
|
496
497
|
window.FEIM.send.exitGame();
|
|
497
498
|
}), this.on("loadEnd", () => {
|
|
498
499
|
window.FEIM.send.gameLoadCompleted();
|
|
499
|
-
}), this.on("loadProgress", ({ progress:
|
|
500
|
-
window.FEIM.send.gameLoadProgress(
|
|
500
|
+
}), this.on("loadProgress", ({ progress: e }) => {
|
|
501
|
+
window.FEIM.send.gameLoadProgress(e);
|
|
501
502
|
}), this.on("loadStart", () => {
|
|
502
503
|
window.FEIM.send.gameLoadStarted();
|
|
503
504
|
}), this.on("cashier", () => {
|
|
504
505
|
window.FEIM.send.openQuickDeposit();
|
|
505
|
-
}), this.on("playCycleEnd", (
|
|
506
|
-
const
|
|
507
|
-
balance:
|
|
508
|
-
bet:
|
|
506
|
+
}), this.on("playCycleEnd", (e) => {
|
|
507
|
+
const a = {
|
|
508
|
+
balance: e.contract.balance.coins,
|
|
509
|
+
bet: e.contract.bet.lastPaid.base * e.contract.bet.lastPaid.multiplier,
|
|
509
510
|
win: {
|
|
510
|
-
win:
|
|
511
|
+
win: e.contract.win.total
|
|
511
512
|
}
|
|
512
513
|
};
|
|
513
|
-
window.FEIM.send.roundFinished(
|
|
514
|
-
}), this.on("playResponse", (
|
|
515
|
-
const
|
|
516
|
-
balance:
|
|
517
|
-
playResponse:
|
|
514
|
+
window.FEIM.send.roundFinished(a);
|
|
515
|
+
}), this.on("playResponse", (e) => {
|
|
516
|
+
const a = {
|
|
517
|
+
balance: e.contract.balance.coins,
|
|
518
|
+
playResponse: e.data
|
|
518
519
|
};
|
|
519
|
-
window.FEIM.send.roundStarted(
|
|
520
|
+
window.FEIM.send.roundStarted(a);
|
|
520
521
|
}), this.on("history", () => {
|
|
521
522
|
window.FEIM.send.showHistory();
|
|
522
|
-
}), this.on("settings", (
|
|
523
|
-
window.FEIM.send.updateSettings(
|
|
523
|
+
}), this.on("settings", (e) => {
|
|
524
|
+
window.FEIM.send.updateSettings(e);
|
|
524
525
|
});
|
|
525
526
|
}
|
|
526
527
|
}
|
|
527
|
-
const
|
|
528
|
-
class
|
|
529
|
-
constructor(...
|
|
530
|
-
super(...
|
|
528
|
+
const We = U("TukoPlugin", "color:#000000;font-weight:bold;");
|
|
529
|
+
class Vi extends j {
|
|
530
|
+
constructor(...e) {
|
|
531
|
+
super(...e);
|
|
531
532
|
b(this, "PING_INTERVAL", 1e4);
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
this.ping(
|
|
535
|
-
}, this.PING_INTERVAL), this.registerToSdkEvents(), this.registerFromSdkEvents(),
|
|
533
|
+
const n = new URLSearchParams(window.location.search).get("pingCallbackUrl");
|
|
534
|
+
n && window.setInterval(() => {
|
|
535
|
+
this.ping(n);
|
|
536
|
+
}, this.PING_INTERVAL), this.registerToSdkEvents(), this.registerFromSdkEvents(), We("configured");
|
|
536
537
|
}
|
|
537
|
-
ping(
|
|
538
|
-
const
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
},
|
|
538
|
+
ping(e) {
|
|
539
|
+
const a = new XMLHttpRequest();
|
|
540
|
+
a.onreadystatechange = function() {
|
|
541
|
+
a.readyState === XMLHttpRequest.DONE && (a.status === 0 || a.status >= 200 && a.status < 400 ? We("ping ok", a) : We("ping error", a));
|
|
542
|
+
}, a.open("GET", e), a.send();
|
|
542
543
|
}
|
|
543
544
|
registerToSdkEvents() {
|
|
544
|
-
window.addEventListener("message", (
|
|
545
|
+
window.addEventListener("message", (e) => {
|
|
545
546
|
try {
|
|
546
|
-
const { type:
|
|
547
|
-
switch (
|
|
547
|
+
const { type: a, payload: n } = e.data;
|
|
548
|
+
switch (a) {
|
|
548
549
|
case "doAudioSettings":
|
|
549
|
-
this.send("settings", { music:
|
|
550
|
+
this.send("settings", { music: n == null ? void 0 : n.musicEnabled, sounds: n == null ? void 0 : n.soundEnabled });
|
|
550
551
|
return;
|
|
551
552
|
case "doBalanceUpdate":
|
|
552
|
-
const { currency:
|
|
553
|
-
|
|
553
|
+
const { currency: r, coinValueInCents: s } = this.sdkConfig.api;
|
|
554
|
+
n.currency === r && typeof n.balanceInCurrency == "number" ? this.send("balance", { balance: Bt(n.balanceInCurrency, s) }) : (n.balanceInCoins, this.send("balance", { balance: n.balanceInCoins }));
|
|
554
555
|
return;
|
|
555
556
|
case "doGamePause":
|
|
556
557
|
this.send("freeze");
|
|
@@ -570,11 +571,11 @@ class Gi extends Q {
|
|
|
570
571
|
}
|
|
571
572
|
registerFromSdkEvents() {
|
|
572
573
|
this.on("close", () => {
|
|
573
|
-
if (this.
|
|
574
|
+
if (this.sdkConfig.api.homeUrl)
|
|
574
575
|
try {
|
|
575
|
-
window.top.location = this.
|
|
576
|
+
window.top.location = this.sdkConfig.api.homeUrl;
|
|
576
577
|
} catch {
|
|
577
|
-
window.location = this.
|
|
578
|
+
window.location = this.sdkConfig.api.homeUrl;
|
|
578
579
|
}
|
|
579
580
|
else
|
|
580
581
|
try {
|
|
@@ -585,26 +586,27 @@ class Gi extends Q {
|
|
|
585
586
|
});
|
|
586
587
|
}
|
|
587
588
|
}
|
|
588
|
-
class
|
|
589
|
-
constructor(e) {
|
|
589
|
+
class Xt {
|
|
590
|
+
constructor(t, e) {
|
|
590
591
|
b(this, "config");
|
|
591
|
-
this
|
|
592
|
+
b(this, "sdkConfig");
|
|
593
|
+
this.config = t, this.sdkConfig = e;
|
|
592
594
|
}
|
|
593
|
-
on(
|
|
594
|
-
const
|
|
595
|
-
s.data.message !== `kalamba:wrapper-rgs:${
|
|
595
|
+
on(t, e, a) {
|
|
596
|
+
const n = function(s) {
|
|
597
|
+
s.data.message !== `kalamba:wrapper-rgs:${t}` && s.data.message !== `kalamba:wrapper:${t}` || e(s.data.payload);
|
|
596
598
|
};
|
|
597
|
-
window.addEventListener("message",
|
|
599
|
+
window.addEventListener("message", n, a);
|
|
598
600
|
}
|
|
599
|
-
send(
|
|
601
|
+
send(t, ...[e]) {
|
|
600
602
|
window.postMessage({
|
|
601
|
-
message: `kalamba:rgs:${
|
|
602
|
-
payload:
|
|
603
|
+
message: `kalamba:rgs:${t}`,
|
|
604
|
+
payload: e
|
|
603
605
|
});
|
|
604
606
|
}
|
|
605
607
|
}
|
|
606
608
|
class Kt {
|
|
607
|
-
constructor(
|
|
609
|
+
constructor(t) {
|
|
608
610
|
b(this, "socket", null);
|
|
609
611
|
b(this, "webSocketUrl");
|
|
610
612
|
b(this, "eventListeners", {
|
|
@@ -613,88 +615,83 @@ class Kt {
|
|
|
613
615
|
message: []
|
|
614
616
|
});
|
|
615
617
|
b(this, "connect", () => {
|
|
616
|
-
const
|
|
617
|
-
return
|
|
618
|
-
|
|
619
|
-
this.handleOpen(
|
|
618
|
+
const t = new WebSocket(this.webSocketUrl);
|
|
619
|
+
return t.addEventListener("message", this.handleMessage), new Promise((e) => {
|
|
620
|
+
t.addEventListener("open", (a) => {
|
|
621
|
+
this.handleOpen(a), e(this.socket);
|
|
620
622
|
});
|
|
621
623
|
});
|
|
622
624
|
});
|
|
623
|
-
b(this, "send", (
|
|
625
|
+
b(this, "send", (t) => {
|
|
624
626
|
if (this.socket == null)
|
|
625
627
|
throw new Error("Cannot send message, the WebSocket connection is not open");
|
|
626
|
-
this.socket.send(
|
|
628
|
+
this.socket.send(t);
|
|
627
629
|
});
|
|
628
630
|
b(this, "close", () => {
|
|
629
631
|
if (this.socket == null)
|
|
630
632
|
throw new Error("Cannot close the WebSocket connection that is not open");
|
|
631
|
-
this.socket.close(), this.addEventListener("error", (
|
|
632
|
-
console.log(
|
|
633
|
+
this.socket.close(), this.addEventListener("error", (t) => {
|
|
634
|
+
console.log(t);
|
|
633
635
|
});
|
|
634
636
|
});
|
|
635
|
-
b(this, "handleClose", (
|
|
636
|
-
this.eventListeners.close.forEach((
|
|
637
|
-
t
|
|
637
|
+
b(this, "handleClose", (t) => {
|
|
638
|
+
this.eventListeners.close.forEach((e) => {
|
|
639
|
+
e(t);
|
|
638
640
|
});
|
|
639
641
|
});
|
|
640
|
-
b(this, "handleError", (
|
|
641
|
-
this.eventListeners.error.forEach((
|
|
642
|
-
t
|
|
642
|
+
b(this, "handleError", (t) => {
|
|
643
|
+
this.eventListeners.error.forEach((e) => {
|
|
644
|
+
e(t);
|
|
643
645
|
});
|
|
644
646
|
});
|
|
645
|
-
b(this, "handleMessage", (
|
|
646
|
-
this.eventListeners.message.forEach((
|
|
647
|
-
t
|
|
647
|
+
b(this, "handleMessage", (t) => {
|
|
648
|
+
this.eventListeners.message.forEach((e) => {
|
|
649
|
+
e(t);
|
|
648
650
|
});
|
|
649
651
|
});
|
|
650
|
-
b(this, "handleOpen", (
|
|
651
|
-
const
|
|
652
|
-
|
|
652
|
+
b(this, "handleOpen", (t) => {
|
|
653
|
+
const e = t.target;
|
|
654
|
+
e.addEventListener("close", this.handleClose), e.addEventListener("error", this.handleError), this.socket = e;
|
|
653
655
|
});
|
|
654
|
-
this.webSocketUrl =
|
|
656
|
+
this.webSocketUrl = t;
|
|
655
657
|
}
|
|
656
|
-
addEventListener(
|
|
657
|
-
this.eventListeners[
|
|
658
|
+
addEventListener(t, e) {
|
|
659
|
+
this.eventListeners[t].push(e);
|
|
658
660
|
}
|
|
659
|
-
removeEventListener(
|
|
660
|
-
const
|
|
661
|
-
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
function Ae(i) {
|
|
665
|
-
try {
|
|
666
|
-
return JSON.parse(i == null ? void 0 : i.data);
|
|
667
|
-
} catch (e) {
|
|
668
|
-
return console.error("fakap", e), null;
|
|
661
|
+
removeEventListener(t, e) {
|
|
662
|
+
const a = this.eventListeners[t].indexOf(e);
|
|
663
|
+
a !== -1 && this.eventListeners[t].splice(a, 1);
|
|
669
664
|
}
|
|
670
665
|
}
|
|
671
|
-
function
|
|
672
|
-
|
|
673
|
-
return ((e = i == null ? void 0 : i.header) == null ? void 0 : e.name) === "GameEvent";
|
|
666
|
+
function Me(i) {
|
|
667
|
+
return JSON.parse(i == null ? void 0 : i.data);
|
|
674
668
|
}
|
|
675
669
|
function Jt(i) {
|
|
676
|
-
|
|
670
|
+
var t;
|
|
671
|
+
return ((t = i == null ? void 0 : i.header) == null ? void 0 : t.name) === "Ping";
|
|
677
672
|
}
|
|
678
|
-
function
|
|
679
|
-
|
|
673
|
+
function lt(i) {
|
|
674
|
+
var t;
|
|
675
|
+
return ((t = i == null ? void 0 : i.header) == null ? void 0 : t.name) === "RealityCheck";
|
|
680
676
|
}
|
|
681
|
-
function
|
|
682
|
-
return
|
|
677
|
+
function Le(i) {
|
|
678
|
+
return i.header.name === "GameEvent";
|
|
683
679
|
}
|
|
684
|
-
function
|
|
685
|
-
|
|
686
|
-
return ((e = i == null ? void 0 : i.header) == null ? void 0 : e.name) === "Ping";
|
|
680
|
+
function Yt(i) {
|
|
681
|
+
return Le(i) && i.body.event === "OPEN_GAME";
|
|
687
682
|
}
|
|
688
|
-
function
|
|
689
|
-
|
|
690
|
-
return ((e = i == null ? void 0 : i.header) == null ? void 0 : e.name) === "RealityCheck";
|
|
683
|
+
function ut(i) {
|
|
684
|
+
return i.header.code !== 1;
|
|
691
685
|
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
686
|
+
function Zt(i) {
|
|
687
|
+
return Le(i) && i.body.event.includes("_RESULT");
|
|
688
|
+
}
|
|
689
|
+
var ie, ve;
|
|
690
|
+
class ei extends Kt {
|
|
691
|
+
constructor(e, a) {
|
|
692
|
+
const n = new URL(e.apiUrl);
|
|
693
|
+
n.searchParams.set("cageCode", e.cageCode), n.searchParams.set("gameCode", e.gameCode), n.searchParams.set("operatorCode", e.operatorCode), n.searchParams.set("playMode", e.playMode), n.searchParams.set("token", e.token), n.searchParams.set("username", e.username);
|
|
694
|
+
super(n.toString());
|
|
698
695
|
/*
|
|
699
696
|
* Correlation ID. Used in Request and Response types.
|
|
700
697
|
* ----
|
|
@@ -724,119 +721,125 @@ class ii extends Kt {
|
|
|
724
721
|
*/
|
|
725
722
|
b(this, "seqId", 10);
|
|
726
723
|
b(this, "gameCode");
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
b(this, "onMessage", (
|
|
730
|
-
const
|
|
731
|
-
(
|
|
724
|
+
C(this, ie, void 0);
|
|
725
|
+
C(this, ve, void 0);
|
|
726
|
+
b(this, "onMessage", (e) => {
|
|
727
|
+
const a = Me(e);
|
|
728
|
+
(Le(a) || Jt(a) || lt(a)) && this.sendAcknowledgement(a), lt(a) && this.handleRealityCheck(a);
|
|
732
729
|
});
|
|
733
|
-
this.eventListeners.realityCheck = [], this.gameCode =
|
|
730
|
+
this.eventListeners.realityCheck = [], this.gameCode = e.gameCode, v(this, ie, a.requestTimeoutMs), v(this, ve, a.gameVersion ?? "unknown"), this.addEventListener("message", this.onMessage);
|
|
734
731
|
}
|
|
735
|
-
handleRealityCheck(
|
|
736
|
-
this.eventListeners.realityCheck.forEach((
|
|
737
|
-
|
|
732
|
+
handleRealityCheck(e) {
|
|
733
|
+
this.eventListeners.realityCheck.forEach((a) => {
|
|
734
|
+
a(e.body);
|
|
738
735
|
});
|
|
739
736
|
}
|
|
740
|
-
addEventListener(
|
|
741
|
-
super.addEventListener(
|
|
737
|
+
addEventListener(e, a) {
|
|
738
|
+
super.addEventListener(e, a);
|
|
742
739
|
}
|
|
743
|
-
removeEventListener(
|
|
744
|
-
super.removeEventListener(
|
|
740
|
+
removeEventListener(e, a) {
|
|
741
|
+
super.removeEventListener(e, a);
|
|
745
742
|
}
|
|
746
|
-
buildHeader(
|
|
743
|
+
buildHeader(e, a = null) {
|
|
747
744
|
return {
|
|
748
745
|
// Assign new cId if it is not provided
|
|
749
|
-
cId:
|
|
750
|
-
code:
|
|
746
|
+
cId: a ?? ++this.cId,
|
|
747
|
+
code: a !== null ? 1 : void 0,
|
|
751
748
|
mId: ++this.mId,
|
|
752
|
-
name:
|
|
749
|
+
name: e
|
|
753
750
|
};
|
|
754
751
|
}
|
|
755
752
|
// TODO infer body from header
|
|
756
|
-
buildPayload(
|
|
753
|
+
buildPayload(e, a) {
|
|
757
754
|
return JSON.stringify({
|
|
758
|
-
body:
|
|
759
|
-
header:
|
|
755
|
+
body: a,
|
|
756
|
+
header: e
|
|
760
757
|
});
|
|
761
758
|
}
|
|
762
|
-
getBodyExtras(
|
|
759
|
+
getBodyExtras(e) {
|
|
763
760
|
return {
|
|
764
|
-
action:
|
|
761
|
+
action: e,
|
|
765
762
|
seqId: ++this.seqId
|
|
766
763
|
};
|
|
767
764
|
}
|
|
768
|
-
request(
|
|
769
|
-
const
|
|
770
|
-
return new Promise((
|
|
771
|
-
setTimeout(() => s({ type: "timeout" }),
|
|
765
|
+
request(e, a) {
|
|
766
|
+
const n = this.buildPayload(e, a);
|
|
767
|
+
return new Promise((r, s) => {
|
|
768
|
+
setTimeout(() => s({ type: "timeout" }), y(this, ie));
|
|
772
769
|
const h = (g) => {
|
|
773
|
-
const w =
|
|
770
|
+
const w = Me(g);
|
|
774
771
|
try {
|
|
775
|
-
|
|
772
|
+
e.cId === w.header.cId && (this.removeEventListener("message", h), w.header.code === 1 ? r(w) : s({ message: w, type: "error" }));
|
|
776
773
|
} catch {
|
|
777
|
-
s({
|
|
774
|
+
s({ message: w, type: "error" });
|
|
778
775
|
}
|
|
779
776
|
};
|
|
780
|
-
this.addEventListener("message", h), this.send(
|
|
777
|
+
this.addEventListener("message", h), this.send(n);
|
|
781
778
|
});
|
|
782
779
|
}
|
|
783
|
-
activateFreeRound(
|
|
784
|
-
const
|
|
780
|
+
activateFreeRound(e) {
|
|
781
|
+
const a = this.buildHeader("ActivateFreeRound");
|
|
785
782
|
return this.request(
|
|
786
|
-
|
|
787
|
-
|
|
783
|
+
a,
|
|
784
|
+
e
|
|
788
785
|
);
|
|
789
786
|
}
|
|
790
|
-
authenticate(
|
|
791
|
-
const
|
|
787
|
+
authenticate(e = !1) {
|
|
788
|
+
const a = this.buildHeader("Authenticate"), n = {
|
|
792
789
|
clientType: 3,
|
|
793
|
-
version:
|
|
794
|
-
reconnect:
|
|
790
|
+
version: y(this, ve),
|
|
791
|
+
reconnect: e
|
|
795
792
|
};
|
|
796
|
-
return this.request(
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
)
|
|
793
|
+
return this.request(a, n).then((r) => r.body).catch((r) => {
|
|
794
|
+
var s;
|
|
795
|
+
throw { data: (s = r == null ? void 0 : r.message) == null ? void 0 : s.body, type: r.type };
|
|
796
|
+
});
|
|
800
797
|
}
|
|
801
798
|
openGame() {
|
|
802
|
-
const
|
|
799
|
+
const e = this.buildHeader("OpenGame"), a = {
|
|
803
800
|
gameCode: this.gameCode
|
|
804
801
|
};
|
|
805
|
-
return new Promise((
|
|
802
|
+
return new Promise((n, r) => {
|
|
806
803
|
const s = (h) => {
|
|
807
|
-
const g =
|
|
808
|
-
|
|
804
|
+
const g = Me(h);
|
|
805
|
+
Yt(g) ? (this.removeEventListener("message", s), n(g.body)) : ut(g) && r({ data: g.body, type: "error" });
|
|
809
806
|
};
|
|
810
|
-
this.addEventListener("message", s), this.request(
|
|
811
|
-
|
|
812
|
-
|
|
807
|
+
this.addEventListener("message", s), this.request(e, a).catch(
|
|
808
|
+
(h) => {
|
|
809
|
+
var g;
|
|
810
|
+
return r({ data: (g = h == null ? void 0 : h.message) == null ? void 0 : g.body, type: h.type });
|
|
811
|
+
}
|
|
812
|
+
);
|
|
813
813
|
});
|
|
814
814
|
}
|
|
815
|
-
sendAcknowledgement(
|
|
816
|
-
const { name:
|
|
815
|
+
sendAcknowledgement(e) {
|
|
816
|
+
const { name: a, cId: n } = e.header, r = this.buildHeader(a, n), s = this.buildPayload(r, {});
|
|
817
817
|
this.send(s);
|
|
818
818
|
}
|
|
819
|
-
sendAction(
|
|
820
|
-
const
|
|
821
|
-
...this.getBodyExtras(
|
|
822
|
-
data:
|
|
819
|
+
sendAction(e, a) {
|
|
820
|
+
const n = this.buildHeader("GameAction"), r = {
|
|
821
|
+
...this.getBodyExtras(e),
|
|
822
|
+
data: a
|
|
823
823
|
};
|
|
824
824
|
return new Promise((s, h) => {
|
|
825
825
|
const g = (w) => {
|
|
826
|
-
const
|
|
827
|
-
|
|
826
|
+
const p = Me(w);
|
|
827
|
+
Le(p) && r.seqId === p.body.correlationSeqId && (this.removeEventListener("message", g), Zt(p) ? s(p.body) : ut(p) && h({ data: p.body, type: "error" }));
|
|
828
828
|
};
|
|
829
|
-
this.addEventListener("message", g), this.request(
|
|
830
|
-
(w) =>
|
|
829
|
+
this.addEventListener("message", g), this.request(n, r).catch(
|
|
830
|
+
(w) => {
|
|
831
|
+
var p;
|
|
832
|
+
return h({ data: (p = w == null ? void 0 : w.message) == null ? void 0 : p.body, type: w.type });
|
|
833
|
+
}
|
|
831
834
|
);
|
|
832
835
|
});
|
|
833
836
|
}
|
|
834
|
-
setRequestTimeoutMs(
|
|
835
|
-
|
|
837
|
+
setRequestTimeoutMs(e) {
|
|
838
|
+
v(this, ie, e);
|
|
836
839
|
}
|
|
837
840
|
}
|
|
838
|
-
|
|
839
|
-
function
|
|
841
|
+
ie = new WeakMap(), ve = new WeakMap();
|
|
842
|
+
function ti(i) {
|
|
840
843
|
return i.contract ? {
|
|
841
844
|
contract: {
|
|
842
845
|
balance: {
|
|
@@ -865,126 +868,102 @@ function ni(i) {
|
|
|
865
868
|
}
|
|
866
869
|
};
|
|
867
870
|
}
|
|
868
|
-
function
|
|
869
|
-
|
|
870
|
-
switch (t) {
|
|
871
|
-
case 2:
|
|
872
|
-
return { code: U.DENIED };
|
|
873
|
-
case 3:
|
|
874
|
-
return { code: U.NOT_FOUND };
|
|
875
|
-
case 4:
|
|
876
|
-
return { code: U.ALREADY_LOGGED_IN };
|
|
877
|
-
case 5:
|
|
878
|
-
default:
|
|
879
|
-
return { code: U.ERROR };
|
|
880
|
-
}
|
|
881
|
-
};
|
|
871
|
+
function ii(i) {
|
|
872
|
+
var t, e;
|
|
882
873
|
return {
|
|
883
|
-
|
|
884
|
-
|
|
874
|
+
// SDK error codes are the same as RGS error codes so we don't need any mapping here
|
|
875
|
+
code: ((t = i.data) == null ? void 0 : t.code) ?? Ne.UNKNOWN,
|
|
876
|
+
details: (e = i.data) == null ? void 0 : e.details
|
|
885
877
|
};
|
|
886
878
|
}
|
|
887
|
-
function
|
|
888
|
-
return
|
|
879
|
+
function ai(i, t) {
|
|
880
|
+
return t.contract ? {
|
|
889
881
|
contract: {
|
|
890
882
|
bet: {
|
|
891
|
-
available:
|
|
883
|
+
available: t.contract.availableMultipliersPerBaseBet,
|
|
892
884
|
default: {
|
|
893
|
-
base:
|
|
894
|
-
multiplier:
|
|
885
|
+
base: t.contract.defaultBet.baseBet,
|
|
886
|
+
multiplier: t.contract.defaultBet.betMultiplier
|
|
895
887
|
},
|
|
896
|
-
max:
|
|
897
|
-
last:
|
|
898
|
-
base:
|
|
899
|
-
multiplier:
|
|
888
|
+
max: t.contract.maxBetInCoins,
|
|
889
|
+
last: t.contract.lastBet ? {
|
|
890
|
+
base: t.contract.lastBet.baseBet,
|
|
891
|
+
multiplier: t.contract.lastBet.betMultiplier
|
|
900
892
|
} : null,
|
|
901
|
-
lastPaid:
|
|
902
|
-
base:
|
|
903
|
-
multiplier:
|
|
893
|
+
lastPaid: t.contract.lastMainGameBet ? {
|
|
894
|
+
base: t.contract.lastMainGameBet.baseBet,
|
|
895
|
+
multiplier: t.contract.lastMainGameBet.betMultiplier
|
|
904
896
|
} : null
|
|
905
897
|
},
|
|
906
898
|
balance: {
|
|
907
|
-
coins:
|
|
908
|
-
version:
|
|
899
|
+
coins: t.contract.balanceInCoins,
|
|
900
|
+
version: t.contract.balanceVersion
|
|
909
901
|
},
|
|
910
|
-
gameModel:
|
|
911
|
-
metaData:
|
|
912
|
-
roundId:
|
|
913
|
-
serverTime:
|
|
914
|
-
sessionId:
|
|
902
|
+
gameModel: t.contract.gameModelFile,
|
|
903
|
+
metaData: t.contract.metaData,
|
|
904
|
+
roundId: t.contract.roundId,
|
|
905
|
+
serverTime: t.contract.serverTime,
|
|
906
|
+
sessionId: t.contract.sessionId,
|
|
915
907
|
stateType: {
|
|
916
|
-
thisRound:
|
|
917
|
-
nextRound:
|
|
908
|
+
thisRound: t.contract.stateTypeThisRound,
|
|
909
|
+
nextRound: t.contract.stateTypeNextRound
|
|
918
910
|
},
|
|
919
|
-
uiMessages: i.contract.uiMessages.concat(
|
|
911
|
+
uiMessages: i.contract.uiMessages.concat(t.contract.uiMessages),
|
|
920
912
|
win: {
|
|
921
|
-
round:
|
|
922
|
-
total:
|
|
913
|
+
round: t.contract.roundWin,
|
|
914
|
+
total: t.contract.totalWin
|
|
923
915
|
}
|
|
924
916
|
},
|
|
925
|
-
data:
|
|
917
|
+
data: t.opaqueGameServerToUi
|
|
926
918
|
} : {
|
|
927
919
|
contract: {
|
|
928
920
|
bet: {
|
|
929
|
-
available:
|
|
921
|
+
available: t.data.additionalConfigData.availableMultipliersPerBaseBet,
|
|
930
922
|
default: {
|
|
931
|
-
base:
|
|
932
|
-
multiplier:
|
|
923
|
+
base: t.data.additionalConfigData.defaultBet.baseBet,
|
|
924
|
+
multiplier: t.data.additionalConfigData.defaultBet.betMultiplier
|
|
933
925
|
},
|
|
934
|
-
max:
|
|
935
|
-
last:
|
|
936
|
-
base:
|
|
937
|
-
multiplier:
|
|
926
|
+
max: t.data.additionalConfigData.maxAllowedOverallBetInCoins,
|
|
927
|
+
last: t.data.gameState.betFromCurrentRound ? {
|
|
928
|
+
base: t.data.gameState.betFromCurrentRound.baseBet,
|
|
929
|
+
multiplier: t.data.gameState.betFromCurrentRound.betMultiplier
|
|
938
930
|
} : null,
|
|
939
|
-
lastPaid:
|
|
940
|
-
base:
|
|
941
|
-
multiplier:
|
|
931
|
+
lastPaid: t.data.gameState.lastPlacedMainGameBet ? {
|
|
932
|
+
base: t.data.gameState.lastPlacedMainGameBet.baseBet,
|
|
933
|
+
multiplier: t.data.gameState.lastPlacedMainGameBet.betMultiplier
|
|
942
934
|
} : null
|
|
943
935
|
},
|
|
944
936
|
balance: {
|
|
945
|
-
coins:
|
|
946
|
-
version:
|
|
937
|
+
coins: t.balance,
|
|
938
|
+
version: t.balanceVersion
|
|
947
939
|
},
|
|
948
|
-
gameModel:
|
|
949
|
-
metaData:
|
|
950
|
-
roundId:
|
|
951
|
-
serverTime:
|
|
952
|
-
sessionId:
|
|
940
|
+
gameModel: t.data.additionalConfigData.gameModelFile,
|
|
941
|
+
metaData: t.data.gameConfigData.metaData,
|
|
942
|
+
roundId: t.data.gameState.cycleId,
|
|
943
|
+
serverTime: t.balanceVersion,
|
|
944
|
+
sessionId: t.data.gameState.sessionId,
|
|
953
945
|
stateType: {
|
|
954
|
-
thisRound:
|
|
955
|
-
nextRound:
|
|
946
|
+
thisRound: t.data.gameState.stateTypeThisRound,
|
|
947
|
+
nextRound: t.data.gameState.stateTypeNextRound
|
|
956
948
|
},
|
|
957
949
|
uiMessages: i.uiMessages,
|
|
958
950
|
win: {
|
|
959
|
-
round:
|
|
960
|
-
total:
|
|
951
|
+
round: t.data.gameState.totalWinFromCurrentRound,
|
|
952
|
+
total: t.data.gameState.totalWinFromCurrentGameCycle
|
|
961
953
|
}
|
|
962
954
|
},
|
|
963
|
-
data:
|
|
955
|
+
data: t.data
|
|
964
956
|
};
|
|
965
957
|
}
|
|
966
|
-
function
|
|
967
|
-
|
|
968
|
-
switch (t) {
|
|
969
|
-
case 2:
|
|
970
|
-
return { code: U.GAME_UNAVAILABLE };
|
|
971
|
-
case 3:
|
|
972
|
-
return { code: U.BONUS_RESTRICTION };
|
|
973
|
-
case 5:
|
|
974
|
-
return { code: U.TOO_MANY_OPEN_GAMES };
|
|
975
|
-
case 6:
|
|
976
|
-
return { code: U.RECONNECT_DATA_MISMATCH };
|
|
977
|
-
case 4:
|
|
978
|
-
default:
|
|
979
|
-
return { code: U.ERROR };
|
|
980
|
-
}
|
|
981
|
-
};
|
|
958
|
+
function ni(i) {
|
|
959
|
+
var t, e;
|
|
982
960
|
return {
|
|
983
|
-
|
|
984
|
-
|
|
961
|
+
// SDK error codes are the same as RGS error codes so we don't need any mapping here
|
|
962
|
+
code: ((t = i.data) == null ? void 0 : t.code) ?? Ne.UNKNOWN,
|
|
963
|
+
details: (e = i.data) == null ? void 0 : e.details
|
|
985
964
|
};
|
|
986
965
|
}
|
|
987
|
-
function
|
|
966
|
+
function si(i) {
|
|
988
967
|
return i.contract ? {
|
|
989
968
|
contract: {
|
|
990
969
|
bet: {
|
|
@@ -1045,32 +1024,15 @@ function ri(i) {
|
|
|
1045
1024
|
data: i.data
|
|
1046
1025
|
};
|
|
1047
1026
|
}
|
|
1048
|
-
function
|
|
1049
|
-
|
|
1050
|
-
switch (t) {
|
|
1051
|
-
case "GAMING_LIMITS_REACHED":
|
|
1052
|
-
return { code: W.GAMING_LIMITS_REACHED };
|
|
1053
|
-
case "INVALID_CURRENCY":
|
|
1054
|
-
return { code: W.INVALID_CURRENCY };
|
|
1055
|
-
case "INVALID_SESSION":
|
|
1056
|
-
return { code: W.INVALID_SESSION };
|
|
1057
|
-
case "OUT_OF_MONEY":
|
|
1058
|
-
return { code: W.OUT_OF_MONEY };
|
|
1059
|
-
case "UNFINISHED_ROUND_IN_PROGRESS":
|
|
1060
|
-
return { code: W.UNFINISHED_ROUND_IN_PROGRESS };
|
|
1061
|
-
case "WALLET_ERROR":
|
|
1062
|
-
return { code: W.WALLET_ERROR };
|
|
1063
|
-
case "ERROR":
|
|
1064
|
-
default:
|
|
1065
|
-
return { code: W.ERROR };
|
|
1066
|
-
}
|
|
1067
|
-
};
|
|
1027
|
+
function oi(i) {
|
|
1028
|
+
var t, e;
|
|
1068
1029
|
return {
|
|
1069
|
-
|
|
1070
|
-
|
|
1030
|
+
// SDK error codes are the same as RGS error codes so we don't need any mapping here
|
|
1031
|
+
code: ((t = i.data) == null ? void 0 : t.code) ?? Ne.UNKNOWN,
|
|
1032
|
+
details: (e = i.data) == null ? void 0 : e.details
|
|
1071
1033
|
};
|
|
1072
1034
|
}
|
|
1073
|
-
const
|
|
1035
|
+
const ri = {
|
|
1074
1036
|
bul: "bg",
|
|
1075
1037
|
chi: "zh",
|
|
1076
1038
|
zho: "zh",
|
|
@@ -1102,74 +1064,70 @@ const di = {
|
|
|
1102
1064
|
tur: "tr",
|
|
1103
1065
|
ukr: "uk",
|
|
1104
1066
|
vie: "vi"
|
|
1105
|
-
},
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
super(...t);
|
|
1067
|
+
}, ci = U("KalambaBullseyePlugin", "color:#000000;font-weight:bold;");
|
|
1068
|
+
class zi extends Xt {
|
|
1069
|
+
constructor(...e) {
|
|
1070
|
+
super(...e);
|
|
1110
1071
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1111
1072
|
// @ts-ignore
|
|
1112
1073
|
b(this, "socket");
|
|
1113
|
-
v(this, ke, "");
|
|
1114
1074
|
this.on("openGame", async () => {
|
|
1115
1075
|
try {
|
|
1116
|
-
const
|
|
1117
|
-
this.send("openGameResponse",
|
|
1118
|
-
} catch (
|
|
1119
|
-
this.send("openGameError",
|
|
1076
|
+
const a = await this.openGame();
|
|
1077
|
+
this.send("openGameResponse", a);
|
|
1078
|
+
} catch (a) {
|
|
1079
|
+
this.send("openGameError", a);
|
|
1120
1080
|
}
|
|
1121
|
-
}), this.on("play", async (
|
|
1081
|
+
}), this.on("play", async (a) => {
|
|
1122
1082
|
try {
|
|
1123
|
-
const
|
|
1124
|
-
this.send("playResponse",
|
|
1125
|
-
} catch (
|
|
1126
|
-
this.send("playError",
|
|
1083
|
+
const n = await this.play(a);
|
|
1084
|
+
this.send("playResponse", n);
|
|
1085
|
+
} catch (n) {
|
|
1086
|
+
this.send("playError", n);
|
|
1127
1087
|
}
|
|
1128
|
-
}), this.on("
|
|
1129
|
-
|
|
1130
|
-
}), this.on("configured", (n) => {
|
|
1131
|
-
this.socket.setRequestTimeoutMs(n.ui.requestTimeoutMs);
|
|
1088
|
+
}), this.on("configured", (a) => {
|
|
1089
|
+
this.socket.setRequestTimeoutMs(a.ui.requestTimeoutMs);
|
|
1132
1090
|
}), this.registerFromSdkEvents();
|
|
1133
1091
|
}
|
|
1134
|
-
initialize(
|
|
1135
|
-
this.socket = new
|
|
1136
|
-
gameVersion:
|
|
1137
|
-
requestTimeoutMs: this.
|
|
1138
|
-
}), this.socket.addEventListener("close", (
|
|
1139
|
-
|
|
1092
|
+
initialize(e) {
|
|
1093
|
+
this.socket = new ei(e, {
|
|
1094
|
+
gameVersion: this.config.gameVersion,
|
|
1095
|
+
requestTimeoutMs: this.sdkConfig.ui.requestTimeoutMs
|
|
1096
|
+
}), this.socket.addEventListener("close", (a) => {
|
|
1097
|
+
a.code === 1006 && this.reconnect(e);
|
|
1140
1098
|
}), document.addEventListener("visibilitychange", () => {
|
|
1141
|
-
document.visibilityState === "visible" && this.socket.socket && this.socket.socket.readyState !== WebSocket.OPEN && this.reconnect(
|
|
1142
|
-
}), this.socket.addEventListener("error", (
|
|
1143
|
-
this.send("realityCheck",
|
|
1099
|
+
document.visibilityState === "visible" && this.socket.socket && this.socket.socket.readyState !== WebSocket.OPEN && this.reconnect(e);
|
|
1100
|
+
}), this.socket.addEventListener("error", (a) => ci("error", a)), this.socket.addEventListener("realityCheck", (a) => {
|
|
1101
|
+
this.send("realityCheck", a);
|
|
1144
1102
|
});
|
|
1145
1103
|
}
|
|
1146
|
-
async reconnect(
|
|
1147
|
-
this.initialize(
|
|
1104
|
+
async reconnect(e) {
|
|
1105
|
+
this.initialize(e), await this.socket.connect(), await this.socket.authenticate(!0), await this.socket.openGame();
|
|
1148
1106
|
}
|
|
1149
1107
|
async openGame() {
|
|
1150
|
-
const
|
|
1151
|
-
this.initialize({ apiUrl:
|
|
1108
|
+
const e = new URLSearchParams(window.location.search), a = e.get("apiUrl"), n = e.get("cageCode"), r = e.get("gameCode"), s = e.get("operatorCode"), h = e.get("playMode"), g = e.get("token"), w = e.get("username"), p = e.get("gameHistoryUrl"), A = e.get("homeUrl") ?? void 0, R = e.get("cashierUrl") ?? void 0;
|
|
1109
|
+
this.initialize({ apiUrl: a, cageCode: n, gameCode: r, operatorCode: s, playMode: h, token: g, username: w });
|
|
1152
1110
|
try {
|
|
1153
1111
|
await this.socket.connect();
|
|
1154
1112
|
} catch {
|
|
1155
|
-
throw { type: "error", data: { code:
|
|
1113
|
+
throw { type: "error", data: { code: Ne.CONNECTION_ERROR } };
|
|
1156
1114
|
}
|
|
1157
|
-
let
|
|
1115
|
+
let Q;
|
|
1158
1116
|
try {
|
|
1159
|
-
|
|
1160
|
-
} catch (
|
|
1161
|
-
throw
|
|
1117
|
+
Q = await this.socket.authenticate();
|
|
1118
|
+
} catch (B) {
|
|
1119
|
+
throw { type: B.type, data: B.type === "error" ? ii(B.data) : void 0 };
|
|
1162
1120
|
}
|
|
1163
|
-
let
|
|
1121
|
+
let X;
|
|
1164
1122
|
try {
|
|
1165
|
-
|
|
1166
|
-
} catch (
|
|
1167
|
-
throw
|
|
1123
|
+
X = await this.socket.openGame();
|
|
1124
|
+
} catch (B) {
|
|
1125
|
+
throw { type: B.type, data: B.type === "error" ? ni(B.data) : void 0 };
|
|
1168
1126
|
}
|
|
1169
|
-
const L =
|
|
1170
|
-
this.
|
|
1171
|
-
brand:
|
|
1172
|
-
game:
|
|
1127
|
+
const L = ti(Q), he = ai(Q, X);
|
|
1128
|
+
this.sdkConfig.api = {
|
|
1129
|
+
brand: n,
|
|
1130
|
+
game: r,
|
|
1173
1131
|
integration: s,
|
|
1174
1132
|
jurisdiction: L.contract.jurisdiction,
|
|
1175
1133
|
playMode: h,
|
|
@@ -1180,115 +1138,114 @@ class qi extends Yt {
|
|
|
1180
1138
|
country: L.contract.country,
|
|
1181
1139
|
currency: L.contract.currency,
|
|
1182
1140
|
coinValueInCents: L.contract.coinValueInCents,
|
|
1183
|
-
gameHistoryUrl:
|
|
1141
|
+
gameHistoryUrl: p,
|
|
1184
1142
|
homeUrl: A,
|
|
1185
|
-
cashierUrl:
|
|
1186
|
-
sessionId:
|
|
1187
|
-
lastRoundId:
|
|
1143
|
+
cashierUrl: R,
|
|
1144
|
+
sessionId: he.contract.sessionId,
|
|
1145
|
+
lastRoundId: he.contract.roundId
|
|
1188
1146
|
};
|
|
1189
|
-
const
|
|
1190
|
-
return
|
|
1147
|
+
const x = e.get("languageCode");
|
|
1148
|
+
return x && (this.sdkConfig.ui.language = x.length === 3 ? ri[x] ?? x : x), he;
|
|
1191
1149
|
}
|
|
1192
|
-
async play(
|
|
1150
|
+
async play(e) {
|
|
1193
1151
|
const {
|
|
1194
|
-
contract: { bet:
|
|
1152
|
+
contract: { bet: a, forcedOutcomes: n, ...r },
|
|
1195
1153
|
extra: s,
|
|
1196
1154
|
actionType: h
|
|
1197
|
-
} =
|
|
1198
|
-
bet:
|
|
1199
|
-
forcedOutcomes:
|
|
1155
|
+
} = e, g = {
|
|
1156
|
+
bet: a ? { baseBet: a.base, betMultiplier: a.multiplier } : void 0,
|
|
1157
|
+
forcedOutcomes: n,
|
|
1200
1158
|
// TODO: get rid of contractRest - it' a legacy from old RGS
|
|
1201
|
-
...
|
|
1159
|
+
...r,
|
|
1202
1160
|
opaqueUiToGameServer: s
|
|
1203
1161
|
};
|
|
1204
1162
|
let w;
|
|
1205
1163
|
try {
|
|
1206
1164
|
w = await this.socket.sendAction(h, g);
|
|
1207
|
-
} catch (
|
|
1208
|
-
throw
|
|
1165
|
+
} catch (p) {
|
|
1166
|
+
throw { type: p.type, data: p.type === "error" ? oi(p.data) : void 0 };
|
|
1209
1167
|
}
|
|
1210
|
-
return
|
|
1168
|
+
return si(w);
|
|
1211
1169
|
}
|
|
1212
1170
|
registerFromSdkEvents() {
|
|
1213
1171
|
this.on("history", () => {
|
|
1214
1172
|
const {
|
|
1215
|
-
api: { game:
|
|
1173
|
+
api: { game: e, integration: a, integrationData: n, jurisdiction: r, user: s, gameHistoryUrl: h },
|
|
1216
1174
|
ui: { language: g }
|
|
1217
|
-
} = this.
|
|
1218
|
-
|
|
1175
|
+
} = this.sdkConfig, w = s.replace(/^user_/, "").replace(new RegExp(`_${a}$`), ""), p = new URL(h);
|
|
1176
|
+
p.searchParams.set("gameCode", e), p.searchParams.set("jurisdiction", r), p.searchParams.set("operatorCode", a), p.searchParams.set("token", n.token), p.searchParams.set("username", w), p.searchParams.set("languageCode", g), window.open(p.toString(), "_blank");
|
|
1219
1177
|
});
|
|
1220
1178
|
}
|
|
1221
1179
|
}
|
|
1222
|
-
|
|
1223
|
-
var
|
|
1224
|
-
var
|
|
1225
|
-
|
|
1226
|
-
t[n] = e[n] && e[n].length % 2 === 0 ? e[n].concat(i[n]) : i[n];
|
|
1227
|
-
return t;
|
|
1228
|
-
}, ze = function(i) {
|
|
1229
|
-
for (var e = {}, t = 0; t < i.length; t++)
|
|
1230
|
-
e[i[t].toUpperCase()] = i[t];
|
|
1180
|
+
var di = "2.0.0-beta.2", de = "", ht = "?", Ye = "function", z = "undefined", le = "object", Ze = "string", fe = "major", d = "model", o = "name", l = "type", u = "vendor", c = "version", M = "architecture", Z = "console", m = "mobile", f = "tablet", I = "smarttv", Y = "wearable", et = "embedded", gt = "user-agent", tt = 500, nt = "brands", W = "formFactor", st = "fullVersionList", ee = "platform", ot = "platformVersion", Re = "bitness", G = "sec-ch-ua", li = G + "-full-version-list", ui = G + "-arch", hi = G + "-" + Re, gi = G + "-form-factor", wi = G + "-" + m, bi = G + "-" + d, Ft = G + "-" + ee, pi = Ft + "-version", Dt = [nt, st, m, d, ee, ot, M, W, Re], T = "browser", _ = "cpu", O = "device", F = "engine", P = "os", te = "result", Se = "Amazon", we = "Apple", wt = "ASUS", bt = "BlackBerry", Ie = "Google", pt = "Huawei", mt = "Lenovo", $e = "LG", Ue = "Microsoft", ft = "Motorola", Te = "Samsung", yt = "Sharp", Ae = "Sony", je = "Xiaomi", Qe = "Zebra", K = "Mobile ", J = " Browser", Pe = "Chrome", mi = "Edge", be = "Firefox", pe = "Opera", vt = "Facebook", kt = "Sogou", it = "Windows", fi = typeof window !== z, S = fi && window.navigator ? window.navigator : void 0, H = S && S.userAgentData ? S.userAgentData : void 0, yi = function(i, t) {
|
|
1181
|
+
var e = {};
|
|
1182
|
+
for (var a in i)
|
|
1183
|
+
e[a] = t[a] && t[a].length % 2 === 0 ? t[a].concat(i[a]) : i[a];
|
|
1231
1184
|
return e;
|
|
1232
|
-
},
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1185
|
+
}, He = function(i) {
|
|
1186
|
+
for (var t = {}, e = 0; e < i.length; e++)
|
|
1187
|
+
t[i[e].toUpperCase()] = i[e];
|
|
1188
|
+
return t;
|
|
1189
|
+
}, at = function(i, t) {
|
|
1190
|
+
if (typeof i === le && i.length > 0) {
|
|
1191
|
+
for (var e in i)
|
|
1192
|
+
if (q(i[e]) == q(t))
|
|
1236
1193
|
return !0;
|
|
1237
1194
|
return !1;
|
|
1238
1195
|
}
|
|
1239
|
-
return
|
|
1240
|
-
},
|
|
1241
|
-
for (var
|
|
1242
|
-
return /^(browser|cpu|device|engine|os)$/.test(
|
|
1243
|
-
},
|
|
1244
|
-
return typeof i ===
|
|
1245
|
-
},
|
|
1196
|
+
return ue(i) ? q(t).indexOf(q(i)) !== -1 : !1;
|
|
1197
|
+
}, Et = function(i) {
|
|
1198
|
+
for (var t in i)
|
|
1199
|
+
return /^(browser|cpu|device|engine|os)$/.test(t);
|
|
1200
|
+
}, ue = function(i) {
|
|
1201
|
+
return typeof i === Ze;
|
|
1202
|
+
}, Xe = function(i) {
|
|
1246
1203
|
if (i) {
|
|
1247
|
-
for (var
|
|
1248
|
-
if (
|
|
1249
|
-
var
|
|
1250
|
-
|
|
1204
|
+
for (var t = [], e = $(/\\?\"/g, i).split(","), a = 0; a < e.length; a++)
|
|
1205
|
+
if (e[a].indexOf(";") > -1) {
|
|
1206
|
+
var n = ye(e[a]).split(";v=");
|
|
1207
|
+
t[a] = { brand: n[0], version: n[1] };
|
|
1251
1208
|
} else
|
|
1252
|
-
|
|
1253
|
-
return
|
|
1254
|
-
}
|
|
1255
|
-
},
|
|
1256
|
-
return
|
|
1257
|
-
},
|
|
1258
|
-
return
|
|
1259
|
-
},
|
|
1260
|
-
for (var
|
|
1261
|
-
var
|
|
1262
|
-
typeof
|
|
1209
|
+
t[a] = ye(e[a]);
|
|
1210
|
+
return t;
|
|
1211
|
+
}
|
|
1212
|
+
}, q = function(i) {
|
|
1213
|
+
return ue(i) ? i.toLowerCase() : i;
|
|
1214
|
+
}, Ke = function(i) {
|
|
1215
|
+
return ue(i) ? $(/[^\d\.]/g, i).split(".")[0] : void 0;
|
|
1216
|
+
}, D = function(i) {
|
|
1217
|
+
for (var t in i) {
|
|
1218
|
+
var e = i[t];
|
|
1219
|
+
typeof e == le && e.length == 2 ? this[e[0]] = e[1] : this[e] = void 0;
|
|
1263
1220
|
}
|
|
1264
1221
|
return this;
|
|
1265
|
-
},
|
|
1266
|
-
return
|
|
1267
|
-
},
|
|
1268
|
-
return
|
|
1269
|
-
},
|
|
1270
|
-
if (
|
|
1271
|
-
return i =
|
|
1272
|
-
},
|
|
1273
|
-
if (!(!i || !
|
|
1274
|
-
for (var
|
|
1275
|
-
var w = e
|
|
1276
|
-
for (
|
|
1277
|
-
if (h = w[
|
|
1278
|
-
for (
|
|
1279
|
-
g = h[++
|
|
1280
|
-
|
|
1222
|
+
}, $ = function(i, t) {
|
|
1223
|
+
return ue(t) ? t.replace(i, de) : t;
|
|
1224
|
+
}, me = function(i) {
|
|
1225
|
+
return $(/\\?\"/g, i);
|
|
1226
|
+
}, ye = function(i, t) {
|
|
1227
|
+
if (ue(i))
|
|
1228
|
+
return i = $(/^\s\s*/, i), typeof t === z ? i : i.substring(0, tt);
|
|
1229
|
+
}, Ct = function(i, t) {
|
|
1230
|
+
if (!(!i || !t))
|
|
1231
|
+
for (var e = 0, a, n, r, s, h, g; e < t.length && !h; ) {
|
|
1232
|
+
var w = t[e], p = t[e + 1];
|
|
1233
|
+
for (a = n = 0; a < w.length && !h && w[a]; )
|
|
1234
|
+
if (h = w[a++].exec(i), h)
|
|
1235
|
+
for (r = 0; r < p.length; r++)
|
|
1236
|
+
g = h[++n], s = p[r], typeof s === le && s.length > 0 ? s.length === 2 ? typeof s[1] == Ye ? this[s[0]] = s[1].call(this, g) : this[s[0]] = s[1] : s.length === 3 ? typeof s[1] === Ye && !(s[1].exec && s[1].test) ? this[s[0]] = g ? s[1].call(this, g, s[2]) : void 0 : this[s[0]] = g ? g.replace(s[1], s[2]) : void 0 : s.length === 4 && (this[s[0]] = g ? s[3].call(this, g.replace(s[1], s[2])) : void 0) : this[s] = g || void 0;
|
|
1237
|
+
e += 2;
|
|
1281
1238
|
}
|
|
1282
|
-
}, Be = function(i,
|
|
1283
|
-
for (var
|
|
1284
|
-
if (typeof e
|
|
1285
|
-
for (var
|
|
1286
|
-
if (
|
|
1287
|
-
return
|
|
1288
|
-
} else if (
|
|
1289
|
-
return
|
|
1290
|
-
return
|
|
1291
|
-
},
|
|
1239
|
+
}, Be = function(i, t) {
|
|
1240
|
+
for (var e in t)
|
|
1241
|
+
if (typeof t[e] === le && t[e].length > 0) {
|
|
1242
|
+
for (var a = 0; a < t[e].length; a++)
|
|
1243
|
+
if (at(t[e][a], i))
|
|
1244
|
+
return e === ht ? void 0 : e;
|
|
1245
|
+
} else if (at(t[e], i))
|
|
1246
|
+
return e === ht ? void 0 : e;
|
|
1247
|
+
return t.hasOwnProperty("*") ? t["*"] : i;
|
|
1248
|
+
}, Mt = {
|
|
1292
1249
|
ME: "4.90",
|
|
1293
1250
|
"NT 3.11": "NT3.51",
|
|
1294
1251
|
"NT 4.0": "NT4.0",
|
|
@@ -1300,7 +1257,7 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1300
1257
|
"8.1": "NT 6.3",
|
|
1301
1258
|
10: ["NT 6.4", "NT 10.0"],
|
|
1302
1259
|
RT: "ARM"
|
|
1303
|
-
},
|
|
1260
|
+
}, St = {
|
|
1304
1261
|
embedded: "Automotive",
|
|
1305
1262
|
mobile: "Mobile",
|
|
1306
1263
|
tablet: ["Tablet", "EInk"],
|
|
@@ -1308,19 +1265,19 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1308
1265
|
wearable: ["VR", "XR", "Watch"],
|
|
1309
1266
|
"?": ["Desktop", "Unknown"],
|
|
1310
1267
|
"*": void 0
|
|
1311
|
-
},
|
|
1268
|
+
}, It = {
|
|
1312
1269
|
browser: [
|
|
1313
1270
|
[
|
|
1314
1271
|
// Most common regardless engine
|
|
1315
1272
|
/\b(?:crmo|crios)\/([\w\.]+)/i
|
|
1316
1273
|
// Chrome for Android/iOS
|
|
1317
1274
|
],
|
|
1318
|
-
[
|
|
1275
|
+
[c, [o, K + "Chrome"]],
|
|
1319
1276
|
[
|
|
1320
1277
|
/edg(?:e|ios|a)?\/([\w\.]+)/i
|
|
1321
1278
|
// Microsoft Edge
|
|
1322
1279
|
],
|
|
1323
|
-
[
|
|
1280
|
+
[c, [o, "Edge"]],
|
|
1324
1281
|
[
|
|
1325
1282
|
// Presto based
|
|
1326
1283
|
/(opera mini)\/([-\w\.]+)/i,
|
|
@@ -1330,28 +1287,28 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1330
1287
|
/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i
|
|
1331
1288
|
// Opera
|
|
1332
1289
|
],
|
|
1333
|
-
[o,
|
|
1290
|
+
[o, c],
|
|
1334
1291
|
[
|
|
1335
1292
|
/opios[\/ ]+([\w\.]+)/i
|
|
1336
1293
|
// Opera mini on iphone >= 8.0
|
|
1337
1294
|
],
|
|
1338
|
-
[
|
|
1295
|
+
[c, [o, pe + " Mini"]],
|
|
1339
1296
|
[
|
|
1340
1297
|
/\bop(?:rg)?x\/([\w\.]+)/i
|
|
1341
1298
|
// Opera GX
|
|
1342
1299
|
],
|
|
1343
|
-
[
|
|
1300
|
+
[c, [o, pe + " GX"]],
|
|
1344
1301
|
[
|
|
1345
1302
|
/\bopr\/([\w\.]+)/i
|
|
1346
1303
|
// Opera Webkit
|
|
1347
1304
|
],
|
|
1348
|
-
[
|
|
1305
|
+
[c, [o, pe]],
|
|
1349
1306
|
[
|
|
1350
1307
|
// Mixed
|
|
1351
1308
|
/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i
|
|
1352
1309
|
// Baidu
|
|
1353
1310
|
],
|
|
1354
|
-
[
|
|
1311
|
+
[c, [o, "Baidu"]],
|
|
1355
1312
|
[
|
|
1356
1313
|
/(kindle)\/([\w\.]+)/i,
|
|
1357
1314
|
// Kindle
|
|
@@ -1370,12 +1327,12 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1370
1327
|
/(weibo)__([\d\.]+)/i
|
|
1371
1328
|
// Weibo
|
|
1372
1329
|
],
|
|
1373
|
-
[o,
|
|
1330
|
+
[o, c],
|
|
1374
1331
|
[
|
|
1375
1332
|
/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i
|
|
1376
1333
|
// UCBrowser
|
|
1377
1334
|
],
|
|
1378
|
-
[
|
|
1335
|
+
[c, [o, "UCBrowser"]],
|
|
1379
1336
|
[
|
|
1380
1337
|
/microm.+\bqbcore\/([\w\.]+)/i,
|
|
1381
1338
|
// WeChat Desktop for Windows Built-in Browser
|
|
@@ -1383,67 +1340,67 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1383
1340
|
/micromessenger\/([\w\.]+)/i
|
|
1384
1341
|
// WeChat
|
|
1385
1342
|
],
|
|
1386
|
-
[
|
|
1343
|
+
[c, [o, "WeChat"]],
|
|
1387
1344
|
[
|
|
1388
1345
|
/konqueror\/([\w\.]+)/i
|
|
1389
1346
|
// Konqueror
|
|
1390
1347
|
],
|
|
1391
|
-
[
|
|
1348
|
+
[c, [o, "Konqueror"]],
|
|
1392
1349
|
[
|
|
1393
1350
|
/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i
|
|
1394
1351
|
// IE11
|
|
1395
1352
|
],
|
|
1396
|
-
[
|
|
1353
|
+
[c, [o, "IE"]],
|
|
1397
1354
|
[
|
|
1398
1355
|
/ya(?:search)?browser\/([\w\.]+)/i
|
|
1399
1356
|
// Yandex
|
|
1400
1357
|
],
|
|
1401
|
-
[
|
|
1358
|
+
[c, [o, "Yandex"]],
|
|
1402
1359
|
[
|
|
1403
1360
|
/slbrowser\/([\w\.]+)/i
|
|
1404
1361
|
// Smart Lenovo Browser
|
|
1405
1362
|
],
|
|
1406
|
-
[
|
|
1363
|
+
[c, [o, "Smart " + mt + J]],
|
|
1407
1364
|
[
|
|
1408
1365
|
/(avast|avg)\/([\w\.]+)/i
|
|
1409
1366
|
// Avast/AVG Secure Browser
|
|
1410
1367
|
],
|
|
1411
|
-
[[o, /(.+)/, "$1 Secure" + J],
|
|
1368
|
+
[[o, /(.+)/, "$1 Secure" + J], c],
|
|
1412
1369
|
[
|
|
1413
1370
|
/\bfocus\/([\w\.]+)/i
|
|
1414
1371
|
// Firefox Focus
|
|
1415
1372
|
],
|
|
1416
|
-
[
|
|
1373
|
+
[c, [o, be + " Focus"]],
|
|
1417
1374
|
[
|
|
1418
1375
|
/\bopt\/([\w\.]+)/i
|
|
1419
1376
|
// Opera Touch
|
|
1420
1377
|
],
|
|
1421
|
-
[
|
|
1378
|
+
[c, [o, pe + " Touch"]],
|
|
1422
1379
|
[
|
|
1423
1380
|
/coc_coc\w+\/([\w\.]+)/i
|
|
1424
1381
|
// Coc Coc Browser
|
|
1425
1382
|
],
|
|
1426
|
-
[
|
|
1383
|
+
[c, [o, "Coc Coc"]],
|
|
1427
1384
|
[
|
|
1428
1385
|
/dolfin\/([\w\.]+)/i
|
|
1429
1386
|
// Dolphin
|
|
1430
1387
|
],
|
|
1431
|
-
[
|
|
1388
|
+
[c, [o, "Dolphin"]],
|
|
1432
1389
|
[
|
|
1433
1390
|
/coast\/([\w\.]+)/i
|
|
1434
1391
|
// Opera Coast
|
|
1435
1392
|
],
|
|
1436
|
-
[
|
|
1393
|
+
[c, [o, pe + " Coast"]],
|
|
1437
1394
|
[
|
|
1438
1395
|
/miuibrowser\/([\w\.]+)/i
|
|
1439
1396
|
// MIUI Browser
|
|
1440
1397
|
],
|
|
1441
|
-
[
|
|
1398
|
+
[c, [o, "MIUI" + J]],
|
|
1442
1399
|
[
|
|
1443
1400
|
/fxios\/([\w\.-]+)/i
|
|
1444
1401
|
// Firefox for iOS
|
|
1445
1402
|
],
|
|
1446
|
-
[
|
|
1403
|
+
[c, [o, K + be]],
|
|
1447
1404
|
[
|
|
1448
1405
|
/\bqihu|(qi?ho?o?|360)browser/i
|
|
1449
1406
|
// 360
|
|
@@ -1452,28 +1409,28 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1452
1409
|
[
|
|
1453
1410
|
/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i
|
|
1454
1411
|
],
|
|
1455
|
-
[[o, /(.+)/, "$1" + J],
|
|
1412
|
+
[[o, /(.+)/, "$1" + J], c],
|
|
1456
1413
|
[
|
|
1457
1414
|
// Oculus/Sailfish/HuaweiBrowser/VivoBrowser
|
|
1458
1415
|
/samsungbrowser\/([\w\.]+)/i
|
|
1459
1416
|
// Samsung Internet
|
|
1460
1417
|
],
|
|
1461
|
-
[
|
|
1418
|
+
[c, [o, Te + " Internet"]],
|
|
1462
1419
|
[
|
|
1463
1420
|
/(comodo_dragon)\/([\w\.]+)/i
|
|
1464
1421
|
// Comodo Dragon
|
|
1465
1422
|
],
|
|
1466
|
-
[[o, /_/g, " "],
|
|
1423
|
+
[[o, /_/g, " "], c],
|
|
1467
1424
|
[
|
|
1468
1425
|
/metasr[\/ ]?([\d\.]+)/i
|
|
1469
1426
|
// Sogou Explorer
|
|
1470
1427
|
],
|
|
1471
|
-
[
|
|
1428
|
+
[c, [o, kt + " Explorer"]],
|
|
1472
1429
|
[
|
|
1473
1430
|
/(sogou)mo\w+\/([\d\.]+)/i
|
|
1474
1431
|
// Sogou Mobile
|
|
1475
1432
|
],
|
|
1476
|
-
[[o,
|
|
1433
|
+
[[o, kt + " Mobile"], c],
|
|
1477
1434
|
[
|
|
1478
1435
|
/(electron)\/([\w\.]+) safari/i,
|
|
1479
1436
|
// Electron-based App
|
|
@@ -1482,7 +1439,7 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1482
1439
|
/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i
|
|
1483
1440
|
// QQBrowser/2345 Browser
|
|
1484
1441
|
],
|
|
1485
|
-
[o,
|
|
1442
|
+
[o, c],
|
|
1486
1443
|
[
|
|
1487
1444
|
/(lbbrowser)/i,
|
|
1488
1445
|
// LieBao Browser
|
|
@@ -1495,7 +1452,7 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1495
1452
|
/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i
|
|
1496
1453
|
// Facebook App for iOS & Android
|
|
1497
1454
|
],
|
|
1498
|
-
[[o, vt],
|
|
1455
|
+
[[o, vt], c],
|
|
1499
1456
|
[
|
|
1500
1457
|
/(Klarna)\/([\w\.]+)/i,
|
|
1501
1458
|
// Klarna Shopping Browser for iOS & Android
|
|
@@ -1512,47 +1469,47 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1512
1469
|
/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i
|
|
1513
1470
|
// Chromium/Instagram/Snapchat
|
|
1514
1471
|
],
|
|
1515
|
-
[o,
|
|
1472
|
+
[o, c],
|
|
1516
1473
|
[
|
|
1517
1474
|
/\bgsa\/([\w\.]+) .*safari\//i
|
|
1518
1475
|
// Google Search Appliance on iOS
|
|
1519
1476
|
],
|
|
1520
|
-
[
|
|
1477
|
+
[c, [o, "GSA"]],
|
|
1521
1478
|
[
|
|
1522
1479
|
/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i
|
|
1523
1480
|
// TikTok
|
|
1524
1481
|
],
|
|
1525
|
-
[
|
|
1482
|
+
[c, [o, "TikTok"]],
|
|
1526
1483
|
[
|
|
1527
1484
|
/headlesschrome(?:\/([\w\.]+)| )/i
|
|
1528
1485
|
// Chrome Headless
|
|
1529
1486
|
],
|
|
1530
|
-
[
|
|
1487
|
+
[c, [o, Pe + " Headless"]],
|
|
1531
1488
|
[
|
|
1532
1489
|
/ wv\).+(chrome)\/([\w\.]+)/i
|
|
1533
1490
|
// Chrome WebView
|
|
1534
1491
|
],
|
|
1535
|
-
[[o,
|
|
1492
|
+
[[o, Pe + " WebView"], c],
|
|
1536
1493
|
[
|
|
1537
1494
|
/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i
|
|
1538
1495
|
// Android Browser
|
|
1539
1496
|
],
|
|
1540
|
-
[
|
|
1497
|
+
[c, [o, "Android" + J]],
|
|
1541
1498
|
[
|
|
1542
1499
|
/chrome\/([\w\.]+) mobile/i
|
|
1543
1500
|
// Chrome Mobile
|
|
1544
1501
|
],
|
|
1545
|
-
[
|
|
1502
|
+
[c, [o, K + "Chrome"]],
|
|
1546
1503
|
[
|
|
1547
1504
|
/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i
|
|
1548
1505
|
// Chrome/OmniWeb/Arora/Tizen/Nokia
|
|
1549
1506
|
],
|
|
1550
|
-
[o,
|
|
1507
|
+
[o, c],
|
|
1551
1508
|
[
|
|
1552
1509
|
/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i
|
|
1553
1510
|
// Safari Mobile
|
|
1554
1511
|
],
|
|
1555
|
-
[
|
|
1512
|
+
[c, [o, K + "Safari"]],
|
|
1556
1513
|
[
|
|
1557
1514
|
/iphone .*mobile(?:\/\w+ | ?)safari/i
|
|
1558
1515
|
],
|
|
@@ -1561,32 +1518,32 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1561
1518
|
/version\/([\w\.\,]+) .*(safari)/i
|
|
1562
1519
|
// Safari
|
|
1563
1520
|
],
|
|
1564
|
-
[
|
|
1521
|
+
[c, o],
|
|
1565
1522
|
[
|
|
1566
1523
|
/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i
|
|
1567
1524
|
// Safari < 3.0
|
|
1568
1525
|
],
|
|
1569
|
-
[o, [
|
|
1526
|
+
[o, [c, "1"]],
|
|
1570
1527
|
[
|
|
1571
1528
|
/(webkit|khtml)\/([\w\.]+)/i
|
|
1572
1529
|
],
|
|
1573
|
-
[o,
|
|
1530
|
+
[o, c],
|
|
1574
1531
|
[
|
|
1575
1532
|
// Gecko based
|
|
1576
1533
|
/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i
|
|
1577
1534
|
// Firefox Mobile
|
|
1578
1535
|
],
|
|
1579
|
-
[[o, K +
|
|
1536
|
+
[[o, K + be], c],
|
|
1580
1537
|
[
|
|
1581
1538
|
/(navigator|netscape\d?)\/([-\w\.]+)/i
|
|
1582
1539
|
// Netscape
|
|
1583
1540
|
],
|
|
1584
|
-
[[o, "Netscape"],
|
|
1541
|
+
[[o, "Netscape"], c],
|
|
1585
1542
|
[
|
|
1586
1543
|
/mobile vr; rv:([\w\.]+)\).+firefox/i
|
|
1587
1544
|
// Firefox Reality
|
|
1588
1545
|
],
|
|
1589
|
-
[
|
|
1546
|
+
[c, [o, be + " Reality"]],
|
|
1590
1547
|
[
|
|
1591
1548
|
/ekiohf.+(flow)\/([\w\.]+)/i,
|
|
1592
1549
|
// Flow
|
|
@@ -1608,56 +1565,56 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1608
1565
|
/panasonic;(viera)/i
|
|
1609
1566
|
// Panasonic Viera
|
|
1610
1567
|
],
|
|
1611
|
-
[o,
|
|
1568
|
+
[o, c],
|
|
1612
1569
|
[
|
|
1613
1570
|
/(cobalt)\/([\w\.]+)/i
|
|
1614
1571
|
// Cobalt
|
|
1615
1572
|
],
|
|
1616
|
-
[o, [
|
|
1573
|
+
[o, [c, /[^\d\.]+./, de]]
|
|
1617
1574
|
],
|
|
1618
1575
|
cpu: [
|
|
1619
1576
|
[
|
|
1620
1577
|
/\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i
|
|
1621
1578
|
// AMD64 (x64)
|
|
1622
1579
|
],
|
|
1623
|
-
[[
|
|
1580
|
+
[[M, "amd64"]],
|
|
1624
1581
|
[
|
|
1625
1582
|
/(ia32(?=;))/i,
|
|
1626
1583
|
// IA32 (quicktime)
|
|
1627
1584
|
/((?:i[346]|x)86)[;\)]/i
|
|
1628
1585
|
// IA32 (x86)
|
|
1629
1586
|
],
|
|
1630
|
-
[[
|
|
1587
|
+
[[M, "ia32"]],
|
|
1631
1588
|
[
|
|
1632
1589
|
/\b(aarch64|arm(v?8e?l?|_?64))\b/i
|
|
1633
1590
|
// ARM64
|
|
1634
1591
|
],
|
|
1635
|
-
[[
|
|
1592
|
+
[[M, "arm64"]],
|
|
1636
1593
|
[
|
|
1637
1594
|
/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i
|
|
1638
1595
|
// ARMHF
|
|
1639
1596
|
],
|
|
1640
|
-
[[
|
|
1597
|
+
[[M, "armhf"]],
|
|
1641
1598
|
[
|
|
1642
1599
|
// PocketPC mistakenly identified as PowerPC
|
|
1643
1600
|
/windows (ce|mobile); ppc;/i
|
|
1644
1601
|
],
|
|
1645
|
-
[[
|
|
1602
|
+
[[M, "arm"]],
|
|
1646
1603
|
[
|
|
1647
1604
|
/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i
|
|
1648
1605
|
// PowerPC
|
|
1649
1606
|
],
|
|
1650
|
-
[[
|
|
1607
|
+
[[M, /ower/, de, q]],
|
|
1651
1608
|
[
|
|
1652
1609
|
/(sun4\w)[;\)]/i
|
|
1653
1610
|
// SPARC
|
|
1654
1611
|
],
|
|
1655
|
-
[[
|
|
1612
|
+
[[M, "sparc"]],
|
|
1656
1613
|
[
|
|
1657
1614
|
/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i
|
|
1658
1615
|
// IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
|
|
1659
1616
|
],
|
|
1660
|
-
[[
|
|
1617
|
+
[[M, q]]
|
|
1661
1618
|
],
|
|
1662
1619
|
device: [
|
|
1663
1620
|
[
|
|
@@ -1667,45 +1624,45 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1667
1624
|
// Samsung
|
|
1668
1625
|
/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i
|
|
1669
1626
|
],
|
|
1670
|
-
[d, [u,
|
|
1627
|
+
[d, [u, Te], [l, f]],
|
|
1671
1628
|
[
|
|
1672
1629
|
/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,
|
|
1673
1630
|
/samsung[- ]([-\w]+)/i,
|
|
1674
1631
|
/sec-(sgh\w+)/i
|
|
1675
1632
|
],
|
|
1676
|
-
[d, [u,
|
|
1633
|
+
[d, [u, Te], [l, m]],
|
|
1677
1634
|
[
|
|
1678
1635
|
// Apple
|
|
1679
1636
|
/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i
|
|
1680
1637
|
// iPod/iPhone
|
|
1681
1638
|
],
|
|
1682
|
-
[d, [u,
|
|
1639
|
+
[d, [u, we], [l, m]],
|
|
1683
1640
|
[
|
|
1684
1641
|
/\((ipad);[-\w\),; ]+apple/i,
|
|
1685
1642
|
// iPad
|
|
1686
1643
|
/applecoremedia\/[\w\.]+ \((ipad)/i,
|
|
1687
1644
|
/\b(ipad)\d\d?,\d\d?[;\]].+ios/i
|
|
1688
1645
|
],
|
|
1689
|
-
[d, [u,
|
|
1646
|
+
[d, [u, we], [l, f]],
|
|
1690
1647
|
[
|
|
1691
1648
|
/(macintosh);/i
|
|
1692
1649
|
],
|
|
1693
|
-
[d, [u,
|
|
1650
|
+
[d, [u, we]],
|
|
1694
1651
|
[
|
|
1695
1652
|
// Sharp
|
|
1696
1653
|
/\b(sh-?[altvz]?\d\d[a-ekm]?)/i
|
|
1697
1654
|
],
|
|
1698
|
-
[d, [u, yt], [l,
|
|
1655
|
+
[d, [u, yt], [l, m]],
|
|
1699
1656
|
[
|
|
1700
1657
|
// Huawei
|
|
1701
1658
|
/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
|
|
1702
1659
|
],
|
|
1703
|
-
[d, [u,
|
|
1660
|
+
[d, [u, pt], [l, f]],
|
|
1704
1661
|
[
|
|
1705
1662
|
/(?:huawei|honor)([-\w ]+)[;\)]/i,
|
|
1706
1663
|
/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i
|
|
1707
1664
|
],
|
|
1708
|
-
[d, [u,
|
|
1665
|
+
[d, [u, pt], [l, m]],
|
|
1709
1666
|
[
|
|
1710
1667
|
// Xiaomi
|
|
1711
1668
|
/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,
|
|
@@ -1721,92 +1678,92 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1721
1678
|
/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i
|
|
1722
1679
|
// Xiaomi Mi
|
|
1723
1680
|
],
|
|
1724
|
-
[[d, /_/g, " "], [u,
|
|
1681
|
+
[[d, /_/g, " "], [u, je], [l, m]],
|
|
1725
1682
|
[
|
|
1726
1683
|
/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,
|
|
1727
1684
|
// Redmi Pad
|
|
1728
1685
|
/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i
|
|
1729
1686
|
// Mi Pad tablets
|
|
1730
1687
|
],
|
|
1731
|
-
[[d, /_/g, " "], [u,
|
|
1688
|
+
[[d, /_/g, " "], [u, je], [l, f]],
|
|
1732
1689
|
[
|
|
1733
1690
|
// OPPO
|
|
1734
1691
|
/; (\w+) bui.+ oppo/i,
|
|
1735
1692
|
/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
|
|
1736
1693
|
],
|
|
1737
|
-
[d, [u, "OPPO"], [l,
|
|
1694
|
+
[d, [u, "OPPO"], [l, m]],
|
|
1738
1695
|
[
|
|
1739
1696
|
// Vivo
|
|
1740
1697
|
/vivo (\w+)(?: bui|\))/i,
|
|
1741
1698
|
/\b(v[12]\d{3}\w?[at])(?: bui|;)/i
|
|
1742
1699
|
],
|
|
1743
|
-
[d, [u, "Vivo"], [l,
|
|
1700
|
+
[d, [u, "Vivo"], [l, m]],
|
|
1744
1701
|
[
|
|
1745
1702
|
// Realme
|
|
1746
1703
|
/\b(rmx[1-3]\d{3})(?: bui|;|\))/i
|
|
1747
1704
|
],
|
|
1748
|
-
[d, [u, "Realme"], [l,
|
|
1705
|
+
[d, [u, "Realme"], [l, m]],
|
|
1749
1706
|
[
|
|
1750
1707
|
// Motorola
|
|
1751
1708
|
/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,
|
|
1752
1709
|
/\bmot(?:orola)?[- ](\w*)/i,
|
|
1753
1710
|
/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i
|
|
1754
1711
|
],
|
|
1755
|
-
[d, [u,
|
|
1712
|
+
[d, [u, ft], [l, m]],
|
|
1756
1713
|
[
|
|
1757
1714
|
/\b(mz60\d|xoom[2 ]{0,2}) build\//i
|
|
1758
1715
|
],
|
|
1759
|
-
[d, [u,
|
|
1716
|
+
[d, [u, ft], [l, f]],
|
|
1760
1717
|
[
|
|
1761
1718
|
// LG
|
|
1762
1719
|
/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i
|
|
1763
1720
|
],
|
|
1764
|
-
[d, [u,
|
|
1721
|
+
[d, [u, $e], [l, f]],
|
|
1765
1722
|
[
|
|
1766
1723
|
/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,
|
|
1767
1724
|
/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,
|
|
1768
1725
|
/\blg-?([\d\w]+) bui/i
|
|
1769
1726
|
],
|
|
1770
|
-
[d, [u,
|
|
1727
|
+
[d, [u, $e], [l, m]],
|
|
1771
1728
|
[
|
|
1772
1729
|
// Lenovo
|
|
1773
1730
|
/(ideatab[-\w ]+)/i,
|
|
1774
1731
|
/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
|
|
1775
1732
|
],
|
|
1776
|
-
[d, [u,
|
|
1733
|
+
[d, [u, mt], [l, f]],
|
|
1777
1734
|
[
|
|
1778
1735
|
// Nokia
|
|
1779
1736
|
/(?:maemo|nokia).*(n900|lumia \d+)/i,
|
|
1780
1737
|
/nokia[-_ ]?([-\w\.]*)/i
|
|
1781
1738
|
],
|
|
1782
|
-
[[d, /_/g, " "], [u, "Nokia"], [l,
|
|
1739
|
+
[[d, /_/g, " "], [u, "Nokia"], [l, m]],
|
|
1783
1740
|
[
|
|
1784
1741
|
// Google
|
|
1785
1742
|
/(pixel c)\b/i
|
|
1786
1743
|
// Google Pixel C
|
|
1787
1744
|
],
|
|
1788
|
-
[d, [u,
|
|
1745
|
+
[d, [u, Ie], [l, f]],
|
|
1789
1746
|
[
|
|
1790
1747
|
/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i
|
|
1791
1748
|
// Google Pixel
|
|
1792
1749
|
],
|
|
1793
|
-
[d, [u,
|
|
1750
|
+
[d, [u, Ie], [l, m]],
|
|
1794
1751
|
[
|
|
1795
1752
|
// Sony
|
|
1796
1753
|
/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i
|
|
1797
1754
|
],
|
|
1798
|
-
[d, [u,
|
|
1755
|
+
[d, [u, Ae], [l, m]],
|
|
1799
1756
|
[
|
|
1800
1757
|
/sony tablet [ps]/i,
|
|
1801
1758
|
/\b(?:sony)?sgp\w+(?: bui|\))/i
|
|
1802
1759
|
],
|
|
1803
|
-
[[d, "Xperia Tablet"], [u,
|
|
1760
|
+
[[d, "Xperia Tablet"], [u, Ae], [l, f]],
|
|
1804
1761
|
[
|
|
1805
1762
|
// OnePlus
|
|
1806
1763
|
/ (kb2005|in20[12]5|be20[12][59])\b/i,
|
|
1807
1764
|
/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i
|
|
1808
1765
|
],
|
|
1809
|
-
[d, [u, "OnePlus"], [l,
|
|
1766
|
+
[d, [u, "OnePlus"], [l, m]],
|
|
1810
1767
|
[
|
|
1811
1768
|
// Amazon
|
|
1812
1769
|
/(alexa)webm/i,
|
|
@@ -1815,12 +1772,12 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1815
1772
|
/(kf[a-z]+)( bui|\)).+silk\//i
|
|
1816
1773
|
// Kindle Fire HD
|
|
1817
1774
|
],
|
|
1818
|
-
[d, [u,
|
|
1775
|
+
[d, [u, Se], [l, f]],
|
|
1819
1776
|
[
|
|
1820
1777
|
/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i
|
|
1821
1778
|
// Fire Phone
|
|
1822
1779
|
],
|
|
1823
|
-
[[d, /(.+)/g, "Fire Phone $1"], [u,
|
|
1780
|
+
[[d, /(.+)/g, "Fire Phone $1"], [u, Se], [l, m]],
|
|
1824
1781
|
[
|
|
1825
1782
|
// BlackBerry
|
|
1826
1783
|
/(playbook);[-\w\),; ]+(rim)/i
|
|
@@ -1832,16 +1789,16 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1832
1789
|
/\(bb10; (\w+)/i
|
|
1833
1790
|
// BlackBerry 10
|
|
1834
1791
|
],
|
|
1835
|
-
[d, [u,
|
|
1792
|
+
[d, [u, bt], [l, m]],
|
|
1836
1793
|
[
|
|
1837
1794
|
// Asus
|
|
1838
1795
|
/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i
|
|
1839
1796
|
],
|
|
1840
|
-
[d, [u,
|
|
1797
|
+
[d, [u, wt], [l, f]],
|
|
1841
1798
|
[
|
|
1842
1799
|
/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i
|
|
1843
1800
|
],
|
|
1844
|
-
[d, [u,
|
|
1801
|
+
[d, [u, wt], [l, m]],
|
|
1845
1802
|
[
|
|
1846
1803
|
// HTC
|
|
1847
1804
|
/(nexus 9)/i
|
|
@@ -1856,7 +1813,7 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1856
1813
|
/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i
|
|
1857
1814
|
// Alcatel/GeeksPhone/Nexian/Panasonic/Sony
|
|
1858
1815
|
],
|
|
1859
|
-
[u, [d, /_/g, " "], [l,
|
|
1816
|
+
[u, [d, /_/g, " "], [l, m]],
|
|
1860
1817
|
[
|
|
1861
1818
|
// Acer
|
|
1862
1819
|
/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i
|
|
@@ -1867,12 +1824,12 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1867
1824
|
/droid.+; (m[1-5] note) bui/i,
|
|
1868
1825
|
/\bmz-([-\w]{2,})/i
|
|
1869
1826
|
],
|
|
1870
|
-
[d, [u, "Meizu"], [l,
|
|
1827
|
+
[d, [u, "Meizu"], [l, m]],
|
|
1871
1828
|
[
|
|
1872
1829
|
// Ulefone
|
|
1873
1830
|
/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i
|
|
1874
1831
|
],
|
|
1875
|
-
[d, [u, "Ulefone"], [l,
|
|
1832
|
+
[d, [u, "Ulefone"], [l, m]],
|
|
1876
1833
|
[
|
|
1877
1834
|
// MIXED
|
|
1878
1835
|
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,
|
|
@@ -1890,7 +1847,7 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1890
1847
|
/(oppo) ?([\w ]+) bui/i
|
|
1891
1848
|
// OPPO
|
|
1892
1849
|
],
|
|
1893
|
-
[u, d, [l,
|
|
1850
|
+
[u, d, [l, m]],
|
|
1894
1851
|
[
|
|
1895
1852
|
/(kobo)\s(ereader|touch)/i,
|
|
1896
1853
|
// Kobo
|
|
@@ -1906,12 +1863,12 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1906
1863
|
/(surface duo)/i
|
|
1907
1864
|
// Surface Duo
|
|
1908
1865
|
],
|
|
1909
|
-
[d, [u,
|
|
1866
|
+
[d, [u, Ue], [l, f]],
|
|
1910
1867
|
[
|
|
1911
1868
|
/droid [\d\.]+; (fp\du?)(?: b|\))/i
|
|
1912
1869
|
// Fairphone
|
|
1913
1870
|
],
|
|
1914
|
-
[d, [u, "Fairphone"], [l,
|
|
1871
|
+
[d, [u, "Fairphone"], [l, m]],
|
|
1915
1872
|
[
|
|
1916
1873
|
/(shield[\w ]+) b/i
|
|
1917
1874
|
// Nvidia Shield Tablets
|
|
@@ -1921,21 +1878,21 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1921
1878
|
/(sprint) (\w+)/i
|
|
1922
1879
|
// Sprint Phones
|
|
1923
1880
|
],
|
|
1924
|
-
[u, d, [l,
|
|
1881
|
+
[u, d, [l, m]],
|
|
1925
1882
|
[
|
|
1926
1883
|
/(kin\.[onetw]{3})/i
|
|
1927
1884
|
// Microsoft Kin
|
|
1928
1885
|
],
|
|
1929
|
-
[[d, /\./g, " "], [u,
|
|
1886
|
+
[[d, /\./g, " "], [u, Ue], [l, m]],
|
|
1930
1887
|
[
|
|
1931
1888
|
/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i
|
|
1932
1889
|
// Zebra
|
|
1933
1890
|
],
|
|
1934
|
-
[d, [u,
|
|
1891
|
+
[d, [u, Qe], [l, f]],
|
|
1935
1892
|
[
|
|
1936
1893
|
/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i
|
|
1937
1894
|
],
|
|
1938
|
-
[d, [u,
|
|
1895
|
+
[d, [u, Qe], [l, m]],
|
|
1939
1896
|
[
|
|
1940
1897
|
///////////////////
|
|
1941
1898
|
// SMARTTVS
|
|
@@ -1943,64 +1900,64 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
1943
1900
|
/smart-tv.+(samsung)/i
|
|
1944
1901
|
// Samsung
|
|
1945
1902
|
],
|
|
1946
|
-
[u, [l,
|
|
1903
|
+
[u, [l, I]],
|
|
1947
1904
|
[
|
|
1948
1905
|
/hbbtv.+maple;(\d+)/i
|
|
1949
1906
|
],
|
|
1950
|
-
[[d, /^/, "SmartTV"], [u,
|
|
1907
|
+
[[d, /^/, "SmartTV"], [u, Te], [l, I]],
|
|
1951
1908
|
[
|
|
1952
1909
|
/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i
|
|
1953
1910
|
// LG SmartTV
|
|
1954
1911
|
],
|
|
1955
|
-
[[u,
|
|
1912
|
+
[[u, $e], [l, I]],
|
|
1956
1913
|
[
|
|
1957
1914
|
/(apple) ?tv/i
|
|
1958
1915
|
// Apple TV
|
|
1959
1916
|
],
|
|
1960
|
-
[u, [d,
|
|
1917
|
+
[u, [d, we + " TV"], [l, I]],
|
|
1961
1918
|
[
|
|
1962
1919
|
/crkey/i
|
|
1963
1920
|
// Google Chromecast
|
|
1964
1921
|
],
|
|
1965
|
-
[[d,
|
|
1922
|
+
[[d, Pe + "cast"], [u, Ie], [l, I]],
|
|
1966
1923
|
[
|
|
1967
1924
|
/droid.+aft(\w+)( bui|\))/i
|
|
1968
1925
|
// Fire TV
|
|
1969
1926
|
],
|
|
1970
|
-
[d, [u,
|
|
1927
|
+
[d, [u, Se], [l, I]],
|
|
1971
1928
|
[
|
|
1972
1929
|
/\(dtv[\);].+(aquos)/i,
|
|
1973
1930
|
/(aquos-tv[\w ]+)\)/i
|
|
1974
1931
|
// Sharp
|
|
1975
1932
|
],
|
|
1976
|
-
[d, [u, yt], [l,
|
|
1933
|
+
[d, [u, yt], [l, I]],
|
|
1977
1934
|
[
|
|
1978
1935
|
/(bravia[\w ]+)( bui|\))/i
|
|
1979
1936
|
// Sony
|
|
1980
1937
|
],
|
|
1981
|
-
[d, [u,
|
|
1938
|
+
[d, [u, Ae], [l, I]],
|
|
1982
1939
|
[
|
|
1983
1940
|
/(mitv-\w{5}) bui/i
|
|
1984
1941
|
// Xiaomi
|
|
1985
1942
|
],
|
|
1986
|
-
[d, [u,
|
|
1943
|
+
[d, [u, je], [l, I]],
|
|
1987
1944
|
[
|
|
1988
1945
|
/Hbbtv.*(technisat) (.*);/i
|
|
1989
1946
|
// TechniSAT
|
|
1990
1947
|
],
|
|
1991
|
-
[u, d, [l,
|
|
1948
|
+
[u, d, [l, I]],
|
|
1992
1949
|
[
|
|
1993
1950
|
/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,
|
|
1994
1951
|
// Roku
|
|
1995
1952
|
/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i
|
|
1996
1953
|
// HbbTV devices
|
|
1997
1954
|
],
|
|
1998
|
-
[[u,
|
|
1955
|
+
[[u, ye], [d, ye], [l, I]],
|
|
1999
1956
|
[
|
|
2000
1957
|
/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i
|
|
2001
1958
|
// SmartTV from Unidentified Vendors
|
|
2002
1959
|
],
|
|
2003
|
-
[[l,
|
|
1960
|
+
[[l, I]],
|
|
2004
1961
|
[
|
|
2005
1962
|
///////////////////
|
|
2006
1963
|
// CONSOLES
|
|
@@ -2010,22 +1967,22 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
2010
1967
|
/(nintendo) (\w+)/i
|
|
2011
1968
|
// Nintendo
|
|
2012
1969
|
],
|
|
2013
|
-
[u, d, [l,
|
|
1970
|
+
[u, d, [l, Z]],
|
|
2014
1971
|
[
|
|
2015
1972
|
/droid.+; (shield) bui/i
|
|
2016
1973
|
// Nvidia
|
|
2017
1974
|
],
|
|
2018
|
-
[d, [u, "Nvidia"], [l,
|
|
1975
|
+
[d, [u, "Nvidia"], [l, Z]],
|
|
2019
1976
|
[
|
|
2020
1977
|
/(playstation \w+)/i
|
|
2021
1978
|
// Playstation
|
|
2022
1979
|
],
|
|
2023
|
-
[d, [u,
|
|
1980
|
+
[d, [u, Ae], [l, Z]],
|
|
2024
1981
|
[
|
|
2025
1982
|
/\b(xbox(?: one)?(?!; xbox))[\); ]/i
|
|
2026
1983
|
// Microsoft Xbox
|
|
2027
1984
|
],
|
|
2028
|
-
[d, [u,
|
|
1985
|
+
[d, [u, Ue], [l, Z]],
|
|
2029
1986
|
[
|
|
2030
1987
|
///////////////////
|
|
2031
1988
|
// WEARABLES
|
|
@@ -2033,26 +1990,26 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
2033
1990
|
/((pebble))app/i
|
|
2034
1991
|
// Pebble
|
|
2035
1992
|
],
|
|
2036
|
-
[u, d, [l,
|
|
1993
|
+
[u, d, [l, Y]],
|
|
2037
1994
|
[
|
|
2038
1995
|
/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i
|
|
2039
1996
|
// Apple Watch
|
|
2040
1997
|
],
|
|
2041
|
-
[d, [u,
|
|
1998
|
+
[d, [u, we], [l, Y]],
|
|
2042
1999
|
[
|
|
2043
2000
|
/droid.+; (glass) \d/i
|
|
2044
2001
|
// Google Glass
|
|
2045
2002
|
],
|
|
2046
|
-
[d, [u,
|
|
2003
|
+
[d, [u, Ie], [l, Y]],
|
|
2047
2004
|
[
|
|
2048
2005
|
/droid.+; (wt63?0{2,3})\)/i
|
|
2049
2006
|
],
|
|
2050
|
-
[d, [u,
|
|
2007
|
+
[d, [u, Qe], [l, Y]],
|
|
2051
2008
|
[
|
|
2052
2009
|
/(quest( 2| pro)?)/i
|
|
2053
2010
|
// Oculus Quest
|
|
2054
2011
|
],
|
|
2055
|
-
[d, [u, vt], [l,
|
|
2012
|
+
[d, [u, vt], [l, Y]],
|
|
2056
2013
|
[
|
|
2057
2014
|
///////////////////
|
|
2058
2015
|
// EMBEDDED
|
|
@@ -2060,12 +2017,12 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
2060
2017
|
/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i
|
|
2061
2018
|
// Tesla
|
|
2062
2019
|
],
|
|
2063
|
-
[u, [l,
|
|
2020
|
+
[u, [l, et]],
|
|
2064
2021
|
[
|
|
2065
2022
|
/(aeobc)\b/i
|
|
2066
2023
|
// Echo Dot
|
|
2067
2024
|
],
|
|
2068
|
-
[d, [u,
|
|
2025
|
+
[d, [u, Se], [l, et]],
|
|
2069
2026
|
[
|
|
2070
2027
|
////////////////////
|
|
2071
2028
|
// MIXED (GENERIC)
|
|
@@ -2073,7 +2030,7 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
2073
2030
|
/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i
|
|
2074
2031
|
// Android Phones from Unidentified Vendors
|
|
2075
2032
|
],
|
|
2076
|
-
[d, [l,
|
|
2033
|
+
[d, [l, m]],
|
|
2077
2034
|
[
|
|
2078
2035
|
/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i
|
|
2079
2036
|
// Android Tablets from Unidentified Vendors
|
|
@@ -2088,7 +2045,7 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
2088
2045
|
/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i
|
|
2089
2046
|
// Unidentifiable Mobile
|
|
2090
2047
|
],
|
|
2091
|
-
[[l,
|
|
2048
|
+
[[l, m]],
|
|
2092
2049
|
[
|
|
2093
2050
|
/(android[-\w\. ]{0,9});.+buil/i
|
|
2094
2051
|
// Generic Android Device
|
|
@@ -2100,12 +2057,12 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
2100
2057
|
/windows.+ edge\/([\w\.]+)/i
|
|
2101
2058
|
// EdgeHTML
|
|
2102
2059
|
],
|
|
2103
|
-
[
|
|
2060
|
+
[c, [o, mi + "HTML"]],
|
|
2104
2061
|
[
|
|
2105
2062
|
/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i
|
|
2106
2063
|
// Blink
|
|
2107
2064
|
],
|
|
2108
|
-
[
|
|
2065
|
+
[c, [o, "Blink"]],
|
|
2109
2066
|
[
|
|
2110
2067
|
/(presto)\/([\w\.]+)/i,
|
|
2111
2068
|
// Presto
|
|
@@ -2119,12 +2076,12 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
2119
2076
|
// iCab
|
|
2120
2077
|
/\b(libweb)/i
|
|
2121
2078
|
],
|
|
2122
|
-
[o,
|
|
2079
|
+
[o, c],
|
|
2123
2080
|
[
|
|
2124
2081
|
/rv\:([\w\.]{1,9})\b.+(gecko)/i
|
|
2125
2082
|
// Gecko
|
|
2126
2083
|
],
|
|
2127
|
-
[
|
|
2084
|
+
[c, o]
|
|
2128
2085
|
],
|
|
2129
2086
|
os: [
|
|
2130
2087
|
[
|
|
@@ -2132,19 +2089,19 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
2132
2089
|
/microsoft (windows) (vista|xp)/i
|
|
2133
2090
|
// Windows (iTunes)
|
|
2134
2091
|
],
|
|
2135
|
-
[o,
|
|
2092
|
+
[o, c],
|
|
2136
2093
|
[
|
|
2137
2094
|
/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i
|
|
2138
2095
|
// Windows Phone
|
|
2139
2096
|
],
|
|
2140
|
-
[o, [
|
|
2097
|
+
[o, [c, Be, Mt]],
|
|
2141
2098
|
[
|
|
2142
2099
|
/windows nt 6\.2; (arm)/i,
|
|
2143
2100
|
// Windows RT
|
|
2144
2101
|
/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,
|
|
2145
2102
|
/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i
|
|
2146
2103
|
],
|
|
2147
|
-
[[
|
|
2104
|
+
[[c, Be, Mt], [o, it]],
|
|
2148
2105
|
[
|
|
2149
2106
|
// iOS/macOS
|
|
2150
2107
|
/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,
|
|
@@ -2152,19 +2109,19 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
2152
2109
|
/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,
|
|
2153
2110
|
/cfnetwork\/.+darwin/i
|
|
2154
2111
|
],
|
|
2155
|
-
[[
|
|
2112
|
+
[[c, /_/g, "."], [o, "iOS"]],
|
|
2156
2113
|
[
|
|
2157
2114
|
/(mac os x) ?([\w\. ]*)/i,
|
|
2158
2115
|
/(macintosh|mac_powerpc\b)(?!.+haiku)/i
|
|
2159
2116
|
// Mac OS
|
|
2160
2117
|
],
|
|
2161
|
-
[[o, "macOS"], [
|
|
2118
|
+
[[o, "macOS"], [c, /_/g, "."]],
|
|
2162
2119
|
[
|
|
2163
2120
|
// Mobile OSes
|
|
2164
2121
|
/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i
|
|
2165
2122
|
// Android-x86/HarmonyOS
|
|
2166
2123
|
],
|
|
2167
|
-
[
|
|
2124
|
+
[c, o],
|
|
2168
2125
|
[
|
|
2169
2126
|
// Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS
|
|
2170
2127
|
/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,
|
|
@@ -2175,44 +2132,44 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
2175
2132
|
/\((series40);/i
|
|
2176
2133
|
// Series 40
|
|
2177
2134
|
],
|
|
2178
|
-
[o,
|
|
2135
|
+
[o, c],
|
|
2179
2136
|
[
|
|
2180
2137
|
/\(bb(10);/i
|
|
2181
2138
|
// BlackBerry 10
|
|
2182
2139
|
],
|
|
2183
|
-
[
|
|
2140
|
+
[c, [o, bt]],
|
|
2184
2141
|
[
|
|
2185
2142
|
/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i
|
|
2186
2143
|
// Symbian
|
|
2187
2144
|
],
|
|
2188
|
-
[
|
|
2145
|
+
[c, [o, "Symbian"]],
|
|
2189
2146
|
[
|
|
2190
2147
|
/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i
|
|
2191
2148
|
// Firefox OS
|
|
2192
2149
|
],
|
|
2193
|
-
[
|
|
2150
|
+
[c, [o, be + " OS"]],
|
|
2194
2151
|
[
|
|
2195
2152
|
/web0s;.+rt(tv)/i,
|
|
2196
2153
|
/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i
|
|
2197
2154
|
// WebOS
|
|
2198
2155
|
],
|
|
2199
|
-
[
|
|
2156
|
+
[c, [o, "webOS"]],
|
|
2200
2157
|
[
|
|
2201
2158
|
/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i
|
|
2202
2159
|
// watchOS
|
|
2203
2160
|
],
|
|
2204
|
-
[
|
|
2161
|
+
[c, [o, "watchOS"]],
|
|
2205
2162
|
[
|
|
2206
2163
|
// Google Chromecast
|
|
2207
2164
|
/crkey\/([\d\.]+)/i
|
|
2208
2165
|
// Google Chromecast
|
|
2209
2166
|
],
|
|
2210
|
-
[
|
|
2167
|
+
[c, [o, Pe + "cast"]],
|
|
2211
2168
|
[
|
|
2212
2169
|
/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i
|
|
2213
2170
|
// Chromium OS
|
|
2214
2171
|
],
|
|
2215
|
-
[[o, "Chrome OS"],
|
|
2172
|
+
[[o, "Chrome OS"], c],
|
|
2216
2173
|
[
|
|
2217
2174
|
// Smart TVs
|
|
2218
2175
|
/panasonic;(viera)/i,
|
|
@@ -2244,12 +2201,12 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
2244
2201
|
/(haiku) (\w+)/i
|
|
2245
2202
|
// Haiku
|
|
2246
2203
|
],
|
|
2247
|
-
[o,
|
|
2204
|
+
[o, c],
|
|
2248
2205
|
[
|
|
2249
2206
|
/(sunos) ?([\w\.\d]*)/i
|
|
2250
2207
|
// Solaris
|
|
2251
2208
|
],
|
|
2252
|
-
[[o, "Solaris"],
|
|
2209
|
+
[[o, "Solaris"], c],
|
|
2253
2210
|
[
|
|
2254
2211
|
/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,
|
|
2255
2212
|
// Solaris
|
|
@@ -2260,47 +2217,47 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
2260
2217
|
/(unix) ?([\w\.]*)/i
|
|
2261
2218
|
// UNIX
|
|
2262
2219
|
],
|
|
2263
|
-
[o,
|
|
2220
|
+
[o, c]
|
|
2264
2221
|
]
|
|
2265
|
-
},
|
|
2222
|
+
}, xe = function() {
|
|
2266
2223
|
var i = { init: {}, isIgnore: {}, isIgnoreRgx: {}, toString: {} };
|
|
2267
|
-
return
|
|
2268
|
-
[
|
|
2269
|
-
[
|
|
2270
|
-
[
|
|
2271
|
-
[
|
|
2272
|
-
[P, [o,
|
|
2273
|
-
]),
|
|
2274
|
-
[
|
|
2275
|
-
[
|
|
2276
|
-
[P, [
|
|
2277
|
-
]),
|
|
2278
|
-
[
|
|
2224
|
+
return D.call(i.init, [
|
|
2225
|
+
[T, [o, c, fe]],
|
|
2226
|
+
[_, [M]],
|
|
2227
|
+
[O, [l, d, u]],
|
|
2228
|
+
[F, [o, c]],
|
|
2229
|
+
[P, [o, c]]
|
|
2230
|
+
]), D.call(i.isIgnore, [
|
|
2231
|
+
[T, [c, fe]],
|
|
2232
|
+
[F, [c]],
|
|
2233
|
+
[P, [c]]
|
|
2234
|
+
]), D.call(i.isIgnoreRgx, [
|
|
2235
|
+
[T, / ?browser$/i],
|
|
2279
2236
|
[P, / ?os$/i]
|
|
2280
|
-
]),
|
|
2281
|
-
[
|
|
2282
|
-
[
|
|
2283
|
-
[
|
|
2284
|
-
[
|
|
2285
|
-
[P, [o,
|
|
2237
|
+
]), D.call(i.toString, [
|
|
2238
|
+
[T, [o, c]],
|
|
2239
|
+
[_, [M]],
|
|
2240
|
+
[O, [u, d]],
|
|
2241
|
+
[F, [o, c]],
|
|
2242
|
+
[P, [o, c]]
|
|
2286
2243
|
]), i;
|
|
2287
|
-
}(),
|
|
2288
|
-
var
|
|
2244
|
+
}(), vi = function(i, t) {
|
|
2245
|
+
var e = xe.init[t], a = xe.isIgnore[t] || 0, n = xe.isIgnoreRgx[t] || 0, r = xe.toString[t] || 0;
|
|
2289
2246
|
function s() {
|
|
2290
|
-
|
|
2247
|
+
D.call(this, e);
|
|
2291
2248
|
}
|
|
2292
2249
|
return s.prototype.getItem = function() {
|
|
2293
2250
|
return i;
|
|
2294
2251
|
}, s.prototype.withClientHints = function() {
|
|
2295
|
-
return H ? H.getHighEntropyValues(
|
|
2252
|
+
return H ? H.getHighEntropyValues(Dt).then(function(h) {
|
|
2296
2253
|
return i.setCH(new Nt(h, !1)).parseCH().get();
|
|
2297
2254
|
}) : i.parseCH().get();
|
|
2298
2255
|
}, s.prototype.withFeatureCheck = function() {
|
|
2299
2256
|
return i.detectFeature().get();
|
|
2300
|
-
},
|
|
2257
|
+
}, t != te && (s.prototype.is = function(h) {
|
|
2301
2258
|
var g = !1;
|
|
2302
2259
|
for (var w in this)
|
|
2303
|
-
if (this.hasOwnProperty(w) && !
|
|
2260
|
+
if (this.hasOwnProperty(w) && !at(a, w) && q(n ? $(n, this[w]) : this[w]) == q(n ? $(n, h) : h)) {
|
|
2304
2261
|
if (g = !0, h != z)
|
|
2305
2262
|
break;
|
|
2306
2263
|
} else if (h == z && g) {
|
|
@@ -2309,9 +2266,9 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
2309
2266
|
}
|
|
2310
2267
|
return g;
|
|
2311
2268
|
}, s.prototype.toString = function() {
|
|
2312
|
-
var h =
|
|
2313
|
-
for (var g in
|
|
2314
|
-
typeof this[
|
|
2269
|
+
var h = de;
|
|
2270
|
+
for (var g in r)
|
|
2271
|
+
typeof this[r[g]] !== z && (h += (h ? " " : de) + this[r[g]]);
|
|
2315
2272
|
return h || z;
|
|
2316
2273
|
}), H || (s.prototype.then = function(h) {
|
|
2317
2274
|
var g = this, w = function() {
|
|
@@ -2322,179 +2279,180 @@ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue
|
|
|
2322
2279
|
is: s.prototype.is,
|
|
2323
2280
|
toString: s.prototype.toString
|
|
2324
2281
|
};
|
|
2325
|
-
var
|
|
2326
|
-
return h(
|
|
2282
|
+
var p = new w();
|
|
2283
|
+
return h(p), p;
|
|
2327
2284
|
}), new s();
|
|
2328
2285
|
};
|
|
2329
|
-
function Nt(i,
|
|
2330
|
-
if (i = i || {},
|
|
2331
|
-
|
|
2332
|
-
[
|
|
2333
|
-
[
|
|
2334
|
-
[
|
|
2335
|
-
[d,
|
|
2336
|
-
[
|
|
2337
|
-
[
|
|
2338
|
-
[
|
|
2339
|
-
[
|
|
2340
|
-
[
|
|
2286
|
+
function Nt(i, t) {
|
|
2287
|
+
if (i = i || {}, D.call(this, Dt), t)
|
|
2288
|
+
D.call(this, [
|
|
2289
|
+
[nt, Xe(i[G])],
|
|
2290
|
+
[st, Xe(i[li])],
|
|
2291
|
+
[m, /\?1/.test(i[wi])],
|
|
2292
|
+
[d, me(i[bi])],
|
|
2293
|
+
[ee, me(i[Ft])],
|
|
2294
|
+
[ot, me(i[pi])],
|
|
2295
|
+
[M, me(i[ui])],
|
|
2296
|
+
[W, Xe(i[gi])],
|
|
2297
|
+
[Re, me(i[hi])]
|
|
2341
2298
|
]);
|
|
2342
2299
|
else
|
|
2343
|
-
for (var
|
|
2344
|
-
this.hasOwnProperty(
|
|
2300
|
+
for (var e in i)
|
|
2301
|
+
this.hasOwnProperty(e) && typeof i[e] !== z && (this[e] = i[e]);
|
|
2345
2302
|
}
|
|
2346
|
-
function
|
|
2347
|
-
return this.get = function(
|
|
2348
|
-
return
|
|
2349
|
-
}, this.set = function(
|
|
2350
|
-
return this.data[
|
|
2351
|
-
}, this.setCH = function(
|
|
2352
|
-
return this.uaCH =
|
|
2303
|
+
function Tt(i, t, e, a) {
|
|
2304
|
+
return this.get = function(n) {
|
|
2305
|
+
return n ? this.data.hasOwnProperty(n) ? this.data[n] : void 0 : this.data;
|
|
2306
|
+
}, this.set = function(n, r) {
|
|
2307
|
+
return this.data[n] = r, this;
|
|
2308
|
+
}, this.setCH = function(n) {
|
|
2309
|
+
return this.uaCH = n, this;
|
|
2353
2310
|
}, this.detectFeature = function() {
|
|
2354
|
-
if (
|
|
2311
|
+
if (S && S.userAgent == this.ua)
|
|
2355
2312
|
switch (this.itemType) {
|
|
2356
|
-
case
|
|
2357
|
-
|
|
2313
|
+
case T:
|
|
2314
|
+
S.brave && typeof S.brave.isBrave == Ye && this.set(o, "Brave");
|
|
2358
2315
|
break;
|
|
2359
|
-
case
|
|
2360
|
-
!this.get(l) && H && H[
|
|
2316
|
+
case O:
|
|
2317
|
+
!this.get(l) && H && H[m] && this.set(l, m), this.get(d) == "Macintosh" && S && typeof S.standalone !== z && S.maxTouchPoints && S.maxTouchPoints > 2 && this.set(d, "iPad").set(l, f);
|
|
2361
2318
|
break;
|
|
2362
2319
|
case P:
|
|
2363
|
-
!this.get(o) && H && H[
|
|
2320
|
+
!this.get(o) && H && H[ee] && this.set(o, H[ee]);
|
|
2364
2321
|
break;
|
|
2365
|
-
case
|
|
2366
|
-
var
|
|
2367
|
-
return
|
|
2322
|
+
case te:
|
|
2323
|
+
var n = this.data, r = function(s) {
|
|
2324
|
+
return n[s].getItem().detectFeature().get();
|
|
2368
2325
|
};
|
|
2369
|
-
this.set(
|
|
2326
|
+
this.set(T, r(T)).set(_, r(_)).set(O, r(O)).set(F, r(F)).set(P, r(P));
|
|
2370
2327
|
}
|
|
2371
2328
|
return this;
|
|
2372
2329
|
}, this.parseUA = function() {
|
|
2373
|
-
return this.itemType !=
|
|
2330
|
+
return this.itemType != te && Ct.call(this.data, this.ua, this.rgxMap), this.itemType == T && this.set(fe, Ke(this.get(c))), this;
|
|
2374
2331
|
}, this.parseCH = function() {
|
|
2375
|
-
var
|
|
2332
|
+
var n = this.uaCH, r = this.rgxMap;
|
|
2376
2333
|
switch (this.itemType) {
|
|
2377
|
-
case
|
|
2378
|
-
var s =
|
|
2334
|
+
case T:
|
|
2335
|
+
var s = n[st] || n[nt], h;
|
|
2379
2336
|
if (s)
|
|
2380
2337
|
for (var g in s) {
|
|
2381
|
-
var w =
|
|
2382
|
-
!/not.a.brand/i.test(w) && (!h || /chrom/i.test(h) && !/chromi/i.test(w)) && (this.set(o, w).set(
|
|
2338
|
+
var w = $(/(Google|Microsoft) /, s[g].brand || s[g]), p = s[g].version;
|
|
2339
|
+
!/not.a.brand/i.test(w) && (!h || /chrom/i.test(h) && !/chromi/i.test(w)) && (this.set(o, w).set(c, p).set(fe, Ke(p)), h = w);
|
|
2383
2340
|
}
|
|
2384
2341
|
break;
|
|
2385
|
-
case D:
|
|
2386
|
-
var A = a[k];
|
|
2387
|
-
A && (A && a[Ve] == "64" && (A += "64"), kt.call(this.data, A + ";", c));
|
|
2388
|
-
break;
|
|
2389
2342
|
case _:
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2343
|
+
var A = n[M];
|
|
2344
|
+
A && (A && n[Re] == "64" && (A += "64"), Ct.call(this.data, A + ";", r));
|
|
2345
|
+
break;
|
|
2346
|
+
case O:
|
|
2347
|
+
if (n[m] && this.set(l, m), n[d] && this.set(d, n[d]), n[d] == "Xbox" && this.set(l, Z).set(u, Ue), n[W]) {
|
|
2348
|
+
var R;
|
|
2349
|
+
if (typeof n[W] != "string")
|
|
2350
|
+
for (var Q = 0; !R && Q < n[W].length; )
|
|
2351
|
+
R = Be(n[W][Q++], St);
|
|
2395
2352
|
else
|
|
2396
|
-
|
|
2397
|
-
this.set(l,
|
|
2353
|
+
R = Be(n[W], St);
|
|
2354
|
+
this.set(l, R);
|
|
2398
2355
|
}
|
|
2399
2356
|
break;
|
|
2400
2357
|
case P:
|
|
2401
|
-
var
|
|
2402
|
-
if (
|
|
2403
|
-
var L =
|
|
2404
|
-
|
|
2358
|
+
var X = n[ee];
|
|
2359
|
+
if (X) {
|
|
2360
|
+
var L = n[ot];
|
|
2361
|
+
X == it && (L = parseInt(Ke(L), 10) >= 13 ? "11" : "10"), this.set(o, X).set(c, L);
|
|
2405
2362
|
}
|
|
2406
|
-
this.get(o) ==
|
|
2363
|
+
this.get(o) == it && n[d] == "Xbox" && this.set(o, "Xbox").set(c, void 0);
|
|
2407
2364
|
break;
|
|
2408
|
-
case
|
|
2409
|
-
var
|
|
2410
|
-
return
|
|
2365
|
+
case te:
|
|
2366
|
+
var he = this.data, x = function(B) {
|
|
2367
|
+
return he[B].getItem().setCH(n).parseCH().get();
|
|
2411
2368
|
};
|
|
2412
|
-
this.set(
|
|
2369
|
+
this.set(T, x(T)).set(_, x(_)).set(O, x(O)).set(F, x(F)).set(P, x(P));
|
|
2413
2370
|
}
|
|
2414
2371
|
return this;
|
|
2415
|
-
},
|
|
2372
|
+
}, D.call(this, [
|
|
2416
2373
|
["itemType", i],
|
|
2417
|
-
["ua",
|
|
2418
|
-
["uaCH",
|
|
2419
|
-
["rgxMap",
|
|
2420
|
-
["data",
|
|
2374
|
+
["ua", t],
|
|
2375
|
+
["uaCH", a],
|
|
2376
|
+
["rgxMap", e],
|
|
2377
|
+
["data", vi(this, i)]
|
|
2421
2378
|
]), this;
|
|
2422
2379
|
}
|
|
2423
|
-
function
|
|
2424
|
-
if (typeof i ===
|
|
2425
|
-
return new
|
|
2426
|
-
var
|
|
2380
|
+
function N(i, t, e) {
|
|
2381
|
+
if (typeof i === le ? (Et(i) ? (typeof t === le && (e = t), t = i) : (e = i, t = void 0), i = void 0) : typeof i === Ze && !Et(t) && (e = t, t = void 0), !(this instanceof N))
|
|
2382
|
+
return new N(i, t, e).getResult();
|
|
2383
|
+
var a = typeof i === Ze ? i : (
|
|
2427
2384
|
// Passed user-agent string
|
|
2428
|
-
|
|
2385
|
+
S && S.userAgent ? S.userAgent : (
|
|
2429
2386
|
// navigator.userAgent
|
|
2430
|
-
|
|
2387
|
+
e && e[gt] ? e[gt] : (
|
|
2431
2388
|
// User-Agent from passed headers
|
|
2432
|
-
|
|
2389
|
+
de
|
|
2433
2390
|
)
|
|
2434
2391
|
)
|
|
2435
|
-
),
|
|
2436
|
-
return h ==
|
|
2437
|
-
return new
|
|
2392
|
+
), n = new Nt(e, !0), r = t ? yi(It, t) : It, s = function(h) {
|
|
2393
|
+
return h == te ? function() {
|
|
2394
|
+
return new Tt(h, a, r, n).set("ua", a).set(T, this.getBrowser()).set(_, this.getCPU()).set(O, this.getDevice()).set(F, this.getEngine()).set(P, this.getOS()).get();
|
|
2438
2395
|
} : function() {
|
|
2439
|
-
return new
|
|
2396
|
+
return new Tt(h, a, r[h], n).parseUA().get();
|
|
2440
2397
|
};
|
|
2441
2398
|
};
|
|
2442
|
-
return
|
|
2443
|
-
["getBrowser", s(
|
|
2444
|
-
["getCPU", s(
|
|
2445
|
-
["getDevice", s(
|
|
2446
|
-
["getEngine", s(
|
|
2399
|
+
return D.call(this, [
|
|
2400
|
+
["getBrowser", s(T)],
|
|
2401
|
+
["getCPU", s(_)],
|
|
2402
|
+
["getDevice", s(O)],
|
|
2403
|
+
["getEngine", s(F)],
|
|
2447
2404
|
["getOS", s(P)],
|
|
2448
|
-
["getResult", s(
|
|
2405
|
+
["getResult", s(te)],
|
|
2449
2406
|
["getUA", function() {
|
|
2450
|
-
return
|
|
2407
|
+
return a;
|
|
2451
2408
|
}],
|
|
2452
2409
|
["setUA", function(h) {
|
|
2453
|
-
return
|
|
2410
|
+
return ue(h) && (a = h.length > tt ? ye(h, tt) : h), this;
|
|
2454
2411
|
}]
|
|
2455
|
-
]).setUA(
|
|
2412
|
+
]).setUA(a), this;
|
|
2456
2413
|
}
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
class
|
|
2463
|
-
constructor(e,
|
|
2414
|
+
N.VERSION = di;
|
|
2415
|
+
N.BROWSER = He([o, c, fe]);
|
|
2416
|
+
N.CPU = He([M]);
|
|
2417
|
+
N.DEVICE = He([d, u, l, Z, m, I, f, Y, et]);
|
|
2418
|
+
N.ENGINE = N.OS = He([o, c]);
|
|
2419
|
+
class ki {
|
|
2420
|
+
constructor(t, e, a) {
|
|
2464
2421
|
b(this, "trackers");
|
|
2465
2422
|
b(this, "config");
|
|
2466
|
-
this
|
|
2423
|
+
b(this, "sdkConfig");
|
|
2424
|
+
this.trackers = t, this.config = e, this.sdkConfig = a;
|
|
2467
2425
|
}
|
|
2468
|
-
on(
|
|
2469
|
-
const
|
|
2470
|
-
s.data.message !== `kalamba:wrapper-telemetry:${
|
|
2426
|
+
on(t, e, a) {
|
|
2427
|
+
const n = function(s) {
|
|
2428
|
+
s.data.message !== `kalamba:wrapper-telemetry:${t}` && s.data.message !== `kalamba:wrapper:${t}` || e(s.data.payload);
|
|
2471
2429
|
};
|
|
2472
|
-
window.addEventListener("message",
|
|
2430
|
+
window.addEventListener("message", n, a);
|
|
2473
2431
|
}
|
|
2474
|
-
track(
|
|
2475
|
-
this.trackers.forEach((
|
|
2432
|
+
track(t, e) {
|
|
2433
|
+
this.trackers.forEach((a) => a.track(t, e));
|
|
2476
2434
|
}
|
|
2477
2435
|
}
|
|
2478
|
-
function
|
|
2479
|
-
return i.reduce((
|
|
2436
|
+
function At(i) {
|
|
2437
|
+
return i.reduce((t, e) => t + e, 0);
|
|
2480
2438
|
}
|
|
2481
|
-
function
|
|
2482
|
-
const
|
|
2483
|
-
return Math.sqrt(
|
|
2439
|
+
function Ei(i) {
|
|
2440
|
+
const t = i.length, e = At(i) / t, a = i.map((r) => Math.pow(r - e, 2)), n = At(a) / t;
|
|
2441
|
+
return Math.sqrt(n);
|
|
2484
2442
|
}
|
|
2485
|
-
class
|
|
2443
|
+
class Pt {
|
|
2486
2444
|
constructor() {
|
|
2487
2445
|
b(this, "rafId", -1);
|
|
2488
2446
|
b(this, "startTime", 0);
|
|
2489
2447
|
b(this, "stopTime", 0);
|
|
2490
2448
|
b(this, "frames", []);
|
|
2491
2449
|
b(this, "calculateFPS", () => {
|
|
2492
|
-
const
|
|
2493
|
-
return this.frames.map((
|
|
2450
|
+
const t = Math.floor((this.stopTime - this.startTime) / 1e3);
|
|
2451
|
+
return this.frames.map((e) => Math.floor((e - this.startTime) / 1e3)).reduce((e, a, n, r) => (r[n] !== r[n - 1] ? e.push(1) : e[e.length - 1]++, e), []).slice(0, t);
|
|
2494
2452
|
});
|
|
2495
2453
|
b(this, "getReport", () => {
|
|
2496
|
-
const
|
|
2497
|
-
return { fpsAvg:
|
|
2454
|
+
const t = this.calculateFPS(), e = Math.floor(this.frames.length / ((this.stopTime - this.startTime) / 1e3)), a = t.length > 0 ? Math.max(...t) : e, n = t.length > 0 ? Math.min(...t) : e, r = t.length > 0 ? Ei(t) : 0;
|
|
2455
|
+
return { fpsAvg: e, fpsMax: a, fpsMin: n, fpsStdDev: r };
|
|
2498
2456
|
});
|
|
2499
2457
|
b(this, "start", () => {
|
|
2500
2458
|
this.startTime = Date.now(), this.frames = [], this.trackFrames();
|
|
@@ -2507,8 +2465,8 @@ class Ot {
|
|
|
2507
2465
|
});
|
|
2508
2466
|
}
|
|
2509
2467
|
}
|
|
2510
|
-
const
|
|
2511
|
-
function
|
|
2468
|
+
const Ci = "landscape", Mi = "portrait";
|
|
2469
|
+
function Si() {
|
|
2512
2470
|
try {
|
|
2513
2471
|
const i = document.createElement("canvas");
|
|
2514
2472
|
return !!window.WebGLRenderingContext && (i.getContext("webgl") || i.getContext("experimental-webgl")) instanceof WebGLRenderingContext;
|
|
@@ -2516,117 +2474,117 @@ function Ci() {
|
|
|
2516
2474
|
return !1;
|
|
2517
2475
|
}
|
|
2518
2476
|
}
|
|
2519
|
-
async function
|
|
2477
|
+
async function Ii() {
|
|
2520
2478
|
if (!window.createImageBitmap)
|
|
2521
2479
|
return !1;
|
|
2522
|
-
const
|
|
2480
|
+
const e = await (await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();
|
|
2523
2481
|
try {
|
|
2524
|
-
return await createImageBitmap(
|
|
2482
|
+
return await createImageBitmap(e), !0;
|
|
2525
2483
|
} catch {
|
|
2526
2484
|
return !1;
|
|
2527
2485
|
}
|
|
2528
2486
|
}
|
|
2529
|
-
function
|
|
2530
|
-
return window.innerWidth >= window.innerHeight ?
|
|
2487
|
+
function Je() {
|
|
2488
|
+
return window.innerWidth >= window.innerHeight ? Ci : Mi;
|
|
2531
2489
|
}
|
|
2532
|
-
var
|
|
2533
|
-
class
|
|
2534
|
-
constructor(...
|
|
2535
|
-
super(...
|
|
2490
|
+
var _e, ae, ne, se, ke, Fe, Ee, De;
|
|
2491
|
+
class qi extends ki {
|
|
2492
|
+
constructor(...e) {
|
|
2493
|
+
super(...e);
|
|
2536
2494
|
b(this, "FPS_SAMPLE_INTERVAL", 1e4);
|
|
2537
2495
|
// wrapper state
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
}), this.on("autoplay", ({ action:
|
|
2549
|
-
["start", "resume"].includes(
|
|
2550
|
-
}), this.on("settings", ({ fastPlay:
|
|
2551
|
-
|
|
2496
|
+
C(this, _e, 0);
|
|
2497
|
+
C(this, ae, "");
|
|
2498
|
+
C(this, ne, void 0);
|
|
2499
|
+
C(this, se, void 0);
|
|
2500
|
+
C(this, ke, !1);
|
|
2501
|
+
C(this, Fe, !1);
|
|
2502
|
+
C(this, Ee, "");
|
|
2503
|
+
C(this, De, []);
|
|
2504
|
+
v(this, ne, {}), v(this, se, this.deviceInfo()), this.on("state", ({ balance: a, version: n }) => {
|
|
2505
|
+
v(this, ae, n), v(this, _e, a);
|
|
2506
|
+
}), this.on("autoplay", ({ action: a }) => {
|
|
2507
|
+
["start", "resume"].includes(a) ? v(this, ke, !0) : v(this, ke, !1);
|
|
2508
|
+
}), this.on("settings", ({ fastPlay: a }) => {
|
|
2509
|
+
a !== void 0 && v(this, Fe, a);
|
|
2552
2510
|
}), this.registerEvents();
|
|
2553
2511
|
}
|
|
2554
2512
|
async registerEvents() {
|
|
2555
|
-
|
|
2556
|
-
this.track("Device Information",
|
|
2513
|
+
y(this, se).then((e) => {
|
|
2514
|
+
this.track("Device Information", e);
|
|
2557
2515
|
}), this.on("loadStart", () => {
|
|
2558
2516
|
this.track("Game Loading", { progress: 0, step: "initial" });
|
|
2559
|
-
}), this.on("loadProgress", (
|
|
2560
|
-
this.track("Game Loading", { progress:
|
|
2517
|
+
}), this.on("loadProgress", (e) => {
|
|
2518
|
+
this.track("Game Loading", { progress: e.progress });
|
|
2561
2519
|
}), this.on("loadEnd", () => {
|
|
2562
2520
|
this.track("Game Loading", { progress: 100, step: "complete" });
|
|
2563
|
-
}), this.on("error", (
|
|
2521
|
+
}), this.on("error", (e) => {
|
|
2564
2522
|
this.track("System Message", {
|
|
2565
|
-
systemMessageText:
|
|
2566
|
-
systemMessageType:
|
|
2523
|
+
systemMessageText: e.messageCode,
|
|
2524
|
+
systemMessageType: e.type
|
|
2567
2525
|
});
|
|
2568
|
-
}), this.on("openGameResponse", async (
|
|
2569
|
-
|
|
2570
|
-
balanceInCoins:
|
|
2571
|
-
clientVersion:
|
|
2572
|
-
coinValueInCents: this.
|
|
2573
|
-
coinValueInCentsFloat: this.
|
|
2574
|
-
currency: this.
|
|
2575
|
-
defaultBaseBet:
|
|
2576
|
-
defaultBetMultiplier:
|
|
2526
|
+
}), this.on("openGameResponse", async (e) => {
|
|
2527
|
+
v(this, Ee, e.contract.stateType.nextRound), v(this, ne, {
|
|
2528
|
+
balanceInCoins: e.contract.balance.coins,
|
|
2529
|
+
clientVersion: y(this, ae),
|
|
2530
|
+
coinValueInCents: this.sdkConfig.api.coinValueInCents,
|
|
2531
|
+
coinValueInCentsFloat: this.sdkConfig.api.coinValueInCents,
|
|
2532
|
+
currency: this.sdkConfig.api.currency,
|
|
2533
|
+
defaultBaseBet: e.contract.bet.default.base,
|
|
2534
|
+
defaultBetMultiplier: e.contract.bet.default.multiplier,
|
|
2577
2535
|
environment: "release",
|
|
2578
|
-
gameCode: this.
|
|
2579
|
-
gameCodeServer: this.
|
|
2580
|
-
gameModelFile:
|
|
2581
|
-
jurisdiction: this.
|
|
2582
|
-
languageCode: this.
|
|
2536
|
+
gameCode: this.sdkConfig.api.game,
|
|
2537
|
+
gameCodeServer: this.sdkConfig.api.game,
|
|
2538
|
+
gameModelFile: e.contract.gameModel,
|
|
2539
|
+
jurisdiction: this.sdkConfig.api.jurisdiction,
|
|
2540
|
+
languageCode: this.sdkConfig.ui.language,
|
|
2583
2541
|
operatorName: "kalamba",
|
|
2584
|
-
partnerId: this.
|
|
2585
|
-
partnerParentId: this.
|
|
2542
|
+
partnerId: this.sdkConfig.api.brand,
|
|
2543
|
+
partnerParentId: this.sdkConfig.api.integration,
|
|
2586
2544
|
platform: "WEB",
|
|
2587
|
-
playMode: this.
|
|
2545
|
+
playMode: this.sdkConfig.api.playMode,
|
|
2588
2546
|
referrer: window.location.hostname,
|
|
2589
2547
|
// rootTrackingSessionID: 'unknown',
|
|
2590
2548
|
// rtpVariant: 'unknown',
|
|
2591
|
-
serverVersion:
|
|
2549
|
+
serverVersion: e.contract.metaData.version
|
|
2592
2550
|
// testVariants: '',
|
|
2593
|
-
}), this.track("Game Open",
|
|
2594
|
-
}), this.on("playCycleEnd", async (
|
|
2595
|
-
const
|
|
2551
|
+
}), this.track("Game Open", y(this, ne));
|
|
2552
|
+
}), this.on("playCycleEnd", async (e) => {
|
|
2553
|
+
const a = await y(this, se), { base: n, multiplier: r, specialAction: s } = e.contract.bet.lastPaid ?? {}, h = e.contract.balance.coins, g = e.contract.bet.lastPaid.base * e.contract.bet.lastPaid.multiplier, w = e.contract.win.total, p = w - g, A = s || "spin", R = e.contract.roundId;
|
|
2596
2554
|
this.track("Betting Activity", {
|
|
2597
|
-
balance: h -
|
|
2555
|
+
balance: h - p,
|
|
2598
2556
|
balanceAfter: h,
|
|
2599
|
-
baseBet:
|
|
2557
|
+
baseBet: n,
|
|
2600
2558
|
// baseBetIndex,
|
|
2601
|
-
betMultiplier:
|
|
2559
|
+
betMultiplier: r,
|
|
2602
2560
|
betType: A,
|
|
2603
|
-
gameVersion:
|
|
2604
|
-
coinValueInCents: this.
|
|
2605
|
-
coinValueInCentsFloat: this.
|
|
2606
|
-
currency: this.
|
|
2561
|
+
gameVersion: y(this, ae),
|
|
2562
|
+
coinValueInCents: this.sdkConfig.api.coinValueInCents,
|
|
2563
|
+
coinValueInCentsFloat: this.sdkConfig.api.coinValueInCents,
|
|
2564
|
+
currency: this.sdkConfig.api.currency,
|
|
2607
2565
|
environment: "release",
|
|
2608
|
-
gameCode: this.
|
|
2609
|
-
gameCodeServer: this.
|
|
2610
|
-
isMobile:
|
|
2611
|
-
netResult:
|
|
2566
|
+
gameCode: this.sdkConfig.api.game,
|
|
2567
|
+
gameCodeServer: this.sdkConfig.api.game,
|
|
2568
|
+
isMobile: a.isMobile,
|
|
2569
|
+
netResult: p,
|
|
2612
2570
|
operatorName: "kalamba",
|
|
2613
|
-
orientation:
|
|
2614
|
-
partnerId: this.
|
|
2615
|
-
partnerParentId: this.
|
|
2571
|
+
orientation: Je(),
|
|
2572
|
+
partnerId: this.sdkConfig.api.brand,
|
|
2573
|
+
partnerParentId: this.sdkConfig.api.integration,
|
|
2616
2574
|
platform: "WEB",
|
|
2617
|
-
playMode: this.
|
|
2618
|
-
roundId:
|
|
2575
|
+
playMode: this.sdkConfig.api.playMode,
|
|
2576
|
+
roundId: R,
|
|
2619
2577
|
// TODO: uncomment when tracking TrackingEvent.GameSpin is implemented
|
|
2620
2578
|
// roundTypes: [...this.#roundTypes],
|
|
2621
2579
|
roundTypes: ["BaseGame"],
|
|
2622
2580
|
totalBet: g,
|
|
2623
2581
|
totalWin: w
|
|
2624
|
-
}),
|
|
2625
|
-
}), this.on("telemetry.click", (
|
|
2582
|
+
}), v(this, De, []);
|
|
2583
|
+
}), this.on("telemetry.click", (e) => {
|
|
2626
2584
|
this.track("UI Interaction", {
|
|
2627
2585
|
action: "click",
|
|
2628
2586
|
...this.getExtraUiInteractionData(),
|
|
2629
|
-
...
|
|
2587
|
+
...e
|
|
2630
2588
|
});
|
|
2631
2589
|
}), this.on("telemetry.orientationChange", () => {
|
|
2632
2590
|
this.track("UI Interaction", {
|
|
@@ -2636,47 +2594,47 @@ class Wi extends Mi {
|
|
|
2636
2594
|
}), this.reportFpsSample(), this.reportFpsRound();
|
|
2637
2595
|
}
|
|
2638
2596
|
reportFpsSample() {
|
|
2639
|
-
const
|
|
2640
|
-
|
|
2641
|
-
const
|
|
2642
|
-
this.track("FPS Performance", { ...
|
|
2643
|
-
},
|
|
2644
|
-
|
|
2597
|
+
const e = new Pt(), a = () => {
|
|
2598
|
+
e.stop();
|
|
2599
|
+
const r = e.getReport();
|
|
2600
|
+
this.track("FPS Performance", { ...r, fpsType: "sample" }), n();
|
|
2601
|
+
}, n = async () => {
|
|
2602
|
+
e.start(), setTimeout(a, this.FPS_SAMPLE_INTERVAL);
|
|
2645
2603
|
};
|
|
2646
|
-
|
|
2604
|
+
n();
|
|
2647
2605
|
}
|
|
2648
2606
|
reportFpsRound() {
|
|
2649
|
-
const
|
|
2607
|
+
const e = new Pt();
|
|
2650
2608
|
this.on("playCycleStart", () => {
|
|
2651
|
-
|
|
2609
|
+
e.start();
|
|
2652
2610
|
}), this.on("playCycleEnd", () => {
|
|
2653
|
-
|
|
2654
|
-
const
|
|
2655
|
-
this.track("FPS Performance", { ...
|
|
2611
|
+
e.stop();
|
|
2612
|
+
const a = e.getReport();
|
|
2613
|
+
this.track("FPS Performance", { ...a, fpsType: "playCycleStart->playCycleEnd" });
|
|
2656
2614
|
});
|
|
2657
2615
|
}
|
|
2658
2616
|
getExtraUiInteractionData() {
|
|
2659
2617
|
return {
|
|
2660
|
-
orientation:
|
|
2661
|
-
stateType:
|
|
2618
|
+
orientation: Je(),
|
|
2619
|
+
stateType: y(this, Ee)
|
|
2662
2620
|
};
|
|
2663
2621
|
}
|
|
2664
2622
|
async deviceInfo() {
|
|
2665
2623
|
var g;
|
|
2666
|
-
const
|
|
2624
|
+
const e = new N(navigator.userAgent), a = Si(), n = await Ii(), r = e.getBrowser(), s = e.getDevice(), h = e.getOS();
|
|
2667
2625
|
return {
|
|
2668
|
-
browserName:
|
|
2669
|
-
browserVersion:
|
|
2626
|
+
browserName: r.name,
|
|
2627
|
+
browserVersion: r.version,
|
|
2670
2628
|
connection: (g = navigator.connection) == null ? void 0 : g.effectiveType,
|
|
2671
2629
|
deviceName: s.model,
|
|
2672
2630
|
deviceType: s.type,
|
|
2673
2631
|
isMobile: ["mobile", "tablet"].includes(s.type ?? ""),
|
|
2674
|
-
isWebGLSupported:
|
|
2675
|
-
isWebPSupported:
|
|
2632
|
+
isWebGLSupported: a,
|
|
2633
|
+
isWebPSupported: n,
|
|
2676
2634
|
manufacturer: s.vendor,
|
|
2677
2635
|
operatingSystem: h.name,
|
|
2678
2636
|
operatingSystemVersion: h.version,
|
|
2679
|
-
orientation:
|
|
2637
|
+
orientation: Je(),
|
|
2680
2638
|
pixelRatio: window.devicePixelRatio,
|
|
2681
2639
|
screenHeight: window.screen.height,
|
|
2682
2640
|
screenSize: `${window.screen.width}x${window.screen.height}`,
|
|
@@ -2688,123 +2646,124 @@ class Wi extends Mi {
|
|
|
2688
2646
|
};
|
|
2689
2647
|
}
|
|
2690
2648
|
}
|
|
2691
|
-
|
|
2692
|
-
let
|
|
2693
|
-
const
|
|
2694
|
-
function
|
|
2695
|
-
if (!
|
|
2649
|
+
_e = new WeakMap(), ae = new WeakMap(), ne = new WeakMap(), se = new WeakMap(), ke = new WeakMap(), Fe = new WeakMap(), Ee = new WeakMap(), De = new WeakMap();
|
|
2650
|
+
let Oe;
|
|
2651
|
+
const Ti = new Uint8Array(16);
|
|
2652
|
+
function Ai() {
|
|
2653
|
+
if (!Oe && (Oe = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Oe))
|
|
2696
2654
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
2697
|
-
return
|
|
2655
|
+
return Oe(Ti);
|
|
2698
2656
|
}
|
|
2699
|
-
const
|
|
2657
|
+
const E = [];
|
|
2700
2658
|
for (let i = 0; i < 256; ++i)
|
|
2701
|
-
|
|
2702
|
-
function
|
|
2703
|
-
return
|
|
2659
|
+
E.push((i + 256).toString(16).slice(1));
|
|
2660
|
+
function Pi(i, t = 0) {
|
|
2661
|
+
return E[i[t + 0]] + E[i[t + 1]] + E[i[t + 2]] + E[i[t + 3]] + "-" + E[i[t + 4]] + E[i[t + 5]] + "-" + E[i[t + 6]] + E[i[t + 7]] + "-" + E[i[t + 8]] + E[i[t + 9]] + "-" + E[i[t + 10]] + E[i[t + 11]] + E[i[t + 12]] + E[i[t + 13]] + E[i[t + 14]] + E[i[t + 15]];
|
|
2704
2662
|
}
|
|
2705
|
-
const
|
|
2706
|
-
randomUUID:
|
|
2663
|
+
const xi = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), xt = {
|
|
2664
|
+
randomUUID: xi
|
|
2707
2665
|
};
|
|
2708
|
-
function
|
|
2709
|
-
if (
|
|
2710
|
-
return
|
|
2666
|
+
function Ot(i, t, e) {
|
|
2667
|
+
if (xt.randomUUID && !t && !i)
|
|
2668
|
+
return xt.randomUUID();
|
|
2711
2669
|
i = i || {};
|
|
2712
|
-
const
|
|
2713
|
-
if (
|
|
2714
|
-
|
|
2715
|
-
for (let
|
|
2716
|
-
e
|
|
2717
|
-
return
|
|
2718
|
-
}
|
|
2719
|
-
return
|
|
2670
|
+
const a = i.random || (i.rng || Ai)();
|
|
2671
|
+
if (a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, t) {
|
|
2672
|
+
e = e || 0;
|
|
2673
|
+
for (let n = 0; n < 16; ++n)
|
|
2674
|
+
t[e + n] = a[n];
|
|
2675
|
+
return t;
|
|
2676
|
+
}
|
|
2677
|
+
return Pi(a);
|
|
2720
2678
|
}
|
|
2721
|
-
class
|
|
2722
|
-
constructor(e) {
|
|
2679
|
+
class Rt {
|
|
2680
|
+
constructor(t, e) {
|
|
2723
2681
|
b(this, "config");
|
|
2724
|
-
this
|
|
2682
|
+
b(this, "sdkConfig");
|
|
2683
|
+
this.config = t, this.sdkConfig = e;
|
|
2725
2684
|
}
|
|
2726
2685
|
}
|
|
2727
|
-
const
|
|
2728
|
-
var re, ce,
|
|
2729
|
-
class
|
|
2730
|
-
constructor(...
|
|
2731
|
-
super(...
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2686
|
+
const Ut = 25, Lt = 1e4;
|
|
2687
|
+
var oe, re, ce, V, Ce;
|
|
2688
|
+
class Gi extends Rt {
|
|
2689
|
+
constructor(...e) {
|
|
2690
|
+
super(...e);
|
|
2691
|
+
C(this, oe, "https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");
|
|
2692
|
+
C(this, re, void 0);
|
|
2693
|
+
C(this, ce, void 0);
|
|
2694
|
+
C(this, V, []);
|
|
2695
|
+
C(this, Ce, void 0);
|
|
2737
2696
|
b(this, "processQueueForced");
|
|
2738
|
-
|
|
2697
|
+
v(this, re, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime()), v(this, V, []), v(this, Ce, Ot()), this.processQueueForced = this.processQueue.bind(this, !0), this.schedule(), fetch(y(this, oe), {
|
|
2739
2698
|
method: "OPTIONS"
|
|
2740
|
-
}).catch(
|
|
2699
|
+
}).catch(ct), this.subscribe();
|
|
2741
2700
|
}
|
|
2742
2701
|
subscribe() {
|
|
2743
2702
|
window.addEventListener("beforeunload", this.processQueueForced, !1), window.addEventListener("pagehide", this.processQueueForced, !1), window.addEventListener("visibilitychange", this.processQueueForced, !1);
|
|
2744
2703
|
}
|
|
2745
2704
|
schedule() {
|
|
2746
|
-
|
|
2705
|
+
y(this, ce) && clearTimeout(y(this, ce)), v(this, ce, window.setTimeout(() => this.processQueue(), Lt));
|
|
2747
2706
|
}
|
|
2748
|
-
send(
|
|
2749
|
-
|
|
2707
|
+
send(e) {
|
|
2708
|
+
v(this, re, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime());
|
|
2750
2709
|
try {
|
|
2751
|
-
navigator.sendBeacon(
|
|
2710
|
+
navigator.sendBeacon(y(this, oe), JSON.stringify(e));
|
|
2752
2711
|
} catch {
|
|
2753
|
-
fetch(
|
|
2754
|
-
body: JSON.stringify(
|
|
2712
|
+
fetch(y(this, oe), {
|
|
2713
|
+
body: JSON.stringify(e),
|
|
2755
2714
|
method: "POST",
|
|
2756
2715
|
headers: {
|
|
2757
2716
|
"Content-Type": "application/json"
|
|
2758
2717
|
},
|
|
2759
2718
|
keepalive: !0
|
|
2760
|
-
}).catch(
|
|
2719
|
+
}).catch(ct);
|
|
2761
2720
|
}
|
|
2762
2721
|
this.schedule();
|
|
2763
2722
|
}
|
|
2764
|
-
addToQueue(
|
|
2765
|
-
|
|
2723
|
+
addToQueue(e) {
|
|
2724
|
+
y(this, V).push(e), this.processQueue();
|
|
2766
2725
|
}
|
|
2767
|
-
processQueue(
|
|
2768
|
-
if (!(this.
|
|
2769
|
-
for (;
|
|
2770
|
-
const
|
|
2771
|
-
...
|
|
2772
|
-
sessionID:
|
|
2773
|
-
userID: this.
|
|
2726
|
+
processQueue(e = !1) {
|
|
2727
|
+
if (!(this.sdkConfig == null || !this.sdkConfig.ui.feature.allowTelemetry) && !(!e && y(this, V).length < Ut && /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime() - y(this, re) < Lt))
|
|
2728
|
+
for (; y(this, V).length; ) {
|
|
2729
|
+
const a = y(this, V).splice(0, Ut).map((n) => ({
|
|
2730
|
+
...n,
|
|
2731
|
+
sessionID: y(this, Ce),
|
|
2732
|
+
userID: this.sdkConfig.api.user
|
|
2774
2733
|
}));
|
|
2775
|
-
this.send(
|
|
2734
|
+
this.send(a);
|
|
2776
2735
|
}
|
|
2777
2736
|
}
|
|
2778
|
-
track(
|
|
2737
|
+
track(e, a) {
|
|
2779
2738
|
this.addToQueue({
|
|
2780
|
-
eventName:
|
|
2781
|
-
eventParams:
|
|
2739
|
+
eventName: e,
|
|
2740
|
+
eventParams: a,
|
|
2782
2741
|
eventTimestamp: /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime(),
|
|
2783
|
-
eventUUID:
|
|
2742
|
+
eventUUID: Ot()
|
|
2784
2743
|
});
|
|
2785
2744
|
}
|
|
2786
2745
|
}
|
|
2787
|
-
|
|
2788
|
-
const
|
|
2789
|
-
class
|
|
2790
|
-
track(
|
|
2791
|
-
|
|
2746
|
+
oe = new WeakMap(), re = new WeakMap(), ce = new WeakMap(), V = new WeakMap(), Ce = new WeakMap();
|
|
2747
|
+
const Oi = U("LoggingTracker", "color:#000000;font-weight:bold;");
|
|
2748
|
+
class Wi extends Rt {
|
|
2749
|
+
track(t, e) {
|
|
2750
|
+
Oi(`@${this.sdkConfig.api.user}`, `[${t}]`, e);
|
|
2792
2751
|
}
|
|
2793
2752
|
}
|
|
2794
2753
|
export {
|
|
2795
|
-
|
|
2796
|
-
|
|
2754
|
+
_i as BasicPlugin,
|
|
2755
|
+
j as CasinoPlugin,
|
|
2797
2756
|
Fi as DebuggingPlugin,
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2757
|
+
Di as GigPlugin,
|
|
2758
|
+
zi as KalambaBullseyePlugin,
|
|
2759
|
+
qi as KalambaStargazerPlugin,
|
|
2760
|
+
Gi as KalambaStargazerTracker,
|
|
2761
|
+
Wi as LoggingTracker,
|
|
2762
|
+
Ni as OryxPlugin,
|
|
2763
|
+
Ri as PariplayPlugin,
|
|
2764
|
+
Hi as RelaxFEIMPlugin,
|
|
2765
|
+
Xt as RgsPlygin,
|
|
2766
|
+
ki as TelemetryPlugin,
|
|
2767
|
+
Rt as Tracker,
|
|
2768
|
+
Vi as TukoPlugin
|
|
2810
2769
|
};
|