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