@jolibox/implement 1.1.46 → 1.1.47

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.
@@ -4,7 +4,7 @@
4
4
  "packages/implement/.eslintrc.js": "7a3d2747dc887655ca9e2d3ff621f7dfd98500b9",
5
5
  "packages/implement/README.md": "5660cd88848b7a5428394cc34d881a35dd402188",
6
6
  "packages/implement/esbuild.config.js": "876db4e384d8543b66a0b61d8f7b277a36dfb4e0",
7
- "packages/implement/package.json": "ebeee7285fcfccd07afda8f3143eeee8b2e5a0eb",
7
+ "packages/implement/package.json": "4da9aba1b00a6d01a75cba0e45cdece4de851021",
8
8
  "packages/implement/src/common/ads/ads-action-detection.ts": "5a7b9f85d7eab9e744f8a9fc7638063f43baa214",
9
9
  "packages/implement/src/common/ads/anti-cheating.test.ts": "e2ff3dc6760cfd28d0f8c15703d7fb20d43df583",
10
10
  "packages/implement/src/common/ads/anti-cheating.ts": "a3ffb6a78e289e1c0ce45c7f7c0cee000e75e541",
@@ -91,10 +91,12 @@
91
91
  "packages/implement/src/h5/rewards/index.ts": "ac0674bc8072f991f01be2fceff579e6976e1d87",
92
92
  "packages/implement/src/index.native.ts": "96cc46c8919ba2333600e9c3ee100f47c511a79a",
93
93
  "packages/implement/src/index.ts": "d0ca7b5312b0a258ae8887e725440c70190442f7",
94
+ "packages/implement/src/native/api/__tests__/convertVersionCodeToVString.test.ts": "5f948265725f8ca48851de4bd41b24a10d754982",
94
95
  "packages/implement/src/native/api/ads.ts": "5c88934592b0f2cfa0fab2dcc7e13dc0e7db5675",
95
- "packages/implement/src/native/api/base.ts": "95d55cfca29dd1b4c265d3c160da422b9184f5d3",
96
+ "packages/implement/src/native/api/base.ts": "574ff57b5f94fa7d59d0e1677b2772d95e5fc679",
96
97
  "packages/implement/src/native/api/get-system-info.ts": "33aa88b7f4d6c4204bc7e81ee9cce05296587691",
97
- "packages/implement/src/native/api/index.ts": "3151d49ea7e2cfb385701c332b61ed3e5168b2af",
98
+ "packages/implement/src/native/api/index.ts": "b783f88a9ac05321076fe5f7561535e03093635c",
99
+ "packages/implement/src/native/api/is-native-support.ts": "46d9353fcec02ac0f4ed7094a7ceae2900eb45c1",
98
100
  "packages/implement/src/native/api/keyboard.ts": "cb65da6e8cbfb7ef4a21582acd74f450a0e3c894",
99
101
  "packages/implement/src/native/api/lifecycle.ts": "af0f376f1283ed0e80062d1568225a334c7d22f9",
100
102
  "packages/implement/src/native/api/login.ts": "4e6a40ad7ed1e4dc5d328cafb449aff7a4f4469b",
@@ -103,6 +105,7 @@
103
105
  "packages/implement/src/native/api/runtime.ts": "3c66cc58685e3ed3b25554aca8979c1650ac9241",
104
106
  "packages/implement/src/native/api/storage.ts": "d395e86a04060a1e734f12c1b9c2e7b56eba392b",
105
107
  "packages/implement/src/native/api/task.ts": "937b5b419aed5d1acc1e87af402fc6ba3f1d73b2",
108
+ "packages/implement/src/native/api/utils.ts": "a589552be6ef411ea7bffa5061da9825ae68a73f",
106
109
  "packages/implement/src/native/bootstrap/index.ts": "2f99dd2498317fbf0ab43b3cdd7a14d1920653df",
107
110
  "packages/implement/src/native/bootstrap/init-env.ts": "d7c3d9bfcf496d6478836f9c6d6e61a712f7b612",
