@kalamba/sdk 0.13.1 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/errors-BXO3dlhS.cjs +5 -0
- package/dist/{errors-7cbbda8a.js → errors-NnLrKjTz.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +7 -14
- package/dist/index.js +158 -121
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.d.ts +9 -15
- package/dist/plugins.js +477 -465
- package/dist/v4-BL_nLifx.js +45 -0
- package/dist/v4-C9_uc0A9.cjs +5 -0
- package/dist/wrapper.cjs +1 -1
- package/dist/wrapper.d.ts +7 -14
- package/dist/wrapper.js +2362 -1360
- package/package.json +3 -3
- package/dist/errors-db453887.cjs +0 -5
- package/dist/v4-58efbfa1.js +0 -48
- package/dist/v4-bada56b0.cjs +0 -5
package/dist/plugins.cjs
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* BSD 3-Clause License
|
|
3
3
|
* Copyright (c) 2025, Kalamba Games Limited
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var Wt=Object.defineProperty;var $t=(s,t,e)=>t in s?Wt(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var m=(s,t,e)=>($t(s,typeof t!="symbol"?t+"":t,e),e),rt=(s,t,e)=>{if(!t.has(s))throw TypeError("Cannot "+e)};var y=(s,t,e)=>(rt(s,t,"read from private field"),e?e.call(s):t.get(s)),C=(s,t,e)=>{if(t.has(s))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(s):t.set(s,e)},E=(s,t,e,i)=>(rt(s,t,"write to private field"),i?i.call(s,e):t.set(s,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Be=require("./errors-db453887.cjs"),Ne=require("./v4-bada56b0.cjs");function O(s,t){return(e,...i)=>{console.log(`[%c${s}\x1B[m] %s`,t,e,...i)}}function xt(s,t){return Math.round(s*100/t)}class D{constructor(t,e){m(this,"config");m(this,"sdkConfig");this.config=t,this.sdkConfig=e}on(t,e,i){const a=function(n){n.data.message!==`kalamba:wrapper-casino:${t}`&&n.data.message!==`kalamba:wrapper:${t}`||e(n.data.payload)};window.addEventListener("message",a,i)}send(t,...[e]){window.postMessage({message:`kalamba:casino:${t}`,payload:e})}}const jt=O("BasicPlugin","color:#000000;font-weight:bold;");class Qt extends D{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),jt("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,payload:i}=t.data;switch(e){case"doAudioSettings":this.send("settings",{music:i==null?void 0:i.musicEnabled,sounds:i==null?void 0:i.soundEnabled});return;case"doBalanceUpdate":const{currency:a,coinValueInCents:o}=this.sdkConfig.api;i.currency===a&&typeof i.balanceInCurrency=="number"?this.send("balance",{balance:xt(i.balanceInCurrency,o)}):(i.balanceInCoins,this.send("balance",{balance:i.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.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}const v=O("▼ DebuggingPlugin IN ▼","color:#444444;font-weight:bold;"),Kt=O("▲ DebuggingPlugin OUT ▲","color:#444444;font-weight:bold;");class Xt extends D{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=>v("autoplay",t)),this.on("balance",t=>v("balance",t)),this.on("bet",t=>v("bet",t)),this.on("cashier",t=>v("cashier",t)),this.on("choice",t=>v("choice",t)),this.on("close",t=>v("close",t)),this.on("error",t=>v("error",t)),this.on("loadEnd",t=>v("loadEnd",t)),this.on("loadProgress",t=>v("loadProgress",t)),this.on("loadStart",t=>v("loadStart",t)),this.on("playCycleStart",t=>v("playCycleStart",t)),this.on("playCycleEnd",t=>v("playCycleEnd",t)),this.on("playEnd",t=>v("playEnd",t)),this.on("playError",t=>v("playError",t)),this.on("playReady",t=>v("playReady",t)),this.on("playStart",t=>v("playStart",t)),this.on("settings",t=>v("settings",t))}_send(...t){Kt(...t),this.send(...t)}}const Jt=O("GigPlugin","color:#000000;font-weight:bold;");class Yt extends D{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.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}}),this.on("playReady",()=>{this.postMessage("GAME_READY")})}}const Zt=O("OryxPlugin","color:#000000;font-weight:bold;");class ei extends D{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Zt("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,param:i}=t.data;switch(e){case"doBalanceUpdate":this.send("balance",{balance:i});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=O("PariplayPlugin","color:#000000;font-weight:bold;");function Ge(s){try{window.top.location=s}catch{window.location=s}}function He(s,t){return new Promise(function(i,a){const o=new XMLHttpRequest;o.onload=function(){o.status>=200&&o.status<300?i(o.responseText):a(o.responseText)},o.open(s,t),o.send()})}function Ve(){}function ti(s){return s.filter(function(e){return e.messageType.toUpperCase()==="DATA"})}function ze(s){return s.filter(function(e){return["NOTIFICATION","POPUP"].includes(e.messageType.toUpperCase())})}function Lt(s){try{return JSON.parse(s.text)}catch{return{}}}function ii(s){return s.map(Lt).filter(Boolean).find(function(e){return e.betId!=null&&e.winId!=null})||{}}function si(s){return s.map(Lt).filter(Boolean).find(function(e){return e.TotalBet!=null&&e.TotalWin!=null})||{}}class ai extends D{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),ct("configured")}postMessage(t,e){const i={lang:this.sdkConfig.ui.language,sender:this.sdkConfig.api.game,type:t};e!=null&&(i.data=e),ct("postMessage",i),window.parent.postMessage(i,"*")}coinsToCurrency(t){return t*this.sdkConfig.api.coinValueInCents/100}handleContinueButton(t,e){t.link&&He("GET",t.link),e()}handleLinkButton(t,e){switch(t.linkType.toUpperCase()){case"AJAX":He("GET",t.link),e();return;case"AJAXRESPONSE":He("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,i)=>e.then(()=>new Promise(a=>{Object.assign({},i,{buttons:i.buttons.filter(o=>o.action.toUpperCase()==="CASHIER"?!!this.sdkConfig.api.cashierUrl:!0).map(o=>Object.assign({},o,{onRelease:()=>{const n=i.messageType.toUpperCase()==="POPUP"?Ve:a,h=this.buttonActions[o.action.toUpperCase()];h?h(o,n):n()}}))})}).catch(Ve)),Promise.resolve()).then(()=>{}).catch(Ve)}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 i;try{const a=JSON.parse(JSON.parse(atob(this.sdkConfig.api.integrationData.token.split(".")[1])).token),o=JSON.parse(a.integrationSpecificAttributes.sessionData||"{}");i={ClientToken:a.integrationSpecificAttributes.clientToken,CurrencyCode:a.currency,PlayerTokenId:a.user,SessionData:o}}catch{i=void 0}this.postMessage("gameDataLoaded",{LoadGameData:i,success:!0});try{const a=ze(e.contract.uiMessages);this.processInfoUiMessages(a)}catch{}}),this.on("balance",({balance:e})=>{t!==e&&(t=e,this.postMessage("balance",{amount:this.coinsToCurrency(e)}))}),this.on("close",()=>{if(this.sdkConfig.api.homeUrl)if(this.sdkConfig.api.homeUrl==="(back)")try{window.top.history.back()}catch{window.history.back()}else this.sdkConfig.api.homeUrl==="(api)"?this.postMessage("quit"):Ge(this.sdkConfig.api.homeUrl)}),this.on("playEnd",e=>{this.postMessage("roundEnded",{balanceAfter:this.coinsToCurrency(e.contract.balance.coins),win:this.coinsToCurrency(e.contract.win.round)});try{const i=ze(e.contract.uiMessages);this.processInfoUiMessages(i)}catch{}}),this.on("playError",e=>{var i,a;this.postMessage("ticketReceived",{ErrorCode:(i=e.data)==null?void 0:i.code,ErrorMessage:"ERROR",Status:{ErrCode:(a=e.data)==null?void 0:a.code}})}),this.on("playResponse",e=>{this.postMessage("roundStarted",{balanceBefore:this.coinsToCurrency(e.contract.balance.coins+e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier)});const i=["BaseGame","PaidSpin"].includes(e.contract.stateType.thisRound),a=ti(e.contract.uiMessages),o=ze(e.contract.uiMessages),n=ii(a),h=si(a);this.postMessage("ticketReceived",{Balance:this.coinsToCurrency(e.contract.balance.coins),BetAmount:i?this.coinsToCurrency(e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier):0,CreditTransactionId:n.betId,DebitTransactionId:n.winId,Message:o,SessionData:h,Status:{ErrCode:0},WinAmount:this.coinsToCurrency(e.contract.win.round)})}),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.sdkConfig.api.cashierUrl&&(this.sdkConfig.api.cashierUrl==="(api)"?this.postMessage("cashier"):Ge(this.sdkConfig.api.cashierUrl))})}}const ue=O("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class ni extends D{constructor(...e){super(...e);m(this,"VERSION","1.17.0");const i=document.createElement("script");i.src=`https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`,i.onload=()=>{ue("loaded"),window.FEIM.configure({p2pConfig:{currency:this.sdkConfig.api.currency,launchParams:{homeurl:"homeUrl"}}}),ue("configured"),this.registerToSdkEvents(),this.registerFromSdkEvents()},document.body.appendChild(i)}registerToSdkEvents(){window.FEIM.on.errorMessageDismissed(()=>this.send("unfreeze")),window.FEIM.on.errorMessageDisplayed(()=>this.send("freeze")),window.FEIM.on.exitingGame(()=>ue("!!! NOT IMPLEMENTED: exitingGame !!!")),window.FEIM.on.freeze(()=>this.send("freeze")),window.FEIM.on.initialized(()=>ue("!!! NOT IMPLEMENTED: initialized !!!")),window.FEIM.on.pauseAutoPlay(()=>this.send("suspend")),window.FEIM.on.refreshBalance(()=>ue("!!! NOT IMPLEMENTED: refreshBalance !!!")),window.FEIM.on.toggleGameHelp(()=>{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:i})=>{window.FEIM.send.betUpdate(e*i)}),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 i={balance:e.contract.balance.coins,bet:e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier,win:{win:e.contract.win.total}};window.FEIM.send.roundFinished(i)}),this.on("playResponse",e=>{const i={balance:e.contract.balance.coins,playResponse:e.data};window.FEIM.send.roundStarted(i)}),this.on("history",()=>{window.FEIM.send.showHistory()}),this.on("settings",e=>{window.FEIM.send.updateSettings(e)})}}const qe=O("TukoPlugin","color:#000000;font-weight:bold;");class oi extends D{constructor(...e){super(...e);m(this,"PING_INTERVAL",1e4);const a=new URLSearchParams(window.location.search).get("pingCallbackUrl");a&&window.setInterval(()=>{this.ping(a)},this.PING_INTERVAL),this.registerToSdkEvents(),this.registerFromSdkEvents(),qe("configured")}ping(e){const i=new XMLHttpRequest;i.onreadystatechange=function(){i.readyState===XMLHttpRequest.DONE&&(i.status===0||i.status>=200&&i.status<400?qe("ping ok",i):qe("ping error",i))},i.open("GET",e),i.send()}registerToSdkEvents(){window.addEventListener("message",e=>{try{const{type:i,payload:a}=e.data;switch(i){case"doAudioSettings":this.send("settings",{music:a==null?void 0:a.musicEnabled,sounds:a==null?void 0:a.soundEnabled});return;case"doBalanceUpdate":const{currency:o,coinValueInCents:n}=this.sdkConfig.api;a.currency===o&&typeof a.balanceInCurrency=="number"?this.send("balance",{balance:xt(a.balanceInCurrency,n)}):(a.balanceInCoins,this.send("balance",{balance:a.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.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}const dt=O("QuantaPlugin","color:#000000;font-weight:bold;");class ri extends D{constructor(...t){super(...t),this.registerFromSdkEvents(),dt("configured")}postMessage(t){const e={event:t};dt("QuantaPlugin::postMessage",e),window.parent.postMessage(e,"*")}registerFromSdkEvents(){this.on("close",()=>{this.postMessage("GameClosed")}),this.on("loadEnd",()=>{this.postMessage("GameLoaded")}),this.on("playCycleStart",()=>{this.postMessage("RoundStarted")}),this.on("playCycleEnd",()=>{this.postMessage("RoundEnded")}),this.on("playError",()=>{this.postMessage("RoundEnded")})}}var ci="2.0.0-beta.3",re="",lt="?",Je="function",V="undefined",ce="object",Ye="string",we="major",l="model",r="name",d="type",u="vendor",c="version",M="architecture",J="console",b="mobile",f="tablet",T="smarttv",Pe="wearable",ut="xr",Ze="embedded",ht="user-agent",et=500,st="brands",W="formFactors",at="fullVersionList",Y="platform",nt="platformVersion",Fe="bitness",q="sec-ch-ua",di=q+"-full-version-list",li=q+"-arch",ui=q+"-"+Fe,hi=q+"-form-factors",gi=q+"-"+b,pi=q+"-"+l,Ut=q+"-"+Y,mi=Ut+"-version",_t=[st,at,b,l,Y,nt,M,W,Fe],I="browser",_="cpu",R="device",B="engine",P="os",Z="result",Ee="Amazon",he="Apple",gt="ASUS",pt="BlackBerry",ve="Google",mt="Huawei",wt="Lenovo",We="LG",Ae="Microsoft",bt="Motorola",Ce="Samsung",ft="Sharp",Me="Sony",$e="Xiaomi",je="Zebra",K="Mobile ",X=" Browser",Se="Chrome",wi="Edge",ge="Firefox",pe="Opera",yt="Facebook",kt="Sogou",tt="Windows",bi=typeof window!==V,S=bi&&window.navigator?window.navigator:void 0,G=S&&S.userAgentData?S.userAgentData:void 0,fi=function(s,t){var e={},i=t;if(!Oe(t)){i={};for(var a in t)for(var o in t[a])i[o]=t[a][o].concat(i[o]?i[o]:[])}for(var n in s)e[n]=i[n]&&i[n].length%2===0?i[n].concat(s[n]):s[n];return e},De=function(s){for(var t={},e=0;e<s.length;e++)t[s[e].toUpperCase()]=s[e];return t},it=function(s,t){if(typeof s===ce&&s.length>0){for(var e in s)if(z(s[e])==z(t))return!0;return!1}return de(s)?z(t).indexOf(z(s))!==-1:!1},Oe=function(s,t){for(var e in s)return/^(browser|cpu|device|engine|os)$/.test(e)||(t?Oe(s[e]):!1)},de=function(s){return typeof s===Ye},Qe=function(s){if(s){for(var t=[],e=$(/\\?\"/g,s).split(","),i=0;i<e.length;i++)if(e[i].indexOf(";")>-1){var a=be(e[i]).split(";v=");t[i]={brand:a[0],version:a[1]}}else t[i]=be(e[i]);return t}},z=function(s){return de(s)?s.toLowerCase():s},Ke=function(s){return de(s)?$(/[^\d\.]/g,s).split(".")[0]:void 0},F=function(s){for(var t in s){var e=s[t];typeof e==ce&&e.length==2?this[e[0]]=e[1]:this[e]=void 0}return this},$=function(s,t){return de(t)?t.replace(s,re):t},me=function(s){return $(/\\?\"/g,s)},be=function(s,t){if(de(s))return s=$(/^\s\s*/,s),typeof t===V?s:s.substring(0,et)},Et=function(s,t){if(!(!s||!t))for(var e=0,i,a,o,n,h,g;e<t.length&&!h;){var w=t[e],p=t[e+1];for(i=a=0;i<w.length&&!h&&w[i];)if(h=w[i++].exec(s),h)for(o=0;o<p.length;o++)g=h[++a],n=p[o],typeof n===ce&&n.length>0?n.length===2?typeof n[1]==Je?this[n[0]]=n[1].call(this,g):this[n[0]]=n[1]:n.length===3?typeof n[1]===Je&&!(n[1].exec&&n[1].test)?this[n[0]]=g?n[1].call(this,g,n[2]):void 0:this[n[0]]=g?g.replace(n[1],n[2]):void 0:n.length===4&&(this[n[0]]=g?n[3].call(this,g.replace(n[1],n[2])):void 0):this[n]=g||void 0;e+=2}},Re=function(s,t){for(var e in t)if(typeof t[e]===ce&&t[e].length>0){for(var i=0;i<t[e].length;i++)if(it(t[e][i],s))return e===lt?void 0:e}else if(it(t[e],s))return e===lt?void 0:e;return t.hasOwnProperty("*")?t["*"]:s},vt={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"},Ct={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Mt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[c,[r,K+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[c,[r,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[r,c],[/opios[\/ ]+([\w\.]+)/i],[c,[r,pe+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[c,[r,pe+" GX"]],[/\bopr\/([\w\.]+)/i],[c,[r,pe]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[c,[r,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\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|duckduckgo|klar)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[r,c],[/\bddg\/([\w\.]+)/i],[c,[r,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[c,[r,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[c,[r,"WeChat"]],[/konqueror\/([\w\.]+)/i],[c,[r,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[c,[r,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[c,[r,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[c,[r,"Smart "+wt+X]],[/(avast|avg)\/([\w\.]+)/i],[[r,/(.+)/,"$1 Secure"+X],c],[/\bfocus\/([\w\.]+)/i],[c,[r,ge+" Focus"]],[/\bopt\/([\w\.]+)/i],[c,[r,pe+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[c,[r,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[c,[r,"Dolphin"]],[/coast\/([\w\.]+)/i],[c,[r,pe+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[c,[r,"MIUI"+X]],[/fxios\/([\w\.-]+)/i],[c,[r,K+ge]],[/\bqihu|(qi?ho?o?|360)browser/i],[[r,"360"+X]],[/\b(qq)\/([\w\.]+)/i],[[r,/(.+)/,"$1Browser"],c],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[r,/(.+)/,"$1"+X],c],[/samsungbrowser\/([\w\.]+)/i],[c,[r,Ce+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[r,/_/g," "],c],[/metasr[\/ ]?([\d\.]+)/i],[c,[r,kt+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[r,kt+" Mobile"],c],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[r,c],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[r],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[r,yt],c],[/(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,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[r,c],[/\bgsa\/([\w\.]+) .*safari\//i],[c,[r,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[c,[r,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[c,[r,Se+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[r,Se+" WebView"],c],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[c,[r,"Android"+X]],[/chrome\/([\w\.]+) mobile/i],[c,[r,K+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[r,c],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[c,[r,K+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[r,K+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[c,r],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[r,[c,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[r,c],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[r,K+ge],c],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[r,"Netscape"],c],[/(wolvic)\/([\w\.]+)/i],[r,c],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[c,[r,ge+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\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|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[r,[c,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[r,[c,/[^\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],[l,[u,Ce],[d,f]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[u,Ce],[d,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[u,he],[d,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[u,he],[d,f]],[/(macintosh);/i],[l,[u,he]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[u,ft],[d,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[u,mt],[d,f]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[u,mt],[d,b]],[/\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],[[l,/_/g," "],[u,$e],[d,b]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[u,$e],[d,f]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[u,"OPPO"],[d,b]],[/\b(opd2\d{3}a?) bui/i],[l,[u,"OPPO"],[d,f]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[u,"Vivo"],[d,b]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[l,[u,"Realme"],[d,b]],[/\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],[l,[u,bt],[d,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[u,bt],[d,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[u,We],[d,f]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[u,We],[d,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[u,wt],[d,f]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[u,"Nokia"],[d,b]],[/(pixel c)\b/i],[l,[u,ve],[d,f]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[u,ve],[d,b]],[/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],[l,[u,Me],[d,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[u,Me],[d,f]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[u,"OnePlus"],[d,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[u,Ee],[d,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[u,Ee],[d,b]],[/(playbook);[-\w\),; ]+(rim)/i],[l,u,[d,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[u,pt],[d,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[u,gt],[d,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[u,gt],[d,b]],[/(nexus 9)/i],[l,[u,"HTC"],[d,f]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[l,/_/g," "],[d,b]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[u,"Acer"],[d,f]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[u,"Meizu"],[d,b]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[l,[u,"Ulefone"],[d,b]],[/(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,l,[d,b]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[u,l,[d,f]],[/(surface duo)/i],[l,[u,Ae],[d,f]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[u,"Fairphone"],[d,b]],[/(shield[\w ]+) b/i],[l,[u,"Nvidia"],[d,f]],[/(sprint) (\w+)/i],[u,l,[d,b]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[u,Ae],[d,b]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[u,je],[d,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[u,je],[d,b]],[/smart-tv.+(samsung)/i],[u,[d,T]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[u,Ce],[d,T]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,We],[d,T]],[/(apple) ?tv/i],[u,[l,he+" TV"],[d,T]],[/crkey/i],[[l,Se+"cast"],[u,ve],[d,T]],[/droid.+aft(\w+)( bui|\))/i],[l,[u,Ee],[d,T]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[u,ft],[d,T]],[/(bravia[\w ]+)( bui|\))/i],[l,[u,Me],[d,T]],[/(mitv-\w{5}) bui/i],[l,[u,$e],[d,T]],[/Hbbtv.*(technisat) (.*);/i],[u,l,[d,T]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,be],[l,be],[d,T]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,T]],[/(ouya)/i,/(nintendo) (\w+)/i],[u,l,[d,J]],[/droid.+; (shield) bui/i],[l,[u,"Nvidia"],[d,J]],[/(playstation \w+)/i],[l,[u,Me],[d,J]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[u,Ae],[d,J]],[/((pebble))app/i],[u,l,[d,Pe]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[u,he],[d,Pe]],[/droid.+; (wt63?0{2,3})\)/i],[l,[u,je],[d,Pe]],[/droid.+; (glass) \d/i],[l,[u,ve],[d,ut]],[/(quest( \d| pro)?)/i],[l,[u,yt],[d,ut]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[d,Ze]],[/(aeobc)\b/i],[l,[u,Ee],[d,Ze]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[l,[d,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[d,f]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,f]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,b]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[c,[r,wi+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[c,[r,"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],[r,c],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[c,r]],os:[[/microsoft (windows) (vista|xp)/i],[r,c],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[r,[c,Re,vt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,Re,vt],[r,tt]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[c,/_/g,"."],[r,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[r,"macOS"],[c,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[c,r],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[r,c],[/\(bb(10);/i],[c,[r,pt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[c,[r,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[c,[r,ge+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[c,[r,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[c,[r,"watchOS"]],[/crkey\/([\d\.]+)/i],[c,[r,Se+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[r,"Chrome OS"],c],[/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],[r,c],[/(sunos) ?([\w\.\d]*)/i],[[r,"Solaris"],c],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[r,c]]},Te=function(){var s={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return F.call(s.init,[[I,[r,c,we,d]],[_,[M]],[R,[d,l,u]],[B,[r,c]],[P,[r,c]]]),F.call(s.isIgnore,[[I,[c,we]],[B,[c]],[P,[c]]]),F.call(s.isIgnoreRgx,[[I,/ ?browser$/i],[P,/ ?os$/i]]),F.call(s.toString,[[I,[r,c]],[_,[M]],[R,[u,l]],[B,[r,c]],[P,[r,c]]]),s}(),yi=function(s,t){var e=Te.init[t],i=Te.isIgnore[t]||0,a=Te.isIgnoreRgx[t]||0,o=Te.toString[t]||0;function n(){F.call(this,e)}return n.prototype.getItem=function(){return s},n.prototype.withClientHints=function(){return G?G.getHighEntropyValues(_t).then(function(h){return s.setCH(new Bt(h,!1)).parseCH().get()}):s.parseCH().get()},n.prototype.withFeatureCheck=function(){return s.detectFeature().get()},t!=Z&&(n.prototype.is=function(h){var g=!1;for(var w in this)if(this.hasOwnProperty(w)&&!it(i,w)&&z(a?$(a,this[w]):this[w])==z(a?$(a,h):h)){if(g=!0,h!=V)break}else if(h==V&&g){g=!g;break}return g},n.prototype.toString=function(){var h=re;for(var g in o)typeof this[o[g]]!==V&&(h+=(h?" ":re)+this[o[g]]);return h||V}),G||(n.prototype.then=function(h){var g=this,w=function(){for(var k in g)g.hasOwnProperty(k)&&(this[k]=g[k])};w.prototype={is:n.prototype.is,toString:n.prototype.toString};var p=new w;return h(p),p}),new n};function Bt(s,t){if(s=s||{},F.call(this,_t),t)F.call(this,[[st,Qe(s[q])],[at,Qe(s[di])],[b,/\?1/.test(s[gi])],[l,me(s[pi])],[Y,me(s[Ut])],[nt,me(s[mi])],[M,me(s[li])],[W,Qe(s[hi])],[Fe,me(s[ui])]]);else for(var e in s)this.hasOwnProperty(e)&&typeof s[e]!==V&&(this[e]=s[e])}function St(s,t,e,i){return this.get=function(a){return a?this.data.hasOwnProperty(a)?this.data[a]:void 0:this.data},this.set=function(a,o){return this.data[a]=o,this},this.setCH=function(a){return this.uaCH=a,this},this.detectFeature=function(){if(S&&S.userAgent==this.ua)switch(this.itemType){case I:S.brave&&typeof S.brave.isBrave==Je&&this.set(r,"Brave");break;case R:!this.get(d)&&G&&G[b]&&this.set(d,b),this.get(l)=="Macintosh"&&S&&typeof S.standalone!==V&&S.maxTouchPoints&&S.maxTouchPoints>2&&this.set(l,"iPad").set(d,f);break;case P:!this.get(r)&&G&&G[Y]&&this.set(r,G[Y]);break;case Z:var a=this.data,o=function(n){return a[n].getItem().detectFeature().get()};this.set(I,o(I)).set(_,o(_)).set(R,o(R)).set(B,o(B)).set(P,o(P))}return this},this.parseUA=function(){return this.itemType!=Z&&Et.call(this.data,this.ua,this.rgxMap),this.itemType==I&&this.set(we,Ke(this.get(c))),this},this.parseCH=function(){var a=this.uaCH,o=this.rgxMap;switch(this.itemType){case I:var n=a[at]||a[st],h;if(n)for(var g in n){var w=$(/(Google|Microsoft) /,n[g].brand||n[g]),p=n[g].version;!/not.a.brand/i.test(w)&&(!h||/chrom/i.test(h)&&!/chromi/i.test(w))&&(this.set(r,w).set(c,p).set(we,Ke(p)),h=w)}break;case _:var k=a[M];k&&(k&&a[Fe]=="64"&&(k+="64"),Et.call(this.data,k+";",o));break;case R:if(a[b]&&this.set(d,b),a[l]&&this.set(l,a[l]),a[l]=="Xbox"&&this.set(d,J).set(u,Ae),a[W]){var N;if(typeof a[W]!="string")for(var j=0;!N&&j<a[W].length;)N=Re(a[W][j++],Ct);else N=Re(a[W],Ct);this.set(d,N)}break;case P:var Q=a[Y];if(Q){var L=a[nt];Q==tt&&(L=parseInt(Ke(L),10)>=13?"11":"10"),this.set(r,Q).set(c,L)}this.get(r)==tt&&a[l]=="Xbox"&&this.set(r,"Xbox").set(c,void 0);break;case Z:var le=this.data,A=function(U){return le[U].getItem().setCH(a).parseCH().get()};this.set(I,A(I)).set(_,A(_)).set(R,A(R)).set(B,A(B)).set(P,A(P))}return this},F.call(this,[["itemType",s],["ua",t],["uaCH",i],["rgxMap",e],["data",yi(this,s)]]),this}function x(s,t,e){if(typeof s===ce?(Oe(s,!0)?(typeof t===ce&&(e=t),t=s):(e=s,t=void 0),s=void 0):typeof s===Ye&&!Oe(t,!0)&&(e=t,t=void 0),!(this instanceof x))return new x(s,t,e).getResult();var i=typeof s===Ye?s:S&&S.userAgent?S.userAgent:e&&e[ht]?e[ht]:re,a=new Bt(e,!0),o=t?fi(Mt,t):Mt,n=function(h){return h==Z?function(){return new St(h,i,o,a).set("ua",i).set(I,this.getBrowser()).set(_,this.getCPU()).set(R,this.getDevice()).set(B,this.getEngine()).set(P,this.getOS()).get()}:function(){return new St(h,i,o[h],a).parseUA().get()}};return F.call(this,[["getBrowser",n(I)],["getCPU",n(_)],["getDevice",n(R)],["getEngine",n(B)],["getOS",n(P)],["getResult",n(Z)],["getUA",function(){return i}],["setUA",function(h){return de(h)&&(i=h.length>et?be(h,et):h),this}]]).setUA(i),this}x.VERSION=ci;x.BROWSER=De([r,c,we,d]);x.CPU=De([M]);x.DEVICE=De([l,u,d,J,b,T,f,Pe,Ze]);x.ENGINE=x.OS=De([r,c]);class Ft{constructor(t,e){m(this,"config");m(this,"sdkConfig");this.config=t,this.sdkConfig=e}on(t,e,i){const a=function(n){n.data.message!==`kalamba:wrapper-rgs:${t}`&&n.data.message!==`kalamba:wrapper:${t}`||e(n.data.payload)};window.addEventListener("message",a,i)}send(t,...[e]){window.postMessage({message:`kalamba:rgs:${t}`,payload:e})}}class ki{constructor(t){m(this,"socket",null);m(this,"webSocketUrl");m(this,"eventListeners",{close:[],error:[],message:[]});m(this,"connect",async()=>{const t=new WebSocket(this.webSocketUrl);return t.addEventListener("message",this.handleMessage),new Promise(e=>{t.addEventListener("open",i=>{this.handleOpen(i),e(this.socket)},{once:!0})})});m(this,"send",t=>{if(this.socket==null)throw new Error("Cannot send message, the WebSocket connection is not open");this.socket.send(t)});m(this,"close",()=>{if(this.socket==null)throw new Error("Cannot close the WebSocket connection that is not open");this.socket.close()});m(this,"handleClose",t=>{this.eventListeners.close.forEach(e=>{e(t)}),this.socket.removeEventListener("message",this.handleMessage),this.socket.removeEventListener("close",this.handleClose),this.socket.removeEventListener("error",this.handleError),this.socket=null});m(this,"handleError",t=>{this.eventListeners.error.forEach(e=>{e(t)})});m(this,"handleMessage",t=>{this.eventListeners.message.forEach(e=>{e(t)})});m(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 i=this.eventListeners[t].indexOf(e);i!==-1&&this.eventListeners[t].splice(i,1)}}function Ie(s){return JSON.parse(s==null?void 0:s.data)}function Ei(s){var t;return((t=s==null?void 0:s.header)==null?void 0:t.name)==="Ping"}function Tt(s){var t;return((t=s==null?void 0:s.header)==null?void 0:t.name)==="RealityCheck"}function xe(s){return s.header.name==="GameEvent"}function vi(s){return xe(s)&&s.body.event==="OPEN_GAME"}function It(s){return s.header.code!==1}function Ci(s){return xe(s)&&s.body.event.includes("_RESULT")}var ee,fe;class Mi extends ki{constructor(e,i){const a=new URL(e.apiUrl);a.searchParams.set("cageCode",e.cageCode),a.searchParams.set("gameCode",e.gameCode),a.searchParams.set("operatorCode",e.operatorCode),a.searchParams.set("playMode",e.playMode),a.searchParams.set("token",e.token),a.searchParams.set("username",e.username);super(a.toString());m(this,"cId",0);m(this,"mId",0);m(this,"seqId",0);m(this,"gameCode");C(this,ee,void 0);C(this,fe,void 0);m(this,"onMessage",e=>{const i=Ie(e);(xe(i)||Ei(i)||Tt(i))&&this.sendAcknowledgement(i),Tt(i)&&this.handleRealityCheck(i)});this.eventListeners.realityCheck=[],this.gameCode=e.gameCode,E(this,ee,i.requestTimeoutMs),E(this,fe,i.gameVersion??"unknown"),this.addEventListener("message",this.onMessage)}handleRealityCheck(e){this.eventListeners.realityCheck.forEach(i=>{i(e.body)})}addEventListener(e,i){super.addEventListener(e,i)}removeEventListener(e,i){super.removeEventListener(e,i)}buildHeader(e,i=null){return{cId:i??++this.cId,code:i!==null?1:void 0,mId:++this.mId,name:e}}buildPayload(e,i){return JSON.stringify({body:i,header:e})}getBodyExtras(e){return{action:e,seqId:++this.seqId}}request(e,i){const a=this.buildPayload(e,i);return new Promise((o,n)=>{setTimeout(()=>n({type:"timeout"}),y(this,ee));const h=g=>{const w=Ie(g);try{e.cId===w.header.cId&&(this.removeEventListener("message",h),w.header.code===1?o(w):n({message:w,type:"error"}))}catch{n({message:w,type:"error"})}};this.addEventListener("message",h),this.send(a)})}freeRounds(e){const i=this.buildHeader("ActivateFreeRound");return this.request(i,e).then(a=>a.body).catch(a=>{var o;throw{data:(o=a==null?void 0:a.message)==null?void 0:o.body,type:a.type}})}async authenticate(e=!1){const i=this.buildHeader("Authenticate"),a={clientType:3,version:y(this,fe),reconnect:e};return this.request(i,a).then(o=>o.body).catch(o=>{var n;throw{data:(n=o==null?void 0:o.message)==null?void 0:n.body,type:o.type}})}async openGame(){const e=this.buildHeader("OpenGame"),i={gameCode:this.gameCode};return new Promise((a,o)=>{const n=h=>{const g=Ie(h);vi(g)?(this.removeEventListener("message",n),a(g.body)):It(g)&&o({data:g.body,type:"error"})};this.addEventListener("message",n),this.request(e,i).catch(h=>{var g;return o({data:(g=h==null?void 0:h.message)==null?void 0:g.body,type:h.type})})})}sendAcknowledgement(e){const{name:i,cId:a}=e.header,o=this.buildHeader(i,a),n=this.buildPayload(o,{});this.send(n)}sendAction(e,i){const a=this.buildHeader("GameAction"),o={...this.getBodyExtras(e),data:i};return new Promise((n,h)=>{const g=w=>{const p=Ie(w);xe(p)&&o.seqId===p.body.correlationSeqId&&(this.removeEventListener("message",g),Ci(p)?n(p.body):It(p)&&h({data:p.body,type:"error"}))};this.addEventListener("message",g),this.request(a,o).catch(w=>{var p;return h({data:(p=w==null?void 0:w.message)==null?void 0:p.body,type:w.type})})})}setRequestTimeoutMs(e){E(this,ee,e)}}ee=new WeakMap,fe=new WeakMap;function Dt(s){const t=s.contract;return t?{contract:{balance:{coins:t.balance,version:t.balanceVersion},coinValueInCents:t.coinValueInCents,country:t.countryCode,currency:t.currencyCode,jurisdiction:t.jurisdictionCode,uiMessages:t.uiMessages,username:t.username}}:{contract:{balance:{coins:s.balance,version:s.balanceVersion},coinValueInCents:s.coinValueInCents,country:s.countryCode,currency:s.currencyCode,jurisdiction:s.jurisdictionCode,uiMessages:s.uiMessages,username:s.username}}}function Nt(s){var t,e;return{code:((t=s.data)==null?void 0:t.code)??Be.RgsErrorCode.UNKNOWN,details:(e=s.data)==null?void 0:e.details}}function Gt(s,t){const e=t.contract;if(!e){const i=t.data;return{contract:{bet:{available:i.additionalConfigData.availableMultipliersPerBaseBet,default:{base:i.additionalConfigData.defaultBet.baseBet,multiplier:i.additionalConfigData.defaultBet.betMultiplier},max:i.additionalConfigData.maxAllowedOverallBetInCoins??null,last:i.gameState.betFromCurrentRound?{base:i.gameState.betFromCurrentRound.baseBet,multiplier:i.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:i.gameState.lastPlacedMainGameBet?{base:i.gameState.lastPlacedMainGameBet.baseBet,multiplier:i.gameState.lastPlacedMainGameBet.betMultiplier}:null},balance:{coins:t.balance,version:t.balanceVersion},freeRounds:(i.FREE_ROUNDS??[]).map(a=>({conf:{base:a.conf.baseBet,multiplier:a.conf.betMultiplier,numAwarded:a.conf.numAwarded},data:{numPlayed:a.data.numPlayed,win:a.data.winAmount,numLeft:a.data.numLeft},id:a.id,rejectable:a.rejectable,skippable:a.skippable,status:a.status,type:a.type})),gameModel:i.additionalConfigData.gameModelFile,metaData:i.gameConfigData.metaData,roundId:i.gameState.cycleId,serverTime:t.balanceVersion,sessionId:i.gameState.sessionId,stateType:{thisRound:i.gameState.stateTypeThisRound,nextRound:i.gameState.stateTypeNextRound},uiMessages:s.uiMessages,win:{max:i.maxWin??null,round:i.gameState.totalWinFromCurrentRound,total:i.gameState.totalWinFromCurrentGameCycle}},data:i}}return{contract:{bet:{available:e.availableMultipliersPerBaseBet,default:{base:e.defaultBet.baseBet,multiplier:e.defaultBet.betMultiplier},max:e.maxBetInCoins??null,last:e.lastBet?{base:e.lastBet.baseBet,multiplier:e.lastBet.betMultiplier}:null,lastPaid:e.lastMainGameBet?{base:e.lastMainGameBet.baseBet,multiplier:e.lastMainGameBet.betMultiplier}:null},balance:{coins:e.balanceInCoins,version:e.balanceVersion},freeRounds:(e.freeRounds??[]).map(i=>({conf:{base:i.conf.baseBet,multiplier:i.conf.betMultiplier,numAwarded:i.conf.numAwarded},data:{numPlayed:i.data.numPlayed,win:i.data.winAmount,numLeft:i.data.numLeft},id:i.id,rejectable:i.rejectable,skippable:i.skippable,status:i.status,type:i.type})),gameModel:e.gameModelFile,metaData:e.metaData,roundId:e.roundId,serverTime:e.serverTime,sessionId:e.sessionId,stateType:{thisRound:e.stateTypeThisRound,nextRound:e.stateTypeNextRound},uiMessages:s.contract.uiMessages.concat(e.uiMessages),win:{max:e.maxWinInCoins??null,round:e.roundWin,total:e.totalWin}},data:t.opaqueGameServerToUi}}function Ht(s){var t,e;return{code:((t=s.data)==null?void 0:t.code)??Be.RgsErrorCode.UNKNOWN,details:(e=s.data)==null?void 0:e.details}}function Vt(s){const t=s.contract;if(!t){const e=s.data;return{contract:{bet:{last:e.gameState.betFromCurrentRound?{base:e.gameState.betFromCurrentRound.baseBet,multiplier:e.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:{base:(e.gameState.lastPlacedMainGameBet??e.gameState.betFromCurrentRound).baseBet,multiplier:(e.gameState.lastPlacedMainGameBet??e.gameState.betFromCurrentRound).betMultiplier}},balance:{coins:s.balance,version:s.balanceVersion},freeRounds:(e.FREE_ROUNDS??[]).map(i=>({conf:{base:i.conf.baseBet,multiplier:i.conf.betMultiplier,numAwarded:i.conf.numAwarded},data:{numPlayed:i.data.numPlayed,win:i.data.winAmount,numLeft:i.data.numLeft},id:i.id,rejectable:i.rejectable,skippable:i.skippable,status:i.status,type:i.type})),serverTime:s.balanceVersion,roundId:e.gameState.cycleId,stateType:{thisRound:e.gameState.stateTypeThisRound,nextRound:e.gameState.stateTypeNextRound},uiMessages:e.uiMessages,win:{round:e.gameState.totalWinFromCurrentRound,total:e.gameState.totalWinFromCurrentGameCycle}},data:e}}return{contract:{bet:{last:t.lastBet?{base:t.lastBet.baseBet,multiplier:t.lastBet.betMultiplier}:null,lastPaid:{base:t.lastMainGameBet.baseBet,multiplier:t.lastMainGameBet.betMultiplier}},balance:{coins:t.balanceInCoins,version:t.balanceVersion},freeRounds:(t.freeRounds??[]).map(e=>({conf:{base:e.conf.baseBet,multiplier:e.conf.betMultiplier,numAwarded:e.conf.numAwarded},data:{numPlayed:e.data.numPlayed,win:e.data.winAmount,numLeft:e.data.numLeft},id:e.id,rejectable:e.rejectable,skippable:e.skippable,status:e.status,type:e.type})),serverTime:t.serverTime,roundId:t.roundId,stateType:{thisRound:t.stateTypeThisRound,nextRound:t.stateTypeNextRound},uiMessages:t.uiMessages,win:{round:t.roundWin,total:t.totalWin}},data:s.opaqueGameServerToUi}}function zt(s){var t,e;return{code:((t=s.data)==null?void 0:t.code)??Be.RgsErrorCode.UNKNOWN,details:(e=s.data)==null?void 0:e.details}}const Si={parseAuthenticateResponse:Dt,parseAuthenticateError:Nt,parseOpenGameResponse:Gt,parseOpenGameError:Ht,parsePlayResponse:Vt,parsePlayError:zt},Ti={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"},{device:Ii}=x(navigator.userAgent),Pi=O("KalambaBullseyePlugin","color:#000000;font-weight:bold;");class Ai extends Ft{constructor(...e){super(...e);m(this,"socket");this.on("openGame",async()=>{try{const i=await this.openGame();this.send("openGameResponse",i)}catch(i){this.send("openGameError",i)}}),this.on("play",async i=>{try{const a=await this.play(i);this.send("playResponse",a)}catch(a){this.send("playError",a)}}),this.on("freeRounds",async i=>{try{await this.socket.freeRounds(i),this.send("freeRoundsResponse",i)}catch(a){this.send("freeRoundsError",a)}}),this.on("configured",i=>{this.socket.setRequestTimeoutMs(i.ui.requestTimeoutMs)}),this.registerFromSdkEvents()}initialize(e){this.socket=new Mi(e,{gameVersion:this.config.gameVersion,requestTimeoutMs:this.sdkConfig.ui.requestTimeoutMs}),["fireboltroulette"].includes(e.gameCode)||(this.socket.addEventListener("close",i=>{i.code===1008?this.send("error",{type:"CLOSE",messageCode:"TOO_MANY_OPEN_GAMES",messageKey:"RgsError.TOO_MANY_OPEN_GAMES"}):i.code===1011||this.reconnect()}),["mobile","tablet"].includes(Ii.type??"")&&document.addEventListener("visibilitychange",async()=>{document.hidden||(this.socket.socket?this.socket.socket&&[WebSocket.CONNECTING,WebSocket.OPEN].includes(this.socket.socket.readyState)&&this.socket.close():this.reconnect())})),this.socket.addEventListener("error",i=>Pi("error",i)),this.socket.addEventListener("realityCheck",i=>{this.send("realityCheck",i)})}async reconnect(){try{await this.socket.connect(),await this.socket.authenticate(!0),await this.socket.openGame()}catch{this.send("error",{type:"CLOSE",messageCode:"CONNECTION_ERROR",messageKey:"RgsError.CONNECTION_ERROR"})}}async openGame(){const e=new URLSearchParams(window.location.search),i=e.get("apiUrl"),a=e.get("cageCode"),o=e.get("gameCode"),n=e.get("operatorCode"),h=e.get("playMode"),g=e.get("token"),w=e.get("username"),p=e.get("gameHistoryUrl"),k=e.get("homeUrl")??void 0,N=e.get("cashierUrl")??void 0;this.initialize({apiUrl:i,cageCode:a,gameCode:o,operatorCode:n,playMode:h,token:g,username:w});try{await this.socket.connect()}catch{throw{type:"error",data:{code:Be.RgsErrorCode.CONNECTION_ERROR}}}let j;try{j=await this.socket.authenticate()}catch(U){throw{type:U.type,data:U.type==="error"?Nt(U.data):void 0}}let Q;try{Q=await this.socket.openGame()}catch(U){throw{type:U.type,data:U.type==="error"?Ht(U.data):void 0}}const L=Dt(j),le=Gt(j,Q);this.sdkConfig.api={...this.sdkConfig.api,brand:a,game:o,integration:n,jurisdiction:L.contract.jurisdiction,playMode:h,user:L.contract.username,integrationData:{token:g},country:L.contract.country,currency:L.contract.currency,coinValueInCents:L.contract.coinValueInCents,gameHistoryUrl:p,homeUrl:k,cashierUrl:N,backendSessionId:le.contract.sessionId,lastRoundId:le.contract.roundId};const A=e.get("languageCode");return A&&(this.sdkConfig.ui.language=A.length===3?Ti[A]??A:A),le}async play(e){for(;!this.socket.socket;)await new Promise(k=>setTimeout(()=>k(),500));const{contract:{bet:i,forcedOutcomes:a,...o},extra:n,payloadToInject:h,actionType:g}=e,w={bet:i?{baseBet:i.base,betMultiplier:i.multiplier}:void 0,forcedOutcomes:a,...o,...h,opaqueUiToGameServer:n};let p;try{p=await this.socket.sendAction(g,w)}catch(k){throw{type:k.type,data:k.type==="error"?zt(k.data):void 0}}return Vt(p)}registerFromSdkEvents(){this.on("history",()=>{const{api:{game:e,integration:i,integrationData:a,jurisdiction:o,user:n,gameHistoryUrl:h},ui:{language:g}}=this.sdkConfig,w=n.replace(/^user_/,"").replace(new RegExp(`_${i}$`),""),p=new URL(window.location.href);p.hostname=p.hostname.replace(/^v\./,"").replace(/^play\./,"history."),p.pathname=p.pathname.replace(/(\/[0-9]+\.[0-9]+\.[0-9]+)?\/wrapper\.html/,"/list/index.html"),p.search="",p.searchParams.set("apiUrl",new URL(h).origin),p.searchParams.set("gameCode",e),p.searchParams.set("jurisdiction",o),p.searchParams.set("operatorCode",i),p.searchParams.set("token",a.token),p.searchParams.set("username",w),p.searchParams.set("languageCode",g),this.config.gameHistoryUrl&&p.searchParams.set("gameHistoryUrl",this.config.gameHistoryUrl),window.open(p.toString(),"_blank")})}}class qt{constructor(t,e,i){m(this,"trackers");m(this,"config");m(this,"sdkConfig");this.trackers=t,this.config=e,this.sdkConfig=i}on(t,e,i){const a=function(n){n.data.message!==`kalamba:wrapper-telemetry:${t}`&&n.data.message!==`kalamba:wrapper:${t}`||e(n.data.payload)};window.addEventListener("message",a,i)}track(t,e){this.trackers.forEach(i=>i.track(t,e))}}function Pt(s){return s.reduce((t,e)=>t+e,0)}function Oi(s){const t=s.length,e=Pt(s)/t,i=s.map(o=>Math.pow(o-e,2)),a=Pt(i)/t;return Math.sqrt(a)}class At{constructor(){m(this,"rafId",-1);m(this,"startTime",0);m(this,"stopTime",0);m(this,"frames",[]);m(this,"calculateFPS",()=>{const t=Math.floor((this.stopTime-this.startTime)/1e3);return this.frames.map(e=>Math.floor((e-this.startTime)/1e3)).reduce((e,i,a,o)=>(o[a]!==o[a-1]?e.push(1):e[e.length-1]++,e),[]).slice(0,t)});m(this,"getReport",()=>{const t=this.calculateFPS(),e=Math.floor(this.frames.length/((this.stopTime-this.startTime)/1e3)),i=t.length>0?Math.max(...t):e,a=t.length>0?Math.min(...t):e,o=t.length>0?Oi(t):0;return{fpsAvg:e,fpsMax:i,fpsMin:a,fpsStdDev:o}});m(this,"start",()=>{this.startTime=Date.now(),this.frames=[],this.trackFrames()});m(this,"stop",()=>{cancelAnimationFrame(this.rafId),this.stopTime=Date.now()});m(this,"trackFrames",()=>{this.frames.push(Date.now()),this.rafId=requestAnimationFrame(this.trackFrames)})}}const Ri="landscape",xi="portrait";function Li(){try{const s=document.createElement("canvas");return!!window.WebGLRenderingContext&&(s.getContext("webgl")||s.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function Ui(){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?Ri:xi}var Le,te,ie,se,ye,Ue,ke,_e;class _i extends qt{constructor(...e){super(...e);m(this,"FPS_SAMPLE_INTERVAL",1e4);C(this,Le,0);C(this,te,void 0);C(this,ie,void 0);C(this,se,void 0);C(this,ye,!1);C(this,Ue,!1);C(this,ke,"");C(this,_e,[]);E(this,ie,{}),E(this,se,this.deviceInfo()),E(this,te,this.config.gameVersion),this.on("state",({balance:i})=>{E(this,Le,i)}),this.on("autoplay",({action:i})=>{["start","resume"].includes(i)?E(this,ye,!0):E(this,ye,!1)}),this.on("settings",({fastPlay:i})=>{i!==void 0&&E(this,Ue,i)}),this.registerEvents()}async registerEvents(){y(this,se).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.messageCode,systemMessageType:e.type})}),this.on("openGameResponse",async e=>{E(this,ke,e.contract.stateType.nextRound),E(this,ie,{balanceInCoins:e.contract.balance.coins,clientVersion:y(this,te),coinValueInCents:this.sdkConfig.api.coinValueInCents,coinValueInCentsFloat:this.sdkConfig.api.coinValueInCents,currency:this.sdkConfig.api.currency,defaultBaseBet:e.contract.bet.default.base,defaultBetMultiplier:e.contract.bet.default.multiplier,environment:"release",gameCode:this.sdkConfig.api.game,gameCodeServer:this.sdkConfig.api.game,gameModelFile:e.contract.gameModel,jurisdiction:this.sdkConfig.api.jurisdiction,languageCode:this.sdkConfig.ui.language,operatorName:"kalamba",partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,referrer:window.location.hostname,rootTrackingSessionID:this.sdkConfig.api.sessionId,backendSessionID:this.sdkConfig.api.backendSessionId,serverVersion:e.contract.metaData.version}),this.track("Game Open",y(this,ie))}),this.on("playCycleEnd",async e=>{const i=await y(this,se),{base:a,multiplier:o,specialAction:n}=e.contract.bet.lastPaid??{},h=e.contract.balance.coins,g=e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier,w=e.contract.win.total,p=w-g,k=n||"spin",N=e.contract.roundId;this.track("Betting Activity",{balance:h-p,balanceAfter:h,baseBet:a,betMultiplier:o,betType:k,gameVersion:y(this,te),coinValueInCents:this.sdkConfig.api.coinValueInCents,coinValueInCentsFloat:this.sdkConfig.api.coinValueInCents,currency:this.sdkConfig.api.currency,environment:"release",gameCode:this.sdkConfig.api.game,gameCodeServer:this.sdkConfig.api.game,isMobile:i.isMobile,netResult:p,operatorName:"kalamba",orientation:Xe(),partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,roundId:N,roundTypes:["BaseGame"],totalBet:g,totalWin:w}),E(this,_e,[])}),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 At,i=()=>{e.stop();const o=e.getReport();this.track("FPS Performance",{...o,fpsType:"sample"}),a()},a=async()=>{e.start(),setTimeout(i,this.FPS_SAMPLE_INTERVAL)};a()}reportFpsRound(){const e=new At;this.on("playCycleStart",()=>{e.start()}),this.on("playCycleEnd",()=>{e.stop();const i=e.getReport();this.track("FPS Performance",{...i,fpsType:"playCycleStart->playCycleEnd"})})}getExtraUiInteractionData(){return{orientation:Xe(),stateType:y(this,ke)}}async deviceInfo(){var h;const{browser:e,device:i,os:a}=x(navigator.userAgent),o=Li(),n=await Ui();return{browserName:e.name,browserVersion:e.version,connection:(h=navigator.connection)==null?void 0:h.effectiveType,deviceName:i.model,deviceType:i.type,isMobile:["mobile","tablet"].includes(i.type??""),isWebGLSupported:o,isWebPSupported:n,manufacturer:i.vendor,operatingSystem:a.name,operatingSystemVersion:a.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,te=new WeakMap,ie=new WeakMap,se=new WeakMap,ye=new WeakMap,Ue=new WeakMap,ke=new WeakMap,_e=new WeakMap;class ot{constructor(t,e){m(this,"config");m(this,"sdkConfig");this.config=t,this.sdkConfig=e}}const Ot=25,Rt=1e4;var ae,ne,oe,H;class Bi extends ot{constructor(...e){super(...e);C(this,ae,"https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");C(this,ne,void 0);C(this,oe,void 0);C(this,H,[]);m(this,"processQueueForced");E(this,ne,new Date().getTime()),E(this,H,[]),this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(y(this,ae),{method:"OPTIONS"}).catch(Ne.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,oe)&&clearTimeout(y(this,oe)),E(this,oe,window.setTimeout(()=>this.processQueue(),Rt))}send(e){E(this,ne,new Date().getTime());try{navigator.sendBeacon(y(this,ae),JSON.stringify(e))}catch{fetch(y(this,ae),{body:JSON.stringify(e),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(Ne.noop)}this.schedule()}addToQueue(e){y(this,H).push(e),this.processQueue()}processQueue(e=!1){if(!(this.sdkConfig==null||!this.sdkConfig.ui.feature.allowTelemetry)&&!(!e&&y(this,H).length<Ot&&new Date().getTime()-y(this,ne)<Rt))for(;y(this,H).length;){const i=y(this,H).splice(0,Ot).map(a=>({...a,sessionID:this.sdkConfig.api.sessionId,userID:this.sdkConfig.api.user}));this.send(i)}}track(e,i){this.addToQueue({eventName:e,eventParams:i,eventTimestamp:new Date().getTime(),eventUUID:Ne.v4()})}}ae=new WeakMap,ne=new WeakMap,oe=new WeakMap,H=new WeakMap;const Fi=O("LoggingTracker","color:#000000;font-weight:bold;");class Di extends ot{track(t,e){Fi(`@${this.sdkConfig.api.user}`,`[${t}]`,e)}}exports.BasicPlugin=Qt;exports.CasinoPlugin=D;exports.DebuggingPlugin=Xt;exports.GigPlugin=Yt;exports.KalambaBullseyeParsers=Si;exports.KalambaBullseyePlugin=Ai;exports.KalambaStargazerPlugin=_i;exports.KalambaStargazerTracker=Bi;exports.LoggingTracker=Di;exports.OryxPlugin=ei;exports.PariplayPlugin=ai;exports.QuantaPlugin=ri;exports.RelaxFEIMPlugin=ni;exports.RgsPlugin=Ft;exports.TelemetryPlugin=qt;exports.Tracker=ot;exports.TukoPlugin=oi;
|
|
5
|
+
"use strict";var Xt=Object.defineProperty;var lt=s=>{throw TypeError(s)};var Jt=(s,t,e)=>t in s?Xt(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var m=(s,t,e)=>Jt(s,typeof t!="symbol"?t+"":t,e),ut=(s,t,e)=>t.has(s)||lt("Cannot "+e);var y=(s,t,e)=>(ut(s,t,"read from private field"),e?e.call(s):t.get(s)),C=(s,t,e)=>t.has(s)?lt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),E=(s,t,e,i)=>(ut(s,t,"write to private field"),i?i.call(s,e):t.set(s,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Fe=require("./errors-BXO3dlhS.cjs"),at=require("./v4-C9_uc0A9.cjs");function O(s,t){return(e,...i)=>{console.log(`[%c${s}\x1B[m] %s`,t,e,...i)}}function Ft(s,t){return Math.round(s*100/t)}class F{constructor(t,e){m(this,"config");m(this,"sdkConfig");this.config=t,this.sdkConfig=e}on(t,e,i){const a=function(n){n.data.message!==`kalamba:wrapper-casino:${t}`&&n.data.message!==`kalamba:wrapper:${t}`||e(n.data.payload)};window.addEventListener("message",a,i)}send(t,...[e]){window.postMessage({message:`kalamba:casino:${t}`,payload:e})}}const Yt=O("BasicPlugin","color:#000000;font-weight:bold;");class Zt extends F{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Yt("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,payload:i}=t.data;switch(e){case"doAudioSettings":this.send("settings",{music:i==null?void 0:i.musicEnabled,sounds:i==null?void 0:i.soundEnabled});return;case"doBalanceUpdate":const{currency:a,coinValueInCents:r}=this.sdkConfig.api;i.currency===a&&typeof i.balanceInCurrency=="number"?this.send("balance",{balance:Ft(i.balanceInCurrency,r)}):(i.balanceInCoins,this.send("balance",{balance:i.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.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}const v=O("▼ DebuggingPlugin IN ▼","color:#444444;font-weight:bold;"),ei=O("▲ DebuggingPlugin OUT ▲","color:#444444;font-weight:bold;");class ti extends F{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=>v("autoplay",t)),this.on("balance",t=>v("balance",t)),this.on("bet",t=>v("bet",t)),this.on("cashier",t=>v("cashier",t)),this.on("choice",t=>v("choice",t)),this.on("close",t=>v("close",t)),this.on("error",t=>v("error",t)),this.on("loadEnd",t=>v("loadEnd",t)),this.on("loadProgress",t=>v("loadProgress",t)),this.on("loadStart",t=>v("loadStart",t)),this.on("playCycleStart",t=>v("playCycleStart",t)),this.on("playCycleEnd",t=>v("playCycleEnd",t)),this.on("playEnd",t=>v("playEnd",t)),this.on("playError",t=>v("playError",t)),this.on("playReady",t=>v("playReady",t)),this.on("playStart",t=>v("playStart",t)),this.on("settings",t=>v("settings",t))}_send(...t){ei(...t),this.send(...t)}}const ii=O("GigPlugin","color:#000000;font-weight:bold;");class si extends F{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),ii("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.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}}),this.on("playReady",()=>{this.postMessage("GAME_READY")})}}const ai=O("OryxPlugin","color:#000000;font-weight:bold;");class ni extends F{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),ai("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,param:i}=t.data;switch(e){case"doBalanceUpdate":this.send("balance",{balance:i});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 Ge=O("PariplayPlugin","color:#000000;font-weight:bold;");function He(s){try{window.top.location=s}catch{window.location=s}}function Ve(s,t){return new Promise(function(i,a){const r=new XMLHttpRequest;r.onload=function(){r.status>=200&&r.status<300?i(r.responseText):a(r.responseText)},r.open(s,t),r.send()})}function ze(){}function oi(s){return s.filter(function(e){return e.messageType.toUpperCase()==="DATA"})}function qe(s){return s.filter(function(e){return["NOTIFICATION","POPUP"].includes(e.messageType.toUpperCase())})}function Nt(s){try{return JSON.parse(s.text)}catch{return{}}}function ri(s){return s.map(Nt).filter(Boolean).find(function(e){return e.betId!=null&&e.winId!=null})||{}}function ci(s){return s.map(Nt).filter(Boolean).find(function(e){return e.TotalBet!=null&&e.TotalWin!=null})||{}}class di extends F{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Ge("configured")}postMessage(t,e){const i={lang:this.sdkConfig.ui.language,sender:this.sdkConfig.api.game,type:t};e!=null&&(i.data=e),Ge("postMessage",i),window.parent.postMessage(i,"*")}coinsToCurrency(t){return t*this.sdkConfig.api.coinValueInCents/100}handleContinueButton(t,e){t.link&&Ve("GET",t.link),e()}handleLinkButton(t,e){switch(t.linkType.toUpperCase()){case"AJAX":Ve("GET",t.link),e();return;case"AJAXRESPONSE":Ve("GET",t.link).then(()=>{e()});return;case"REDIRECT":He(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,i)=>e.then(()=>new Promise(a=>{const r=Object.assign({},i,{buttons:i.buttons.filter(n=>n.action.toUpperCase()==="CASHIER"?!!this.sdkConfig.api.cashierUrl:!0).map(n=>Object.assign({},n,{onRelease:()=>{const h=i.messageType.toUpperCase()==="POPUP"?ze:a,g=this.buttonActions[n.action.toUpperCase()];g?g(n,h):h()}}))});Ge("showMessage",r)}).catch(ze)),Promise.resolve()).then(()=>{}).catch(ze)}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 i;try{const a=JSON.parse(JSON.parse(atob(this.sdkConfig.api.integrationData.token.split(".")[1])).token),r=JSON.parse(a.integrationSpecificAttributes.sessionData||"{}");i={ClientToken:a.integrationSpecificAttributes.clientToken,CurrencyCode:a.currency,PlayerTokenId:a.user,SessionData:r}}catch{i=void 0}this.postMessage("gameDataLoaded",{LoadGameData:i,success:!0});try{const a=qe(e.contract.uiMessages);this.processInfoUiMessages(a)}catch{}}),this.on("balance",({balance:e})=>{t!==e&&(t=e,this.postMessage("balance",{amount:this.coinsToCurrency(e)}))}),this.on("close",()=>{if(this.sdkConfig.api.homeUrl)if(this.sdkConfig.api.homeUrl==="(back)")try{window.top.history.back()}catch{window.history.back()}else this.sdkConfig.api.homeUrl==="(api)"?this.postMessage("quit"):He(this.sdkConfig.api.homeUrl)}),this.on("playEnd",e=>{this.postMessage("roundEnded",{balanceAfter:this.coinsToCurrency(e.contract.balance.coins),win:this.coinsToCurrency(e.contract.win.round)});try{const i=qe(e.contract.uiMessages);this.processInfoUiMessages(i)}catch{}}),this.on("playError",e=>{var i,a;this.postMessage("ticketReceived",{ErrorCode:(i=e.data)==null?void 0:i.code,ErrorMessage:"ERROR",Status:{ErrCode:(a=e.data)==null?void 0:a.code}})}),this.on("playResponse",e=>{this.postMessage("roundStarted",{balanceBefore:this.coinsToCurrency(e.contract.balance.coins+e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier)});const i=["BaseGame","PaidSpin"].includes(e.contract.stateType.thisRound),a=oi(e.contract.uiMessages),r=qe(e.contract.uiMessages),n=ri(a),h=ci(a);this.postMessage("ticketReceived",{Balance:this.coinsToCurrency(e.contract.balance.coins),BetAmount:i?this.coinsToCurrency(e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier):0,CreditTransactionId:n.betId,DebitTransactionId:n.winId,Message:r,SessionData:h,Status:{ErrCode:0},WinAmount:this.coinsToCurrency(e.contract.win.round)})}),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.sdkConfig.api.cashierUrl&&(this.sdkConfig.api.cashierUrl==="(api)"?this.postMessage("cashier"):He(this.sdkConfig.api.cashierUrl))})}}const ue=O("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class li extends F{constructor(...e){super(...e);m(this,"VERSION","1.17.0");const i=document.createElement("script");i.src=`https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`,i.onload=()=>{ue("loaded"),window.FEIM.configure({p2pConfig:{currency:this.sdkConfig.api.currency,launchParams:{homeurl:"homeUrl"}}}),ue("configured"),this.registerToSdkEvents(),this.registerFromSdkEvents()},document.body.appendChild(i)}registerToSdkEvents(){window.FEIM.on.errorMessageDismissed(()=>this.send("unfreeze")),window.FEIM.on.errorMessageDisplayed(()=>this.send("freeze")),window.FEIM.on.exitingGame(()=>ue("!!! NOT IMPLEMENTED: exitingGame !!!")),window.FEIM.on.freeze(()=>this.send("freeze")),window.FEIM.on.initialized(()=>ue("!!! NOT IMPLEMENTED: initialized !!!")),window.FEIM.on.pauseAutoPlay(()=>this.send("suspend")),window.FEIM.on.refreshBalance(()=>ue("!!! NOT IMPLEMENTED: refreshBalance !!!")),window.FEIM.on.toggleGameHelp(()=>{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:i})=>{window.FEIM.send.betUpdate(e*i)}),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 i={balance:e.contract.balance.coins,bet:e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier,win:{win:e.contract.win.total}};window.FEIM.send.roundFinished(i)}),this.on("playResponse",e=>{const i={balance:e.contract.balance.coins,playResponse:e.data};window.FEIM.send.roundStarted(i)}),this.on("history",()=>{window.FEIM.send.showHistory()}),this.on("settings",e=>{window.FEIM.send.updateSettings(e)})}}const We=O("TukoPlugin","color:#000000;font-weight:bold;");class ui extends F{constructor(...e){super(...e);m(this,"PING_INTERVAL",1e4);const a=new URLSearchParams(window.location.search).get("pingCallbackUrl");a&&window.setInterval(()=>{this.ping(a)},this.PING_INTERVAL),this.registerToSdkEvents(),this.registerFromSdkEvents(),We("configured")}ping(e){const i=new XMLHttpRequest;i.onreadystatechange=function(){i.readyState===XMLHttpRequest.DONE&&(i.status===0||i.status>=200&&i.status<400?We("ping ok",i):We("ping error",i))},i.open("GET",e),i.send()}registerToSdkEvents(){window.addEventListener("message",e=>{try{const{type:i,payload:a}=e.data;switch(i){case"doAudioSettings":this.send("settings",{music:a==null?void 0:a.musicEnabled,sounds:a==null?void 0:a.soundEnabled});return;case"doBalanceUpdate":const{currency:r,coinValueInCents:n}=this.sdkConfig.api;a.currency===r&&typeof a.balanceInCurrency=="number"?this.send("balance",{balance:Ft(a.balanceInCurrency,n)}):(a.balanceInCoins,this.send("balance",{balance:a.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.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}const ht=O("QuantaPlugin","color:#000000;font-weight:bold;");class hi extends F{constructor(...t){super(...t),this.registerFromSdkEvents(),ht("configured")}postMessage(t){const e={event:t};ht("QuantaPlugin::postMessage",e),window.parent.postMessage(e,"*")}registerFromSdkEvents(){this.on("close",()=>{this.postMessage("GameClosed")}),this.on("loadEnd",()=>{this.postMessage("GameLoaded")}),this.on("playCycleStart",()=>{this.postMessage("RoundStarted")}),this.on("playCycleEnd",()=>{this.postMessage("RoundEnded")}),this.on("playError",()=>{this.postMessage("RoundEnded")})}}var gi="2.0.0-beta.3",re="",gt="?",Ye="function",H="undefined",ce="object",Ze="string",we="major",l="model",o="name",d="type",u="vendor",c="version",M="architecture",J="console",b="mobile",f="tablet",I="smarttv",Ae="wearable",pt="xr",et="embedded",mt="user-agent",tt=500,nt="brands",W="formFactors",ot="fullVersionList",Y="platform",rt="platformVersion",Ne="bitness",z="sec-ch-ua",pi=z+"-full-version-list",mi=z+"-arch",wi=z+"-"+Ne,bi=z+"-form-factors",fi=z+"-"+b,yi=z+"-"+l,Dt=z+"-"+Y,ki=Dt+"-version",Gt=[nt,ot,b,l,Y,rt,M,W,Ne],T="browser",L="cpu",R="device",_="engine",P="os",Z="result",ve="Amazon",he="Apple",wt="ASUS",bt="BlackBerry",Ce="Google",ft="Huawei",yt="Lenovo",$e="LG",Oe="Microsoft",kt="Motorola",Me="Samsung",Et="Sharp",Se="Sony",je="Xiaomi",Ke="Zebra",Q="Mobile ",X=" Browser",Ie="Chrome",Ei="Edge",ge="Firefox",pe="Opera",vt="Facebook",Ct="Sogou",it="Windows",vi=typeof window!==H,S=vi&&window.navigator?window.navigator:void 0,D=S&&S.userAgentData?S.userAgentData:void 0,Ci=function(s,t){var e={},i=t;if(!Re(t)){i={};for(var a in t)for(var r in t[a])i[r]=t[a][r].concat(i[r]?i[r]:[])}for(var n in s)e[n]=i[n]&&i[n].length%2===0?i[n].concat(s[n]):s[n];return e},De=function(s){for(var t={},e=0;e<s.length;e++)t[s[e].toUpperCase()]=s[e];return t},st=function(s,t){if(typeof s===ce&&s.length>0){for(var e in s)if(V(s[e])==V(t))return!0;return!1}return de(s)?V(t).indexOf(V(s))!==-1:!1},Re=function(s,t){for(var e in s)return/^(browser|cpu|device|engine|os)$/.test(e)||(t?Re(s[e]):!1)},de=function(s){return typeof s===Ze},Qe=function(s){if(s){for(var t=[],e=$(/\\?\"/g,s).split(","),i=0;i<e.length;i++)if(e[i].indexOf(";")>-1){var a=be(e[i]).split(";v=");t[i]={brand:a[0],version:a[1]}}else t[i]=be(e[i]);return t}},V=function(s){return de(s)?s.toLowerCase():s},Xe=function(s){return de(s)?$(/[^\d\.]/g,s).split(".")[0]:void 0},B=function(s){for(var t in s){var e=s[t];typeof e==ce&&e.length==2?this[e[0]]=e[1]:this[e]=void 0}return this},$=function(s,t){return de(t)?t.replace(s,re):t},me=function(s){return $(/\\?\"/g,s)},be=function(s,t){if(de(s))return s=$(/^\s\s*/,s),typeof t===H?s:s.substring(0,tt)},Mt=function(s,t){if(!(!s||!t))for(var e=0,i,a,r,n,h,g;e<t.length&&!h;){var w=t[e],p=t[e+1];for(i=a=0;i<w.length&&!h&&w[i];)if(h=w[i++].exec(s),h)for(r=0;r<p.length;r++)g=h[++a],n=p[r],typeof n===ce&&n.length>0?n.length===2?typeof n[1]==Ye?this[n[0]]=n[1].call(this,g):this[n[0]]=n[1]:n.length===3?typeof n[1]===Ye&&!(n[1].exec&&n[1].test)?this[n[0]]=g?n[1].call(this,g,n[2]):void 0:this[n[0]]=g?g.replace(n[1],n[2]):void 0:n.length===4&&(this[n[0]]=g?n[3].call(this,g.replace(n[1],n[2])):void 0):this[n]=g||void 0;e+=2}},xe=function(s,t){for(var e in t)if(typeof t[e]===ce&&t[e].length>0){for(var i=0;i<t[e].length;i++)if(st(t[e][i],s))return e===gt?void 0:e}else if(st(t[e],s))return e===gt?void 0:e;return t.hasOwnProperty("*")?t["*"]:s},St={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"},It={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Tt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[c,[o,Q+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[c,[o,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[o,c],[/opios[\/ ]+([\w\.]+)/i],[c,[o,pe+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[c,[o,pe+" GX"]],[/\bopr\/([\w\.]+)/i],[c,[o,pe]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[c,[o,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\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|duckduckgo|klar)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[o,c],[/\bddg\/([\w\.]+)/i],[c,[o,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[c,[o,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[c,[o,"WeChat"]],[/konqueror\/([\w\.]+)/i],[c,[o,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[c,[o,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[c,[o,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[c,[o,"Smart "+yt+X]],[/(avast|avg)\/([\w\.]+)/i],[[o,/(.+)/,"$1 Secure"+X],c],[/\bfocus\/([\w\.]+)/i],[c,[o,ge+" Focus"]],[/\bopt\/([\w\.]+)/i],[c,[o,pe+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[c,[o,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[c,[o,"Dolphin"]],[/coast\/([\w\.]+)/i],[c,[o,pe+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[c,[o,"MIUI"+X]],[/fxios\/([\w\.-]+)/i],[c,[o,Q+ge]],[/\bqihu|(qi?ho?o?|360)browser/i],[[o,"360"+X]],[/\b(qq)\/([\w\.]+)/i],[[o,/(.+)/,"$1Browser"],c],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[o,/(.+)/,"$1"+X],c],[/samsungbrowser\/([\w\.]+)/i],[c,[o,Me+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[o,/_/g," "],c],[/metasr[\/ ]?([\d\.]+)/i],[c,[o,Ct+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[o,Ct+" Mobile"],c],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[o,c],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[o],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[o,vt],c],[/(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,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[o,c],[/\bgsa\/([\w\.]+) .*safari\//i],[c,[o,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[c,[o,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[c,[o,Ie+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[o,Ie+" WebView"],c],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[c,[o,"Android"+X]],[/chrome\/([\w\.]+) mobile/i],[c,[o,Q+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[o,c],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[c,[o,Q+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[o,Q+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[c,o],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[o,[c,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[o,c],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[o,Q+ge],c],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[o,"Netscape"],c],[/(wolvic)\/([\w\.]+)/i],[o,c],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[c,[o,ge+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\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|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[o,[c,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[o,[c,/[^\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,V]],[/(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,V]]],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],[l,[u,Me],[d,f]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[u,Me],[d,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[u,he],[d,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[u,he],[d,f]],[/(macintosh);/i],[l,[u,he]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[u,Et],[d,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[u,ft],[d,f]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[u,ft],[d,b]],[/\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],[[l,/_/g," "],[u,je],[d,b]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[u,je],[d,f]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[u,"OPPO"],[d,b]],[/\b(opd2\d{3}a?) bui/i],[l,[u,"OPPO"],[d,f]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[u,"Vivo"],[d,b]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[l,[u,"Realme"],[d,b]],[/\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],[l,[u,kt],[d,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[u,kt],[d,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[u,$e],[d,f]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[u,$e],[d,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[u,yt],[d,f]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[u,"Nokia"],[d,b]],[/(pixel c)\b/i],[l,[u,Ce],[d,f]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[u,Ce],[d,b]],[/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],[l,[u,Se],[d,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[u,Se],[d,f]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[u,"OnePlus"],[d,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[u,ve],[d,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[u,ve],[d,b]],[/(playbook);[-\w\),; ]+(rim)/i],[l,u,[d,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[u,bt],[d,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[u,wt],[d,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[u,wt],[d,b]],[/(nexus 9)/i],[l,[u,"HTC"],[d,f]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[l,/_/g," "],[d,b]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[u,"Acer"],[d,f]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[u,"Meizu"],[d,b]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[l,[u,"Ulefone"],[d,b]],[/(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,l,[d,b]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[u,l,[d,f]],[/(surface duo)/i],[l,[u,Oe],[d,f]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[u,"Fairphone"],[d,b]],[/(shield[\w ]+) b/i],[l,[u,"Nvidia"],[d,f]],[/(sprint) (\w+)/i],[u,l,[d,b]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[u,Oe],[d,b]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[u,Ke],[d,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[u,Ke],[d,b]],[/smart-tv.+(samsung)/i],[u,[d,I]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[u,Me],[d,I]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,$e],[d,I]],[/(apple) ?tv/i],[u,[l,he+" TV"],[d,I]],[/crkey/i],[[l,Ie+"cast"],[u,Ce],[d,I]],[/droid.+aft(\w+)( bui|\))/i],[l,[u,ve],[d,I]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[u,Et],[d,I]],[/(bravia[\w ]+)( bui|\))/i],[l,[u,Se],[d,I]],[/(mitv-\w{5}) bui/i],[l,[u,je],[d,I]],[/Hbbtv.*(technisat) (.*);/i],[u,l,[d,I]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,be],[l,be],[d,I]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,I]],[/(ouya)/i,/(nintendo) (\w+)/i],[u,l,[d,J]],[/droid.+; (shield) bui/i],[l,[u,"Nvidia"],[d,J]],[/(playstation \w+)/i],[l,[u,Se],[d,J]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[u,Oe],[d,J]],[/((pebble))app/i],[u,l,[d,Ae]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[u,he],[d,Ae]],[/droid.+; (wt63?0{2,3})\)/i],[l,[u,Ke],[d,Ae]],[/droid.+; (glass) \d/i],[l,[u,Ce],[d,pt]],[/(quest( \d| pro)?)/i],[l,[u,vt],[d,pt]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[d,et]],[/(aeobc)\b/i],[l,[u,ve],[d,et]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[l,[d,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[d,f]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,f]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,b]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[c,[o,Ei+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[c,[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,c],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[c,o]],os:[[/microsoft (windows) (vista|xp)/i],[o,c],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[o,[c,xe,St]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,xe,St],[o,it]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[c,/_/g,"."],[o,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[o,"macOS"],[c,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[c,o],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[o,c],[/\(bb(10);/i],[c,[o,bt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[c,[o,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[c,[o,ge+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[c,[o,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[c,[o,"watchOS"]],[/crkey\/([\d\.]+)/i],[c,[o,Ie+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[o,"Chrome OS"],c],[/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,c],[/(sunos) ?([\w\.\d]*)/i],[[o,"Solaris"],c],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[o,c]]},Te=function(){var s={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return B.call(s.init,[[T,[o,c,we,d]],[L,[M]],[R,[d,l,u]],[_,[o,c]],[P,[o,c]]]),B.call(s.isIgnore,[[T,[c,we]],[_,[c]],[P,[c]]]),B.call(s.isIgnoreRgx,[[T,/ ?browser$/i],[P,/ ?os$/i]]),B.call(s.toString,[[T,[o,c]],[L,[M]],[R,[u,l]],[_,[o,c]],[P,[o,c]]]),s}(),Mi=function(s,t){var e=Te.init[t],i=Te.isIgnore[t]||0,a=Te.isIgnoreRgx[t]||0,r=Te.toString[t]||0;function n(){B.call(this,e)}return n.prototype.getItem=function(){return s},n.prototype.withClientHints=function(){return D?D.getHighEntropyValues(Gt).then(function(h){return s.setCH(new Ht(h,!1)).parseCH().get()}):s.parseCH().get()},n.prototype.withFeatureCheck=function(){return s.detectFeature().get()},t!=Z&&(n.prototype.is=function(h){var g=!1;for(var w in this)if(this.hasOwnProperty(w)&&!st(i,w)&&V(a?$(a,this[w]):this[w])==V(a?$(a,h):h)){if(g=!0,h!=H)break}else if(h==H&&g){g=!g;break}return g},n.prototype.toString=function(){var h=re;for(var g in r)typeof this[r[g]]!==H&&(h+=(h?" ":re)+this[r[g]]);return h||H}),D||(n.prototype.then=function(h){var g=this,w=function(){for(var k in g)g.hasOwnProperty(k)&&(this[k]=g[k])};w.prototype={is:n.prototype.is,toString:n.prototype.toString};var p=new w;return h(p),p}),new n};function Ht(s,t){if(s=s||{},B.call(this,Gt),t)B.call(this,[[nt,Qe(s[z])],[ot,Qe(s[pi])],[b,/\?1/.test(s[fi])],[l,me(s[yi])],[Y,me(s[Dt])],[rt,me(s[ki])],[M,me(s[mi])],[W,Qe(s[bi])],[Ne,me(s[wi])]]);else for(var e in s)this.hasOwnProperty(e)&&typeof s[e]!==H&&(this[e]=s[e])}function Pt(s,t,e,i){return this.get=function(a){return a?this.data.hasOwnProperty(a)?this.data[a]:void 0:this.data},this.set=function(a,r){return this.data[a]=r,this},this.setCH=function(a){return this.uaCH=a,this},this.detectFeature=function(){if(S&&S.userAgent==this.ua)switch(this.itemType){case T:S.brave&&typeof S.brave.isBrave==Ye&&this.set(o,"Brave");break;case R:!this.get(d)&&D&&D[b]&&this.set(d,b),this.get(l)=="Macintosh"&&S&&typeof S.standalone!==H&&S.maxTouchPoints&&S.maxTouchPoints>2&&this.set(l,"iPad").set(d,f);break;case P:!this.get(o)&&D&&D[Y]&&this.set(o,D[Y]);break;case Z:var a=this.data,r=function(n){return a[n].getItem().detectFeature().get()};this.set(T,r(T)).set(L,r(L)).set(R,r(R)).set(_,r(_)).set(P,r(P))}return this},this.parseUA=function(){return this.itemType!=Z&&Mt.call(this.data,this.ua,this.rgxMap),this.itemType==T&&this.set(we,Xe(this.get(c))),this},this.parseCH=function(){var a=this.uaCH,r=this.rgxMap;switch(this.itemType){case T:var n=a[ot]||a[nt],h;if(n)for(var g in n){var w=$(/(Google|Microsoft) /,n[g].brand||n[g]),p=n[g].version;!/not.a.brand/i.test(w)&&(!h||/chrom/i.test(h)&&!/chromi/i.test(w))&&(this.set(o,w).set(c,p).set(we,Xe(p)),h=w)}break;case L:var k=a[M];k&&(k&&a[Ne]=="64"&&(k+="64"),Mt.call(this.data,k+";",r));break;case R:if(a[b]&&this.set(d,b),a[l]&&this.set(l,a[l]),a[l]=="Xbox"&&this.set(d,J).set(u,Oe),a[W]){var N;if(typeof a[W]!="string")for(var j=0;!N&&j<a[W].length;)N=xe(a[W][j++],It);else N=xe(a[W],It);this.set(d,N)}break;case P:var K=a[Y];if(K){var U=a[rt];K==it&&(U=parseInt(Xe(U),10)>=13?"11":"10"),this.set(o,K).set(c,U)}this.get(o)==it&&a[l]=="Xbox"&&this.set(o,"Xbox").set(c,void 0);break;case Z:var le=this.data,A=function(Ee){return le[Ee].getItem().setCH(a).parseCH().get()};this.set(T,A(T)).set(L,A(L)).set(R,A(R)).set(_,A(_)).set(P,A(P))}return this},B.call(this,[["itemType",s],["ua",t],["uaCH",i],["rgxMap",e],["data",Mi(this,s)]]),this}function x(s,t,e){if(typeof s===ce?(Re(s,!0)?(typeof t===ce&&(e=t),t=s):(e=s,t=void 0),s=void 0):typeof s===Ze&&!Re(t,!0)&&(e=t,t=void 0),!(this instanceof x))return new x(s,t,e).getResult();var i=typeof s===Ze?s:S&&S.userAgent?S.userAgent:e&&e[mt]?e[mt]:re,a=new Ht(e,!0),r=t?Ci(Tt,t):Tt,n=function(h){return h==Z?function(){return new Pt(h,i,r,a).set("ua",i).set(T,this.getBrowser()).set(L,this.getCPU()).set(R,this.getDevice()).set(_,this.getEngine()).set(P,this.getOS()).get()}:function(){return new Pt(h,i,r[h],a).parseUA().get()}};return B.call(this,[["getBrowser",n(T)],["getCPU",n(L)],["getDevice",n(R)],["getEngine",n(_)],["getOS",n(P)],["getResult",n(Z)],["getUA",function(){return i}],["setUA",function(h){return de(h)&&(i=h.length>tt?be(h,tt):h),this}]]).setUA(i),this}x.VERSION=gi;x.BROWSER=De([o,c,we,d]);x.CPU=De([M]);x.DEVICE=De([l,u,d,J,b,I,f,Ae,et]);x.ENGINE=x.OS=De([o,c]);class Vt{constructor(t,e){m(this,"config");m(this,"sdkConfig");this.config=t,this.sdkConfig=e}on(t,e,i){const a=function(n){n.data.message!==`kalamba:wrapper-rgs:${t}`&&n.data.message!==`kalamba:wrapper:${t}`||e(n.data.payload)};window.addEventListener("message",a,i)}send(t,...[e]){window.postMessage({message:`kalamba:rgs:${t}`,payload:e})}}class Si{constructor(t){m(this,"socket",null);m(this,"webSocketUrl");m(this,"eventListeners",{close:[],error:[],message:[]});m(this,"connect",async()=>{const t=new WebSocket(this.webSocketUrl);return t.addEventListener("message",this.handleMessage),new Promise(e=>{t.addEventListener("open",i=>{this.handleOpen(i),e(this.socket)},{once:!0})})});m(this,"send",t=>{if(this.socket==null)throw new Error("Cannot send message, the WebSocket connection is not open");this.socket.send(t)});m(this,"close",()=>{if(this.socket==null)throw new Error("Cannot close the WebSocket connection that is not open");this.socket.close()});m(this,"handleClose",t=>{this.eventListeners.close.forEach(e=>{e(t)}),this.socket.removeEventListener("message",this.handleMessage),this.socket.removeEventListener("close",this.handleClose),this.socket.removeEventListener("error",this.handleError),this.socket=null});m(this,"handleError",t=>{this.eventListeners.error.forEach(e=>{e(t)})});m(this,"handleMessage",t=>{this.eventListeners.message.forEach(e=>{e(t)})});m(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 i=this.eventListeners[t].indexOf(e);i!==-1&&this.eventListeners[t].splice(i,1)}}function Pe(s){return JSON.parse(s==null?void 0:s.data)}function Ii(s){var t;return((t=s==null?void 0:s.header)==null?void 0:t.name)==="Ping"}function At(s){var t;return((t=s==null?void 0:s.header)==null?void 0:t.name)==="RealityCheck"}function Ue(s){return s.header.name==="GameEvent"}function Ti(s){return Ue(s)&&s.body.event==="OPEN_GAME"}function Ot(s){return s.header.code!==1}function Pi(s){return Ue(s)&&s.body.event.includes("_RESULT")}var ee,fe;class Ai extends Si{constructor(e,i){const a=new URL(e.apiUrl);a.searchParams.set("cageCode",e.cageCode),a.searchParams.set("gameCode",e.gameCode),a.searchParams.set("operatorCode",e.operatorCode),a.searchParams.set("playMode",e.playMode),a.searchParams.set("token",e.token),a.searchParams.set("username",e.username);super(a.toString());m(this,"cId",0);m(this,"mId",0);m(this,"seqId",0);m(this,"gameCode");C(this,ee);C(this,fe);m(this,"onMessage",e=>{const i=Pe(e);(Ue(i)||Ii(i)||At(i))&&this.sendAcknowledgement(i),At(i)&&this.handleRealityCheck(i)});this.eventListeners.realityCheck=[],this.gameCode=e.gameCode,E(this,ee,i.requestTimeoutMs),E(this,fe,i.gameVersion??"unknown"),this.addEventListener("message",this.onMessage)}handleRealityCheck(e){this.eventListeners.realityCheck.forEach(i=>{i(e.body)})}addEventListener(e,i){super.addEventListener(e,i)}removeEventListener(e,i){super.removeEventListener(e,i)}buildHeader(e,i=null){return{cId:i??++this.cId,code:i!==null?1:void 0,mId:++this.mId,name:e}}buildPayload(e,i){return JSON.stringify({body:i,header:e})}getBodyExtras(e){return{action:e,seqId:++this.seqId}}request(e,i){const a=this.buildPayload(e,i);return new Promise((r,n)=>{setTimeout(()=>n({type:"timeout"}),y(this,ee));const h=g=>{const w=Pe(g);try{e.cId===w.header.cId&&(this.removeEventListener("message",h),w.header.code===1?r(w):n({message:w,type:"error"}))}catch{n({message:w,type:"error"})}};this.addEventListener("message",h),this.send(a)})}freeRounds(e){const i=this.buildHeader("ActivateFreeRound");return this.request(i,e).then(a=>a.body).catch(a=>{var r;throw{data:(r=a==null?void 0:a.message)==null?void 0:r.body,type:a.type}})}async authenticate(e=!1){const i=this.buildHeader("Authenticate"),a={clientType:3,version:y(this,fe),reconnect:e};return this.request(i,a).then(r=>r.body).catch(r=>{var n;throw{data:(n=r==null?void 0:r.message)==null?void 0:n.body,type:r.type}})}async openGame(){const e=this.buildHeader("OpenGame"),i={gameCode:this.gameCode};return new Promise((a,r)=>{const n=h=>{const g=Pe(h);Ti(g)?(this.removeEventListener("message",n),a(g.body)):Ot(g)&&r({data:g.body,type:"error"})};this.addEventListener("message",n),this.request(e,i).catch(h=>{var g;return r({data:(g=h==null?void 0:h.message)==null?void 0:g.body,type:h.type})})})}sendAcknowledgement(e){const{name:i,cId:a}=e.header,r=this.buildHeader(i,a),n=this.buildPayload(r,{});this.send(n)}sendAction(e,i){const a=this.buildHeader("GameAction"),r={...this.getBodyExtras(e),data:i};return new Promise((n,h)=>{const g=w=>{const p=Pe(w);Ue(p)&&r.seqId===p.body.correlationSeqId&&(this.removeEventListener("message",g),Pi(p)?n(p.body):Ot(p)&&h({data:p.body,type:"error"}))};this.addEventListener("message",g),this.request(a,r).catch(w=>{var p;return h({data:(p=w==null?void 0:w.message)==null?void 0:p.body,type:w.type})})})}setRequestTimeoutMs(e){E(this,ee,e)}}ee=new WeakMap,fe=new WeakMap;const Oi={CA_BC:"CA",CA_ON:"CA",GER:"DE",US_CT:"US",US_MI:"US",US_NJ:"US",USA:"US"};function Rt(s){return!s||s==="NOT_APPLICABLE"?null:Oi[s]??s}function zt(s){const t=s.contract;return t?{contract:{balance:{coins:t.balance,version:t.balanceVersion},coinValueInCents:t.coinValueInCents,country:t.countryCode,currency:t.currencyCode,jurisdiction:Rt(t.jurisdictionCode),uiMessages:t.uiMessages,username:t.username}}:{contract:{balance:{coins:s.balance,version:s.balanceVersion},coinValueInCents:s.coinValueInCents,country:s.countryCode,currency:s.currencyCode,jurisdiction:Rt(s.jurisdictionCode),uiMessages:s.uiMessages,username:s.username}}}function qt(s){var t,e;return{code:((t=s.data)==null?void 0:t.code)??Fe.RgsErrorCode.UNKNOWN,details:(e=s.data)==null?void 0:e.details}}function Wt(s,t){const e=t.contract;if(!e){const i=t.data;return{contract:{bet:{available:i.additionalConfigData.availableMultipliersPerBaseBet,default:{base:i.additionalConfigData.defaultBet.baseBet,multiplier:i.additionalConfigData.defaultBet.betMultiplier},max:i.additionalConfigData.maxAllowedOverallBetInCoins??null,last:i.gameState.betFromCurrentRound?{base:i.gameState.betFromCurrentRound.baseBet,multiplier:i.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:i.gameState.lastPlacedMainGameBet?{base:i.gameState.lastPlacedMainGameBet.baseBet,multiplier:i.gameState.lastPlacedMainGameBet.betMultiplier}:null},balance:{coins:t.balance,version:t.balanceVersion},freeRounds:(i.FREE_ROUNDS??[]).map(a=>({conf:{base:a.conf.baseBet,multiplier:a.conf.betMultiplier,numAwarded:a.conf.numAwarded},data:{numPlayed:a.data.numPlayed,win:a.data.winAmount,numLeft:a.data.numLeft},id:a.id,rejectable:a.rejectable,skippable:a.skippable,status:a.status,type:a.type})),gameModel:i.additionalConfigData.gameModelFile,metaData:i.gameConfigData.metaData,roundId:i.gameState.cycleId,serverTime:t.balanceVersion,sessionId:i.gameState.sessionId,stateType:{thisRound:i.gameState.stateTypeThisRound,nextRound:i.gameState.stateTypeNextRound},uiMessages:s.uiMessages,win:{max:i.maxWin??null,round:i.gameState.totalWinFromCurrentRound,total:i.gameState.totalWinFromCurrentGameCycle}},data:i}}return{contract:{bet:{available:e.availableMultipliersPerBaseBet,default:{base:e.defaultBet.baseBet,multiplier:e.defaultBet.betMultiplier},max:e.maxBetInCoins??null,last:e.lastBet?{base:e.lastBet.baseBet,multiplier:e.lastBet.betMultiplier}:null,lastPaid:e.lastMainGameBet?{base:e.lastMainGameBet.baseBet,multiplier:e.lastMainGameBet.betMultiplier}:null},balance:{coins:e.balanceInCoins,version:e.balanceVersion},freeRounds:(e.freeRounds??[]).map(i=>({conf:{base:i.conf.baseBet,multiplier:i.conf.betMultiplier,numAwarded:i.conf.numAwarded},data:{numPlayed:i.data.numPlayed,win:i.data.winAmount,numLeft:i.data.numLeft},id:i.id,rejectable:i.rejectable,skippable:i.skippable,status:i.status,type:i.type})),gameModel:e.gameModelFile,metaData:e.metaData,roundId:e.roundId,serverTime:e.serverTime,sessionId:e.sessionId,stateType:{thisRound:e.stateTypeThisRound,nextRound:e.stateTypeNextRound},uiMessages:s.contract.uiMessages.concat(e.uiMessages),win:{max:e.maxWinInCoins??null,round:e.roundWin,total:e.totalWin}},data:t.opaqueGameServerToUi}}function $t(s){var t,e;return{code:((t=s.data)==null?void 0:t.code)??Fe.RgsErrorCode.UNKNOWN,details:(e=s.data)==null?void 0:e.details}}function jt(s){const t=s.contract;if(!t){const e=s.data;return{contract:{bet:{last:e.gameState.betFromCurrentRound?{base:e.gameState.betFromCurrentRound.baseBet,multiplier:e.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:{base:(e.gameState.lastPlacedMainGameBet??e.gameState.betFromCurrentRound).baseBet,multiplier:(e.gameState.lastPlacedMainGameBet??e.gameState.betFromCurrentRound).betMultiplier}},balance:{coins:s.balance,version:s.balanceVersion},freeRounds:(e.FREE_ROUNDS??[]).map(i=>({conf:{base:i.conf.baseBet,multiplier:i.conf.betMultiplier,numAwarded:i.conf.numAwarded},data:{numPlayed:i.data.numPlayed,win:i.data.winAmount,numLeft:i.data.numLeft},id:i.id,rejectable:i.rejectable,skippable:i.skippable,status:i.status,type:i.type})),serverTime:s.balanceVersion,roundId:e.gameState.cycleId,stateType:{thisRound:e.gameState.stateTypeThisRound,nextRound:e.gameState.stateTypeNextRound},uiMessages:e.uiMessages,win:{round:e.gameState.totalWinFromCurrentRound,total:e.gameState.totalWinFromCurrentGameCycle}},data:e}}return{contract:{bet:{last:t.lastBet?{base:t.lastBet.baseBet,multiplier:t.lastBet.betMultiplier}:null,lastPaid:{base:t.lastMainGameBet.baseBet,multiplier:t.lastMainGameBet.betMultiplier}},balance:{coins:t.balanceInCoins,version:t.balanceVersion},freeRounds:(t.freeRounds??[]).map(e=>({conf:{base:e.conf.baseBet,multiplier:e.conf.betMultiplier,numAwarded:e.conf.numAwarded},data:{numPlayed:e.data.numPlayed,win:e.data.winAmount,numLeft:e.data.numLeft},id:e.id,rejectable:e.rejectable,skippable:e.skippable,status:e.status,type:e.type})),serverTime:t.serverTime,roundId:t.roundId,stateType:{thisRound:t.stateTypeThisRound,nextRound:t.stateTypeNextRound},uiMessages:t.uiMessages,win:{round:t.roundWin,total:t.totalWin}},data:s.opaqueGameServerToUi}}function Kt(s){var t,e;return{code:((t=s.data)==null?void 0:t.code)??Fe.RgsErrorCode.UNKNOWN,details:(e=s.data)==null?void 0:e.details}}const Ri={parseAuthenticateResponse:zt,parseAuthenticateError:qt,parseOpenGameResponse:Wt,parseOpenGameError:$t,parsePlayResponse:jt,parsePlayError:Kt},xi={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"},{device:Ui}=x(navigator.userAgent),Li=O("KalambaBullseyePlugin","color:#000000;font-weight:bold;");class _i extends Vt{constructor(...e){super(...e);m(this,"socket");m(this,"error");this.on("openGame",async()=>{try{this.error=void 0;const i=await this.openGame();this.send("openGameResponse",i)}catch(i){this.error=i,this.send("openGameError",i)}}),this.on("play",async i=>{try{this.error=void 0;const a=await this.play(i);this.send("playResponse",a)}catch(a){this.error=a,this.send("playError",a)}}),this.on("freeRounds",async i=>{try{this.error=void 0,await this.socket.freeRounds(i),this.send("freeRoundsResponse",i)}catch(a){this.error=a,this.send("freeRoundsError",a)}}),this.on("configured",i=>{this.socket.setRequestTimeoutMs(i.ui.requestTimeoutMs)}),this.registerFromSdkEvents()}initialize(e){this.socket=new Ai(e,{gameVersion:this.config.gameVersion,requestTimeoutMs:this.sdkConfig.ui.requestTimeoutMs}),["fireboltroulette"].includes(e.gameCode)||(this.socket.addEventListener("close",i=>{i.code===1008?this.error||this.send("error",{type:"CLOSE",messageCode:"TOO_MANY_OPEN_GAMES",messageKey:"RgsError.TOO_MANY_OPEN_GAMES"}):i.code===1011?this.error||this.send("error",{type:"CLOSE",messageCode:"UNKNOWN",messageKey:"RgsError.UNKNOWN"}):this.reconnect()}),["mobile","tablet"].includes(Ui.type??"")&&document.addEventListener("visibilitychange",async()=>{document.hidden||(this.socket.socket?this.socket.socket&&[WebSocket.CONNECTING,WebSocket.OPEN].includes(this.socket.socket.readyState)&&this.socket.close():this.reconnect())})),this.socket.addEventListener("error",i=>Li("error",i)),this.socket.addEventListener("realityCheck",i=>{this.send("realityCheck",i)})}async reconnect(){try{await this.socket.connect(),await this.socket.authenticate(!0),await this.socket.openGame()}catch{this.send("error",{type:"CLOSE",messageCode:"CONNECTION_ERROR",messageKey:"RgsError.CONNECTION_ERROR"})}}async openGame(){var Ee,dt;const e=new URLSearchParams(window.location.search),i=e.get("apiUrl"),a=e.get("cageCode"),r=e.get("gameCode"),n=e.get("operatorCode"),h=e.get("playMode"),g=e.get("token"),w=e.get("username"),p=e.get("gameHistoryUrl"),k=e.get("homeUrl")??void 0,N=e.get("cashierUrl")??void 0;this.initialize({apiUrl:i,cageCode:a,gameCode:r,operatorCode:n,playMode:h,token:g,username:w});try{await this.socket.connect()}catch{throw{type:"error",data:{code:Fe.RgsErrorCode.CONNECTION_ERROR}}}let j;try{j=await this.socket.authenticate()}catch(q){throw{type:q.type,data:q.type==="error"?qt(q.data):void 0}}let K;try{K=await this.socket.openGame()}catch(q){throw{type:q.type,data:q.type==="error"?$t(q.data):void 0}}const U=zt(j),le=Wt(j,K);this.sdkConfig.api={...this.sdkConfig.api,brand:a,game:r,integration:n,jurisdiction:U.contract.jurisdiction,playMode:h,user:U.contract.username,integrationData:{token:g},country:U.contract.country,currency:U.contract.currency,coinValueInCents:U.contract.coinValueInCents,gameHistoryUrl:p,homeUrl:k,cashierUrl:N,backendSessionId:le.contract.sessionId,lastRoundId:le.contract.roundId};const A=(dt=(Ee=e.get("languageCode"))==null?void 0:Ee.split("_"))==null?void 0:dt[0];return A&&(this.sdkConfig.ui.language=A.length===3?xi[A]??A:A),le}async play(e){for(;!this.socket.socket;)await new Promise(k=>setTimeout(()=>k(),500));const{contract:{bet:i,forcedOutcomes:a,...r},extra:n,payloadToInject:h,actionType:g}=e,w={bet:i?{baseBet:i.base,betMultiplier:i.multiplier}:void 0,forcedOutcomes:a,...r,...h,opaqueUiToGameServer:n};let p;try{p=await this.socket.sendAction(g,w)}catch(k){throw{type:k.type,data:k.type==="error"?Kt(k.data):void 0}}return jt(p)}registerFromSdkEvents(){this.on("history",()=>{const{api:{game:e,integration:i,integrationData:a,jurisdiction:r,user:n,gameHistoryUrl:h},ui:{language:g}}=this.sdkConfig,w=n.replace(/^user_/,"").replace(new RegExp(`_${i}$`),""),p=new URL(window.location.href);p.hostname=p.hostname.replace(/^v\./,"").replace(/^play\./,"history."),p.pathname=p.pathname.replace(/(\/[0-9]+\.[0-9]+\.[0-9]+)?\/wrapper\.html/,"/list/index.html"),p.search="",p.searchParams.set("apiUrl",new URL(h).origin),p.searchParams.set("gameCode",e),p.searchParams.set("jurisdiction",r),p.searchParams.set("operatorCode",i),p.searchParams.set("token",a.token),p.searchParams.set("username",w),p.searchParams.set("languageCode",g),this.config.gameHistoryUrl&&p.searchParams.set("gameHistoryUrl",this.config.gameHistoryUrl),window.open(p.toString(),"_blank")})}}class Qt{constructor(t,e,i){m(this,"trackers");m(this,"config");m(this,"sdkConfig");this.trackers=t,this.config=e,this.sdkConfig=i}on(t,e,i){const a=function(n){n.data.message!==`kalamba:wrapper-telemetry:${t}`&&n.data.message!==`kalamba:wrapper:${t}`||e(n.data.payload)};window.addEventListener("message",a,i)}track(t,e){this.trackers.forEach(i=>i.track(t,e))}}function xt(s){return s.reduce((t,e)=>t+e,0)}function Bi(s){const t=s.length,e=xt(s)/t,i=s.map(r=>Math.pow(r-e,2)),a=xt(i)/t;return Math.sqrt(a)}class Ut{constructor(){m(this,"rafId",-1);m(this,"startTime",0);m(this,"stopTime",0);m(this,"frames",[]);m(this,"calculateFPS",()=>{const t=Math.floor((this.stopTime-this.startTime)/1e3);return this.frames.map(e=>Math.floor((e-this.startTime)/1e3)).reduce((e,i,a,r)=>(r[a]!==r[a-1]?e.push(1):e[e.length-1]++,e),[]).slice(0,t)});m(this,"getReport",()=>{const t=this.calculateFPS(),e=Math.floor(this.frames.length/((this.stopTime-this.startTime)/1e3)),i=t.length>0?Math.max(...t):e,a=t.length>0?Math.min(...t):e,r=t.length>0?Bi(t):0;return{fpsAvg:e,fpsMax:i,fpsMin:a,fpsStdDev:r}});m(this,"start",()=>{this.startTime=Date.now(),this.frames=[],this.trackFrames()});m(this,"stop",()=>{cancelAnimationFrame(this.rafId),this.stopTime=Date.now()});m(this,"trackFrames",()=>{this.frames.push(Date.now()),this.rafId=requestAnimationFrame(this.trackFrames)})}}const Fi="landscape",Ni="portrait";function Di(){try{const s=document.createElement("canvas");return!!window.WebGLRenderingContext&&(s.getContext("webgl")||s.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function Gi(){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 Je(){return window.innerWidth>=window.innerHeight?Fi:Ni}var Le,te,ie,se,ye,_e,ke,Be;class Hi extends Qt{constructor(...e){super(...e);m(this,"FPS_SAMPLE_INTERVAL",1e4);C(this,Le,0);C(this,te);C(this,ie);C(this,se);C(this,ye,!1);C(this,_e,!1);C(this,ke,"");C(this,Be,[]);E(this,ie,{}),E(this,se,this.deviceInfo()),E(this,te,this.config.gameVersion),this.on("state",({balance:i})=>{E(this,Le,i)}),this.on("autoplay",({action:i})=>{["start","resume"].includes(i)?E(this,ye,!0):E(this,ye,!1)}),this.on("settings",({fastPlay:i})=>{i!==void 0&&E(this,_e,i)}),this.registerEvents()}async registerEvents(){y(this,se).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.messageCode,systemMessageType:e.type})}),this.on("openGameResponse",async e=>{E(this,ke,e.contract.stateType.nextRound),E(this,ie,{balanceInCoins:e.contract.balance.coins,clientVersion:y(this,te),coinValueInCents:this.sdkConfig.api.coinValueInCents,coinValueInCentsFloat:this.sdkConfig.api.coinValueInCents,currency:this.sdkConfig.api.currency,defaultBaseBet:e.contract.bet.default.base,defaultBetMultiplier:e.contract.bet.default.multiplier,environment:"release",gameCode:this.sdkConfig.api.game,gameCodeServer:this.sdkConfig.api.game,gameModelFile:e.contract.gameModel,jurisdiction:this.sdkConfig.api.jurisdiction,languageCode:this.sdkConfig.ui.language,operatorName:"kalamba",partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,referrer:window.location.hostname,rootTrackingSessionID:this.sdkConfig.api.sessionId,backendSessionID:this.sdkConfig.api.backendSessionId,serverVersion:e.contract.metaData.version}),this.track("Game Open",y(this,ie))}),this.on("playCycleEnd",async e=>{const i=await y(this,se),{base:a,multiplier:r,specialAction:n}=e.contract.bet.lastPaid??{},h=e.contract.balance.coins,g=e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier,w=e.contract.win.total,p=w-g,k=n||"spin",N=e.contract.roundId;this.track("Betting Activity",{balance:h-p,balanceAfter:h,baseBet:a,betMultiplier:r,betType:k,gameVersion:y(this,te),coinValueInCents:this.sdkConfig.api.coinValueInCents,coinValueInCentsFloat:this.sdkConfig.api.coinValueInCents,currency:this.sdkConfig.api.currency,environment:"release",gameCode:this.sdkConfig.api.game,gameCodeServer:this.sdkConfig.api.game,isMobile:i.isMobile,netResult:p,operatorName:"kalamba",orientation:Je(),partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,roundId:N,roundTypes:["BaseGame"],totalBet:g,totalWin:w}),E(this,Be,[])}),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 Ut,i=()=>{e.stop();const r=e.getReport();this.track("FPS Performance",{...r,fpsType:"sample"}),a()},a=async()=>{e.start(),setTimeout(i,this.FPS_SAMPLE_INTERVAL)};a()}reportFpsRound(){const e=new Ut;this.on("playCycleStart",()=>{e.start()}),this.on("playCycleEnd",()=>{e.stop();const i=e.getReport();this.track("FPS Performance",{...i,fpsType:"playCycleStart->playCycleEnd"})})}getExtraUiInteractionData(){return{orientation:Je(),stateType:y(this,ke)}}async deviceInfo(){var h;const{browser:e,device:i,os:a}=x(navigator.userAgent),r=Di(),n=await Gi();return{browserName:e.name,browserVersion:e.version,connection:(h=navigator.connection)==null?void 0:h.effectiveType,deviceName:i.model,deviceType:i.type,isMobile:["mobile","tablet"].includes(i.type??""),isWebGLSupported:r,isWebPSupported:n,manufacturer:i.vendor,operatingSystem:a.name,operatingSystemVersion:a.version,orientation:Je(),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,te=new WeakMap,ie=new WeakMap,se=new WeakMap,ye=new WeakMap,_e=new WeakMap,ke=new WeakMap,Be=new WeakMap;var Vi=at.requireNoop();const Lt=at.getDefaultExportFromCjs(Vi);class ct{constructor(t,e){m(this,"config");m(this,"sdkConfig");this.config=t,this.sdkConfig=e}}const _t=25,Bt=1e4;var ae,ne,oe,G;class zi extends ct{constructor(...e){super(...e);C(this,ae,"https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");C(this,ne);C(this,oe);C(this,G,[]);m(this,"processQueueForced");E(this,ne,new Date().getTime()),E(this,G,[]),this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(y(this,ae),{method:"OPTIONS"}).catch(Lt),this.subscribe()}subscribe(){window.addEventListener("beforeunload",this.processQueueForced,!1),window.addEventListener("pagehide",this.processQueueForced,!1),window.addEventListener("visibilitychange",this.processQueueForced,!1)}schedule(){y(this,oe)&&clearTimeout(y(this,oe)),E(this,oe,window.setTimeout(()=>this.processQueue(),Bt))}send(e){E(this,ne,new Date().getTime());try{navigator.sendBeacon(y(this,ae),JSON.stringify(e))}catch{fetch(y(this,ae),{body:JSON.stringify(e),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(Lt)}this.schedule()}addToQueue(e){y(this,G).push(e),this.processQueue()}processQueue(e=!1){if(!(this.sdkConfig==null||!this.sdkConfig.ui.feature.allowTelemetry)&&!(!e&&y(this,G).length<_t&&new Date().getTime()-y(this,ne)<Bt))for(;y(this,G).length;){const i=y(this,G).splice(0,_t).map(a=>({...a,sessionID:this.sdkConfig.api.sessionId,userID:this.sdkConfig.api.user}));this.send(i)}}track(e,i){this.addToQueue({eventName:e,eventParams:i,eventTimestamp:new Date().getTime(),eventUUID:at.v4()})}}ae=new WeakMap,ne=new WeakMap,oe=new WeakMap,G=new WeakMap;const qi=O("LoggingTracker","color:#000000;font-weight:bold;");class Wi extends ct{track(t,e){qi(`@${this.sdkConfig.api.user}`,`[${t}]`,e)}}exports.BasicPlugin=Zt;exports.CasinoPlugin=F;exports.DebuggingPlugin=ti;exports.GigPlugin=si;exports.KalambaBullseyeParsers=Ri;exports.KalambaBullseyePlugin=_i;exports.KalambaStargazerPlugin=Hi;exports.KalambaStargazerTracker=zi;exports.LoggingTracker=Wi;exports.OryxPlugin=ni;exports.PariplayPlugin=di;exports.QuantaPlugin=hi;exports.RelaxFEIMPlugin=li;exports.RgsPlugin=Vt;exports.TelemetryPlugin=Qt;exports.Tracker=ct;exports.TukoPlugin=ui;
|
package/dist/plugins.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ declare type AuthenticateResponse_2 = {
|
|
|
22
22
|
coinValueInCents: number;
|
|
23
23
|
country: string;
|
|
24
24
|
currency: string;
|
|
25
|
-
jurisdiction: string;
|
|
25
|
+
jurisdiction: string | null;
|
|
26
26
|
uiMessages: unknown[];
|
|
27
27
|
username: string;
|
|
28
28
|
};
|
|
@@ -219,6 +219,7 @@ export declare const KalambaBullseyeParsers: {
|
|
|
219
219
|
|
|
220
220
|
export declare class KalambaBullseyePlugin extends RgsPlugin {
|
|
221
221
|
socket: KalambaWebSocketClient;
|
|
222
|
+
error?: RgsErrorWithType;
|
|
222
223
|
constructor(...args: ConstructorParameters<typeof RgsPlugin>);
|
|
223
224
|
initialize(init: KalambaWebSocketClientInit): void;
|
|
224
225
|
reconnect(): Promise<void>;
|
|
@@ -715,7 +716,7 @@ declare interface SdkConfig {
|
|
|
715
716
|
homeUrl?: string;
|
|
716
717
|
integration: string;
|
|
717
718
|
integrationData?: unknown;
|
|
718
|
-
jurisdiction: string;
|
|
719
|
+
jurisdiction: string | null;
|
|
719
720
|
playMode: 'FUN' | 'REAL';
|
|
720
721
|
user: string;
|
|
721
722
|
sessionId: string;
|
|
@@ -735,6 +736,7 @@ declare interface SdkConfig {
|
|
|
735
736
|
feature: {
|
|
736
737
|
allowTelemetry: boolean;
|
|
737
738
|
allowFullscreen: boolean;
|
|
739
|
+
allowGamble: boolean;
|
|
738
740
|
allowQuickStop: boolean;
|
|
739
741
|
showCashier: boolean;
|
|
740
742
|
showClock: boolean;
|
|
@@ -819,22 +821,14 @@ declare type SdkOnlyMessagePayloadMap = {
|
|
|
819
821
|
/**
|
|
820
822
|
* ```typescript
|
|
821
823
|
* {
|
|
822
|
-
*
|
|
823
|
-
*
|
|
824
|
-
*
|
|
825
|
-
*
|
|
826
|
-
* }
|
|
827
|
-
* },
|
|
828
|
-
* pl: {
|
|
829
|
-
* my_custom_error: 'Coś poszło nie tak',
|
|
830
|
-
* RgsError: {
|
|
831
|
-
* OUT_OF_MONEY: 'Nie masz już środków',
|
|
832
|
-
* }
|
|
833
|
-
* }
|
|
824
|
+
* my_custom_error: 'Something went wrong',
|
|
825
|
+
* RgsError: {
|
|
826
|
+
* OUT_OF_MONEY: 'You are out of credits',
|
|
827
|
+
* }
|
|
834
828
|
* }
|
|
835
829
|
* ```
|
|
836
830
|
*/
|
|
837
|
-
translations:
|
|
831
|
+
translations: NestedRecord<string, string>;
|
|
838
832
|
settings: Settings;
|
|
839
833
|
'telemetry.click': {
|
|
840
834
|
location: string;
|