@kalamba/sdk 0.26.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/plugins.cjs CHANGED
@@ -2,4 +2,246 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2025, Kalamba Games Limited
4
4
  */
5
- "use strict";var rs=Object.defineProperty;var ft=i=>{throw TypeError(i)};var cs=(i,t,e)=>t in i?rs(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var b=(i,t,e)=>cs(i,typeof t!="symbol"?t+"":t,e),yt=(i,t,e)=>t.has(i)||ft("Cannot "+e);var k=(i,t,e)=>(yt(i,t,"read from private field"),e?e.call(i):t.get(i)),M=(i,t,e)=>t.has(i)?ft("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),E=(i,t,e,s)=>(yt(i,t,"write to private field"),s?s.call(i,e):t.set(i,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const te=require("./errors-BXO3dlhS.cjs"),qe=require("./encoders-DVHzIpWT.cjs"),gt=require("./v4-CoqWKwnX.cjs");function A(i,t){return(e,...s)=>{console.log(`[%c${i}\x1B[m] %s`,t,e,...s)}}function Kt(i,t){return Math.round(i*100/t)}class R{constructor(t,e){b(this,"config");b(this,"sdkConfig");this.config=t,this.sdkConfig=e}on(t,e,s){const a=function(c){c.data.message!==`kalamba:wrapper-casino:${t}`&&c.data.message!==`kalamba:wrapper:${t}`||e(c.data.payload)};window.addEventListener("message",a,s)}send(t,...[e]){window.postMessage({message:`kalamba:casino:${t}`,payload:e})}}const ds=A("BasicPlugin","color:#000000;font-weight:bold;");class ls extends R{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),ds("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,payload:s}=t.data;switch(e){case"doAudioSettings":this.send("settings",{music:s==null?void 0:s.musicEnabled,sounds:s==null?void 0:s.soundEnabled});return;case"doBalanceUpdate":const{currency:a,coinValueInCents:r}=this.sdkConfig.api;s.currency===a&&typeof s.balanceInCurrency=="number"?this.send("balance",{balance:Kt(s.balanceInCurrency,r)}):(s.balanceInCoins,this.send("balance",{balance:s.balanceInCoins}));return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.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=A("▼ DebuggingPlugin IN ▼","color:#444444;font-weight:bold;"),us=A("▲ DebuggingPlugin OUT ▲","color:#444444;font-weight:bold;");class hs extends R{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){us.apply(null,t),this.send.apply(this,t)}}const kt=A("GigPlugin","color:#000000;font-weight:bold;");class gs extends R{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),kt("configured")}postMessage(t){const e={event:t};kt("postMessage",e),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 ps=A("OryxPlugin","color:#000000;font-weight:bold;");class ws extends R{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),ps("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,param:s}=t.data;switch(e){case"doBalanceUpdate":this.send("balance",{balance:s});return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){let t=0;this.on("close",()=>{window.top.postMessage({wpgaction:"close"},"*"),window.parent.postMessage({wpgaction:"close.parent"},"*")}),this.on("balance",({balance:e})=>{t!==e&&(t=e,window.top.postMessage({param:{},wpgaction:"balance"},"*"),window.parent.postMessage({param:{},wpgaction:"balance.parent"},"*"))}),this.on("loadStart",()=>{window.top.postMessage({wpgaction:"loadStart"},"*"),window.parent.postMessage({wpgaction:"loadStart.parent"},"*")}),this.on("loadEnd",()=>{window.top.postMessage({wpgaction:"loadEnd"},"*"),window.parent.postMessage({wpgaction:"loadEnd.parent"},"*")}),this.on("playStart",()=>{window.top.postMessage({wpgaction:"gameSpinStart"},"*"),window.parent.postMessage({wpgaction:"gameSpinStart.parent"},"*")}),this.on("playEnd",()=>{window.top.postMessage({wpgaction:"gameSpinEnd"},"*"),window.parent.postMessage({wpgaction:"gameSpinEnd.parent"},"*")}),this.on("cashier",({type:e})=>{switch(e){case"BALANCE_LOW":window.top.postMessage({wpgaction:"cashier"},"*"),window.parent.postMessage({wpgaction:"cashier.parent"},"*");break;case"BALANCE_INSUFFICIENT":window.top.postMessage({wpgaction:"errorOutOfMoney"},"*"),window.parent.postMessage({wpgaction:"errorOutOfMoney.parent"},"*");break}})}}const We=A("PariplayPlugin","color:#000000;font-weight:bold;");function je(i){try{window.top.location=i}catch{window.location=i}}function $e(i,t){return new Promise(function(s,a){const r=new XMLHttpRequest;r.onload=function(){r.status>=200&&r.status<300?s(r.responseText):a(r.responseText)},r.open(i,t),r.send()})}function Ke(){}function ms(i){return i.filter(function(e){return e.messageType.toUpperCase()==="DATA"})}function Qe(i){return i.filter(function(e){return["NOTIFICATION","POPUP"].includes(e.messageType.toUpperCase())})}function Qt(i){try{return JSON.parse(i.text)}catch{return{}}}function bs(i){return i.map(Qt).filter(Boolean).find(function(e){return e.betId!=null&&e.winId!=null})||{}}function fs(i){return i.map(Qt).filter(Boolean).find(function(e){return e.TotalBet!=null&&e.TotalWin!=null})||{}}class ys extends R{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),We("configured")}postMessage(t,e){const s={lang:this.sdkConfig.ui.language,sender:this.sdkConfig.api.game,type:t};e!=null&&(s.data=e),We("postMessage",s),window.parent.postMessage(s,"*")}coinsToCurrency(t){return t*this.sdkConfig.api.coinValueInCents/100}handleContinueButton(t,e){t.link&&$e("GET",t.link),e()}handleLinkButton(t,e){switch(t.linkType.toUpperCase()){case"AJAX":$e("GET",t.link),e();return;case"AJAXRESPONSE":$e("GET",t.link).then(()=>{e()});return;case"REDIRECT":je(t.link),e();return}}handleQuitButton(t,e){this.send("close"),e()}handleCashierButton(t,e){this.send("cashier",{type:"ON_DEMAND"}),e()}handleHistoryButton(t,e){this.send("history",{source:"casino"}),e()}get buttonActions(){return{CASHIER:this.handleCashierButton,CONTINUE:this.handleContinueButton,HISTORY:this.handleHistoryButton,LINK:this.handleLinkButton,QUIT:this.handleQuitButton}}processInfoUiMessages(t){return t.reduce((e,s)=>e.then(()=>new Promise(a=>{const r=Object.assign({},s,{buttons:s.buttons.filter(c=>c.action.toUpperCase()==="CASHIER"?!!this.sdkConfig.api.cashierUrl:!0).map(c=>Object.assign({},c,{onRelease:()=>{const g=s.messageType.toUpperCase()==="POPUP"?Ke:a,h=this.buttonActions[c.action.toUpperCase()];h?h(c,g):g()}}))});We("showMessage",r)}).catch(Ke)),Promise.resolve()).then(()=>{}).catch(Ke)}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e}=t.data;switch(e){case"pause":case"disableSpin":this.send("freeze");return;case"resume":case"enableSpin":this.send("unfreeze");return;case"stopAutobet":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){let t=0;this.on("openGameResponse",e=>{let s;try{const a=JSON.parse(JSON.parse(atob(this.sdkConfig.api.integrationData.token.split(".")[1])).token),r=JSON.parse(a.integrationSpecificAttributes.sessionData||"{}");s={ClientToken:a.integrationSpecificAttributes.clientToken,CurrencyCode:a.currency,PlayerTokenId:a.user,SessionData:r}}catch{s=void 0}this.postMessage("gameDataLoaded",{LoadGameData:s,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"):je(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 s=Qe(e.contract.uiMessages);this.processInfoUiMessages(s)}catch{}}),this.on("playError",e=>{this.postMessage("ticketReceived",{ErrorCode:e.type==="error"?e.data.code:"TIMEOUT",ErrorMessage:"ERROR",Status:{ErrCode:e.type==="error"?e.data.code:"TIMEOUT"}})}),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 s=["BaseGame","PaidSpin"].includes(e.contract.stateType.thisRound),a=ms(e.contract.uiMessages),r=Qe(e.contract.uiMessages),c=bs(a),g=fs(a);this.postMessage("ticketReceived",{Balance:this.coinsToCurrency(e.contract.balance.coins),BetAmount:s?this.coinsToCurrency(e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier):0,CreditTransactionId:c.betId,DebitTransactionId:c.winId,Message:r,SessionData:g,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"):je(this.sdkConfig.api.cashierUrl))})}}const me=A("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class ks extends R{constructor(...e){super(...e);b(this,"VERSION","1.17.0");const s=document.createElement("script");s.src=`https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`,s.onload=()=>{me("loaded"),window.FEIM.configure({p2pConfig:{currency:this.sdkConfig.api.currency,launchParams:{homeurl:"homeUrl"}}}),me("configured"),this.registerToSdkEvents(),this.registerFromSdkEvents()},document.body.appendChild(s)}registerToSdkEvents(){window.FEIM.on.errorMessageDismissed(()=>this.send("unfreeze")),window.FEIM.on.errorMessageDisplayed(()=>this.send("freeze")),window.FEIM.on.exitingGame(()=>me("!!! NOT IMPLEMENTED: exitingGame !!!")),window.FEIM.on.freeze(()=>this.send("freeze")),window.FEIM.on.initialized(()=>me("!!! NOT IMPLEMENTED: initialized !!!")),window.FEIM.on.pauseAutoPlay(()=>this.send("suspend")),window.FEIM.on.refreshBalance(()=>me("!!! NOT IMPLEMENTED: refreshBalance !!!")),window.FEIM.on.toggleGameHelp(()=>{this.send("help")}),window.FEIM.on.togglePaytable(()=>{this.send("paytable")}),window.FEIM.on.unfreeze(()=>this.send("unfreeze")),window.FEIM.on.updateSettings(({payload:[e]})=>this.send("settings",{sounds:e.sounds,fastPlay:e.fastPlay}))}registerFromSdkEvents(){this.on("autoplay",({action:e})=>{switch(e){case"start":window.FEIM.send.autoPlayStarted();break;case"stop":window.FEIM.send.autoPlayFinished();break}}),this.on("balance",({balance:e})=>{window.FEIM.send.balanceUpdate(e)}),this.on("bet",({base:e,multiplier:s})=>{window.FEIM.send.betUpdate(e*s)}),this.on("error",e=>{const s="message"in e?e.message:"Unknown error";window.FEIM.send.errorMessage(s)}),this.on("close",()=>{window.FEIM.send.exitGame()}),this.on("loadEnd",()=>{window.FEIM.send.gameLoadCompleted()}),this.on("loadProgress",({progress:e})=>{window.FEIM.send.gameLoadProgress(e)}),this.on("loadStart",()=>{window.FEIM.send.gameLoadStarted()}),this.on("cashier",()=>{window.FEIM.send.openQuickDeposit()}),this.on("playCycleEnd",e=>{const s={balance:e.contract.balance.coins,bet:e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier,win:{win:e.contract.win.total}};window.FEIM.send.roundFinished(s)}),this.on("playResponse",e=>{const s={balance:e.contract.balance.coins,playResponse:e.data};window.FEIM.send.roundStarted(s)}),this.on("history",()=>{window.FEIM.send.showHistory()}),this.on("settings",e=>{window.FEIM.send.updateSettings(e)})}}const Xe=A("TukoPlugin","color:#000000;font-weight:bold;");class Es extends R{constructor(...e){super(...e);b(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(),Xe("configured")}ping(e){const s=new XMLHttpRequest;s.onreadystatechange=function(){s.readyState===XMLHttpRequest.DONE&&(s.status===0||s.status>=200&&s.status<400?Xe("ping ok",s):Xe("ping error",s))},s.open("GET",e),s.send()}registerToSdkEvents(){window.addEventListener("message",e=>{try{const{type:s,payload:a}=e.data;switch(s){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:c}=this.sdkConfig.api;a.currency===r&&typeof a.balanceInCurrency=="number"?this.send("balance",{balance:Kt(a.balanceInCurrency,c)}):(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 Et=A("QuantaPlugin","color:#000000;font-weight:bold;");class vs extends R{constructor(...t){super(...t),this.registerFromSdkEvents(),Et("configured")}postMessage(t){const e={event:t};Et("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")})}}const vt=A("SoftSwissPlugin","color:#000000;font-weight:bold;");class Cs extends R{constructor(...t){super(...t),this.registerFromSdkEvents(),vt("configured")}postMessage(t,e){const s={event:t,payload:e};vt("postMessage",s),window.top.postMessage(s,"*")}registerFromSdkEvents(){this.on("loadStart",()=>{this.postMessage("gameLoadStarted")}),this.on("loadProgress",({progress:t})=>{this.postMessage("gameLoadProgress",{progress:t})}),this.on("loadEnd",()=>{this.postMessage("gameLoadCompleted")}),this.on("playCycleStart",()=>{this.postMessage("gameAnimationStart")}),this.on("playCycleEnd",t=>{this.postMessage("winUpdate",{win:t.contract.win.total}),this.postMessage("gameAnimationCompleted")}),this.on("playError",()=>{this.postMessage("gameAnimationCompleted")}),this.on("balance",({balance:t})=>{this.postMessage("balanceUpdate",{balance:t})}),this.on("bet",t=>{this.postMessage("stakeUpdate",{bet:t})})}}const Ct=A("EveryMatrixPlugin","color:#000000;font-weight:bold;");class Ms extends R{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Ct("configured")}postMessage(t,e){const s={name:t,sender:"game",data:e};Ct("postMessage",s),window.top.postMessage(s,"*")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{name:e,sender:s}=t.data;if(s!=="emwindow")return;switch(e){case"updateBalance":this.send("getBalance");return;case"togglePaytable":this.send("paytable");return;case"stopAutoplay":this.send("suspend");return;case"showHelp":this.send("help",{show:!0});return;default:return}}catch{}})}registerFromSdkEvents(){this.on("loadProgress",({progress:t})=>{this.postMessage("loadProgress",{progress:t})}),this.on("loadEnd",()=>{this.postMessage("loadCompleted")}),this.on("settings",t=>{(t!=null&&t.music||t!=null&&t.sounds)&&this.postMessage("audioToggle")}),this.on("playCycleStart",()=>{this.postMessage("roundStart")}),this.on("playCycleEnd",()=>{this.postMessage("roundEnd")}),this.on("playError",()=>{this.postMessage("errorMessage")}),this.on("error",()=>{this.postMessage("errorMessage")}),this.on("close",()=>{this.postMessage("close")}),this.on("bet",()=>{this.postMessage("stakeUpdate")})}}var Ss="2.0.3",dt=500,Mt="user-agent",ue="",St="?",_e="function",j="undefined",he="object",lt="string",S="browser",N="cpu",L="device",x="engine",O="os",se="result",l="name",n="type",d="vendor",u="version",T="architecture",Te="major",o="model",Me="console",w="mobile",f="tablet",y="smarttv",U="wearable",Je="xr",Se="embedded",be="inapp",pt="brands",Y="formFactors",wt="fullVersionList",ie="platform",mt="platformVersion",Ve="bitness",$="sec-ch-ua",Ts=$+"-full-version-list",Is=$+"-arch",Ps=$+"-"+Ve,As=$+"-form-factors",Os=$+"-"+w,xs=$+"-"+o,Xt=$+"-"+ie,Rs=Xt+"-version",Jt=[pt,wt,w,o,ie,mt,T,Y,Ve],Re="Amazon",Z="Apple",Tt="ASUS",It="BlackBerry",J="Google",Pt="Huawei",At="Lenovo",Ot="Honor",Ue="LG",Ye="Microsoft",Ze="Motorola",et="Nvidia",xt="OnePlus",tt="OPPO",fe="Samsung",Rt="Sharp",ye="Sony",st="Xiaomi",it="Zebra",Ut="Chrome",Lt="Chromium",V="Chromecast",Us="Edge",ke="Firefox",Ee="Opera",at="Facebook",Bt="Sogou",ee="Mobile ",ve=" Browser",ut="Windows",Ls=typeof window!==j,I=Ls&&window.navigator?window.navigator:void 0,z=I&&I.userAgentData?I.userAgentData:void 0,Bs=function(i,t){var e={},s=t;if(!Ne(t)){s={};for(var a in t)for(var r in t[a])s[r]=t[a][r].concat(s[r]?s[r]:[])}for(var c in i)e[c]=s[c]&&s[c].length%2===0?s[c].concat(i[c]):i[c];return e},ze=function(i){for(var t={},e=0;e<i.length;e++)t[i[e].toUpperCase()]=i[e];return t},ht=function(i,t){if(typeof i===he&&i.length>0){for(var e in i)if(F(i[e])==F(t))return!0;return!1}return pe(i)?F(t).indexOf(F(i))!==-1:!1},Ne=function(i,t){for(var e in i)return/^(browser|cpu|device|engine|os)$/.test(e)||(t?Ne(i[e]):!1)},pe=function(i){return typeof i===lt},nt=function(i){if(i){for(var t=[],e=ge(/\\?\"/g,i).split(","),s=0;s<e.length;s++)if(e[s].indexOf(";")>-1){var a=Ie(e[s]).split(";v=");t[s]={brand:a[0],version:a[1]}}else t[s]=Ie(e[s]);return t}},F=function(i){return pe(i)?i.toLowerCase():i},ot=function(i){return pe(i)?ge(/[^\d\.]/g,i).split(".")[0]:void 0},D=function(i){for(var t in i){var e=i[t];typeof e==he&&e.length==2?this[e[0]]=e[1]:this[e]=void 0}return this},ge=function(i,t){return pe(t)?t.replace(i,ue):t},Ce=function(i){return ge(/\\?\"/g,i)},Ie=function(i,t){if(pe(i))return i=ge(/^\s\s*/,i),typeof t===j?i:i.substring(0,dt)},rt=function(i,t){if(!(!i||!t))for(var e=0,s,a,r,c,g,h;e<t.length&&!g;){var p=t[e],m=t[e+1];for(s=a=0;s<p.length&&!g&&p[s];)if(g=p[s++].exec(i),g)for(r=0;r<m.length;r++)h=g[++a],c=m[r],typeof c===he&&c.length>0?c.length===2?typeof c[1]==_e?this[c[0]]=c[1].call(this,h):this[c[0]]=c[1]:c.length===3?typeof c[1]===_e&&!(c[1].exec&&c[1].test)?this[c[0]]=h?c[1].call(this,h,c[2]):void 0:this[c[0]]=h?h.replace(c[1],c[2]):void 0:c.length===4&&(this[c[0]]=h?c[3].call(this,h.replace(c[1],c[2])):void 0):this[c]=h||void 0;e+=2}},q=function(i,t){for(var e in t)if(typeof t[e]===he&&t[e].length>0){for(var s=0;s<t[e].length;s++)if(ht(t[e][s],i))return e===St?void 0:e}else if(ht(t[e],i))return e===St?void 0:e;return t.hasOwnProperty("*")?t["*"]:i},_t={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"},Nt={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Ft={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[u,[l,ee+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[u,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,u],[/opios[\/ ]+([\w\.]+)/i],[u,[l,Ee+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[u,[l,Ee+" GX"]],[/\bopr\/([\w\.]+)/i],[u,[l,Ee]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[u,[l,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[u,[l,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[l,u],[/quark(?:pc)?\/([-\w\.]+)/i],[u,[l,"Quark"]],[/\bddg\/([\w\.]+)/i],[u,[l,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[u,[l,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[u,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[u,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[u,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[u,[l,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[u,[l,"Smart "+At+ve]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure"+ve],u],[/\bfocus\/([\w\.]+)/i],[u,[l,ke+" Focus"]],[/\bopt\/([\w\.]+)/i],[u,[l,Ee+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[u,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[u,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[u,[l,Ee+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[u,[l,"MIUI"+ve]],[/fxios\/([\w\.-]+)/i],[u,[l,ee+ke]],[/\bqihoobrowser\/?([\w\.]*)/i],[u,[l,"360"]],[/\b(qq)\/([\w\.]+)/i],[[l,/(.+)/,"$1Browser"],u],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1"+ve],u],[/samsungbrowser\/([\w\.]+)/i],[u,[l,fe+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[u,[l,Bt+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[l,Bt+" Mobile"],u],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[l,u],[/(lbbrowser|rekonq)/i],[l],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[u,l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,at],u,[n,be]],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat)[\/ ]([-\w\.]+)/i],[l,u,[n,be]],[/\bgsa\/([\w\.]+) .*safari\//i],[u,[l,"GSA"],[n,be]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[u,[l,"TikTok"],[n,be]],[/\[(linkedin)app\]/i],[l,[n,be]],[/(chromium)[\/ ]([-\w\.]+)/i],[l,u],[/headlesschrome(?:\/([\w\.]+)| )/i],[u,[l,Ut+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,Ut+" WebView"],u],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[u,[l,"Android"+ve]],[/chrome\/([\w\.]+) mobile/i],[u,[l,ee+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,u],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[u,[l,ee+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[l,ee+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[u,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[u,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[l,u],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[l,ee+ke],u],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],u],[/(wolvic|librewolf)\/([\w\.]+)/i],[l,u],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[u,[l,ke+" 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,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[l,[u,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[l,[u,/[^\d\.]+./,ue]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[T,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[T,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[T,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[T,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[T,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[T,/ower/,ue,F]],[/ sun4\w[;\)]/i],[[T,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[T,F]]],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],[o,[d,fe],[n,f]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[o,[d,fe],[n,w]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[o,[d,Z],[n,w]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[o,[d,Z],[n,f]],[/(macintosh);/i],[o,[d,Z]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[o,[d,Rt],[n,w]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[o,[d,Ot],[n,f]],[/honor([-\w ]+)[;\)]/i],[o,[d,Ot],[n,w]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[o,[d,Pt],[n,f]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[o,[d,Pt],[n,w]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[o,/_/g," "],[d,st],[n,f]],[/\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|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[o,/_/g," "],[d,st],[n,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[o,[d,tt],[n,w]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[o,[d,q,{OnePlus:["304","403","203"],"*":tt}],[n,f]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[o,[d,"BLU"],[n,w]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[o,[d,"Vivo"],[n,w]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[o,[d,"Realme"],[n,w]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[o,[d,Ze],[n,w]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[o,[d,Ze],[n,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[o,[d,Ue],[n,f]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch))(\w+)/i,/\blg-?([\d\w]+) bui/i],[o,[d,Ue],[n,w]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[o,[d,At],[n,f]],[/(nokia) (t[12][01])/i],[d,o,[n,f]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[o,/_/g," "],[n,w],[d,"Nokia"]],[/(pixel (c|tablet))\b/i],[o,[d,J],[n,f]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[o,[d,J],[n,w]],[/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],[o,[d,ye],[n,w]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[o,"Xperia Tablet"],[d,ye],[n,f]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[o,[d,xt],[n,w]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[o,[d,Re],[n,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[o,/(.+)/g,"Fire Phone $1"],[d,Re],[n,w]],[/(playbook);[-\w\),; ]+(rim)/i],[o,d,[n,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[o,[d,It],[n,w]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[o,[d,Tt],[n,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[o,[d,Tt],[n,w]],[/(nexus 9)/i],[o,[d,"HTC"],[n,f]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[o,/_/g," "],[n,w]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[o,[d,"TCL"],[n,f]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[o,[d,"TCL"],[n,w]],[/(itel) ((\w+))/i],[[d,F],o,[n,q,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[o,[d,"Acer"],[n,f]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[o,[d,"Meizu"],[n,w]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[o,[d,"Ulefone"],[n,w]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[o,[d,"Energizer"],[n,w]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[o,[d,"Cat"],[n,w]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[o,[d,"Smartfren"],[n,w]],[/droid.+; (a(?:015|06[35]|142p?))/i],[o,[d,"Nothing"],[n,w]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[o,[d,"Archos"],[n,f]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[o,[d,"Archos"],[n,w]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[d,o,[n,f]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[d,o,[n,w]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[d,o,[n,f]],[/(surface duo)/i],[o,[d,Ye],[n,f]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[o,[d,"Fairphone"],[n,w]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[o,[d,et],[n,f]],[/(sprint) (\w+)/i],[d,o,[n,w]],[/(kin\.[onetw]{3})/i],[[o,/\./g," "],[d,Ye],[n,w]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[o,[d,it],[n,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[o,[d,it],[n,w]],[/smart-tv.+(samsung)/i],[d,[n,y]],[/hbbtv.+maple;(\d+)/i],[[o,/^/,"SmartTV"],[d,fe],[n,y]],[/tcast.+(lg)e?. ([-\w]+)/i],[d,o,[n,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,Ue],[n,y]],[/(apple) ?tv/i],[d,[o,Z+" TV"],[n,y]],[/crkey.*devicetype\/chromecast/i],[[o,V+" Third Generation"],[d,J],[n,y]],[/crkey.*devicetype\/([^/]*)/i],[[o,/^/,"Chromecast "],[d,J],[n,y]],[/fuchsia.*crkey/i],[[o,V+" Nest Hub"],[d,J],[n,y]],[/crkey/i],[[o,V],[d,J],[n,y]],[/(portaltv)/i],[o,[d,at],[n,y]],[/droid.+aft(\w+)( bui|\))/i],[o,[d,Re],[n,y]],[/(shield \w+ tv)/i],[o,[d,et],[n,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[o,[d,Rt],[n,y]],[/(bravia[\w ]+)( bui|\))/i],[o,[d,ye],[n,y]],[/(mi(tv|box)-?\w+) bui/i],[o,[d,st],[n,y]],[/Hbbtv.*(technisat) (.*);/i],[d,o,[n,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,Ie],[o,Ie],[n,y]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[o,[n,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[n,y]],[/(ouya)/i,/(nintendo) (\w+)/i],[d,o,[n,Me]],[/droid.+; (shield)( bui|\))/i],[o,[d,et],[n,Me]],[/(playstation \w+)/i],[o,[d,ye],[n,Me]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[o,[d,Ye],[n,Me]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[o,[d,fe],[n,U]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[d,o,[n,U]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[o,[d,tt],[n,U]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[o,[d,Z],[n,U]],[/(opwwe\d{3})/i],[o,[d,xt],[n,U]],[/(moto 360)/i],[o,[d,Ze],[n,U]],[/(smartwatch 3)/i],[o,[d,ye],[n,U]],[/(g watch r)/i],[o,[d,Ue],[n,U]],[/droid.+; (wt63?0{2,3})\)/i],[o,[d,it],[n,U]],[/droid.+; (glass) \d/i],[o,[d,J],[n,Je]],[/(pico) (4|neo3(?: link|pro)?)/i],[d,o,[n,Je]],[/(quest( \d| pro)?s?).+vr/i],[o,[d,at],[n,Je]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[n,Se]],[/(aeobc)\b/i],[o,[d,Re],[n,Se]],[/(homepod).+mac os/i],[o,[d,Z],[n,Se]],[/windows iot/i],[[n,Se]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[o,[n,q,{mobile:"Mobile",xr:"VR","*":f}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[n,f]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[n,w]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[o,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[u,[l,Us+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[l,u],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[u,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[l,u],[/ladybird\//i],[[l,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[u,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,u],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[l,[u,q,_t]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,q,_t],[l,ut]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[u,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,"macOS"],[u,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[u,[l,V+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[u,[l,V+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[u,[l,V+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[u,[l,V+" Linux"]],[/crkey\/([\d\.]+)/i],[u,[l,V]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[u,l],[/(ubuntu) ([\w\.]+) like android/i],[[l,/(.+)/,"$1 Touch"],u],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/\.; ]?([\d\.]*)/i],[l,u],[/\(bb(10);/i],[u,[l,It]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[u,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[u,[l,ke+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[u,[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[u,[l,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,"Chrome OS"],u],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/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)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,u],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],u],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[l,u]]},Le=function(){var i={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return D.call(i.init,[[S,[l,u,Te,n]],[N,[T]],[L,[n,o,d]],[x,[l,u]],[O,[l,u]]]),D.call(i.isIgnore,[[S,[u,Te]],[x,[u]],[O,[u]]]),D.call(i.isIgnoreRgx,[[S,/ ?browser$/i],[O,/ ?os$/i]]),D.call(i.toString,[[S,[l,u]],[N,[T]],[L,[d,o]],[x,[l,u]],[O,[l,u]]]),i}(),_s=function(i,t){var e=Le.init[t],s=Le.isIgnore[t]||0,a=Le.isIgnoreRgx[t]||0,r=Le.toString[t]||0;function c(){D.call(this,e)}return c.prototype.getItem=function(){return i},c.prototype.withClientHints=function(){return z?z.getHighEntropyValues(Jt).then(function(g){return i.setCH(new Yt(g,!1)).parseCH().get()}):i.parseCH().get()},c.prototype.withFeatureCheck=function(){return i.detectFeature().get()},t!=se&&(c.prototype.is=function(g){var h=!1;for(var p in this)if(this.hasOwnProperty(p)&&!ht(s,p)&&F(a?ge(a,this[p]):this[p])==F(a?ge(a,g):g)){if(h=!0,g!=j)break}else if(g==j&&h){h=!h;break}return h},c.prototype.toString=function(){var g=ue;for(var h in r)typeof this[r[h]]!==j&&(g+=(g?" ":ue)+this[r[h]]);return g||j}),z||(c.prototype.then=function(g){var h=this,p=function(){for(var C in h)h.hasOwnProperty(C)&&(this[C]=h[C])};p.prototype={is:c.prototype.is,toString:c.prototype.toString};var m=new p;return g(m),m}),new c};function Yt(i,t){if(i=i||{},D.call(this,Jt),t)D.call(this,[[pt,nt(i[$])],[wt,nt(i[Ts])],[w,/\?1/.test(i[Os])],[o,Ce(i[xs])],[ie,Ce(i[Xt])],[mt,Ce(i[Rs])],[T,Ce(i[Is])],[Y,nt(i[As])],[Ve,Ce(i[Ps])]]);else for(var e in i)this.hasOwnProperty(e)&&typeof i[e]!==j&&(this[e]=i[e])}function Dt(i,t,e,s){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(I&&I.userAgent==this.ua)switch(this.itemType){case S:I.brave&&typeof I.brave.isBrave==_e&&this.set(l,"Brave");break;case L:!this.get(n)&&z&&z[w]&&this.set(n,w),this.get(o)=="Macintosh"&&I&&typeof I.standalone!==j&&I.maxTouchPoints&&I.maxTouchPoints>2&&this.set(o,"iPad").set(n,f);break;case O:!this.get(l)&&z&&z[ie]&&this.set(l,z[ie]);break;case se:var a=this.data,r=function(c){return a[c].getItem().detectFeature().get()};this.set(S,r(S)).set(N,r(N)).set(L,r(L)).set(x,r(x)).set(O,r(O))}return this},this.parseUA=function(){return this.itemType!=se&&rt.call(this.data,this.ua,this.rgxMap),this.itemType==S&&this.set(Te,ot(this.get(u))),this},this.parseCH=function(){var a=this.uaCH,r=this.rgxMap;switch(this.itemType){case S:case x:var c=a[wt]||a[pt],g;if(c)for(var h in c){var p=c[h].brand||c[h],m=c[h].version;this.itemType==S&&!/not.a.brand/i.test(p)&&(!g||/chrom/i.test(g)&&p!=Lt)&&(p=q(p,{Chrome:"Google Chrome",Edge:"Microsoft Edge","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"}),this.set(l,p).set(u,m).set(Te,ot(m)),g=p),this.itemType==x&&p==Lt&&this.set(u,m)}break;case N:var C=a[T];C&&(C&&a[Ve]=="64"&&(C+="64"),rt.call(this.data,C+";",r));break;case L:if(a[w]&&this.set(n,w),a[o]&&(this.set(o,a[o]),!this.get(n)||!this.get(d))){var P={};rt.call(P,"droid 9; "+a[o]+")",r),!this.get(n)&&P.type&&this.set(n,P.type),!this.get(d)&&P.vendor&&this.set(d,P.vendor)}if(a[Y]){var G;if(typeof a[Y]!="string")for(var we=0;!G&&we<a[Y].length;)G=q(a[Y][we++],Nt);else G=q(a[Y],Nt);this.set(n,G)}break;case O:var _=a[ie];if(_){var K=a[mt];_==ut&&(K=parseInt(ot(K),10)>=13?"11":"10"),this.set(l,_).set(u,K)}this.get(l)==ut&&a[o]=="Xbox"&&this.set(l,"Xbox").set(u,void 0);break;case se:var Q=this.data,H=function(xe){return Q[xe].getItem().setCH(a).parseCH().get()};this.set(S,H(S)).set(N,H(N)).set(L,H(L)).set(x,H(x)).set(O,H(O))}return this},D.call(this,[["itemType",i],["ua",t],["uaCH",s],["rgxMap",e],["data",_s(this,i)]]),this}function B(i,t,e){if(typeof i===he?(Ne(i,!0)?(typeof t===he&&(e=t),t=i):(e=i,t=void 0),i=void 0):typeof i===lt&&!Ne(t,!0)&&(e=t,t=void 0),e&&typeof e.append===_e){var s={};e.forEach(function(h,p){s[p]=h}),e=s}if(!(this instanceof B))return new B(i,t,e).getResult();var a=typeof i===lt?i:e&&e[Mt]?e[Mt]:I&&I.userAgent?I.userAgent:ue,r=new Yt(e,!0),c=t?Bs(Ft,t):Ft,g=function(h){return h==se?function(){return new Dt(h,a,c,r).set("ua",a).set(S,this.getBrowser()).set(N,this.getCPU()).set(L,this.getDevice()).set(x,this.getEngine()).set(O,this.getOS()).get()}:function(){return new Dt(h,a,c[h],r).parseUA().get()}};return D.call(this,[["getBrowser",g(S)],["getCPU",g(N)],["getDevice",g(L)],["getEngine",g(x)],["getOS",g(O)],["getResult",g(se)],["getUA",function(){return a}],["setUA",function(h){return pe(h)&&(a=h.length>dt?Ie(h,dt):h),this}]]).setUA(a),this}B.VERSION=Ss;B.BROWSER=ze([l,u,Te,n]);B.CPU=ze([T]);B.DEVICE=ze([o,d,n,Me,w,y,f,U,Se]);B.ENGINE=B.OS=ze([l,u]);class Zt{constructor(t,e){b(this,"config");b(this,"sdkConfig");b(this,"error");this.config=t,this.sdkConfig=e,this.on("openGame",async()=>{try{this.error=void 0;const s=await this.openGame();this.send("openGameResponse",s)}catch(s){this.error=s,this.send("openGameError",this.error)}}),this.on("play",async s=>{try{this.error=void 0;const a=await this.play(s);this.send("playResponse",a)}catch(a){this.error=a,this.send("playError",this.error)}}),this.on("freeRounds",async s=>{try{this.error=void 0;const a=await this.freeRounds(s);this.send("freeRoundsResponse",a)}catch(a){this.error=a,this.send("freeRoundsError",this.error)}}),this.on("getBalance",async()=>{try{this.error=void 0;const s=await this.getBalance();this.send("balance",s)}catch{}}),this.showHistory=this.showHistory.bind(this),this.on("history",this.showHistory)}on(t,e,s){const a=function(c){c.data.message!==`kalamba:wrapper-rgs:${t}`&&c.data.message!==`kalamba:wrapper:${t}`||e(c.data.payload)};window.addEventListener("message",a,s)}send(t,...[e]){window.postMessage({message:`kalamba:rgs:${t}`,payload:e})}async openGame(){throw new Error("Not implemented")}async play(t){throw new Error("Not implemented")}async freeRounds(t){throw new Error("Not implemented")}async getBalance(){throw new Error("Not implemented")}async showHistory(){throw new Error("Not implemented")}}class Ns{constructor(t){b(this,"socket",null);b(this,"webSocketUrl");b(this,"eventListeners",{close:[],error:[],message:[]});b(this,"connect",async()=>{const t=new WebSocket(this.webSocketUrl);return t.addEventListener("message",this.handleMessage),new Promise(e=>{t.addEventListener("open",s=>{this.handleOpen(s),e(this.socket)},{once:!0})})});b(this,"send",t=>{if(this.socket==null)throw new Error("Cannot send message, the WebSocket connection is not open");this.socket.send(t)});b(this,"close",()=>{if(this.socket==null)throw new Error("Cannot close the WebSocket connection that is not open");this.socket.close()});b(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});b(this,"handleError",t=>{this.eventListeners.error.forEach(e=>{e(t)})});b(this,"handleMessage",t=>{this.eventListeners.message.forEach(e=>{e(t)})});b(this,"handleOpen",t=>{const e=t.target;e.addEventListener("close",this.handleClose),e.addEventListener("error",this.handleError),this.socket=e});this.webSocketUrl=t}addEventListener(t,e){this.eventListeners[t].push(e)}removeEventListener(t,e){const s=this.eventListeners[t].indexOf(e);s!==-1&&this.eventListeners[t].splice(s,1)}}function Be(i){return JSON.parse(i==null?void 0:i.data)}function Fs(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="Ping"}function Gt(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="RealityCheck"}function Fe(i){return i.header.name==="GameEvent"}function Ds(i){return Fe(i)&&i.body.event==="OPEN_GAME"}function Ht(i){return i.header.code!==1}function Gs(i){return Fe(i)&&i.body.event.includes("_RESULT")}var ae,Pe;class Hs extends Ns{constructor(e,s){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());b(this,"cId",0);b(this,"mId",0);b(this,"seqId",0);b(this,"gameCode");M(this,ae);M(this,Pe);b(this,"onMessage",e=>{const s=Be(e);(Fe(s)||Fs(s)||Gt(s))&&this.sendAcknowledgement(s),Gt(s)&&this.handleRealityCheck(s)});this.eventListeners.realityCheck=[],this.gameCode=e.gameCode,E(this,ae,s.requestTimeoutMs),E(this,Pe,s.gameVersion??"unknown"),this.addEventListener("message",this.onMessage)}handleRealityCheck(e){this.eventListeners.realityCheck.forEach(s=>{s(e.body)})}addEventListener(e,s){super.addEventListener(e,s)}removeEventListener(e,s){super.removeEventListener(e,s)}buildHeader(e,s=null){return{cId:s??++this.cId,code:s!==null?1:void 0,mId:++this.mId,name:e}}buildPayload(e,s){return JSON.stringify({body:s,header:e})}getBodyExtras(e){return{action:e,seqId:++this.seqId}}request(e,s){const a=this.buildPayload(e,s);return new Promise((r,c)=>{setTimeout(()=>c({type:"timeout"}),k(this,ae));const g=h=>{const p=Be(h);try{e.cId===p.header.cId&&(this.removeEventListener("message",g),p.header.code===1?r(p):c({message:p,type:"error"}))}catch{c({message:p,type:"error"})}};this.addEventListener("message",g),this.send(a)})}freeRounds(e){const s=this.buildHeader("ActivateFreeRound");return this.request(s,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 s=this.buildHeader("Authenticate"),a={clientType:3,version:k(this,Pe),reconnect:e};return this.request(s,a).then(r=>r.body).catch(r=>{var c;throw{data:(c=r==null?void 0:r.message)==null?void 0:c.body,type:r.type}})}async getBalance(){const e=this.buildHeader("GetBalance"),s={};return this.request(e,s).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 openGame(){const e=this.buildHeader("OpenGame"),s={gameCode:this.gameCode};return new Promise((a,r)=>{const c=g=>{const h=Be(g);Ds(h)?(this.removeEventListener("message",c),a(h.body)):Ht(h)&&r({data:h.body,type:"error"})};this.addEventListener("message",c),this.request(e,s).catch(g=>{var h;return r({data:(h=g==null?void 0:g.message)==null?void 0:h.body,type:g.type})})})}sendAcknowledgement(e){const{name:s,cId:a}=e.header,r=this.buildHeader(s,a),c=this.buildPayload(r,{});this.send(c)}sendAction(e,s){const a=this.buildHeader("GameAction"),r={...this.getBodyExtras(e),data:s};return new Promise((c,g)=>{const h=p=>{const m=Be(p);Fe(m)&&r.seqId===m.body.correlationSeqId&&(this.removeEventListener("message",h),Gs(m)?c(m.body):Ht(m)&&g({data:m.body,type:"error"}))};this.addEventListener("message",h),this.request(a,r).catch(p=>{var m;return g({data:(m=p==null?void 0:p.message)==null?void 0:m.body,type:p.type})})})}setRequestTimeoutMs(e){E(this,ae,e)}}ae=new WeakMap,Pe=new WeakMap;const Vs={CA_BC:"CA",CA_ON:"CA",GER:"DE",US_CT:"US",US_MI:"US",US_NJ:"US",USA:"US"};function Vt(i){return!i||i==="NOT_APPLICABLE"?null:Vs[i]??i}function es(i){const t=i.contract;return t?{contract:{balance:{coins:t.balance,version:t.balanceVersion},coinValueInCents:t.coinValueInCents,country:t.countryCode,currency:t.currencyCode,jurisdiction:Vt(t.jurisdictionCode),uiMessages:t.uiMessages,username:t.username}}:{contract:{balance:{coins:i.balance,version:i.balanceVersion},coinValueInCents:i.coinValueInCents,country:i.countryCode,currency:i.currencyCode,jurisdiction:Vt(i.jurisdictionCode),uiMessages:i.uiMessages,username:i.username}}}function ts(i){var t,e;return{code:((t=i.data)==null?void 0:t.code)??te.RgsErrorCode.UNKNOWN,details:(e=i.data)==null?void 0:e.details}}function ss(i,t,e){const s=t.contract;if(!s){const a=t.data;return{contract:{bet:{available:a.additionalConfigData.availableMultipliersPerBaseBet,default:{base:a.additionalConfigData.defaultBet.baseBet,multiplier:a.additionalConfigData.defaultBet.betMultiplier},max:a.additionalConfigData.maxAllowedOverallBetInCoins??null,last:a.gameState.betFromCurrentRound?{base:a.gameState.betFromCurrentRound.baseBet,multiplier:a.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:a.gameState.lastPlacedMainGameBet?{base:a.gameState.lastPlacedMainGameBet.baseBet,multiplier:a.gameState.lastPlacedMainGameBet.betMultiplier}:null},balance:{coins:t.balance,version:t.balanceVersion},freeRounds:(a.FREE_ROUNDS??[]).map(r=>({conf:{base:r.conf.baseBet,multiplier:r.conf.betMultiplier,numAwarded:r.conf.numAwarded},data:{numPlayed:r.data.numPlayed,win:r.data.winAmount,numLeft:r.data.numLeft},id:r.id,rejectable:r.rejectable,skippable:r.skippable,status:r.status,type:r.type})),gameModel:a.additionalConfigData.gameModelFile,metaData:a.gameConfigData.metaData,roundId:a.gameState.cycleId,serverTime:t.balanceVersion,sessionId:a.gameState.sessionId,stateType:{thisRound:a.gameState.stateTypeThisRound,nextRound:a.gameState.stateTypeNextRound},uiMessages:i.uiMessages,win:{max:a.maxWin??null,round:a.gameState.totalWinFromCurrentRound,total:a.gameState.totalWinFromCurrentGameCycle}},data:a}}return{contract:{bet:{available:s.availableMultipliersPerBaseBet,default:{base:s.defaultBet.baseBet,multiplier:s.defaultBet.betMultiplier},max:s.maxBetInCoins??null,last:s.lastBet?{base:s.lastBet.baseBet,multiplier:s.lastBet.betMultiplier}:null,lastPaid:s.lastMainGameBet?{base:s.lastMainGameBet.baseBet,multiplier:s.lastMainGameBet.betMultiplier}:null},balance:{coins:s.balanceInCoins,version:s.balanceVersion},freeRounds:(s.freeRounds??[]).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:s.gameModelFile,metaData:s.metaData,roundId:s.roundId,serverTime:s.serverTime,sessionId:s.sessionId,stateType:{thisRound:s.stateTypeThisRound,nextRound:s.stateTypeNextRound},uiMessages:i.contract.uiMessages.concat(s.uiMessages),win:{max:s.maxWinInCoins??null,round:s.roundWin,total:s.totalWin}},data:e?e(t.opaqueGameServerToUi):t.opaqueGameServerToUi}}function is(i){var t,e;return{code:((t=i.data)==null?void 0:t.code)??te.RgsErrorCode.UNKNOWN,details:(e=i.data)==null?void 0:e.details}}function as(i,t){const e=i.contract;if(!e){const s=i.data;return{contract:{bet:{last:s.gameState.betFromCurrentRound?{base:s.gameState.betFromCurrentRound.baseBet,multiplier:s.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:{base:(s.gameState.lastPlacedMainGameBet??s.gameState.betFromCurrentRound).baseBet,multiplier:(s.gameState.lastPlacedMainGameBet??s.gameState.betFromCurrentRound).betMultiplier}},balance:{coins:i.balance,version:i.balanceVersion},freeRounds:(s.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})),serverTime:i.balanceVersion,roundId:s.gameState.cycleId,stateType:{thisRound:s.gameState.stateTypeThisRound,nextRound:s.gameState.stateTypeNextRound},uiMessages:s.uiMessages,win:{round:s.gameState.totalWinFromCurrentRound,total:s.gameState.totalWinFromCurrentGameCycle}},data:s}}return{contract:{bet:{last:e.lastBet?{base:e.lastBet.baseBet,multiplier:e.lastBet.betMultiplier}:null,lastPaid:{base:e.lastMainGameBet.baseBet,multiplier:e.lastMainGameBet.betMultiplier}},balance:{coins:e.balanceInCoins,version:e.balanceVersion},freeRounds:(e.freeRounds??[]).map(s=>({conf:{base:s.conf.baseBet,multiplier:s.conf.betMultiplier,numAwarded:s.conf.numAwarded},data:{numPlayed:s.data.numPlayed,win:s.data.winAmount,numLeft:s.data.numLeft},id:s.id,rejectable:s.rejectable,skippable:s.skippable,status:s.status,type:s.type})),serverTime:e.serverTime,roundId:e.roundId,stateType:{thisRound:e.stateTypeThisRound,nextRound:e.stateTypeNextRound},uiMessages:e.uiMessages,win:{round:e.roundWin,total:e.totalWin}},data:t?t(i.opaqueGameServerToUi):i.opaqueGameServerToUi}}function ns(i){var t,e;return{code:((t=i.data)==null?void 0:t.code)??te.RgsErrorCode.UNKNOWN,details:(e=i.data)==null?void 0:e.details}}const zs={parseAuthenticateResponse:es,parseAuthenticateError:ts,parseOpenGameResponse:ss,parseOpenGameError:is,parsePlayResponse:as,parsePlayError:ns},qs={aze:"az",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:Ws}=B(navigator.userAgent),js=A("KalambaBullseyePlugin","color:#000000;font-weight:bold;");class $s extends Zt{constructor(...e){super(...e);b(this,"socket");this.on("configured",s=>{this.socket.setRequestTimeoutMs(s.ui.requestTimeoutMs)})}initialize(e){this.socket=new Hs(e,{gameVersion:this.config.gameVersion,requestTimeoutMs:this.sdkConfig.ui.requestTimeoutMs}),["fireboltroulette"].includes(e.gameCode)||(this.socket.addEventListener("close",s=>{s.code===1008?this.error||this.send("error",{type:"CLOSE",messageCode:"TOO_MANY_OPEN_GAMES",messageKey:"RgsError.TOO_MANY_OPEN_GAMES"}):s.code===1011?this.error||this.send("error",{type:"CLOSE",messageCode:"UNKNOWN",messageKey:"RgsError.UNKNOWN"}):this.reconnect()}),["mobile","tablet"].includes(Ws.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",s=>js("error",s)),this.socket.addEventListener("realityCheck",s=>{this.send("realityCheck",s)})}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 H,xe;const e=new URLSearchParams(window.location.search),s=e.get("apiUrl"),a=e.get("cageCode"),r=e.get("gameCode"),c=e.get("operatorCode"),g=e.get("playMode"),h=e.get("token"),p=e.get("username"),m=e.get("gameHistoryUrl"),C=e.get("homeUrl")??void 0,P=e.get("cashierUrl")??void 0;this.initialize({apiUrl:s,cageCode:a,gameCode:r,operatorCode:c,playMode:g,token:h,username:p});try{await this.socket.connect()}catch{throw{type:"error",data:{code:te.RgsErrorCode.CONNECTION_ERROR}}}let G;try{G=await this.socket.authenticate()}catch(X){throw{type:X.type,data:X.type==="error"?ts(X.data):void 0}}let we;try{we=await this.socket.openGame()}catch(X){throw{type:X.type,data:X.type==="error"?is(X.data):void 0}}const _=es(G),K=ss(G,we,this.config.dataDecoder&&qe.decoders[this.config.dataDecoder]);this.sdkConfig.api={...this.sdkConfig.api,brand:a,game:r,integration:c,jurisdiction:_.contract.jurisdiction,playMode:g,user:_.contract.username,integrationData:{token:h},country:_.contract.country,currency:_.contract.currency,coinValueInCents:_.contract.coinValueInCents,gameHistoryUrl:m,homeUrl:C,cashierUrl:P,backendSessionId:K.contract.sessionId,lastRoundId:K.contract.roundId};const Q=(xe=(H=e.get("languageCode"))==null?void 0:H.split("_"))==null?void 0:xe[0];return Q&&(this.sdkConfig.ui.language=Q.length===3?qs[Q]??Q:Q),K}async play(e){for(;!this.socket.socket;)await new Promise(P=>setTimeout(()=>P(),500));const{contract:{bet:s,forcedOutcomes:a,...r},extra:c,payloadToInject:g,actionType:h}=e,p=this.config.dataEncoder&&qe.encoders[this.config.dataEncoder],m={bet:s?{baseBet:s.base,betMultiplier:s.multiplier}:void 0,forcedOutcomes:a,...r,...g,opaqueUiToGameServer:p?p(c):c};let C;try{C=await this.socket.sendAction(h,m)}catch(P){throw{type:P.type,data:P.type==="error"?ns(P.data):void 0}}return as(C,this.config.dataDecoder&&qe.decoders[this.config.dataDecoder])}async freeRounds(e){try{await this.socket.freeRounds(e)}catch{throw{type:"error",data:{code:te.RgsErrorCode.UNKNOWN}}}return e}async getBalance(){try{return{balance:(await this.socket.getBalance()).balance}}catch{throw{type:"error",data:{code:te.RgsErrorCode.UNKNOWN}}}}async showHistory(){const{api:{game:e,integration:s,integrationData:a,jurisdiction:r,user:c,gameHistoryUrl:g},ui:{language:h}}=this.sdkConfig,p=c.replace(/^user_/,"").replace(new RegExp(`_${s}$`),""),m=new URL(window.location.href);m.hostname=m.hostname.replace(/^v\./,"").replace(/^play\./,"history."),m.pathname=m.pathname.replace(/(\/[0-9]+\.[0-9]+\.[0-9]+)?\/wrapper\.html/,"/list/index.html"),m.search="",m.searchParams.set("apiUrl",new URL(g).origin),m.searchParams.set("gameCode",e),r&&m.searchParams.set("jurisdiction",r),m.searchParams.set("operatorCode",s),m.searchParams.set("token",a.token),m.searchParams.set("username",p),m.searchParams.set("languageCode",h),this.config.gameHistoryUrl&&m.searchParams.set("gameHistoryUrl",this.config.gameHistoryUrl),window.open(m.toString(),"_blank")}}class os{constructor(t,e,s){b(this,"trackers");b(this,"config");b(this,"sdkConfig");this.trackers=t,this.config=e,this.sdkConfig=s}on(t,e,s){const a=function(c){c.data.message!==`kalamba:wrapper-telemetry:${t}`&&c.data.message!==`kalamba:wrapper:${t}`||e(c.data.payload)};window.addEventListener("message",a,s)}track(t,e){this.trackers.forEach(s=>s.track(t,e))}}function zt(i){return i.reduce((t,e)=>t+e,0)}function Ks(i){const t=i.length,e=zt(i)/t,s=i.map(r=>Math.pow(r-e,2)),a=zt(s)/t;return Math.sqrt(a)}class qt{constructor(){b(this,"rafId",-1);b(this,"startTime",0);b(this,"stopTime",0);b(this,"frames",[]);b(this,"calculateFPS",()=>{const t=Math.floor((this.stopTime-this.startTime)/1e3);return this.frames.map(e=>Math.floor((e-this.startTime)/1e3)).reduce((e,s,a,r)=>(r[a]!==r[a-1]?e.push(1):e[e.length-1]++,e),[]).slice(0,t)});b(this,"getReport",()=>{const t=this.calculateFPS(),e=Math.floor(this.frames.length/((this.stopTime-this.startTime)/1e3)),s=t.length>0?Math.max(...t):e,a=t.length>0?Math.min(...t):e,r=t.length>0?Ks(t):0;return{fpsAvg:e,fpsMax:s,fpsMin:a,fpsStdDev:r}});b(this,"start",()=>{this.startTime=Date.now(),this.frames=[],this.trackFrames()});b(this,"stop",()=>{cancelAnimationFrame(this.rafId),this.stopTime=Date.now()});b(this,"trackFrames",()=>{this.frames.push(Date.now()),this.rafId=requestAnimationFrame(this.trackFrames)})}}const Qs="landscape",Xs="portrait";function Js(){try{const i=document.createElement("canvas");return!!window.WebGLRenderingContext&&(i.getContext("webgl")||i.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function Ys(){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 ct(){return window.innerWidth>=window.innerHeight?Qs:Xs}var De,ne,oe,re,Ae,Ge,Oe,He;class Zs extends os{constructor(...e){super(...e);b(this,"FPS_SAMPLE_INTERVAL",1e4);M(this,De,0);M(this,ne);M(this,oe);M(this,re);M(this,Ae,!1);M(this,Ge,!1);M(this,Oe,"");M(this,He,[]);E(this,oe,{}),E(this,re,this.deviceInfo()),E(this,ne,this.config.gameVersion),this.on("state",({balance:s})=>{E(this,De,s)}),this.on("autoplay",({action:s})=>{["start","resume"].includes(s)?E(this,Ae,!0):E(this,Ae,!1)}),this.on("settings",({fastPlay:s})=>{s!==void 0&&E(this,Ge,s)}),this.registerEvents()}async registerEvents(){k(this,re).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,Oe,e.contract.stateType.nextRound),E(this,oe,{balanceInCoins:e.contract.balance.coins,clientVersion:k(this,ne),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",k(this,oe))}),this.on("playCycleEnd",async e=>{const s=await k(this,re),{base:a,multiplier:r}=e.contract.bet.lastPaid??{},c=e.contract.balance.coins,g=e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier,h=e.contract.win.total,p=h-g,m="spin",C=e.contract.roundId;this.track("Betting Activity",{balance:c-p,balanceAfter:c,baseBet:a,betMultiplier:r,betType:m,gameVersion:k(this,ne),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:s.isMobile,netResult:p,operatorName:"kalamba",orientation:ct(),partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,roundId:C,roundTypes:["BaseGame"],totalBet:g,totalWin:h}),E(this,He,[])}),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 qt,s=()=>{e.stop();const r=e.getReport();this.track("FPS Performance",{...r,fpsType:"sample"}),a()},a=async()=>{e.start(),setTimeout(s,this.FPS_SAMPLE_INTERVAL)};a()}reportFpsRound(){const e=new qt;this.on("playCycleStart",()=>{e.start()}),this.on("playCycleEnd",()=>{e.stop();const s=e.getReport();this.track("FPS Performance",{...s,fpsType:"playCycleStart->playCycleEnd"})})}getExtraUiInteractionData(){return{orientation:ct(),stateType:k(this,Oe)}}async deviceInfo(){var g;const{browser:e,device:s,os:a}=B(navigator.userAgent),r=Js(),c=await Ys();return{browserName:e.name,browserVersion:e.version,connection:(g=navigator.connection)==null?void 0:g.effectiveType,deviceName:s.model,deviceType:s.type,isMobile:["mobile","tablet"].includes(s.type??""),isWebGLSupported:r,isWebPSupported:c,manufacturer:s.vendor,operatingSystem:a.name,operatingSystemVersion:a.version,orientation:ct(),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}}}De=new WeakMap,ne=new WeakMap,oe=new WeakMap,re=new WeakMap,Ae=new WeakMap,Ge=new WeakMap,Oe=new WeakMap,He=new WeakMap;var ei=gt.requireNoop();const Wt=gt.getDefaultExportFromCjs(ei);class bt{constructor(t,e){b(this,"config");b(this,"sdkConfig");this.config=t,this.sdkConfig=e}}const jt=25,$t=1e4;var ce,de,le,W;class ti extends bt{constructor(...e){super(...e);M(this,ce,"https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");M(this,de);M(this,le);M(this,W,[]);b(this,"processQueueForced");E(this,de,new Date().getTime()),E(this,W,[]),this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(k(this,ce),{method:"OPTIONS"}).catch(Wt),this.subscribe()}subscribe(){window.addEventListener("beforeunload",this.processQueueForced,!1),window.addEventListener("pagehide",this.processQueueForced,!1),window.addEventListener("visibilitychange",this.processQueueForced,!1)}schedule(){k(this,le)&&clearTimeout(k(this,le)),E(this,le,window.setTimeout(()=>this.processQueue(),$t))}send(e){E(this,de,new Date().getTime());try{navigator.sendBeacon(k(this,ce),JSON.stringify(e))}catch{fetch(k(this,ce),{body:JSON.stringify(e),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(Wt)}this.schedule()}addToQueue(e){k(this,W).push(e),this.processQueue()}processQueue(e=!1){if(!(this.sdkConfig==null||!this.sdkConfig.ui.feature.allowTelemetry)&&!(!e&&k(this,W).length<jt&&new Date().getTime()-k(this,de)<$t))for(;k(this,W).length;){const s=k(this,W).splice(0,jt).map(a=>({...a,sessionID:this.sdkConfig.api.sessionId,userID:this.sdkConfig.api.user}));this.send(s)}}track(e,s){this.addToQueue({eventName:e,eventParams:s,eventTimestamp:new Date().getTime(),eventUUID:gt.v4()})}}ce=new WeakMap,de=new WeakMap,le=new WeakMap,W=new WeakMap;const si=A("LoggingTracker","color:#000000;font-weight:bold;");class ii extends bt{track(t,e){si(`@${this.sdkConfig.api.user}`,`[${t}]`,e)}}exports.BasicPlugin=ls;exports.CasinoPlugin=R;exports.DebuggingPlugin=hs;exports.EveryMatrixPlugin=Ms;exports.GigPlugin=gs;exports.KalambaBullseyeParsers=zs;exports.KalambaBullseyePlugin=$s;exports.KalambaStargazerPlugin=Zs;exports.KalambaStargazerTracker=ti;exports.LoggingTracker=ii;exports.OryxPlugin=ws;exports.PariplayPlugin=ys;exports.QuantaPlugin=vs;exports.RelaxFEIMPlugin=ks;exports.RgsPlugin=Zt;exports.SoftSwissPlugin=Cs;exports.TelemetryPlugin=os;exports.Tracker=bt;exports.TukoPlugin=Es;
5
+ "use strict";var Li=Object.defineProperty;var Bn=e=>{throw TypeError(e)};var Ui=(e,t,n)=>t in e?Li(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var E=(e,t,n)=>Ui(e,typeof t!="symbol"?t+"":t,n),qt=(e,t,n)=>t.has(e)||Bn("Cannot "+n);var b=(e,t,n)=>(qt(e,t,"read from private field"),n?n.call(e):t.get(e)),S=(e,t,n)=>t.has(e)?Bn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),x=(e,t,n,o)=>(qt(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),I=(e,t,n)=>(qt(e,t,"access private method"),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Re=require("./errors-BXO3dlhS.cjs"),Kt=require("./encoders-DVHzIpWT.cjs"),Mn=require("./v4-Cj9BnqmU.cjs");function J(e,t){return(n,...o)=>{console.log(`[%c${e}\x1B[m] %s`,t,n,...o)}}function Fo(e,t){return Math.round(e*100/t)}class ee{constructor(t,n){E(this,"config");E(this,"sdkConfig");this.config=t,this.sdkConfig=n}on(t,n,o){const i=function(s){s.data.message!==`kalamba:wrapper-casino:${t}`&&s.data.message!==`kalamba:wrapper:${t}`||n(s.data.payload)};window.addEventListener("message",i,o)}send(t,...[n]){window.postMessage({message:`kalamba:casino:${t}`,payload:n})}}const Di=J("BasicPlugin","color:#000000;font-weight:bold;");class Bi extends ee{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Di("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:n,payload:o}=t.data;switch(n){case"doAudioSettings":this.send("settings",{music:o==null?void 0:o.musicEnabled,sounds:o==null?void 0:o.soundEnabled});return;case"doBalanceUpdate":const{currency:i,coinValueInCents:r}=this.sdkConfig.api;o.currency===i&&typeof o.balanceInCurrency=="number"?this.send("balance",{balance:Fo(o.balanceInCurrency,r)}):(o.balanceInCoins,this.send("balance",{balance:o.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()}})}}function l(e,t,n){function o(a,c){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,c);for(const h in s.prototype)h in a||Object.defineProperty(a,h,{value:s.prototype[h].bind(a)});a._zod.constr=s,a._zod.def=c}const i=(n==null?void 0:n.Parent)??Object;class r extends i{}Object.defineProperty(r,"name",{value:e});function s(a){var c;const u=n!=null&&n.Parent?new r:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const h of u._zod.deferred)h();return u}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>{var c,u;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(u=(c=a==null?void 0:a._zod)==null?void 0:c.traits)==null?void 0:u.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}class Fe extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Lo extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Uo={};function ye(e){return Uo}function ji(e){const t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,i])=>t.indexOf(+o)===-1).map(([o,i])=>i)}function wn(e,t){return typeof t=="bigint"?t.toString():t}function Tn(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function An(e){return e==null}function Pn(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Gi(e,t){const n=(e.toString().split(".")[1]||"").length,o=t.toString();let i=(o.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(o)){const c=o.match(/\d?e-(\d?)/);c!=null&&c[1]&&(i=Number.parseInt(c[1]))}const r=n>i?n:i,s=Number.parseInt(e.toFixed(r).replace(".","")),a=Number.parseInt(t.toFixed(r).replace(".",""));return s%a/10**r}const jn=Symbol("evaluating");function A(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==jn)return o===void 0&&(o=jn,o=n()),o},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Te(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ae(...e){const t={};for(const n of e){const o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function Gn(e){return JSON.stringify(e)}const Do="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Pt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Hi=Tn(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Xe(e){if(Pt(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(Pt(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Bo(e){return Xe(e)?{...e}:Array.isArray(e)?[...e]:e}const Vi=new Set(["string","number","symbol"]);function Bt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ee(e,t,n){const o=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(o._zod.parent=e),o}function v(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Wi(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const qi={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ki(e,t){const n=e._zod.def,o=Ae(e._zod.def,{get shape(){const i={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(i[r]=n.shape[r])}return Te(this,"shape",i),i},checks:[]});return Ee(e,o)}function Xi(e,t){const n=e._zod.def,o=Ae(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&delete i[r]}return Te(this,"shape",i),i},checks:[]});return Ee(e,o)}function Ji(e,t){if(!Xe(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=Ae(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Te(this,"shape",r),r},checks:[]});return Ee(e,i)}function Yi(e,t){if(!Xe(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const o={...e._zod.def.shape,...t};return Te(this,"shape",o),o},checks:e._zod.def.checks};return Ee(e,n)}function Qi(e,t){const n=Ae(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return Te(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return Ee(e,n)}function er(e,t,n){const o=Ae(t._zod.def,{get shape(){const i=t._zod.def.shape,r={...i};if(n)for(const s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(r[s]=e?new e({type:"optional",innerType:i[s]}):i[s])}else for(const s in i)r[s]=e?new e({type:"optional",innerType:i[s]}):i[s];return Te(this,"shape",r),r},checks:[]});return Ee(t,o)}function tr(e,t,n){const o=Ae(t._zod.def,{get shape(){const i=t._zod.def.shape,r={...i};if(n)for(const s in n){if(!(s in r))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(r[s]=new e({type:"nonoptional",innerType:i[s]}))}else for(const s in i)r[s]=new e({type:"nonoptional",innerType:i[s]});return Te(this,"shape",r),r},checks:[]});return Ee(t,o)}function Ze(e,t=0){var n;if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(((n=e.issues[o])==null?void 0:n.continue)!==!0)return!0;return!1}function Ne(e,t){return t.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function kt(e){return typeof e=="string"?e:e==null?void 0:e.message}function ke(e,t,n){var i,r,s,a,c,u;const o={...e,path:e.path??[]};if(!e.message){const h=kt((s=(r=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:r.error)==null?void 0:s.call(r,e))??kt((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??kt((c=n.customError)==null?void 0:c.call(n,e))??kt((u=n.localeError)==null?void 0:u.call(n,e))??"Invalid input";o.message=h}return delete o.inst,delete o.continue,t!=null&&t.reportInput||delete o.input,o}function $n(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ht(...e){const[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}const jo=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,wn,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Go=l("$ZodError",jo),Ho=l("$ZodError",jo,{Parent:Error});function nr(e,t=n=>n.message){const n={},o=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):o.push(t(i));return{formErrors:o,fieldErrors:n}}function or(e,t=n=>n.message){const n={_errors:[]},o=i=>{for(const r of i.issues)if(r.code==="invalid_union"&&r.errors.length)r.errors.map(s=>o({issues:s}));else if(r.code==="invalid_key")o({issues:r.issues});else if(r.code==="invalid_element")o({issues:r.issues});else if(r.path.length===0)n._errors.push(t(r));else{let s=n,a=0;for(;a<r.path.length;){const c=r.path[a];a===r.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(r))):s[c]=s[c]||{_errors:[]},s=s[c],a++}}};return o(e),n}const On=e=>(t,n,o,i)=>{const r=o?Object.assign(o,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new Fe;if(s.issues.length){const a=new((i==null?void 0:i.Err)??e)(s.issues.map(c=>ke(c,r,ye())));throw Do(a,i==null?void 0:i.callee),a}return s.value},Zn=e=>async(t,n,o,i)=>{const r=o?Object.assign(o,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new((i==null?void 0:i.Err)??e)(s.issues.map(c=>ke(c,r,ye())));throw Do(a,i==null?void 0:i.callee),a}return s.value},jt=e=>(t,n,o)=>{const i=o?{...o,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},i);if(r instanceof Promise)throw new Fe;return r.issues.length?{success:!1,error:new(e??Go)(r.issues.map(s=>ke(s,i,ye())))}:{success:!0,data:r.value}},ir=jt(Ho),Gt=e=>async(t,n,o)=>{const i=o?Object.assign(o,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},i);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map(s=>ke(s,i,ye())))}:{success:!0,data:r.value}},rr=Gt(Ho),sr=e=>(t,n,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return On(e)(t,n,i)},ar=e=>(t,n,o)=>On(e)(t,n,o),cr=e=>async(t,n,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Zn(e)(t,n,i)},ur=e=>async(t,n,o)=>Zn(e)(t,n,o),dr=e=>(t,n,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return jt(e)(t,n,i)},lr=e=>(t,n,o)=>jt(e)(t,n,o),hr=e=>async(t,n,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Gt(e)(t,n,i)},pr=e=>async(t,n,o)=>Gt(e)(t,n,o),gr=/^[cC][^\s-]{8,}$/,mr=/^[0-9a-z]+$/,fr=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,br=/^[0-9a-vA-V]{20}$/,wr=/^[A-Za-z0-9]{27}$/,vr=/^[a-zA-Z0-9_-]{21}$/,yr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,kr=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Hn=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,_r=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Er="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Cr(){return new RegExp(Er,"u")}const xr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Sr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,zr=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ir=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Mr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Vo=/^[A-Za-z0-9_-]*$/,Tr=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Ar=/^\+(?:[0-9]){6,14}[0-9]$/,Wo="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Pr=new RegExp(`^${Wo}$`);function qo(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function $r(e){return new RegExp(`^${qo(e)}$`)}function Or(e){const t=qo({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${t}(?:${n.join("|")})`;return new RegExp(`^${Wo}T(?:${o})$`)}const Zr=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Nr=/^-?\d+$/,Rr=/^-?\d+(?:\.\d+)?/,Fr=/^(?:true|false)$/i,Lr=/^null$/i,Ur=/^undefined$/i,Dr=/^[^A-Z]*$/,Br=/^[^a-z]*$/,q=l("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ko={number:"number",bigint:"bigint",object:"date"},Xo=l("$ZodCheckLessThan",(e,t)=>{q.init(e,t);const n=Ko[typeof t.value];e._zod.onattach.push(o=>{const i=o._zod.bag,r=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:"too_big",maximum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Jo=l("$ZodCheckGreaterThan",(e,t)=>{q.init(e,t);const n=Ko[typeof t.value];e._zod.onattach.push(o=>{const i=o._zod.bag,r=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),jr=l("$ZodCheckMultipleOf",(e,t)=>{q.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Gi(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Gr=l("$ZodCheckNumberFormat",(e,t)=>{var s;q.init(e,t),t.format=t.format||"float64";const n=(s=t.format)==null?void 0:s.includes("int"),o=n?"int":"number",[i,r]=qi[t.format];e._zod.onattach.push(a=>{const c=a._zod.bag;c.format=t.format,c.minimum=i,c.maximum=r,n&&(c.pattern=Nr)}),e._zod.check=a=>{const c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}c<i&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),c>r&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:r,inst:e})}}),Hr=l("$ZodCheckMaxLength",(e,t)=>{var n;q.init(e,t),(n=e._zod.def).when??(n.when=o=>{const i=o.value;return!An(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{const i=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const i=o.value;if(i.length<=t.maximum)return;const s=$n(i);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Vr=l("$ZodCheckMinLength",(e,t)=>{var n;q.init(e,t),(n=e._zod.def).when??(n.when=o=>{const i=o.value;return!An(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{const i=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const i=o.value;if(i.length>=t.minimum)return;const s=$n(i);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Wr=l("$ZodCheckLengthEquals",(e,t)=>{var n;q.init(e,t),(n=e._zod.def).when??(n.when=o=>{const i=o.value;return!An(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{const i=o._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=o=>{const i=o.value,r=i.length;if(r===t.length)return;const s=$n(i),a=r>t.length;o.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Ht=l("$ZodCheckStringFormat",(e,t)=>{var n,o;q.init(e,t),e._zod.onattach.push(i=>{const r=i._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),qr=l("$ZodCheckRegex",(e,t)=>{Ht.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Kr=l("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Dr),Ht.init(e,t)}),Xr=l("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Br),Ht.init(e,t)}),Jr=l("$ZodCheckIncludes",(e,t)=>{q.init(e,t);const n=Bt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(i=>{const r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),Yr=l("$ZodCheckStartsWith",(e,t)=>{q.init(e,t);const n=new RegExp(`^${Bt(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Qr=l("$ZodCheckEndsWith",(e,t)=>{q.init(e,t);const n=new RegExp(`.*${Bt(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}}),es=l("$ZodCheckOverwrite",(e,t)=>{q.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class ts{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const o=t.split(`
6
+ `).filter(s=>s),i=Math.min(...o.map(s=>s.length-s.trimStart().length)),r=o.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(const s of r)this.content.push(s)}compile(){const t=Function,n=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(r=>` ${r}`)];return new t(...n,i.join(`
7
+ `))}}const ns={major:4,minor:1,patch:12},P=l("$ZodType",(e,t)=>{var i;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ns;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const r of o)for(const s of r._zod.onattach)s(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),(i=e._zod.deferred)==null||i.push(()=>{e._zod.run=e._zod.parse});else{const r=(a,c,u)=>{let h=Ze(a),y;for(const w of c){if(w._zod.def.when){if(!w._zod.def.when(a))continue}else if(h)continue;const C=a.issues.length,Z=w._zod.check(a);if(Z instanceof Promise&&(u==null?void 0:u.async)===!1)throw new Fe;if(y||Z instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await Z,a.issues.length!==C&&(h||(h=Ze(a,C)))});else{if(a.issues.length===C)continue;h||(h=Ze(a,C))}}return y?y.then(()=>a):a},s=(a,c,u)=>{if(Ze(a))return a.aborted=!0,a;const h=r(c,o,u);if(h instanceof Promise){if(u.async===!1)throw new Fe;return h.then(y=>e._zod.parse(y,u))}return e._zod.parse(h,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){const h=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return h instanceof Promise?h.then(y=>s(y,a,c)):s(h,a,c)}const u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new Fe;return u.then(h=>r(h,o,c))}return r(u,o,c)}}e["~standard"]={validate:r=>{var s;try{const a=ir(e,r);return a.success?{value:a.data}:{issues:(s=a.error)==null?void 0:s.issues}}catch{return rr(e,r).then(c=>{var u;return c.success?{value:c.data}:{issues:(u=c.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}}),Nn=l("$ZodString",(e,t)=>{var n;P.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??Zr(e._zod.bag),e._zod.parse=(o,i)=>{if(t.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),$=l("$ZodStringFormat",(e,t)=>{Ht.init(e,t),Nn.init(e,t)}),os=l("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=kr),$.init(e,t)}),is=l("$ZodUUID",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Hn(o))}else t.pattern??(t.pattern=Hn());$.init(e,t)}),rs=l("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=_r),$.init(e,t)}),ss=l("$ZodURL",(e,t)=>{$.init(e,t),e._zod.check=n=>{try{const o=n.value.trim(),i=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Tr.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),as=l("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Cr()),$.init(e,t)}),cs=l("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=vr),$.init(e,t)}),us=l("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=gr),$.init(e,t)}),ds=l("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=mr),$.init(e,t)}),ls=l("$ZodULID",(e,t)=>{t.pattern??(t.pattern=fr),$.init(e,t)}),hs=l("$ZodXID",(e,t)=>{t.pattern??(t.pattern=br),$.init(e,t)}),ps=l("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=wr),$.init(e,t)}),gs=l("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Or(t)),$.init(e,t)}),ms=l("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Pr),$.init(e,t)}),fs=l("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=$r(t)),$.init(e,t)}),bs=l("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=yr),$.init(e,t)}),ws=l("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=xr),$.init(e,t),e._zod.onattach.push(n=>{const o=n._zod.bag;o.format="ipv4"})}),vs=l("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Sr),$.init(e,t),e._zod.onattach.push(n=>{const o=n._zod.bag;o.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),ys=l("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=zr),$.init(e,t)}),ks=l("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ir),$.init(e,t),e._zod.check=n=>{const o=n.value.split("/");try{if(o.length!==2)throw new Error;const[i,r]=o;if(!r)throw new Error;const s=Number(r);if(`${s}`!==r)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Yo(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const _s=l("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Mr),$.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{Yo(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Es(e){if(!Vo.test(e))return!1;const t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Yo(n)}const Cs=l("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Vo),$.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{Es(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),xs=l("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ar),$.init(e,t)});function Ss(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[o]=n;if(!o)return!1;const i=JSON.parse(atob(o));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const zs=l("$ZodJWT",(e,t)=>{$.init(e,t),e._zod.check=n=>{Ss(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Qo=l("$ZodNumber",(e,t)=>{P.init(e,t),e._zod.pattern=e._zod.bag.pattern??Rr,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const r=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...r?{received:r}:{}}),n}}),Is=l("$ZodNumber",(e,t)=>{Gr.init(e,t),Qo.init(e,t)}),Ms=l("$ZodBoolean",(e,t)=>{P.init(e,t),e._zod.pattern=Fr,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),Ts=l("$ZodUndefined",(e,t)=>{P.init(e,t),e._zod.pattern=Ur,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{const i=n.value;return typeof i>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),n}}),As=l("$ZodNull",(e,t)=>{P.init(e,t),e._zod.pattern=Lr,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),n}}),Ps=l("$ZodAny",(e,t)=>{P.init(e,t),e._zod.parse=n=>n}),$s=l("$ZodUnknown",(e,t)=>{P.init(e,t),e._zod.parse=n=>n}),Os=l("$ZodNever",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Vn(e,t,n){e.issues.length&&t.issues.push(...Ne(n,e.issues)),t.value[n]=e.value}const Zs=l("$ZodArray",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const r=[];for(let s=0;s<i.length;s++){const a=i[s],c=t.element._zod.run({value:a,issues:[]},o);c instanceof Promise?r.push(c.then(u=>Vn(u,n,s))):Vn(c,n,s)}return r.length?Promise.all(r).then(()=>n):n}});function $t(e,t,n,o){e.issues.length&&t.issues.push(...Ne(n,e.issues)),e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}function ei(e){var o,i,r,s;const t=Object.keys(e.shape);for(const a of t)if(!((s=(r=(i=(o=e.shape)==null?void 0:o[a])==null?void 0:i._zod)==null?void 0:r.traits)!=null&&s.has("$ZodType")))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=Wi(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function ti(e,t,n,o,i,r){const s=[],a=i.keySet,c=i.catchall._zod,u=c.def.type;for(const h of Object.keys(t)){if(a.has(h))continue;if(u==="never"){s.push(h);continue}const y=c.run({value:t[h],issues:[]},o);y instanceof Promise?e.push(y.then(w=>$t(w,n,h,t))):$t(y,n,h,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:r}),e.length?Promise.all(e).then(()=>n):n}const Ns=l("$ZodObject",(e,t)=>{P.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const o=Tn(()=>ei(t));A(e._zod,"propValues",()=>{const a=t.shape,c={};for(const u in a){const h=a[u]._zod;if(h.values){c[u]??(c[u]=new Set);for(const y of h.values)c[u].add(y)}}return c});const i=Pt,r=t.catchall;let s;e._zod.parse=(a,c)=>{s??(s=o.value);const u=a.value;if(!i(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const h=[],y=s.shape;for(const w of s.keys){const Z=y[w]._zod.run({value:u[w],issues:[]},c);Z instanceof Promise?h.push(Z.then(L=>$t(L,a,w,u))):$t(Z,a,w,u)}return r?ti(h,u,a,c,o.value,e):h.length?Promise.all(h).then(()=>a):a}}),Rs=l("$ZodObjectJIT",(e,t)=>{Ns.init(e,t);const n=e._zod.parse,o=Tn(()=>ei(t)),i=w=>{const C=new ts(["shape","payload","ctx"]),Z=o.value,L=j=>{const U=Gn(j);return`shape[${U}]._zod.run({ value: input[${U}], issues: [] }, ctx)`};C.write("const input = payload.value;");const ae=Object.create(null);let ce=0;for(const j of Z.keys)ae[j]=`key_${ce++}`;C.write("const newResult = {};");for(const j of Z.keys){const U=ae[j],tt=Gn(j);C.write(`const ${U} = ${L(j)};`),C.write(`
8
+ if (${U}.issues.length) {
9
+ payload.issues = payload.issues.concat(${U}.issues.map(iss => ({
10
+ ...iss,
11
+ path: iss.path ? [${tt}, ...iss.path] : [${tt}]
12
+ })));
13
+ }
14
+
15
+
16
+ if (${U}.value === undefined) {
17
+ if (${tt} in input) {
18
+ newResult[${tt}] = undefined;
19
+ }
20
+ } else {
21
+ newResult[${tt}] = ${U}.value;
22
+ }
23
+
24
+ `)}C.write("payload.value = newResult;"),C.write("return payload;");const te=C.compile();return(j,U)=>te(w,j,U)};let r;const s=Pt,a=!Uo.jitless,u=a&&Hi.value,h=t.catchall;let y;e._zod.parse=(w,C)=>{y??(y=o.value);const Z=w.value;return s(Z)?a&&u&&(C==null?void 0:C.async)===!1&&C.jitless!==!0?(r||(r=i(t.shape)),w=r(w,C),h?ti([],Z,w,C,y,e):w):n(w,C):(w.issues.push({expected:"object",code:"invalid_type",input:Z,inst:e}),w)}});function Wn(e,t,n,o){for(const r of e)if(r.issues.length===0)return t.value=r.value,t;const i=e.filter(r=>!Ze(r));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(r=>r.issues.map(s=>ke(s,o,ye())))}),t)}const Fs=l("$ZodUnion",(e,t)=>{P.init(e,t),A(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),A(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),A(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),A(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${i.map(r=>Pn(r.source)).join("|")})$`)}});const n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(i,r)=>{if(n)return o(i,r);let s=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:i.value,issues:[]},r);if(u instanceof Promise)a.push(u),s=!0;else{if(u.issues.length===0)return u;a.push(u)}}return s?Promise.all(a).then(c=>Wn(c,i,e,r)):Wn(a,i,e,r)}}),Ls=l("$ZodIntersection",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{const i=n.value,r=t.left._zod.run({value:i,issues:[]},o),s=t.right._zod.run({value:i,issues:[]},o);return r instanceof Promise||s instanceof Promise?Promise.all([r,s]).then(([c,u])=>qn(n,c,u)):qn(n,r,s)}});function vn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Xe(e)&&Xe(t)){const n=Object.keys(t),o=Object.keys(e).filter(r=>n.indexOf(r)!==-1),i={...e,...t};for(const r of o){const s=vn(e[r],t[r]);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};i[r]=s.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let o=0;o<e.length;o++){const i=e[o],r=t[o],s=vn(i,r);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function qn(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ze(e))return e;const o=vn(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const Us=l("$ZodRecord",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{const i=n.value;if(!Xe(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const r=[];if(t.keyType._zod.values){const s=t.keyType._zod.values;n.value={};for(const c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){const u=t.valueType._zod.run({value:i[c],issues:[]},o);u instanceof Promise?r.push(u.then(h=>{h.issues.length&&n.issues.push(...Ne(c,h.issues)),n.value[c]=h.value})):(u.issues.length&&n.issues.push(...Ne(c,u.issues)),n.value[c]=u.value)}let a;for(const c in i)s.has(c)||(a=a??[],a.push(c));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:a})}else{n.value={};for(const s of Reflect.ownKeys(i)){if(s==="__proto__")continue;const a=t.keyType._zod.run({value:s,issues:[]},o);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(u=>ke(u,o,ye())),input:s,path:[s],inst:e}),n.value[a.value]=a.value;continue}const c=t.valueType._zod.run({value:i[s],issues:[]},o);c instanceof Promise?r.push(c.then(u=>{u.issues.length&&n.issues.push(...Ne(s,u.issues)),n.value[a.value]=u.value})):(c.issues.length&&n.issues.push(...Ne(s,c.issues)),n.value[a.value]=c.value)}}return r.length?Promise.all(r).then(()=>n):n}}),Ds=l("$ZodEnum",(e,t)=>{P.init(e,t);const n=ji(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter(i=>Vi.has(typeof i)).map(i=>typeof i=="string"?Bt(i):i.toString()).join("|")})$`),e._zod.parse=(i,r)=>{const s=i.value;return o.has(s)||i.issues.push({code:"invalid_value",values:n,input:s,inst:e}),i}}),Bs=l("$ZodTransform",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Lo(e.constructor.name);const i=t.transform(n.value,n);if(o.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(n.value=s,n));if(i instanceof Promise)throw new Fe;return n.value=i,n}});function Kn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const js=l("$ZodOptional",(e,t)=>{P.init(e,t),e._zod.optin="optional",e._zod.optout="optional",A(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),A(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Pn(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,o);return i instanceof Promise?i.then(r=>Kn(r,n.value)):Kn(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,o)}}),Gs=l("$ZodNullable",(e,t)=>{P.init(e,t),A(e._zod,"optin",()=>t.innerType._zod.optin),A(e._zod,"optout",()=>t.innerType._zod.optout),A(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Pn(n.source)}|null)$`):void 0}),A(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),Hs=l("$ZodDefault",(e,t)=>{P.init(e,t),e._zod.optin="optional",A(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,o);return i instanceof Promise?i.then(r=>Xn(r,t)):Xn(i,t)}});function Xn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Vs=l("$ZodPrefault",(e,t)=>{P.init(e,t),e._zod.optin="optional",A(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(o.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),Ws=l("$ZodNonOptional",(e,t)=>{P.init(e,t),A(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{const i=t.innerType._zod.run(n,o);return i instanceof Promise?i.then(r=>Jn(r,e)):Jn(i,e)}});function Jn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const qs=l("$ZodCatch",(e,t)=>{P.init(e,t),A(e._zod,"optin",()=>t.innerType._zod.optin),A(e._zod,"optout",()=>t.innerType._zod.optout),A(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);const i=t.innerType._zod.run(n,o);return i instanceof Promise?i.then(r=>(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(s=>ke(s,o,ye()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(r=>ke(r,o,ye()))},input:n.value}),n.issues=[]),n)}}),Ks=l("$ZodPipe",(e,t)=>{P.init(e,t),A(e._zod,"values",()=>t.in._zod.values),A(e._zod,"optin",()=>t.in._zod.optin),A(e._zod,"optout",()=>t.out._zod.optout),A(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){const r=t.out._zod.run(n,o);return r instanceof Promise?r.then(s=>_t(s,t.in,o)):_t(r,t.in,o)}const i=t.in._zod.run(n,o);return i instanceof Promise?i.then(r=>_t(r,t.out,o)):_t(i,t.out,o)}});function _t(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Xs=l("$ZodReadonly",(e,t)=>{P.init(e,t),A(e._zod,"propValues",()=>t.innerType._zod.propValues),A(e._zod,"values",()=>t.innerType._zod.values),A(e._zod,"optin",()=>t.innerType._zod.optin),A(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);const i=t.innerType._zod.run(n,o);return i instanceof Promise?i.then(Yn):Yn(i)}});function Yn(e){return e.value=Object.freeze(e.value),e}const Js=l("$ZodCustom",(e,t)=>{q.init(e,t),P.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{const o=n.value,i=t.fn(o);if(i instanceof Promise)return i.then(r=>Qn(r,n,o,e));Qn(i,n,o,e)}});function Qn(e,t,n,o){if(!e){const i={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(i.params=o._zod.def.params),t.issues.push(ht(i))}}class Ys{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const o=n[0];if(this._map.set(t,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const o={...this.get(n)??{}};delete o.id;const i={...o,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Qs(){return new Ys}const Et=Qs();function ea(e,t){return new e({type:"string",...v(t)})}function ta(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...v(t)})}function eo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...v(t)})}function na(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...v(t)})}function oa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...v(t)})}function ia(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...v(t)})}function ra(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...v(t)})}function sa(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...v(t)})}function aa(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...v(t)})}function ca(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...v(t)})}function ua(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...v(t)})}function da(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...v(t)})}function la(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...v(t)})}function ha(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...v(t)})}function pa(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...v(t)})}function ga(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...v(t)})}function ma(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...v(t)})}function fa(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...v(t)})}function ba(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...v(t)})}function wa(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...v(t)})}function va(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...v(t)})}function ya(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...v(t)})}function ka(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...v(t)})}function _a(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...v(t)})}function Ea(e,t){return new e({type:"string",format:"date",check:"string_format",...v(t)})}function Ca(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...v(t)})}function xa(e,t){return new e({type:"string",format:"duration",check:"string_format",...v(t)})}function Sa(e,t){return new e({type:"number",checks:[],...v(t)})}function za(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...v(t)})}function Ia(e,t){return new e({type:"boolean",...v(t)})}function Ma(e,t){return new e({type:"undefined",...v(t)})}function Ta(e,t){return new e({type:"null",...v(t)})}function Aa(e){return new e({type:"any"})}function Pa(e){return new e({type:"unknown"})}function $a(e,t){return new e({type:"never",...v(t)})}function to(e,t){return new Xo({check:"less_than",...v(t),value:e,inclusive:!1})}function Xt(e,t){return new Xo({check:"less_than",...v(t),value:e,inclusive:!0})}function no(e,t){return new Jo({check:"greater_than",...v(t),value:e,inclusive:!1})}function Jt(e,t){return new Jo({check:"greater_than",...v(t),value:e,inclusive:!0})}function oo(e,t){return new jr({check:"multiple_of",...v(t),value:e})}function ni(e,t){return new Hr({check:"max_length",...v(t),maximum:e})}function Ot(e,t){return new Vr({check:"min_length",...v(t),minimum:e})}function oi(e,t){return new Wr({check:"length_equals",...v(t),length:e})}function Oa(e,t){return new qr({check:"string_format",format:"regex",...v(t),pattern:e})}function Za(e){return new Kr({check:"string_format",format:"lowercase",...v(e)})}function Na(e){return new Xr({check:"string_format",format:"uppercase",...v(e)})}function Ra(e,t){return new Jr({check:"string_format",format:"includes",...v(t),includes:e})}function Fa(e,t){return new Yr({check:"string_format",format:"starts_with",...v(t),prefix:e})}function La(e,t){return new Qr({check:"string_format",format:"ends_with",...v(t),suffix:e})}function vt(e){return new es({check:"overwrite",tx:e})}function Ua(e){return vt(t=>t.normalize(e))}function Da(){return vt(e=>e.trim())}function Ba(){return vt(e=>e.toLowerCase())}function ja(){return vt(e=>e.toUpperCase())}function Ga(e,t,n){return new e({type:"array",element:t,...v(n)})}function Ha(e,t,n){return new e({type:"custom",check:"custom",fn:t,...v(n)})}function Va(e){const t=Wa(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(ht(o,n.value,t._zod.def));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(ht(i))}},e(n.value,n)));return t}function Wa(e,t){const n=new q({check:"custom",...v(t)});return n._zod.check=e,n}const qa=l("ZodISODateTime",(e,t)=>{gs.init(e,t),N.init(e,t)});function Ka(e){return _a(qa,e)}const Xa=l("ZodISODate",(e,t)=>{ms.init(e,t),N.init(e,t)});function Ja(e){return Ea(Xa,e)}const Ya=l("ZodISOTime",(e,t)=>{fs.init(e,t),N.init(e,t)});function Qa(e){return Ca(Ya,e)}const ec=l("ZodISODuration",(e,t)=>{bs.init(e,t),N.init(e,t)});function tc(e){return xa(ec,e)}const nc=(e,t)=>{Go.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>or(e,n)},flatten:{value:n=>nr(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,wn,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,wn,2)}},isEmpty:{get(){return e.issues.length===0}}})},Y=l("ZodError",nc,{Parent:Error}),oc=On(Y),ic=Zn(Y),rc=jt(Y),sc=Gt(Y),ac=sr(Y),cc=ar(Y),uc=cr(Y),dc=ur(Y),lc=dr(Y),hc=lr(Y),pc=hr(Y),gc=pr(Y),O=l("ZodType",(e,t)=>(P.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ae(t,{checks:[...t.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]})),e.clone=(n,o)=>Ee(e,n,o),e.brand=()=>e,e.register=(n,o)=>(n.add(e,o),e),e.parse=(n,o)=>oc(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>rc(e,n,o),e.parseAsync=async(n,o)=>ic(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>sc(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>ac(e,n,o),e.decode=(n,o)=>cc(e,n,o),e.encodeAsync=async(n,o)=>uc(e,n,o),e.decodeAsync=async(n,o)=>dc(e,n,o),e.safeEncode=(n,o)=>lc(e,n,o),e.safeDecode=(n,o)=>hc(e,n,o),e.safeEncodeAsync=async(n,o)=>pc(e,n,o),e.safeDecodeAsync=async(n,o)=>gc(e,n,o),e.refine=(n,o)=>e.check(du(n,o)),e.superRefine=n=>e.check(lu(n)),e.overwrite=n=>e.check(vt(n)),e.optional=()=>ao(e),e.nullable=()=>co(e),e.nullish=()=>ao(co(e)),e.nonoptional=n=>ou(e,n),e.array=()=>de(e),e.or=n=>Rn([e,n]),e.and=n=>Wc(e,n),e.transform=n=>uo(e,Jc(n)),e.default=n=>eu(e,n),e.prefault=n=>nu(e,n),e.catch=n=>ru(e,n),e.pipe=n=>uo(e,n),e.readonly=()=>cu(e),e.describe=n=>{const o=e.clone();return Et.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){var n;return(n=Et.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Et.get(e);const o=e.clone();return Et.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),ii=l("_ZodString",(e,t)=>{Nn.init(e,t),O.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(Oa(...o)),e.includes=(...o)=>e.check(Ra(...o)),e.startsWith=(...o)=>e.check(Fa(...o)),e.endsWith=(...o)=>e.check(La(...o)),e.min=(...o)=>e.check(Ot(...o)),e.max=(...o)=>e.check(ni(...o)),e.length=(...o)=>e.check(oi(...o)),e.nonempty=(...o)=>e.check(Ot(1,...o)),e.lowercase=o=>e.check(Za(o)),e.uppercase=o=>e.check(Na(o)),e.trim=()=>e.check(Da()),e.normalize=(...o)=>e.check(Ua(...o)),e.toLowerCase=()=>e.check(Ba()),e.toUpperCase=()=>e.check(ja())}),mc=l("ZodString",(e,t)=>{Nn.init(e,t),ii.init(e,t),e.email=n=>e.check(ta(fc,n)),e.url=n=>e.check(sa(bc,n)),e.jwt=n=>e.check(ka(Pc,n)),e.emoji=n=>e.check(aa(wc,n)),e.guid=n=>e.check(eo(io,n)),e.uuid=n=>e.check(na(Ct,n)),e.uuidv4=n=>e.check(oa(Ct,n)),e.uuidv6=n=>e.check(ia(Ct,n)),e.uuidv7=n=>e.check(ra(Ct,n)),e.nanoid=n=>e.check(ca(vc,n)),e.guid=n=>e.check(eo(io,n)),e.cuid=n=>e.check(ua(yc,n)),e.cuid2=n=>e.check(da(kc,n)),e.ulid=n=>e.check(la(_c,n)),e.base64=n=>e.check(wa(Mc,n)),e.base64url=n=>e.check(va(Tc,n)),e.xid=n=>e.check(ha(Ec,n)),e.ksuid=n=>e.check(pa(Cc,n)),e.ipv4=n=>e.check(ga(xc,n)),e.ipv6=n=>e.check(ma(Sc,n)),e.cidrv4=n=>e.check(fa(zc,n)),e.cidrv6=n=>e.check(ba(Ic,n)),e.e164=n=>e.check(ya(Ac,n)),e.datetime=n=>e.check(Ka(n)),e.date=n=>e.check(Ja(n)),e.time=n=>e.check(Qa(n)),e.duration=n=>e.check(tc(n))});function F(e){return ea(mc,e)}const N=l("ZodStringFormat",(e,t)=>{$.init(e,t),ii.init(e,t)}),fc=l("ZodEmail",(e,t)=>{rs.init(e,t),N.init(e,t)}),io=l("ZodGUID",(e,t)=>{os.init(e,t),N.init(e,t)}),Ct=l("ZodUUID",(e,t)=>{is.init(e,t),N.init(e,t)}),bc=l("ZodURL",(e,t)=>{ss.init(e,t),N.init(e,t)}),wc=l("ZodEmoji",(e,t)=>{as.init(e,t),N.init(e,t)}),vc=l("ZodNanoID",(e,t)=>{cs.init(e,t),N.init(e,t)}),yc=l("ZodCUID",(e,t)=>{us.init(e,t),N.init(e,t)}),kc=l("ZodCUID2",(e,t)=>{ds.init(e,t),N.init(e,t)}),_c=l("ZodULID",(e,t)=>{ls.init(e,t),N.init(e,t)}),Ec=l("ZodXID",(e,t)=>{hs.init(e,t),N.init(e,t)}),Cc=l("ZodKSUID",(e,t)=>{ps.init(e,t),N.init(e,t)}),xc=l("ZodIPv4",(e,t)=>{ws.init(e,t),N.init(e,t)}),Sc=l("ZodIPv6",(e,t)=>{vs.init(e,t),N.init(e,t)}),zc=l("ZodCIDRv4",(e,t)=>{ys.init(e,t),N.init(e,t)}),Ic=l("ZodCIDRv6",(e,t)=>{ks.init(e,t),N.init(e,t)}),Mc=l("ZodBase64",(e,t)=>{_s.init(e,t),N.init(e,t)}),Tc=l("ZodBase64URL",(e,t)=>{Cs.init(e,t),N.init(e,t)}),Ac=l("ZodE164",(e,t)=>{xs.init(e,t),N.init(e,t)}),Pc=l("ZodJWT",(e,t)=>{zs.init(e,t),N.init(e,t)}),ri=l("ZodNumber",(e,t)=>{Qo.init(e,t),O.init(e,t),e.gt=(o,i)=>e.check(no(o,i)),e.gte=(o,i)=>e.check(Jt(o,i)),e.min=(o,i)=>e.check(Jt(o,i)),e.lt=(o,i)=>e.check(to(o,i)),e.lte=(o,i)=>e.check(Xt(o,i)),e.max=(o,i)=>e.check(Xt(o,i)),e.int=o=>e.check(ro(o)),e.safe=o=>e.check(ro(o)),e.positive=o=>e.check(no(0,o)),e.nonnegative=o=>e.check(Jt(0,o)),e.negative=o=>e.check(to(0,o)),e.nonpositive=o=>e.check(Xt(0,o)),e.multipleOf=(o,i)=>e.check(oo(o,i)),e.step=(o,i)=>e.check(oo(o,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function T(e){return Sa(ri,e)}const $c=l("ZodNumberFormat",(e,t)=>{Is.init(e,t),ri.init(e,t)});function ro(e){return za($c,e)}const Oc=l("ZodBoolean",(e,t)=>{Ms.init(e,t),O.init(e,t)});function re(e){return Ia(Oc,e)}const Zc=l("ZodUndefined",(e,t)=>{Ts.init(e,t),O.init(e,t)});function Nc(e){return Ma(Zc,e)}const Rc=l("ZodNull",(e,t)=>{As.init(e,t),O.init(e,t)});function Fc(e){return Ta(Rc,e)}const Lc=l("ZodAny",(e,t)=>{Ps.init(e,t),O.init(e,t)});function so(){return Aa(Lc)}const Uc=l("ZodUnknown",(e,t)=>{$s.init(e,t),O.init(e,t)});function _e(){return Pa(Uc)}const Dc=l("ZodNever",(e,t)=>{Os.init(e,t),O.init(e,t)});function Bc(e){return $a(Dc,e)}const jc=l("ZodArray",(e,t)=>{Zs.init(e,t),O.init(e,t),e.element=t.element,e.min=(n,o)=>e.check(Ot(n,o)),e.nonempty=n=>e.check(Ot(1,n)),e.max=(n,o)=>e.check(ni(n,o)),e.length=(n,o)=>e.check(oi(n,o)),e.unwrap=()=>e.element});function de(e,t){return Ga(jc,e,t)}const Gc=l("ZodObject",(e,t)=>{Rs.init(e,t),O.init(e,t),A(e,"shape",()=>t.shape),e.keyof=()=>yt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:_e()}),e.loose=()=>e.clone({...e._zod.def,catchall:_e()}),e.strict=()=>e.clone({...e._zod.def,catchall:Bc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Ji(e,n),e.safeExtend=n=>Yi(e,n),e.merge=n=>Qi(e,n),e.pick=n=>Ki(e,n),e.omit=n=>Xi(e,n),e.partial=(...n)=>er(si,e,n[0]),e.required=(...n)=>tr(ai,e,n[0])});function z(e,t){const n={type:"object",shape:e??{},...v(t)};return new Gc(n)}const Hc=l("ZodUnion",(e,t)=>{Fs.init(e,t),O.init(e,t),e.options=t.options});function Rn(e,t){return new Hc({type:"union",options:e,...v(t)})}const Vc=l("ZodIntersection",(e,t)=>{Ls.init(e,t),O.init(e,t)});function Wc(e,t){return new Vc({type:"intersection",left:e,right:t})}const qc=l("ZodRecord",(e,t)=>{Us.init(e,t),O.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Kc(e,t,n){return new qc({type:"record",keyType:e,valueType:t,...v(n)})}const yn=l("ZodEnum",(e,t)=>{Ds.init(e,t),O.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(o,i)=>{const r={};for(const s of o)if(n.has(s))r[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new yn({...t,checks:[],...v(i),entries:r})},e.exclude=(o,i)=>{const r={...t.entries};for(const s of o)if(n.has(s))delete r[s];else throw new Error(`Key ${s} not found in enum`);return new yn({...t,checks:[],...v(i),entries:r})}});function yt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new yn({type:"enum",entries:n,...v(t)})}const Xc=l("ZodTransform",(e,t)=>{Bs.init(e,t),O.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Lo(e.constructor.name);n.addIssue=r=>{if(typeof r=="string")n.issues.push(ht(r,n.value,t));else{const s=r;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(ht(s))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(r=>(n.value=r,n)):(n.value=i,n)}});function Jc(e){return new Xc({type:"transform",transform:e})}const si=l("ZodOptional",(e,t)=>{js.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ao(e){return new si({type:"optional",innerType:e})}const Yc=l("ZodNullable",(e,t)=>{Gs.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function co(e){return new Yc({type:"nullable",innerType:e})}const Qc=l("ZodDefault",(e,t)=>{Hs.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function eu(e,t){return new Qc({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Bo(t)}})}const tu=l("ZodPrefault",(e,t)=>{Vs.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function nu(e,t){return new tu({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Bo(t)}})}const ai=l("ZodNonOptional",(e,t)=>{Ws.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ou(e,t){return new ai({type:"nonoptional",innerType:e,...v(t)})}const iu=l("ZodCatch",(e,t)=>{qs.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ru(e,t){return new iu({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const su=l("ZodPipe",(e,t)=>{Ks.init(e,t),O.init(e,t),e.in=t.in,e.out=t.out});function uo(e,t){return new su({type:"pipe",in:e,out:t})}const au=l("ZodReadonly",(e,t)=>{Xs.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function cu(e){return new au({type:"readonly",innerType:e})}const uu=l("ZodCustom",(e,t)=>{Js.init(e,t),O.init(e,t)});function du(e,t={}){return Ha(uu,e,t)}function lu(e){return Va(e)}const nt=Rn([Nc(),Fc()]),Me=z({base:T(),multiplier:T()}),hu=z({fastPlay:re().optional(),sounds:re().optional(),music:re().optional()}).refine(e=>Object.values(e).some(t=>t!==void 0),{message:"Object must have at least one property defined"}),pu=z({source:yt(["realityCheck","settings","casino"])}),gu=z({type:yt(["ON_DEMAND","BALANCE_LOW","BALANCE_INSUFFICIENT"])}),mu=z({balance:T()}),fu=z({action:yt(["start","stop","pause","resume"])}),bu=z({progress:T().min(0).max(100)}),wu=z({lock:F().optional()}),ci=z({conf:z({base:T(),multiplier:T(),numAwarded:T()}),data:z({numPlayed:T(),win:T(),numLeft:T()}),id:F(),rejectable:re(),skippable:re(),status:yt(["PENDING","ACTIVE","FINISHED"]),type:F()}),vu=z({contract:z({bet:z({available:Kc(Rn([F(),T()]),de(T())),default:Me,max:T().nullable(),last:Me.nullable(),lastPaid:Me.nullable()}),balance:z({coins:T(),version:T()}),freeRounds:de(ci),gameModel:F(),metaData:z({rtpValues:de(z({key:F(),rtpValue:F()})),maxWin:de(z({key:F(),maxWinValueXBet:T(),maxWinOdds:T()})),version:F()}),roundId:F().optional(),serverTime:T(),sessionId:F(),stateType:z({thisRound:F(),nextRound:F()}),uiMessages:de(_e()),win:z({max:T().nullable(),round:T(),total:T()})}),data:_e()}),Yt=z({contract:z({bet:z({last:Me.nullable(),lastPaid:Me}),balance:z({coins:T(),version:T()}),freeRounds:de(ci),roundId:F(),serverTime:T(),stateType:z({thisRound:F(),nextRound:F()}),uiMessages:de(_e()),win:z({round:T(),total:T()})}),data:_e()}),kn=z({bet:Me.nullable(),forcedOutcomes:_e().optional()}).passthrough(),yu=z({contract:kn,extra:_e().optional()}),ku=z({dataDecoder:so().optional(),dataEncoder:so().optional(),gameName:F().optional(),gameVersion:F().optional(),gameHistoryUrl:F().optional(),showFreeRounds:re().optional(),showPromoPanel:re().optional(),showRealityCheck:re().optional(),showErrors:re().optional(),showBars:re().optional(),skipErrors:de(F()).optional()}).passthrough(),_u={configure:ku,openGame:nt,loadStart:nt,loadEnd:nt,playReady:nt,bet:Me,play:yu,playCycleStart:kn,playCycleEnd:Yt,playStart:kn,playEnd:Yt,history:pu,close:nt,cashier:gu,fullscreen:wu,autoplay:fu,loadProgress:bu,settings:hu,balance:mu,openGameResponse:vu,playResponse:Yt};function Eu(e){return _u[e]}function Cu(e){return e.issues.map(t=>`[${t.path.length>0?t.path.join("."):"root"}] ${t.message}`).join(`
25
+ `)}var me,B,G,De,D,Be,K,fe,ue,gt,ze,Ie,k,ui,di,li,hi,pi,gi,mi,fi,bi,wi,vi,yi,_n,En,ki,_i,Tt,Ei,Ci,xi,Cn,Si;class xu{constructor(t,n){S(this,k);S(this,me);S(this,B);S(this,G);S(this,De);S(this,D);S(this,Be);S(this,K);S(this,fe);S(this,ue,[]);S(this,gt,new Map);S(this,ze,!1);S(this,Ie,{x:0,y:0});x(this,D,t),x(this,Be,n),I(this,k,ui).call(this),x(this,me,I(this,k,di).call(this)),x(this,K,I(this,k,li).call(this)),x(this,fe,I(this,k,hi).call(this)),x(this,De,I(this,k,pi).call(this)),x(this,B,I(this,k,gi).call(this)),I(this,k,bi).call(this),I(this,k,wi).call(this)}registerEvent(t){b(this,Be).call(this,t,n=>{const o=I(this,k,_n).call(this,t,n);I(this,k,En).call(this,t,n,o)})}}me=new WeakMap,B=new WeakMap,G=new WeakMap,De=new WeakMap,D=new WeakMap,Be=new WeakMap,K=new WeakMap,fe=new WeakMap,ue=new WeakMap,gt=new WeakMap,ze=new WeakMap,Ie=new WeakMap,k=new WeakSet,ui=function(){const t="dbg-plugin-styles";if(!document.getElementById(t)){const n=document.createElement("style");n.id=t,n.textContent=`
26
+ .dbg-toggle {
27
+ position: fixed; top: 3px; left: 50%; transform: translateX(-50%); z-index: 10000;
28
+ background: #111827; color: #fff; border: 1px solid #1f2937;
29
+ border-radius: 6px; padding: 4px 10px; font-size: 11px; cursor: pointer;
30
+ box-shadow: 0 2px 8px rgba(0,0,0,.15);
31
+ transition: background .15s ease, box-shadow .15s ease, transform .1s ease;
32
+ }
33
+ .dbg-toggle:hover { background: #0b1220; box-shadow: 0 4px 12px rgba(0,0,0,.2); transform: translate(-50%, -1px); }
34
+
35
+ .dbg-popup {
36
+ position: absolute; top: 10px; left: 10px; z-index: 9999;
37
+ background: #ffffff; border: 1px solid #E5E7EB; border-radius: 10px;
38
+ box-shadow: 0 10px 30px rgba(0,0,0,.12);
39
+ display: flex; flex-direction: column;
40
+ width: min(800px, 95vw); height: min(650px, 95vh);
41
+ min-width: min(400px, 95vw); min-height: min(400px, 95vh);
42
+ max-width: 95vw; max-height: 95vh;
43
+ overflow: hidden; resize: both;
44
+ container-type: inline-size;
45
+ }
46
+ .dbg-drag-handle {
47
+ background: #F9FAFB; border-bottom: 1px solid #E5E7EB;
48
+ padding: 8px 16px; cursor: move; user-select: none;
49
+ -webkit-user-select: none; touch-action: none;
50
+ border-radius: 10px 10px 0 0;
51
+ display: flex; align-items: center; justify-content: space-between;
52
+ color: #6B7280; font-size: 11px; font-weight: 600;
53
+ letter-spacing: 0.05em; text-transform: uppercase;
54
+ }
55
+ .dbg-drag-handle:hover { background: #F3F4F6; }
56
+ .dbg-drag-handle.dragging { cursor: grabbing; background: #E5E7EB; }
57
+ .dbg-drag-title { display: flex; align-items: center; gap: 8px; }
58
+ .dbg-popup-content {
59
+ display: flex; flex-direction: row; gap: 16px; padding: 16px;
60
+ flex: 1; overflow-y: auto; overflow-x: hidden;
61
+ }
62
+ @container (max-width: 700px) {
63
+ .dbg-popup-content {
64
+ flex-direction: column;
65
+ }
66
+ .dbg-sections {
67
+ max-width: 100% !important;
68
+ min-width: 100%;
69
+ }
70
+ .dbg-logs-panel {
71
+ max-width: 100% !important;
72
+ min-width: 100%;
73
+ }
74
+ .dbg-event-checks {
75
+ min-height: 100px;
76
+ }
77
+ }
78
+ .dbg-close {
79
+ width: 24px; height: 24px; flex-shrink: 0;
80
+ background: transparent; border: 1px solid transparent; border-radius: 4px; cursor: pointer;
81
+ color: #6B7280; font-size: 14px; font-weight: 600; line-height: 1;
82
+ display: flex; align-items: center; justify-content: center;
83
+ transition: background .15s ease, border-color .15s ease, color .15s ease;
84
+ }
85
+ .dbg-close:hover { background: #E5E7EB; border-color: #D1D5DB; color: #374151; }
86
+
87
+ .dbg-sections {
88
+ display: flex; flex-direction: column; gap: 12px; flex-shrink: 0;
89
+ min-width: 260px; max-width: 260px;
90
+ }
91
+ .dbg-logs-panel {
92
+ display: flex; flex-direction: column; gap: 8px;
93
+ min-width: 350px; max-width: 550px; flex: 1;
94
+ min-height: 0;
95
+ }
96
+ .dbg-logs-header { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
97
+ .dbg-logs-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #6B7280; }
98
+ .dbg-logs-actions { display: flex; gap: 6px; }
99
+ .dbg-filter-container { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
100
+ .dbg-filter-input {
101
+ flex: 1; padding: 6px 8px; font-size: 12px; border: 1px solid #E5E7EB;
102
+ border-radius: 4px; background: #F9FAFB; color: #111827;
103
+ transition: border-color .15s ease, background .15s ease;
104
+ }
105
+ .dbg-filter-input:focus { outline: none; border-color: #93C5FD; background: #ffffff; }
106
+ .dbg-filter-input::placeholder { color: #9CA3AF; }
107
+ .dbg-logs-btn {
108
+ padding: 4px 8px; font-size: 11px; background: #F3F4F6; border: 1px solid #E5E7EB;
109
+ border-radius: 4px; cursor: pointer; color: #374151; transition: background .15s ease;
110
+ }
111
+ .dbg-logs-btn:hover { background: #E5E7EB; }
112
+ .dbg-logs-container {
113
+ width: 100%; height: 200px; min-height: 60px; resize: vertical;
114
+ font-family: 'Monaco', 'Menlo', monospace;
115
+ font-size: 11px; line-height: 1.4; padding: 8px; border: 1px solid #E5E7EB;
116
+ border-radius: 6px; background: #F9FAFB; color: #111827; overflow-y: auto;
117
+ text-align: left;
118
+ }
119
+ .dbg-logs-container:focus-within { outline: 2px solid #93C5FD; outline-offset: -1px; }
120
+ .dbg-log-header {
121
+ display: flex; align-items: center; gap: 6px; cursor: pointer;
122
+ user-select: none; color: #111827;
123
+ }
124
+ .dbg-log-header:hover { color: #3B82F6; }
125
+ .dbg-log-toggle {
126
+ display: inline-block; width: 14px; text-align: center;
127
+ font-weight: bold; color: #6B7280; flex-shrink: 0; font-size: 13px;
128
+ }
129
+ .dbg-log-timestamp { color: #6B7280; }
130
+ .dbg-log-name { font-weight: 600; }
131
+ .dbg-log-payload {
132
+ margin-top: 4px; padding-left: 0; color: #374151;
133
+ white-space: pre; word-wrap: break-word; text-align: left;
134
+ }
135
+ .dbg-log-payload.collapsed { display: none; }
136
+ .dbg-log-entry.validation-error {
137
+ border-left: 3px solid #d32f2f; background: #fdecea;
138
+ padding-left: 8px; margin-left: -8px;
139
+ }
140
+ .dbg-log-error-message {
141
+ font-family: 'Monaco', 'Menlo', monospace;
142
+ color: #c62828; white-space: pre-wrap; margin-top: 4px;
143
+ font-size: 10px; padding: 4px 0;
144
+ }
145
+ .dbg-section { min-height: 100px; }
146
+ .dbg-section.event-checks-section {
147
+ display: flex; flex-direction: column;
148
+ flex: 1; min-height: 100px;
149
+ }
150
+ .dbg-section-title {
151
+ font-size: 12px; font-weight: 700; text-transform: uppercase;
152
+ letter-spacing: .06em; color: #6B7280; margin: 0 0 8px 0;
153
+ text-align: left;
154
+ }
155
+ .dbg-buttons {
156
+ display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px;
157
+ }
158
+ .dbg-button {
159
+ appearance: none; padding: 6px 10px; font-size: 12px; line-height: 1.1;
160
+ border-radius: 6px; border: 1px solid transparent; cursor: pointer;
161
+ transition: background .15s ease, transform .1s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease;
162
+ box-shadow: 0 1px 0 rgba(0,0,0,.02);
163
+ }
164
+ .dbg-button:hover { transform: translateY(-1px); }
165
+
166
+ /* Color variants: primary (blue), success (green), warning (yellow), danger (red), neutral (gray) */
167
+ .dbg-button.is-primary { background: #DBEAFE; border-color: #93C5FD; color: #1D4ED8; }
168
+ .dbg-button.is-primary:hover { background: #BFDBFE; }
169
+
170
+ .dbg-button.is-success { background: #DCFCE7; border-color: #86EFAC; color: #166534; }
171
+ .dbg-button.is-success:hover { background: #BBF7D0; }
172
+
173
+ .dbg-button.is-warning { background: #FEF3C7; border-color: #FDE68A; color: #92400E; }
174
+ .dbg-button.is-warning:hover { background: #FDE68A; }
175
+
176
+ .dbg-button.is-danger { background: #FEE2E2; border-color: #FCA5A5; color: #991B1B; }
177
+ .dbg-button.is-danger:hover { background: #FCA5A5; }
178
+
179
+ .dbg-button.is-neutral { background: #F3F4F6; border-color: #E5E7EB; color: #111827; }
180
+ .dbg-button.is-neutral:hover { background: #E5E7EB; }
181
+
182
+ .dbg-separator { height: 1px; background: #E5E7EB; margin: 10px 0 4px; border: 0; }
183
+ .dbg-event-checks {
184
+ display: flex; flex-direction: column; gap: 10px;
185
+ flex: 1; overflow-y: auto;
186
+ padding-right: 4px;
187
+ min-height: 100px;
188
+ }
189
+ .dbg-event-group { display: flex; flex-direction: column; gap: 4px; }
190
+ .dbg-event-group-title {
191
+ font-size: 10px; font-weight: 600; text-transform: uppercase;
192
+ letter-spacing: 0.05em; display: flex; align-items: center; gap: 6px;
193
+ margin: 1em 0;
194
+ }
195
+ .dbg-event-group-title .dbg-event-indicator {
196
+ width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
197
+ }
198
+ .dbg-event-group-title.required { color: #991B1B; }
199
+ .dbg-event-group-title.required .dbg-event-indicator { background: #DC2626; }
200
+ .dbg-event-group-title.nice-to-have { color: #92400E; }
201
+ .dbg-event-group-title.nice-to-have .dbg-event-indicator { background: #F59E0B; }
202
+ .dbg-event-group-title.optional { color: #6B7280; }
203
+ .dbg-event-group-title.optional .dbg-event-indicator { background: #9CA3AF; }
204
+ .dbg-event-group-items {
205
+ display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
206
+ }
207
+ .dbg-event-checks::-webkit-scrollbar { width: 6px; }
208
+ .dbg-event-checks::-webkit-scrollbar-track { background: #F3F4F6; border-radius: 3px; }
209
+ .dbg-event-checks::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }
210
+ .dbg-event-checks::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }
211
+ .dbg-event-item {
212
+ display: flex; align-items: center; gap: 5px; padding: 4px 6px;
213
+ border-radius: 4px; font-size: 10px; font-family: 'Monaco', 'Menlo', monospace;
214
+ transition: background .15s ease, color .15s ease;
215
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
216
+ cursor: default;
217
+ }
218
+ .dbg-event-item .dbg-event-indicator {
219
+ width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
220
+ transition: background .2s ease;
221
+ }
222
+ /* Required - red when pending, green when received */
223
+ .dbg-event-item.required.pending { color: #991B1B; }
224
+ .dbg-event-item.required.pending .dbg-event-indicator { background: #DC2626; }
225
+ .dbg-event-item.required.received { color: #166534; }
226
+ .dbg-event-item.required.received .dbg-event-indicator { background: #16A34A; }
227
+ /* Nice to have - yellow when pending, green when received */
228
+ .dbg-event-item.nice-to-have.pending { color: #92400E; }
229
+ .dbg-event-item.nice-to-have.pending .dbg-event-indicator { background: #F59E0B; }
230
+ .dbg-event-item.nice-to-have.received { color: #166534; }
231
+ .dbg-event-item.nice-to-have.received .dbg-event-indicator { background: #16A34A; }
232
+ /* Optional - gray when pending, green when received */
233
+ .dbg-event-item.optional.pending { color: #6B7280; }
234
+ .dbg-event-item.optional.pending .dbg-event-indicator { background: #9CA3AF; }
235
+ .dbg-event-item.optional.received { color: #166534; }
236
+ .dbg-event-item.optional.received .dbg-event-indicator { background: #16A34A; }
237
+ `,document.head.appendChild(n)}},di=function(){const t=document.createElement("button");return t.textContent="DEBUG",t.className="dbg-toggle",t},li=function(){const t=document.createElement("div");return t.className="dbg-logs-container",t},hi=function(){const t=document.createElement("input");return t.type="text",t.className="dbg-filter-input",t.placeholder="Filter by event name...",t},pi=function(){const t=document.createElement("button");return t.innerHTML="×",t.className="dbg-close",t.title="Close debug panel",t},gi=function(){const t=document.createElement("div");t.className="dbg-popup",t.style.display="none",x(this,G,document.createElement("div")),b(this,G).className="dbg-drag-handle";const n=document.createElement("div");n.className="dbg-drag-title",n.innerHTML="<span>⋮⋮</span> <span>Debug Panel</span>",b(this,G).appendChild(n),b(this,G).appendChild(b(this,De)),t.appendChild(b(this,G));const o=document.createElement("div");o.className="dbg-popup-content",t.appendChild(o);const i=document.createElement("div");i.className="dbg-sections",o.appendChild(i);const r=[{title:"Game",items:[{text:"Freeze",action:()=>b(this,D).call(this,"freeze"),variant:"neutral"},{text:"Unfreeze",action:()=>b(this,D).call(this,"unfreeze"),variant:"neutral"},{text:"Suspend",action:()=>b(this,D).call(this,"suspend"),variant:"neutral"},{text:"Resume",action:()=>b(this,D).call(this,"resume"),variant:"neutral"}]},{title:"Help",items:[{text:"Show Help",action:()=>b(this,D).call(this,"help",{show:!0}),variant:"success"},{text:"Hide Help",action:()=>b(this,D).call(this,"help",{show:!1}),variant:"danger"},{text:"Toggle Help",action:()=>b(this,D).call(this,"help"),variant:"primary"}]},{title:"Paytable (Optional)",items:[{text:"Show Paytable",action:()=>b(this,D).call(this,"paytable",{show:!0}),variant:"success"},{text:"Hide Paytable",action:()=>b(this,D).call(this,"paytable",{show:!1}),variant:"danger"},{text:"Toggle Paytable",action:()=>b(this,D).call(this,"paytable"),variant:"primary"}]},{title:"Audio Settings",items:[{text:"Enable Sounds",action:()=>b(this,D).call(this,"settings",{sounds:!0}),variant:"success"},{text:"Disable Sounds",action:()=>b(this,D).call(this,"settings",{sounds:!1}),variant:"danger"},{text:"Enable Music",action:()=>b(this,D).call(this,"settings",{music:!0}),variant:"success"},{text:"Disable Music",action:()=>b(this,D).call(this,"settings",{music:!1}),variant:"danger"}]}];I(this,k,mi).call(this,r,i);const s=document.createElement("div");s.className="dbg-logs-panel";const a=document.createElement("div");a.className="dbg-logs-header";const c=document.createElement("div");c.className="dbg-logs-title",c.textContent="Event Logs",a.appendChild(c);const u=document.createElement("div");u.className="dbg-logs-actions";const h=document.createElement("button");h.textContent="Clear",h.className="dbg-button is-warning",h.addEventListener("click",()=>I(this,k,ki).call(this)),u.appendChild(h);const y=document.createElement("button");y.textContent="Copy",y.className="dbg-logs-btn",y.addEventListener("click",()=>I(this,k,Ei).call(this)),u.appendChild(y),a.appendChild(u),s.appendChild(a);const w=document.createElement("div");return w.className="dbg-filter-container",w.appendChild(b(this,fe)),s.appendChild(w),s.appendChild(b(this,K)),I(this,k,fi).call(this,s),o.appendChild(s),t},mi=function(t,n){t.forEach(o=>{const i=document.createElement("div");i.className="dbg-section";const r=document.createElement("div");r.className="dbg-section-title",r.textContent=o.title,i.appendChild(r);const s=document.createElement("div");s.className="dbg-buttons",o.items.forEach(({text:c,action:u,variant:h})=>{const y=document.createElement("button");y.textContent=c,y.className=`dbg-button is-${h}`,y.addEventListener("click",u),s.appendChild(y)}),i.appendChild(s),n.appendChild(i);const a=document.createElement("div");a.className="dbg-separator",n.appendChild(a)})},fi=function(t){const n=document.createElement("div");n.className="dbg-section event-checks-section";const o=document.createElement("div");o.className="dbg-section-title",o.textContent="Event Checks",n.appendChild(o);const i=document.createElement("div");i.className="dbg-event-checks",[{type:"required",title:"Required",events:["configure","openGame","loadStart","loadEnd","playReady","bet","play","playCycleStart","playStart","playEnd","playCycleEnd","history","close"]},{type:"nice-to-have",title:"Nice to have",events:["cashier","fullscreen","autoplay"]},{type:"optional",title:"Optional",events:["loadProgress","settings","balance"]}].forEach(({type:s,title:a,events:c})=>{if(c.length===0)return;const u=document.createElement("div");u.className="dbg-event-group";const h=document.createElement("div");h.className=`dbg-event-group-title ${s}`,h.innerHTML=`
238
+ <span class="dbg-event-indicator"></span>
239
+ <span>${a}</span>
240
+ `,u.appendChild(h);const y=document.createElement("div");y.className="dbg-event-group-items",c.forEach(w=>{const C=document.createElement("div");C.className=`dbg-event-item ${s} pending`,C.title=w,C.innerHTML=`
241
+ <span class="dbg-event-indicator"></span>
242
+ <span>${w}</span>
243
+ `,y.appendChild(C),b(this,gt).set(w,C),b(this,Be).call(this,w,Z=>{const L=I(this,k,_n).call(this,w,Z);L.status==="error"?I(this,k,En).call(this,w,Z,L):I(this,k,Si).call(this,w)})}),u.appendChild(y),i.appendChild(u)}),n.appendChild(i),t.appendChild(n)},bi=function(){b(this,me).addEventListener("click",()=>I(this,k,vi).call(this)),b(this,De).addEventListener("click",()=>I(this,k,yi).call(this)),b(this,fe).addEventListener("input",()=>I(this,k,_i).call(this)),b(this,G).addEventListener("pointerdown",t=>I(this,k,Ci).call(this,t)),document.addEventListener("pointermove",t=>I(this,k,xi).call(this,t)),document.addEventListener("pointerup",t=>I(this,k,Cn).call(this,t)),document.addEventListener("pointercancel",t=>I(this,k,Cn).call(this,t))},wi=function(){document.body.appendChild(b(this,me)),document.body.appendChild(b(this,B))},vi=function(){b(this,B).style.display="flex",b(this,me).style.display="none";const t=b(this,B).offsetWidth,n=b(this,B).offsetHeight,o=window.innerWidth,i=window.innerHeight,r=Math.min(10,Math.max(0,o-t-10)),s=Math.min(10,Math.max(0,i-n-10));b(this,B).style.left=`${r}px`,b(this,B).style.top=`${s}px`},yi=function(){b(this,B).style.display="none",b(this,me).style.display="block"},_n=function(t,n){const o=Eu(t);if(!o)return{status:"skipped"};const i=o.safeParse(n);return i.success?{status:"success"}:{status:"error",errorMessage:Cu(i.error)}},En=function(t,n,o){const i=new Date().toLocaleTimeString("en-GB",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3});b(this,ue).push({eventName:t,payload:n,timestamp:i,expanded:!1,validation:o}),b(this,ue).length>100&&b(this,ue).shift(),I(this,k,Tt).call(this)},ki=function(){x(this,ue,[]),b(this,K).innerHTML=""},_i=function(){I(this,k,Tt).call(this)},Tt=function(){const t=b(this,fe).value.toLowerCase(),n=b(this,ue).filter(o=>o.eventName.toLowerCase().includes(t));if(b(this,K).innerHTML="",n.length===0){b(this,K).innerHTML='<div style="color: #9CA3AF; padding: 20px; text-align: center;">Events will appear here...</div>';return}n.forEach(o=>{var h,y;const i=document.createElement("div");i.className="dbg-log-entry",((h=o.validation)==null?void 0:h.status)==="error"&&i.classList.add("validation-error");const r=document.createElement("div");r.className="dbg-log-header";const s=o.payload!==void 0&&o.payload!==null,a=document.createElement("span");a.className="dbg-log-timestamp",a.textContent=`[${o.timestamp}]`;const c=document.createElement("span");c.className="dbg-log-name",c.textContent=o.eventName;const u=document.createElement("span");if(u.className="dbg-log-toggle",u.textContent=s?o.expanded?"−":"+":"",r.appendChild(a),r.appendChild(c),r.appendChild(u),s&&r.addEventListener("click",()=>{const w=b(this,K).scrollTop;o.expanded=!o.expanded,I(this,k,Tt).call(this),b(this,K).scrollTop=w}),i.appendChild(r),s){const w=document.createElement("div");w.className=`dbg-log-payload${o.expanded?"":" collapsed"}`,w.textContent=JSON.stringify(o.payload,null,2),i.appendChild(w)}if(((y=o.validation)==null?void 0:y.status)==="error"&&o.validation.errorMessage){const w=document.createElement("div");w.className="dbg-log-error-message",w.textContent=`❌ Validation Error:
244
+ ${o.validation.errorMessage}`,i.appendChild(w)}b(this,K).appendChild(i)}),b(this,K).scrollTop=b(this,K).scrollHeight},Ei=function(){const t=b(this,fe).value.toLowerCase(),o=b(this,ue).filter(i=>i.eventName.toLowerCase().includes(t)).map(i=>{const r=i.payload!==void 0?JSON.stringify(i.payload,null,2):"";return`[${i.timestamp}] ${i.eventName}${r?`
245
+ `+r:""}
246
+ `}).join(`
247
+ `);navigator.clipboard.writeText(o).catch(()=>{const i=document.createElement("textarea");i.value=o,document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i)})},Ci=function(t){if(t.target.closest(".dbg-close"))return;x(this,ze,!0),b(this,G).classList.add("dragging"),b(this,G).setPointerCapture(t.pointerId);const n=b(this,B).getBoundingClientRect();b(this,Ie).x=t.clientX-n.left,b(this,Ie).y=t.clientY-n.top,t.preventDefault()},xi=function(t){if(!b(this,ze))return;const n=t.clientX-b(this,Ie).x,o=t.clientY-b(this,Ie).y,i=window.innerWidth-b(this,B).offsetWidth,r=window.innerHeight-b(this,B).offsetHeight,s=Math.max(0,Math.min(n,i)),a=Math.max(0,Math.min(o,r));b(this,B).style.left=`${s}px`,b(this,B).style.top=`${a}px`},Cn=function(t){b(this,ze)&&(x(this,ze,!1),b(this,G).classList.remove("dragging"),t&&b(this,G).hasPointerCapture(t.pointerId)&&b(this,G).releasePointerCapture(t.pointerId))},Si=function(t){const n=b(this,gt).get(t);n&&n.classList.contains("pending")&&(n.classList.remove("pending"),n.classList.add("received"))};const Su=J("DebuggingPlugin","color:#444444;font-weight:bold;");var mt;class zu extends ee{constructor(...n){super(...n);S(this,mt);x(this,mt,new xu(this.send.bind(this),this.on.bind(this))),this.registerSdkToDebugEvents(),Su("configured")}registerSdkToDebugEvents(){["autoplay","balance","bet","cashier","choice","close","configure","configured","error","loadEnd","loadProgress","loadStart","playCycleStart","playCycleEnd","playEnd","playError","playReady","playStart","settings","openGame","openGameResponse","playResponse"].forEach(o=>{b(this,mt).registerEvent(o)})}}mt=new WeakMap;const lo=J("GigPlugin","color:#000000;font-weight:bold;");class Iu extends ee{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),lo("configured")}postMessage(t){const n={event:t};lo("postMessage",n),window.top.postMessage(n,"*")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{data:n}=t;switch(n){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 Mu=J("OryxPlugin","color:#000000;font-weight:bold;");class Tu extends ee{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Mu("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:n,param:o}=t.data;switch(n){case"doBalanceUpdate":this.send("balance",{balance:o});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:n})=>{t!==n&&(t=n,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:n})=>{switch(n){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 Qt=J("PariplayPlugin","color:#000000;font-weight:bold;");function en(e){try{window.top.location=e}catch{window.location=e}}function tn(e,t){return new Promise(function(o,i){const r=new XMLHttpRequest;r.onload=function(){r.status>=200&&r.status<300?o(r.responseText):i(r.responseText)},r.open(e,t),r.send()})}function nn(){}function Au(e){return e.filter(function(n){return n.messageType.toUpperCase()==="DATA"})}function on(e){return e.filter(function(n){return["NOTIFICATION","POPUP"].includes(n.messageType.toUpperCase())})}function zi(e){try{return JSON.parse(e.text)}catch{return{}}}function Pu(e){return e.map(zi).filter(Boolean).find(function(n){return n.betId!=null&&n.winId!=null})||{}}function $u(e){return e.map(zi).filter(Boolean).find(function(n){return n.TotalBet!=null&&n.TotalWin!=null})||{}}class Ou extends ee{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Qt("configured")}postMessage(t,n){const o={lang:this.sdkConfig.ui.language,sender:this.sdkConfig.api.game,type:t};n!=null&&(o.data=n),Qt("postMessage",o),window.parent.postMessage(o,"*")}coinsToCurrency(t){return t*this.sdkConfig.api.coinValueInCents/100}handleContinueButton(t,n){t.link&&tn("GET",t.link),n()}handleLinkButton(t,n){switch(t.linkType.toUpperCase()){case"AJAX":tn("GET",t.link),n();return;case"AJAXRESPONSE":tn("GET",t.link).then(()=>{n()});return;case"REDIRECT":en(t.link),n();return}}handleQuitButton(t,n){this.send("close"),n()}handleCashierButton(t,n){this.send("cashier",{type:"ON_DEMAND"}),n()}handleHistoryButton(t,n){this.send("history",{source:"casino"}),n()}get buttonActions(){return{CASHIER:this.handleCashierButton,CONTINUE:this.handleContinueButton,HISTORY:this.handleHistoryButton,LINK:this.handleLinkButton,QUIT:this.handleQuitButton}}processInfoUiMessages(t){return t.reduce((n,o)=>n.then(()=>new Promise(i=>{const r=Object.assign({},o,{buttons:o.buttons.filter(s=>s.action.toUpperCase()==="CASHIER"?!!this.sdkConfig.api.cashierUrl:!0).map(s=>Object.assign({},s,{onRelease:()=>{const a=o.messageType.toUpperCase()==="POPUP"?nn:i,c=this.buttonActions[s.action.toUpperCase()];c?c(s,a):a()}}))});Qt("showMessage",r)}).catch(nn)),Promise.resolve()).then(()=>{}).catch(nn)}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:n}=t.data;switch(n){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",n=>{let o;try{const i=JSON.parse(JSON.parse(atob(this.sdkConfig.api.integrationData.token.split(".")[1])).token),r=JSON.parse(i.integrationSpecificAttributes.sessionData||"{}");o={ClientToken:i.integrationSpecificAttributes.clientToken,CurrencyCode:i.currency,PlayerTokenId:i.user,SessionData:r}}catch{o=void 0}this.postMessage("gameDataLoaded",{LoadGameData:o,success:!0});try{const i=on(n.contract.uiMessages);this.processInfoUiMessages(i)}catch{}}),this.on("balance",({balance:n})=>{t!==n&&(t=n,this.postMessage("balance",{amount:this.coinsToCurrency(n)}))}),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"):en(this.sdkConfig.api.homeUrl)}),this.on("playEnd",n=>{this.postMessage("roundEnded",{balanceAfter:this.coinsToCurrency(n.contract.balance.coins),win:this.coinsToCurrency(n.contract.win.round)});try{const o=on(n.contract.uiMessages);this.processInfoUiMessages(o)}catch{}}),this.on("playError",n=>{this.postMessage("ticketReceived",{ErrorCode:n.type==="error"?n.data.code:"TIMEOUT",ErrorMessage:"ERROR",Status:{ErrCode:n.type==="error"?n.data.code:"TIMEOUT"}})}),this.on("playResponse",n=>{this.postMessage("roundStarted",{balanceBefore:this.coinsToCurrency(n.contract.balance.coins+n.contract.bet.lastPaid.base*n.contract.bet.lastPaid.multiplier)});const o=["BaseGame","PaidSpin"].includes(n.contract.stateType.thisRound),i=Au(n.contract.uiMessages),r=on(n.contract.uiMessages),s=Pu(i),a=$u(i);this.postMessage("ticketReceived",{Balance:this.coinsToCurrency(n.contract.balance.coins),BetAmount:o?this.coinsToCurrency(n.contract.bet.lastPaid.base*n.contract.bet.lastPaid.multiplier):0,CreditTransactionId:s.betId,DebitTransactionId:s.winId,Message:r,SessionData:a,Status:{ErrCode:0},WinAmount:this.coinsToCurrency(n.contract.win.round)})}),this.on("playStart",n=>{n.bet&&this.postMessage("roundStart",{totalBet:this.coinsToCurrency(n.bet.base*n.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"):en(this.sdkConfig.api.cashierUrl))})}}const ot=J("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class Zu extends ee{constructor(...n){super(...n);E(this,"VERSION","1.17.0");const o=document.createElement("script");o.src=`https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`,o.onload=()=>{ot("loaded"),window.FEIM.configure({p2pConfig:{currency:this.sdkConfig.api.currency,launchParams:{homeurl:"homeUrl"}}}),ot("configured"),this.registerToSdkEvents(),this.registerFromSdkEvents()},document.body.appendChild(o)}registerToSdkEvents(){window.FEIM.on.errorMessageDismissed(()=>this.send("unfreeze")),window.FEIM.on.errorMessageDisplayed(()=>this.send("freeze")),window.FEIM.on.exitingGame(()=>ot("!!! NOT IMPLEMENTED: exitingGame !!!")),window.FEIM.on.freeze(()=>this.send("freeze")),window.FEIM.on.initialized(()=>ot("!!! NOT IMPLEMENTED: initialized !!!")),window.FEIM.on.pauseAutoPlay(()=>this.send("suspend")),window.FEIM.on.refreshBalance(()=>ot("!!! 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:[n]})=>this.send("settings",{sounds:n.sounds,fastPlay:n.fastPlay}))}registerFromSdkEvents(){this.on("autoplay",({action:n})=>{switch(n){case"start":window.FEIM.send.autoPlayStarted();break;case"stop":window.FEIM.send.autoPlayFinished();break}}),this.on("balance",({balance:n})=>{window.FEIM.send.balanceUpdate(n)}),this.on("bet",({base:n,multiplier:o})=>{window.FEIM.send.betUpdate(n*o)}),this.on("error",n=>{const o="message"in n?n.message:"Unknown error";window.FEIM.send.errorMessage(o)}),this.on("close",()=>{window.FEIM.send.exitGame()}),this.on("loadEnd",()=>{window.FEIM.send.gameLoadCompleted()}),this.on("loadProgress",({progress:n})=>{window.FEIM.send.gameLoadProgress(n)}),this.on("loadStart",()=>{window.FEIM.send.gameLoadStarted()}),this.on("cashier",()=>{window.FEIM.send.openQuickDeposit()}),this.on("playCycleEnd",n=>{const o={balance:n.contract.balance.coins,bet:n.contract.bet.lastPaid.base*n.contract.bet.lastPaid.multiplier,win:{win:n.contract.win.total}};window.FEIM.send.roundFinished(o)}),this.on("playResponse",n=>{const o={balance:n.contract.balance.coins,playResponse:n.data};window.FEIM.send.roundStarted(o)}),this.on("history",()=>{window.FEIM.send.showHistory()}),this.on("settings",n=>{window.FEIM.send.updateSettings(n)})}}const rn=J("TukoPlugin","color:#000000;font-weight:bold;");class Nu extends ee{constructor(...n){super(...n);E(this,"PING_INTERVAL",1e4);const i=new URLSearchParams(window.location.search).get("pingCallbackUrl");i&&window.setInterval(()=>{this.ping(i)},this.PING_INTERVAL),this.registerToSdkEvents(),this.registerFromSdkEvents(),rn("configured")}ping(n){const o=new XMLHttpRequest;o.onreadystatechange=function(){o.readyState===XMLHttpRequest.DONE&&(o.status===0||o.status>=200&&o.status<400?rn("ping ok",o):rn("ping error",o))},o.open("GET",n),o.send()}registerToSdkEvents(){window.addEventListener("message",n=>{try{const{type:o,payload:i}=n.data;switch(o){case"doAudioSettings":this.send("settings",{music:i==null?void 0:i.musicEnabled,sounds:i==null?void 0:i.soundEnabled});return;case"doBalanceUpdate":const{currency:r,coinValueInCents:s}=this.sdkConfig.api;i.currency===r&&typeof i.balanceInCurrency=="number"?this.send("balance",{balance:Fo(i.balanceInCurrency,s)}):(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 ho=J("QuantaPlugin","color:#000000;font-weight:bold;");class Ru extends ee{constructor(...t){super(...t),this.registerFromSdkEvents(),ho("configured")}postMessage(t){const n={event:t};ho("postMessage",n),window.parent.postMessage(n,"*")}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")})}}const po=J("SoftSwissPlugin","color:#000000;font-weight:bold;");class Fu extends ee{constructor(...t){super(...t),this.registerFromSdkEvents(),po("configured")}postMessage(t,n){const o={event:t,payload:n};po("postMessage",o),window.top.postMessage(o,"*")}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("loadStart",()=>{this.postMessage("gameLoadStarted")}),this.on("loadProgress",({progress:t})=>{this.postMessage("gameLoadProgress",{progress:t})}),this.on("loadEnd",()=>{this.postMessage("gameLoadCompleted")}),this.on("playCycleStart",()=>{this.postMessage("gameAnimationStart")}),this.on("playCycleEnd",t=>{this.postMessage("winUpdate",{win:t.contract.win.total}),this.postMessage("gameAnimationCompleted")}),this.on("playError",()=>{this.postMessage("gameAnimationCompleted")}),this.on("balance",({balance:t})=>{this.postMessage("balanceUpdate",{balance:t})}),this.on("bet",t=>{this.postMessage("stakeUpdate",{bet:t})})}}const go=J("EveryMatrixPlugin","color:#000000;font-weight:bold;");class Lu extends ee{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),go("configured")}postMessage(t,n){const o={name:t,sender:"game",data:n};go("postMessage",o),window.top.postMessage(o,"*")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{name:n,sender:o}=t.data;if(o!=="emwindow")return;switch(n){case"updateBalance":this.send("getBalance");return;case"togglePaytable":this.send("paytable");return;case"stopAutoplay":this.send("suspend");return;case"showHelp":this.send("help",{show:!0});return;default:return}}catch{}})}registerFromSdkEvents(){this.on("loadProgress",({progress:t})=>{this.postMessage("loadProgress",{progress:t})}),this.on("loadEnd",()=>{this.postMessage("loadCompleted")}),this.on("settings",t=>{(t!=null&&t.music||t!=null&&t.sounds)&&this.postMessage("audioToggle")}),this.on("playCycleStart",()=>{this.postMessage("roundStart")}),this.on("playCycleEnd",()=>{this.postMessage("roundEnd")}),this.on("playError",()=>{this.postMessage("errorMessage")}),this.on("error",()=>{this.postMessage("errorMessage")}),this.on("close",()=>{this.postMessage("close")}),this.on("bet",()=>{this.postMessage("stakeUpdate")})}}var Uu="2.0.5",xn=500,mo="user-agent",Je="",fo="?",Zt="function",we="undefined",Ye="object",Sn="string",H="browser",le="cpu",ie="device",Q="engine",X="os",Le="result",m="name",d="type",g="vendor",f="version",V="architecture",pt="major",p="model",dt="console",_="mobile",M="tablet",R="smarttv",ne="wearable",xt="xr",lt="embedded",Pe="inapp",Fn="brands",Se="formFactors",Ln="fullVersionList",Ue="platform",Un="platformVersion",Vt="bitness",Ce="sec-ch-ua",Du=Ce+"-full-version-list",Bu=Ce+"-arch",ju=Ce+"-"+Vt,Gu=Ce+"-form-factors",Hu=Ce+"-"+_,Vu=Ce+"-"+p,Ii=Ce+"-"+Ue,Wu=Ii+"-version",Mi=[Fn,Ln,_,p,Ue,Un,V,Se,Vt],St="Amazon",$e="Apple",bo="ASUS",wo="BlackBerry",xe="Google",vo="Huawei",sn="Lenovo",yo="Honor",zt="LG",an="Microsoft",cn="Motorola",un="Nvidia",ko="OnePlus",dn="OPPO",it="Samsung",_o="Sharp",rt="Sony",ln="Xiaomi",hn="Zebra",Eo="Chrome",Co="Chromium",pe="Chromecast",At="Edge",st="Firefox",at="Opera",pn="Facebook",xo="Sogou",Oe="Mobile ",ct=" Browser",zn="Windows",qu=typeof window!==we,W=qu&&window.navigator?window.navigator:void 0,ge=W&&W.userAgentData?W.userAgentData:void 0,Ku=function(e,t){var n={},o=t;if(!Nt(t)){o={};for(var i in t)for(var r in t[i])o[r]=t[i][r].concat(o[r]?o[r]:[])}for(var s in e)n[s]=o[s]&&o[s].length%2===0?o[s].concat(e[s]):e[s];return n},Wt=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},In=function(e,t){if(typeof e===Ye&&e.length>0){for(var n in e)if(ve(t)==ve(e[n]))return!0;return!1}return et(e)?ve(t)==ve(e):!1},Nt=function(e,t){for(var n in e)return/^(browser|cpu|device|engine|os)$/.test(n)||(t?Nt(e[n]):!1)},et=function(e){return typeof e===Sn},gn=function(e){if(e){for(var t=[],n=Qe(/\\?\"/g,e).split(","),o=0;o<n.length;o++)if(n[o].indexOf(";")>-1){var i=Rt(n[o]).split(";v=");t[o]={brand:i[0],version:i[1]}}else t[o]=Rt(n[o]);return t}},ve=function(e){return et(e)?e.toLowerCase():e},mn=function(e){return et(e)?Qe(/[^\d\.]/g,e).split(".")[0]:void 0},he=function(e){for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];typeof n==Ye&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},Qe=function(e,t){return et(t)?t.replace(e,Je):t},ut=function(e){return Qe(/\\?\"/g,e)},Rt=function(e,t){if(et(e))return e=Qe(/^\s\s*/,e),typeof t===we?e:e.substring(0,xn)},fn=function(e,t){if(!(!e||!t))for(var n=0,o,i,r,s,a,c;n<t.length&&!a;){var u=t[n],h=t[n+1];for(o=i=0;o<u.length&&!a&&u[o];)if(a=u[o++].exec(e),a)for(r=0;r<h.length;r++)c=a[++i],s=h[r],typeof s===Ye&&s.length>0?s.length===2?typeof s[1]==Zt?this[s[0]]=s[1].call(this,c):this[s[0]]=s[1]:s.length>=3&&(typeof s[1]===Zt&&!(s[1].exec&&s[1].test)?s.length>3?this[s[0]]=c?s[1].apply(this,s.slice(2)):void 0:this[s[0]]=c?s[1].call(this,c,s[2]):void 0:s.length==3?this[s[0]]=c?c.replace(s[1],s[2]):void 0:s.length==4?this[s[0]]=c?s[3].call(this,c.replace(s[1],s[2])):void 0:s.length>4&&(this[s[0]]=c?s[3].apply(this,[c.replace(s[1],s[2])].concat(s.slice(4))):void 0)):this[s]=c||void 0;n+=2}},oe=function(e,t){for(var n in t)if(typeof t[n]===Ye&&t[n].length>0){for(var o=0;o<t[n].length;o++)if(In(t[n][o],e))return n===fo?void 0:n}else if(In(t[n],e))return n===fo?void 0:n;return t.hasOwnProperty("*")?t["*"]:e},So={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},zo={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Xu={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Io={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[m,Oe+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[f,[m,At+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[m,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[m,f],[/opios[\/ ]+([\w\.]+)/i],[f,[m,at+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[f,[m,at+" GX"]],[/\bopr\/([\w\.]+)/i],[f,[m,at]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[f,[m,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[f,[m,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[m,f],[/quark(?:pc)?\/([-\w\.]+)/i],[f,[m,"Quark"]],[/\bddg\/([\w\.]+)/i],[f,[m,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[m,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[f,[m,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[m,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[m,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[m,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[f,[m,"Smart "+sn+ct]],[/(avast|avg)\/([\w\.]+)/i],[[m,/(.+)/,"$1 Secure"+ct],f],[/\bfocus\/([\w\.]+)/i],[f,[m,st+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[m,at+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[m,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[m,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[m,at+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[m,"MIUI"+ct]],[/fxios\/([\w\.-]+)/i],[f,[m,Oe+st]],[/\bqihoobrowser\/?([\w\.]*)/i],[f,[m,"360"]],[/\b(qq)\/([\w\.]+)/i],[[m,/(.+)/,"$1Browser"],f],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[m,/(.+)/,"$1"+ct],f],[/samsungbrowser\/([\w\.]+)/i],[f,[m,it+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[f,[m,xo+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[m,xo+" Mobile"],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[m,f],[/(lbbrowser|rekonq)/i],[m],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[f,m],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[m,pn],f,[d,Pe]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[m,f,[d,Pe]],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[m,"GSA"],[d,Pe]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[m,"TikTok"],[d,Pe]],[/\[(linkedin)app\]/i],[m,[d,Pe]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[m,/(.+)/,"Zalo"],f,[d,Pe]],[/(chromium)[\/ ]([-\w\.]+)/i],[m,f],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[m,Eo+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[f,[m,At+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[m,Eo+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[m,"Android"+ct]],[/chrome\/([\w\.]+) mobile/i],[f,[m,Oe+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[m,f],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[f,[m,Oe+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[m,Oe+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[f,m],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[m,[f,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[m,f],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[m,Oe+st],f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[m,"Netscape"],f],[/(wolvic|librewolf)\/([\w\.]+)/i],[m,f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[m,st+" 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,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[m,[f,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[m,[f,/[^\d\.]+./,Je]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[V,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[V,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[V,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[V,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[V,"arm"]],[/ sun4\w[;\)]/i],[[V,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[V,/ower/,Je,ve]],[/winnt.+\[axp/i],[[V,"alpha"]]],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],[p,[g,it],[d,M]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[p,[g,it],[d,_]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[g,$e],[d,_]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[g,$e],[d,M]],[/(macintosh);/i],[p,[g,$e]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[g,_o],[d,_]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[p,[g,yo],[d,M]],[/honor([-\w ]+)[;\)]/i],[p,[g,yo],[d,_]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[p,[g,vo],[d,M]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[g,vo],[d,_]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[p,/_/g," "],[g,ln],[d,M]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[p,/_/g," "],[g,ln],[d,_]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[g,ko],[d,_]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[g,dn],[d,_]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[p,[g,oe,{OnePlus:["203","304","403","404","413","415"],"*":dn}],[d,M]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[p,[g,"BLU"],[d,_]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[g,"Vivo"],[d,_]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[g,"Realme"],[d,_]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[p,[g,sn],[d,M]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[p,[g,sn],[d,_]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[p,[g,cn],[d,_]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[g,cn],[d,M]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[g,zt],[d,M]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[g,zt],[d,_]],[/(nokia) (t[12][01])/i],[g,p,[d,M]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[p,/_/g," "],[d,_],[g,"Nokia"]],[/(pixel (c|tablet))\b/i],[p,[g,xe],[d,M]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[p,[g,xe],[d,_]],[/(google) (pixelbook( go)?)/i],[g,p],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[g,rt],[d,_]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[g,rt],[d,M]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[g,St],[d,M]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[g,St],[d,_]],[/(playbook);[-\w\),; ]+(rim)/i],[p,g,[d,M]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[g,wo],[d,_]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[g,bo],[d,M]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[g,bo],[d,_]],[/(nexus 9)/i],[p,[g,"HTC"],[d,M]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[p,/_/g," "],[d,_]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[p,[g,"TCL"],[d,M]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[p,[g,"TCL"],[d,_]],[/(itel) ((\w+))/i],[[g,ve],p,[d,oe,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[g,"Acer"],[d,M]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[g,"Meizu"],[d,_]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[g,"Ulefone"],[d,_]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[g,"Energizer"],[d,_]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[g,"Cat"],[d,_]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[g,"Smartfren"],[d,_]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[p,[g,"Nothing"],[d,_]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[p,[g,"Archos"],[d,M]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[p,[g,"Archos"],[d,_]],[/; (n159v)/i],[p,[g,"HMD"],[d,_]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[g,p,[d,M]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[g,p,[d,_]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[g,p,[d,M]],[/(surface duo)/i],[p,[g,an],[d,M]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[g,"Fairphone"],[d,_]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[p,[g,un],[d,M]],[/(sprint) (\w+)/i],[g,p,[d,_]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[g,an],[d,_]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[g,hn],[d,M]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[g,hn],[d,_]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[g,[d,R]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[g,it],[d,R]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[g,p,[d,R]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,zt],[d,R]],[/(apple) ?tv/i],[g,[p,$e+" TV"],[d,R]],[/crkey.*devicetype\/chromecast/i],[[p,pe+" Third Generation"],[g,xe],[d,R]],[/crkey.*devicetype\/([^/]*)/i],[[p,/^/,"Chromecast "],[g,xe],[d,R]],[/fuchsia.*crkey/i],[[p,pe+" Nest Hub"],[g,xe],[d,R]],[/crkey/i],[[p,pe],[g,xe],[d,R]],[/(portaltv)/i],[p,[g,pn],[d,R]],[/droid.+aft(\w+)( bui|\))/i],[p,[g,St],[d,R]],[/(shield \w+ tv)/i],[p,[g,un],[d,R]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[g,_o],[d,R]],[/(bravia[\w ]+)( bui|\))/i],[p,[g,rt],[d,R]],[/(mi(tv|box)-?\w+) bui/i],[p,[g,ln],[d,R]],[/Hbbtv.*(technisat) (.*);/i],[g,p,[d,R]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,/.+\/(\w+)/,"$1",oe,{LG:"lge"}],[p,Rt],[d,R]],[/(playstation \w+)/i],[p,[g,rt],[d,dt]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[g,an],[d,dt]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[g,p,[d,dt]],[/droid.+; (shield)( bui|\))/i],[p,[g,un],[d,dt]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[p,[g,it],[d,ne]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[g,p,[d,ne]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[p,[g,dn],[d,ne]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[g,$e],[d,ne]],[/(opwwe\d{3})/i],[p,[g,ko],[d,ne]],[/(moto 360)/i],[p,[g,cn],[d,ne]],[/(smartwatch 3)/i],[p,[g,rt],[d,ne]],[/(g watch r)/i],[p,[g,zt],[d,ne]],[/droid.+; (wt63?0{2,3})\)/i],[p,[g,hn],[d,ne]],[/droid.+; (glass) \d/i],[p,[g,xe],[d,xt]],[/(pico) ([\w ]+) os\d/i],[g,p,[d,xt]],[/(quest( \d| pro)?s?).+vr/i],[p,[g,pn],[d,xt]],[/mobile vr; rv.+firefox/i],[[d,xt]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[d,lt]],[/(aeobc)\b/i],[p,[g,St],[d,lt]],[/(homepod).+mac os/i],[p,[g,$e],[d,lt]],[/windows iot/i],[[d,lt]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[p,[d,R]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[d,R]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[p,[d,oe,{mobile:"Mobile",xr:"VR","*":M}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,M]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,_]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[p,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[m,At+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[m,f],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[m,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[m,f],[/ladybird\//i],[[m,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,m]],os:[[/(windows nt) (6\.[23]); arm/i],[[m,/N/,"R"],[f,oe,So]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[m,f],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[f,/(;|\))/g,"",oe,So],[m,zn]],[/(windows ce)\/?([\d\.]*)/i],[m,f],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[m,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[m,"macOS"],[f,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[f,[m,pe+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[f,[m,pe+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[f,[m,pe+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[f,[m,pe+" Linux"]],[/crkey\/([\d\.]+)/i],[f,[m,pe]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[f,m],[/(ubuntu) ([\w\.]+) like android/i],[[m,/(.+)/,"$1 Touch"],f],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[m,f],[/\(bb(10);/i],[f,[m,wo]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[f,[m,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[m,st+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[f,[m,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[f,oe,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[m,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[m,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[m,"Chrome OS"],f],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[m,f],[/(sunos) ?([\d\.]*)/i],[[m,"Solaris"],f],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[m,f]]},It=function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return he.call(e.init,[[H,[m,f,pt,d]],[le,[V]],[ie,[d,p,g]],[Q,[m,f]],[X,[m,f]]]),he.call(e.isIgnore,[[H,[f,pt]],[Q,[f]],[X,[f]]]),he.call(e.isIgnoreRgx,[[H,/ ?browser$/i],[X,/ ?os$/i]]),he.call(e.toString,[[H,[m,f]],[le,[V]],[ie,[g,p]],[Q,[m,f]],[X,[m,f]]]),e}(),Ju=function(e,t){var n=It.init[t],o=It.isIgnore[t]||0,i=It.isIgnoreRgx[t]||0,r=It.toString[t]||0;function s(){he.call(this,n)}return s.prototype.getItem=function(){return e},s.prototype.withClientHints=function(){return ge?ge.getHighEntropyValues(Mi).then(function(a){return e.setCH(new Ti(a,!1)).parseCH().get()}):e.parseCH().get()},s.prototype.withFeatureCheck=function(){return e.detectFeature().get()},t!=Le&&(s.prototype.is=function(a){var c=!1;for(var u in this)if(this.hasOwnProperty(u)&&!In(o,u)&&ve(i?Qe(i,this[u]):this[u])==ve(i?Qe(i,a):a)){if(c=!0,a!=we)break}else if(a==we&&c){c=!c;break}return c},s.prototype.toString=function(){var a=Je;for(var c in r)typeof this[r[c]]!==we&&(a+=(a?" ":Je)+this[r[c]]);return a||we}),ge||(s.prototype.then=function(a){var c=this,u=function(){for(var y in c)c.hasOwnProperty(y)&&(this[y]=c[y])};u.prototype={is:s.prototype.is,toString:s.prototype.toString};var h=new u;return a(h),h}),new s};function Ti(e,t){if(e=e||{},he.call(this,Mi),t)he.call(this,[[Fn,gn(e[Ce])],[Ln,gn(e[Du])],[_,/\?1/.test(e[Hu])],[p,ut(e[Vu])],[Ue,ut(e[Ii])],[Un,ut(e[Wu])],[V,ut(e[Bu])],[Se,gn(e[Gu])],[Vt,ut(e[ju])]]);else for(var n in e)this.hasOwnProperty(n)&&typeof e[n]!==we&&(this[n]=e[n])}function Mo(e,t,n,o){return this.get=function(i){return i?this.data.hasOwnProperty(i)?this.data[i]:void 0:this.data},this.set=function(i,r){return this.data[i]=r,this},this.setCH=function(i){return this.uaCH=i,this},this.detectFeature=function(){if(W&&W.userAgent==this.ua)switch(this.itemType){case H:W.brave&&typeof W.brave.isBrave==Zt&&this.set(m,"Brave");break;case ie:!this.get(d)&&ge&&ge[_]&&this.set(d,_),this.get(p)=="Macintosh"&&W&&typeof W.standalone!==we&&W.maxTouchPoints&&W.maxTouchPoints>2&&this.set(p,"iPad").set(d,M);break;case X:!this.get(m)&&ge&&ge[Ue]&&this.set(m,ge[Ue]);break;case Le:var i=this.data,r=function(s){return i[s].getItem().detectFeature().get()};this.set(H,r(H)).set(le,r(le)).set(ie,r(ie)).set(Q,r(Q)).set(X,r(X))}return this},this.parseUA=function(){return this.itemType!=Le&&fn.call(this.data,this.ua,this.rgxMap),this.itemType==H&&this.set(pt,mn(this.get(f))),this},this.parseCH=function(){var i=this.uaCH,r=this.rgxMap;switch(this.itemType){case H:case Q:var s=i[Ln]||i[Fn],a;if(s)for(var c=0;c<s.length;c++){var u=s[c].brand||s[c],h=s[c].version;this.itemType==H&&!/not.a.brand/i.test(u)&&(!a||/Chrom/.test(a)&&u!=Co||a==At&&/WebView2/.test(u))&&(u=oe(u,Xu),a=this.get(m),a&&!/Chrom/.test(a)&&/Chrom/.test(u)||this.set(m,u).set(f,h).set(pt,mn(h)),a=u),this.itemType==Q&&u==Co&&this.set(f,h)}break;case le:var y=i[V];y&&(y&&i[Vt]=="64"&&(y+="64"),fn.call(this.data,y+";",r));break;case ie:if(i[_]&&this.set(d,_),i[p]&&(this.set(p,i[p]),!this.get(d)||!this.get(g))){var w={};fn.call(w,"droid 9; "+i[p]+")",r),!this.get(d)&&w.type&&this.set(d,w.type),!this.get(g)&&w.vendor&&this.set(g,w.vendor)}if(i[Se]){var C;if(typeof i[Se]!="string")for(var Z=0;!C&&Z<i[Se].length;)C=oe(i[Se][Z++],zo);else C=oe(i[Se],zo);this.set(d,C)}break;case X:var L=i[Ue];if(L){var ae=i[Un];L==zn&&(ae=parseInt(mn(ae),10)>=13?"11":"10"),this.set(m,L).set(f,ae)}this.get(m)==zn&&i[p]=="Xbox"&&this.set(m,"Xbox").set(f,void 0);break;case Le:var ce=this.data,te=function(j){return ce[j].getItem().setCH(i).parseCH().get()};this.set(H,te(H)).set(le,te(le)).set(ie,te(ie)).set(Q,te(Q)).set(X,te(X))}return this},he.call(this,[["itemType",e],["ua",t],["uaCH",o],["rgxMap",n],["data",Ju(this,e)]]),this}function se(e,t,n){if(typeof e===Ye?(Nt(e,!0)?(typeof t===Ye&&(n=t),t=e):(n=e,t=void 0),e=void 0):typeof e===Sn&&!Nt(t,!0)&&(n=t,t=void 0),n)if(typeof n.append===Zt){var o={};n.forEach(function(h,y){o[String(y).toLowerCase()]=h}),n=o}else{var i={};for(var r in n)n.hasOwnProperty(r)&&(i[String(r).toLowerCase()]=n[r]);n=i}if(!(this instanceof se))return new se(e,t,n).getResult();var s=typeof e===Sn?e:n&&n[mo]?n[mo]:W&&W.userAgent?W.userAgent:Je,a=new Ti(n,!0),c=t?Ku(Io,t):Io,u=function(h){return h==Le?function(){return new Mo(h,s,c,a).set("ua",s).set(H,this.getBrowser()).set(le,this.getCPU()).set(ie,this.getDevice()).set(Q,this.getEngine()).set(X,this.getOS()).get()}:function(){return new Mo(h,s,c[h],a).parseUA().get()}};return he.call(this,[["getBrowser",u(H)],["getCPU",u(le)],["getDevice",u(ie)],["getEngine",u(Q)],["getOS",u(X)],["getResult",u(Le)],["getUA",function(){return s}],["setUA",function(h){return et(h)&&(s=h.length>xn?Rt(h,xn):h),this}]]).setUA(s),this}se.VERSION=Uu;se.BROWSER=Wt([m,f,pt,d]);se.CPU=Wt([V]);se.DEVICE=Wt([p,g,d,dt,_,R,M,ne,lt]);se.ENGINE=se.OS=Wt([m,f]);class Ai{constructor(t,n){E(this,"config");E(this,"sdkConfig");E(this,"error");this.config=t,this.sdkConfig=n,this.on("openGame",async()=>{try{this.error=void 0;const o=await this.openGame();this.send("openGameResponse",o)}catch(o){this.error=o,this.send("openGameError",this.error)}}),this.on("play",async o=>{try{this.error=void 0;const i=await this.play(o);this.send("playResponse",i)}catch(i){this.error=i,this.send("playError",this.error)}}),this.on("freeRounds",async o=>{try{this.error=void 0;const i=await this.freeRounds(o);this.send("freeRoundsResponse",i)}catch(i){this.error=i,this.send("freeRoundsError",this.error)}}),this.on("getBalance",async()=>{try{this.error=void 0;const o=await this.getBalance();this.send("balance",o)}catch{}}),this.showHistory=this.showHistory.bind(this),this.on("history",this.showHistory)}on(t,n,o){const i=function(s){s.data.message!==`kalamba:wrapper-rgs:${t}`&&s.data.message!==`kalamba:wrapper:${t}`||n(s.data.payload)};window.addEventListener("message",i,o)}send(t,...[n]){window.postMessage({message:`kalamba:rgs:${t}`,payload:n})}async openGame(){throw new Error("Not implemented")}async play(t){throw new Error("Not implemented")}async freeRounds(t){throw new Error("Not implemented")}async getBalance(){throw new Error("Not implemented")}async showHistory(){throw new Error("Not implemented")}}class Yu{constructor(t){E(this,"socket",null);E(this,"webSocketUrl");E(this,"eventListeners",{close:[],error:[],message:[]});E(this,"connect",async()=>{const t=new WebSocket(this.webSocketUrl);return t.addEventListener("message",this.handleMessage),new Promise(n=>{t.addEventListener("open",o=>{this.handleOpen(o),n(this.socket)},{once:!0})})});E(this,"send",t=>{if(this.socket==null)throw new Error("Cannot send message, the WebSocket connection is not open");this.socket.send(t)});E(this,"close",()=>{if(this.socket==null)throw new Error("Cannot close the WebSocket connection that is not open");this.socket.close()});E(this,"handleClose",t=>{this.eventListeners.close.forEach(n=>{n(t)}),this.socket.removeEventListener("message",this.handleMessage),this.socket.removeEventListener("close",this.handleClose),this.socket.removeEventListener("error",this.handleError),this.socket=null});E(this,"handleError",t=>{this.eventListeners.error.forEach(n=>{n(t)})});E(this,"handleMessage",t=>{this.eventListeners.message.forEach(n=>{n(t)})});E(this,"handleOpen",t=>{const n=t.target;n.addEventListener("close",this.handleClose),n.addEventListener("error",this.handleError),this.socket=n});this.webSocketUrl=t}addEventListener(t,n){this.eventListeners[t].push(n)}removeEventListener(t,n){const o=this.eventListeners[t].indexOf(n);o!==-1&&this.eventListeners[t].splice(o,1)}}function Mt(e){return JSON.parse(e==null?void 0:e.data)}function Qu(e){var t;return((t=e==null?void 0:e.header)==null?void 0:t.name)==="Ping"}function To(e){var t;return((t=e==null?void 0:e.header)==null?void 0:t.name)==="RealityCheck"}function Ft(e){return e.header.name==="GameEvent"}function ed(e){return Ft(e)&&e.body.event==="OPEN_GAME"}function Ao(e){return e.header.code!==1}function td(e){return Ft(e)&&e.body.event.includes("_RESULT")}var je,ft;class nd extends Yu{constructor(n,o){const i=new URL(n.apiUrl);i.searchParams.set("cageCode",n.cageCode),i.searchParams.set("gameCode",n.gameCode),i.searchParams.set("operatorCode",n.operatorCode),i.searchParams.set("playMode",n.playMode),i.searchParams.set("token",n.token),i.searchParams.set("username",n.username);super(i.toString());E(this,"cId",0);E(this,"mId",0);E(this,"seqId",0);E(this,"gameCode");S(this,je);S(this,ft);E(this,"onMessage",n=>{const o=Mt(n);(Ft(o)||Qu(o)||To(o))&&this.sendAcknowledgement(o),To(o)&&this.handleRealityCheck(o)});this.eventListeners.realityCheck=[],this.gameCode=n.gameCode,x(this,je,o.requestTimeoutMs),x(this,ft,o.gameVersion??"unknown"),this.addEventListener("message",this.onMessage)}handleRealityCheck(n){this.eventListeners.realityCheck.forEach(o=>{o(n.body)})}addEventListener(n,o){super.addEventListener(n,o)}removeEventListener(n,o){super.removeEventListener(n,o)}buildHeader(n,o=null){return{cId:o??++this.cId,code:o!==null?1:void 0,mId:++this.mId,name:n}}buildPayload(n,o){return JSON.stringify({body:o,header:n})}getBodyExtras(n){return{action:n,seqId:++this.seqId}}request(n,o){const i=this.buildPayload(n,o);return new Promise((r,s)=>{setTimeout(()=>s({type:"timeout"}),b(this,je));const a=c=>{const u=Mt(c);try{n.cId===u.header.cId&&(this.removeEventListener("message",a),u.header.code===1?r(u):s({message:u,type:"error"}))}catch{s({message:u,type:"error"})}};this.addEventListener("message",a),this.send(i)})}freeRounds(n){const o=this.buildHeader("ActivateFreeRound");return this.request(o,n).then(i=>i.body).catch(i=>{var r;throw{data:(r=i==null?void 0:i.message)==null?void 0:r.body,type:i.type}})}async authenticate(n=!1){const o=this.buildHeader("Authenticate"),i={clientType:3,version:b(this,ft),reconnect:n};return this.request(o,i).then(r=>r.body).catch(r=>{var s;throw{data:(s=r==null?void 0:r.message)==null?void 0:s.body,type:r.type}})}async getBalance(){const n=this.buildHeader("GetBalance"),o={};return this.request(n,o).then(i=>i.body).catch(i=>{var r;throw{data:(r=i==null?void 0:i.message)==null?void 0:r.body,type:i.type}})}async openGame(){const n=this.buildHeader("OpenGame"),o={gameCode:this.gameCode};return new Promise((i,r)=>{const s=a=>{const c=Mt(a);ed(c)?(this.removeEventListener("message",s),i(c.body)):Ao(c)&&r({data:c.body,type:"error"})};this.addEventListener("message",s),this.request(n,o).catch(a=>{var c;return r({data:(c=a==null?void 0:a.message)==null?void 0:c.body,type:a.type})})})}sendAcknowledgement(n){const{name:o,cId:i}=n.header,r=this.buildHeader(o,i),s=this.buildPayload(r,{});this.send(s)}sendAction(n,o){const i=this.buildHeader("GameAction"),r={...this.getBodyExtras(n),data:o};return new Promise((s,a)=>{const c=u=>{const h=Mt(u);Ft(h)&&r.seqId===h.body.correlationSeqId&&(this.removeEventListener("message",c),td(h)?s(h.body):Ao(h)&&a({data:h.body,type:"error"}))};this.addEventListener("message",c),this.request(i,r).catch(u=>{var h;return a({data:(h=u==null?void 0:u.message)==null?void 0:h.body,type:u.type})})})}setRequestTimeoutMs(n){x(this,je,n)}}je=new WeakMap,ft=new WeakMap;const od={CA_BC:"CA",CA_ON:"CA",GER:"DE",US_CT:"US",US_MI:"US",US_NJ:"US",USA:"US"};function Po(e){return!e||e==="NOT_APPLICABLE"?null:od[e]??e}function Pi(e){const t=e.contract;return t?{contract:{balance:{coins:t.balance,version:t.balanceVersion},coinValueInCents:t.coinValueInCents,country:t.countryCode,currency:t.currencyCode,jurisdiction:Po(t.jurisdictionCode),uiMessages:t.uiMessages,username:t.username}}:{contract:{balance:{coins:e.balance,version:e.balanceVersion},coinValueInCents:e.coinValueInCents,country:e.countryCode,currency:e.currencyCode,jurisdiction:Po(e.jurisdictionCode),uiMessages:e.uiMessages,username:e.username}}}function $i(e){var t,n;return{code:((t=e.data)==null?void 0:t.code)??Re.RgsErrorCode.UNKNOWN,details:(n=e.data)==null?void 0:n.details}}function Oi(e,t,n){const o=t.contract;if(!o){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(r=>({conf:{base:r.conf.baseBet,multiplier:r.conf.betMultiplier,numAwarded:r.conf.numAwarded},data:{numPlayed:r.data.numPlayed,win:r.data.winAmount,numLeft:r.data.numLeft},id:r.id,rejectable:r.rejectable,skippable:r.skippable,status:r.status,type:r.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:e.uiMessages,win:{max:i.maxWin??null,round:i.gameState.totalWinFromCurrentRound,total:i.gameState.totalWinFromCurrentGameCycle}},data:i}}return{contract:{bet:{available:o.availableMultipliersPerBaseBet,default:{base:o.defaultBet.baseBet,multiplier:o.defaultBet.betMultiplier},max:o.maxBetInCoins??null,last:o.lastBet?{base:o.lastBet.baseBet,multiplier:o.lastBet.betMultiplier}:null,lastPaid:o.lastMainGameBet?{base:o.lastMainGameBet.baseBet,multiplier:o.lastMainGameBet.betMultiplier}:null},balance:{coins:o.balanceInCoins,version:o.balanceVersion},freeRounds:(o.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:o.gameModelFile,metaData:o.metaData,roundId:o.roundId,serverTime:o.serverTime,sessionId:o.sessionId,stateType:{thisRound:o.stateTypeThisRound,nextRound:o.stateTypeNextRound},uiMessages:e.contract.uiMessages.concat(o.uiMessages),win:{max:o.maxWinInCoins??null,round:o.roundWin,total:o.totalWin}},data:n?n(t.opaqueGameServerToUi):t.opaqueGameServerToUi}}function Zi(e){var t,n;return{code:((t=e.data)==null?void 0:t.code)??Re.RgsErrorCode.UNKNOWN,details:(n=e.data)==null?void 0:n.details}}function Ni(e,t){const n=e.contract;if(!n){const o=e.data;return{contract:{bet:{last:o.gameState.betFromCurrentRound?{base:o.gameState.betFromCurrentRound.baseBet,multiplier:o.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:{base:(o.gameState.lastPlacedMainGameBet??o.gameState.betFromCurrentRound).baseBet,multiplier:(o.gameState.lastPlacedMainGameBet??o.gameState.betFromCurrentRound).betMultiplier}},balance:{coins:e.balance,version:e.balanceVersion},freeRounds:(o.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:e.balanceVersion,roundId:o.gameState.cycleId,stateType:{thisRound:o.gameState.stateTypeThisRound,nextRound:o.gameState.stateTypeNextRound},uiMessages:o.uiMessages,win:{round:o.gameState.totalWinFromCurrentRound,total:o.gameState.totalWinFromCurrentGameCycle}},data:o}}return{contract:{bet:{last:n.lastBet?{base:n.lastBet.baseBet,multiplier:n.lastBet.betMultiplier}:null,lastPaid:{base:n.lastMainGameBet.baseBet,multiplier:n.lastMainGameBet.betMultiplier}},balance:{coins:n.balanceInCoins,version:n.balanceVersion},freeRounds:(n.freeRounds??[]).map(o=>({conf:{base:o.conf.baseBet,multiplier:o.conf.betMultiplier,numAwarded:o.conf.numAwarded},data:{numPlayed:o.data.numPlayed,win:o.data.winAmount,numLeft:o.data.numLeft},id:o.id,rejectable:o.rejectable,skippable:o.skippable,status:o.status,type:o.type})),serverTime:n.serverTime,roundId:n.roundId,stateType:{thisRound:n.stateTypeThisRound,nextRound:n.stateTypeNextRound},uiMessages:n.uiMessages,win:{round:n.roundWin,total:n.totalWin}},data:t?t(e.opaqueGameServerToUi):e.opaqueGameServerToUi}}function Ri(e){var t,n;return{code:((t=e.data)==null?void 0:t.code)??Re.RgsErrorCode.UNKNOWN,details:(n=e.data)==null?void 0:n.details}}const id={parseAuthenticateResponse:Pi,parseAuthenticateError:$i,parseOpenGameResponse:Oi,parseOpenGameError:Zi,parsePlayResponse:Ni,parsePlayError:Ri},rd={aze:"az",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",lav:"lv",may:"ms",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:sd}=se(navigator.userAgent),ad=J("KalambaBullseyePlugin","color:#000000;font-weight:bold;");class cd extends Ai{constructor(...n){super(...n);E(this,"socket");this.on("configured",o=>{this.socket.setRequestTimeoutMs(o.ui.requestTimeoutMs)})}initialize(n){this.socket=new nd(n,{gameVersion:this.config.gameVersion,requestTimeoutMs:this.sdkConfig.ui.requestTimeoutMs}),["fireboltroulette"].includes(n.gameCode)||(this.socket.addEventListener("close",o=>{o.code===1008?this.error||this.send("error",{type:"CLOSE",messageCode:"TOO_MANY_OPEN_GAMES",messageKey:"RgsError.TOO_MANY_OPEN_GAMES"}):o.code===1011?this.error||this.send("error",{type:"CLOSE",messageCode:"UNKNOWN",messageKey:"RgsError.UNKNOWN"}):this.reconnect()}),["mobile","tablet"].includes(sd.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",o=>ad("error",o)),this.socket.addEventListener("realityCheck",o=>{this.send("realityCheck",o)})}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 te,j;const n=new URLSearchParams(window.location.search),o=n.get("apiUrl"),i=n.get("cageCode"),r=n.get("gameCode"),s=n.get("operatorCode"),a=n.get("playMode"),c=n.get("token"),u=n.get("username"),h=n.get("gameHistoryUrl"),y=n.get("homeUrl")??void 0,w=n.get("cashierUrl")??void 0;this.initialize({apiUrl:o,cageCode:i,gameCode:r,operatorCode:s,playMode:a,token:c,username:u});try{await this.socket.connect()}catch{throw{type:"error",data:{code:Re.RgsErrorCode.CONNECTION_ERROR}}}let C;try{C=await this.socket.authenticate()}catch(U){throw{type:U.type,data:U.type==="error"?$i(U.data):void 0}}let Z;try{Z=await this.socket.openGame()}catch(U){throw{type:U.type,data:U.type==="error"?Zi(U.data):void 0}}const L=Pi(C),ae=Oi(C,Z,this.config.dataDecoder&&Kt.decoders[this.config.dataDecoder]);this.sdkConfig.api={...this.sdkConfig.api,brand:i,game:r,integration:s,jurisdiction:L.contract.jurisdiction,playMode:a,user:L.contract.username,integrationData:{token:c},country:L.contract.country,currency:L.contract.currency,coinValueInCents:L.contract.coinValueInCents,gameHistoryUrl:h,homeUrl:y,cashierUrl:w,backendSessionId:ae.contract.sessionId};const ce=(j=(te=n.get("languageCode"))==null?void 0:te.split("_"))==null?void 0:j[0];return ce&&(this.sdkConfig.ui.language=ce.length===3?rd[ce]??ce:ce),ae}async play(n){for(;!this.socket.socket;)await new Promise(w=>setTimeout(()=>w(),500));const{contract:{bet:o,forcedOutcomes:i,...r},extra:s,payloadToInject:a}=n,c=this.config.dataEncoder&&Kt.encoders[this.config.dataEncoder],u=o===null?"BG_ACTION":"SPIN",h={bet:o?{baseBet:o.base,betMultiplier:o.multiplier}:void 0,forcedOutcomes:i,...r,...a,opaqueUiToGameServer:c?c(s):s};let y;try{y=await this.socket.sendAction(u,h)}catch(w){throw{type:w.type,data:w.type==="error"?Ri(w.data):void 0}}return Ni(y,this.config.dataDecoder&&Kt.decoders[this.config.dataDecoder])}async freeRounds(n){try{await this.socket.freeRounds(n)}catch{throw{type:"error",data:{code:Re.RgsErrorCode.UNKNOWN}}}return n}async getBalance(){try{return{balance:(await this.socket.getBalance()).balance}}catch{throw{type:"error",data:{code:Re.RgsErrorCode.UNKNOWN}}}}async showHistory(){const{api:{game:n,integration:o,integrationData:i,jurisdiction:r,user:s,gameHistoryUrl:a},ui:{language:c}}=this.sdkConfig,u=s.replace(/^user_/,"").replace(new RegExp(`_${o}$`),""),h=new URL(window.location.href);h.hostname=h.hostname.replace(/^v\./,"").replace(/^play\./,"history."),h.pathname=h.pathname.replace(/(\/[0-9]+\.[0-9]+\.[0-9]+)?\/wrapper\.html/,"/list/index.html"),h.search="",h.searchParams.set("apiUrl",new URL(a).origin),h.searchParams.set("gameCode",n),r&&h.searchParams.set("jurisdiction",r),h.searchParams.set("operatorCode",o),h.searchParams.set("token",i.token),h.searchParams.set("username",u),h.searchParams.set("languageCode",c),this.config.gameHistoryUrl&&h.searchParams.set("gameHistoryUrl",this.config.gameHistoryUrl),window.open(h.toString(),"_blank")}}class Fi{constructor(t,n,o){E(this,"trackers");E(this,"config");E(this,"sdkConfig");this.trackers=t,this.config=n,this.sdkConfig=o}on(t,n,o){const i=function(s){s.data.message!==`kalamba:wrapper-telemetry:${t}`&&s.data.message!==`kalamba:wrapper:${t}`||n(s.data.payload)};window.addEventListener("message",i,o)}track(t,n){this.trackers.forEach(o=>o.track(t,n))}}function $o(e){return e.reduce((t,n)=>t+n,0)}function ud(e){const t=e.length,n=$o(e)/t,o=e.map(r=>Math.pow(r-n,2)),i=$o(o)/t;return Math.sqrt(i)}class Oo{constructor(){E(this,"rafId",-1);E(this,"startTime",0);E(this,"stopTime",0);E(this,"frames",[]);E(this,"calculateFPS",()=>{const t=Math.floor((this.stopTime-this.startTime)/1e3);return this.frames.map(n=>Math.floor((n-this.startTime)/1e3)).reduce((n,o,i,r)=>(r[i]!==r[i-1]?n.push(1):n[n.length-1]++,n),[]).slice(0,t)});E(this,"getReport",()=>{const t=this.calculateFPS(),n=Math.floor(this.frames.length/((this.stopTime-this.startTime)/1e3)),o=t.length>0?Math.max(...t):n,i=t.length>0?Math.min(...t):n,r=t.length>0?ud(t):0;return{fpsAvg:n,fpsMax:o,fpsMin:i,fpsStdDev:r}});E(this,"start",()=>{this.startTime=Date.now(),this.frames=[],this.trackFrames()});E(this,"stop",()=>{cancelAnimationFrame(this.rafId),this.stopTime=Date.now()});E(this,"trackFrames",()=>{this.frames.push(Date.now()),this.rafId=requestAnimationFrame(this.trackFrames)})}}const dd="landscape",ld="portrait";function hd(){try{const e=document.createElement("canvas");return!!window.WebGLRenderingContext&&(e.getContext("webgl")||e.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function pd(){if(!window.createImageBitmap)return!1;const n=await(await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();try{return await createImageBitmap(n),!0}catch{return!1}}function bn(){return window.innerWidth>=window.innerHeight?dd:ld}var Lt,Ge,He,Ve,bt,Ut,wt,Dt;class gd extends Fi{constructor(...n){super(...n);E(this,"FPS_SAMPLE_INTERVAL",1e4);S(this,Lt,0);S(this,Ge);S(this,He);S(this,Ve);S(this,bt,!1);S(this,Ut,!1);S(this,wt,"");S(this,Dt,[]);x(this,He,{}),x(this,Ve,this.deviceInfo()),x(this,Ge,this.config.gameVersion),this.on("state",({balance:o})=>{x(this,Lt,o)}),this.on("autoplay",({action:o})=>{["start","resume"].includes(o)?x(this,bt,!0):x(this,bt,!1)}),this.on("settings",({fastPlay:o})=>{o!==void 0&&x(this,Ut,o)}),this.registerEvents()}async registerEvents(){b(this,Ve).then(n=>{this.track("Device Information",n)}),this.on("loadStart",()=>{this.track("Game Loading",{progress:0,step:"initial"})}),this.on("loadProgress",n=>{this.track("Game Loading",{progress:n.progress})}),this.on("loadEnd",()=>{this.track("Game Loading",{progress:100,step:"complete"})}),this.on("error",n=>{this.track("System Message",{systemMessageText:n.messageCode,systemMessageType:n.type})}),this.on("openGameResponse",async n=>{x(this,wt,n.contract.stateType.nextRound),x(this,He,{balanceInCoins:n.contract.balance.coins,clientVersion:b(this,Ge),coinValueInCents:this.sdkConfig.api.coinValueInCents,coinValueInCentsFloat:this.sdkConfig.api.coinValueInCents,currency:this.sdkConfig.api.currency,defaultBaseBet:n.contract.bet.default.base,defaultBetMultiplier:n.contract.bet.default.multiplier,environment:"release",gameCode:this.sdkConfig.api.game,gameCodeServer:this.sdkConfig.api.game,gameModelFile:n.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:n.contract.metaData.version}),this.track("Game Open",b(this,He))}),this.on("playCycleEnd",async n=>{const o=await b(this,Ve),{base:i,multiplier:r}=n.contract.bet.lastPaid??{},s=n.contract.balance.coins,a=n.contract.bet.lastPaid.base*n.contract.bet.lastPaid.multiplier,c=n.contract.win.total,u=c-a,h="spin",y=n.contract.roundId;this.track("Betting Activity",{balance:s-u,balanceAfter:s,baseBet:i,betMultiplier:r,betType:h,gameVersion:b(this,Ge),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:o.isMobile,netResult:u,operatorName:"kalamba",orientation:bn(),partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,roundId:y,roundTypes:["BaseGame"],totalBet:a,totalWin:c}),x(this,Dt,[])}),this.on("telemetry.click",n=>{this.track("UI Interaction",{action:"click",...this.getExtraUiInteractionData(),...n})}),this.on("telemetry.orientationChange",()=>{this.track("UI Interaction",{action:"orientationChange",...this.getExtraUiInteractionData()})}),this.reportFpsSample(),this.reportFpsRound()}reportFpsSample(){const n=new Oo,o=()=>{n.stop();const r=n.getReport();this.track("FPS Performance",{...r,fpsType:"sample"}),i()},i=async()=>{n.start(),setTimeout(o,this.FPS_SAMPLE_INTERVAL)};i()}reportFpsRound(){const n=new Oo;this.on("playCycleStart",()=>{n.start()}),this.on("playCycleEnd",()=>{n.stop();const o=n.getReport();this.track("FPS Performance",{...o,fpsType:"playCycleStart->playCycleEnd"})})}getExtraUiInteractionData(){return{orientation:bn(),stateType:b(this,wt)}}async deviceInfo(){var a;const{browser:n,device:o,os:i}=se(navigator.userAgent),r=hd(),s=await pd();return{browserName:n.name,browserVersion:n.version,connection:(a=navigator.connection)==null?void 0:a.effectiveType,deviceName:o.model,deviceType:o.type,isMobile:["mobile","tablet"].includes(o.type??""),isWebGLSupported:r,isWebPSupported:s,manufacturer:o.vendor,operatingSystem:i.name,operatingSystemVersion:i.version,orientation:bn(),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}}}Lt=new WeakMap,Ge=new WeakMap,He=new WeakMap,Ve=new WeakMap,bt=new WeakMap,Ut=new WeakMap,wt=new WeakMap,Dt=new WeakMap;var md=Mn.requireNoop();const Zo=Mn.getDefaultExportFromCjs(md);class Dn{constructor(t,n){E(this,"config");E(this,"sdkConfig");this.config=t,this.sdkConfig=n}}const No=25,Ro=1e4;var We,qe,Ke,be;class fd extends Dn{constructor(...n){super(...n);S(this,We,"https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");S(this,qe);S(this,Ke);S(this,be,[]);E(this,"processQueueForced");x(this,qe,new Date().getTime()),x(this,be,[]),this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(b(this,We),{method:"OPTIONS"}).catch(Zo),this.subscribe()}subscribe(){window.addEventListener("beforeunload",this.processQueueForced,!1),window.addEventListener("pagehide",this.processQueueForced,!1),window.addEventListener("visibilitychange",this.processQueueForced,!1)}schedule(){b(this,Ke)&&clearTimeout(b(this,Ke)),x(this,Ke,window.setTimeout(()=>this.processQueue(),Ro))}send(n){x(this,qe,new Date().getTime());try{navigator.sendBeacon(b(this,We),JSON.stringify(n))}catch{fetch(b(this,We),{body:JSON.stringify(n),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(Zo)}this.schedule()}addToQueue(n){b(this,be).push(n),this.processQueue()}processQueue(n=!1){if(!(this.sdkConfig==null||!this.sdkConfig.ui.feature.allowTelemetry)&&!(!n&&b(this,be).length<No&&new Date().getTime()-b(this,qe)<Ro))for(;b(this,be).length;){const o=b(this,be).splice(0,No).map(i=>({...i,sessionID:this.sdkConfig.api.sessionId,userID:this.sdkConfig.api.user}));this.send(o)}}track(n,o){this.addToQueue({eventName:n,eventParams:o,eventTimestamp:new Date().getTime(),eventUUID:Mn.v4()})}}We=new WeakMap,qe=new WeakMap,Ke=new WeakMap,be=new WeakMap;const bd=J("LoggingTracker","color:#000000;font-weight:bold;");class wd extends Dn{track(t,n){bd(`@${this.sdkConfig.api.user}`,`[${t}]`,n)}}exports.BasicPlugin=Bi;exports.CasinoPlugin=ee;exports.DebuggingPlugin=zu;exports.EveryMatrixPlugin=Lu;exports.GigPlugin=Iu;exports.KalambaBullseyeParsers=id;exports.KalambaBullseyePlugin=cd;exports.KalambaStargazerPlugin=gd;exports.KalambaStargazerTracker=fd;exports.LoggingTracker=wd;exports.OryxPlugin=Tu;exports.PariplayPlugin=Ou;exports.QuantaPlugin=Ru;exports.RelaxFEIMPlugin=Zu;exports.RgsPlugin=Ai;exports.SoftSwissPlugin=Fu;exports.TelemetryPlugin=Fi;exports.Tracker=Dn;exports.TukoPlugin=Nu;