108
111
  "packages/implement/src/native/network/create-fetch.ts": "b199f0fd41bb953173d1386ba32e418d225d95ad",
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var Mc=Object.create;var ni=Object.defineProperty,Bc=Object.defineProperties,Fc=Object.getOwnPropertyDescriptor,jc=Object.getOwnPropertyDescriptors,Jc=Object.getOwnPropertyNames,Cr=Object.getOwnPropertySymbols,ya=Object.getPrototypeOf,ii=Object.prototype.hasOwnProperty,ba=Object.prototype.propertyIsEnumerable,Vc=Reflect.get;var ga=(e,t,r)=>t in e?ni(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,H=(e,t)=>{for(var r in t||(t={}))ii.call(t,r)&&ga(e,r,t[r]);if(Cr)for(var r of Cr(t))ba.call(t,r)&&ga(e,r,t[r]);return e},pe=(e,t)=>Bc(e,jc(t));var Vt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var wa=(e,t)=>{var r={};for(var n in e)ii.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Cr)for(var n of Cr(e))t.indexOf(n)<0&&ba.call(e,n)&&(r[n]=e[n]);return r};var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var oi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Hc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Jc(t))!ii.call(e,i)&&i!==r&&ni(e,i,{get:()=>t[i],enumerable:!(n=Fc(t,i))||n.enumerable});return e};var ai=(e,t,r)=>(r=e!=null?Mc(ya(e)):{},Hc(t||!e||!e.__esModule?ni(r,"default",{value:e,enumerable:!0}):r,e));var Ea=(e,t,r)=>Vc(ya(e),r,t);var P=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(d){i(d)}},a=l=>{try{s(r.throw(l))}catch(d){i(d)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});function Xc(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function xa(e){return new Promise(t=>setTimeout(t,e))}function mi(e){return typeof e=="string"}function Oa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Pa(e){return typeof e=="object"&&Array.isArray(e)}function Zc(e){return typeof e=="undefined"}function ed(e){return Zc(e)||e===null}function td(e){return typeof e=="function"}function Da(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Na(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,o){for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=i[a],l=o[a],d=r(s,l,a,i,o);d!==void 0?i[a]=d:Sa(l)&&Sa(s)?i[a]=n(ka({},s),l):Array.isArray(l)&&Array.isArray(s)?i[a]=[...s,...l]:i[a]=l}return i}return n(e,t)}function Sa(e){return e&&typeof e=="object"&&e.constructor===Object}function La(e,t){if(Array.isArray(e))return e.concat(t)}function qt(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:l=!0}=r,d=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),y=function(...h){i=h,o=this;let p=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,l&&!p&&d()},t),p)return d()};return y.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},y.flush=()=>{if(n)return clearTimeout(n),n=null,d()},y}function id(e,t){return(...r)=>t(e,...r)}function Fa(e){return t=>id(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new nd(`${i}`))}})}function Ht(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function kr(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function cd(e){let t=e.location?kr(e.location,Ca):null,r=e.target?kr(e.target,Ca):null;return kr(zc(ka({},e),{location:t,target:r}),ld)}function yi(e){let t=e.events.map(n=>cd(n)),r=kr(e.device,ud);return[e.protocolVersion,t,r,e.project]}function dd(){try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function wd(e){return new Promise(t=>Va(e)(t))}function Va(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function Ed(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Gt(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function Id(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Sd(e[n],t[n])}function Sd(e,t){if(mi(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(td(t)){try{if(e instanceof t)return}catch(r){}if(!ed(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function Rd(){return typeof globalThis!="undefined"?globalThis[Ha]:void 0}function Cd(e){typeof globalThis!="undefined"&&(globalThis[Ha]=e)}function ve(e=!1){let t=Rd();if(!e&&t)return t;let r=new Tr,n=new fi,i={registerCommand(o,a,s){r.registerCommand({id:o,handler:a,metadata:s})},executeCommand(o,...a){return n.executeCommand(o,...a)},excuteCommandSync(o,...a){return n.executeCommandThowErr(o,...a)}};return Cd(i),i}var hi,$c,Gc,qc,Aa,Kc,Wc,Ia,ka,zc,Qc,Ta,Yc,rd,pi,vi,Ua,Ma,nd,Ba,xr,Or,_i,De,li,od,gi,Ra,ad,lt,yt,sd,Ca,ld,ud,ut,fd,Ae,hd,md,pd,ja,bi,wi,vd,_d,Ja,ui,ee,gd,yd,$t,Gt,Be,di,bd,si,Ad,Kt,Tr,fi,Ha,V=Z(()=>{"use strict";hi=Object.defineProperty,$c=Object.defineProperties,Gc=Object.getOwnPropertyDescriptor,qc=Object.getOwnPropertyDescriptors,Aa=Object.getOwnPropertySymbols,Kc=Object.prototype.hasOwnProperty,Wc=Object.prototype.propertyIsEnumerable,Ia=(e,t,r)=>t in e?hi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ka=(e,t)=>{for(var r in t||(t={}))Kc.call(t,r)&&Ia(e,r,t[r]);if(Aa)for(var r of Aa(t))Wc.call(t,r)&&Ia(e,r,t[r]);return e},zc=(e,t)=>$c(e,qc(t)),Qc=(e,t)=>{for(var r in t)hi(e,r,{get:t[r],enumerable:!0})},Ta=(e,t,r,n)=>{for(var i=n>1?void 0:n?Gc(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&hi(t,r,i),i},Yc=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(d){i(d)}},a=l=>{try{s(r.throw(l))}catch(d){i(d)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}rd=(e=>(e[e.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",e[e.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",e[e.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",e[e.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",e[e.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",e[e.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",e[e.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",e[e.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",e))(rd||{}),pi=class extends Error{constructor(e){if(typeof e=="string"){super(e),this.priority="P1";return}super(e.message),this.priority="P1",this.stack=e.stack,this.raw=e}},vi=class extends pi{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Ua=class extends pi{constructor(){super(...arguments),this.kind="USER_ERROR"}},Ma=class extends Ua{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},nd=class extends Ua{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="USER_CUSTOM_ERROR",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},Ba=class extends vi{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},xr=class extends vi{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},Or=class extends pi{constructor(e,t,r,n,i){super(e),this.message=e,this.code=t,this.kind="API_ERROR",this.name="API_ERROR",r&&(this.errorType=r),n!==void 0&&(this.stack=n),i&&(this.priority=i)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},_i=class extends vi{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};De={log:Ht("log"),warn:Ht("warn"),info:Ht("info"),error:Ht("error"),debug:Ht("debug")};Object.assign(globalThis,{logger:De});li=Symbol.for("Jolibox.canIUseMap"),od={};globalThis[li]||(globalThis[li]=od);gi={get config(){return globalThis[li]}},Ra=Symbol.for("Jolibox.canIUseMap.native"),ad={};globalThis[Ra]||(globalThis[Ra]=ad);lt=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(lt||{}),yt=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(yt||{}),sd=(e=>(e[e.App=0]="App",e[e.H5=1]="H5",e[e.Weapp=2]="Weapp",e[e.Alipay=3]="Alipay",e[e.Gcash=4]="Gcash",e[e.Dana=5]="Dana",e[e.Umma=6]="Umma",e[e.WebSDK=1e3]="WebSDK",e[e.AppSDK=1001]="AppSDK",e[e.Other=9999]="Other",e))(sd||{}),Ca=["name","params"],ld=["name","type","location","target","extra","timestamp","userId"],ud=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];ut=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});dd();fd=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Ae={isiOS:navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),iosVersion:()=>{let e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||"0",10)]},isAndroid:navigator.userAgent.includes("Android"),isMac:navigator.userAgent.includes("Mac"),isFacebook:navigator.userAgent.includes("FB_IAB"),isPC:!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},hd=()=>Ae.isiOS?"iOS":Ae.isAndroid?"Android":Ae.isMac?"Mac":Ae.isFacebook?"Facebook":"PC",md="device_id",pd="advertising_id",ja=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,ut()),window.__joliboxLocalStorage__.getItem(e)),bi=()=>new URLSearchParams(window.location.search).get("deviceId")||ja(md),wi=()=>new URLSearchParams(window.location.search).get("advertisingId")||ja(pd),vd=e=>e.charAt(0).toUpperCase()+e.slice(1),_d=()=>{var e;let t=new URLSearchParams(window.location.search);return vd((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},Ja=e=>{if(fd())return window.navigator.userAgent;let t="JoliboxWebSDK",r=hd(),n=navigator.language,i=bi(),o=wi();return`${t} (${_d()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`},ui=class ci{constructor(t){this.element=t,this.next=ci.Undefined,this.prev=ci.Undefined}};ui.Undefined=new ui(void 0);ee=ui,gd=class{constructor(){this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ee.Undefined}clear(){let e=this._first;for(;e!==ee.Undefined;){let t=e.next;e.prev=ee.Undefined,e.next=ee.Undefined,e=t}this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new ee(e);if(this._first===ee.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==ee.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ee.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ee.Undefined&&e.next!==ee.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ee.Undefined&&e.next===ee.Undefined?(this._first=ee.Undefined,this._last=ee.Undefined):e.next===ee.Undefined?(this._last=this._last.prev,this._last.next=ee.Undefined):e.prev===ee.Undefined&&(this._first=this._first.next,this._first.prev=ee.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ee.Undefined;)yield e.element,e=e.next}},yd=0,$t=class{constructor(e){this.value=e,this.id=yd++}},Gt=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof $t&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let d=new $t(t);return this._listeners?this._listeners instanceof $t?this._listeners=[this._listeners,d]:this._listeners.push(d):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=d,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var y,h,p,f;if(!this._disposed){if(this._listeners instanceof $t)this._listeners.id===d.id&&(this._listeners=void 0,this._size=0,(h=(y=this.options)==null?void 0:y.onDidRemoveLastListener)==null||h.call(y));else if(this._listeners){let b=this._listeners.indexOf(d);b>=0&&(this._listeners.splice(b,1),this._size--,this._size===0&&((f=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||f.call(p)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof $t?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Be=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Gt,o=l=>t(...l.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new gd,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},di={};Qc(di,{None:()=>bd,filter:()=>Ed,once:()=>Va,toPromise:()=>wd});bd=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});si=Symbol.for("Jolibox.hostEmitter"),Ad=()=>{let e=new Be;return globalThis[si]||(globalThis[si]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[si]},Kt=Ad();Tr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Gt,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(...i){return Id(i,r),n(...i)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};Tr=Ta([Da],Tr);fi=class{constructor(){this._onWillExecuteCommand=new Gt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Gt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Tr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Xc(3e4)),this._starActivation}executeCommand(e,...t){return Yc(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),di.toPromise(di.filter(this.registry.onDidRegisterCommand,r=>r===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let r=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),n}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e,...t){let r=!1;try{return e(...t)}finally{r=!0}}};fi=Ta([Da],fi);Ha=Symbol.for("Jolibox.commands")});function ke(e,t={}){Ei.emit("ERROR_REPORT",{error:e,options:t})}var Ei,ct,$e=Z(()=>{"use strict";V();V();Ei=new Be,ct=new Be;ke.debounce=qt(ke,50,{leading:!0})});var Ai,kd,$a,Ga,qa=Z(()=>{"use strict";V();$e();Ai=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4===0?"":"=".repeat(4-t.length%4),n=atob(t+r);try{return JSON.parse(n)}catch(i){return{}}},kd=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},$a=e=>{var t;try{let i=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(i!=null&&i.length){let[o,a,s]=i;return{headerJson:Ai(o),payloadJson:Ai(a),signature:Ai(s)}}else throw"joli_source is missing"}catch(r){return ke(new Ba(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},Ga=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=kd(e),o=r[2];return`${n}.${i}.${o}`}return t}});var Td,Pr,Ka,Ii=Z(()=>{"use strict";V();Td="1.1.46",Pr=()=>Td,Ka=()=>{let e=Pr();return`${Ja(e)}`}});function Ri(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var xd,Wa,Si,za,oe,Od,D,_e=Z(()=>{"use strict";V();qa();Ii();V();xd={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:bi(),adId:wi(),pixelRatio:window.devicePixelRatio||1,platform:Ae.isAndroid?"android":Ae.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:Pr()},schema:window.location.href,platform:Ae.isAndroid?"android":Ae.isiOS?"ios":"h5"},Si=(Wa=globalThis.joliboxJSCore)==null?void 0:Wa.env,oe=Object.assign({},(za=Si==null?void 0:Si())!=null?za:xd);Od=()=>{var f,b,A,S,w,T,N,j,W,R,L;let{payloadJson:e,headerJson:t,signature:r}=oe.schema.length?$a(oe.schema):{},n=`${oe.deviceInfo.did}-${new Date().getTime()}`,o=new URL(oe.schema.length?oe.schema:window.location.href).searchParams,a=(A=(b=(f=o.get("mpId"))!=null?f:o.get("appId"))!=null?b:o.get("gameId"))!=null?A:"",s=(T=(w=(S=oe.clientSessionId)!=null?S:e==null?void 0:e.sessionId)!=null?w:o.get("sessionId"))!=null?T:n,l=!!((j=(N=e==null?void 0:e.testAdsMode)!=null?N:e==null?void 0:e.__testAdsMode)!=null?j:o.get("testAdsMode")==="true"),d=(L=(R=(W=e==null?void 0:e.joliboxEnv)!=null?W:e==null?void 0:e.__joliboxEnv)!=null?R:o.get("joliboxEnv"))!=null?L:"production",y=d==="staging",h=t==null?void 0:t.channel,p=e==null?void 0:e.__shouldInterupt;return{get startTime(){var O;return(O=performance.timeOrigin)!=null?O:performance.timing.navigationStart},get testMode(){return y},get testAdsMode(){return l},get joliboxEnv(){return d},get joliSource(){var O;return(O=o.get("joliSource"))!=null?O:null},get mpId(){var O;return(O=a!=null?a:e==null?void 0:e.id)!=null?O:""},get mpVersion(){var O;return(O=t==null?void 0:t.ver)!=null?O:Pr()},get mpType(){var O,B;return(B=(O=t==null?void 0:t.__mpType)!=null?O:e==null?void 0:e.__mpType)!=null?B:"game"},get platform(){var O;return((O=oe.platform)!=null?O:oe.deviceInfo.platform).toLowerCase()},get deviceInfo(){return oe.deviceInfo},get sdkInfo(){return oe.sdkInfo},get hostInfo(){return oe.hostInfo},get hostUserInfo(){return oe.hostUserInfo},get sessionId(){var O,B;return(B=(O=oe.clientSessionId)!=null?O:s)!=null?B:n},get channel(){return h},get webviewId(){var O;return(O=oe.webviewId)!=null?O:-1},get shouldInterupt(){return p},get from(){return e==null?void 0:e.__from},get baseApiHost(){return y?"https://stg-api.jolibox.com":"https://api.jolibox.com"},get adId(){var O;return(O=oe.deviceInfo.adId)!=null?O:oe.deviceInfo.did},get language(){return oe.deviceInfo.lang},get sdkEnvironment(){return Ri("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":Ri("gamedistribution","jolibox")?"gamedistribution":Ri("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var Q,ne,Ee;let O=(Q=oe.deviceInfo.pixelRatio)!=null?Q:1,B=(ne=oe.deviceInfo.statusBarHeight)!=null?ne:e==null?void 0:e.__androidStatusBarHeight,z=(Ee=oe.deviceInfo.navigationBarHeight)!=null?Ee:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:B!==void 0?B/O:20,navigationBarHeight:z!==void 0?z/O:10}},onEnvConfigChanged:O=>{Na(oe,O,La)},encodeJoliSourceQuery:O=>{var B,z;return t&&r?Ga(H(H({},e),O),(B=o.get("joliSource"))!=null?B:""):(z=o.get("joliSource"))!=null?z:""},setDoExitDirectly:()=>{p=!1}}},D=Od()});var Ci,Ya,Pd,Dd,Qa,Nd,Xa=Z(()=>{"use strict";V();$e();_e();V();Ci=!1,Ya=(e,t)=>e==null?!1:t in e,Pd=e=>Ya(e,"kind"),Dd=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},Qa=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=D.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:Dd(e.name)},i=pe(H({},n),{env:t.environment,isFromUser:r});r?ct.emit("GLOBAL_USER_ERROR",e,i):ct.emit("GLOBAL_ERROR",e,i)},Nd=e=>Ya(e,"kind")&&e.kind==="USER_ERROR";Ei.on("ERROR_REPORT",({error:e,options:t})=>{if(Ci)return;Ci=!0;let r=Pd(e)&&e.raw?e.raw:e;try{let n=Nd(e);Qa(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new _i(`${i}, origin error: ${r.message}`);De.error(o),Qa(new _i(o.message),{environment:t.environment},!1)}finally{Ci=!1}})});var ki,Ti=Z(()=>{"use strict";$e();V();$e();ki=e=>new Ma(e)});function Za(e,t){let r=(n,i,o)=>{let d=i!=null?i:{},{eventType:a}=d,s=wa(d,["eventType"]),l=pe(H({tag:n,eventType:a!=null?a:lt.Other},t),{extra:H({},s)});n=="globalJsError"?ke(new xr(JSON.stringify(l))):e("systemLog",l,o)};return r.debounce=qt(r,500,{leading:!0}),r}function es(e){let t=(r,n,i)=>{var s;let o=(s=i&&JSON.stringify(i))!=null?s:0,a={speed_value_type:r,total_duration:n};o&&Object.assign(a,{extra:o}),e("joliboxSpeedAnalysis",a)};return t.debounce=qt(t,500,{leading:!0}),t}var ts=Z(()=>{"use strict";V();V();$e()});function rs(e,t){let r=Za(e,t),n=es(r);return{track:r,trackPerformance:n}}var ns=Z(()=>{"use strict";ts()});var xi=Z(()=>{"use strict"});var Dr,is=Z(()=>{"use strict";_e();V();V();Dr=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return P(this,null,function*(){let r=`${D.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"}/api/fe-configs/js-sdk/samples-config`,n=yield(yield fetch(r)).json();this.samplesConfig=n})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:r}=this.samplesConfig;for(let[n,i]of Object.entries(r))if(i.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,i,o,a,s;let{nativeSDKVersion:t,jssdkVersion:r}=D.sdkInfo;return{platform:1e3,os:D.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(o=(i=D.hostInfo)==null?void 0:i.aid)!=null?o:"1",model:(a=D.deviceInfo.model)!=null?a:"UnknownModel",brand:(s=D.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:D.deviceInfo.did,jsSdkVersion:r,extra:{}}}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:"GamePage",params:r}}trackEvent(t,r,n){return P(this,null,function*(){if(this.checkIsSampled(t))return;let i=t.location?t.location:yield this.getLocation(),o=t.target||null,a=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let s=this.deviceInfo,d={protocolVersion:"1.0.0",events:[pe(H({},t),{location:i,target:o,extra:a,timestamp:Date.now(),userId:null})],device:s,project:r};try{n?yield this.doReport(yi(d),n):yield this.doReport(yi(d))}catch(y){De.log("[Jolibox SDK] report API error",y)}})}}});var Oi=Z(()=>{"use strict";ns();xi();is()});var Pi,os,Ge,Nr,Me,bt=Z(()=>{"use strict";Ii();_e();V();Pi=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(os=AbortSignal.timeout)!=null||(AbortSignal.timeout=Pi);Ge=class e{constructor(){this.httpClients=new WeakSet;this.networkRequests=[];this.maxRequestsToTrack=20;this.getNetworkStatus=()=>this.networkRequests.length===0?!0:this.networkRequests.filter(n=>n).length/this.networkRequests.length>=.6}static getInstance(){return e._instance||(e._instance=new e),e._instance}create(t){let r=new Nr(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},Nr=class{constructor(t){this.xua=Ka();this.getJoliSource=()=>D.joliSource;var n;let r=D.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com";this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return P(this,null,function*(){try{let{query:n,timeout:i}=r!=null?r:{},{headers:o}=r!=null?r:{},a=n?new URLSearchParams(n):null,s=a==null?void 0:a.toString(),l=`${this.baseUrl}${t}${s?`?${s}`:""}`,d=this.xua,y=this.getJoliSource();o=Object.assign({},o!=null?o:{},d?{"x-user-agent":d}:{},y?{"x-joli-source":y}:{});let h=yield fetch(l,{method:"GET",headers:o,credentials:"include",signal:Pi(i!=null?i:3e4)});return Ge.getInstance().recordNetworkRequest(!0),yield h.json()}catch(n){throw Ge.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return P(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,l=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${l?`?${l}`:""}`,y=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{},{"x-os-type":Ae.isAndroid?"ANDROID":Ae.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let p=yield fetch(d,{method:"POST",headers:a,body:JSON.stringify(n),signal:Pi(o!=null?o:3e4),credentials:"include"});Ge.getInstance().recordNetworkRequest(!0);let f=p.headers.get("content-type");if(f!=null&&f.includes("application/octet-stream"))try{return p.blob()}catch(b){return yield p.arrayBuffer()}if(f!=null&&f.includes("multipart/form-data")||f!=null&&f.includes("application/x-www-form-urlencoded"))try{return p.formData()}catch(b){return yield p.text()}if(f!=null&&f.includes("application/json"))try{return yield p.json()}catch(b){return yield p.text()}return p}catch(n){throw Ge.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return P(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,l=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${l?`?${l}`:""}`,y=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{});let p=yield fetch(d,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!p.ok)throw Ge.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${p.status}`);return Ge.getInstance().recordNetworkRequest(!0),yield p.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=Nr;Me=Ge.getInstance()});var Di,Lr,Ni=Z(()=>{"use strict";_e();Oi();bt();Di=class extends Dr{constructor(){super(...arguments);this.hostToApiMap={default:{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.jolibox.com":{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.pico-game.com":{test:"https://stg-collect.pico-game.com",prod:"https://collect.pico-game.com"}};this.httpClient=Me.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n,i;let r=(n=this.hostToApiMap[window.location.host])!=null?n:this.hostToApiMap.default;return(i=D.testMode)!=null&&i?r.test:r.prod}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},Lr=new Di});var Ld,as=Z(()=>{"use strict";Xa();V();Ti();V();Ni();_e();Ld=(e,t)=>{var i,o,a;let r={message:t.message,stack:(i=t.stack)!=null?i:"",errorType:t.name,source:0},n={name:e,type:lt.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:null};Lr.trackEvent(n,yt.WebSDK)};ct.on("GLOBAL_ERROR",(e,t)=>{Ld(t.tag,e)});ct.on("GLOBAL_USER_ERROR",(e,t)=>{De.log("UserError",e,t)})});var Ur,ss=Z(()=>{"use strict";Ur=class{constructor(t,r){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.timer=this.createRAFTimer(t=>{this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t})});this.interval=r!=null?r:5*1e3,t.on("visible",n=>{this.visible=n})}start(t){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:t!=null?t:0}}),this.tracker("OpenGame",{duration:t!=null?t:0}),this.timer.start()}close(t){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:t}}),this.tracker("CloseGame",{duration:t}),this.timer.stop()}createRAFTimer(t){let r=Date.now(),n,i,o=!1,a=0,s=()=>{if(!o)return;let f=Date.now(),b=f-r;b>=this.interval&&(this.visible&&(a+=Math.min(b,this.interval+1e3),t(a)),r=f),n=requestAnimationFrame(s)},l=()=>{y(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let f=Date.now();f-r>=this.interval&&(r=f)},this.interval)},d=()=>{h(),r=Date.now(),n=requestAnimationFrame(s)},y=()=>{n&&(cancelAnimationFrame(n),n=0)},h=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",f=>{o&&(console.log("visible",f),f?d():l())});let p=this.visible;return{start(){o||(o=!0,p?d():l())},stop(){o=!1,y(),h()}}}}});var Mr,ls=Z(()=>{"use strict";_e();ss();bt();Mr=class extends Ur{constructor(r,n,i){super(n,i);this.httpClient=Me.create();this.gameId=D.mpId,this.sessionId=D.sessionId,this.track=r}reporter(r){return P(this,null,function*(){let{event:n,params:i}=r;yield this.httpClient.post("/api/base/app-event",{data:{eventType:n,gameInfo:H({gameId:this.gameId,sessionId:this.sessionId},i)}})})}tracker(r,n=null){this.track(r,n)}}});var us,Ud,Ne,Md,Li,dt,rt=Z(()=>{"use strict";as();V();V();Oi();Ni();ls();_e();xi();us=ve(),Ud={type:yt.WebSDK,platform:"h5",jssdk_version:D.sdkInfo.jssdkVersion,mp_id:D.mpId,mp_version:D.mpVersion},{track:Ne,trackPerformance:Md}=rs((...e)=>{var a,s,l,d;let[,t]=e,r=t,n=Oa(r.extra)?r.extra:mi(r.extra)?JSON.parse(r.extra):{},i=pe(H({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(s=r.mp_version)!=null?s:""}),o={name:t.tag,type:lt.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(d=(l=D.hostUserInfo)==null?void 0:l.uid)!=null?d:null};Lr.trackEvent(o,yt.WebSDK)},Ud);us.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Md(e,t,r)});us.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Ne(e,t)});Li=new Be,dt=new Mr(Ne,Li)});function cs(e){let t=gi.config[e];return t||(t={},gi.config[e]=t),(r,n)=>{if(t[r]){De.warn(`[can i use] ${r} already registered`);return}t[r]=H({},n)}}var ds=Z(()=>{"use strict";V()});function Ui(e){fs=e}function Br(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>Br(t)):Object.keys(e).reduce((t,r)=>(t[r]=Br(e[r]),t),{})}function qe(e){return typeof e=="number"}function Mi(e){let t=Bi(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function Bi(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var fs,ce,Fr,jr,Jr,Vr,wt,Hr,$r,Gr,qr,Kr,Wr,zr,Qr,Yr,Xr,Zr,en,Fi=Z(()=>{"use strict";fs=!1;ce=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(fs)if(typeof t=="string")this.errors.push(t);else{let r=`${this.path} should be ${t.expect}`;this._optional&&t.expect!=="undefined"?r+=" or undefined, ":r+=", ",r+=`but got ${Mi(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return Br(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:Br(this._default)}optional(){return this._optional=!0,this}};Fr=class extends ce{validate(t){return this._optional&&t===void 0?!0:qe(t)?qe(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):qe(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):qe(this._greater)&&t<=this._greater?this.fail(`the value of ${this.path} should be greater than ${this._greater}`):this._isInt&&t!==Math.floor(t)?this.fail(`the value of ${this.path} should be integer but got ${t}`):!0:this.fail({expect:"number",actual:t})}min(t){return this._min=t,this}max(t){return this._max=t,this}isInt(t){return this._isInt=t,this}greater(t){return this._greater=t,this}},jr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},Jr=class extends ce{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(qe(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(qe(this._minLength)&&t.length<this._minLength)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minLength}`);if(typeof this._pattern=="string"){if(!new RegExp(this._pattern).test(t))return this.fail(`${this.path} should match pattern "${this._pattern}"`)}else if(this._pattern&&!this._pattern.test(t))return this.fail(`${this.path} should match pattern "${this._pattern.toString()}"`);return!0}minLength(t){return this._minLength=t,this}maxLength(t){return this._maxLength=t,this}pattern(t){return this._pattern=t,this}},Vr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},wt=class extends ce{validate(t){return!0}},Hr=class extends ce{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},$r=class extends ce{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},Gr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},qr=class extends ce{constructor(...t){super(),this._items=t}validate(t){if(this._optional&&t===void 0)return!0;if(!this._items.includes(t)){let r=this._items.map(n=>JSON.stringify(n)).join(", ");return this.fail(`expect ${this.path} to be one of ${r}, but got ${Mi(t)}`)}return!0}},Kr=class extends ce{constructor(r){super();this._item=r}validate(r){if(this._optional&&r===void 0)return!0;if(!Array.isArray(r))return this.fail({expect:"array",actual:r});if(qe(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(qe(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(qe(this._length)&&r.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let n=this._item;if(!n)return!0;let i=!0;if(r.forEach((o,a)=>{if(n.path=`${this.path}[${a}]`,n.errors=this.errors,o===void 0&&n.hasDefault){r[a]=n.defaultValue;return}n.validate(o)||(n.hasFallback?r[a]=n.fallbackValue:i=!1)}),this._uniqueItems){let o=new Map;for(let a in r)o.has(r[a])?i=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${o.get(r[a])}] and ${this.path}[${a}] are identical)`):o.set(r[a],a)}return i}minItems(r){return this._minItems=r,this}maxItems(r){return this._maxItems=r,this}uniqueItems(){return this._uniqueItems=!0,this}length(r){return this._length=r,this}},Wr=class extends ce{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(Bi(r)!=="object")return this.fail({expect:"object",actual:r});let i=r,o=this._value;o.errors=this.errors;let a=!0;for(let s in i){let l=i[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?o.path=`${this.path}.${s}`:o.path=`${this.path}["${s}"]`,!(l===void 0&&o._optional)){if(l===void 0&&o.hasDefault){i[s]=o.defaultValue;continue}o.validate(l)||(o.hasFallback?i[s]=o.fallbackValue:a=!1)}}return a}},zr=class extends ce{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(Bi(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,i=!0;for(let o in this._object){let a=n[o],s=this._object[o];if(s.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(o)?s.path=`${this.path}.${o}`:s.path=`${this.path}["${o}"]`,!(s._optional&&a===void 0)){if(a===void 0&&s.hasDefault){n[o]=s.defaultValue;continue}s.validate(a)||(s.hasFallback?n[o]=s.fallbackValue:i=!1)}}return i}},Qr=class extends ce{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:Mi(this.value),actual:r}):!0}},Yr=class extends ce{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,i=this._items.length;for(let o=0;o<i;o++){let a=this._items[o];if(a.errors=[],a.path=this.path,!a.validate(t))r.push(a.errors.join("; "));else if(!n){n=!0;break}}if(!n){let o=r.join(`
1
+ var Mc=Object.create;var ni=Object.defineProperty,Bc=Object.defineProperties,Fc=Object.getOwnPropertyDescriptor,jc=Object.getOwnPropertyDescriptors,Jc=Object.getOwnPropertyNames,Cr=Object.getOwnPropertySymbols,ya=Object.getPrototypeOf,ii=Object.prototype.hasOwnProperty,ba=Object.prototype.propertyIsEnumerable,Vc=Reflect.get;var ga=(e,t,r)=>t in e?ni(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,H=(e,t)=>{for(var r in t||(t={}))ii.call(t,r)&&ga(e,r,t[r]);if(Cr)for(var r of Cr(t))ba.call(t,r)&&ga(e,r,t[r]);return e},pe=(e,t)=>Bc(e,jc(t));var Vt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var wa=(e,t)=>{var r={};for(var n in e)ii.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Cr)for(var n of Cr(e))t.indexOf(n)<0&&ba.call(e,n)&&(r[n]=e[n]);return r};var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var oi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Hc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Jc(t))!ii.call(e,i)&&i!==r&&ni(e,i,{get:()=>t[i],enumerable:!(n=Fc(t,i))||n.enumerable});return e};var ai=(e,t,r)=>(r=e!=null?Mc(ya(e)):{},Hc(t||!e||!e.__esModule?ni(r,"default",{value:e,enumerable:!0}):r,e));var Ea=(e,t,r)=>Vc(ya(e),r,t);var P=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(d){i(d)}},a=l=>{try{s(r.throw(l))}catch(d){i(d)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});function Xc(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function xa(e){return new Promise(t=>setTimeout(t,e))}function mi(e){return typeof e=="string"}function Oa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Pa(e){return typeof e=="object"&&Array.isArray(e)}function Zc(e){return typeof e=="undefined"}function ed(e){return Zc(e)||e===null}function td(e){return typeof e=="function"}function Da(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Na(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,o){for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=i[a],l=o[a],d=r(s,l,a,i,o);d!==void 0?i[a]=d:Sa(l)&&Sa(s)?i[a]=n(ka({},s),l):Array.isArray(l)&&Array.isArray(s)?i[a]=[...s,...l]:i[a]=l}return i}return n(e,t)}function Sa(e){return e&&typeof e=="object"&&e.constructor===Object}function La(e,t){if(Array.isArray(e))return e.concat(t)}function qt(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:l=!0}=r,d=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),y=function(...h){i=h,o=this;let p=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,l&&!p&&d()},t),p)return d()};return y.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},y.flush=()=>{if(n)return clearTimeout(n),n=null,d()},y}function id(e,t){return(...r)=>t(e,...r)}function Fa(e){return t=>id(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new nd(`${i}`))}})}function Ht(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function kr(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function cd(e){let t=e.location?kr(e.location,Ca):null,r=e.target?kr(e.target,Ca):null;return kr(zc(ka({},e),{location:t,target:r}),ld)}function yi(e){let t=e.events.map(n=>cd(n)),r=kr(e.device,ud);return[e.protocolVersion,t,r,e.project]}function dd(){try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function wd(e){return new Promise(t=>Va(e)(t))}function Va(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function Ed(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Gt(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function Id(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Sd(e[n],t[n])}function Sd(e,t){if(mi(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(td(t)){try{if(e instanceof t)return}catch(r){}if(!ed(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function Rd(){return typeof globalThis!="undefined"?globalThis[Ha]:void 0}function Cd(e){typeof globalThis!="undefined"&&(globalThis[Ha]=e)}function ve(e=!1){let t=Rd();if(!e&&t)return t;let r=new Tr,n=new fi,i={registerCommand(o,a,s){r.registerCommand({id:o,handler:a,metadata:s})},executeCommand(o,...a){return n.executeCommand(o,...a)},excuteCommandSync(o,...a){return n.executeCommandThowErr(o,...a)}};return Cd(i),i}var hi,$c,Gc,qc,Aa,Kc,Wc,Ia,ka,zc,Qc,Ta,Yc,rd,pi,vi,Ua,Ma,nd,Ba,xr,Or,_i,De,li,od,gi,Ra,ad,lt,yt,sd,Ca,ld,ud,ut,fd,Ae,hd,md,pd,ja,bi,wi,vd,_d,Ja,ui,ee,gd,yd,$t,Gt,Be,di,bd,si,Ad,Kt,Tr,fi,Ha,V=Z(()=>{"use strict";hi=Object.defineProperty,$c=Object.defineProperties,Gc=Object.getOwnPropertyDescriptor,qc=Object.getOwnPropertyDescriptors,Aa=Object.getOwnPropertySymbols,Kc=Object.prototype.hasOwnProperty,Wc=Object.prototype.propertyIsEnumerable,Ia=(e,t,r)=>t in e?hi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ka=(e,t)=>{for(var r in t||(t={}))Kc.call(t,r)&&Ia(e,r,t[r]);if(Aa)for(var r of Aa(t))Wc.call(t,r)&&Ia(e,r,t[r]);return e},zc=(e,t)=>$c(e,qc(t)),Qc=(e,t)=>{for(var r in t)hi(e,r,{get:t[r],enumerable:!0})},Ta=(e,t,r,n)=>{for(var i=n>1?void 0:n?Gc(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&hi(t,r,i),i},Yc=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(d){i(d)}},a=l=>{try{s(r.throw(l))}catch(d){i(d)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}rd=(e=>(e[e.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",e[e.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",e[e.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",e[e.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",e[e.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",e[e.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",e[e.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",e[e.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",e))(rd||{}),pi=class extends Error{constructor(e){if(typeof e=="string"){super(e),this.priority="P1";return}super(e.message),this.priority="P1",this.stack=e.stack,this.raw=e}},vi=class extends pi{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Ua=class extends pi{constructor(){super(...arguments),this.kind="USER_ERROR"}},Ma=class extends Ua{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},nd=class extends Ua{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="USER_CUSTOM_ERROR",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},Ba=class extends vi{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},xr=class extends vi{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},Or=class extends pi{constructor(e,t,r,n,i){super(e),this.message=e,this.code=t,this.kind="API_ERROR",this.name="API_ERROR",r&&(this.errorType=r),n!==void 0&&(this.stack=n),i&&(this.priority=i)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},_i=class extends vi{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};De={log:Ht("log"),warn:Ht("warn"),info:Ht("info"),error:Ht("error"),debug:Ht("debug")};Object.assign(globalThis,{logger:De});li=Symbol.for("Jolibox.canIUseMap"),od={};globalThis[li]||(globalThis[li]=od);gi={get config(){return globalThis[li]}},Ra=Symbol.for("Jolibox.canIUseMap.native"),ad={};globalThis[Ra]||(globalThis[Ra]=ad);lt=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(lt||{}),yt=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(yt||{}),sd=(e=>(e[e.App=0]="App",e[e.H5=1]="H5",e[e.Weapp=2]="Weapp",e[e.Alipay=3]="Alipay",e[e.Gcash=4]="Gcash",e[e.Dana=5]="Dana",e[e.Umma=6]="Umma",e[e.WebSDK=1e3]="WebSDK",e[e.AppSDK=1001]="AppSDK",e[e.Other=9999]="Other",e))(sd||{}),Ca=["name","params"],ld=["name","type","location","target","extra","timestamp","userId"],ud=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];ut=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});dd();fd=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Ae={isiOS:navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),iosVersion:()=>{let e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||"0",10)]},isAndroid:navigator.userAgent.includes("Android"),isMac:navigator.userAgent.includes("Mac"),isFacebook:navigator.userAgent.includes("FB_IAB"),isPC:!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},hd=()=>Ae.isiOS?"iOS":Ae.isAndroid?"Android":Ae.isMac?"Mac":Ae.isFacebook?"Facebook":"PC",md="device_id",pd="advertising_id",ja=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,ut()),window.__joliboxLocalStorage__.getItem(e)),bi=()=>new URLSearchParams(window.location.search).get("deviceId")||ja(md),wi=()=>new URLSearchParams(window.location.search).get("advertisingId")||ja(pd),vd=e=>e.charAt(0).toUpperCase()+e.slice(1),_d=()=>{var e;let t=new URLSearchParams(window.location.search);return vd((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},Ja=e=>{if(fd())return window.navigator.userAgent;let t="JoliboxWebSDK",r=hd(),n=navigator.language,i=bi(),o=wi();return`${t} (${_d()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`},ui=class ci{constructor(t){this.element=t,this.next=ci.Undefined,this.prev=ci.Undefined}};ui.Undefined=new ui(void 0);ee=ui,gd=class{constructor(){this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ee.Undefined}clear(){let e=this._first;for(;e!==ee.Undefined;){let t=e.next;e.prev=ee.Undefined,e.next=ee.Undefined,e=t}this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new ee(e);if(this._first===ee.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==ee.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ee.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ee.Undefined&&e.next!==ee.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ee.Undefined&&e.next===ee.Undefined?(this._first=ee.Undefined,this._last=ee.Undefined):e.next===ee.Undefined?(this._last=this._last.prev,this._last.next=ee.Undefined):e.prev===ee.Undefined&&(this._first=this._first.next,this._first.prev=ee.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ee.Undefined;)yield e.element,e=e.next}},yd=0,$t=class{constructor(e){this.value=e,this.id=yd++}},Gt=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof $t&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let d=new $t(t);return this._listeners?this._listeners instanceof $t?this._listeners=[this._listeners,d]:this._listeners.push(d):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=d,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var y,h,p,f;if(!this._disposed){if(this._listeners instanceof $t)this._listeners.id===d.id&&(this._listeners=void 0,this._size=0,(h=(y=this.options)==null?void 0:y.onDidRemoveLastListener)==null||h.call(y));else if(this._listeners){let b=this._listeners.indexOf(d);b>=0&&(this._listeners.splice(b,1),this._size--,this._size===0&&((f=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||f.call(p)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof $t?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Be=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Gt,o=l=>t(...l.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new gd,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},di={};Qc(di,{None:()=>bd,filter:()=>Ed,once:()=>Va,toPromise:()=>wd});bd=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});si=Symbol.for("Jolibox.hostEmitter"),Ad=()=>{let e=new Be;return globalThis[si]||(globalThis[si]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[si]},Kt=Ad();Tr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Gt,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(...i){return Id(i,r),n(...i)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};Tr=Ta([Da],Tr);fi=class{constructor(){this._onWillExecuteCommand=new Gt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Gt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Tr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Xc(3e4)),this._starActivation}executeCommand(e,...t){return Yc(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),di.toPromise(di.filter(this.registry.onDidRegisterCommand,r=>r===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let r=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),n}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e,...t){let r=!1;try{return e(...t)}finally{r=!0}}};fi=Ta([Da],fi);Ha=Symbol.for("Jolibox.commands")});function ke(e,t={}){Ei.emit("ERROR_REPORT",{error:e,options:t})}var Ei,ct,$e=Z(()=>{"use strict";V();V();Ei=new Be,ct=new Be;ke.debounce=qt(ke,50,{leading:!0})});var Ai,kd,$a,Ga,qa=Z(()=>{"use strict";V();$e();Ai=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4===0?"":"=".repeat(4-t.length%4),n=atob(t+r);try{return JSON.parse(n)}catch(i){return{}}},kd=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},$a=e=>{var t;try{let i=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(i!=null&&i.length){let[o,a,s]=i;return{headerJson:Ai(o),payloadJson:Ai(a),signature:Ai(s)}}else throw"joli_source is missing"}catch(r){return ke(new Ba(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},Ga=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=kd(e),o=r[2];return`${n}.${i}.${o}`}return t}});var Td,Pr,Ka,Ii=Z(()=>{"use strict";V();Td="1.1.47",Pr=()=>Td,Ka=()=>{let e=Pr();return`${Ja(e)}`}});function Ri(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var xd,Wa,Si,za,oe,Od,D,_e=Z(()=>{"use strict";V();qa();Ii();V();xd={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:bi(),adId:wi(),pixelRatio:window.devicePixelRatio||1,platform:Ae.isAndroid?"android":Ae.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:Pr()},schema:window.location.href,platform:Ae.isAndroid?"android":Ae.isiOS?"ios":"h5"},Si=(Wa=globalThis.joliboxJSCore)==null?void 0:Wa.env,oe=Object.assign({},(za=Si==null?void 0:Si())!=null?za:xd);Od=()=>{var f,b,A,S,w,T,N,j,W,R,L;let{payloadJson:e,headerJson:t,signature:r}=oe.schema.length?$a(oe.schema):{},n=`${oe.deviceInfo.did}-${new Date().getTime()}`,o=new URL(oe.schema.length?oe.schema:window.location.href).searchParams,a=(A=(b=(f=o.get("mpId"))!=null?f:o.get("appId"))!=null?b:o.get("gameId"))!=null?A:"",s=(T=(w=(S=oe.clientSessionId)!=null?S:e==null?void 0:e.sessionId)!=null?w:o.get("sessionId"))!=null?T:n,l=!!((j=(N=e==null?void 0:e.testAdsMode)!=null?N:e==null?void 0:e.__testAdsMode)!=null?j:o.get("testAdsMode")==="true"),d=(L=(R=(W=e==null?void 0:e.joliboxEnv)!=null?W:e==null?void 0:e.__joliboxEnv)!=null?R:o.get("joliboxEnv"))!=null?L:"production",y=d==="staging",h=t==null?void 0:t.channel,p=e==null?void 0:e.__shouldInterupt;return{get startTime(){var O;return(O=performance.timeOrigin)!=null?O:performance.timing.navigationStart},get testMode(){return y},get testAdsMode(){return l},get joliboxEnv(){return d},get joliSource(){var O;return(O=o.get("joliSource"))!=null?O:null},get mpId(){var O;return(O=a!=null?a:e==null?void 0:e.id)!=null?O:""},get mpVersion(){var O;return(O=t==null?void 0:t.ver)!=null?O:Pr()},get mpType(){var O,B;return(B=(O=t==null?void 0:t.__mpType)!=null?O:e==null?void 0:e.__mpType)!=null?B:"game"},get platform(){var O;return((O=oe.platform)!=null?O:oe.deviceInfo.platform).toLowerCase()},get deviceInfo(){return oe.deviceInfo},get sdkInfo(){return oe.sdkInfo},get hostInfo(){return oe.hostInfo},get hostUserInfo(){return oe.hostUserInfo},get sessionId(){var O,B;return(B=(O=oe.clientSessionId)!=null?O:s)!=null?B:n},get channel(){return h},get webviewId(){var O;return(O=oe.webviewId)!=null?O:-1},get shouldInterupt(){return p},get from(){return e==null?void 0:e.__from},get baseApiHost(){return y?"https://stg-api.jolibox.com":"https://api.jolibox.com"},get adId(){var O;return(O=oe.deviceInfo.adId)!=null?O:oe.deviceInfo.did},get language(){return oe.deviceInfo.lang},get sdkEnvironment(){return Ri("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":Ri("gamedistribution","jolibox")?"gamedistribution":Ri("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var Q,ne,Ee;let O=(Q=oe.deviceInfo.pixelRatio)!=null?Q:1,B=(ne=oe.deviceInfo.statusBarHeight)!=null?ne:e==null?void 0:e.__androidStatusBarHeight,z=(Ee=oe.deviceInfo.navigationBarHeight)!=null?Ee:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:B!==void 0?B/O:20,navigationBarHeight:z!==void 0?z/O:10}},onEnvConfigChanged:O=>{Na(oe,O,La)},encodeJoliSourceQuery:O=>{var B,z;return t&&r?Ga(H(H({},e),O),(B=o.get("joliSource"))!=null?B:""):(z=o.get("joliSource"))!=null?z:""},setDoExitDirectly:()=>{p=!1}}},D=Od()});var Ci,Ya,Pd,Dd,Qa,Nd,Xa=Z(()=>{"use strict";V();$e();_e();V();Ci=!1,Ya=(e,t)=>e==null?!1:t in e,Pd=e=>Ya(e,"kind"),Dd=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},Qa=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=D.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:Dd(e.name)},i=pe(H({},n),{env:t.environment,isFromUser:r});r?ct.emit("GLOBAL_USER_ERROR",e,i):ct.emit("GLOBAL_ERROR",e,i)},Nd=e=>Ya(e,"kind")&&e.kind==="USER_ERROR";Ei.on("ERROR_REPORT",({error:e,options:t})=>{if(Ci)return;Ci=!0;let r=Pd(e)&&e.raw?e.raw:e;try{let n=Nd(e);Qa(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new _i(`${i}, origin error: ${r.message}`);De.error(o),Qa(new _i(o.message),{environment:t.environment},!1)}finally{Ci=!1}})});var ki,Ti=Z(()=>{"use strict";$e();V();$e();ki=e=>new Ma(e)});function Za(e,t){let r=(n,i,o)=>{let d=i!=null?i:{},{eventType:a}=d,s=wa(d,["eventType"]),l=pe(H({tag:n,eventType:a!=null?a:lt.Other},t),{extra:H({},s)});n=="globalJsError"?ke(new xr(JSON.stringify(l))):e("systemLog",l,o)};return r.debounce=qt(r,500,{leading:!0}),r}function es(e){let t=(r,n,i)=>{var s;let o=(s=i&&JSON.stringify(i))!=null?s:0,a={speed_value_type:r,total_duration:n};o&&Object.assign(a,{extra:o}),e("joliboxSpeedAnalysis",a)};return t.debounce=qt(t,500,{leading:!0}),t}var ts=Z(()=>{"use strict";V();V();$e()});function rs(e,t){let r=Za(e,t),n=es(r);return{track:r,trackPerformance:n}}var ns=Z(()=>{"use strict";ts()});var xi=Z(()=>{"use strict"});var Dr,is=Z(()=>{"use strict";_e();V();V();Dr=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return P(this,null,function*(){let r=`${D.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"}/api/fe-configs/js-sdk/samples-config`,n=yield(yield fetch(r)).json();this.samplesConfig=n})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:r}=this.samplesConfig;for(let[n,i]of Object.entries(r))if(i.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,i,o,a,s;let{nativeSDKVersion:t,jssdkVersion:r}=D.sdkInfo;return{platform:1e3,os:D.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(o=(i=D.hostInfo)==null?void 0:i.aid)!=null?o:"1",model:(a=D.deviceInfo.model)!=null?a:"UnknownModel",brand:(s=D.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:D.deviceInfo.did,jsSdkVersion:r,extra:{}}}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:"GamePage",params:r}}trackEvent(t,r,n){return P(this,null,function*(){if(this.checkIsSampled(t))return;let i=t.location?t.location:yield this.getLocation(),o=t.target||null,a=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let s=this.deviceInfo,d={protocolVersion:"1.0.0",events:[pe(H({},t),{location:i,target:o,extra:a,timestamp:Date.now(),userId:null})],device:s,project:r};try{n?yield this.doReport(yi(d),n):yield this.doReport(yi(d))}catch(y){De.log("[Jolibox SDK] report API error",y)}})}}});var Oi=Z(()=>{"use strict";ns();xi();is()});var Pi,os,Ge,Nr,Me,bt=Z(()=>{"use strict";Ii();_e();V();Pi=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(os=AbortSignal.timeout)!=null||(AbortSignal.timeout=Pi);Ge=class e{constructor(){this.httpClients=new WeakSet;this.networkRequests=[];this.maxRequestsToTrack=20;this.getNetworkStatus=()=>this.networkRequests.length===0?!0:this.networkRequests.filter(n=>n).length/this.networkRequests.length>=.6}static getInstance(){return e._instance||(e._instance=new e),e._instance}create(t){let r=new Nr(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},Nr=class{constructor(t){this.xua=Ka();this.getJoliSource=()=>D.joliSource;var n;let r=D.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com";this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return P(this,null,function*(){try{let{query:n,timeout:i}=r!=null?r:{},{headers:o}=r!=null?r:{},a=n?new URLSearchParams(n):null,s=a==null?void 0:a.toString(),l=`${this.baseUrl}${t}${s?`?${s}`:""}`,d=this.xua,y=this.getJoliSource();o=Object.assign({},o!=null?o:{},d?{"x-user-agent":d}:{},y?{"x-joli-source":y}:{});let h=yield fetch(l,{method:"GET",headers:o,credentials:"include",signal:Pi(i!=null?i:3e4)});return Ge.getInstance().recordNetworkRequest(!0),yield h.json()}catch(n){throw Ge.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return P(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,l=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${l?`?${l}`:""}`,y=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{},{"x-os-type":Ae.isAndroid?"ANDROID":Ae.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let p=yield fetch(d,{method:"POST",headers:a,body:JSON.stringify(n),signal:Pi(o!=null?o:3e4),credentials:"include"});Ge.getInstance().recordNetworkRequest(!0);let f=p.headers.get("content-type");if(f!=null&&f.includes("application/octet-stream"))try{return p.blob()}catch(b){return yield p.arrayBuffer()}if(f!=null&&f.includes("multipart/form-data")||f!=null&&f.includes("application/x-www-form-urlencoded"))try{return p.formData()}catch(b){return yield p.text()}if(f!=null&&f.includes("application/json"))try{return yield p.json()}catch(b){return yield p.text()}return p}catch(n){throw Ge.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return P(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,l=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${l?`?${l}`:""}`,y=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{});let p=yield fetch(d,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!p.ok)throw Ge.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${p.status}`);return Ge.getInstance().recordNetworkRequest(!0),yield p.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=Nr;Me=Ge.getInstance()});var Di,Lr,Ni=Z(()=>{"use strict";_e();Oi();bt();Di=class extends Dr{constructor(){super(...arguments);this.hostToApiMap={default:{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.jolibox.com":{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.pico-game.com":{test:"https://stg-collect.pico-game.com",prod:"https://collect.pico-game.com"}};this.httpClient=Me.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n,i;let r=(n=this.hostToApiMap[window.location.host])!=null?n:this.hostToApiMap.default;return(i=D.testMode)!=null&&i?r.test:r.prod}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},Lr=new Di});var Ld,as=Z(()=>{"use strict";Xa();V();Ti();V();Ni();_e();Ld=(e,t)=>{var i,o,a;let r={message:t.message,stack:(i=t.stack)!=null?i:"",errorType:t.name,source:0},n={name:e,type:lt.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:null};Lr.trackEvent(n,yt.WebSDK)};ct.on("GLOBAL_ERROR",(e,t)=>{Ld(t.tag,e)});ct.on("GLOBAL_USER_ERROR",(e,t)=>{De.log("UserError",e,t)})});var Ur,ss=Z(()=>{"use strict";Ur=class{constructor(t,r){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.timer=this.createRAFTimer(t=>{this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t})});this.interval=r!=null?r:5*1e3,t.on("visible",n=>{this.visible=n})}start(t){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:t!=null?t:0}}),this.tracker("OpenGame",{duration:t!=null?t:0}),this.timer.start()}close(t){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:t}}),this.tracker("CloseGame",{duration:t}),this.timer.stop()}createRAFTimer(t){let r=Date.now(),n,i,o=!1,a=0,s=()=>{if(!o)return;let f=Date.now(),b=f-r;b>=this.interval&&(this.visible&&(a+=Math.min(b,this.interval+1e3),t(a)),r=f),n=requestAnimationFrame(s)},l=()=>{y(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let f=Date.now();f-r>=this.interval&&(r=f)},this.interval)},d=()=>{h(),r=Date.now(),n=requestAnimationFrame(s)},y=()=>{n&&(cancelAnimationFrame(n),n=0)},h=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",f=>{o&&(console.log("visible",f),f?d():l())});let p=this.visible;return{start(){o||(o=!0,p?d():l())},stop(){o=!1,y(),h()}}}}});var Mr,ls=Z(()=>{"use strict";_e();ss();bt();Mr=class extends Ur{constructor(r,n,i){super(n,i);this.httpClient=Me.create();this.gameId=D.mpId,this.sessionId=D.sessionId,this.track=r}reporter(r){return P(this,null,function*(){let{event:n,params:i}=r;yield this.httpClient.post("/api/base/app-event",{data:{eventType:n,gameInfo:H({gameId:this.gameId,sessionId:this.sessionId},i)}})})}tracker(r,n=null){this.track(r,n)}}});var us,Ud,Ne,Md,Li,dt,rt=Z(()=>{"use strict";as();V();V();Oi();Ni();ls();_e();xi();us=ve(),Ud={type:yt.WebSDK,platform:"h5",jssdk_version:D.sdkInfo.jssdkVersion,mp_id:D.mpId,mp_version:D.mpVersion},{track:Ne,trackPerformance:Md}=rs((...e)=>{var a,s,l,d;let[,t]=e,r=t,n=Oa(r.extra)?r.extra:mi(r.extra)?JSON.parse(r.extra):{},i=pe(H({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(s=r.mp_version)!=null?s:""}),o={name:t.tag,type:lt.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(d=(l=D.hostUserInfo)==null?void 0:l.uid)!=null?d:null};Lr.trackEvent(o,yt.WebSDK)},Ud);us.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Md(e,t,r)});us.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Ne(e,t)});Li=new Be,dt=new Mr(Ne,Li)});function cs(e){let t=gi.config[e];return t||(t={},gi.config[e]=t),(r,n)=>{if(t[r]){De.warn(`[can i use] ${r} already registered`);return}t[r]=H({},n)}}var ds=Z(()=>{"use strict";V()});function Ui(e){fs=e}function Br(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>Br(t)):Object.keys(e).reduce((t,r)=>(t[r]=Br(e[r]),t),{})}function qe(e){return typeof e=="number"}function Mi(e){let t=Bi(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function Bi(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var fs,ce,Fr,jr,Jr,Vr,wt,Hr,$r,Gr,qr,Kr,Wr,zr,Qr,Yr,Xr,Zr,en,Fi=Z(()=>{"use strict";fs=!1;ce=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(fs)if(typeof t=="string")this.errors.push(t);else{let r=`${this.path} should be ${t.expect}`;this._optional&&t.expect!=="undefined"?r+=" or undefined, ":r+=", ",r+=`but got ${Mi(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return Br(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:Br(this._default)}optional(){return this._optional=!0,this}};Fr=class extends ce{validate(t){return this._optional&&t===void 0?!0:qe(t)?qe(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):qe(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):qe(this._greater)&&t<=this._greater?this.fail(`the value of ${this.path} should be greater than ${this._greater}`):this._isInt&&t!==Math.floor(t)?this.fail(`the value of ${this.path} should be integer but got ${t}`):!0:this.fail({expect:"number",actual:t})}min(t){return this._min=t,this}max(t){return this._max=t,this}isInt(t){return this._isInt=t,this}greater(t){return this._greater=t,this}},jr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},Jr=class extends ce{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(qe(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(qe(this._minLength)&&t.length<this._minLength)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minLength}`);if(typeof this._pattern=="string"){if(!new RegExp(this._pattern).test(t))return this.fail(`${this.path} should match pattern "${this._pattern}"`)}else if(this._pattern&&!this._pattern.test(t))return this.fail(`${this.path} should match pattern "${this._pattern.toString()}"`);return!0}minLength(t){return this._minLength=t,this}maxLength(t){return this._maxLength=t,this}pattern(t){return this._pattern=t,this}},Vr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},wt=class extends ce{validate(t){return!0}},Hr=class extends ce{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},$r=class extends ce{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},Gr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},qr=class extends ce{constructor(...t){super(),this._items=t}validate(t){if(this._optional&&t===void 0)return!0;if(!this._items.includes(t)){let r=this._items.map(n=>JSON.stringify(n)).join(", ");return this.fail(`expect ${this.path} to be one of ${r}, but got ${Mi(t)}`)}return!0}},Kr=class extends ce{constructor(r){super();this._item=r}validate(r){if(this._optional&&r===void 0)return!0;if(!Array.isArray(r))return this.fail({expect:"array",actual:r});if(qe(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(qe(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(qe(this._length)&&r.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let n=this._item;if(!n)return!0;let i=!0;if(r.forEach((o,a)=>{if(n.path=`${this.path}[${a}]`,n.errors=this.errors,o===void 0&&n.hasDefault){r[a]=n.defaultValue;return}n.validate(o)||(n.hasFallback?r[a]=n.fallbackValue:i=!1)}),this._uniqueItems){let o=new Map;for(let a in r)o.has(r[a])?i=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${o.get(r[a])}] and ${this.path}[${a}] are identical)`):o.set(r[a],a)}return i}minItems(r){return this._minItems=r,this}maxItems(r){return this._maxItems=r,this}uniqueItems(){return this._uniqueItems=!0,this}length(r){return this._length=r,this}},Wr=class extends ce{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(Bi(r)!=="object")return this.fail({expect:"object",actual:r});let i=r,o=this._value;o.errors=this.errors;let a=!0;for(let s in i){let l=i[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?o.path=`${this.path}.${s}`:o.path=`${this.path}["${s}"]`,!(l===void 0&&o._optional)){if(l===void 0&&o.hasDefault){i[s]=o.defaultValue;continue}o.validate(l)||(o.hasFallback?i[s]=o.fallbackValue:a=!1)}}return a}},zr=class extends ce{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(Bi(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,i=!0;for(let o in this._object){let a=n[o],s=this._object[o];if(s.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(o)?s.path=`${this.path}.${o}`:s.path=`${this.path}["${o}"]`,!(s._optional&&a===void 0)){if(a===void 0&&s.hasDefault){n[o]=s.defaultValue;continue}s.validate(a)||(s.hasFallback?n[o]=s.fallbackValue:i=!1)}}return i}},Qr=class extends ce{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:Mi(this.value),actual:r}):!0}},Yr=class extends ce{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,i=this._items.length;for(let o=0;o<i;o++){let a=this._items[o];if(a.errors=[],a.path=this.path,!a.validate(t))r.push(a.errors.join("; "));else if(!n){n=!0;break}}if(!n){let o=r.join(`
2
2
  or `);this.errors.push(o)}return n}},Xr=class extends ce{constructor(...t){super(),this._items=t;let r=0,n=t.length-1;for(;n>=0;n--){let i=t[n];if(i._optional||i.hasDefault)r+=1;else break}this._minItems=t.length-r}validate(t){if(t===void 0&&this._optional)return!0;if(!Array.isArray(t))return this.fail({expect:"array",actual:t});if(t.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);let r=!0;return this._items.forEach((n,i)=>{if(n.path=`${this.path}[${i}]`,n.errors=this.errors,t[i]===void 0&&n.hasDefault){t[i]=n.defaultValue;return}n.validate(t[i])||(n.hasFallback?t[i]=n._fallback:r=!1)}),r}},Zr=class extends ce{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},en=class extends ce{constructor(t){super(),this._ctor=t}validate(t){return t===void 0&&this._optional||t instanceof this._ctor?!0:this.fail({expect:`typedarray of ${this._ctor.name}`,actual:t})}}});function ji(e,t,r="param"){if(e.errors=[],e.path=r,Ui(!0),!e.validate(t)){let n=e.errors.join(`
3
3
  `);throw e.errors.length=0,Ui(!1),new TypeError(n)}}var F,Ji=Z(()=>{"use strict";Fi();Fi();F={object(e){return new zr(e)},array(e){return new Kr(e)},tuple(...e){return new Xr(...e)},literal(e){return new Qr(e)},or(...e){return new Yr(...e)},symbol(){return new Vr},record(e){return new Wr(e)},function(){return new Gr},boolean(){return new jr},string(){return new Jr},number(){return new Fr},undefined(){return new Hr},null(){return new $r},unknown(){return new wt},any(){return new wt},as(){return new wt},arraybuffer(){return new Zr},enum(...e){return new qr(...e)},typedarray(e){return new en(e)}}});var tn,hs,ms=Z(()=>{"use strict";V();$e();Ji();Ti();tn=1,hs=e=>{function t(n,i){return(...o)=>{var h,p,f,b;let a=Date.now(),s={method:n,trace_id:tn};tn+=1;let l="SUCCESS",d=`${n}:ok`,y=0;try{if(i.paramsSchema)try{ji(i.paramsSchema,o,"params")}catch(T){throw ki(`${n}:fail ${T.message}`)}let A=i.implement(...o),S=A,w=`${n}:ok`;if(A&&"code"in A){let{code:T,data:N,message:j}=A;l=T,S=N,w=j}return{code:l,message:w,data:S}}catch(A){let S=A;y=(p=(h=S.code)!=null?h:S.errNo)!=null?p:2e3,l="FAILURE";let w=(b=(f=S.message)!=null?f:S.errMsg)!=null?b:`${A}`;return d=`${n}:${l} ${w.replace(/^\S+:(fail|cancel)\s?/,"")}`,ke(new Or(d,y)),{code:l,message:d}}finally{let A=Date.now()-a;e("apiInvoked",pe(H({},s),{duration:A,status:l}))}}}function r(n,i){return(...o)=>P(this,null,function*(){var p,f,b,A;let a=Pa(o)?o:[o],s=Date.now(),l={method:n,trace_id:tn};tn+=1;let d=`${n}:ok`,y="SUCCESS",h={code:y,message:d};try{if(i.paramsSchema)try{ji(i.paramsSchema,a,"params")}catch(T){throw ki(T.message)}let w=yield i.implement(...a);if(w&&"code"in w){let{code:T,data:N,message:j}=w;y=T,d=j,w=N}return Object.assign(h,{code:y,message:d,data:w}),h}catch(S){let w=S,T=(f=(p=w.code)!=null?p:w.errNo)!=null?f:2e3;y="FAILURE";let N=(A=(b=w.message)!=null?b:w.errMsg)!=null?A:`${S}`,j=`${n}:${y} ${N.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(h,{code:y,message:j}),ke(new Or(j,T)),h}finally{let S=Date.now()-s;e("apiInvoked",pe(H({},l),{duration:S,status:y}))}})}return{createAPI:r,createSyncAPI:t}}});var Ke,ft,ge,Wt=Z(()=>{"use strict";ds();rt();ms();Ji();({createAPI:Ke,createSyncAPI:ft}=hs(Ne)),ge=cs("h5")});var gs=oi((_s,Gi)=>{(function(e){if(typeof _s=="object"&&typeof Gi!="undefined")Gi.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window!="undefined"?t=window:typeof global!="undefined"?t=global:typeof self!="undefined"?t=self:t=this,t.localforage=e()}})(function(){var e,t,r;return function n(i,o,a){function s(y,h){if(!o[y]){if(!i[y]){var p=typeof Vt=="function"&&Vt;if(!h&&p)return p(y,!0);if(l)return l(y,!0);var f=new Error("Cannot find module '"+y+"'");throw f.code="MODULE_NOT_FOUND",f}var b=o[y]={exports:{}};i[y][0].call(b.exports,function(A){var S=i[y][1][A];return s(S||A)},b,b.exports,n,i,o,a)}return o[y].exports}for(var l=typeof Vt=="function"&&Vt,d=0;d<a.length;d++)s(a[d]);return s}({1:[function(n,i,o){(function(a){"use strict";var s=a.MutationObserver||a.WebKitMutationObserver,l;if(s){var d=0,y=new s(A),h=a.document.createTextNode("");y.observe(h,{characterData:!0}),l=function(){h.data=d=++d%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var p=new a.MessageChannel;p.port1.onmessage=A,l=function(){p.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?l=function(){var w=a.document.createElement("script");w.onreadystatechange=function(){A(),w.onreadystatechange=null,w.parentNode.removeChild(w),w=null},a.document.documentElement.appendChild(w)}:l=function(){setTimeout(A,0)};var f,b=[];function A(){f=!0;for(var w,T,N=b.length;N;){for(T=b,b=[],w=-1;++w<N;)T[w]();N=b.length}f=!1}i.exports=S;function S(w){b.push(w)===1&&!f&&l()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,i,o){"use strict";var a=n(1);function s(){}var l={},d=["REJECTED"],y=["FULFILLED"],h=["PENDING"];i.exports=p;function p(R){if(typeof R!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,R!==s&&S(this,R)}p.prototype.catch=function(R){return this.then(null,R)},p.prototype.then=function(R,L){if(typeof R!="function"&&this.state===y||typeof L!="function"&&this.state===d)return this;var O=new this.constructor(s);if(this.state!==h){var B=this.state===y?R:L;b(O,B,this.outcome)}else this.queue.push(new f(O,R,L));return O};function f(R,L,O){this.promise=R,typeof L=="function"&&(this.onFulfilled=L,this.callFulfilled=this.otherCallFulfilled),typeof O=="function"&&(this.onRejected=O,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(R){l.resolve(this.promise,R)},f.prototype.otherCallFulfilled=function(R){b(this.promise,this.onFulfilled,R)},f.prototype.callRejected=function(R){l.reject(this.promise,R)},f.prototype.otherCallRejected=function(R){b(this.promise,this.onRejected,R)};function b(R,L,O){a(function(){var B;try{B=L(O)}catch(z){return l.reject(R,z)}B===R?l.reject(R,new TypeError("Cannot resolve promise with itself")):l.resolve(R,B)})}l.resolve=function(R,L){var O=w(A,L);if(O.status==="error")return l.reject(R,O.value);var B=O.value;if(B)S(R,B);else{R.state=y,R.outcome=L;for(var z=-1,Q=R.queue.length;++z<Q;)R.queue[z].callFulfilled(L)}return R},l.reject=function(R,L){R.state=d,R.outcome=L;for(var O=-1,B=R.queue.length;++O<B;)R.queue[O].callRejected(L);return R};function A(R){var L=R&&R.then;if(R&&(typeof R=="object"||typeof R=="function")&&typeof L=="function")return function(){L.apply(R,arguments)}}function S(R,L){var O=!1;function B(Ee){O||(O=!0,l.reject(R,Ee))}function z(Ee){O||(O=!0,l.resolve(R,Ee))}function Q(){L(z,B)}var ne=w(Q);ne.status==="error"&&B(ne.value)}function w(R,L){var O={};try{O.value=R(L),O.status="success"}catch(B){O.status="error",O.value=B}return O}p.resolve=T;function T(R){return R instanceof this?R:l.resolve(new this(s),R)}p.reject=N;function N(R){var L=new this(s);return l.reject(L,R)}p.all=j;function j(R){var L=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var O=R.length,B=!1;if(!O)return this.resolve([]);for(var z=new Array(O),Q=0,ne=-1,Ee=new this(s);++ne<O;)Ve(R[ne],ne);return Ee;function Ve(Ft,Ir){L.resolve(Ft).then(Kn,function(_t){B||(B=!0,l.reject(Ee,_t))});function Kn(_t){z[Ir]=_t,++Q===O&&!B&&(B=!0,l.resolve(Ee,z))}}}p.race=W;function W(R){var L=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var O=R.length,B=!1;if(!O)return this.resolve([]);for(var z=-1,Q=new this(s);++z<O;)ne(R[z]);return Q;function ne(Ee){L.resolve(Ee).then(function(Ve){B||(B=!0,l.resolve(Q,Ve))},function(Ve){B||(B=!0,l.reject(Q,Ve))})}}},{1:1}],3:[function(n,i,o){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=n(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(n,i,o){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u};function s(u,m){if(!(u instanceof m))throw new TypeError("Cannot call a class as a function")}function l(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(u){return}}var d=l();function y(){try{if(!d||!d.open)return!1;var u=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),m=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!u||m)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(c){return!1}}function h(u,m){u=u||[],m=m||{};try{return new Blob(u,m)}catch(v){if(v.name!=="TypeError")throw v;for(var c=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,_=new c,g=0;g<u.length;g+=1)_.append(u[g]);return _.getBlob(m.type)}}typeof Promise=="undefined"&&n(3);var p=Promise;function f(u,m){m&&u.then(function(c){m(null,c)},function(c){m(c)})}function b(u,m,c){typeof m=="function"&&u.then(m),typeof c=="function"&&u.catch(c)}function A(u){return typeof u!="string"&&(console.warn(u+" used as a key, but it is not a string."),u=String(u)),u}function S(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var w="local-forage-detect-blob-support",T=void 0,N={},j=Object.prototype.toString,W="readonly",R="readwrite";function L(u){for(var m=u.length,c=new ArrayBuffer(m),_=new Uint8Array(c),g=0;g<m;g++)_[g]=u.charCodeAt(g);return c}function O(u){return new p(function(m){var c=u.transaction(w,R),_=h([""]);c.objectStore(w).put(_,"key"),c.onabort=function(g){g.preventDefault(),g.stopPropagation(),m(!1)},c.oncomplete=function(){var g=navigator.userAgent.match(/Chrome\/(\d+)/),v=navigator.userAgent.match(/Edge\//);m(v||!g||parseInt(g[1],10)>=43)}}).catch(function(){return!1})}function B(u){return typeof T=="boolean"?p.resolve(T):O(u).then(function(m){return T=m,T})}function z(u){var m=N[u.name],c={};c.promise=new p(function(_,g){c.resolve=_,c.reject=g}),m.deferredOperations.push(c),m.dbReady?m.dbReady=m.dbReady.then(function(){return c.promise}):m.dbReady=c.promise}function Q(u){var m=N[u.name],c=m.deferredOperations.pop();if(c)return c.resolve(),c.promise}function ne(u,m){var c=N[u.name],_=c.deferredOperations.pop();if(_)return _.reject(m),_.promise}function Ee(u,m){return new p(function(c,_){if(N[u.name]=N[u.name]||Xo(),u.db)if(m)z(u),u.db.close();else return c(u.db);var g=[u.name];m&&g.push(u.version);var v=d.open.apply(d,g);m&&(v.onupgradeneeded=function(E){var I=v.result;try{I.createObjectStore(u.storeName),E.oldVersion<=1&&I.createObjectStore(w)}catch(C){if(C.name==="ConstraintError")console.warn('The database "'+u.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+u.storeName+'" already exists.');else throw C}}),v.onerror=function(E){E.preventDefault(),_(v.error)},v.onsuccess=function(){var E=v.result;E.onversionchange=function(I){I.target.close()},c(E),Q(u)}})}function Ve(u){return Ee(u,!1)}function Ft(u){return Ee(u,!0)}function Ir(u,m){if(!u.db)return!0;var c=!u.db.objectStoreNames.contains(u.storeName),_=u.version<u.db.version,g=u.version>u.db.version;if(_&&(u.version!==m&&console.warn('The database "'+u.name+`" can't be downgraded from version `+u.db.version+" to version "+u.version+"."),u.version=u.db.version),g||c){if(c){var v=u.db.version+1;v>u.version&&(u.version=v)}return!0}return!1}function Kn(u){return new p(function(m,c){var _=new FileReader;_.onerror=c,_.onloadend=function(g){var v=btoa(g.target.result||"");m({__local_forage_encoded_blob:!0,data:v,type:u.type})},_.readAsBinaryString(u)})}function _t(u){var m=L(atob(u.data));return h([m],{type:u.type})}function Yo(u){return u&&u.__local_forage_encoded_blob}function Bu(u){var m=this,c=m._initReady().then(function(){var _=N[m._dbInfo.name];if(_&&_.dbReady)return _.dbReady});return b(c,u,u),c}function Fu(u){z(u);for(var m=N[u.name],c=m.forages,_=0;_<c.length;_++){var g=c[_];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return u.db=null,Ve(u).then(function(v){return u.db=v,Ir(u)?Ft(u):v}).then(function(v){u.db=m.db=v;for(var E=0;E<c.length;E++)c[E]._dbInfo.db=v}).catch(function(v){throw ne(u,v),v})}function He(u,m,c,_){_===void 0&&(_=1);try{var g=u.db.transaction(u.storeName,m);c(null,g)}catch(v){if(_>0&&(!u.db||v.name==="InvalidStateError"||v.name==="NotFoundError"))return p.resolve().then(function(){if(!u.db||v.name==="NotFoundError"&&!u.db.objectStoreNames.contains(u.storeName)&&u.version<=u.db.version)return u.db&&(u.version=u.db.version+1),Ft(u)}).then(function(){return Fu(u).then(function(){He(u,m,c,_-1)})}).catch(c);c(v)}}function Xo(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function ju(u){var m=this,c={db:null};if(u)for(var _ in u)c[_]=u[_];var g=N[c.name];g||(g=Xo(),N[c.name]=g),g.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=Bu);var v=[];function E(){return p.resolve()}for(var I=0;I<g.forages.length;I++){var C=g.forages[I];C!==m&&v.push(C._initReady().catch(E))}var k=g.forages.slice(0);return p.all(v).then(function(){return c.db=g.db,Ve(c)}).then(function(x){return c.db=x,Ir(c,m._defaultConfig.version)?Ft(c):x}).then(function(x){c.db=g.db=x,m._dbInfo=c;for(var U=0;U<k.length;U++){var J=k[U];J!==m&&(J._dbInfo.db=c.db,J._dbInfo.version=c.version)}})}function Ju(u,m){var c=this;u=A(u);var _=new p(function(g,v){c.ready().then(function(){He(c._dbInfo,W,function(E,I){if(E)return v(E);try{var C=I.objectStore(c._dbInfo.storeName),k=C.get(u);k.onsuccess=function(){var x=k.result;x===void 0&&(x=null),Yo(x)&&(x=_t(x)),g(x)},k.onerror=function(){v(k.error)}}catch(x){v(x)}})}).catch(v)});return f(_,m),_}function Vu(u,m){var c=this,_=new p(function(g,v){c.ready().then(function(){He(c._dbInfo,W,function(E,I){if(E)return v(E);try{var C=I.objectStore(c._dbInfo.storeName),k=C.openCursor(),x=1;k.onsuccess=function(){var U=k.result;if(U){var J=U.value;Yo(J)&&(J=_t(J));var q=u(J,U.key,x++);q!==void 0?g(q):U.continue()}else g()},k.onerror=function(){v(k.error)}}catch(U){v(U)}})}).catch(v)});return f(_,m),_}function Hu(u,m,c){var _=this;u=A(u);var g=new p(function(v,E){var I;_.ready().then(function(){return I=_._dbInfo,j.call(m)==="[object Blob]"?B(I.db).then(function(C){return C?m:Kn(m)}):m}).then(function(C){He(_._dbInfo,R,function(k,x){if(k)return E(k);try{var U=x.objectStore(_._dbInfo.storeName);C===null&&(C=void 0);var J=U.put(C,u);x.oncomplete=function(){C===void 0&&(C=null),v(C)},x.onabort=x.onerror=function(){var q=J.error?J.error:J.transaction.error;E(q)}}catch(q){E(q)}})}).catch(E)});return f(g,c),g}function $u(u,m){var c=this;u=A(u);var _=new p(function(g,v){c.ready().then(function(){He(c._dbInfo,R,function(E,I){if(E)return v(E);try{var C=I.objectStore(c._dbInfo.storeName),k=C.delete(u);I.oncomplete=function(){g()},I.onerror=function(){v(k.error)},I.onabort=function(){var x=k.error?k.error:k.transaction.error;v(x)}}catch(x){v(x)}})}).catch(v)});return f(_,m),_}function Gu(u){var m=this,c=new p(function(_,g){m.ready().then(function(){He(m._dbInfo,R,function(v,E){if(v)return g(v);try{var I=E.objectStore(m._dbInfo.storeName),C=I.clear();E.oncomplete=function(){_()},E.onabort=E.onerror=function(){var k=C.error?C.error:C.transaction.error;g(k)}}catch(k){g(k)}})}).catch(g)});return f(c,u),c}function qu(u){var m=this,c=new p(function(_,g){m.ready().then(function(){He(m._dbInfo,W,function(v,E){if(v)return g(v);try{var I=E.objectStore(m._dbInfo.storeName),C=I.count();C.onsuccess=function(){_(C.result)},C.onerror=function(){g(C.error)}}catch(k){g(k)}})}).catch(g)});return f(c,u),c}function Ku(u,m){var c=this,_=new p(function(g,v){if(u<0){g(null);return}c.ready().then(function(){He(c._dbInfo,W,function(E,I){if(E)return v(E);try{var C=I.objectStore(c._dbInfo.storeName),k=!1,x=C.openKeyCursor();x.onsuccess=function(){var U=x.result;if(!U){g(null);return}u===0||k?g(U.key):(k=!0,U.advance(u))},x.onerror=function(){v(x.error)}}catch(U){v(U)}})}).catch(v)});return f(_,m),_}function Wu(u){var m=this,c=new p(function(_,g){m.ready().then(function(){He(m._dbInfo,W,function(v,E){if(v)return g(v);try{var I=E.objectStore(m._dbInfo.storeName),C=I.openKeyCursor(),k=[];C.onsuccess=function(){var x=C.result;if(!x){_(k);return}k.push(x.key),x.continue()},C.onerror=function(){g(C.error)}}catch(x){g(x)}})}).catch(g)});return f(c,u),c}function zu(u,m){m=S.apply(this,arguments);var c=this.config();u=typeof u!="function"&&u||{},u.name||(u.name=u.name||c.name,u.storeName=u.storeName||c.storeName);var _=this,g;if(!u.name)g=p.reject("Invalid arguments");else{var v=u.name===c.name&&_._dbInfo.db,E=v?p.resolve(_._dbInfo.db):Ve(u).then(function(I){var C=N[u.name],k=C.forages;C.db=I;for(var x=0;x<k.length;x++)k[x]._dbInfo.db=I;return I});u.storeName?g=E.then(function(I){if(I.objectStoreNames.contains(u.storeName)){var C=I.version+1;z(u);var k=N[u.name],x=k.forages;I.close();for(var U=0;U<x.length;U++){var J=x[U];J._dbInfo.db=null,J._dbInfo.version=C}var q=new p(function(K,ue){var ie=d.open(u.name,C);ie.onerror=function(Pe){var Jt=ie.result;Jt.close(),ue(Pe)},ie.onupgradeneeded=function(){var Pe=ie.result;Pe.deleteObjectStore(u.storeName)},ie.onsuccess=function(){var Pe=ie.result;Pe.close(),K(Pe)}});return q.then(function(K){k.db=K;for(var ue=0;ue<x.length;ue++){var ie=x[ue];ie._dbInfo.db=K,Q(ie._dbInfo)}}).catch(function(K){throw(ne(u,K)||p.resolve()).catch(function(){}),K})}}):g=E.then(function(I){z(u);var C=N[u.name],k=C.forages;I.close();for(var x=0;x<k.length;x++){var U=k[x];U._dbInfo.db=null}var J=new p(function(q,K){var ue=d.deleteDatabase(u.name);ue.onerror=function(){var ie=ue.result;ie&&ie.close(),K(ue.error)},ue.onblocked=function(){console.warn('dropInstance blocked for database "'+u.name+'" until all open connections are closed')},ue.onsuccess=function(){var ie=ue.result;ie&&ie.close(),q(ie)}});return J.then(function(q){C.db=q;for(var K=0;K<k.length;K++){var ue=k[K];Q(ue._dbInfo)}}).catch(function(q){throw(ne(u,q)||p.resolve()).catch(function(){}),q})})}return f(g,m),g}var Qu={_driver:"asyncStorage",_initStorage:ju,_support:y(),iterate:Vu,getItem:Ju,setItem:Hu,removeItem:$u,clear:Gu,length:qu,key:Ku,keys:Wu,dropInstance:zu};function Yu(){return typeof openDatabase=="function"}var et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xu="~~local_forage_type~",Zo=/^~~local_forage_type~([^~]+)~/,Sr="__lfsc__:",Wn=Sr.length,zn="arbf",Qn="blob",ea="si08",ta="ui08",ra="uic8",na="si16",ia="si32",oa="ur16",aa="ui32",sa="fl32",la="fl64",ua=Wn+zn.length,ca=Object.prototype.toString;function da(u){var m=u.length*.75,c=u.length,_,g=0,v,E,I,C;u[u.length-1]==="="&&(m--,u[u.length-2]==="="&&m--);var k=new ArrayBuffer(m),x=new Uint8Array(k);for(_=0;_<c;_+=4)v=et.indexOf(u[_]),E=et.indexOf(u[_+1]),I=et.indexOf(u[_+2]),C=et.indexOf(u[_+3]),x[g++]=v<<2|E>>4,x[g++]=(E&15)<<4|I>>2,x[g++]=(I&3)<<6|C&63;return k}function Yn(u){var m=new Uint8Array(u),c="",_;for(_=0;_<m.length;_+=3)c+=et[m[_]>>2],c+=et[(m[_]&3)<<4|m[_+1]>>4],c+=et[(m[_+1]&15)<<2|m[_+2]>>6],c+=et[m[_+2]&63];return m.length%3===2?c=c.substring(0,c.length-1)+"=":m.length%3===1&&(c=c.substring(0,c.length-2)+"=="),c}function Zu(u,m){var c="";if(u&&(c=ca.call(u)),u&&(c==="[object ArrayBuffer]"||u.buffer&&ca.call(u.buffer)==="[object ArrayBuffer]")){var _,g=Sr;u instanceof ArrayBuffer?(_=u,g+=zn):(_=u.buffer,c==="[object Int8Array]"?g+=ea:c==="[object Uint8Array]"?g+=ta:c==="[object Uint8ClampedArray]"?g+=ra:c==="[object Int16Array]"?g+=na:c==="[object Uint16Array]"?g+=oa:c==="[object Int32Array]"?g+=ia:c==="[object Uint32Array]"?g+=aa:c==="[object Float32Array]"?g+=sa:c==="[object Float64Array]"?g+=la:m(new Error("Failed to get type for BinaryArray"))),m(g+Yn(_))}else if(c==="[object Blob]"){var v=new FileReader;v.onload=function(){var E=Xu+u.type+"~"+Yn(this.result);m(Sr+Qn+E)},v.readAsArrayBuffer(u)}else try{m(JSON.stringify(u))}catch(E){console.error("Couldn't convert value into a JSON string: ",u),m(null,E)}}function ec(u){if(u.substring(0,Wn)!==Sr)return JSON.parse(u);var m=u.substring(ua),c=u.substring(Wn,ua),_;if(c===Qn&&Zo.test(m)){var g=m.match(Zo);_=g[1],m=m.substring(g[0].length)}var v=da(m);switch(c){case zn:return v;case Qn:return h([v],{type:_});case ea:return new Int8Array(v);case ta:return new Uint8Array(v);case ra:return new Uint8ClampedArray(v);case na:return new Int16Array(v);case oa:return new Uint16Array(v);case ia:return new Int32Array(v);case aa:return new Uint32Array(v);case sa:return new Float32Array(v);case la:return new Float64Array(v);default:throw new Error("Unkown type: "+c)}}var Xn={serialize:Zu,deserialize:ec,stringToBuffer:da,bufferToString:Yn};function fa(u,m,c,_){u.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,_)}function tc(u){var m=this,c={db:null};if(u)for(var _ in u)c[_]=typeof u[_]!="string"?u[_].toString():u[_];var g=new p(function(v,E){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(I){return E(I)}c.db.transaction(function(I){fa(I,c,function(){m._dbInfo=c,v()},function(C,k){E(k)})},E)});return c.serializer=Xn,g}function tt(u,m,c,_,g,v){u.executeSql(c,_,g,function(E,I){I.code===I.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[m.storeName],function(C,k){k.rows.length?v(C,I):fa(C,m,function(){C.executeSql(c,_,g,v)},v)},v):v(E,I)},v)}function rc(u,m){var c=this;u=A(u);var _=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){tt(I,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[u],function(C,k){var x=k.rows.length?k.rows.item(0).value:null;x&&(x=E.serializer.deserialize(x)),g(x)},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function nc(u,m){var c=this,_=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){tt(I,E,"SELECT * FROM "+E.storeName,[],function(C,k){for(var x=k.rows,U=x.length,J=0;J<U;J++){var q=x.item(J),K=q.value;if(K&&(K=E.serializer.deserialize(K)),K=u(K,q.key,J+1),K!==void 0){g(K);return}}g()},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function ha(u,m,c,_){var g=this;u=A(u);var v=new p(function(E,I){g.ready().then(function(){m===void 0&&(m=null);var C=m,k=g._dbInfo;k.serializer.serialize(m,function(x,U){U?I(U):k.db.transaction(function(J){tt(J,k,"INSERT OR REPLACE INTO "+k.storeName+" (key, value) VALUES (?, ?)",[u,x],function(){E(C)},function(q,K){I(K)})},function(J){if(J.code===J.QUOTA_ERR){if(_>0){E(ha.apply(g,[u,C,c,_-1]));return}I(J)}})})}).catch(I)});return f(v,c),v}function ic(u,m,c){return ha.apply(this,[u,m,c,1])}function oc(u,m){var c=this;u=A(u);var _=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){tt(I,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[u],function(){g()},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function ac(u){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){tt(E,v,"DELETE FROM "+v.storeName,[],function(){_()},function(I,C){g(C)})})}).catch(g)});return f(c,u),c}function sc(u){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){tt(E,v,"SELECT COUNT(key) as c FROM "+v.storeName,[],function(I,C){var k=C.rows.item(0).c;_(k)},function(I,C){g(C)})})}).catch(g)});return f(c,u),c}function lc(u,m){var c=this,_=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){tt(I,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[u+1],function(C,k){var x=k.rows.length?k.rows.item(0).key:null;g(x)},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function uc(u){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){tt(E,v,"SELECT key FROM "+v.storeName,[],function(I,C){for(var k=[],x=0;x<C.rows.length;x++)k.push(C.rows.item(x).key);_(k)},function(I,C){g(C)})})}).catch(g)});return f(c,u),c}function cc(u){return new p(function(m,c){u.transaction(function(_){_.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(g,v){for(var E=[],I=0;I<v.rows.length;I++)E.push(v.rows.item(I).name);m({db:u,storeNames:E})},function(g,v){c(v)})},function(_){c(_)})})}function dc(u,m){m=S.apply(this,arguments);var c=this.config();u=typeof u!="function"&&u||{},u.name||(u.name=u.name||c.name,u.storeName=u.storeName||c.storeName);var _=this,g;return u.name?g=new p(function(v){var E;u.name===c.name?E=_._dbInfo.db:E=openDatabase(u.name,"","",0),u.storeName?v({db:E,storeNames:[u.storeName]}):v(cc(E))}).then(function(v){return new p(function(E,I){v.db.transaction(function(C){function k(q){return new p(function(K,ue){C.executeSql("DROP TABLE IF EXISTS "+q,[],function(){K()},function(ie,Pe){ue(Pe)})})}for(var x=[],U=0,J=v.storeNames.length;U<J;U++)x.push(k(v.storeNames[U]));p.all(x).then(function(){E()}).catch(function(q){I(q)})},function(C){I(C)})})}):g=p.reject("Invalid arguments"),f(g,m),g}var fc={_driver:"webSQLStorage",_initStorage:tc,_support:Yu(),iterate:nc,getItem:rc,setItem:ic,removeItem:oc,clear:ac,length:sc,key:lc,keys:uc,dropInstance:dc};function hc(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(u){return!1}}function ma(u,m){var c=u.name+"/";return u.storeName!==m.storeName&&(c+=u.storeName+"/"),c}function mc(){var u="_localforage_support_test";try{return localStorage.setItem(u,!0),localStorage.removeItem(u),!1}catch(m){return!0}}function pc(){return!mc()||localStorage.length>0}function vc(u){var m=this,c={};if(u)for(var _ in u)c[_]=u[_];return c.keyPrefix=ma(u,m._defaultConfig),pc()?(m._dbInfo=c,c.serializer=Xn,p.resolve()):p.reject()}function _c(u){var m=this,c=m.ready().then(function(){for(var _=m._dbInfo.keyPrefix,g=localStorage.length-1;g>=0;g--){var v=localStorage.key(g);v.indexOf(_)===0&&localStorage.removeItem(v)}});return f(c,u),c}function gc(u,m){var c=this;u=A(u);var _=c.ready().then(function(){var g=c._dbInfo,v=localStorage.getItem(g.keyPrefix+u);return v&&(v=g.serializer.deserialize(v)),v});return f(_,m),_}function yc(u,m){var c=this,_=c.ready().then(function(){for(var g=c._dbInfo,v=g.keyPrefix,E=v.length,I=localStorage.length,C=1,k=0;k<I;k++){var x=localStorage.key(k);if(x.indexOf(v)===0){var U=localStorage.getItem(x);if(U&&(U=g.serializer.deserialize(U)),U=u(U,x.substring(E),C++),U!==void 0)return U}}});return f(_,m),_}function bc(u,m){var c=this,_=c.ready().then(function(){var g=c._dbInfo,v;try{v=localStorage.key(u)}catch(E){v=null}return v&&(v=v.substring(g.keyPrefix.length)),v});return f(_,m),_}function wc(u){var m=this,c=m.ready().then(function(){for(var _=m._dbInfo,g=localStorage.length,v=[],E=0;E<g;E++){var I=localStorage.key(E);I.indexOf(_.keyPrefix)===0&&v.push(I.substring(_.keyPrefix.length))}return v});return f(c,u),c}function Ec(u){var m=this,c=m.keys().then(function(_){return _.length});return f(c,u),c}function Ac(u,m){var c=this;u=A(u);var _=c.ready().then(function(){var g=c._dbInfo;localStorage.removeItem(g.keyPrefix+u)});return f(_,m),_}function Ic(u,m,c){var _=this;u=A(u);var g=_.ready().then(function(){m===void 0&&(m=null);var v=m;return new p(function(E,I){var C=_._dbInfo;C.serializer.serialize(m,function(k,x){if(x)I(x);else try{localStorage.setItem(C.keyPrefix+u,k),E(v)}catch(U){(U.name==="QuotaExceededError"||U.name==="NS_ERROR_DOM_QUOTA_REACHED")&&I(U),I(U)}})})});return f(g,c),g}function Sc(u,m){if(m=S.apply(this,arguments),u=typeof u!="function"&&u||{},!u.name){var c=this.config();u.name=u.name||c.name,u.storeName=u.storeName||c.storeName}var _=this,g;return u.name?g=new p(function(v){u.storeName?v(ma(u,_._defaultConfig)):v(u.name+"/")}).then(function(v){for(var E=localStorage.length-1;E>=0;E--){var I=localStorage.key(E);I.indexOf(v)===0&&localStorage.removeItem(I)}}):g=p.reject("Invalid arguments"),f(g,m),g}var Rc={_driver:"localStorageWrapper",_initStorage:vc,_support:hc(),iterate:yc,getItem:gc,setItem:Ic,removeItem:Ac,clear:_c,length:Ec,key:bc,keys:wc,dropInstance:Sc},Cc=function(m,c){return m===c||typeof m=="number"&&typeof c=="number"&&isNaN(m)&&isNaN(c)},kc=function(m,c){for(var _=m.length,g=0;g<_;){if(Cc(m[g],c))return!0;g++}return!1},pa=Array.isArray||function(u){return Object.prototype.toString.call(u)==="[object Array]"},jt={},va={},gt={INDEXEDDB:Qu,WEBSQL:fc,LOCALSTORAGE:Rc},Tc=[gt.INDEXEDDB._driver,gt.WEBSQL._driver,gt.LOCALSTORAGE._driver],Rr=["dropInstance"],Zn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Rr),xc={description:"",driver:Tc.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Oc(u,m){u[m]=function(){var c=arguments;return u.ready().then(function(){return u[m].apply(u,c)})}}function ei(){for(var u=1;u<arguments.length;u++){var m=arguments[u];if(m)for(var c in m)m.hasOwnProperty(c)&&(pa(m[c])?arguments[0][c]=m[c].slice():arguments[0][c]=m[c])}return arguments[0]}var Pc=function(){function u(m){s(this,u);for(var c in gt)if(gt.hasOwnProperty(c)){var _=gt[c],g=_._driver;this[c]=g,jt[g]||this.defineDriver(_)}this._defaultConfig=ei({},xc),this._config=ei({},this._defaultConfig,m),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return u.prototype.config=function(c){if((typeof c=="undefined"?"undefined":a(c))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var _ in c){if(_==="storeName"&&(c[_]=c[_].replace(/\W/g,"_")),_==="version"&&typeof c[_]!="number")return new Error("Database version must be a number.");this._config[_]=c[_]}return"driver"in c&&c.driver?this.setDriver(this._config.driver):!0}else return typeof c=="string"?this._config[c]:this._config},u.prototype.defineDriver=function(c,_,g){var v=new p(function(E,I){try{var C=c._driver,k=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!c._driver){I(k);return}for(var x=Zn.concat("_initStorage"),U=0,J=x.length;U<J;U++){var q=x[U],K=!kc(Rr,q);if((K||c[q])&&typeof c[q]!="function"){I(k);return}}var ue=function(){for(var Jt=function(Lc){return function(){var Uc=new Error("Method "+Lc+" is not implemented by the current driver"),_a=p.reject(Uc);return f(_a,arguments[arguments.length-1]),_a}},ti=0,Nc=Rr.length;ti<Nc;ti++){var ri=Rr[ti];c[ri]||(c[ri]=Jt(ri))}};ue();var ie=function(Jt){jt[C]&&console.info("Redefining LocalForage driver: "+C),jt[C]=c,va[C]=Jt,E()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(ie,I):ie(!!c._support):ie(!0)}catch(Pe){I(Pe)}});return b(v,_,g),v},u.prototype.driver=function(){return this._driver||null},u.prototype.getDriver=function(c,_,g){var v=jt[c]?p.resolve(jt[c]):p.reject(new Error("Driver not found."));return b(v,_,g),v},u.prototype.getSerializer=function(c){var _=p.resolve(Xn);return b(_,c),_},u.prototype.ready=function(c){var _=this,g=_._driverSet.then(function(){return _._ready===null&&(_._ready=_._initDriver()),_._ready});return b(g,c,c),g},u.prototype.setDriver=function(c,_,g){var v=this;pa(c)||(c=[c]);var E=this._getSupportedDrivers(c);function I(){v._config.driver=v.driver()}function C(U){return v._extend(U),I(),v._ready=v._initStorage(v._config),v._ready}function k(U){return function(){var J=0;function q(){for(;J<U.length;){var K=U[J];return J++,v._dbInfo=null,v._ready=null,v.getDriver(K).then(C).catch(q)}I();var ue=new Error("No available storage method found.");return v._driverSet=p.reject(ue),v._driverSet}return q()}}var x=this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve();return this._driverSet=x.then(function(){var U=E[0];return v._dbInfo=null,v._ready=null,v.getDriver(U).then(function(J){v._driver=J._driver,I(),v._wrapLibraryMethodsWithReady(),v._initDriver=k(E)})}).catch(function(){I();var U=new Error("No available storage method found.");return v._driverSet=p.reject(U),v._driverSet}),b(this._driverSet,_,g),this._driverSet},u.prototype.supports=function(c){return!!va[c]},u.prototype._extend=function(c){ei(this,c)},u.prototype._getSupportedDrivers=function(c){for(var _=[],g=0,v=c.length;g<v;g++){var E=c[g];this.supports(E)&&_.push(E)}return _},u.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,_=Zn.length;c<_;c++)Oc(this,Zn[c])},u.prototype.createInstance=function(c){return new u(c)},u}(),Dc=new Pc;i.exports=Dc},{3:3}]},{},[4])(4)})});var bs=oi(sn=>{"use strict";V();Wt();rt();var Ki=ve(),tf=Ke("levelFinished",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),duration:F.number().optional(),rating:F.number().optional(),score:F.number().optional()})),implement:e=>P(sn,null,function*(){let{levelId:t,duration:r,rating:n,score:i}=e;De.info("onLevelFinished",r,n,i),yield Promise.all([dt.reporter({event:"COMPLETE_GAME_LEVEL"}),dt.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i})])})}),rf=Ke("gamePlayEnded",{paramsSchema:F.tuple(F.object({duration:F.number().optional(),rating:F.number().optional(),score:F.number()})),implement:e=>P(sn,null,function*(){let{duration:t,rating:r,score:n}=e;return De.info("onGamePlayEnded",t,r,n),dt.tracker("GamePlayEnded",{duration:t,rating:r,score:n})})}),nf=Ke("levelUpgrade",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),name:F.string().optional()})),implement:r=>P(sn,[r],function*({levelId:e,name:t}){return dt.tracker("LevelUpgrade",{name:t,levelId:e})})});Ki.registerCommand("TaskTrackerSDK.levelFinished",tf);Ki.registerCommand("TaskTrackerSDK.gamePlayEnded",rf);Ki.registerCommand("TaskTrackerSDK.levelUpgrade",nf);ge("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ge("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ge("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var ht,Et,ws,Wi,of,ln,zi=Z(()=>{"use strict";ht=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},Et=new Map,ws=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=Et.get(t.type);r&&r.forEach(n=>{try{n(t.data)}catch(i){console.warn("Callback execution failed:",i)}})}}catch(t){console.warn("Failed to parse message:",t)}},Wi=!1,of=()=>{Wi||(window.addEventListener("message",ws),Wi=!0)},ln=(e,t)=>{of(),Et.has(e)||Et.set(e,new Set);let r=Et.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&Et.delete(e),Et.size===0&&(window.removeEventListener("message",ws),Wi=!1)}}});var un,cn,dn,fn,hn,Es,mn,pn,At,af,ae,It,St,Le=Z(()=>{"use strict";V();un="UNLOCK_OPTIONS_CHANGED",cn="INVOKE_PAYMENT",dn="ON_PAYMENT_RESULT",fn="ON_USE_MODAL_EVENT",hn="ON_USE_MODAL_RESULT",Es="ON_USE_MODAL_FREQUENCY",mn="ON_USE_UNLOGIN_MODAL_EVENT",pn="INVOKE_UNLOGIN_MODAL_EVENT",At=new Be,af=()=>({on:At.on.bind(At),off:At.off.bind(At),emit:At.emit.bind(At)}),ae=af(),It={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}},St={show:!0,minInterval:8*60*60*1e3}});var yu=oi(qo=>{"use strict";_e();Le();zi();V();var gu={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};ln("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",gu[e.result],e.result),ae.emit(hn,{useModalResult:gu[e.result]})});ae.on(fn,(e,t)=>{var r;ht("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:ut()})});ln("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{ae.emit(dn,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin})});ae.on(cn,(e,t)=>P(qo,null,function*(){var r;ht("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:ut()})}));ln("ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT",e=>{var t,r,n,i,o;ae.emit(mn,{result:e.result=="ADS"?"FAILED":e.result,rewards:{jolicoin:{claimedRewardValue:(i=(n=(r=(t=e.extra)==null?void 0:t.firstLogin)==null?void 0:r.reward)==null?void 0:n.rewardValue)!=null?i:0,isFirstLogin:(o=e.isFirstLogin)!=null?o:!1}}}),e.result==="SUCCESS"&&D.onEnvConfigChanged({hostUserInfo:{isLogin:!0}})});ae.on(pn,e=>P(qo,null,function*(){ht("JOLIBOX_JOLI_UNLOGIN_MODAL_EVENT",{sequenceId:ut(),type:e})}))});rt();_e();Wt();V();var ps=ve(),Fd="env",jd="getSystemInfoSync",Jd=()=>{var i,o,a,s;let e={system:D.deviceInfo.system,platform:D.deviceInfo.platform.toLowerCase(),brand:D.deviceInfo.brand,pixelRatio:D.deviceInfo.pixelRatio,language:D.deviceInfo.lang,version:D.sdkInfo.jssdkVersion,appName:(i=D.hostInfo)==null?void 0:i.appName,SDKVersion:D.sdkInfo.nativeSDKVersion},t=(o=D.hostInfo)==null?void 0:o.version;t&&(e=pe(H({},e),{version:t}));let r=(a=D.hostInfo)==null?void 0:a.appName;r&&(e=pe(H({},e),{appName:r}));let n=(s=D.sdkInfo)==null?void 0:s.jssdkVersion;return n&&(e=pe(H({},e),{SDKVersion:n})),e},Vd=ft(jd,{implement:Jd}),Hd=ft(Fd,{implement:()=>pe(H({},D.hostInfo),{sdkInfo:D.sdkInfo,platform:D.platform,deviceInfo:D.deviceInfo})});ps.registerCommand("API.env",Hd);ps.registerCommand("API.getSystemInfoSync",Vd);ge("env",{version:"1.0.0"});ge("getSystemInfoSync",{version:"1.0.0"});V();Wt();$e();rt();var $d="onJoliboxShow",Gd="onJoliboxHide",qd="onReady",Hi=ve(),$i=Fa(ke),Vi=!0,zt=!0,rn=0,nn=Li;function Kd(){let e=Date.now();if(e-rn<100)return;rn=e;let t=document.visibilityState==="visible";t!==Vi&&(Vi=t,nn.emit("visible",Vi))}function vs(e){let t=Date.now();t-rn<100||(rn=t,e==="focus"&&!zt?zt=!0:e==="blur"&&zt&&(zt=!1),nn.emit("visible",zt))}document.addEventListener("visibilitychange",Kd);window.addEventListener("focus",()=>vs("focus"));window.addEventListener("blur",()=>vs("blur"));var Wd=ft($d,{paramsSchema:F.tuple(F.function()),implement(e){let t=$i(e);nn.on("visible",r=>{r&&t()})}}),zd=ft(Gd,{paramsSchema:F.tuple(F.function()),implement(e){let t=$i(e);nn.on("visible",r=>{!r&&t()})}}),Qd=ft(qd,{paramsSchema:F.tuple(F.function()),implement(e){let t=$i(e);Kt.on("LifecycleEvent.onReady",r=>{t(r)})}});Hi.registerCommand("LifecycleSDK.onReady",Qd);Hi.registerCommand("LifecycleSDK.onJoliboxShow",Wd);Hi.registerCommand("LifecycleSDK.onJoliboxHide",zd);ge("lifeCycle.onReady",{version:"1.0.0"});ge("lifeCycle.onJoliboxShow",{version:"1.0.0"});ge("lifeCycle.onJoliboxHide",{version:"1.0.0"});Wt();V();bt();_e();var ys=ai(gs());var on=ve(),qi=class{constructor(){this.httpClient=Me.create({baseUrl:D.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"});this.getGameId=()=>D.mpId;this.getItem=t=>P(this,null,function*(){let{code:r,data:n,message:i}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),o=n==null?void 0:n.value,a=i;return r!=="SUCCESS"&&(o=yield this.gameStore.getItem(t),console.info("[SDK] cloud storage getItem failed, read from localstorage",o),a+="fallback to localstorage"),{code:r,message:a,data:o&&o!=="undefined"?o:null}});this.setItem=(t,r)=>P(this,null,function*(){let n=typeof r=="string"?r:String(r),{code:i,message:o}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}`,{data:{key:t,value:n}});return yield this.gameStore.setItem(t,n),{code:i,message:o}});this.removeItem=t=>P(this,null,function*(){yield this.gameStore.removeItem(t);let{code:r,message:n}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/remove`,{data:{key:t}});return{code:r,message:n}});this.clear=()=>P(this,null,function*(){yield this.gameStore.clear();let{code:t,message:r}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/clear`,{});return{code:t,message:r}});this.gameId=this.getGameId(),this.gameStore=ys.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},an=new qi,Yd=Ke("getLocalStorage",{paramsSchema:F.tuple(F.string()),implement(e){return P(this,null,function*(){return yield an.getItem(e)})}});on.registerCommand("StorageSDK.getItem",Yd);ge("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Xd=Ke("setStorage",{paramsSchema:F.tuple(F.string(),F.or(F.string(),F.boolean(),F.number())),implement(e,t){return P(this,null,function*(){return yield an.setItem(e,t)})}});on.registerCommand("StorageSDK.setItem",Xd);ge("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Zd=Ke("removeStorage",{paramsSchema:F.tuple(F.string()),implement(e){return P(this,null,function*(){return yield an.removeItem(e)})}});on.registerCommand("StorageSDK.removeItem",Zd);ge("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var ef=Ke("clearStorage",{implement(){return P(this,null,function*(){return yield an.clear()})}});on.registerCommand("StorageSDK.clear",ef);ge("storage.clear",{version:"1.0.0"});var vb=ai(bs());rt();V();bt();zi();_e();Le();var As=D.testMode;function Is(){let e=new Map,t,r;return{registerRewardHandler(i,o){e.set(i,o)},handleReward(i,...o){return P(this,null,function*(){return yield i.reduce((s,l)=>P(this,null,function*(){let d=yield s;if(d===!0)return!0;As&&console.log(`handleReward ${l}`);let y=e.get(l),h=y?yield y(...o):d;return As&&console.log(`handleReward ${l} ${h}`),h}),Promise.resolve(!1))})},registerRewardsFetcher(i){return P(this,null,function*(){t=(...o)=>P(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),["ADS"]}})})},registerRewardFrequencyConfigFetcher(i){return P(this,null,function*(){r=(...o)=>P(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),{joliCoinUseAndCharge:It,loginGuide:St}}})})},getRewardsTypes(...i){return P(this,null,function*(){return t?yield t(...i):["ADS"]})},getRewardFrequencyConfig(...i){return P(this,null,function*(){return r?yield r(...i):{joliCoinUseAndCharge:It,loginGuide:St}})}}}Le();var sf=()=>(e,t)=>e==="JOLI_COIN"&&t==="ADS"?-1:e==="ADS"&&t==="JOLI_COIN"?1:0,lf=e=>e.length?e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(sf()):["ADS"],Ss=e=>{e.registerRewardsFetcher(t=>P(void 0,null,function*(){var n,i,o,a;let r=["ADS"];try{let s=yield t.post("/api/games/unlock-options",{});if(s.code!=="SUCCESS")return r;ae.emit(un,{options:((n=s.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=s.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1}});let l=((a=(o=s.data)==null?void 0:o.unlockOptions)==null?void 0:a.map(d=>d.type))||Array.from(r);return lf(l)}catch(s){return console.error("getRewardOptions error:",s),r}}))},Rs=e=>{e.registerRewardFrequencyConfigFetcher(t=>P(void 0,null,function*(){var n,i,o,a;let r=yield t.get("/api/fe-configs/web-common/global-config",{});return ae.emit(Es,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||It,loginGuide:((i=r.data)==null?void 0:i.loginGuide)||St}),{joliCoinUseAndCharge:((o=r.data)==null?void 0:o.joliCoinUseAndCharge)||It,loginGuide:((a=r.data)==null?void 0:a.loginGuide)||St}}))};var Cs=e=>t=>P(void 0,null,function*(){return console.log("trigger @jolibox/ads reward",t),e.adBreak(t),!0});Le();function nt(e,t){let r=null,n=null,i=null,o=()=>{if(i){r=Promise.resolve(i);return}r=new Promise(a=>{n=a})};return o(),e.on(t,(...a)=>{let s=a[0];i=s,n&&(n(s),n=null)}),{getData:()=>(r||o(),r),getCachedData:()=>i,clearCache:()=>{i=null,r=null},getFreshData:()=>(i=null,r=null,o(),r),updateData:a=>{if(i)return i=H(H({},i),a),r=Promise.resolve(i),n&&(n(i),n=null),i}}}Le();var Ue=nt(ae,un);_e();V();V();var it=ve();Le();Le();var Qi=(e,t)=>{let{showUnlockWithJolicoinModal:r}=t;it.registerCommand(`Rewards.${e}.useJolicoin`,()=>P(void 0,null,function*(){var s,l,d,y;let n=yield Ue.getData(),i=!!((s=n==null?void 0:n.userJoliCoin)!=null&&s.enableAutoDeduct),o=(y=(d=(l=n==null?void 0:n.options)==null?void 0:l.find(h=>h.type==="JOLI_COIN"))==null?void 0:d.joliCoinChoices[0].joliCoinQuantity)!=null?y:0;return console.log("-----unlockOptions usemodal-----",n,i,o),(yield r({enableAutoDeduct:i,userJoliCoin:n==null?void 0:n.userJoliCoin,joliCoinQuantity:o}))!=="CONFIRM"?{result:"FAILED"}:{result:"SUCCESS"}}))},Qt=(e,t)=>r=>P(void 0,null,function*(){let n=nt(ae,hn);return ae.emit(fn,e,{enableAutoDeduct:r.enableAutoDeduct,userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult});var vn=e=>P(void 0,null,function*(){return(yield e.get("/api/joli-coin/balance",{query:{type:"JOLI_COIN"}})).data});var ks=(e,t)=>e.some(r=>r.type==="JOLI_COIN"&&r.joliCoinChoices.some(n=>{var i;return n.joliCoinQuantity<=((i=t==null?void 0:t.balance)!=null?i:0)}));Le();Le();var Yi=(e,t)=>{let{httpClient:r,initiateAndAwaitPayment:n}=t;it.registerCommand(`Rewards.${e}.usePayment`,()=>P(void 0,null,function*(){var l,d,y,h,p,f;let i=yield Ue.getData(),o=yield vn(r),a=(y=(d=(l=i==null?void 0:i.options)==null?void 0:l.find(b=>b.type==="JOLI_COIN"))==null?void 0:d.joliCoinChoices[0].joliCoinQuantity)!=null?y:0,s={balance:(h=o==null?void 0:o.balance)!=null?h:0,enableAutoDeduct:(f=(p=i==null?void 0:i.userJoliCoin)==null?void 0:p.enableAutoDeduct)!=null?f:!1};return Ue.updateData({userJoliCoin:s}),console.log("-----unlockOptions payment-----",i,s,a),ks((i==null?void 0:i.options)||[],s)?{result:"CONTINUE"}:{result:(yield n({userJoliCoin:s,joliCoinQuantity:a}))==="SUCCESS"?"SUCCESS":"FAILED"}}))},Yt=(e,t)=>r=>P(void 0,null,function*(){let n=nt(ae,dn);return ae.emit(cn,e,{userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,enableAutoDeduct:r.userJoliCoin.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult});_e();Le();Le();V();var Xi=(e,t)=>{let{showUnloginModal:r,httpClient:n}=t;it.registerCommand(`Rewards.${e}.useUnloginModal`,()=>P(void 0,null,function*(){var a,s,l,d,y,h,p,f,b;let i=(a=D.hostUserInfo)==null?void 0:a.isLogin,o=yield Ue.getData();if(console.log("-----isLogin-----",!!i),!i){let A=yield r();if(console.log("-----unloginModalResult-----",A),A.result=="FAILED"||A.result=="CANCEL")return{result:"FAILED"};let{isFirstLogin:S,claimedRewardValue:w}=(l=(s=A.rewards)==null?void 0:s.jolicoin)!=null?l:{};if(A.result=="SUCCESS"){S&&w&&(yield xa(3e3));let T=yield vn(n),N=(h=(y=(d=o==null?void 0:o.options)==null?void 0:d.find(W=>W.type==="JOLI_COIN"))==null?void 0:y.joliCoinChoices[0].joliCoinQuantity)!=null?h:0,j={balance:(p=T==null?void 0:T.balance)!=null?p:0,enableAutoDeduct:(b=(f=o==null?void 0:o.userJoliCoin)==null?void 0:f.enableAutoDeduct)!=null?b:!1};if(Ue.updateData({userJoliCoin:j}),j.balance>=N)return{result:"SUCCESS"}}}return{result:"CONTINUE"}}))},Xt=(e,t)=>()=>P(void 0,null,function*(){let r=nt(ae,mn);return ae.emit(pn,e,{confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),yield r.getFreshData()});var _n=(e,t,{handlers:{handleUnlockSuccess:r,handleUnlockFailed:n,unlockOptionsHandler:i,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:a,showUnloginModal:s}})=>(Xi(e,{httpClient:t,showUnloginModal:s}),Yi(e,{httpClient:t,initiateAndAwaitPayment:o}),Qi(e,{showUnlockWithJolicoinModal:a}),l=>P(void 0,null,function*(){var d,y,h;try{let p=!0,f=[`Rewards.${e}.useUnloginModal`,`Rewards.${e}.usePayment`,`Rewards.${e}.useJolicoin`];for(let A of f){let S=yield it.executeCommand(A);if(p=p&&S.result!=="FAILED",S.result!=="CONTINUE")break}if(!p)return n==null||n(l),!1;let b=yield t.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${ut()}-${D.mpType}-${Date.now()}`,gameInfo:{gameId:D.mpId}}});return console.log("-----unlockWithJolicoin request result-----",b),b.code=="SUCCESS"?((y=l.adBreakDone)==null||y.call(l,{breakType:l.type,breakName:"name"in l&&(d=l.name)!=null?d:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in l&&((h=l.adViewed)==null||h.call(l)),r==null||r({quantity:b.data.quantity,balance:b.data.balance}),!0):(n==null||n(l),!1)}catch(p){if(console.info("JolicoinRewardHandler error:",p),p instanceof Error&&p.message=="CANCEL")throw p;return n==null||n(l),!1}finally{i.clearCache()}}));var Ts=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=()=>{r==null||r()},i=Qt("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),o=Yt("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"}),a=Xt("ADS-JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noWatchAds"});return _n("ADS-JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:Ue,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:i,showUnloginModal:a}})};var xs=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=l=>{var d;r==null||r(),(d=l.adBreakDone)==null||d.call(l,{breakType:l.type,breakFormat:l.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},i=Qt("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),o=Yt("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"}),a=Xt("JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noThanks"});return _n("JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:Ue,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:i,showUnloginModal:a}})};var We=Is();Ss(We);Rs(We);var wn,M,Ls,to,mt,Os,Us,Ms,Bs,ro,Zi,eo,uf,Zt={},Fs=[],cf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,er=Array.isArray;function ze(e,t){for(var r in t)e[r]=t[r];return e}function no(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function tr(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?wn.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return yn(e,a,n,i,null)}function yn(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++Ls:i,__i:-1,__u:0};return i==null&&M.vnode!=null&&M.vnode(o),o}function ot(e){return e.children}function Te(e,t){this.props=e,this.context=t}function Rt(e,t){if(t==null)return e.__?Rt(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Rt(e):null}function js(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return js(e)}}function Ps(e){(!e.__d&&(e.__d=!0)&&mt.push(e)&&!bn.__r++||Os!==M.debounceRendering)&&((Os=M.debounceRendering)||Us)(bn)}function bn(){for(var e,t,r,n,i,o,a,s=1;mt.length;)mt.length>s&&mt.sort(Ms),e=mt.shift(),s=mt.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=ze({},n)).__v=n.__v+1,M.vnode&&M.vnode(r),io(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i==null?Rt(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,Hs(o,r,a),r.__e!=i&&js(r)));bn.__r=0}function Js(e,t,r,n,i,o,a,s,l,d,y){var h,p,f,b,A,S,w=n&&n.__k||Fs,T=t.length;for(l=df(r,t,w,l,T),h=0;h<T;h++)(f=r.__k[h])!=null&&(p=f.__i===-1?Zt:w[f.__i]||Zt,f.__i=h,S=io(e,f,p,i,o,a,s,l,d,y),b=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&oo(p.ref,null,f),y.push(f.ref,f.__c||b,f)),A==null&&b!=null&&(A=b),4&f.__u||p.__k===f.__k?l=Vs(f,l,e):typeof f.type=="function"&&S!==void 0?l=S:b&&(l=b.nextSibling),f.__u&=-7);return r.__e=A,l}function df(e,t,r,n,i){var o,a,s,l,d,y=r.length,h=y,p=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(l=o+p,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?yn(null,a,null,null,null):er(a)?yn(ot,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?yn(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,(d=a.__i=ff(a,r,l,h))!==-1&&(h--,(s=r[d])&&(s.__u|=2)),s==null||s.__v===null?(d==-1&&(i>y?p--:i<y&&p++),typeof a.type!="function"&&(a.__u|=4)):d!=l&&(d==l-1?p--:d==l+1?p++:(d>l?p--:p++,a.__u|=4))):e.__k[o]=null;if(h)for(o=0;o<y;o++)(s=r[o])!=null&&!(2&s.__u)&&(s.__e==n&&(n=Rt(s)),Gs(s,s));return n}function Vs(e,t,r){var n,i;if(typeof e.type=="function"){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=Vs(n[i],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=Rt(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function rr(e,t){return t=t||[],e==null||typeof e=="boolean"||(er(e)?e.some(function(r){rr(r,t)}):t.push(e)),t}function ff(e,t,r,n){var i,o,a=e.key,s=e.type,l=t[r];if(l===null&&e.key==null||l&&a==l.key&&s===l.type&&!(2&l.__u))return r;if(n>(l!=null&&!(2&l.__u)?1:0))for(i=r-1,o=r+1;i>=0||o<t.length;){if(i>=0){if((l=t[i])&&!(2&l.__u)&&a==l.key&&s===l.type)return i;i--}if(o<t.length){if((l=t[o])&&!(2&l.__u)&&a==l.key&&s===l.type)return o;o++}}return-1}function Ds(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||cf.test(t)?r:r+"px"}function gn(e,t,r,n,i){var o;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Ds(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Ds(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(Bs,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.t=n.t:(r.t=ro,e.addEventListener(t,o?eo:Zi,o)):e.removeEventListener(t,o?eo:Zi,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r==null?"":r;break e}catch(a){}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function Ns(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=ro++;else if(t.u<r.t)return;return r(M.event?M.event(t):t)}}}function io(e,t,r,n,i,o,a,s,l,d){var y,h,p,f,b,A,S,w,T,N,j,W,R,L,O,B,z,Q=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[s=t.__e=r.__e]),(y=M.__b)&&y(t);e:if(typeof Q=="function")try{if(w=t.props,T="prototype"in Q&&Q.prototype.render,N=(y=Q.contextType)&&n[y.__c],j=y?N?N.props.value:y.__:n,r.__c?S=(h=t.__c=r.__c).__=h.__E:(T?t.__c=h=new Q(w,j):(t.__c=h=new Te(w,j),h.constructor=Q,h.render=mf),N&&N.sub(h),h.props=w,h.state||(h.state={}),h.context=j,h.__n=n,p=h.__d=!0,h.__h=[],h._sb=[]),T&&h.__s==null&&(h.__s=h.state),T&&Q.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=ze({},h.__s)),ze(h.__s,Q.getDerivedStateFromProps(w,h.__s))),f=h.props,b=h.state,h.__v=t,p)T&&Q.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),T&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(T&&Q.getDerivedStateFromProps==null&&w!==f&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(w,j),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(w,h.__s,j)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(h.props=w,h.state=h.__s,h.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(ne){ne&&(ne.__=t)}),W=0;W<h._sb.length;W++)h.__h.push(h._sb[W]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(w,h.__s,j),T&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(f,b,A)})}if(h.context=j,h.props=w,h.__P=e,h.__e=!1,R=M.__r,L=0,T){for(h.state=h.__s,h.__d=!1,R&&R(t),y=h.render(h.props,h.state,h.context),O=0;O<h._sb.length;O++)h.__h.push(h._sb[O]);h._sb=[]}else do h.__d=!1,R&&R(t),y=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++L<25);h.state=h.__s,h.getChildContext!=null&&(n=ze(ze({},n),h.getChildContext())),T&&!p&&h.getSnapshotBeforeUpdate!=null&&(A=h.getSnapshotBeforeUpdate(f,b)),B=y,y!=null&&y.type===ot&&y.key==null&&(B=$s(y.props.children)),s=Js(e,er(B)?B:[B],t,r,n,i,o,a,s,l,d),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),S&&(h.__E=h.__=null)}catch(ne){if(t.__v=null,l||o!=null)if(ne.then){for(t.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else for(z=o.length;z--;)no(o[z]);else t.__e=r.__e,t.__k=r.__k;M.__e(ne,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=hf(r.__e,t,r,n,i,o,a,l,d);return(y=M.diffed)&&y(t),128&t.__u?void 0:s}function Hs(e,t,r){for(var n=0;n<r.length;n++)oo(r[n],r[++n],r[++n]);M.__c&&M.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){M.__e(o,i.__v)}})}function $s(e){return typeof e!="object"||e==null?e:er(e)?e.map($s):ze({},e)}function hf(e,t,r,n,i,o,a,s,l){var d,y,h,p,f,b,A,S=r.props,w=t.props,T=t.type;if(T=="svg"?i="http://www.w3.org/2000/svg":T=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(d=0;d<o.length;d++)if((f=o[d])&&"setAttribute"in f==!!T&&(T?f.localName==T:f.nodeType==3)){e=f,o[d]=null;break}}if(e==null){if(T==null)return document.createTextNode(w);e=document.createElementNS(i,T,w.is&&w),s&&(M.__m&&M.__m(t,o),s=!1),o=null}if(T===null)S===w||s&&e.data===w||(e.data=w);else{if(o=o&&wn.call(e.childNodes),S=r.props||Zt,!s&&o!=null)for(S={},d=0;d<e.attributes.length;d++)S[(f=e.attributes[d]).name]=f.value;for(d in S)if(f=S[d],d!="children"){if(d=="dangerouslySetInnerHTML")h=f;else if(!(d in w)){if(d=="value"&&"defaultValue"in w||d=="checked"&&"defaultChecked"in w)continue;gn(e,d,null,f,i)}}for(d in w)f=w[d],d=="children"?p=f:d=="dangerouslySetInnerHTML"?y=f:d=="value"?b=f:d=="checked"?A=f:s&&typeof f!="function"||S[d]===f||gn(e,d,f,S[d],i);if(y)s||h&&(y.__html===h.__html||y.__html===e.innerHTML)||(e.innerHTML=y.__html),t.__k=[];else if(h&&(e.innerHTML=""),Js(t.type==="template"?e.content:e,er(p)?p:[p],t,r,n,T=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&Rt(r,0),s,l),o!=null)for(d=o.length;d--;)no(o[d]);s||(d="value",T=="progress"&&b==null?e.removeAttribute("value"):b!==void 0&&(b!==e[d]||T=="progress"&&!b||T=="option"&&b!==S[d])&&gn(e,d,b,S[d],i),d="checked",A!==void 0&&A!==e[d]&&gn(e,d,A,S[d],i))}return e}function oo(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){M.__e(i,r)}}function Gs(e,t,r){var n,i;if(M.unmount&&M.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||oo(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){M.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Gs(n[i],t,r||typeof e.type!="function");r||no(e.__e),e.__c=e.__=e.__e=void 0}function mf(e,t,r){return this.constructor(e,r)}function qs(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),M.__&&M.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],io(t,e=(!n&&r||t).__k=tr(ot,null,[e]),i||Zt,Zt,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?wn.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),Hs(o,e,a)}wn=Fs.slice,M={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},Ls=0,to=function(e){return e!=null&&e.constructor==null},Te.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ze({},this.state),typeof e=="function"&&(e=e(ze({},r),this.props)),e&&ze(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ps(this))},Te.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ps(this))},Te.prototype.render=ot,mt=[],Us=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ms=function(e,t){return e.__v.__b-t.__v.__b},bn.__r=0,Bs=/(PointerCapture)$|Capture$/i,ro=0,Zi=Ns(!1),eo=Ns(!0),uf=0;var Ct,re,ao,Ks,nr=0,tl=[],se=M,Ws=se.__b,zs=se.__r,Qs=se.diffed,Ys=se.__c,Xs=se.unmount,Zs=se.__;function An(e,t){se.__h&&se.__h(re,e,nr||t),nr=0;var r=re.__H||(re.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function In(e){return nr=1,rl(nl,e)}function rl(e,t,r){var n=An(Ct++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):nl(void 0,t),function(s){var l=n.__N?n.__N[0]:n.__[0],d=n.t(l,s);l!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=re,!re.__f)){var i=function(s,l,d){if(!n.__c.__H)return!0;var y=n.__c.__H.__.filter(function(p){return!!p.__c});if(y.every(function(p){return!p.__N}))return!o||o.call(this,s,l,d);var h=n.__c.props!==s;return y.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(h=!0)}}),o&&o.call(this,s,l,d)||h};re.__f=!0;var o=re.shouldComponentUpdate,a=re.componentWillUpdate;re.componentWillUpdate=function(s,l,d){if(this.__e){var y=o;o=void 0,i(s,l,d),o=y}a&&a.call(this,s,l,d)},re.shouldComponentUpdate=i}return n.__N||n.__}function ir(e,t){var r=An(Ct++,3);!se.__s&&fo(r.__H,t)&&(r.__=e,r.u=t,re.__H.__h.push(r))}function lo(e,t){var r=An(Ct++,4);!se.__s&&fo(r.__H,t)&&(r.__=e,r.u=t,re.__h.push(r))}function uo(e){return nr=5,or(function(){return{current:e}},[])}function or(e,t){var r=An(Ct++,7);return fo(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function co(e,t){return nr=8,or(function(){return e},t)}function pf(){for(var e;e=tl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(En),e.__H.__h.forEach(so),e.__H.__h=[]}catch(t){e.__H.__h=[],se.__e(t,e.__v)}}se.__b=function(e){re=null,Ws&&Ws(e)},se.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Zs&&Zs(e,t)},se.__r=function(e){zs&&zs(e),Ct=0;var t=(re=e.__c).__H;t&&(ao===re?(t.__h=[],re.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(En),t.__h.forEach(so),t.__h=[],Ct=0)),ao=re},se.diffed=function(e){Qs&&Qs(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(tl.push(t)!==1&&Ks===se.requestAnimationFrame||((Ks=se.requestAnimationFrame)||vf)(pf)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),ao=re=null},se.__c=function(e,t){t.some(function(r){try{r.__h.forEach(En),r.__h=r.__h.filter(function(n){return!n.__||so(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],se.__e(n,r.__v)}}),Ys&&Ys(e,t)},se.unmount=function(e){Xs&&Xs(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{En(n)}catch(i){t=i}}),r.__H=void 0,t&&se.__e(t,r.__v))};var el=typeof requestAnimationFrame=="function";function vf(e){var t,r=function(){clearTimeout(n),el&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);el&&(t=requestAnimationFrame(r))}function En(e){var t=re,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),re=t}function so(e){var t=re;e.__c=e.__(),re=t}function fo(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function nl(e,t){return typeof t=="function"?t(e):t}function gf(e,t){for(var r in t)e[r]=t[r];return e}function il(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function ol(e,t){this.props=e,this.context=t}(ol.prototype=new Te).isPureReactComponent=!0,ol.prototype.shouldComponentUpdate=function(e,t){return il(this.props,e)||il(this.state,t)};var al=M.__b;M.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),al&&al(e)};var _y=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var yf=M.__e;M.__e=function(e,t,r,n){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}yf(e,t,r,n)};var sl=M.unmount;function ml(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=gf({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return ml(n,t,r)})),e}function pl(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return pl(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function ho(){this.__u=0,this.o=null,this.__b=null}function vl(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Sn(){this.i=null,this.l=null}M.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),sl&&sl(e)},(ho.prototype=new Te).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=vl(n.__v),o=!1,a=function(){o||(o=!0,r.__R=null,i?i(s):s())};r.__R=a;var s=function(){if(!--n.__u){if(n.state.__a){var l=n.state.__a;n.__v.__k[0]=pl(l,l.__c.__P,l.__c.__O)}var d;for(n.setState({__a:n.__b=null});d=n.o.pop();)d.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},ho.prototype.componentWillUnmount=function(){this.o=[]},ho.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=ml(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&tr(ot,null,e.fallback);return i&&(i.__u&=-33),[tr(ot,null,t.__a?null:e.children),i]};var ll=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(Sn.prototype=new Te).__a=function(e){var t=this,r=vl(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),ll(t,e,n)):i()};r?r(o):o()}},Sn.prototype.render=function(e){this.i=null,this.l=new Map;var t=rr(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},Sn.prototype.componentDidUpdate=Sn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){ll(e,r,t)})};var bf=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,wf=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ef=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Af=/[A-Z0-9]/g,If=typeof document!="undefined",Sf=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function mo(e,t,r){return t.__k==null&&(t.textContent=""),qs(e,t),typeof r=="function"&&r(),e?e.__c:null}Te.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Te.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var ul=M.event;function Rf(){}function Cf(){return this.cancelBubble}function kf(){return this.defaultPrevented}M.event=function(e){return ul&&(e=ul(e)),e.persist=Rf,e.isPropagationStopped=Cf,e.isDefaultPrevented=kf,e.nativeEvent=e};var _l,Tf={enumerable:!1,configurable:!0,get:function(){return this.class}},cl=M.vnode;M.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={},o=n.indexOf("-")===-1;for(var a in r){var s=r[a];if(!(a==="value"&&"defaultValue"in r&&s==null||If&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?a="ondblclick":l!=="onchange"||n!=="input"&&n!=="textarea"||Sf(r.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":Ef.test(a)&&(a=l):l=a="oninput":o&&wf.test(a)?a=a.replace(Af,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&i[a=l]&&(a="oninputCapture"),i[a]=s}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=rr(r.children).forEach(function(d){d.props.selected=i.value.indexOf(d.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=rr(r.children).forEach(function(d){d.props.selected=i.multiple?i.defaultValue.indexOf(d.props.value)!=-1:i.defaultValue==d.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",Tf)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=bf,cl&&cl(e)};var dl=M.__r;M.__r=function(e){dl&&dl(e),_l=e.__c};var fl=M.diffed;M.diffed=function(e){fl&&fl(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),_l=null};var gl=Object.getOwnPropertySymbols,xf=Object.prototype.hasOwnProperty,Of=Object.prototype.propertyIsEnumerable,Pf=(e,t)=>{var r={};for(var n in e)xf.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&gl)for(var n of gl(e))t.indexOf(n)<0&&Of.call(e,n)&&(r[n]=e[n]);return r},Hl=Object.defineProperty,Df=Object.defineProperties,Nf=Object.getOwnPropertyDescriptors,yl=Object.getOwnPropertySymbols,Lf=Object.prototype.hasOwnProperty,Uf=Object.prototype.propertyIsEnumerable,bl=(e,t,r)=>t in e?Hl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mf=(e,t)=>{for(var r in t||(t={}))Lf.call(t,r)&&bl(e,r,t[r]);if(yl)for(var r of yl(t))Uf.call(t,r)&&bl(e,r,t[r]);return e},Bf=(e,t)=>Df(e,Nf(t)),Ff=(e,t)=>{for(var r in t)Hl(e,r,{get:t[r],enumerable:!0})},$l=(e,t,r,n)=>{for(var i=t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=a(i)||i);return i},jf=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(d){i(d)}},a=l=>{try{s(r.throw(l))}catch(d){i(d)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}function Jf(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Vf(e){return typeof e=="string"}function Hf(e){return typeof e=="undefined"}function $f(e){return Hf(e)||e===null}function Gf(e){return typeof e=="function"}function Gl(e){let t=e,r=null,n=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r||(r=new t(...o)),r};return n.prototype=t.prototype,n}var qf=(e=>(e[e.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",e[e.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",e[e.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",e[e.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",e[e.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",e[e.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",e[e.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",e[e.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",e))(qf||{});function ar(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}var Kf={log:ar("log"),warn:ar("warn"),info:ar("info"),error:ar("error"),debug:ar("debug")};Object.assign(globalThis,{logger:Kf});var wl=Symbol.for("Jolibox.canIUseMap"),Wf={};globalThis[wl]||(globalThis[wl]=Wf);var El=Symbol.for("Jolibox.canIUseMap.native"),zf={};globalThis[El]||(globalThis[El]=zf);var ql=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(ql||{}),Kl=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Kl||{}),Wl=(e=>(e[e.App=0]="App",e[e.H5=1]="H5",e[e.Weapp=2]="Weapp",e[e.Alipay=3]="Alipay",e[e.Gcash=4]="Gcash",e[e.Dana=5]="Dana",e[e.Umma=6]="Umma",e[e.WebSDK=1e3]="WebSDK",e[e.AppSDK=1001]="AppSDK",e[e.Other=9999]="Other",e))(Wl||{}),Al=["name","params"],Qf=["name","type","location","target","extra","timestamp","userId"],Yf=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function Tn(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function Xf(e){let t=e.location?Tn(e.location,Al):null,r=e.target?Tn(e.target,Al):null;return Tn(Bf(Mf({},e),{location:t,target:r}),Qf)}function Zf(e){let t=e.events.map(n=>Xf(n)),r=Tn(e.device,Yf);return[e.protocolVersion,t,r,e.project]}function eh(){try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}eh();var Il=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),navigator.userAgent.includes("Android"),navigator.userAgent.includes("Mac"),navigator.userAgent.includes("FB_IAB"),!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var wo=class Eo{constructor(t){this.element=t,this.next=Eo.Undefined,this.prev=Eo.Undefined}};wo.Undefined=new wo(void 0);var te=wo,th=class{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let e=this._first;for(;e!==te.Undefined;){let t=e.next;e.prev=te.Undefined,e.next=te.Undefined,e=t}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new te(e);if(this._first===te.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==te.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==te.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==te.Undefined&&e.next!==te.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===te.Undefined&&e.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):e.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):e.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==te.Undefined;)yield e.element,e=e.next}},rh=0,sr=class{constructor(e){this.value=e,this.id=rh++}},dr=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof sr&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){return this._event!=null||(this._event=(e,t)=>{var r,n,i,o,a,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let l=new sr(e);return this._listeners?this._listeners instanceof sr?this._listeners=[this._listeners,l]:this._listeners.push(l):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=l,(o=(i=this.options)==null?void 0:i.onDidFirstListener)==null||o.call(i,this)),(s=(a=this.options)==null?void 0:a.onDidAddListener)==null||s.call(a,this),this._size++,()=>{var d,y,h,p;if(!this._disposed){if(this._listeners instanceof sr)this._listeners.id===l.id&&(this._listeners=void 0,this._size=0,(y=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||y.call(d));else if(this._listeners){let f=this._listeners.indexOf(l);f>=0&&(this._listeners.splice(f,1),this._size--,this._size===0&&((p=(h=this.options)==null?void 0:h.onDidRemoveLastListener)==null||p.call(h)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof sr?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},nh=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;var n;let i=(n=this.listeners.get(e))!=null?n:new dr,o=l=>t(...l.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e){let t=this.listeners.get(e),r=this.cachedEventQueue.get(e);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r||(r=new th,this.cachedEventQueue.set(e,r)),r.push({args:i}),t&&t.fire({event:e,args:i})}once(e,t){var r=this;let n=function(){t(...arguments),r.off(e,n)};this.on(e,n,!1)}},Ao={};Ff(Ao,{None:()=>ih,filter:()=>ah,once:()=>zl,toPromise:()=>oh});var ih=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function oh(e){return new Promise(t=>zl(e)(t))}function zl(e){return function(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function ah(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new dr(n);return i.event})(function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e(i=>t(i)&&r.call(n,i),null)})}var po=Symbol.for("Jolibox.hostEmitter"),sh=()=>{let e=new nh;return globalThis[po]||(globalThis[po]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[po]};sh();function lh(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)uh(e[n],t[n])}function uh(e,t){if(Vf(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Gf(t)){try{if(e instanceof t)return}catch(r){}if(!$f(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}var Io=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new dr,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return lh(o,r),n(...o)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};Io=$l([Gl],Io);var Sl=class{constructor(){this._onWillExecuteCommand=new dr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new dr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Io,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Jf(3e4)),this._starActivation}executeCommand(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return jf(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),Ao.toPromise(Ao.filter(this.registry.onDidRegisterCommand,i=>i===e))])]),this._tryExecuteCommand(e,r))})}executeCommandThowErr(e){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let t=this.registry.getCommand(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this._onWillExecuteCommand.fire({commandId:e,args:n});let o=this.invokeFunction(t.handler,...n);return this._onDidExecuteCommand.fire({commandId:e,args:n}),o}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e){try{for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e(...r)}finally{}}};Sl=$l([Gl],Sl);function Ie(e,t,r){return(t=ch(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ch(e){var t=dh(e,"string");return typeof t=="symbol"?t:t+""}function dh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var So=class{constructor(t){Ie(this,"context",void 0),Ie(this,"continueCallback",void 0),Ie(this,"adIsShowingCallback",void 0),Ie(this,"isBeforeAdCalled",!1),Ie(this,"isBeforeRewardCalled",!1),Ie(this,"isAdDismissedCalled",!1),Ie(this,"isAdViewedCalled",!1),Ie(this,"isAfterAdCalled",!1),Ie(this,"currentProvider",void 0),Ie(this,"currentClientParams",void 0),Ie(this,"adsHasResponse",!1),Ie(this,"videoChecker",window.document.createElement("video")),Ie(this,"contextInfo",void 0),Ie(this,"wrapShowAdFn",r=>()=>{var n,i,o;this.adsHasResponse=!0;let a=!1;this.videoChecker.play().catch(()=>{a=!1}),a=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:a},this.paramsToTrack)),Il()&&this.context.track("mmp_ad_impression",{ad_network:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:"",ad_format:"rewarded",module:"game",game_id:this.contextInfo.objectId}),(o=this.adIsShowingCallback)==null||o.call(this,!0),r()}),this.context=t,this.contextInfo=t.getContextInfo()}get paramsToTrack(){var t,r,n,i,o,a;return{provider:(r=(t=this.currentProvider)==null?void 0:t.name)!=null?r:null,type:(n=this.currentClientParams)==null?void 0:n.type,name:((i=this.currentClientParams)==null?void 0:i.type)==="preroll"?null:(a=(o=this.currentClientParams)==null?void 0:o.name)!=null?a:""}}wrapBeforeAd(t){return()=>{var r,n,i,o;this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.isBeforeAdCalled||(this.isBeforeAdCalled=!0,t==null||t(),((r=this.currentClientParams)==null?void 0:r.type)!=="reward"&&((n=this.adIsShowingCallback)==null||n.call(this,!0),Il()&&this.context.track("mmp_ad_impression",{ad_network:(o=(i=this.currentProvider)==null?void 0:i.name)!=null?o:"",ad_format:"interstitial",module:"game",game_id:this.contextInfo.objectId})))}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{this.adsHasResponse=!0,this.isAdDismissedCalled||(this.isAdDismissedCalled=!0,t==null||t())}}wrapAdViewed(t){return()=>{this.adsHasResponse=!0,this.isAdViewedCalled||(this.isAdViewedCalled=!0,t==null||t())}}wrapAfterAd(t){return()=>{this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.isAfterAdCalled||(this.isAfterAdCalled=!0,t==null||t())}}wrapAdBreakDone(t){return r=>{var n,i,o,a,s,l;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:null,breakType:r.breakType,breakName:(o=r.breakName)!=null?o:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{t==null||t(r),(a=this.adIsShowingCallback)==null||a.call(this,!1),(s=this.continueCallback)==null||s.call(this,[!1,r]);break}default:{(l=this.continueCallback)==null||l.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n,i){return P(this,null,function*(){return this.currentProvider=t,this.currentClientParams=r,this.adsHasResponse=!1,new Promise(o=>{this.continueCallback=o,this.adIsShowingCallback=i;let a;switch(r.type){case"preroll":{a={type:r.type,adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}case"reward":{a={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),beforeReward:this.wrapBeforeReward(r.beforeReward),adDismissed:this.wrapAdDismissed(r.adDismissed),adViewed:this.wrapAdViewed(r.adViewed),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}default:{a={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}}window.setTimeout(()=>{var s,l,d,y,h;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(l=(s=this.currentProvider)==null?void 0:s.name)!=null?l:null}),(y=this.continueCallback)==null||y.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(d=r.name)!=null?d:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(h=this.adIsShowingCallback)==null||h.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(a,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};function Rn(e,t,r){return(t=fh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fh(e){var t=hh(e,"string");return typeof t=="symbol"?t:t+""}function hh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ro=class{constructor(t){Rn(this,"context",void 0),Rn(this,"adBreakIsShowing",!1),Rn(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),Rn(this,"reportPageHide",()=>{this.context.track("AdBreakHide",{context:"AdsActionDetection"})}),this.context=t,window.addEventListener("visibilitychange",()=>{document.hidden&&this.adBreakIsShowing&&this.reportPageHide()}),window.addEventListener("beforeunload",r=>{this.adBreakIsShowing&&this.reportPageJumpOut()})}};function vo(e,t,r){return(t=mh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mh(e){var t=ph(e,"string");return typeof t=="symbol"?t:t+""}function ph(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Co=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";vo(this,"context",void 0),vo(this,"placement","GAME"),vo(this,"contextInfo",void 0),this.context=t,this.placement=r,this.contextInfo=this.context.getContextInfo()}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:this.placement==="GAME"?"GamePage":"DramaPage",params:r}}getDevice(){var t,r,n,i;return{platform:(t=this.contextInfo.platform)!=null?t:Wl.WebSDK,os:this.contextInfo.osType+"_"+this.contextInfo.runtimeType,appVersion:"1.0.0",appId:(r=this.contextInfo.hostAppId)!=null?r:"1",model:(n=this.contextInfo.deviceModel)!=null?n:"UnknownModel",brand:(i=this.contextInfo.deviceBrand)!=null?i:"UnknownBrand",uuid:this.contextInfo.deviceId,jsSdkVersion:"1.0.0",extra:{}}}serialize(t,r){var n;let i={protocolVersion:"1.0.0",events:[{name:t,type:ql.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:Kl.WebSDK};return Zf(i)}};function Cn(e,t,r){return(t=vh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vh(e){var t=_h(e,"string");return typeof t=="symbol"?t:t+""}function _h(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ko=class{constructor(t){Cn(this,"configs",null),Cn(this,"firstRun",!0),Cn(this,"context",void 0),Cn(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return P(this,null,function*(){try{this.configs=yield this.context.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config",{})}catch(t){}})}shouldBypassCallingInterstitial(){var t,r;let n;if(!this.configs)this.init(),n=!this.firstRun;else{let i=(t=this.contextInfo.channel)!=null?t:"",o=this.configs[i],a=(r=o==null?void 0:o.interstitialRate)!=null?r:1;n=Math.random()<a}return this.firstRun=!1,n}};function Qe(e,t,r){return(t=gh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gh(e){var t=yh(e,"string");return typeof t=="symbol"?t:t+""}function yh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var To=class{constructor(t,r){Qe(this,"name","ADSENSE"),Qe(this,"context",void 0),Qe(this,"contextInfo",void 0),Qe(this,"configured",!1),Qe(this,"initParams",void 0),Qe(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),Qe(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=Pf(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),Qe(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),Qe(this,"adUnit",n=>P(this,null,function*(){var i,o,a,s;if(this.context.track("CallAdUnit",{adFormat:(o=(i=n.adFormat)==null?void 0:i.toString())!=null?o:null,fullWidthResponsive:(a=n.fullWidthResponsive)!=null?a:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:l,slot:d,adFormat:y,fullWidthResponsive:h,style:p}=n,f;if(!l)throw new Error("targeting element is required");if(typeof l=="string"?f=document.querySelector(l):f=l,!f)throw new Error("targeting element not found");let b=d;if(b||(b=this.initParams.unitId),!b)throw new Error("slot is required");let A=typeof y=="object"&&Array.isArray(y)?y.join(", "):y,S=document.createElement("ins");if(S.className="adsbygoogle",S.id="jolibox-ads",S.style.display="block",S.setAttribute("data-ad-client",this.initParams.clientId),S.setAttribute("data-ad-slot",b),A&&S.setAttribute("data-ad-format",A),h&&S.setAttribute("data-full-width-responsive",h),p&&S.setAttribute("style",p),(s=this.contextInfo.testAdsMode)!=null?s:!1){let w=document.createElement("div");w.style.position="absolute",w.style.top="0",w.style.left="0",w.style.width="100%",w.style.height="100%",w.style.display="flex",w.style.justifyContent="center",w.style.alignItems="center",w.style.backgroundColor="rgba(0, 0, 0, 0.5)",w.style.color="white",w.innerHTML="Test Ad",S.style.position="relative",f.appendChild(S),S.appendChild(w)}else f.appendChild(S),new MutationObserver(w=>{w.forEach(T=>{if(T.type==="attributes"&&T.attributeName==="data-ad-status"){let N=S.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:N!=null?N:"null"})}})}).observe(S,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})})),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,window.adsbygoogle=window.adsbygoogle||[]}init(){return P(this,null,function*(){var t;if(this.context.track("CallAdsInit",{provider:this.name}),typeof window=="undefined")return;let r="google-adsense",n=(t=this.contextInfo.testAdsMode)!=null?t:!1;if(!document.getElementById(r)&&this.initParams.clientId){let i=document.createElement("script");i.id=r,i.async=!0,i.crossOrigin="anonymous",i.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,n&&i.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&i.setAttribute("data-ad-channel",this.initParams.channelId),this.initParams.admobInterstitialSlot&&i.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),this.initParams.admobRewardedSlot&&i.setAttribute("data-admob-rewarded-slot",this.initParams.admobRewardedSlot),this.initParams.admobOnly&&i.setAttribute("data-admob-ads-only","on"),document.head.appendChild(i),this.context.track("LoadAdsenseCompleted",null)}})}};function bh(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function wh(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Eh=function(){function e(r){var n=this;this._insertTag=function(i){var o;n.tags.length===0?n.insertionPoint?o=n.insertionPoint.nextSibling:n.prepend?o=n.container.firstChild:o=n.before:o=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(i,o),n.tags.push(i)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(wh(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=bh(n);try{i.insertRule(r,i.cssRules.length)}catch(o){}}else n.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var n;return(n=r.parentNode)==null?void 0:n.removeChild(r)}),this.tags=[],this.ctr=0},e}(),be="-ms-",Ln="-moz-",$="-webkit-",Ql="comm",Vo="rule",Ho="decl",Ah="@import",Yl="@keyframes",Ih="@layer",Sh=Math.abs,Fn=String.fromCharCode,Rh=Object.assign;function Ch(e,t){return he(e,0)^45?(((t<<2^he(e,0))<<2^he(e,1))<<2^he(e,2))<<2^he(e,3):0}function Xl(e){return e.trim()}function kh(e,t){return(e=t.exec(e))?e[0]:e}function G(e,t,r){return e.replace(t,r)}function xo(e,t){return e.indexOf(t)}function he(e,t){return e.charCodeAt(t)|0}function fr(e,t,r){return e.slice(t,r)}function je(e){return e.length}function $o(e){return e.length}function kn(e,t){return t.push(e),e}function Th(e,t){return e.map(t).join("")}var jn=1,Ot=1,Zl=0,Ce=0,de=0,Pt="";function Jn(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:jn,column:Ot,length:a,return:""}}function lr(e,t){return Rh(Jn("",null,null,"",null,null,0),e,{length:-e.length},t)}function xh(){return de}function Oh(){return de=Ce>0?he(Pt,--Ce):0,Ot--,de===10&&(Ot=1,jn--),de}function Oe(){return de=Ce<Zl?he(Pt,Ce++):0,Ot++,de===10&&(Ot=1,jn++),de}function Je(){return he(Pt,Ce)}function xn(){return Ce}function pr(e,t){return fr(Pt,e,t)}function hr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function eu(e){return jn=Ot=1,Zl=je(Pt=e),Ce=0,[]}function tu(e){return Pt="",e}function On(e){return Xl(pr(Ce-1,Oo(e===91?e+2:e===40?e+1:e)))}function Ph(e){for(;(de=Je())&&de<33;)Oe();return hr(e)>2||hr(de)>3?"":" "}function Dh(e,t){for(;--t&&Oe()&&!(de<48||de>102||de>57&&de<65||de>70&&de<97););return pr(e,xn()+(t<6&&Je()==32&&Oe()==32))}function Oo(e){for(;Oe();)switch(de){case e:return Ce;case 34:case 39:e!==34&&e!==39&&Oo(de);break;case 40:e===41&&Oo(e);break;case 92:Oe();break}return Ce}function Nh(e,t){for(;Oe()&&e+de!==57&&!(e+de===84&&Je()===47););return"/*"+pr(t,Ce-1)+"*"+Fn(e===47?e:Oe())}function Lh(e){for(;!hr(Je());)Oe();return pr(e,Ce)}function Uh(e){return tu(Pn("",null,null,null,[""],e=eu(e),0,[0],e))}function Pn(e,t,r,n,i,o,a,s,l){for(var d=0,y=0,h=a,p=0,f=0,b=0,A=1,S=1,w=1,T=0,N="",j=i,W=o,R=n,L=N;S;)switch(b=T,T=Oe()){case 40:if(b!=108&&he(L,h-1)==58){xo(L+=G(On(T),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:L+=On(T);break;case 9:case 10:case 13:case 32:L+=Ph(b);break;case 92:L+=Dh(xn()-1,7);continue;case 47:switch(Je()){case 42:case 47:kn(Mh(Nh(Oe(),xn()),t,r),l);break;default:L+="/"}break;case 123*A:s[d++]=je(L)*w;case 125*A:case 59:case 0:switch(T){case 0:case 125:S=0;case 59+y:w==-1&&(L=G(L,/\f/g,"")),f>0&&je(L)-h&&kn(f>32?Cl(L+";",n,r,h-1):Cl(G(L," ","")+";",n,r,h-2),l);break;case 59:L+=";";default:if(kn(R=Rl(L,t,r,d,y,i,s,N,j=[],W=[],h),o),T===123)if(y===0)Pn(L,t,R,R,j,o,h,s,W);else switch(p===99&&he(L,3)===110?100:p){case 100:case 108:case 109:case 115:Pn(e,R,R,n&&kn(Rl(e,R,R,0,0,i,s,N,i,j=[],h),W),i,W,h,s,n?j:W);break;default:Pn(L,R,R,R,[""],W,0,s,W)}}d=y=f=0,A=w=1,N=L="",h=a;break;case 58:h=1+je(L),f=b;default:if(A<1){if(T==123)--A;else if(T==125&&A++==0&&Oh()==125)continue}switch(L+=Fn(T),T*A){case 38:w=y>0?1:(L+="\f",-1);break;case 44:s[d++]=(je(L)-1)*w,w=1;break;case 64:Je()===45&&(L+=On(Oe())),p=Je(),y=h=je(N=L+=Lh(xn())),T++;break;case 45:b===45&&je(L)==2&&(A=0)}}return o}function Rl(e,t,r,n,i,o,a,s,l,d,y){for(var h=i-1,p=i===0?o:[""],f=$o(p),b=0,A=0,S=0;b<n;++b)for(var w=0,T=fr(e,h+1,h=Sh(A=a[b])),N=e;w<f;++w)(N=Xl(A>0?p[w]+" "+T:G(T,/&\f/g,p[w])))&&(l[S++]=N);return Jn(e,t,r,i===0?Vo:s,l,d,y)}function Mh(e,t,r){return Jn(e,t,r,Ql,Fn(xh()),fr(e,2,-2),0)}function Cl(e,t,r,n){return Jn(e,t,r,Ho,fr(e,0,n),fr(e,n+1,-1),n)}function xt(e,t){for(var r="",n=$o(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function Bh(e,t,r,n){switch(e.type){case Ih:if(e.children.length)break;case Ah:case Ho:return e.return=e.return||e.value;case Ql:return"";case Yl:return e.return=e.value+"{"+xt(e.children,n)+"}";case Vo:e.value=e.props.join(",")}return je(r=xt(e.children,n))?e.return=e.value+"{"+r+"}":""}function Fh(e){var t=$o(e);return function(r,n,i,o){for(var a="",s=0;s<t;s++)a+=e[s](r,n,i,o)||"";return a}}function jh(e){return function(t){t.root||(t=t.return)&&e(t)}}function Jh(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Vh=function(e,t,r){for(var n=0,i=0;n=i,i=Je(),n===38&&i===12&&(t[r]=1),!hr(i);)Oe();return pr(e,Ce)},Hh=function(e,t){var r=-1,n=44;do switch(hr(n)){case 0:n===38&&Je()===12&&(t[r]=1),e[r]+=Vh(Ce-1,t,r);break;case 2:e[r]+=On(n);break;case 4:if(n===44){e[++r]=Je()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=Fn(n)}while(n=Oe());return e},$h=function(e,t){return tu(Hh(eu(e),t))},kl=new WeakMap,Gh=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!kl.get(r))&&!n){kl.set(e,!0);for(var i=[],o=$h(t,i),a=r.props,s=0,l=0;s<o.length;s++)for(var d=0;d<a.length;d++,l++)e.props[l]=i[s]?o[s].replace(/&\f/g,a[d]):a[d]+" "+o[s]}}},qh=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function ru(e,t){switch(Ch(e,t)){case 5103:return $+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return $+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return $+e+Ln+e+be+e+e;case 6828:case 4268:return $+e+be+e+e;case 6165:return $+e+be+"flex-"+e+e;case 5187:return $+e+G(e,/(\w+).+(:[^]+)/,$+"box-$1$2"+be+"flex-$1$2")+e;case 5443:return $+e+be+"flex-item-"+G(e,/flex-|-self/,"")+e;case 4675:return $+e+be+"flex-line-pack"+G(e,/align-content|flex-|-self/,"")+e;case 5548:return $+e+be+G(e,"shrink","negative")+e;case 5292:return $+e+be+G(e,"basis","preferred-size")+e;case 6060:return $+"box-"+G(e,"-grow","")+$+e+be+G(e,"grow","positive")+e;case 4554:return $+G(e,/([^-])(transform)/g,"$1"+$+"$2")+e;case 6187:return G(G(G(e,/(zoom-|grab)/,$+"$1"),/(image-set)/,$+"$1"),e,"")+e;case 5495:case 3959:return G(e,/(image-set\([^]*)/,$+"$1$`$1");case 4968:return G(G(e,/(.+:)(flex-)?(.*)/,$+"box-pack:$3"+be+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+$+e+e;case 4095:case 3583:case 4068:case 2532:return G(e,/(.+)-inline(.+)/,$+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(je(e)-1-t>6)switch(he(e,t+1)){case 109:if(he(e,t+4)!==45)break;case 102:return G(e,/(.+:)(.+)-([^]+)/,"$1"+$+"$2-$3$1"+Ln+(he(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~xo(e,"stretch")?ru(G(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(he(e,t+1)!==115)break;case 6444:switch(he(e,je(e)-3-(~xo(e,"!important")&&10))){case 107:return G(e,":",":"+$)+e;case 101:return G(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+$+(he(e,14)===45?"inline-":"")+"box$3$1"+$+"$2$3$1"+be+"$2box$3")+e}break;case 5936:switch(he(e,t+11)){case 114:return $+e+be+G(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return $+e+be+G(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return $+e+be+G(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return $+e+be+e+e}return e}var Kh=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case Ho:e.return=ru(e.value,e.length);break;case Yl:return xt([lr(e,{value:G(e.value,"@","@"+$)})],n);case Vo:if(e.length)return Th(e.props,function(i){switch(kh(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return xt([lr(e,{props:[G(i,/:(read-\w+)/,":"+Ln+"$1")]})],n);case"::placeholder":return xt([lr(e,{props:[G(i,/:(plac\w+)/,":"+$+"input-$1")]}),lr(e,{props:[G(i,/:(plac\w+)/,":"+Ln+"$1")]}),lr(e,{props:[G(i,/:(plac\w+)/,be+"input-$1")]})],n)}return""})}},Wh=[Kh],zh=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(b){var A=b.getAttribute("data-emotion");A.indexOf(" ")!==-1&&(document.head.appendChild(b),b.setAttribute("data-s",""))})}var n=e.stylisPlugins||Wh,i={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(b){for(var A=b.getAttribute("data-emotion").split(" "),S=1;S<A.length;S++)i[A[S]]=!0;a.push(b)});var s,l=[Gh,qh];{var d,y=[Bh,jh(function(b){d.insert(b)})],h=Fh(l.concat(n,y)),p=function(b){return xt(Uh(b),h)};s=function(b,A,S,w){d=S,p(b?b+"{"+A.styles+"}":A.styles),w&&(f.inserted[A.name]=!0)}}var f={key:t,sheet:new Eh({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return f.sheet.hydrate(a),f};function Qh(e){for(var t=0,r,n=0,i=e.length;i>=4;++n,i-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Yh={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Xh=/[A-Z]|^ms/g,Zh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,nu=function(e){return e.charCodeAt(1)===45},Tl=function(e){return e!=null&&typeof e!="boolean"},_o=Jh(function(e){return nu(e)?e:e.replace(Xh,"-$&").toLowerCase()}),xl=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(Zh,function(r,n,i){return at={name:n,styles:i,next:at},n})}return Yh[e]!==1&&!nu(e)&&typeof t=="number"&&t!==0?t+"px":t};function Un(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var i=r;if(i.anim===1)return at={name:i.name,styles:i.styles,next:at},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)at={name:a.name,styles:a.styles,next:at},a=a.next;var s=o.styles+";";return s}return em(e,t,r)}}var l=r;if(t==null)return l;var d=t[l];return d!==void 0?d:l}function em(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=Un(e,t,r[i])+";";else for(var o in r){var a=r[o];if(typeof a!="object"){var s=a;t!=null&&t[s]!==void 0?n+=o+"{"+t[s]+"}":Tl(s)&&(n+=_o(o)+":"+xl(o,s)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var l=0;l<a.length;l++)Tl(a[l])&&(n+=_o(o)+":"+xl(o,a[l])+";");else{var d=Un(e,t,a);switch(o){case"animation":case"animationName":{n+=_o(o)+":"+d+";";break}default:n+=o+"{"+d+"}"}}}return n}var Ol=/label:\s*([^\s;{]+)\s*(;|$)/g,at;function go(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,i="";at=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=Un(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=Un(r,t,e[s]),n){var l=o;i+=l[s]}Ol.lastIndex=0;for(var d="",y;(y=Ol.exec(i))!==null;)d+="-"+y[1];var h=Qh(i)+d;return{name:h,styles:i,next:at}}function iu(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}var tm=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},rm=function(e,t,r){tm(e,t);var n=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var i=t;do e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next;while(i!==void 0)}};function Pl(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function Dl(e,t,r){var n=[],i=iu(e,n,r);return n.length<2?r:i+t(n)}var nm=function(e){var t=zh(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var d=go(s,t.registered,void 0);return rm(t,d),t.key+"-"+d.name},n=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var d=go(s,t.registered),y="animation-"+d.name;return Pl(t,{name:d.name,styles:"@keyframes "+y+"{"+d.styles+"}"}),y},i=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var d=go(s,t.registered);Pl(t,d)},o=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return Dl(t.registered,r,im(s))};return{css:r,cx:o,injectGlobal:i,keyframes:n,hydrate:function(a){a.forEach(function(s){t.inserted[s]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:iu.bind(null,t.registered),merge:Dl.bind(null,t.registered,r)}},im=function e(t){for(var r="",n=0;n<t.length;n++){var i=t[n];if(i!=null){var o=void 0;switch(typeof i){case"boolean":break;case"object":{if(Array.isArray(i))o=e(i);else{o="";for(var a in i)i[a]&&a&&(o&&(o+=" "),o+=a)}break}default:o=i}o&&(r&&(r+=" "),r+=o)}}return r},om=nm({key:"css"}),Dt=om.css,Po,xe,yo,Nl,Ll=0,ou=[],fe=M,Ul=fe.__b,Ml=fe.__r,Bl=fe.diffed,Fl=fe.__c,jl=fe.unmount,Jl=fe.__;function am(e,t){fe.__h&&fe.__h(xe,e,Ll||t),Ll=0;var r=xe.__H||(xe.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function au(e,t){var r=am(Po++,7);return um(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function sm(){for(var e;e=ou.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Dn),e.__H.__h.forEach(Do),e.__H.__h=[]}catch(t){e.__H.__h=[],fe.__e(t,e.__v)}}fe.__b=function(e){xe=null,Ul&&Ul(e)},fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Jl&&Jl(e,t)},fe.__r=function(e){Ml&&Ml(e),Po=0;var t=(xe=e.__c).__H;t&&(yo===xe?(t.__h=[],xe.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Dn),t.__h.forEach(Do),t.__h=[],Po=0)),yo=xe},fe.diffed=function(e){Bl&&Bl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ou.push(t)!==1&&Nl===fe.requestAnimationFrame||((Nl=fe.requestAnimationFrame)||lm)(sm)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),yo=xe=null},fe.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Dn),r.__h=r.__h.filter(function(n){return!n.__||Do(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],fe.__e(n,r.__v)}}),Fl&&Fl(e,t)},fe.unmount=function(e){jl&&jl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Dn(n)}catch(i){t=i}}),r.__H=void 0,t&&fe.__e(t,r.__v))};var Vl=typeof requestAnimationFrame=="function";function lm(e){var t,r=function(){clearTimeout(n),Vl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Vl&&(t=requestAnimationFrame(r))}function Dn(e){var t=xe,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),xe=t}function Do(e){var t=xe;e.__c=e.__(),xe=t}function um(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var cm=Symbol.for("preact-signals");function Vn(){if(st>1)st--;else{for(var e,t=!1;ur!==void 0;){var r=ur;for(ur=void 0,No++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&lu(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(No=0,st--,t)throw e}}function Re(e){if(st>0)return e();st++;try{return e()}finally{Vn()}}var Y=void 0,ur=void 0,st=0,No=0,Mn=0;function su(e){if(Y!==void 0){var t=e.n;if(t===void 0||t.t!==Y)return t={i:0,S:e,p:Y.s,n:void 0,t:Y,e:void 0,x:void 0,r:t},Y.s!==void 0&&(Y.s.n=t),Y.s=t,e.n=t,32&Y.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Y.s,t.n=void 0,Y.s.n=t,Y.s=t),t}}function me(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}me.prototype.brand=cm;me.prototype.h=function(){return!0};me.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)};me.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}};me.prototype.subscribe=function(e){var t=this;return _r(function(){var r=t.value,n=Y;Y=void 0;try{e(r)}finally{Y=n}})};me.prototype.valueOf=function(){return this.value};me.prototype.toString=function(){return this.value+""};me.prototype.toJSON=function(){return this.value};me.prototype.peek=function(){var e=Y;Y=void 0;try{return this.value}finally{Y=e}};Object.defineProperty(me.prototype,"value",{get:function(){var e=su(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(No>100)throw new Error("Cycle detected");this.v=e,this.i++,Mn++,st++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Vn()}}}});function X(e){return new me(e)}function lu(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function uu(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function cu(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function Nt(e){me.call(this,void 0),this.x=e,this.s=void 0,this.g=Mn-1,this.f=4}(Nt.prototype=new me).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Mn))return!0;if(this.g=Mn,this.f|=1,this.i>0&&!lu(this))return this.f&=-2,!0;var e=Y;try{uu(this),Y=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Y=e,cu(this),this.f&=-2,!0};Nt.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}me.prototype.S.call(this,e)};Nt.prototype.U=function(e){if(this.t!==void 0&&(me.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Nt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Nt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=su(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function cr(e){return new Nt(e)}function du(e){var t=e.u;if(e.u=void 0,typeof t=="function"){st++;var r=Y;Y=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Go(e),n}finally{Y=r,Vn()}}}function Go(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,du(e)}function dm(e){if(Y!==this)throw new Error("Out-of-order effect");cu(this),Y=e,this.f&=-2,8&this.f&&Go(this),Vn()}function vr(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}vr.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}};vr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,du(this),uu(this),st++;var e=Y;return Y=this,dm.bind(this,e)};vr.prototype.N=function(){2&this.f||(this.f|=2,this.o=ur,ur=this)};vr.prototype.d=function(){this.f|=8,1&this.f||Go(this)};function _r(e){var t=new vr(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var fu,bo,hu=[];_r(function(){fu=this.N})();function Lt(e,t){M[e]=t.bind(null,M[e]||function(){})}function Bn(e){bo&&bo(),bo=e&&e.S()}function mu(e){var t=this,r=e.data,n=pu(r);n.value=r;var i=au(function(){for(var s=t,l=t.__v;l=l.__;)if(l.__c){l.__c.__$f|=4;break}var d=cr(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),y=cr(function(){return!Array.isArray(d.value)&&!to(d.value)}),h=_r(function(){if(this.N=vu,y.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),p=t.__$u.d;return t.__$u.d=function(){h(),p.call(this)},[y,d]},[]),o=i[0],a=i[1];return o.value?a.peek():a.value}mu.displayName="_st";Object.defineProperties(me.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:mu},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Lt("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof me&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});Lt("__r",function(e,t){Bn();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return _r(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),Bn(r),e(t)});Lt("__e",function(e,t,r,n){Bn(),e(t,r,n)});Lt("diffed",function(e,t){Bn();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var s=o[a];s!==void 0&&!(a in n)&&(s.d(),o[a]=void 0)}else o={},r.U=o;for(var l in n){var d=o[l],y=n[l];d===void 0?(d=fm(r,l,y,i),o[l]=d):d.o(y,i)}}}e(t)});function fm(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=X(r);return{o:function(a,s){o.value=a,n=s},d:_r(function(){this.N=vu;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}Lt("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var a=t.__c;if(a){var s=a.__$u;s&&(a.__$u=void 0,s.d())}}e(t)});Lt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});Te.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u,n=r&&r.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var o=2&this.__$f;if(!(n||o||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var a in e)if(a!=="__source"&&e[a]!==this.props[a])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function pu(e){return au(function(){return X(e)},[])}var hm=function(e){queueMicrotask(function(){queueMicrotask(e)})};function mm(){Re(function(){for(var e;e=hu.shift();)fu.call(e)})}function vu(){hu.push(this)===1&&(M.requestAnimationFrame||hm)(mm)}var we=Dt`
4
4
  inset: 0;