@kalamba/sdk 0.1.2 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -8
- package/dist/index.js +45 -45
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.d.ts +20 -10
- package/dist/plugins.js +174 -181
- package/dist/wrapper.d.ts +17 -7
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* BSD 3-Clause License
|
|
3
3
|
* Copyright (c) 2024, Kalamba Games Limited
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var E=Object.defineProperty;var w=(s,e
|
|
5
|
+
"use strict";var E=Object.defineProperty;var w=(s,r,e)=>r in s?E(s,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[r]=e;var c=(s,r,e)=>(w(s,typeof r!="symbol"?r+"":r,e),e),p=(s,r,e)=>{if(!r.has(s))throw TypeError("Cannot "+e)};var u=(s,r,e)=>(p(s,r,"read from private field"),e?e.call(s):r.get(s)),l=(s,r,e)=>{if(r.has(s))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(s):r.set(s,e)},d=(s,r,e,o)=>(p(s,r,"write to private field"),o?o.call(s,e):r.set(s,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=()=>{};class h extends Error{constructor(e){super("OpenGameError");c(this,"error");this.name="OpenGameError",this.error=e}}class y extends Error{constructor(e){super("PlayError");c(this,"error");this.name="PlayError",this.error=e}}class m extends Error{constructor(){super("TimeoutError"),this.name="TimeoutError"}}var i;class f{constructor({messagePort:r}){c(this,"config");l(this,i,void 0);d(this,i,r),this.on("configured",e=>{this.config=e})}request(r,...[e]){return new Promise(o=>{this.on(`${r}Response`,t=>o({type:"response",response:t}),{once:!0}),this.on(`${r}Error`,t=>o({type:"error",error:t}),{once:!0}),this.send(r,e)})}on(r,e,o){const t=function n(a){a.data.message===`kalamba:wrapper:${r}`&&(g("on",a.data.message.replace(/^kalamba:/,""),a.data.payload),e(a.data.payload),o!=null&&o.once&&window.removeEventListener("message",n))};window.addEventListener("message",t)}send(r,...[e]){u(this,i).postMessage({message:`kalamba:sdk:${r}`,payload:e},"*")}async openGame(r){var o;const[,e]=await Promise.all([new Promise(t=>this.on("configured",t,{once:!0})),this.request("openGame",r)]);if(e.type==="response")return e.response;throw((o=e.error)==null?void 0:o.type)==="timeout"?new m:new h(e.error)}async play(r,e={},o="SPIN"){var a;const t={contract:r,extra:e,actionType:o},n=await this.request("play",t);if(n.type==="response")return n.response;throw((a=n.error)==null?void 0:a.type)==="timeout"?new m:new y(n.error)}}i=new WeakMap;exports.KalambaSdk=f;exports.OpenGameError=h;exports.PlayError=y;exports.TimeoutError=m;
|
package/dist/index.d.ts
CHANGED
|
@@ -48,6 +48,11 @@ export declare type CasinoOnlyMessagePayloadMap = {
|
|
|
48
48
|
unfreeze: never;
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
+
export declare type ContractPlayPayload = {
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
bet: Bet | null;
|
|
54
|
+
};
|
|
55
|
+
|
|
51
56
|
export declare type DomainAllowedPayloadMap<P extends DomainPrefix> = DomainToMessagePayloadMap[P];
|
|
52
57
|
|
|
53
58
|
export declare type DomainMessage<P extends DomainPrefix> = keyof DomainAllowedPayloadMap<P>;
|
|
@@ -76,6 +81,12 @@ declare type Error_2 = {
|
|
|
76
81
|
};
|
|
77
82
|
export { Error_2 as Error }
|
|
78
83
|
|
|
84
|
+
export declare type ExtraPlayPayload = {
|
|
85
|
+
[key: string]: any;
|
|
86
|
+
} & {
|
|
87
|
+
bet?: never;
|
|
88
|
+
};
|
|
89
|
+
|
|
79
90
|
export declare type ForwardToPluginsMessage<P extends PluginDomain> = keyof ForwardToPluginsMessageMap<'sdk'>[P] | keyof ForwardToPluginsMessageMap<'rgs'>[P] | keyof ForwardToPluginsMessageMap<'casino'>[P] | keyof ForwardToPluginsMessageMap<'telemetry'>[P];
|
|
80
91
|
|
|
81
92
|
export declare interface ForwardToPluginsMessageMap<SourceDomain extends DomainPrefix> {
|
|
@@ -105,7 +116,7 @@ export declare class KalambaSdk {
|
|
|
105
116
|
on<M extends DomainMessage<'wrapper'> | ForwardToSdkMessage>(message: M, listener: (payload: M extends DomainMessage<'wrapper'> ? DomainMessagePayload<'wrapper', M> : M extends ForwardToSdkMessage ? ForwardToSdkMessagePayload<M> : never) => void, options?: AddEventListenerOptions_2): void;
|
|
106
117
|
send<M extends DomainMessage<'sdk'>>(message: M, ...[payload]: DomainMessagePayload<'sdk', M> extends never ? [] : [DomainMessagePayload<'sdk', M>]): void;
|
|
107
118
|
openGame(payload: DomainMessagePayload<'sdk', 'openGame'>): Promise<OpenGameResponse>;
|
|
108
|
-
play(
|
|
119
|
+
play(contract: ContractPlayPayload, extra?: ExtraPlayPayload, actionType?: string): Promise<PlayResponse>;
|
|
109
120
|
}
|
|
110
121
|
|
|
111
122
|
export declare type Message = keyof MessageMap;
|
|
@@ -131,6 +142,7 @@ declare type OpenGameError_2 = {
|
|
|
131
142
|
|
|
132
143
|
export declare type OpenGameRequest = {
|
|
133
144
|
gameName: string;
|
|
145
|
+
/** version of game client */
|
|
134
146
|
version: string;
|
|
135
147
|
};
|
|
136
148
|
|
|
@@ -150,11 +162,9 @@ declare type PlayError_2 = {
|
|
|
150
162
|
};
|
|
151
163
|
|
|
152
164
|
export declare type PlayRequest = {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
} | {
|
|
157
|
-
opaqueGameAttributes: unknown;
|
|
165
|
+
contract: ContractPlayPayload;
|
|
166
|
+
extra: ExtraPlayPayload;
|
|
167
|
+
actionType: string;
|
|
158
168
|
};
|
|
159
169
|
|
|
160
170
|
export declare type PlayResponse = {
|
|
@@ -306,12 +316,12 @@ export declare type SdkOnlyMessagePayloadMap = {
|
|
|
306
316
|
openGame: OpenGameRequest;
|
|
307
317
|
play: PlayRequest;
|
|
308
318
|
playCycleEnd: PlayResponse;
|
|
309
|
-
playCycleStart:
|
|
319
|
+
playCycleStart: ContractPlayPayload;
|
|
310
320
|
playEnd: PlayResponse;
|
|
311
321
|
playReady: {
|
|
312
322
|
ready: boolean;
|
|
313
323
|
};
|
|
314
|
-
playStart:
|
|
324
|
+
playStart: ContractPlayPayload;
|
|
315
325
|
translations: Record<string, Record<string, string>>;
|
|
316
326
|
settings: Settings;
|
|
317
327
|
'telemetry.click': {
|
package/dist/index.js
CHANGED
|
@@ -3,96 +3,96 @@
|
|
|
3
3
|
* Copyright (c) 2024, Kalamba Games Limited
|
|
4
4
|
*/
|
|
5
5
|
var h = Object.defineProperty;
|
|
6
|
-
var w = (s,
|
|
7
|
-
var
|
|
8
|
-
if (!
|
|
9
|
-
throw TypeError("Cannot " +
|
|
6
|
+
var w = (s, e, r) => e in s ? h(s, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[e] = r;
|
|
7
|
+
var c = (s, e, r) => (w(s, typeof e != "symbol" ? e + "" : e, r), r), p = (s, e, r) => {
|
|
8
|
+
if (!e.has(s))
|
|
9
|
+
throw TypeError("Cannot " + r);
|
|
10
10
|
};
|
|
11
|
-
var
|
|
12
|
-
if (
|
|
11
|
+
var m = (s, e, r) => (p(s, e, "read from private field"), r ? r.call(s) : e.get(s)), u = (s, e, r) => {
|
|
12
|
+
if (e.has(s))
|
|
13
13
|
throw TypeError("Cannot add the same private member more than once");
|
|
14
|
-
|
|
15
|
-
},
|
|
14
|
+
e instanceof WeakSet ? e.add(s) : e.set(s, r);
|
|
15
|
+
}, l = (s, e, r, o) => (p(s, e, "write to private field"), o ? o.call(s, r) : e.set(s, r), r);
|
|
16
16
|
const y = () => {
|
|
17
17
|
};
|
|
18
18
|
class E extends Error {
|
|
19
|
-
constructor(
|
|
19
|
+
constructor(r) {
|
|
20
20
|
super("OpenGameError");
|
|
21
|
-
|
|
22
|
-
this.name = "OpenGameError", this.error =
|
|
21
|
+
c(this, "error");
|
|
22
|
+
this.name = "OpenGameError", this.error = r;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
class g extends Error {
|
|
26
|
-
constructor(
|
|
26
|
+
constructor(r) {
|
|
27
27
|
super("PlayError");
|
|
28
|
-
|
|
29
|
-
this.name = "PlayError", this.error =
|
|
28
|
+
c(this, "error");
|
|
29
|
+
this.name = "PlayError", this.error = r;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
class
|
|
32
|
+
class d extends Error {
|
|
33
33
|
constructor() {
|
|
34
34
|
super("TimeoutError"), this.name = "TimeoutError";
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var i;
|
|
38
38
|
class P {
|
|
39
|
-
constructor({ messagePort:
|
|
39
|
+
constructor({ messagePort: e }) {
|
|
40
40
|
// after open game we can be sure that config is set
|
|
41
41
|
// it's much easier to use it with type `SdkConfig` instead of `SdkConfig | undefined`
|
|
42
42
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
43
43
|
// @ts-ignore
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
this.config =
|
|
44
|
+
c(this, "config");
|
|
45
|
+
u(this, i, void 0);
|
|
46
|
+
l(this, i, e), this.on("configured", (r) => {
|
|
47
|
+
this.config = r;
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
request(
|
|
50
|
+
request(e, ...[r]) {
|
|
51
51
|
return new Promise((o) => {
|
|
52
|
-
this.on(`${
|
|
52
|
+
this.on(`${e}Response`, (t) => o({ type: "response", response: t }), {
|
|
53
53
|
once: !0
|
|
54
|
-
}), this.on(`${
|
|
54
|
+
}), this.on(`${e}Error`, (t) => o({ type: "error", error: t }), { once: !0 }), this.send(e, r);
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
on(
|
|
58
|
-
const t = function
|
|
59
|
-
|
|
57
|
+
on(e, r, o) {
|
|
58
|
+
const t = function n(a) {
|
|
59
|
+
a.data.message === `kalamba:wrapper:${e}` && (y("on", a.data.message.replace(/^kalamba:/, ""), a.data.payload), r(a.data.payload), o != null && o.once && window.removeEventListener("message", n));
|
|
60
60
|
};
|
|
61
61
|
window.addEventListener("message", t);
|
|
62
62
|
}
|
|
63
63
|
// TODO error messages
|
|
64
|
-
send(
|
|
65
|
-
|
|
64
|
+
send(e, ...[r]) {
|
|
65
|
+
m(this, i).postMessage(
|
|
66
66
|
{
|
|
67
|
-
message: `kalamba:sdk:${
|
|
68
|
-
payload:
|
|
67
|
+
message: `kalamba:sdk:${e}`,
|
|
68
|
+
payload: r
|
|
69
69
|
},
|
|
70
70
|
"*"
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
|
-
async openGame(
|
|
73
|
+
async openGame(e) {
|
|
74
74
|
var o;
|
|
75
|
-
const [,
|
|
75
|
+
const [, r] = await Promise.all([
|
|
76
76
|
// TODO: return promise from call to this.on if listener is not provided
|
|
77
77
|
new Promise((t) => this.on("configured", t, { once: !0 })),
|
|
78
|
-
this.request("openGame",
|
|
78
|
+
this.request("openGame", e)
|
|
79
79
|
]);
|
|
80
|
-
if (
|
|
81
|
-
return
|
|
82
|
-
throw ((o =
|
|
80
|
+
if (r.type === "response")
|
|
81
|
+
return r.response;
|
|
82
|
+
throw ((o = r.error) == null ? void 0 : o.type) === "timeout" ? new d() : new E(r.error);
|
|
83
83
|
}
|
|
84
|
-
async play(r) {
|
|
85
|
-
var
|
|
86
|
-
const e = await this.request("play",
|
|
87
|
-
if (
|
|
88
|
-
return
|
|
89
|
-
throw ((
|
|
84
|
+
async play(e, r = {}, o = "SPIN") {
|
|
85
|
+
var a;
|
|
86
|
+
const t = { contract: e, extra: r, actionType: o }, n = await this.request("play", t);
|
|
87
|
+
if (n.type === "response")
|
|
88
|
+
return n.response;
|
|
89
|
+
throw ((a = n.error) == null ? void 0 : a.type) === "timeout" ? new d() : new g(n.error);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
i = new WeakMap();
|
|
93
93
|
export {
|
|
94
94
|
P as KalambaSdk,
|
|
95
95
|
E as OpenGameError,
|
|
96
96
|
g as PlayError,
|
|
97
|
-
|
|
97
|
+
d as TimeoutError
|
|
98
98
|
};
|
package/dist/plugins.cjs
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* BSD 3-Clause License
|
|
3
3
|
* Copyright (c) 2024, Kalamba Games Limited
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var Nt=Object.defineProperty;var Ht=(i,t,e)=>t in i?Nt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var w=(i,t,e)=>(Ht(i,typeof t!="symbol"?t+"":t,e),e),ot=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var y=(i,t,e)=>(ot(i,t,"read from private field"),e?e.call(i):t.get(i)),v=(i,t,e)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)},E=(i,t,e,s)=>(ot(i,t,"write to private field"),s?s.call(i,e):t.set(i,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rt=require("./noop-b3c54b76.cjs");function x(i,t){return(e,...s)=>{console.log(`[%c${i}\x1B[m] %s`,t,e,...s)}}class V{constructor(t){w(this,"config");this.config=t}on(t,e,s){const n=function(a){a.data.message!==`kalamba:wrapper-casino:${t}`&&a.data.message!==`kalamba:wrapper:${t}`||e(a.data.payload)};window.addEventListener("message",n,s)}send(t,...[e]){window.postMessage({message:`kalamba:casino:${t}`,payload:e})}}const zt=x("BasicPlugin","color:#000000;font-weight:bold;");function Vt(i,t){return Math.round(i*100/t)}class qt extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),zt("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,payload:s}=t.data;switch(e){case"doAudioSettings":this.send("settings",{music:s==null?void 0:s.musicEnabled,sounds:s==null?void 0:s.soundEnabled});return;case"doBalanceUpdate":const{currency:n,coinValueInCents:l}=this.config.api;s.currency===n&&typeof s.balanceInCurrency=="number"?this.send("balance",{balance:Vt(s.balanceInCurrency,l)}):(s.balanceInCoins,this.send("balance",{balance:s.balanceInCoins}));return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}const k=x("▼ DebuggingPlugin IN ▼","color:#444444;font-weight:bold;"),Wt=x("▲ DebuggingPlugin OUT ▲","color:#444444;font-weight:bold;");class $t extends V{constructor(...t){super(...t),this.registerDebugToSdkEvents(),this.registerSdkToDebugEvents()}registerDebugToSdkEvents(){window.DebuggingPlugin={balance:t=>this._send("balance",t),bet:t=>this._send("bet",t),choice:t=>this._send("choice",t),close:t=>this._send("close",t),help:t=>this._send("help",t),history:t=>this._send("history",t),freeze:t=>this._send("freeze",t),paytable:t=>this._send("paytable",t),settings:t=>this._send("settings",t),suspend:t=>this._send("suspend",t),unfreeze:t=>this._send("unfreeze",t)}}registerSdkToDebugEvents(){this.on("autoplay",t=>k("autoplay",t)),this.on("balance",t=>k("balance",t)),this.on("bet",t=>k("bet",t)),this.on("cashier",t=>k("cashier",t)),this.on("choice",t=>k("choice",t)),this.on("close",t=>k("close",t)),this.on("error",t=>k("error",t)),this.on("loadEnd",t=>k("loadEnd",t)),this.on("loadProgress",t=>k("loadProgress",t)),this.on("loadStart",t=>k("loadStart",t)),this.on("playCycleStart",t=>k("playCycleStart",t)),this.on("playCycleEnd",t=>k("playCycleEnd",t)),this.on("playEnd",t=>k("playEnd",t)),this.on("playError",t=>k("playError",t)),this.on("playReady",t=>k("playReady",t)),this.on("playStart",t=>k("playStart",t)),this.on("settings",t=>k("settings",t))}_send(...t){Wt(...t),this.send(...t)}}const jt=x("GigPlugin","color:#000000;font-weight:bold;");class Qt extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),jt("configured")}postMessage(t){const e={event:t};window.top.postMessage(e,"*")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{data:e}=t;switch(e){case"STOP_AUTO_PLAY":this.send("suspend");return;case"BLOCK_BETS":this.send("freeze");return;case"UNBLOCK_BETS":this.send("unfreeze");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}}),this.on("playReady",()=>{this.postMessage("GAME_READY")})}}const Xt=x("OryxPlugin","color:#000000;font-weight:bold;");class Kt extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Xt("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,param:s}=t.data;switch(e){case"doBalanceUpdate":this.send("balance",{balance:s});return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){let t=0;this.on("close",()=>{window.top.postMessage({wpgaction:"close"},"*"),window.parent.postMessage({wpgaction:"close.parent"},"*")}),this.on("balance",({balance:e})=>{t!==e&&(t=e,window.top.postMessage({param:{},wpgaction:"balance"},"*"),window.parent.postMessage({param:{},wpgaction:"balance.parent"},"*"))}),this.on("loadStart",()=>{window.top.postMessage({wpgaction:"loadStart"},"*"),window.parent.postMessage({wpgaction:"loadStart.parent"},"*")}),this.on("loadEnd",()=>{window.top.postMessage({wpgaction:"loadEnd"},"*"),window.parent.postMessage({wpgaction:"loadEnd.parent"},"*")}),this.on("playStart",()=>{window.top.postMessage({wpgaction:"gameSpinStart"},"*"),window.parent.postMessage({wpgaction:"gameSpinStart.parent"},"*")}),this.on("playEnd",()=>{window.top.postMessage({wpgaction:"gameSpinEnd"},"*"),window.parent.postMessage({wpgaction:"gameSpinEnd.parent"},"*")}),this.on("cashier",({type:e})=>{switch(e){case"BALANCE_LOW":window.top.postMessage({wpgaction:"cashier"},"*"),window.parent.postMessage({wpgaction:"cashier.parent"},"*");break;case"BALANCE_INSUFFICIENT":window.top.postMessage({wpgaction:"errorOutOfMoney"},"*"),window.parent.postMessage({wpgaction:"errorOutOfMoney.parent"},"*");break}})}}const ct=x("PariplayPlugin","color:#000000;font-weight:bold;");function Ge(i){try{window.top.location=i}catch{window.location=i}}function Ne(i,t){return new Promise(function(s,n){const l=new XMLHttpRequest;l.onload=function(){l.status>=200&&l.status<300?s(l.responseText):n(l.responseText)},l.open(i,t),l.send()})}function He(){}function Jt(i){return i.filter(function(e){return e.messageType.toUpperCase()==="DATA"})}function ze(i){return i.filter(function(e){return["NOTIFICATION","POPUP"].includes(e.messageType.toUpperCase())})}function Ot(i){try{return JSON.parse(i.text)}catch{return{}}}function Yt(i){return i.map(Ot).filter(Boolean).find(function(e){return e.betId!=null&&e.winId!=null})||{}}function Zt(i){return i.map(Ot).filter(Boolean).find(function(e){return e.TotalBet!=null&&e.TotalWin!=null})||{}}class ei extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),ct("configured")}postMessage(t,e){const s={lang:this.config.ui.language,sender:this.config.api.game,type:t};e!=null&&(s.data=e),ct("postMessage",s),window.parent.postMessage(s,"*")}coinsToCurrency(t){return t*this.config.api.coinValueInCents/100}handleContinueButton(t,e){t.link&&Ne("GET",t.link),e()}handleLinkButton(t,e){switch(t.linkType.toUpperCase()){case"AJAX":Ne("GET",t.link),e();return;case"AJAXRESPONSE":Ne("GET",t.link).then(()=>{e()});return;case"REDIRECT":Ge(t.link),e();return}}handleQuitButton(t,e){this.send("close"),e()}handleCashierButton(t,e){this.send("cashier",{type:"ON_DEMAND"}),e()}handleHistoryButton(t,e){this.send("history",{source:"casino"}),e()}get buttonActions(){return{CASHIER:this.handleCashierButton,CONTINUE:this.handleContinueButton,HISTORY:this.handleHistoryButton,LINK:this.handleLinkButton,QUIT:this.handleQuitButton}}processInfoUiMessages(t){return t.reduce((e,s)=>e.then(()=>new Promise(n=>{Object.assign({},s,{buttons:s.buttons.filter(l=>l.action.toUpperCase()==="CASHIER"?!!this.config.api.cashierUrl:!0).map(l=>Object.assign({},l,{onRelease:()=>{const a=s.messageType.toUpperCase()==="POPUP"?He:n,h=this.buttonActions[l.action.toUpperCase()];h?h(l,a):a()}}))})}).catch(He)),Promise.resolve()).then(()=>{}).catch(He)}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e}=t.data;switch(e){case"pause":case"disableSpin":this.send("freeze");return;case"resume":case"enableSpin":this.send("unfreeze");return;case"stopAutobet":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){let t=0;this.on("openGameResponse",e=>{let s;try{const n=JSON.parse(JSON.parse(atob(this.config.api.integrationData.token.split(".")[1])).token),l=JSON.parse(n.integrationSpecificAttributes.sessionData||"{}");s={ClientToken:n.integrationSpecificAttributes.clientToken,CurrencyCode:n.currency,PlayerTokenId:n.user,SessionData:l}}catch{s=void 0}this.postMessage("gameDataLoaded",{LoadGameData:s,success:!0});try{const n=ze(e.data.uiMessages);this.processInfoUiMessages(n)}catch{}}),this.on("balance",({balance:e})=>{t!==e&&(t=e,this.postMessage("balance",{amount:this.coinsToCurrency(e)}))}),this.on("close",()=>{if(this.config.api.homeUrl)if(this.config.api.homeUrl==="(back)")try{window.top.history.back()}catch{window.history.back()}else this.config.api.homeUrl==="(api)"?this.postMessage("quit"):Ge(this.config.api.homeUrl)}),this.on("playEnd",e=>{this.postMessage("roundEnded",{balanceAfter:this.coinsToCurrency(e.balance),win:this.coinsToCurrency(e.data.gameRoundResult.win)});try{const s=ze(e.data.uiMessages);this.processInfoUiMessages(s)}catch{}}),this.on("playError",e=>{this.postMessage("ticketReceived",{ErrorCode:e.data.data.data.operatorSpecificErrorCode,ErrorMessage:e.data.data.data.operatorSpecificErrorMessage,Status:{ErrCode:e.data.data.data.operatorSpecificErrorCode}})}),this.on("playResponse",e=>{this.postMessage("roundStarted",{balanceBefore:this.coinsToCurrency(e.balance+e.data.gameState.totalBetFromCurrentGameCycle)});const s=e.data.gameState.stateTypeThisRound==="BaseGame",n=Jt(e.data.uiMessages),l=ze(e.data.uiMessages),a=Yt(n),h=Zt(n);this.postMessage("ticketReceived",{Balance:this.coinsToCurrency(e.balance),BetAmount:s?this.coinsToCurrency(e.data.gameState.totalBetFromCurrentGameCycle):0,CreditTransactionId:a.betId,DebitTransactionId:a.winId,Message:l,SessionData:h,Status:{ErrCode:0},WinAmount:this.coinsToCurrency(e.data.gameRoundResult.win)})}),this.on("playStart",e=>{"bet"in e&&this.postMessage("roundStart",{totalBet:this.coinsToCurrency(e.bet.base*e.bet.multiplier)})}),this.on("loadEnd",()=>{this.postMessage("gameReady")}),this.on("loadStart",()=>{this.postMessage("onAppFrameReady")}),this.on("cashier",()=>{this.config.api.cashierUrl&&(this.config.api.cashierUrl==="(api)"?this.postMessage("cashier"):Ge(this.config.api.cashierUrl))})}}const he=x("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class ti extends V{constructor(...e){super(...e);w(this,"VERSION","1.15.0");const s=document.createElement("script");s.src=`https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`,s.onload=()=>{he("loaded"),window.FEIM.configure({p2pConfig:{currency:this.config.api.currency,launchParams:{homeurl:"homeUrl"}}}),he("configured"),this.registerToSdkEvents(),this.registerFromSdkEvents()},document.body.appendChild(s)}registerToSdkEvents(){window.FEIM.on.errorMessageDismissed(()=>this.send("unfreeze")),window.FEIM.on.errorMessageDisplayed(()=>this.send("freeze")),window.FEIM.on.exitingGame(()=>he("!!! NOT IMPLEMENTED: exitingGame !!!")),window.FEIM.on.freeze(()=>this.send("freeze")),window.FEIM.on.initialized(()=>he("!!! NOT IMPLEMENTED: initialized !!!")),window.FEIM.on.pauseAutoPlay(()=>this.send("suspend")),window.FEIM.on.refreshBalance(()=>he("!!! NOT IMPLEMENTED: refreshBalance !!!")),window.FEIM.on.toggleGameHelp(()=>{this.send("help",{})}),window.FEIM.on.togglePaytable(()=>{this.send("paytable",{})}),window.FEIM.on.unfreeze(()=>this.send("unfreeze")),window.FEIM.on.updateSettings(({payload:[e]})=>this.send("settings",{sounds:e.sounds,fastPlay:e.fastPlay}))}registerFromSdkEvents(){this.on("autoplay",({action:e})=>{switch(e){case"start":window.FEIM.send.autoPlayStarted();break;case"stop":window.FEIM.send.autoPlayFinished();break}}),this.on("balance",({balance:e})=>{window.FEIM.send.balanceUpdate(e)}),this.on("bet",({base:e,multiplier:s})=>{window.FEIM.send.betUpdate(e*s)}),this.on("error",({message:e})=>{window.FEIM.send.errorMessage(e)}),this.on("close",()=>{window.FEIM.send.exitGame()}),this.on("loadEnd",()=>{window.FEIM.send.gameLoadCompleted()}),this.on("loadProgress",({progress:e})=>{window.FEIM.send.gameLoadProgress(e)}),this.on("loadStart",()=>{window.FEIM.send.gameLoadStarted()}),this.on("cashier",()=>{window.FEIM.send.openQuickDeposit()}),this.on("playCycleEnd",e=>{const s={balance:e.balance,bet:e.data.gameState.totalBetFromCurrentGameCycle,win:{win:e.data.gameState.totalWinFromCurrentGameCycle}};window.FEIM.send.roundFinished(s)}),this.on("playResponse",e=>{const s={balance:e.balance,playResponse:e.data};window.FEIM.send.roundStarted(s)}),this.on("history",()=>{window.FEIM.send.showHistory()}),this.on("settings",e=>{window.FEIM.send.updateSettings(e)})}}const Ve=x("TukoPlugin","color:#000000;font-weight:bold;");function ii(i,t){return Math.round(i*100/t)}class si extends V{constructor(...e){super(...e);w(this,"PING_INTERVAL",1e4);const n=new URLSearchParams(window.location.search).get("pingCallbackUrl");n&&window.setInterval(()=>{this.ping(n)},this.PING_INTERVAL),this.registerToSdkEvents(),this.registerFromSdkEvents(),Ve("configured")}ping(e){const s=new XMLHttpRequest;s.onreadystatechange=function(){s.readyState===XMLHttpRequest.DONE&&(s.status===0||s.status>=200&&s.status<400?Ve("ping ok",s):Ve("ping error",s))},s.open("GET",e),s.send()}registerToSdkEvents(){window.addEventListener("message",e=>{try{const{type:s,payload:n}=e.data;switch(s){case"doAudioSettings":this.send("settings",{music:n==null?void 0:n.musicEnabled,sounds:n==null?void 0:n.soundEnabled});return;case"doBalanceUpdate":const{currency:l,coinValueInCents:a}=this.config.api;n.currency===l&&typeof n.balanceInCurrency=="number"?this.send("balance",{balance:ii(n.balanceInCurrency,a)}):(n.balanceInCoins,this.send("balance",{balance:n.balanceInCoins}));return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}class ni{constructor(t){w(this,"socket",null);w(this,"webSocketUrl");w(this,"eventListeners",{close:[],error:[],message:[]});w(this,"connect",()=>{const t=new WebSocket(this.webSocketUrl);return t.addEventListener("message",this.handleMessage),new Promise(e=>{t.addEventListener("open",s=>{this.handleOpen(s),e(this.socket)})})});w(this,"send",t=>{if(this.socket==null)throw new Error("Cannot send message, the WebSocket connection is not open");this.socket.send(t)});w(this,"close",()=>{if(this.socket==null)throw new Error("Cannot close the WebSocket connection that is not open");this.socket.close(),this.addEventListener("error",t=>{console.log(t)})});w(this,"handleClose",t=>{this.eventListeners.close.forEach(e=>{e(t)})});w(this,"handleError",t=>{this.eventListeners.error.forEach(e=>{e(t)})});w(this,"handleMessage",t=>{this.eventListeners.message.forEach(e=>{e(t)})});w(this,"handleOpen",t=>{const e=t.target;e.addEventListener("close",this.handleClose),e.addEventListener("error",this.handleError),this.socket=e});this.webSocketUrl=t}addEventListener(t,e){this.eventListeners[t].push(e)}removeEventListener(t,e){const s=this.eventListeners[t].indexOf(e);s!==-1&&this.eventListeners[t].splice(s,1)}}function Me(i){try{return JSON.parse(i==null?void 0:i.data)}catch(t){return console.error("fakap",t),null}}function oe(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="GameEvent"}function ai(i){return oe(i)&&i.body.event==="OPEN_GAME"}function oi(i){return oe(i)&&i.body.event==="SPIN_ERROR"}function ri(i){return oe(i)&&i.body.event==="SPIN_RESULT"}function ci(i){return oe(i)&&i.body.event==="BG_RESULT"}function di(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="OpenGame"}function li(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="Ping"}function dt(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="RealityCheck"}var Z,ye;class ui extends ni{constructor(e,s){const n=new URL(e.apiUrl);n.searchParams.set("cageCode",e.cageCode),n.searchParams.set("gameCode",e.gameCode),n.searchParams.set("operatorCode",e.operatorCode),n.searchParams.set("playMode",e.playMode),n.searchParams.set("token",e.token),n.searchParams.set("username",e.username);super(n.toString());w(this,"cId",0);w(this,"mId",0);w(this,"seqId",10);w(this,"gameCode");v(this,Z,void 0);v(this,ye,void 0);w(this,"onMessage",e=>{const s=Me(e);(oe(s)||li(s)||dt(s))&&this.sendAcknowledgement(s),dt(s)&&this.handleRealityCheck(s)});this.eventListeners.realityCheck=[],this.gameCode=e.gameCode,E(this,Z,s.requestTimeoutMs),E(this,ye,s.gameVersion??"unknown"),this.addEventListener("message",this.onMessage)}handleRealityCheck(e){this.eventListeners.realityCheck.forEach(s=>{s(e.body)})}addEventListener(e,s){super.addEventListener(e,s)}removeEventListener(e,s){super.removeEventListener(e,s)}buildHeader(e,s=null){return{cId:s??++this.cId,code:s!==null?1:void 0,mId:++this.mId,name:e}}buildPayload(e,s){return JSON.stringify({body:s,header:e})}getBodyExtras(e){return{action:e,seqId:++this.seqId}}request(e,s){const n=this.buildPayload(e,s);return new Promise((l,a)=>{setTimeout(()=>a({request:{body:s,header:e},type:"timeout"}),y(this,Z));const h=g=>{const p=Me(g);try{e.cId===(p==null?void 0:p.header.cId)&&(this.removeEventListener("message",h),p.header.code===1?l(p):a({response:p,type:"response"}))}catch{a({response:p,type:"error"})}};this.addEventListener("message",h),this.send(n)})}activateFreeRound(e){const s=this.buildHeader("ActivateFreeRound");return this.request(s,e)}authenticate(e=!1){const s=this.buildHeader("Authenticate"),n={clientType:3,version:y(this,ye),reconnect:e};return this.request(s,n).then(l=>l.body)}openGame(){const e=this.buildHeader("OpenGame"),s={gameCode:this.gameCode};return new Promise((n,l)=>{const a=h=>{const g=Me(h);ai(g)&&(this.removeEventListener("message",a),n(g.body))};this.addEventListener("message",a),this.request(e,s).catch(h=>{di(h.response)&&l(h),l(h)})})}sendAcknowledgement(e){const{name:s,cId:n}=e.header,l=this.buildHeader(s,n),a=this.buildPayload(l,{});this.send(a)}sendAction(e,s){const n=this.buildHeader("GameAction"),l={...this.getBodyExtras(e),data:s};return new Promise((a,h)=>{const g=p=>{const f=Me(p);oe(f)&&l.seqId===f.body.correlationSeqId&&(this.removeEventListener("message",g),ri(f)||ci(f)?a(f.body):oi(f)&&h(f.body))};this.addEventListener("message",g),this.request(n,l).catch(p=>{h(p)})})}spin(e){return this.sendAction("SPIN",e)}bgAction(e){return this.sendAction("BG_ACTION",e)}setRequestTimeoutMs(e){E(this,Z,e)}}Z=new WeakMap,ye=new WeakMap;class Ut{constructor(t){w(this,"config");this.config=t}on(t,e,s){const n=function(a){a.data.message!==`kalamba:wrapper-rgs:${t}`&&a.data.message!==`kalamba:wrapper:${t}`||e(a.data.payload)};window.addEventListener("message",n,s)}send(t,...[e]){window.postMessage({message:`kalamba:rgs:${t}`,payload:e})}}const hi={bul:"bg",chi:"zh",zho:"zh",hrv:"hr",cze:"cs",dan:"da",dut:"nl",eng:"en",est:"et",fin:"fi",fra:"fr",ger:"de",gre:"el",hun:"hu",ind:"id",ita:"it",jpn:"ja",kor:"ko",nor:"no",pol:"pl",por:"pt",rum:"ro",rus:"ru",srp:"sr",slo:"sk",spa:"es",swe:"sv",tha:"th",tur:"tr",ukr:"uk",vie:"vi"},gi=x("KalambaBullseyePlugin","color:#000000;font-weight:bold;");var Ee;class pi extends Ut{constructor(...e){super(...e);w(this,"socket");v(this,Ee,"");this.on("openGame",async()=>{try{const s=await this.openGame();this.send("openGameResponse",s)}catch(s){this.send("openGameError",s)}}),this.on("play",async s=>{try{const n=await this.play(s);this.send("playResponse",n)}catch(n){this.send("playError",n)}}),this.on("state",({version:s})=>{E(this,Ee,s)}),this.on("configured",s=>{this.socket.setRequestTimeoutMs(s.ui.requestTimeoutMs)}),this.registerFromSdkEvents()}initialize(e){this.socket=new ui(e,{gameVersion:y(this,Ee),requestTimeoutMs:this.config.ui.requestTimeoutMs}),this.socket.addEventListener("close",s=>{s.code===1006&&this.reconnect(e)}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this.socket.socket&&this.socket.socket.readyState!==WebSocket.OPEN&&this.reconnect(e)}),this.socket.addEventListener("error",s=>gi("error",s)),this.socket.addEventListener("realityCheck",s=>{this.send("realityCheck",s)})}async reconnect(e){this.initialize(e),await this.socket.connect(),await this.socket.authenticate(!0),await this.socket.openGame()}async openGame(){const e=new URLSearchParams(window.location.search),s=e.get("apiUrl"),n=e.get("cageCode"),l=e.get("gameCode"),a=e.get("operatorCode"),h=e.get("playMode"),g=e.get("token"),p=e.get("username"),f=e.get("gameHistoryUrl"),A=e.get("homeUrl")??void 0,D=e.get("cashierUrl")??void 0;this.initialize({apiUrl:s,cageCode:n,gameCode:l,operatorCode:a,playMode:h,token:g,username:p}),await this.socket.connect();const B=await this.socket.authenticate(),le=await this.socket.openGame();this.config.api={brand:n,game:l,integration:a,jurisdiction:B.jurisdictionCode,playMode:h,user:B.username,integrationData:{token:g},country:B.countryCode,currency:B.currencyCode,coinValueInCents:B.coinValueInCents,gameHistoryUrl:f,homeUrl:A,cashierUrl:D};const O=e.get("languageCode");return O&&(this.config.ui.language=O.length===3?hi[O]??O:O),le}play(e){if("userInput"in e&&e.userInput!=null)return this.socket.bgAction(e);if("opaqueGameAttributes"in e&&e.opaqueGameAttributes)return this.socket.spin(e);if("bet"in e&&e.bet){const{bet:s,...n}=e;return this.socket.spin({bet:{baseBet:s.base,betMultiplier:s.multiplier},...n})}}registerFromSdkEvents(){this.on("history",()=>{const{api:{game:e,integration:s,integrationData:n,jurisdiction:l,user:a,gameHistoryUrl:h},ui:{language:g}}=this.config,p=a.replace(/^user_/,"").replace(new RegExp(`_${s}$`),""),f=new URL(h);f.searchParams.set("gameCode",e),f.searchParams.set("jurisdiction",l),f.searchParams.set("operatorCode",s),f.searchParams.set("token",n.token),f.searchParams.set("username",p),f.searchParams.set("languageCode",g),window.open(f.toString(),"_blank")})}}Ee=new WeakMap;var wi="2.0.0-beta.2",re="",lt="?",Ke="function",H="undefined",ce="object",Je="string",fe="major",c="model",o="name",d="type",u="vendor",r="version",M="architecture",K="console",m="mobile",b="tablet",I="smarttv",X="wearable",Ye="embedded",ut="user-agent",Ze=500,it="brands",W="formFactor",st="fullVersionList",J="platform",nt="platformVersion",De="bitness",q="sec-ch-ua",mi=q+"-full-version-list",fi=q+"-arch",bi=q+"-"+De,yi=q+"-form-factor",Ei=q+"-"+m,vi=q+"-"+c,Lt=q+"-"+J,ki=Lt+"-version",_t=[it,st,m,c,J,nt,M,W,De],T="browser",U="cpu",R="device",L="engine",P="os",Y="result",Ce="Amazon",ge="Apple",ht="ASUS",gt="BlackBerry",Ie="Google",pt="Huawei",wt="Lenovo",qe="LG",Oe="Microsoft",mt="Motorola",Te="Samsung",ft="Sharp",Ae="Sony",We="Xiaomi",$e="Zebra",j="Mobile ",Q=" Browser",Pe="Chrome",Si="Edge",pe="Firefox",we="Opera",bt="Facebook",yt="Sogou",et="Windows",Mi=typeof window!==H,C=Mi&&window.navigator?window.navigator:void 0,G=C&&C.userAgentData?C.userAgentData:void 0,Ci=function(i,t){var e={};for(var s in i)e[s]=t[s]&&t[s].length%2===0?t[s].concat(i[s]):i[s];return e},Be=function(i){for(var t={},e=0;e<i.length;e++)t[i[e].toUpperCase()]=i[e];return t},tt=function(i,t){if(typeof i===ce&&i.length>0){for(var e in i)if(z(i[e])==z(t))return!0;return!1}return de(i)?z(t).indexOf(z(i))!==-1:!1},Et=function(i){for(var t in i)return/^(browser|cpu|device|engine|os)$/.test(t)},de=function(i){return typeof i===Je},je=function(i){if(i){for(var t=[],e=$(/\\?\"/g,i).split(","),s=0;s<e.length;s++)if(e[s].indexOf(";")>-1){var n=be(e[s]).split(";v=");t[s]={brand:n[0],version:n[1]}}else t[s]=be(e[s]);return t}},z=function(i){return de(i)?i.toLowerCase():i},Qe=function(i){return de(i)?$(/[^\d\.]/g,i).split(".")[0]:void 0},_=function(i){for(var t in i){var e=i[t];typeof e==ce&&e.length==2?this[e[0]]=e[1]:this[e]=void 0}return this},$=function(i,t){return de(t)?t.replace(i,re):t},me=function(i){return $(/\\?\"/g,i)},be=function(i,t){if(de(i))return i=$(/^\s\s*/,i),typeof t===H?i:i.substring(0,Ze)},vt=function(i,t){if(!(!i||!t))for(var e=0,s,n,l,a,h,g;e<t.length&&!h;){var p=t[e],f=t[e+1];for(s=n=0;s<p.length&&!h&&p[s];)if(h=p[s++].exec(i),h)for(l=0;l<f.length;l++)g=h[++n],a=f[l],typeof a===ce&&a.length>0?a.length===2?typeof a[1]==Ke?this[a[0]]=a[1].call(this,g):this[a[0]]=a[1]:a.length===3?typeof a[1]===Ke&&!(a[1].exec&&a[1].test)?this[a[0]]=g?a[1].call(this,g,a[2]):void 0:this[a[0]]=g?g.replace(a[1],a[2]):void 0:a.length===4&&(this[a[0]]=g?a[3].call(this,g.replace(a[1],a[2])):void 0):this[a]=g||void 0;e+=2}},Ue=function(i,t){for(var e in t)if(typeof t[e]===ce&&t[e].length>0){for(var s=0;s<t[e].length;s++)if(tt(t[e][s],i))return e===lt?void 0:e}else if(tt(t[e],i))return e===lt?void 0:e;return t.hasOwnProperty("*")?t["*"]:i},kt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},St={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:["VR","XR","Watch"],"?":["Desktop","Unknown"],"*":void 0},Mt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[r,[o,j+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[r,[o,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[o,r],[/opios[\/ ]+([\w\.]+)/i],[r,[o,we+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[r,[o,we+" GX"]],[/\bopr\/([\w\.]+)/i],[r,[o,we]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[r,[o,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[o,r],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[r,[o,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[r,[o,"WeChat"]],[/konqueror\/([\w\.]+)/i],[r,[o,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[r,[o,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[r,[o,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[r,[o,"Smart "+wt+Q]],[/(avast|avg)\/([\w\.]+)/i],[[o,/(.+)/,"$1 Secure"+Q],r],[/\bfocus\/([\w\.]+)/i],[r,[o,pe+" Focus"]],[/\bopt\/([\w\.]+)/i],[r,[o,we+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[r,[o,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[r,[o,"Dolphin"]],[/coast\/([\w\.]+)/i],[r,[o,we+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[r,[o,"MIUI"+Q]],[/fxios\/([\w\.-]+)/i],[r,[o,j+pe]],[/\bqihu|(qi?ho?o?|360)browser/i],[[o,"360"+Q]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[o,/(.+)/,"$1"+Q],r],[/samsungbrowser\/([\w\.]+)/i],[r,[o,Te+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[o,/_/g," "],r],[/metasr[\/ ]?([\d\.]+)/i],[r,[o,yt+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[o,yt+" Mobile"],r],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[o,r],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[o],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[o,bt],r],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[o,r],[/\bgsa\/([\w\.]+) .*safari\//i],[r,[o,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[r,[o,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[r,[o,Pe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[o,Pe+" WebView"],r],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[r,[o,"Android"+Q]],[/chrome\/([\w\.]+) mobile/i],[r,[o,j+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[o,r],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[r,[o,j+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[o,j+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[r,o],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[o,[r,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[o,r],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[o,j+pe],r],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[o,"Netscape"],r],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[r,[o,pe+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[o,r],[/(cobalt)\/([\w\.]+)/i],[o,[r,/[^\d\.]+./,re]]],cpu:[[/\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i],[[M,"amd64"]],[/(ia32(?=;))/i,/((?:i[346]|x)86)[;\)]/i],[[M,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[M,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[M,"armhf"]],[/windows (ce|mobile); ppc;/i],[[M,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[M,/ower/,re,z]],[/(sun4\w)[;\)]/i],[[M,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[M,z]]],device:[[/\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],[c,[u,Te],[d,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[c,[u,Te],[d,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[c,[u,ge],[d,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[u,ge],[d,b]],[/(macintosh);/i],[c,[u,ge]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[u,ft],[d,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[u,pt],[d,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[u,pt],[d,m]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[c,/_/g," "],[u,We],[d,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[u,We],[d,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[u,"OPPO"],[d,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[u,"Vivo"],[d,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[c,[u,"Realme"],[d,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[c,[u,mt],[d,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[u,mt],[d,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[u,qe],[d,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[u,qe],[d,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[u,wt],[d,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[u,"Nokia"],[d,m]],[/(pixel c)\b/i],[c,[u,Ie],[d,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[u,Ie],[d,m]],[/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],[c,[u,Ae],[d,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[u,Ae],[d,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[u,"OnePlus"],[d,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[u,Ce],[d,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[u,Ce],[d,m]],[/(playbook);[-\w\),; ]+(rim)/i],[c,u,[d,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[u,gt],[d,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[u,ht],[d,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[u,ht],[d,m]],[/(nexus 9)/i],[c,[u,"HTC"],[d,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[c,/_/g," "],[d,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[u,"Acer"],[d,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[u,"Meizu"],[d,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[c,[u,"Ulefone"],[d,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[u,c,[d,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[u,c,[d,b]],[/(surface duo)/i],[c,[u,Oe],[d,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[u,"Fairphone"],[d,m]],[/(shield[\w ]+) b/i],[c,[u,"Nvidia"],[d,b]],[/(sprint) (\w+)/i],[u,c,[d,m]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[u,Oe],[d,m]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[u,$e],[d,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[u,$e],[d,m]],[/smart-tv.+(samsung)/i],[u,[d,I]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[u,Te],[d,I]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,qe],[d,I]],[/(apple) ?tv/i],[u,[c,ge+" TV"],[d,I]],[/crkey/i],[[c,Pe+"cast"],[u,Ie],[d,I]],[/droid.+aft(\w+)( bui|\))/i],[c,[u,Ce],[d,I]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[u,ft],[d,I]],[/(bravia[\w ]+)( bui|\))/i],[c,[u,Ae],[d,I]],[/(mitv-\w{5}) bui/i],[c,[u,We],[d,I]],[/Hbbtv.*(technisat) (.*);/i],[u,c,[d,I]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,be],[c,be],[d,I]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,I]],[/(ouya)/i,/(nintendo) (\w+)/i],[u,c,[d,K]],[/droid.+; (shield) bui/i],[c,[u,"Nvidia"],[d,K]],[/(playstation \w+)/i],[c,[u,Ae],[d,K]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[u,Oe],[d,K]],[/((pebble))app/i],[u,c,[d,X]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[u,ge],[d,X]],[/droid.+; (glass) \d/i],[c,[u,Ie],[d,X]],[/droid.+; (wt63?0{2,3})\)/i],[c,[u,$e],[d,X]],[/(quest( 2| pro)?)/i],[c,[u,bt],[d,X]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[d,Ye]],[/(aeobc)\b/i],[c,[u,Ce],[d,Ye]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[c,[d,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[d,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,m]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[r,[o,Si+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[r,[o,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[o,r],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[r,o]],os:[[/microsoft (windows) (vista|xp)/i],[o,r],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[o,[r,Ue,kt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[r,Ue,kt],[o,et]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[r,/_/g,"."],[o,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[o,"macOS"],[r,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[r,o],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[o,r],[/\(bb(10);/i],[r,[o,gt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[r,[o,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[r,[o,pe+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[r,[o,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[r,[o,"watchOS"]],[/crkey\/([\d\.]+)/i],[r,[o,Pe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[o,"Chrome OS"],r],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([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,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[o,r],[/(sunos) ?([\w\.\d]*)/i],[[o,"Solaris"],r],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[o,r]]},Re=function(){var i={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return _.call(i.init,[[T,[o,r,fe]],[U,[M]],[R,[d,c,u]],[L,[o,r]],[P,[o,r]]]),_.call(i.isIgnore,[[T,[r,fe]],[L,[r]],[P,[r]]]),_.call(i.isIgnoreRgx,[[T,/ ?browser$/i],[P,/ ?os$/i]]),_.call(i.toString,[[T,[o,r]],[U,[M]],[R,[u,c]],[L,[o,r]],[P,[o,r]]]),i}(),Ii=function(i,t){var e=Re.init[t],s=Re.isIgnore[t]||0,n=Re.isIgnoreRgx[t]||0,l=Re.toString[t]||0;function a(){_.call(this,e)}return a.prototype.getItem=function(){return i},a.prototype.withClientHints=function(){return G?G.getHighEntropyValues(_t).then(function(h){return i.setCH(new Ft(h,!1)).parseCH().get()}):i.parseCH().get()},a.prototype.withFeatureCheck=function(){return i.detectFeature().get()},t!=Y&&(a.prototype.is=function(h){var g=!1;for(var p in this)if(this.hasOwnProperty(p)&&!tt(s,p)&&z(n?$(n,this[p]):this[p])==z(n?$(n,h):h)){if(g=!0,h!=H)break}else if(h==H&&g){g=!g;break}return g},a.prototype.toString=function(){var h=re;for(var g in l)typeof this[l[g]]!==H&&(h+=(h?" ":re)+this[l[g]]);return h||H}),G||(a.prototype.then=function(h){var g=this,p=function(){for(var A in g)g.hasOwnProperty(A)&&(this[A]=g[A])};p.prototype={is:a.prototype.is,toString:a.prototype.toString};var f=new p;return h(f),f}),new a};function Ft(i,t){if(i=i||{},_.call(this,_t),t)_.call(this,[[it,je(i[q])],[st,je(i[mi])],[m,/\?1/.test(i[Ei])],[c,me(i[vi])],[J,me(i[Lt])],[nt,me(i[ki])],[M,me(i[fi])],[W,je(i[yi])],[De,me(i[bi])]]);else for(var e in i)this.hasOwnProperty(e)&&typeof i[e]!==H&&(this[e]=i[e])}function Ct(i,t,e,s){return this.get=function(n){return n?this.data.hasOwnProperty(n)?this.data[n]:void 0:this.data},this.set=function(n,l){return this.data[n]=l,this},this.setCH=function(n){return this.uaCH=n,this},this.detectFeature=function(){if(C&&C.userAgent==this.ua)switch(this.itemType){case T:C.brave&&typeof C.brave.isBrave==Ke&&this.set(o,"Brave");break;case R:!this.get(d)&&G&&G[m]&&this.set(d,m),this.get(c)=="Macintosh"&&C&&typeof C.standalone!==H&&C.maxTouchPoints&&C.maxTouchPoints>2&&this.set(c,"iPad").set(d,b);break;case P:!this.get(o)&&G&&G[J]&&this.set(o,G[J]);break;case Y:var n=this.data,l=function(a){return n[a].getItem().detectFeature().get()};this.set(T,l(T)).set(U,l(U)).set(R,l(R)).set(L,l(L)).set(P,l(P))}return this},this.parseUA=function(){return this.itemType!=Y&&vt.call(this.data,this.ua,this.rgxMap),this.itemType==T&&this.set(fe,Qe(this.get(r))),this},this.parseCH=function(){var n=this.uaCH,l=this.rgxMap;switch(this.itemType){case T:var a=n[st]||n[it],h;if(a)for(var g in a){var p=$(/(Google|Microsoft) /,a[g].brand||a[g]),f=a[g].version;!/not.a.brand/i.test(p)&&(!h||/chrom/i.test(h)&&!/chromi/i.test(p))&&(this.set(o,p).set(r,f).set(fe,Qe(f)),h=p)}break;case U:var A=n[M];A&&(A&&n[De]=="64"&&(A+="64"),vt.call(this.data,A+";",l));break;case R:if(n[m]&&this.set(d,m),n[c]&&this.set(c,n[c]),n[c]=="Xbox"&&this.set(d,K).set(u,Oe),n[W]){var D;if(typeof n[W]!="string")for(var B=0;!D&&B<n[W].length;)D=Ue(n[W][B++],St);else D=Ue(n[W],St);this.set(d,D)}break;case P:var le=n[J];if(le){var O=n[nt];le==et&&(O=parseInt(Qe(O),10)>=13?"11":"10"),this.set(o,le).set(r,O)}this.get(o)==et&&n[c]=="Xbox"&&this.set(o,"Xbox").set(r,void 0);break;case Y:var Bt=this.data,ue=function(Gt){return Bt[Gt].getItem().setCH(n).parseCH().get()};this.set(T,ue(T)).set(U,ue(U)).set(R,ue(R)).set(L,ue(L)).set(P,ue(P))}return this},_.call(this,[["itemType",i],["ua",t],["uaCH",s],["rgxMap",e],["data",Ii(this,i)]]),this}function F(i,t,e){if(typeof i===ce?(Et(i)?(typeof t===ce&&(e=t),t=i):(e=i,t=void 0),i=void 0):typeof i===Je&&!Et(t)&&(e=t,t=void 0),!(this instanceof F))return new F(i,t,e).getResult();var s=typeof i===Je?i:C&&C.userAgent?C.userAgent:e&&e[ut]?e[ut]:re,n=new Ft(e,!0),l=t?Ci(Mt,t):Mt,a=function(h){return h==Y?function(){return new Ct(h,s,l,n).set("ua",s).set(T,this.getBrowser()).set(U,this.getCPU()).set(R,this.getDevice()).set(L,this.getEngine()).set(P,this.getOS()).get()}:function(){return new Ct(h,s,l[h],n).parseUA().get()}};return _.call(this,[["getBrowser",a(T)],["getCPU",a(U)],["getDevice",a(R)],["getEngine",a(L)],["getOS",a(P)],["getResult",a(Y)],["getUA",function(){return s}],["setUA",function(h){return de(h)&&(s=h.length>Ze?be(h,Ze):h),this}]]).setUA(s),this}F.VERSION=wi;F.BROWSER=Be([o,r,fe]);F.CPU=Be([M]);F.DEVICE=Be([c,u,d,K,m,I,b,X,Ye]);F.ENGINE=F.OS=Be([o,r]);class Dt{constructor(t,e){w(this,"trackers");w(this,"config");this.trackers=t,this.config=e}on(t,e,s){const n=function(a){a.data.message!==`kalamba:wrapper-telemetry:${t}`&&a.data.message!==`kalamba:wrapper:${t}`||e(a.data.payload)};window.addEventListener("message",n,s)}track(t,e){this.trackers.forEach(s=>s.track(t,e))}}function It(i){return i.reduce((t,e)=>t+e,0)}function Ti(i){const t=i.length,e=It(i)/t,s=i.map(l=>Math.pow(l-e,2)),n=It(s)/t;return Math.sqrt(n)}class Tt{constructor(){w(this,"rafId",-1);w(this,"startTime",0);w(this,"stopTime",0);w(this,"frames",[]);w(this,"calculateFPS",()=>{const t=Math.floor((this.stopTime-this.startTime)/1e3);return this.frames.map(e=>Math.floor((e-this.startTime)/1e3)).reduce((e,s,n,l)=>(l[n]!==l[n-1]?e.push(1):e[e.length-1]++,e),[]).slice(0,t)});w(this,"getReport",()=>{const t=this.calculateFPS(),e=Math.floor(this.frames.length/((this.stopTime-this.startTime)/1e3)),s=t.length>0?Math.max(...t):e,n=t.length>0?Math.min(...t):e,l=t.length>0?Ti(t):0;return{fpsAvg:e,fpsMax:s,fpsMin:n,fpsStdDev:l}});w(this,"start",()=>{this.startTime=Date.now(),this.trackFrames()});w(this,"stop",()=>{cancelAnimationFrame(this.rafId),this.stopTime=Date.now()});w(this,"trackFrames",()=>{this.frames.push(Date.now()),this.rafId=requestAnimationFrame(this.trackFrames)})}}const Ai="landscape",Pi="portrait";function Ri(){try{const i=document.createElement("canvas");return!!window.WebGLRenderingContext&&(i.getContext("webgl")||i.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function xi(){if(!window.createImageBitmap)return!1;const e=await(await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();try{return await createImageBitmap(e),!0}catch{return!1}}function Xe(){return window.innerWidth>=window.innerHeight?Ai:Pi}var Le,ee,te,ie,ve,_e,ke,Fe;class Oi extends Dt{constructor(...e){super(...e);w(this,"FPS_SAMPLE_INTERVAL",1e4);v(this,Le,0);v(this,ee,"");v(this,te,void 0);v(this,ie,void 0);v(this,ve,!1);v(this,_e,!1);v(this,ke,"");v(this,Fe,[]);E(this,te,{}),E(this,ie,this.deviceInfo()),this.on("state",({balance:s,version:n})=>{E(this,ee,n),E(this,Le,s)}),this.on("autoplay",({action:s})=>{["start","resume"].includes(s)?E(this,ve,!0):E(this,ve,!1)}),this.on("settings",({fastPlay:s})=>{s!==void 0&&E(this,_e,s)}),this.registerEvents()}async registerEvents(){y(this,ie).then(e=>{this.track("Device Information",e)}),this.on("loadStart",()=>{this.track("Game Loading",{progress:0,step:"initial"})}),this.on("loadProgress",e=>{this.track("Game Loading",{progress:e.progress})}),this.on("loadEnd",()=>{this.track("Game Loading",{progress:100,step:"complete"})}),this.on("error",e=>{this.track("System Message",{systemMessageText:e.messageKey,systemMessageType:e.type})}),this.on("openGameResponse",async e=>{E(this,ke,e.data.gameState.stateTypeNextRound),E(this,te,{balanceInCoins:e.balance,clientVersion:y(this,ee),coinValueInCents:this.config.api.coinValueInCents,coinValueInCentsFloat:this.config.api.coinValueInCents,currency:this.config.api.currency,defaultBaseBet:e.data.additionalConfigData.defaultBet.baseBet,defaultBetMultiplier:e.data.additionalConfigData.defaultBet.betMultiplier,environment:"release",gameCode:this.config.api.game,gameCodeServer:this.config.api.game,gameModelFile:e.data.additionalConfigData.gameModelFile,jurisdiction:this.config.api.jurisdiction,languageCode:this.config.ui.language,operatorName:"kalamba",partnerId:this.config.api.brand,partnerParentId:this.config.api.integration,platform:"WEB",playMode:this.config.api.playMode,referrer:window.location.hostname,serverVersion:e.data.gameConfigData.metaData.version}),this.track("Game Open",y(this,te))}),this.on("playCycleEnd",async e=>{const s=await y(this,ie),{baseBet:n,betMultiplier:l,specialAction:a}=e.data.gameState.lastPlacedMainGameBet??{},h=e.balance,g=e.data.gameState.totalBetFromCurrentGameCycle,p=e.data.gameState.totalWinFromCurrentGameCycle,f=p-g,A=a||"spin",D=e.data.gameState.cycleId;this.track("Betting Activity",{balance:h-f,balanceAfter:h,baseBet:n,betMultiplier:l,betType:A,gameVersion:y(this,ee),coinValueInCents:this.config.api.coinValueInCents,coinValueInCentsFloat:this.config.api.coinValueInCents,currency:this.config.api.currency,environment:"release",gameCode:this.config.api.game,gameCodeServer:this.config.api.game,isMobile:s.isMobile,netResult:f,operatorName:"kalamba",orientation:Xe(),partnerId:this.config.api.brand,partnerParentId:this.config.api.integration,platform:"WEB",playMode:this.config.api.playMode,roundId:D,roundTypes:["BaseGame"],totalBet:g,totalWin:p}),E(this,Fe,[])}),this.on("telemetry.click",e=>{this.track("UI Interaction",{action:"click",...this.getExtraUiInteractionData(),...e})}),this.on("telemetry.orientationChange",()=>{this.track("UI Interaction",{action:"orientationChange",...this.getExtraUiInteractionData()})}),this.reportFpsSample(),this.reportFpsRound()}reportFpsSample(){const e=new Tt,s=()=>{e.stop();const l=e.getReport();this.track("FPS Performance",{...l,fpsType:"sample"}),n()},n=async()=>{e.start(),setTimeout(s,this.FPS_SAMPLE_INTERVAL)};n()}reportFpsRound(){const e=new Tt;this.on("playCycleStart",()=>{e.start()}),this.on("playCycleEnd",()=>{e.stop();const s=e.getReport();this.track("FPS Performance",{...s,fpsType:"playCycleStart->playCycleEnd"})})}getExtraUiInteractionData(){return{orientation:Xe(),stateType:y(this,ke)}}async deviceInfo(){var g;const e=new F(navigator.userAgent),s=Ri(),n=await xi(),l=e.getBrowser(),a=e.getDevice(),h=e.getOS();return{browserName:l.name,browserVersion:l.version,connection:(g=navigator.connection)==null?void 0:g.effectiveType,deviceName:a.model,deviceType:a.type,isMobile:["mobile","tablet"].includes(a.type??""),isWebGLSupported:s,isWebPSupported:n,manufacturer:a.vendor,operatingSystem:h.name,operatingSystemVersion:h.version,orientation:Xe(),pixelRatio:window.devicePixelRatio,screenHeight:window.screen.height,screenSize:`${window.screen.width}x${window.screen.height}`,screenWidth:window.screen.width,timezoneOffsetMinutes:new Date().getTimezoneOffset(),windowHeight:window.innerHeight,windowSize:`${window.innerWidth}x${window.innerHeight}`,windowWidth:window.innerWidth}}}Le=new WeakMap,ee=new WeakMap,te=new WeakMap,ie=new WeakMap,ve=new WeakMap,_e=new WeakMap,ke=new WeakMap,Fe=new WeakMap;let xe;const Ui=new Uint8Array(16);function Li(){if(!xe&&(xe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xe(Ui)}const S=[];for(let i=0;i<256;++i)S.push((i+256).toString(16).slice(1));function _i(i,t=0){return S[i[t+0]]+S[i[t+1]]+S[i[t+2]]+S[i[t+3]]+"-"+S[i[t+4]]+S[i[t+5]]+"-"+S[i[t+6]]+S[i[t+7]]+"-"+S[i[t+8]]+S[i[t+9]]+"-"+S[i[t+10]]+S[i[t+11]]+S[i[t+12]]+S[i[t+13]]+S[i[t+14]]+S[i[t+15]]}const Fi=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),At={randomUUID:Fi};function Pt(i,t,e){if(At.randomUUID&&!t&&!i)return At.randomUUID();i=i||{};const s=i.random||(i.rng||Li)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,t){e=e||0;for(let n=0;n<16;++n)t[e+n]=s[n];return t}return _i(s)}class at{constructor(t){w(this,"config");this.config=t}}const Rt=25,xt=1e4;var se,ne,ae,N,Se;class Di extends at{constructor(...e){super(...e);v(this,se,"https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");v(this,ne,void 0);v(this,ae,void 0);v(this,N,[]);v(this,Se,void 0);w(this,"processQueueForced");E(this,ne,new Date().getTime()),E(this,N,[]),E(this,Se,Pt()),this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(y(this,se),{method:"OPTIONS"}).catch(rt.noop),this.subscribe()}subscribe(){window.addEventListener("beforeunload",this.processQueueForced,!1),window.addEventListener("pagehide",this.processQueueForced,!1),window.addEventListener("visibilitychange",this.processQueueForced,!1)}schedule(){y(this,ae)&&clearTimeout(y(this,ae)),E(this,ae,window.setTimeout(()=>this.processQueue(),xt))}send(e){E(this,ne,new Date().getTime());try{navigator.sendBeacon(y(this,se),JSON.stringify(e))}catch{fetch(y(this,se),{body:JSON.stringify(e),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(rt.noop)}this.schedule()}addToQueue(e){y(this,N).push(e),this.processQueue()}processQueue(e=!1){if(!(this.config==null||!this.config.ui.feature.allowTelemetry)&&!(!e&&y(this,N).length<Rt&&new Date().getTime()-y(this,ne)<xt))for(;y(this,N).length;){const s=y(this,N).splice(0,Rt).map(n=>({...n,sessionID:y(this,Se),userID:this.config.api.user}));this.send(s)}}track(e,s){this.addToQueue({eventName:e,eventParams:s,eventTimestamp:new Date().getTime(),eventUUID:Pt()})}}se=new WeakMap,ne=new WeakMap,ae=new WeakMap,N=new WeakMap,Se=new WeakMap;const Bi=x("LoggingTracker","color:#000000;font-weight:bold;");class Gi extends at{track(t,e){Bi(`@${this.config.api.user}`,`[${t}]`,e)}}exports.BasicPlugin=qt;exports.CasinoPlugin=V;exports.DebuggingPlugin=$t;exports.GigPlugin=Qt;exports.KalambaBullseyePlugin=pi;exports.KalambaStargazerPlugin=Oi;exports.KalambaStargazerTracker=Di;exports.LoggingTracker=Gi;exports.OryxPlugin=Kt;exports.PariplayPlugin=ei;exports.RelaxFEIMPlugin=ti;exports.RgsPlygin=Ut;exports.TelemetryPlugin=Dt;exports.Tracker=at;exports.TukoPlugin=si;
|
|
5
|
+
"use strict";var Nt=Object.defineProperty;var Ht=(i,t,e)=>t in i?Nt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var w=(i,t,e)=>(Ht(i,typeof t!="symbol"?t+"":t,e),e),ot=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var y=(i,t,e)=>(ot(i,t,"read from private field"),e?e.call(i):t.get(i)),v=(i,t,e)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)},E=(i,t,e,s)=>(ot(i,t,"write to private field"),s?s.call(i,e):t.set(i,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rt=require("./noop-b3c54b76.cjs");function x(i,t){return(e,...s)=>{console.log(`[%c${i}\x1B[m] %s`,t,e,...s)}}class V{constructor(t){w(this,"config");this.config=t}on(t,e,s){const n=function(a){a.data.message!==`kalamba:wrapper-casino:${t}`&&a.data.message!==`kalamba:wrapper:${t}`||e(a.data.payload)};window.addEventListener("message",n,s)}send(t,...[e]){window.postMessage({message:`kalamba:casino:${t}`,payload:e})}}function zt(i,t){return Math.round(i*100/t)}const Vt=x("BasicPlugin","color:#000000;font-weight:bold;");class qt extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Vt("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,payload:s}=t.data;switch(e){case"doAudioSettings":this.send("settings",{music:s==null?void 0:s.musicEnabled,sounds:s==null?void 0:s.soundEnabled});return;case"doBalanceUpdate":const{currency:n,coinValueInCents:c}=this.config.api;s.currency===n&&typeof s.balanceInCurrency=="number"?this.send("balance",{balance:zt(s.balanceInCurrency,c)}):(s.balanceInCoins,this.send("balance",{balance:s.balanceInCoins}));return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}const k=x("▼ DebuggingPlugin IN ▼","color:#444444;font-weight:bold;"),Wt=x("▲ DebuggingPlugin OUT ▲","color:#444444;font-weight:bold;");class $t extends V{constructor(...t){super(...t),this.registerDebugToSdkEvents(),this.registerSdkToDebugEvents()}registerDebugToSdkEvents(){window.DebuggingPlugin={balance:t=>this._send("balance",t),bet:t=>this._send("bet",t),choice:t=>this._send("choice",t),close:t=>this._send("close",t),help:t=>this._send("help",t),history:t=>this._send("history",t),freeze:t=>this._send("freeze",t),paytable:t=>this._send("paytable",t),settings:t=>this._send("settings",t),suspend:t=>this._send("suspend",t),unfreeze:t=>this._send("unfreeze",t)}}registerSdkToDebugEvents(){this.on("autoplay",t=>k("autoplay",t)),this.on("balance",t=>k("balance",t)),this.on("bet",t=>k("bet",t)),this.on("cashier",t=>k("cashier",t)),this.on("choice",t=>k("choice",t)),this.on("close",t=>k("close",t)),this.on("error",t=>k("error",t)),this.on("loadEnd",t=>k("loadEnd",t)),this.on("loadProgress",t=>k("loadProgress",t)),this.on("loadStart",t=>k("loadStart",t)),this.on("playCycleStart",t=>k("playCycleStart",t)),this.on("playCycleEnd",t=>k("playCycleEnd",t)),this.on("playEnd",t=>k("playEnd",t)),this.on("playError",t=>k("playError",t)),this.on("playReady",t=>k("playReady",t)),this.on("playStart",t=>k("playStart",t)),this.on("settings",t=>k("settings",t))}_send(...t){Wt(...t),this.send(...t)}}const jt=x("GigPlugin","color:#000000;font-weight:bold;");class Qt extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),jt("configured")}postMessage(t){const e={event:t};window.top.postMessage(e,"*")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{data:e}=t;switch(e){case"STOP_AUTO_PLAY":this.send("suspend");return;case"BLOCK_BETS":this.send("freeze");return;case"UNBLOCK_BETS":this.send("unfreeze");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}}),this.on("playReady",()=>{this.postMessage("GAME_READY")})}}const Xt=x("OryxPlugin","color:#000000;font-weight:bold;");class Kt extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Xt("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,param:s}=t.data;switch(e){case"doBalanceUpdate":this.send("balance",{balance:s});return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){let t=0;this.on("close",()=>{window.top.postMessage({wpgaction:"close"},"*"),window.parent.postMessage({wpgaction:"close.parent"},"*")}),this.on("balance",({balance:e})=>{t!==e&&(t=e,window.top.postMessage({param:{},wpgaction:"balance"},"*"),window.parent.postMessage({param:{},wpgaction:"balance.parent"},"*"))}),this.on("loadStart",()=>{window.top.postMessage({wpgaction:"loadStart"},"*"),window.parent.postMessage({wpgaction:"loadStart.parent"},"*")}),this.on("loadEnd",()=>{window.top.postMessage({wpgaction:"loadEnd"},"*"),window.parent.postMessage({wpgaction:"loadEnd.parent"},"*")}),this.on("playStart",()=>{window.top.postMessage({wpgaction:"gameSpinStart"},"*"),window.parent.postMessage({wpgaction:"gameSpinStart.parent"},"*")}),this.on("playEnd",()=>{window.top.postMessage({wpgaction:"gameSpinEnd"},"*"),window.parent.postMessage({wpgaction:"gameSpinEnd.parent"},"*")}),this.on("cashier",({type:e})=>{switch(e){case"BALANCE_LOW":window.top.postMessage({wpgaction:"cashier"},"*"),window.parent.postMessage({wpgaction:"cashier.parent"},"*");break;case"BALANCE_INSUFFICIENT":window.top.postMessage({wpgaction:"errorOutOfMoney"},"*"),window.parent.postMessage({wpgaction:"errorOutOfMoney.parent"},"*");break}})}}const ct=x("PariplayPlugin","color:#000000;font-weight:bold;");function Ge(i){try{window.top.location=i}catch{window.location=i}}function Ne(i,t){return new Promise(function(s,n){const c=new XMLHttpRequest;c.onload=function(){c.status>=200&&c.status<300?s(c.responseText):n(c.responseText)},c.open(i,t),c.send()})}function He(){}function Jt(i){return i.filter(function(e){return e.messageType.toUpperCase()==="DATA"})}function ze(i){return i.filter(function(e){return["NOTIFICATION","POPUP"].includes(e.messageType.toUpperCase())})}function Ut(i){try{return JSON.parse(i.text)}catch{return{}}}function Yt(i){return i.map(Ut).filter(Boolean).find(function(e){return e.betId!=null&&e.winId!=null})||{}}function Zt(i){return i.map(Ut).filter(Boolean).find(function(e){return e.TotalBet!=null&&e.TotalWin!=null})||{}}class ei extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),ct("configured")}postMessage(t,e){const s={lang:this.config.ui.language,sender:this.config.api.game,type:t};e!=null&&(s.data=e),ct("postMessage",s),window.parent.postMessage(s,"*")}coinsToCurrency(t){return t*this.config.api.coinValueInCents/100}handleContinueButton(t,e){t.link&&Ne("GET",t.link),e()}handleLinkButton(t,e){switch(t.linkType.toUpperCase()){case"AJAX":Ne("GET",t.link),e();return;case"AJAXRESPONSE":Ne("GET",t.link).then(()=>{e()});return;case"REDIRECT":Ge(t.link),e();return}}handleQuitButton(t,e){this.send("close"),e()}handleCashierButton(t,e){this.send("cashier",{type:"ON_DEMAND"}),e()}handleHistoryButton(t,e){this.send("history",{source:"casino"}),e()}get buttonActions(){return{CASHIER:this.handleCashierButton,CONTINUE:this.handleContinueButton,HISTORY:this.handleHistoryButton,LINK:this.handleLinkButton,QUIT:this.handleQuitButton}}processInfoUiMessages(t){return t.reduce((e,s)=>e.then(()=>new Promise(n=>{Object.assign({},s,{buttons:s.buttons.filter(c=>c.action.toUpperCase()==="CASHIER"?!!this.config.api.cashierUrl:!0).map(c=>Object.assign({},c,{onRelease:()=>{const a=s.messageType.toUpperCase()==="POPUP"?He:n,h=this.buttonActions[c.action.toUpperCase()];h?h(c,a):a()}}))})}).catch(He)),Promise.resolve()).then(()=>{}).catch(He)}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e}=t.data;switch(e){case"pause":case"disableSpin":this.send("freeze");return;case"resume":case"enableSpin":this.send("unfreeze");return;case"stopAutobet":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){let t=0;this.on("openGameResponse",e=>{let s;try{const n=JSON.parse(JSON.parse(atob(this.config.api.integrationData.token.split(".")[1])).token),c=JSON.parse(n.integrationSpecificAttributes.sessionData||"{}");s={ClientToken:n.integrationSpecificAttributes.clientToken,CurrencyCode:n.currency,PlayerTokenId:n.user,SessionData:c}}catch{s=void 0}this.postMessage("gameDataLoaded",{LoadGameData:s,success:!0});try{const n=ze(e.data.uiMessages);this.processInfoUiMessages(n)}catch{}}),this.on("balance",({balance:e})=>{t!==e&&(t=e,this.postMessage("balance",{amount:this.coinsToCurrency(e)}))}),this.on("close",()=>{if(this.config.api.homeUrl)if(this.config.api.homeUrl==="(back)")try{window.top.history.back()}catch{window.history.back()}else this.config.api.homeUrl==="(api)"?this.postMessage("quit"):Ge(this.config.api.homeUrl)}),this.on("playEnd",e=>{this.postMessage("roundEnded",{balanceAfter:this.coinsToCurrency(e.balance),win:this.coinsToCurrency(e.data.gameRoundResult.win)});try{const s=ze(e.data.uiMessages);this.processInfoUiMessages(s)}catch{}}),this.on("playError",e=>{this.postMessage("ticketReceived",{ErrorCode:e.data.data.data.operatorSpecificErrorCode,ErrorMessage:e.data.data.data.operatorSpecificErrorMessage,Status:{ErrCode:e.data.data.data.operatorSpecificErrorCode}})}),this.on("playResponse",e=>{this.postMessage("roundStarted",{balanceBefore:this.coinsToCurrency(e.balance+e.data.gameState.totalBetFromCurrentGameCycle)});const s=e.data.gameState.stateTypeThisRound==="BaseGame",n=Jt(e.data.uiMessages),c=ze(e.data.uiMessages),a=Yt(n),h=Zt(n);this.postMessage("ticketReceived",{Balance:this.coinsToCurrency(e.balance),BetAmount:s?this.coinsToCurrency(e.data.gameState.totalBetFromCurrentGameCycle):0,CreditTransactionId:a.betId,DebitTransactionId:a.winId,Message:c,SessionData:h,Status:{ErrCode:0},WinAmount:this.coinsToCurrency(e.data.gameRoundResult.win)})}),this.on("playStart",e=>{e.bet&&this.postMessage("roundStart",{totalBet:this.coinsToCurrency(e.bet.base*e.bet.multiplier)})}),this.on("loadEnd",()=>{this.postMessage("gameReady")}),this.on("loadStart",()=>{this.postMessage("onAppFrameReady")}),this.on("cashier",()=>{this.config.api.cashierUrl&&(this.config.api.cashierUrl==="(api)"?this.postMessage("cashier"):Ge(this.config.api.cashierUrl))})}}const he=x("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class ti extends V{constructor(...e){super(...e);w(this,"VERSION","1.15.0");const s=document.createElement("script");s.src=`https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`,s.onload=()=>{he("loaded"),window.FEIM.configure({p2pConfig:{currency:this.config.api.currency,launchParams:{homeurl:"homeUrl"}}}),he("configured"),this.registerToSdkEvents(),this.registerFromSdkEvents()},document.body.appendChild(s)}registerToSdkEvents(){window.FEIM.on.errorMessageDismissed(()=>this.send("unfreeze")),window.FEIM.on.errorMessageDisplayed(()=>this.send("freeze")),window.FEIM.on.exitingGame(()=>he("!!! NOT IMPLEMENTED: exitingGame !!!")),window.FEIM.on.freeze(()=>this.send("freeze")),window.FEIM.on.initialized(()=>he("!!! NOT IMPLEMENTED: initialized !!!")),window.FEIM.on.pauseAutoPlay(()=>this.send("suspend")),window.FEIM.on.refreshBalance(()=>he("!!! NOT IMPLEMENTED: refreshBalance !!!")),window.FEIM.on.toggleGameHelp(()=>{this.send("help",{})}),window.FEIM.on.togglePaytable(()=>{this.send("paytable",{})}),window.FEIM.on.unfreeze(()=>this.send("unfreeze")),window.FEIM.on.updateSettings(({payload:[e]})=>this.send("settings",{sounds:e.sounds,fastPlay:e.fastPlay}))}registerFromSdkEvents(){this.on("autoplay",({action:e})=>{switch(e){case"start":window.FEIM.send.autoPlayStarted();break;case"stop":window.FEIM.send.autoPlayFinished();break}}),this.on("balance",({balance:e})=>{window.FEIM.send.balanceUpdate(e)}),this.on("bet",({base:e,multiplier:s})=>{window.FEIM.send.betUpdate(e*s)}),this.on("error",({message:e})=>{window.FEIM.send.errorMessage(e)}),this.on("close",()=>{window.FEIM.send.exitGame()}),this.on("loadEnd",()=>{window.FEIM.send.gameLoadCompleted()}),this.on("loadProgress",({progress:e})=>{window.FEIM.send.gameLoadProgress(e)}),this.on("loadStart",()=>{window.FEIM.send.gameLoadStarted()}),this.on("cashier",()=>{window.FEIM.send.openQuickDeposit()}),this.on("playCycleEnd",e=>{const s={balance:e.balance,bet:e.data.gameState.totalBetFromCurrentGameCycle,win:{win:e.data.gameState.totalWinFromCurrentGameCycle}};window.FEIM.send.roundFinished(s)}),this.on("playResponse",e=>{const s={balance:e.balance,playResponse:e.data};window.FEIM.send.roundStarted(s)}),this.on("history",()=>{window.FEIM.send.showHistory()}),this.on("settings",e=>{window.FEIM.send.updateSettings(e)})}}function ii(i,t){return Math.round(i*100/t)}const Ve=x("TukoPlugin","color:#000000;font-weight:bold;");class si extends V{constructor(...e){super(...e);w(this,"PING_INTERVAL",1e4);const n=new URLSearchParams(window.location.search).get("pingCallbackUrl");n&&window.setInterval(()=>{this.ping(n)},this.PING_INTERVAL),this.registerToSdkEvents(),this.registerFromSdkEvents(),Ve("configured")}ping(e){const s=new XMLHttpRequest;s.onreadystatechange=function(){s.readyState===XMLHttpRequest.DONE&&(s.status===0||s.status>=200&&s.status<400?Ve("ping ok",s):Ve("ping error",s))},s.open("GET",e),s.send()}registerToSdkEvents(){window.addEventListener("message",e=>{try{const{type:s,payload:n}=e.data;switch(s){case"doAudioSettings":this.send("settings",{music:n==null?void 0:n.musicEnabled,sounds:n==null?void 0:n.soundEnabled});return;case"doBalanceUpdate":const{currency:c,coinValueInCents:a}=this.config.api;n.currency===c&&typeof n.balanceInCurrency=="number"?this.send("balance",{balance:ii(n.balanceInCurrency,a)}):(n.balanceInCoins,this.send("balance",{balance:n.balanceInCoins}));return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}class ni{constructor(t){w(this,"socket",null);w(this,"webSocketUrl");w(this,"eventListeners",{close:[],error:[],message:[]});w(this,"connect",()=>{const t=new WebSocket(this.webSocketUrl);return t.addEventListener("message",this.handleMessage),new Promise(e=>{t.addEventListener("open",s=>{this.handleOpen(s),e(this.socket)})})});w(this,"send",t=>{if(this.socket==null)throw new Error("Cannot send message, the WebSocket connection is not open");this.socket.send(t)});w(this,"close",()=>{if(this.socket==null)throw new Error("Cannot close the WebSocket connection that is not open");this.socket.close(),this.addEventListener("error",t=>{console.log(t)})});w(this,"handleClose",t=>{this.eventListeners.close.forEach(e=>{e(t)})});w(this,"handleError",t=>{this.eventListeners.error.forEach(e=>{e(t)})});w(this,"handleMessage",t=>{this.eventListeners.message.forEach(e=>{e(t)})});w(this,"handleOpen",t=>{const e=t.target;e.addEventListener("close",this.handleClose),e.addEventListener("error",this.handleError),this.socket=e});this.webSocketUrl=t}addEventListener(t,e){this.eventListeners[t].push(e)}removeEventListener(t,e){const s=this.eventListeners[t].indexOf(e);s!==-1&&this.eventListeners[t].splice(s,1)}}function Me(i){try{return JSON.parse(i==null?void 0:i.data)}catch(t){return console.error("fakap",t),null}}function oe(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="GameEvent"}function ai(i){return oe(i)&&i.body.event==="OPEN_GAME"}function oi(i){return oe(i)&&i.body.event==="SPIN_ERROR"}function ri(i){return oe(i)&&i.body.event==="SPIN_RESULT"}function ci(i){return oe(i)&&i.body.event==="BG_RESULT"}function di(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="OpenGame"}function li(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="Ping"}function dt(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="RealityCheck"}var Z,ye;class ui extends ni{constructor(e,s){const n=new URL(e.apiUrl);n.searchParams.set("cageCode",e.cageCode),n.searchParams.set("gameCode",e.gameCode),n.searchParams.set("operatorCode",e.operatorCode),n.searchParams.set("playMode",e.playMode),n.searchParams.set("token",e.token),n.searchParams.set("username",e.username);super(n.toString());w(this,"cId",0);w(this,"mId",0);w(this,"seqId",10);w(this,"gameCode");v(this,Z,void 0);v(this,ye,void 0);w(this,"onMessage",e=>{const s=Me(e);(oe(s)||li(s)||dt(s))&&this.sendAcknowledgement(s),dt(s)&&this.handleRealityCheck(s)});this.eventListeners.realityCheck=[],this.gameCode=e.gameCode,E(this,Z,s.requestTimeoutMs),E(this,ye,s.gameVersion??"unknown"),this.addEventListener("message",this.onMessage)}handleRealityCheck(e){this.eventListeners.realityCheck.forEach(s=>{s(e.body)})}addEventListener(e,s){super.addEventListener(e,s)}removeEventListener(e,s){super.removeEventListener(e,s)}buildHeader(e,s=null){return{cId:s??++this.cId,code:s!==null?1:void 0,mId:++this.mId,name:e}}buildPayload(e,s){return JSON.stringify({body:s,header:e})}getBodyExtras(e){return{action:e,seqId:++this.seqId}}request(e,s){const n=this.buildPayload(e,s);return new Promise((c,a)=>{setTimeout(()=>a({request:{body:s,header:e},type:"timeout"}),y(this,Z));const h=g=>{const p=Me(g);try{e.cId===(p==null?void 0:p.header.cId)&&(this.removeEventListener("message",h),p.header.code===1?c(p):a({response:p,type:"response"}))}catch{a({response:p,type:"error"})}};this.addEventListener("message",h),this.send(n)})}activateFreeRound(e){const s=this.buildHeader("ActivateFreeRound");return this.request(s,e)}authenticate(e=!1){const s=this.buildHeader("Authenticate"),n={clientType:3,version:y(this,ye),reconnect:e};return this.request(s,n).then(c=>c.body)}openGame(){const e=this.buildHeader("OpenGame"),s={gameCode:this.gameCode};return new Promise((n,c)=>{const a=h=>{const g=Me(h);ai(g)&&(this.removeEventListener("message",a),n(g.body))};this.addEventListener("message",a),this.request(e,s).catch(h=>{di(h.response)&&c(h),c(h)})})}sendAcknowledgement(e){const{name:s,cId:n}=e.header,c=this.buildHeader(s,n),a=this.buildPayload(c,{});this.send(a)}sendAction(e,s){const n=this.buildHeader("GameAction"),c={...this.getBodyExtras(e),data:s};return new Promise((a,h)=>{const g=p=>{const f=Me(p);oe(f)&&c.seqId===f.body.correlationSeqId&&(this.removeEventListener("message",g),ri(f)||ci(f)?a(f.body):oi(f)&&h(f.body))};this.addEventListener("message",g),this.request(n,c).catch(p=>{h(p)})})}setRequestTimeoutMs(e){E(this,Z,e)}}Z=new WeakMap,ye=new WeakMap;class Ot{constructor(t){w(this,"config");this.config=t}on(t,e,s){const n=function(a){a.data.message!==`kalamba:wrapper-rgs:${t}`&&a.data.message!==`kalamba:wrapper:${t}`||e(a.data.payload)};window.addEventListener("message",n,s)}send(t,...[e]){window.postMessage({message:`kalamba:rgs:${t}`,payload:e})}}const hi={bul:"bg",chi:"zh",zho:"zh",hrv:"hr",cze:"cs",dan:"da",dut:"nl",eng:"en",est:"et",fin:"fi",fra:"fr",ger:"de",gre:"el",hun:"hu",ind:"id",ita:"it",jpn:"ja",kor:"ko",nor:"no",pol:"pl",por:"pt",rum:"ro",rus:"ru",srp:"sr",slo:"sk",spa:"es",swe:"sv",tha:"th",tur:"tr",ukr:"uk",vie:"vi"},gi=x("KalambaBullseyePlugin","color:#000000;font-weight:bold;");var Ee;class pi extends Ot{constructor(...e){super(...e);w(this,"socket");v(this,Ee,"");this.on("openGame",async()=>{try{const s=await this.openGame();this.send("openGameResponse",s)}catch(s){this.send("openGameError",s)}}),this.on("play",async s=>{try{const n=await this.play(s);this.send("playResponse",n)}catch(n){this.send("playError",n)}}),this.on("state",({version:s})=>{E(this,Ee,s)}),this.on("configured",s=>{this.socket.setRequestTimeoutMs(s.ui.requestTimeoutMs)}),this.registerFromSdkEvents()}initialize(e){this.socket=new ui(e,{gameVersion:y(this,Ee),requestTimeoutMs:this.config.ui.requestTimeoutMs}),this.socket.addEventListener("close",s=>{s.code===1006&&this.reconnect(e)}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this.socket.socket&&this.socket.socket.readyState!==WebSocket.OPEN&&this.reconnect(e)}),this.socket.addEventListener("error",s=>gi("error",s)),this.socket.addEventListener("realityCheck",s=>{this.send("realityCheck",s)})}async reconnect(e){this.initialize(e),await this.socket.connect(),await this.socket.authenticate(!0),await this.socket.openGame()}async openGame(){const e=new URLSearchParams(window.location.search),s=e.get("apiUrl"),n=e.get("cageCode"),c=e.get("gameCode"),a=e.get("operatorCode"),h=e.get("playMode"),g=e.get("token"),p=e.get("username"),f=e.get("gameHistoryUrl"),A=e.get("homeUrl")??void 0,D=e.get("cashierUrl")??void 0;this.initialize({apiUrl:s,cageCode:n,gameCode:c,operatorCode:a,playMode:h,token:g,username:p}),await this.socket.connect();const B=await this.socket.authenticate(),le=await this.socket.openGame();this.config.api={brand:n,game:c,integration:a,jurisdiction:B.jurisdictionCode,playMode:h,user:B.username,integrationData:{token:g},country:B.countryCode,currency:B.currencyCode,coinValueInCents:B.coinValueInCents,gameHistoryUrl:f,homeUrl:A,cashierUrl:D};const U=e.get("languageCode");return U&&(this.config.ui.language=U.length===3?hi[U]??U:U),le}play(e){const{contract:{bet:s,...n},extra:c,actionType:a}=e;return this.socket.sendAction(a,{bet:s?{baseBet:s.base,betMultiplier:s.multiplier}:void 0,...n,...c})}registerFromSdkEvents(){this.on("history",()=>{const{api:{game:e,integration:s,integrationData:n,jurisdiction:c,user:a,gameHistoryUrl:h},ui:{language:g}}=this.config,p=a.replace(/^user_/,"").replace(new RegExp(`_${s}$`),""),f=new URL(h);f.searchParams.set("gameCode",e),f.searchParams.set("jurisdiction",c),f.searchParams.set("operatorCode",s),f.searchParams.set("token",n.token),f.searchParams.set("username",p),f.searchParams.set("languageCode",g),window.open(f.toString(),"_blank")})}}Ee=new WeakMap;var wi="2.0.0-beta.2",re="",lt="?",Ke="function",H="undefined",ce="object",Je="string",fe="major",d="model",o="name",l="type",u="vendor",r="version",M="architecture",K="console",m="mobile",b="tablet",I="smarttv",X="wearable",Ye="embedded",ut="user-agent",Ze=500,it="brands",W="formFactor",st="fullVersionList",J="platform",nt="platformVersion",De="bitness",q="sec-ch-ua",mi=q+"-full-version-list",fi=q+"-arch",bi=q+"-"+De,yi=q+"-form-factor",Ei=q+"-"+m,vi=q+"-"+d,Lt=q+"-"+J,ki=Lt+"-version",_t=[it,st,m,d,J,nt,M,W,De],T="browser",O="cpu",R="device",L="engine",P="os",Y="result",Ce="Amazon",ge="Apple",ht="ASUS",gt="BlackBerry",Ie="Google",pt="Huawei",wt="Lenovo",qe="LG",Ue="Microsoft",mt="Motorola",Te="Samsung",ft="Sharp",Ae="Sony",We="Xiaomi",$e="Zebra",j="Mobile ",Q=" Browser",Pe="Chrome",Si="Edge",pe="Firefox",we="Opera",bt="Facebook",yt="Sogou",et="Windows",Mi=typeof window!==H,C=Mi&&window.navigator?window.navigator:void 0,G=C&&C.userAgentData?C.userAgentData:void 0,Ci=function(i,t){var e={};for(var s in i)e[s]=t[s]&&t[s].length%2===0?t[s].concat(i[s]):i[s];return e},Be=function(i){for(var t={},e=0;e<i.length;e++)t[i[e].toUpperCase()]=i[e];return t},tt=function(i,t){if(typeof i===ce&&i.length>0){for(var e in i)if(z(i[e])==z(t))return!0;return!1}return de(i)?z(t).indexOf(z(i))!==-1:!1},Et=function(i){for(var t in i)return/^(browser|cpu|device|engine|os)$/.test(t)},de=function(i){return typeof i===Je},je=function(i){if(i){for(var t=[],e=$(/\\?\"/g,i).split(","),s=0;s<e.length;s++)if(e[s].indexOf(";")>-1){var n=be(e[s]).split(";v=");t[s]={brand:n[0],version:n[1]}}else t[s]=be(e[s]);return t}},z=function(i){return de(i)?i.toLowerCase():i},Qe=function(i){return de(i)?$(/[^\d\.]/g,i).split(".")[0]:void 0},_=function(i){for(var t in i){var e=i[t];typeof e==ce&&e.length==2?this[e[0]]=e[1]:this[e]=void 0}return this},$=function(i,t){return de(t)?t.replace(i,re):t},me=function(i){return $(/\\?\"/g,i)},be=function(i,t){if(de(i))return i=$(/^\s\s*/,i),typeof t===H?i:i.substring(0,Ze)},vt=function(i,t){if(!(!i||!t))for(var e=0,s,n,c,a,h,g;e<t.length&&!h;){var p=t[e],f=t[e+1];for(s=n=0;s<p.length&&!h&&p[s];)if(h=p[s++].exec(i),h)for(c=0;c<f.length;c++)g=h[++n],a=f[c],typeof a===ce&&a.length>0?a.length===2?typeof a[1]==Ke?this[a[0]]=a[1].call(this,g):this[a[0]]=a[1]:a.length===3?typeof a[1]===Ke&&!(a[1].exec&&a[1].test)?this[a[0]]=g?a[1].call(this,g,a[2]):void 0:this[a[0]]=g?g.replace(a[1],a[2]):void 0:a.length===4&&(this[a[0]]=g?a[3].call(this,g.replace(a[1],a[2])):void 0):this[a]=g||void 0;e+=2}},Oe=function(i,t){for(var e in t)if(typeof t[e]===ce&&t[e].length>0){for(var s=0;s<t[e].length;s++)if(tt(t[e][s],i))return e===lt?void 0:e}else if(tt(t[e],i))return e===lt?void 0:e;return t.hasOwnProperty("*")?t["*"]:i},kt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},St={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:["VR","XR","Watch"],"?":["Desktop","Unknown"],"*":void 0},Mt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[r,[o,j+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[r,[o,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[o,r],[/opios[\/ ]+([\w\.]+)/i],[r,[o,we+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[r,[o,we+" GX"]],[/\bopr\/([\w\.]+)/i],[r,[o,we]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[r,[o,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[o,r],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[r,[o,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[r,[o,"WeChat"]],[/konqueror\/([\w\.]+)/i],[r,[o,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[r,[o,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[r,[o,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[r,[o,"Smart "+wt+Q]],[/(avast|avg)\/([\w\.]+)/i],[[o,/(.+)/,"$1 Secure"+Q],r],[/\bfocus\/([\w\.]+)/i],[r,[o,pe+" Focus"]],[/\bopt\/([\w\.]+)/i],[r,[o,we+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[r,[o,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[r,[o,"Dolphin"]],[/coast\/([\w\.]+)/i],[r,[o,we+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[r,[o,"MIUI"+Q]],[/fxios\/([\w\.-]+)/i],[r,[o,j+pe]],[/\bqihu|(qi?ho?o?|360)browser/i],[[o,"360"+Q]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[o,/(.+)/,"$1"+Q],r],[/samsungbrowser\/([\w\.]+)/i],[r,[o,Te+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[o,/_/g," "],r],[/metasr[\/ ]?([\d\.]+)/i],[r,[o,yt+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[o,yt+" Mobile"],r],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[o,r],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[o],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[o,bt],r],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[o,r],[/\bgsa\/([\w\.]+) .*safari\//i],[r,[o,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[r,[o,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[r,[o,Pe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[o,Pe+" WebView"],r],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[r,[o,"Android"+Q]],[/chrome\/([\w\.]+) mobile/i],[r,[o,j+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[o,r],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[r,[o,j+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[o,j+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[r,o],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[o,[r,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[o,r],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[o,j+pe],r],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[o,"Netscape"],r],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[r,[o,pe+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[o,r],[/(cobalt)\/([\w\.]+)/i],[o,[r,/[^\d\.]+./,re]]],cpu:[[/\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i],[[M,"amd64"]],[/(ia32(?=;))/i,/((?:i[346]|x)86)[;\)]/i],[[M,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[M,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[M,"armhf"]],[/windows (ce|mobile); ppc;/i],[[M,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[M,/ower/,re,z]],[/(sun4\w)[;\)]/i],[[M,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[M,z]]],device:[[/\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],[d,[u,Te],[l,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[d,[u,Te],[l,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[u,ge],[l,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[u,ge],[l,b]],[/(macintosh);/i],[d,[u,ge]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[u,ft],[l,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[u,pt],[l,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[u,pt],[l,m]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[d,/_/g," "],[u,We],[l,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[u,We],[l,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[u,"OPPO"],[l,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[u,"Vivo"],[l,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[u,"Realme"],[l,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[d,[u,mt],[l,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[u,mt],[l,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[u,qe],[l,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[u,qe],[l,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[u,wt],[l,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[u,"Nokia"],[l,m]],[/(pixel c)\b/i],[d,[u,Ie],[l,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[u,Ie],[l,m]],[/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],[d,[u,Ae],[l,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[u,Ae],[l,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[u,"OnePlus"],[l,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[u,Ce],[l,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[u,Ce],[l,m]],[/(playbook);[-\w\),; ]+(rim)/i],[d,u,[l,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[u,gt],[l,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[u,ht],[l,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[u,ht],[l,m]],[/(nexus 9)/i],[d,[u,"HTC"],[l,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[d,/_/g," "],[l,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[u,"Acer"],[l,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[u,"Meizu"],[l,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[u,"Ulefone"],[l,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[u,d,[l,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[u,d,[l,b]],[/(surface duo)/i],[d,[u,Ue],[l,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[u,"Fairphone"],[l,m]],[/(shield[\w ]+) b/i],[d,[u,"Nvidia"],[l,b]],[/(sprint) (\w+)/i],[u,d,[l,m]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[u,Ue],[l,m]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[u,$e],[l,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[u,$e],[l,m]],[/smart-tv.+(samsung)/i],[u,[l,I]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[u,Te],[l,I]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,qe],[l,I]],[/(apple) ?tv/i],[u,[d,ge+" TV"],[l,I]],[/crkey/i],[[d,Pe+"cast"],[u,Ie],[l,I]],[/droid.+aft(\w+)( bui|\))/i],[d,[u,Ce],[l,I]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[u,ft],[l,I]],[/(bravia[\w ]+)( bui|\))/i],[d,[u,Ae],[l,I]],[/(mitv-\w{5}) bui/i],[d,[u,We],[l,I]],[/Hbbtv.*(technisat) (.*);/i],[u,d,[l,I]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,be],[d,be],[l,I]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,I]],[/(ouya)/i,/(nintendo) (\w+)/i],[u,d,[l,K]],[/droid.+; (shield) bui/i],[d,[u,"Nvidia"],[l,K]],[/(playstation \w+)/i],[d,[u,Ae],[l,K]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[u,Ue],[l,K]],[/((pebble))app/i],[u,d,[l,X]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[u,ge],[l,X]],[/droid.+; (glass) \d/i],[d,[u,Ie],[l,X]],[/droid.+; (wt63?0{2,3})\)/i],[d,[u,$e],[l,X]],[/(quest( 2| pro)?)/i],[d,[u,bt],[l,X]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[l,Ye]],[/(aeobc)\b/i],[d,[u,Ce],[l,Ye]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[l,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[l,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,m]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[r,[o,Si+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[r,[o,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[o,r],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[r,o]],os:[[/microsoft (windows) (vista|xp)/i],[o,r],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[o,[r,Oe,kt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[r,Oe,kt],[o,et]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[r,/_/g,"."],[o,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[o,"macOS"],[r,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[r,o],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[o,r],[/\(bb(10);/i],[r,[o,gt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[r,[o,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[r,[o,pe+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[r,[o,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[r,[o,"watchOS"]],[/crkey\/([\d\.]+)/i],[r,[o,Pe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[o,"Chrome OS"],r],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([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,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[o,r],[/(sunos) ?([\w\.\d]*)/i],[[o,"Solaris"],r],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[o,r]]},Re=function(){var i={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return _.call(i.init,[[T,[o,r,fe]],[O,[M]],[R,[l,d,u]],[L,[o,r]],[P,[o,r]]]),_.call(i.isIgnore,[[T,[r,fe]],[L,[r]],[P,[r]]]),_.call(i.isIgnoreRgx,[[T,/ ?browser$/i],[P,/ ?os$/i]]),_.call(i.toString,[[T,[o,r]],[O,[M]],[R,[u,d]],[L,[o,r]],[P,[o,r]]]),i}(),Ii=function(i,t){var e=Re.init[t],s=Re.isIgnore[t]||0,n=Re.isIgnoreRgx[t]||0,c=Re.toString[t]||0;function a(){_.call(this,e)}return a.prototype.getItem=function(){return i},a.prototype.withClientHints=function(){return G?G.getHighEntropyValues(_t).then(function(h){return i.setCH(new Ft(h,!1)).parseCH().get()}):i.parseCH().get()},a.prototype.withFeatureCheck=function(){return i.detectFeature().get()},t!=Y&&(a.prototype.is=function(h){var g=!1;for(var p in this)if(this.hasOwnProperty(p)&&!tt(s,p)&&z(n?$(n,this[p]):this[p])==z(n?$(n,h):h)){if(g=!0,h!=H)break}else if(h==H&&g){g=!g;break}return g},a.prototype.toString=function(){var h=re;for(var g in c)typeof this[c[g]]!==H&&(h+=(h?" ":re)+this[c[g]]);return h||H}),G||(a.prototype.then=function(h){var g=this,p=function(){for(var A in g)g.hasOwnProperty(A)&&(this[A]=g[A])};p.prototype={is:a.prototype.is,toString:a.prototype.toString};var f=new p;return h(f),f}),new a};function Ft(i,t){if(i=i||{},_.call(this,_t),t)_.call(this,[[it,je(i[q])],[st,je(i[mi])],[m,/\?1/.test(i[Ei])],[d,me(i[vi])],[J,me(i[Lt])],[nt,me(i[ki])],[M,me(i[fi])],[W,je(i[yi])],[De,me(i[bi])]]);else for(var e in i)this.hasOwnProperty(e)&&typeof i[e]!==H&&(this[e]=i[e])}function Ct(i,t,e,s){return this.get=function(n){return n?this.data.hasOwnProperty(n)?this.data[n]:void 0:this.data},this.set=function(n,c){return this.data[n]=c,this},this.setCH=function(n){return this.uaCH=n,this},this.detectFeature=function(){if(C&&C.userAgent==this.ua)switch(this.itemType){case T:C.brave&&typeof C.brave.isBrave==Ke&&this.set(o,"Brave");break;case R:!this.get(l)&&G&&G[m]&&this.set(l,m),this.get(d)=="Macintosh"&&C&&typeof C.standalone!==H&&C.maxTouchPoints&&C.maxTouchPoints>2&&this.set(d,"iPad").set(l,b);break;case P:!this.get(o)&&G&&G[J]&&this.set(o,G[J]);break;case Y:var n=this.data,c=function(a){return n[a].getItem().detectFeature().get()};this.set(T,c(T)).set(O,c(O)).set(R,c(R)).set(L,c(L)).set(P,c(P))}return this},this.parseUA=function(){return this.itemType!=Y&&vt.call(this.data,this.ua,this.rgxMap),this.itemType==T&&this.set(fe,Qe(this.get(r))),this},this.parseCH=function(){var n=this.uaCH,c=this.rgxMap;switch(this.itemType){case T:var a=n[st]||n[it],h;if(a)for(var g in a){var p=$(/(Google|Microsoft) /,a[g].brand||a[g]),f=a[g].version;!/not.a.brand/i.test(p)&&(!h||/chrom/i.test(h)&&!/chromi/i.test(p))&&(this.set(o,p).set(r,f).set(fe,Qe(f)),h=p)}break;case O:var A=n[M];A&&(A&&n[De]=="64"&&(A+="64"),vt.call(this.data,A+";",c));break;case R:if(n[m]&&this.set(l,m),n[d]&&this.set(d,n[d]),n[d]=="Xbox"&&this.set(l,K).set(u,Ue),n[W]){var D;if(typeof n[W]!="string")for(var B=0;!D&&B<n[W].length;)D=Oe(n[W][B++],St);else D=Oe(n[W],St);this.set(l,D)}break;case P:var le=n[J];if(le){var U=n[nt];le==et&&(U=parseInt(Qe(U),10)>=13?"11":"10"),this.set(o,le).set(r,U)}this.get(o)==et&&n[d]=="Xbox"&&this.set(o,"Xbox").set(r,void 0);break;case Y:var Bt=this.data,ue=function(Gt){return Bt[Gt].getItem().setCH(n).parseCH().get()};this.set(T,ue(T)).set(O,ue(O)).set(R,ue(R)).set(L,ue(L)).set(P,ue(P))}return this},_.call(this,[["itemType",i],["ua",t],["uaCH",s],["rgxMap",e],["data",Ii(this,i)]]),this}function F(i,t,e){if(typeof i===ce?(Et(i)?(typeof t===ce&&(e=t),t=i):(e=i,t=void 0),i=void 0):typeof i===Je&&!Et(t)&&(e=t,t=void 0),!(this instanceof F))return new F(i,t,e).getResult();var s=typeof i===Je?i:C&&C.userAgent?C.userAgent:e&&e[ut]?e[ut]:re,n=new Ft(e,!0),c=t?Ci(Mt,t):Mt,a=function(h){return h==Y?function(){return new Ct(h,s,c,n).set("ua",s).set(T,this.getBrowser()).set(O,this.getCPU()).set(R,this.getDevice()).set(L,this.getEngine()).set(P,this.getOS()).get()}:function(){return new Ct(h,s,c[h],n).parseUA().get()}};return _.call(this,[["getBrowser",a(T)],["getCPU",a(O)],["getDevice",a(R)],["getEngine",a(L)],["getOS",a(P)],["getResult",a(Y)],["getUA",function(){return s}],["setUA",function(h){return de(h)&&(s=h.length>Ze?be(h,Ze):h),this}]]).setUA(s),this}F.VERSION=wi;F.BROWSER=Be([o,r,fe]);F.CPU=Be([M]);F.DEVICE=Be([d,u,l,K,m,I,b,X,Ye]);F.ENGINE=F.OS=Be([o,r]);class Dt{constructor(t,e){w(this,"trackers");w(this,"config");this.trackers=t,this.config=e}on(t,e,s){const n=function(a){a.data.message!==`kalamba:wrapper-telemetry:${t}`&&a.data.message!==`kalamba:wrapper:${t}`||e(a.data.payload)};window.addEventListener("message",n,s)}track(t,e){this.trackers.forEach(s=>s.track(t,e))}}function It(i){return i.reduce((t,e)=>t+e,0)}function Ti(i){const t=i.length,e=It(i)/t,s=i.map(c=>Math.pow(c-e,2)),n=It(s)/t;return Math.sqrt(n)}class Tt{constructor(){w(this,"rafId",-1);w(this,"startTime",0);w(this,"stopTime",0);w(this,"frames",[]);w(this,"calculateFPS",()=>{const t=Math.floor((this.stopTime-this.startTime)/1e3);return this.frames.map(e=>Math.floor((e-this.startTime)/1e3)).reduce((e,s,n,c)=>(c[n]!==c[n-1]?e.push(1):e[e.length-1]++,e),[]).slice(0,t)});w(this,"getReport",()=>{const t=this.calculateFPS(),e=Math.floor(this.frames.length/((this.stopTime-this.startTime)/1e3)),s=t.length>0?Math.max(...t):e,n=t.length>0?Math.min(...t):e,c=t.length>0?Ti(t):0;return{fpsAvg:e,fpsMax:s,fpsMin:n,fpsStdDev:c}});w(this,"start",()=>{this.startTime=Date.now(),this.trackFrames()});w(this,"stop",()=>{cancelAnimationFrame(this.rafId),this.stopTime=Date.now()});w(this,"trackFrames",()=>{this.frames.push(Date.now()),this.rafId=requestAnimationFrame(this.trackFrames)})}}const Ai="landscape",Pi="portrait";function Ri(){try{const i=document.createElement("canvas");return!!window.WebGLRenderingContext&&(i.getContext("webgl")||i.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function xi(){if(!window.createImageBitmap)return!1;const e=await(await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();try{return await createImageBitmap(e),!0}catch{return!1}}function Xe(){return window.innerWidth>=window.innerHeight?Ai:Pi}var Le,ee,te,ie,ve,_e,ke,Fe;class Ui extends Dt{constructor(...e){super(...e);w(this,"FPS_SAMPLE_INTERVAL",1e4);v(this,Le,0);v(this,ee,"");v(this,te,void 0);v(this,ie,void 0);v(this,ve,!1);v(this,_e,!1);v(this,ke,"");v(this,Fe,[]);E(this,te,{}),E(this,ie,this.deviceInfo()),this.on("state",({balance:s,version:n})=>{E(this,ee,n),E(this,Le,s)}),this.on("autoplay",({action:s})=>{["start","resume"].includes(s)?E(this,ve,!0):E(this,ve,!1)}),this.on("settings",({fastPlay:s})=>{s!==void 0&&E(this,_e,s)}),this.registerEvents()}async registerEvents(){y(this,ie).then(e=>{this.track("Device Information",e)}),this.on("loadStart",()=>{this.track("Game Loading",{progress:0,step:"initial"})}),this.on("loadProgress",e=>{this.track("Game Loading",{progress:e.progress})}),this.on("loadEnd",()=>{this.track("Game Loading",{progress:100,step:"complete"})}),this.on("error",e=>{this.track("System Message",{systemMessageText:e.messageKey,systemMessageType:e.type})}),this.on("openGameResponse",async e=>{E(this,ke,e.data.gameState.stateTypeNextRound),E(this,te,{balanceInCoins:e.balance,clientVersion:y(this,ee),coinValueInCents:this.config.api.coinValueInCents,coinValueInCentsFloat:this.config.api.coinValueInCents,currency:this.config.api.currency,defaultBaseBet:e.data.additionalConfigData.defaultBet.baseBet,defaultBetMultiplier:e.data.additionalConfigData.defaultBet.betMultiplier,environment:"release",gameCode:this.config.api.game,gameCodeServer:this.config.api.game,gameModelFile:e.data.additionalConfigData.gameModelFile,jurisdiction:this.config.api.jurisdiction,languageCode:this.config.ui.language,operatorName:"kalamba",partnerId:this.config.api.brand,partnerParentId:this.config.api.integration,platform:"WEB",playMode:this.config.api.playMode,referrer:window.location.hostname,serverVersion:e.data.gameConfigData.metaData.version}),this.track("Game Open",y(this,te))}),this.on("playCycleEnd",async e=>{const s=await y(this,ie),{baseBet:n,betMultiplier:c,specialAction:a}=e.data.gameState.lastPlacedMainGameBet??{},h=e.balance,g=e.data.gameState.totalBetFromCurrentGameCycle,p=e.data.gameState.totalWinFromCurrentGameCycle,f=p-g,A=a||"spin",D=e.data.gameState.cycleId;this.track("Betting Activity",{balance:h-f,balanceAfter:h,baseBet:n,betMultiplier:c,betType:A,gameVersion:y(this,ee),coinValueInCents:this.config.api.coinValueInCents,coinValueInCentsFloat:this.config.api.coinValueInCents,currency:this.config.api.currency,environment:"release",gameCode:this.config.api.game,gameCodeServer:this.config.api.game,isMobile:s.isMobile,netResult:f,operatorName:"kalamba",orientation:Xe(),partnerId:this.config.api.brand,partnerParentId:this.config.api.integration,platform:"WEB",playMode:this.config.api.playMode,roundId:D,roundTypes:["BaseGame"],totalBet:g,totalWin:p}),E(this,Fe,[])}),this.on("telemetry.click",e=>{this.track("UI Interaction",{action:"click",...this.getExtraUiInteractionData(),...e})}),this.on("telemetry.orientationChange",()=>{this.track("UI Interaction",{action:"orientationChange",...this.getExtraUiInteractionData()})}),this.reportFpsSample(),this.reportFpsRound()}reportFpsSample(){const e=new Tt,s=()=>{e.stop();const c=e.getReport();this.track("FPS Performance",{...c,fpsType:"sample"}),n()},n=async()=>{e.start(),setTimeout(s,this.FPS_SAMPLE_INTERVAL)};n()}reportFpsRound(){const e=new Tt;this.on("playCycleStart",()=>{e.start()}),this.on("playCycleEnd",()=>{e.stop();const s=e.getReport();this.track("FPS Performance",{...s,fpsType:"playCycleStart->playCycleEnd"})})}getExtraUiInteractionData(){return{orientation:Xe(),stateType:y(this,ke)}}async deviceInfo(){var g;const e=new F(navigator.userAgent),s=Ri(),n=await xi(),c=e.getBrowser(),a=e.getDevice(),h=e.getOS();return{browserName:c.name,browserVersion:c.version,connection:(g=navigator.connection)==null?void 0:g.effectiveType,deviceName:a.model,deviceType:a.type,isMobile:["mobile","tablet"].includes(a.type??""),isWebGLSupported:s,isWebPSupported:n,manufacturer:a.vendor,operatingSystem:h.name,operatingSystemVersion:h.version,orientation:Xe(),pixelRatio:window.devicePixelRatio,screenHeight:window.screen.height,screenSize:`${window.screen.width}x${window.screen.height}`,screenWidth:window.screen.width,timezoneOffsetMinutes:new Date().getTimezoneOffset(),windowHeight:window.innerHeight,windowSize:`${window.innerWidth}x${window.innerHeight}`,windowWidth:window.innerWidth}}}Le=new WeakMap,ee=new WeakMap,te=new WeakMap,ie=new WeakMap,ve=new WeakMap,_e=new WeakMap,ke=new WeakMap,Fe=new WeakMap;let xe;const Oi=new Uint8Array(16);function Li(){if(!xe&&(xe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xe(Oi)}const S=[];for(let i=0;i<256;++i)S.push((i+256).toString(16).slice(1));function _i(i,t=0){return S[i[t+0]]+S[i[t+1]]+S[i[t+2]]+S[i[t+3]]+"-"+S[i[t+4]]+S[i[t+5]]+"-"+S[i[t+6]]+S[i[t+7]]+"-"+S[i[t+8]]+S[i[t+9]]+"-"+S[i[t+10]]+S[i[t+11]]+S[i[t+12]]+S[i[t+13]]+S[i[t+14]]+S[i[t+15]]}const Fi=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),At={randomUUID:Fi};function Pt(i,t,e){if(At.randomUUID&&!t&&!i)return At.randomUUID();i=i||{};const s=i.random||(i.rng||Li)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,t){e=e||0;for(let n=0;n<16;++n)t[e+n]=s[n];return t}return _i(s)}class at{constructor(t){w(this,"config");this.config=t}}const Rt=25,xt=1e4;var se,ne,ae,N,Se;class Di extends at{constructor(...e){super(...e);v(this,se,"https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");v(this,ne,void 0);v(this,ae,void 0);v(this,N,[]);v(this,Se,void 0);w(this,"processQueueForced");E(this,ne,new Date().getTime()),E(this,N,[]),E(this,Se,Pt()),this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(y(this,se),{method:"OPTIONS"}).catch(rt.noop),this.subscribe()}subscribe(){window.addEventListener("beforeunload",this.processQueueForced,!1),window.addEventListener("pagehide",this.processQueueForced,!1),window.addEventListener("visibilitychange",this.processQueueForced,!1)}schedule(){y(this,ae)&&clearTimeout(y(this,ae)),E(this,ae,window.setTimeout(()=>this.processQueue(),xt))}send(e){E(this,ne,new Date().getTime());try{navigator.sendBeacon(y(this,se),JSON.stringify(e))}catch{fetch(y(this,se),{body:JSON.stringify(e),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(rt.noop)}this.schedule()}addToQueue(e){y(this,N).push(e),this.processQueue()}processQueue(e=!1){if(!(this.config==null||!this.config.ui.feature.allowTelemetry)&&!(!e&&y(this,N).length<Rt&&new Date().getTime()-y(this,ne)<xt))for(;y(this,N).length;){const s=y(this,N).splice(0,Rt).map(n=>({...n,sessionID:y(this,Se),userID:this.config.api.user}));this.send(s)}}track(e,s){this.addToQueue({eventName:e,eventParams:s,eventTimestamp:new Date().getTime(),eventUUID:Pt()})}}se=new WeakMap,ne=new WeakMap,ae=new WeakMap,N=new WeakMap,Se=new WeakMap;const Bi=x("LoggingTracker","color:#000000;font-weight:bold;");class Gi extends at{track(t,e){Bi(`@${this.config.api.user}`,`[${t}]`,e)}}exports.BasicPlugin=qt;exports.CasinoPlugin=V;exports.DebuggingPlugin=$t;exports.GigPlugin=Qt;exports.KalambaBullseyePlugin=pi;exports.KalambaStargazerPlugin=Ui;exports.KalambaStargazerTracker=Di;exports.LoggingTracker=Gi;exports.OryxPlugin=Kt;exports.PariplayPlugin=ei;exports.RelaxFEIMPlugin=ti;exports.RgsPlygin=Ot;exports.TelemetryPlugin=Dt;exports.Tracker=at;exports.TukoPlugin=si;
|
package/dist/plugins.d.ts
CHANGED
|
@@ -57,6 +57,11 @@ export declare abstract class CasinoPlugin {
|
|
|
57
57
|
protected send<M extends DomainMessage<'casino'>>(message: M, ...[payload]: DomainMessagePayload<'casino', M> extends never ? [] : [payload: DomainMessagePayload<'casino', M>]): void;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
declare type ContractPlayPayload = {
|
|
61
|
+
[key: string]: any;
|
|
62
|
+
bet: Bet | null;
|
|
63
|
+
};
|
|
64
|
+
|
|
60
65
|
export declare class DebuggingPlugin extends CasinoPlugin {
|
|
61
66
|
constructor(...args: ConstructorParameters<typeof CasinoPlugin>);
|
|
62
67
|
registerDebugToSdkEvents(): void;
|
|
@@ -86,6 +91,12 @@ declare type Error_2 = {
|
|
|
86
91
|
type: 'CLOSE' | 'RELOAD' | 'CONTINUE';
|
|
87
92
|
};
|
|
88
93
|
|
|
94
|
+
declare type ExtraPlayPayload = {
|
|
95
|
+
[key: string]: any;
|
|
96
|
+
} & {
|
|
97
|
+
bet?: never;
|
|
98
|
+
};
|
|
99
|
+
|
|
89
100
|
declare type ForwardToPluginsMessage<P extends PluginDomain> = keyof ForwardToPluginsMessageMap<'sdk'>[P] | keyof ForwardToPluginsMessageMap<'rgs'>[P] | keyof ForwardToPluginsMessageMap<'casino'>[P] | keyof ForwardToPluginsMessageMap<'telemetry'>[P];
|
|
90
101
|
|
|
91
102
|
declare interface ForwardToPluginsMessageMap<SourceDomain extends DomainPrefix> {
|
|
@@ -96,6 +107,8 @@ declare interface ForwardToPluginsMessageMap<SourceDomain extends DomainPrefix>
|
|
|
96
107
|
|
|
97
108
|
declare type ForwardToPluginsMessagePayload<P extends PluginDomain, M extends ForwardToPluginsMessage<P>> = ForwardToPluginsMessageMap<'sdk'>[P][M] & ForwardToPluginsMessageMap<'rgs'>[P][M] & ForwardToPluginsMessageMap<'casino'>[P][M] & ForwardToPluginsMessageMap<'telemetry'>[P][M];
|
|
98
109
|
|
|
110
|
+
declare type GameAction = string;
|
|
111
|
+
|
|
99
112
|
declare type GameEventName = 'BG_RESULT' | 'OPEN_GAME' | 'SPIN_ERROR' | 'SPIN_RESULT';
|
|
100
113
|
|
|
101
114
|
export declare class GigPlugin extends CasinoPlugin {
|
|
@@ -195,9 +208,7 @@ declare class KalambaWebSocketClient extends WebSocketClient {
|
|
|
195
208
|
seqId: number;
|
|
196
209
|
}>;
|
|
197
210
|
private sendAcknowledgement;
|
|
198
|
-
|
|
199
|
-
spin(payload: any): Promise<unknown>;
|
|
200
|
-
bgAction(payload: any): Promise<unknown>;
|
|
211
|
+
sendAction(action: GameAction, data: any): Promise<unknown>;
|
|
201
212
|
setRequestTimeoutMs(ms: number): void;
|
|
202
213
|
}
|
|
203
214
|
|
|
@@ -239,6 +250,7 @@ declare type OpenGameError = {
|
|
|
239
250
|
|
|
240
251
|
declare type OpenGameRequest = {
|
|
241
252
|
gameName: string;
|
|
253
|
+
/** version of game client */
|
|
242
254
|
version: string;
|
|
243
255
|
};
|
|
244
256
|
|
|
@@ -274,11 +286,9 @@ declare type PlayError = {
|
|
|
274
286
|
};
|
|
275
287
|
|
|
276
288
|
declare type PlayRequest = {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
} | {
|
|
281
|
-
opaqueGameAttributes: unknown;
|
|
289
|
+
contract: ContractPlayPayload;
|
|
290
|
+
extra: ExtraPlayPayload;
|
|
291
|
+
actionType: string;
|
|
282
292
|
};
|
|
283
293
|
|
|
284
294
|
declare type PlayResponse = {
|
|
@@ -423,12 +433,12 @@ declare type SdkOnlyMessagePayloadMap = {
|
|
|
423
433
|
openGame: OpenGameRequest;
|
|
424
434
|
play: PlayRequest;
|
|
425
435
|
playCycleEnd: PlayResponse;
|
|
426
|
-
playCycleStart:
|
|
436
|
+
playCycleStart: ContractPlayPayload;
|
|
427
437
|
playEnd: PlayResponse;
|
|
428
438
|
playReady: {
|
|
429
439
|
ready: boolean;
|
|
430
440
|
};
|
|
431
|
-
playStart:
|
|
441
|
+
playStart: ContractPlayPayload;
|
|
432
442
|
translations: Record<string, Record<string, string>>;
|
|
433
443
|
settings: Settings;
|
|
434
444
|
'telemetry.click': {
|