@kalamba/sdk 0.30.0 → 0.35.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
@@ -1,28 +1,28 @@
1
1
  /**
2
2
  * BSD 3-Clause License
3
- * Copyright (c) 2025, Kalamba Games Limited
3
+ * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
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 => ({
5
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const tt=require("./encoders-C-jSxC0Z.cjs"),Ee=require("./errors-BZBs3Z5K.cjs"),Ht=require("./v4-BIWLDecr.cjs");function U(e,t){return(n,...o)=>{console.log(`[%c${e}\x1B[m] %s`,t,n,...o)}}function to(e,t){return Math.round(e*100/t)}class B{config;sdkConfig;state;i18n;injectPayload;constructor(t,n,o,i){this.config=t,this.sdkConfig=n,this.state=o,this.i18n=new tt.I18n({config:n}),this.injectPayload=i}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 Uo=U("BasicPlugin","color:#000000;font-weight:bold;");class Lo extends B{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Uo("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:n,payload:o}=t.data;switch(n){case"doAudioSettings":this.send("settings",{music:o?.musicEnabled,sounds:o?.soundEnabled});return;case"doBalanceUpdate":const{currency:i,coinValueInCents:r}=this.sdkConfig.api;o?.currency===i&&typeof o?.balanceInCurrency=="number"?this.send("balance",{balance:to(o.balanceInCurrency,r)}):typeof o?.balanceInCoins=="number"?this.send("balance",{balance:o.balanceInCoins}):this.send("getBalance");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 rn=e=>{let t;const n=new Set,o=(u,f)=>{const b=typeof u=="function"?u(t):u;if(!Object.is(b,t)){const v=t;t=f??(typeof b!="object"||b===null)?b:Object.assign({},t,b),n.forEach(k=>k(t,v))}},i=()=>t,a={setState:o,getState:i,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=t=e(o,i,a);return a},Do=e=>e?rn(e):rn,Bo={},jo=({onSwitchPlayMode:e})=>Do(()=>({...Bo,switchPlayMode:e})),A=U("BspotPlugin","color:#000000;font-weight:bold;");class Vt extends B{#o="current";static store;#e;#t;#i;#n;constructor(...t){super(...t);const n=new URLSearchParams(window.location.search);this.#i=n.get("bspotEnv")||"prod",this.#e=this.#d(),Vt.store=jo({onSwitchPlayMode:()=>this.#l()}),this.#c(),this.registerFromSdkEvents(),A("configured")}#c(){this.send("translations",{UI:{Balance:"CREDITS"}})}#s(){const o=this.#i==="prod"?"bspot.com":"sb.bspot.com";return`https://games.kl.luckycdn.net/games/static/assets/${this.sdkConfig.api.game.replace(/-eo(v2)?$/,"")}/metadata/${o}/`}async#r(){(await this.#e).getBalances()}async#a(){await new Promise(t=>{this.#t=t}),A("handleReconnect"),this.#r(),this.#a()}async#l(){A("switchPlayMode");const t=await this.#e,n=this.sdkConfig.api.playMode==="REAL",o=!!t._token;if(!n&&!o){t.login();return}const i=new URL(t.config().urls.redirect);i.searchParams.set("demo",String(n)),i.searchParams.set("bspotEnv",this.#i),t._token&&i.searchParams.set("jwt",t._token),i.hash=window.location.hash,window.location.href=i.toString()}#u(t,n){return A("processActiveTokens",{tokens:n}),n.reduce((o,i,r)=>o.then(()=>new Promise(s=>{const a=this.i18n.formatMoneyWithCurrency(i.denomination),c=this.i18n.formatMoneyWithCurrency(i.value),u=this.state.lastPlayResponse?.stateType.thisRound==="PaidSpin",f=`We found a game you may not have finished. You have ${a} in play, press continue to finish playing.`,b=`We found a game you may not have finished. You had ${a} in play, but there were no winnings to reveal this time.`,v=`We found a game you may not have finished. You had ${a} in play, and won ${c}! Congratulations!`,C={buttons:[{action:"CONTINUE",link:"",linkType:"",onRelease:()=>{t.revealToken(i.id,this.config.gameName),s()},text:"Continue"}],messageType:"NOTIFICATION",text:u?+i.value==0?b:v:f,title:n.length>1?`Unfinished Game #${r+1} of ${n.length}`:"Unfinished Game"};A("Incomplete game found",C),s()}).catch(()=>{})),Promise.resolve()).catch(()=>{})}async#d(){const t=`https://sdk.bspot.com/javascript/v1/bspot-sdk-${this.#o}.min.js`,n=document.createElement("script");n.src=t;const o=new Promise(r=>{this.#t=r}),i=new Promise(r=>{n.onload=()=>r()}).then(()=>o).then(()=>(this.#a(),new Promise(r=>{if(!window.bspot)throw new Error("Bspot SDK not loaded");const s=this.sdkConfig.api.playMode==="REAL"?{authenticated:()=>{A("authenticated"),a.getBalances(c=>{const u=this.sdkConfig.api.coinValueInCents,f=parseFloat(c.availableGameplayBalance)*100/u;this.send("balance",{balance:f}),a.getActiveTokens(b=>{this.#u(a,b)}),this.#r()})},balancesUpdated:c=>{A("balancesUpdated",{balances:c})},context:this.#s(),deposited:()=>{A("deposited"),a.getBalances()},errored:c=>{A("errored",{errorMessage:c})},tokenRevealed:c=>{A("tokenRevealed",{balances:c})},unauthenticated:()=>{A("unauthenticated"),a.login()},wagered:c=>{A("wagered",{balances:c})}}:{context:this.#s()},a=new window.bspot.Api(s);a.initialize(),r(a),A("API initialized",{api:a})})));return document.head.appendChild(n),i}registerFromSdkEvents(){this.on("openGameResponse",()=>{this.#t?.()}),this.on("close",()=>{this.#e.then(t=>{window.location.href=t.domain})}),this.on("playEnd",t=>{if(A("playEnd",t),this.sdkConfig.api.playMode==="REAL")try{const n=t.roundResult?.winnings?.nonReelGridResults?.filter(o=>o.Triggers?.some(i=>i.name==="HHRBonusWin"))?.map(o=>o.Win)?.reduce((o,i)=>o+i,0)||0;n>0&&A("Bonus win",`Congratulations! You've been awarded a bonus win of ${this.i18n.formatCoinsWithCurrency(n)}`)}catch(n){A("error processing bonus win",n)}}),this.on("playError",t=>{A("playError",t)}),this.on("playCycleEnd",async t=>{A("playCycleEnd",t),(await this.#e).revealToken(this.#n.id,this.config.gameName)}),this.injectPayload("bspot",async t=>{if(this.sdkConfig.api.playMode!=="REAL")return{};if((this.state.lastPlayResponse?.stateType.thisRound??"PaidSpin")!=="PaidSpin"||t.bet==null)return{};const o=await this.#e,i=1,r=this.i18n.formatCoins(t.bet.base*t.bet.multiplier),s="TOKENA",a=10,c=new window.bspot.PlayToken(i,r,s,a),f=(await new Promise(v=>{o.startPlay(c,v)}))[0];return this.#n=f,A("startPlay result",{token:f}),{integrationSpecificData:JSON.stringify(Object.assign({winAmount:f.value}))}}),this.on("cashier",t=>{A("cashier",t),t.type==="ON_DEMAND"&&this.#e.then(n=>{n.wager()})})}}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 f in s.prototype)f in a||Object.defineProperty(a,f,{value:s.prototype[f].bind(a)});a._zod.constr=s,a._zod.def=c}const i=n?.Parent??Object;class r extends i{}Object.defineProperty(r,"name",{value:e});function s(a){var c;const u=n?.Parent?new r:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class _e extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class no extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const oo={};function re(e){return oo}function Go(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 Zt(e,t){return typeof t=="bigint"?t.toString():t}function Wt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function qt(e){return e==null}function Kt(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Ho(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?.[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 an=Symbol("evaluating");function x(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==an)return o===void 0&&(o=an,o=n()),o},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function me(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fe(...e){const t={};for(const n of e){const o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function cn(e){return JSON.stringify(e)}const io="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ot(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Vo=Wt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Se(e){if(ot(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(ot(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function so(e){return Se(e)?{...e}:Array.isArray(e)?[...e]:e}const Wo=new Set(["string","number","symbol"]);function dt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ue(e,t,n){const o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function w(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(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 qo(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Ko={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 Jo(e,t){const n=e._zod.def,o=fe(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 me(this,"shape",i),i},checks:[]});return ue(e,o)}function Xo(e,t){const n=e._zod.def,o=fe(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 me(this,"shape",i),i},checks:[]});return ue(e,o)}function Yo(e,t){if(!Se(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=fe(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return me(this,"shape",r),r},checks:[]});return ue(e,i)}function Qo(e,t){if(!Se(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 me(this,"shape",o),o},checks:e._zod.def.checks};return ue(e,n)}function ei(e,t){const n=fe(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return me(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return ue(e,n)}function ti(e,t,n){const o=fe(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 me(this,"shape",r),r},checks:[]});return ue(t,o)}function ni(e,t,n){const o=fe(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 me(this,"shape",r),r},checks:[]});return ue(t,o)}function ye(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ke(e,t){return t.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Ve(e){return typeof e=="string"?e:e?.message}function ae(e,t,n){const o={...e,path:e.path??[]};if(!e.message){const i=Ve(e.inst?._zod.def?.error?.(e))??Ve(t?.error?.(e))??Ve(n.customError?.(e))??Ve(n.localeError?.(e))??"Invalid input";o.message=i}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function Jt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Be(...e){const[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}const ro=(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,Zt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ao=l("$ZodError",ro),co=l("$ZodError",ro,{Parent:Error});function oi(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 ii(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 Xt=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 _e;if(s.issues.length){const a=new(i?.Err??e)(s.issues.map(c=>ae(c,r,re())));throw io(a,i?.callee),a}return s.value},Yt=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?.Err??e)(s.issues.map(c=>ae(c,r,re())));throw io(a,i?.callee),a}return s.value},lt=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 _e;return r.issues.length?{success:!1,error:new(e??ao)(r.issues.map(s=>ae(s,i,re())))}:{success:!0,data:r.value}},si=lt(co),pt=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=>ae(s,i,re())))}:{success:!0,data:r.value}},ri=pt(co),ai=e=>(t,n,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Xt(e)(t,n,i)},ci=e=>(t,n,o)=>Xt(e)(t,n,o),ui=e=>async(t,n,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Yt(e)(t,n,i)},di=e=>async(t,n,o)=>Yt(e)(t,n,o),li=e=>(t,n,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return lt(e)(t,n,i)},pi=e=>(t,n,o)=>lt(e)(t,n,o),hi=e=>async(t,n,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return pt(e)(t,n,i)},gi=e=>async(t,n,o)=>pt(e)(t,n,o),mi=/^[cC][^\s-]{8,}$/,fi=/^[0-9a-z]+$/,bi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wi=/^[0-9a-vA-V]{20}$/,vi=/^[A-Za-z0-9]{27}$/,yi=/^[a-zA-Z0-9_-]{21}$/,ki=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ei=/^([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})$/,un=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)$/,_i=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ci="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function xi(){return new RegExp(Ci,"u")}const Si=/^(?:(?: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])$/,Ii=/^(([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}|:))$/,zi=/^((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])$/,Ti=/^(([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])$/,Mi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,uo=/^[A-Za-z0-9_-]*$/,Ai=/^(?=.{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])?)*\.?$/,Pi=/^\+(?:[0-9]){6,14}[0-9]$/,lo="(?:(?:\\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])))",Oi=new RegExp(`^${lo}$`);function po(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 $i(e){return new RegExp(`^${po(e)}$`)}function Ri(e){const t=po({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(`^${lo}T(?:${o})$`)}const Ni=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Zi=/^-?\d+$/,Fi=/^-?\d+(?:\.\d+)?/,Ui=/^(?:true|false)$/i,Li=/^null$/i,Di=/^undefined$/i,Bi=/^[^A-Z]*$/,ji=/^[^a-z]*$/,Z=l("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ho={number:"number",bigint:"bigint",object:"date"},go=l("$ZodCheckLessThan",(e,t)=>{Z.init(e,t);const n=ho[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})}}),mo=l("$ZodCheckGreaterThan",(e,t)=>{Z.init(e,t);const n=ho[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})}}),Gi=l("$ZodCheckMultipleOf",(e,t)=>{Z.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):Ho(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})}}),Hi=l("$ZodCheckNumberFormat",(e,t)=>{Z.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),o=n?"int":"number",[i,r]=Ko[t.format];e._zod.onattach.push(s=>{const a=s._zod.bag;a.format=t.format,a.minimum=i,a.maximum=r,n&&(a.pattern=Zi)}),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):s.issues.push({input:a,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}}a<i&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>r&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inst:e})}}),Vi=l("$ZodCheckMaxLength",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=o=>{const i=o.value;return!qt(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=Jt(i);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Wi=l("$ZodCheckMinLength",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=o=>{const i=o.value;return!qt(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=Jt(i);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),qi=l("$ZodCheckLengthEquals",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=o=>{const i=o.value;return!qt(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=Jt(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;Z.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=()=>{})}),Ki=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})}}),Ji=l("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Bi),ht.init(e,t)}),Xi=l("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ji),ht.init(e,t)}),Yi=l("$ZodCheckIncludes",(e,t)=>{Z.init(e,t);const n=dt(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})}}),Qi=l("$ZodCheckStartsWith",(e,t)=>{Z.init(e,t);const n=new RegExp(`^${dt(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})}}),es=l("$ZodCheckEndsWith",(e,t)=>{Z.init(e,t);const n=new RegExp(`.*${dt(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})}}),ts=l("$ZodCheckOverwrite",(e,t)=>{Z.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class ns{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?.args,i=[...(this?.content??[""]).map(r=>` ${r}`)];return new t(...n,i.join(`
7
+ `))}}const os={major:4,minor:1,patch:12},I=l("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=os;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const i of o)for(const r of i._zod.onattach)r(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(s,a,c)=>{let u=ye(s),f;for(const b of a){if(b._zod.def.when){if(!b._zod.def.when(s))continue}else if(u)continue;const v=s.issues.length,k=b._zod.check(s);if(k instanceof Promise&&c?.async===!1)throw new _e;if(f||k instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await k,s.issues.length!==v&&(u||(u=ye(s,v)))});else{if(s.issues.length===v)continue;u||(u=ye(s,v))}}return f?f.then(()=>s):s},r=(s,a,c)=>{if(ye(s))return s.aborted=!0,s;const u=i(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new _e;return u.then(f=>e._zod.parse(f,c))}return e._zod.parse(u,c)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){const u=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(f=>r(f,s,a)):r(u,s,a)}const c=e._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new _e;return c.then(u=>i(u,o,a))}return i(c,o,a)}}e["~standard"]={validate:i=>{try{const r=si(e,i);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return ri(e,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),Qt=l("$ZodString",(e,t)=>{I.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ni(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),z=l("$ZodStringFormat",(e,t)=>{ht.init(e,t),Qt.init(e,t)}),is=l("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ei),z.init(e,t)}),ss=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=un(o))}else t.pattern??(t.pattern=un());z.init(e,t)}),rs=l("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=_i),z.init(e,t)}),as=l("$ZodURL",(e,t)=>{z.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:Ai.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})}}}),cs=l("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=xi()),z.init(e,t)}),us=l("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=yi),z.init(e,t)}),ds=l("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=mi),z.init(e,t)}),ls=l("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=fi),z.init(e,t)}),ps=l("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bi),z.init(e,t)}),hs=l("$ZodXID",(e,t)=>{t.pattern??(t.pattern=wi),z.init(e,t)}),gs=l("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=vi),z.init(e,t)}),ms=l("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ri(t)),z.init(e,t)}),fs=l("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Oi),z.init(e,t)}),bs=l("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=$i(t)),z.init(e,t)}),ws=l("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ki),z.init(e,t)}),vs=l("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Si),z.init(e,t),e._zod.onattach.push(n=>{const o=n._zod.bag;o.format="ipv4"})}),ys=l("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ii),z.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})}}}),ks=l("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=zi),z.init(e,t)}),Es=l("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ti),z.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 fo(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=Mi),z.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{fo(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Cs(e){if(!uo.test(e))return!1;const t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return fo(n)}const xs=l("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=uo),z.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{Cs(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Ss=l("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Pi),z.init(e,t)});function Is(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?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const zs=l("$ZodJWT",(e,t)=>{z.init(e,t),e._zod.check=n=>{Is(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),bo=l("$ZodNumber",(e,t)=>{I.init(e,t),e._zod.pattern=e._zod.bag.pattern??Fi,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}}),Ts=l("$ZodNumber",(e,t)=>{Hi.init(e,t),bo.init(e,t)}),Ms=l("$ZodBoolean",(e,t)=>{I.init(e,t),e._zod.pattern=Ui,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}}),As=l("$ZodUndefined",(e,t)=>{I.init(e,t),e._zod.pattern=Di,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}}),Ps=l("$ZodNull",(e,t)=>{I.init(e,t),e._zod.pattern=Li,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}}),Os=l("$ZodAny",(e,t)=>{I.init(e,t),e._zod.parse=n=>n}),$s=l("$ZodUnknown",(e,t)=>{I.init(e,t),e._zod.parse=n=>n}),Rs=l("$ZodNever",(e,t)=>{I.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function dn(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues)),t.value[n]=e.value}const Ns=l("$ZodArray",(e,t)=>{I.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=>dn(u,n,s))):dn(c,n,s)}return r.length?Promise.all(r).then(()=>n):n}});function it(e,t,n,o){e.issues.length&&t.issues.push(...ke(n,e.issues)),e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}function wo(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const n=qo(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function vo(e,t,n,o,i,r){const s=[],a=i.keySet,c=i.catchall._zod,u=c.def.type;for(const f of Object.keys(t)){if(a.has(f))continue;if(u==="never"){s.push(f);continue}const b=c.run({value:t[f],issues:[]},o);b instanceof Promise?e.push(b.then(v=>it(v,n,f,t))):it(b,n,f,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 Zs=l("$ZodObject",(e,t)=>{if(I.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const o=Wt(()=>wo(t));x(e._zod,"propValues",()=>{const a=t.shape,c={};for(const u in a){const f=a[u]._zod;if(f.values){c[u]??(c[u]=new Set);for(const b of f.values)c[u].add(b)}}return c});const i=ot,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 f=[],b=s.shape;for(const v of s.keys){const C=b[v]._zod.run({value:u[v],issues:[]},c);C instanceof Promise?f.push(C.then(F=>it(F,a,v,u))):it(C,a,v,u)}return r?vo(f,u,a,c,o.value,e):f.length?Promise.all(f).then(()=>a):a}}),Fs=l("$ZodObjectJIT",(e,t)=>{Zs.init(e,t);const n=e._zod.parse,o=Wt(()=>wo(t)),i=v=>{const k=new ns(["shape","payload","ctx"]),C=o.value,F=H=>{const W=cn(H);return`shape[${W}]._zod.run({ value: input[${W}], issues: [] }, ctx)`};k.write("const input = payload.value;");const L=Object.create(null);let G=0;for(const H of C.keys)L[H]=`key_${G++}`;k.write("const newResult = {};");for(const H of C.keys){const W=L[H],Ae=cn(H);k.write(`const ${W} = ${F(H)};`),k.write(`
8
+ if (${W}.issues.length) {
9
+ payload.issues = payload.issues.concat(${W}.issues.map(iss => ({
10
10
  ...iss,
11
- path: iss.path ? [${tt}, ...iss.path] : [${tt}]
11
+ path: iss.path ? [${Ae}, ...iss.path] : [${Ae}]
12
12
  })));
13
13
  }
14
14
 
15
15
 
16
- if (${U}.value === undefined) {
17
- if (${tt} in input) {
18
- newResult[${tt}] = undefined;
16
+ if (${W}.value === undefined) {
17
+ if (${Ae} in input) {
18
+ newResult[${Ae}] = undefined;
19
19
  }
20
20
  } else {
21
- newResult[${tt}] = ${U}.value;
21
+ newResult[${Ae}] = ${W}.value;
22
22
  }
23
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=`
24
+ `)}k.write("payload.value = newResult;"),k.write("return payload;");const le=k.compile();return(H,W)=>le(v,H,W)};let r;const s=ot,a=!oo.jitless,u=a&&Vo.value,f=t.catchall;let b;e._zod.parse=(v,k)=>{b??(b=o.value);const C=v.value;return s(C)?a&&u&&k?.async===!1&&k.jitless!==!0?(r||(r=i(t.shape)),v=r(v,k),f?vo([],C,v,k,b,e):v):n(v,k):(v.issues.push({expected:"object",code:"invalid_type",input:C,inst:e}),v)}});function ln(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=>!ye(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=>ae(s,o,re())))}),t)}const Us=l("$ZodUnion",(e,t)=>{I.init(e,t),x(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),x(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),x(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),x(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=>Kt(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=>ln(c,i,e,r)):ln(a,i,e,r)}}),Ls=l("$ZodIntersection",(e,t)=>{I.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])=>pn(n,c,u)):pn(n,r,s)}});function Ft(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(Se(e)&&Se(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=Ft(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=Ft(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 pn(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),ye(e))return e;const o=Ft(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 Ds=l("$ZodRecord",(e,t)=>{I.init(e,t),e._zod.parse=(n,o)=>{const i=n.value;if(!Se(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(f=>{f.issues.length&&n.issues.push(...ke(c,f.issues)),n.value[c]=f.value})):(u.issues.length&&n.issues.push(...ke(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=>ae(u,o,re())),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(...ke(s,u.issues)),n.value[a.value]=u.value})):(c.issues.length&&n.issues.push(...ke(s,c.issues)),n.value[a.value]=c.value)}}return r.length?Promise.all(r).then(()=>n):n}}),Bs=l("$ZodEnum",(e,t)=>{I.init(e,t);const n=Go(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter(i=>Wo.has(typeof i)).map(i=>typeof i=="string"?dt(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}}),js=l("$ZodTransform",(e,t)=>{I.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new no(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 _e;return n.value=i,n}});function hn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Gs=l("$ZodOptional",(e,t)=>{I.init(e,t),e._zod.optin="optional",e._zod.optout="optional",x(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),x(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Kt(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=>hn(r,n.value)):hn(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,o)}}),Hs=l("$ZodNullable",(e,t)=>{I.init(e,t),x(e._zod,"optin",()=>t.innerType._zod.optin),x(e._zod,"optout",()=>t.innerType._zod.optout),x(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Kt(n.source)}|null)$`):void 0}),x(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)}),Vs=l("$ZodDefault",(e,t)=>{I.init(e,t),e._zod.optin="optional",x(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=>gn(r,t)):gn(i,t)}});function gn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ws=l("$ZodPrefault",(e,t)=>{I.init(e,t),e._zod.optin="optional",x(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))}),qs=l("$ZodNonOptional",(e,t)=>{I.init(e,t),x(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=>mn(r,e)):mn(i,e)}});function mn(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 Ks=l("$ZodCatch",(e,t)=>{I.init(e,t),x(e._zod,"optin",()=>t.innerType._zod.optin),x(e._zod,"optout",()=>t.innerType._zod.optout),x(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=>ae(s,o,re()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(r=>ae(r,o,re()))},input:n.value}),n.issues=[]),n)}}),Js=l("$ZodPipe",(e,t)=>{I.init(e,t),x(e._zod,"values",()=>t.in._zod.values),x(e._zod,"optin",()=>t.in._zod.optin),x(e._zod,"optout",()=>t.out._zod.optout),x(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=>We(s,t.in,o)):We(r,t.in,o)}const i=t.in._zod.run(n,o);return i instanceof Promise?i.then(r=>We(r,t.out,o)):We(i,t.out,o)}});function We(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)=>{I.init(e,t),x(e._zod,"propValues",()=>t.innerType._zod.propValues),x(e._zod,"values",()=>t.innerType._zod.values),x(e._zod,"optin",()=>t.innerType._zod.optin),x(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(fn):fn(i)}});function fn(e){return e.value=Object.freeze(e.value),e}const Ys=l("$ZodCustom",(e,t)=>{Z.init(e,t),I.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=>bn(r,n,o,e));bn(i,n,o,e)}});function bn(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(Be(i))}}class Qs{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 er(){return new Qs}const qe=er();function tr(e,t){return new e({type:"string",...w(t)})}function nr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...w(t)})}function wn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...w(t)})}function or(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...w(t)})}function ir(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...w(t)})}function sr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...w(t)})}function rr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...w(t)})}function ar(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...w(t)})}function cr(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...w(t)})}function ur(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...w(t)})}function dr(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...w(t)})}function lr(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...w(t)})}function pr(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...w(t)})}function hr(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...w(t)})}function gr(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...w(t)})}function mr(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...w(t)})}function fr(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...w(t)})}function br(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...w(t)})}function wr(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...w(t)})}function vr(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...w(t)})}function yr(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...w(t)})}function kr(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...w(t)})}function Er(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...w(t)})}function _r(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...w(t)})}function Cr(e,t){return new e({type:"string",format:"date",check:"string_format",...w(t)})}function xr(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...w(t)})}function Sr(e,t){return new e({type:"string",format:"duration",check:"string_format",...w(t)})}function Ir(e,t){return new e({type:"number",checks:[],...w(t)})}function zr(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...w(t)})}function Tr(e,t){return new e({type:"boolean",...w(t)})}function Mr(e,t){return new e({type:"undefined",...w(t)})}function Ar(e,t){return new e({type:"null",...w(t)})}function Pr(e){return new e({type:"any"})}function Or(e){return new e({type:"unknown"})}function $r(e,t){return new e({type:"never",...w(t)})}function vn(e,t){return new go({check:"less_than",...w(t),value:e,inclusive:!1})}function ft(e,t){return new go({check:"less_than",...w(t),value:e,inclusive:!0})}function yn(e,t){return new mo({check:"greater_than",...w(t),value:e,inclusive:!1})}function bt(e,t){return new mo({check:"greater_than",...w(t),value:e,inclusive:!0})}function kn(e,t){return new Gi({check:"multiple_of",...w(t),value:e})}function yo(e,t){return new Vi({check:"max_length",...w(t),maximum:e})}function st(e,t){return new Wi({check:"min_length",...w(t),minimum:e})}function ko(e,t){return new qi({check:"length_equals",...w(t),length:e})}function Rr(e,t){return new Ki({check:"string_format",format:"regex",...w(t),pattern:e})}function Nr(e){return new Ji({check:"string_format",format:"lowercase",...w(e)})}function Zr(e){return new Xi({check:"string_format",format:"uppercase",...w(e)})}function Fr(e,t){return new Yi({check:"string_format",format:"includes",...w(t),includes:e})}function Ur(e,t){return new Qi({check:"string_format",format:"starts_with",...w(t),prefix:e})}function Lr(e,t){return new es({check:"string_format",format:"ends_with",...w(t),suffix:e})}function Ge(e){return new ts({check:"overwrite",tx:e})}function Dr(e){return Ge(t=>t.normalize(e))}function Br(){return Ge(e=>e.trim())}function jr(){return Ge(e=>e.toLowerCase())}function Gr(){return Ge(e=>e.toUpperCase())}function Hr(e,t,n){return new e({type:"array",element:t,...w(n)})}function Vr(e,t,n){return new e({type:"custom",check:"custom",fn:t,...w(n)})}function Wr(e){const t=qr(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Be(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(Be(i))}},e(n.value,n)));return t}function qr(e,t){const n=new Z({check:"custom",...w(t)});return n._zod.check=e,n}const Kr=l("ZodISODateTime",(e,t)=>{ms.init(e,t),M.init(e,t)});function Jr(e){return _r(Kr,e)}const Xr=l("ZodISODate",(e,t)=>{fs.init(e,t),M.init(e,t)});function Yr(e){return Cr(Xr,e)}const Qr=l("ZodISOTime",(e,t)=>{bs.init(e,t),M.init(e,t)});function ea(e){return xr(Qr,e)}const ta=l("ZodISODuration",(e,t)=>{ws.init(e,t),M.init(e,t)});function na(e){return Sr(ta,e)}const oa=(e,t)=>{ao.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>ii(e,n)},flatten:{value:n=>oi(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Zt,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Zt,2)}},isEmpty:{get(){return e.issues.length===0}}})},j=l("ZodError",oa,{Parent:Error}),ia=Xt(j),sa=Yt(j),ra=lt(j),aa=pt(j),ca=ai(j),ua=ci(j),da=ui(j),la=di(j),pa=li(j),ha=pi(j),ga=hi(j),ma=gi(j),T=l("ZodType",(e,t)=>(I.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(fe(t,{checks:[...t.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]})),e.clone=(n,o)=>ue(e,n,o),e.brand=()=>e,e.register=(n,o)=>(n.add(e,o),e),e.parse=(n,o)=>ia(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>ra(e,n,o),e.parseAsync=async(n,o)=>sa(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>aa(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>ca(e,n,o),e.decode=(n,o)=>ua(e,n,o),e.encodeAsync=async(n,o)=>da(e,n,o),e.decodeAsync=async(n,o)=>la(e,n,o),e.safeEncode=(n,o)=>pa(e,n,o),e.safeDecode=(n,o)=>ha(e,n,o),e.safeEncodeAsync=async(n,o)=>ga(e,n,o),e.safeDecodeAsync=async(n,o)=>ma(e,n,o),e.refine=(n,o)=>e.check(lc(n,o)),e.superRefine=n=>e.check(pc(n)),e.overwrite=n=>e.check(Ge(n)),e.optional=()=>xn(e),e.nullable=()=>Sn(e),e.nullish=()=>xn(Sn(e)),e.nonoptional=n=>ic(e,n),e.array=()=>Q(e),e.or=n=>en([e,n]),e.and=n=>qa(e,n),e.transform=n=>In(e,Ya(n)),e.default=n=>tc(e,n),e.prefault=n=>oc(e,n),e.catch=n=>rc(e,n),e.pipe=n=>In(e,n),e.readonly=()=>uc(e),e.describe=n=>{const o=e.clone();return qe.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return qe.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return qe.get(e);const o=e.clone();return qe.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Eo=l("_ZodString",(e,t)=>{Qt.init(e,t),T.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(Rr(...o)),e.includes=(...o)=>e.check(Fr(...o)),e.startsWith=(...o)=>e.check(Ur(...o)),e.endsWith=(...o)=>e.check(Lr(...o)),e.min=(...o)=>e.check(st(...o)),e.max=(...o)=>e.check(yo(...o)),e.length=(...o)=>e.check(ko(...o)),e.nonempty=(...o)=>e.check(st(1,...o)),e.lowercase=o=>e.check(Nr(o)),e.uppercase=o=>e.check(Zr(o)),e.trim=()=>e.check(Br()),e.normalize=(...o)=>e.check(Dr(...o)),e.toLowerCase=()=>e.check(jr()),e.toUpperCase=()=>e.check(Gr())}),fa=l("ZodString",(e,t)=>{Qt.init(e,t),Eo.init(e,t),e.email=n=>e.check(nr(ba,n)),e.url=n=>e.check(ar(wa,n)),e.jwt=n=>e.check(Er(Oa,n)),e.emoji=n=>e.check(cr(va,n)),e.guid=n=>e.check(wn(En,n)),e.uuid=n=>e.check(or(Ke,n)),e.uuidv4=n=>e.check(ir(Ke,n)),e.uuidv6=n=>e.check(sr(Ke,n)),e.uuidv7=n=>e.check(rr(Ke,n)),e.nanoid=n=>e.check(ur(ya,n)),e.guid=n=>e.check(wn(En,n)),e.cuid=n=>e.check(dr(ka,n)),e.cuid2=n=>e.check(lr(Ea,n)),e.ulid=n=>e.check(pr(_a,n)),e.base64=n=>e.check(vr(Ma,n)),e.base64url=n=>e.check(yr(Aa,n)),e.xid=n=>e.check(hr(Ca,n)),e.ksuid=n=>e.check(gr(xa,n)),e.ipv4=n=>e.check(mr(Sa,n)),e.ipv6=n=>e.check(fr(Ia,n)),e.cidrv4=n=>e.check(br(za,n)),e.cidrv6=n=>e.check(wr(Ta,n)),e.e164=n=>e.check(kr(Pa,n)),e.datetime=n=>e.check(Jr(n)),e.date=n=>e.check(Yr(n)),e.time=n=>e.check(ea(n)),e.duration=n=>e.check(na(n))});function O(e){return tr(fa,e)}const M=l("ZodStringFormat",(e,t)=>{z.init(e,t),Eo.init(e,t)}),ba=l("ZodEmail",(e,t)=>{rs.init(e,t),M.init(e,t)}),En=l("ZodGUID",(e,t)=>{is.init(e,t),M.init(e,t)}),Ke=l("ZodUUID",(e,t)=>{ss.init(e,t),M.init(e,t)}),wa=l("ZodURL",(e,t)=>{as.init(e,t),M.init(e,t)}),va=l("ZodEmoji",(e,t)=>{cs.init(e,t),M.init(e,t)}),ya=l("ZodNanoID",(e,t)=>{us.init(e,t),M.init(e,t)}),ka=l("ZodCUID",(e,t)=>{ds.init(e,t),M.init(e,t)}),Ea=l("ZodCUID2",(e,t)=>{ls.init(e,t),M.init(e,t)}),_a=l("ZodULID",(e,t)=>{ps.init(e,t),M.init(e,t)}),Ca=l("ZodXID",(e,t)=>{hs.init(e,t),M.init(e,t)}),xa=l("ZodKSUID",(e,t)=>{gs.init(e,t),M.init(e,t)}),Sa=l("ZodIPv4",(e,t)=>{vs.init(e,t),M.init(e,t)}),Ia=l("ZodIPv6",(e,t)=>{ys.init(e,t),M.init(e,t)}),za=l("ZodCIDRv4",(e,t)=>{ks.init(e,t),M.init(e,t)}),Ta=l("ZodCIDRv6",(e,t)=>{Es.init(e,t),M.init(e,t)}),Ma=l("ZodBase64",(e,t)=>{_s.init(e,t),M.init(e,t)}),Aa=l("ZodBase64URL",(e,t)=>{xs.init(e,t),M.init(e,t)}),Pa=l("ZodE164",(e,t)=>{Ss.init(e,t),M.init(e,t)}),Oa=l("ZodJWT",(e,t)=>{zs.init(e,t),M.init(e,t)}),_o=l("ZodNumber",(e,t)=>{bo.init(e,t),T.init(e,t),e.gt=(o,i)=>e.check(yn(o,i)),e.gte=(o,i)=>e.check(bt(o,i)),e.min=(o,i)=>e.check(bt(o,i)),e.lt=(o,i)=>e.check(vn(o,i)),e.lte=(o,i)=>e.check(ft(o,i)),e.max=(o,i)=>e.check(ft(o,i)),e.int=o=>e.check(_n(o)),e.safe=o=>e.check(_n(o)),e.positive=o=>e.check(yn(0,o)),e.nonnegative=o=>e.check(bt(0,o)),e.negative=o=>e.check(vn(0,o)),e.nonpositive=o=>e.check(ft(0,o)),e.multipleOf=(o,i)=>e.check(kn(o,i)),e.step=(o,i)=>e.check(kn(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 S(e){return Ir(_o,e)}const $a=l("ZodNumberFormat",(e,t)=>{Ts.init(e,t),_o.init(e,t)});function _n(e){return zr($a,e)}const Ra=l("ZodBoolean",(e,t)=>{Ms.init(e,t),T.init(e,t)});function X(e){return Tr(Ra,e)}const Na=l("ZodUndefined",(e,t)=>{As.init(e,t),T.init(e,t)});function Za(e){return Mr(Na,e)}const Fa=l("ZodNull",(e,t)=>{Ps.init(e,t),T.init(e,t)});function Ua(e){return Ar(Fa,e)}const La=l("ZodAny",(e,t)=>{Os.init(e,t),T.init(e,t)});function Cn(){return Pr(La)}const Da=l("ZodUnknown",(e,t)=>{$s.init(e,t),T.init(e,t)});function ce(){return Or(Da)}const Ba=l("ZodNever",(e,t)=>{Rs.init(e,t),T.init(e,t)});function ja(e){return $r(Ba,e)}const Ga=l("ZodArray",(e,t)=>{Ns.init(e,t),T.init(e,t),e.element=t.element,e.min=(n,o)=>e.check(st(n,o)),e.nonempty=n=>e.check(st(1,n)),e.max=(n,o)=>e.check(yo(n,o)),e.length=(n,o)=>e.check(ko(n,o)),e.unwrap=()=>e.element});function Q(e,t){return Hr(Ga,e,t)}const Ha=l("ZodObject",(e,t)=>{Fs.init(e,t),T.init(e,t),x(e,"shape",()=>t.shape),e.keyof=()=>He(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ce()}),e.loose=()=>e.clone({...e._zod.def,catchall:ce()}),e.strict=()=>e.clone({...e._zod.def,catchall:ja()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Yo(e,n),e.safeExtend=n=>Qo(e,n),e.merge=n=>ei(e,n),e.pick=n=>Jo(e,n),e.omit=n=>Xo(e,n),e.partial=(...n)=>ti(Co,e,n[0]),e.required=(...n)=>ni(xo,e,n[0])});function _(e,t){const n={type:"object",shape:e??{},...w(t)};return new Ha(n)}const Va=l("ZodUnion",(e,t)=>{Us.init(e,t),T.init(e,t),e.options=t.options});function en(e,t){return new Va({type:"union",options:e,...w(t)})}const Wa=l("ZodIntersection",(e,t)=>{Ls.init(e,t),T.init(e,t)});function qa(e,t){return new Wa({type:"intersection",left:e,right:t})}const Ka=l("ZodRecord",(e,t)=>{Ds.init(e,t),T.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Ja(e,t,n){return new Ka({type:"record",keyType:e,valueType:t,...w(n)})}const Ut=l("ZodEnum",(e,t)=>{Bs.init(e,t),T.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 Ut({...t,checks:[],...w(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 Ut({...t,checks:[],...w(i),entries:r})}});function He(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Ut({type:"enum",entries:n,...w(t)})}const Xa=l("ZodTransform",(e,t)=>{js.init(e,t),T.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new no(e.constructor.name);n.addIssue=r=>{if(typeof r=="string")n.issues.push(Be(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(Be(s))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(r=>(n.value=r,n)):(n.value=i,n)}});function Ya(e){return new Xa({type:"transform",transform:e})}const Co=l("ZodOptional",(e,t)=>{Gs.init(e,t),T.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xn(e){return new Co({type:"optional",innerType:e})}const Qa=l("ZodNullable",(e,t)=>{Hs.init(e,t),T.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Sn(e){return new Qa({type:"nullable",innerType:e})}const ec=l("ZodDefault",(e,t)=>{Vs.init(e,t),T.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tc(e,t){return new ec({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():so(t)}})}const nc=l("ZodPrefault",(e,t)=>{Ws.init(e,t),T.init(e,t),e.unwrap=()=>e._zod.def.innerType});function oc(e,t){return new nc({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():so(t)}})}const xo=l("ZodNonOptional",(e,t)=>{qs.init(e,t),T.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ic(e,t){return new xo({type:"nonoptional",innerType:e,...w(t)})}const sc=l("ZodCatch",(e,t)=>{Ks.init(e,t),T.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function rc(e,t){return new sc({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ac=l("ZodPipe",(e,t)=>{Js.init(e,t),T.init(e,t),e.in=t.in,e.out=t.out});function In(e,t){return new ac({type:"pipe",in:e,out:t})}const cc=l("ZodReadonly",(e,t)=>{Xs.init(e,t),T.init(e,t),e.unwrap=()=>e._zod.def.innerType});function uc(e){return new cc({type:"readonly",innerType:e})}const dc=l("ZodCustom",(e,t)=>{Ys.init(e,t),T.init(e,t)});function lc(e,t={}){return Vr(dc,e,t)}function pc(e){return Wr(e)}const Pe=en([Za(),Ua()]),ge=_({base:S(),multiplier:S()}),hc=_({fastPlay:X().optional(),sounds:X().optional(),music:X().optional()}).refine(e=>Object.values(e).some(t=>t!==void 0),{message:"Object must have at least one property defined"}),gc=_({source:He(["realityCheck","settings","casino"])}),mc=_({type:He(["ON_DEMAND","BALANCE_LOW","BALANCE_INSUFFICIENT"])}),fc=_({action:He(["start","stop","pause","resume"])}),bc=_({progress:S().min(0).max(100)}),wc=_({lock:O().optional()}),So=_({conf:_({base:S(),multiplier:S(),numAwarded:S()}),data:_({numPlayed:S(),win:S(),numLeft:S()}),id:O(),rejectable:X(),skippable:X(),status:He(["PENDING","ACTIVE","FINISHED"]),type:O()}),vc=_({contract:_({bet:_({available:Ja(en([O(),S()]),Q(S())),default:ge,max:S().nullable(),last:ge.nullable(),lastPaid:ge.nullable()}),balance:_({coins:S(),version:S()}),freeRounds:Q(So),gameModel:O(),metaData:_({rtpValues:Q(_({key:O(),rtpValue:O()})),maxWin:Q(_({key:O(),maxWinValueXBet:S(),maxWinOdds:S()})),version:O()}),roundId:O().optional(),serverTime:S(),sessionId:O(),stateType:_({thisRound:O(),nextRound:O()}),uiMessages:Q(ce()),win:_({max:S().nullable(),round:S(),total:S()})}),data:ce()}),wt=_({contract:_({bet:_({last:ge.nullable(),lastPaid:ge}),balance:_({coins:S(),version:S()}),freeRounds:Q(So),roundId:O(),serverTime:S(),stateType:_({thisRound:O(),nextRound:O()}),uiMessages:Q(ce()),win:_({round:S(),total:S()})}),data:ce()}),Lt=_({bet:ge.nullable(),forcedOutcomes:ce().optional()}).passthrough(),yc=_({contract:Lt,extra:ce().optional()}),kc=_({dataDecoder:Cn().optional(),dataEncoder:Cn().optional(),gameName:O().optional(),gameVersion:O().optional(),gameHistoryUrl:O().optional(),showFreeRounds:X().optional(),showPromoPanel:X().optional(),showRealityCheck:X().optional(),showErrors:X().optional(),showBars:X().optional(),skipErrors:Q(O()).optional()}).passthrough(),Ec={configure:kc,openGame:Pe,loadStart:Pe,loadEnd:Pe,playReady:Pe,bet:ge,play:yc,playCycleStart:Lt,playCycleEnd:wt,playStart:Lt,playEnd:wt,history:gc,close:Pe,cashier:mc,fullscreen:wc,autoplay:fc,loadProgress:bc,settings:hc,openGameResponse:vc,playResponse:wt};function _c(e){return Ec[e]}function Cc(e){return e.issues.map(t=>`[${t.path.length>0?t.path.join("."):"root"}] ${t.message}`).join(`
25
+ `)}class xc{#o;#e;#t;#i;#n;#c;#s;#r;#a=[];#l=new Map;#u=!1;#d={x:0,y:0};constructor(t,n){this.#n=t,this.#c=n,this.#f(),this.#o=this.#b(),this.#s=this.#w(),this.#r=this.#v(),this.#i=this.#y(),this.#e=this.#k(),this.#C(),this.#x()}#f(){const t="dbg-plugin-styles";if(!document.getElementById(t)){const n=document.createElement("style");n.id=t,n.textContent=`
26
26
  .dbg-toggle {
27
27
  position: fixed; top: 3px; left: 50%; transform: translateX(-50%); z-index: 10000;
28
28
  background: #111827; color: #fff; border: 1px solid #1f2937;
@@ -234,14 +234,14 @@
234
234
  .dbg-event-item.optional.pending .dbg-event-indicator { background: #9CA3AF; }
235
235
  .dbg-event-item.optional.received { color: #166534; }
236
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=`
237
+ `,document.head.appendChild(n)}}#b(){const t=document.createElement("button");return t.textContent="DEBUG",t.className="dbg-toggle",t}#w(){const t=document.createElement("div");return t.className="dbg-logs-container",t}#v(){const t=document.createElement("input");return t.type="text",t.className="dbg-filter-input",t.placeholder="Filter by event name...",t}#y(){const t=document.createElement("button");return t.innerHTML="×",t.className="dbg-close",t.title="Close debug panel",t}#k(){const t=document.createElement("div");t.className="dbg-popup",t.style.display="none",this.#t=document.createElement("div"),this.#t.className="dbg-drag-handle";const n=document.createElement("div");n.className="dbg-drag-title",n.innerHTML="<span>⋮⋮</span> <span>Debug Panel</span>",this.#t.appendChild(n),this.#t.appendChild(this.#i),t.appendChild(this.#t);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:()=>this.#n("freeze"),variant:"neutral"},{text:"Unfreeze",action:()=>this.#n("unfreeze"),variant:"neutral"},{text:"Suspend",action:()=>this.#n("suspend"),variant:"neutral"},{text:"Resume",action:()=>this.#n("resume"),variant:"neutral"}]},{title:"Help",items:[{text:"Show Help",action:()=>this.#n("help",{show:!0}),variant:"success"},{text:"Hide Help",action:()=>this.#n("help",{show:!1}),variant:"danger"},{text:"Toggle Help",action:()=>this.#n("help"),variant:"primary"}]},{title:"Paytable (Optional)",items:[{text:"Show Paytable",action:()=>this.#n("paytable",{show:!0}),variant:"success"},{text:"Hide Paytable",action:()=>this.#n("paytable",{show:!1}),variant:"danger"},{text:"Toggle Paytable",action:()=>this.#n("paytable"),variant:"primary"}]},{title:"Audio Settings",items:[{text:"Enable Sounds",action:()=>this.#n("settings",{sounds:!0}),variant:"success"},{text:"Disable Sounds",action:()=>this.#n("settings",{sounds:!1}),variant:"danger"},{text:"Enable Music",action:()=>this.#n("settings",{music:!0}),variant:"success"},{text:"Disable Music",action:()=>this.#n("settings",{music:!1}),variant:"danger"}]}];this.#E(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 f=document.createElement("button");f.textContent="Clear",f.className="dbg-button is-warning",f.addEventListener("click",()=>this.#z()),u.appendChild(f);const b=document.createElement("button");b.textContent="Copy",b.className="dbg-logs-btn",b.addEventListener("click",()=>this.#M()),u.appendChild(b),a.appendChild(u),s.appendChild(a);const v=document.createElement("div");return v.className="dbg-filter-container",v.appendChild(this.#r),s.appendChild(v),s.appendChild(this.#s),this.#_(s),o.appendChild(s),t}#E(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:f})=>{const b=document.createElement("button");b.textContent=c,b.className=`dbg-button is-${f}`,b.addEventListener("click",u),s.appendChild(b)}),i.appendChild(s),n.appendChild(i);const a=document.createElement("div");a.className="dbg-separator",n.appendChild(a)})}#_(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"]}].forEach(({type:s,title:a,events:c})=>{if(c.length===0)return;const u=document.createElement("div");u.className="dbg-event-group";const f=document.createElement("div");f.className=`dbg-event-group-title ${s}`,f.innerHTML=`
238
238
  <span class="dbg-event-indicator"></span>
239
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=`
240
+ `,u.appendChild(f);const b=document.createElement("div");b.className="dbg-event-group-items",c.forEach(v=>{const k=document.createElement("div");k.className=`dbg-event-item ${s} pending`,k.title=v,k.innerHTML=`
241
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?`
242
+ <span>${v}</span>
243
+ `,b.appendChild(k),this.#l.set(v,k),this.#c(v,C=>{const F=this.#h(v,C);F.status==="error"?this.#g(v,C,F):this.#O(v)})}),u.appendChild(b),i.appendChild(u)}),n.appendChild(i),t.appendChild(n)}#C(){this.#o.addEventListener("click",()=>this.#S()),this.#i.addEventListener("click",()=>this.#I()),this.#r.addEventListener("input",()=>this.#T()),this.#t.addEventListener("pointerdown",t=>this.#A(t)),document.addEventListener("pointermove",t=>this.#P(t)),document.addEventListener("pointerup",t=>this.#m(t)),document.addEventListener("pointercancel",t=>this.#m(t))}#x(){document.body.appendChild(this.#o),document.body.appendChild(this.#e)}#S(){this.#e.style.display="flex",this.#o.style.display="none";const t=this.#e.offsetWidth,n=this.#e.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));this.#e.style.left=`${r}px`,this.#e.style.top=`${s}px`}#I(){this.#e.style.display="none",this.#o.style.display="block"}#h(t,n){const o=_c(t);if(!o)return{status:"skipped"};const i=o.safeParse(n);return i.success?{status:"success"}:{status:"error",errorMessage:Cc(i.error)}}#g(t,n,o){const i=new Date().toLocaleTimeString("en-GB",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3});this.#a.push({eventName:t,payload:n,timestamp:i,expanded:!1,validation:o}),this.#a.length>100&&this.#a.shift(),this.#p()}#z(){this.#a=[],this.#s.innerHTML=""}#T(){this.#p()}#p(){const t=this.#r.value.toLowerCase(),n=this.#a.filter(o=>o.eventName.toLowerCase().includes(t));if(this.#s.innerHTML="",n.length===0){this.#s.innerHTML='<div style="color: #9CA3AF; padding: 20px; text-align: center;">Events will appear here...</div>';return}n.forEach(o=>{const i=document.createElement("div");i.className="dbg-log-entry",o.validation?.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 f=this.#s.scrollTop;o.expanded=!o.expanded,this.#p(),this.#s.scrollTop=f}),i.appendChild(r),s){const f=document.createElement("div");f.className=`dbg-log-payload${o.expanded?"":" collapsed"}`,f.textContent=JSON.stringify(o.payload,null,2),i.appendChild(f)}if(o.validation?.status==="error"&&o.validation.errorMessage){const f=document.createElement("div");f.className="dbg-log-error-message",f.textContent=`❌ Validation Error:
244
+ ${o.validation.errorMessage}`,i.appendChild(f)}this.#s.appendChild(i)}),this.#s.scrollTop=this.#s.scrollHeight}#M(){const t=this.#r.value.toLowerCase(),o=this.#a.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
245
  `+r:""}
246
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;
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)})}registerEvent(t){this.#c(t,n=>{const o=this.#h(t,n);this.#g(t,n,o)})}#A(t){if(t.target.closest(".dbg-close"))return;this.#u=!0,this.#t.classList.add("dragging"),this.#t.setPointerCapture(t.pointerId);const n=this.#e.getBoundingClientRect();this.#d.x=t.clientX-n.left,this.#d.y=t.clientY-n.top,t.preventDefault()}#P(t){if(!this.#u)return;const n=t.clientX-this.#d.x,o=t.clientY-this.#d.y,i=window.innerWidth-this.#e.offsetWidth,r=window.innerHeight-this.#e.offsetHeight,s=Math.max(0,Math.min(n,i)),a=Math.max(0,Math.min(o,r));this.#e.style.left=`${s}px`,this.#e.style.top=`${a}px`}#m(t){this.#u&&(this.#u=!1,this.#t.classList.remove("dragging"),t&&this.#t.hasPointerCapture(t.pointerId)&&this.#t.releasePointerCapture(t.pointerId))}#O(t){const n=this.#l.get(t);n&&n.classList.contains("pending")&&(n.classList.remove("pending"),n.classList.add("received"))}}const Sc=U("DebuggingPlugin","color:#444444;font-weight:bold;");class Ic extends B{#o;constructor(...t){super(...t),this.#o=new xc(this.send.bind(this),this.on.bind(this)),this.registerSdkToDebugEvents(),Sc("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(n=>{this.#o.registerEvent(n)})}}const zn=U("GigPlugin","color:#000000;font-weight:bold;");class zc extends B{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),zn("configured")}postMessage(t){const n={event:t};zn("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 Tc=U("OryxPlugin","color:#000000;font-weight:bold;");class Mc extends B{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Tc("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 vt=U("PariplayPlugin","color:#000000;font-weight:bold;");function yt(e){try{window.top.location=e}catch{window.location=e}}function kt(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 Et(){}function Ac(e){return e.filter(function(n){return n.messageType.toUpperCase()==="DATA"})}function _t(e){return e.filter(function(n){return["NOTIFICATION","POPUP"].includes(n.messageType.toUpperCase())})}function Io(e){try{return JSON.parse(e.text)}catch{return{}}}function Pc(e){return e.map(Io).filter(Boolean).find(function(n){return n.betId!=null&&n.winId!=null})||{}}function Oc(e){return e.map(Io).filter(Boolean).find(function(n){return n.TotalBet!=null&&n.TotalWin!=null})||{}}class $c extends B{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),vt("configured")}postMessage(t,n){const o={lang:this.sdkConfig.ui.language,sender:this.sdkConfig.api.game,type:t};n!=null&&(o.data=n),vt("postMessage",o),window.parent.postMessage(o,"*")}coinsToCurrency(t){return t*this.sdkConfig.api.coinValueInCents/100}handleContinueButton(t,n){t.link&&kt("GET",t.link),n()}handleLinkButton(t,n){switch(t.linkType.toUpperCase()){case"AJAX":kt("GET",t.link),n();return;case"AJAXRESPONSE":kt("GET",t.link).then(()=>{n()});return;case"REDIRECT":yt(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"?Et:i,c=this.buttonActions[s.action.toUpperCase()];c?c(s,a):a()}}))});vt("showMessage",r)}).catch(Et)),Promise.resolve()).then(()=>{}).catch(Et)}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=_t(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"):yt(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=_t(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=Ac(n.contract.uiMessages),r=_t(n.contract.uiMessages),s=Pc(i),a=Oc(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"):yt(this.sdkConfig.api.cashierUrl))})}}const Oe=U("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class Rc extends B{VERSION="1.17.0";constructor(...t){super(...t);const n=document.createElement("script");n.src=`https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`,n.onload=()=>{Oe("loaded"),window.FEIM.configure({p2pConfig:{currency:this.sdkConfig.api.currency,launchParams:{homeurl:"homeUrl"}}}),Oe("configured"),this.registerToSdkEvents(),this.registerFromSdkEvents()},document.body.appendChild(n)}registerToSdkEvents(){window.FEIM.on.errorMessageDismissed(()=>this.send("unfreeze")),window.FEIM.on.errorMessageDisplayed(()=>this.send("freeze")),window.FEIM.on.exitingGame(()=>Oe("!!! NOT IMPLEMENTED: exitingGame !!!")),window.FEIM.on.freeze(()=>this.send("freeze")),window.FEIM.on.initialized(()=>Oe("!!! NOT IMPLEMENTED: initialized !!!")),window.FEIM.on.pauseAutoPlay(()=>this.send("suspend")),window.FEIM.on.refreshBalance(()=>Oe("!!! 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:[t]})=>this.send("settings",{sounds:t.sounds,fastPlay:t.fastPlay}))}registerFromSdkEvents(){this.on("autoplay",({action:t})=>{switch(t){case"start":window.FEIM.send.autoPlayStarted();break;case"stop":window.FEIM.send.autoPlayFinished();break}}),this.on("balance",({balance:t})=>{window.FEIM.send.balanceUpdate(t)}),this.on("bet",({base:t,multiplier:n})=>{window.FEIM.send.betUpdate(t*n)}),this.on("error",t=>{const n="message"in t?t.message:"Unknown error";window.FEIM.send.errorMessage(n)}),this.on("close",()=>{window.FEIM.send.exitGame()}),this.on("loadEnd",()=>{window.FEIM.send.gameLoadCompleted()}),this.on("loadProgress",({progress:t})=>{window.FEIM.send.gameLoadProgress(t)}),this.on("loadStart",()=>{window.FEIM.send.gameLoadStarted()}),this.on("cashier",()=>{window.FEIM.send.openQuickDeposit()}),this.on("playCycleEnd",t=>{const n={balance:t.contract.balance.coins,bet:t.contract.bet.lastPaid.base*t.contract.bet.lastPaid.multiplier,win:{win:t.contract.win.total}};window.FEIM.send.roundFinished(n)}),this.on("playResponse",t=>{const n={balance:t.contract.balance.coins,playResponse:t.data};window.FEIM.send.roundStarted(n)}),this.on("history",()=>{window.FEIM.send.showHistory()}),this.on("settings",t=>{window.FEIM.send.updateSettings(t)})}}const Ct=U("TukoPlugin","color:#000000;font-weight:bold;");class Nc extends B{PING_INTERVAL=1e4;constructor(...t){super(...t);const o=new URLSearchParams(window.location.search).get("pingCallbackUrl");o&&window.setInterval(()=>{this.ping(o)},this.PING_INTERVAL),this.registerToSdkEvents(),this.registerFromSdkEvents(),Ct("configured")}ping(t){const n=new XMLHttpRequest;n.onreadystatechange=function(){n.readyState===XMLHttpRequest.DONE&&(n.status===0||n.status>=200&&n.status<400?Ct("ping ok",n):Ct("ping error",n))},n.open("GET",t),n.send()}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:n,payload:o}=t.data;switch(n){case"doAudioSettings":this.send("settings",{music:o?.musicEnabled,sounds:o?.soundEnabled});return;case"doBalanceUpdate":const{currency:i,coinValueInCents:r}=this.sdkConfig.api;o.currency===i&&typeof o.balanceInCurrency=="number"?this.send("balance",{balance:to(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()}})}}const Tn=U("QuantaPlugin","color:#000000;font-weight:bold;");class Zc extends B{constructor(...t){super(...t),this.registerFromSdkEvents(),Tn("configured")}postMessage(t){const n={event:t};Tn("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 Mn=U("SoftSwissPlugin","color:#000000;font-weight:bold;");class Fc extends B{constructor(...t){super(...t),this.registerFromSdkEvents(),Mn("configured")}postMessage(t,n){const o={event:t,payload:n};Mn("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 An=U("EveryMatrixPlugin","color:#000000;font-weight:bold;");class Uc extends B{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),An("configured")}postMessage(t,n){const o={name:t,sender:"game",data:n};An("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?.music||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 Lc="2.0.5",Dt=500,Pn="user-agent",Ie="",On="?",rt="function",ie="undefined",ze="object",Bt="string",$="browser",ee="cpu",J="device",V="engine",D="os",Ce="result",g="name",d="type",h="vendor",m="version",R="architecture",je="major",p="model",Le="console",y="mobile",E="tablet",P="smarttv",q="wearable",Je="xr",De="embedded",be="inapp",tn="brands",he="formFactors",nn="fullVersionList",xe="platform",on="platformVersion",gt="bitness",de="sec-ch-ua",Dc=de+"-full-version-list",Bc=de+"-arch",jc=de+"-"+gt,Gc=de+"-form-factors",Hc=de+"-"+y,Vc=de+"-"+p,zo=de+"-"+xe,Wc=zo+"-version",To=[tn,nn,y,p,xe,on,R,he,gt],Xe="Amazon",we="Apple",$n="ASUS",Rn="BlackBerry",pe="Google",Nn="Huawei",xt="Lenovo",Zn="Honor",Ye="LG",St="Microsoft",It="Motorola",zt="Nvidia",Fn="OnePlus",Tt="OPPO",$e="Samsung",Un="Sharp",Re="Sony",Mt="Xiaomi",At="Zebra",Ln="Chrome",Dn="Chromium",ne="Chromecast",nt="Edge",Ne="Firefox",Ze="Opera",Pt="Facebook",Bn="Sogou",ve="Mobile ",Fe=" Browser",jt="Windows",qc=typeof window!==ie,N=qc&&window.navigator?window.navigator:void 0,oe=N&&N.userAgentData?N.userAgentData:void 0,Kc=function(e,t){var n={},o=t;if(!at(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},mt=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},Gt=function(e,t){if(typeof e===ze&&e.length>0){for(var n in e)if(se(t)==se(e[n]))return!0;return!1}return Me(e)?se(t)==se(e):!1},at=function(e,t){for(var n in e)return/^(browser|cpu|device|engine|os)$/.test(n)||(t?at(e[n]):!1)},Me=function(e){return typeof e===Bt},Ot=function(e){if(e){for(var t=[],n=Te(/\\?\"/g,e).split(","),o=0;o<n.length;o++)if(n[o].indexOf(";")>-1){var i=ct(n[o]).split(";v=");t[o]={brand:i[0],version:i[1]}}else t[o]=ct(n[o]);return t}},se=function(e){return Me(e)?e.toLowerCase():e},$t=function(e){return Me(e)?Te(/[^\d\.]/g,e).split(".")[0]:void 0},te=function(e){for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];typeof n==ze&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},Te=function(e,t){return Me(t)?t.replace(e,Ie):t},Ue=function(e){return Te(/\\?\"/g,e)},ct=function(e,t){if(Me(e))return e=Te(/^\s\s*/,e),typeof t===ie?e:e.substring(0,Dt)},Rt=function(e,t){if(!(!e||!t))for(var n=0,o,i,r,s,a,c;n<t.length&&!a;){var u=t[n],f=t[n+1];for(o=i=0;o<u.length&&!a&&u[o];)if(a=u[o++].exec(e),a)for(r=0;r<f.length;r++)c=a[++i],s=f[r],typeof s===ze&&s.length>0?s.length===2?typeof s[1]==rt?this[s[0]]=s[1].call(this,c):this[s[0]]=s[1]:s.length>=3&&(typeof s[1]===rt&&!(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}},K=function(e,t){for(var n in t)if(typeof t[n]===ze&&t[n].length>0){for(var o=0;o<t[n].length;o++)if(Gt(t[n][o],e))return n===On?void 0:n}else if(Gt(t[n],e))return n===On?void 0:n;return t.hasOwnProperty("*")?t["*"]:e},jn={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:""},Gn={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Jc={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"},Hn={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[m,[g,ve+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[m,[g,nt+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[m,[g,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[g,m],[/opios[\/ ]+([\w\.]+)/i],[m,[g,Ze+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[m,[g,Ze+" GX"]],[/\bopr\/([\w\.]+)/i],[m,[g,Ze]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[m,[g,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[m,[g,"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],[g,m],[/quark(?:pc)?\/([-\w\.]+)/i],[m,[g,"Quark"]],[/\bddg\/([\w\.]+)/i],[m,[g,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[m,[g,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[m,[g,"WeChat"]],[/konqueror\/([\w\.]+)/i],[m,[g,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[m,[g,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[m,[g,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[m,[g,"Smart "+xt+Fe]],[/(avast|avg)\/([\w\.]+)/i],[[g,/(.+)/,"$1 Secure"+Fe],m],[/\bfocus\/([\w\.]+)/i],[m,[g,Ne+" Focus"]],[/\bopt\/([\w\.]+)/i],[m,[g,Ze+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[m,[g,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[m,[g,"Dolphin"]],[/coast\/([\w\.]+)/i],[m,[g,Ze+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[m,[g,"MIUI"+Fe]],[/fxios\/([\w\.-]+)/i],[m,[g,ve+Ne]],[/\bqihoobrowser\/?([\w\.]*)/i],[m,[g,"360"]],[/\b(qq)\/([\w\.]+)/i],[[g,/(.+)/,"$1Browser"],m],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[g,/(.+)/,"$1"+Fe],m],[/samsungbrowser\/([\w\.]+)/i],[m,[g,$e+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[m,[g,Bn+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[g,Bn+" Mobile"],m],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[g,m],[/(lbbrowser|rekonq)/i],[g],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[m,g],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[g,Pt],m,[d,be]],[/(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],[g,m,[d,be]],[/\bgsa\/([\w\.]+) .*safari\//i],[m,[g,"GSA"],[d,be]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[m,[g,"TikTok"],[d,be]],[/\[(linkedin)app\]/i],[g,[d,be]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[g,/(.+)/,"Zalo"],m,[d,be]],[/(chromium)[\/ ]([-\w\.]+)/i],[g,m],[/headlesschrome(?:\/([\w\.]+)| )/i],[m,[g,Ln+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[m,[g,nt+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[g,Ln+" WebView"],m],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[m,[g,"Android"+Fe]],[/chrome\/([\w\.]+) mobile/i],[m,[g,ve+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[g,m],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[m,[g,ve+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[g,ve+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[m,g],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[g,[m,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[g,m],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[g,ve+Ne],m],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[g,"Netscape"],m],[/(wolvic|librewolf)\/([\w\.]+)/i],[g,m],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[m,[g,Ne+" 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],[g,[m,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[g,[m,/[^\d\.]+./,Ie]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[R,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[R,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[R,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[R,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[R,"arm"]],[/ sun4\w[;\)]/i],[[R,"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],[[R,/ower/,Ie,se]],[/winnt.+\[axp/i],[[R,"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,[h,$e],[d,E]],[/\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,[h,$e],[d,y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[h,we],[d,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[h,we],[d,E]],[/(macintosh);/i],[p,[h,we]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[h,Un],[d,y]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[p,[h,Zn],[d,E]],[/honor([-\w ]+)[;\)]/i],[p,[h,Zn],[d,y]],[/\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,[h,Nn],[d,E]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[h,Nn],[d,y]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[p,/_/g," "],[h,Mt],[d,E]],[/\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," "],[h,Mt],[d,y]],[/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,[h,Fn],[d,y]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[h,Tt],[d,y]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[p,[h,K,{OnePlus:["203","304","403","404","413","415"],"*":Tt}],[d,E]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[p,[h,"BLU"],[d,y]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[h,"Vivo"],[d,y]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[h,"Realme"],[d,y]],[/(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,[h,xt],[d,E]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[p,[h,xt],[d,y]],[/\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,[h,It],[d,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[h,It],[d,E]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[h,Ye],[d,E]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[h,Ye],[d,y]],[/(nokia) (t[12][01])/i],[h,p,[d,E]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[p,/_/g," "],[d,y],[h,"Nokia"]],[/(pixel (c|tablet))\b/i],[p,[h,pe],[d,E]],[/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,[h,pe],[d,y]],[/(google) (pixelbook( go)?)/i],[h,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,[h,Re],[d,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[h,Re],[d,E]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[h,Xe],[d,E]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[h,Xe],[d,y]],[/(playbook);[-\w\),; ]+(rim)/i],[p,h,[d,E]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[h,Rn],[d,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[h,$n],[d,E]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[h,$n],[d,y]],[/(nexus 9)/i],[p,[h,"HTC"],[d,E]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[p,/_/g," "],[d,y]],[/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,[h,"TCL"],[d,E]],[/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,[h,"TCL"],[d,y]],[/(itel) ((\w+))/i],[[h,se],p,[d,K,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[h,"Acer"],[d,E]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[h,"Meizu"],[d,y]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[h,"Ulefone"],[d,y]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[h,"Energizer"],[d,y]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[h,"Cat"],[d,y]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[h,"Smartfren"],[d,y]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[p,[h,"Nothing"],[d,y]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[p,[h,"Archos"],[d,E]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[p,[h,"Archos"],[d,y]],[/; (n159v)/i],[p,[h,"HMD"],[d,y]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[h,p,[d,E]],[/(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],[h,p,[d,y]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[h,p,[d,E]],[/(surface duo)/i],[p,[h,St],[d,E]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[h,"Fairphone"],[d,y]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[p,[h,zt],[d,E]],[/(sprint) (\w+)/i],[h,p,[d,y]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[h,St],[d,y]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[h,At],[d,E]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[h,At],[d,y]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[h,[d,P]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[h,$e],[d,P]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[h,p,[d,P]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,Ye],[d,P]],[/(apple) ?tv/i],[h,[p,we+" TV"],[d,P]],[/crkey.*devicetype\/chromecast/i],[[p,ne+" Third Generation"],[h,pe],[d,P]],[/crkey.*devicetype\/([^/]*)/i],[[p,/^/,"Chromecast "],[h,pe],[d,P]],[/fuchsia.*crkey/i],[[p,ne+" Nest Hub"],[h,pe],[d,P]],[/crkey/i],[[p,ne],[h,pe],[d,P]],[/(portaltv)/i],[p,[h,Pt],[d,P]],[/droid.+aft(\w+)( bui|\))/i],[p,[h,Xe],[d,P]],[/(shield \w+ tv)/i],[p,[h,zt],[d,P]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[h,Un],[d,P]],[/(bravia[\w ]+)( bui|\))/i],[p,[h,Re],[d,P]],[/(mi(tv|box)-?\w+) bui/i],[p,[h,Mt],[d,P]],[/Hbbtv.*(technisat) (.*);/i],[h,p,[d,P]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,/.+\/(\w+)/,"$1",K,{LG:"lge"}],[p,ct],[d,P]],[/(playstation \w+)/i],[p,[h,Re],[d,Le]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[h,St],[d,Le]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[h,p,[d,Le]],[/droid.+; (shield)( bui|\))/i],[p,[h,zt],[d,Le]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[p,[h,$e],[d,q]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[h,p,[d,q]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[p,[h,Tt],[d,q]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[h,we],[d,q]],[/(opwwe\d{3})/i],[p,[h,Fn],[d,q]],[/(moto 360)/i],[p,[h,It],[d,q]],[/(smartwatch 3)/i],[p,[h,Re],[d,q]],[/(g watch r)/i],[p,[h,Ye],[d,q]],[/droid.+; (wt63?0{2,3})\)/i],[p,[h,At],[d,q]],[/droid.+; (glass) \d/i],[p,[h,pe],[d,Je]],[/(pico) ([\w ]+) os\d/i],[h,p,[d,Je]],[/(quest( \d| pro)?s?).+vr/i],[p,[h,Pt],[d,Je]],[/mobile vr; rv.+firefox/i],[[d,Je]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[d,De]],[/(aeobc)\b/i],[p,[h,Xe],[d,De]],[/(homepod).+mac os/i],[p,[h,we],[d,De]],[/windows iot/i],[[d,De]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[p,[d,P]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[d,P]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[p,[d,K,{mobile:"Mobile",xr:"VR","*":E}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,E]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,y]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[p,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[m,[g,nt+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[g,m],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[m,[g,"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],[g,m],[/ladybird\//i],[[g,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[m,g]],os:[[/(windows nt) (6\.[23]); arm/i],[[g,/N/,"R"],[m,K,jn]],[/(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],[g,m],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[m,/(;|\))/g,"",K,jn],[g,jt]],[/(windows ce)\/?([\d\.]*)/i],[g,m],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[m,/_/g,"."],[g,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[g,"macOS"],[m,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[m,[g,ne+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[m,[g,ne+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[m,[g,ne+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[m,[g,ne+" Linux"]],[/crkey\/([\d\.]+)/i],[m,[g,ne]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[m,g],[/(ubuntu) ([\w\.]+) like android/i],[[g,/(.+)/,"$1 Touch"],m],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[g,m],[/\(bb(10);/i],[m,[g,Rn]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[m,[g,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[m,[g,Ne+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[m,[g,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[m,K,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[g,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[m,[g,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[g,"Chrome OS"],m],[/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],[g,m],[/(sunos) ?([\d\.]*)/i],[[g,"Solaris"],m],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[g,m]]},Qe=function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return te.call(e.init,[[$,[g,m,je,d]],[ee,[R]],[J,[d,p,h]],[V,[g,m]],[D,[g,m]]]),te.call(e.isIgnore,[[$,[m,je]],[V,[m]],[D,[m]]]),te.call(e.isIgnoreRgx,[[$,/ ?browser$/i],[D,/ ?os$/i]]),te.call(e.toString,[[$,[g,m]],[ee,[R]],[J,[h,p]],[V,[g,m]],[D,[g,m]]]),e}(),Xc=function(e,t){var n=Qe.init[t],o=Qe.isIgnore[t]||0,i=Qe.isIgnoreRgx[t]||0,r=Qe.toString[t]||0;function s(){te.call(this,n)}return s.prototype.getItem=function(){return e},s.prototype.withClientHints=function(){return oe?oe.getHighEntropyValues(To).then(function(a){return e.setCH(new Mo(a,!1)).parseCH().get()}):e.parseCH().get()},s.prototype.withFeatureCheck=function(){return e.detectFeature().get()},t!=Ce&&(s.prototype.is=function(a){var c=!1;for(var u in this)if(this.hasOwnProperty(u)&&!Gt(o,u)&&se(i?Te(i,this[u]):this[u])==se(i?Te(i,a):a)){if(c=!0,a!=ie)break}else if(a==ie&&c){c=!c;break}return c},s.prototype.toString=function(){var a=Ie;for(var c in r)typeof this[r[c]]!==ie&&(a+=(a?" ":Ie)+this[r[c]]);return a||ie}),oe||(s.prototype.then=function(a){var c=this,u=function(){for(var b in c)c.hasOwnProperty(b)&&(this[b]=c[b])};u.prototype={is:s.prototype.is,toString:s.prototype.toString};var f=new u;return a(f),f}),new s};function Mo(e,t){if(e=e||{},te.call(this,To),t)te.call(this,[[tn,Ot(e[de])],[nn,Ot(e[Dc])],[y,/\?1/.test(e[Hc])],[p,Ue(e[Vc])],[xe,Ue(e[zo])],[on,Ue(e[Wc])],[R,Ue(e[Bc])],[he,Ot(e[Gc])],[gt,Ue(e[jc])]]);else for(var n in e)this.hasOwnProperty(n)&&typeof e[n]!==ie&&(this[n]=e[n])}function Vn(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(N&&N.userAgent==this.ua)switch(this.itemType){case $:N.brave&&typeof N.brave.isBrave==rt&&this.set(g,"Brave");break;case J:!this.get(d)&&oe&&oe[y]&&this.set(d,y),this.get(p)=="Macintosh"&&N&&typeof N.standalone!==ie&&N.maxTouchPoints&&N.maxTouchPoints>2&&this.set(p,"iPad").set(d,E);break;case D:!this.get(g)&&oe&&oe[xe]&&this.set(g,oe[xe]);break;case Ce:var i=this.data,r=function(s){return i[s].getItem().detectFeature().get()};this.set($,r($)).set(ee,r(ee)).set(J,r(J)).set(V,r(V)).set(D,r(D))}return this},this.parseUA=function(){return this.itemType!=Ce&&Rt.call(this.data,this.ua,this.rgxMap),this.itemType==$&&this.set(je,$t(this.get(m))),this},this.parseCH=function(){var i=this.uaCH,r=this.rgxMap;switch(this.itemType){case $:case V:var s=i[nn]||i[tn],a;if(s)for(var c=0;c<s.length;c++){var u=s[c].brand||s[c],f=s[c].version;this.itemType==$&&!/not.a.brand/i.test(u)&&(!a||/Chrom/.test(a)&&u!=Dn||a==nt&&/WebView2/.test(u))&&(u=K(u,Jc),a=this.get(g),a&&!/Chrom/.test(a)&&/Chrom/.test(u)||this.set(g,u).set(m,f).set(je,$t(f)),a=u),this.itemType==V&&u==Dn&&this.set(m,f)}break;case ee:var b=i[R];b&&(b&&i[gt]=="64"&&(b+="64"),Rt.call(this.data,b+";",r));break;case J:if(i[y]&&this.set(d,y),i[p]&&(this.set(p,i[p]),!this.get(d)||!this.get(h))){var v={};Rt.call(v,"droid 9; "+i[p]+")",r),!this.get(d)&&v.type&&this.set(d,v.type),!this.get(h)&&v.vendor&&this.set(h,v.vendor)}if(i[he]){var k;if(typeof i[he]!="string")for(var C=0;!k&&C<i[he].length;)k=K(i[he][C++],Gn);else k=K(i[he],Gn);this.set(d,k)}break;case D:var F=i[xe];if(F){var L=i[on];F==jt&&(L=parseInt($t(L),10)>=13?"11":"10"),this.set(g,F).set(m,L)}this.get(g)==jt&&i[p]=="Xbox"&&this.set(g,"Xbox").set(m,void 0);break;case Ce:var G=this.data,le=function(H){return G[H].getItem().setCH(i).parseCH().get()};this.set($,le($)).set(ee,le(ee)).set(J,le(J)).set(V,le(V)).set(D,le(D))}return this},te.call(this,[["itemType",e],["ua",t],["uaCH",o],["rgxMap",n],["data",Xc(this,e)]]),this}function Y(e,t,n){if(typeof e===ze?(at(e,!0)?(typeof t===ze&&(n=t),t=e):(n=e,t=void 0),e=void 0):typeof e===Bt&&!at(t,!0)&&(n=t,t=void 0),n)if(typeof n.append===rt){var o={};n.forEach(function(f,b){o[String(b).toLowerCase()]=f}),n=o}else{var i={};for(var r in n)n.hasOwnProperty(r)&&(i[String(r).toLowerCase()]=n[r]);n=i}if(!(this instanceof Y))return new Y(e,t,n).getResult();var s=typeof e===Bt?e:n&&n[Pn]?n[Pn]:N&&N.userAgent?N.userAgent:Ie,a=new Mo(n,!0),c=t?Kc(Hn,t):Hn,u=function(f){return f==Ce?function(){return new Vn(f,s,c,a).set("ua",s).set($,this.getBrowser()).set(ee,this.getCPU()).set(J,this.getDevice()).set(V,this.getEngine()).set(D,this.getOS()).get()}:function(){return new Vn(f,s,c[f],a).parseUA().get()}};return te.call(this,[["getBrowser",u($)],["getCPU",u(ee)],["getDevice",u(J)],["getEngine",u(V)],["getOS",u(D)],["getResult",u(Ce)],["getUA",function(){return s}],["setUA",function(f){return Me(f)&&(s=f.length>Dt?ct(f,Dt):f),this}]]).setUA(s),this}Y.VERSION=Lc;Y.BROWSER=mt([g,m,je,d]);Y.CPU=mt([R]);Y.DEVICE=mt([p,h,d,Le,y,P,E,q,De]);Y.ENGINE=Y.OS=mt([g,m]);class Ao{config;sdkConfig;error;constructor(t,n){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 Yc{socket=null;webSocketUrl;eventListeners={close:[],error:[],message:[]};constructor(t){this.webSocketUrl=t}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})})};send=t=>{if(this.socket==null)throw new Error("Cannot send message, the WebSocket connection is not open");this.socket.send(t)};close=()=>{if(this.socket==null)throw new Error("Cannot close the WebSocket connection that is not open");this.socket.close()};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)}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};handleError=t=>{this.eventListeners.error.forEach(n=>{n(t)})};handleMessage=t=>{this.eventListeners.message.forEach(n=>{n(t)})};handleOpen=t=>{const n=t.target;n.addEventListener("close",this.handleClose),n.addEventListener("error",this.handleError),this.socket=n}}function et(e){return JSON.parse(e?.data)}function Qc(e){return e?.header?.name==="Ping"}function Wn(e){return e?.header?.name==="RealityCheck"}function ut(e){return e.header.name==="GameEvent"}function eu(e){return ut(e)&&e.body.event==="OPEN_GAME"}function qn(e){return e.header.code!==1}function tu(e){return ut(e)&&e.body.event.includes("_RESULT")}class nu extends Yc{cId=0;mId=0;seqId=0;gameCode;#o;#e;constructor(t,n){const o=new URL(t.apiUrl);o.searchParams.set("cageCode",t.cageCode),o.searchParams.set("gameCode",t.gameCode),o.searchParams.set("operatorCode",t.operatorCode),o.searchParams.set("playMode",t.playMode),o.searchParams.set("token",t.token),o.searchParams.set("username",t.username),super(o.toString()),this.eventListeners.realityCheck=[],this.gameCode=t.gameCode,this.#o=n.requestTimeoutMs,this.#e=n.gameVersion??"unknown",this.addEventListener("message",this.onMessage)}handleRealityCheck(t){this.eventListeners.realityCheck.forEach(n=>{n(t.body)})}addEventListener(t,n){super.addEventListener(t,n)}removeEventListener(t,n){super.removeEventListener(t,n)}onMessage=t=>{const n=et(t);(ut(n)||Qc(n)||Wn(n))&&this.sendAcknowledgement(n),Wn(n)&&this.handleRealityCheck(n)};buildHeader(t,n=null){return{cId:n??++this.cId,code:n!==null?1:void 0,mId:++this.mId,name:t}}buildPayload(t,n){return JSON.stringify({body:n,header:t})}getBodyExtras(t){return{action:t,seqId:++this.seqId}}request(t,n){const o=this.buildPayload(t,n);return new Promise((i,r)=>{setTimeout(()=>r({type:"timeout"}),this.#o);const s=a=>{const c=et(a);try{t.cId===c.header.cId&&(this.removeEventListener("message",s),c.header.code===1?i(c):r({message:c,type:"error"}))}catch{r({message:c,type:"error"})}};this.addEventListener("message",s),this.send(o)})}freeRounds(t){const n=this.buildHeader("ActivateFreeRound");return this.request(n,t).then(o=>o.body).catch(o=>{throw{data:o?.message?.body,type:o.type}})}async authenticate(t=!1){const n=this.buildHeader("Authenticate"),o={clientType:3,version:this.#e,reconnect:t};return this.request(n,o).then(i=>i.body).catch(i=>{throw{data:i?.message?.body,type:i.type}})}async getBalance(){const t=this.buildHeader("GetBalance"),n={};return this.request(t,n).then(o=>o.body).catch(o=>{throw{data:o?.message?.body,type:o.type}})}async openGame(){const t=this.buildHeader("OpenGame"),n={gameCode:this.gameCode};return new Promise((o,i)=>{const r=s=>{const a=et(s);eu(a)?(this.removeEventListener("message",r),o(a.body)):qn(a)&&i({data:a.body,type:"error"})};this.addEventListener("message",r),this.request(t,n).catch(s=>i({data:s?.message?.body,type:s.type}))})}sendAcknowledgement(t){const{name:n,cId:o}=t.header,i=this.buildHeader(n,o),r=this.buildPayload(i,{});this.send(r)}sendAction(t,n){const o=this.buildHeader("GameAction"),i={...this.getBodyExtras(t),data:n};return new Promise((r,s)=>{const a=c=>{const u=et(c);ut(u)&&i.seqId===u.body.correlationSeqId&&(this.removeEventListener("message",a),tu(u)?r(u.body):qn(u)&&s({data:u.body,type:"error"}))};this.addEventListener("message",a),this.request(o,i).catch(c=>s({data:c?.message?.body,type:c.type}))})}setRequestTimeoutMs(t){this.#o=t}}const ou={CA_BC:"CA",CA_ON:"CA",CAON:"CA",CAAB:"CA",GER:"DE",US_CT:"US",US_MI:"US",US_NJ:"US",USA:"US"};function Kn(e){return!e||e==="NOT_APPLICABLE"?null:ou[e]??e}function Po(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:Kn(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:Kn(e.jurisdictionCode),uiMessages:e.uiMessages,username:e.username}}}function Oo(e){return{code:e.data?.code??Ee.RgsErrorCode.UNKNOWN,details:e.data?.details}}function $o(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 Ro(e){return{code:e.data?.code??Ee.RgsErrorCode.UNKNOWN,details:e.data?.details}}function No(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 Zo(e){return{code:e.data?.code??Ee.RgsErrorCode.UNKNOWN,details:e.data?.details}}const iu={parseAuthenticateResponse:Po,parseAuthenticateError:Oo,parseOpenGameResponse:$o,parseOpenGameError:Ro,parsePlayResponse:No,parsePlayError:Zo},su={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:ru}=Y(navigator.userAgent),au=U("KalambaBullseyePlugin","color:#000000;font-weight:bold;");class cu extends Ao{socket;constructor(...t){super(...t),this.on("configured",n=>{this.socket.setRequestTimeoutMs(n.ui.requestTimeoutMs)})}initialize(t){this.socket=new nu(t,{gameVersion:this.config.gameVersion,requestTimeoutMs:this.sdkConfig.ui.requestTimeoutMs}),["fireboltroulette"].includes(t.gameCode)||(this.socket.addEventListener("close",n=>{n.code===1008?this.error||this.send("error",{type:"CLOSE",messageCode:"TOO_MANY_OPEN_GAMES",messageKey:"RgsError.TOO_MANY_OPEN_GAMES"}):n.code===1011?this.error||this.send("error",{type:"CLOSE",messageCode:"UNKNOWN",messageKey:"RgsError.UNKNOWN"}):this.reconnect()}),["mobile","tablet"].includes(ru.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",n=>au("error",n)),this.socket.addEventListener("realityCheck",n=>{this.send("realityCheck",n)})}async reconnect(){try{await this.socket.connect(),await this.socket.authenticate(!0),await this.socket.openGame()}catch{this.send("error",{type:"CLOSE",messageCode:"CONNECTION_ERROR",messageKey:"RgsError.CONNECTION_ERROR"})}}async openGame(){const t=new URLSearchParams(window.location.search),n=t.get("apiUrl"),o=t.get("cageCode"),i=t.get("gameCode"),r=t.get("operatorCode"),s=t.get("playMode"),a=t.get("token"),c=t.get("username"),u=t.get("gameHistoryUrl"),f=t.get("homeUrl")??void 0,b=t.get("cashierUrl")??void 0;this.initialize({apiUrl:n,cageCode:o,gameCode:i,operatorCode:r,playMode:s,token:a,username:c});try{await this.socket.connect()}catch{throw{type:"error",data:{code:Ee.RgsErrorCode.CONNECTION_ERROR}}}let v;try{v=await this.socket.authenticate()}catch(G){throw{type:G.type,data:G.type==="error"?Oo(G.data):void 0}}let k;try{k=await this.socket.openGame()}catch(G){throw{type:G.type,data:G.type==="error"?Ro(G.data):void 0}}const C=Po(v),F=$o(v,k,this.config.dataDecoder&&tt.decoders[this.config.dataDecoder]);this.sdkConfig.api={...this.sdkConfig.api,brand:o,game:i,integration:r,jurisdiction:C.contract.jurisdiction,playMode:s,user:C.contract.username,integrationData:{token:a},country:C.contract.country,currency:C.contract.currency,coinValueInCents:C.contract.coinValueInCents,gameHistoryUrl:u,homeUrl:f,cashierUrl:b,backendSessionId:F.contract.sessionId};const L=t.get("languageCode")?.split("_")?.[0];return L&&(this.sdkConfig.ui.language=L.length===3?su[L]??L:L),F}async play(t){for(;!this.socket.socket;)await new Promise(b=>setTimeout(()=>b(),500));const{contract:{bet:n,forcedOutcomes:o,...i},extra:r,payloadToInject:s}=t,a=this.config.dataEncoder&&tt.encoders[this.config.dataEncoder],c=n===null?"BG_ACTION":"SPIN",u={bet:n?{baseBet:n.base,betMultiplier:n.multiplier}:void 0,forcedOutcomes:o,...i,...s,opaqueUiToGameServer:a?a(r):r};let f;try{f=await this.socket.sendAction(c,u)}catch(b){throw{type:b.type,data:b.type==="error"?Zo(b.data):void 0}}return No(f,this.config.dataDecoder&&tt.decoders[this.config.dataDecoder])}async freeRounds(t){try{await this.socket.freeRounds(t)}catch{throw{type:"error",data:{code:Ee.RgsErrorCode.UNKNOWN}}}return t}async getBalance(){try{return{balance:(await this.socket.getBalance()).balance}}catch{throw{type:"error",data:{code:Ee.RgsErrorCode.UNKNOWN}}}}async showHistory(){const{api:{game:t,integration:n,integrationData:o,jurisdiction:i,user:r,gameHistoryUrl:s},ui:{language:a}}=this.sdkConfig,c=r.replace(/^user_/,"").replace(new RegExp(`_${n}$`),""),u=new URL(window.location.href);u.hostname=u.hostname.replace(/^v\./,"").replace(/^play\./,"history."),u.pathname=u.pathname.replace(/(\/[0-9]+\.[0-9]+\.[0-9]+)?\/wrapper\.html/,"/list/index.html"),u.search="",u.searchParams.set("apiUrl",new URL(s).origin),u.searchParams.set("gameCode",t),i&&u.searchParams.set("jurisdiction",i),u.searchParams.set("operatorCode",n),u.searchParams.set("token",o.token),u.searchParams.set("username",c),u.searchParams.set("languageCode",a),this.config.gameHistoryUrl&&u.searchParams.set("gameHistoryUrl",this.config.gameHistoryUrl),window.open(u.toString(),"_blank")}}class Fo{trackers;config;sdkConfig;constructor(t,n,o){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 Jn(e){return e.reduce((t,n)=>t+n,0)}function uu(e){const t=e.length,n=Jn(e)/t,o=e.map(r=>Math.pow(r-n,2)),i=Jn(o)/t;return Math.sqrt(i)}class Xn{rafId=-1;startTime=0;stopTime=0;frames=[];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)};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?uu(t):0;return{fpsAvg:n,fpsMax:o,fpsMin:i,fpsStdDev:r}};start=()=>{this.startTime=Date.now(),this.frames=[],this.trackFrames()};stop=()=>{cancelAnimationFrame(this.rafId),this.stopTime=Date.now()};trackFrames=()=>{this.frames.push(Date.now()),this.rafId=requestAnimationFrame(this.trackFrames)}}const du="landscape",lu="portrait";function pu(){try{const e=document.createElement("canvas");return!!window.WebGLRenderingContext&&(e.getContext("webgl")||e.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function hu(){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 Nt(){return window.innerWidth>=window.innerHeight?du:lu}class gu extends Fo{FPS_SAMPLE_INTERVAL=1e4;#o=0;#e;#t;#i;#n=!1;#c=!1;#s="";#r=[];constructor(...t){super(...t),this.#t={},this.#i=this.deviceInfo(),this.#e=this.config.gameVersion,this.on("state",({balance:n})=>{this.#o=n}),this.on("autoplay",({action:n})=>{["start","resume"].includes(n)?this.#n=!0:this.#n=!1}),this.on("settings",({fastPlay:n})=>{n!==void 0&&(this.#c=n)}),this.registerEvents()}async registerEvents(){this.#i.then(t=>{this.track("Device Information",t)}),this.on("loadStart",()=>{this.track("Game Loading",{progress:0,step:"initial"})}),this.on("loadProgress",t=>{this.track("Game Loading",{progress:t.progress})}),this.on("loadEnd",()=>{this.track("Game Loading",{progress:100,step:"complete"})}),this.on("error",t=>{this.track("System Message",{systemMessageText:t.messageCode,systemMessageType:t.type})}),this.on("openGameResponse",async t=>{this.#s=t.contract.stateType.nextRound,this.#t={balanceInCoins:t.contract.balance.coins,clientVersion:this.#e,coinValueInCents:this.sdkConfig.api.coinValueInCents,coinValueInCentsFloat:this.sdkConfig.api.coinValueInCents,currency:this.sdkConfig.api.currency,defaultBaseBet:t.contract.bet.default.base,defaultBetMultiplier:t.contract.bet.default.multiplier,environment:"release",gameCode:this.sdkConfig.api.game,gameCodeServer:this.sdkConfig.api.game,gameModelFile:t.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:t.contract.metaData.version},this.track("Game Open",this.#t)}),this.on("playCycleEnd",async t=>{const n=await this.#i,{base:o,multiplier:i}=t.contract.bet.lastPaid??{},r=t.contract.balance.coins,s=t.contract.bet.lastPaid.base*t.contract.bet.lastPaid.multiplier,a=t.contract.win.total,c=a-s,u="spin",f=t.contract.roundId;this.track("Betting Activity",{balance:r-c,balanceAfter:r,baseBet:o,betMultiplier:i,betType:u,gameVersion:this.#e,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:n.isMobile,netResult:c,operatorName:"kalamba",orientation:Nt(),partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,roundId:f,roundTypes:["BaseGame"],totalBet:s,totalWin:a}),this.#r=[]}),this.on("telemetry.click",t=>{this.track("UI Interaction",{action:"click",...this.getExtraUiInteractionData(),...t})}),this.on("telemetry.orientationChange",()=>{this.track("UI Interaction",{action:"orientationChange",...this.getExtraUiInteractionData()})}),this.reportFpsSample(),this.reportFpsRound()}reportFpsSample(){const t=new Xn,n=()=>{t.stop();const i=t.getReport();this.track("FPS Performance",{...i,fpsType:"sample"}),o()},o=async()=>{t.start(),setTimeout(n,this.FPS_SAMPLE_INTERVAL)};o()}reportFpsRound(){const t=new Xn;this.on("playCycleStart",()=>{t.start()}),this.on("playCycleEnd",()=>{t.stop();const n=t.getReport();this.track("FPS Performance",{...n,fpsType:"playCycleStart->playCycleEnd"})})}getExtraUiInteractionData(){return{orientation:Nt(),stateType:this.#s}}async deviceInfo(){const{browser:t,device:n,os:o}=Y(navigator.userAgent),i=pu(),r=await hu();return{browserName:t.name,browserVersion:t.version,connection:navigator.connection?.effectiveType,deviceName:n.model,deviceType:n.type,isMobile:["mobile","tablet"].includes(n.type??""),isWebGLSupported:i,isWebPSupported:r,manufacturer:n.vendor,operatingSystem:o.name,operatingSystemVersion:o.version,orientation:Nt(),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}}}var mu=Ht.requireNoop();const Yn=Ht.getDefaultExportFromCjs(mu);class sn{config;sdkConfig;constructor(t,n){this.config=t,this.sdkConfig=n}}const Qn=25,eo=1e4;class fu extends sn{#o="https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events";#e;#t;#i=[];processQueueForced;constructor(...t){super(...t),this.#e=new Date().getTime(),this.#i=[],this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(this.#o,{method:"OPTIONS"}).catch(Yn),this.subscribe()}subscribe(){window.addEventListener("beforeunload",this.processQueueForced,!1),window.addEventListener("pagehide",this.processQueueForced,!1),window.addEventListener("visibilitychange",this.processQueueForced,!1)}schedule(){this.#t&&clearTimeout(this.#t),this.#t=window.setTimeout(()=>this.processQueue(),eo)}send(t){this.#e=new Date().getTime();try{navigator.sendBeacon(this.#o,JSON.stringify(t))}catch{fetch(this.#o,{body:JSON.stringify(t),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(Yn)}this.schedule()}addToQueue(t){this.#i.push(t),this.processQueue()}processQueue(t=!1){if(!(this.sdkConfig==null||!this.sdkConfig.ui.feature.allowTelemetry)&&!(!t&&this.#i.length<Qn&&new Date().getTime()-this.#e<eo))for(;this.#i.length;){const n=this.#i.splice(0,Qn).map(o=>({...o,sessionID:this.sdkConfig.api.sessionId,userID:this.sdkConfig.api.user}));this.send(n)}}track(t,n){this.addToQueue({eventName:t,eventParams:n,eventTimestamp:new Date().getTime(),eventUUID:Ht.v4()})}}const bu=U("LoggingTracker","color:#000000;font-weight:bold;");class wu extends sn{track(t,n){bu(`@${this.sdkConfig.api.user}`,`[${t}]`,n)}}exports.BasicPlugin=Lo;exports.BspotPlugin=Vt;exports.CasinoPlugin=B;exports.DebuggingPlugin=Ic;exports.EveryMatrixPlugin=Uc;exports.GigPlugin=zc;exports.KalambaBullseyeParsers=iu;exports.KalambaBullseyePlugin=cu;exports.KalambaStargazerPlugin=gu;exports.KalambaStargazerTracker=fu;exports.LoggingTracker=wu;exports.OryxPlugin=Mc;exports.PariplayPlugin=$c;exports.QuantaPlugin=Zc;exports.RelaxFEIMPlugin=Rc;exports.RgsPlugin=Ao;exports.SoftSwissPlugin=Fc;exports.TelemetryPlugin=Fo;exports.Tracker=sn;exports.TukoPlugin=Nc;