@kalamba/sdk 0.13.2 → 0.19.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/plugins.js CHANGED
@@ -2,36 +2,33 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2025, Kalamba Games Limited
4
4
  */
5
- var Wt = Object.defineProperty;
6
- var $t = (s, t, e) => t in s ? Wt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
7
- var m = (s, t, e) => ($t(s, typeof t != "symbol" ? t + "" : t, e), e), rt = (s, t, e) => {
8
- if (!t.has(s))
9
- throw TypeError("Cannot " + e);
5
+ var ti = Object.defineProperty;
6
+ var wt = (s) => {
7
+ throw TypeError(s);
10
8
  };
11
- var y = (s, t, e) => (rt(s, t, "read from private field"), e ? e.call(s) : t.get(s)), C = (s, t, e) => {
12
- if (t.has(s))
13
- throw TypeError("Cannot add the same private member more than once");
14
- t instanceof WeakSet ? t.add(s) : t.set(s, e);
15
- }, E = (s, t, e, i) => (rt(s, t, "write to private field"), i ? i.call(s, e) : t.set(s, e), e);
16
- import { a as Fe } from "./errors-7cbbda8a.js";
17
- import { a as ct, v as jt } from "./v4-58efbfa1.js";
18
- function O(s, t) {
9
+ var ii = (s, t, e) => t in s ? ti(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
10
+ var b = (s, t, e) => ii(s, typeof t != "symbol" ? t + "" : t, e), mt = (s, t, e) => t.has(s) || wt("Cannot " + e);
11
+ var k = (s, t, e) => (mt(s, t, "read from private field"), e ? e.call(s) : t.get(s)), M = (s, t, e) => t.has(s) ? wt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), v = (s, t, e, i) => (mt(s, t, "write to private field"), i ? i.call(s, e) : t.set(s, e), e);
12
+ import { a as He } from "./errors-NnLrKjTz.js";
13
+ import { d as bt, e as si } from "./encoders-BDr7fjKQ.js";
14
+ import { r as ai, g as ni, v as oi } from "./v4-BfzDHJEo.js";
15
+ function x(s, t) {
19
16
  return (e, ...i) => {
20
17
  console.log(`[%c${s}\x1B[m] %s`, t, e, ...i);
21
18
  };
22
19
  }
23
- function Lt(s, t) {
20
+ function zt(s, t) {
24
21
  return Math.round(s * 100 / t);
25
22
  }
26
- class V {
23
+ class j {
27
24
  constructor(t, e) {
28
- m(this, "config");
29
- m(this, "sdkConfig");
25
+ b(this, "config");
26
+ b(this, "sdkConfig");
30
27
  this.config = t, this.sdkConfig = e;
31
28
  }
32
29
  on(t, e, i) {
33
- const a = function(n) {
34
- n.data.message !== `kalamba:wrapper-casino:${t}` && n.data.message !== `kalamba:wrapper:${t}` || e(n.data.payload);
30
+ const a = function(r) {
31
+ r.data.message !== `kalamba:wrapper-casino:${t}` && r.data.message !== `kalamba:wrapper:${t}` || e(r.data.payload);
35
32
  };
36
33
  window.addEventListener("message", a, i);
37
34
  }
@@ -42,10 +39,10 @@ class V {
42
39
  });
43
40
  }
44
41
  }
45
- const Qt = O("BasicPlugin", "color:#000000;font-weight:bold;");
46
- class Ri extends V {
42
+ const ri = x("BasicPlugin", "color:#000000;font-weight:bold;");
43
+ class Qi extends j {
47
44
  constructor(...t) {
48
- super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), Qt("configured");
45
+ super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), ri("configured");
49
46
  }
50
47
  registerToSdkEvents() {
51
48
  window.addEventListener("message", (t) => {
@@ -56,8 +53,8 @@ class Ri extends V {
56
53
  this.send("settings", { music: i == null ? void 0 : i.musicEnabled, sounds: i == null ? void 0 : i.soundEnabled });
57
54
  return;
58
55
  case "doBalanceUpdate":
59
- const { currency: a, coinValueInCents: o } = this.sdkConfig.api;
60
- i.currency === a && typeof i.balanceInCurrency == "number" ? this.send("balance", { balance: Lt(i.balanceInCurrency, o) }) : (i.balanceInCoins, this.send("balance", { balance: i.balanceInCoins }));
56
+ const { currency: a, coinValueInCents: d } = this.sdkConfig.api;
57
+ i.currency === a && typeof i.balanceInCurrency == "number" ? this.send("balance", { balance: zt(i.balanceInCurrency, d) }) : (i.balanceInCoins, this.send("balance", { balance: i.balanceInCoins }));
61
58
  return;
62
59
  case "doGamePause":
63
60
  this.send("freeze");
@@ -92,8 +89,8 @@ class Ri extends V {
92
89
  });
93
90
  }
94
91
  }
95
- const v = O("▼ DebuggingPlugin IN ▼", "color:#444444;font-weight:bold;"), Xt = O("▲ DebuggingPlugin OUT ▲", "color:#444444;font-weight:bold;");
96
- class Li extends V {
92
+ const E = x("▼ DebuggingPlugin IN ▼", "color:#444444;font-weight:bold;"), ci = x("▲ DebuggingPlugin OUT ▲", "color:#444444;font-weight:bold;");
93
+ class Ki extends j {
97
94
  constructor(...t) {
98
95
  super(...t), this.registerDebugToSdkEvents(), this.registerSdkToDebugEvents();
99
96
  }
@@ -114,16 +111,16 @@ class Li extends V {
114
111
  };
115
112
  }
116
113
  registerSdkToDebugEvents() {
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));
114
+ this.on("autoplay", (t) => E("autoplay", t)), this.on("balance", (t) => E("balance", t)), this.on("bet", (t) => E("bet", t)), this.on("cashier", (t) => E("cashier", t)), this.on("choice", (t) => E("choice", t)), this.on("close", (t) => E("close", t)), this.on("error", (t) => E("error", t)), this.on("loadEnd", (t) => E("loadEnd", t)), this.on("loadProgress", (t) => E("loadProgress", t)), this.on("loadStart", (t) => E("loadStart", t)), this.on("playCycleStart", (t) => E("playCycleStart", t)), this.on("playCycleEnd", (t) => E("playCycleEnd", t)), this.on("playEnd", (t) => E("playEnd", t)), this.on("playError", (t) => E("playError", t)), this.on("playReady", (t) => E("playReady", t)), this.on("playStart", (t) => E("playStart", t)), this.on("settings", (t) => E("settings", t));
118
115
  }
119
116
  _send(...t) {
120
- Xt(...t), this.send(...t);
117
+ ci(...t), this.send(...t);
121
118
  }
122
119
  }
123
- const Kt = O("GigPlugin", "color:#000000;font-weight:bold;");
124
- class Ui extends V {
120
+ const di = x("GigPlugin", "color:#000000;font-weight:bold;");
121
+ class Xi extends j {
125
122
  constructor(...t) {
126
- super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), Kt("configured");
123
+ super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), di("configured");
127
124
  }
128
125
  postMessage(t) {
129
126
  const e = {
@@ -171,10 +168,10 @@ class Ui extends V {
171
168
  });
172
169
  }
173
170
  }
174
- const Jt = O("OryxPlugin", "color:#000000;font-weight:bold;");
175
- class _i extends V {
171
+ const li = x("OryxPlugin", "color:#000000;font-weight:bold;");
172
+ class Ji extends j {
176
173
  constructor(...t) {
177
- super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), Jt("configured");
174
+ super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), li("configured");
178
175
  }
179
176
  registerToSdkEvents() {
180
177
  window.addEventListener("message", (t) => {
@@ -226,54 +223,54 @@ class _i extends V {
226
223
  });
227
224
  }
228
225
  }
229
- const dt = O("PariplayPlugin", "color:#000000;font-weight:bold;");
230
- function Ge(s) {
226
+ const qe = x("PariplayPlugin", "color:#000000;font-weight:bold;");
227
+ function We(s) {
231
228
  try {
232
229
  window.top.location = s;
233
230
  } catch {
234
231
  window.location = s;
235
232
  }
236
233
  }
237
- function He(s, t) {
234
+ function je(s, t) {
238
235
  return new Promise(function(i, a) {
239
- const o = new XMLHttpRequest();
240
- o.onload = function() {
241
- o.status >= 200 && o.status < 300 ? i(o.responseText) : a(o.responseText);
242
- }, o.open(s, t), o.send();
236
+ const d = new XMLHttpRequest();
237
+ d.onload = function() {
238
+ d.status >= 200 && d.status < 300 ? i(d.responseText) : a(d.responseText);
239
+ }, d.open(s, t), d.send();
243
240
  });
244
241
  }
245
- function Ve() {
242
+ function $e() {
246
243
  }
247
- function Yt(s) {
244
+ function ui(s) {
248
245
  return s.filter(function(e) {
249
246
  return e.messageType.toUpperCase() === "DATA";
250
247
  });
251
248
  }
252
- function ze(s) {
249
+ function Qe(s) {
253
250
  return s.filter(function(e) {
254
251
  return ["NOTIFICATION", "POPUP"].includes(e.messageType.toUpperCase());
255
252
  });
256
253
  }
257
- function Ut(s) {
254
+ function qt(s) {
258
255
  try {
259
256
  return JSON.parse(s.text);
260
257
  } catch {
261
258
  return {};
262
259
  }
263
260
  }
264
- function Zt(s) {
265
- return s.map(Ut).filter(Boolean).find(function(e) {
261
+ function hi(s) {
262
+ return s.map(qt).filter(Boolean).find(function(e) {
266
263
  return e.betId != null && e.winId != null;
267
264
  }) || {};
268
265
  }
269
- function ei(s) {
270
- return s.map(Ut).filter(Boolean).find(function(e) {
266
+ function pi(s) {
267
+ return s.map(qt).filter(Boolean).find(function(e) {
271
268
  return e.TotalBet != null && e.TotalWin != null;
272
269
  }) || {};
273
270
  }
274
- class Bi extends V {
271
+ class Yi extends j {
275
272
  constructor(...t) {
276
- super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), dt("configured");
273
+ super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), qe("configured");
277
274
  }
278
275
  postMessage(t, e) {
279
276
  const i = {
@@ -281,26 +278,26 @@ class Bi extends V {
281
278
  sender: this.sdkConfig.api.game,
282
279
  type: t
283
280
  };
284
- e != null && (i.data = e), dt("postMessage", i), window.parent.postMessage(i, "*");
281
+ e != null && (i.data = e), qe("postMessage", i), window.parent.postMessage(i, "*");
285
282
  }
286
283
  coinsToCurrency(t) {
287
284
  return t * this.sdkConfig.api.coinValueInCents / 100;
288
285
  }
289
286
  handleContinueButton(t, e) {
290
- t.link && He("GET", t.link), e();
287
+ t.link && je("GET", t.link), e();
291
288
  }
292
289
  handleLinkButton(t, e) {
293
290
  switch (t.linkType.toUpperCase()) {
294
291
  case "AJAX":
295
- He("GET", t.link), e();
292
+ je("GET", t.link), e();
296
293
  return;
297
294
  case "AJAXRESPONSE":
298
- He("GET", t.link).then(() => {
295
+ je("GET", t.link).then(() => {
299
296
  e();
300
297
  });
301
298
  return;
302
299
  case "REDIRECT":
303
- Ge(t.link), e();
300
+ We(t.link), e();
304
301
  return;
305
302
  }
306
303
  }
@@ -324,16 +321,17 @@ class Bi extends V {
324
321
  }
325
322
  processInfoUiMessages(t) {
326
323
  return t.reduce((e, i) => e.then(() => new Promise((a) => {
327
- Object.assign({}, i, {
328
- buttons: i.buttons.filter((o) => o.action.toUpperCase() === "CASHIER" ? !!this.sdkConfig.api.cashierUrl : !0).map((o) => Object.assign({}, o, {
324
+ const d = Object.assign({}, i, {
325
+ buttons: i.buttons.filter((r) => r.action.toUpperCase() === "CASHIER" ? !!this.sdkConfig.api.cashierUrl : !0).map((r) => Object.assign({}, r, {
329
326
  onRelease: () => {
330
- const n = i.messageType.toUpperCase() === "POPUP" ? Ve : a, h = this.buttonActions[o.action.toUpperCase()];
331
- h ? h(o, n) : n();
327
+ const p = i.messageType.toUpperCase() === "POPUP" ? $e : a, h = this.buttonActions[r.action.toUpperCase()];
328
+ h ? h(r, p) : p();
332
329
  }
333
330
  }))
334
331
  });
335
- }).catch(Ve)), Promise.resolve()).then(() => {
336
- }).catch(Ve);
332
+ qe("showMessage", d);
333
+ }).catch($e)), Promise.resolve()).then(() => {
334
+ }).catch($e);
337
335
  }
338
336
  registerToSdkEvents() {
339
337
  window.addEventListener("message", (t) => {
@@ -365,12 +363,12 @@ class Bi extends V {
365
363
  try {
366
364
  const a = JSON.parse(
367
365
  JSON.parse(atob(this.sdkConfig.api.integrationData.token.split(".")[1])).token
368
- ), o = JSON.parse(a.integrationSpecificAttributes.sessionData || "{}");
366
+ ), d = JSON.parse(a.integrationSpecificAttributes.sessionData || "{}");
369
367
  i = {
370
368
  ClientToken: a.integrationSpecificAttributes.clientToken,
371
369
  CurrencyCode: a.currency,
372
370
  PlayerTokenId: a.user,
373
- SessionData: o
371
+ SessionData: d
374
372
  };
375
373
  } catch {
376
374
  i = void 0;
@@ -380,7 +378,7 @@ class Bi extends V {
380
378
  success: !0
381
379
  });
382
380
  try {
383
- const a = ze(e.contract.uiMessages);
381
+ const a = Qe(e.contract.uiMessages);
384
382
  this.processInfoUiMessages(a);
385
383
  } catch {
386
384
  }
@@ -396,26 +394,24 @@ class Bi extends V {
396
394
  } catch {
397
395
  window.history.back();
398
396
  }
399
- else
400
- this.sdkConfig.api.homeUrl === "(api)" ? this.postMessage("quit") : Ge(this.sdkConfig.api.homeUrl);
397
+ else this.sdkConfig.api.homeUrl === "(api)" ? this.postMessage("quit") : We(this.sdkConfig.api.homeUrl);
401
398
  }), this.on("playEnd", (e) => {
402
399
  this.postMessage("roundEnded", {
403
400
  balanceAfter: this.coinsToCurrency(e.contract.balance.coins),
404
401
  win: this.coinsToCurrency(e.contract.win.round)
405
402
  });
406
403
  try {
407
- const i = ze(e.contract.uiMessages);
404
+ const i = Qe(e.contract.uiMessages);
408
405
  this.processInfoUiMessages(i);
409
406
  } catch {
410
407
  }
411
408
  }), this.on("playError", (e) => {
412
- var i, a;
413
409
  this.postMessage("ticketReceived", {
414
410
  // TODO: Operator specific error code and message
415
- ErrorCode: (i = e.data) == null ? void 0 : i.code,
411
+ ErrorCode: e.type === "error" ? e.data.code : "TIMEOUT",
416
412
  ErrorMessage: "ERROR",
417
413
  Status: {
418
- ErrCode: (a = e.data) == null ? void 0 : a.code
414
+ ErrCode: e.type === "error" ? e.data.code : "TIMEOUT"
419
415
  }
420
416
  });
421
417
  }), this.on("playResponse", (e) => {
@@ -424,14 +420,14 @@ class Bi extends V {
424
420
  e.contract.balance.coins + e.contract.bet.lastPaid.base * e.contract.bet.lastPaid.multiplier
425
421
  )
426
422
  });
427
- const i = ["BaseGame", "PaidSpin"].includes(e.contract.stateType.thisRound), a = Yt(e.contract.uiMessages), o = ze(e.contract.uiMessages), n = Zt(a), h = ei(a);
423
+ const i = ["BaseGame", "PaidSpin"].includes(e.contract.stateType.thisRound), a = ui(e.contract.uiMessages), d = Qe(e.contract.uiMessages), r = hi(a), p = pi(a);
428
424
  this.postMessage("ticketReceived", {
429
425
  Balance: this.coinsToCurrency(e.contract.balance.coins),
430
426
  BetAmount: i ? this.coinsToCurrency(e.contract.bet.lastPaid.base * e.contract.bet.lastPaid.multiplier) : 0,
431
- CreditTransactionId: n.betId,
432
- DebitTransactionId: n.winId,
433
- Message: o,
434
- SessionData: h,
427
+ CreditTransactionId: r.betId,
428
+ DebitTransactionId: r.winId,
429
+ Message: d,
430
+ SessionData: p,
435
431
  Status: {
436
432
  ErrCode: 0
437
433
  },
@@ -446,18 +442,18 @@ class Bi extends V {
446
442
  }), this.on("loadStart", () => {
447
443
  this.postMessage("onAppFrameReady");
448
444
  }), this.on("cashier", () => {
449
- this.sdkConfig.api.cashierUrl && (this.sdkConfig.api.cashierUrl === "(api)" ? this.postMessage("cashier") : Ge(this.sdkConfig.api.cashierUrl));
445
+ this.sdkConfig.api.cashierUrl && (this.sdkConfig.api.cashierUrl === "(api)" ? this.postMessage("cashier") : We(this.sdkConfig.api.cashierUrl));
450
446
  });
451
447
  }
452
448
  }
453
- const ue = O("RelaxFEIMPlugin", "color:#000000;font-weight:bold;");
454
- class Fi extends V {
449
+ const we = x("RelaxFEIMPlugin", "color:#000000;font-weight:bold;");
450
+ class Zi extends j {
455
451
  constructor(...e) {
456
452
  super(...e);
457
- m(this, "VERSION", "1.17.0");
453
+ b(this, "VERSION", "1.17.0");
458
454
  const i = document.createElement("script");
459
455
  i.src = `https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`, i.onload = () => {
460
- ue("loaded"), window.FEIM.configure({
456
+ we("loaded"), window.FEIM.configure({
461
457
  p2pConfig: {
462
458
  currency: this.sdkConfig.api.currency,
463
459
  launchParams: {
@@ -465,11 +461,11 @@ class Fi extends V {
465
461
  homeurl: "homeUrl"
466
462
  }
467
463
  }
468
- }), ue("configured"), this.registerToSdkEvents(), this.registerFromSdkEvents();
464
+ }), we("configured"), this.registerToSdkEvents(), this.registerFromSdkEvents();
469
465
  }, document.body.appendChild(i);
470
466
  }
471
467
  registerToSdkEvents() {
472
- window.FEIM.on.errorMessageDismissed(() => this.send("unfreeze")), window.FEIM.on.errorMessageDisplayed(() => this.send("freeze")), window.FEIM.on.exitingGame(() => ue("!!! NOT IMPLEMENTED: exitingGame !!!")), window.FEIM.on.freeze(() => this.send("freeze")), window.FEIM.on.initialized(() => ue("!!! NOT IMPLEMENTED: initialized !!!")), window.FEIM.on.pauseAutoPlay(() => this.send("suspend")), window.FEIM.on.refreshBalance(() => ue("!!! NOT IMPLEMENTED: refreshBalance !!!")), window.FEIM.on.toggleGameHelp(() => {
468
+ window.FEIM.on.errorMessageDismissed(() => this.send("unfreeze")), window.FEIM.on.errorMessageDisplayed(() => this.send("freeze")), window.FEIM.on.exitingGame(() => we("!!! NOT IMPLEMENTED: exitingGame !!!")), window.FEIM.on.freeze(() => this.send("freeze")), window.FEIM.on.initialized(() => we("!!! NOT IMPLEMENTED: initialized !!!")), window.FEIM.on.pauseAutoPlay(() => this.send("suspend")), window.FEIM.on.refreshBalance(() => we("!!! NOT IMPLEMENTED: refreshBalance !!!")), window.FEIM.on.toggleGameHelp(() => {
473
469
  this.send("help", {});
474
470
  }), window.FEIM.on.togglePaytable(() => {
475
471
  this.send("paytable", {});
@@ -491,8 +487,9 @@ class Fi extends V {
491
487
  window.FEIM.send.balanceUpdate(e);
492
488
  }), this.on("bet", ({ base: e, multiplier: i }) => {
493
489
  window.FEIM.send.betUpdate(e * i);
494
- }), this.on("error", ({ message: e }) => {
495
- window.FEIM.send.errorMessage(e);
490
+ }), this.on("error", (e) => {
491
+ const i = "message" in e ? e.message : "Unknown error";
492
+ window.FEIM.send.errorMessage(i);
496
493
  }), this.on("close", () => {
497
494
  window.FEIM.send.exitGame();
498
495
  }), this.on("loadEnd", () => {
@@ -525,20 +522,20 @@ class Fi extends V {
525
522
  });
526
523
  }
527
524
  }
528
- const qe = O("TukoPlugin", "color:#000000;font-weight:bold;");
529
- class Di extends V {
525
+ const Ke = x("TukoPlugin", "color:#000000;font-weight:bold;");
526
+ class es extends j {
530
527
  constructor(...e) {
531
528
  super(...e);
532
- m(this, "PING_INTERVAL", 1e4);
529
+ b(this, "PING_INTERVAL", 1e4);
533
530
  const a = new URLSearchParams(window.location.search).get("pingCallbackUrl");
534
531
  a && window.setInterval(() => {
535
532
  this.ping(a);
536
- }, this.PING_INTERVAL), this.registerToSdkEvents(), this.registerFromSdkEvents(), qe("configured");
533
+ }, this.PING_INTERVAL), this.registerToSdkEvents(), this.registerFromSdkEvents(), Ke("configured");
537
534
  }
538
535
  ping(e) {
539
536
  const i = new XMLHttpRequest();
540
537
  i.onreadystatechange = function() {
541
- i.readyState === XMLHttpRequest.DONE && (i.status === 0 || i.status >= 200 && i.status < 400 ? qe("ping ok", i) : qe("ping error", i));
538
+ i.readyState === XMLHttpRequest.DONE && (i.status === 0 || i.status >= 200 && i.status < 400 ? Ke("ping ok", i) : Ke("ping error", i));
542
539
  }, i.open("GET", e), i.send();
543
540
  }
544
541
  registerToSdkEvents() {
@@ -550,8 +547,8 @@ class Di extends V {
550
547
  this.send("settings", { music: a == null ? void 0 : a.musicEnabled, sounds: a == null ? void 0 : a.soundEnabled });
551
548
  return;
552
549
  case "doBalanceUpdate":
553
- const { currency: o, coinValueInCents: n } = this.sdkConfig.api;
554
- a.currency === o && typeof a.balanceInCurrency == "number" ? this.send("balance", { balance: Lt(a.balanceInCurrency, n) }) : (a.balanceInCoins, this.send("balance", { balance: a.balanceInCoins }));
550
+ const { currency: d, coinValueInCents: r } = this.sdkConfig.api;
551
+ a.currency === d && typeof a.balanceInCurrency == "number" ? this.send("balance", { balance: zt(a.balanceInCurrency, r) }) : (a.balanceInCoins, this.send("balance", { balance: a.balanceInCoins }));
555
552
  return;
556
553
  case "doGamePause":
557
554
  this.send("freeze");
@@ -586,14 +583,14 @@ class Di extends V {
586
583
  });
587
584
  }
588
585
  }
589
- const lt = O("QuantaPlugin", "color:#000000;font-weight:bold;");
590
- class Ni extends V {
586
+ const ft = x("QuantaPlugin", "color:#000000;font-weight:bold;");
587
+ class ts extends j {
591
588
  constructor(...t) {
592
- super(...t), this.registerFromSdkEvents(), lt("configured");
589
+ super(...t), this.registerFromSdkEvents(), ft("configured");
593
590
  }
594
591
  postMessage(t) {
595
592
  const e = { event: t };
596
- lt("QuantaPlugin::postMessage", e), window.parent.postMessage(e, "*");
593
+ ft("QuantaPlugin::postMessage", e), window.parent.postMessage(e, "*");
597
594
  }
598
595
  registerFromSdkEvents() {
599
596
  this.on("close", () => {
@@ -609,81 +606,80 @@ class Ni extends V {
609
606
  });
610
607
  }
611
608
  }
612
- var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce = "object", Ye = "string", we = "major", l = "model", r = "name", d = "type", u = "vendor", c = "version", M = "architecture", J = "console", b = "mobile", f = "tablet", I = "smarttv", Ae = "wearable", ht = "xr", Ze = "embedded", pt = "user-agent", et = 500, st = "brands", W = "formFactors", at = "fullVersionList", Y = "platform", nt = "platformVersion", De = "bitness", z = "sec-ch-ua", ii = z + "-full-version-list", si = z + "-arch", ai = z + "-" + De, ni = z + "-form-factors", oi = z + "-" + b, ri = z + "-" + l, _t = z + "-" + Y, ci = _t + "-version", Bt = [st, at, b, l, Y, nt, M, W, De], T = "browser", U = "cpu", x = "device", _ = "engine", P = "os", Z = "result", ve = "Amazon", he = "Apple", gt = "ASUS", mt = "BlackBerry", Ce = "Google", wt = "Huawei", bt = "Lenovo", We = "LG", Oe = "Microsoft", ft = "Motorola", Me = "Samsung", yt = "Sharp", Se = "Sony", $e = "Xiaomi", je = "Zebra", X = "Mobile ", K = " Browser", Ie = "Chrome", di = "Edge", pe = "Firefox", ge = "Opera", kt = "Facebook", Et = "Sogou", tt = "Windows", li = typeof window !== G, S = li && window.navigator ? window.navigator : void 0, D = S && S.userAgentData ? S.userAgentData : void 0, ui = function(s, t) {
609
+ var gi = "2.0.3", ct = 500, yt = "user-agent", le = "", kt = "?", _e = "function", W = "undefined", ue = "object", dt = "string", S = "browser", B = "cpu", R = "device", O = "engine", P = "os", te = "result", l = "name", n = "type", c = "vendor", u = "version", I = "architecture", Se = "major", o = "model", Ce = "console", w = "mobile", f = "tablet", y = "smarttv", U = "wearable", Xe = "xr", Me = "embedded", me = "inapp", ht = "brands", Y = "formFactors", pt = "fullVersionList", ie = "platform", gt = "platformVersion", Ve = "bitness", $ = "sec-ch-ua", wi = $ + "-full-version-list", mi = $ + "-arch", bi = $ + "-" + Ve, fi = $ + "-form-factors", yi = $ + "-" + w, ki = $ + "-" + o, Wt = $ + "-" + ie, vi = Wt + "-version", jt = [ht, pt, w, o, ie, gt, I, Y, Ve], xe = "Amazon", Z = "Apple", vt = "ASUS", Et = "BlackBerry", J = "Google", Ct = "Huawei", Mt = "Lenovo", St = "Honor", Ue = "LG", Je = "Microsoft", Ye = "Motorola", Ze = "Nvidia", It = "OnePlus", et = "OPPO", be = "Samsung", Tt = "Sharp", fe = "Sony", tt = "Xiaomi", it = "Zebra", At = "Chrome", Pt = "Chromium", H = "Chromecast", Ei = "Edge", ye = "Firefox", ke = "Opera", st = "Facebook", Ot = "Sogou", ee = "Mobile ", ve = " Browser", lt = "Windows", Ci = typeof window !== W, T = Ci && window.navigator ? window.navigator : void 0, V = T && T.userAgentData ? T.userAgentData : void 0, Mi = function(s, t) {
613
610
  var e = {}, i = t;
614
- if (!xe(t)) {
611
+ if (!Be(t)) {
615
612
  i = {};
616
613
  for (var a in t)
617
- for (var o in t[a])
618
- i[o] = t[a][o].concat(i[o] ? i[o] : []);
614
+ for (var d in t[a])
615
+ i[d] = t[a][d].concat(i[d] ? i[d] : []);
619
616
  }
620
- for (var n in s)
621
- e[n] = i[n] && i[n].length % 2 === 0 ? i[n].concat(s[n]) : s[n];
617
+ for (var r in s)
618
+ e[r] = i[r] && i[r].length % 2 === 0 ? i[r].concat(s[r]) : s[r];
622
619
  return e;
623
- }, Ne = function(s) {
620
+ }, ze = function(s) {
624
621
  for (var t = {}, e = 0; e < s.length; e++)
625
622
  t[s[e].toUpperCase()] = s[e];
626
623
  return t;
627
- }, it = function(s, t) {
628
- if (typeof s === ce && s.length > 0) {
624
+ }, ut = function(s, t) {
625
+ if (typeof s === ue && s.length > 0) {
629
626
  for (var e in s)
630
- if (H(s[e]) == H(t))
631
- return !0;
627
+ if (F(s[e]) == F(t)) return !0;
632
628
  return !1;
633
629
  }
634
- return de(s) ? H(t).indexOf(H(s)) !== -1 : !1;
635
- }, xe = function(s, t) {
630
+ return pe(s) ? F(t).indexOf(F(s)) !== -1 : !1;
631
+ }, Be = function(s, t) {
636
632
  for (var e in s)
637
- return /^(browser|cpu|device|engine|os)$/.test(e) || (t ? xe(s[e]) : !1);
638
- }, de = function(s) {
639
- return typeof s === Ye;
640
- }, Qe = function(s) {
633
+ return /^(browser|cpu|device|engine|os)$/.test(e) || (t ? Be(s[e]) : !1);
634
+ }, pe = function(s) {
635
+ return typeof s === dt;
636
+ }, at = function(s) {
641
637
  if (s) {
642
- for (var t = [], e = $(/\\?\"/g, s).split(","), i = 0; i < e.length; i++)
638
+ for (var t = [], e = he(/\\?\"/g, s).split(","), i = 0; i < e.length; i++)
643
639
  if (e[i].indexOf(";") > -1) {
644
- var a = be(e[i]).split(";v=");
640
+ var a = Ie(e[i]).split(";v=");
645
641
  t[i] = { brand: a[0], version: a[1] };
646
642
  } else
647
- t[i] = be(e[i]);
643
+ t[i] = Ie(e[i]);
648
644
  return t;
649
645
  }
650
- }, H = function(s) {
651
- return de(s) ? s.toLowerCase() : s;
652
- }, Xe = function(s) {
653
- return de(s) ? $(/[^\d\.]/g, s).split(".")[0] : void 0;
654
- }, B = function(s) {
646
+ }, F = function(s) {
647
+ return pe(s) ? s.toLowerCase() : s;
648
+ }, nt = function(s) {
649
+ return pe(s) ? he(/[^\d\.]/g, s).split(".")[0] : void 0;
650
+ }, N = function(s) {
655
651
  for (var t in s) {
656
652
  var e = s[t];
657
- typeof e == ce && e.length == 2 ? this[e[0]] = e[1] : this[e] = void 0;
653
+ typeof e == ue && e.length == 2 ? this[e[0]] = e[1] : this[e] = void 0;
658
654
  }
659
655
  return this;
660
- }, $ = function(s, t) {
661
- return de(t) ? t.replace(s, re) : t;
662
- }, me = function(s) {
663
- return $(/\\?\"/g, s);
664
- }, be = function(s, t) {
665
- if (de(s))
666
- return s = $(/^\s\s*/, s), typeof t === G ? s : s.substring(0, et);
667
- }, vt = function(s, t) {
656
+ }, he = function(s, t) {
657
+ return pe(t) ? t.replace(s, le) : t;
658
+ }, Ee = function(s) {
659
+ return he(/\\?\"/g, s);
660
+ }, Ie = function(s, t) {
661
+ if (pe(s))
662
+ return s = he(/^\s\s*/, s), typeof t === W ? s : s.substring(0, ct);
663
+ }, ot = function(s, t) {
668
664
  if (!(!s || !t))
669
- for (var e = 0, i, a, o, n, h, p; e < t.length && !h; ) {
670
- var w = t[e], g = t[e + 1];
671
- for (i = a = 0; i < w.length && !h && w[i]; )
672
- if (h = w[i++].exec(s), h)
673
- for (o = 0; o < g.length; o++)
674
- p = h[++a], n = g[o], typeof n === ce && n.length > 0 ? n.length === 2 ? typeof n[1] == Je ? this[n[0]] = n[1].call(this, p) : this[n[0]] = n[1] : n.length === 3 ? typeof n[1] === Je && !(n[1].exec && n[1].test) ? this[n[0]] = p ? n[1].call(this, p, n[2]) : void 0 : this[n[0]] = p ? p.replace(n[1], n[2]) : void 0 : n.length === 4 && (this[n[0]] = p ? n[3].call(this, p.replace(n[1], n[2])) : void 0) : this[n] = p || void 0;
665
+ for (var e = 0, i, a, d, r, p, h; e < t.length && !p; ) {
666
+ var g = t[e], m = t[e + 1];
667
+ for (i = a = 0; i < g.length && !p && g[i]; )
668
+ if (p = g[i++].exec(s), p)
669
+ for (d = 0; d < m.length; d++)
670
+ h = p[++a], r = m[d], typeof r === ue && r.length > 0 ? r.length === 2 ? typeof r[1] == _e ? this[r[0]] = r[1].call(this, h) : this[r[0]] = r[1] : r.length === 3 ? typeof r[1] === _e && !(r[1].exec && r[1].test) ? this[r[0]] = h ? r[1].call(this, h, r[2]) : void 0 : this[r[0]] = h ? h.replace(r[1], r[2]) : void 0 : r.length === 4 && (this[r[0]] = h ? r[3].call(this, h.replace(r[1], r[2])) : void 0) : this[r] = h || void 0;
675
671
  e += 2;
676
672
  }
677
- }, Re = function(s, t) {
673
+ }, z = function(s, t) {
678
674
  for (var e in t)
679
- if (typeof t[e] === ce && t[e].length > 0) {
675
+ if (typeof t[e] === ue && t[e].length > 0) {
680
676
  for (var i = 0; i < t[e].length; i++)
681
- if (it(t[e][i], s))
682
- return e === ut ? void 0 : e;
683
- } else if (it(t[e], s))
684
- return e === ut ? void 0 : e;
677
+ if (ut(t[e][i], s))
678
+ return e === kt ? void 0 : e;
679
+ } else if (ut(t[e], s))
680
+ return e === kt ? void 0 : e;
685
681
  return t.hasOwnProperty("*") ? t["*"] : s;
686
- }, Ct = {
682
+ }, xt = {
687
683
  ME: "4.90",
688
684
  "NT 3.11": "NT3.51",
689
685
  "NT 4.0": "NT4.0",
@@ -695,7 +691,7 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
695
691
  "8.1": "NT 6.3",
696
692
  10: ["NT 6.4", "NT 10.0"],
697
693
  RT: "ARM"
698
- }, Mt = {
694
+ }, Ut = {
699
695
  embedded: "Automotive",
700
696
  mobile: "Mobile",
701
697
  tablet: ["Tablet", "EInk"],
@@ -704,19 +700,19 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
704
700
  xr: ["VR", "XR"],
705
701
  "?": ["Desktop", "Unknown"],
706
702
  "*": void 0
707
- }, St = {
703
+ }, Rt = {
708
704
  browser: [
709
705
  [
710
706
  // Most common regardless engine
711
707
  /\b(?:crmo|crios)\/([\w\.]+)/i
712
708
  // Chrome for Android/iOS
713
709
  ],
714
- [c, [r, X + "Chrome"]],
710
+ [u, [l, ee + "Chrome"]],
715
711
  [
716
712
  /edg(?:e|ios|a)?\/([\w\.]+)/i
717
713
  // Microsoft Edge
718
714
  ],
719
- [c, [r, "Edge"]],
715
+ [u, [l, "Edge"]],
720
716
  [
721
717
  // Presto based
722
718
  /(opera mini)\/([-\w\.]+)/i,
@@ -726,57 +722,67 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
726
722
  /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i
727
723
  // Opera
728
724
  ],
729
- [r, c],
725
+ [l, u],
730
726
  [
731
727
  /opios[\/ ]+([\w\.]+)/i
732
728
  // Opera mini on iphone >= 8.0
733
729
  ],
734
- [c, [r, ge + " Mini"]],
730
+ [u, [l, ke + " Mini"]],
735
731
  [
736
732
  /\bop(?:rg)?x\/([\w\.]+)/i
737
733
  // Opera GX
738
734
  ],
739
- [c, [r, ge + " GX"]],
735
+ [u, [l, ke + " GX"]],
740
736
  [
741
737
  /\bopr\/([\w\.]+)/i
742
738
  // Opera Webkit
743
739
  ],
744
- [c, [r, ge]],
740
+ [u, [l, ke]],
745
741
  [
746
742
  // Mixed
747
743
  /\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i
748
744
  // Baidu
749
745
  ],
750
- [c, [r, "Baidu"]],
746
+ [u, [l, "Baidu"]],
747
+ [
748
+ /\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i
749
+ // Maxthon
750
+ ],
751
+ [u, [l, "Maxthon"]],
751
752
  [
752
753
  /(kindle)\/([\w\.]+)/i,
753
754
  // Kindle
754
755
  /(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,
755
756
  // Lunascape/Maxthon/Netfront/Jasmine/Blazer/Sleipnir
756
757
  // Trident based
757
- /(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,
758
- // Avant/IEMobile/SlimBrowser
758
+ /(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,
759
+ // Avant/IEMobile/SlimBrowser/SlimBoat/Slimjet
759
760
  /(?:ms|\()(ie) ([\w\.]+)/i,
760
761
  // Internet Explorer
761
- // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon
762
- /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar)\/([-\w\.]+)/i,
763
- // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ//Vivaldi/DuckDuckGo/Klar
764
- /(heytap|ovi)browser\/([\d\.]+)/i,
765
- // HeyTap/Ovi
766
- /(weibo)__([\d\.]+)/i
767
- // Weibo
762
+ // Blink/Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon/LG Browser/Otter/qutebrowser/Dooble
763
+ /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,
764
+ // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ//Vivaldi/DuckDuckGo/Klar/Helio/Dragon
765
+ /(heytap|ovi|115|surf)browser\/([\d\.]+)/i,
766
+ // HeyTap/Ovi/115/Surf
767
+ /(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i
768
+ // Ecosia/Weibo
768
769
  ],
769
- [r, c],
770
+ [l, u],
771
+ [
772
+ /quark(?:pc)?\/([-\w\.]+)/i
773
+ // Quark
774
+ ],
775
+ [u, [l, "Quark"]],
770
776
  [
771
777
  /\bddg\/([\w\.]+)/i
772
778
  // DuckDuckGo
773
779
  ],
774
- [c, [r, "DuckDuckGo"]],
780
+ [u, [l, "DuckDuckGo"]],
775
781
  [
776
782
  /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i
777
783
  // UCBrowser
778
784
  ],
779
- [c, [r, "UCBrowser"]],
785
+ [u, [l, "UCBrowser"]],
780
786
  [
781
787
  /microm.+\bqbcore\/([\w\.]+)/i,
782
788
  // WeChat Desktop for Windows Built-in Browser
@@ -784,124 +790,124 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
784
790
  /micromessenger\/([\w\.]+)/i
785
791
  // WeChat
786
792
  ],
787
- [c, [r, "WeChat"]],
793
+ [u, [l, "WeChat"]],
788
794
  [
789
795
  /konqueror\/([\w\.]+)/i
790
796
  // Konqueror
791
797
  ],
792
- [c, [r, "Konqueror"]],
798
+ [u, [l, "Konqueror"]],
793
799
  [
794
800
  /trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i
795
801
  // IE11
796
802
  ],
797
- [c, [r, "IE"]],
803
+ [u, [l, "IE"]],
798
804
  [
799
805
  /ya(?:search)?browser\/([\w\.]+)/i
800
806
  // Yandex
801
807
  ],
802
- [c, [r, "Yandex"]],
808
+ [u, [l, "Yandex"]],
803
809
  [
804
810
  /slbrowser\/([\w\.]+)/i
805
811
  // Smart Lenovo Browser
806
812
  ],
807
- [c, [r, "Smart " + bt + K]],
813
+ [u, [l, "Smart " + Mt + ve]],
808
814
  [
809
815
  /(avast|avg)\/([\w\.]+)/i
810
816
  // Avast/AVG Secure Browser
811
817
  ],
812
- [[r, /(.+)/, "$1 Secure" + K], c],
818
+ [[l, /(.+)/, "$1 Secure" + ve], u],
813
819
  [
814
820
  /\bfocus\/([\w\.]+)/i
815
821
  // Firefox Focus
816
822
  ],
817
- [c, [r, pe + " Focus"]],
823
+ [u, [l, ye + " Focus"]],
818
824
  [
819
825
  /\bopt\/([\w\.]+)/i
820
826
  // Opera Touch
821
827
  ],
822
- [c, [r, ge + " Touch"]],
828
+ [u, [l, ke + " Touch"]],
823
829
  [
824
830
  /coc_coc\w+\/([\w\.]+)/i
825
831
  // Coc Coc Browser
826
832
  ],
827
- [c, [r, "Coc Coc"]],
833
+ [u, [l, "Coc Coc"]],
828
834
  [
829
835
  /dolfin\/([\w\.]+)/i
830
836
  // Dolphin
831
837
  ],
832
- [c, [r, "Dolphin"]],
838
+ [u, [l, "Dolphin"]],
833
839
  [
834
840
  /coast\/([\w\.]+)/i
835
841
  // Opera Coast
836
842
  ],
837
- [c, [r, ge + " Coast"]],
843
+ [u, [l, ke + " Coast"]],
838
844
  [
839
845
  /miuibrowser\/([\w\.]+)/i
840
846
  // MIUI Browser
841
847
  ],
842
- [c, [r, "MIUI" + K]],
848
+ [u, [l, "MIUI" + ve]],
843
849
  [
844
850
  /fxios\/([\w\.-]+)/i
845
851
  // Firefox for iOS
846
852
  ],
847
- [c, [r, X + pe]],
853
+ [u, [l, ee + ye]],
848
854
  [
849
- /\bqihu|(qi?ho?o?|360)browser/i
855
+ /\bqihoobrowser\/?([\w\.]*)/i
850
856
  // 360
851
857
  ],
852
- [[r, "360" + K]],
858
+ [u, [l, "360"]],
853
859
  [
854
860
  /\b(qq)\/([\w\.]+)/i
855
861
  // QQ
856
862
  ],
857
- [[r, /(.+)/, "$1Browser"], c],
863
+ [[l, /(.+)/, "$1Browser"], u],
858
864
  [
859
865
  /(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i
860
866
  ],
861
- [[r, /(.+)/, "$1" + K], c],
867
+ [[l, /(.+)/, "$1" + ve], u],
862
868
  [
863
869
  // Oculus/Sailfish/HuaweiBrowser/VivoBrowser/PicoBrowser
864
870
  /samsungbrowser\/([\w\.]+)/i
865
871
  // Samsung Internet
866
872
  ],
867
- [c, [r, Me + " Internet"]],
868
- [
869
- /(comodo_dragon)\/([\w\.]+)/i
870
- // Comodo Dragon
871
- ],
872
- [[r, /_/g, " "], c],
873
+ [u, [l, be + " Internet"]],
873
874
  [
874
875
  /metasr[\/ ]?([\d\.]+)/i
875
876
  // Sogou Explorer
876
877
  ],
877
- [c, [r, Et + " Explorer"]],
878
+ [u, [l, Ot + " Explorer"]],
878
879
  [
879
880
  /(sogou)mo\w+\/([\d\.]+)/i
880
881
  // Sogou Mobile
881
882
  ],
882
- [[r, Et + " Mobile"], c],
883
+ [[l, Ot + " Mobile"], u],
883
884
  [
884
885
  /(electron)\/([\w\.]+) safari/i,
885
886
  // Electron-based App
886
887
  /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,
887
888
  // Tesla
888
- /m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i
889
- // QQBrowser/2345 Browser
889
+ /m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i
890
+ // QQ/2345
890
891
  ],
891
- [r, c],
892
+ [l, u],
892
893
  [
893
- /(lbbrowser|rekonq)/i,
894
+ /(lbbrowser|rekonq)/i
894
895
  // LieBao Browser/Rekonq
895
- /\[(linkedin)app\]/i
896
- // LinkedIn App for iOS & Android
897
896
  ],
898
- [r],
897
+ [l],
898
+ [
899
+ /ome\/([\w\.]+) \w* ?(iron) saf/i,
900
+ // Iron
901
+ /ome\/([\w\.]+).+qihu (360)[es]e/i
902
+ // 360
903
+ ],
904
+ [u, l],
899
905
  [
900
906
  // WebView
901
907
  /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i
902
908
  // Facebook App for iOS & Android
903
909
  ],
904
- [[r, kt], c],
910
+ [[l, st], u, [n, me]],
905
911
  [
906
912
  /(Klarna)\/([\w\.]+)/i,
907
913
  // Klarna Shopping Browser for iOS & Android
@@ -909,6 +915,8 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
909
915
  // Kakao App
910
916
  /(naver)\(.*?(\d+\.[\w\.]+).*\)/i,
911
917
  // Naver InApp
918
+ /(daum)apps[\/ ]([\w\.]+)/i,
919
+ // Daum App
912
920
  /safari (line)\/([\w\.]+)/i,
913
921
  // Line App for iOS
914
922
  /\b(line)\/([\w\.]+)\/iab/i,
@@ -917,89 +925,99 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
917
925
  // Alipay
918
926
  /(twitter)(?:and| f.+e\/([\w\.]+))/i,
919
927
  // Twitter
920
- /(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i
921
- // Chromium/Instagram/Snapchat
928
+ /(instagram|snapchat)[\/ ]([-\w\.]+)/i
929
+ // Instagram/Snapchat
922
930
  ],
923
- [r, c],
931
+ [l, u, [n, me]],
924
932
  [
925
933
  /\bgsa\/([\w\.]+) .*safari\//i
926
934
  // Google Search Appliance on iOS
927
935
  ],
928
- [c, [r, "GSA"]],
936
+ [u, [l, "GSA"], [n, me]],
929
937
  [
930
938
  /musical_ly(?:.+app_?version\/|_)([\w\.]+)/i
931
939
  // TikTok
932
940
  ],
933
- [c, [r, "TikTok"]],
941
+ [u, [l, "TikTok"], [n, me]],
942
+ [
943
+ /\[(linkedin)app\]/i
944
+ // LinkedIn App for iOS & Android
945
+ ],
946
+ [l, [n, me]],
947
+ [
948
+ /(chromium)[\/ ]([-\w\.]+)/i
949
+ // Chromium
950
+ ],
951
+ [l, u],
934
952
  [
935
953
  /headlesschrome(?:\/([\w\.]+)| )/i
936
954
  // Chrome Headless
937
955
  ],
938
- [c, [r, Ie + " Headless"]],
956
+ [u, [l, At + " Headless"]],
939
957
  [
940
958
  / wv\).+(chrome)\/([\w\.]+)/i
941
959
  // Chrome WebView
942
960
  ],
943
- [[r, Ie + " WebView"], c],
961
+ [[l, At + " WebView"], u],
944
962
  [
945
963
  /droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i
946
964
  // Android Browser
947
965
  ],
948
- [c, [r, "Android" + K]],
966
+ [u, [l, "Android" + ve]],
949
967
  [
950
968
  /chrome\/([\w\.]+) mobile/i
951
969
  // Chrome Mobile
952
970
  ],
953
- [c, [r, X + "Chrome"]],
971
+ [u, [l, ee + "Chrome"]],
954
972
  [
955
973
  /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i
956
974
  // Chrome/OmniWeb/Arora/Tizen/Nokia
957
975
  ],
958
- [r, c],
976
+ [l, u],
959
977
  [
960
978
  /version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i
961
979
  // Safari Mobile
962
980
  ],
963
- [c, [r, X + "Safari"]],
981
+ [u, [l, ee + "Safari"]],
964
982
  [
965
983
  /iphone .*mobile(?:\/\w+ | ?)safari/i
966
984
  ],
967
- [[r, X + "Safari"]],
985
+ [[l, ee + "Safari"]],
968
986
  [
969
987
  /version\/([\w\.\,]+) .*(safari)/i
970
988
  // Safari
971
989
  ],
972
- [c, r],
990
+ [u, l],
973
991
  [
974
992
  /webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i
975
993
  // Safari < 3.0
976
994
  ],
977
- [r, [c, "1"]],
995
+ [l, [u, "1"]],
978
996
  [
979
997
  /(webkit|khtml)\/([\w\.]+)/i
980
998
  ],
981
- [r, c],
999
+ [l, u],
982
1000
  [
983
1001
  // Gecko based
984
1002
  /(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i
985
1003
  // Firefox Mobile
986
1004
  ],
987
- [[r, X + pe], c],
1005
+ [[l, ee + ye], u],
988
1006
  [
989
1007
  /(navigator|netscape\d?)\/([-\w\.]+)/i
990
1008
  // Netscape
991
1009
  ],
992
- [[r, "Netscape"], c],
1010
+ [[l, "Netscape"], u],
993
1011
  [
994
- /(wolvic)\/([\w\.]+)/i
995
- // Wolvic
1012
+ /(wolvic|librewolf)\/([\w\.]+)/i
1013
+ // Wolvic/LibreWolf
996
1014
  ],
997
- [r, c],
1015
+ [l, u],
998
1016
  [
999
1017
  /mobile vr; rv:([\w\.]+)\).+firefox/i
1000
1018
  // Firefox Reality
1001
1019
  ],
1002
- [c, [r, pe + " Reality"]],
1020
+ [u, [l, ye + " Reality"]],
1003
1021
  [
1004
1022
  /ekiohf.+(flow)\/([\w\.]+)/i,
1005
1023
  // Flow
@@ -1014,61 +1032,61 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
1014
1032
  /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,
1015
1033
  // Mozilla
1016
1034
  // Other
1017
- /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
1018
- // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Obigo/Mosaic/Go/ICE/UP.Browser
1019
- /(links) \(([\w\.]+)/i
1035
+ /(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
1036
+ // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Obigo/Mosaic/Go/ICE/UP.Browser/Ladybird
1037
+ /\b(links) \(([\w\.]+)/i
1020
1038
  // Links
1021
1039
  ],
1022
- [r, [c, /_/g, "."]],
1040
+ [l, [u, /_/g, "."]],
1023
1041
  [
1024
1042
  /(cobalt)\/([\w\.]+)/i
1025
1043
  // Cobalt
1026
1044
  ],
1027
- [r, [c, /[^\d\.]+./, re]]
1045
+ [l, [u, /[^\d\.]+./, le]]
1028
1046
  ],
1029
1047
  cpu: [
1030
1048
  [
1031
- /\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i
1049
+ /\b((amd|x|x86[-_]?|wow|win)64)\b/i
1032
1050
  // AMD64 (x64)
1033
1051
  ],
1034
- [[M, "amd64"]],
1052
+ [[I, "amd64"]],
1035
1053
  [
1036
1054
  /(ia32(?=;))/i,
1037
1055
  // IA32 (quicktime)
1038
- /((?:i[346]|x)86)[;\)]/i
1056
+ /\b((i[346]|x)86)(pc)?\b/i
1039
1057
  // IA32 (x86)
1040
1058
  ],
1041
- [[M, "ia32"]],
1059
+ [[I, "ia32"]],
1042
1060
  [
1043
- /\b(aarch64|arm(v?8e?l?|_?64))\b/i
1061
+ /\b(aarch64|arm(v?[89]e?l?|_?64))\b/i
1044
1062
  // ARM64
1045
1063
  ],
1046
- [[M, "arm64"]],
1064
+ [[I, "arm64"]],
1047
1065
  [
1048
- /\b(arm(?:v[67])?ht?n?[fl]p?)\b/i
1066
+ /\b(arm(v[67])?ht?n?[fl]p?)\b/i
1049
1067
  // ARMHF
1050
1068
  ],
1051
- [[M, "armhf"]],
1069
+ [[I, "armhf"]],
1052
1070
  [
1053
1071
  // PocketPC mistakenly identified as PowerPC
1054
- /windows (ce|mobile); ppc;/i
1072
+ /( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i
1055
1073
  ],
1056
- [[M, "arm"]],
1074
+ [[I, "arm"]],
1057
1075
  [
1058
- /((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i
1076
+ /((ppc|powerpc)(64)?)( mac|;|\))/i
1059
1077
  // PowerPC
1060
1078
  ],
1061
- [[M, /ower/, re, H]],
1079
+ [[I, /ower/, le, F]],
1062
1080
  [
1063
- /(sun4\w)[;\)]/i
1081
+ / sun4\w[;\)]/i
1064
1082
  // SPARC
1065
1083
  ],
1066
- [[M, "sparc"]],
1084
+ [[I, "sparc"]],
1067
1085
  [
1068
- /((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i
1086
+ /\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i
1069
1087
  // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
1070
1088
  ],
1071
- [[M, H]]
1089
+ [[I, F]]
1072
1090
  ],
1073
1091
  device: [
1074
1092
  [
@@ -1078,47 +1096,62 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
1078
1096
  // Samsung
1079
1097
  /\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i
1080
1098
  ],
1081
- [l, [u, Me], [d, f]],
1099
+ [o, [c, be], [n, f]],
1082
1100
  [
1083
- /\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,
1084
- /samsung[- ]([-\w]+)/i,
1101
+ /\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,
1102
+ /samsung[- ]((?!sm-[lr])[-\w]+)/i,
1085
1103
  /sec-(sgh\w+)/i
1086
1104
  ],
1087
- [l, [u, Me], [d, b]],
1105
+ [o, [c, be], [n, w]],
1088
1106
  [
1089
1107
  // Apple
1090
1108
  /(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i
1091
1109
  // iPod/iPhone
1092
1110
  ],
1093
- [l, [u, he], [d, b]],
1111
+ [o, [c, Z], [n, w]],
1094
1112
  [
1095
1113
  /\((ipad);[-\w\),; ]+apple/i,
1096
1114
  // iPad
1097
1115
  /applecoremedia\/[\w\.]+ \((ipad)/i,
1098
1116
  /\b(ipad)\d\d?,\d\d?[;\]].+ios/i
1099
1117
  ],
1100
- [l, [u, he], [d, f]],
1118
+ [o, [c, Z], [n, f]],
1101
1119
  [
1102
1120
  /(macintosh);/i
1103
1121
  ],
1104
- [l, [u, he]],
1122
+ [o, [c, Z]],
1105
1123
  [
1106
1124
  // Sharp
1107
1125
  /\b(sh-?[altvz]?\d\d[a-ekm]?)/i
1108
1126
  ],
1109
- [l, [u, yt], [d, b]],
1127
+ [o, [c, Tt], [n, w]],
1128
+ [
1129
+ // Honor
1130
+ /\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i
1131
+ ],
1132
+ [o, [c, St], [n, f]],
1133
+ [
1134
+ /honor([-\w ]+)[;\)]/i
1135
+ ],
1136
+ [o, [c, St], [n, w]],
1110
1137
  [
1111
1138
  // Huawei
1112
- /\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
1139
+ /\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i
1113
1140
  ],
1114
- [l, [u, wt], [d, f]],
1141
+ [o, [c, Ct], [n, f]],
1115
1142
  [
1116
- /(?:huawei|honor)([-\w ]+)[;\)]/i,
1143
+ /(?:huawei)([-\w ]+)[;\)]/i,
1117
1144
  /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i
1118
1145
  ],
1119
- [l, [u, wt], [d, b]],
1146
+ [o, [c, Ct], [n, w]],
1120
1147
  [
1121
1148
  // Xiaomi
1149
+ /oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,
1150
+ /\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i
1151
+ // Mi Pad tablets
1152
+ ],
1153
+ [[o, /_/g, " "], [c, tt], [n, f]],
1154
+ [
1122
1155
  /\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,
1123
1156
  // Xiaomi POCO
1124
1157
  /\b; (\w+) build\/hm\1/i,
@@ -1129,140 +1162,143 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
1129
1162
  // Xiaomi Redmi
1130
1163
  /oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,
1131
1164
  // Xiaomi Redmi 'numeric' models
1132
- /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i
1165
+ /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,
1133
1166
  // Xiaomi Mi
1167
+ / ([\w ]+) miui\/v?\d/i
1134
1168
  ],
1135
- [[l, /_/g, " "], [u, $e], [d, b]],
1136
- [
1137
- /oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,
1138
- // Redmi Pad
1139
- /\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i
1140
- // Mi Pad tablets
1141
- ],
1142
- [[l, /_/g, " "], [u, $e], [d, f]],
1169
+ [[o, /_/g, " "], [c, tt], [n, w]],
1143
1170
  [
1144
1171
  // OPPO
1145
1172
  /; (\w+) bui.+ oppo/i,
1146
1173
  /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
1147
1174
  ],
1148
- [l, [u, "OPPO"], [d, b]],
1175
+ [o, [c, et], [n, w]],
1149
1176
  [
1150
- /\b(opd2\d{3}a?) bui/i
1177
+ /\b(opd2(\d{3}a?))(?: bui|\))/i
1151
1178
  ],
1152
- [l, [u, "OPPO"], [d, f]],
1179
+ [o, [c, z, { OnePlus: ["304", "403", "203"], "*": et }], [n, f]],
1180
+ [
1181
+ // BLU Vivo Series
1182
+ /(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i
1183
+ ],
1184
+ [o, [c, "BLU"], [n, w]],
1153
1185
  [
1154
1186
  // Vivo
1155
- /vivo (\w+)(?: bui|\))/i,
1187
+ /; vivo (\w+)(?: bui|\))/i,
1156
1188
  /\b(v[12]\d{3}\w?[at])(?: bui|;)/i
1157
1189
  ],
1158
- [l, [u, "Vivo"], [d, b]],
1190
+ [o, [c, "Vivo"], [n, w]],
1159
1191
  [
1160
1192
  // Realme
1161
1193
  /\b(rmx[1-3]\d{3})(?: bui|;|\))/i
1162
1194
  ],
1163
- [l, [u, "Realme"], [d, b]],
1195
+ [o, [c, "Realme"], [n, w]],
1164
1196
  [
1165
1197
  // Motorola
1166
1198
  /\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,
1167
1199
  /\bmot(?:orola)?[- ](\w*)/i,
1168
- /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i
1200
+ /((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i
1169
1201
  ],
1170
- [l, [u, ft], [d, b]],
1202
+ [o, [c, Ye], [n, w]],
1171
1203
  [
1172
1204
  /\b(mz60\d|xoom[2 ]{0,2}) build\//i
1173
1205
  ],
1174
- [l, [u, ft], [d, f]],
1206
+ [o, [c, Ye], [n, f]],
1175
1207
  [
1176
1208
  // LG
1177
1209
  /((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i
1178
1210
  ],
1179
- [l, [u, We], [d, f]],
1211
+ [o, [c, Ue], [n, f]],
1180
1212
  [
1181
1213
  /(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,
1182
- /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,
1214
+ /\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch))(\w+)/i,
1183
1215
  /\blg-?([\d\w]+) bui/i
1184
1216
  ],
1185
- [l, [u, We], [d, b]],
1217
+ [o, [c, Ue], [n, w]],
1186
1218
  [
1187
1219
  // Lenovo
1188
- /(ideatab[-\w ]+)/i,
1189
- /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
1220
+ /(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,
1221
+ /lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i
1190
1222
  ],
1191
- [l, [u, bt], [d, f]],
1223
+ [o, [c, Mt], [n, f]],
1192
1224
  [
1193
1225
  // Nokia
1194
- /(?:maemo|nokia).*(n900|lumia \d+)/i,
1195
- /nokia[-_ ]?([-\w\.]*)/i
1226
+ /(nokia) (t[12][01])/i
1227
+ ],
1228
+ [c, o, [n, f]],
1229
+ [
1230
+ /(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,
1231
+ /nokia[-_ ]?(([-\w\. ]*))/i
1196
1232
  ],
1197
- [[l, /_/g, " "], [u, "Nokia"], [d, b]],
1233
+ [[o, /_/g, " "], [n, w], [c, "Nokia"]],
1198
1234
  [
1199
1235
  // Google
1200
- /(pixel c)\b/i
1201
- // Google Pixel C
1236
+ /(pixel (c|tablet))\b/i
1237
+ // Google Pixel C/Tablet
1202
1238
  ],
1203
- [l, [u, Ce], [d, f]],
1239
+ [o, [c, J], [n, f]],
1204
1240
  [
1205
1241
  /droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i
1206
1242
  // Google Pixel
1207
1243
  ],
1208
- [l, [u, Ce], [d, b]],
1244
+ [o, [c, J], [n, w]],
1209
1245
  [
1210
1246
  // Sony
1211
- /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
1247
+ /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
1212
1248
  ],
1213
- [l, [u, Se], [d, b]],
1249
+ [o, [c, fe], [n, w]],
1214
1250
  [
1215
1251
  /sony tablet [ps]/i,
1216
1252
  /\b(?:sony)?sgp\w+(?: bui|\))/i
1217
1253
  ],
1218
- [[l, "Xperia Tablet"], [u, Se], [d, f]],
1254
+ [[o, "Xperia Tablet"], [c, fe], [n, f]],
1219
1255
  [
1220
1256
  // OnePlus
1221
1257
  / (kb2005|in20[12]5|be20[12][59])\b/i,
1222
1258
  /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i
1223
1259
  ],
1224
- [l, [u, "OnePlus"], [d, b]],
1260
+ [o, [c, It], [n, w]],
1225
1261
  [
1226
1262
  // Amazon
1227
1263
  /(alexa)webm/i,
1228
- /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,
1264
+ /(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,
1229
1265
  // Kindle Fire without Silk / Echo Show
1230
1266
  /(kf[a-z]+)( bui|\)).+silk\//i
1231
1267
  // Kindle Fire HD
1232
1268
  ],
1233
- [l, [u, ve], [d, f]],
1269
+ [o, [c, xe], [n, f]],
1234
1270
  [
1235
1271
  /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i
1236
1272
  // Fire Phone
1237
1273
  ],
1238
- [[l, /(.+)/g, "Fire Phone $1"], [u, ve], [d, b]],
1274
+ [[o, /(.+)/g, "Fire Phone $1"], [c, xe], [n, w]],
1239
1275
  [
1240
1276
  // BlackBerry
1241
1277
  /(playbook);[-\w\),; ]+(rim)/i
1242
1278
  // BlackBerry PlayBook
1243
1279
  ],
1244
- [l, u, [d, f]],
1280
+ [o, c, [n, f]],
1245
1281
  [
1246
1282
  /\b((?:bb[a-f]|st[hv])100-\d)/i,
1247
1283
  /\(bb10; (\w+)/i
1248
1284
  // BlackBerry 10
1249
1285
  ],
1250
- [l, [u, mt], [d, b]],
1286
+ [o, [c, Et], [n, w]],
1251
1287
  [
1252
1288
  // Asus
1253
1289
  /(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i
1254
1290
  ],
1255
- [l, [u, gt], [d, f]],
1291
+ [o, [c, vt], [n, f]],
1256
1292
  [
1257
1293
  / (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i
1258
1294
  ],
1259
- [l, [u, gt], [d, b]],
1295
+ [o, [c, vt], [n, w]],
1260
1296
  [
1261
1297
  // HTC
1262
1298
  /(nexus 9)/i
1263
1299
  // HTC Nexus 9
1264
1300
  ],
1265
- [l, [u, "HTC"], [d, f]],
1301
+ [o, [c, "HTC"], [n, f]],
1266
1302
  [
1267
1303
  /(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,
1268
1304
  // HTC
@@ -1271,86 +1307,137 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
1271
1307
  /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i
1272
1308
  // Alcatel/GeeksPhone/Nexian/Panasonic/Sony
1273
1309
  ],
1274
- [u, [l, /_/g, " "], [d, b]],
1310
+ [c, [o, /_/g, " "], [n, w]],
1311
+ [
1312
+ // TCL
1313
+ /tcl (xess p17aa)/i,
1314
+ /droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i
1315
+ ],
1316
+ [o, [c, "TCL"], [n, f]],
1317
+ [
1318
+ /droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i
1319
+ ],
1320
+ [o, [c, "TCL"], [n, w]],
1321
+ [
1322
+ // itel
1323
+ /(itel) ((\w+))/i
1324
+ ],
1325
+ [[c, F], o, [n, z, { tablet: ["p10001l", "w7001"], "*": "mobile" }]],
1275
1326
  [
1276
1327
  // Acer
1277
1328
  /droid.+; ([ab][1-7]-?[0178a]\d\d?)/i
1278
1329
  ],
1279
- [l, [u, "Acer"], [d, f]],
1330
+ [o, [c, "Acer"], [n, f]],
1280
1331
  [
1281
1332
  // Meizu
1282
1333
  /droid.+; (m[1-5] note) bui/i,
1283
1334
  /\bmz-([-\w]{2,})/i
1284
1335
  ],
1285
- [l, [u, "Meizu"], [d, b]],
1336
+ [o, [c, "Meizu"], [n, w]],
1286
1337
  [
1287
1338
  // Ulefone
1288
1339
  /; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i
1289
1340
  ],
1290
- [l, [u, "Ulefone"], [d, b]],
1341
+ [o, [c, "Ulefone"], [n, w]],
1342
+ [
1343
+ // Energizer
1344
+ /; (energy ?\w+)(?: bui|\))/i,
1345
+ /; energizer ([\w ]+)(?: bui|\))/i
1346
+ ],
1347
+ [o, [c, "Energizer"], [n, w]],
1348
+ [
1349
+ // Cat
1350
+ /; cat (b35);/i,
1351
+ /; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i
1352
+ ],
1353
+ [o, [c, "Cat"], [n, w]],
1354
+ [
1355
+ // Smartfren
1356
+ /((?:new )?andromax[\w- ]+)(?: bui|\))/i
1357
+ ],
1358
+ [o, [c, "Smartfren"], [n, w]],
1359
+ [
1360
+ // Nothing
1361
+ /droid.+; (a(?:015|06[35]|142p?))/i
1362
+ ],
1363
+ [o, [c, "Nothing"], [n, w]],
1364
+ [
1365
+ // Archos
1366
+ /; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,
1367
+ /archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i
1368
+ ],
1369
+ [o, [c, "Archos"], [n, f]],
1370
+ [
1371
+ /archos ([\w ]+)( b|\))/i,
1372
+ /; (ac[3-6]\d\w{2,8})( b|\))/i
1373
+ ],
1374
+ [o, [c, "Archos"], [n, w]],
1291
1375
  [
1292
1376
  // MIXED
1293
- /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,
1294
- // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron
1377
+ /(imo) (tab \w+)/i,
1378
+ // IMO
1379
+ /(infinix) (x1101b?)/i
1380
+ // Infinix XPad
1381
+ ],
1382
+ [c, o, [n, f]],
1383
+ [
1384
+ /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,
1385
+ // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron/Infinix/Tecno/Micromax/Advan
1386
+ /; (blu|hmd|imo|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,
1387
+ // BLU/HMD/IMO/TCL
1295
1388
  /(hp) ([\w ]+\w)/i,
1296
1389
  // HP iPAQ
1297
- /(asus)-?(\w+)/i,
1298
- // Asus
1299
1390
  /(microsoft); (lumia[\w ]+)/i,
1300
1391
  // Microsoft Lumia
1301
- /(lenovo)[-_ ]?([-\w]+)/i,
1392
+ /(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,
1302
1393
  // Lenovo
1303
- /(jolla)/i,
1304
- // Jolla
1305
1394
  /(oppo) ?([\w ]+) bui/i
1306
1395
  // OPPO
1307
1396
  ],
1308
- [u, l, [d, b]],
1397
+ [c, o, [n, w]],
1309
1398
  [
1310
1399
  /(kobo)\s(ereader|touch)/i,
1311
1400
  // Kobo
1312
- /(archos) (gamepad2?)/i,
1313
- // Archos
1314
1401
  /(hp).+(touchpad(?!.+tablet)|tablet)/i,
1315
1402
  // HP TouchPad
1316
1403
  /(kindle)\/([\w\.]+)/i
1317
1404
  // Kindle
1318
1405
  ],
1319
- [u, l, [d, f]],
1406
+ [c, o, [n, f]],
1320
1407
  [
1321
1408
  /(surface duo)/i
1322
1409
  // Surface Duo
1323
1410
  ],
1324
- [l, [u, Oe], [d, f]],
1411
+ [o, [c, Je], [n, f]],
1325
1412
  [
1326
1413
  /droid [\d\.]+; (fp\du?)(?: b|\))/i
1327
1414
  // Fairphone
1328
1415
  ],
1329
- [l, [u, "Fairphone"], [d, b]],
1416
+ [o, [c, "Fairphone"], [n, w]],
1330
1417
  [
1331
- /(shield[\w ]+) b/i
1332
- // Nvidia Shield Tablets
1418
+ /((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i
1419
+ // Nvidia Tablets
1333
1420
  ],
1334
- [l, [u, "Nvidia"], [d, f]],
1421
+ [o, [c, Ze], [n, f]],
1335
1422
  [
1336
1423
  /(sprint) (\w+)/i
1337
1424
  // Sprint Phones
1338
1425
  ],
1339
- [u, l, [d, b]],
1426
+ [c, o, [n, w]],
1340
1427
  [
1341
1428
  /(kin\.[onetw]{3})/i
1342
1429
  // Microsoft Kin
1343
1430
  ],
1344
- [[l, /\./g, " "], [u, Oe], [d, b]],
1431
+ [[o, /\./g, " "], [c, Je], [n, w]],
1345
1432
  [
1346
1433
  /droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i
1347
1434
  // Zebra
1348
1435
  ],
1349
- [l, [u, je], [d, f]],
1436
+ [o, [c, it], [n, f]],
1350
1437
  [
1351
1438
  /droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i
1352
1439
  ],
1353
- [l, [u, je], [d, b]],
1440
+ [o, [c, it], [n, w]],
1354
1441
  [
1355
1442
  ///////////////////
1356
1443
  // SMARTTVS
@@ -1358,64 +1445,97 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
1358
1445
  /smart-tv.+(samsung)/i
1359
1446
  // Samsung
1360
1447
  ],
1361
- [u, [d, I]],
1448
+ [c, [n, y]],
1362
1449
  [
1363
1450
  /hbbtv.+maple;(\d+)/i
1364
1451
  ],
1365
- [[l, /^/, "SmartTV"], [u, Me], [d, I]],
1452
+ [[o, /^/, "SmartTV"], [c, be], [n, y]],
1366
1453
  [
1367
- /(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i
1454
+ /tcast.+(lg)e?. ([-\w]+)/i
1368
1455
  // LG SmartTV
1369
1456
  ],
1370
- [[u, We], [d, I]],
1457
+ [c, o, [n, y]],
1458
+ [
1459
+ /(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i
1460
+ ],
1461
+ [[c, Ue], [n, y]],
1371
1462
  [
1372
1463
  /(apple) ?tv/i
1373
1464
  // Apple TV
1374
1465
  ],
1375
- [u, [l, he + " TV"], [d, I]],
1466
+ [c, [o, Z + " TV"], [n, y]],
1467
+ [
1468
+ /crkey.*devicetype\/chromecast/i
1469
+ // Google Chromecast Third Generation
1470
+ ],
1471
+ [[o, H + " Third Generation"], [c, J], [n, y]],
1472
+ [
1473
+ /crkey.*devicetype\/([^/]*)/i
1474
+ // Google Chromecast with specific device type
1475
+ ],
1476
+ [[o, /^/, "Chromecast "], [c, J], [n, y]],
1477
+ [
1478
+ /fuchsia.*crkey/i
1479
+ // Google Chromecast Nest Hub
1480
+ ],
1481
+ [[o, H + " Nest Hub"], [c, J], [n, y]],
1376
1482
  [
1377
1483
  /crkey/i
1378
- // Google Chromecast
1484
+ // Google Chromecast, Linux-based or unknown
1379
1485
  ],
1380
- [[l, Ie + "cast"], [u, Ce], [d, I]],
1486
+ [[o, H], [c, J], [n, y]],
1487
+ [
1488
+ /(portaltv)/i
1489
+ // Facebook Portal TV
1490
+ ],
1491
+ [o, [c, st], [n, y]],
1381
1492
  [
1382
1493
  /droid.+aft(\w+)( bui|\))/i
1383
1494
  // Fire TV
1384
1495
  ],
1385
- [l, [u, ve], [d, I]],
1496
+ [o, [c, xe], [n, y]],
1497
+ [
1498
+ /(shield \w+ tv)/i
1499
+ // Nvidia Shield TV
1500
+ ],
1501
+ [o, [c, Ze], [n, y]],
1386
1502
  [
1387
1503
  /\(dtv[\);].+(aquos)/i,
1388
1504
  /(aquos-tv[\w ]+)\)/i
1389
1505
  // Sharp
1390
1506
  ],
1391
- [l, [u, yt], [d, I]],
1507
+ [o, [c, Tt], [n, y]],
1392
1508
  [
1393
1509
  /(bravia[\w ]+)( bui|\))/i
1394
1510
  // Sony
1395
1511
  ],
1396
- [l, [u, Se], [d, I]],
1512
+ [o, [c, fe], [n, y]],
1397
1513
  [
1398
- /(mitv-\w{5}) bui/i
1514
+ /(mi(tv|box)-?\w+) bui/i
1399
1515
  // Xiaomi
1400
1516
  ],
1401
- [l, [u, $e], [d, I]],
1517
+ [o, [c, tt], [n, y]],
1402
1518
  [
1403
1519
  /Hbbtv.*(technisat) (.*);/i
1404
1520
  // TechniSAT
1405
1521
  ],
1406
- [u, l, [d, I]],
1522
+ [c, o, [n, y]],
1407
1523
  [
1408
1524
  /\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,
1409
1525
  // Roku
1410
1526
  /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i
1411
1527
  // HbbTV devices
1412
1528
  ],
1413
- [[u, be], [l, be], [d, I]],
1529
+ [[c, Ie], [o, Ie], [n, y]],
1414
1530
  [
1415
- /\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i
1416
1531
  // SmartTV from Unidentified Vendors
1532
+ /droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i
1533
+ ],
1534
+ [o, [n, y]],
1535
+ [
1536
+ /\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i
1417
1537
  ],
1418
- [[d, I]],
1538
+ [[n, y]],
1419
1539
  [
1420
1540
  ///////////////////
1421
1541
  // CONSOLES
@@ -1425,39 +1545,71 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
1425
1545
  /(nintendo) (\w+)/i
1426
1546
  // Nintendo
1427
1547
  ],
1428
- [u, l, [d, J]],
1548
+ [c, o, [n, Ce]],
1429
1549
  [
1430
- /droid.+; (shield) bui/i
1431
- // Nvidia
1550
+ /droid.+; (shield)( bui|\))/i
1551
+ // Nvidia Portable
1432
1552
  ],
1433
- [l, [u, "Nvidia"], [d, J]],
1553
+ [o, [c, Ze], [n, Ce]],
1434
1554
  [
1435
1555
  /(playstation \w+)/i
1436
1556
  // Playstation
1437
1557
  ],
1438
- [l, [u, Se], [d, J]],
1558
+ [o, [c, fe], [n, Ce]],
1439
1559
  [
1440
1560
  /\b(xbox(?: one)?(?!; xbox))[\); ]/i
1441
1561
  // Microsoft Xbox
1442
1562
  ],
1443
- [l, [u, Oe], [d, J]],
1563
+ [o, [c, Je], [n, Ce]],
1444
1564
  [
1445
1565
  ///////////////////
1446
1566
  // WEARABLES
1447
1567
  ///////////////////
1448
- /((pebble))app/i
1568
+ /\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i
1569
+ // Samsung Galaxy Watch
1570
+ ],
1571
+ [o, [c, be], [n, U]],
1572
+ [
1573
+ /((pebble))app/i,
1449
1574
  // Pebble
1575
+ /(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i
1576
+ // Asus ZenWatch / LG Watch / Pixel Watch
1577
+ ],
1578
+ [c, o, [n, U]],
1579
+ [
1580
+ /(ow(?:19|20)?we?[1-3]{1,3})/i
1581
+ // Oppo Watch
1450
1582
  ],
1451
- [u, l, [d, Ae]],
1583
+ [o, [c, et], [n, U]],
1452
1584
  [
1453
1585
  /(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i
1454
1586
  // Apple Watch
1455
1587
  ],
1456
- [l, [u, he], [d, Ae]],
1588
+ [o, [c, Z], [n, U]],
1589
+ [
1590
+ /(opwwe\d{3})/i
1591
+ // OnePlus Watch
1592
+ ],
1593
+ [o, [c, It], [n, U]],
1594
+ [
1595
+ /(moto 360)/i
1596
+ // Motorola 360
1597
+ ],
1598
+ [o, [c, Ye], [n, U]],
1599
+ [
1600
+ /(smartwatch 3)/i
1601
+ // Sony SmartWatch
1602
+ ],
1603
+ [o, [c, fe], [n, U]],
1604
+ [
1605
+ /(g watch r)/i
1606
+ // LG G Watch R
1607
+ ],
1608
+ [o, [c, Ue], [n, U]],
1457
1609
  [
1458
1610
  /droid.+; (wt63?0{2,3})\)/i
1459
1611
  ],
1460
- [l, [u, je], [d, Ae]],
1612
+ [o, [c, it], [n, U]],
1461
1613
  [
1462
1614
  ///////////////////
1463
1615
  // XR
@@ -1465,12 +1617,17 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
1465
1617
  /droid.+; (glass) \d/i
1466
1618
  // Google Glass
1467
1619
  ],
1468
- [l, [u, Ce], [d, ht]],
1620
+ [o, [c, J], [n, Xe]],
1621
+ [
1622
+ /(pico) (4|neo3(?: link|pro)?)/i
1623
+ // Pico
1624
+ ],
1625
+ [c, o, [n, Xe]],
1469
1626
  [
1470
- /(quest( \d| pro)?)/i
1471
- // Oculus Quest
1627
+ /(quest( \d| pro)?s?).+vr/i
1628
+ // Meta Quest
1472
1629
  ],
1473
- [l, [u, kt], [d, ht]],
1630
+ [o, [c, st], [n, Xe]],
1474
1631
  [
1475
1632
  ///////////////////
1476
1633
  // EMBEDDED
@@ -1478,57 +1635,65 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
1478
1635
  /(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i
1479
1636
  // Tesla
1480
1637
  ],
1481
- [u, [d, Ze]],
1638
+ [c, [n, Me]],
1482
1639
  [
1483
1640
  /(aeobc)\b/i
1484
1641
  // Echo Dot
1485
1642
  ],
1486
- [l, [u, ve], [d, Ze]],
1643
+ [o, [c, xe], [n, Me]],
1644
+ [
1645
+ /(homepod).+mac os/i
1646
+ // Apple HomePod
1647
+ ],
1648
+ [o, [c, Z], [n, Me]],
1649
+ [
1650
+ /windows iot/i
1651
+ ],
1652
+ [[n, Me]],
1487
1653
  [
1488
1654
  ////////////////////
1489
1655
  // MIXED (GENERIC)
1490
1656
  ///////////////////
1491
- /droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i
1492
- // Android Phones from Unidentified Vendors
1493
- ],
1494
- [l, [d, b]],
1495
- [
1496
- /droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i
1497
- // Android Tablets from Unidentified Vendors
1657
+ /droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i
1498
1658
  ],
1499
- [l, [d, f]],
1659
+ [o, [n, z, { mobile: "Mobile", xr: "VR", "*": f }]],
1500
1660
  [
1501
1661
  /\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i
1502
1662
  // Unidentifiable Tablet
1503
1663
  ],
1504
- [[d, f]],
1664
+ [[n, f]],
1505
1665
  [
1506
1666
  /(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i
1507
1667
  // Unidentifiable Mobile
1508
1668
  ],
1509
- [[d, b]],
1669
+ [[n, w]],
1510
1670
  [
1511
- /(android[-\w\. ]{0,9});.+buil/i
1671
+ /droid .+?; ([\w\. -]+)( bui|\))/i
1512
1672
  // Generic Android Device
1513
1673
  ],
1514
- [l, [u, "Generic"]]
1674
+ [o, [c, "Generic"]]
1515
1675
  ],
1516
1676
  engine: [
1517
1677
  [
1518
1678
  /windows.+ edge\/([\w\.]+)/i
1519
1679
  // EdgeHTML
1520
1680
  ],
1521
- [c, [r, di + "HTML"]],
1681
+ [u, [l, Ei + "HTML"]],
1682
+ [
1683
+ /(arkweb)\/([\w\.]+)/i
1684
+ // ArkWeb
1685
+ ],
1686
+ [l, u],
1522
1687
  [
1523
1688
  /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i
1524
1689
  // Blink
1525
1690
  ],
1526
- [c, [r, "Blink"]],
1691
+ [u, [l, "Blink"]],
1527
1692
  [
1528
1693
  /(presto)\/([\w\.]+)/i,
1529
1694
  // Presto
1530
- /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,
1531
- // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
1695
+ /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,
1696
+ // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna/Servo
1532
1697
  /ekioh(flow)\/([\w\.]+)/i,
1533
1698
  // Flow
1534
1699
  /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,
@@ -1536,13 +1701,18 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
1536
1701
  /(icab)[\/ ]([23]\.[\d\.]+)/i,
1537
1702
  // iCab
1538
1703
  /\b(libweb)/i
1704
+ // LibWeb
1705
+ ],
1706
+ [l, u],
1707
+ [
1708
+ /ladybird\//i
1539
1709
  ],
1540
- [r, c],
1710
+ [[l, "LibWeb"]],
1541
1711
  [
1542
1712
  /rv\:([\w\.]{1,9})\b.+(gecko)/i
1543
1713
  // Gecko
1544
1714
  ],
1545
- [c, r]
1715
+ [u, l]
1546
1716
  ],
1547
1717
  os: [
1548
1718
  [
@@ -1550,87 +1720,107 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
1550
1720
  /microsoft (windows) (vista|xp)/i
1551
1721
  // Windows (iTunes)
1552
1722
  ],
1553
- [r, c],
1723
+ [l, u],
1554
1724
  [
1555
- /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i
1725
+ /(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i
1556
1726
  // Windows Phone
1557
1727
  ],
1558
- [r, [c, Re, Ct]],
1728
+ [l, [u, z, xt]],
1559
1729
  [
1560
1730
  /windows nt 6\.2; (arm)/i,
1561
1731
  // Windows RT
1562
- /windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,
1732
+ /windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,
1563
1733
  /(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i
1564
1734
  ],
1565
- [[c, Re, Ct], [r, tt]],
1735
+ [[u, z, xt], [l, lt]],
1566
1736
  [
1567
1737
  // iOS/macOS
1568
- /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,
1738
+ /[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,
1569
1739
  // iOS
1570
1740
  /(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,
1571
1741
  /cfnetwork\/.+darwin/i
1572
1742
  ],
1573
- [[c, /_/g, "."], [r, "iOS"]],
1743
+ [[u, /_/g, "."], [l, "iOS"]],
1574
1744
  [
1575
1745
  /(mac os x) ?([\w\. ]*)/i,
1576
1746
  /(macintosh|mac_powerpc\b)(?!.+haiku)/i
1577
1747
  // Mac OS
1578
1748
  ],
1579
- [[r, "macOS"], [c, /_/g, "."]],
1749
+ [[l, "macOS"], [u, /_/g, "."]],
1750
+ [
1751
+ // Google Chromecast
1752
+ /android ([\d\.]+).*crkey/i
1753
+ // Google Chromecast, Android-based
1754
+ ],
1755
+ [u, [l, H + " Android"]],
1756
+ [
1757
+ /fuchsia.*crkey\/([\d\.]+)/i
1758
+ // Google Chromecast, Fuchsia-based
1759
+ ],
1760
+ [u, [l, H + " Fuchsia"]],
1761
+ [
1762
+ /crkey\/([\d\.]+).*devicetype\/smartspeaker/i
1763
+ // Google Chromecast, Linux-based Smart Speaker
1764
+ ],
1765
+ [u, [l, H + " SmartSpeaker"]],
1766
+ [
1767
+ /linux.*crkey\/([\d\.]+)/i
1768
+ // Google Chromecast, Legacy Linux-based
1769
+ ],
1770
+ [u, [l, H + " Linux"]],
1771
+ [
1772
+ /crkey\/([\d\.]+)/i
1773
+ // Google Chromecast, unknown
1774
+ ],
1775
+ [u, [l, H]],
1580
1776
  [
1581
1777
  // Mobile OSes
1582
1778
  /droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i
1583
1779
  // Android-x86/HarmonyOS
1584
1780
  ],
1585
- [c, r],
1781
+ [u, l],
1782
+ [
1783
+ /(ubuntu) ([\w\.]+) like android/i
1784
+ // Ubuntu Touch
1785
+ ],
1786
+ [[l, /(.+)/, "$1 Touch"], u],
1586
1787
  [
1587
- // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS
1588
- /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,
1589
- /(blackberry)\w*\/([\w\.]*)/i,
1590
- // Blackberry
1591
- /(tizen|kaios)[\/ ]([\w\.]+)/i,
1592
- // Tizen/KaiOS
1593
- /\((series40);/i
1594
- // Series 40
1788
+ // Android/Blackberry/WebOS/QNX/Bada/RIM/KaiOS/Maemo/MeeGo/S40/Sailfish OS/OpenHarmony/Tizen
1789
+ /(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/\.; ]?([\d\.]*)/i
1595
1790
  ],
1596
- [r, c],
1791
+ [l, u],
1597
1792
  [
1598
1793
  /\(bb(10);/i
1599
1794
  // BlackBerry 10
1600
1795
  ],
1601
- [c, [r, mt]],
1796
+ [u, [l, Et]],
1602
1797
  [
1603
- /(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i
1798
+ /(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i
1604
1799
  // Symbian
1605
1800
  ],
1606
- [c, [r, "Symbian"]],
1801
+ [u, [l, "Symbian"]],
1607
1802
  [
1608
1803
  /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i
1609
1804
  // Firefox OS
1610
1805
  ],
1611
- [c, [r, pe + " OS"]],
1806
+ [u, [l, ye + " OS"]],
1612
1807
  [
1613
1808
  /web0s;.+rt(tv)/i,
1614
1809
  /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i
1615
1810
  // WebOS
1616
1811
  ],
1617
- [c, [r, "webOS"]],
1812
+ [u, [l, "webOS"]],
1618
1813
  [
1619
1814
  /watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i
1620
1815
  // watchOS
1621
1816
  ],
1622
- [c, [r, "watchOS"]],
1623
- [
1624
- // Google Chromecast
1625
- /crkey\/([\d\.]+)/i
1626
- // Google Chromecast
1627
- ],
1628
- [c, [r, Ie + "cast"]],
1817
+ [u, [l, "watchOS"]],
1629
1818
  [
1819
+ // Google ChromeOS
1630
1820
  /(cros) [\w]+(?:\)| ([\w\.]+)\b)/i
1631
1821
  // Chromium OS
1632
1822
  ],
1633
- [[r, "Chrome OS"], c],
1823
+ [[l, "Chrome OS"], u],
1634
1824
  [
1635
1825
  // Smart TVs
1636
1826
  /panasonic;(viera)/i,
@@ -1644,6 +1834,8 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
1644
1834
  // Nintendo/Playstation
1645
1835
  /(xbox); +xbox ([^\);]+)/i,
1646
1836
  // Microsoft Xbox (360, One, X, S, Series X, Series S)
1837
+ /(pico) .+os([\w\.]+)/i,
1838
+ // Pico
1647
1839
  // Other
1648
1840
  /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,
1649
1841
  // Joli/Palm
@@ -1653,7 +1845,7 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
1653
1845
  // Mageia/VectorLinux
1654
1846
  /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,
1655
1847
  // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire
1656
- /(hurd|linux) ?([\w\.]*)/i,
1848
+ /(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,
1657
1849
  // Hurd/Linux
1658
1850
  /(gnu) ?([\w\.]*)/i,
1659
1851
  // GNU
@@ -1662,12 +1854,12 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
1662
1854
  /(haiku) (\w+)/i
1663
1855
  // Haiku
1664
1856
  ],
1665
- [r, c],
1857
+ [l, u],
1666
1858
  [
1667
1859
  /(sunos) ?([\w\.\d]*)/i
1668
1860
  // Solaris
1669
1861
  ],
1670
- [[r, "Solaris"], c],
1862
+ [[l, "Solaris"], u],
1671
1863
  [
1672
1864
  /((?:open)?solaris)[-\/ ]?([\w\.]*)/i,
1673
1865
  // Solaris
@@ -1678,214 +1870,233 @@ var ti = "2.0.0-beta.3", re = "", ut = "?", Je = "function", G = "undefined", ce
1678
1870
  /(unix) ?([\w\.]*)/i
1679
1871
  // UNIX
1680
1872
  ],
1681
- [r, c]
1873
+ [l, u]
1682
1874
  ]
1683
- }, Te = function() {
1875
+ }, Re = function() {
1684
1876
  var s = { init: {}, isIgnore: {}, isIgnoreRgx: {}, toString: {} };
1685
- return B.call(s.init, [
1686
- [T, [r, c, we, d]],
1687
- [U, [M]],
1688
- [x, [d, l, u]],
1689
- [_, [r, c]],
1690
- [P, [r, c]]
1691
- ]), B.call(s.isIgnore, [
1692
- [T, [c, we]],
1693
- [_, [c]],
1694
- [P, [c]]
1695
- ]), B.call(s.isIgnoreRgx, [
1696
- [T, / ?browser$/i],
1877
+ return N.call(s.init, [
1878
+ [S, [l, u, Se, n]],
1879
+ [B, [I]],
1880
+ [R, [n, o, c]],
1881
+ [O, [l, u]],
1882
+ [P, [l, u]]
1883
+ ]), N.call(s.isIgnore, [
1884
+ [S, [u, Se]],
1885
+ [O, [u]],
1886
+ [P, [u]]
1887
+ ]), N.call(s.isIgnoreRgx, [
1888
+ [S, / ?browser$/i],
1697
1889
  [P, / ?os$/i]
1698
- ]), B.call(s.toString, [
1699
- [T, [r, c]],
1700
- [U, [M]],
1701
- [x, [u, l]],
1702
- [_, [r, c]],
1703
- [P, [r, c]]
1890
+ ]), N.call(s.toString, [
1891
+ [S, [l, u]],
1892
+ [B, [I]],
1893
+ [R, [c, o]],
1894
+ [O, [l, u]],
1895
+ [P, [l, u]]
1704
1896
  ]), s;
1705
- }(), hi = function(s, t) {
1706
- var e = Te.init[t], i = Te.isIgnore[t] || 0, a = Te.isIgnoreRgx[t] || 0, o = Te.toString[t] || 0;
1707
- function n() {
1708
- B.call(this, e);
1897
+ }(), Si = function(s, t) {
1898
+ var e = Re.init[t], i = Re.isIgnore[t] || 0, a = Re.isIgnoreRgx[t] || 0, d = Re.toString[t] || 0;
1899
+ function r() {
1900
+ N.call(this, e);
1709
1901
  }
1710
- return n.prototype.getItem = function() {
1902
+ return r.prototype.getItem = function() {
1711
1903
  return s;
1712
- }, n.prototype.withClientHints = function() {
1713
- return D ? D.getHighEntropyValues(Bt).then(function(h) {
1714
- return s.setCH(new Ft(h, !1)).parseCH().get();
1904
+ }, r.prototype.withClientHints = function() {
1905
+ return V ? V.getHighEntropyValues(jt).then(function(p) {
1906
+ return s.setCH(new $t(p, !1)).parseCH().get();
1715
1907
  }) : s.parseCH().get();
1716
- }, n.prototype.withFeatureCheck = function() {
1908
+ }, r.prototype.withFeatureCheck = function() {
1717
1909
  return s.detectFeature().get();
1718
- }, t != Z && (n.prototype.is = function(h) {
1719
- var p = !1;
1720
- for (var w in this)
1721
- if (this.hasOwnProperty(w) && !it(i, w) && H(a ? $(a, this[w]) : this[w]) == H(a ? $(a, h) : h)) {
1722
- if (p = !0, h != G)
1723
- break;
1724
- } else if (h == G && p) {
1725
- p = !p;
1910
+ }, t != te && (r.prototype.is = function(p) {
1911
+ var h = !1;
1912
+ for (var g in this)
1913
+ if (this.hasOwnProperty(g) && !ut(i, g) && F(a ? he(a, this[g]) : this[g]) == F(a ? he(a, p) : p)) {
1914
+ if (h = !0, p != W) break;
1915
+ } else if (p == W && h) {
1916
+ h = !h;
1726
1917
  break;
1727
1918
  }
1728
- return p;
1729
- }, n.prototype.toString = function() {
1730
- var h = re;
1731
- for (var p in o)
1732
- typeof this[o[p]] !== G && (h += (h ? " " : re) + this[o[p]]);
1733
- return h || G;
1734
- }), D || (n.prototype.then = function(h) {
1735
- var p = this, w = function() {
1736
- for (var k in p)
1737
- p.hasOwnProperty(k) && (this[k] = p[k]);
1919
+ return h;
1920
+ }, r.prototype.toString = function() {
1921
+ var p = le;
1922
+ for (var h in d)
1923
+ typeof this[d[h]] !== W && (p += (p ? " " : le) + this[d[h]]);
1924
+ return p || W;
1925
+ }), V || (r.prototype.then = function(p) {
1926
+ var h = this, g = function() {
1927
+ for (var C in h)
1928
+ h.hasOwnProperty(C) && (this[C] = h[C]);
1738
1929
  };
1739
- w.prototype = {
1740
- is: n.prototype.is,
1741
- toString: n.prototype.toString
1930
+ g.prototype = {
1931
+ is: r.prototype.is,
1932
+ toString: r.prototype.toString
1742
1933
  };
1743
- var g = new w();
1744
- return h(g), g;
1745
- }), new n();
1934
+ var m = new g();
1935
+ return p(m), m;
1936
+ }), new r();
1746
1937
  };
1747
- function Ft(s, t) {
1748
- if (s = s || {}, B.call(this, Bt), t)
1749
- B.call(this, [
1750
- [st, Qe(s[z])],
1751
- [at, Qe(s[ii])],
1752
- [b, /\?1/.test(s[oi])],
1753
- [l, me(s[ri])],
1754
- [Y, me(s[_t])],
1755
- [nt, me(s[ci])],
1756
- [M, me(s[si])],
1757
- [W, Qe(s[ni])],
1758
- [De, me(s[ai])]
1938
+ function $t(s, t) {
1939
+ if (s = s || {}, N.call(this, jt), t)
1940
+ N.call(this, [
1941
+ [ht, at(s[$])],
1942
+ [pt, at(s[wi])],
1943
+ [w, /\?1/.test(s[yi])],
1944
+ [o, Ee(s[ki])],
1945
+ [ie, Ee(s[Wt])],
1946
+ [gt, Ee(s[vi])],
1947
+ [I, Ee(s[mi])],
1948
+ [Y, at(s[fi])],
1949
+ [Ve, Ee(s[bi])]
1759
1950
  ]);
1760
1951
  else
1761
1952
  for (var e in s)
1762
- this.hasOwnProperty(e) && typeof s[e] !== G && (this[e] = s[e]);
1953
+ this.hasOwnProperty(e) && typeof s[e] !== W && (this[e] = s[e]);
1763
1954
  }
1764
- function It(s, t, e, i) {
1955
+ function Lt(s, t, e, i) {
1765
1956
  return this.get = function(a) {
1766
1957
  return a ? this.data.hasOwnProperty(a) ? this.data[a] : void 0 : this.data;
1767
- }, this.set = function(a, o) {
1768
- return this.data[a] = o, this;
1958
+ }, this.set = function(a, d) {
1959
+ return this.data[a] = d, this;
1769
1960
  }, this.setCH = function(a) {
1770
1961
  return this.uaCH = a, this;
1771
1962
  }, this.detectFeature = function() {
1772
- if (S && S.userAgent == this.ua)
1963
+ if (T && T.userAgent == this.ua)
1773
1964
  switch (this.itemType) {
1774
- case T:
1775
- S.brave && typeof S.brave.isBrave == Je && this.set(r, "Brave");
1965
+ case S:
1966
+ T.brave && typeof T.brave.isBrave == _e && this.set(l, "Brave");
1776
1967
  break;
1777
- case x:
1778
- !this.get(d) && D && D[b] && this.set(d, b), this.get(l) == "Macintosh" && S && typeof S.standalone !== G && S.maxTouchPoints && S.maxTouchPoints > 2 && this.set(l, "iPad").set(d, f);
1968
+ case R:
1969
+ !this.get(n) && V && V[w] && this.set(n, w), this.get(o) == "Macintosh" && T && typeof T.standalone !== W && T.maxTouchPoints && T.maxTouchPoints > 2 && this.set(o, "iPad").set(n, f);
1779
1970
  break;
1780
1971
  case P:
1781
- !this.get(r) && D && D[Y] && this.set(r, D[Y]);
1972
+ !this.get(l) && V && V[ie] && this.set(l, V[ie]);
1782
1973
  break;
1783
- case Z:
1784
- var a = this.data, o = function(n) {
1785
- return a[n].getItem().detectFeature().get();
1974
+ case te:
1975
+ var a = this.data, d = function(r) {
1976
+ return a[r].getItem().detectFeature().get();
1786
1977
  };
1787
- this.set(T, o(T)).set(U, o(U)).set(x, o(x)).set(_, o(_)).set(P, o(P));
1978
+ this.set(S, d(S)).set(B, d(B)).set(R, d(R)).set(O, d(O)).set(P, d(P));
1788
1979
  }
1789
1980
  return this;
1790
1981
  }, this.parseUA = function() {
1791
- return this.itemType != Z && vt.call(this.data, this.ua, this.rgxMap), this.itemType == T && this.set(we, Xe(this.get(c))), this;
1982
+ return this.itemType != te && ot.call(this.data, this.ua, this.rgxMap), this.itemType == S && this.set(Se, nt(this.get(u))), this;
1792
1983
  }, this.parseCH = function() {
1793
- var a = this.uaCH, o = this.rgxMap;
1984
+ var a = this.uaCH, d = this.rgxMap;
1794
1985
  switch (this.itemType) {
1795
- case T:
1796
- var n = a[at] || a[st], h;
1797
- if (n)
1798
- for (var p in n) {
1799
- var w = $(/(Google|Microsoft) /, n[p].brand || n[p]), g = n[p].version;
1800
- !/not.a.brand/i.test(w) && (!h || /chrom/i.test(h) && !/chromi/i.test(w)) && (this.set(r, w).set(c, g).set(we, Xe(g)), h = w);
1986
+ case S:
1987
+ case O:
1988
+ var r = a[pt] || a[ht], p;
1989
+ if (r)
1990
+ for (var h in r) {
1991
+ var g = r[h].brand || r[h], m = r[h].version;
1992
+ this.itemType == S && !/not.a.brand/i.test(g) && (!p || /chrom/i.test(p) && g != Pt) && (g = z(g, {
1993
+ Chrome: "Google Chrome",
1994
+ Edge: "Microsoft Edge",
1995
+ "Chrome WebView": "Android WebView",
1996
+ "Chrome Headless": "HeadlessChrome",
1997
+ "Huawei Browser": "HuaweiBrowser",
1998
+ "MIUI Browser": "Miui Browser",
1999
+ "Opera Mobi": "OperaMobile",
2000
+ Yandex: "YaBrowser"
2001
+ }), this.set(l, g).set(u, m).set(Se, nt(m)), p = g), this.itemType == O && g == Pt && this.set(u, m);
1801
2002
  }
1802
2003
  break;
1803
- case U:
1804
- var k = a[M];
1805
- k && (k && a[De] == "64" && (k += "64"), vt.call(this.data, k + ";", o));
2004
+ case B:
2005
+ var C = a[I];
2006
+ C && (C && a[Ve] == "64" && (C += "64"), ot.call(this.data, C + ";", d));
1806
2007
  break;
1807
- case x:
1808
- if (a[b] && this.set(d, b), a[l] && this.set(l, a[l]), a[l] == "Xbox" && this.set(d, J).set(u, Oe), a[W]) {
1809
- var F;
1810
- if (typeof a[W] != "string")
1811
- for (var j = 0; !F && j < a[W].length; )
1812
- F = Re(a[W][j++], Mt);
2008
+ case R:
2009
+ if (a[w] && this.set(n, w), a[o] && (this.set(o, a[o]), !this.get(n) || !this.get(c))) {
2010
+ var A = {};
2011
+ ot.call(A, "droid 9; " + a[o] + ")", d), !this.get(n) && A.type && this.set(n, A.type), !this.get(c) && A.vendor && this.set(c, A.vendor);
2012
+ }
2013
+ if (a[Y]) {
2014
+ var D;
2015
+ if (typeof a[Y] != "string")
2016
+ for (var ge = 0; !D && ge < a[Y].length; )
2017
+ D = z(a[Y][ge++], Ut);
1813
2018
  else
1814
- F = Re(a[W], Mt);
1815
- this.set(d, F);
2019
+ D = z(a[Y], Ut);
2020
+ this.set(n, D);
1816
2021
  }
1817
2022
  break;
1818
2023
  case P:
1819
- var Q = a[Y];
1820
- if (Q) {
1821
- var L = a[nt];
1822
- Q == tt && (L = parseInt(Xe(L), 10) >= 13 ? "11" : "10"), this.set(r, Q).set(c, L);
2024
+ var _ = a[ie];
2025
+ if (_) {
2026
+ var Q = a[gt];
2027
+ _ == lt && (Q = parseInt(nt(Q), 10) >= 13 ? "11" : "10"), this.set(l, _).set(u, Q);
1823
2028
  }
1824
- this.get(r) == tt && a[l] == "Xbox" && this.set(r, "Xbox").set(c, void 0);
2029
+ this.get(l) == lt && a[o] == "Xbox" && this.set(l, "Xbox").set(u, void 0);
1825
2030
  break;
1826
- case Z:
1827
- var le = this.data, A = function(Ee) {
1828
- return le[Ee].getItem().setCH(a).parseCH().get();
2031
+ case te:
2032
+ var K = this.data, G = function(Oe) {
2033
+ return K[Oe].getItem().setCH(a).parseCH().get();
1829
2034
  };
1830
- this.set(T, A(T)).set(U, A(U)).set(x, A(x)).set(_, A(_)).set(P, A(P));
2035
+ this.set(S, G(S)).set(B, G(B)).set(R, G(R)).set(O, G(O)).set(P, G(P));
1831
2036
  }
1832
2037
  return this;
1833
- }, B.call(this, [
2038
+ }, N.call(this, [
1834
2039
  ["itemType", s],
1835
2040
  ["ua", t],
1836
2041
  ["uaCH", i],
1837
2042
  ["rgxMap", e],
1838
- ["data", hi(this, s)]
2043
+ ["data", Si(this, s)]
1839
2044
  ]), this;
1840
2045
  }
1841
- function R(s, t, e) {
1842
- if (typeof s === ce ? (xe(s, !0) ? (typeof t === ce && (e = t), t = s) : (e = s, t = void 0), s = void 0) : typeof s === Ye && !xe(t, !0) && (e = t, t = void 0), !(this instanceof R))
1843
- return new R(s, t, e).getResult();
1844
- var i = typeof s === Ye ? s : (
2046
+ function L(s, t, e) {
2047
+ if (typeof s === ue ? (Be(s, !0) ? (typeof t === ue && (e = t), t = s) : (e = s, t = void 0), s = void 0) : typeof s === dt && !Be(t, !0) && (e = t, t = void 0), e && typeof e.append === _e) {
2048
+ var i = {};
2049
+ e.forEach(function(h, g) {
2050
+ i[g] = h;
2051
+ }), e = i;
2052
+ }
2053
+ if (!(this instanceof L))
2054
+ return new L(s, t, e).getResult();
2055
+ var a = typeof s === dt ? s : (
1845
2056
  // Passed user-agent string
1846
- S && S.userAgent ? S.userAgent : (
1847
- // navigator.userAgent
1848
- e && e[pt] ? e[pt] : (
1849
- // User-Agent from passed headers
1850
- re
2057
+ e && e[yt] ? e[yt] : (
2058
+ // User-Agent from passed headers
2059
+ T && T.userAgent ? T.userAgent : (
2060
+ // navigator.userAgent
2061
+ le
1851
2062
  )
1852
2063
  )
1853
- ), a = new Ft(e, !0), o = t ? ui(St, t) : St, n = function(h) {
1854
- return h == Z ? function() {
1855
- return new It(h, i, o, a).set("ua", i).set(T, this.getBrowser()).set(U, this.getCPU()).set(x, this.getDevice()).set(_, this.getEngine()).set(P, this.getOS()).get();
2064
+ ), d = new $t(e, !0), r = t ? Mi(Rt, t) : Rt, p = function(h) {
2065
+ return h == te ? function() {
2066
+ return new Lt(h, a, r, d).set("ua", a).set(S, this.getBrowser()).set(B, this.getCPU()).set(R, this.getDevice()).set(O, this.getEngine()).set(P, this.getOS()).get();
1856
2067
  } : function() {
1857
- return new It(h, i, o[h], a).parseUA().get();
2068
+ return new Lt(h, a, r[h], d).parseUA().get();
1858
2069
  };
1859
2070
  };
1860
- return B.call(this, [
1861
- ["getBrowser", n(T)],
1862
- ["getCPU", n(U)],
1863
- ["getDevice", n(x)],
1864
- ["getEngine", n(_)],
1865
- ["getOS", n(P)],
1866
- ["getResult", n(Z)],
2071
+ return N.call(this, [
2072
+ ["getBrowser", p(S)],
2073
+ ["getCPU", p(B)],
2074
+ ["getDevice", p(R)],
2075
+ ["getEngine", p(O)],
2076
+ ["getOS", p(P)],
2077
+ ["getResult", p(te)],
1867
2078
  ["getUA", function() {
1868
- return i;
2079
+ return a;
1869
2080
  }],
1870
2081
  ["setUA", function(h) {
1871
- return de(h) && (i = h.length > et ? be(h, et) : h), this;
2082
+ return pe(h) && (a = h.length > ct ? Ie(h, ct) : h), this;
1872
2083
  }]
1873
- ]).setUA(i), this;
2084
+ ]).setUA(a), this;
1874
2085
  }
1875
- R.VERSION = ti;
1876
- R.BROWSER = Ne([r, c, we, d]);
1877
- R.CPU = Ne([M]);
1878
- R.DEVICE = Ne([l, u, d, J, b, I, f, Ae, Ze]);
1879
- R.ENGINE = R.OS = Ne([r, c]);
1880
- class pi {
2086
+ L.VERSION = gi;
2087
+ L.BROWSER = ze([l, u, Se, n]);
2088
+ L.CPU = ze([I]);
2089
+ L.DEVICE = ze([o, c, n, Ce, w, y, f, U, Me]);
2090
+ L.ENGINE = L.OS = ze([l, u]);
2091
+ class Ii {
1881
2092
  constructor(t, e) {
1882
- m(this, "config");
1883
- m(this, "sdkConfig");
2093
+ b(this, "config");
2094
+ b(this, "sdkConfig");
1884
2095
  this.config = t, this.sdkConfig = e;
1885
2096
  }
1886
2097
  on(t, e, i) {
1887
- const a = function(n) {
1888
- n.data.message !== `kalamba:wrapper-rgs:${t}` && n.data.message !== `kalamba:wrapper:${t}` || e(n.data.payload);
2098
+ const a = function(r) {
2099
+ r.data.message !== `kalamba:wrapper-rgs:${t}` && r.data.message !== `kalamba:wrapper:${t}` || e(r.data.payload);
1889
2100
  };
1890
2101
  window.addEventListener("message", a, i);
1891
2102
  }
@@ -1896,16 +2107,16 @@ class pi {
1896
2107
  });
1897
2108
  }
1898
2109
  }
1899
- class gi {
2110
+ class Ti {
1900
2111
  constructor(t) {
1901
- m(this, "socket", null);
1902
- m(this, "webSocketUrl");
1903
- m(this, "eventListeners", {
2112
+ b(this, "socket", null);
2113
+ b(this, "webSocketUrl");
2114
+ b(this, "eventListeners", {
1904
2115
  close: [],
1905
2116
  error: [],
1906
2117
  message: []
1907
2118
  });
1908
- m(this, "connect", async () => {
2119
+ b(this, "connect", async () => {
1909
2120
  const t = new WebSocket(this.webSocketUrl);
1910
2121
  return t.addEventListener("message", this.handleMessage), new Promise((e) => {
1911
2122
  t.addEventListener(
@@ -1917,32 +2128,32 @@ class gi {
1917
2128
  );
1918
2129
  });
1919
2130
  });
1920
- m(this, "send", (t) => {
2131
+ b(this, "send", (t) => {
1921
2132
  if (this.socket == null)
1922
2133
  throw new Error("Cannot send message, the WebSocket connection is not open");
1923
2134
  this.socket.send(t);
1924
2135
  });
1925
- m(this, "close", () => {
2136
+ b(this, "close", () => {
1926
2137
  if (this.socket == null)
1927
2138
  throw new Error("Cannot close the WebSocket connection that is not open");
1928
2139
  this.socket.close();
1929
2140
  });
1930
- m(this, "handleClose", (t) => {
2141
+ b(this, "handleClose", (t) => {
1931
2142
  this.eventListeners.close.forEach((e) => {
1932
2143
  e(t);
1933
2144
  }), this.socket.removeEventListener("message", this.handleMessage), this.socket.removeEventListener("close", this.handleClose), this.socket.removeEventListener("error", this.handleError), this.socket = null;
1934
2145
  });
1935
- m(this, "handleError", (t) => {
2146
+ b(this, "handleError", (t) => {
1936
2147
  this.eventListeners.error.forEach((e) => {
1937
2148
  e(t);
1938
2149
  });
1939
2150
  });
1940
- m(this, "handleMessage", (t) => {
2151
+ b(this, "handleMessage", (t) => {
1941
2152
  this.eventListeners.message.forEach((e) => {
1942
2153
  e(t);
1943
2154
  });
1944
2155
  });
1945
- m(this, "handleOpen", (t) => {
2156
+ b(this, "handleOpen", (t) => {
1946
2157
  const e = t.target;
1947
2158
  e.addEventListener("close", this.handleClose), e.addEventListener("error", this.handleError), this.socket = e;
1948
2159
  });
@@ -1956,31 +2167,31 @@ class gi {
1956
2167
  i !== -1 && this.eventListeners[t].splice(i, 1);
1957
2168
  }
1958
2169
  }
1959
- function Pe(s) {
2170
+ function Le(s) {
1960
2171
  return JSON.parse(s == null ? void 0 : s.data);
1961
2172
  }
1962
- function mi(s) {
2173
+ function Ai(s) {
1963
2174
  var t;
1964
2175
  return ((t = s == null ? void 0 : s.header) == null ? void 0 : t.name) === "Ping";
1965
2176
  }
1966
- function Tt(s) {
2177
+ function _t(s) {
1967
2178
  var t;
1968
2179
  return ((t = s == null ? void 0 : s.header) == null ? void 0 : t.name) === "RealityCheck";
1969
2180
  }
1970
- function Le(s) {
2181
+ function Fe(s) {
1971
2182
  return s.header.name === "GameEvent";
1972
2183
  }
1973
- function wi(s) {
1974
- return Le(s) && s.body.event === "OPEN_GAME";
2184
+ function Pi(s) {
2185
+ return Fe(s) && s.body.event === "OPEN_GAME";
1975
2186
  }
1976
- function Pt(s) {
2187
+ function Bt(s) {
1977
2188
  return s.header.code !== 1;
1978
2189
  }
1979
- function bi(s) {
1980
- return Le(s) && s.body.event.includes("_RESULT");
2190
+ function Oi(s) {
2191
+ return Fe(s) && s.body.event.includes("_RESULT");
1981
2192
  }
1982
- var ee, fe;
1983
- class fi extends gi {
2193
+ var se, Te;
2194
+ class xi extends Ti {
1984
2195
  constructor(e, i) {
1985
2196
  const a = new URL(e.apiUrl);
1986
2197
  a.searchParams.set("cageCode", e.cageCode), a.searchParams.set("gameCode", e.gameCode), a.searchParams.set("operatorCode", e.operatorCode), a.searchParams.set("playMode", e.playMode), a.searchParams.set("token", e.token), a.searchParams.set("username", e.username);
@@ -1995,7 +2206,7 @@ class fi extends gi {
1995
2206
  * request sent. Client and server independently maintain their own
1996
2207
  * correlation id counter.
1997
2208
  */
1998
- m(this, "cId", 0);
2209
+ b(this, "cId", 0);
1999
2210
  // Initial values for header
2000
2211
  /*
2001
2212
  * Increasing message ID
@@ -2007,20 +2218,20 @@ class fi extends gi {
2007
2218
  * received out of sync).
2008
2219
  */
2009
2220
  // TODO make sure messages are processed in order
2010
- m(this, "mId", 0);
2221
+ b(this, "mId", 0);
2011
2222
  // Initial values for body
2012
2223
  /*
2013
2224
  * Sequence ID. Action/Event correlation.
2014
2225
  */
2015
- m(this, "seqId", 0);
2016
- m(this, "gameCode");
2017
- C(this, ee, void 0);
2018
- C(this, fe, void 0);
2019
- m(this, "onMessage", (e) => {
2020
- const i = Pe(e);
2021
- (Le(i) || mi(i) || Tt(i)) && this.sendAcknowledgement(i), Tt(i) && this.handleRealityCheck(i);
2226
+ b(this, "seqId", 0);
2227
+ b(this, "gameCode");
2228
+ M(this, se);
2229
+ M(this, Te);
2230
+ b(this, "onMessage", (e) => {
2231
+ const i = Le(e);
2232
+ (Fe(i) || Ai(i) || _t(i)) && this.sendAcknowledgement(i), _t(i) && this.handleRealityCheck(i);
2022
2233
  });
2023
- this.eventListeners.realityCheck = [], this.gameCode = e.gameCode, E(this, ee, i.requestTimeoutMs), E(this, fe, i.gameVersion ?? "unknown"), this.addEventListener("message", this.onMessage);
2234
+ this.eventListeners.realityCheck = [], this.gameCode = e.gameCode, v(this, se, i.requestTimeoutMs), v(this, Te, i.gameVersion ?? "unknown"), this.addEventListener("message", this.onMessage);
2024
2235
  }
2025
2236
  handleRealityCheck(e) {
2026
2237
  this.eventListeners.realityCheck.forEach((i) => {
@@ -2057,82 +2268,94 @@ class fi extends gi {
2057
2268
  }
2058
2269
  request(e, i) {
2059
2270
  const a = this.buildPayload(e, i);
2060
- return new Promise((o, n) => {
2061
- setTimeout(() => n({ type: "timeout" }), y(this, ee));
2062
- const h = (p) => {
2063
- const w = Pe(p);
2271
+ return new Promise((d, r) => {
2272
+ setTimeout(() => r({ type: "timeout" }), k(this, se));
2273
+ const p = (h) => {
2274
+ const g = Le(h);
2064
2275
  try {
2065
- e.cId === w.header.cId && (this.removeEventListener("message", h), w.header.code === 1 ? o(w) : n({ message: w, type: "error" }));
2276
+ e.cId === g.header.cId && (this.removeEventListener("message", p), g.header.code === 1 ? d(g) : r({ message: g, type: "error" }));
2066
2277
  } catch {
2067
- n({ message: w, type: "error" });
2278
+ r({ message: g, type: "error" });
2068
2279
  }
2069
2280
  };
2070
- this.addEventListener("message", h), this.send(a);
2281
+ this.addEventListener("message", p), this.send(a);
2071
2282
  });
2072
2283
  }
2073
2284
  freeRounds(e) {
2074
2285
  const i = this.buildHeader("ActivateFreeRound");
2075
2286
  return this.request(i, e).then((a) => a.body).catch((a) => {
2076
- var o;
2077
- throw { data: (o = a == null ? void 0 : a.message) == null ? void 0 : o.body, type: a.type };
2287
+ var d;
2288
+ throw { data: (d = a == null ? void 0 : a.message) == null ? void 0 : d.body, type: a.type };
2078
2289
  });
2079
2290
  }
2080
2291
  async authenticate(e = !1) {
2081
2292
  const i = this.buildHeader("Authenticate"), a = {
2082
2293
  clientType: 3,
2083
- version: y(this, fe),
2294
+ version: k(this, Te),
2084
2295
  reconnect: e
2085
2296
  };
2086
- return this.request(i, a).then((o) => o.body).catch((o) => {
2087
- var n;
2088
- throw { data: (n = o == null ? void 0 : o.message) == null ? void 0 : n.body, type: o.type };
2297
+ return this.request(i, a).then((d) => d.body).catch((d) => {
2298
+ var r;
2299
+ throw { data: (r = d == null ? void 0 : d.message) == null ? void 0 : r.body, type: d.type };
2089
2300
  });
2090
2301
  }
2091
2302
  async openGame() {
2092
2303
  const e = this.buildHeader("OpenGame"), i = {
2093
2304
  gameCode: this.gameCode
2094
2305
  };
2095
- return new Promise((a, o) => {
2096
- const n = (h) => {
2097
- const p = Pe(h);
2098
- wi(p) ? (this.removeEventListener("message", n), a(p.body)) : Pt(p) && o({ data: p.body, type: "error" });
2306
+ return new Promise((a, d) => {
2307
+ const r = (p) => {
2308
+ const h = Le(p);
2309
+ Pi(h) ? (this.removeEventListener("message", r), a(h.body)) : Bt(h) && d({ data: h.body, type: "error" });
2099
2310
  };
2100
- this.addEventListener("message", n), this.request(e, i).catch(
2101
- (h) => {
2102
- var p;
2103
- return o({ data: (p = h == null ? void 0 : h.message) == null ? void 0 : p.body, type: h.type });
2311
+ this.addEventListener("message", r), this.request(e, i).catch(
2312
+ (p) => {
2313
+ var h;
2314
+ return d({ data: (h = p == null ? void 0 : p.message) == null ? void 0 : h.body, type: p.type });
2104
2315
  }
2105
2316
  );
2106
2317
  });
2107
2318
  }
2108
2319
  sendAcknowledgement(e) {
2109
- const { name: i, cId: a } = e.header, o = this.buildHeader(i, a), n = this.buildPayload(o, {});
2110
- this.send(n);
2320
+ const { name: i, cId: a } = e.header, d = this.buildHeader(i, a), r = this.buildPayload(d, {});
2321
+ this.send(r);
2111
2322
  }
2112
2323
  sendAction(e, i) {
2113
- const a = this.buildHeader("GameAction"), o = {
2324
+ const a = this.buildHeader("GameAction"), d = {
2114
2325
  ...this.getBodyExtras(e),
2115
2326
  data: i
2116
2327
  };
2117
- return new Promise((n, h) => {
2118
- const p = (w) => {
2119
- const g = Pe(w);
2120
- Le(g) && o.seqId === g.body.correlationSeqId && (this.removeEventListener("message", p), bi(g) ? n(g.body) : Pt(g) && h({ data: g.body, type: "error" }));
2328
+ return new Promise((r, p) => {
2329
+ const h = (g) => {
2330
+ const m = Le(g);
2331
+ Fe(m) && d.seqId === m.body.correlationSeqId && (this.removeEventListener("message", h), Oi(m) ? r(m.body) : Bt(m) && p({ data: m.body, type: "error" }));
2121
2332
  };
2122
- this.addEventListener("message", p), this.request(a, o).catch(
2123
- (w) => {
2124
- var g;
2125
- return h({ data: (g = w == null ? void 0 : w.message) == null ? void 0 : g.body, type: w.type });
2333
+ this.addEventListener("message", h), this.request(a, d).catch(
2334
+ (g) => {
2335
+ var m;
2336
+ return p({ data: (m = g == null ? void 0 : g.message) == null ? void 0 : m.body, type: g.type });
2126
2337
  }
2127
2338
  );
2128
2339
  });
2129
2340
  }
2130
2341
  setRequestTimeoutMs(e) {
2131
- E(this, ee, e);
2342
+ v(this, se, e);
2132
2343
  }
2133
2344
  }
2134
- ee = new WeakMap(), fe = new WeakMap();
2135
- function Dt(s) {
2345
+ se = new WeakMap(), Te = new WeakMap();
2346
+ const Ui = {
2347
+ CA_BC: "CA",
2348
+ CA_ON: "CA",
2349
+ GER: "DE",
2350
+ US_CT: "US",
2351
+ US_MI: "US",
2352
+ US_NJ: "US",
2353
+ USA: "US"
2354
+ };
2355
+ function Ft(s) {
2356
+ return !s || s === "NOT_APPLICABLE" ? null : Ui[s] ?? s;
2357
+ }
2358
+ function Qt(s) {
2136
2359
  const t = s.contract;
2137
2360
  return t ? {
2138
2361
  contract: {
@@ -2143,7 +2366,7 @@ function Dt(s) {
2143
2366
  coinValueInCents: t.coinValueInCents,
2144
2367
  country: t.countryCode,
2145
2368
  currency: t.currencyCode,
2146
- jurisdiction: t.jurisdictionCode,
2369
+ jurisdiction: Ft(t.jurisdictionCode),
2147
2370
  uiMessages: t.uiMessages,
2148
2371
  username: t.username
2149
2372
  }
@@ -2156,264 +2379,264 @@ function Dt(s) {
2156
2379
  coinValueInCents: s.coinValueInCents,
2157
2380
  country: s.countryCode,
2158
2381
  currency: s.currencyCode,
2159
- jurisdiction: s.jurisdictionCode,
2382
+ jurisdiction: Ft(s.jurisdictionCode),
2160
2383
  uiMessages: s.uiMessages,
2161
2384
  username: s.username
2162
2385
  }
2163
2386
  };
2164
2387
  }
2165
- function Nt(s) {
2388
+ function Kt(s) {
2166
2389
  var t, e;
2167
2390
  return {
2168
2391
  // SDK error codes are the same as RGS error codes so we don't need any mapping here
2169
- code: ((t = s.data) == null ? void 0 : t.code) ?? Fe.UNKNOWN,
2392
+ code: ((t = s.data) == null ? void 0 : t.code) ?? He.UNKNOWN,
2170
2393
  details: (e = s.data) == null ? void 0 : e.details
2171
2394
  };
2172
2395
  }
2173
- function Gt(s, t) {
2174
- const e = t.contract;
2175
- if (!e) {
2176
- const i = t.data;
2396
+ function Xt(s, t, e) {
2397
+ const i = t.contract;
2398
+ if (!i) {
2399
+ const a = t.data;
2177
2400
  return {
2178
2401
  contract: {
2179
2402
  bet: {
2180
- available: i.additionalConfigData.availableMultipliersPerBaseBet,
2403
+ available: a.additionalConfigData.availableMultipliersPerBaseBet,
2181
2404
  default: {
2182
- base: i.additionalConfigData.defaultBet.baseBet,
2183
- multiplier: i.additionalConfigData.defaultBet.betMultiplier
2405
+ base: a.additionalConfigData.defaultBet.baseBet,
2406
+ multiplier: a.additionalConfigData.defaultBet.betMultiplier
2184
2407
  },
2185
- max: i.additionalConfigData.maxAllowedOverallBetInCoins ?? null,
2186
- last: i.gameState.betFromCurrentRound ? {
2187
- base: i.gameState.betFromCurrentRound.baseBet,
2188
- multiplier: i.gameState.betFromCurrentRound.betMultiplier
2408
+ max: a.additionalConfigData.maxAllowedOverallBetInCoins ?? null,
2409
+ last: a.gameState.betFromCurrentRound ? {
2410
+ base: a.gameState.betFromCurrentRound.baseBet,
2411
+ multiplier: a.gameState.betFromCurrentRound.betMultiplier
2189
2412
  } : null,
2190
- lastPaid: i.gameState.lastPlacedMainGameBet ? {
2191
- base: i.gameState.lastPlacedMainGameBet.baseBet,
2192
- multiplier: i.gameState.lastPlacedMainGameBet.betMultiplier
2413
+ lastPaid: a.gameState.lastPlacedMainGameBet ? {
2414
+ base: a.gameState.lastPlacedMainGameBet.baseBet,
2415
+ multiplier: a.gameState.lastPlacedMainGameBet.betMultiplier
2193
2416
  } : null
2194
2417
  },
2195
2418
  balance: {
2196
2419
  coins: t.balance,
2197
2420
  version: t.balanceVersion
2198
2421
  },
2199
- freeRounds: (i.FREE_ROUNDS ?? []).map((a) => ({
2422
+ freeRounds: (a.FREE_ROUNDS ?? []).map((d) => ({
2200
2423
  conf: {
2201
- base: a.conf.baseBet,
2202
- multiplier: a.conf.betMultiplier,
2203
- numAwarded: a.conf.numAwarded
2424
+ base: d.conf.baseBet,
2425
+ multiplier: d.conf.betMultiplier,
2426
+ numAwarded: d.conf.numAwarded
2204
2427
  },
2205
2428
  data: {
2206
- numPlayed: a.data.numPlayed,
2207
- win: a.data.winAmount,
2208
- numLeft: a.data.numLeft
2429
+ numPlayed: d.data.numPlayed,
2430
+ win: d.data.winAmount,
2431
+ numLeft: d.data.numLeft
2209
2432
  },
2210
- id: a.id,
2211
- rejectable: a.rejectable,
2212
- skippable: a.skippable,
2213
- status: a.status,
2214
- type: a.type
2433
+ id: d.id,
2434
+ rejectable: d.rejectable,
2435
+ skippable: d.skippable,
2436
+ status: d.status,
2437
+ type: d.type
2215
2438
  })),
2216
- gameModel: i.additionalConfigData.gameModelFile,
2217
- metaData: i.gameConfigData.metaData,
2218
- roundId: i.gameState.cycleId,
2439
+ gameModel: a.additionalConfigData.gameModelFile,
2440
+ metaData: a.gameConfigData.metaData,
2441
+ roundId: a.gameState.cycleId,
2219
2442
  serverTime: t.balanceVersion,
2220
- sessionId: i.gameState.sessionId,
2443
+ sessionId: a.gameState.sessionId,
2221
2444
  stateType: {
2222
- thisRound: i.gameState.stateTypeThisRound,
2223
- nextRound: i.gameState.stateTypeNextRound
2445
+ thisRound: a.gameState.stateTypeThisRound,
2446
+ nextRound: a.gameState.stateTypeNextRound
2224
2447
  },
2225
2448
  uiMessages: s.uiMessages,
2226
2449
  win: {
2227
- max: i.maxWin ?? null,
2228
- round: i.gameState.totalWinFromCurrentRound,
2229
- total: i.gameState.totalWinFromCurrentGameCycle
2450
+ max: a.maxWin ?? null,
2451
+ round: a.gameState.totalWinFromCurrentRound,
2452
+ total: a.gameState.totalWinFromCurrentGameCycle
2230
2453
  }
2231
2454
  },
2232
- data: i
2455
+ data: a
2233
2456
  };
2234
2457
  }
2235
2458
  return {
2236
2459
  contract: {
2237
2460
  bet: {
2238
- available: e.availableMultipliersPerBaseBet,
2461
+ available: i.availableMultipliersPerBaseBet,
2239
2462
  default: {
2240
- base: e.defaultBet.baseBet,
2241
- multiplier: e.defaultBet.betMultiplier
2463
+ base: i.defaultBet.baseBet,
2464
+ multiplier: i.defaultBet.betMultiplier
2242
2465
  },
2243
- max: e.maxBetInCoins ?? null,
2244
- last: e.lastBet ? {
2245
- base: e.lastBet.baseBet,
2246
- multiplier: e.lastBet.betMultiplier
2466
+ max: i.maxBetInCoins ?? null,
2467
+ last: i.lastBet ? {
2468
+ base: i.lastBet.baseBet,
2469
+ multiplier: i.lastBet.betMultiplier
2247
2470
  } : null,
2248
- lastPaid: e.lastMainGameBet ? {
2249
- base: e.lastMainGameBet.baseBet,
2250
- multiplier: e.lastMainGameBet.betMultiplier
2471
+ lastPaid: i.lastMainGameBet ? {
2472
+ base: i.lastMainGameBet.baseBet,
2473
+ multiplier: i.lastMainGameBet.betMultiplier
2251
2474
  } : null
2252
2475
  },
2253
2476
  balance: {
2254
- coins: e.balanceInCoins,
2255
- version: e.balanceVersion
2477
+ coins: i.balanceInCoins,
2478
+ version: i.balanceVersion
2256
2479
  },
2257
- freeRounds: (e.freeRounds ?? []).map((i) => ({
2480
+ freeRounds: (i.freeRounds ?? []).map((a) => ({
2258
2481
  conf: {
2259
- base: i.conf.baseBet,
2260
- multiplier: i.conf.betMultiplier,
2261
- numAwarded: i.conf.numAwarded
2482
+ base: a.conf.baseBet,
2483
+ multiplier: a.conf.betMultiplier,
2484
+ numAwarded: a.conf.numAwarded
2262
2485
  },
2263
2486
  data: {
2264
- numPlayed: i.data.numPlayed,
2265
- win: i.data.winAmount,
2266
- numLeft: i.data.numLeft
2487
+ numPlayed: a.data.numPlayed,
2488
+ win: a.data.winAmount,
2489
+ numLeft: a.data.numLeft
2267
2490
  },
2268
- id: i.id,
2269
- rejectable: i.rejectable,
2270
- skippable: i.skippable,
2271
- status: i.status,
2272
- type: i.type
2491
+ id: a.id,
2492
+ rejectable: a.rejectable,
2493
+ skippable: a.skippable,
2494
+ status: a.status,
2495
+ type: a.type
2273
2496
  })),
2274
- gameModel: e.gameModelFile,
2275
- metaData: e.metaData,
2276
- roundId: e.roundId,
2277
- serverTime: e.serverTime,
2278
- sessionId: e.sessionId,
2497
+ gameModel: i.gameModelFile,
2498
+ metaData: i.metaData,
2499
+ roundId: i.roundId,
2500
+ serverTime: i.serverTime,
2501
+ sessionId: i.sessionId,
2279
2502
  stateType: {
2280
- thisRound: e.stateTypeThisRound,
2281
- nextRound: e.stateTypeNextRound
2503
+ thisRound: i.stateTypeThisRound,
2504
+ nextRound: i.stateTypeNextRound
2282
2505
  },
2283
- uiMessages: s.contract.uiMessages.concat(e.uiMessages),
2506
+ uiMessages: s.contract.uiMessages.concat(i.uiMessages),
2284
2507
  win: {
2285
- max: e.maxWinInCoins ?? null,
2286
- round: e.roundWin,
2287
- total: e.totalWin
2508
+ max: i.maxWinInCoins ?? null,
2509
+ round: i.roundWin,
2510
+ total: i.totalWin
2288
2511
  }
2289
2512
  },
2290
- data: t.opaqueGameServerToUi
2513
+ data: e ? e(t.opaqueGameServerToUi) : t.opaqueGameServerToUi
2291
2514
  };
2292
2515
  }
2293
- function Ht(s) {
2516
+ function Jt(s) {
2294
2517
  var t, e;
2295
2518
  return {
2296
2519
  // SDK error codes are the same as RGS error codes so we don't need any mapping here
2297
- code: ((t = s.data) == null ? void 0 : t.code) ?? Fe.UNKNOWN,
2520
+ code: ((t = s.data) == null ? void 0 : t.code) ?? He.UNKNOWN,
2298
2521
  details: (e = s.data) == null ? void 0 : e.details
2299
2522
  };
2300
2523
  }
2301
- function Vt(s) {
2302
- const t = s.contract;
2303
- if (!t) {
2304
- const e = s.data;
2524
+ function Yt(s, t) {
2525
+ const e = s.contract;
2526
+ if (!e) {
2527
+ const i = s.data;
2305
2528
  return {
2306
2529
  contract: {
2307
2530
  bet: {
2308
- last: e.gameState.betFromCurrentRound ? {
2309
- base: e.gameState.betFromCurrentRound.baseBet,
2310
- multiplier: e.gameState.betFromCurrentRound.betMultiplier
2531
+ last: i.gameState.betFromCurrentRound ? {
2532
+ base: i.gameState.betFromCurrentRound.baseBet,
2533
+ multiplier: i.gameState.betFromCurrentRound.betMultiplier
2311
2534
  } : null,
2312
2535
  lastPaid: {
2313
- base: (e.gameState.lastPlacedMainGameBet ?? e.gameState.betFromCurrentRound).baseBet,
2314
- multiplier: (e.gameState.lastPlacedMainGameBet ?? e.gameState.betFromCurrentRound).betMultiplier
2536
+ base: (i.gameState.lastPlacedMainGameBet ?? i.gameState.betFromCurrentRound).baseBet,
2537
+ multiplier: (i.gameState.lastPlacedMainGameBet ?? i.gameState.betFromCurrentRound).betMultiplier
2315
2538
  }
2316
2539
  },
2317
2540
  balance: {
2318
2541
  coins: s.balance,
2319
2542
  version: s.balanceVersion
2320
2543
  },
2321
- freeRounds: (e.FREE_ROUNDS ?? []).map((i) => ({
2544
+ freeRounds: (i.FREE_ROUNDS ?? []).map((a) => ({
2322
2545
  conf: {
2323
- base: i.conf.baseBet,
2324
- multiplier: i.conf.betMultiplier,
2325
- numAwarded: i.conf.numAwarded
2546
+ base: a.conf.baseBet,
2547
+ multiplier: a.conf.betMultiplier,
2548
+ numAwarded: a.conf.numAwarded
2326
2549
  },
2327
2550
  data: {
2328
- numPlayed: i.data.numPlayed,
2329
- win: i.data.winAmount,
2330
- numLeft: i.data.numLeft
2551
+ numPlayed: a.data.numPlayed,
2552
+ win: a.data.winAmount,
2553
+ numLeft: a.data.numLeft
2331
2554
  },
2332
- id: i.id,
2333
- rejectable: i.rejectable,
2334
- skippable: i.skippable,
2335
- status: i.status,
2336
- type: i.type
2555
+ id: a.id,
2556
+ rejectable: a.rejectable,
2557
+ skippable: a.skippable,
2558
+ status: a.status,
2559
+ type: a.type
2337
2560
  })),
2338
2561
  serverTime: s.balanceVersion,
2339
- roundId: e.gameState.cycleId,
2562
+ roundId: i.gameState.cycleId,
2340
2563
  stateType: {
2341
- thisRound: e.gameState.stateTypeThisRound,
2342
- nextRound: e.gameState.stateTypeNextRound
2564
+ thisRound: i.gameState.stateTypeThisRound,
2565
+ nextRound: i.gameState.stateTypeNextRound
2343
2566
  },
2344
- uiMessages: e.uiMessages,
2567
+ uiMessages: i.uiMessages,
2345
2568
  win: {
2346
- round: e.gameState.totalWinFromCurrentRound,
2347
- total: e.gameState.totalWinFromCurrentGameCycle
2569
+ round: i.gameState.totalWinFromCurrentRound,
2570
+ total: i.gameState.totalWinFromCurrentGameCycle
2348
2571
  }
2349
2572
  },
2350
- data: e
2573
+ data: i
2351
2574
  };
2352
2575
  }
2353
2576
  return {
2354
2577
  contract: {
2355
2578
  bet: {
2356
- last: t.lastBet ? {
2357
- base: t.lastBet.baseBet,
2358
- multiplier: t.lastBet.betMultiplier
2579
+ last: e.lastBet ? {
2580
+ base: e.lastBet.baseBet,
2581
+ multiplier: e.lastBet.betMultiplier
2359
2582
  } : null,
2360
2583
  lastPaid: {
2361
- base: t.lastMainGameBet.baseBet,
2362
- multiplier: t.lastMainGameBet.betMultiplier
2584
+ base: e.lastMainGameBet.baseBet,
2585
+ multiplier: e.lastMainGameBet.betMultiplier
2363
2586
  }
2364
2587
  },
2365
2588
  balance: {
2366
- coins: t.balanceInCoins,
2367
- version: t.balanceVersion
2589
+ coins: e.balanceInCoins,
2590
+ version: e.balanceVersion
2368
2591
  },
2369
- freeRounds: (t.freeRounds ?? []).map((e) => ({
2592
+ freeRounds: (e.freeRounds ?? []).map((i) => ({
2370
2593
  conf: {
2371
- base: e.conf.baseBet,
2372
- multiplier: e.conf.betMultiplier,
2373
- numAwarded: e.conf.numAwarded
2594
+ base: i.conf.baseBet,
2595
+ multiplier: i.conf.betMultiplier,
2596
+ numAwarded: i.conf.numAwarded
2374
2597
  },
2375
2598
  data: {
2376
- numPlayed: e.data.numPlayed,
2377
- win: e.data.winAmount,
2378
- numLeft: e.data.numLeft
2599
+ numPlayed: i.data.numPlayed,
2600
+ win: i.data.winAmount,
2601
+ numLeft: i.data.numLeft
2379
2602
  },
2380
- id: e.id,
2381
- rejectable: e.rejectable,
2382
- skippable: e.skippable,
2383
- status: e.status,
2384
- type: e.type
2603
+ id: i.id,
2604
+ rejectable: i.rejectable,
2605
+ skippable: i.skippable,
2606
+ status: i.status,
2607
+ type: i.type
2385
2608
  })),
2386
- serverTime: t.serverTime,
2387
- roundId: t.roundId,
2609
+ serverTime: e.serverTime,
2610
+ roundId: e.roundId,
2388
2611
  stateType: {
2389
- thisRound: t.stateTypeThisRound,
2390
- nextRound: t.stateTypeNextRound
2612
+ thisRound: e.stateTypeThisRound,
2613
+ nextRound: e.stateTypeNextRound
2391
2614
  },
2392
- uiMessages: t.uiMessages,
2615
+ uiMessages: e.uiMessages,
2393
2616
  win: {
2394
- round: t.roundWin,
2395
- total: t.totalWin
2617
+ round: e.roundWin,
2618
+ total: e.totalWin
2396
2619
  }
2397
2620
  },
2398
- data: s.opaqueGameServerToUi
2621
+ data: t ? t(s.opaqueGameServerToUi) : s.opaqueGameServerToUi
2399
2622
  };
2400
2623
  }
2401
- function zt(s) {
2624
+ function Zt(s) {
2402
2625
  var t, e;
2403
2626
  return {
2404
2627
  // SDK error codes are the same as RGS error codes so we don't need any mapping here
2405
- code: ((t = s.data) == null ? void 0 : t.code) ?? Fe.UNKNOWN,
2628
+ code: ((t = s.data) == null ? void 0 : t.code) ?? He.UNKNOWN,
2406
2629
  details: (e = s.data) == null ? void 0 : e.details
2407
2630
  };
2408
2631
  }
2409
- const Gi = {
2410
- parseAuthenticateResponse: Dt,
2411
- parseAuthenticateError: Nt,
2412
- parseOpenGameResponse: Gt,
2413
- parseOpenGameError: Ht,
2414
- parsePlayResponse: Vt,
2415
- parsePlayError: zt
2416
- }, yi = {
2632
+ const is = {
2633
+ parseAuthenticateResponse: Qt,
2634
+ parseAuthenticateError: Kt,
2635
+ parseOpenGameResponse: Xt,
2636
+ parseOpenGameError: Jt,
2637
+ parsePlayResponse: Yt,
2638
+ parsePlayError: Zt
2639
+ }, Ri = {
2417
2640
  bul: "bg",
2418
2641
  chi: "zh",
2419
2642
  zho: "zh",
@@ -2445,50 +2668,53 @@ const Gi = {
2445
2668
  tur: "tr",
2446
2669
  ukr: "uk",
2447
2670
  vie: "vi"
2448
- }, { device: ki } = R(navigator.userAgent), Ei = O("KalambaBullseyePlugin", "color:#000000;font-weight:bold;");
2449
- class Hi extends pi {
2671
+ }, { device: Li } = L(navigator.userAgent), _i = x("KalambaBullseyePlugin", "color:#000000;font-weight:bold;");
2672
+ class ss extends Ii {
2450
2673
  constructor(...e) {
2451
2674
  super(...e);
2452
2675
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2453
2676
  // @ts-ignore
2454
- m(this, "socket");
2677
+ b(this, "socket");
2678
+ b(this, "error");
2455
2679
  this.on("openGame", async () => {
2456
2680
  try {
2681
+ this.error = void 0;
2457
2682
  const i = await this.openGame();
2458
2683
  this.send("openGameResponse", i);
2459
2684
  } catch (i) {
2460
- this.send("openGameError", i);
2685
+ this.error = i, this.send("openGameError", i);
2461
2686
  }
2462
2687
  }), this.on("play", async (i) => {
2463
2688
  try {
2689
+ this.error = void 0;
2464
2690
  const a = await this.play(i);
2465
2691
  this.send("playResponse", a);
2466
2692
  } catch (a) {
2467
- this.send("playError", a);
2693
+ this.error = a, this.send("playError", a);
2468
2694
  }
2469
2695
  }), this.on("freeRounds", async (i) => {
2470
2696
  try {
2471
- await this.socket.freeRounds(i), this.send("freeRoundsResponse", i);
2697
+ this.error = void 0, await this.socket.freeRounds(i), this.send("freeRoundsResponse", i);
2472
2698
  } catch (a) {
2473
- this.send("freeRoundsError", a);
2699
+ this.error = a, this.send("freeRoundsError", a);
2474
2700
  }
2475
2701
  }), this.on("configured", (i) => {
2476
2702
  this.socket.setRequestTimeoutMs(i.ui.requestTimeoutMs);
2477
2703
  }), this.registerFromSdkEvents();
2478
2704
  }
2479
2705
  initialize(e) {
2480
- this.socket = new fi(e, {
2706
+ this.socket = new xi(e, {
2481
2707
  gameVersion: this.config.gameVersion,
2482
2708
  requestTimeoutMs: this.sdkConfig.ui.requestTimeoutMs
2483
2709
  }), ["fireboltroulette"].includes(e.gameCode) || (this.socket.addEventListener("close", (i) => {
2484
- i.code === 1008 ? this.send("error", {
2710
+ i.code === 1008 ? this.error || this.send("error", {
2485
2711
  type: "CLOSE",
2486
2712
  messageCode: "TOO_MANY_OPEN_GAMES",
2487
2713
  messageKey: "RgsError.TOO_MANY_OPEN_GAMES"
2488
- }) : i.code === 1011 || this.reconnect();
2489
- }), ["mobile", "tablet"].includes(ki.type ?? "") && document.addEventListener("visibilitychange", async () => {
2714
+ }) : i.code === 1011 ? this.error || this.send("error", { type: "CLOSE", messageCode: "UNKNOWN", messageKey: "RgsError.UNKNOWN" }) : this.reconnect();
2715
+ }), ["mobile", "tablet"].includes(Li.type ?? "") && document.addEventListener("visibilitychange", async () => {
2490
2716
  document.hidden || (this.socket.socket ? this.socket.socket && [WebSocket.CONNECTING, WebSocket.OPEN].includes(this.socket.socket.readyState) && this.socket.close() : this.reconnect());
2491
- })), this.socket.addEventListener("error", (i) => Ei("error", i)), this.socket.addEventListener("realityCheck", (i) => {
2717
+ })), this.socket.addEventListener("error", (i) => _i("error", i)), this.socket.addEventListener("realityCheck", (i) => {
2492
2718
  this.send("realityCheck", i);
2493
2719
  });
2494
2720
  }
@@ -2500,94 +2726,98 @@ class Hi extends pi {
2500
2726
  }
2501
2727
  }
2502
2728
  async openGame() {
2503
- var Ee, ot;
2504
- const e = new URLSearchParams(window.location.search), i = e.get("apiUrl"), a = e.get("cageCode"), o = e.get("gameCode"), n = e.get("operatorCode"), h = e.get("playMode"), p = e.get("token"), w = e.get("username"), g = e.get("gameHistoryUrl"), k = e.get("homeUrl") ?? void 0, F = e.get("cashierUrl") ?? void 0;
2505
- this.initialize({ apiUrl: i, cageCode: a, gameCode: o, operatorCode: n, playMode: h, token: p, username: w });
2729
+ var G, Oe;
2730
+ const e = new URLSearchParams(window.location.search), i = e.get("apiUrl"), a = e.get("cageCode"), d = e.get("gameCode"), r = e.get("operatorCode"), p = e.get("playMode"), h = e.get("token"), g = e.get("username"), m = e.get("gameHistoryUrl"), C = e.get("homeUrl") ?? void 0, A = e.get("cashierUrl") ?? void 0;
2731
+ this.initialize({ apiUrl: i, cageCode: a, gameCode: d, operatorCode: r, playMode: p, token: h, username: g });
2506
2732
  try {
2507
2733
  await this.socket.connect();
2508
2734
  } catch {
2509
- throw { type: "error", data: { code: Fe.CONNECTION_ERROR } };
2735
+ throw { type: "error", data: { code: He.CONNECTION_ERROR } };
2510
2736
  }
2511
- let j;
2737
+ let D;
2512
2738
  try {
2513
- j = await this.socket.authenticate();
2514
- } catch (q) {
2515
- throw { type: q.type, data: q.type === "error" ? Nt(q.data) : void 0 };
2739
+ D = await this.socket.authenticate();
2740
+ } catch (X) {
2741
+ throw { type: X.type, data: X.type === "error" ? Kt(X.data) : void 0 };
2516
2742
  }
2517
- let Q;
2743
+ let ge;
2518
2744
  try {
2519
- Q = await this.socket.openGame();
2520
- } catch (q) {
2521
- throw { type: q.type, data: q.type === "error" ? Ht(q.data) : void 0 };
2745
+ ge = await this.socket.openGame();
2746
+ } catch (X) {
2747
+ throw { type: X.type, data: X.type === "error" ? Jt(X.data) : void 0 };
2522
2748
  }
2523
- const L = Dt(j), le = Gt(j, Q);
2749
+ const _ = Qt(D), Q = Xt(
2750
+ D,
2751
+ ge,
2752
+ this.config.dataDecoder && bt[this.config.dataDecoder]
2753
+ );
2524
2754
  this.sdkConfig.api = {
2525
2755
  ...this.sdkConfig.api,
2526
2756
  brand: a,
2527
- game: o,
2528
- integration: n,
2529
- jurisdiction: L.contract.jurisdiction,
2530
- playMode: h,
2531
- user: L.contract.username,
2757
+ game: d,
2758
+ integration: r,
2759
+ jurisdiction: _.contract.jurisdiction,
2760
+ playMode: p,
2761
+ user: _.contract.username,
2532
2762
  integrationData: {
2533
- token: p
2763
+ token: h
2534
2764
  },
2535
- country: L.contract.country,
2536
- currency: L.contract.currency,
2537
- coinValueInCents: L.contract.coinValueInCents,
2538
- gameHistoryUrl: g,
2539
- homeUrl: k,
2540
- cashierUrl: F,
2541
- backendSessionId: le.contract.sessionId,
2542
- lastRoundId: le.contract.roundId
2765
+ country: _.contract.country,
2766
+ currency: _.contract.currency,
2767
+ coinValueInCents: _.contract.coinValueInCents,
2768
+ gameHistoryUrl: m,
2769
+ homeUrl: C,
2770
+ cashierUrl: A,
2771
+ backendSessionId: Q.contract.sessionId,
2772
+ lastRoundId: Q.contract.roundId
2543
2773
  };
2544
- const A = (ot = (Ee = e.get("languageCode")) == null ? void 0 : Ee.split("_")) == null ? void 0 : ot[0];
2545
- return A && (this.sdkConfig.ui.language = A.length === 3 ? yi[A] ?? A : A), le;
2774
+ const K = (Oe = (G = e.get("languageCode")) == null ? void 0 : G.split("_")) == null ? void 0 : Oe[0];
2775
+ return K && (this.sdkConfig.ui.language = K.length === 3 ? Ri[K] ?? K : K), Q;
2546
2776
  }
2547
2777
  async play(e) {
2548
2778
  for (; !this.socket.socket; )
2549
- await new Promise((k) => setTimeout(() => k(), 500));
2779
+ await new Promise((A) => setTimeout(() => A(), 500));
2550
2780
  const {
2551
- contract: { bet: i, forcedOutcomes: a, ...o },
2552
- extra: n,
2553
- payloadToInject: h,
2554
- actionType: p
2555
- } = e, w = {
2781
+ contract: { bet: i, forcedOutcomes: a, ...d },
2782
+ extra: r,
2783
+ payloadToInject: p,
2784
+ actionType: h
2785
+ } = e, g = this.config.dataEncoder && si[this.config.dataEncoder], m = {
2556
2786
  bet: i ? { baseBet: i.base, betMultiplier: i.multiplier } : void 0,
2557
2787
  forcedOutcomes: a,
2558
2788
  // TODO: get rid of contractRest - it' a legacy from old RGS
2559
- ...o,
2560
- ...h,
2561
- opaqueUiToGameServer: n
2789
+ ...d,
2790
+ ...p,
2791
+ opaqueUiToGameServer: g ? g(r) : r
2562
2792
  };
2563
- let g;
2793
+ let C;
2564
2794
  try {
2565
- g = await this.socket.sendAction(p, w);
2566
- } catch (k) {
2567
- throw { type: k.type, data: k.type === "error" ? zt(k.data) : void 0 };
2795
+ C = await this.socket.sendAction(h, m);
2796
+ } catch (A) {
2797
+ throw { type: A.type, data: A.type === "error" ? Zt(A.data) : void 0 };
2568
2798
  }
2569
- return Vt(g);
2799
+ return Yt(C, this.config.dataDecoder && bt[this.config.dataDecoder]);
2570
2800
  }
2571
2801
  registerFromSdkEvents() {
2572
2802
  this.on("history", () => {
2573
2803
  const {
2574
- api: { game: e, integration: i, integrationData: a, jurisdiction: o, user: n, gameHistoryUrl: h },
2575
- ui: { language: p }
2576
- } = this.sdkConfig, w = n.replace(/^user_/, "").replace(new RegExp(`_${i}$`), ""), g = new URL(window.location.href);
2577
- g.hostname = g.hostname.replace(/^v\./, "").replace(/^play\./, "history."), g.pathname = g.pathname.replace(/(\/[0-9]+\.[0-9]+\.[0-9]+)?\/wrapper\.html/, "/list/index.html"), g.search = "", g.searchParams.set("apiUrl", new URL(h).origin), g.searchParams.set("gameCode", e), g.searchParams.set("jurisdiction", o), g.searchParams.set("operatorCode", i), g.searchParams.set("token", a.token), g.searchParams.set("username", w), g.searchParams.set("languageCode", p), this.config.gameHistoryUrl && g.searchParams.set("gameHistoryUrl", this.config.gameHistoryUrl), window.open(g.toString(), "_blank");
2804
+ api: { game: e, integration: i, integrationData: a, jurisdiction: d, user: r, gameHistoryUrl: p },
2805
+ ui: { language: h }
2806
+ } = this.sdkConfig, g = r.replace(/^user_/, "").replace(new RegExp(`_${i}$`), ""), m = new URL(window.location.href);
2807
+ m.hostname = m.hostname.replace(/^v\./, "").replace(/^play\./, "history."), m.pathname = m.pathname.replace(/(\/[0-9]+\.[0-9]+\.[0-9]+)?\/wrapper\.html/, "/list/index.html"), m.search = "", m.searchParams.set("apiUrl", new URL(p).origin), m.searchParams.set("gameCode", e), d && m.searchParams.set("jurisdiction", d), m.searchParams.set("operatorCode", i), m.searchParams.set("token", a.token), m.searchParams.set("username", g), m.searchParams.set("languageCode", h), this.config.gameHistoryUrl && m.searchParams.set("gameHistoryUrl", this.config.gameHistoryUrl), window.open(m.toString(), "_blank");
2578
2808
  });
2579
2809
  }
2580
2810
  }
2581
- class vi {
2811
+ class Bi {
2582
2812
  constructor(t, e, i) {
2583
- m(this, "trackers");
2584
- m(this, "config");
2585
- m(this, "sdkConfig");
2813
+ b(this, "trackers");
2814
+ b(this, "config");
2815
+ b(this, "sdkConfig");
2586
2816
  this.trackers = t, this.config = e, this.sdkConfig = i;
2587
2817
  }
2588
2818
  on(t, e, i) {
2589
- const a = function(n) {
2590
- n.data.message !== `kalamba:wrapper-telemetry:${t}` && n.data.message !== `kalamba:wrapper:${t}` || e(n.data.payload);
2819
+ const a = function(r) {
2820
+ r.data.message !== `kalamba:wrapper-telemetry:${t}` && r.data.message !== `kalamba:wrapper:${t}` || e(r.data.payload);
2591
2821
  };
2592
2822
  window.addEventListener("message", a, i);
2593
2823
  }
@@ -2595,40 +2825,40 @@ class vi {
2595
2825
  this.trackers.forEach((i) => i.track(t, e));
2596
2826
  }
2597
2827
  }
2598
- function At(s) {
2828
+ function Nt(s) {
2599
2829
  return s.reduce((t, e) => t + e, 0);
2600
2830
  }
2601
- function Ci(s) {
2602
- const t = s.length, e = At(s) / t, i = s.map((o) => Math.pow(o - e, 2)), a = At(i) / t;
2831
+ function Fi(s) {
2832
+ const t = s.length, e = Nt(s) / t, i = s.map((d) => Math.pow(d - e, 2)), a = Nt(i) / t;
2603
2833
  return Math.sqrt(a);
2604
2834
  }
2605
- class Ot {
2835
+ class Dt {
2606
2836
  constructor() {
2607
- m(this, "rafId", -1);
2608
- m(this, "startTime", 0);
2609
- m(this, "stopTime", 0);
2610
- m(this, "frames", []);
2611
- m(this, "calculateFPS", () => {
2837
+ b(this, "rafId", -1);
2838
+ b(this, "startTime", 0);
2839
+ b(this, "stopTime", 0);
2840
+ b(this, "frames", []);
2841
+ b(this, "calculateFPS", () => {
2612
2842
  const t = Math.floor((this.stopTime - this.startTime) / 1e3);
2613
- return this.frames.map((e) => Math.floor((e - this.startTime) / 1e3)).reduce((e, i, a, o) => (o[a] !== o[a - 1] ? e.push(1) : e[e.length - 1]++, e), []).slice(0, t);
2843
+ return this.frames.map((e) => Math.floor((e - this.startTime) / 1e3)).reduce((e, i, a, d) => (d[a] !== d[a - 1] ? e.push(1) : e[e.length - 1]++, e), []).slice(0, t);
2614
2844
  });
2615
- m(this, "getReport", () => {
2616
- const t = this.calculateFPS(), e = Math.floor(this.frames.length / ((this.stopTime - this.startTime) / 1e3)), i = t.length > 0 ? Math.max(...t) : e, a = t.length > 0 ? Math.min(...t) : e, o = t.length > 0 ? Ci(t) : 0;
2617
- return { fpsAvg: e, fpsMax: i, fpsMin: a, fpsStdDev: o };
2845
+ b(this, "getReport", () => {
2846
+ const t = this.calculateFPS(), e = Math.floor(this.frames.length / ((this.stopTime - this.startTime) / 1e3)), i = t.length > 0 ? Math.max(...t) : e, a = t.length > 0 ? Math.min(...t) : e, d = t.length > 0 ? Fi(t) : 0;
2847
+ return { fpsAvg: e, fpsMax: i, fpsMin: a, fpsStdDev: d };
2618
2848
  });
2619
- m(this, "start", () => {
2849
+ b(this, "start", () => {
2620
2850
  this.startTime = Date.now(), this.frames = [], this.trackFrames();
2621
2851
  });
2622
- m(this, "stop", () => {
2852
+ b(this, "stop", () => {
2623
2853
  cancelAnimationFrame(this.rafId), this.stopTime = Date.now();
2624
2854
  });
2625
- m(this, "trackFrames", () => {
2855
+ b(this, "trackFrames", () => {
2626
2856
  this.frames.push(Date.now()), this.rafId = requestAnimationFrame(this.trackFrames);
2627
2857
  });
2628
2858
  }
2629
2859
  }
2630
- const Mi = "landscape", Si = "portrait";
2631
- function Ii() {
2860
+ const Ni = "landscape", Di = "portrait";
2861
+ function Gi() {
2632
2862
  try {
2633
2863
  const s = document.createElement("canvas");
2634
2864
  return !!window.WebGLRenderingContext && (s.getContext("webgl") || s.getContext("experimental-webgl")) instanceof WebGLRenderingContext;
@@ -2636,7 +2866,7 @@ function Ii() {
2636
2866
  return !1;
2637
2867
  }
2638
2868
  }
2639
- async function Ti() {
2869
+ async function Hi() {
2640
2870
  if (!window.createImageBitmap)
2641
2871
  return !1;
2642
2872
  const e = await (await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();
@@ -2646,33 +2876,33 @@ async function Ti() {
2646
2876
  return !1;
2647
2877
  }
2648
2878
  }
2649
- function Ke() {
2650
- return window.innerWidth >= window.innerHeight ? Mi : Si;
2879
+ function rt() {
2880
+ return window.innerWidth >= window.innerHeight ? Ni : Di;
2651
2881
  }
2652
- var Ue, te, ie, se, ye, _e, ke, Be;
2653
- class Vi extends vi {
2882
+ var Ne, ae, ne, oe, Ae, De, Pe, Ge;
2883
+ class as extends Bi {
2654
2884
  constructor(...e) {
2655
2885
  super(...e);
2656
- m(this, "FPS_SAMPLE_INTERVAL", 1e4);
2886
+ b(this, "FPS_SAMPLE_INTERVAL", 1e4);
2657
2887
  // wrapper state
2658
- C(this, Ue, 0);
2659
- C(this, te, void 0);
2660
- C(this, ie, void 0);
2661
- C(this, se, void 0);
2662
- C(this, ye, !1);
2663
- C(this, _e, !1);
2664
- C(this, ke, "");
2665
- C(this, Be, []);
2666
- E(this, ie, {}), E(this, se, this.deviceInfo()), E(this, te, this.config.gameVersion), this.on("state", ({ balance: i }) => {
2667
- E(this, Ue, i);
2888
+ M(this, Ne, 0);
2889
+ M(this, ae);
2890
+ M(this, ne);
2891
+ M(this, oe);
2892
+ M(this, Ae, !1);
2893
+ M(this, De, !1);
2894
+ M(this, Pe, "");
2895
+ M(this, Ge, []);
2896
+ v(this, ne, {}), v(this, oe, this.deviceInfo()), v(this, ae, this.config.gameVersion), this.on("state", ({ balance: i }) => {
2897
+ v(this, Ne, i);
2668
2898
  }), this.on("autoplay", ({ action: i }) => {
2669
- ["start", "resume"].includes(i) ? E(this, ye, !0) : E(this, ye, !1);
2899
+ ["start", "resume"].includes(i) ? v(this, Ae, !0) : v(this, Ae, !1);
2670
2900
  }), this.on("settings", ({ fastPlay: i }) => {
2671
- i !== void 0 && E(this, _e, i);
2901
+ i !== void 0 && v(this, De, i);
2672
2902
  }), this.registerEvents();
2673
2903
  }
2674
2904
  async registerEvents() {
2675
- y(this, se).then((e) => {
2905
+ k(this, oe).then((e) => {
2676
2906
  this.track("Device Information", e);
2677
2907
  }), this.on("loadStart", () => {
2678
2908
  this.track("Game Loading", { progress: 0, step: "initial" });
@@ -2686,9 +2916,9 @@ class Vi extends vi {
2686
2916
  systemMessageType: e.type
2687
2917
  });
2688
2918
  }), this.on("openGameResponse", async (e) => {
2689
- E(this, ke, e.contract.stateType.nextRound), E(this, ie, {
2919
+ v(this, Pe, e.contract.stateType.nextRound), v(this, ne, {
2690
2920
  balanceInCoins: e.contract.balance.coins,
2691
- clientVersion: y(this, te),
2921
+ clientVersion: k(this, ae),
2692
2922
  coinValueInCents: this.sdkConfig.api.coinValueInCents,
2693
2923
  coinValueInCentsFloat: this.sdkConfig.api.coinValueInCents,
2694
2924
  currency: this.sdkConfig.api.currency,
@@ -2711,17 +2941,17 @@ class Vi extends vi {
2711
2941
  // rtpVariant: 'unknown',
2712
2942
  serverVersion: e.contract.metaData.version
2713
2943
  // testVariants: '',
2714
- }), this.track("Game Open", y(this, ie));
2944
+ }), this.track("Game Open", k(this, ne));
2715
2945
  }), this.on("playCycleEnd", async (e) => {
2716
- const i = await y(this, se), { base: a, multiplier: o, specialAction: n } = e.contract.bet.lastPaid ?? {}, h = e.contract.balance.coins, p = e.contract.bet.lastPaid.base * e.contract.bet.lastPaid.multiplier, w = e.contract.win.total, g = w - p, k = n || "spin", F = e.contract.roundId;
2946
+ const i = await k(this, oe), { base: a, multiplier: d } = e.contract.bet.lastPaid ?? {}, r = e.contract.balance.coins, p = e.contract.bet.lastPaid.base * e.contract.bet.lastPaid.multiplier, h = e.contract.win.total, g = h - p, m = "spin", C = e.contract.roundId;
2717
2947
  this.track("Betting Activity", {
2718
- balance: h - g,
2719
- balanceAfter: h,
2948
+ balance: r - g,
2949
+ balanceAfter: r,
2720
2950
  baseBet: a,
2721
2951
  // baseBetIndex,
2722
- betMultiplier: o,
2723
- betType: k,
2724
- gameVersion: y(this, te),
2952
+ betMultiplier: d,
2953
+ betType: m,
2954
+ gameVersion: k(this, ae),
2725
2955
  coinValueInCents: this.sdkConfig.api.coinValueInCents,
2726
2956
  coinValueInCentsFloat: this.sdkConfig.api.coinValueInCents,
2727
2957
  currency: this.sdkConfig.api.currency,
@@ -2731,18 +2961,18 @@ class Vi extends vi {
2731
2961
  isMobile: i.isMobile,
2732
2962
  netResult: g,
2733
2963
  operatorName: "kalamba",
2734
- orientation: Ke(),
2964
+ orientation: rt(),
2735
2965
  partnerId: this.sdkConfig.api.brand,
2736
2966
  partnerParentId: this.sdkConfig.api.integration,
2737
2967
  platform: "WEB",
2738
2968
  playMode: this.sdkConfig.api.playMode,
2739
- roundId: F,
2969
+ roundId: C,
2740
2970
  // TODO: uncomment when tracking TrackingEvent.GameSpin is implemented
2741
2971
  // roundTypes: [...this.#roundTypes],
2742
2972
  roundTypes: ["BaseGame"],
2743
2973
  totalBet: p,
2744
- totalWin: w
2745
- }), E(this, Be, []);
2974
+ totalWin: h
2975
+ }), v(this, Ge, []);
2746
2976
  }), this.on("telemetry.click", (e) => {
2747
2977
  this.track("UI Interaction", {
2748
2978
  action: "click",
@@ -2757,17 +2987,17 @@ class Vi extends vi {
2757
2987
  }), this.reportFpsSample(), this.reportFpsRound();
2758
2988
  }
2759
2989
  reportFpsSample() {
2760
- const e = new Ot(), i = () => {
2990
+ const e = new Dt(), i = () => {
2761
2991
  e.stop();
2762
- const o = e.getReport();
2763
- this.track("FPS Performance", { ...o, fpsType: "sample" }), a();
2992
+ const d = e.getReport();
2993
+ this.track("FPS Performance", { ...d, fpsType: "sample" }), a();
2764
2994
  }, a = async () => {
2765
2995
  e.start(), setTimeout(i, this.FPS_SAMPLE_INTERVAL);
2766
2996
  };
2767
2997
  a();
2768
2998
  }
2769
2999
  reportFpsRound() {
2770
- const e = new Ot();
3000
+ const e = new Dt();
2771
3001
  this.on("playCycleStart", () => {
2772
3002
  e.start();
2773
3003
  }), this.on("playCycleEnd", () => {
@@ -2778,26 +3008,26 @@ class Vi extends vi {
2778
3008
  }
2779
3009
  getExtraUiInteractionData() {
2780
3010
  return {
2781
- orientation: Ke(),
2782
- stateType: y(this, ke)
3011
+ orientation: rt(),
3012
+ stateType: k(this, Pe)
2783
3013
  };
2784
3014
  }
2785
3015
  async deviceInfo() {
2786
- var h;
2787
- const { browser: e, device: i, os: a } = R(navigator.userAgent), o = Ii(), n = await Ti();
3016
+ var p;
3017
+ const { browser: e, device: i, os: a } = L(navigator.userAgent), d = Gi(), r = await Hi();
2788
3018
  return {
2789
3019
  browserName: e.name,
2790
3020
  browserVersion: e.version,
2791
- connection: (h = navigator.connection) == null ? void 0 : h.effectiveType,
3021
+ connection: (p = navigator.connection) == null ? void 0 : p.effectiveType,
2792
3022
  deviceName: i.model,
2793
3023
  deviceType: i.type,
2794
3024
  isMobile: ["mobile", "tablet"].includes(i.type ?? ""),
2795
- isWebGLSupported: o,
2796
- isWebPSupported: n,
3025
+ isWebGLSupported: d,
3026
+ isWebPSupported: r,
2797
3027
  manufacturer: i.vendor,
2798
3028
  operatingSystem: a.name,
2799
3029
  operatingSystemVersion: a.version,
2800
- orientation: Ke(),
3030
+ orientation: rt(),
2801
3031
  pixelRatio: window.devicePixelRatio,
2802
3032
  screenHeight: window.screen.height,
2803
3033
  screenSize: `${window.screen.width}x${window.screen.height}`,
@@ -2809,57 +3039,59 @@ class Vi extends vi {
2809
3039
  };
2810
3040
  }
2811
3041
  }
2812
- Ue = new WeakMap(), te = new WeakMap(), ie = new WeakMap(), se = new WeakMap(), ye = new WeakMap(), _e = new WeakMap(), ke = new WeakMap(), Be = new WeakMap();
2813
- class qt {
3042
+ Ne = new WeakMap(), ae = new WeakMap(), ne = new WeakMap(), oe = new WeakMap(), Ae = new WeakMap(), De = new WeakMap(), Pe = new WeakMap(), Ge = new WeakMap();
3043
+ var Vi = ai();
3044
+ const Gt = /* @__PURE__ */ ni(Vi);
3045
+ class ei {
2814
3046
  constructor(t, e) {
2815
- m(this, "config");
2816
- m(this, "sdkConfig");
3047
+ b(this, "config");
3048
+ b(this, "sdkConfig");
2817
3049
  this.config = t, this.sdkConfig = e;
2818
3050
  }
2819
3051
  }
2820
- const xt = 25, Rt = 1e4;
2821
- var ae, ne, oe, N;
2822
- class zi extends qt {
3052
+ const Ht = 25, Vt = 1e4;
3053
+ var re, ce, de, q;
3054
+ class ns extends ei {
2823
3055
  constructor(...e) {
2824
3056
  super(...e);
2825
- C(this, ae, "https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");
2826
- C(this, ne, void 0);
2827
- C(this, oe, void 0);
2828
- C(this, N, []);
2829
- m(this, "processQueueForced");
2830
- E(this, ne, (/* @__PURE__ */ new Date()).getTime()), E(this, N, []), this.processQueueForced = this.processQueue.bind(this, !0), this.schedule(), fetch(y(this, ae), {
3057
+ M(this, re, "https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");
3058
+ M(this, ce);
3059
+ M(this, de);
3060
+ M(this, q, []);
3061
+ b(this, "processQueueForced");
3062
+ v(this, ce, (/* @__PURE__ */ new Date()).getTime()), v(this, q, []), this.processQueueForced = this.processQueue.bind(this, !0), this.schedule(), fetch(k(this, re), {
2831
3063
  method: "OPTIONS"
2832
- }).catch(ct), this.subscribe();
3064
+ }).catch(Gt), this.subscribe();
2833
3065
  }
2834
3066
  subscribe() {
2835
3067
  window.addEventListener("beforeunload", this.processQueueForced, !1), window.addEventListener("pagehide", this.processQueueForced, !1), window.addEventListener("visibilitychange", this.processQueueForced, !1);
2836
3068
  }
2837
3069
  schedule() {
2838
- y(this, oe) && clearTimeout(y(this, oe)), E(this, oe, window.setTimeout(() => this.processQueue(), Rt));
3070
+ k(this, de) && clearTimeout(k(this, de)), v(this, de, window.setTimeout(() => this.processQueue(), Vt));
2839
3071
  }
2840
3072
  send(e) {
2841
- E(this, ne, (/* @__PURE__ */ new Date()).getTime());
3073
+ v(this, ce, (/* @__PURE__ */ new Date()).getTime());
2842
3074
  try {
2843
- navigator.sendBeacon(y(this, ae), JSON.stringify(e));
3075
+ navigator.sendBeacon(k(this, re), JSON.stringify(e));
2844
3076
  } catch {
2845
- fetch(y(this, ae), {
3077
+ fetch(k(this, re), {
2846
3078
  body: JSON.stringify(e),
2847
3079
  method: "POST",
2848
3080
  headers: {
2849
3081
  "Content-Type": "application/json"
2850
3082
  },
2851
3083
  keepalive: !0
2852
- }).catch(ct);
3084
+ }).catch(Gt);
2853
3085
  }
2854
3086
  this.schedule();
2855
3087
  }
2856
3088
  addToQueue(e) {
2857
- y(this, N).push(e), this.processQueue();
3089
+ k(this, q).push(e), this.processQueue();
2858
3090
  }
2859
3091
  processQueue(e = !1) {
2860
- if (!(this.sdkConfig == null || !this.sdkConfig.ui.feature.allowTelemetry) && !(!e && y(this, N).length < xt && (/* @__PURE__ */ new Date()).getTime() - y(this, ne) < Rt))
2861
- for (; y(this, N).length; ) {
2862
- const i = y(this, N).splice(0, xt).map((a) => ({
3092
+ if (!(this.sdkConfig == null || !this.sdkConfig.ui.feature.allowTelemetry) && !(!e && k(this, q).length < Ht && (/* @__PURE__ */ new Date()).getTime() - k(this, ce) < Vt))
3093
+ for (; k(this, q).length; ) {
3094
+ const i = k(this, q).splice(0, Ht).map((a) => ({
2863
3095
  ...a,
2864
3096
  sessionID: this.sdkConfig.api.sessionId,
2865
3097
  userID: this.sdkConfig.api.user
@@ -2872,33 +3104,33 @@ class zi extends qt {
2872
3104
  eventName: e,
2873
3105
  eventParams: i,
2874
3106
  eventTimestamp: (/* @__PURE__ */ new Date()).getTime(),
2875
- eventUUID: jt()
3107
+ eventUUID: oi()
2876
3108
  });
2877
3109
  }
2878
3110
  }
2879
- ae = new WeakMap(), ne = new WeakMap(), oe = new WeakMap(), N = new WeakMap();
2880
- const Pi = O("LoggingTracker", "color:#000000;font-weight:bold;");
2881
- class qi extends qt {
3111
+ re = new WeakMap(), ce = new WeakMap(), de = new WeakMap(), q = new WeakMap();
3112
+ const zi = x("LoggingTracker", "color:#000000;font-weight:bold;");
3113
+ class os extends ei {
2882
3114
  track(t, e) {
2883
- Pi(`@${this.sdkConfig.api.user}`, `[${t}]`, e);
3115
+ zi(`@${this.sdkConfig.api.user}`, `[${t}]`, e);
2884
3116
  }
2885
3117
  }
2886
3118
  export {
2887
- Ri as BasicPlugin,
2888
- V as CasinoPlugin,
2889
- Li as DebuggingPlugin,
2890
- Ui as GigPlugin,
2891
- Gi as KalambaBullseyeParsers,
2892
- Hi as KalambaBullseyePlugin,
2893
- Vi as KalambaStargazerPlugin,
2894
- zi as KalambaStargazerTracker,
2895
- qi as LoggingTracker,
2896
- _i as OryxPlugin,
2897
- Bi as PariplayPlugin,
2898
- Ni as QuantaPlugin,
2899
- Fi as RelaxFEIMPlugin,
2900
- pi as RgsPlugin,
2901
- vi as TelemetryPlugin,
2902
- qt as Tracker,
2903
- Di as TukoPlugin
3119
+ Qi as BasicPlugin,
3120
+ j as CasinoPlugin,
3121
+ Ki as DebuggingPlugin,
3122
+ Xi as GigPlugin,
3123
+ is as KalambaBullseyeParsers,
3124
+ ss as KalambaBullseyePlugin,
3125
+ as as KalambaStargazerPlugin,
3126
+ ns as KalambaStargazerTracker,
3127
+ os as LoggingTracker,
3128
+ Ji as OryxPlugin,
3129
+ Yi as PariplayPlugin,
3130
+ ts as QuantaPlugin,
3131
+ Zi as RelaxFEIMPlugin,
3132
+ Ii as RgsPlugin,
3133
+ Bi as TelemetryPlugin,
3134
+ ei as Tracker,
3135
+ es as TukoPlugin
2904
3136
  };