@jolibox/implement 1.3.4 → 1.3.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/package-deps_build.json +6 -6
- package/dist/common/utils/index.d.ts +6 -0
- package/dist/index.js +39 -39
- package/dist/index.native.js +67 -67
- package/implement.build.log +2 -2
- package/package.json +6 -6
- package/src/common/utils/index.ts +9 -0
- package/src/h5/api/ads.ts +5 -1
- package/src/h5/api/runtime.ts +3 -0
- package/src/native/api/ads.ts +5 -1
- package/src/native/bootstrap/index.ts +28 -0
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Nd=Object.create;var Oa=Object.defineProperty,Ud=Object.defineProperties,Bd=Object.getOwnPropertyDescriptor,Md=Object.getOwnPropertyDescriptors,Gd=Object.getOwnPropertyNames,jn=Object.getOwnPropertySymbols,os=Object.getPrototypeOf,ka=Object.prototype.hasOwnProperty,ss=Object.prototype.propertyIsEnumerable,Jd=Reflect.get;var is=(t,e,n)=>e in t?Oa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,W=(t,e)=>{for(var n in e||(e={}))ka.call(e,n)&&is(t,n,e[n]);if(jn)for(var n of jn(e))ss.call(e,n)&&is(t,n,e[n]);return t},Ce=(t,e)=>Ud(t,Md(e));var ln=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,n)=>(typeof require!="undefined"?require:e)[n]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var ls=(t,e)=>{var n={};for(var r in t)ka.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&jn)for(var r of jn(t))e.indexOf(r)<0&&ss.call(t,r)&&(n[r]=t[r]);return n};var ne=(t,e)=>()=>(t&&(e=t(t=0)),e);var Ta=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fd=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Gd(e))!ka.call(t,a)&&a!==n&&Oa(t,a,{get:()=>e[a],enumerable:!(r=Bd(e,a))||r.enumerable});return t};var xa=(t,e,n)=>(n=t!=null?Nd(os(t)):{},Fd(e||!t||!t.__esModule?Oa(n,"default",{value:t,enumerable:!0}):n,t));var cs=(t,e,n)=>Jd(os(t),n,e);var S=(t,e,n)=>new Promise((r,a)=>{var i=l=>{try{s(n.next(l))}catch(d){a(d)}},o=l=>{try{s(n.throw(l))}catch(d){a(d)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,o);s((n=n.apply(t,e)).next())});function zd(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}function Ja(t){return typeof t=="string"}function vs(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}function gs(t){return typeof t=="object"&&Array.isArray(t)}function Xd(t){return typeof t=="undefined"}function Yd(t){return Xd(t)||t===null}function Qd(t){return typeof t=="function"}function _s(t){let e=t,n=null,r=function(...a){return n||(n=new e(...a)),n};return r.prototype=e.prototype,r}function ys(t,e,n){if(typeof n!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function r(a,i){for(let o in i)if(Object.prototype.hasOwnProperty.call(i,o)){let s=a[o],l=i[o],d=n(s,l,o,a,i);d!==void 0?a[o]=d:fs(l)&&fs(s)?a[o]=r(Ga({},s),l):Array.isArray(l)&&Array.isArray(s)?a[o]=[...s,...l]:a[o]=l}return a}return r(t,e)}function fs(t){return t&&typeof t=="object"&&t.constructor===Object}function ws(t,e){if(Array.isArray(t))return t.concat(e)}function fn(t,e,n={}){let r=null,a,i,o,{leading:s=!1,trailing:l=!0}=n,d=()=>(o=t.apply(i,a),a=void 0,i=void 0,o),_=function(...f){a=f,i=this;let p=s&&!r;if(r&&clearTimeout(r),r=setTimeout(()=>{r=null,l&&!p&&d()},e),p)return d()};return _.cancel=()=>{r&&clearTimeout(r),r=null,a=i=void 0},_.flush=()=>{if(r)return clearTimeout(r),r=null,d()},_}function tf(t,e){return(...n)=>e(t,...n)}function As(t){return e=>tf(e,function(n,...r){if(typeof n=="function")try{return n.apply(this,r)}catch(a){t(new ef(`${a}`))}})}function cn(t){return(...e)=>{var n,r;((r=(n=globalThis.VConsole)==null?void 0:n[t])!=null?r:globalThis.console[t])(...e)}}function qn(t,e){return e.map(n=>{if(n==="params"&&t[n]){let r=t[n];return Object.keys(r).reduce((a,i)=>(a[i]=String(r[i]),a),{})}return t[n]})}function lf(t){let e=t.location?qn(t.location,ms):null,n=t.target?qn(t.target,ms):null;return qn(Kd(Ga({},t),{location:e,target:n}),of)}function Va(t){let e=t.events.map(r=>lf(r)),n=qn(t.device,sf);return[t.protocolVersion,e,n,t.project]}function cf(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let t=Object.getOwnPropertyDescriptor(window,"localStorage");if(t&&t.get){let r=t.get.call(window);return window.__joliboxLocalStorage__=r,r}if(t=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),t&&t.get)return t.get.call(window);let e=Window.prototype,n=Object.getOwnPropertyDescriptor(e,"localStorage");if(n&&n.get){let r=n.get.call(window);return window.__joliboxLocalStorage__=r,r}return localStorage}catch(t){return console.warn("Failed to get original localStorage, fallback to default implementation",t),localStorage}}function Wa(t,e,n){let r=window.location.hostname,a=r.split("."),i=n?e:t;if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(r))return`${i}.jolibox.com`;if(a.length>=2){let o=a.slice(-2).join(".");if(o==="jolibox.com"||o==="pico-game.com"||o==="joyslite.com"||o==="mporia.com"||o==="pingplus.ai")return`${i}.${o}`}return`${i}.jolibox.com`}function Rs(t){return Wa("app","stg-app",t)}function Gt(t){return`https://${Wa("api","stg-api",t)}`}function vf(t){return Wa("collect","stg-collect",t)}function Os(t){return`https://${vf(t)}`}function wf(t){return new Promise(e=>ks(t)(e))}function ks(t){return(e,n=null)=>{let r=!1;return t(a=>{if(!r)return r=!0,e.call(n,a)},null)}}function bf(t,e){return(n=>{let r,a={onWillAddFirstListener(){r=n(i.fire,i)}},i=new dn(a);return i.event})((n,r=null)=>t(a=>e(a)&&n.call(r,a),null))}function If(t,e){let n=Math.min(t.length,e.length);for(let r=0;r<n;r++)Af(t[r],e[r])}function Af(t,e){if(Ja(e)){if(typeof t!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(Qd(e)){try{if(t instanceof e)return}catch(n){}if(!Yd(t)&&t.constructor===e||e.length===1&&e.call(void 0,t)===!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 Sf(){return typeof globalThis!="undefined"?globalThis[Ts]:void 0}function Cf(t){typeof globalThis!="undefined"&&(globalThis[Ts]=t)}function we(t=!1){let e=Sf();if(!t&&e)return e;let n=new Vn,r=new Ba,a={registerCommand(i,o,s){n.registerCommand({id:i,handler:o,metadata:s})},executeCommand(i,...o){return r.executeCommand(i,...o)},excuteCommandSync(i,...o){return r.executeCommandThowErr(i,...o)}};return Cf(a),a}var Ma,Hd,jd,qd,us,Vd,$d,ds,Ga,Kd,Wd,ps,bt,Zd,Fa,Ha,bs,Es,ef,Is,$n,Kn,ja,Ne,Da,nf,qa,hs,rf,Et,Mt,af,ms,of,sf,je,Bt,uf,Re,df,ff,hf,Ss,$a,Ka,mf,pf,Cs,It,La,ie,gf,_f,un,dn,$e,Ua,yf,Pa,Ef,pt,Vn,Ba,Ts,q=ne(()=>{"use strict";Ma=Object.defineProperty,Hd=Object.defineProperties,jd=Object.getOwnPropertyDescriptor,qd=Object.getOwnPropertyDescriptors,us=Object.getOwnPropertySymbols,Vd=Object.prototype.hasOwnProperty,$d=Object.prototype.propertyIsEnumerable,ds=(t,e,n)=>e in t?Ma(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ga=(t,e)=>{for(var n in e||(e={}))Vd.call(e,n)&&ds(t,n,e[n]);if(us)for(var n of us(e))$d.call(e,n)&&ds(t,n,e[n]);return t},Kd=(t,e)=>Hd(t,qd(e)),Wd=(t,e)=>{for(var n in e)Ma(t,n,{get:e[n],enumerable:!0})},ps=(t,e,n,r)=>{for(var a=r>1?void 0:r?jd(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(a=(r?o(e,n,a):o(a))||a);return r&&a&&Ma(e,n,a),a},bt=(t,e,n)=>new Promise((r,a)=>{var i=l=>{try{s(n.next(l))}catch(d){a(d)}},o=l=>{try{s(n.throw(l))}catch(d){a(d)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,o);s((n=n.apply(t,e)).next())});if(typeof window!="undefined"&&!window.AbortController){let t=function(){this.signal=new e};t.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let n=new Event("abort");this.signal.dispatchEvent(n)};let e=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(e.prototype,"aborted",{get:function(){return this._aborted}}),e.prototype.addEventListener=function(n,r){this._eventListeners[n]||(this._eventListeners[n]=[]),this._eventListeners[n].push(r)},e.prototype.removeEventListener=function(n,r){if(!this._eventListeners[n])return;let a=this._eventListeners[n].indexOf(r);a!==-1&&this._eventListeners[n].splice(a,1)},e.prototype.dispatchEvent=function(n){if(this._eventListeners[n.type])for(let r of this._eventListeners[n.type])r.call(this,n)},window.AbortController=t,window.AbortSignal=e}Zd=(t=>(t[t.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",t[t.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",t[t.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",t[t.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",t[t.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",t[t.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",t[t.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",t[t.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",t))(Zd||{}),Fa=class extends Error{constructor(t){if(typeof t=="string"){super(t),this.priority="P1";return}super(t.message),this.priority="P1",this.stack=t.stack,this.raw=t}},Ha=class extends Fa{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},bs=class extends Fa{constructor(){super(...arguments),this.kind="USER_ERROR"}},Es=class extends bs{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},ef=class extends bs{constructor(t,e,n){super(t),this.message=t,this.errNo=e,this.name="USER_CUSTOM_ERROR",this.errMsg=t,n&&(this.extra=Object.assign({},this.extra,n))}},Is=class extends Ha{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},$n=class extends Ha{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},Kn=class extends Fa{constructor(t,e,n,r,a){super(t),this.message=t,this.code=e,this.kind="API_ERROR",this.name="API_ERROR",n&&(this.errorType=n),r!==void 0&&(this.stack=r),a&&(this.priority=a)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},ja=class extends Ha{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Ne={log:cn("log"),warn:cn("warn"),info:cn("info"),error:cn("error"),debug:cn("debug")};Object.assign(globalThis,{logger:Ne});Da=Symbol.for("Jolibox.canIUseMap"),nf={};globalThis[Da]||(globalThis[Da]=nf);qa={get config(){return globalThis[Da]}},hs=Symbol.for("Jolibox.canIUseMap.native"),rf={};globalThis[hs]||(globalThis[hs]=rf);Et=(t=>(t[t.Other=0]="Other",t[t.Route=1]="Route",t[t.Click=2]="Click",t[t.View=3]="View",t[t.Expose=4]="Expose",t[t.Swipe=5]="Swipe",t[t.Input=6]="Input",t[t.Select=7]="Select",t[t.SwitchOn=8]="SwitchOn",t[t.SwitchOff=9]="SwitchOff",t[t.Submit=10]="Submit",t[t.Scroll=11]="Scroll",t[t.Hide=12]="Hide",t[t.System=1e3]="System",t[t.ErrorTrace=1001]="ErrorTrace",t[t.UserDefined=1002]="UserDefined",t))(Et||{}),Mt=(t=>(t.MiniGame="mini-game",t.MiniDrama="mini-drama",t.App="app",t.WebSDK="web-sdk",t.AppSDK="app-sdk",t))(Mt||{}),af=(t=>(t[t.App=0]="App",t[t.H5=1]="H5",t[t.Weapp=2]="Weapp",t[t.Alipay=3]="Alipay",t[t.Gcash=4]="Gcash",t[t.Dana=5]="Dana",t[t.Umma=6]="Umma",t[t.WebSDK=1e3]="WebSDK",t[t.AppSDK=1001]="AppSDK",t[t.Other=9999]="Other",t))(af||{}),ms=["name","params"],of=["name","type","location","target","extra","timestamp","userId"],sf=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];je=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)});cf();Bt=typeof window=="undefined",uf=()=>!Bt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Re={isiOS:!Bt&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),iosVersion:()=>{let t=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3]||"0",10)]},isAndroid:!Bt&&navigator.userAgent.includes("Android"),isMac:!Bt&&navigator.userAgent.includes("Mac"),isFacebook:!Bt&&navigator.userAgent.includes("FB_IAB"),isPC:!Bt&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},df=()=>Re.isiOS?"iOS":Re.isAndroid?"Android":Re.isMac?"Mac":Re.isFacebook?"Facebook":"PC",ff="device_id",hf="advertising_id",Ss=t=>(window.__joliboxLocalStorage__.getItem(t)||window.__joliboxLocalStorage__.setItem(t,je()),window.__joliboxLocalStorage__.getItem(t)),$a=()=>new URLSearchParams(window.location.search).get("deviceId")||Ss(ff),Ka=()=>new URLSearchParams(window.location.search).get("advertisingId")||Ss(hf),mf=t=>t.charAt(0).toUpperCase()+t.slice(1),pf=()=>{var t;let e=new URLSearchParams(window.location.search);return mf((t=e.get("utm_source"))!=null?t:"")||"JoliboxSDK"},Cs=t=>{if(uf())return window.navigator.userAgent;let e="JoliboxWebSDK",n=df(),r=navigator.language,a=$a(),i=Ka();return`${e} (${pf()}${n}; UnknownModel; UnknownSystemVersion; ${r}) uuid/${a} adid/${i} version/${t||""}`};It=class{constructor(t,e={}){this.requestAdapter=t,this.cache=new Map,this.pendingRequests=new Map,this.requestSequence=0,this.cacheSequences=new Map,this.config=Ga({duration:10*60*1e3,timeout:3e3,keyGenerator:(n,r)=>n,consistencyChecker:()=>!0},e)}request(t,e){return bt(this,null,function*(){let n=this.config.keyGenerator(t,e),r=this.pendingRequests.get(n);if(r)return console.log(`[RequestCacheService] Reusing pending request for ${t}`),r;let a=this.requestInternal(t,e),i=this.createTimeoutPromise(),o=Promise.race([a,i]).catch(s=>bt(this,null,function*(){if(s.message.includes("timeout")){let l=this.getValidCachedData(n);if(l)return console.warn(`[RequestCacheService] Request timeout, falling back to cache for ${t}`),this.requestAdapter.processCachedData?this.requestAdapter.processCachedData(l):l}throw s}));this.pendingRequests.set(n,o),a.then(s=>{console.log(`[RequestCacheService] Background request completed successfully for ${t}`)}).catch(s=>{console.warn(`[RequestCacheService] Background request failed for ${t}:`,s)});try{return yield o}finally{this.pendingRequests.delete(n)}})}requestInternal(t,e){return bt(this,null,function*(){var n,r,a,i;let o=this.config.keyGenerator(t,e),s=++this.requestSequence,l=this.getValidCachedData(o);if(console.log("[RequestCacheService] requestInternal start",t,"cached:",l),l){if(this.requestAdapter.extractRealTimeData&&this.requestAdapter.mergeData)try{let f=yield this.requestAdapter.execute(t,e),p=this.requestAdapter.extractRealTimeData(f),h=(r=(n=this.requestAdapter).extractCacheableData)==null?void 0:r.call(n,f);return h&&!this.config.consistencyChecker(l,h)?(console.log(`[RequestCacheService] Cache invalidated due to data change for ${t}`),this.setCachedDataWithSequence(o,h,s),f):this.requestAdapter.mergeData(l,p)}catch(f){return console.warn(`[RequestCacheService] Failed to fetch real-time data, using cache only for ${t}:`,f),this.requestAdapter.processCachedData?this.requestAdapter.processCachedData(l):l}return console.log(`[RequestCacheService] use cache for ${t}`),this.requestAdapter.processCachedData?this.requestAdapter.processCachedData(l):l}console.log(`[RequestCacheService] Cache miss, fetching fresh data for ${t} (sequence: ${s})`);let d=yield this.requestAdapter.execute(t,e),_=(i=(a=this.requestAdapter).extractCacheableData)==null?void 0:i.call(a,d);return _&&this.setCachedDataWithSequence(o,_,s),d})}createTimeoutPromise(){return new Promise((t,e)=>{setTimeout(()=>{e(new Error(`[RequestCacheService] Request timeout after ${this.config.timeout/1e3} seconds`))},this.config.timeout)})}getValidCachedData(t){let e=this.cache.get(t);return e?Date.now()>e.expiresAt?(this.cache.delete(t),null):e.data:null}setCachedDataWithSequence(t,e,n,r){let a=this.cache.get(t);if(a&&a.sequence>n){console.log(`[RequestCacheService] Ignoring stale cache update for ${t} (current: ${a.sequence}, incoming: ${n})`);return}let i=Date.now();this.cache.set(t,{data:JSON.parse(JSON.stringify(e)),timestamp:i,expiresAt:i+this.config.duration,key:t,sequence:n,metadata:r}),this.cacheSequences.set(t,n),console.log(`[RequestCacheService] Updated cache for ${t} with sequence ${n}`)}refreshCache(t,e){return bt(this,null,function*(){let n=this.config.keyGenerator(t,e);return this.cache.delete(n),this.request(t,e)})}forceRequest(t,e){return bt(this,null,function*(){var n,r;let a=this.config.keyGenerator(t,e),i=++this.requestSequence;console.log(`[RequestCacheService] Force request for ${t} (sequence: ${i})`);let o=yield this.requestAdapter.execute(t,e),s=(r=(n=this.requestAdapter).extractCacheableData)==null?void 0:r.call(n,o);return s&&(this.setCachedDataWithSequence(a,s,i),console.log(`[RequestCacheService] Force updated cache for ${t}`)),o})}warmupCache(t,e){return bt(this,null,function*(){let n=this.config.keyGenerator(t,e);if(this.pendingRequests.has(n)){console.log(`[RequestCacheService] Skipping warmup for ${t} - request in progress`);return}if(this.hasValidCache(n)){console.log(`[RequestCacheService] Skipping warmup for ${t} - valid cache exists`);return}try{console.log(`[RequestCacheService] Warming up cache for ${t}`),yield this.forceRequest(t,e)}catch(r){console.warn(`[RequestCacheService] Cache warmup failed for ${t}:`,r)}})}clearCache(t){t?(this.cache.delete(t),this.cacheSequences.delete(t),this.pendingRequests.delete(t),console.log(`[RequestCacheService] Cleared cache for ${t}`)):(this.cache.clear(),this.cacheSequences.clear(),this.pendingRequests.clear(),this.requestSequence=0,console.log("[RequestCacheService] Cleared all cache"))}clearExpiredCache(){let t=Date.now();for(let[e,n]of this.cache)t>n.expiresAt&&(this.cache.delete(e),this.cacheSequences.delete(e));console.log("[RequestCacheService] Cleared expired cache entries")}getCacheStats(){let t=Date.now(),e=0,n=0;for(let r of this.cache.values())t>r.expiresAt?n++:e++;return{cacheCount:this.cache.size,validCount:e,expiredCount:n,pendingRequestCount:this.pendingRequests.size}}getCacheKeys(){return Array.from(this.cache.keys())}hasValidCache(t){let e=this.cache.get(t);return e?Date.now()<=e.expiresAt:!1}getPendingRequestKeys(){return Array.from(this.pendingRequests.keys())}hasPendingRequest(t){return this.pendingRequests.has(t)}getCacheSequence(t){return this.cacheSequences.get(t)}},La=class Na{constructor(e){this.element=e,this.next=Na.Undefined,this.prev=Na.Undefined}};La.Undefined=new La(void 0);ie=La,gf=class{constructor(){this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ie.Undefined}clear(){let t=this._first;for(;t!==ie.Undefined;){let e=t.next;t.prev=ie.Undefined,t.next=ie.Undefined,t=e}this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,e){let n=new ie(t);if(this._first===ie.Undefined)this._first=n,this._last=n;else if(e){let a=this._last;this._last=n,n.prev=a,a.next=n}else{let a=this._first;this._first=n,n.next=a,a.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==ie.Undefined){let t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==ie.Undefined){let t=this._last.element;return this._remove(this._last),t}}_remove(t){if(t.prev!==ie.Undefined&&t.next!==ie.Undefined){let e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===ie.Undefined&&t.next===ie.Undefined?(this._first=ie.Undefined,this._last=ie.Undefined):t.next===ie.Undefined?(this._last=this._last.prev,this._last.next=ie.Undefined):t.prev===ie.Undefined&&(this._first=this._first.next,this._first.prev=ie.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==ie.Undefined;)yield t.element,t=t.next}},_f=0,un=class{constructor(t){this.value=t,this.id=_f++}},dn=class{constructor(t){this.options=t,this._size=0}dispose(t){var e,n;this._disposed||(this._disposed=!0,this._listeners&&(t?(this._listeners instanceof un&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(r=>(r==null?void 0:r.value)===t)):(this._listeners=void 0,this._size=0)),(n=(e=this.options)==null?void 0:e.onDidRemoveLastListener)==null||n.call(e))}get event(){var t;return(t=this._event)!=null||(this._event=(e,n)=>{var r,a,i,o,s,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};n&&(e=e.bind(n));let d=new un(e);return this._listeners?this._listeners instanceof un?this._listeners=[this._listeners,d]:this._listeners.push(d):((a=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||a.call(r,this),this._listeners=d,(o=(i=this.options)==null?void 0:i.onDidFirstListener)==null||o.call(i,this)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var _,f,p,h;if(!this._disposed){if(this._listeners instanceof un)this._listeners.id===d.id&&(this._listeners=void 0,this._size=0,(f=(_=this.options)==null?void 0:_.onDidRemoveLastListener)==null||f.call(_));else if(this._listeners){let b=this._listeners.indexOf(d);b>=0&&(this._listeners.splice(b,1),this._size--,this._size===0&&((h=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||h.call(p)))}}}}),this._event}_deliver(t,e){var n;if(!t)return;let r=((n=this.options)==null?void 0:n.onListenerError)||Error.constructor;if(!r){t.value(e);return}try{t.value(e)}catch(a){r(a)}}fire(t){this._listeners&&(this._listeners instanceof un?this._deliver(this._listeners,t):this._listeners.forEach(e=>this._deliver(e,t)))}hasListeners(){return this._size>0}},$e=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(t,e,n=!0){var r;let a=(r=this.listeners.get(t))!=null?r:new dn,i=l=>e(...l.args),o=a.event(i);this.listerHandlerMap.set(e,{handler:i,dispose:o}),this.listeners.set(t,a);let s=this.cachedEventQueue.get(t);if(s&&n)for(let l of s)e(...l.args)}flushCachedEvent(t){t?this.cachedEventQueue.delete(t):this.cachedEventQueue.clear()}off(t,e){let n=this.listerHandlerMap.get(e);n&&(n.dispose(),this.listerHandlerMap.delete(e))}emit(t,...e){let n=this.listeners.get(t),r=this.cachedEventQueue.get(t);r||(r=new gf,this.cachedEventQueue.set(t,r)),r.push({args:e}),n&&n.fire({event:t,args:e})}once(t,e){let n=(...r)=>{e(...r),this.off(t,n)};this.on(t,n,!1)}},Ua={};Wd(Ua,{None:()=>yf,filter:()=>bf,once:()=>ks,toPromise:()=>wf});yf=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Pa=Symbol.for("Jolibox.hostEmitter"),Ef=()=>{let t=new $e;return globalThis[Pa]||(globalThis[Pa]={on:t.on.bind(t),off:t.off.bind(t),emit:t.emit.bind(t),once:t.once.bind(t)}),globalThis[Pa]},pt=Ef();Vn=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new dn,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(t){if(!t)throw new Error("invalid command");if(t.metadata&&Array.isArray(t.metadata.args)){let n=[];for(let a of t.metadata.args)n.push(a.constraint);let r=t.handler;t.handler=function(...a){return If(a,n),r(...a)}}let{id:e}=t;this._commands.get(e)&&console.info(`[Jolibox SDK] duplicated command is registered ${e}`),this._commands.set(e,t),this._onDidRegisterCommand.fire(e)}getCommand(t){return this._commands.get(t)}getCommands(){let t=new Map;for(let e of this._commands.keys()){let n=this.getCommand(e);n&&t.set(e,n)}return t}};Vn=ps([_s],Vn);Ba=class{constructor(){this._onWillExecuteCommand=new dn,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new dn,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Vn,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=zd(3e4)),this._starActivation}executeCommand(t,...e){return bt(this,null,function*(){return this.registry.getCommand(t)?this._tryExecuteCommand(t,e):(yield Promise.all([Promise.race([this._activateStar(),Ua.toPromise(Ua.filter(this.registry.onDidRegisterCommand,n=>n===t))])]),this._tryExecuteCommand(t,e))})}executeCommandThowErr(t,...e){if(!this.registry.getCommand(t))throw new Error(`command '${t}' not found`);let n=this.registry.getCommand(t);this._onWillExecuteCommand.fire({commandId:t,args:e});let r=this.invokeFunction(n.handler,...e);return this._onDidExecuteCommand.fire({commandId:t,args:e}),r}_tryExecuteCommand(t,e){let n=this.registry.getCommand(t);if(!n)return Promise.reject(new Error(`command '${t}' not found`));try{this._onWillExecuteCommand.fire({commandId:t,args:e});let r=this.invokeFunction(n.handler,...e);return this._onDidExecuteCommand.fire({commandId:t,args:e}),Promise.resolve(r)}catch(r){return Promise.reject(r)}}invokeFunction(t,...e){let n=!1;try{return t(...e)}finally{n=!0}}};Ba=ps([_s],Ba);Ts=Symbol.for("Jolibox.commands")});function Ue(t,e={}){za.emit("ERROR_REPORT",{error:t,options:e})}var za,At,et=ne(()=>{"use strict";q();q();za=new $e,At=new $e;Ue.debounce=fn(Ue,50,{leading:!0})});var Xa,Rf,xs,Ps,Ds=ne(()=>{"use strict";q();et();Xa=t=>{let e=t.replace(/-/g,"+").replace(/_/g,"/"),n=e.length%4===0?"":"=".repeat(4-e.length%4),r=atob(e+n);try{return JSON.parse(r)}catch(a){return{}}},Rf=t=>{let e=JSON.stringify(t);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},xs=t=>{var e;try{let a=(e=new URL(t).searchParams.get("joliSource"))==null?void 0:e.split(".");if(a!=null&&a.length){let[i,o,s]=a;return{headerJson:Xa(i),payloadJson:Xa(o),signature:Xa(s)}}else throw"joli_source is missing"}catch(n){return Ue(new Is(`${t} not a valid schema: ${n}`)),{headerJson:{},payloadJson:{},signature:{}}}},Ps=(t,e)=>{let n=e.split(".");if(n&&n.length===3){let r=n[0],a=Rf(t),i=n[2];return`${r}.${a}.${i}`}return e}});var Of,Wn,Ls,Ya=ne(()=>{"use strict";q();Of="1.3.4",Wn=()=>Of,Ls=()=>{let t=Wn();return`${Cs(t)}`}});function Za(t,e){return(document==null?void 0:document.head.querySelector(`meta[name="${t}"][content="${e}"]`))!==null}var kf,Ns,Qa,Us,oe,Tf,L,fe=ne(()=>{"use strict";q();Ds();Ya();q();kf={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:$a(),adId:Ka(),pixelRatio:window.devicePixelRatio||1,platform:Re.isAndroid?"android":Re.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:Wn()},schema:window.location.href,platform:Re.isAndroid?"android":Re.isiOS?"ios":"h5"},Qa=(Ns=globalThis.joliboxJSCore)==null?void 0:Ns.env,oe=Object.assign({},(Us=Qa==null?void 0:Qa())!=null?Us:kf);Tf=()=>{var E,C,w,O,k,M,B,I,D,J,j;let{payloadJson:t,headerJson:e,signature:n}=oe.schema.length?xs(oe.schema):{},r=`${oe.deviceInfo.did}-${new Date().getTime()}`,i=new URL(oe.schema.length?oe.schema:window.location.href).searchParams,o=(w=(C=(E=i.get("mpId"))!=null?E:i.get("appId"))!=null?C:i.get("gameId"))!=null?w:"",s=(M=(k=(O=oe.clientSessionId)!=null?O:t==null?void 0:t.sessionId)!=null?k:i.get("sessionId"))!=null?M:r,l=!!((I=(B=t==null?void 0:t.testAdsMode)!=null?B:t==null?void 0:t.__testAdsMode)!=null?I:i.get("testAdsMode")==="true"),d=(j=(J=(D=t==null?void 0:t.joliboxEnv)!=null?D:t==null?void 0:t.__joliboxEnv)!=null?J:i.get("joliboxEnv"))!=null?j:"production",_=d==="staging",f=e==null?void 0:e.channel,h=new URL(window.location.href).searchParams,b=t==null?void 0:t.__shouldInterupt;return{get startTime(){var N;return(N=performance.timeOrigin)!=null?N:performance.timing.navigationStart},get testMode(){return _},get testAdsMode(){return l},get joliboxEnv(){return d},get joliSource(){var N,G;return(G=(N=h.get("joliSource"))!=null?N:i.get("joliSource"))!=null?G:null},get mpId(){var N;return(N=o!=null?o:t==null?void 0:t.id)!=null?N:""},get mpVersion(){var N;return(N=e==null?void 0:e.ver)!=null?N:Wn()},get mpType(){var N,G;return(G=(N=e==null?void 0:e.__mpType)!=null?N:t==null?void 0:t.__mpType)!=null?G:"game"},get platform(){var N;return((N=oe.platform)!=null?N: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 N,G;return(G=(N=oe.clientSessionId)!=null?N:s)!=null?G:r},get channel(){return f},get webviewId(){var N;return(N=oe.webviewId)!=null?N:-1},get shouldInterupt(){return b},get from(){return t==null?void 0:t.__from},get baseApiHost(){return Rs(_)},get adId(){var N;return(N=oe.deviceInfo.adId)!=null?N:oe.deviceInfo.did},get language(){return oe.deviceInfo.lang},get sdkEnvironment(){return Za("dlightek","jolibox")?"dlightek":i.get("huaweiQuick")==="true"?"huaweiQuick":Za("gamedistribution","jolibox")?"gamedistribution":Za("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var X,Z,He;let N=(X=oe.deviceInfo.pixelRatio)!=null?X:1,G=(Z=oe.deviceInfo.statusBarHeight)!=null?Z:t==null?void 0:t.__androidStatusBarHeight,F=(He=oe.deviceInfo.navigationBarHeight)!=null?He:t==null?void 0:t.__androidNavigationBarHeight;return{statusBarHeight:G!==void 0?G/N:20,navigationBarHeight:F!==void 0?F/N:10}},get abTests(){var N,G;return(G=(N=oe.abValues)==null?void 0:N.split(","))!=null?G:[]},get mpInfo(){var N;return(N=oe.mpInfo)!=null?N:{mpName:"unknown"}},onEnvConfigChanged:N=>{ys(oe,N,ws)},encodeJoliSourceQuery:N=>{var G,F;return e&&n?Ps(W(W({},t),N),(G=i.get("joliSource"))!=null?G:""):(F=i.get("joliSource"))!=null?F:""},setDoExitDirectly:()=>{b=!1}}},L=Tf()});var ei,Ms,xf,Pf,Bs,Df,Gs=ne(()=>{"use strict";q();et();fe();q();ei=!1,Ms=(t,e)=>t==null?!1:e in t,xf=t=>Ms(t,"kind"),Pf=t=>{let e=t.toLowerCase().split("_");return e[0]+e.slice(1).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")},Bs=(t,e={},n)=>{var i,o,s;let r={user_id:(o=(i=L.hostUserInfo)==null?void 0:i.uid)!=null?o:"",device_id:(s=L.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:Pf(t.name)},a=Ce(W({},r),{env:e.environment,isFromUser:n});n?At.emit("GLOBAL_USER_ERROR",t,a):At.emit("GLOBAL_ERROR",t,a)},Df=t=>Ms(t,"kind")&&t.kind==="USER_ERROR";za.on("ERROR_REPORT",({error:t,options:e})=>{if(ei)return;ei=!0;let n=xf(t)&&t.raw?t.raw:t;try{let r=Df(t);Bs(t,e,r)}catch(r){let a=r instanceof Error?r.message:String(r),i=new ja(`${a}, origin error: ${n.message}`);Ne.error(i),Bs(new ja(i.message),{environment:e.environment},!1)}finally{ei=!1}})});var ti,ni=ne(()=>{"use strict";et();q();et();ti=t=>new Es(t)});function Js(t,e){let n=(r,a,i)=>{let d=a!=null?a:{},{eventType:o}=d,s=ls(d,["eventType"]),l=Ce(W({tag:r,eventType:i!=null?i:o!=null?o:Et.Other},e),{extra:W({},s)});r=="globalJsError"?Ue(new $n(JSON.stringify(l))):t("systemLog",l,L.webviewId)};return n.debounce=fn(n,500,{leading:!0}),n}function Fs(t){let e=(n,r,a)=>{var s;let i=(s=a&&JSON.stringify(a))!=null?s:0,o={speed_value_type:n,total_duration:r};i&&Object.assign(o,{extra:i}),t("joliboxSpeedAnalysis",o)};return e.debounce=fn(e,500,{leading:!0}),e}var Hs=ne(()=>{"use strict";q();q();et();fe()});function js(t,e){let n=Js(t,e),r=Fs(n);return{track:n,trackPerformance:r}}var qs=ne(()=>{"use strict";Hs()});var ri=ne(()=>{"use strict"});var zn,Vs=ne(()=>{"use strict";fe();q();q();zn=class{constructor(e){this.apiHost=e;this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return S(this,null,function*(){let n=`${this.apiHost}/api/fe-configs/js-sdk/samples-config`,r=yield(yield fetch(n)).json();this.samplesConfig=r})}checkIsSampled(e){if(!this.samplesConfig)return!1;let{samples:n}=this.samplesConfig;for(let[r,a]of Object.entries(n))if(a.includes(e.name))return Math.floor(Math.random()*101)<parseFloat(r);return!1}getDevice(){var r,a,i,o,s;let{nativeSDKVersion:e,jssdkVersion:n}=L.sdkInfo;return{platform:1e3,os:L.deviceInfo.platform,appVersion:(r=e!=null?e:n)!=null?r:"1.0.0",appId:(i=(a=L.hostInfo)==null?void 0:a.aid)!=null?i:"1",model:(o=L.deviceInfo.model)!=null?o:"UnknownModel",brand:(s=L.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:L.deviceInfo.did,jsSdkVersion:n,extra:{}}}getLocation(){let e=new URLSearchParams(window.location.search),n={};return e.forEach((r,a)=>{n[a]=r}),{name:"GamePage",params:n}}trackEvent(e,n,r){return S(this,null,function*(){if(this.checkIsSampled(e))return;let a=e.location?e.location:yield this.getLocation(),i=e.target||null,o=e.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let s=this.deviceInfo,d={protocolVersion:"1.0.0",events:[Ce(W({},e),{location:a,target:i,extra:o,timestamp:Date.now(),userId:null})],device:s,project:n};try{r?yield this.doReport(Va(d),r):yield this.doReport(Va(d))}catch(_){Ne.log("[Jolibox SDK] report API error",_)}})}}});var ai=ne(()=>{"use strict";qs();ri();Vs()});var ii,$s,tt,Xn,qe,Jt=ne(()=>{"use strict";Ya();fe();q();ii=t=>{let e=new AbortController;return setTimeout(()=>e.abort(),t),e.signal};($s=AbortSignal.timeout)!=null||(AbortSignal.timeout=ii);tt=class t{constructor(){this.httpClients=new WeakSet;this.networkRequests=[];this.maxRequestsToTrack=20;this.getNetworkStatus=()=>this.networkRequests.length===0?!0:this.networkRequests.filter(r=>r).length/this.networkRequests.length>=.6}static getInstance(){return t._instance||(t._instance=new t),t._instance}create(e){let n=new Xn(e);return t.getInstance().httpClients.add(n),n}recordNetworkRequest(e){this.networkRequests.push(e),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},Xn=class{constructor(e){this.xua=Ls();this.getJoliSource=()=>L.joliSource;var r;let n=Gt(L.testMode);this.baseUrl=(r=e==null?void 0:e.baseUrl)!=null?r:n}get(e,n){return S(this,null,function*(){try{let{query:r,timeout:a}=n!=null?n:{},{headers:i}=n!=null?n:{},o=r?new URLSearchParams(r):null,s=o==null?void 0:o.toString(),l=`${this.baseUrl}${e}${s?`?${s}`:""}`,d=this.xua,_=this.getJoliSource();i=Object.assign({},i!=null?i:{},d?{"x-user-agent":d}:{},_?{"x-joli-source":_}:{});let f=yield fetch(l,{method:"GET",headers:i,credentials:"include",signal:ii(a!=null?a:3e4)});return tt.getInstance().recordNetworkRequest(!0),yield f.json()}catch(r){throw tt.getInstance().recordNetworkRequest(!1),r}})}post(e,n){return S(this,null,function*(){try{let{data:r,query:a,timeout:i}=n!=null?n:{},{headers:o}=n!=null?n:{},s=a?new URLSearchParams(a):null,l=s==null?void 0:s.toString(),d=`${this.baseUrl}${e}${l?`?${l}`:""}`,_=this.xua,f=this.getJoliSource();o=Object.assign({},o!=null?o:{},{"Content-Type":"application/json"},_?{"x-user-agent":_}:{},f?{"x-joli-source":f}:{},{"x-os-type":Re.isAndroid?"ANDROID":Re.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let p=yield fetch(d,{method:"POST",headers:o,body:JSON.stringify(r),signal:ii(i!=null?i:3e4),credentials:"include"});tt.getInstance().recordNetworkRequest(!0);let h=p.headers.get("content-type");if(h!=null&&h.includes("application/octet-stream"))try{return p.blob()}catch(b){return yield p.arrayBuffer()}if(h!=null&&h.includes("multipart/form-data")||h!=null&&h.includes("application/x-www-form-urlencoded"))try{return p.formData()}catch(b){return yield p.text()}if(h!=null&&h.includes("application/json"))try{return yield p.json()}catch(b){return yield p.text()}return p}catch(r){throw tt.getInstance().recordNetworkRequest(!1),r}})}put(e,n){return S(this,null,function*(){try{let{data:r,query:a,timeout:i}=n!=null?n:{},{headers:o}=n!=null?n:{},s=a?new URLSearchParams(a):null,l=s==null?void 0:s.toString(),d=`${this.baseUrl}${e}${l?`?${l}`:""}`,_=this.xua,f=this.getJoliSource();o=Object.assign({},o!=null?o:{},{"Content-Type":"application/json"},_?{"x-user-agent":_}:{},f?{"x-joli-source":f}:{});let p=yield fetch(d,{method:"PUT",headers:o,credentials:"include",body:JSON.stringify(r!=null?r:{})});if(!p.ok)throw tt.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${p.status}`);return tt.getInstance().recordNetworkRequest(!0),yield p.json()}catch(r){throw console.error("Error:",r),r}})}};window.JoliboxHttpClient=Xn;qe=tt.getInstance()});var oi,Yn,si=ne(()=>{"use strict";fe();ai();Jt();q();oi=class extends zn{constructor(){super(...arguments);this.httpClient=qe.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n;return Os((n=L.testMode)!=null?n:!1)}doReport(n){this.httpClient.post("/report",{data:n,timeout:5e3}).catch(r=>{console.info("report error",r)})}},Yn=new oi(Gt(L.testMode))});var Lf,Ks=ne(()=>{"use strict";Gs();q();ni();q();si();fe();Lf=(t,e)=>{var a,i,o;let n={message:e.message,stack:(a=e.stack)!=null?a:"",errorType:e.name,source:0},r={name:t,type:Et.ErrorTrace,location:null,target:null,extra:n,timestamp:Date.now(),userId:(o=(i=L.hostUserInfo)==null?void 0:i.uid)!=null?o:null};Yn.trackEvent(r,Mt.WebSDK)};At.on("GLOBAL_ERROR",(t,e)=>{Lf(e.tag,t)});At.on("GLOBAL_USER_ERROR",(t,e)=>{Ne.log("UserError",t,e)})});var Qn,Ws=ne(()=>{"use strict";Qn=class{constructor(e,n){this.eventEmitter=e;this.lastReportTime=0;this.visible=!0;this.reportCount=0;this.notifyIframeGameEvent=(e,n)=>{window.parent&&window.parent.postMessage({type:e,data:n},"*")};this.playGame=e=>{this.reportCount++,(this.reportCount<=3||(this.reportCount-3)%3===0)&&(this.reporter({event:"PLAY_GAME",params:{duration:e}}),this.tracker("PlayGame",{duration:e}),this.notifyIframeGameEvent("JOLIBOX_GAME_PLAY",{duration:e}))};this.timer=this.createRAFTimer(e=>{this.playGame(e)});this.interval=n!=null?n:5*1e3,e.on("visible",r=>{this.visible=r})}start(e){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:e!=null?e:0}}),this.tracker("OpenGame",{duration:e!=null?e:0}),this.notifyIframeGameEvent("JOLIBOX_GAME_OPEN",{duration:e!=null?e:0}),this.timer.start()}close(e){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:e}}),this.tracker("CloseGame",{duration:e}),this.notifyIframeGameEvent("JOLIBOX_GAME_CLOSE",{duration:e}),this.timer.stop()}createRAFTimer(e){let n=Date.now(),r,a,i=!1,o=0,s=()=>{if(!i)return;let h=Date.now(),b=h-n;b>=this.interval&&(this.visible&&(o+=Math.min(b,this.interval+1e3),e(o)),n=h),r=requestAnimationFrame(s)},l=()=>{_(),n=Date.now(),a=window.setInterval(()=>{if(!i)return;let h=Date.now();h-n>=this.interval&&(n=h)},this.interval)},d=()=>{f(),n=Date.now(),r=requestAnimationFrame(s)},_=()=>{r&&(cancelAnimationFrame(r),r=0)},f=()=>{a&&(clearInterval(a),a=0)};this.eventEmitter.on("visible",h=>{i&&(console.log("visible",h),h?d():l())});let p=this.visible;return{start(){i||(i=!0,p?d():l())},stop(){i=!1,_(),f()}}}}});var zs,Xs=ne(()=>{"use strict";zs=`-----BEGIN PUBLIC KEY-----
|
|
1
|
+
var Hf=Object.create;var Wi=Object.defineProperty,qf=Object.defineProperties,Vf=Object.getOwnPropertyDescriptor,$f=Object.getOwnPropertyDescriptors,Kf=Object.getOwnPropertyNames,nn=Object.getOwnPropertySymbols,Ks=Object.getPrototypeOf,zi=Object.prototype.hasOwnProperty,Ws=Object.prototype.propertyIsEnumerable,Wf=Reflect.get;var $s=(e,t,r)=>t in e?Wi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,z=(e,t)=>{for(var r in t||(t={}))zi.call(t,r)&&$s(e,r,t[r]);if(nn)for(var r of nn(t))Ws.call(t,r)&&$s(e,r,t[r]);return e},Re=(e,t)=>qf(e,$f(t));var gr=(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 zs=(e,t)=>{var r={};for(var n in e)zi.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&nn)for(var n of nn(e))t.indexOf(n)<0&&Ws.call(e,n)&&(r[n]=e[n]);return r};var re=(e,t)=>()=>(e&&(t=e(e=0)),t);var Yi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var zf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Kf(t))!zi.call(e,i)&&i!==r&&Wi(e,i,{get:()=>t[i],enumerable:!(n=Vf(t,i))||n.enumerable});return e};var Xi=(e,t,r)=>(r=e!=null?Hf(Ks(e)):{},zf(t||!e||!e.__esModule?Wi(r,"default",{value:e,enumerable:!0}):r,e));var Ys=(e,t,r)=>Wf(Ks(e),r,t);var A=(e,t,r)=>new Promise((n,i)=>{var a=l=>{try{s(r.next(l))}catch(c){i(c)}},o=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(a,o);s((r=r.apply(e,t)).next())});function nh(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function oa(e){return typeof e=="string"}function nl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function il(e){return typeof e=="object"&&Array.isArray(e)}function ih(e){return typeof e=="undefined"}function ah(e){return ih(e)||e===null}function oh(e){return typeof e=="function"}function al(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function ol(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,a){for(let o in a)if(Object.prototype.hasOwnProperty.call(a,o)){let s=i[o],l=a[o],c=r(s,l,o,i,a);c!==void 0?i[o]=c:Zs(l)&&Zs(s)?i[o]=n(aa({},s),l):Array.isArray(l)&&Array.isArray(s)?i[o]=[...s,...l]:i[o]=l}return i}return n(e,t)}function Zs(e){return e&&typeof e=="object"&&e.constructor===Object}function sl(e,t){if(Array.isArray(e))return e.concat(t)}function wr(e,t,r={}){let n=null,i,a,o,{leading:s=!1,trailing:l=!0}=r,c=()=>(o=e.apply(a,i),i=void 0,a=void 0,o),p=function(...u){i=u,a=this;let m=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,l&&!m&&c()},t),m)return c()};return p.cancel=()=>{n&&clearTimeout(n),n=null,i=a=void 0},p.flush=()=>{if(n)return clearTimeout(n),n=null,c()},p}function ch(e,t){return(...r)=>t(e,...r)}function ul(e){return t=>ch(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new lh(`${i}`))}})}function _r(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function an(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,a)=>(i[a]=String(n[a]),i),{})}return e[r]})}function ph(e){let t=e.location?an(e.location,tl):null,r=e.target?an(e.target,tl):null;return an(th(aa({},e),{location:t,target:r}),hh)}function ua(e){let t=e.events.map(n=>ph(n)),r=an(e.device,mh);return[e.protocolVersion,t,r,e.project]}function vh(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};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 ma(e,t,r){let n=window.location.hostname,i=n.split("."),a=r?t:e;if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n))return`${a}.jolibox.com`;if(i.length>=2){let o=i.slice(-2).join(".");if(o==="jolibox.com"||o==="pico-game.com"||o==="joyslite.com"||o==="mporia.com"||o==="pingplus.ai")return`${a}.${o}`}return`${a}.jolibox.com`}function ml(e){return ma("app","stg-app",e)}function Kt(e){return`https://${ma("api","stg-api",e)}`}function Ih(e){return ma("collect","stg-collect",e)}function pl(e){return`https://${Ih(e)}`}function Rh(e){return new Promise(t=>vl(e)(t))}function vl(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function Oh(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(a.fire,a)}},a=new br(i);return a.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function Th(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)xh(e[n],t[n])}function xh(e,t){if(oa(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(oh(t)){try{if(e instanceof t)return}catch(r){}if(!ah(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 Ph(){return typeof globalThis!="undefined"?globalThis[gl]:void 0}function Nh(e){typeof globalThis!="undefined"&&(globalThis[gl]=e)}function we(e=!1){let t=Ph();if(!e&&t)return t;let r=new on,n=new na,i={registerCommand(a,o,s){r.registerCommand({id:a,handler:o,metadata:s})},executeCommand(a,...o){return n.executeCommand(a,...o)},excuteCommandSync(a,...o){return n.executeCommandThowErr(a,...o)}};return Nh(i),i}var ia,Yf,Xf,Qf,Xs,Zf,eh,Qs,aa,th,rh,rl,Ot,sh,sa,la,ll,cl,lh,dl,sn,ln,ca,Be,Zi,dh,da,el,uh,kt,$t,fh,tl,hh,mh,$e,Vt,gh,Oe,_h,yh,bh,fl,fa,ha,wh,Eh,hl,Tt,ea,ae,Ah,Sh,yr,br,ze,ra,Ch,Qi,kh,bt,on,na,gl,q=re(()=>{"use strict";ia=Object.defineProperty,Yf=Object.defineProperties,Xf=Object.getOwnPropertyDescriptor,Qf=Object.getOwnPropertyDescriptors,Xs=Object.getOwnPropertySymbols,Zf=Object.prototype.hasOwnProperty,eh=Object.prototype.propertyIsEnumerable,Qs=(e,t,r)=>t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,aa=(e,t)=>{for(var r in t||(t={}))Zf.call(t,r)&&Qs(e,r,t[r]);if(Xs)for(var r of Xs(t))eh.call(t,r)&&Qs(e,r,t[r]);return e},th=(e,t)=>Yf(e,Qf(t)),rh=(e,t)=>{for(var r in t)ia(e,r,{get:t[r],enumerable:!0})},rl=(e,t,r,n)=>{for(var i=n>1?void 0:n?Xf(t,r):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(n?o(t,r,i):o(i))||i);return n&&i&&ia(t,r,i),i},Ot=(e,t,r)=>new Promise((n,i)=>{var a=l=>{try{s(r.next(l))}catch(c){i(c)}},o=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(a,o);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}sh=(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))(sh||{}),sa=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}},la=class extends sa{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},ll=class extends sa{constructor(){super(...arguments),this.kind="USER_ERROR"}},cl=class extends ll{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},lh=class extends ll{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))}},dl=class extends la{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},sn=class extends la{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},ln=class extends sa{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}}},ca=class extends la{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Be={log:_r("log"),warn:_r("warn"),info:_r("info"),error:_r("error"),debug:_r("debug")};Object.assign(globalThis,{logger:Be});Zi=Symbol.for("Jolibox.canIUseMap"),dh={};globalThis[Zi]||(globalThis[Zi]=dh);da={get config(){return globalThis[Zi]}},el=Symbol.for("Jolibox.canIUseMap.native"),uh={};globalThis[el]||(globalThis[el]=uh);kt=(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))(kt||{}),$t=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))($t||{}),fh=(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))(fh||{}),tl=["name","params"],hh=["name","type","location","target","extra","timestamp","userId"],mh=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];$e=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});vh();Vt=typeof window=="undefined",gh=()=>!Vt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Oe={isiOS:!Vt&&(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:!Vt&&navigator.userAgent.includes("Android"),isMac:!Vt&&navigator.userAgent.includes("Mac"),isFacebook:!Vt&&navigator.userAgent.includes("FB_IAB"),isPC:!Vt&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},_h=()=>Oe.isiOS?"iOS":Oe.isAndroid?"Android":Oe.isMac?"Mac":Oe.isFacebook?"Facebook":"PC",yh="device_id",bh="advertising_id",fl=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,$e()),window.__joliboxLocalStorage__.getItem(e)),fa=()=>new URLSearchParams(window.location.search).get("deviceId")||fl(yh),ha=()=>new URLSearchParams(window.location.search).get("advertisingId")||fl(bh),wh=e=>e.charAt(0).toUpperCase()+e.slice(1),Eh=()=>{var e;let t=new URLSearchParams(window.location.search);return wh((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},hl=e=>{if(gh())return window.navigator.userAgent;let t="JoliboxWebSDK",r=_h(),n=navigator.language,i=fa(),a=ha();return`${t} (${Eh()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${a} version/${e||""}`};Tt=class{constructor(e,t={}){this.requestAdapter=e,this.cache=new Map,this.pendingRequests=new Map,this.requestSequence=0,this.cacheSequences=new Map,this.config=aa({duration:10*60*1e3,timeout:3e3,keyGenerator:(r,n)=>r,consistencyChecker:()=>!0},t)}request(e,t){return Ot(this,null,function*(){let r=this.config.keyGenerator(e,t),n=this.pendingRequests.get(r);if(n)return console.log(`[RequestCacheService] Reusing pending request for ${e}`),n;let i=this.requestInternal(e,t),a=this.createTimeoutPromise(),o=Promise.race([i,a]).catch(s=>Ot(this,null,function*(){if(s.message.includes("timeout")){let l=this.getValidCachedData(r);if(l)return console.warn(`[RequestCacheService] Request timeout, falling back to cache for ${e}`),this.requestAdapter.processCachedData?this.requestAdapter.processCachedData(l):l}throw s}));this.pendingRequests.set(r,o),i.then(s=>{console.log(`[RequestCacheService] Background request completed successfully for ${e}`)}).catch(s=>{console.warn(`[RequestCacheService] Background request failed for ${e}:`,s)});try{return yield o}finally{this.pendingRequests.delete(r)}})}requestInternal(e,t){return Ot(this,null,function*(){var r,n,i,a;let o=this.config.keyGenerator(e,t),s=++this.requestSequence,l=this.getValidCachedData(o);if(console.log("[RequestCacheService] requestInternal start",e,"cached:",l),l){if(this.requestAdapter.extractRealTimeData&&this.requestAdapter.mergeData)try{let u=yield this.requestAdapter.execute(e,t),m=this.requestAdapter.extractRealTimeData(u),h=(n=(r=this.requestAdapter).extractCacheableData)==null?void 0:n.call(r,u);return h&&!this.config.consistencyChecker(l,h)?(console.log(`[RequestCacheService] Cache invalidated due to data change for ${e}`),this.setCachedDataWithSequence(o,h,s),u):this.requestAdapter.mergeData(l,m)}catch(u){return console.warn(`[RequestCacheService] Failed to fetch real-time data, using cache only for ${e}:`,u),this.requestAdapter.processCachedData?this.requestAdapter.processCachedData(l):l}return console.log(`[RequestCacheService] use cache for ${e}`),this.requestAdapter.processCachedData?this.requestAdapter.processCachedData(l):l}console.log(`[RequestCacheService] Cache miss, fetching fresh data for ${e} (sequence: ${s})`);let c=yield this.requestAdapter.execute(e,t),p=(a=(i=this.requestAdapter).extractCacheableData)==null?void 0:a.call(i,c);return p&&this.setCachedDataWithSequence(o,p,s),c})}createTimeoutPromise(){return new Promise((e,t)=>{setTimeout(()=>{t(new Error(`[RequestCacheService] Request timeout after ${this.config.timeout/1e3} seconds`))},this.config.timeout)})}getValidCachedData(e){let t=this.cache.get(e);return t?Date.now()>t.expiresAt?(this.cache.delete(e),null):t.data:null}setCachedDataWithSequence(e,t,r,n){let i=this.cache.get(e);if(i&&i.sequence>r){console.log(`[RequestCacheService] Ignoring stale cache update for ${e} (current: ${i.sequence}, incoming: ${r})`);return}let a=Date.now();this.cache.set(e,{data:JSON.parse(JSON.stringify(t)),timestamp:a,expiresAt:a+this.config.duration,key:e,sequence:r,metadata:n}),this.cacheSequences.set(e,r),console.log(`[RequestCacheService] Updated cache for ${e} with sequence ${r}`)}refreshCache(e,t){return Ot(this,null,function*(){let r=this.config.keyGenerator(e,t);return this.cache.delete(r),this.request(e,t)})}forceRequest(e,t){return Ot(this,null,function*(){var r,n;let i=this.config.keyGenerator(e,t),a=++this.requestSequence;console.log(`[RequestCacheService] Force request for ${e} (sequence: ${a})`);let o=yield this.requestAdapter.execute(e,t),s=(n=(r=this.requestAdapter).extractCacheableData)==null?void 0:n.call(r,o);return s&&(this.setCachedDataWithSequence(i,s,a),console.log(`[RequestCacheService] Force updated cache for ${e}`)),o})}warmupCache(e,t){return Ot(this,null,function*(){let r=this.config.keyGenerator(e,t);if(this.pendingRequests.has(r)){console.log(`[RequestCacheService] Skipping warmup for ${e} - request in progress`);return}if(this.hasValidCache(r)){console.log(`[RequestCacheService] Skipping warmup for ${e} - valid cache exists`);return}try{console.log(`[RequestCacheService] Warming up cache for ${e}`),yield this.forceRequest(e,t)}catch(n){console.warn(`[RequestCacheService] Cache warmup failed for ${e}:`,n)}})}clearCache(e){e?(this.cache.delete(e),this.cacheSequences.delete(e),this.pendingRequests.delete(e),console.log(`[RequestCacheService] Cleared cache for ${e}`)):(this.cache.clear(),this.cacheSequences.clear(),this.pendingRequests.clear(),this.requestSequence=0,console.log("[RequestCacheService] Cleared all cache"))}clearExpiredCache(){let e=Date.now();for(let[t,r]of this.cache)e>r.expiresAt&&(this.cache.delete(t),this.cacheSequences.delete(t));console.log("[RequestCacheService] Cleared expired cache entries")}getCacheStats(){let e=Date.now(),t=0,r=0;for(let n of this.cache.values())e>n.expiresAt?r++:t++;return{cacheCount:this.cache.size,validCount:t,expiredCount:r,pendingRequestCount:this.pendingRequests.size}}getCacheKeys(){return Array.from(this.cache.keys())}hasValidCache(e){let t=this.cache.get(e);return t?Date.now()<=t.expiresAt:!1}getPendingRequestKeys(){return Array.from(this.pendingRequests.keys())}hasPendingRequest(e){return this.pendingRequests.has(e)}getCacheSequence(e){return this.cacheSequences.get(e)}},ea=class ta{constructor(t){this.element=t,this.next=ta.Undefined,this.prev=ta.Undefined}};ea.Undefined=new ea(void 0);ae=ea,Ah=class{constructor(){this._first=ae.Undefined,this._last=ae.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ae.Undefined}clear(){let e=this._first;for(;e!==ae.Undefined;){let t=e.next;e.prev=ae.Undefined,e.next=ae.Undefined,e=t}this._first=ae.Undefined,this._last=ae.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new ae(e);if(this._first===ae.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!==ae.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ae.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ae.Undefined&&e.next!==ae.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ae.Undefined&&e.next===ae.Undefined?(this._first=ae.Undefined,this._last=ae.Undefined):e.next===ae.Undefined?(this._last=this._last.prev,this._last.next=ae.Undefined):e.prev===ae.Undefined&&(this._first=this._first.next,this._first.prev=ae.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ae.Undefined;)yield e.element,e=e.next}},Sh=0,yr=class{constructor(e){this.value=e,this.id=Sh++}},br=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 yr&&(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,a,o,s,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let c=new yr(t);return this._listeners?this._listeners instanceof yr?this._listeners=[this._listeners,c]:this._listeners.push(c):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=c,(o=(a=this.options)==null?void 0:a.onDidFirstListener)==null||o.call(a,this)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var p,u,m,h;if(!this._disposed){if(this._listeners instanceof yr)this._listeners.id===c.id&&(this._listeners=void 0,this._size=0,(u=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||u.call(p));else if(this._listeners){let w=this._listeners.indexOf(c);w>=0&&(this._listeners.splice(w,1),this._size--,this._size===0&&((h=(m=this.options)==null?void 0:m.onDidRemoveLastListener)==null||h.call(m)))}}}}),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 yr?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},ze=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 br,a=l=>t(...l.args),o=i.event(a);this.listerHandlerMap.set(t,{handler:a,dispose:o}),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 Ah,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)}},ra={};rh(ra,{None:()=>Ch,filter:()=>Oh,once:()=>vl,toPromise:()=>Rh});Ch=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Qi=Symbol.for("Jolibox.hostEmitter"),kh=()=>{let e=new ze;return globalThis[Qi]||(globalThis[Qi]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Qi]},bt=kh();on=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new br,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 Th(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}};on=rl([al],on);na=class{constructor(){this._onWillExecuteCommand=new br,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new br,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new on,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=nh(3e4)),this._starActivation}executeCommand(e,...t){return Ot(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),ra.toPromise(ra.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}}};na=rl([al],na);gl=Symbol.for("Jolibox.commands")});function Me(e,t={}){pa.emit("ERROR_REPORT",{error:e,options:t})}var pa,xt,rt=re(()=>{"use strict";q();q();pa=new ze,xt=new ze;Me.debounce=wr(Me,50,{leading:!0})});var va,Dh,_l,yl,bl=re(()=>{"use strict";q();rt();va=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{}}},Dh=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},_l=e=>{var t;try{let i=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(i!=null&&i.length){let[a,o,s]=i;return{headerJson:va(a),payloadJson:va(o),signature:va(s)}}else throw"joli_source is missing"}catch(r){return Me(new dl(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},yl=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=Dh(e),a=r[2];return`${n}.${i}.${a}`}return t}});var Lh,cn,wl,ga=re(()=>{"use strict";q();Lh="1.3.5-beta.2",cn=()=>Lh,wl=()=>{let e=cn();return`${hl(e)}`}});function ya(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var Uh,El,_a,Il,oe,Bh,L,he=re(()=>{"use strict";q();bl();ga();q();Uh={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:fa(),adId:ha(),pixelRatio:window.devicePixelRatio||1,platform:Oe.isAndroid?"android":Oe.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:cn()},schema:window.location.href,platform:Oe.isAndroid?"android":Oe.isiOS?"ios":"h5"},_a=(El=globalThis.joliboxJSCore)==null?void 0:El.env,oe=Object.assign({},(Il=_a==null?void 0:_a())!=null?Il:Uh);Bh=()=>{var E,I,b,R,k,D,J,S,N,F,H;let{payloadJson:e,headerJson:t,signature:r}=oe.schema.length?_l(oe.schema):{},n=`${oe.deviceInfo.did}-${new Date().getTime()}`,a=new URL(oe.schema.length?oe.schema:window.location.href).searchParams,o=(b=(I=(E=a.get("mpId"))!=null?E:a.get("appId"))!=null?I:a.get("gameId"))!=null?b:"",s=(D=(k=(R=oe.clientSessionId)!=null?R:e==null?void 0:e.sessionId)!=null?k:a.get("sessionId"))!=null?D:n,l=!!((S=(J=e==null?void 0:e.testAdsMode)!=null?J:e==null?void 0:e.__testAdsMode)!=null?S:a.get("testAdsMode")==="true"),c=(H=(F=(N=e==null?void 0:e.joliboxEnv)!=null?N:e==null?void 0:e.__joliboxEnv)!=null?F:a.get("joliboxEnv"))!=null?H:"production",p=c==="staging",u=t==null?void 0:t.channel,h=new URL(window.location.href).searchParams,w=e==null?void 0:e.__shouldInterupt;return{get startTime(){var U;return(U=performance.timeOrigin)!=null?U:performance.timing.navigationStart},get testMode(){return p},get testAdsMode(){return l},get joliboxEnv(){return c},get joliSource(){var U,M;return(M=(U=h.get("joliSource"))!=null?U:a.get("joliSource"))!=null?M:null},get mpId(){var U;return(U=o!=null?o:e==null?void 0:e.id)!=null?U:""},get mpVersion(){var U;return(U=t==null?void 0:t.ver)!=null?U:cn()},get mpType(){var U,M;return(M=(U=t==null?void 0:t.__mpType)!=null?U:e==null?void 0:e.__mpType)!=null?M:"game"},get platform(){var U;return((U=oe.platform)!=null?U: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 U,M;return(M=(U=oe.clientSessionId)!=null?U:s)!=null?M:n},get channel(){return u},get webviewId(){var U;return(U=oe.webviewId)!=null?U:-1},get shouldInterupt(){return w},get from(){return e==null?void 0:e.__from},get baseApiHost(){return ml(p)},get adId(){var U;return(U=oe.deviceInfo.adId)!=null?U:oe.deviceInfo.did},get language(){return oe.deviceInfo.lang},get sdkEnvironment(){return ya("dlightek","jolibox")?"dlightek":a.get("huaweiQuick")==="true"?"huaweiQuick":ya("gamedistribution","jolibox")?"gamedistribution":ya("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var K,Y,Ue;let U=(K=oe.deviceInfo.pixelRatio)!=null?K:1,M=(Y=oe.deviceInfo.statusBarHeight)!=null?Y:e==null?void 0:e.__androidStatusBarHeight,G=(Ue=oe.deviceInfo.navigationBarHeight)!=null?Ue:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:M!==void 0?M/U:20,navigationBarHeight:G!==void 0?G/U:10}},get abTests(){var U,M;return(M=(U=oe.abValues)==null?void 0:U.split(","))!=null?M:[]},get mpInfo(){var U;return(U=oe.mpInfo)!=null?U:{mpName:"unknown"}},onEnvConfigChanged:U=>{ol(oe,U,sl)},encodeJoliSourceQuery:U=>{var M,G;return t&&r?yl(z(z({},e),U),(M=a.get("joliSource"))!=null?M:""):(G=a.get("joliSource"))!=null?G:""},setDoExitDirectly:()=>{w=!1}}},L=Bh()});var ba,Sl,Mh,Gh,Al,Jh,Cl=re(()=>{"use strict";q();rt();he();q();ba=!1,Sl=(e,t)=>e==null?!1:t in e,Mh=e=>Sl(e,"kind"),Gh=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},Al=(e,t={},r)=>{var a,o,s;let n={user_id:(o=(a=L.hostUserInfo)==null?void 0:a.uid)!=null?o:"",device_id:(s=L.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:Gh(e.name)},i=Re(z({},n),{env:t.environment,isFromUser:r});r?xt.emit("GLOBAL_USER_ERROR",e,i):xt.emit("GLOBAL_ERROR",e,i)},Jh=e=>Sl(e,"kind")&&e.kind==="USER_ERROR";pa.on("ERROR_REPORT",({error:e,options:t})=>{if(ba)return;ba=!0;let r=Mh(e)&&e.raw?e.raw:e;try{let n=Jh(e);Al(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),a=new ca(`${i}, origin error: ${r.message}`);Be.error(a),Al(new ca(a.message),{environment:t.environment},!1)}finally{ba=!1}})});var wa,Ea=re(()=>{"use strict";rt();q();rt();wa=e=>new cl(e)});function Rl(e,t){let r=(n,i,a)=>{let c=i!=null?i:{},{eventType:o}=c,s=zs(c,["eventType"]),l=Re(z({tag:n,eventType:a!=null?a:o!=null?o:kt.Other},t),{extra:z({},s)});n=="globalJsError"?Me(new sn(JSON.stringify(l))):e("systemLog",l,L.webviewId)};return r.debounce=wr(r,500,{leading:!0}),r}function Ol(e){let t=(r,n,i)=>{var s;let a=(s=i&&JSON.stringify(i))!=null?s:0,o={speed_value_type:r,total_duration:n};a&&Object.assign(o,{extra:a}),e("joliboxSpeedAnalysis",o)};return t.debounce=wr(t,500,{leading:!0}),t}var kl=re(()=>{"use strict";q();q();rt();he()});function Tl(e,t){let r=Rl(e,t),n=Ol(r);return{track:r,trackPerformance:n}}var xl=re(()=>{"use strict";kl()});var Ia=re(()=>{"use strict"});var dn,Pl=re(()=>{"use strict";he();q();q();dn=class{constructor(t){this.apiHost=t;this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return A(this,null,function*(){let r=`${this.apiHost}/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,a,o,s;let{nativeSDKVersion:t,jssdkVersion:r}=L.sdkInfo;return{platform:1e3,os:L.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(a=(i=L.hostInfo)==null?void 0:i.aid)!=null?a:"1",model:(o=L.deviceInfo.model)!=null?o:"UnknownModel",brand:(s=L.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:L.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 A(this,null,function*(){if(this.checkIsSampled(t))return;let i=t.location?t.location:yield this.getLocation(),a=t.target||null,o=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let s=this.deviceInfo,c={protocolVersion:"1.0.0",events:[Re(z({},t),{location:i,target:a,extra:o,timestamp:Date.now(),userId:null})],device:s,project:r};try{n?yield this.doReport(ua(c),n):yield this.doReport(ua(c))}catch(p){Be.log("[Jolibox SDK] report API error",p)}})}}});var Aa=re(()=>{"use strict";xl();Ia();Pl()});var Sa,Nl,nt,un,Ke,Wt=re(()=>{"use strict";ga();he();q();Sa=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(Nl=AbortSignal.timeout)!=null||(AbortSignal.timeout=Sa);nt=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 un(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},un=class{constructor(t){this.xua=wl();this.getJoliSource=()=>L.joliSource;var n;let r=Kt(L.testMode);this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return A(this,null,function*(){try{let{query:n,timeout:i}=r!=null?r:{},{headers:a}=r!=null?r:{},o=n?new URLSearchParams(n):null,s=o==null?void 0:o.toString(),l=`${this.baseUrl}${t}${s?`?${s}`:""}`,c=this.xua,p=this.getJoliSource();a=Object.assign({},a!=null?a:{},c?{"x-user-agent":c}:{},p?{"x-joli-source":p}:{});let u=yield fetch(l,{method:"GET",headers:a,credentials:"include",signal:Sa(i!=null?i:3e4)});return nt.getInstance().recordNetworkRequest(!0),yield u.json()}catch(n){throw nt.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return A(this,null,function*(){try{let{data:n,query:i,timeout:a}=r!=null?r:{},{headers:o}=r!=null?r:{},s=i?new URLSearchParams(i):null,l=s==null?void 0:s.toString(),c=`${this.baseUrl}${t}${l?`?${l}`:""}`,p=this.xua,u=this.getJoliSource();o=Object.assign({},o!=null?o:{},{"Content-Type":"application/json"},p?{"x-user-agent":p}:{},u?{"x-joli-source":u}:{},{"x-os-type":Oe.isAndroid?"ANDROID":Oe.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let m=yield fetch(c,{method:"POST",headers:o,body:JSON.stringify(n),signal:Sa(a!=null?a:3e4),credentials:"include"});nt.getInstance().recordNetworkRequest(!0);let h=m.headers.get("content-type");if(h!=null&&h.includes("application/octet-stream"))try{return m.blob()}catch(w){return yield m.arrayBuffer()}if(h!=null&&h.includes("multipart/form-data")||h!=null&&h.includes("application/x-www-form-urlencoded"))try{return m.formData()}catch(w){return yield m.text()}if(h!=null&&h.includes("application/json"))try{return yield m.json()}catch(w){return yield m.text()}return m}catch(n){throw nt.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return A(this,null,function*(){try{let{data:n,query:i,timeout:a}=r!=null?r:{},{headers:o}=r!=null?r:{},s=i?new URLSearchParams(i):null,l=s==null?void 0:s.toString(),c=`${this.baseUrl}${t}${l?`?${l}`:""}`,p=this.xua,u=this.getJoliSource();o=Object.assign({},o!=null?o:{},{"Content-Type":"application/json"},p?{"x-user-agent":p}:{},u?{"x-joli-source":u}:{});let m=yield fetch(c,{method:"PUT",headers:o,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!m.ok)throw nt.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${m.status}`);return nt.getInstance().recordNetworkRequest(!0),yield m.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=un;Ke=nt.getInstance()});var Ca,fn,Ra=re(()=>{"use strict";he();Aa();Wt();q();Ca=class extends dn{constructor(){super(...arguments);this.httpClient=Ke.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var r;return pl((r=L.testMode)!=null?r:!1)}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},fn=new Ca(Kt(L.testMode))});var Fh,Dl=re(()=>{"use strict";Cl();q();Ea();q();Ra();he();Fh=(e,t)=>{var i,a,o;let r={message:t.message,stack:(i=t.stack)!=null?i:"",errorType:t.name,source:0},n={name:e,type:kt.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(o=(a=L.hostUserInfo)==null?void 0:a.uid)!=null?o:null};fn.trackEvent(n,$t.WebSDK)};xt.on("GLOBAL_ERROR",(e,t)=>{Fh(t.tag,e)});xt.on("GLOBAL_USER_ERROR",(e,t)=>{Be.log("UserError",e,t)})});var hn,Ll=re(()=>{"use strict";hn=class{constructor(t,r){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.reportCount=0;this.notifyIframeGameEvent=(t,r)=>{window.parent&&window.parent.postMessage({type:t,data:r},"*")};this.playGame=t=>{this.reportCount++,(this.reportCount<=3||(this.reportCount-3)%3===0)&&(this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t}),this.notifyIframeGameEvent("JOLIBOX_GAME_PLAY",{duration:t}))};this.timer=this.createRAFTimer(t=>{this.playGame(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.notifyIframeGameEvent("JOLIBOX_GAME_OPEN",{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.notifyIframeGameEvent("JOLIBOX_GAME_CLOSE",{duration:t}),this.timer.stop()}createRAFTimer(t){let r=Date.now(),n,i,a=!1,o=0,s=()=>{if(!a)return;let h=Date.now(),w=h-r;w>=this.interval&&(this.visible&&(o+=Math.min(w,this.interval+1e3),t(o)),r=h),n=requestAnimationFrame(s)},l=()=>{p(),r=Date.now(),i=window.setInterval(()=>{if(!a)return;let h=Date.now();h-r>=this.interval&&(r=h)},this.interval)},c=()=>{u(),r=Date.now(),n=requestAnimationFrame(s)},p=()=>{n&&(cancelAnimationFrame(n),n=0)},u=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",h=>{a&&(console.log("visible",h),h?c():l())});let m=this.visible;return{start(){a||(a=!0,m?c():l())},stop(){a=!1,p(),u()}}}}});var Ul,Bl=re(()=>{"use strict";Ul=`-----BEGIN PUBLIC KEY-----
|
|
2
2
|
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs29BUZPZdQwNDEYtXufp
|
|
3
3
|
IGF40RBoddFzoD2ixl6PjyKWFXF8kxGS++HNtLspxhLvWoE12IZvrP7+whSpgHcy
|
|
4
4
|
4ryuW86mOdHnP9iyeK69GosHz3lVhQjF9UdhJDXB7P/zdj3VlVzZIj0yL+YvZjO0
|
|
@@ -6,9 +6,9 @@ F9vHrK8GMr1/gf3HKAroVJUVmJlWjqhBGoQzb58mqbTSWSN0HkDdYwXHNh/Xc1le
|
|
|
6
6
|
DJDbBmfKOQdlBjABR9gb1wGz2LPFA40kzROV9mMiVePXpCOKNMy+b0UOW4RoF7pi
|
|
7
7
|
Rq0jHJ4fRrMWvf/GugT0mv8YyuU9DaXLqTGP+jOEVvzvgtkO84XtLW1vh5ggINPW
|
|
8
8
|
2wIDAQAB
|
|
9
|
-
-----END PUBLIC KEY-----`});function
|
|
10
|
-
or `);this.errors.push(
|
|
11
|
-
`);throw t.errors.length=0,ci(!1),new TypeError(r)}}var V,mi=ne(()=>{"use strict";fi();fi();V={object(t){return new dr(t)},array(t){return new cr(t)},tuple(...t){return new mr(...t)},literal(t){return new fr(t)},or(...t){return new hr(...t)},symbol(){return new ar},record(t){return new ur(t)},function(){return new sr},boolean(){return new nr},string(){return new rr},number(){return new tr},undefined(){return new ir},null(){return new or},unknown(){return new Ft},any(){return new Ft},as(){return new Ft},arraybuffer(){return new pr},enum(...t){return new lr(...t)},typedarray(t){return new vr(t)}}});var gr,il,ol=ne(()=>{"use strict";q();et();mi();ni();gr=1,il=t=>{function e(r,a){return(...i)=>{var f,p,h,b;let o=Date.now(),s={method:r,trace_id:gr};gr+=1;let l="SUCCESS",d=`${r}:ok`,_=0;try{if(a.paramsSchema)try{hi(a.paramsSchema,i,"params")}catch(O){throw ti(`${r}:fail ${O.message}`)}let E=a.implement(...i),C=E,w=`${r}:ok`;if(E&&"code"in E){let{code:O,data:k,message:M}=E;l=O,C=k,w=M}return{code:l,message:w,data:C}}catch(E){let C=E;_=(p=(f=C.code)!=null?f:C.errNo)!=null?p:2e3,l="FAILURE";let w=(b=(h=C.message)!=null?h:C.errMsg)!=null?b:`${E}`;return d=`${r}:${l} ${w.replace(/^\S+:(fail|cancel)\s?/,"")}`,Ue(new Kn(d,_)),{code:l,message:d}}finally{let E=Date.now()-o}}}function n(r,a){return(...i)=>S(this,null,function*(){var p,h,b,E;let o=gs(i)?i:[i],s=Date.now(),l={method:r,trace_id:gr};gr+=1;let d=`${r}:ok`,_="SUCCESS",f={code:_,message:d};try{if(a.paramsSchema)try{hi(a.paramsSchema,o,"params")}catch(O){throw ti(O.message)}let w=yield a.implement(...o);if(w&&"code"in w){let{code:O,data:k,message:M}=w;_=O,d=M,w=k}return Object.assign(f,{code:_,message:d,data:w}),f}catch(C){let w=C,O=(h=(p=w.code)!=null?p:w.errNo)!=null?h:2e3;_="FAILURE";let k=(E=(b=w.message)!=null?b:w.errMsg)!=null?E:`${C}`,M=`${r}:${_} ${k.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(f,{code:_,message:M}),Ue(new Kn(M,O)),f}finally{let C=Date.now()-s}})}return{createAPI:n,createSyncAPI:e}}});var at,St,be,hn=ne(()=>{"use strict";rl();vt();ol();mi();({createAPI:at,createSyncAPI:St}=il(Te)),be=nl("h5")});var ul=Ta((cl,_i)=>{(function(t){if(typeof cl=="object"&&typeof _i!="undefined")_i.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window!="undefined"?e=window:typeof global!="undefined"?e=global:typeof self!="undefined"?e=self:e=this,e.localforage=t()}})(function(){var t,e,n;return function r(a,i,o){function s(_,f){if(!i[_]){if(!a[_]){var p=typeof ln=="function"&&ln;if(!f&&p)return p(_,!0);if(l)return l(_,!0);var h=new Error("Cannot find module '"+_+"'");throw h.code="MODULE_NOT_FOUND",h}var b=i[_]={exports:{}};a[_][0].call(b.exports,function(E){var C=a[_][1][E];return s(C||E)},b,b.exports,r,a,i,o)}return i[_].exports}for(var l=typeof ln=="function"&&ln,d=0;d<o.length;d++)s(o[d]);return s}({1:[function(r,a,i){(function(o){"use strict";var s=o.MutationObserver||o.WebKitMutationObserver,l;if(s){var d=0,_=new s(E),f=o.document.createTextNode("");_.observe(f,{characterData:!0}),l=function(){f.data=d=++d%2}}else if(!o.setImmediate&&typeof o.MessageChannel!="undefined"){var p=new o.MessageChannel;p.port1.onmessage=E,l=function(){p.port2.postMessage(0)}}else"document"in o&&"onreadystatechange"in o.document.createElement("script")?l=function(){var w=o.document.createElement("script");w.onreadystatechange=function(){E(),w.onreadystatechange=null,w.parentNode.removeChild(w),w=null},o.document.documentElement.appendChild(w)}:l=function(){setTimeout(E,0)};var h,b=[];function E(){h=!0;for(var w,O,k=b.length;k;){for(O=b,b=[],w=-1;++w<k;)O[w]();k=b.length}h=!1}a.exports=C;function C(w){b.push(w)===1&&!h&&l()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(r,a,i){"use strict";var o=r(1);function s(){}var l={},d=["REJECTED"],_=["FULFILLED"],f=["PENDING"];a.exports=p;function p(I){if(typeof I!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,I!==s&&C(this,I)}p.prototype.catch=function(I){return this.then(null,I)},p.prototype.then=function(I,D){if(typeof I!="function"&&this.state===_||typeof D!="function"&&this.state===d)return this;var J=new this.constructor(s);if(this.state!==f){var j=this.state===_?I:D;b(J,j,this.outcome)}else this.queue.push(new h(J,I,D));return J};function h(I,D,J){this.promise=I,typeof D=="function"&&(this.onFulfilled=D,this.callFulfilled=this.otherCallFulfilled),typeof J=="function"&&(this.onRejected=J,this.callRejected=this.otherCallRejected)}h.prototype.callFulfilled=function(I){l.resolve(this.promise,I)},h.prototype.otherCallFulfilled=function(I){b(this.promise,this.onFulfilled,I)},h.prototype.callRejected=function(I){l.reject(this.promise,I)},h.prototype.otherCallRejected=function(I){b(this.promise,this.onRejected,I)};function b(I,D,J){o(function(){var j;try{j=D(J)}catch(N){return l.reject(I,N)}j===I?l.reject(I,new TypeError("Cannot resolve promise with itself")):l.resolve(I,j)})}l.resolve=function(I,D){var J=w(E,D);if(J.status==="error")return l.reject(I,J.value);var j=J.value;if(j)C(I,j);else{I.state=_,I.outcome=D;for(var N=-1,G=I.queue.length;++N<G;)I.queue[N].callFulfilled(D)}return I},l.reject=function(I,D){I.state=d,I.outcome=D;for(var J=-1,j=I.queue.length;++J<j;)I.queue[J].callRejected(D);return I};function E(I){var D=I&&I.then;if(I&&(typeof I=="object"||typeof I=="function")&&typeof D=="function")return function(){D.apply(I,arguments)}}function C(I,D){var J=!1;function j(X){J||(J=!0,l.reject(I,X))}function N(X){J||(J=!0,l.resolve(I,X))}function G(){D(N,j)}var F=w(G);F.status==="error"&&j(F.value)}function w(I,D){var J={};try{J.value=I(D),J.status="success"}catch(j){J.status="error",J.value=j}return J}p.resolve=O;function O(I){return I instanceof this?I:l.resolve(new this(s),I)}p.reject=k;function k(I){var D=new this(s);return l.reject(D,I)}p.all=M;function M(I){var D=this;if(Object.prototype.toString.call(I)!=="[object Array]")return this.reject(new TypeError("must be an array"));var J=I.length,j=!1;if(!J)return this.resolve([]);for(var N=new Array(J),G=0,F=-1,X=new this(s);++F<J;)Z(I[F],F);return X;function Z(He,Jn){D.resolve(He).then(_a,function(Nt){j||(j=!0,l.reject(X,Nt))});function _a(Nt){N[Jn]=Nt,++G===J&&!j&&(j=!0,l.resolve(X,N))}}}p.race=B;function B(I){var D=this;if(Object.prototype.toString.call(I)!=="[object Array]")return this.reject(new TypeError("must be an array"));var J=I.length,j=!1;if(!J)return this.resolve([]);for(var N=-1,G=new this(s);++N<J;)F(I[N]);return G;function F(X){D.resolve(X).then(function(Z){j||(j=!0,l.resolve(G,Z))},function(Z){j||(j=!0,l.reject(G,Z))})}}},{1:1}],3:[function(r,a,i){(function(o){"use strict";typeof o.Promise!="function"&&(o.Promise=r(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(r,a,i){"use strict";var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c};function s(c,m){if(!(c 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(c){return}}var d=l();function _(){try{if(!d||!d.open)return!1;var c=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(!c||m)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(u){return!1}}function f(c,m){c=c||[],m=m||{};try{return new Blob(c,m)}catch(v){if(v.name!=="TypeError")throw v;for(var u=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,g=new u,y=0;y<c.length;y+=1)g.append(c[y]);return g.getBlob(m.type)}}typeof Promise=="undefined"&&r(3);var p=Promise;function h(c,m){m&&c.then(function(u){m(null,u)},function(u){m(u)})}function b(c,m,u){typeof m=="function"&&c.then(m),typeof u=="function"&&c.catch(u)}function E(c){return typeof c!="string"&&(console.warn(c+" used as a key, but it is not a string."),c=String(c)),c}function C(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var w="local-forage-detect-blob-support",O=void 0,k={},M=Object.prototype.toString,B="readonly",I="readwrite";function D(c){for(var m=c.length,u=new ArrayBuffer(m),g=new Uint8Array(u),y=0;y<m;y++)g[y]=c.charCodeAt(y);return u}function J(c){return new p(function(m){var u=c.transaction(w,I),g=f([""]);u.objectStore(w).put(g,"key"),u.onabort=function(y){y.preventDefault(),y.stopPropagation(),m(!1)},u.oncomplete=function(){var y=navigator.userAgent.match(/Chrome\/(\d+)/),v=navigator.userAgent.match(/Edge\//);m(v||!y||parseInt(y[1],10)>=43)}}).catch(function(){return!1})}function j(c){return typeof O=="boolean"?p.resolve(O):J(c).then(function(m){return O=m,O})}function N(c){var m=k[c.name],u={};u.promise=new p(function(g,y){u.resolve=g,u.reject=y}),m.deferredOperations.push(u),m.dbReady?m.dbReady=m.dbReady.then(function(){return u.promise}):m.dbReady=u.promise}function G(c){var m=k[c.name],u=m.deferredOperations.pop();if(u)return u.resolve(),u.promise}function F(c,m){var u=k[c.name],g=u.deferredOperations.pop();if(g)return g.reject(m),g.promise}function X(c,m){return new p(function(u,g){if(k[c.name]=k[c.name]||Go(),c.db)if(m)N(c),c.db.close();else return u(c.db);var y=[c.name];m&&y.push(c.version);var v=d.open.apply(d,y);m&&(v.onupgradeneeded=function(A){var R=v.result;try{R.createObjectStore(c.storeName),A.oldVersion<=1&&R.createObjectStore(w)}catch(T){if(T.name==="ConstraintError")console.warn('The database "'+c.name+'" has been upgraded from version '+A.oldVersion+" to version "+A.newVersion+', but the storage "'+c.storeName+'" already exists.');else throw T}}),v.onerror=function(A){A.preventDefault(),g(v.error)},v.onsuccess=function(){var A=v.result;A.onversionchange=function(R){R.target.close()},u(A),G(c)}})}function Z(c){return X(c,!1)}function He(c){return X(c,!0)}function Jn(c,m){if(!c.db)return!0;var u=!c.db.objectStoreNames.contains(c.storeName),g=c.version<c.db.version,y=c.version>c.db.version;if(g&&(c.version!==m&&console.warn('The database "'+c.name+`" can't be downgraded from version `+c.db.version+" to version "+c.version+"."),c.version=c.db.version),y||u){if(u){var v=c.db.version+1;v>c.version&&(c.version=v)}return!0}return!1}function _a(c){return new p(function(m,u){var g=new FileReader;g.onerror=u,g.onloadend=function(y){var v=btoa(y.target.result||"");m({__local_forage_encoded_blob:!0,data:v,type:c.type})},g.readAsBinaryString(c)})}function Nt(c){var m=D(atob(c.data));return f([m],{type:c.type})}function Mo(c){return c&&c.__local_forage_encoded_blob}function Uu(c){var m=this,u=m._initReady().then(function(){var g=k[m._dbInfo.name];if(g&&g.dbReady)return g.dbReady});return b(u,c,c),u}function Bu(c){N(c);for(var m=k[c.name],u=m.forages,g=0;g<u.length;g++){var y=u[g];y._dbInfo.db&&(y._dbInfo.db.close(),y._dbInfo.db=null)}return c.db=null,Z(c).then(function(v){return c.db=v,Jn(c)?He(c):v}).then(function(v){c.db=m.db=v;for(var A=0;A<u.length;A++)u[A]._dbInfo.db=v}).catch(function(v){throw F(c,v),v})}function Ze(c,m,u,g){g===void 0&&(g=1);try{var y=c.db.transaction(c.storeName,m);u(null,y)}catch(v){if(g>0&&(!c.db||v.name==="InvalidStateError"||v.name==="NotFoundError"))return p.resolve().then(function(){if(!c.db||v.name==="NotFoundError"&&!c.db.objectStoreNames.contains(c.storeName)&&c.version<=c.db.version)return c.db&&(c.version=c.db.version+1),He(c)}).then(function(){return Bu(c).then(function(){Ze(c,m,u,g-1)})}).catch(u);u(v)}}function Go(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Mu(c){var m=this,u={db:null};if(c)for(var g in c)u[g]=c[g];var y=k[u.name];y||(y=Go(),k[u.name]=y),y.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=Uu);var v=[];function A(){return p.resolve()}for(var R=0;R<y.forages.length;R++){var T=y.forages[R];T!==m&&v.push(T._initReady().catch(A))}var x=y.forages.slice(0);return p.all(v).then(function(){return u.db=y.db,Z(u)}).then(function(P){return u.db=P,Jn(u,m._defaultConfig.version)?He(u):P}).then(function(P){u.db=y.db=P,m._dbInfo=u;for(var U=0;U<x.length;U++){var $=x[U];$!==m&&($._dbInfo.db=u.db,$._dbInfo.version=u.version)}})}function Gu(c,m){var u=this;c=E(c);var g=new p(function(y,v){u.ready().then(function(){Ze(u._dbInfo,B,function(A,R){if(A)return v(A);try{var T=R.objectStore(u._dbInfo.storeName),x=T.get(c);x.onsuccess=function(){var P=x.result;P===void 0&&(P=null),Mo(P)&&(P=Nt(P)),y(P)},x.onerror=function(){v(x.error)}}catch(P){v(P)}})}).catch(v)});return h(g,m),g}function Ju(c,m){var u=this,g=new p(function(y,v){u.ready().then(function(){Ze(u._dbInfo,B,function(A,R){if(A)return v(A);try{var T=R.objectStore(u._dbInfo.storeName),x=T.openCursor(),P=1;x.onsuccess=function(){var U=x.result;if(U){var $=U.value;Mo($)&&($=Nt($));var ee=c($,U.key,P++);ee!==void 0?y(ee):U.continue()}else y()},x.onerror=function(){v(x.error)}}catch(U){v(U)}})}).catch(v)});return h(g,m),g}function Fu(c,m,u){var g=this;c=E(c);var y=new p(function(v,A){var R;g.ready().then(function(){return R=g._dbInfo,M.call(m)==="[object Blob]"?j(R.db).then(function(T){return T?m:_a(m)}):m}).then(function(T){Ze(g._dbInfo,I,function(x,P){if(x)return A(x);try{var U=P.objectStore(g._dbInfo.storeName);T===null&&(T=void 0);var $=U.put(T,c);P.oncomplete=function(){T===void 0&&(T=null),v(T)},P.onabort=P.onerror=function(){var ee=$.error?$.error:$.transaction.error;A(ee)}}catch(ee){A(ee)}})}).catch(A)});return h(y,u),y}function Hu(c,m){var u=this;c=E(c);var g=new p(function(y,v){u.ready().then(function(){Ze(u._dbInfo,I,function(A,R){if(A)return v(A);try{var T=R.objectStore(u._dbInfo.storeName),x=T.delete(c);R.oncomplete=function(){y()},R.onerror=function(){v(x.error)},R.onabort=function(){var P=x.error?x.error:x.transaction.error;v(P)}}catch(P){v(P)}})}).catch(v)});return h(g,m),g}function ju(c){var m=this,u=new p(function(g,y){m.ready().then(function(){Ze(m._dbInfo,I,function(v,A){if(v)return y(v);try{var R=A.objectStore(m._dbInfo.storeName),T=R.clear();A.oncomplete=function(){g()},A.onabort=A.onerror=function(){var x=T.error?T.error:T.transaction.error;y(x)}}catch(x){y(x)}})}).catch(y)});return h(u,c),u}function qu(c){var m=this,u=new p(function(g,y){m.ready().then(function(){Ze(m._dbInfo,B,function(v,A){if(v)return y(v);try{var R=A.objectStore(m._dbInfo.storeName),T=R.count();T.onsuccess=function(){g(T.result)},T.onerror=function(){y(T.error)}}catch(x){y(x)}})}).catch(y)});return h(u,c),u}function Vu(c,m){var u=this,g=new p(function(y,v){if(c<0){y(null);return}u.ready().then(function(){Ze(u._dbInfo,B,function(A,R){if(A)return v(A);try{var T=R.objectStore(u._dbInfo.storeName),x=!1,P=T.openKeyCursor();P.onsuccess=function(){var U=P.result;if(!U){y(null);return}c===0||x?y(U.key):(x=!0,U.advance(c))},P.onerror=function(){v(P.error)}}catch(U){v(U)}})}).catch(v)});return h(g,m),g}function $u(c){var m=this,u=new p(function(g,y){m.ready().then(function(){Ze(m._dbInfo,B,function(v,A){if(v)return y(v);try{var R=A.objectStore(m._dbInfo.storeName),T=R.openKeyCursor(),x=[];T.onsuccess=function(){var P=T.result;if(!P){g(x);return}x.push(P.key),P.continue()},T.onerror=function(){y(T.error)}}catch(P){y(P)}})}).catch(y)});return h(u,c),u}function Ku(c,m){m=C.apply(this,arguments);var u=this.config();c=typeof c!="function"&&c||{},c.name||(c.name=c.name||u.name,c.storeName=c.storeName||u.storeName);var g=this,y;if(!c.name)y=p.reject("Invalid arguments");else{var v=c.name===u.name&&g._dbInfo.db,A=v?p.resolve(g._dbInfo.db):Z(c).then(function(R){var T=k[c.name],x=T.forages;T.db=R;for(var P=0;P<x.length;P++)x[P]._dbInfo.db=R;return R});c.storeName?y=A.then(function(R){if(R.objectStoreNames.contains(c.storeName)){var T=R.version+1;N(c);var x=k[c.name],P=x.forages;R.close();for(var U=0;U<P.length;U++){var $=P[U];$._dbInfo.db=null,$._dbInfo.version=T}var ee=new p(function(te,de){var ce=d.open(c.name,T);ce.onerror=function(Je){var sn=ce.result;sn.close(),de(Je)},ce.onupgradeneeded=function(){var Je=ce.result;Je.deleteObjectStore(c.storeName)},ce.onsuccess=function(){var Je=ce.result;Je.close(),te(Je)}});return ee.then(function(te){x.db=te;for(var de=0;de<P.length;de++){var ce=P[de];ce._dbInfo.db=te,G(ce._dbInfo)}}).catch(function(te){throw(F(c,te)||p.resolve()).catch(function(){}),te})}}):y=A.then(function(R){N(c);var T=k[c.name],x=T.forages;R.close();for(var P=0;P<x.length;P++){var U=x[P];U._dbInfo.db=null}var $=new p(function(ee,te){var de=d.deleteDatabase(c.name);de.onerror=function(){var ce=de.result;ce&&ce.close(),te(de.error)},de.onblocked=function(){console.warn('dropInstance blocked for database "'+c.name+'" until all open connections are closed')},de.onsuccess=function(){var ce=de.result;ce&&ce.close(),ee(ce)}});return $.then(function(ee){T.db=ee;for(var te=0;te<x.length;te++){var de=x[te];G(de._dbInfo)}}).catch(function(ee){throw(F(c,ee)||p.resolve()).catch(function(){}),ee})})}return h(y,m),y}var Wu={_driver:"asyncStorage",_initStorage:Mu,_support:_(),iterate:Ju,getItem:Gu,setItem:Fu,removeItem:Hu,clear:ju,length:qu,key:Vu,keys:$u,dropInstance:Ku};function zu(){return typeof openDatabase=="function"}var ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xu="~~local_forage_type~",Jo=/^~~local_forage_type~([^~]+)~/,Fn="__lfsc__:",ya=Fn.length,wa="arbf",ba="blob",Fo="si08",Ho="ui08",jo="uic8",qo="si16",Vo="si32",$o="ur16",Ko="ui32",Wo="fl32",zo="fl64",Xo=ya+wa.length,Yo=Object.prototype.toString;function Qo(c){var m=c.length*.75,u=c.length,g,y=0,v,A,R,T;c[c.length-1]==="="&&(m--,c[c.length-2]==="="&&m--);var x=new ArrayBuffer(m),P=new Uint8Array(x);for(g=0;g<u;g+=4)v=ht.indexOf(c[g]),A=ht.indexOf(c[g+1]),R=ht.indexOf(c[g+2]),T=ht.indexOf(c[g+3]),P[y++]=v<<2|A>>4,P[y++]=(A&15)<<4|R>>2,P[y++]=(R&3)<<6|T&63;return x}function Ea(c){var m=new Uint8Array(c),u="",g;for(g=0;g<m.length;g+=3)u+=ht[m[g]>>2],u+=ht[(m[g]&3)<<4|m[g+1]>>4],u+=ht[(m[g+1]&15)<<2|m[g+2]>>6],u+=ht[m[g+2]&63];return m.length%3===2?u=u.substring(0,u.length-1)+"=":m.length%3===1&&(u=u.substring(0,u.length-2)+"=="),u}function Yu(c,m){var u="";if(c&&(u=Yo.call(c)),c&&(u==="[object ArrayBuffer]"||c.buffer&&Yo.call(c.buffer)==="[object ArrayBuffer]")){var g,y=Fn;c instanceof ArrayBuffer?(g=c,y+=wa):(g=c.buffer,u==="[object Int8Array]"?y+=Fo:u==="[object Uint8Array]"?y+=Ho:u==="[object Uint8ClampedArray]"?y+=jo:u==="[object Int16Array]"?y+=qo:u==="[object Uint16Array]"?y+=$o:u==="[object Int32Array]"?y+=Vo:u==="[object Uint32Array]"?y+=Ko:u==="[object Float32Array]"?y+=Wo:u==="[object Float64Array]"?y+=zo:m(new Error("Failed to get type for BinaryArray"))),m(y+Ea(g))}else if(u==="[object Blob]"){var v=new FileReader;v.onload=function(){var A=Xu+c.type+"~"+Ea(this.result);m(Fn+ba+A)},v.readAsArrayBuffer(c)}else try{m(JSON.stringify(c))}catch(A){console.error("Couldn't convert value into a JSON string: ",c),m(null,A)}}function Qu(c){if(c.substring(0,ya)!==Fn)return JSON.parse(c);var m=c.substring(Xo),u=c.substring(ya,Xo),g;if(u===ba&&Jo.test(m)){var y=m.match(Jo);g=y[1],m=m.substring(y[0].length)}var v=Qo(m);switch(u){case wa:return v;case ba:return f([v],{type:g});case Fo:return new Int8Array(v);case Ho:return new Uint8Array(v);case jo:return new Uint8ClampedArray(v);case qo:return new Int16Array(v);case $o:return new Uint16Array(v);case Vo:return new Int32Array(v);case Ko:return new Uint32Array(v);case Wo:return new Float32Array(v);case zo:return new Float64Array(v);default:throw new Error("Unkown type: "+u)}}var Ia={serialize:Yu,deserialize:Qu,stringToBuffer:Qo,bufferToString:Ea};function Zo(c,m,u,g){c.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],u,g)}function Zu(c){var m=this,u={db:null};if(c)for(var g in c)u[g]=typeof c[g]!="string"?c[g].toString():c[g];var y=new p(function(v,A){try{u.db=openDatabase(u.name,String(u.version),u.description,u.size)}catch(R){return A(R)}u.db.transaction(function(R){Zo(R,u,function(){m._dbInfo=u,v()},function(T,x){A(x)})},A)});return u.serializer=Ia,y}function mt(c,m,u,g,y,v){c.executeSql(u,g,y,function(A,R){R.code===R.SYNTAX_ERR?A.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[m.storeName],function(T,x){x.rows.length?v(T,R):Zo(T,m,function(){T.executeSql(u,g,y,v)},v)},v):v(A,R)},v)}function ed(c,m){var u=this;c=E(c);var g=new p(function(y,v){u.ready().then(function(){var A=u._dbInfo;A.db.transaction(function(R){mt(R,A,"SELECT * FROM "+A.storeName+" WHERE key = ? LIMIT 1",[c],function(T,x){var P=x.rows.length?x.rows.item(0).value:null;P&&(P=A.serializer.deserialize(P)),y(P)},function(T,x){v(x)})})}).catch(v)});return h(g,m),g}function td(c,m){var u=this,g=new p(function(y,v){u.ready().then(function(){var A=u._dbInfo;A.db.transaction(function(R){mt(R,A,"SELECT * FROM "+A.storeName,[],function(T,x){for(var P=x.rows,U=P.length,$=0;$<U;$++){var ee=P.item($),te=ee.value;if(te&&(te=A.serializer.deserialize(te)),te=c(te,ee.key,$+1),te!==void 0){y(te);return}}y()},function(T,x){v(x)})})}).catch(v)});return h(g,m),g}function es(c,m,u,g){var y=this;c=E(c);var v=new p(function(A,R){y.ready().then(function(){m===void 0&&(m=null);var T=m,x=y._dbInfo;x.serializer.serialize(m,function(P,U){U?R(U):x.db.transaction(function($){mt($,x,"INSERT OR REPLACE INTO "+x.storeName+" (key, value) VALUES (?, ?)",[c,P],function(){A(T)},function(ee,te){R(te)})},function($){if($.code===$.QUOTA_ERR){if(g>0){A(es.apply(y,[c,T,u,g-1]));return}R($)}})})}).catch(R)});return h(v,u),v}function nd(c,m,u){return es.apply(this,[c,m,u,1])}function rd(c,m){var u=this;c=E(c);var g=new p(function(y,v){u.ready().then(function(){var A=u._dbInfo;A.db.transaction(function(R){mt(R,A,"DELETE FROM "+A.storeName+" WHERE key = ?",[c],function(){y()},function(T,x){v(x)})})}).catch(v)});return h(g,m),g}function ad(c){var m=this,u=new p(function(g,y){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(A){mt(A,v,"DELETE FROM "+v.storeName,[],function(){g()},function(R,T){y(T)})})}).catch(y)});return h(u,c),u}function id(c){var m=this,u=new p(function(g,y){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(A){mt(A,v,"SELECT COUNT(key) as c FROM "+v.storeName,[],function(R,T){var x=T.rows.item(0).c;g(x)},function(R,T){y(T)})})}).catch(y)});return h(u,c),u}function od(c,m){var u=this,g=new p(function(y,v){u.ready().then(function(){var A=u._dbInfo;A.db.transaction(function(R){mt(R,A,"SELECT key FROM "+A.storeName+" WHERE id = ? LIMIT 1",[c+1],function(T,x){var P=x.rows.length?x.rows.item(0).key:null;y(P)},function(T,x){v(x)})})}).catch(v)});return h(g,m),g}function sd(c){var m=this,u=new p(function(g,y){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(A){mt(A,v,"SELECT key FROM "+v.storeName,[],function(R,T){for(var x=[],P=0;P<T.rows.length;P++)x.push(T.rows.item(P).key);g(x)},function(R,T){y(T)})})}).catch(y)});return h(u,c),u}function ld(c){return new p(function(m,u){c.transaction(function(g){g.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(y,v){for(var A=[],R=0;R<v.rows.length;R++)A.push(v.rows.item(R).name);m({db:c,storeNames:A})},function(y,v){u(v)})},function(g){u(g)})})}function cd(c,m){m=C.apply(this,arguments);var u=this.config();c=typeof c!="function"&&c||{},c.name||(c.name=c.name||u.name,c.storeName=c.storeName||u.storeName);var g=this,y;return c.name?y=new p(function(v){var A;c.name===u.name?A=g._dbInfo.db:A=openDatabase(c.name,"","",0),c.storeName?v({db:A,storeNames:[c.storeName]}):v(ld(A))}).then(function(v){return new p(function(A,R){v.db.transaction(function(T){function x(ee){return new p(function(te,de){T.executeSql("DROP TABLE IF EXISTS "+ee,[],function(){te()},function(ce,Je){de(Je)})})}for(var P=[],U=0,$=v.storeNames.length;U<$;U++)P.push(x(v.storeNames[U]));p.all(P).then(function(){A()}).catch(function(ee){R(ee)})},function(T){R(T)})})}):y=p.reject("Invalid arguments"),h(y,m),y}var ud={_driver:"webSQLStorage",_initStorage:Zu,_support:zu(),iterate:td,getItem:ed,setItem:nd,removeItem:rd,clear:ad,length:id,key:od,keys:sd,dropInstance:cd};function dd(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(c){return!1}}function ts(c,m){var u=c.name+"/";return c.storeName!==m.storeName&&(u+=c.storeName+"/"),u}function fd(){var c="_localforage_support_test";try{return localStorage.setItem(c,!0),localStorage.removeItem(c),!1}catch(m){return!0}}function hd(){return!fd()||localStorage.length>0}function md(c){var m=this,u={};if(c)for(var g in c)u[g]=c[g];return u.keyPrefix=ts(c,m._defaultConfig),hd()?(m._dbInfo=u,u.serializer=Ia,p.resolve()):p.reject()}function pd(c){var m=this,u=m.ready().then(function(){for(var g=m._dbInfo.keyPrefix,y=localStorage.length-1;y>=0;y--){var v=localStorage.key(y);v.indexOf(g)===0&&localStorage.removeItem(v)}});return h(u,c),u}function vd(c,m){var u=this;c=E(c);var g=u.ready().then(function(){var y=u._dbInfo,v=localStorage.getItem(y.keyPrefix+c);return v&&(v=y.serializer.deserialize(v)),v});return h(g,m),g}function gd(c,m){var u=this,g=u.ready().then(function(){for(var y=u._dbInfo,v=y.keyPrefix,A=v.length,R=localStorage.length,T=1,x=0;x<R;x++){var P=localStorage.key(x);if(P.indexOf(v)===0){var U=localStorage.getItem(P);if(U&&(U=y.serializer.deserialize(U)),U=c(U,P.substring(A),T++),U!==void 0)return U}}});return h(g,m),g}function _d(c,m){var u=this,g=u.ready().then(function(){var y=u._dbInfo,v;try{v=localStorage.key(c)}catch(A){v=null}return v&&(v=v.substring(y.keyPrefix.length)),v});return h(g,m),g}function yd(c){var m=this,u=m.ready().then(function(){for(var g=m._dbInfo,y=localStorage.length,v=[],A=0;A<y;A++){var R=localStorage.key(A);R.indexOf(g.keyPrefix)===0&&v.push(R.substring(g.keyPrefix.length))}return v});return h(u,c),u}function wd(c){var m=this,u=m.keys().then(function(g){return g.length});return h(u,c),u}function bd(c,m){var u=this;c=E(c);var g=u.ready().then(function(){var y=u._dbInfo;localStorage.removeItem(y.keyPrefix+c)});return h(g,m),g}function Ed(c,m,u){var g=this;c=E(c);var y=g.ready().then(function(){m===void 0&&(m=null);var v=m;return new p(function(A,R){var T=g._dbInfo;T.serializer.serialize(m,function(x,P){if(P)R(P);else try{localStorage.setItem(T.keyPrefix+c,x),A(v)}catch(U){(U.name==="QuotaExceededError"||U.name==="NS_ERROR_DOM_QUOTA_REACHED")&&R(U),R(U)}})})});return h(y,u),y}function Id(c,m){if(m=C.apply(this,arguments),c=typeof c!="function"&&c||{},!c.name){var u=this.config();c.name=c.name||u.name,c.storeName=c.storeName||u.storeName}var g=this,y;return c.name?y=new p(function(v){c.storeName?v(ts(c,g._defaultConfig)):v(c.name+"/")}).then(function(v){for(var A=localStorage.length-1;A>=0;A--){var R=localStorage.key(A);R.indexOf(v)===0&&localStorage.removeItem(R)}}):y=p.reject("Invalid arguments"),h(y,m),y}var Ad={_driver:"localStorageWrapper",_initStorage:md,_support:dd(),iterate:gd,getItem:vd,setItem:Ed,removeItem:bd,clear:pd,length:wd,key:_d,keys:yd,dropInstance:Id},Sd=function(m,u){return m===u||typeof m=="number"&&typeof u=="number"&&isNaN(m)&&isNaN(u)},Cd=function(m,u){for(var g=m.length,y=0;y<g;){if(Sd(m[y],u))return!0;y++}return!1},ns=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},on={},rs={},Ut={INDEXEDDB:Wu,WEBSQL:ud,LOCALSTORAGE:Ad},Rd=[Ut.INDEXEDDB._driver,Ut.WEBSQL._driver,Ut.LOCALSTORAGE._driver],Hn=["dropInstance"],Aa=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Hn),Od={description:"",driver:Rd.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function kd(c,m){c[m]=function(){var u=arguments;return c.ready().then(function(){return c[m].apply(c,u)})}}function Sa(){for(var c=1;c<arguments.length;c++){var m=arguments[c];if(m)for(var u in m)m.hasOwnProperty(u)&&(ns(m[u])?arguments[0][u]=m[u].slice():arguments[0][u]=m[u])}return arguments[0]}var Td=function(){function c(m){s(this,c);for(var u in Ut)if(Ut.hasOwnProperty(u)){var g=Ut[u],y=g._driver;this[u]=y,on[y]||this.defineDriver(g)}this._defaultConfig=Sa({},Od),this._config=Sa({},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 c.prototype.config=function(u){if((typeof u=="undefined"?"undefined":o(u))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var g in u){if(g==="storeName"&&(u[g]=u[g].replace(/\W/g,"_")),g==="version"&&typeof u[g]!="number")return new Error("Database version must be a number.");this._config[g]=u[g]}return"driver"in u&&u.driver?this.setDriver(this._config.driver):!0}else return typeof u=="string"?this._config[u]:this._config},c.prototype.defineDriver=function(u,g,y){var v=new p(function(A,R){try{var T=u._driver,x=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!u._driver){R(x);return}for(var P=Aa.concat("_initStorage"),U=0,$=P.length;U<$;U++){var ee=P[U],te=!Cd(Hn,ee);if((te||u[ee])&&typeof u[ee]!="function"){R(x);return}}var de=function(){for(var sn=function(Dd){return function(){var Ld=new Error("Method "+Dd+" is not implemented by the current driver"),as=p.reject(Ld);return h(as,arguments[arguments.length-1]),as}},Ca=0,Pd=Hn.length;Ca<Pd;Ca++){var Ra=Hn[Ca];u[Ra]||(u[Ra]=sn(Ra))}};de();var ce=function(sn){on[T]&&console.info("Redefining LocalForage driver: "+T),on[T]=u,rs[T]=sn,A()};"_support"in u?u._support&&typeof u._support=="function"?u._support().then(ce,R):ce(!!u._support):ce(!0)}catch(Je){R(Je)}});return b(v,g,y),v},c.prototype.driver=function(){return this._driver||null},c.prototype.getDriver=function(u,g,y){var v=on[u]?p.resolve(on[u]):p.reject(new Error("Driver not found."));return b(v,g,y),v},c.prototype.getSerializer=function(u){var g=p.resolve(Ia);return b(g,u),g},c.prototype.ready=function(u){var g=this,y=g._driverSet.then(function(){return g._ready===null&&(g._ready=g._initDriver()),g._ready});return b(y,u,u),y},c.prototype.setDriver=function(u,g,y){var v=this;ns(u)||(u=[u]);var A=this._getSupportedDrivers(u);function R(){v._config.driver=v.driver()}function T(U){return v._extend(U),R(),v._ready=v._initStorage(v._config),v._ready}function x(U){return function(){var $=0;function ee(){for(;$<U.length;){var te=U[$];return $++,v._dbInfo=null,v._ready=null,v.getDriver(te).then(T).catch(ee)}R();var de=new Error("No available storage method found.");return v._driverSet=p.reject(de),v._driverSet}return ee()}}var P=this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve();return this._driverSet=P.then(function(){var U=A[0];return v._dbInfo=null,v._ready=null,v.getDriver(U).then(function($){v._driver=$._driver,R(),v._wrapLibraryMethodsWithReady(),v._initDriver=x(A)})}).catch(function(){R();var U=new Error("No available storage method found.");return v._driverSet=p.reject(U),v._driverSet}),b(this._driverSet,g,y),this._driverSet},c.prototype.supports=function(u){return!!rs[u]},c.prototype._extend=function(u){Sa(this,u)},c.prototype._getSupportedDrivers=function(u){for(var g=[],y=0,v=u.length;y<v;y++){var A=u[y];this.supports(A)&&g.push(A)}return g},c.prototype._wrapLibraryMethodsWithReady=function(){for(var u=0,g=Aa.length;u<g;u++)kd(this,Aa[u])},c.prototype.createInstance=function(u){return new c(u)},c}(),xd=new Td;a.exports=xd},{3:3}]},{},[4])(4)})});var fl=Ta(Er=>{"use strict";q();hn();vt();var wi=(t,e)=>{window.parent&&window.parent.postMessage({type:t,data:e},"*")},bi=we(),th=at("levelFinished",{paramsSchema:V.tuple(V.object({levelId:V.or(V.string(),V.number()),duration:V.number().optional(),rating:V.number().optional(),score:V.number().optional(),variation:V.string().optional()})),implement:t=>S(Er,null,function*(){let{levelId:e,duration:n,rating:r,score:a,variation:i}=t;Ne.info("onLevelFinished",n,r,a,i),wi("JOLIBOX_GAME_TASK_LEVEL_FINISHED",{levelId:e,duration:n,rating:r,score:a,variation:i}),yield Promise.all([nt.reporter({event:"COMPLETE_GAME_LEVEL",extraParams:{inGameInfo:{levelId:e,duration:n,rating:r,score:a}}}),nt.tracker("LevelFinished",{levelId:e,duration:n,rating:r,score:a,variation:i})])})}),nh=at("gamePlayEnded",{paramsSchema:V.tuple(V.object({duration:V.number().optional(),rating:V.number().optional(),score:V.number(),variation:V.string().optional()})),implement:t=>S(Er,null,function*(){let{duration:e,rating:n,score:r,variation:a}=t;Ne.info("onGamePlayEnded",e,n,r,a),wi("JOLIBOX_GAME_TASK_GAME_PLAY_ENDED",{duration:e,rating:n,score:r,variation:a}),yield Promise.all([nt.tracker("GamePlayEnded",{duration:e,rating:n,score:r,variation:a}),nt.reporter({event:"GAME_ENDED",extraParams:{inGameInfo:{duration:e,rating:n,score:r}}})])})}),rh=at("levelUpgrade",{paramsSchema:V.tuple(V.object({levelId:V.or(V.string(),V.number()),name:V.string().optional()})),implement:n=>S(Er,[n],function*({levelId:t,name:e}){Ne.info("onLevelUpgrade",t,e),wi("JOLIBOX_GAME_TASK_LEVEL_UPGRADE",{levelId:t,name:e}),yield Promise.all([nt.tracker("LevelUpgrade",{name:e,levelId:t}),nt.reporter({event:"GAME_LEVEL_UP",extraParams:{inGameInfo:{levelId:t,levelName:e}}})])})});bi.registerCommand("TaskTrackerSDK.levelFinished",th);bi.registerCommand("TaskTrackerSDK.gamePlayEnded",nh);bi.registerCommand("TaskTrackerSDK.levelUpgrade",rh);be("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});be("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});be("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var Ke,Ht,hl,Ei,ah,Ct,Ir=ne(()=>{"use strict";Ke=(t,e)=>{var n;window.dispatchEvent(new CustomEvent(t,{detail:e})),(n=window.parent)==null||n.postMessage({type:t,data:{detail:e}},"*")},Ht=new Map,hl=t=>{if(t.source===window.parent)try{let e=t.data;if(e&&e.type){let n=Ht.get(e.type);n&&n.forEach(r=>{try{r(e.data)}catch(a){console.warn("Callback execution failed:",a)}})}}catch(e){console.warn("Failed to parse message:",e)}},Ei=!1,ah=()=>{Ei||(window.addEventListener("message",hl),Ei=!0)},Ct=(t,e)=>{ah(),Ht.has(t)||Ht.set(t,new Set);let n=Ht.get(t);return n.add(e),()=>{n.delete(e),n.size===0&&Ht.delete(t),Ht.size===0&&(window.removeEventListener("message",hl),Ei=!1)}}});var Ar,Sr,Cr,Rr,Or,Ii,kr,Tr,xr,Pr,jt,ih,re,it,ot,xe=ne(()=>{"use strict";q();Ar="UNLOCK_OPTIONS_CHANGED",Sr="INVOKE_PAYMENT",Cr="ON_PAYMENT_RESULT",Rr="ON_USE_MODAL_EVENT",Or="ON_USE_MODAL_RESULT",Ii="ON_USE_MODAL_FREQUENCY",kr="ON_USE_UNLOGIN_MODAL_EVENT",Tr="INVOKE_UNLOGIN_MODAL_EVENT",xr="INVOKE_SUBSCRIPTION_EVENT",Pr="ON_USE_SUBSCRIPTION_RESULT",jt=new $e,ih=()=>({on:jt.on.bind(jt),off:jt.off.bind(jt),emit:jt.emit.bind(jt)}),re=ih(),it={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},joinMember:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}},ot={show:!0,minInterval:8*60*60*1e3}});var pu=Ta(fa=>{"use strict";fe();xe();Ir();q();var mu={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};Ct("ON_JOLIBOX_JOLI_COIN_USE_RESULT",t=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",mu[t.result],t.result),re.emit(Or,{useModalResult:mu[t.result]})});re.on(Rr,(t,e)=>{var n;t=="ADS-JOLI_GEM"||t=="JOLI_GEM"||Ke("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:e.quantity,balance:e.userCurrency.balance,enableAutoDeduct:e.enableAutoDeduct},type:t,sequenceId:(n=e.sequenceId)!=null?n:je()})});Ct("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",t=>{re.emit(Cr,{paymentResult:t.result=="ADS"?"FAILED":t.result,userJoliCoin:t.joliCoin,currency:"JOLI_COIN"})});re.on(Sr,(t,e)=>S(fa,null,function*(){var n;t=="ADS-JOLI_GEM"||t=="JOLI_GEM"||Ke("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:e.quantity,balance:e.userCurrency.balance,enableAutoDeduct:e.enableAutoDeduct},type:t,sequenceId:(n=e.sequenceId)!=null?n:je()})}));Ct("ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT",t=>{var e,n,r,a,i;re.emit(kr,{result:t.result=="ADS"?"FAILED":t.result,rewards:{claimedRewardValue:(a=(r=(n=(e=t.extra)==null?void 0:e.firstLogin)==null?void 0:n.reward)==null?void 0:r.rewardValue)!=null?a:0,isFirstLogin:(i=t.isFirstLogin)!=null?i:!1}}),t.result==="SUCCESS"&&L.onEnvConfigChanged({hostUserInfo:{isLogin:!0}})});re.on(Tr,t=>S(fa,null,function*(){t=="ADS-JOLI_GEM"||t=="JOLI_GEM"||Ke("JOLIBOX_JOLI_UNLOGIN_MODAL_EVENT",{sequenceId:je(),type:t})}));Ct("ON_JOLIBOX_SUB_RESULT_EVENT",t=>{console.log("----on custom event ON_JOLIBOX_SUB_RESULT_EVENT-----",t),re.emit(Pr,{result:t.result})});re.on(xr,t=>S(fa,null,function*(){console.log("----notify custom event-----",t),Ke("JOLIBOX_SUB_EVENT",{sequenceId:je()})}))});vt();fe();hn();q();var sl=we(),Gf="env",Jf="getSystemInfoSync",Ff=()=>{var a,i,o,s;let t={system:L.deviceInfo.system,platform:L.deviceInfo.platform.toLowerCase(),brand:L.deviceInfo.brand,pixelRatio:L.deviceInfo.pixelRatio,language:L.deviceInfo.lang,version:L.sdkInfo.jssdkVersion,appName:(a=L.hostInfo)==null?void 0:a.appName,SDKVersion:L.sdkInfo.nativeSDKVersion},e=(i=L.hostInfo)==null?void 0:i.version;e&&(t=Ce(W({},t),{version:e}));let n=(o=L.hostInfo)==null?void 0:o.appName;n&&(t=Ce(W({},t),{appName:n}));let r=(s=L.sdkInfo)==null?void 0:s.jssdkVersion;return r&&(t=Ce(W({},t),{SDKVersion:r})),t},Hf=St(Jf,{implement:Ff}),jf=St(Gf,{implement:()=>Ce(W({},L.hostInfo),{sdkInfo:L.sdkInfo,platform:L.platform,deviceInfo:L.deviceInfo})});sl.registerCommand("API.env",jf);sl.registerCommand("API.getSystemInfoSync",Hf);be("env",{version:"1.0.0"});be("getSystemInfoSync",{version:"1.0.0"});q();hn();et();vt();var qf="onJoliboxShow",Vf="onJoliboxHide",$f="onReady",vi=we(),gi=As(Ue),pi=!0,mn=!0,_r=0,yr=li;function Kf(){let t=Date.now();if(t-_r<100)return;_r=t;let e=document.visibilityState==="visible";e!==pi&&(pi=e,yr.emit("visible",pi))}function ll(t){let e=Date.now();e-_r<100||(_r=e,t==="focus"&&!mn?mn=!0:t==="blur"&&mn&&(mn=!1),yr.emit("visible",mn))}document.addEventListener("visibilitychange",Kf);window.addEventListener("focus",()=>ll("focus"));window.addEventListener("blur",()=>ll("blur"));var Wf=St(qf,{paramsSchema:V.tuple(V.function()),implement(t){let e=gi(t);yr.on("visible",n=>{n&&e()})}}),zf=St(Vf,{paramsSchema:V.tuple(V.function()),implement(t){let e=gi(t);yr.on("visible",n=>{!n&&e()})}}),Xf=St($f,{paramsSchema:V.tuple(V.function()),implement(t){let e=gi(t);pt.on("LifecycleEvent.onReady",n=>{e(n)})}});vi.registerCommand("LifecycleSDK.onReady",Xf);vi.registerCommand("LifecycleSDK.onJoliboxShow",Wf);vi.registerCommand("LifecycleSDK.onJoliboxHide",zf);be("lifeCycle.onReady",{version:"1.0.0"});be("lifeCycle.onJoliboxShow",{version:"1.0.0"});be("lifeCycle.onJoliboxHide",{version:"1.0.0"});hn();q();Jt();fe();var dl=xa(ul());var wr=we(),yi=class{constructor(){this.httpClient=qe.create({baseUrl:Gt(L.testMode)});this.getGameId=()=>L.mpId;this.getItem=e=>S(this,null,function*(){let{code:n,data:r,message:a}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:e}}),i=r==null?void 0:r.value,o=a;return n!=="SUCCESS"&&(i=yield this.gameStore.getItem(e),console.info("[SDK] cloud storage getItem failed, read from localstorage",i),o+="fallback to localstorage"),{code:n,message:o,data:i&&i!=="undefined"?i:null}});this.setItem=(e,n)=>S(this,null,function*(){let r=typeof n=="string"?n:String(n),{code:a,message:i}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}`,{data:{key:e,value:r}});return yield this.gameStore.setItem(e,r),{code:a,message:i}});this.removeItem=e=>S(this,null,function*(){yield this.gameStore.removeItem(e);let{code:n,message:r}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/remove`,{data:{key:e}});return{code:n,message:r}});this.clear=()=>S(this,null,function*(){yield this.gameStore.clear();let{code:e,message:n}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/clear`,{});return{code:e,message:n}});this.gameId=this.getGameId(),this.gameStore=dl.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},br=new yi,Yf=at("getLocalStorage",{paramsSchema:V.tuple(V.string()),implement(t){return S(this,null,function*(){return yield br.getItem(t)})}});wr.registerCommand("StorageSDK.getItem",Yf);be("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Qf=at("setStorage",{paramsSchema:V.tuple(V.string(),V.or(V.string(),V.boolean(),V.number())),implement(t,e){return S(this,null,function*(){return yield br.setItem(t,e)})}});wr.registerCommand("StorageSDK.setItem",Qf);be("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Zf=at("removeStorage",{paramsSchema:V.tuple(V.string()),implement(t){return S(this,null,function*(){return yield br.removeItem(t)})}});wr.registerCommand("StorageSDK.removeItem",Zf);be("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var eh=at("clearStorage",{implement(){return S(this,null,function*(){return yield br.clear()})}});wr.registerCommand("StorageSDK.clear",eh);be("storage.clear",{version:"1.0.0"});var FI=xa(fl());vt();q();Jt();Ir();fe();xe();var ml=L.testMode;function pl(){let t=new Map,e,n;return{registerRewardHandler(a,i){t.set(a,i)},handleReward(a,...i){return S(this,null,function*(){return yield a.reduce((s,l)=>S(this,null,function*(){let d=yield s;if(d===!0)return!0;ml&&console.log(`handleReward ${l}`);let _=t.get(l),f=_?yield _(...i):d;return ml&&console.log(`handleReward ${l} ${f}`),f}),Promise.resolve(!1))})},registerRewardsFetcher(a){return S(this,null,function*(){e=(...i)=>S(this,null,function*(){try{return yield a(...i)}catch(o){return console.error("getRewardOptions error:",o),["ADS"]}})})},registerRewardFrequencyConfigFetcher(a){return S(this,null,function*(){n=(...i)=>S(this,null,function*(){try{return yield a(...i)}catch(o){return console.error("getRewardOptions error:",o),{joliCoinUseAndCharge:it,loginGuide:ot}}})})},getRewardsTypes(...a){return S(this,null,function*(){return e?yield e(...a):["ADS"]})},getRewardFrequencyConfig(...a){return S(this,null,function*(){return n?yield n(...a):{joliCoinUseAndCharge:it,loginGuide:ot}})}}}q();var Ai=class{constructor(e){this.httpClient=e}execute(e,n){return S(this,null,function*(){let r=(n==null?void 0:n.method)||"POST",a=(n==null?void 0:n.body)||{};return r==="GET"?yield this.httpClient.get(e,a):yield this.httpClient.post(e,a)})}extractCacheableData(e){var n,r,a;return{unlockOptions:((n=e.data)==null?void 0:n.unlockOptions)||[],joliCoin:((r=e.extra)==null?void 0:r.joliCoin)||{balance:0,enableAutoDeduct:!1},joliGem:((a=e.extra)==null?void 0:a.joliGem)||{balance:0,enableAutoDeduct:!1}}}mergeData(e,n){return{code:"SUCCESS",message:"success",data:{unlockOptions:e.unlockOptions},extra:{joliCoin:e.joliCoin||{balance:0,enableAutoDeduct:!1},joliGem:e.joliGem||{balance:0,enableAutoDeduct:!1}}}}processCachedData(e){return{code:"SUCCESS",message:"success from cache",data:{unlockOptions:e.unlockOptions},extra:{joliCoin:e.joliCoin,joliGem:e.joliGem}}}},Si=class{constructor(e){this.httpClient=e}execute(e,n){return S(this,null,function*(){let r=(n==null?void 0:n.method)||"GET",a=(n==null?void 0:n.body)||{};return r==="GET"?yield this.httpClient.get(e,a):yield this.httpClient.post(e,a)})}extractCacheableData(e){let n=e.data;return W({joliCoinUseAndCharge:n==null?void 0:n.joliCoinUseAndCharge,loginGuide:n==null?void 0:n.loginGuide},n)}processCachedData(e){return{code:"SUCCESS",message:"success from cache",data:e}}},Dr=class{constructor(e){this.unlockOptionsService=new It(new Ai(e),{duration:30*60*1e3,timeout:1e3,keyGenerator:n=>n,consistencyChecker:(n,r)=>n.unlockOptions.length!==r.unlockOptions.length?!1:n.unlockOptions.every((a,i)=>{var s,l;let o=r.unlockOptions[i];return a.type===o.type&&((s=a.joliGemChoice)==null?void 0:s.joliGemQuantity)===((l=o.joliGemChoice)==null?void 0:l.joliGemQuantity)})}),this.globalConfigService=new It(new Si(e),{duration:60*60*1e3,timeout:1e3,keyGenerator:n=>n})}getUnlockOptions(){return S(this,arguments,function*(e={}){return yield this.unlockOptionsService.request("/api/games/unlock-options",{endpoint:"/api/games/unlock-options",body:e,method:"POST"})})}getGlobalConfig(){return S(this,null,function*(){return yield this.globalConfigService.request("/api/fe-configs/web-common/global-config",{endpoint:"/api/fe-configs/web-common/global-config",method:"GET"})})}refreshUnlockOptions(){return S(this,arguments,function*(e={}){return yield this.unlockOptionsService.forceRequest("/api/games/unlock-options",{endpoint:"/api/games/unlock-options",body:e,method:"POST"})})}refreshGlobalConfig(){return S(this,null,function*(){return yield this.globalConfigService.forceRequest("/api/fe-configs/web-common/global-config",{endpoint:"/api/fe-configs/web-common/global-config",method:"GET"})})}warmupCache(){return S(this,null,function*(){yield Promise.all([this.unlockOptionsService.warmupCache("/api/games/unlock-options",{endpoint:"/api/games/unlock-options",method:"POST"}),this.globalConfigService.warmupCache("/api/fe-configs/web-common/global-config",{endpoint:"/api/fe-configs/web-common/global-config",method:"GET"})])})}clearAllCache(){this.unlockOptionsService.clearCache(),this.globalConfigService.clearCache()}getCacheStats(){return{unlockOptions:this.unlockOptionsService.getCacheStats(),globalConfig:this.globalConfigService.getCacheStats()}}clearExpiredCache(){this.unlockOptionsService.clearExpiredCache(),this.globalConfigService.clearExpiredCache()}};xe();q();var oh=()=>(t,e)=>{let n={SUBSCRIPTION:4,JOLI_GEM:3,JOLI_GEM_ONLY:3,JOLI_COIN:2,JOLI_COIN_ONLY:2,ADS:1};return n[e]-n[t]},sh=["openJolicoinGuide",{method:"getABTest",platforms:["android"],nativeVersionCode:1050100},"userTrackAsync",{method:"openMiniapp",nativeVersionCode:1050100}],lh=t=>{if(!t.length)return["ADS"];if(t.includes("JOLI_GEM")){if(t.length===1)return["JOLI_GEM_ONLY"];if(t.includes("SUBSCRIPTION")&&t.length===2)return["SUBSCRIPTION","JOLI_GEM_ONLY"]}if(t.includes("JOLI_COIN")){if(t.length===1)return["JOLI_COIN_ONLY"];if(t.includes("SUBSCRIPTION")&&t.length===2)return["SUBSCRIPTION","JOLI_COIN_ONLY"]}return t.sort(oh())},Ci=null;function Ri(t){return Ci||(Ci=new Dr(t)),Ci}var Oi=t=>{t.registerRewardsFetcher(e=>S(void 0,null,function*(){var a,i,o,s,l;let n=["ADS"],r=Ri(e);try{let d=yield r.getUnlockOptions({});if(d.code!=="SUCCESS")return n;re.emit(Ar,{options:((a=d.data)==null?void 0:a.unlockOptions)||[],userJoliCoin:((i=d.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1},userGem:((o=d.extra)==null?void 0:o.joliGem)||{balance:0,enableAutoDeduct:!1}});let _=((l=(s=d.data)==null?void 0:s.unlockOptions)==null?void 0:l.map(f=>f.type))||Array.from(n);return lh(_)}catch(d){return console.error("getRewardOptions error (cached):",d),n}}))},ki=t=>{t.registerRewardFrequencyConfigFetcher(e=>S(void 0,null,function*(){var r,a,i,o;let n=Ri(e);try{let s=yield n.getGlobalConfig();return re.emit(Ii,{joliCoinUseAndCharge:((r=s.data)==null?void 0:r.joliCoinUseAndCharge)||it,loginGuide:((a=s.data)==null?void 0:a.loginGuide)||ot}),s.data&&pt.emit("onGlobalConfigChanged",{globalConfig:s.data}),{joliCoinUseAndCharge:((i=s.data)==null?void 0:i.joliCoinUseAndCharge)||it,loginGuide:((o=s.data)==null?void 0:o.loginGuide)||ot}}catch(s){return console.error("getGlobalConfig error (cached):",s),re.emit(Ii,{joliCoinUseAndCharge:it,loginGuide:ot}),pt.emit("onGlobalConfigChanged",{globalConfig:{joliCoinUseAndCharge:it,loginGuide:ot,supportedHostMethods:sh}}),{joliCoinUseAndCharge:it,loginGuide:ot}}}))};var Ti=t=>S(void 0,null,function*(){yield Ri(t).warmupCache(),console.log("Reward cache warmed up")});var vl=t=>e=>S(void 0,null,function*(){try{console.log("trigger @jolibox/ads reward",e),yield t.adBreak(e)}catch(n){console.error("-----createAdsRewardHandler error-----",n)}return!0});xe();function We(t,e){let n=null,r=null,a=null,i=()=>{if(a){n=Promise.resolve(a);return}n=new Promise(o=>{r=o})};return i(),t.on(e,(...o)=>{let s=o[0];a=s,r&&(r(s),r=null)}),{getData:()=>(n||i(),n),getCachedData:()=>a,clearCache:()=>{a=null,n=null},getFreshData:()=>(a=null,n=null,i(),n),updateData:o=>{if(a)return a=W(W({},a),o),n=Promise.resolve(a),r&&(r(a),r=null),a}}}xe();var Ee=We(re,Ar),pn=(t,e)=>{var r;let n=(r=t.options)==null?void 0:r.some(a=>a.type==="SUBSCRIPTION");return console.log("typeof extraCheck",typeof e,e==null?void 0:e()),n&&(!e||(e==null?void 0:e()))};fe();q();var xi={JOLI_COIN:{balanceEndpoint:"/api/joli-coin/balance",balanceDetailEndpoint:"/api/joli-coin/balance-detail",unlockEndpoint:"/api/joli-coin/unlock",unlockType:"JOLI_COIN"},GEM:{balanceEndpoint:"/api/joli-gem/balance",balanceDetailEndpoint:"/api/joli-gem/balance-detail",unlockEndpoint:"/api/joli-gem/unlock",unlockType:"GEM"}};q();var Fe=we();xe();xe();q();var Di=class{constructor(e){this.httpClient=e}execute(e,n){return S(this,null,function*(){let r=(n==null?void 0:n.method)||"GET",a=(n==null?void 0:n.query)||{};return r==="GET"?yield this.httpClient.get(e,{query:a}):yield this.httpClient.post(e,{query:a})})}extractCacheableData(e){var n;return{balance:((n=e.data)==null?void 0:n.balance)||0,timestamp:Date.now()}}processCachedData(e){return{code:"SUCCESS",message:"success from cache",data:{balance:e.balance}}}},Li=class{constructor(e){this.balanceService=new It(new Di(e),{duration:20*60*1e3,timeout:1e3,keyGenerator:(n,r)=>{let a=r!=null&&r.query?JSON.stringify(r.query):"";return`${n}:${a}`}})}getBalance(e="JOLI_COIN"){return S(this,null,function*(){return(yield this.balanceService.request("/api/joli-coin/balance",{endpoint:"/api/joli-coin/balance",query:{type:e},method:"GET"})).data})}refreshBalance(e="JOLI_COIN"){return S(this,null,function*(){return(yield this.balanceService.forceRequest("/api/joli-coin/balance",{endpoint:"/api/joli-coin/balance",query:{type:e},method:"GET"})).data})}warmupBalance(e="JOLI_COIN"){return S(this,null,function*(){yield this.balanceService.warmupCache("/api/joli-coin/balance",{endpoint:"/api/joli-coin/balance",query:{type:e},method:"GET"})})}clearBalanceCache(){this.balanceService.clearCache()}getBalanceCacheStats(){return this.balanceService.getCacheStats()}clearExpiredCache(){this.balanceService.clearExpiredCache()}},Pi=null;function Ni(t){return Pi||(Pi=new Li(t)),Pi}var Ui=(t,e="JOLI_COIN")=>S(void 0,null,function*(){return yield Ni(t).getBalance(e)}),Rt=(t,e="JOLI_COIN")=>S(void 0,null,function*(){let r=yield Ni(t).refreshBalance(e);return console.log(`Balance cache refreshed for type: ${e}`),r}),Lr=(t,e="JOLI_COIN")=>S(void 0,null,function*(){yield Ni(t).warmupBalance(e),console.log(`Balance cache warmed up for type: ${e}`)});q();var Mi=class{constructor(e){this.httpClient=e}execute(e,n){return S(this,null,function*(){let r=(n==null?void 0:n.method)||"GET",a=(n==null?void 0:n.query)||{};return r==="GET"?yield this.httpClient.get(e,{query:a}):yield this.httpClient.post(e,{query:a})})}extractCacheableData(e){var n;return{balance:((n=e.data)==null?void 0:n.balance)||0,timestamp:Date.now()}}processCachedData(e){return{code:"SUCCESS",message:"success from cache",data:{balance:e.balance}}}},Gi=class{constructor(e){this.gemBalanceService=new It(new Mi(e),{duration:20*60*1e3,timeout:1e3,keyGenerator:(n,r)=>{let a=r!=null&&r.query?JSON.stringify(r.query):"";return`${n}:${a}`}})}getGemBalance(e="GEM"){return S(this,null,function*(){return(yield this.gemBalanceService.request("/api/joli-gem/balance",{endpoint:"/api/joli-gem/balance",query:{type:e},method:"GET"})).data})}refreshGemBalance(e="GEM"){return S(this,null,function*(){return(yield this.gemBalanceService.forceRequest("/api/joli-gem/balance",{endpoint:"/api/joli-gem/balance",query:{type:e},method:"GET"})).data})}warmupGemBalance(e="GEM"){return S(this,null,function*(){yield this.gemBalanceService.warmupCache("/api/joli-gem/balance",{endpoint:"/api/joli-gem/balance",query:{type:e},method:"GET"})})}clearGemBalanceCache(){this.gemBalanceService.clearCache()}getGemBalanceCacheStats(){return this.gemBalanceService.getCacheStats()}clearExpiredCache(){this.gemBalanceService.clearExpiredCache()}},Bi=null;function gl(t){return Bi||(Bi=new Gi(t)),Bi}var Ji=(t,e="GEM")=>S(void 0,null,function*(){return yield gl(t).getGemBalance(e)}),qt=(t,e="GEM")=>S(void 0,null,function*(){let r=yield gl(t).refreshGemBalance(e);return console.log(`Gem balance cache refreshed for type: ${e}`),r});var ze={JOLI_COIN:{fetchBalance:Ui,getQuantity:t=>{var e,n,r;return(r=(n=(e=t==null?void 0:t.options)==null?void 0:e.find(a=>a.type==="JOLI_COIN"))==null?void 0:n.joliCoinChoices[0].joliCoinQuantity)!=null?r:0},getCurrentUser:t=>{var e;return(e=t==null?void 0:t.userJoliCoin)!=null?e:{balance:0,enableAutoDeduct:!1}},createUpdatedUser:(t,e)=>({balance:t,enableAutoDeduct:e}),getUpdateKey:()=>"userJoliCoin",isEnough:(t,e)=>{var n,r;return(r=(n=t==null?void 0:t.options)==null?void 0:n.some(a=>a.type==="JOLI_COIN"&&a.joliCoinChoices.some(i=>{var o;return i.joliCoinQuantity<=((o=e==null?void 0:e.balance)!=null?o:0)})))!=null?r:!1}},JOLI_GEM:{fetchBalance:Ji,getQuantity:t=>{var e,n,r,a;return(a=(r=(n=(e=t==null?void 0:t.options)==null?void 0:e.find(i=>i.type==="JOLI_GEM"))==null?void 0:n.joliGemChoice)==null?void 0:r.joliGemQuantity)!=null?a:0},getCurrentUser:t=>{var e;return(e=t==null?void 0:t.userGem)!=null?e:{balance:0,enableAutoDeduct:!1}},createUpdatedUser:(t,e)=>({balance:t,enableAutoDeduct:e}),getUpdateKey:()=>"userGem",isEnough:(t,e)=>{var r,a,i;let n=t==null?void 0:t.options.find(o=>o.type==="JOLI_GEM");return n?((a=(r=n.joliGemChoice)==null?void 0:r.joliGemQuantity)!=null?a:0)<=((i=e==null?void 0:e.balance)!=null?i:0):!1}}};var Nr=(t,e,n)=>{let{showUnlockWithCurrencyModal:r}=n;Fe.registerCommand(`Rewards.${t}.useJolicoin`,()=>S(void 0,null,function*(){let a=yield Ee.getData(),i=ze[e],o=i.getCurrentUser(a),s=i.getQuantity(a),l=!!(o!=null&&o.enableAutoDeduct);return console.log("-----unlockOptions usemodal-----",a,l,s),(yield r({enableAutoDeduct:l,userCurrency:o,quantity:s,currency:e}))!=="CONFIRM"?{result:"FAILED"}:{result:"SUCCESS"}}))},Ot=(t,e)=>n=>S(void 0,null,function*(){let r=We(re,Or);return re.emit(Rr,t,{enableAutoDeduct:n.enableAutoDeduct,userCurrency:n.userCurrency,quantity:n.quantity,currency:n.currency,confirmButtonText:e.confirmButtonText,cancelButtonText:e.cancelButtonText}),(yield r.getFreshData()).useModalResult});xe();xe();var Ur=(t,e,n)=>{let{httpClient:r,initiateAndAwaitPayment:a}=n;Fe.registerCommand(`Rewards.${t}.usePayment`,()=>S(void 0,null,function*(){var p;let i=yield Ee.getData(),o=ze[e],s=yield o.fetchBalance(r),l=o.getQuantity(i),d=o.getCurrentUser(i),_=o.createUpdatedUser((p=s==null?void 0:s.balance)!=null?p:0,d.enableAutoDeduct),f=o.getUpdateKey();if(Ee.updateData({[f]:_}),console.log("-----unlockOptions payment-----",i,_,l,e),!o.isEnough(i,_)){let h=yield a({userCurrency:_,currencyQuantity:l,currency:e});return e==="JOLI_GEM"?qt(r):Rt(r),{result:h==="SUCCESS"?"SUCCESS":"FAILED"}}return{result:"CONTINUE"}}))},kt=(t,e)=>n=>S(void 0,null,function*(){let r=We(re,Cr);return re.emit(Sr,t,{userCurrency:n.userCurrency,quantity:n.currencyQuantity,currency:n.currency,enableAutoDeduct:n.userCurrency.enableAutoDeduct,confirmButtonText:e.confirmButtonText,cancelButtonText:e.cancelButtonText}),(yield r.getFreshData()).paymentResult});fe();xe();xe();q();var Tt=(t,e)=>n=>S(void 0,null,function*(){let r=We(re,kr);return re.emit(Tr,t,{confirmButtonText:e.confirmButtonText,cancelButtonText:e.cancelButtonText,currency:n}),yield r.getFreshData()});var dh=(t,e,n,{handlers:{handleUnlockSuccess:r,handleUnlockFailed:a,unlockOptionsHandler:i,initiateAndAwaitPayment:o,showUnlockWithCurrencyModal:s,showUnloginModal:l,hasSubscription:d}})=>{Ur(t,"JOLI_COIN",{httpClient:e,initiateAndAwaitPayment:o}),Nr(t,"JOLI_COIN",{showUnlockWithCurrencyModal:s});let _=[`Rewards.${t}.usePayment`,`Rewards.${t}.useJolicoin`];return f=>S(void 0,null,function*(){var p,h,b,E;try{let C=yield i.getData();if(pn(C,d)){let M=ze.JOLI_COIN,B=yield M.fetchBalance(e),I=M.getCurrentUser(C),D=M.createUpdatedUser((p=B==null?void 0:B.balance)!=null?p:0,I.enableAutoDeduct);if(!M.isEnough(C,D))return a==null||a(f),!1}else{let M=!0;for(let B of _){let I=yield Fe.executeCommand(B);if(M=M&&I.result!=="FAILED",I.result!=="CONTINUE")break}if(!M)return a==null||a(f),!1}let O=xi[n],k=yield e.post(O.unlockEndpoint,{data:{type:"GAME_REWARD",reqId:`${je()}-${L.mpType}-${Date.now()}`,gameInfo:{gameId:L.mpId}}});if(console.log("-----unlockWithCurrency request result-----",k),k.code=="SUCCESS"){try{(b=f.adBreakDone)==null||b.call(f,{breakType:f.type,breakName:"name"in f&&(h=f.name)!=null?h:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in f&&((E=f.adViewed)==null||E.call(f)),Rt(e)}catch(M){console.error("-----unlockWithJolicoin adBreakDone error-----",M)}return r==null||r({quantity:k.data.quantity,balance:k.data.balance}),!0}return a==null||a(f),!1}catch(C){if(console.info("JolicoinRewardHandler error:",C),C instanceof Error&&C.message=="CANCEL")throw C;return a==null||a(f),!1}finally{i.clearCache()}})},Br=(t,e,n)=>dh(t,e,"JOLI_COIN",n);var _l=(t,{onUnlockSuccess:e,onUnlockFailed:n,hasSubscription:r})=>{let a=()=>{n==null||n()},i=Ot("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),o=kt("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"}),s=Tt("ADS-JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noWatchAds"});return Br("ADS-JOLI_COIN",t,{handlers:{handleUnlockSuccess:e,handleUnlockFailed:a,unlockOptionsHandler:Ee,initiateAndAwaitPayment:o,showUnlockWithCurrencyModal:i,showUnloginModal:s,hasSubscription:r}})};var yl=(t,{onUnlockSuccess:e,onUnlockFailed:n,hasSubscription:r})=>{let a=d=>{var _;n==null||n(),(_=d.adBreakDone)==null||_.call(d,{breakType:d.type,breakFormat:d.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},i=Ot("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),o=kt("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"}),s=Tt("JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noThanks"});return Br("JOLI_COIN",t,{handlers:{handleUnlockSuccess:e,handleUnlockFailed:a,unlockOptionsHandler:Ee,initiateAndAwaitPayment:o,showUnlockWithCurrencyModal:i,showUnloginModal:s,hasSubscription:r}})};fe();q();xe();xe();var wl=t=>{let{showSubscriptionModal:e}=t;Fe.registerCommand("Rewards.subscription",()=>S(void 0,null,function*(){var s,l;let n=yield Ee.getData(),r=(l=(s=n==null?void 0:n.options)==null?void 0:s.find(d=>d.type==="JOLI_GEM"))==null?void 0:l.type,a=ze[r?"JOLI_GEM":"JOLI_COIN"],i=a.getCurrentUser(n);return a.isEnough(n,i)?{result:"FAILED"}:{result:(yield e())==="SUCCESS"?"SUCCESS":"FAILED"}}))},bl=t=>()=>S(void 0,null,function*(){let e=We(re,Pr);return re.emit(xr,t),(yield e.getFreshData()).result});fe();var El=(t,e,{handlers:{handleSubSuccess:n,handleSubFailed:r,unlockOptionsHandler:a,showSubscriptionModal:i,hasSubscription:o}})=>{wl({showSubscriptionModal:i});let s=["Rewards.subscription"];return l=>S(void 0,null,function*(){var d,_,f,p,h,b;try{let E=yield a.getData();if(!pn(E,o))return!1;let w=!0;for(let O of s){let k=yield Fe.executeCommand(O);if(w=w&&k.result!=="FAILED",k.result!=="CONTINUE")break}if(Rt(e),qt(e),console.log("-----unlockWithSubscription result-----",w),w){try{(_=l.adBreakDone)==null||_.call(l,{breakType:l.type,breakName:"name"in l&&(d=l.name)!=null?d:"",breakFormat:l.type==="reward"?"reward":"interstitial",breakStatus:"viewed"}),"adViewed"in l&&((f=l.adViewed)==null||f.call(l)),(b=(h=L).onEnvConfigChanged)==null||b.call(h,{hostUserInfo:Ce(W({},(p=L.hostUserInfo)!=null?p:{isLogin:!1}),{isSubUser:!0})})}catch(O){console.error("-----unlockWithSubscription adBreakDone error-----",O)}return n==null||n(),!0}return r==null||r(l),!1}catch(E){if(console.info("SubscriptionRewardHandler error:",E),E instanceof Error&&E.message=="CANCEL")throw E;return r==null||r(l),!1}finally{}})};var Il=(t,{onSubSuccess:e,onSubFailed:n,hasSubscription:r})=>{let a=()=>{n==null||n()},i=bl("SUBSCRIPTION");return El("SUBSCRIPTION",t,{handlers:{handleSubSuccess:e,handleSubFailed:a,unlockOptionsHandler:Ee,showSubscriptionModal:i,hasSubscription:r}})};var Xe=pl();Oi(Xe);ki(Xe);var Fr,H,Ol,ji,xt,Al,kl,Tl,xl,qi,Fi,Hi,hh,vn={},Pl=[],mh=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,gn=Array.isArray;function st(t,e){for(var n in e)t[n]=e[n];return t}function Vi(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function _n(t,e,n){var r,a,i,o={};for(i in e)i=="key"?r=e[i]:i=="ref"?a=e[i]:o[i]=e[i];if(arguments.length>2&&(o.children=arguments.length>3?Fr.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)o[i]===void 0&&(o[i]=t.defaultProps[i]);return Gr(t,o,r,a,null)}function Gr(t,e,n,r,a){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a==null?++Ol:a,__i:-1,__u:0};return a==null&&H.vnode!=null&&H.vnode(i),i}function gt(t){return t.children}function Be(t,e){this.props=t,this.context=e}function Vt(t,e){if(e==null)return t.__?Vt(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Vt(t):null}function Dl(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Dl(t)}}function Sl(t){(!t.__d&&(t.__d=!0)&&xt.push(t)&&!Jr.__r++||Al!==H.debounceRendering)&&((Al=H.debounceRendering)||kl)(Jr)}function Jr(){for(var t,e,n,r,a,i,o,s=1;xt.length;)xt.length>s&&xt.sort(Tl),t=xt.shift(),s=xt.length,t.__d&&(n=void 0,a=(r=(e=t).__v).__e,i=[],o=[],e.__P&&((n=st({},r)).__v=r.__v+1,H.vnode&&H.vnode(n),$i(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[a]:null,i,a==null?Vt(r):a,!!(32&r.__u),o),n.__v=r.__v,n.__.__k[n.__i]=n,Ul(i,n,o),n.__e!=a&&Dl(n)));Jr.__r=0}function Ll(t,e,n,r,a,i,o,s,l,d,_){var f,p,h,b,E,C,w=r&&r.__k||Pl,O=e.length;for(l=ph(n,e,w,l,O),f=0;f<O;f++)(h=n.__k[f])!=null&&(p=h.__i===-1?vn:w[h.__i]||vn,h.__i=f,C=$i(t,h,p,a,i,o,s,l,d,_),b=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&Ki(p.ref,null,h),_.push(h.ref,h.__c||b,h)),E==null&&b!=null&&(E=b),4&h.__u||p.__k===h.__k?l=Nl(h,l,t):typeof h.type=="function"&&C!==void 0?l=C:b&&(l=b.nextSibling),h.__u&=-7);return n.__e=E,l}function ph(t,e,n,r,a){var i,o,s,l,d,_=n.length,f=_,p=0;for(t.__k=new Array(a),i=0;i<a;i++)(o=e[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(l=i+p,(o=t.__k[i]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Gr(null,o,null,null,null):gn(o)?Gr(gt,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Gr(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=t,o.__b=t.__b+1,s=null,(d=o.__i=vh(o,n,l,f))!==-1&&(f--,(s=n[d])&&(s.__u|=2)),s==null||s.__v===null?(d==-1&&(a>_?p--:a<_&&p++),typeof o.type!="function"&&(o.__u|=4)):d!=l&&(d==l-1?p--:d==l+1?p++:(d>l?p--:p++,o.__u|=4))):t.__k[i]=null;if(f)for(i=0;i<_;i++)(s=n[i])!=null&&!(2&s.__u)&&(s.__e==r&&(r=Vt(s)),Ml(s,s));return r}function Nl(t,e,n){var r,a;if(typeof t.type=="function"){for(r=t.__k,a=0;r&&a<r.length;a++)r[a]&&(r[a].__=t,e=Nl(r[a],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=Vt(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function yn(t,e){return e=e||[],t==null||typeof t=="boolean"||(gn(t)?t.some(function(n){yn(n,e)}):e.push(t)),e}function vh(t,e,n,r){var a,i,o=t.key,s=t.type,l=e[n];if(l===null&&t.key==null||l&&o==l.key&&s===l.type&&!(2&l.__u))return n;if(r>(l!=null&&!(2&l.__u)?1:0))for(a=n-1,i=n+1;a>=0||i<e.length;){if(a>=0){if((l=e[a])&&!(2&l.__u)&&o==l.key&&s===l.type)return a;a--}if(i<e.length){if((l=e[i])&&!(2&l.__u)&&o==l.key&&s===l.type)return i;i++}}return-1}function Cl(t,e,n){e[0]=="-"?t.setProperty(e,n==null?"":n):t[e]=n==null?"":typeof n!="number"||mh.test(e)?n:n+"px"}function Mr(t,e,n,r,a){var i;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||Cl(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||Cl(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(xl,"$1")),e=e.toLowerCase()in t||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.t=r.t:(n.t=qi,t.addEventListener(e,i?Hi:Fi,i)):t.removeEventListener(e,i?Hi:Fi,i);else{if(a=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n==null?"":n;break e}catch(o){}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Rl(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.u==null)e.u=qi++;else if(e.u<n.t)return;return n(H.event?H.event(e):e)}}}function $i(t,e,n,r,a,i,o,s,l,d){var _,f,p,h,b,E,C,w,O,k,M,B,I,D,J,j,N,G=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=e.__e=n.__e]),(_=H.__b)&&_(e);e:if(typeof G=="function")try{if(w=e.props,O="prototype"in G&&G.prototype.render,k=(_=G.contextType)&&r[_.__c],M=_?k?k.props.value:_.__:r,n.__c?C=(f=e.__c=n.__c).__=f.__E:(O?e.__c=f=new G(w,M):(e.__c=f=new Be(w,M),f.constructor=G,f.render=_h),k&&k.sub(f),f.props=w,f.state||(f.state={}),f.context=M,f.__n=r,p=f.__d=!0,f.__h=[],f._sb=[]),O&&f.__s==null&&(f.__s=f.state),O&&G.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=st({},f.__s)),st(f.__s,G.getDerivedStateFromProps(w,f.__s))),h=f.props,b=f.state,f.__v=e,p)O&&G.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),O&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(O&&G.getDerivedStateFromProps==null&&w!==h&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(w,M),!f.__e&&(f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(w,f.__s,M)===!1||e.__v==n.__v)){for(e.__v!=n.__v&&(f.props=w,f.state=f.__s,f.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(F){F&&(F.__=e)}),B=0;B<f._sb.length;B++)f.__h.push(f._sb[B]);f._sb=[],f.__h.length&&o.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(w,f.__s,M),O&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(h,b,E)})}if(f.context=M,f.props=w,f.__P=t,f.__e=!1,I=H.__r,D=0,O){for(f.state=f.__s,f.__d=!1,I&&I(e),_=f.render(f.props,f.state,f.context),J=0;J<f._sb.length;J++)f.__h.push(f._sb[J]);f._sb=[]}else do f.__d=!1,I&&I(e),_=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++D<25);f.state=f.__s,f.getChildContext!=null&&(r=st(st({},r),f.getChildContext())),O&&!p&&f.getSnapshotBeforeUpdate!=null&&(E=f.getSnapshotBeforeUpdate(h,b)),j=_,_!=null&&_.type===gt&&_.key==null&&(j=Bl(_.props.children)),s=Ll(t,gn(j)?j:[j],e,n,r,a,i,o,s,l,d),f.base=e.__e,e.__u&=-161,f.__h.length&&o.push(f),C&&(f.__E=f.__=null)}catch(F){if(e.__v=null,l||i!=null)if(F.then){for(e.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,e.__e=s}else for(N=i.length;N--;)Vi(i[N]);else e.__e=n.__e,e.__k=n.__k;H.__e(F,e,n)}else i==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):s=e.__e=gh(n.__e,e,n,r,a,i,o,l,d);return(_=H.diffed)&&_(e),128&e.__u?void 0:s}function Ul(t,e,n){for(var r=0;r<n.length;r++)Ki(n[r],n[++r],n[++r]);H.__c&&H.__c(e,t),t.some(function(a){try{t=a.__h,a.__h=[],t.some(function(i){i.call(a)})}catch(i){H.__e(i,a.__v)}})}function Bl(t){return typeof t!="object"||t==null?t:gn(t)?t.map(Bl):st({},t)}function gh(t,e,n,r,a,i,o,s,l){var d,_,f,p,h,b,E,C=n.props,w=e.props,O=e.type;if(O=="svg"?a="http://www.w3.org/2000/svg":O=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((h=i[d])&&"setAttribute"in h==!!O&&(O?h.localName==O:h.nodeType==3)){t=h,i[d]=null;break}}if(t==null){if(O==null)return document.createTextNode(w);t=document.createElementNS(a,O,w.is&&w),s&&(H.__m&&H.__m(e,i),s=!1),i=null}if(O===null)C===w||s&&t.data===w||(t.data=w);else{if(i=i&&Fr.call(t.childNodes),C=n.props||vn,!s&&i!=null)for(C={},d=0;d<t.attributes.length;d++)C[(h=t.attributes[d]).name]=h.value;for(d in C)if(h=C[d],d!="children"){if(d=="dangerouslySetInnerHTML")f=h;else if(!(d in w)){if(d=="value"&&"defaultValue"in w||d=="checked"&&"defaultChecked"in w)continue;Mr(t,d,null,h,a)}}for(d in w)h=w[d],d=="children"?p=h:d=="dangerouslySetInnerHTML"?_=h:d=="value"?b=h:d=="checked"?E=h:s&&typeof h!="function"||C[d]===h||Mr(t,d,h,C[d],a);if(_)s||f&&(_.__html===f.__html||_.__html===t.innerHTML)||(t.innerHTML=_.__html),e.__k=[];else if(f&&(t.innerHTML=""),Ll(e.type==="template"?t.content:t,gn(p)?p:[p],e,n,r,O=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,o,i?i[0]:n.__k&&Vt(n,0),s,l),i!=null)for(d=i.length;d--;)Vi(i[d]);s||(d="value",O=="progress"&&b==null?t.removeAttribute("value"):b!==void 0&&(b!==t[d]||O=="progress"&&!b||O=="option"&&b!==C[d])&&Mr(t,d,b,C[d],a),d="checked",E!==void 0&&E!==t[d]&&Mr(t,d,E,C[d],a))}return t}function Ki(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(a){H.__e(a,n)}}function Ml(t,e,n){var r,a;if(H.unmount&&H.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||Ki(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){H.__e(i,e)}r.base=r.__P=null}if(r=t.__k)for(a=0;a<r.length;a++)r[a]&&Ml(r[a],e,n||typeof t.type!="function");n||Vi(t.__e),t.__c=t.__=t.__e=void 0}function _h(t,e,n){return this.constructor(t,n)}function Gl(t,e,n){var r,a,i,o;e==document&&(e=document.documentElement),H.__&&H.__(t,e),a=(r=typeof n=="function")?null:n&&n.__k||e.__k,i=[],o=[],$i(e,t=(!r&&n||e).__k=_n(gt,null,[t]),a||vn,vn,e.namespaceURI,!r&&n?[n]:a?null:e.firstChild?Fr.call(e.childNodes):null,i,!r&&n?n:a?a.__e:e.firstChild,r,o),Ul(i,t,o)}Fr=Pl.slice,H={__e:function(t,e,n,r){for(var a,i,o;e=e.__;)if((a=e.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(t)),o=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(t,r||{}),o=a.__d),o)return a.__E=a}catch(s){t=s}throw t}},Ol=0,ji=function(t){return t!=null&&t.constructor==null},Be.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=st({},this.state),typeof t=="function"&&(t=t(st({},n),this.props)),t&&st(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Sl(this))},Be.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Sl(this))},Be.prototype.render=gt,xt=[],kl=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Tl=function(t,e){return t.__v.__b-e.__v.__b},Jr.__r=0,xl=/(PointerCapture)$|Capture$/i,qi=0,Fi=Rl(!1),Hi=Rl(!0),hh=0;var $t,le,Wi,Jl,wn=0,Wl=[],ue=H,Fl=ue.__b,Hl=ue.__r,jl=ue.diffed,ql=ue.__c,Vl=ue.unmount,$l=ue.__;function jr(t,e){ue.__h&&ue.__h(le,t,wn||e),wn=0;var n=le.__H||(le.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function lt(t){return wn=1,zl(Xl,t)}function zl(t,e,n){var r=jr($t++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):Xl(void 0,e),function(s){var l=r.__N?r.__N[0]:r.__[0],d=r.t(l,s);l!==d&&(r.__N=[d,r.__[1]],r.__c.setState({}))}],r.__c=le,!le.__f)){var a=function(s,l,d){if(!r.__c.__H)return!0;var _=r.__c.__H.__.filter(function(p){return!!p.__c});if(_.every(function(p){return!p.__N}))return!i||i.call(this,s,l,d);var f=r.__c.props!==s;return _.forEach(function(p){if(p.__N){var h=p.__[0];p.__=p.__N,p.__N=void 0,h!==p.__[0]&&(f=!0)}}),i&&i.call(this,s,l,d)||f};le.__f=!0;var i=le.shouldComponentUpdate,o=le.componentWillUpdate;le.componentWillUpdate=function(s,l,d){if(this.__e){var _=i;i=void 0,a(s,l,d),i=_}o&&o.call(this,s,l,d)},le.shouldComponentUpdate=a}return r.__N||r.__}function Pt(t,e){var n=jr($t++,3);!ue.__s&&Yi(n.__H,e)&&(n.__=t,n.u=e,le.__H.__h.push(n))}function Xi(t,e){var n=jr($t++,4);!ue.__s&&Yi(n.__H,e)&&(n.__=t,n.u=e,le.__h.push(n))}function qr(t){return wn=5,bn(function(){return{current:t}},[])}function bn(t,e){var n=jr($t++,7);return Yi(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function En(t,e){return wn=8,bn(function(){return t},e)}function yh(){for(var t;t=Wl.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Hr),t.__H.__h.forEach(zi),t.__H.__h=[]}catch(e){t.__H.__h=[],ue.__e(e,t.__v)}}ue.__b=function(t){le=null,Fl&&Fl(t)},ue.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),$l&&$l(t,e)},ue.__r=function(t){Hl&&Hl(t),$t=0;var e=(le=t.__c).__H;e&&(Wi===le?(e.__h=[],le.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(Hr),e.__h.forEach(zi),e.__h=[],$t=0)),Wi=le},ue.diffed=function(t){jl&&jl(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Wl.push(e)!==1&&Jl===ue.requestAnimationFrame||((Jl=ue.requestAnimationFrame)||wh)(yh)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Wi=le=null},ue.__c=function(t,e){e.some(function(n){try{n.__h.forEach(Hr),n.__h=n.__h.filter(function(r){return!r.__||zi(r)})}catch(r){e.some(function(a){a.__h&&(a.__h=[])}),e=[],ue.__e(r,n.__v)}}),ql&&ql(t,e)},ue.unmount=function(t){Vl&&Vl(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Hr(r)}catch(a){e=a}}),n.__H=void 0,e&&ue.__e(e,n.__v))};var Kl=typeof requestAnimationFrame=="function";function wh(t){var e,n=function(){clearTimeout(r),Kl&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);Kl&&(e=requestAnimationFrame(n))}function Hr(t){var e=le,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),le=e}function zi(t){var e=le;t.__c=t.__(),le=e}function Yi(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Xl(t,e){return typeof e=="function"?e(t):e}function Eh(t,e){for(var n in e)t[n]=e[n];return t}function Yl(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return!0;for(var r in e)if(r!=="__source"&&t[r]!==e[r])return!0;return!1}function Ql(t,e){this.props=t,this.context=e}(Ql.prototype=new Be).isPureReactComponent=!0,Ql.prototype.shouldComponentUpdate=function(t,e){return Yl(this.props,t)||Yl(this.state,e)};var Zl=H.__b;H.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Zl&&Zl(t)};var GE=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Ih=H.__e;H.__e=function(t,e,n,r){if(t.then){for(var a,i=e;i=i.__;)if((a=i.__c)&&a.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),a.__c(t,e)}Ih(t,e,n,r)};var ec=H.unmount;function sc(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),t.__c.__H=null),(t=Eh({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(r){return sc(r,e,n)})),t}function lc(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(r){return lc(r,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function Qi(){this.__u=0,this.o=null,this.__b=null}function cc(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Vr(){this.i=null,this.l=null}H.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),ec&&ec(t)},(Qi.prototype=new Be).__c=function(t,e){var n=e.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var a=cc(r.__v),i=!1,o=function(){i||(i=!0,n.__R=null,a?a(s):s())};n.__R=o;var s=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=lc(l,l.__c.__P,l.__c.__O)}var d;for(r.setState({__a:r.__b=null});d=r.o.pop();)d.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(o,o)},Qi.prototype.componentWillUnmount=function(){this.o=[]},Qi.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=sc(this.__b,n,r.__O=r.__P)}this.__b=null}var a=e.__a&&_n(gt,null,t.fallback);return a&&(a.__u&=-33),[_n(gt,null,e.__a?null:t.children),a]};var tc=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};(Vr.prototype=new Be).__a=function(t){var e=this,n=cc(e.__v),r=e.l.get(t);return r[0]++,function(a){var i=function(){e.props.revealOrder?(r.push(a),tc(e,t,r)):a()};n?n(i):i()}},Vr.prototype.render=function(t){this.i=null,this.l=new Map;var e=yn(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},Vr.prototype.componentDidUpdate=Vr.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){tc(t,n,e)})};var Ah=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,Sh=/^(?: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]/,Ch=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Rh=/[A-Z0-9]/g,Oh=typeof document!="undefined",kh=function(t){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function $r(t,e,n){return e.__k==null&&(e.textContent=""),Gl(t,e),typeof n=="function"&&n(),t?t.__c:null}Be.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(Be.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var nc=H.event;function Th(){}function xh(){return this.cancelBubble}function Ph(){return this.defaultPrevented}H.event=function(t){return nc&&(t=nc(t)),t.persist=Th,t.isPropagationStopped=xh,t.isDefaultPrevented=Ph,t.nativeEvent=t};var uc,Dh={enumerable:!1,configurable:!0,get:function(){return this.class}},rc=H.vnode;H.vnode=function(t){typeof t.type=="string"&&function(e){var n=e.props,r=e.type,a={},i=r.indexOf("-")===-1;for(var o in n){var s=n[o];if(!(o==="value"&&"defaultValue"in n&&s==null||Oh&&o==="children"&&r==="noscript"||o==="class"||o==="className")){var l=o.toLowerCase();o==="defaultValue"&&"value"in n&&n.value==null?o="value":o==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?o="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||kh(n.type)?l==="onfocus"?o="onfocusin":l==="onblur"?o="onfocusout":Ch.test(o)&&(o=l):l=o="oninput":i&&Sh.test(o)?o=o.replace(Rh,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&a[o=l]&&(o="oninputCapture"),a[o]=s}}r=="select"&&a.multiple&&Array.isArray(a.value)&&(a.value=yn(n.children).forEach(function(d){d.props.selected=a.value.indexOf(d.props.value)!=-1})),r=="select"&&a.defaultValue!=null&&(a.value=yn(n.children).forEach(function(d){d.props.selected=a.multiple?a.defaultValue.indexOf(d.props.value)!=-1:a.defaultValue==d.props.value})),n.class&&!n.className?(a.class=n.class,Object.defineProperty(a,"className",Dh)):(n.className&&!n.class||n.class&&n.className)&&(a.class=a.className=n.className),e.props=a}(t),t.$$typeof=Ah,rc&&rc(t)};var ac=H.__r;H.__r=function(t){ac&&ac(t),uc=t.__c};var ic=H.diffed;H.diffed=function(t){ic&&ic(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value),uc=null};var Lh=Object.defineProperty,na=Object.getOwnPropertySymbols,Bc=Object.prototype.hasOwnProperty,Mc=Object.prototype.propertyIsEnumerable,dc=(t,e,n)=>e in t?Lh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Nh=(t,e)=>{for(var n in e||(e={}))Bc.call(e,n)&&dc(t,n,e[n]);if(na)for(var n of na(e))Mc.call(e,n)&&dc(t,n,e[n]);return t},Uh=(t,e)=>{var n={};for(var r in t)Bc.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&na)for(var r of na(t))e.indexOf(r)<0&&Mc.call(t,r)&&(n[r]=t[r]);return n},Gc=Object.defineProperty,Bh=Object.defineProperties,Mh=Object.getOwnPropertyDescriptors,fc=Object.getOwnPropertySymbols,Gh=Object.prototype.hasOwnProperty,Jh=Object.prototype.propertyIsEnumerable,hc=(t,e,n)=>e in t?Gc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Fh=(t,e)=>{for(var n in e||(e={}))Gh.call(e,n)&&hc(t,n,e[n]);if(fc)for(var n of fc(e))Jh.call(e,n)&&hc(t,n,e[n]);return t},Hh=(t,e)=>Bh(t,Mh(e)),jh=(t,e)=>{for(var n in e)Gc(t,n,{get:e[n],enumerable:!0})},Jc=(t,e,n,r)=>{for(var a=e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(a=o(a)||a);return a},qh=(t,e,n)=>new Promise((r,a)=>{var i=l=>{try{s(n.next(l))}catch(d){a(d)}},o=l=>{try{s(n.throw(l))}catch(d){a(d)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,o);s((n=n.apply(t,e)).next())});if(typeof window!="undefined"&&!window.AbortController){let t=function(){this.signal=new e};t.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let n=new Event("abort");this.signal.dispatchEvent(n)};let e=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(e.prototype,"aborted",{get:function(){return this._aborted}}),e.prototype.addEventListener=function(n,r){this._eventListeners[n]||(this._eventListeners[n]=[]),this._eventListeners[n].push(r)},e.prototype.removeEventListener=function(n,r){if(!this._eventListeners[n])return;let a=this._eventListeners[n].indexOf(r);a!==-1&&this._eventListeners[n].splice(a,1)},e.prototype.dispatchEvent=function(n){if(this._eventListeners[n.type])for(let r of this._eventListeners[n.type])r.call(this,n)},window.AbortController=t,window.AbortSignal=e}function Vh(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}function $h(t){return typeof t=="string"}function Kh(t){return typeof t=="undefined"}function Wh(t){return Kh(t)||t===null}function zh(t){return typeof t=="function"}function Fc(t){let e=t,n=null,r=function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n||(n=new e(...i)),n};return r.prototype=e.prototype,r}var Xh=(t=>(t[t.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",t[t.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",t[t.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",t[t.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",t[t.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",t[t.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",t[t.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",t[t.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",t))(Xh||{});function In(t){return function(){var e,n;((n=(e=globalThis.VConsole)==null?void 0:e[t])!=null?n:globalThis.console[t])(...arguments)}}var Yh={log:In("log"),warn:In("warn"),info:In("info"),error:In("error"),debug:In("debug")};Object.assign(globalThis,{logger:Yh});var mc=Symbol.for("Jolibox.canIUseMap"),Qh={};globalThis[mc]||(globalThis[mc]=Qh);var pc=Symbol.for("Jolibox.canIUseMap.native"),Zh={};globalThis[pc]||(globalThis[pc]=Zh);var Hc=(t=>(t[t.Other=0]="Other",t[t.Route=1]="Route",t[t.Click=2]="Click",t[t.View=3]="View",t[t.Expose=4]="Expose",t[t.Swipe=5]="Swipe",t[t.Input=6]="Input",t[t.Select=7]="Select",t[t.SwitchOn=8]="SwitchOn",t[t.SwitchOff=9]="SwitchOff",t[t.Submit=10]="Submit",t[t.Scroll=11]="Scroll",t[t.Hide=12]="Hide",t[t.System=1e3]="System",t[t.ErrorTrace=1001]="ErrorTrace",t[t.UserDefined=1002]="UserDefined",t))(Hc||{}),jc=(t=>(t.MiniGame="mini-game",t.MiniDrama="mini-drama",t.App="app",t.WebSDK="web-sdk",t.AppSDK="app-sdk",t))(jc||{}),qc=(t=>(t[t.App=0]="App",t[t.H5=1]="H5",t[t.Weapp=2]="Weapp",t[t.Alipay=3]="Alipay",t[t.Gcash=4]="Gcash",t[t.Dana=5]="Dana",t[t.Umma=6]="Umma",t[t.WebSDK=1e3]="WebSDK",t[t.AppSDK=1001]="AppSDK",t[t.Other=9999]="Other",t))(qc||{}),vc=["name","params"],em=["name","type","location","target","extra","timestamp","userId"],tm=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function Xr(t,e){return e.map(n=>{if(n==="params"&&t[n]){let r=t[n];return Object.keys(r).reduce((a,i)=>(a[i]=String(r[i]),a),{})}return t[n]})}function nm(t){let e=t.location?Xr(t.location,vc):null,n=t.target?Xr(t.target,vc):null;return Xr(Hh(Fh({},t),{location:e,target:n}),em)}function rm(t){let e=t.events.map(r=>nm(r)),n=Xr(t.device,tm);return[t.protocolVersion,e,n,t.project]}function am(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let t=Object.getOwnPropertyDescriptor(window,"localStorage");if(t&&t.get){let r=t.get.call(window);return window.__joliboxLocalStorage__=r,r}if(t=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),t&&t.get)return t.get.call(window);let e=Window.prototype,n=Object.getOwnPropertyDescriptor(e,"localStorage");if(n&&n.get){let r=n.get.call(window);return window.__joliboxLocalStorage__=r,r}return localStorage}catch(t){return console.warn("Failed to get original localStorage, fallback to default implementation",t),localStorage}}am();var zt=typeof window=="undefined",gc=()=>!zt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");!zt&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),!zt&&navigator.userAgent.includes("Android"),!zt&&navigator.userAgent.includes("Mac"),!zt&&navigator.userAgent.includes("FB_IAB"),!zt&&!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var io=class oo{constructor(e){this.element=e,this.next=oo.Undefined,this.prev=oo.Undefined}};io.Undefined=new io(void 0);var se=io,im=class{constructor(){this._first=se.Undefined,this._last=se.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===se.Undefined}clear(){let t=this._first;for(;t!==se.Undefined;){let e=t.next;t.prev=se.Undefined,t.next=se.Undefined,t=e}this._first=se.Undefined,this._last=se.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,e){let n=new se(t);if(this._first===se.Undefined)this._first=n,this._last=n;else if(e){let a=this._last;this._last=n,n.prev=a,a.next=n}else{let a=this._first;this._first=n,n.next=a,a.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==se.Undefined){let t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==se.Undefined){let t=this._last.element;return this._remove(this._last),t}}_remove(t){if(t.prev!==se.Undefined&&t.next!==se.Undefined){let e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===se.Undefined&&t.next===se.Undefined?(this._first=se.Undefined,this._last=se.Undefined):t.next===se.Undefined?(this._last=this._last.prev,this._last.next=se.Undefined):t.prev===se.Undefined&&(this._first=this._first.next,this._first.prev=se.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==se.Undefined;)yield t.element,t=t.next}},om=0,An=class{constructor(t){this.value=t,this.id=om++}},On=class{constructor(t){this.options=t,this._size=0}dispose(t){var e,n;this._disposed||(this._disposed=!0,this._listeners&&(t?(this._listeners instanceof An&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(r=>(r==null?void 0:r.value)===t)):(this._listeners=void 0,this._size=0)),(n=(e=this.options)==null?void 0:e.onDidRemoveLastListener)==null||n.call(e))}get event(){return this._event!=null||(this._event=(t,e)=>{var n,r,a,i,o,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};e&&(t=t.bind(e));let l=new An(t);return this._listeners?this._listeners instanceof An?this._listeners=[this._listeners,l]:this._listeners.push(l):((r=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||r.call(n,this),this._listeners=l,(i=(a=this.options)==null?void 0:a.onDidFirstListener)==null||i.call(a,this)),(s=(o=this.options)==null?void 0:o.onDidAddListener)==null||s.call(o,this),this._size++,()=>{var d,_,f,p;if(!this._disposed){if(this._listeners instanceof An)this._listeners.id===l.id&&(this._listeners=void 0,this._size=0,(_=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||_.call(d));else if(this._listeners){let h=this._listeners.indexOf(l);h>=0&&(this._listeners.splice(h,1),this._size--,this._size===0&&((p=(f=this.options)==null?void 0:f.onDidRemoveLastListener)==null||p.call(f)))}}}}),this._event}_deliver(t,e){var n;if(!t)return;let r=((n=this.options)==null?void 0:n.onListenerError)||Error.constructor;if(!r){t.value(e);return}try{t.value(e)}catch(a){r(a)}}fire(t){this._listeners&&(this._listeners instanceof An?this._deliver(this._listeners,t):this._listeners.forEach(e=>this._deliver(e,t)))}hasListeners(){return this._size>0}},sm=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;var r;let a=(r=this.listeners.get(t))!=null?r:new On,i=l=>e(...l.args),o=a.event(i);this.listerHandlerMap.set(e,{handler:i,dispose:o}),this.listeners.set(t,a);let s=this.cachedEventQueue.get(t);if(s&&n)for(let l of s)e(...l.args)}flushCachedEvent(t){t?this.cachedEventQueue.delete(t):this.cachedEventQueue.clear()}off(t,e){let n=this.listerHandlerMap.get(e);n&&(n.dispose(),this.listerHandlerMap.delete(e))}emit(t){let e=this.listeners.get(t),n=this.cachedEventQueue.get(t);for(var r=arguments.length,a=new Array(r>1?r-1:0),i=1;i<r;i++)a[i-1]=arguments[i];n||(n=new im,this.cachedEventQueue.set(t,n)),n.push({args:a}),e&&e.fire({event:t,args:a})}once(t,e){var n=this;let r=function(){e(...arguments),n.off(t,r)};this.on(t,r,!1)}},so={};jh(so,{None:()=>lm,filter:()=>um,once:()=>Vc,toPromise:()=>cm});var lm=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function cm(t){return new Promise(e=>Vc(t)(e))}function Vc(t){return function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=!1;return t(a=>{if(!r)return r=!0,e.call(n,a)},null)}}function um(t,e){return(n=>{let r={onWillAddFirstListener(){n(a.fire,a)}},a=new On(r);return a.event})(function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return t(a=>e(a)&&n.call(r,a),null)})}var Zi=Symbol.for("Jolibox.hostEmitter"),dm=()=>{let t=new sm;return globalThis[Zi]||(globalThis[Zi]={on:t.on.bind(t),off:t.off.bind(t),emit:t.emit.bind(t),once:t.once.bind(t)}),globalThis[Zi]};dm();function fm(t,e){let n=Math.min(t.length,e.length);for(let r=0;r<n;r++)hm(t[r],e[r])}function hm(t,e){if($h(e)){if(typeof t!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(zh(e)){try{if(t instanceof e)return}catch(n){}if(!Wh(t)&&t.constructor===e||e.length===1&&e.call(void 0,t)===!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 lo=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new On,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(t){if(!t)throw new Error("invalid command");if(t.metadata&&Array.isArray(t.metadata.args)){let n=[];for(let a of t.metadata.args)n.push(a.constraint);let r=t.handler;t.handler=function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return fm(i,n),r(...i)}}let{id:e}=t;this._commands.get(e)&&console.info(`[Jolibox SDK] duplicated command is registered ${e}`),this._commands.set(e,t),this._onDidRegisterCommand.fire(e)}getCommand(t){return this._commands.get(t)}getCommands(){let t=new Map;for(let e of this._commands.keys()){let n=this.getCommand(e);n&&t.set(e,n)}return t}};lo=Jc([Fc],lo);var _c=class{constructor(){this._onWillExecuteCommand=new On,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new On,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new lo,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Vh(3e4)),this._starActivation}executeCommand(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return qh(this,null,function*(){return this.registry.getCommand(t)?this._tryExecuteCommand(t,n):(yield Promise.all([Promise.race([this._activateStar(),so.toPromise(so.filter(this.registry.onDidRegisterCommand,a=>a===t))])]),this._tryExecuteCommand(t,n))})}executeCommandThowErr(t){if(!this.registry.getCommand(t))throw new Error(`command '${t}' not found`);let e=this.registry.getCommand(t);for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];this._onWillExecuteCommand.fire({commandId:t,args:r});let i=this.invokeFunction(e.handler,...r);return this._onDidExecuteCommand.fire({commandId:t,args:r}),i}_tryExecuteCommand(t,e){let n=this.registry.getCommand(t);if(!n)return Promise.reject(new Error(`command '${t}' not found`));try{this._onWillExecuteCommand.fire({commandId:t,args:e});let r=this.invokeFunction(n.handler,...e);return this._onDidExecuteCommand.fire({commandId:t,args:e}),Promise.resolve(r)}catch(r){return Promise.reject(r)}}invokeFunction(t){try{for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return t(...n)}finally{}}};_c=Jc([Fc],_c);function Pe(t,e,n){return(e=mm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mm(t){var e=pm(t,"string");return typeof e=="symbol"?e:e+""}function pm(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Kt=t=>t?function(){try{for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t==null||t(...n)}catch(a){console.error("Error calling function",a)}}:()=>{console.log("wrapUserFunction: fn is undefined")},co=class{constructor(e){Pe(this,"context",void 0),Pe(this,"continueCallback",void 0),Pe(this,"adIsShowingCallback",void 0),Pe(this,"isBeforeAdCalled",!1),Pe(this,"isBeforeRewardCalled",!1),Pe(this,"isAdDismissedCalled",!1),Pe(this,"isAdViewedCalled",!1),Pe(this,"isAfterAdCalled",!1),Pe(this,"currentProvider",void 0),Pe(this,"currentClientParams",void 0),Pe(this,"adsHasResponse",!1),Pe(this,"videoChecker",window.document.createElement("video")),Pe(this,"contextInfo",void 0),Pe(this,"wrapShowAdFn",n=>()=>{var r,a,i;this.adsHasResponse=!0;let o=!1;this.videoChecker.play().catch(()=>{o=!1}),o=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:o},this.paramsToTrack)),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_BEFORE_REWARD",Nh({userEvent:o},this.paramsToTrack)),gc()&&this.context.track("mmp_ad_impression",{ad_network:(a=(r=this.currentProvider)==null?void 0:r.name)!=null?a:"",ad_format:"rewarded",module:"game",game_id:this.contextInfo.objectId}),(i=this.adIsShowingCallback)==null||i.call(this,!0);let s=Kt(n);s==null||s()}),this.context=e,this.contextInfo=e.getContextInfo()}notifyIframeAdsEvent(e,n){window.parent&&window.parent.postMessage({type:e,data:n},"*"),window.dispatchEvent(new CustomEvent(e,{detail:n}))}get paramsToTrack(){var e,n,r,a,i,o;return{provider:(n=(e=this.currentProvider)==null?void 0:e.name)!=null?n:null,type:(r=this.currentClientParams)==null?void 0:r.type,name:((a=this.currentClientParams)==null?void 0:a.type)==="preroll"?null:(o=(i=this.currentClientParams)==null?void 0:i.name)!=null?o:""}}wrapBeforeAd(e){return()=>{var n,r,a,i;if(this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_BEFORE_AD",this.paramsToTrack),!this.isBeforeAdCalled){this.isBeforeAdCalled=!0;let o=Kt(e);o==null||o(),((n=this.currentClientParams)==null?void 0:n.type)!=="reward"&&((r=this.adIsShowingCallback)==null||r.call(this,!0),gc()&&this.context.track("mmp_ad_impression",{ad_network:(i=(a=this.currentProvider)==null?void 0:a.name)!=null?i:"",ad_format:"interstitial",module:"game",game_id:this.contextInfo.objectId}))}}}wrapBeforeReward(e){return n=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(n)():(this.isBeforeRewardCalled=!0,e==null||e(this.wrapShowAdFn(n)))}}wrapAdDismissed(e){return()=>{if(this.adsHasResponse=!0,!this.isAdDismissedCalled){this.isAdDismissedCalled=!0;let n=Kt(e);n==null||n()}}}wrapAdViewed(e){return()=>{if(this.adsHasResponse=!0,!this.isAdViewedCalled){this.isAdViewedCalled=!0;let n=Kt(e);n==null||n()}}}wrapAfterAd(e){return()=>{if(this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AFTER_AD",this.paramsToTrack),!this.isAfterAdCalled){this.isAfterAdCalled=!0;let n=Kt(e);n==null||n()}}}wrapAdBreakDone(e){return n=>{var r,a,i,o,s,l,d,_,f;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(a=(r=this.currentProvider)==null?void 0:r.name)!=null?a:null,breakType:n.breakType,breakName:(i=n.breakName)!=null?i:"",breakFormat:n.breakFormat,breakStatus:n.breakStatus}),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AD_BREAK_DONE",{provider:(s=(o=this.currentProvider)==null?void 0:o.name)!=null?s:null,breakType:n.breakType,breakName:(l=n.breakName)!=null?l:"",breakFormat:n.breakFormat,breakStatus:n.breakStatus}),n.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{let p=Kt(e);p==null||p(n),(d=this.adIsShowingCallback)==null||d.call(this,!1),(_=this.continueCallback)==null||_.call(this,[!1,n]);break}default:{(f=this.continueCallback)==null||f.call(this,[!0,n]);break}}}}callAdBreakAndContinue(e,n,r,a){return S(this,null,function*(){return this.currentProvider=e,this.currentClientParams=n,this.adsHasResponse=!1,new Promise(i=>{this.continueCallback=i,this.adIsShowingCallback=a;let o;switch(n.type){case"preroll":{o={type:n.type,adBreakDone:this.wrapAdBreakDone(n.adBreakDone)};break}case"reward":{o={name:n.name,type:n.type,beforeAd:this.wrapBeforeAd(n.beforeAd),beforeReward:this.wrapBeforeReward(n.beforeReward),adDismissed:this.wrapAdDismissed(n.adDismissed),adViewed:this.wrapAdViewed(n.adViewed),afterAd:this.wrapAfterAd(n.afterAd),adBreakDone:this.wrapAdBreakDone(n.adBreakDone)};break}default:{o={name:n.name,type:n.type,beforeAd:this.wrapBeforeAd(n.beforeAd),afterAd:this.wrapAfterAd(n.afterAd),adBreakDone:this.wrapAdBreakDone(n.adBreakDone)};break}}window.setTimeout(()=>{var s,l,d,_,f,p,h;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:n.type,provider:(l=(s=this.currentProvider)==null?void 0:s.name)!=null?l:null}),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AD_BREAK_TIMEOUT",{type:n.type,provider:(_=(d=this.currentProvider)==null?void 0:d.name)!=null?_:null}),(p=this.continueCallback)==null||p.call(this,[!0,{breakType:n.type,breakName:n.type==="preroll"?"":(f=n.name)!=null?f:"",breakFormat:n.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(h=this.adIsShowingCallback)==null||h.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AD_BREAK",this.paramsToTrack),e.adBreak(o,r),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};function Kr(t,e,n){return(e=vm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vm(t){var e=gm(t,"string");return typeof e=="symbol"?e:e+""}function gm(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var uo=class{constructor(e){Kr(this,"context",void 0),Kr(this,"adBreakIsShowing",!1),Kr(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),Kr(this,"reportPageHide",()=>{this.context.track("AdBreakHide",{context:"AdsActionDetection"})}),this.context=e,window.addEventListener("visibilitychange",()=>{document.hidden&&this.adBreakIsShowing&&this.reportPageHide()}),window.addEventListener("beforeunload",n=>{this.adBreakIsShowing&&this.reportPageJumpOut()})}};function Wr(t,e,n){return(e=_m(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _m(t){var e=ym(t,"string");return typeof e=="symbol"?e:e+""}function ym(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var fo=class{constructor(e){Wr(this,"configs",null),Wr(this,"firstRun",!0),Wr(this,"context",void 0),Wr(this,"contextInfo",void 0),this.context=e,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return S(this,null,function*(){try{this.configs=yield this.context.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config",{})}catch(e){}})}shouldBypassCallingInterstitial(){var e,n;let r;if(!this.configs)this.init(),r=!this.firstRun;else{let a=(e=this.contextInfo.channel)!=null?e:"",i=this.configs[a],o=(n=i==null?void 0:i.interstitialRate)!=null?n:1;r=Math.random()<o}return this.firstRun=!1,r}};function ct(t,e,n){return(e=wm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wm(t){var e=bm(t,"string");return typeof e=="symbol"?e:e+""}function bm(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ho=class{constructor(e,n){ct(this,"name","ADSENSE"),ct(this,"context",void 0),ct(this,"contextInfo",void 0),ct(this,"configured",!1),ct(this,"initParams",void 0),ct(this,"push",function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(r)}),ct(this,"adConfig",r=>{let a=r,{onReady:i}=a,o=Uh(a,["onReady"]);this.context.track("CallAdConfig",o),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(r))}),ct(this,"adBreak",r=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(r)}),ct(this,"adUnit",r=>S(this,null,function*(){var a,i,o,s;if(this.context.track("CallAdUnit",{adFormat:(i=(a=r.adFormat)==null?void 0:a.toString())!=null?i:null,fullWidthResponsive:(o=r.fullWidthResponsive)!=null?o:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:l,slot:d,adFormat:_,fullWidthResponsive:f,style:p}=r,h;if(!l)throw new Error("targeting element is required");if(typeof l=="string"?h=document.querySelector(l):h=l,!h)throw new Error("targeting element not found");let b=d;if(b||(b=this.initParams.unitId),!b)throw new Error("slot is required");let E=typeof _=="object"&&Array.isArray(_)?_.join(", "):_,C=document.createElement("ins");if(C.className="adsbygoogle",C.id="jolibox-ads",C.style.display="block",C.setAttribute("data-ad-client",this.initParams.clientId),C.setAttribute("data-ad-slot",b),E&&C.setAttribute("data-ad-format",E),f&&C.setAttribute("data-full-width-responsive",f),p&&C.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",C.style.position="relative",h.appendChild(C),C.appendChild(w)}else h.appendChild(C),new MutationObserver(w=>{w.forEach(O=>{if(O.type==="attributes"&&O.attributeName==="data-ad-status"){let k=C.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:k!=null?k:"null"})}})}).observe(C,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})})),this.context=e,this.contextInfo=this.context.getContextInfo(),this.initParams=n,window.adsbygoogle=window.adsbygoogle||[]}init(){return S(this,null,function*(){var e;if(this.context.track("CallAdsInit",{provider:this.name}),typeof window=="undefined")return;let n="google-adsense",r=(e=this.contextInfo.testAdsMode)!=null?e:!1;if(!document.getElementById(n)&&this.initParams.clientId){let a=document.createElement("script");a.id=n,a.async=!0,a.crossOrigin="anonymous",a.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,r&&a.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&a.setAttribute("data-ad-channel",this.initParams.channelId),this.initParams.admobInterstitialSlot&&a.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),this.initParams.admobRewardedSlot&&a.setAttribute("data-admob-rewarded-slot",this.initParams.admobRewardedSlot),this.initParams.admobOnly&&a.setAttribute("data-admob-ads-only","on"),document.head.appendChild(a),this.context.track("LoadAdsenseCompleted",null)}})}};function Em(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function Im(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var Am=function(){function t(n){var r=this;this._insertTag=function(a){var i;r.tags.length===0?r.insertionPoint?i=r.insertionPoint.nextSibling:r.prepend?i=r.container.firstChild:i=r.before:i=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(a,i),r.tags.push(a)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(n){n.forEach(this._insertTag)},e.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Im(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var a=Em(r);try{a.insertRule(n,a.cssRules.length)}catch(i){}}else r.appendChild(document.createTextNode(n));this.ctr++},e.flush=function(){this.tags.forEach(function(n){var r;return(r=n.parentNode)==null?void 0:r.removeChild(n)}),this.tags=[],this.ctr=0},t}(),Ae="-ms-",ra="-moz-",Y="-webkit-",$c="comm",ko="rule",To="decl",Sm="@import",Kc="@keyframes",Cm="@layer",Rm=Math.abs,la=String.fromCharCode,Om=Object.assign;function km(t,e){return ge(t,0)^45?(((e<<2^ge(t,0))<<2^ge(t,1))<<2^ge(t,2))<<2^ge(t,3):0}function Wc(t){return t.trim()}function Tm(t,e){return(t=e.exec(t))?t[0]:t}function Q(t,e,n){return t.replace(e,n)}function mo(t,e){return t.indexOf(e)}function ge(t,e){return t.charCodeAt(e)|0}function kn(t,e,n){return t.slice(e,n)}function Ye(t){return t.length}function xo(t){return t.length}function zr(t,e){return e.push(t),t}function xm(t,e){return t.map(e).join("")}var ca=1,Qt=1,zc=0,Le=0,me=0,Zt="";function ua(t,e,n,r,a,i,o){return{value:t,root:e,parent:n,type:r,props:a,children:i,line:ca,column:Qt,length:o,return:""}}function Sn(t,e){return Om(ua("",null,null,"",null,null,0),t,{length:-t.length},e)}function Pm(){return me}function Dm(){return me=Le>0?ge(Zt,--Le):0,Qt--,me===10&&(Qt=1,ca--),me}function Ge(){return me=Le<zc?ge(Zt,Le++):0,Qt++,me===10&&(Qt=1,ca++),me}function Qe(){return ge(Zt,Le)}function Yr(){return Le}function Pn(t,e){return kn(Zt,t,e)}function Tn(t){switch(t){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 Xc(t){return ca=Qt=1,zc=Ye(Zt=t),Le=0,[]}function Yc(t){return Zt="",t}function Qr(t){return Wc(Pn(Le-1,po(t===91?t+2:t===40?t+1:t)))}function Lm(t){for(;(me=Qe())&&me<33;)Ge();return Tn(t)>2||Tn(me)>3?"":" "}function Nm(t,e){for(;--e&&Ge()&&!(me<48||me>102||me>57&&me<65||me>70&&me<97););return Pn(t,Yr()+(e<6&&Qe()==32&&Ge()==32))}function po(t){for(;Ge();)switch(me){case t:return Le;case 34:case 39:t!==34&&t!==39&&po(me);break;case 40:t===41&&po(t);break;case 92:Ge();break}return Le}function Um(t,e){for(;Ge()&&t+me!==57&&!(t+me===84&&Qe()===47););return"/*"+Pn(e,Le-1)+"*"+la(t===47?t:Ge())}function Bm(t){for(;!Tn(Qe());)Ge();return Pn(t,Le)}function Mm(t){return Yc(Zr("",null,null,null,[""],t=Xc(t),0,[0],t))}function Zr(t,e,n,r,a,i,o,s,l){for(var d=0,_=0,f=o,p=0,h=0,b=0,E=1,C=1,w=1,O=0,k="",M=a,B=i,I=r,D=k;C;)switch(b=O,O=Ge()){case 40:if(b!=108&&ge(D,f-1)==58){mo(D+=Q(Qr(O),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:D+=Qr(O);break;case 9:case 10:case 13:case 32:D+=Lm(b);break;case 92:D+=Nm(Yr()-1,7);continue;case 47:switch(Qe()){case 42:case 47:zr(Gm(Um(Ge(),Yr()),e,n),l);break;default:D+="/"}break;case 123*E:s[d++]=Ye(D)*w;case 125*E:case 59:case 0:switch(O){case 0:case 125:C=0;case 59+_:w==-1&&(D=Q(D,/\f/g,"")),h>0&&Ye(D)-f&&zr(h>32?wc(D+";",r,n,f-1):wc(Q(D," ","")+";",r,n,f-2),l);break;case 59:D+=";";default:if(zr(I=yc(D,e,n,d,_,a,s,k,M=[],B=[],f),i),O===123)if(_===0)Zr(D,e,I,I,M,i,f,s,B);else switch(p===99&&ge(D,3)===110?100:p){case 100:case 108:case 109:case 115:Zr(t,I,I,r&&zr(yc(t,I,I,0,0,a,s,k,a,M=[],f),B),a,B,f,s,r?M:B);break;default:Zr(D,I,I,I,[""],B,0,s,B)}}d=_=h=0,E=w=1,k=D="",f=o;break;case 58:f=1+Ye(D),h=b;default:if(E<1){if(O==123)--E;else if(O==125&&E++==0&&Dm()==125)continue}switch(D+=la(O),O*E){case 38:w=_>0?1:(D+="\f",-1);break;case 44:s[d++]=(Ye(D)-1)*w,w=1;break;case 64:Qe()===45&&(D+=Qr(Ge())),p=Qe(),_=f=Ye(k=D+=Bm(Yr())),O++;break;case 45:b===45&&Ye(D)==2&&(E=0)}}return i}function yc(t,e,n,r,a,i,o,s,l,d,_){for(var f=a-1,p=a===0?i:[""],h=xo(p),b=0,E=0,C=0;b<r;++b)for(var w=0,O=kn(t,f+1,f=Rm(E=o[b])),k=t;w<h;++w)(k=Wc(E>0?p[w]+" "+O:Q(O,/&\f/g,p[w])))&&(l[C++]=k);return ua(t,e,n,a===0?ko:s,l,d,_)}function Gm(t,e,n){return ua(t,e,n,$c,la(Pm()),kn(t,2,-2),0)}function wc(t,e,n,r){return ua(t,e,n,To,kn(t,0,r),kn(t,r+1,-1),r)}function Yt(t,e){for(var n="",r=xo(t),a=0;a<r;a++)n+=e(t[a],a,t,e)||"";return n}function Jm(t,e,n,r){switch(t.type){case Cm:if(t.children.length)break;case Sm:case To:return t.return=t.return||t.value;case $c:return"";case Kc:return t.return=t.value+"{"+Yt(t.children,r)+"}";case ko:t.value=t.props.join(",")}return Ye(n=Yt(t.children,r))?t.return=t.value+"{"+n+"}":""}function Fm(t){var e=xo(t);return function(n,r,a,i){for(var o="",s=0;s<e;s++)o+=t[s](n,r,a,i)||"";return o}}function Hm(t){return function(e){e.root||(e=e.return)&&t(e)}}function jm(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var qm=function(t,e,n){for(var r=0,a=0;r=a,a=Qe(),r===38&&a===12&&(e[n]=1),!Tn(a);)Ge();return Pn(t,Le)},Vm=function(t,e){var n=-1,r=44;do switch(Tn(r)){case 0:r===38&&Qe()===12&&(e[n]=1),t[n]+=qm(Le-1,e,n);break;case 2:t[n]+=Qr(r);break;case 4:if(r===44){t[++n]=Qe()===58?"&\f":"",e[n]=t[n].length;break}default:t[n]+=la(r)}while(r=Ge());return t},$m=function(t,e){return Yc(Vm(Xc(t),e))},bc=new WeakMap,Km=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var e=t.value,n=t.parent,r=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&e.charCodeAt(0)!==58&&!bc.get(n))&&!r){bc.set(t,!0);for(var a=[],i=$m(e,a),o=n.props,s=0,l=0;s<i.length;s++)for(var d=0;d<o.length;d++,l++)t.props[l]=a[s]?i[s].replace(/&\f/g,o[d]):o[d]+" "+i[s]}}},Wm=function(t){if(t.type==="decl"){var e=t.value;e.charCodeAt(0)===108&&e.charCodeAt(2)===98&&(t.return="",t.value="")}};function Qc(t,e){switch(km(t,e)){case 5103:return Y+"print-"+t+t;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 Y+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Y+t+ra+t+Ae+t+t;case 6828:case 4268:return Y+t+Ae+t+t;case 6165:return Y+t+Ae+"flex-"+t+t;case 5187:return Y+t+Q(t,/(\w+).+(:[^]+)/,Y+"box-$1$2"+Ae+"flex-$1$2")+t;case 5443:return Y+t+Ae+"flex-item-"+Q(t,/flex-|-self/,"")+t;case 4675:return Y+t+Ae+"flex-line-pack"+Q(t,/align-content|flex-|-self/,"")+t;case 5548:return Y+t+Ae+Q(t,"shrink","negative")+t;case 5292:return Y+t+Ae+Q(t,"basis","preferred-size")+t;case 6060:return Y+"box-"+Q(t,"-grow","")+Y+t+Ae+Q(t,"grow","positive")+t;case 4554:return Y+Q(t,/([^-])(transform)/g,"$1"+Y+"$2")+t;case 6187:return Q(Q(Q(t,/(zoom-|grab)/,Y+"$1"),/(image-set)/,Y+"$1"),t,"")+t;case 5495:case 3959:return Q(t,/(image-set\([^]*)/,Y+"$1$`$1");case 4968:return Q(Q(t,/(.+:)(flex-)?(.*)/,Y+"box-pack:$3"+Ae+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Y+t+t;case 4095:case 3583:case 4068:case 2532:return Q(t,/(.+)-inline(.+)/,Y+"$1$2")+t;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(Ye(t)-1-e>6)switch(ge(t,e+1)){case 109:if(ge(t,e+4)!==45)break;case 102:return Q(t,/(.+:)(.+)-([^]+)/,"$1"+Y+"$2-$3$1"+ra+(ge(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~mo(t,"stretch")?Qc(Q(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(ge(t,e+1)!==115)break;case 6444:switch(ge(t,Ye(t)-3-(~mo(t,"!important")&&10))){case 107:return Q(t,":",":"+Y)+t;case 101:return Q(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Y+(ge(t,14)===45?"inline-":"")+"box$3$1"+Y+"$2$3$1"+Ae+"$2box$3")+t}break;case 5936:switch(ge(t,e+11)){case 114:return Y+t+Ae+Q(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Y+t+Ae+Q(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Y+t+Ae+Q(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Y+t+Ae+t+t}return t}var zm=function(t,e,n,r){if(t.length>-1&&!t.return)switch(t.type){case To:t.return=Qc(t.value,t.length);break;case Kc:return Yt([Sn(t,{value:Q(t.value,"@","@"+Y)})],r);case ko:if(t.length)return xm(t.props,function(a){switch(Tm(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Yt([Sn(t,{props:[Q(a,/:(read-\w+)/,":"+ra+"$1")]})],r);case"::placeholder":return Yt([Sn(t,{props:[Q(a,/:(plac\w+)/,":"+Y+"input-$1")]}),Sn(t,{props:[Q(a,/:(plac\w+)/,":"+ra+"$1")]}),Sn(t,{props:[Q(a,/:(plac\w+)/,Ae+"input-$1")]})],r)}return""})}},Xm=[zm],Ym=function(t){var e=t.key;if(e==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(b){var E=b.getAttribute("data-emotion");E.indexOf(" ")!==-1&&(document.head.appendChild(b),b.setAttribute("data-s",""))})}var r=t.stylisPlugins||Xm,a={},i,o=[];i=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+e+' "]'),function(b){for(var E=b.getAttribute("data-emotion").split(" "),C=1;C<E.length;C++)a[E[C]]=!0;o.push(b)});var s,l=[Km,Wm];{var d,_=[Jm,Hm(function(b){d.insert(b)})],f=Fm(l.concat(r,_)),p=function(b){return Yt(Mm(b),f)};s=function(b,E,C,w){d=C,p(b?b+"{"+E.styles+"}":E.styles),w&&(h.inserted[E.name]=!0)}}var h={key:e,sheet:new Am({key:e,container:i,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:s};return h.sheet.hydrate(o),h};function Qm(t){for(var e=0,n,r=0,a=t.length;a>=4;++r,a-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(a){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var Zm={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},ep=/[A-Z]|^ms/g,tp=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Zc=function(t){return t.charCodeAt(1)===45},Ec=function(t){return t!=null&&typeof t!="boolean"},eo=jm(function(t){return Zc(t)?t:t.replace(ep,"-$&").toLowerCase()}),Ic=function(t,e){switch(t){case"animation":case"animationName":if(typeof e=="string")return e.replace(tp,function(n,r,a){return _t={name:r,styles:a,next:_t},r})}return Zm[t]!==1&&!Zc(t)&&typeof e=="number"&&e!==0?e+"px":e};function aa(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var a=n;if(a.anim===1)return _t={name:a.name,styles:a.styles,next:_t},a.name;var i=n;if(i.styles!==void 0){var o=i.next;if(o!==void 0)for(;o!==void 0;)_t={name:o.name,styles:o.styles,next:_t},o=o.next;var s=i.styles+";";return s}return np(t,e,n)}}var l=n;if(e==null)return l;var d=e[l];return d!==void 0?d:l}function np(t,e,n){var r="";if(Array.isArray(n))for(var a=0;a<n.length;a++)r+=aa(t,e,n[a])+";";else for(var i in n){var o=n[i];if(typeof o!="object"){var s=o;e!=null&&e[s]!==void 0?r+=i+"{"+e[s]+"}":Ec(s)&&(r+=eo(i)+":"+Ic(i,s)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(e==null||e[o[0]]===void 0))for(var l=0;l<o.length;l++)Ec(o[l])&&(r+=eo(i)+":"+Ic(i,o[l])+";");else{var d=aa(t,e,o);switch(i){case"animation":case"animationName":{r+=eo(i)+":"+d+";";break}default:r+=i+"{"+d+"}"}}}return r}var Ac=/label:\s*([^\s;{]+)\s*(;|$)/g,_t;function to(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var r=!0,a="";_t=void 0;var i=t[0];if(i==null||i.raw===void 0)r=!1,a+=aa(n,e,i);else{var o=i;a+=o[0]}for(var s=1;s<t.length;s++)if(a+=aa(n,e,t[s]),r){var l=i;a+=l[s]}Ac.lastIndex=0;for(var d="",_;(_=Ac.exec(a))!==null;)d+="-"+_[1];var f=Qm(a)+d;return{name:f,styles:a,next:_t}}function eu(t,e,n){var r="";return n.split(" ").forEach(function(a){t[a]!==void 0?e.push(t[a]+";"):a&&(r+=a+" ")}),r}var rp=function(t,e,n){var r=t.key+"-"+e.name;t.registered[r]===void 0&&(t.registered[r]=e.styles)},ap=function(t,e,n){rp(t,e);var r=t.key+"-"+e.name;if(t.inserted[e.name]===void 0){var a=e;do t.insert(e===a?"."+r:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function Sc(t,e){if(t.inserted[e.name]===void 0)return t.insert("",e,t.sheet,!0)}function Cc(t,e,n){var r=[],a=eu(t,r,n);return r.length<2?n:a+e(r)}var ip=function(t){var e=Ym(t);e.sheet.speedy=function(o){this.isSpeedy=o},e.compat=!0;var n=function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];var d=to(s,e.registered,void 0);return ap(e,d),e.key+"-"+d.name},r=function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];var d=to(s,e.registered),_="animation-"+d.name;return Sc(e,{name:d.name,styles:"@keyframes "+_+"{"+d.styles+"}"}),_},a=function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];var d=to(s,e.registered);Sc(e,d)},i=function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return Cc(e.registered,n,op(s))};return{css:n,cx:i,injectGlobal:a,keyframes:r,hydrate:function(o){o.forEach(function(s){e.inserted[s]=!0})},flush:function(){e.registered={},e.inserted={},e.sheet.flush()},sheet:e.sheet,cache:e,getRegisteredStyles:eu.bind(null,e.registered),merge:Cc.bind(null,e.registered,n)}},op=function t(e){for(var n="",r=0;r<e.length;r++){var a=e[r];if(a!=null){var i=void 0;switch(typeof a){case"boolean":break;case"object":{if(Array.isArray(a))i=t(a);else{i="";for(var o in a)a[o]&&o&&(i&&(i+=" "),i+=o)}break}default:i=a}i&&(n&&(n+=" "),n+=i)}}return n},sp=ip({key:"css"}),Se=sp.css,vo,Me,no,Rc,Oc=0,tu=[],pe=H,kc=pe.__b,Tc=pe.__r,xc=pe.diffed,Pc=pe.__c,Dc=pe.unmount,Lc=pe.__;function lp(t,e){pe.__h&&pe.__h(Me,t,Oc||e),Oc=0;var n=Me.__H||(Me.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function nu(t,e){var n=lp(vo++,7);return dp(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function cp(){for(var t;t=tu.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ea),t.__H.__h.forEach(go),t.__H.__h=[]}catch(e){t.__H.__h=[],pe.__e(e,t.__v)}}pe.__b=function(t){Me=null,kc&&kc(t)},pe.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Lc&&Lc(t,e)},pe.__r=function(t){Tc&&Tc(t),vo=0;var e=(Me=t.__c).__H;e&&(no===Me?(e.__h=[],Me.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(ea),e.__h.forEach(go),e.__h=[],vo=0)),no=Me},pe.diffed=function(t){xc&&xc(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(tu.push(e)!==1&&Rc===pe.requestAnimationFrame||((Rc=pe.requestAnimationFrame)||up)(cp)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),no=Me=null},pe.__c=function(t,e){e.some(function(n){try{n.__h.forEach(ea),n.__h=n.__h.filter(function(r){return!r.__||go(r)})}catch(r){e.some(function(a){a.__h&&(a.__h=[])}),e=[],pe.__e(r,n.__v)}}),Pc&&Pc(t,e)},pe.unmount=function(t){Dc&&Dc(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{ea(r)}catch(a){e=a}}),n.__H=void 0,e&&pe.__e(e,n.__v))};var Nc=typeof requestAnimationFrame=="function";function up(t){var e,n=function(){clearTimeout(r),Nc&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);Nc&&(e=requestAnimationFrame(n))}function ea(t){var e=Me,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Me=e}function go(t){var e=Me;t.__c=t.__(),Me=e}function dp(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}var fp=Symbol.for("preact-signals");function da(){if(yt>1)yt--;else{for(var t,e=!1;Cn!==void 0;){var n=Cn;for(Cn=void 0,_o++;n!==void 0;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&au(n))try{n.c()}catch(a){e||(t=a,e=!0)}n=r}}if(_o=0,yt--,e)throw t}}function _e(t){if(yt>0)return t();yt++;try{return t()}finally{da()}}var ae=void 0,Cn=void 0,yt=0,_o=0,ia=0;function ru(t){if(ae!==void 0){var e=t.n;if(e===void 0||e.t!==ae)return e={i:0,S:t,p:ae.s,n:void 0,t:ae,e:void 0,x:void 0,r:e},ae.s!==void 0&&(ae.s.n=e),ae.s=e,t.n=e,32&ae.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=ae.s,e.n=void 0,ae.s.n=e,ae.s=e),e}}function ye(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}ye.prototype.brand=fp;ye.prototype.h=function(){return!0};ye.prototype.S=function(t){this.t!==t&&t.e===void 0&&(t.x=this.t,this.t!==void 0&&(this.t.e=t),this.t=t)};ye.prototype.U=function(t){if(this.t!==void 0){var e=t.e,n=t.x;e!==void 0&&(e.x=n,t.e=void 0),n!==void 0&&(n.e=e,t.x=void 0),t===this.t&&(this.t=n)}};ye.prototype.subscribe=function(t){var e=this;return Ln(function(){var n=e.value,r=ae;ae=void 0;try{t(n)}finally{ae=r}})};ye.prototype.valueOf=function(){return this.value};ye.prototype.toString=function(){return this.value+""};ye.prototype.toJSON=function(){return this.value};ye.prototype.peek=function(){var t=ae;ae=void 0;try{return this.value}finally{ae=t}};Object.defineProperty(ye.prototype,"value",{get:function(){var t=ru(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(_o>100)throw new Error("Cycle detected");this.v=t,this.i++,ia++,yt++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{da()}}}});function K(t){return new ye(t)}function au(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function iu(t){for(var e=t.s;e!==void 0;e=e.n){var n=e.S.n;if(n!==void 0&&(e.r=n),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function ou(t){for(var e=t.s,n=void 0;e!==void 0;){var r=e.p;e.i===-1?(e.S.U(e),r!==void 0&&(r.n=e.n),e.n!==void 0&&(e.n.p=r)):n=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=r}t.s=n}function en(t){ye.call(this,void 0),this.x=t,this.s=void 0,this.g=ia-1,this.f=4}(en.prototype=new ye).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ia))return!0;if(this.g=ia,this.f|=1,this.i>0&&!au(this))return this.f&=-2,!0;var t=ae;try{iu(this),ae=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return ae=t,ou(this),this.f&=-2,!0};en.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}ye.prototype.S.call(this,t)};en.prototype.U=function(t){if(this.t!==void 0&&(ye.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};en.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(en.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=ru(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function Rn(t){return new en(t)}function su(t){var e=t.u;if(t.u=void 0,typeof e=="function"){yt++;var n=ae;ae=void 0;try{e()}catch(r){throw t.f&=-2,t.f|=8,Po(t),r}finally{ae=n,da()}}}function Po(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,su(t)}function hp(t){if(ae!==this)throw new Error("Out-of-order effect");ou(this),ae=t,this.f&=-2,8&this.f&&Po(this),da()}function Dn(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Dn.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}};Dn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,su(this),iu(this),yt++;var t=ae;return ae=this,hp.bind(this,t)};Dn.prototype.N=function(){2&this.f||(this.f|=2,this.o=Cn,Cn=this)};Dn.prototype.d=function(){this.f|=8,1&this.f||Po(this)};function Ln(t){var e=new Dn(t);try{e.c()}catch(n){throw e.d(),n}return e.d.bind(e)}var lu,ro,cu=[];Ln(function(){lu=this.N})();function tn(t,e){H[t]=e.bind(null,H[t]||function(){})}function oa(t){ro&&ro(),ro=t&&t.S()}function uu(t){var e=this,n=t.data,r=du(n);r.value=n;var a=nu(function(){for(var s=e,l=e.__v;l=l.__;)if(l.__c){l.__c.__$f|=4;break}var d=Rn(function(){var h=r.value.value;return h===0?0:h===!0?"":h||""}),_=Rn(function(){return!Array.isArray(d.value)&&!ji(d.value)}),f=Ln(function(){if(this.N=fu,_.value){var h=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=h)}}),p=e.__$u.d;return e.__$u.d=function(){f(),p.call(this)},[_,d]},[]),i=a[0],o=a[1];return i.value?o.peek():o.value}uu.displayName="_st";Object.defineProperties(ye.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:uu},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});tn("__b",function(t,e){if(typeof e.type=="string"){var n,r=e.props;for(var a in r)if(a!=="children"){var i=r[a];i instanceof ye&&(n||(e.__np=n={}),n[a]=i,r[a]=i.peek())}}t(e)});tn("__r",function(t,e){oa();var n,r=e.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(a){var i;return Ln(function(){i=this}),i.c=function(){r.__$f|=1,r.setState({})},i}())),oa(n),t(e)});tn("__e",function(t,e,n,r){oa(),t(e,n,r)});tn("diffed",function(t,e){oa();var n;if(typeof e.type=="string"&&(n=e.__e)){var r=e.__np,a=e.props;if(r){var i=n.U;if(i)for(var o in i){var s=i[o];s!==void 0&&!(o in r)&&(s.d(),i[o]=void 0)}else i={},n.U=i;for(var l in r){var d=i[l],_=r[l];d===void 0?(d=mp(n,l,_,a),i[l]=d):d.o(_,a)}}}t(e)});function mp(t,e,n,r){var a=e in t&&t.ownerSVGElement===void 0,i=K(n);return{o:function(o,s){i.value=o,r=s},d:Ln(function(){this.N=fu;var o=i.value.value;r[e]!==o&&(r[e]=o,a?t[e]=o:o?t.setAttribute(e,o):t.removeAttribute(e))})}}tn("unmount",function(t,e){if(typeof e.type=="string"){var n=e.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var a in r){var i=r[a];i&&i.d()}}}}else{var o=e.__c;if(o){var s=o.__$u;s&&(o.__$u=void 0,s.d())}}t(e)});tn("__h",function(t,e,n,r){(r<3||r===9)&&(e.__$f|=2),t(e,n,r)});Be.prototype.shouldComponentUpdate=function(t,e){var n=this.__$u,r=n&&n.s!==void 0;for(var a in e)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(r||i||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var o in t)if(o!=="__source"&&t[o]!==this.props[o])return!0;for(var s in this.props)if(!(s in t))return!0;return!1};function du(t){return nu(function(){return K(t)},[])}var pp=function(t){queueMicrotask(function(){queueMicrotask(t)})};function vp(){_e(function(){for(var t;t=cu.shift();)lu.call(t)})}function fu(){cu.push(this)===1&&(H.requestAnimationFrame||pp)(vp)}var ve=Se`
|
|
9
|
+
-----END PUBLIC KEY-----`});function Ml(e){let t="",r=new Uint8Array(e),n=r.byteLength;for(let i=0;i<n;i++)t+=String.fromCharCode(r[i]);return window.btoa(t)}function jh(e){let t="-----BEGIN PUBLIC KEY-----",n=e.substring(e.indexOf(t)+t.length,e.indexOf("-----END PUBLIC KEY-----")).replace(/\s+/g,""),i=window.atob(n),a=new Uint8Array(i.length);for(let o=0;o<i.length;o++)a[o]=i.charCodeAt(o);return a.buffer}function Gl(e){return A(this,null,function*(){let t=window.crypto,r=t.subtle,n=jh(Ul),i=yield r.importKey("spki",n,{name:"RSA-OAEP",hash:"SHA-1"},!1,["encrypt"]),a=t.getRandomValues(new Uint8Array(32)),o=yield r.importKey("raw",a,"AES-GCM",!1,["encrypt"]),s=yield r.encrypt({name:"RSA-OAEP"},i,a),l=Ml(s),p={timestamp:Date.now(),data:e},m=new TextEncoder().encode(JSON.stringify(p)),h=t.getRandomValues(new Uint8Array(12)),w=yield r.encrypt({name:"AES-GCM",iv:h,tagLength:128},o,m),E=new Uint8Array(w),I=new Uint8Array(h.length+E.length);I.set(h,0),I.set(E,h.length);let b=Ml(I.buffer);return{k:l,v:"1.0",payload:b}})}var Jl=re(()=>{"use strict";Bl()});var mn,Fl=re(()=>{"use strict";he();Ll();Wt();Jl();mn=class extends hn{constructor(r,n,i){super(n,i);this.httpClient=Ke.create();this.gameId=L.mpId,this.sessionId=L.sessionId,this.track=r}reporter(r){return A(this,null,function*(){let{event:n,params:i,extraParams:a}=r,o={eventType:n,gameInfo:z({gameId:this.gameId,sessionId:this.sessionId},i)};a&&Object.assign(o,a);try{let s=yield Gl(o);yield this.httpClient.post("/api/base/app-event/v2",{data:s})}catch(s){yield this.httpClient.post("/api/base/app-event",{data:o})}})}tracker(r,n=null){this.track(r,n)}}});var jl,Hh,xe,qh,Oa,it,wt=re(()=>{"use strict";Dl();q();q();Aa();Ra();Fl();he();Ia();jl=we(),Hh={type:$t.WebSDK,platform:"h5",jssdk_version:L.sdkInfo.jssdkVersion,mp_id:L.mpId,mp_version:L.mpVersion},{track:xe,trackPerformance:qh}=Tl((...e)=>{var o,s,l,c;let[,t]=e,r=t,n=nl(r.extra)?r.extra:oa(r.extra)?JSON.parse(r.extra):{},i=Re(z({},n),{mp_id:(o=r.mp_id)!=null?o:"",mp_version:(s=r.mp_version)!=null?s:""}),a={name:t.tag,type:kt.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(c=(l=L.hostUserInfo)==null?void 0:l.uid)!=null?c:null};fn.trackEvent(a,$t.WebSDK)},Hh);jl.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{qh(e,t,r)});jl.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{xe(e,t)});Oa=new ze,it=new mn(xe,Oa)});function Hl(e){let t=da.config[e];return t||(t={},da.config[e]=t),(r,n)=>{if(t[r]){Be.warn(`[can i use] ${r} already registered`);return}t[r]=z({},n)}}var ql=re(()=>{"use strict";q()});function ka(e){Vl=e}function pn(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>pn(t)):Object.keys(e).reduce((t,r)=>(t[r]=pn(e[r]),t),{})}function at(e){return typeof e=="number"}function Ta(e){let t=xa(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function xa(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var Vl,me,vn,gn,_n,yn,zt,bn,wn,En,In,An,Sn,Cn,Rn,On,kn,Tn,xn,Pa=re(()=>{"use strict";Vl=!1;me=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(Vl)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 ${Ta(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return pn(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:pn(this._default)}optional(){return this._optional=!0,this}};vn=class extends me{validate(t){return this._optional&&t===void 0?!0:at(t)?at(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):at(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):at(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}},gn=class extends me{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},_n=class extends me{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(at(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(at(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}},yn=class extends me{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},zt=class extends me{validate(t){return!0}},bn=class extends me{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},wn=class extends me{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},En=class extends me{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},In=class extends me{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 ${Ta(t)}`)}return!0}},An=class extends me{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(at(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(at(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(at(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((a,o)=>{if(n.path=`${this.path}[${o}]`,n.errors=this.errors,a===void 0&&n.hasDefault){r[o]=n.defaultValue;return}n.validate(a)||(n.hasFallback?r[o]=n.fallbackValue:i=!1)}),this._uniqueItems){let a=new Map;for(let o in r)a.has(r[o])?i=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${a.get(r[o])}] and ${this.path}[${o}] are identical)`):a.set(r[o],o)}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}},Sn=class extends me{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(xa(r)!=="object")return this.fail({expect:"object",actual:r});let i=r,a=this._value;a.errors=this.errors;let o=!0;for(let s in i){let l=i[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?a.path=`${this.path}.${s}`:a.path=`${this.path}["${s}"]`,!(l===void 0&&a._optional)){if(l===void 0&&a.hasDefault){i[s]=a.defaultValue;continue}a.validate(l)||(a.hasFallback?i[s]=a.fallbackValue:o=!1)}}return o}},Cn=class extends me{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(xa(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,i=!0;for(let a in this._object){let o=n[a],s=this._object[a];if(s.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(a)?s.path=`${this.path}.${a}`:s.path=`${this.path}["${a}"]`,!(s._optional&&o===void 0)){if(o===void 0&&s.hasDefault){n[a]=s.defaultValue;continue}s.validate(o)||(s.hasFallback?n[a]=s.fallbackValue:i=!1)}}return i}},Rn=class extends me{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:Ta(this.value),actual:r}):!0}},On=class extends me{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 a=0;a<i;a++){let o=this._items[a];if(o.errors=[],o.path=this.path,!o.validate(t))r.push(o.errors.join("; "));else if(!n){n=!0;break}}if(!n){let a=r.join(`
|
|
10
|
+
or `);this.errors.push(a)}return n}},kn=class extends me{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}},Tn=class extends me{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},xn=class extends me{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 Na(e,t,r="param"){if(e.errors=[],e.path=r,ka(!0),!e.validate(t)){let n=e.errors.join(`
|
|
11
|
+
`);throw e.errors.length=0,ka(!1),new TypeError(n)}}var V,Da=re(()=>{"use strict";Pa();Pa();V={object(e){return new Cn(e)},array(e){return new An(e)},tuple(...e){return new kn(...e)},literal(e){return new Rn(e)},or(...e){return new On(...e)},symbol(){return new yn},record(e){return new Sn(e)},function(){return new En},boolean(){return new gn},string(){return new _n},number(){return new vn},undefined(){return new bn},null(){return new wn},unknown(){return new zt},any(){return new zt},as(){return new zt},arraybuffer(){return new Tn},enum(...e){return new In(...e)},typedarray(e){return new xn(e)}}});var Pn,$l,Kl=re(()=>{"use strict";q();rt();Da();Ea();Pn=1,$l=e=>{function t(n,i){return(...a)=>{var u,m,h,w;let o=Date.now(),s={method:n,trace_id:Pn};Pn+=1;let l="SUCCESS",c=`${n}:ok`,p=0;try{if(i.paramsSchema)try{Na(i.paramsSchema,a,"params")}catch(R){throw wa(`${n}:fail ${R.message}`)}let E=i.implement(...a),I=E,b=`${n}:ok`;if(E&&"code"in E){let{code:R,data:k,message:D}=E;l=R,I=k,b=D}return{code:l,message:b,data:I}}catch(E){let I=E;p=(m=(u=I.code)!=null?u:I.errNo)!=null?m:2e3,l="FAILURE";let b=(w=(h=I.message)!=null?h:I.errMsg)!=null?w:`${E}`;return c=`${n}:${l} ${b.replace(/^\S+:(fail|cancel)\s?/,"")}`,Me(new ln(c,p)),{code:l,message:c}}finally{let E=Date.now()-o}}}function r(n,i){return(...a)=>A(this,null,function*(){var m,h,w,E;let o=il(a)?a:[a],s=Date.now(),l={method:n,trace_id:Pn};Pn+=1;let c=`${n}:ok`,p="SUCCESS",u={code:p,message:c};try{if(i.paramsSchema)try{Na(i.paramsSchema,o,"params")}catch(R){throw wa(R.message)}let b=yield i.implement(...o);if(b&&"code"in b){let{code:R,data:k,message:D}=b;p=R,c=D,b=k}return Object.assign(u,{code:p,message:c,data:b}),u}catch(I){let b=I,R=(h=(m=b.code)!=null?m:b.errNo)!=null?h:2e3;p="FAILURE";let k=(E=(w=b.message)!=null?w:b.errMsg)!=null?E:`${I}`,D=`${n}:${p} ${k.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(u,{code:p,message:D}),Me(new ln(D,R)),u}finally{let I=Date.now()-s}})}return{createAPI:r,createSyncAPI:t}}});var ot,Pt,Ee,Er=re(()=>{"use strict";ql();wt();Kl();Da();({createAPI:ot,createSyncAPI:Pt}=$l(xe)),Ee=Hl("h5")});var Xl=Yi((Yl,Ma)=>{(function(e){if(typeof Yl=="object"&&typeof Ma!="undefined")Ma.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,a,o){function s(p,u){if(!a[p]){if(!i[p]){var m=typeof gr=="function"&&gr;if(!u&&m)return m(p,!0);if(l)return l(p,!0);var h=new Error("Cannot find module '"+p+"'");throw h.code="MODULE_NOT_FOUND",h}var w=a[p]={exports:{}};i[p][0].call(w.exports,function(E){var I=i[p][1][E];return s(I||E)},w,w.exports,n,i,a,o)}return a[p].exports}for(var l=typeof gr=="function"&&gr,c=0;c<o.length;c++)s(o[c]);return s}({1:[function(n,i,a){(function(o){"use strict";var s=o.MutationObserver||o.WebKitMutationObserver,l;if(s){var c=0,p=new s(E),u=o.document.createTextNode("");p.observe(u,{characterData:!0}),l=function(){u.data=c=++c%2}}else if(!o.setImmediate&&typeof o.MessageChannel!="undefined"){var m=new o.MessageChannel;m.port1.onmessage=E,l=function(){m.port2.postMessage(0)}}else"document"in o&&"onreadystatechange"in o.document.createElement("script")?l=function(){var b=o.document.createElement("script");b.onreadystatechange=function(){E(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},o.document.documentElement.appendChild(b)}:l=function(){setTimeout(E,0)};var h,w=[];function E(){h=!0;for(var b,R,k=w.length;k;){for(R=w,w=[],b=-1;++b<k;)R[b]();k=w.length}h=!1}i.exports=I;function I(b){w.push(b)===1&&!h&&l()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,i,a){"use strict";var o=n(1);function s(){}var l={},c=["REJECTED"],p=["FULFILLED"],u=["PENDING"];i.exports=m;function m(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,S!==s&&I(this,S)}m.prototype.catch=function(S){return this.then(null,S)},m.prototype.then=function(S,N){if(typeof S!="function"&&this.state===p||typeof N!="function"&&this.state===c)return this;var F=new this.constructor(s);if(this.state!==u){var H=this.state===p?S:N;w(F,H,this.outcome)}else this.queue.push(new h(F,S,N));return F};function h(S,N,F){this.promise=S,typeof N=="function"&&(this.onFulfilled=N,this.callFulfilled=this.otherCallFulfilled),typeof F=="function"&&(this.onRejected=F,this.callRejected=this.otherCallRejected)}h.prototype.callFulfilled=function(S){l.resolve(this.promise,S)},h.prototype.otherCallFulfilled=function(S){w(this.promise,this.onFulfilled,S)},h.prototype.callRejected=function(S){l.reject(this.promise,S)},h.prototype.otherCallRejected=function(S){w(this.promise,this.onRejected,S)};function w(S,N,F){o(function(){var H;try{H=N(F)}catch(U){return l.reject(S,U)}H===S?l.reject(S,new TypeError("Cannot resolve promise with itself")):l.resolve(S,H)})}l.resolve=function(S,N){var F=b(E,N);if(F.status==="error")return l.reject(S,F.value);var H=F.value;if(H)I(S,H);else{S.state=p,S.outcome=N;for(var U=-1,M=S.queue.length;++U<M;)S.queue[U].callFulfilled(N)}return S},l.reject=function(S,N){S.state=c,S.outcome=N;for(var F=-1,H=S.queue.length;++F<H;)S.queue[F].callRejected(N);return S};function E(S){var N=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof N=="function")return function(){N.apply(S,arguments)}}function I(S,N){var F=!1;function H(K){F||(F=!0,l.reject(S,K))}function U(K){F||(F=!0,l.resolve(S,K))}function M(){N(U,H)}var G=b(M);G.status==="error"&&H(G.value)}function b(S,N){var F={};try{F.value=S(N),F.status="success"}catch(H){F.status="error",F.value=H}return F}m.resolve=R;function R(S){return S instanceof this?S:l.resolve(new this(s),S)}m.reject=k;function k(S){var N=new this(s);return l.reject(N,S)}m.all=D;function D(S){var N=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=S.length,H=!1;if(!F)return this.resolve([]);for(var U=new Array(F),M=0,G=-1,K=new this(s);++G<F;)Y(S[G],G);return K;function Y(Ue,Rt){N.resolve(Ue).then(jt,function(Ht){H||(H=!0,l.reject(K,Ht))});function jt(Ht){U[Rt]=Ht,++M===F&&!H&&(H=!0,l.resolve(K,U))}}}m.race=J;function J(S){var N=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=S.length,H=!1;if(!F)return this.resolve([]);for(var U=-1,M=new this(s);++U<F;)G(S[U]);return M;function G(K){N.resolve(K).then(function(Y){H||(H=!0,l.resolve(M,Y))},function(Y){H||(H=!0,l.reject(M,Y))})}}},{1:1}],3:[function(n,i,a){(function(o){"use strict";typeof o.Promise!="function"&&(o.Promise=n(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(n,i,a){"use strict";var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d};function s(d,v){if(!(d instanceof v))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(d){return}}var c=l();function p(){try{if(!c||!c.open)return!1;var d=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),v=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!d||v)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(f){return!1}}function u(d,v){d=d||[],v=v||{};try{return new Blob(d,v)}catch(g){if(g.name!=="TypeError")throw g;for(var f=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,_=new f,y=0;y<d.length;y+=1)_.append(d[y]);return _.getBlob(v.type)}}typeof Promise=="undefined"&&n(3);var m=Promise;function h(d,v){v&&d.then(function(f){v(null,f)},function(f){v(f)})}function w(d,v,f){typeof v=="function"&&d.then(v),typeof f=="function"&&d.catch(f)}function E(d){return typeof d!="string"&&(console.warn(d+" used as a key, but it is not a string."),d=String(d)),d}function I(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var b="local-forage-detect-blob-support",R=void 0,k={},D=Object.prototype.toString,J="readonly",S="readwrite";function N(d){for(var v=d.length,f=new ArrayBuffer(v),_=new Uint8Array(f),y=0;y<v;y++)_[y]=d.charCodeAt(y);return f}function F(d){return new m(function(v){var f=d.transaction(b,S),_=u([""]);f.objectStore(b).put(_,"key"),f.onabort=function(y){y.preventDefault(),y.stopPropagation(),v(!1)},f.oncomplete=function(){var y=navigator.userAgent.match(/Chrome\/(\d+)/),g=navigator.userAgent.match(/Edge\//);v(g||!y||parseInt(y[1],10)>=43)}}).catch(function(){return!1})}function H(d){return typeof R=="boolean"?m.resolve(R):F(d).then(function(v){return R=v,R})}function U(d){var v=k[d.name],f={};f.promise=new m(function(_,y){f.resolve=_,f.reject=y}),v.deferredOperations.push(f),v.dbReady?v.dbReady=v.dbReady.then(function(){return f.promise}):v.dbReady=f.promise}function M(d){var v=k[d.name],f=v.deferredOperations.pop();if(f)return f.resolve(),f.promise}function G(d,v){var f=k[d.name],_=f.deferredOperations.pop();if(_)return _.reject(v),_.promise}function K(d,v){return new m(function(f,_){if(k[d.name]=k[d.name]||Cs(),d.db)if(v)U(d),d.db.close();else return f(d.db);var y=[d.name];v&&y.push(d.version);var g=c.open.apply(c,y);v&&(g.onupgradeneeded=function(C){var O=g.result;try{O.createObjectStore(d.storeName),C.oldVersion<=1&&O.createObjectStore(b)}catch(T){if(T.name==="ConstraintError")console.warn('The database "'+d.name+'" has been upgraded from version '+C.oldVersion+" to version "+C.newVersion+', but the storage "'+d.storeName+'" already exists.');else throw T}}),g.onerror=function(C){C.preventDefault(),_(g.error)},g.onsuccess=function(){var C=g.result;C.onversionchange=function(O){O.target.close()},f(C),M(d)}})}function Y(d){return K(d,!1)}function Ue(d){return K(d,!0)}function Rt(d,v){if(!d.db)return!0;var f=!d.db.objectStoreNames.contains(d.storeName),_=d.version<d.db.version,y=d.version>d.db.version;if(_&&(d.version!==v&&console.warn('The database "'+d.name+`" can't be downgraded from version `+d.db.version+" to version "+d.version+"."),d.version=d.db.version),y||f){if(f){var g=d.db.version+1;g>d.version&&(d.version=g)}return!0}return!1}function jt(d){return new m(function(v,f){var _=new FileReader;_.onerror=f,_.onloadend=function(y){var g=btoa(y.target.result||"");v({__local_forage_encoded_blob:!0,data:g,type:d.type})},_.readAsBinaryString(d)})}function Ht(d){var v=N(atob(d.data));return u([v],{type:d.type})}function Ss(d){return d&&d.__local_forage_encoded_blob}function Hu(d){var v=this,f=v._initReady().then(function(){var _=k[v._dbInfo.name];if(_&&_.dbReady)return _.dbReady});return w(f,d,d),f}function qu(d){U(d);for(var v=k[d.name],f=v.forages,_=0;_<f.length;_++){var y=f[_];y._dbInfo.db&&(y._dbInfo.db.close(),y._dbInfo.db=null)}return d.db=null,Y(d).then(function(g){return d.db=g,Rt(d)?Ue(d):g}).then(function(g){d.db=v.db=g;for(var C=0;C<f.length;C++)f[C]._dbInfo.db=g}).catch(function(g){throw G(d,g),g})}function tt(d,v,f,_){_===void 0&&(_=1);try{var y=d.db.transaction(d.storeName,v);f(null,y)}catch(g){if(_>0&&(!d.db||g.name==="InvalidStateError"||g.name==="NotFoundError"))return m.resolve().then(function(){if(!d.db||g.name==="NotFoundError"&&!d.db.objectStoreNames.contains(d.storeName)&&d.version<=d.db.version)return d.db&&(d.version=d.db.version+1),Ue(d)}).then(function(){return qu(d).then(function(){tt(d,v,f,_-1)})}).catch(f);f(g)}}function Cs(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Vu(d){var v=this,f={db:null};if(d)for(var _ in d)f[_]=d[_];var y=k[f.name];y||(y=Cs(),k[f.name]=y),y.forages.push(v),v._initReady||(v._initReady=v.ready,v.ready=Hu);var g=[];function C(){return m.resolve()}for(var O=0;O<y.forages.length;O++){var T=y.forages[O];T!==v&&g.push(T._initReady().catch(C))}var x=y.forages.slice(0);return m.all(g).then(function(){return f.db=y.db,Y(f)}).then(function(P){return f.db=P,Rt(f,v._defaultConfig.version)?Ue(f):P}).then(function(P){f.db=y.db=P,v._dbInfo=f;for(var B=0;B<x.length;B++){var $=x[B];$!==v&&($._dbInfo.db=f.db,$._dbInfo.version=f.version)}})}function $u(d,v){var f=this;d=E(d);var _=new m(function(y,g){f.ready().then(function(){tt(f._dbInfo,J,function(C,O){if(C)return g(C);try{var T=O.objectStore(f._dbInfo.storeName),x=T.get(d);x.onsuccess=function(){var P=x.result;P===void 0&&(P=null),Ss(P)&&(P=Ht(P)),y(P)},x.onerror=function(){g(x.error)}}catch(P){g(P)}})}).catch(g)});return h(_,v),_}function Ku(d,v){var f=this,_=new m(function(y,g){f.ready().then(function(){tt(f._dbInfo,J,function(C,O){if(C)return g(C);try{var T=O.objectStore(f._dbInfo.storeName),x=T.openCursor(),P=1;x.onsuccess=function(){var B=x.result;if(B){var $=B.value;Ss($)&&($=Ht($));var ee=d($,B.key,P++);ee!==void 0?y(ee):B.continue()}else y()},x.onerror=function(){g(x.error)}}catch(B){g(B)}})}).catch(g)});return h(_,v),_}function Wu(d,v,f){var _=this;d=E(d);var y=new m(function(g,C){var O;_.ready().then(function(){return O=_._dbInfo,D.call(v)==="[object Blob]"?H(O.db).then(function(T){return T?v:jt(v)}):v}).then(function(T){tt(_._dbInfo,S,function(x,P){if(x)return C(x);try{var B=P.objectStore(_._dbInfo.storeName);T===null&&(T=void 0);var $=B.put(T,d);P.oncomplete=function(){T===void 0&&(T=null),g(T)},P.onabort=P.onerror=function(){var ee=$.error?$.error:$.transaction.error;C(ee)}}catch(ee){C(ee)}})}).catch(C)});return h(y,f),y}function zu(d,v){var f=this;d=E(d);var _=new m(function(y,g){f.ready().then(function(){tt(f._dbInfo,S,function(C,O){if(C)return g(C);try{var T=O.objectStore(f._dbInfo.storeName),x=T.delete(d);O.oncomplete=function(){y()},O.onerror=function(){g(x.error)},O.onabort=function(){var P=x.error?x.error:x.transaction.error;g(P)}}catch(P){g(P)}})}).catch(g)});return h(_,v),_}function Yu(d){var v=this,f=new m(function(_,y){v.ready().then(function(){tt(v._dbInfo,S,function(g,C){if(g)return y(g);try{var O=C.objectStore(v._dbInfo.storeName),T=O.clear();C.oncomplete=function(){_()},C.onabort=C.onerror=function(){var x=T.error?T.error:T.transaction.error;y(x)}}catch(x){y(x)}})}).catch(y)});return h(f,d),f}function Xu(d){var v=this,f=new m(function(_,y){v.ready().then(function(){tt(v._dbInfo,J,function(g,C){if(g)return y(g);try{var O=C.objectStore(v._dbInfo.storeName),T=O.count();T.onsuccess=function(){_(T.result)},T.onerror=function(){y(T.error)}}catch(x){y(x)}})}).catch(y)});return h(f,d),f}function Qu(d,v){var f=this,_=new m(function(y,g){if(d<0){y(null);return}f.ready().then(function(){tt(f._dbInfo,J,function(C,O){if(C)return g(C);try{var T=O.objectStore(f._dbInfo.storeName),x=!1,P=T.openKeyCursor();P.onsuccess=function(){var B=P.result;if(!B){y(null);return}d===0||x?y(B.key):(x=!0,B.advance(d))},P.onerror=function(){g(P.error)}}catch(B){g(B)}})}).catch(g)});return h(_,v),_}function Zu(d){var v=this,f=new m(function(_,y){v.ready().then(function(){tt(v._dbInfo,J,function(g,C){if(g)return y(g);try{var O=C.objectStore(v._dbInfo.storeName),T=O.openKeyCursor(),x=[];T.onsuccess=function(){var P=T.result;if(!P){_(x);return}x.push(P.key),P.continue()},T.onerror=function(){y(T.error)}}catch(P){y(P)}})}).catch(y)});return h(f,d),f}function ef(d,v){v=I.apply(this,arguments);var f=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||f.name,d.storeName=d.storeName||f.storeName);var _=this,y;if(!d.name)y=m.reject("Invalid arguments");else{var g=d.name===f.name&&_._dbInfo.db,C=g?m.resolve(_._dbInfo.db):Y(d).then(function(O){var T=k[d.name],x=T.forages;T.db=O;for(var P=0;P<x.length;P++)x[P]._dbInfo.db=O;return O});d.storeName?y=C.then(function(O){if(O.objectStoreNames.contains(d.storeName)){var T=O.version+1;U(d);var x=k[d.name],P=x.forages;O.close();for(var B=0;B<P.length;B++){var $=P[B];$._dbInfo.db=null,$._dbInfo.version=T}var ee=new m(function(te,fe){var de=c.open(d.name,T);de.onerror=function(He){var vr=de.result;vr.close(),fe(He)},de.onupgradeneeded=function(){var He=de.result;He.deleteObjectStore(d.storeName)},de.onsuccess=function(){var He=de.result;He.close(),te(He)}});return ee.then(function(te){x.db=te;for(var fe=0;fe<P.length;fe++){var de=P[fe];de._dbInfo.db=te,M(de._dbInfo)}}).catch(function(te){throw(G(d,te)||m.resolve()).catch(function(){}),te})}}):y=C.then(function(O){U(d);var T=k[d.name],x=T.forages;O.close();for(var P=0;P<x.length;P++){var B=x[P];B._dbInfo.db=null}var $=new m(function(ee,te){var fe=c.deleteDatabase(d.name);fe.onerror=function(){var de=fe.result;de&&de.close(),te(fe.error)},fe.onblocked=function(){console.warn('dropInstance blocked for database "'+d.name+'" until all open connections are closed')},fe.onsuccess=function(){var de=fe.result;de&&de.close(),ee(de)}});return $.then(function(ee){T.db=ee;for(var te=0;te<x.length;te++){var fe=x[te];M(fe._dbInfo)}}).catch(function(ee){throw(G(d,ee)||m.resolve()).catch(function(){}),ee})})}return h(y,v),y}var tf={_driver:"asyncStorage",_initStorage:Vu,_support:p(),iterate:Ku,getItem:$u,setItem:Wu,removeItem:zu,clear:Yu,length:Xu,key:Qu,keys:Zu,dropInstance:ef};function rf(){return typeof openDatabase=="function"}var _t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nf="~~local_forage_type~",Rs=/^~~local_forage_type~([^~]+)~/,tn="__lfsc__:",Gi=tn.length,Ji="arbf",Fi="blob",Os="si08",ks="ui08",Ts="uic8",xs="si16",Ps="si32",Ns="ur16",Ds="ui32",Ls="fl32",Us="fl64",Bs=Gi+Ji.length,Ms=Object.prototype.toString;function Gs(d){var v=d.length*.75,f=d.length,_,y=0,g,C,O,T;d[d.length-1]==="="&&(v--,d[d.length-2]==="="&&v--);var x=new ArrayBuffer(v),P=new Uint8Array(x);for(_=0;_<f;_+=4)g=_t.indexOf(d[_]),C=_t.indexOf(d[_+1]),O=_t.indexOf(d[_+2]),T=_t.indexOf(d[_+3]),P[y++]=g<<2|C>>4,P[y++]=(C&15)<<4|O>>2,P[y++]=(O&3)<<6|T&63;return x}function ji(d){var v=new Uint8Array(d),f="",_;for(_=0;_<v.length;_+=3)f+=_t[v[_]>>2],f+=_t[(v[_]&3)<<4|v[_+1]>>4],f+=_t[(v[_+1]&15)<<2|v[_+2]>>6],f+=_t[v[_+2]&63];return v.length%3===2?f=f.substring(0,f.length-1)+"=":v.length%3===1&&(f=f.substring(0,f.length-2)+"=="),f}function af(d,v){var f="";if(d&&(f=Ms.call(d)),d&&(f==="[object ArrayBuffer]"||d.buffer&&Ms.call(d.buffer)==="[object ArrayBuffer]")){var _,y=tn;d instanceof ArrayBuffer?(_=d,y+=Ji):(_=d.buffer,f==="[object Int8Array]"?y+=Os:f==="[object Uint8Array]"?y+=ks:f==="[object Uint8ClampedArray]"?y+=Ts:f==="[object Int16Array]"?y+=xs:f==="[object Uint16Array]"?y+=Ns:f==="[object Int32Array]"?y+=Ps:f==="[object Uint32Array]"?y+=Ds:f==="[object Float32Array]"?y+=Ls:f==="[object Float64Array]"?y+=Us:v(new Error("Failed to get type for BinaryArray"))),v(y+ji(_))}else if(f==="[object Blob]"){var g=new FileReader;g.onload=function(){var C=nf+d.type+"~"+ji(this.result);v(tn+Fi+C)},g.readAsArrayBuffer(d)}else try{v(JSON.stringify(d))}catch(C){console.error("Couldn't convert value into a JSON string: ",d),v(null,C)}}function of(d){if(d.substring(0,Gi)!==tn)return JSON.parse(d);var v=d.substring(Bs),f=d.substring(Gi,Bs),_;if(f===Fi&&Rs.test(v)){var y=v.match(Rs);_=y[1],v=v.substring(y[0].length)}var g=Gs(v);switch(f){case Ji:return g;case Fi:return u([g],{type:_});case Os:return new Int8Array(g);case ks:return new Uint8Array(g);case Ts:return new Uint8ClampedArray(g);case xs:return new Int16Array(g);case Ns:return new Uint16Array(g);case Ps:return new Int32Array(g);case Ds:return new Uint32Array(g);case Ls:return new Float32Array(g);case Us:return new Float64Array(g);default:throw new Error("Unkown type: "+f)}}var Hi={serialize:af,deserialize:of,stringToBuffer:Gs,bufferToString:ji};function Js(d,v,f,_){d.executeSql("CREATE TABLE IF NOT EXISTS "+v.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],f,_)}function sf(d){var v=this,f={db:null};if(d)for(var _ in d)f[_]=typeof d[_]!="string"?d[_].toString():d[_];var y=new m(function(g,C){try{f.db=openDatabase(f.name,String(f.version),f.description,f.size)}catch(O){return C(O)}f.db.transaction(function(O){Js(O,f,function(){v._dbInfo=f,g()},function(T,x){C(x)})},C)});return f.serializer=Hi,y}function yt(d,v,f,_,y,g){d.executeSql(f,_,y,function(C,O){O.code===O.SYNTAX_ERR?C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[v.storeName],function(T,x){x.rows.length?g(T,O):Js(T,v,function(){T.executeSql(f,_,y,g)},g)},g):g(C,O)},g)}function lf(d,v){var f=this;d=E(d);var _=new m(function(y,g){f.ready().then(function(){var C=f._dbInfo;C.db.transaction(function(O){yt(O,C,"SELECT * FROM "+C.storeName+" WHERE key = ? LIMIT 1",[d],function(T,x){var P=x.rows.length?x.rows.item(0).value:null;P&&(P=C.serializer.deserialize(P)),y(P)},function(T,x){g(x)})})}).catch(g)});return h(_,v),_}function cf(d,v){var f=this,_=new m(function(y,g){f.ready().then(function(){var C=f._dbInfo;C.db.transaction(function(O){yt(O,C,"SELECT * FROM "+C.storeName,[],function(T,x){for(var P=x.rows,B=P.length,$=0;$<B;$++){var ee=P.item($),te=ee.value;if(te&&(te=C.serializer.deserialize(te)),te=d(te,ee.key,$+1),te!==void 0){y(te);return}}y()},function(T,x){g(x)})})}).catch(g)});return h(_,v),_}function Fs(d,v,f,_){var y=this;d=E(d);var g=new m(function(C,O){y.ready().then(function(){v===void 0&&(v=null);var T=v,x=y._dbInfo;x.serializer.serialize(v,function(P,B){B?O(B):x.db.transaction(function($){yt($,x,"INSERT OR REPLACE INTO "+x.storeName+" (key, value) VALUES (?, ?)",[d,P],function(){C(T)},function(ee,te){O(te)})},function($){if($.code===$.QUOTA_ERR){if(_>0){C(Fs.apply(y,[d,T,f,_-1]));return}O($)}})})}).catch(O)});return h(g,f),g}function df(d,v,f){return Fs.apply(this,[d,v,f,1])}function uf(d,v){var f=this;d=E(d);var _=new m(function(y,g){f.ready().then(function(){var C=f._dbInfo;C.db.transaction(function(O){yt(O,C,"DELETE FROM "+C.storeName+" WHERE key = ?",[d],function(){y()},function(T,x){g(x)})})}).catch(g)});return h(_,v),_}function ff(d){var v=this,f=new m(function(_,y){v.ready().then(function(){var g=v._dbInfo;g.db.transaction(function(C){yt(C,g,"DELETE FROM "+g.storeName,[],function(){_()},function(O,T){y(T)})})}).catch(y)});return h(f,d),f}function hf(d){var v=this,f=new m(function(_,y){v.ready().then(function(){var g=v._dbInfo;g.db.transaction(function(C){yt(C,g,"SELECT COUNT(key) as c FROM "+g.storeName,[],function(O,T){var x=T.rows.item(0).c;_(x)},function(O,T){y(T)})})}).catch(y)});return h(f,d),f}function mf(d,v){var f=this,_=new m(function(y,g){f.ready().then(function(){var C=f._dbInfo;C.db.transaction(function(O){yt(O,C,"SELECT key FROM "+C.storeName+" WHERE id = ? LIMIT 1",[d+1],function(T,x){var P=x.rows.length?x.rows.item(0).key:null;y(P)},function(T,x){g(x)})})}).catch(g)});return h(_,v),_}function pf(d){var v=this,f=new m(function(_,y){v.ready().then(function(){var g=v._dbInfo;g.db.transaction(function(C){yt(C,g,"SELECT key FROM "+g.storeName,[],function(O,T){for(var x=[],P=0;P<T.rows.length;P++)x.push(T.rows.item(P).key);_(x)},function(O,T){y(T)})})}).catch(y)});return h(f,d),f}function vf(d){return new m(function(v,f){d.transaction(function(_){_.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(y,g){for(var C=[],O=0;O<g.rows.length;O++)C.push(g.rows.item(O).name);v({db:d,storeNames:C})},function(y,g){f(g)})},function(_){f(_)})})}function gf(d,v){v=I.apply(this,arguments);var f=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||f.name,d.storeName=d.storeName||f.storeName);var _=this,y;return d.name?y=new m(function(g){var C;d.name===f.name?C=_._dbInfo.db:C=openDatabase(d.name,"","",0),d.storeName?g({db:C,storeNames:[d.storeName]}):g(vf(C))}).then(function(g){return new m(function(C,O){g.db.transaction(function(T){function x(ee){return new m(function(te,fe){T.executeSql("DROP TABLE IF EXISTS "+ee,[],function(){te()},function(de,He){fe(He)})})}for(var P=[],B=0,$=g.storeNames.length;B<$;B++)P.push(x(g.storeNames[B]));m.all(P).then(function(){C()}).catch(function(ee){O(ee)})},function(T){O(T)})})}):y=m.reject("Invalid arguments"),h(y,v),y}var _f={_driver:"webSQLStorage",_initStorage:sf,_support:rf(),iterate:cf,getItem:lf,setItem:df,removeItem:uf,clear:ff,length:hf,key:mf,keys:pf,dropInstance:gf};function yf(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(d){return!1}}function js(d,v){var f=d.name+"/";return d.storeName!==v.storeName&&(f+=d.storeName+"/"),f}function bf(){var d="_localforage_support_test";try{return localStorage.setItem(d,!0),localStorage.removeItem(d),!1}catch(v){return!0}}function wf(){return!bf()||localStorage.length>0}function Ef(d){var v=this,f={};if(d)for(var _ in d)f[_]=d[_];return f.keyPrefix=js(d,v._defaultConfig),wf()?(v._dbInfo=f,f.serializer=Hi,m.resolve()):m.reject()}function If(d){var v=this,f=v.ready().then(function(){for(var _=v._dbInfo.keyPrefix,y=localStorage.length-1;y>=0;y--){var g=localStorage.key(y);g.indexOf(_)===0&&localStorage.removeItem(g)}});return h(f,d),f}function Af(d,v){var f=this;d=E(d);var _=f.ready().then(function(){var y=f._dbInfo,g=localStorage.getItem(y.keyPrefix+d);return g&&(g=y.serializer.deserialize(g)),g});return h(_,v),_}function Sf(d,v){var f=this,_=f.ready().then(function(){for(var y=f._dbInfo,g=y.keyPrefix,C=g.length,O=localStorage.length,T=1,x=0;x<O;x++){var P=localStorage.key(x);if(P.indexOf(g)===0){var B=localStorage.getItem(P);if(B&&(B=y.serializer.deserialize(B)),B=d(B,P.substring(C),T++),B!==void 0)return B}}});return h(_,v),_}function Cf(d,v){var f=this,_=f.ready().then(function(){var y=f._dbInfo,g;try{g=localStorage.key(d)}catch(C){g=null}return g&&(g=g.substring(y.keyPrefix.length)),g});return h(_,v),_}function Rf(d){var v=this,f=v.ready().then(function(){for(var _=v._dbInfo,y=localStorage.length,g=[],C=0;C<y;C++){var O=localStorage.key(C);O.indexOf(_.keyPrefix)===0&&g.push(O.substring(_.keyPrefix.length))}return g});return h(f,d),f}function Of(d){var v=this,f=v.keys().then(function(_){return _.length});return h(f,d),f}function kf(d,v){var f=this;d=E(d);var _=f.ready().then(function(){var y=f._dbInfo;localStorage.removeItem(y.keyPrefix+d)});return h(_,v),_}function Tf(d,v,f){var _=this;d=E(d);var y=_.ready().then(function(){v===void 0&&(v=null);var g=v;return new m(function(C,O){var T=_._dbInfo;T.serializer.serialize(v,function(x,P){if(P)O(P);else try{localStorage.setItem(T.keyPrefix+d,x),C(g)}catch(B){(B.name==="QuotaExceededError"||B.name==="NS_ERROR_DOM_QUOTA_REACHED")&&O(B),O(B)}})})});return h(y,f),y}function xf(d,v){if(v=I.apply(this,arguments),d=typeof d!="function"&&d||{},!d.name){var f=this.config();d.name=d.name||f.name,d.storeName=d.storeName||f.storeName}var _=this,y;return d.name?y=new m(function(g){d.storeName?g(js(d,_._defaultConfig)):g(d.name+"/")}).then(function(g){for(var C=localStorage.length-1;C>=0;C--){var O=localStorage.key(C);O.indexOf(g)===0&&localStorage.removeItem(O)}}):y=m.reject("Invalid arguments"),h(y,v),y}var Pf={_driver:"localStorageWrapper",_initStorage:Ef,_support:yf(),iterate:Sf,getItem:Af,setItem:Tf,removeItem:kf,clear:If,length:Of,key:Cf,keys:Rf,dropInstance:xf},Nf=function(v,f){return v===f||typeof v=="number"&&typeof f=="number"&&isNaN(v)&&isNaN(f)},Df=function(v,f){for(var _=v.length,y=0;y<_;){if(Nf(v[y],f))return!0;y++}return!1},Hs=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"},pr={},qs={},qt={INDEXEDDB:tf,WEBSQL:_f,LOCALSTORAGE:Pf},Lf=[qt.INDEXEDDB._driver,qt.WEBSQL._driver,qt.LOCALSTORAGE._driver],rn=["dropInstance"],qi=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(rn),Uf={description:"",driver:Lf.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Bf(d,v){d[v]=function(){var f=arguments;return d.ready().then(function(){return d[v].apply(d,f)})}}function Vi(){for(var d=1;d<arguments.length;d++){var v=arguments[d];if(v)for(var f in v)v.hasOwnProperty(f)&&(Hs(v[f])?arguments[0][f]=v[f].slice():arguments[0][f]=v[f])}return arguments[0]}var Mf=function(){function d(v){s(this,d);for(var f in qt)if(qt.hasOwnProperty(f)){var _=qt[f],y=_._driver;this[f]=y,pr[y]||this.defineDriver(_)}this._defaultConfig=Vi({},Uf),this._config=Vi({},this._defaultConfig,v),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return d.prototype.config=function(f){if((typeof f=="undefined"?"undefined":o(f))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var _ in f){if(_==="storeName"&&(f[_]=f[_].replace(/\W/g,"_")),_==="version"&&typeof f[_]!="number")return new Error("Database version must be a number.");this._config[_]=f[_]}return"driver"in f&&f.driver?this.setDriver(this._config.driver):!0}else return typeof f=="string"?this._config[f]:this._config},d.prototype.defineDriver=function(f,_,y){var g=new m(function(C,O){try{var T=f._driver,x=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!f._driver){O(x);return}for(var P=qi.concat("_initStorage"),B=0,$=P.length;B<$;B++){var ee=P[B],te=!Df(rn,ee);if((te||f[ee])&&typeof f[ee]!="function"){O(x);return}}var fe=function(){for(var vr=function(Ff){return function(){var jf=new Error("Method "+Ff+" is not implemented by the current driver"),Vs=m.reject(jf);return h(Vs,arguments[arguments.length-1]),Vs}},$i=0,Jf=rn.length;$i<Jf;$i++){var Ki=rn[$i];f[Ki]||(f[Ki]=vr(Ki))}};fe();var de=function(vr){pr[T]&&console.info("Redefining LocalForage driver: "+T),pr[T]=f,qs[T]=vr,C()};"_support"in f?f._support&&typeof f._support=="function"?f._support().then(de,O):de(!!f._support):de(!0)}catch(He){O(He)}});return w(g,_,y),g},d.prototype.driver=function(){return this._driver||null},d.prototype.getDriver=function(f,_,y){var g=pr[f]?m.resolve(pr[f]):m.reject(new Error("Driver not found."));return w(g,_,y),g},d.prototype.getSerializer=function(f){var _=m.resolve(Hi);return w(_,f),_},d.prototype.ready=function(f){var _=this,y=_._driverSet.then(function(){return _._ready===null&&(_._ready=_._initDriver()),_._ready});return w(y,f,f),y},d.prototype.setDriver=function(f,_,y){var g=this;Hs(f)||(f=[f]);var C=this._getSupportedDrivers(f);function O(){g._config.driver=g.driver()}function T(B){return g._extend(B),O(),g._ready=g._initStorage(g._config),g._ready}function x(B){return function(){var $=0;function ee(){for(;$<B.length;){var te=B[$];return $++,g._dbInfo=null,g._ready=null,g.getDriver(te).then(T).catch(ee)}O();var fe=new Error("No available storage method found.");return g._driverSet=m.reject(fe),g._driverSet}return ee()}}var P=this._driverSet!==null?this._driverSet.catch(function(){return m.resolve()}):m.resolve();return this._driverSet=P.then(function(){var B=C[0];return g._dbInfo=null,g._ready=null,g.getDriver(B).then(function($){g._driver=$._driver,O(),g._wrapLibraryMethodsWithReady(),g._initDriver=x(C)})}).catch(function(){O();var B=new Error("No available storage method found.");return g._driverSet=m.reject(B),g._driverSet}),w(this._driverSet,_,y),this._driverSet},d.prototype.supports=function(f){return!!qs[f]},d.prototype._extend=function(f){Vi(this,f)},d.prototype._getSupportedDrivers=function(f){for(var _=[],y=0,g=f.length;y<g;y++){var C=f[y];this.supports(C)&&_.push(C)}return _},d.prototype._wrapLibraryMethodsWithReady=function(){for(var f=0,_=qi.length;f<_;f++)Bf(this,qi[f])},d.prototype.createInstance=function(f){return new d(f)},d}(),Gf=new Mf;i.exports=Gf},{3:3}]},{},[4])(4)})});var Zl=Yi(Bn=>{"use strict";q();Er();wt();var Ja=(e,t)=>{window.parent&&window.parent.postMessage({type:e,data:t},"*")},Fa=we(),lm=ot("levelFinished",{paramsSchema:V.tuple(V.object({levelId:V.or(V.string(),V.number()),duration:V.number().optional(),rating:V.number().optional(),score:V.number().optional(),variation:V.string().optional()})),implement:e=>A(Bn,null,function*(){let{levelId:t,duration:r,rating:n,score:i,variation:a}=e;Be.info("onLevelFinished",r,n,i,a),Ja("JOLIBOX_GAME_TASK_LEVEL_FINISHED",{levelId:t,duration:r,rating:n,score:i,variation:a}),yield Promise.all([it.reporter({event:"COMPLETE_GAME_LEVEL",extraParams:{inGameInfo:{levelId:t,duration:r,rating:n,score:i}}}),it.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i,variation:a})])})}),cm=ot("gamePlayEnded",{paramsSchema:V.tuple(V.object({duration:V.number().optional(),rating:V.number().optional(),score:V.number(),variation:V.string().optional()})),implement:e=>A(Bn,null,function*(){let{duration:t,rating:r,score:n,variation:i}=e;Be.info("onGamePlayEnded",t,r,n,i),Ja("JOLIBOX_GAME_TASK_GAME_PLAY_ENDED",{duration:t,rating:r,score:n,variation:i}),yield Promise.all([it.tracker("GamePlayEnded",{duration:t,rating:r,score:n,variation:i}),it.reporter({event:"GAME_ENDED",extraParams:{inGameInfo:{duration:t,rating:r,score:n}}})])})}),dm=ot("levelUpgrade",{paramsSchema:V.tuple(V.object({levelId:V.or(V.string(),V.number()),name:V.string().optional()})),implement:r=>A(Bn,[r],function*({levelId:e,name:t}){Be.info("onLevelUpgrade",e,t),Ja("JOLIBOX_GAME_TASK_LEVEL_UPGRADE",{levelId:e,name:t}),yield Promise.all([it.tracker("LevelUpgrade",{name:t,levelId:e}),it.reporter({event:"GAME_LEVEL_UP",extraParams:{inGameInfo:{levelId:e,levelName:t}}})])})});Fa.registerCommand("TaskTrackerSDK.levelFinished",lm);Fa.registerCommand("TaskTrackerSDK.gamePlayEnded",cm);Fa.registerCommand("TaskTrackerSDK.levelUpgrade",dm);Ee("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});Ee("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});Ee("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var Ge,Yt,ec,ja,um,Nt,Ar=re(()=>{"use strict";Ge=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},Yt=new Map,ec=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=Yt.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)}},ja=!1,um=()=>{ja||(window.addEventListener("message",ec),ja=!0)},Nt=(e,t)=>{um(),Yt.has(e)||Yt.set(e,new Set);let r=Yt.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&Yt.delete(e),Yt.size===0&&(window.removeEventListener("message",ec),ja=!1)}}});var Mn,Gn,Jn,Fn,jn,Ha,Hn,qn,Vn,$n,Xt,fm,ne,st,lt,Pe=re(()=>{"use strict";q();Mn="UNLOCK_OPTIONS_CHANGED",Gn="INVOKE_PAYMENT",Jn="ON_PAYMENT_RESULT",Fn="ON_USE_MODAL_EVENT",jn="ON_USE_MODAL_RESULT",Ha="ON_USE_MODAL_FREQUENCY",Hn="ON_USE_UNLOGIN_MODAL_EVENT",qn="INVOKE_UNLOGIN_MODAL_EVENT",Vn="INVOKE_SUBSCRIPTION_EVENT",$n="ON_USE_SUBSCRIPTION_RESULT",Xt=new ze,fm=()=>({on:Xt.on.bind(Xt),off:Xt.off.bind(Xt),emit:Xt.emit.bind(Xt)}),ne=fm(),st={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},joinMember:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}},lt={show:!0,minInterval:8*60*60*1e3}});var Eu=Yi(Ni=>{"use strict";he();Pe();Ar();q();var wu={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};Nt("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",wu[e.result],e.result),ne.emit(jn,{useModalResult:wu[e.result]})});ne.on(Fn,(e,t)=>{var r;e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||Ge("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.quantity,balance:t.userCurrency.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:$e()})});Nt("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{ne.emit(Jn,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin,currency:"JOLI_COIN"})});ne.on(Gn,(e,t)=>A(Ni,null,function*(){var r;e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||Ge("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.quantity,balance:t.userCurrency.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:$e()})}));Nt("ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT",e=>{var t,r,n,i,a;ne.emit(Hn,{result:e.result=="ADS"?"FAILED":e.result,rewards:{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:(a=e.isFirstLogin)!=null?a:!1}}),e.result==="SUCCESS"&&L.onEnvConfigChanged({hostUserInfo:{isLogin:!0}})});ne.on(qn,e=>A(Ni,null,function*(){e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||Ge("JOLIBOX_JOLI_UNLOGIN_MODAL_EVENT",{sequenceId:$e(),type:e})}));Nt("ON_JOLIBOX_SUB_RESULT_EVENT",e=>{console.log("----on custom event ON_JOLIBOX_SUB_RESULT_EVENT-----",e),ne.emit($n,{result:e.result})});ne.on(Vn,e=>A(Ni,null,function*(){console.log("----notify custom event-----",e),Ge("JOLIBOX_SUB_EVENT",{sequenceId:$e()})}))});wt();he();Er();q();var Wl=we(),$h="env",Kh="getSystemInfoSync",Wh=()=>{var i,a,o,s;let e={system:L.deviceInfo.system,platform:L.deviceInfo.platform.toLowerCase(),brand:L.deviceInfo.brand,pixelRatio:L.deviceInfo.pixelRatio,language:L.deviceInfo.lang,version:L.sdkInfo.jssdkVersion,appName:(i=L.hostInfo)==null?void 0:i.appName,SDKVersion:L.sdkInfo.nativeSDKVersion},t=(a=L.hostInfo)==null?void 0:a.version;t&&(e=Re(z({},e),{version:t}));let r=(o=L.hostInfo)==null?void 0:o.appName;r&&(e=Re(z({},e),{appName:r}));let n=(s=L.sdkInfo)==null?void 0:s.jssdkVersion;return n&&(e=Re(z({},e),{SDKVersion:n})),e},zh=Pt(Kh,{implement:Wh}),Yh=Pt($h,{implement:()=>Re(z({},L.hostInfo),{sdkInfo:L.sdkInfo,platform:L.platform,deviceInfo:L.deviceInfo})});Wl.registerCommand("API.env",Yh);Wl.registerCommand("API.getSystemInfoSync",zh);Ee("env",{version:"1.0.0"});Ee("getSystemInfoSync",{version:"1.0.0"});q();Er();rt();wt();var Xh="onJoliboxShow",Qh="onJoliboxHide",Zh="onReady",Ua=we(),Ba=ul(Me),La=!0,Ir=!0,Nn=0,Dn=Oa;function em(){let e=Date.now();if(e-Nn<100)return;Nn=e;let t=document.visibilityState==="visible";t!==La&&(La=t,Dn.emit("visible",La))}function zl(e){let t=Date.now();t-Nn<100||(Nn=t,e==="focus"&&!Ir?Ir=!0:e==="blur"&&Ir&&(Ir=!1),Dn.emit("visible",Ir))}document.addEventListener("visibilitychange",em);window.addEventListener("focus",()=>zl("focus"));window.addEventListener("blur",()=>zl("blur"));var tm=Pt(Xh,{paramsSchema:V.tuple(V.function()),implement(e){let t=Ba(e);Dn.on("visible",r=>{r&&t()})}}),rm=Pt(Qh,{paramsSchema:V.tuple(V.function()),implement(e){let t=Ba(e);Dn.on("visible",r=>{!r&&t()})}}),nm=Pt(Zh,{paramsSchema:V.tuple(V.function()),implement(e){let t=Ba(e);bt.on("LifecycleEvent.onReady",r=>{t(r)})}});Ua.registerCommand("LifecycleSDK.onReady",nm);Ua.registerCommand("LifecycleSDK.onJoliboxShow",tm);Ua.registerCommand("LifecycleSDK.onJoliboxHide",rm);Ee("lifeCycle.onReady",{version:"1.0.0"});Ee("lifeCycle.onJoliboxShow",{version:"1.0.0"});Ee("lifeCycle.onJoliboxHide",{version:"1.0.0"});Er();q();Wt();he();var Ql=Xi(Xl());var Ln=we(),Ga=class{constructor(){this.httpClient=Ke.create({baseUrl:Kt(L.testMode)});this.getGameId=()=>L.mpId;this.getItem=t=>A(this,null,function*(){let{code:r,data:n,message:i}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),a=n==null?void 0:n.value,o=i;return r!=="SUCCESS"&&(a=yield this.gameStore.getItem(t),console.info("[SDK] cloud storage getItem failed, read from localstorage",a),o+="fallback to localstorage"),{code:r,message:o,data:a&&a!=="undefined"?a:null}});this.setItem=(t,r)=>A(this,null,function*(){let n=typeof r=="string"?r:String(r),{code:i,message:a}=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:a}});this.removeItem=t=>A(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=()=>A(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=Ql.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},Un=new Ga,im=ot("getLocalStorage",{paramsSchema:V.tuple(V.string()),implement(e){return A(this,null,function*(){return yield Un.getItem(e)})}});Ln.registerCommand("StorageSDK.getItem",im);Ee("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var am=ot("setStorage",{paramsSchema:V.tuple(V.string(),V.or(V.string(),V.boolean(),V.number())),implement(e,t){return A(this,null,function*(){return yield Un.setItem(e,t)})}});Ln.registerCommand("StorageSDK.setItem",am);Ee("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var om=ot("removeStorage",{paramsSchema:V.tuple(V.string()),implement(e){return A(this,null,function*(){return yield Un.removeItem(e)})}});Ln.registerCommand("StorageSDK.removeItem",om);Ee("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var sm=ot("clearStorage",{implement(){return A(this,null,function*(){return yield Un.clear()})}});Ln.registerCommand("StorageSDK.clear",sm);Ee("storage.clear",{version:"1.0.0"});var IC=Xi(Zl());wt();q();Wt();Ar();he();Pe();var tc=L.testMode;function rc(){let e=new Map,t,r;return{registerRewardHandler(i,a){e.set(i,a)},handleReward(i,...a){return A(this,null,function*(){return yield i.reduce((s,l)=>A(this,null,function*(){let c=yield s;if(c===!0)return!0;tc&&console.log(`handleReward ${l}`);let p=e.get(l),u=p?yield p(...a):c;return tc&&console.log(`handleReward ${l} ${u}`),u}),Promise.resolve(!1))})},registerRewardsFetcher(i){return A(this,null,function*(){t=(...a)=>A(this,null,function*(){try{return yield i(...a)}catch(o){return console.error("getRewardOptions error:",o),["ADS"]}})})},registerRewardFrequencyConfigFetcher(i){return A(this,null,function*(){r=(...a)=>A(this,null,function*(){try{return yield i(...a)}catch(o){return console.error("getRewardOptions error:",o),{joliCoinUseAndCharge:st,loginGuide:lt}}})})},getRewardsTypes(...i){return A(this,null,function*(){return t?yield t(...i):["ADS"]})},getRewardFrequencyConfig(...i){return A(this,null,function*(){return r?yield r(...i):{joliCoinUseAndCharge:st,loginGuide:lt}})}}}q();var qa=class{constructor(t){this.httpClient=t}execute(t,r){return A(this,null,function*(){let n=(r==null?void 0:r.method)||"POST",i=(r==null?void 0:r.body)||{};return n==="GET"?yield this.httpClient.get(t,i):yield this.httpClient.post(t,i)})}extractCacheableData(t){var r,n,i;return{unlockOptions:((r=t.data)==null?void 0:r.unlockOptions)||[],joliCoin:((n=t.extra)==null?void 0:n.joliCoin)||{balance:0,enableAutoDeduct:!1},joliGem:((i=t.extra)==null?void 0:i.joliGem)||{balance:0,enableAutoDeduct:!1}}}mergeData(t,r){return{code:"SUCCESS",message:"success",data:{unlockOptions:t.unlockOptions},extra:{joliCoin:t.joliCoin||{balance:0,enableAutoDeduct:!1},joliGem:t.joliGem||{balance:0,enableAutoDeduct:!1}}}}processCachedData(t){return{code:"SUCCESS",message:"success from cache",data:{unlockOptions:t.unlockOptions},extra:{joliCoin:t.joliCoin,joliGem:t.joliGem}}}},Va=class{constructor(t){this.httpClient=t}execute(t,r){return A(this,null,function*(){let n=(r==null?void 0:r.method)||"GET",i=(r==null?void 0:r.body)||{};return n==="GET"?yield this.httpClient.get(t,i):yield this.httpClient.post(t,i)})}extractCacheableData(t){let r=t.data;return z({joliCoinUseAndCharge:r==null?void 0:r.joliCoinUseAndCharge,loginGuide:r==null?void 0:r.loginGuide},r)}processCachedData(t){return{code:"SUCCESS",message:"success from cache",data:t}}},Kn=class{constructor(t){this.unlockOptionsService=new Tt(new qa(t),{duration:30*60*1e3,timeout:1e3,keyGenerator:r=>r,consistencyChecker:(r,n)=>r.unlockOptions.length!==n.unlockOptions.length?!1:r.unlockOptions.every((i,a)=>{var s,l;let o=n.unlockOptions[a];return i.type===o.type&&((s=i.joliGemChoice)==null?void 0:s.joliGemQuantity)===((l=o.joliGemChoice)==null?void 0:l.joliGemQuantity)})}),this.globalConfigService=new Tt(new Va(t),{duration:60*60*1e3,timeout:1e3,keyGenerator:r=>r})}getUnlockOptions(){return A(this,arguments,function*(t={}){return yield this.unlockOptionsService.request("/api/games/unlock-options",{endpoint:"/api/games/unlock-options",body:t,method:"POST"})})}getGlobalConfig(){return A(this,null,function*(){return yield this.globalConfigService.request("/api/fe-configs/web-common/global-config",{endpoint:"/api/fe-configs/web-common/global-config",method:"GET"})})}refreshUnlockOptions(){return A(this,arguments,function*(t={}){return yield this.unlockOptionsService.forceRequest("/api/games/unlock-options",{endpoint:"/api/games/unlock-options",body:t,method:"POST"})})}refreshGlobalConfig(){return A(this,null,function*(){return yield this.globalConfigService.forceRequest("/api/fe-configs/web-common/global-config",{endpoint:"/api/fe-configs/web-common/global-config",method:"GET"})})}warmupCache(){return A(this,null,function*(){yield Promise.all([this.unlockOptionsService.warmupCache("/api/games/unlock-options",{endpoint:"/api/games/unlock-options",method:"POST"}),this.globalConfigService.warmupCache("/api/fe-configs/web-common/global-config",{endpoint:"/api/fe-configs/web-common/global-config",method:"GET"})])})}clearAllCache(){this.unlockOptionsService.clearCache(),this.globalConfigService.clearCache()}getCacheStats(){return{unlockOptions:this.unlockOptionsService.getCacheStats(),globalConfig:this.globalConfigService.getCacheStats()}}clearExpiredCache(){this.unlockOptionsService.clearExpiredCache(),this.globalConfigService.clearExpiredCache()}};Pe();q();var hm=()=>(e,t)=>{let r={SUBSCRIPTION:4,JOLI_GEM:3,JOLI_GEM_ONLY:3,JOLI_COIN:2,JOLI_COIN_ONLY:2,ADS:1};return r[t]-r[e]},mm=["openJolicoinGuide",{method:"getABTest",platforms:["android"],nativeVersionCode:1050100},"userTrackAsync",{method:"openMiniapp",nativeVersionCode:1050100}],pm=e=>{if(!e.length)return["ADS"];if(e.includes("JOLI_GEM")){if(e.length===1)return["JOLI_GEM_ONLY"];if(e.includes("SUBSCRIPTION")&&e.length===2)return["SUBSCRIPTION","JOLI_GEM_ONLY"]}if(e.includes("JOLI_COIN")){if(e.length===1)return["JOLI_COIN_ONLY"];if(e.includes("SUBSCRIPTION")&&e.length===2)return["SUBSCRIPTION","JOLI_COIN_ONLY"]}return e.sort(hm())},$a=null;function Ka(e){return $a||($a=new Kn(e)),$a}var Wa=e=>{e.registerRewardsFetcher(t=>A(void 0,null,function*(){var i,a,o,s,l;let r=["ADS"],n=Ka(t);try{let c=yield n.getUnlockOptions({});if(c.code!=="SUCCESS")return r;ne.emit(Mn,{options:((i=c.data)==null?void 0:i.unlockOptions)||[],userJoliCoin:((a=c.extra)==null?void 0:a.joliCoin)||{balance:0,enableAutoDeduct:!1},userGem:((o=c.extra)==null?void 0:o.joliGem)||{balance:0,enableAutoDeduct:!1}});let p=((l=(s=c.data)==null?void 0:s.unlockOptions)==null?void 0:l.map(u=>u.type))||Array.from(r);return pm(p)}catch(c){return console.error("getRewardOptions error (cached):",c),r}}))},za=e=>{e.registerRewardFrequencyConfigFetcher(t=>A(void 0,null,function*(){var n,i,a,o;let r=Ka(t);try{let s=yield r.getGlobalConfig();return ne.emit(Ha,{joliCoinUseAndCharge:((n=s.data)==null?void 0:n.joliCoinUseAndCharge)||st,loginGuide:((i=s.data)==null?void 0:i.loginGuide)||lt}),s.data&&bt.emit("onGlobalConfigChanged",{globalConfig:s.data}),{joliCoinUseAndCharge:((a=s.data)==null?void 0:a.joliCoinUseAndCharge)||st,loginGuide:((o=s.data)==null?void 0:o.loginGuide)||lt}}catch(s){return console.error("getGlobalConfig error (cached):",s),ne.emit(Ha,{joliCoinUseAndCharge:st,loginGuide:lt}),bt.emit("onGlobalConfigChanged",{globalConfig:{joliCoinUseAndCharge:st,loginGuide:lt,supportedHostMethods:mm}}),{joliCoinUseAndCharge:st,loginGuide:lt}}}))};var Ya=e=>A(void 0,null,function*(){yield Ka(e).warmupCache(),console.log("Reward cache warmed up")});var nc=e=>t=>A(void 0,null,function*(){try{console.log("trigger @jolibox/ads reward",t),yield e.adBreak(t)}catch(r){console.error("-----createAdsRewardHandler error-----",r)}return!0});Pe();function Ye(e,t){let r=null,n=null,i=null,a=()=>{if(i){r=Promise.resolve(i);return}r=new Promise(o=>{n=o})};return a(),e.on(t,(...o)=>{let s=o[0];i=s,n&&(n(s),n=null)}),{getData:()=>(r||a(),r),getCachedData:()=>i,clearCache:()=>{i=null,r=null},getFreshData:()=>(i=null,r=null,a(),r),updateData:o=>{if(i)return i=z(z({},i),o),r=Promise.resolve(i),n&&(n(i),n=null),i}}}Pe();var Ie=Ye(ne,Mn),Sr=(e,t)=>{var n;let r=(n=e.options)==null?void 0:n.some(i=>i.type==="SUBSCRIPTION");return console.log("typeof extraCheck",typeof t,t==null?void 0:t()),r&&(!t||(t==null?void 0:t()))};he();q();var Xa={JOLI_COIN:{balanceEndpoint:"/api/joli-coin/balance",balanceDetailEndpoint:"/api/joli-coin/balance-detail",unlockEndpoint:"/api/joli-coin/unlock",unlockType:"JOLI_COIN"},GEM:{balanceEndpoint:"/api/joli-gem/balance",balanceDetailEndpoint:"/api/joli-gem/balance-detail",unlockEndpoint:"/api/joli-gem/unlock",unlockType:"GEM"}};q();var qe=we();Pe();Pe();q();var Za=class{constructor(t){this.httpClient=t}execute(t,r){return A(this,null,function*(){let n=(r==null?void 0:r.method)||"GET",i=(r==null?void 0:r.query)||{};return n==="GET"?yield this.httpClient.get(t,{query:i}):yield this.httpClient.post(t,{query:i})})}extractCacheableData(t){var r;return{balance:((r=t.data)==null?void 0:r.balance)||0,timestamp:Date.now()}}processCachedData(t){return{code:"SUCCESS",message:"success from cache",data:{balance:t.balance}}}},eo=class{constructor(t){this.balanceService=new Tt(new Za(t),{duration:20*60*1e3,timeout:1e3,keyGenerator:(r,n)=>{let i=n!=null&&n.query?JSON.stringify(n.query):"";return`${r}:${i}`}})}getBalance(t="JOLI_COIN"){return A(this,null,function*(){return(yield this.balanceService.request("/api/joli-coin/balance",{endpoint:"/api/joli-coin/balance",query:{type:t},method:"GET"})).data})}refreshBalance(t="JOLI_COIN"){return A(this,null,function*(){return(yield this.balanceService.forceRequest("/api/joli-coin/balance",{endpoint:"/api/joli-coin/balance",query:{type:t},method:"GET"})).data})}warmupBalance(t="JOLI_COIN"){return A(this,null,function*(){yield this.balanceService.warmupCache("/api/joli-coin/balance",{endpoint:"/api/joli-coin/balance",query:{type:t},method:"GET"})})}clearBalanceCache(){this.balanceService.clearCache()}getBalanceCacheStats(){return this.balanceService.getCacheStats()}clearExpiredCache(){this.balanceService.clearExpiredCache()}},Qa=null;function to(e){return Qa||(Qa=new eo(e)),Qa}var ro=(e,t="JOLI_COIN")=>A(void 0,null,function*(){return yield to(e).getBalance(t)}),Dt=(e,t="JOLI_COIN")=>A(void 0,null,function*(){let n=yield to(e).refreshBalance(t);return console.log(`Balance cache refreshed for type: ${t}`),n}),Wn=(e,t="JOLI_COIN")=>A(void 0,null,function*(){yield to(e).warmupBalance(t),console.log(`Balance cache warmed up for type: ${t}`)});q();var io=class{constructor(t){this.httpClient=t}execute(t,r){return A(this,null,function*(){let n=(r==null?void 0:r.method)||"GET",i=(r==null?void 0:r.query)||{};return n==="GET"?yield this.httpClient.get(t,{query:i}):yield this.httpClient.post(t,{query:i})})}extractCacheableData(t){var r;return{balance:((r=t.data)==null?void 0:r.balance)||0,timestamp:Date.now()}}processCachedData(t){return{code:"SUCCESS",message:"success from cache",data:{balance:t.balance}}}},ao=class{constructor(t){this.gemBalanceService=new Tt(new io(t),{duration:20*60*1e3,timeout:1e3,keyGenerator:(r,n)=>{let i=n!=null&&n.query?JSON.stringify(n.query):"";return`${r}:${i}`}})}getGemBalance(t="GEM"){return A(this,null,function*(){return(yield this.gemBalanceService.request("/api/joli-gem/balance",{endpoint:"/api/joli-gem/balance",query:{type:t},method:"GET"})).data})}refreshGemBalance(t="GEM"){return A(this,null,function*(){return(yield this.gemBalanceService.forceRequest("/api/joli-gem/balance",{endpoint:"/api/joli-gem/balance",query:{type:t},method:"GET"})).data})}warmupGemBalance(t="GEM"){return A(this,null,function*(){yield this.gemBalanceService.warmupCache("/api/joli-gem/balance",{endpoint:"/api/joli-gem/balance",query:{type:t},method:"GET"})})}clearGemBalanceCache(){this.gemBalanceService.clearCache()}getGemBalanceCacheStats(){return this.gemBalanceService.getCacheStats()}clearExpiredCache(){this.gemBalanceService.clearExpiredCache()}},no=null;function ic(e){return no||(no=new ao(e)),no}var oo=(e,t="GEM")=>A(void 0,null,function*(){return yield ic(e).getGemBalance(t)}),Qt=(e,t="GEM")=>A(void 0,null,function*(){let n=yield ic(e).refreshGemBalance(t);return console.log(`Gem balance cache refreshed for type: ${t}`),n});var Xe={JOLI_COIN:{fetchBalance:ro,getQuantity:e=>{var t,r,n;return(n=(r=(t=e==null?void 0:e.options)==null?void 0:t.find(i=>i.type==="JOLI_COIN"))==null?void 0:r.joliCoinChoices[0].joliCoinQuantity)!=null?n:0},getCurrentUser:e=>{var t;return(t=e==null?void 0:e.userJoliCoin)!=null?t:{balance:0,enableAutoDeduct:!1}},createUpdatedUser:(e,t)=>({balance:e,enableAutoDeduct:t}),getUpdateKey:()=>"userJoliCoin",isEnough:(e,t)=>{var r,n;return(n=(r=e==null?void 0:e.options)==null?void 0:r.some(i=>i.type==="JOLI_COIN"&&i.joliCoinChoices.some(a=>{var o;return a.joliCoinQuantity<=((o=t==null?void 0:t.balance)!=null?o:0)})))!=null?n:!1}},JOLI_GEM:{fetchBalance:oo,getQuantity:e=>{var t,r,n,i;return(i=(n=(r=(t=e==null?void 0:e.options)==null?void 0:t.find(a=>a.type==="JOLI_GEM"))==null?void 0:r.joliGemChoice)==null?void 0:n.joliGemQuantity)!=null?i:0},getCurrentUser:e=>{var t;return(t=e==null?void 0:e.userGem)!=null?t:{balance:0,enableAutoDeduct:!1}},createUpdatedUser:(e,t)=>({balance:e,enableAutoDeduct:t}),getUpdateKey:()=>"userGem",isEnough:(e,t)=>{var n,i,a;let r=e==null?void 0:e.options.find(o=>o.type==="JOLI_GEM");return r?((i=(n=r.joliGemChoice)==null?void 0:n.joliGemQuantity)!=null?i:0)<=((a=t==null?void 0:t.balance)!=null?a:0):!1}}};var zn=(e,t,r)=>{let{showUnlockWithCurrencyModal:n}=r;qe.registerCommand(`Rewards.${e}.useJolicoin`,()=>A(void 0,null,function*(){let i=yield Ie.getData(),a=Xe[t],o=a.getCurrentUser(i),s=a.getQuantity(i),l=!!(o!=null&&o.enableAutoDeduct);return console.log("-----unlockOptions usemodal-----",i,l,s),(yield n({enableAutoDeduct:l,userCurrency:o,quantity:s,currency:t}))!=="CONFIRM"?{result:"FAILED"}:{result:"SUCCESS"}}))},Lt=(e,t)=>r=>A(void 0,null,function*(){let n=Ye(ne,jn);return ne.emit(Fn,e,{enableAutoDeduct:r.enableAutoDeduct,userCurrency:r.userCurrency,quantity:r.quantity,currency:r.currency,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult});Pe();Pe();var Yn=(e,t,r)=>{let{httpClient:n,initiateAndAwaitPayment:i}=r;qe.registerCommand(`Rewards.${e}.usePayment`,()=>A(void 0,null,function*(){var m;let a=yield Ie.getData(),o=Xe[t],s=yield o.fetchBalance(n),l=o.getQuantity(a),c=o.getCurrentUser(a),p=o.createUpdatedUser((m=s==null?void 0:s.balance)!=null?m:0,c.enableAutoDeduct),u=o.getUpdateKey();if(Ie.updateData({[u]:p}),console.log("-----unlockOptions payment-----",a,p,l,t),!o.isEnough(a,p)){let h=yield i({userCurrency:p,currencyQuantity:l,currency:t});return t==="JOLI_GEM"?Qt(n):Dt(n),{result:h==="SUCCESS"?"SUCCESS":"FAILED"}}return{result:"CONTINUE"}}))},Ut=(e,t)=>r=>A(void 0,null,function*(){let n=Ye(ne,Jn);return ne.emit(Gn,e,{userCurrency:r.userCurrency,quantity:r.currencyQuantity,currency:r.currency,enableAutoDeduct:r.userCurrency.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult});he();Pe();Pe();q();var Bt=(e,t)=>r=>A(void 0,null,function*(){let n=Ye(ne,Hn);return ne.emit(qn,e,{confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText,currency:r}),yield n.getFreshData()});var _m=(e,t,r,{handlers:{handleUnlockSuccess:n,handleUnlockFailed:i,unlockOptionsHandler:a,initiateAndAwaitPayment:o,showUnlockWithCurrencyModal:s,showUnloginModal:l,hasSubscription:c}})=>{Yn(e,"JOLI_COIN",{httpClient:t,initiateAndAwaitPayment:o}),zn(e,"JOLI_COIN",{showUnlockWithCurrencyModal:s});let p=[`Rewards.${e}.usePayment`,`Rewards.${e}.useJolicoin`];return u=>A(void 0,null,function*(){var m,h,w,E;try{let I=yield a.getData();if(Sr(I,c)){let D=Xe.JOLI_COIN,J=yield D.fetchBalance(t),S=D.getCurrentUser(I),N=D.createUpdatedUser((m=J==null?void 0:J.balance)!=null?m:0,S.enableAutoDeduct);if(!D.isEnough(I,N))return i==null||i(u),!1}else{let D=!0;for(let J of p){let S=yield qe.executeCommand(J);if(D=D&&S.result!=="FAILED",S.result!=="CONTINUE")break}if(!D)return i==null||i(u),!1}let R=Xa[r],k=yield t.post(R.unlockEndpoint,{data:{type:"GAME_REWARD",reqId:`${$e()}-${L.mpType}-${Date.now()}`,gameInfo:{gameId:L.mpId}}});if(console.log("-----unlockWithCurrency request result-----",k),k.code=="SUCCESS"){try{(w=u.adBreakDone)==null||w.call(u,{breakType:u.type,breakName:"name"in u&&(h=u.name)!=null?h:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in u&&((E=u.adViewed)==null||E.call(u)),Dt(t)}catch(D){console.error("-----unlockWithJolicoin adBreakDone error-----",D)}return n==null||n({quantity:k.data.quantity,balance:k.data.balance}),!0}return i==null||i(u),!1}catch(I){if(console.info("JolicoinRewardHandler error:",I),I instanceof Error&&I.message=="CANCEL")throw I;return i==null||i(u),!1}finally{a.clearCache()}})},Xn=(e,t,r)=>_m(e,t,"JOLI_COIN",r);var ac=(e,{onUnlockSuccess:t,onUnlockFailed:r,hasSubscription:n})=>{let i=()=>{r==null||r()},a=Lt("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),o=Ut("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"}),s=Bt("ADS-JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noWatchAds"});return Xn("ADS-JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:i,unlockOptionsHandler:Ie,initiateAndAwaitPayment:o,showUnlockWithCurrencyModal:a,showUnloginModal:s,hasSubscription:n}})};var oc=(e,{onUnlockSuccess:t,onUnlockFailed:r,hasSubscription:n})=>{let i=c=>{var p;r==null||r(),(p=c.adBreakDone)==null||p.call(c,{breakType:c.type,breakFormat:c.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},a=Lt("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),o=Ut("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"}),s=Bt("JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noThanks"});return Xn("JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:i,unlockOptionsHandler:Ie,initiateAndAwaitPayment:o,showUnlockWithCurrencyModal:a,showUnloginModal:s,hasSubscription:n}})};he();q();Pe();Pe();var sc=e=>{let{showSubscriptionModal:t}=e;qe.registerCommand("Rewards.subscription",()=>A(void 0,null,function*(){var s,l;let r=yield Ie.getData(),n=(l=(s=r==null?void 0:r.options)==null?void 0:s.find(c=>c.type==="JOLI_GEM"))==null?void 0:l.type,i=Xe[n?"JOLI_GEM":"JOLI_COIN"],a=i.getCurrentUser(r);return i.isEnough(r,a)?{result:"FAILED"}:{result:(yield t())==="SUCCESS"?"SUCCESS":"FAILED"}}))},lc=e=>()=>A(void 0,null,function*(){let t=Ye(ne,$n);return ne.emit(Vn,e),(yield t.getFreshData()).result});he();var cc=(e,t,{handlers:{handleSubSuccess:r,handleSubFailed:n,unlockOptionsHandler:i,showSubscriptionModal:a,hasSubscription:o}})=>{sc({showSubscriptionModal:a});let s=["Rewards.subscription"];return l=>A(void 0,null,function*(){var c,p,u,m,h,w;try{let E=yield i.getData();if(!Sr(E,o))return!1;let b=!0;for(let R of s){let k=yield qe.executeCommand(R);if(b=b&&k.result!=="FAILED",k.result!=="CONTINUE")break}if(Dt(t),Qt(t),console.log("-----unlockWithSubscription result-----",b),b){try{(p=l.adBreakDone)==null||p.call(l,{breakType:l.type,breakName:"name"in l&&(c=l.name)!=null?c:"",breakFormat:l.type==="reward"?"reward":"interstitial",breakStatus:"viewed"}),"adViewed"in l&&((u=l.adViewed)==null||u.call(l)),(w=(h=L).onEnvConfigChanged)==null||w.call(h,{hostUserInfo:Re(z({},(m=L.hostUserInfo)!=null?m:{isLogin:!1}),{isSubUser:!0})})}catch(R){console.error("-----unlockWithSubscription adBreakDone error-----",R)}return r==null||r(),!0}return n==null||n(l),!1}catch(E){if(console.info("SubscriptionRewardHandler error:",E),E instanceof Error&&E.message=="CANCEL")throw E;return n==null||n(l),!1}finally{}})};var dc=(e,{onSubSuccess:t,onSubFailed:r,hasSubscription:n})=>{let i=()=>{r==null||r()},a=lc("SUBSCRIPTION");return cc("SUBSCRIPTION",e,{handlers:{handleSubSuccess:t,handleSubFailed:i,unlockOptionsHandler:Ie,showSubscriptionModal:a,hasSubscription:n}})};var Qe=rc();Wa(Qe);za(Qe);var ti,j,pc,co,Mt,uc,vc,gc,_c,uo,so,lo,bm,Cr={},yc=[],wm=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Rr=Array.isArray;function ct(e,t){for(var r in t)e[r]=t[r];return e}function fo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Or(e,t,r){var n,i,a,o={};for(a in t)a=="key"?n=t[a]:a=="ref"?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?ti.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return Zn(e,o,n,i,null)}function Zn(e,t,r,n,i){var a={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++pc:i,__i:-1,__u:0};return i==null&&j.vnode!=null&&j.vnode(a),a}function Et(e){return e.children}function Je(e,t){this.props=e,this.context=t}function Zt(e,t){if(t==null)return e.__?Zt(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"?Zt(e):null}function bc(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 bc(e)}}function fc(e){(!e.__d&&(e.__d=!0)&&Mt.push(e)&&!ei.__r++||uc!==j.debounceRendering)&&((uc=j.debounceRendering)||vc)(ei)}function ei(){for(var e,t,r,n,i,a,o,s=1;Mt.length;)Mt.length>s&&Mt.sort(gc),e=Mt.shift(),s=Mt.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,a=[],o=[],t.__P&&((r=ct({},n)).__v=n.__v+1,j.vnode&&j.vnode(r),ho(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,a,i==null?Zt(n):i,!!(32&n.__u),o),r.__v=n.__v,r.__.__k[r.__i]=r,Ic(a,r,o),r.__e!=i&&bc(r)));ei.__r=0}function wc(e,t,r,n,i,a,o,s,l,c,p){var u,m,h,w,E,I,b=n&&n.__k||yc,R=t.length;for(l=Em(r,t,b,l,R),u=0;u<R;u++)(h=r.__k[u])!=null&&(m=h.__i===-1?Cr:b[h.__i]||Cr,h.__i=u,I=ho(e,h,m,i,a,o,s,l,c,p),w=h.__e,h.ref&&m.ref!=h.ref&&(m.ref&&mo(m.ref,null,h),p.push(h.ref,h.__c||w,h)),E==null&&w!=null&&(E=w),4&h.__u||m.__k===h.__k?l=Ec(h,l,e):typeof h.type=="function"&&I!==void 0?l=I:w&&(l=w.nextSibling),h.__u&=-7);return r.__e=E,l}function Em(e,t,r,n,i){var a,o,s,l,c,p=r.length,u=p,m=0;for(e.__k=new Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!="boolean"&&typeof o!="function"?(l=a+m,(o=e.__k[a]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Zn(null,o,null,null,null):Rr(o)?Zn(Et,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Zn(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(c=o.__i=Im(o,r,l,u))!==-1&&(u--,(s=r[c])&&(s.__u|=2)),s==null||s.__v===null?(c==-1&&(i>p?m--:i<p&&m++),typeof o.type!="function"&&(o.__u|=4)):c!=l&&(c==l-1?m--:c==l+1?m++:(c>l?m--:m++,o.__u|=4))):e.__k[a]=null;if(u)for(a=0;a<p;a++)(s=r[a])!=null&&!(2&s.__u)&&(s.__e==n&&(n=Zt(s)),Sc(s,s));return n}function Ec(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=Ec(n[i],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=Zt(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function kr(e,t){return t=t||[],e==null||typeof e=="boolean"||(Rr(e)?e.some(function(r){kr(r,t)}):t.push(e)),t}function Im(e,t,r,n){var i,a,o=e.key,s=e.type,l=t[r];if(l===null&&e.key==null||l&&o==l.key&&s===l.type&&!(2&l.__u))return r;if(n>(l!=null&&!(2&l.__u)?1:0))for(i=r-1,a=r+1;i>=0||a<t.length;){if(i>=0){if((l=t[i])&&!(2&l.__u)&&o==l.key&&s===l.type)return i;i--}if(a<t.length){if((l=t[a])&&!(2&l.__u)&&o==l.key&&s===l.type)return a;a++}}return-1}function hc(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||wm.test(t)?r:r+"px"}function Qn(e,t,r,n,i){var a;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||hc(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||hc(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")a=t!=(t=t.replace(_c,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?n?r.t=n.t:(r.t=uo,e.addEventListener(t,a?lo:so,a)):e.removeEventListener(t,a?lo:so,a);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(o){}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function mc(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=uo++;else if(t.u<r.t)return;return r(j.event?j.event(t):t)}}}function ho(e,t,r,n,i,a,o,s,l,c){var p,u,m,h,w,E,I,b,R,k,D,J,S,N,F,H,U,M=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),a=[s=t.__e=r.__e]),(p=j.__b)&&p(t);e:if(typeof M=="function")try{if(b=t.props,R="prototype"in M&&M.prototype.render,k=(p=M.contextType)&&n[p.__c],D=p?k?k.props.value:p.__:n,r.__c?I=(u=t.__c=r.__c).__=u.__E:(R?t.__c=u=new M(b,D):(t.__c=u=new Je(b,D),u.constructor=M,u.render=Sm),k&&k.sub(u),u.props=b,u.state||(u.state={}),u.context=D,u.__n=n,m=u.__d=!0,u.__h=[],u._sb=[]),R&&u.__s==null&&(u.__s=u.state),R&&M.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=ct({},u.__s)),ct(u.__s,M.getDerivedStateFromProps(b,u.__s))),h=u.props,w=u.state,u.__v=t,m)R&&M.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),R&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(R&&M.getDerivedStateFromProps==null&&b!==h&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(b,D),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(b,u.__s,D)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(u.props=b,u.state=u.__s,u.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(G){G&&(G.__=t)}),J=0;J<u._sb.length;J++)u.__h.push(u._sb[J]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(b,u.__s,D),R&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,w,E)})}if(u.context=D,u.props=b,u.__P=e,u.__e=!1,S=j.__r,N=0,R){for(u.state=u.__s,u.__d=!1,S&&S(t),p=u.render(u.props,u.state,u.context),F=0;F<u._sb.length;F++)u.__h.push(u._sb[F]);u._sb=[]}else do u.__d=!1,S&&S(t),p=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++N<25);u.state=u.__s,u.getChildContext!=null&&(n=ct(ct({},n),u.getChildContext())),R&&!m&&u.getSnapshotBeforeUpdate!=null&&(E=u.getSnapshotBeforeUpdate(h,w)),H=p,p!=null&&p.type===Et&&p.key==null&&(H=Ac(p.props.children)),s=wc(e,Rr(H)?H:[H],t,r,n,i,a,o,s,l,c),u.base=t.__e,t.__u&=-161,u.__h.length&&o.push(u),I&&(u.__E=u.__=null)}catch(G){if(t.__v=null,l||a!=null)if(G.then){for(t.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__e=s}else for(U=a.length;U--;)fo(a[U]);else t.__e=r.__e,t.__k=r.__k;j.__e(G,t,r)}else a==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=Am(r.__e,t,r,n,i,a,o,l,c);return(p=j.diffed)&&p(t),128&t.__u?void 0:s}function Ic(e,t,r){for(var n=0;n<r.length;n++)mo(r[n],r[++n],r[++n]);j.__c&&j.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(a){a.call(i)})}catch(a){j.__e(a,i.__v)}})}function Ac(e){return typeof e!="object"||e==null?e:Rr(e)?e.map(Ac):ct({},e)}function Am(e,t,r,n,i,a,o,s,l){var c,p,u,m,h,w,E,I=r.props,b=t.props,R=t.type;if(R=="svg"?i="http://www.w3.org/2000/svg":R=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),a!=null){for(c=0;c<a.length;c++)if((h=a[c])&&"setAttribute"in h==!!R&&(R?h.localName==R:h.nodeType==3)){e=h,a[c]=null;break}}if(e==null){if(R==null)return document.createTextNode(b);e=document.createElementNS(i,R,b.is&&b),s&&(j.__m&&j.__m(t,a),s=!1),a=null}if(R===null)I===b||s&&e.data===b||(e.data=b);else{if(a=a&&ti.call(e.childNodes),I=r.props||Cr,!s&&a!=null)for(I={},c=0;c<e.attributes.length;c++)I[(h=e.attributes[c]).name]=h.value;for(c in I)if(h=I[c],c!="children"){if(c=="dangerouslySetInnerHTML")u=h;else if(!(c in b)){if(c=="value"&&"defaultValue"in b||c=="checked"&&"defaultChecked"in b)continue;Qn(e,c,null,h,i)}}for(c in b)h=b[c],c=="children"?m=h:c=="dangerouslySetInnerHTML"?p=h:c=="value"?w=h:c=="checked"?E=h:s&&typeof h!="function"||I[c]===h||Qn(e,c,h,I[c],i);if(p)s||u&&(p.__html===u.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(u&&(e.innerHTML=""),wc(t.type==="template"?e.content:e,Rr(m)?m:[m],t,r,n,R=="foreignObject"?"http://www.w3.org/1999/xhtml":i,a,o,a?a[0]:r.__k&&Zt(r,0),s,l),a!=null)for(c=a.length;c--;)fo(a[c]);s||(c="value",R=="progress"&&w==null?e.removeAttribute("value"):w!==void 0&&(w!==e[c]||R=="progress"&&!w||R=="option"&&w!==I[c])&&Qn(e,c,w,I[c],i),c="checked",E!==void 0&&E!==e[c]&&Qn(e,c,E,I[c],i))}return e}function mo(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){j.__e(i,r)}}function Sc(e,t,r){var n,i;if(j.unmount&&j.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||mo(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(a){j.__e(a,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Sc(n[i],t,r||typeof e.type!="function");r||fo(e.__e),e.__c=e.__=e.__e=void 0}function Sm(e,t,r){return this.constructor(e,r)}function Cc(e,t,r){var n,i,a,o;t==document&&(t=document.documentElement),j.__&&j.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,a=[],o=[],ho(t,e=(!n&&r||t).__k=Or(Et,null,[e]),i||Cr,Cr,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?ti.call(t.childNodes):null,a,!n&&r?r:i?i.__e:t.firstChild,n,o),Ic(a,e,o)}ti=yc.slice,j={__e:function(e,t,r,n){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(s){e=s}throw e}},pc=0,co=function(e){return e!=null&&e.constructor==null},Je.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ct({},this.state),typeof e=="function"&&(e=e(ct({},r),this.props)),e&&ct(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),fc(this))},Je.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),fc(this))},Je.prototype.render=Et,Mt=[],vc=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,gc=function(e,t){return e.__v.__b-t.__v.__b},ei.__r=0,_c=/(PointerCapture)$|Capture$/i,uo=0,so=mc(!1),lo=mc(!0),bm=0;var er,ce,po,Rc,Tr=0,Lc=[],ue=j,Oc=ue.__b,kc=ue.__r,Tc=ue.diffed,xc=ue.__c,Pc=ue.unmount,Nc=ue.__;function ni(e,t){ue.__h&&ue.__h(ce,e,Tr||t),Tr=0;var r=ce.__H||(ce.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function dt(e){return Tr=1,Uc(Bc,e)}function Uc(e,t,r){var n=ni(er++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Bc(void 0,t),function(s){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,s);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=ce,!ce.__f)){var i=function(s,l,c){if(!n.__c.__H)return!0;var p=n.__c.__H.__.filter(function(m){return!!m.__c});if(p.every(function(m){return!m.__N}))return!a||a.call(this,s,l,c);var u=n.__c.props!==s;return p.forEach(function(m){if(m.__N){var h=m.__[0];m.__=m.__N,m.__N=void 0,h!==m.__[0]&&(u=!0)}}),a&&a.call(this,s,l,c)||u};ce.__f=!0;var a=ce.shouldComponentUpdate,o=ce.componentWillUpdate;ce.componentWillUpdate=function(s,l,c){if(this.__e){var p=a;a=void 0,i(s,l,c),a=p}o&&o.call(this,s,l,c)},ce.shouldComponentUpdate=i}return n.__N||n.__}function Gt(e,t){var r=ni(er++,3);!ue.__s&&_o(r.__H,t)&&(r.__=e,r.u=t,ce.__H.__h.push(r))}function go(e,t){var r=ni(er++,4);!ue.__s&&_o(r.__H,t)&&(r.__=e,r.u=t,ce.__h.push(r))}function ii(e){return Tr=5,xr(function(){return{current:e}},[])}function xr(e,t){var r=ni(er++,7);return _o(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Pr(e,t){return Tr=8,xr(function(){return e},t)}function Cm(){for(var e;e=Lc.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ri),e.__H.__h.forEach(vo),e.__H.__h=[]}catch(t){e.__H.__h=[],ue.__e(t,e.__v)}}ue.__b=function(e){ce=null,Oc&&Oc(e)},ue.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Nc&&Nc(e,t)},ue.__r=function(e){kc&&kc(e),er=0;var t=(ce=e.__c).__H;t&&(po===ce?(t.__h=[],ce.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(ri),t.__h.forEach(vo),t.__h=[],er=0)),po=ce},ue.diffed=function(e){Tc&&Tc(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Lc.push(t)!==1&&Rc===ue.requestAnimationFrame||((Rc=ue.requestAnimationFrame)||Rm)(Cm)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),po=ce=null},ue.__c=function(e,t){t.some(function(r){try{r.__h.forEach(ri),r.__h=r.__h.filter(function(n){return!n.__||vo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],ue.__e(n,r.__v)}}),xc&&xc(e,t)},ue.unmount=function(e){Pc&&Pc(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{ri(n)}catch(i){t=i}}),r.__H=void 0,t&&ue.__e(t,r.__v))};var Dc=typeof requestAnimationFrame=="function";function Rm(e){var t,r=function(){clearTimeout(n),Dc&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Dc&&(t=requestAnimationFrame(r))}function ri(e){var t=ce,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),ce=t}function vo(e){var t=ce;e.__c=e.__(),ce=t}function _o(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Bc(e,t){return typeof t=="function"?t(e):t}function km(e,t){for(var r in t)e[r]=t[r];return e}function Mc(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 Gc(e,t){this.props=e,this.context=t}(Gc.prototype=new Je).isPureReactComponent=!0,Gc.prototype.shouldComponentUpdate=function(e,t){return Mc(this.props,e)||Mc(this.state,t)};var Jc=j.__b;j.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Jc&&Jc(e)};var oS=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Tm=j.__e;j.__e=function(e,t,r,n){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}Tm(e,t,r,n)};var Fc=j.unmount;function Wc(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=km({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Wc(n,t,r)})),e}function zc(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return zc(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 yo(){this.__u=0,this.o=null,this.__b=null}function Yc(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ai(){this.i=null,this.l=null}j.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Fc&&Fc(e)},(yo.prototype=new Je).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=Yc(n.__v),a=!1,o=function(){a||(a=!0,r.__R=null,i?i(s):s())};r.__R=o;var s=function(){if(!--n.__u){if(n.state.__a){var l=n.state.__a;n.__v.__k[0]=zc(l,l.__c.__P,l.__c.__O)}var c;for(n.setState({__a:n.__b=null});c=n.o.pop();)c.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(o,o)},yo.prototype.componentWillUnmount=function(){this.o=[]},yo.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]=Wc(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&Or(Et,null,e.fallback);return i&&(i.__u&=-33),[Or(Et,null,t.__a?null:e.children),i]};var jc=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]}};(ai.prototype=new Je).__a=function(e){var t=this,r=Yc(t.__v),n=t.l.get(e);return n[0]++,function(i){var a=function(){t.props.revealOrder?(n.push(i),jc(t,e,n)):i()};r?r(a):a()}},ai.prototype.render=function(e){this.i=null,this.l=new Map;var t=kr(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},ai.prototype.componentDidUpdate=ai.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){jc(e,r,t)})};var xm=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,Pm=/^(?: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]/,Nm=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Dm=/[A-Z0-9]/g,Lm=typeof document!="undefined",Um=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function oi(e,t,r){return t.__k==null&&(t.textContent=""),Cc(e,t),typeof r=="function"&&r(),e?e.__c:null}Je.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Je.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Hc=j.event;function Bm(){}function Mm(){return this.cancelBubble}function Gm(){return this.defaultPrevented}j.event=function(e){return Hc&&(e=Hc(e)),e.persist=Bm,e.isPropagationStopped=Mm,e.isDefaultPrevented=Gm,e.nativeEvent=e};var Xc,Jm={enumerable:!1,configurable:!0,get:function(){return this.class}},qc=j.vnode;j.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={},a=n.indexOf("-")===-1;for(var o in r){var s=r[o];if(!(o==="value"&&"defaultValue"in r&&s==null||Lm&&o==="children"&&n==="noscript"||o==="class"||o==="className")){var l=o.toLowerCase();o==="defaultValue"&&"value"in r&&r.value==null?o="value":o==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?o="ondblclick":l!=="onchange"||n!=="input"&&n!=="textarea"||Um(r.type)?l==="onfocus"?o="onfocusin":l==="onblur"?o="onfocusout":Nm.test(o)&&(o=l):l=o="oninput":a&&Pm.test(o)?o=o.replace(Dm,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&i[o=l]&&(o="oninputCapture"),i[o]=s}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=kr(r.children).forEach(function(c){c.props.selected=i.value.indexOf(c.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=kr(r.children).forEach(function(c){c.props.selected=i.multiple?i.defaultValue.indexOf(c.props.value)!=-1:i.defaultValue==c.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",Jm)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=xm,qc&&qc(e)};var Vc=j.__r;j.__r=function(e){Vc&&Vc(e),Xc=e.__c};var $c=j.diffed;j.diffed=function(e){$c&&$c(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),Xc=null};var Fm=Object.defineProperty,jm=Object.defineProperties,Hm=Object.getOwnPropertyDescriptors,_i=Object.getOwnPropertySymbols,xd=Object.prototype.hasOwnProperty,Pd=Object.prototype.propertyIsEnumerable,Qc=(e,t,r)=>t in e?Fm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Nd=(e,t)=>{for(var r in t||(t={}))xd.call(t,r)&&Qc(e,r,t[r]);if(_i)for(var r of _i(t))Pd.call(t,r)&&Qc(e,r,t[r]);return e},qm=(e,t)=>jm(e,Hm(t)),Vm=(e,t)=>{var r={};for(var n in e)xd.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&_i)for(var n of _i(e))t.indexOf(n)<0&&Pd.call(e,n)&&(r[n]=e[n]);return r},Dd=Object.defineProperty,$m=Object.defineProperties,Km=Object.getOwnPropertyDescriptors,Zc=Object.getOwnPropertySymbols,Wm=Object.prototype.hasOwnProperty,zm=Object.prototype.propertyIsEnumerable,ed=(e,t,r)=>t in e?Dd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ym=(e,t)=>{for(var r in t||(t={}))Wm.call(t,r)&&ed(e,r,t[r]);if(Zc)for(var r of Zc(t))zm.call(t,r)&&ed(e,r,t[r]);return e},Xm=(e,t)=>$m(e,Km(t)),Qm=(e,t)=>{for(var r in t)Dd(e,r,{get:t[r],enumerable:!0})},Ld=(e,t,r,n)=>{for(var i=t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=o(i)||i);return i},Zm=(e,t,r)=>new Promise((n,i)=>{var a=l=>{try{s(r.next(l))}catch(c){i(c)}},o=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(a,o);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 ep(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function tp(e){return typeof e=="string"}function rp(e){return typeof e=="undefined"}function np(e){return rp(e)||e===null}function ip(e){return typeof e=="function"}function Ud(e){let t=e,r=null,n=function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return r||(r=new t(...a)),r};return n.prototype=t.prototype,n}var ap=(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))(ap||{});function Nr(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}var op={log:Nr("log"),warn:Nr("warn"),info:Nr("info"),error:Nr("error"),debug:Nr("debug")};Object.assign(globalThis,{logger:op});var td=Symbol.for("Jolibox.canIUseMap"),sp={};globalThis[td]||(globalThis[td]=sp);var rd=Symbol.for("Jolibox.canIUseMap.native"),lp={};globalThis[rd]||(globalThis[rd]=lp);var Bd=(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))(Bd||{}),Md=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Md||{}),Gd=(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))(Gd||{}),nd=["name","params"],cp=["name","type","location","target","extra","timestamp","userId"],dp=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function ui(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,a)=>(i[a]=String(n[a]),i),{})}return e[r]})}function up(e){let t=e.location?ui(e.location,nd):null,r=e.target?ui(e.target,nd):null;return ui(Xm(Ym({},e),{location:t,target:r}),cp)}function fp(e){let t=e.events.map(n=>up(n)),r=ui(e.device,dp);return[e.protocolVersion,t,r,e.project]}function hp(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};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}}hp();var nr=typeof window=="undefined",No=()=>!nr&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");!nr&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),!nr&&navigator.userAgent.includes("Android"),!nr&&navigator.userAgent.includes("Mac"),!nr&&navigator.userAgent.includes("FB_IAB"),!nr&&!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var Do=class Lo{constructor(t){this.element=t,this.next=Lo.Undefined,this.prev=Lo.Undefined}};Do.Undefined=new Do(void 0);var se=Do,mp=class{constructor(){this._first=se.Undefined,this._last=se.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===se.Undefined}clear(){let e=this._first;for(;e!==se.Undefined;){let t=e.next;e.prev=se.Undefined,e.next=se.Undefined,e=t}this._first=se.Undefined,this._last=se.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new se(e);if(this._first===se.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!==se.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==se.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==se.Undefined&&e.next!==se.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===se.Undefined&&e.next===se.Undefined?(this._first=se.Undefined,this._last=se.Undefined):e.next===se.Undefined?(this._last=this._last.prev,this._last.next=se.Undefined):e.prev===se.Undefined&&(this._first=this._first.next,this._first.prev=se.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==se.Undefined;)yield e.element,e=e.next}},pp=0,Dr=class{constructor(e){this.value=e,this.id=pp++}},jr=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 Dr&&(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,a,o,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let l=new Dr(e);return this._listeners?this._listeners instanceof Dr?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,(a=(i=this.options)==null?void 0:i.onDidFirstListener)==null||a.call(i,this)),(s=(o=this.options)==null?void 0:o.onDidAddListener)==null||s.call(o,this),this._size++,()=>{var c,p,u,m;if(!this._disposed){if(this._listeners instanceof Dr)this._listeners.id===l.id&&(this._listeners=void 0,this._size=0,(p=(c=this.options)==null?void 0:c.onDidRemoveLastListener)==null||p.call(c));else if(this._listeners){let h=this._listeners.indexOf(l);h>=0&&(this._listeners.splice(h,1),this._size--,this._size===0&&((m=(u=this.options)==null?void 0:u.onDidRemoveLastListener)==null||m.call(u)))}}}}),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 Dr?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},vp=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 jr,a=l=>t(...l.args),o=i.event(a);this.listerHandlerMap.set(t,{handler:a,dispose:o}),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),a=1;a<n;a++)i[a-1]=arguments[a];r||(r=new mp,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)}},Uo={};Qm(Uo,{None:()=>gp,filter:()=>yp,once:()=>Jd,toPromise:()=>_p});var gp=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function _p(e){return new Promise(t=>Jd(e)(t))}function Jd(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 yp(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new jr(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 bo=Symbol.for("Jolibox.hostEmitter"),bp=()=>{let e=new vp;return globalThis[bo]||(globalThis[bo]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[bo]};bp();function wp(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Ep(e[n],t[n])}function Ep(e,t){if(tp(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(ip(t)){try{if(e instanceof t)return}catch(r){}if(!np(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 Bo=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new jr,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,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return wp(a,r),n(...a)}}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}};Bo=Ld([Ud],Bo);var id=class{constructor(){this._onWillExecuteCommand=new jr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new jr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Bo,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=ep(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 Zm(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),Uo.toPromise(Uo.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 a=this.invokeFunction(t.handler,...n);return this._onDidExecuteCommand.fire({commandId:e,args:n}),a}_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{}}};id=Ld([Ud],id);function Ne(e,t,r){return(t=Ip(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ip(e){var t=Ap(e,"string");return typeof t=="symbol"?t:t+""}function Ap(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 tr=e=>e?function(){try{for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e==null||e(...r)}catch(i){console.error("Error calling function",i)}}:()=>{console.log("wrapUserFunction: fn is undefined")},Mo=class{constructor(t){Ne(this,"context",void 0),Ne(this,"continueCallback",void 0),Ne(this,"adIsShowingCallback",void 0),Ne(this,"isBeforeAdCalled",!1),Ne(this,"isBeforeRewardCalled",!1),Ne(this,"isAdDismissedCalled",!1),Ne(this,"isAdViewedCalled",!1),Ne(this,"isAfterAdCalled",!1),Ne(this,"currentProvider",void 0),Ne(this,"currentClientParams",void 0),Ne(this,"adsHasResponse",!1),Ne(this,"videoChecker",window.document.createElement("video")),Ne(this,"contextInfo",void 0),Ne(this,"wrapShowAdFn",r=>()=>{var n,i,a;this.adsHasResponse=!0;let o=!1;this.videoChecker.play().catch(()=>{o=!1}),o=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:o},this.paramsToTrack)),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_BEFORE_REWARD",Nd({userEvent:o},this.paramsToTrack)),No()&&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}),(a=this.adIsShowingCallback)==null||a.call(this,!0);let s=tr(r);s==null||s()}),this.context=t,this.contextInfo=t.getContextInfo()}notifyIframeAdsEvent(t,r){window.parent&&window.parent.postMessage({type:t,data:r},"*"),window.dispatchEvent(new CustomEvent(t,{detail:r}))}get paramsToTrack(){var t,r,n,i,a,o;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:(o=(a=this.currentClientParams)==null?void 0:a.name)!=null?o:""}}wrapBeforeAd(t){return()=>{var r,n,i,a;if(this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_BEFORE_AD",this.paramsToTrack),!this.isBeforeAdCalled){this.isBeforeAdCalled=!0;let o=tr(t);o==null||o(),((r=this.currentClientParams)==null?void 0:r.type)!=="reward"&&((n=this.adIsShowingCallback)==null||n.call(this,!0),No()&&this.context.track("mmp_ad_impression",{ad_network:(a=(i=this.currentProvider)==null?void 0:i.name)!=null?a:"",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()=>{if(this.adsHasResponse=!0,!this.isAdDismissedCalled){this.isAdDismissedCalled=!0;let r=tr(t);r==null||r()}}}wrapAdViewed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdViewedCalled){this.isAdViewedCalled=!0;let r=tr(t);r==null||r()}}}wrapAfterAd(t){return()=>{if(this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AFTER_AD",this.paramsToTrack),!this.isAfterAdCalled){this.isAfterAdCalled=!0;let r=tr(t);r==null||r()}}}wrapAdBreakDone(t){return r=>{var n,i,a,o,s,l,c,p,u;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:(a=r.breakName)!=null?a:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AD_BREAK_DONE",{provider:(s=(o=this.currentProvider)==null?void 0:o.name)!=null?s:null,breakType:r.breakType,breakName:(l=r.breakName)!=null?l:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{let m=tr(t);m==null||m(r),(c=this.adIsShowingCallback)==null||c.call(this,!1),(p=this.continueCallback)==null||p.call(this,[!1,r]);break}default:{(u=this.continueCallback)==null||u.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n,i){return A(this,null,function*(){return this.currentProvider=t,this.currentClientParams=r,this.adsHasResponse=!1,new Promise(a=>{this.continueCallback=a,this.adIsShowingCallback=i;let o;switch(r.type){case"preroll":{o={type:r.type,adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}case"reward":{o={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:{o={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,c,p,u,m,h;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(l=(s=this.currentProvider)==null?void 0:s.name)!=null?l:null}),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AD_BREAK_TIMEOUT",{type:r.type,provider:(p=(c=this.currentProvider)==null?void 0:c.name)!=null?p:null}),(m=this.continueCallback)==null||m.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(u=r.name)!=null?u:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(h=this.adIsShowingCallback)==null||h.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AD_BREAK",this.paramsToTrack),t.adBreak(o,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};function si(e,t,r){return(t=Sp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sp(e){var t=Cp(e,"string");return typeof t=="symbol"?t:t+""}function Cp(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 Go=class{constructor(t){si(this,"context",void 0),si(this,"adBreakIsShowing",!1),si(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),si(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 li(e,t,r){return(t=Rp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rp(e){var t=Op(e,"string");return typeof t=="symbol"?t:t+""}function Op(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 Jo=class{constructor(t){li(this,"configs",null),li(this,"firstRun",!0),li(this,"context",void 0),li(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return A(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:"",a=this.configs[i],o=(r=a==null?void 0:a.interstitialRate)!=null?r:1;n=Math.random()<o}return this.firstRun=!1,n}};function ut(e,t,r){return(t=kp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kp(e){var t=Tp(e,"string");return typeof t=="symbol"?t:t+""}function Tp(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 Fo=class{constructor(t,r){ut(this,"name","ADSENSE"),ut(this,"context",void 0),ut(this,"contextInfo",void 0),ut(this,"configured",!1),ut(this,"initParams",void 0),ut(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),ut(this,"adConfig",n=>{let i=n,{onReady:a}=i,o=Vm(i,["onReady"]);this.context.track("CallAdConfig",o),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),ut(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),ut(this,"adUnit",n=>A(this,null,function*(){var i,a,o,s;if(this.context.track("CallAdUnit",{adFormat:(a=(i=n.adFormat)==null?void 0:i.toString())!=null?a:null,fullWidthResponsive:(o=n.fullWidthResponsive)!=null?o:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:l,slot:c,adFormat:p,fullWidthResponsive:u,style:m}=n,h;if(!l)throw new Error("targeting element is required");if(typeof l=="string"?h=document.querySelector(l):h=l,!h)throw new Error("targeting element not found");let w=c;if(w||(w=this.initParams.unitId),!w)throw new Error("slot is required");let E=typeof p=="object"&&Array.isArray(p)?p.join(", "):p,I=document.createElement("ins");if(I.className="adsbygoogle",I.id="jolibox-ads",I.style.display="block",I.setAttribute("data-ad-client",this.initParams.clientId),I.setAttribute("data-ad-slot",w),E&&I.setAttribute("data-ad-format",E),u&&I.setAttribute("data-full-width-responsive",u),m&&I.setAttribute("style",m),(s=this.contextInfo.testAdsMode)!=null?s:!1){let b=document.createElement("div");b.style.position="absolute",b.style.top="0",b.style.left="0",b.style.width="100%",b.style.height="100%",b.style.display="flex",b.style.justifyContent="center",b.style.alignItems="center",b.style.backgroundColor="rgba(0, 0, 0, 0.5)",b.style.color="white",b.innerHTML="Test Ad",I.style.position="relative",h.appendChild(I),I.appendChild(b)}else h.appendChild(I),new MutationObserver(b=>{b.forEach(R=>{if(R.type==="attributes"&&R.attributeName==="data-ad-status"){let k=I.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:k!=null?k:"null"})}})}).observe(I,{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 A(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 xp(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 Pp(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 Np=function(){function e(r){var n=this;this._insertTag=function(i){var a;n.tags.length===0?n.insertionPoint?a=n.insertionPoint.nextSibling:n.prepend?a=n.container.firstChild:a=n.before:a=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(i,a),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(Pp(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=xp(n);try{i.insertRule(r,i.cssRules.length)}catch(a){}}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}(),Se="-ms-",yi="-moz-",Q="-webkit-",Fd="comm",ps="rule",vs="decl",Dp="@import",jd="@keyframes",Lp="@layer",Up=Math.abs,Ri=String.fromCharCode,Bp=Object.assign;function Mp(e,t){return _e(e,0)^45?(((t<<2^_e(e,0))<<2^_e(e,1))<<2^_e(e,2))<<2^_e(e,3):0}function Hd(e){return e.trim()}function Gp(e,t){return(e=t.exec(e))?e[0]:e}function Z(e,t,r){return e.replace(t,r)}function jo(e,t){return e.indexOf(t)}function _e(e,t){return e.charCodeAt(t)|0}function Hr(e,t,r){return e.slice(t,r)}function Ze(e){return e.length}function gs(e){return e.length}function ci(e,t){return t.push(e),e}function Jp(e,t){return e.map(t).join("")}var Oi=1,lr=1,qd=0,Le=0,pe=0,cr="";function ki(e,t,r,n,i,a,o){return{value:e,root:t,parent:r,type:n,props:i,children:a,line:Oi,column:lr,length:o,return:""}}function Lr(e,t){return Bp(ki("",null,null,"",null,null,0),e,{length:-e.length},t)}function Fp(){return pe}function jp(){return pe=Le>0?_e(cr,--Le):0,lr--,pe===10&&(lr=1,Oi--),pe}function je(){return pe=Le<qd?_e(cr,Le++):0,lr++,pe===10&&(lr=1,Oi++),pe}function et(){return _e(cr,Le)}function fi(){return Le}function Kr(e,t){return Hr(cr,e,t)}function qr(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 Vd(e){return Oi=lr=1,qd=Ze(cr=e),Le=0,[]}function $d(e){return cr="",e}function hi(e){return Hd(Kr(Le-1,Ho(e===91?e+2:e===40?e+1:e)))}function Hp(e){for(;(pe=et())&&pe<33;)je();return qr(e)>2||qr(pe)>3?"":" "}function qp(e,t){for(;--t&&je()&&!(pe<48||pe>102||pe>57&&pe<65||pe>70&&pe<97););return Kr(e,fi()+(t<6&&et()==32&&je()==32))}function Ho(e){for(;je();)switch(pe){case e:return Le;case 34:case 39:e!==34&&e!==39&&Ho(pe);break;case 40:e===41&&Ho(e);break;case 92:je();break}return Le}function Vp(e,t){for(;je()&&e+pe!==57&&!(e+pe===84&&et()===47););return"/*"+Kr(t,Le-1)+"*"+Ri(e===47?e:je())}function $p(e){for(;!qr(et());)je();return Kr(e,Le)}function Kp(e){return $d(mi("",null,null,null,[""],e=Vd(e),0,[0],e))}function mi(e,t,r,n,i,a,o,s,l){for(var c=0,p=0,u=o,m=0,h=0,w=0,E=1,I=1,b=1,R=0,k="",D=i,J=a,S=n,N=k;I;)switch(w=R,R=je()){case 40:if(w!=108&&_e(N,u-1)==58){jo(N+=Z(hi(R),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:N+=hi(R);break;case 9:case 10:case 13:case 32:N+=Hp(w);break;case 92:N+=qp(fi()-1,7);continue;case 47:switch(et()){case 42:case 47:ci(Wp(Vp(je(),fi()),t,r),l);break;default:N+="/"}break;case 123*E:s[c++]=Ze(N)*b;case 125*E:case 59:case 0:switch(R){case 0:case 125:I=0;case 59+p:b==-1&&(N=Z(N,/\f/g,"")),h>0&&Ze(N)-u&&ci(h>32?od(N+";",n,r,u-1):od(Z(N," ","")+";",n,r,u-2),l);break;case 59:N+=";";default:if(ci(S=ad(N,t,r,c,p,i,s,k,D=[],J=[],u),a),R===123)if(p===0)mi(N,t,S,S,D,a,u,s,J);else switch(m===99&&_e(N,3)===110?100:m){case 100:case 108:case 109:case 115:mi(e,S,S,n&&ci(ad(e,S,S,0,0,i,s,k,i,D=[],u),J),i,J,u,s,n?D:J);break;default:mi(N,S,S,S,[""],J,0,s,J)}}c=p=h=0,E=b=1,k=N="",u=o;break;case 58:u=1+Ze(N),h=w;default:if(E<1){if(R==123)--E;else if(R==125&&E++==0&&jp()==125)continue}switch(N+=Ri(R),R*E){case 38:b=p>0?1:(N+="\f",-1);break;case 44:s[c++]=(Ze(N)-1)*b,b=1;break;case 64:et()===45&&(N+=hi(je())),m=et(),p=u=Ze(k=N+=$p(fi())),R++;break;case 45:w===45&&Ze(N)==2&&(E=0)}}return a}function ad(e,t,r,n,i,a,o,s,l,c,p){for(var u=i-1,m=i===0?a:[""],h=gs(m),w=0,E=0,I=0;w<n;++w)for(var b=0,R=Hr(e,u+1,u=Up(E=o[w])),k=e;b<h;++b)(k=Hd(E>0?m[b]+" "+R:Z(R,/&\f/g,m[b])))&&(l[I++]=k);return ki(e,t,r,i===0?ps:s,l,c,p)}function Wp(e,t,r){return ki(e,t,r,Fd,Ri(Fp()),Hr(e,2,-2),0)}function od(e,t,r,n){return ki(e,t,r,vs,Hr(e,0,n),Hr(e,n+1,-1),n)}function or(e,t){for(var r="",n=gs(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function zp(e,t,r,n){switch(e.type){case Lp:if(e.children.length)break;case Dp:case vs:return e.return=e.return||e.value;case Fd:return"";case jd:return e.return=e.value+"{"+or(e.children,n)+"}";case ps:e.value=e.props.join(",")}return Ze(r=or(e.children,n))?e.return=e.value+"{"+r+"}":""}function Yp(e){var t=gs(e);return function(r,n,i,a){for(var o="",s=0;s<t;s++)o+=e[s](r,n,i,a)||"";return o}}function Xp(e){return function(t){t.root||(t=t.return)&&e(t)}}function Qp(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Zp=function(e,t,r){for(var n=0,i=0;n=i,i=et(),n===38&&i===12&&(t[r]=1),!qr(i);)je();return Kr(e,Le)},ev=function(e,t){var r=-1,n=44;do switch(qr(n)){case 0:n===38&&et()===12&&(t[r]=1),e[r]+=Zp(Le-1,t,r);break;case 2:e[r]+=hi(n);break;case 4:if(n===44){e[++r]=et()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=Ri(n)}while(n=je());return e},tv=function(e,t){return $d(ev(Vd(e),t))},sd=new WeakMap,rv=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&&!sd.get(r))&&!n){sd.set(e,!0);for(var i=[],a=tv(t,i),o=r.props,s=0,l=0;s<a.length;s++)for(var c=0;c<o.length;c++,l++)e.props[l]=i[s]?a[s].replace(/&\f/g,o[c]):o[c]+" "+a[s]}}},nv=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function Kd(e,t){switch(Mp(e,t)){case 5103:return Q+"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 Q+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Q+e+yi+e+Se+e+e;case 6828:case 4268:return Q+e+Se+e+e;case 6165:return Q+e+Se+"flex-"+e+e;case 5187:return Q+e+Z(e,/(\w+).+(:[^]+)/,Q+"box-$1$2"+Se+"flex-$1$2")+e;case 5443:return Q+e+Se+"flex-item-"+Z(e,/flex-|-self/,"")+e;case 4675:return Q+e+Se+"flex-line-pack"+Z(e,/align-content|flex-|-self/,"")+e;case 5548:return Q+e+Se+Z(e,"shrink","negative")+e;case 5292:return Q+e+Se+Z(e,"basis","preferred-size")+e;case 6060:return Q+"box-"+Z(e,"-grow","")+Q+e+Se+Z(e,"grow","positive")+e;case 4554:return Q+Z(e,/([^-])(transform)/g,"$1"+Q+"$2")+e;case 6187:return Z(Z(Z(e,/(zoom-|grab)/,Q+"$1"),/(image-set)/,Q+"$1"),e,"")+e;case 5495:case 3959:return Z(e,/(image-set\([^]*)/,Q+"$1$`$1");case 4968:return Z(Z(e,/(.+:)(flex-)?(.*)/,Q+"box-pack:$3"+Se+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Q+e+e;case 4095:case 3583:case 4068:case 2532:return Z(e,/(.+)-inline(.+)/,Q+"$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(Ze(e)-1-t>6)switch(_e(e,t+1)){case 109:if(_e(e,t+4)!==45)break;case 102:return Z(e,/(.+:)(.+)-([^]+)/,"$1"+Q+"$2-$3$1"+yi+(_e(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~jo(e,"stretch")?Kd(Z(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(_e(e,t+1)!==115)break;case 6444:switch(_e(e,Ze(e)-3-(~jo(e,"!important")&&10))){case 107:return Z(e,":",":"+Q)+e;case 101:return Z(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Q+(_e(e,14)===45?"inline-":"")+"box$3$1"+Q+"$2$3$1"+Se+"$2box$3")+e}break;case 5936:switch(_e(e,t+11)){case 114:return Q+e+Se+Z(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Q+e+Se+Z(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Q+e+Se+Z(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Q+e+Se+e+e}return e}var iv=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case vs:e.return=Kd(e.value,e.length);break;case jd:return or([Lr(e,{value:Z(e.value,"@","@"+Q)})],n);case ps:if(e.length)return Jp(e.props,function(i){switch(Gp(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return or([Lr(e,{props:[Z(i,/:(read-\w+)/,":"+yi+"$1")]})],n);case"::placeholder":return or([Lr(e,{props:[Z(i,/:(plac\w+)/,":"+Q+"input-$1")]}),Lr(e,{props:[Z(i,/:(plac\w+)/,":"+yi+"$1")]}),Lr(e,{props:[Z(i,/:(plac\w+)/,Se+"input-$1")]})],n)}return""})}},av=[iv],ov=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(w){var E=w.getAttribute("data-emotion");E.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var n=e.stylisPlugins||av,i={},a,o=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(w){for(var E=w.getAttribute("data-emotion").split(" "),I=1;I<E.length;I++)i[E[I]]=!0;o.push(w)});var s,l=[rv,nv];{var c,p=[zp,Xp(function(w){c.insert(w)})],u=Yp(l.concat(n,p)),m=function(w){return or(Kp(w),u)};s=function(w,E,I,b){c=I,m(w?w+"{"+E.styles+"}":E.styles),b&&(h.inserted[E.name]=!0)}}var h={key:t,sheet:new Np({key:t,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return h.sheet.hydrate(o),h};function sv(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 lv={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},cv=/[A-Z]|^ms/g,dv=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Wd=function(e){return e.charCodeAt(1)===45},ld=function(e){return e!=null&&typeof e!="boolean"},wo=Qp(function(e){return Wd(e)?e:e.replace(cv,"-$&").toLowerCase()}),cd=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(dv,function(r,n,i){return It={name:n,styles:i,next:It},n})}return lv[e]!==1&&!Wd(e)&&typeof t=="number"&&t!==0?t+"px":t};function bi(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 It={name:i.name,styles:i.styles,next:It},i.name;var a=r;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)It={name:o.name,styles:o.styles,next:It},o=o.next;var s=a.styles+";";return s}return uv(e,t,r)}}var l=r;if(t==null)return l;var c=t[l];return c!==void 0?c:l}function uv(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=bi(e,t,r[i])+";";else for(var a in r){var o=r[a];if(typeof o!="object"){var s=o;t!=null&&t[s]!==void 0?n+=a+"{"+t[s]+"}":ld(s)&&(n+=wo(a)+":"+cd(a,s)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var l=0;l<o.length;l++)ld(o[l])&&(n+=wo(a)+":"+cd(a,o[l])+";");else{var c=bi(e,t,o);switch(a){case"animation":case"animationName":{n+=wo(a)+":"+c+";";break}default:n+=a+"{"+c+"}"}}}return n}var dd=/label:\s*([^\s;{]+)\s*(;|$)/g,It;function Eo(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="";It=void 0;var a=e[0];if(a==null||a.raw===void 0)n=!1,i+=bi(r,t,a);else{var o=a;i+=o[0]}for(var s=1;s<e.length;s++)if(i+=bi(r,t,e[s]),n){var l=a;i+=l[s]}dd.lastIndex=0;for(var c="",p;(p=dd.exec(i))!==null;)c+="-"+p[1];var u=sv(i)+c;return{name:u,styles:i,next:It}}function zd(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}var fv=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},hv=function(e,t,r){fv(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 ud(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function fd(e,t,r){var n=[],i=zd(e,n,r);return n.length<2?r:i+t(n)}var mv=function(e){var t=ov(e);t.sheet.speedy=function(o){this.isSpeedy=o},t.compat=!0;var r=function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];var c=Eo(s,t.registered,void 0);return hv(t,c),t.key+"-"+c.name},n=function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];var c=Eo(s,t.registered),p="animation-"+c.name;return ud(t,{name:c.name,styles:"@keyframes "+p+"{"+c.styles+"}"}),p},i=function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];var c=Eo(s,t.registered);ud(t,c)},a=function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return fd(t.registered,r,pv(s))};return{css:r,cx:a,injectGlobal:i,keyframes:n,hydrate:function(o){o.forEach(function(s){t.inserted[s]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:zd.bind(null,t.registered),merge:fd.bind(null,t.registered,r)}},pv=function e(t){for(var r="",n=0;n<t.length;n++){var i=t[n];if(i!=null){var a=void 0;switch(typeof i){case"boolean":break;case"object":{if(Array.isArray(i))a=e(i);else{a="";for(var o in i)i[o]&&o&&(a&&(a+=" "),a+=o)}break}default:a=i}a&&(r&&(r+=" "),r+=a)}}return r},vv=mv({key:"css"}),Ce=vv.css,qo,Fe,Io,hd,md=0,Yd=[],ve=j,pd=ve.__b,vd=ve.__r,gd=ve.diffed,_d=ve.__c,yd=ve.unmount,bd=ve.__;function gv(e,t){ve.__h&&ve.__h(Fe,e,md||t),md=0;var r=Fe.__H||(Fe.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Xd(e,t){var r=gv(qo++,7);return bv(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function _v(){for(var e;e=Yd.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(pi),e.__H.__h.forEach(Vo),e.__H.__h=[]}catch(t){e.__H.__h=[],ve.__e(t,e.__v)}}ve.__b=function(e){Fe=null,pd&&pd(e)},ve.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),bd&&bd(e,t)},ve.__r=function(e){vd&&vd(e),qo=0;var t=(Fe=e.__c).__H;t&&(Io===Fe?(t.__h=[],Fe.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(pi),t.__h.forEach(Vo),t.__h=[],qo=0)),Io=Fe},ve.diffed=function(e){gd&&gd(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Yd.push(t)!==1&&hd===ve.requestAnimationFrame||((hd=ve.requestAnimationFrame)||yv)(_v)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Io=Fe=null},ve.__c=function(e,t){t.some(function(r){try{r.__h.forEach(pi),r.__h=r.__h.filter(function(n){return!n.__||Vo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],ve.__e(n,r.__v)}}),_d&&_d(e,t)},ve.unmount=function(e){yd&&yd(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{pi(n)}catch(i){t=i}}),r.__H=void 0,t&&ve.__e(t,r.__v))};var wd=typeof requestAnimationFrame=="function";function yv(e){var t,r=function(){clearTimeout(n),wd&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);wd&&(t=requestAnimationFrame(r))}function pi(e){var t=Fe,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Fe=t}function Vo(e){var t=Fe;e.__c=e.__(),Fe=t}function bv(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var wv=Symbol.for("preact-signals");function Ti(){if(At>1)At--;else{for(var e,t=!1;Gr!==void 0;){var r=Gr;for(Gr=void 0,$o++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Zd(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if($o=0,At--,t)throw e}}function ye(e){if(At>0)return e();At++;try{return e()}finally{Ti()}}var ie=void 0,Gr=void 0,At=0,$o=0,wi=0;function Qd(e){if(ie!==void 0){var t=e.n;if(t===void 0||t.t!==ie)return t={i:0,S:e,p:ie.s,n:void 0,t:ie,e:void 0,x:void 0,r:t},ie.s!==void 0&&(ie.s.n=t),ie.s=t,e.n=t,32&ie.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=ie.s,t.n=void 0,ie.s.n=t,ie.s=t),t}}function be(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}be.prototype.brand=wv;be.prototype.h=function(){return!0};be.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)};be.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)}};be.prototype.subscribe=function(e){var t=this;return zr(function(){var r=t.value,n=ie;ie=void 0;try{e(r)}finally{ie=n}})};be.prototype.valueOf=function(){return this.value};be.prototype.toString=function(){return this.value+""};be.prototype.toJSON=function(){return this.value};be.prototype.peek=function(){var e=ie;ie=void 0;try{return this.value}finally{ie=e}};Object.defineProperty(be.prototype,"value",{get:function(){var e=Qd(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if($o>100)throw new Error("Cycle detected");this.v=e,this.i++,wi++,At++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Ti()}}}});function W(e){return new be(e)}function Zd(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 eu(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 tu(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 dr(e){be.call(this,void 0),this.x=e,this.s=void 0,this.g=wi-1,this.f=4}(dr.prototype=new be).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===wi))return!0;if(this.g=wi,this.f|=1,this.i>0&&!Zd(this))return this.f&=-2,!0;var e=ie;try{eu(this),ie=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 ie=e,tu(this),this.f&=-2,!0};dr.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)}be.prototype.S.call(this,e)};dr.prototype.U=function(e){if(this.t!==void 0&&(be.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)}};dr.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(dr.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Qd(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Jr(e){return new dr(e)}function ru(e){var t=e.u;if(e.u=void 0,typeof t=="function"){At++;var r=ie;ie=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,_s(e),n}finally{ie=r,Ti()}}}function _s(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ru(e)}function Ev(e){if(ie!==this)throw new Error("Out-of-order effect");tu(this),ie=e,this.f&=-2,8&this.f&&_s(this),Ti()}function Wr(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Wr.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()}};Wr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ru(this),eu(this),At++;var e=ie;return ie=this,Ev.bind(this,e)};Wr.prototype.N=function(){2&this.f||(this.f|=2,this.o=Gr,Gr=this)};Wr.prototype.d=function(){this.f|=8,1&this.f||_s(this)};function zr(e){var t=new Wr(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var nu,Ao,iu=[];zr(function(){nu=this.N})();function ur(e,t){j[e]=t.bind(null,j[e]||function(){})}function Ei(e){Ao&&Ao(),Ao=e&&e.S()}function au(e){var t=this,r=e.data,n=ou(r);n.value=r;var i=Xd(function(){for(var s=t,l=t.__v;l=l.__;)if(l.__c){l.__c.__$f|=4;break}var c=Jr(function(){var h=n.value.value;return h===0?0:h===!0?"":h||""}),p=Jr(function(){return!Array.isArray(c.value)&&!co(c.value)}),u=zr(function(){if(this.N=su,p.value){var h=c.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=h)}}),m=t.__$u.d;return t.__$u.d=function(){u(),m.call(this)},[p,c]},[]),a=i[0],o=i[1];return a.value?o.peek():o.value}au.displayName="_st";Object.defineProperties(be.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:au},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});ur("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var a=n[i];a instanceof be&&(r||(t.__np=r={}),r[i]=a,n[i]=a.peek())}}e(t)});ur("__r",function(e,t){Ei();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var a;return zr(function(){a=this}),a.c=function(){n.__$f|=1,n.setState({})},a}())),Ei(r),e(t)});ur("__e",function(e,t,r,n){Ei(),e(t,r,n)});ur("diffed",function(e,t){Ei();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var a=r.U;if(a)for(var o in a){var s=a[o];s!==void 0&&!(o in n)&&(s.d(),a[o]=void 0)}else a={},r.U=a;for(var l in n){var c=a[l],p=n[l];c===void 0?(c=Iv(r,l,p,i),a[l]=c):c.o(p,i)}}}e(t)});function Iv(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,a=W(r);return{o:function(o,s){a.value=o,n=s},d:zr(function(){this.N=su;var o=a.value.value;n[t]!==o&&(n[t]=o,i?e[t]=o:o?e.setAttribute(t,o):e.removeAttribute(t))})}}ur("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 a=n[i];a&&a.d()}}}}else{var o=t.__c;if(o){var s=o.__$u;s&&(o.__$u=void 0,s.d())}}e(t)});ur("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});Je.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 a=2&this.__$f;if(!(n||a||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var o in e)if(o!=="__source"&&e[o]!==this.props[o])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function ou(e){return Xd(function(){return W(e)},[])}var Av=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Sv(){ye(function(){for(var e;e=iu.shift();)nu.call(e)})}function su(){iu.push(this)===1&&(j.requestAnimationFrame||Av)(Sv)}var ge=Ce`
|
|
12
12
|
inset: 0;
|
|
13
13
|
clear: none;
|
|
14
14
|
float: none;
|
|
@@ -26,8 +26,8 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
26
26
|
text-decoration: none;
|
|
27
27
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
28
28
|
'Helvetica Neue', sans-serif;
|
|
29
|
-
`;function
|
|
30
|
-
${
|
|
29
|
+
`;function Cv(e,t){let r=ii(e);go(()=>{r.current=e},[e]),Gt(()=>{if(t===null)return;let n=setInterval(()=>{r.current()},t);return()=>{clearInterval(n)}},[t])}var Rv=0;function X(e,t,r,n,i,a){t||(t={});var o,s,l=t;if("ref"in l)for(s in l={},t)s=="ref"?o=t[s]:l[s]=t[s];var c={type:e,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Rv,__i:-1,__u:0,__source:i,__self:a};if(typeof e=="function"&&(o=e.defaultProps))for(s in o)l[s]===void 0&&(l[s]=o[s]);return j.vnode&&j.vnode(c),c}var Ov=Ce`
|
|
30
|
+
${ge}
|
|
31
31
|
position: fixed;
|
|
32
32
|
top: 0;
|
|
33
33
|
left: 0;
|
|
@@ -40,7 +40,7 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
40
40
|
height: 100vh;
|
|
41
41
|
|
|
42
42
|
.card-wrapper {
|
|
43
|
-
${
|
|
43
|
+
${ge}
|
|
44
44
|
position: relative;
|
|
45
45
|
display: flex;
|
|
46
46
|
flex-direction: column;
|
|
@@ -54,7 +54,7 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
54
54
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
55
55
|
|
|
56
56
|
.body {
|
|
57
|
-
${
|
|
57
|
+
${ge}
|
|
58
58
|
display: flex;
|
|
59
59
|
flex-direction: column;
|
|
60
60
|
width: 100%;
|
|
@@ -63,7 +63,7 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
63
63
|
box-sizing: border-box;
|
|
64
64
|
justify-content: center;
|
|
65
65
|
.title {
|
|
66
|
-
${
|
|
66
|
+
${ge}
|
|
67
67
|
text-align: center;
|
|
68
68
|
font-size: 16px;
|
|
69
69
|
font-weight: bold;
|
|
@@ -71,7 +71,7 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.content {
|
|
74
|
-
${
|
|
74
|
+
${ge}
|
|
75
75
|
font-size: 14px;
|
|
76
76
|
color: #888;
|
|
77
77
|
margin-bottom: 16px;
|
|
@@ -79,13 +79,13 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
.footer {
|
|
82
|
-
${
|
|
82
|
+
${ge}
|
|
83
83
|
display: flex;
|
|
84
84
|
align-items: center;
|
|
85
85
|
width: 100%;
|
|
86
86
|
height: 40px;
|
|
87
87
|
button {
|
|
88
|
-
${
|
|
88
|
+
${ge}
|
|
89
89
|
border: none;
|
|
90
90
|
outline: none;
|
|
91
91
|
height: 100%;
|
|
@@ -101,8 +101,8 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
`,
|
|
105
|
-
${
|
|
104
|
+
`,vt=W(null),Ko=W(""),Wo=W(""),vi=W(!1),kv=()=>{var e;(e=vt.value)==null||e.call(vt,!1)},Tv=()=>{var e;(e=vt.value)==null||e.call(vt,!0)},xv=e=>A(void 0,null,function*(){let{title:t,content:r}=e;return vt.value&&(vt.value(!1),ye(()=>{vt.value=null,vi.value=!1})),ye(()=>{Ko.value=t||"",Wo.value=r||"",vi.value=!0}),new Promise(n=>{vt.value=i=>{ye(()=>{vt.value=null,vi.value=!1,Ko.value="",Wo.value=""}),n(i)}})}),Pv=()=>vi.value?X("div",{className:Ov,children:X("div",{className:"card-wrapper",children:[X("div",{className:"body",children:[X("div",{className:"title",children:Ko.value}),X("div",{className:"content",children:Wo.value})]}),X("div",{className:"footer",children:[X("button",{onClick:kv,className:"cancel-btn",children:"Cancel"}),X("button",{onClick:Tv,className:"confirm-btm",children:"Confirm"})]})]})}):null,Nv=Ce`
|
|
105
|
+
${ge}
|
|
106
106
|
position: relative;
|
|
107
107
|
display: flex;
|
|
108
108
|
align-items: center;
|
|
@@ -120,7 +120,7 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
button {
|
|
123
|
-
${
|
|
123
|
+
${ge}
|
|
124
124
|
padding: 0 20px;
|
|
125
125
|
height: 30px;
|
|
126
126
|
line-height: 30px;
|
|
@@ -134,8 +134,8 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
134
134
|
cursor: not-allowed;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
`,
|
|
138
|
-
${
|
|
137
|
+
`,Dv=()=>{let e=W(!1),t=W(null);return{timerPaused:e,startTimestamp:t,startTimer:()=>{ye(()=>{t.value=Date.now(),e.value=!1})}}},Lv=e=>{let{countdown:t=0,mode:r,onClose:n,state:i}=e,{startTimestamp:a,timerPaused:o}=i,s=ou(t);Cv(()=>{s.value>0?s.value-=1:ye(()=>{o.value=!0,s.value=0})},o.value?null:1e3);let l=Jr(()=>{if(r==="interstitial"||r==="rewarded_insterstitial"||!a.value)return!1;let h=Date.now()-a.value;return s.value>0&&t-s.value>=5&&h>=5e3}),c=Jr(()=>{if(r==="interstitial")return!0;if(!a.value)return!1;let h=Date.now()-a.value;return s.value<=0&&h>=(t-1)*1e3&&t>5}),p=Jr(()=>r==="interstitial"?!1:!l.value&&!c.value),u=()=>A(void 0,null,function*(){if(o.value=!0,!(yield xv({title:"Are you sure?",content:"You will lose your reward if you dismiss this Ad."}))){o.value=!1;return}n("dismiss"),ye(()=>{o.value=!0,s.value=0,a.value=null})}),m=()=>{n("viewed"),ye(()=>{o.value=!0,s.value=0,a.value=null})};return X("div",{className:Nv,children:[s.value>0&&r!=="interstitial"&&X("div",{className:"timer",children:[s.value,"s"]}),X("button",{onClick:l.value?u:c.value?m:void 0,disabled:p.value,children:X("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:X("path",{d:"M13.3 0.710215C12.91 0.320215 12.28 0.320215 11.89 0.710215L6.99997 5.59022L2.10997 0.700215C1.71997 0.310215 1.08997 0.310215 0.699971 0.700215C0.309971 1.09021 0.309971 1.72022 0.699971 2.11022L5.58997 7.00022L0.699971 11.8902C0.309971 12.2802 0.309971 12.9102 0.699971 13.3002C1.08997 13.6902 1.71997 13.6902 2.10997 13.3002L6.99997 8.41021L11.89 13.3002C12.28 13.6902 12.91 13.6902 13.3 13.3002C13.69 12.9102 13.69 12.2802 13.3 11.8902L8.40997 7.00022L13.3 2.11022C13.68 1.73022 13.68 1.09022 13.3 0.710215Z",fill:"white"})})})]})},Uv=()=>{let e=W(),t=W(),r=W(),n=W(),i=W(),a=W(!1),o=W(15),s=W(""),l=W("reward");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,visible:a,countdown:o,src:s,mode:l}},Bv=Ce`
|
|
138
|
+
${ge}
|
|
139
139
|
position: fixed;
|
|
140
140
|
z-index: 2147483647;
|
|
141
141
|
background: white;
|
|
@@ -145,7 +145,7 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
145
145
|
flex-direction: column;
|
|
146
146
|
|
|
147
147
|
iframe {
|
|
148
|
-
${
|
|
148
|
+
${ge}
|
|
149
149
|
flex: 1;
|
|
150
150
|
position: relative;
|
|
151
151
|
display: block;
|
|
@@ -153,22 +153,22 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
153
153
|
width: 100%;
|
|
154
154
|
height: 100%;
|
|
155
155
|
}
|
|
156
|
-
`,
|
|
157
|
-
${
|
|
156
|
+
`,Mv=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:a,adLoaded:o,visible:s,countdown:l,src:c,mode:p}=t,u=xr(()=>Dv(),[]),[m,h]=dt(!1),w=I=>{var b,R,k,D;s.value=!1,I==="dismiss"?(b=n.value)==null||b.call(n):I==="viewed"&&((R=i.value)==null||R.call(i)),(k=r.value)==null||k.call(r),(D=a.value)==null||D.call(a),h(!1)},E=Pr(()=>{var I;m||(h(!0),(I=o.value)==null||I.call(o))},[m]);return Gt(()=>{m&&(p.value==="reward"||p.value==="rewarded_insterstitial")&&setTimeout(()=>{u.startTimer()},100)},[m,p.value]),s.value?X("div",{className:Bv,children:[X(Lv,{mode:p.value,onClose:w,countdown:l.value,state:u}),s.value&&X("iframe",{src:c.value,onLoad:E,sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols"}),X(Pv,{})]}):null};function ft(e,t,r){return(t=Gv(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gv(e){var t=Jv(e,"string");return typeof t=="symbol"?t:t+""}function Jv(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 zo=class{constructor(t,r){ft(this,"name","OKSPIN"),ft(this,"initialized",!1),ft(this,"initCompleter",null),ft(this,"context",void 0),ft(this,"initParams",void 0),ft(this,"adsOverlay",null),ft(this,"adsIsShowing",!1),ft(this,"lastUnDisplayedAdBreak",null),ft(this,"state",Uv()),this.context=t,this.initParams=r}init(){return A(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg"),oi(X(Mv,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(t=this.initCompleter)==null||t.call(this)})}adConfig(t){var r;if(this.initialized){(r=t.onReady)==null||r.call(t);return}this.initCompleter=()=>{var n;(n=t.onReady)==null||n.call(t)}}adBreak(t,r){return A(this,null,function*(){var n,i,a,o,s,l,c,p;if(!this.initialized||!this.adsOverlay||!r.params.url){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}switch(t.type){case"preroll":{(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(o=t.beforeAd)==null||o.call(t);let u=()=>{var h;this.adsIsShowing=!1,(h=t.afterAd)==null||h.call(t)},m=()=>{var h;this.adsIsShowing=!1,(h=t.adBreakDone)==null||h.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})};ye(()=>{this.adsIsShowing=!0,this.state.afterAd.value=u,this.state.adBreakDone.value=m,this.state.src.value=r.params.url,this.state.mode.value="interstitial",this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((l=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||l.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(c=t.beforeAd)==null||c.call(t);let u=()=>{var b;this.adsIsShowing=!1,(b=t.afterAd)==null||b.call(t)},m={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},h=()=>{var b;this.adsIsShowing=!1,m.breakStatus="dismissed",(b=t.adDismissed)==null||b.call(t)},w=()=>{var b;this.adsIsShowing=!1,m.breakStatus="viewed",(b=t.adViewed)==null||b.call(t)},E=()=>{var b;this.adsIsShowing=!1,(b=t.adBreakDone)==null||b.call(t,m)};ye(()=>{this.state.afterAd.value=u,this.state.adDismissed.value=h,this.state.adViewed.value=w,this.state.adBreakDone.value=E});let I=()=>{var b;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(b=t.adBreakDone)==null||b.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,ye(()=>{var R;this.state.countdown.value=(R=r.params.countdown)!=null?R:15,this.state.src.value=r.params.url,this.state.mode.value="reward",this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(p=t.beforeReward)==null||p.call(t,I);break}}})}},Fv=()=>{let e=W(null),t=W(null),r=W(null),n=W(null),i=W(null),a=W(null),o=W(!1),s=W(null);return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,adError:a,visible:o,payload:s}},jv=Ce`
|
|
157
|
+
${ge}
|
|
158
158
|
position: fixed;
|
|
159
159
|
inset: 0;
|
|
160
160
|
z-index: 2147483647;
|
|
161
161
|
display: flex;
|
|
162
162
|
background: #000000;
|
|
163
|
-
`,
|
|
164
|
-
${
|
|
163
|
+
`,Hv=Ce`
|
|
164
|
+
${ge}
|
|
165
165
|
position: relative;
|
|
166
166
|
width: 100%;
|
|
167
167
|
height: 100%;
|
|
168
168
|
display: flex;
|
|
169
169
|
flex-direction: column;
|
|
170
170
|
color: #f7f9fc;
|
|
171
|
-
`,
|
|
171
|
+
`,qv=Ce`
|
|
172
172
|
position: absolute;
|
|
173
173
|
top: 24px;
|
|
174
174
|
left: 24px;
|
|
@@ -179,23 +179,23 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
179
179
|
border-radius: 999px;
|
|
180
180
|
background: rgba(0, 0, 0, 0.65);
|
|
181
181
|
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
182
|
-
`,
|
|
182
|
+
`,Vv=Ce`
|
|
183
183
|
font-size: 11px;
|
|
184
184
|
letter-spacing: 0.08em;
|
|
185
185
|
text-transform: uppercase;
|
|
186
186
|
color: #c7d4ef;
|
|
187
|
-
|
|
187
|
+
`,$v=Ce`
|
|
188
188
|
font-size: 14px;
|
|
189
189
|
font-weight: 500;
|
|
190
|
-
`,
|
|
191
|
-
${
|
|
190
|
+
`,Kv=Ce`
|
|
191
|
+
${ge}
|
|
192
192
|
flex: 1;
|
|
193
193
|
background: #050505;
|
|
194
194
|
display: flex;
|
|
195
195
|
align-items: center;
|
|
196
196
|
justify-content: center;
|
|
197
197
|
padding: 0;
|
|
198
|
-
`,
|
|
198
|
+
`,Ed=Ce`
|
|
199
199
|
width: 100%;
|
|
200
200
|
height: 100%;
|
|
201
201
|
border: 2px dashed rgba(255, 255, 255, 0.08);
|
|
@@ -204,13 +204,13 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
204
204
|
justify-content: center;
|
|
205
205
|
color: #6e7da1;
|
|
206
206
|
font-size: 14px;
|
|
207
|
-
`,
|
|
207
|
+
`,Wv=Ce`
|
|
208
208
|
position: absolute;
|
|
209
209
|
bottom: 32px;
|
|
210
210
|
right: 32px;
|
|
211
211
|
display: flex;
|
|
212
212
|
gap: 12px;
|
|
213
|
-
`,
|
|
213
|
+
`,zv=Ce`
|
|
214
214
|
min-width: 160px;
|
|
215
215
|
min-height: 48px;
|
|
216
216
|
border-radius: 999px;
|
|
@@ -226,7 +226,7 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
226
226
|
opacity: 0.4;
|
|
227
227
|
cursor: not-allowed;
|
|
228
228
|
}
|
|
229
|
-
`,
|
|
229
|
+
`,Yv=Ce`
|
|
230
230
|
min-width: 120px;
|
|
231
231
|
min-height: 44px;
|
|
232
232
|
border-radius: 999px;
|
|
@@ -236,8 +236,8 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
236
236
|
font-size: 14px;
|
|
237
237
|
font-weight: 500;
|
|
238
238
|
cursor: pointer;
|
|
239
|
-
`,
|
|
240
|
-
${
|
|
239
|
+
`,Xv=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:a,adLoaded:o,adError:s,visible:l,payload:c}=t,[p,u]=dt(!1),[m,h]=dt(0),[w,E]=dt(!1),[I,b]=dt(!1),[R,k]=dt("Loading next content..."),D=ii(null),J=c.value,S=Pr(U=>{var M,G,K,Y;u(!1),l.value=!1,U==="dismiss"?(M=n.value)==null||M.call(n):(G=i.value)==null||G.call(i),(K=r.value)==null||K.call(r),(Y=a.value)==null||Y.call(a)},[l,n,i,r,a]),N=Pr(()=>{var U;u(!1),l.value=!1,(U=s.value)==null||U.call(s)},[l,s]);if(Gt(()=>{var U;if(!l.value||!J){h(0),E(!1),b(!1),k("Loading next content...");return}let M=J.mode==="reward"?15:0,G=Math.max(Math.floor((U=J.countdown)!=null?U:M),0);if(h(G),b(J.mode==="reward"?G===0:!0),E(J.mode==="interstitial"?G===0:!1),G===0)return;let K=G,Y=window.setInterval(()=>{K-=1,h(Math.max(K,0)),K<=0&&(window.clearInterval(Y),J.mode==="reward"?b(!0):E(!0))},1e3);return()=>{window.clearInterval(Y)}},[l.value,J,S]),Gt(()=>{var U;if(!l.value||!J)return;let M=D.current;if(!M)return;if(M.innerHTML="",k("Loading next content..."),u(!1),J.testMode){let Y=document.createElement("div");Y.className=Ed,Y.innerText="Preview slot placeholder",M.appendChild(Y),u(!0),(U=o.value)==null||U.call(o);return}if(typeof window=="undefined"){N();return}let G=document.createElement("ins");G.className="adsbygoogle",G.style.display="block",G.style.width="100%",G.style.height="100%",G.setAttribute("data-ad-client",J.clientId),G.setAttribute("data-ad-slot",J.unitId),G.setAttribute("data-ad-format","auto"),G.setAttribute("data-full-width-responsive","true"),J.channelId&&G.setAttribute("data-ad-channel",J.channelId),M.appendChild(G);let K=new MutationObserver(()=>{var Y;let Ue=G.getAttribute("data-ad-status");Ue==="filled"?(u(!0),k(""),(Y=o.value)==null||Y.call(o),K.disconnect()):Ue==="unfilled"&&(k("Slot currently unavailable."),u(!1),K.disconnect())});K.observe(G,{attributes:!0,attributeFilter:["data-ad-status"]});try{let Y=window;Y.adsbygoogle=Y.adsbygoogle||[],Y.adsbygoogle.push({})}catch(Y){K.disconnect(),N()}return()=>{K.disconnect(),M.innerHTML=""}},[l.value,J,o,N]),!l.value||!J)return null;let F=J.mode==="reward"?"Next content unlocking":"Content paused",H=m>0?`Content resumes in ${m}s`:"Content ready";return X("div",{className:jv,children:X("div",{className:Hv,children:[X("div",{className:qv,children:[X("div",{className:Vv,children:F}),X("div",{className:$v,children:H})]}),X("div",{className:Kv,ref:D,children:!p&&X("div",{className:Ed,children:R})}),X("div",{className:Wv,children:J.mode==="reward"?X("button",{className:zv,type:"button",onClick:()=>S("viewed"),disabled:!I,children:I?"Continue":`Continue in ${m}s`}):w&&X("button",{className:Yv,type:"button",onClick:()=>S("viewed"),children:"Continue"})})]})})};function ke(e,t,r){return(t=Qv(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qv(e){var t=Zv(e,"string");return typeof t=="symbol"?t:t+""}function Zv(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 Yo=class{constructor(t,r){if(ke(this,"name","ADSENSE_BANNER_AS_AFG"),ke(this,"initialized",!1),ke(this,"initCompleter",null),ke(this,"context",void 0),ke(this,"contextInfo",void 0),ke(this,"initParams",void 0),ke(this,"defaultCountdown",5),ke(this,"adsOverlay",null),ke(this,"adsIsShowing",!1),ke(this,"lastUnDisplayedAdBreak",null),ke(this,"requestCounter",0),ke(this,"scriptPromise",null),ke(this,"scriptReady",!1),ke(this,"scriptFailed",!1),ke(this,"state",Fv()),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,typeof window!="undefined"){let n=window;n.adsbygoogle=n.adsbygoogle||[]}}init(){return A(this,null,function*(){var t;if(typeof document!="undefined"){this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg-banner-as-afg"),oi(X(Xv,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay);try{yield this.ensureAdSenseScript()}catch(r){this.scriptFailed=!0,console.warn("[BannerAsAFG] Failed to load Google AdSense script",r)}this.initialized=!0,(t=this.initCompleter)==null||t.call(this)}})}ensureAdSenseScript(){var t;if(typeof document=="undefined")return Promise.resolve();if(this.scriptPromise)return this.scriptPromise;if(document.getElementById("google-adsense"))return this.scriptReady=!0,Promise.resolve();if(!this.initParams.clientId)return this.scriptFailed=!0,Promise.reject(new Error("BannerAsAFG requires a Google AdSense clientId."));let r=(t=this.contextInfo.testAdsMode)!=null?t:!1;return this.scriptPromise=new Promise((n,i)=>{let a=document.createElement("script");a.id="google-adsense",a.async=!0,a.crossOrigin="anonymous",a.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,r&&a.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&a.setAttribute("data-ad-channel",this.initParams.channelId),a.onload=()=>{this.scriptReady=!0,n()},a.onerror=()=>{this.scriptFailed=!0,i(new Error("Failed to fetch Google AdSense script."))},document.head.appendChild(a)}),this.scriptPromise}adConfig(t){var r;if(this.initialized){(r=t.onReady)==null||r.call(t);return}this.initCompleter=()=>{var n;(n=t.onReady)==null||n.call(t)}}resolveOverlayConfig(t){var r,n;let i=(n=(r=t==null?void 0:t.params)==null?void 0:r.countdown)!=null?n:this.defaultCountdown;return{rewardUnitId:this.initParams.rewardUnitId,interstitialUnitId:this.initParams.interstitialUnitId,channelId:this.initParams.channelId,countdown:Math.max(Math.floor(i),0)}}canDisplay(t){return!!t&&!!this.initParams.clientId&&!!this.adsOverlay&&this.initialized&&!this.scriptFailed&&this.scriptReady}showBannerOverlay(t,r){var n,i;let a=Math.max(Math.floor((n=r.countdown)!=null?n:t==="reward"?15:0),0),o={requestId:++this.requestCounter,clientId:this.initParams.clientId,unitId:t==="reward"?this.initParams.rewardUnitId:this.initParams.interstitialUnitId,channelId:r.channelId,countdown:a,mode:t,testMode:(i=this.contextInfo.testAdsMode)!=null?i:!1};this.state.payload.value=o,this.state.visible.value=!0}adBreak(t,r){var n,i,a,o,s,l,c,p,u;let m=t.type==="preroll"?"":t.name,h=t.type==="reward"?"reward":"interstitial";if(!this.initialized||!this.adsOverlay){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:m,breakFormat:h,breakStatus:"notReady"});return}if(this.adsIsShowing){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:m,breakFormat:h,breakStatus:"frequencyCapped"});return}let w=this.resolveOverlayConfig(r);if(!this.canDisplay(w.rewardUnitId)){(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:m,breakFormat:h,breakStatus:"notReady"});return}switch(t.type){case"preroll":{(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(s=t.beforeAd)==null||s.call(t);let E={breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"},I=()=>{var k;this.adsIsShowing=!1,(k=t.afterAd)==null||k.call(t)},b=()=>{var k;this.adsIsShowing=!1,(k=t.adBreakDone)==null||k.call(t,E)},R=()=>{var k,D;this.adsIsShowing=!1,E.breakStatus="noAdPreloaded",(k=t.afterAd)==null||k.call(t),(D=t.adBreakDone)==null||D.call(t,E)};ye(()=>{this.adsIsShowing=!0,this.state.afterAd.value=I,this.state.adBreakDone.value=b,this.state.adDismissed.value=null,this.state.adViewed.value=null,this.state.adError.value=R,this.showBannerOverlay("interstitial",w)});break}case"reward":{this.lastUnDisplayedAdBreak&&((c=(l=this.lastUnDisplayedAdBreak).adBreakDone)==null||c.call(l,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(p=t.beforeAd)==null||p.call(t);let E={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},I=()=>{var S;this.adsIsShowing=!1,(S=t.afterAd)==null||S.call(t)},b=()=>{var S;this.adsIsShowing=!1,E.breakStatus="dismissed",(S=t.adDismissed)==null||S.call(t)},R=()=>{var S;this.adsIsShowing=!1,E.breakStatus="viewed",(S=t.adViewed)==null||S.call(t)},k=()=>{var S;this.adsIsShowing=!1,(S=t.adBreakDone)==null||S.call(t,E)},D=()=>{var S,N;this.adsIsShowing=!1,E.breakStatus="noAdPreloaded",(S=t.afterAd)==null||S.call(t),(N=t.adBreakDone)==null||N.call(t,E)};ye(()=>{this.state.afterAd.value=I,this.state.adDismissed.value=b,this.state.adViewed.value=R,this.state.adBreakDone.value=k,this.state.adError.value=D});let J=()=>{var S,N;if(!this.canDisplay(w.rewardUnitId)){this.lastUnDisplayedAdBreak=null,(S=t.afterAd)==null||S.call(t),(N=t.adBreakDone)==null||N.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.lastUnDisplayedAdBreak=null,this.adsIsShowing=!0,ye(()=>{this.showBannerOverlay("reward",w)})};this.lastUnDisplayedAdBreak=t,(u=t.beforeReward)==null||u.call(t,J);break}}}},ar={};window.addEventListener("message",e=>{e.origin!=="https://ads.appsrockets.com"&&e.origin!=="https://stg-ads.appsrockets.com"||ar[e.data.type]&&ar[e.data.type].forEach(t=>{t(e.data.data)})});var rr=(e,t)=>{Gt(()=>(ar[e]||(ar[e]=new Set),ar[e].add(t),()=>{ar[e].delete(t)}),[e,t])},eg=()=>{let e=W(),t=W(),r=W(),n=W(),i=W(),a=W(),o=W(),s=W(!1),l=W("");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,adLinkClicked:a,adError:o,visible:s,src:l}},tg=Ce`
|
|
240
|
+
${ge}
|
|
241
241
|
position: fixed;
|
|
242
242
|
z-index: 2147483647;
|
|
243
243
|
background: white;
|
|
@@ -247,7 +247,7 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
247
247
|
flex-direction: column;
|
|
248
248
|
|
|
249
249
|
iframe {
|
|
250
|
-
${
|
|
250
|
+
${ge}
|
|
251
251
|
flex: 1;
|
|
252
252
|
position: relative;
|
|
253
253
|
display: block;
|
|
@@ -255,8 +255,8 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
255
255
|
width: 100%;
|
|
256
256
|
height: 100%;
|
|
257
257
|
}
|
|
258
|
-
`,Kp=t=>{let{state:e}=t,{afterAd:n,adDismissed:r,adViewed:a,adBreakDone:i,adLoaded:o,adLinkClicked:s,visible:l,src:d}=e,[_,f]=lt(!1),p=b=>{var E,C,w,O;f(!1),l.value=!1,b==="dismiss"?(E=r.value)==null||E.call(r):b==="viewed"&&((C=a.value)==null||C.call(a)),(w=n.value)==null||w.call(n),(O=i.value)==null||O.call(i)},h=()=>{var b;(b=o.value)==null||b.call(o)};return Wt("appsrockets_ad_dismissed",()=>p("dismiss")),Wt("appsrockets_ad_rewarded",()=>p("viewed")),Wt("appsrockets_ad_completed",()=>p("viewed")),Wt("appsrockets_ad_skipped",()=>p("viewed")),Wt("appsrockets_ad_clicked",b=>{var E;return(E=s.value)==null?void 0:E.call(s,b)}),Wt("appsrockets_ad_loaded",()=>f(!0)),l.value?z("div",{className:$p,style:{display:_?"flex":"none"},children:l.value&&z("iframe",{src:d.value,onLoad:h,allowFullScreen:!0,allow:"autoplay",sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols"})}):null};function dt(t,e,n){return(e=Wp(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wp(t){var e=zp(t,"string");return typeof e=="symbol"?e:e+""}function zp(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Io=class{constructor(e,n){dt(this,"name","APPSROCKETS"),dt(this,"initialized",!1),dt(this,"initCompleter",null),dt(this,"context",void 0),dt(this,"adsOverlay",null),dt(this,"adsIsShowing",!1),dt(this,"lastUnDisplayedAdBreak",null),dt(this,"state",Vp()),dt(this,"processUrl",r=>{var a;let i=this.context.getContextInfo(),o=new URL(r),s=new URLSearchParams(o.search);return s.has("joliSource")||s.set("joliSource",i.joliSource),s.get("osType")||s.set("osType",i.osType),s.get("runtimeType")||s.set("runtimeType",i.runtimeType),s.get("mode")||s.set("mode","AFG"),s.get("deviceId")||s.set("deviceId",i.deviceId),s.get("statusBarHeight")||s.set("statusBarHeight",((a=this.context.getWindowInfo().statusBarHeight)!=null?a:0).toString()),o.search=s.toString(),o.toString()}),this.context=e}init(){return S(this,null,function*(){var e;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg-appsrockets"),$r(z(Kp,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(e=this.initCompleter)==null||e.call(this)})}adConfig(e){var n;if(this.initialized){(n=e.onReady)==null||n.call(e);return}this.initCompleter=()=>{var r;(r=e.onReady)==null||r.call(e)}}adBreak(e,n){var r,a,i,o,s,l,d,_;if(!this.initialized||!this.adsOverlay||!n.params.url){(r=e.adBreakDone)==null||r.call(e,{breakType:e.type,breakName:e.type==="preroll"?"":e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(a=e.adBreakDone)==null||a.call(e,{breakType:e.type,breakName:e.type==="preroll"?"":e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}let f=p=>{var h,b;(b=(h=this.context).handleLinkClicked)==null||b.call(h,p)};switch(e.type){case"preroll":{(i=e.adBreakDone)==null||i.call(e,{breakType:e.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(o=e.beforeAd)==null||o.call(e);let p=()=>{var E;this.adsIsShowing=!1,(E=e.afterAd)==null||E.call(e)},h=()=>{var E;this.adsIsShowing=!1,(E=e.adBreakDone)==null||E.call(e,{breakType:e.type,breakName:e.name,breakFormat:"interstitial",breakStatus:"viewed"})},b=()=>{var E;this.adsIsShowing=!1,(E=e.adBreakDone)==null||E.call(e,{breakType:e.type,breakName:e.name,breakFormat:"interstitial",breakStatus:"noAdPreloaded"})};_e(()=>{this.adsIsShowing=!0,this.state.afterAd.value=p,this.state.adBreakDone.value=h,this.state.src.value=this.processUrl(n.params.url),this.state.adLinkClicked.value=f,this.state.adError.value=b,this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((l=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||l.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(d=e.beforeAd)==null||d.call(e);let p=()=>{var k;this.adsIsShowing=!1,(k=e.afterAd)==null||k.call(e)},h={breakType:e.type,breakName:e.name,breakFormat:"reward",breakStatus:"ignored"},b=()=>{var k;this.adsIsShowing=!1,h.breakStatus="dismissed",(k=e.adDismissed)==null||k.call(e)},E=()=>{var k;this.adsIsShowing=!1,h.breakStatus="viewed",(k=e.adViewed)==null||k.call(e)},C=()=>{var k;this.adsIsShowing=!1,(k=e.adBreakDone)==null||k.call(e,h)},w=()=>{this.adsIsShowing=!1,h.breakStatus="noAdPreloaded"};_e(()=>{this.state.afterAd.value=p,this.state.adDismissed.value=b,this.state.adViewed.value=E,this.state.adBreakDone.value=C,this.state.adLinkClicked.value=f,this.state.adError.value=w});let O=()=>{var k;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(k=e.adBreakDone)==null||k.call(e,{breakType:e.type,breakName:e.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,_e(()=>{this.state.src.value=this.processUrl(n.params.url),this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=e,(_=e.beforeReward)==null||_.call(e,O);break}}}},hu=()=>{window.googletag=window.googletag||{cmd:[]},window.googletag.pubadsReady||window.googletag.cmd.push(()=>{window.googletag.enableServices()})};function Ie(t,e,n){return(e=Xp(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xp(t){var e=Yp(t,"string");return typeof e=="symbol"?e:e+""}function Yp(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ao=class{constructor(e,n,r){Ie(this,"adUnit",void 0),Ie(this,"project",void 0),Ie(this,"keyValue",void 0),Ie(this,"adsContext",null),Ie(this,"rewardedSlot",null),Ie(this,"rewardedPayload",null),Ie(this,"readyEvent",null),Ie(this,"withCommand",function(){googletag.cmd.push(...arguments)}),Ie(this,"init",()=>{var a;this.rewardedSlot=googletag.defineOutOfPageSlot(this.adUnit,googletag.enums.OutOfPageFormat.REWARDED),this.rewardedSlot&&(this.rewardedSlot.addService(googletag.pubads()),googletag.pubads().addEventListener("rewardedSlotReady",this.handleSlotReady),googletag.pubads().addEventListener("rewardedSlotClosed",this.handleSlotClosed),googletag.pubads().addEventListener("rewardedSlotGranted",this.handleSlotGranted),googletag.pubads().addEventListener("slotRenderEnded",this.handleSlotRenderEnded),this.keyValue&&(Object.keys(this.keyValue).forEach(i=>{var o;(o=this.rewardedSlot)==null||o.setTargeting(i,this.keyValue[i])}),Object.keys(this.keyValue).includes("project")||(a=this.rewardedSlot)==null||a.setTargeting("project",this.project)),googletag.display(this.rewardedSlot))}),Ie(this,"destroy",a=>{var i,o;this.rewardedPayload=null,this.readyEvent=null,googletag.pubads().removeEventListener("rewardedSlotReady",this.handleSlotReady),googletag.pubads().removeEventListener("rewardedSlotClosed",this.handleSlotClosed),googletag.pubads().removeEventListener("rewardedSlotGranted",this.handleSlotGranted),googletag.pubads().removeEventListener("slotRenderEnded",this.handleSlotRenderEnded),this.rewardedSlot&&(googletag.destroySlots([this.rewardedSlot]),this.rewardedSlot=null),(o=(i=this.adsContext)==null?void 0:i.adBreakDone)==null||o.call(i,a),this.adsContext=null}),Ie(this,"reinit",a=>{this.destroy(a),this.init()}),Ie(this,"handleSlotReady",a=>{a.slot===this.rewardedSlot&&(this.readyEvent=a)}),Ie(this,"handleSlotClosed",a=>{var i,o;if(this.adsContext&&a.slot===this.rewardedSlot){let s=this.rewardedPayload?"viewed":"dismissed";s==="viewed"?this.adsContext.adViewed():this.adsContext.adDismissed(),(o=(i=this.adsContext).afterAd)==null||o.call(i),this.withCommand(()=>{this.reinit(s)})}}),Ie(this,"handleSlotGranted",a=>{this.adsContext&&a.slot===this.rewardedSlot&&(this.rewardedPayload=a.payload)}),Ie(this,"handleSlotRenderEnded",a=>{a.slot===this.rewardedSlot&&a.isEmpty&&this.adsContext&&this.withCommand(()=>{this.reinit("frequencyCapped")})}),Ie(this,"requestAds",a=>{this.withCommand(()=>{if(this.adsContext&&this.reinit("ignored"),this.rewardedSlot||this.init(),this.adsContext=a,!this.rewardedSlot){this.reinit("notReady");return}if(this.readyEvent)this.adsContext.beforeReward(()=>{var i,o,s;(o=(i=this.adsContext)==null?void 0:i.beforeAd)==null||o.call(i),(s=this.readyEvent)==null||s.makeRewardedVisible()});else{let i=o=>{o.slot===this.rewardedSlot&&this.adsContext&&(googletag.pubads().removeEventListener("rewardedSlotReady",i),this.readyEvent=o,this.adsContext.beforeReward(()=>{var s,l,d;(l=(s=this.adsContext)==null?void 0:s.beforeAd)==null||l.call(s),(d=this.readyEvent)==null||d.makeRewardedVisible()}))};googletag.pubads().addEventListener("rewardedSlotReady",i),window.setTimeout(()=>{this.readyEvent||(this.reinit("timeout"),googletag.pubads().removeEventListener("rewardedSlotReady",i))},500)}})}),this.adUnit=e,this.project=n,this.keyValue=r,hu(),this.withCommand(()=>{this.init()})}};function De(t,e,n){return(e=Qp(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qp(t){var e=Zp(t,"string");return typeof e=="symbol"?e:e+""}function Zp(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var So=class{constructor(e,n,r){var a=this;De(this,"adUnit",void 0),De(this,"project",void 0),De(this,"keyValue",void 0),De(this,"adsContext",null),De(this,"gamingInterstitialSlot",null),De(this,"readyEvent",null),De(this,"isRetrying",!1),De(this,"withCommand",function(){googletag.cmd.push(...arguments)}),De(this,"init",()=>{var i;this.gamingInterstitialSlot=googletag.defineOutOfPageSlot(this.adUnit,googletag.enums.OutOfPageFormat.GAME_MANUAL_INTERSTITIAL),this.gamingInterstitialSlot&&(this.gamingInterstitialSlot.addService(googletag.pubads()),googletag.pubads().addEventListener("gameManualInterstitialSlotReady",this.handleSlotReady),googletag.pubads().addEventListener("gameManualInterstitialSlotClosed",this.handleSlotClosed),this.keyValue&&(Object.keys(this.keyValue).forEach(o=>{var s;(s=this.gamingInterstitialSlot)==null||s.setTargeting(o,this.keyValue[o])}),Object.keys(this.keyValue).includes("project")||(i=this.gamingInterstitialSlot)==null||i.setTargeting("project",this.project)),googletag.display(this.gamingInterstitialSlot))}),De(this,"destroy",function(i){var o,s;(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&((s=(o=a.adsContext)==null?void 0:o.onEnd)==null||s.call(o,i),a.adsContext=null),googletag.pubads().removeEventListener("gameManualInterstitialSlotReady",a.handleSlotReady),googletag.pubads().removeEventListener("gameManualInterstitialSlotClosed",a.handleSlotClosed),a.gamingInterstitialSlot&&(googletag.destroySlots([a.gamingInterstitialSlot]),a.gamingInterstitialSlot=null,a.readyEvent=null)}),De(this,"reinit",function(i){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;a.destroy(i,o),a.init()}),De(this,"handleSlotReady",i=>{this.gamingInterstitialSlot===i.slot&&(this.readyEvent=i)}),De(this,"handleSlotClosed",i=>{var o,s;this.adsContext&&this.gamingInterstitialSlot===i.slot&&((s=(o=this.adsContext).afterAd)==null||s.call(o),this.withCommand(()=>{this.reinit("viewed")}))}),De(this,"requestAds",i=>{this.withCommand(()=>{var o,s,l;if(this.adsContext&&this.reinit("ignored"),this.gamingInterstitialSlot||this.init(),this.adsContext=i,!this.gamingInterstitialSlot){this.reinit("notReady");return}this.readyEvent?((o=i.beforeAd)==null||o.call(i),this.readyEvent.makeGameManualInterstitialVisible()):((l=(s=this.adsContext).onEnd)==null||l.call(s,"frequencyCapped"),this.adsContext=null,this.isRetrying||(this.isRetrying=!0,window.setTimeout(()=>{this.readyEvent||this.withCommand(()=>{this.reinit("frequencyCapped",!1)}),this.isRetrying=!1},31e3)))})}),hu(),this.adUnit=e,this.project=n,this.keyValue=r,this.withCommand(()=>{this.init()})}};function Dt(t,e,n){return(e=ev(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ev(t){var e=tv(t,"string");return typeof e=="symbol"?e:e+""}function tv(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Co=class{constructor(e,n){Dt(this,"name","GOOGLE_GPT"),Dt(this,"context",void 0),Dt(this,"contextInfo",void 0),Dt(this,"initParams",void 0),Dt(this,"rewardAdManager",void 0),Dt(this,"interstitialManager",void 0),Dt(this,"insertScript",()=>{let r="jolibox-google-gpt",a=document.getElementById(r);a||(a=window.document.createElement("script"),a.id=r,a.async=!0,a.src="https://securepubads.g.doubleclick.net/tag/js/gpt.js",a.crossOrigin="anonymous",document.head.appendChild(a))}),this.context=e,this.contextInfo=this.context.getContextInfo(),this.initParams=n,this.insertScript()}init(){return S(this,null,function*(){let e=this.contextInfo.testAdsMode?"/22639388115/rewarded_web_example":this.initParams.rewardedSlot,n=this.contextInfo.testAdsMode?"/6355419/Travel/Europe/France/Paris":this.initParams.interstitialSlot,r=`minigame-${this.contextInfo.runtimeType==="APP"?"app":"h5"}`;e&&(this.rewardAdManager=new Ao(e,r,this.initParams.keyValue)),n&&(this.interstitialManager=new So(n,r,this.initParams.keyValue))})}adConfig(e,n){}adBreak(e,n){var r,a,i;switch(e.type){case"preroll":{(r=e.adBreakDone)==null||r.call(e,{breakType:"preroll",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"reward":{if(!this.rewardAdManager){(a=e.adBreakDone)==null||a.call(e,{breakName:e.name,breakType:e.type,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}this.rewardAdManager.requestAds({beforeAd:e.beforeAd,afterAd:e.afterAd,adDismissed:e.adDismissed,adViewed:e.adViewed,beforeReward:e.beforeReward,adBreakDone:o=>{var s;(s=e.adBreakDone)==null||s.call(e,{breakName:e.name,breakType:e.type,breakFormat:"reward",breakStatus:o})}});break}default:{if(!this.interstitialManager){(i=e.adBreakDone)==null||i.call(e,{breakName:e.name,breakType:e.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}this.interstitialManager.requestAds({beforeAd:e.beforeAd,afterAd:e.afterAd,onEnd:o=>{var s;(s=e.adBreakDone)==null||s.call(e,{breakName:e.name,breakType:e.type,breakFormat:"interstitial",breakStatus:o})}});break}}}};function ao(t,e,n){return(e=nv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nv(t){var e=rv(t,"string");return typeof e=="symbol"?e:e+""}function rv(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ro=class{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";ao(this,"context",void 0),ao(this,"placement","GAME"),ao(this,"contextInfo",void 0),this.context=e,this.placement=n,this.contextInfo=this.context.getContextInfo()}getLocation(){let e=new URLSearchParams(window.location.search),n={};return e.forEach((r,a)=>{n[a]=r}),{name:this.placement==="GAME"?"GamePage":"DramaPage",params:n}}getDevice(){var e,n,r,a;return{platform:(e=this.contextInfo.platform)!=null?e:qc.WebSDK,os:this.contextInfo.osType+"_"+this.contextInfo.runtimeType,appVersion:"1.0.0",appId:(n=this.contextInfo.hostAppId)!=null?n:"1",model:(r=this.contextInfo.deviceModel)!=null?r:"UnknownModel",brand:(a=this.contextInfo.deviceBrand)!=null?a:"UnknownBrand",uuid:this.contextInfo.deviceId,jsSdkVersion:"1.0.0",extra:{}}}serialize(e,n){var r;let a={protocolVersion:"1.0.0",events:[{name:e,type:Hc.System,location:this.getLocation(),target:null,extra:n,timestamp:Date.now(),userId:(r=this.contextInfo.userId)!=null?r:null}],device:this.getDevice(),project:jc.WebSDK};return rm(a)}};function ke(t,e,n){return(e=av(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function av(t){var e=iv(t,"string");return typeof e=="symbol"?e:e+""}function iv(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var sa=class{constructor(e){ke(this,"context",void 0),ke(this,"adsTrackSerializer",void 0),ke(this,"contextInfo",void 0),this.context=e,this.contextInfo=e.getContextInfo(),this.adsTrackSerializer=new Ro(this.context)}getRequestContextData(e){var n,r;this.contextInfo=this.context.getContextInfo();let{width:a,height:i}=this.context.getWindowInfo();return{report:JSON.stringify(this.adsTrackSerializer.serialize(e,{sessionId:this.contextInfo.sessionId,objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId,testAdsMode:this.contextInfo.testAdsMode})),osType:this.contextInfo.osType,runtimeType:this.contextInfo.runtimeType,sessionId:this.contextInfo.sessionId,deviceId:this.contextInfo.deviceId,adId:this.contextInfo.adId,deviceModel:(n=this.contextInfo.deviceModel)!=null?n:"UnknownModel",deviceBrand:(r=this.contextInfo.deviceBrand)!=null?r:"UnknownBrand",dimension:{width:a,height:i}}}getRequestBizParams(){return{objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId}}},Oo=class{constructor(e,n){var r=this;ke(this,"context",void 0),ke(this,"contextInfo",void 0),ke(this,"requestContext",void 0),ke(this,"pendingAFGAdsInfo",{REWARD:Promise.resolve(null),INTERSTITIAL:Promise.resolve(null)}),ke(this,"pendingAFVAdsInfo",Promise.resolve(null)),ke(this,"doFetchAdsInfo",a=>S(this,null,function*(){let i=a==="afv"?"AdsAFVSDKRequest":"AdsAFGSDKAdBreak",o=a==="afv"?"REWARD_INTERSTITIAL":a==="reward"?"REWARD":"INTERSTITIAL",s=a==="afv"?void 0:"cached",{data:l,code:d}=yield this.context.httpClient.post("/api/ads/info",{data:{contextData:this.requestContext.getRequestContextData(i),bizParams:this.requestContext.getRequestBizParams(),adsType:o,testAdsMode:this.contextInfo.testAdsMode,name:s}});return d==="SUCCESS"||d==="BYPASS_ADS"?{code:d,data:l}:null})),ke(this,"cacheRewardInfo",()=>{this.pendingAFGAdsInfo.REWARD=this.doFetchAdsInfo("reward").catch(()=>null)}),ke(this,"cacheInterstitialInfo",a=>{this.pendingAFGAdsInfo.INTERSTITIAL=this.doFetchAdsInfo(a).catch(()=>null)}),ke(this,"cacheAFVInfo",()=>{this.pendingAFVAdsInfo=this.doFetchAdsInfo("afv").catch(()=>null)}),ke(this,"cacheNextAFGAdsInfo",a=>S(this,null,function*(){a==="reward"?this.cacheRewardInfo():this.cacheInterstitialInfo(a)})),ke(this,"getAFGAdsInfo",a=>S(this,null,function*(){let i=yield a==="reward"?this.pendingAFGAdsInfo.REWARD:this.pendingAFGAdsInfo.INTERSTITIAL;return this.cacheNextAFGAdsInfo(a),i})),ke(this,"getAFVAdsInfo",function(){return S(this,arguments,function*(){if(!(arguments.length>0&&arguments[0]!==void 0)||arguments[0]){let a=yield r.pendingAFVAdsInfo;return r.cacheAFVInfo(),a}else return r.cacheAFVInfo(),yield r.pendingAFVAdsInfo})}),this.context=e,this.contextInfo=this.context.getContextInfo(),this.requestContext=new sa(e),n!=null&&n.reward&&this.cacheRewardInfo(),n!=null&&n.interstitial&&this.cacheInterstitialInfo("start"),n!=null&&n.afv&&this.cacheAFVInfo()}};function Ve(t,e,n){return(e=ov(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ov(t){var e=sv(t,"string");return typeof e=="symbol"?e:e+""}function sv(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var xn=class{constructor(e){if(Ve(this,"context",void 0),Ve(this,"contextInfo",void 0),Ve(this,"providers",{}),Ve(this,"channelPolicy",void 0),Ve(this,"adsActionDetection",void 0),Ve(this,"requestContext",void 0),Ve(this,"adsRequest",void 0),Ve(this,"initialized",!1),Ve(this,"adsIsShowing",!1),Ve(this,"lastAdBreak",void 0),Ve(this,"initializedTimeStamp",Date.now()),e)this.context=e,this.channelPolicy=new fo(this.context),this.adsActionDetection=new uo(this.context),this.contextInfo=this.context.getContextInfo(),this.adsRequest=new Oo(e),this.requestContext=new sa(e);else throw new Error("JoliboxAdsForGame requires a configuration object")}init(e){return S(this,null,function*(){window.adsbygoogle=window.adsbygoogle||[];let{data:n}=yield this.context.httpClient.post("/api/ads/init",{data:{contextData:this.requestContext.getRequestContextData("AdsAFGSDKInit"),bizParams:this.requestContext.getRequestBizParams(),testAdsMode:this.contextInfo.testAdsMode}});if((n==null?void 0:n.length)>0)for(let r of n)switch(r.provider){case"GOOGLE_GPT":{let a=new Co(this.context,r.params);yield a.init(),this.providers[r.provider]=a;break}case"ADSENSE":case"ADSENSE_ADMOB":{let a=new ho(this.context,r.params);yield a.init(),this.providers[r.provider]=a;break}case"OKSPIN":{let a=new bo(this.context,r.params);yield a.init(),this.providers.OKSPIN=a;break}case"APPSROCKETS":{let a=new Io(this.context,r.params);yield a.init(),this.providers.APPSROCKETS=a;break}case"ADSENSE_BANNER_AS_AFG":{let a=new Eo(this.context,r.params);yield a.init(),this.providers.ADSENSE_BANNER_AS_AFG=a;break}}this.adsRequest.cacheInterstitialInfo("start"),this.adsRequest.cacheRewardInfo(),this.initialized=!0})}adConfig(e){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(e):window.adsbygoogle.push(e)}adBreak(e){return S(this,null,function*(){var n,r,a,i,o,s,l,d,_,f,p,h,b,E;let C=Date.now();if(C-this.initializedTimeStamp<3e3){(n=e.adBreakDone)==null||n.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}if(this.lastAdBreak&&C-this.lastAdBreak<500){console.warn("[Jolibox SDK Ads] You can't call adBreak too frequently"),(r=e.adBreakDone)==null||r.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.lastAdBreak=C,this.adsIsShowing){console.warn("[Jolibox SDK Ads] You can't call adBreak while ad is showing"),(a=e.adBreakDone)==null||a.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.initialized||(yield this.init()),e.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(i=e.adBreakDone)==null||i.call(e,{breakType:e.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}if(!this.context.checkNetwork()){(o=e.adBreakDone)==null||o.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}try{let w=yield this.adsRequest.getAFGAdsInfo(e.type),O=w==null?void 0:w.data,k=w==null?void 0:w.code;if(k==="BYPASS_ADS"){switch(e.type){case"preroll":{(s=e.adBreakDone)==null||s.call(e,{breakType:e.type,breakFormat:"interstitial",breakStatus:"viewed"});break}case"reward":{e.beforeReward(()=>{var M,B,I,D;(M=e.beforeAd)==null||M.call(e),(B=e.adViewed)==null||B.call(e),(I=e.afterAd)==null||I.call(e),(D=e.adBreakDone)==null||D.call(e,{breakType:e.type,breakName:e.name,breakFormat:"reward",breakStatus:"viewed"})});break}default:{(l=e.beforeAd)==null||l.call(e),(d=e.afterAd)==null||d.call(e),(_=e.adBreakDone)==null||_.call(e,{breakType:e.type,breakName:e.name,breakFormat:"interstitial",breakStatus:"viewed"});break}}return}if(!O||k!=="SUCCESS"){(f=e.adBreakDone)==null||f.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let M=O.sort((J,j)=>J.seq-j.seq);if(M.length===0){(p=e.adBreakDone)==null||p.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let B=!0,I=null,D=new co(this.context);for(this.adsActionDetection.adBreakIsShowing=!0;M.length>0;){let J=M.shift(),j=this.providers[J.provider];if(j){let[N,G]=yield D.callAdBreakAndContinue(j,e,J,F=>{var X;this.adsIsShowing=F,(X=this.context.eventEmitter)==null||X.emit("isAdShowing",F)});B=N,I=G}else B=!0,I={breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!B)break}B&&I&&((h=e.adBreakDone)==null||h.call(e,I))}}catch(w){(b=e.adBreakDone)==null||b.call(e,{breakType:e.type,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{this.adsIsShowing=!1,(E=this.context.eventEmitter)==null||E.emit("isAdShowing",!1),this.adsActionDetection.adBreakIsShowing=!1}})}adUnit(e){console.warn("This method has been deprecated. We will not support AdSense AdUnit in the future.")}};var VE=Se`
|
|
259
|
-
${
|
|
258
|
+
`,rg=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:a,adLoaded:o,adLinkClicked:s,visible:l,src:c}=t,[p,u]=dt(!1),m=w=>{var E,I,b,R;u(!1),l.value=!1,w==="dismiss"?(E=n.value)==null||E.call(n):w==="viewed"&&((I=i.value)==null||I.call(i)),(b=r.value)==null||b.call(r),(R=a.value)==null||R.call(a)},h=()=>{var w;(w=o.value)==null||w.call(o)};return rr("appsrockets_ad_dismissed",()=>m("dismiss")),rr("appsrockets_ad_rewarded",()=>m("viewed")),rr("appsrockets_ad_completed",()=>m("viewed")),rr("appsrockets_ad_skipped",()=>m("viewed")),rr("appsrockets_ad_clicked",w=>{var E;return(E=s.value)==null?void 0:E.call(s,w)}),rr("appsrockets_ad_loaded",()=>u(!0)),l.value?X("div",{className:tg,style:{display:p?"flex":"none"},children:l.value&&X("iframe",{src:c.value,onLoad:h,allowFullScreen:!0,allow:"autoplay",sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols"})}):null};function ht(e,t,r){return(t=ng(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ng(e){var t=ig(e,"string");return typeof t=="symbol"?t:t+""}function ig(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 Xo=class{constructor(t,r){ht(this,"name","APPSROCKETS"),ht(this,"initialized",!1),ht(this,"initCompleter",null),ht(this,"context",void 0),ht(this,"adsOverlay",null),ht(this,"adsIsShowing",!1),ht(this,"lastUnDisplayedAdBreak",null),ht(this,"state",eg()),ht(this,"processUrl",(n,i)=>{var a;let o=this.context.getContextInfo(),s=new URL(n),l=new URLSearchParams(s.search);return l.has("joliSource")||l.set("joliSource",o.joliSource),l.get("osType")||l.set("osType",o.osType),l.get("runtimeType")||l.set("runtimeType",o.runtimeType),l.get("mode")||l.set("mode","AFG"),l.get("deviceId")||l.set("deviceId",o.deviceId),l.get("statusBarHeight")||l.set("statusBarHeight",((a=this.context.getWindowInfo().statusBarHeight)!=null?a:0).toString()),l.get("adsType")||l.set("adsType",i),s.search=l.toString(),s.toString()}),this.context=t}init(){return A(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg-appsrockets"),oi(X(rg,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(t=this.initCompleter)==null||t.call(this)})}adConfig(t){var r;if(this.initialized){(r=t.onReady)==null||r.call(t);return}this.initCompleter=()=>{var n;(n=t.onReady)==null||n.call(t)}}adBreak(t,r){var n,i,a,o,s,l,c,p;if(!this.initialized||!this.adsOverlay||!r.params.url){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}let u=h=>{var w,E;(E=(w=this.context).handleLinkClicked)==null||E.call(w,h)},m=t.type==="reward"?"REWARD":"INTERSTITIAL";switch(t.type){case"preroll":{(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(o=t.beforeAd)==null||o.call(t);let h=()=>{var I;this.adsIsShowing=!1,(I=t.afterAd)==null||I.call(t)},w=()=>{var I;this.adsIsShowing=!1,(I=t.adBreakDone)==null||I.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})},E=()=>{var I;this.adsIsShowing=!1,(I=t.adBreakDone)==null||I.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"noAdPreloaded"})};ye(()=>{this.adsIsShowing=!0,this.state.afterAd.value=h,this.state.adBreakDone.value=w,this.state.src.value=this.processUrl(r.params.url,m),this.state.adLinkClicked.value=u,this.state.adError.value=E,this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((l=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||l.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(c=t.beforeAd)==null||c.call(t);let h=()=>{var D;this.adsIsShowing=!1,(D=t.afterAd)==null||D.call(t)},w={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},E=()=>{var D;this.adsIsShowing=!1,w.breakStatus="dismissed",(D=t.adDismissed)==null||D.call(t)},I=()=>{var D;this.adsIsShowing=!1,w.breakStatus="viewed",(D=t.adViewed)==null||D.call(t)},b=()=>{var D;this.adsIsShowing=!1,(D=t.adBreakDone)==null||D.call(t,w)},R=()=>{this.adsIsShowing=!1,w.breakStatus="noAdPreloaded"};ye(()=>{this.state.afterAd.value=h,this.state.adDismissed.value=E,this.state.adViewed.value=I,this.state.adBreakDone.value=b,this.state.adLinkClicked.value=u,this.state.adError.value=R});let k=()=>{var D;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(D=t.adBreakDone)==null||D.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,ye(()=>{this.state.src.value=this.processUrl(r.params.url,m),this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(p=t.beforeReward)==null||p.call(t,k);break}}}},lu=()=>{window.googletag=window.googletag||{cmd:[]},window.googletag.pubadsReady||window.googletag.cmd.push(()=>{window.googletag.enableServices()})};function Ae(e,t,r){return(t=ag(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ag(e){var t=og(e,"string");return typeof t=="symbol"?t:t+""}function og(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 Qo=class{constructor(t,r,n){Ae(this,"adUnit",void 0),Ae(this,"project",void 0),Ae(this,"keyValue",void 0),Ae(this,"adsContext",null),Ae(this,"rewardedSlot",null),Ae(this,"rewardedPayload",null),Ae(this,"readyEvent",null),Ae(this,"withCommand",function(){googletag.cmd.push(...arguments)}),Ae(this,"init",()=>{var i;this.rewardedSlot=googletag.defineOutOfPageSlot(this.adUnit,googletag.enums.OutOfPageFormat.REWARDED),this.rewardedSlot&&(this.rewardedSlot.addService(googletag.pubads()),googletag.pubads().addEventListener("rewardedSlotReady",this.handleSlotReady),googletag.pubads().addEventListener("rewardedSlotClosed",this.handleSlotClosed),googletag.pubads().addEventListener("rewardedSlotGranted",this.handleSlotGranted),googletag.pubads().addEventListener("slotRenderEnded",this.handleSlotRenderEnded),this.keyValue&&(Object.keys(this.keyValue).forEach(a=>{var o;(o=this.rewardedSlot)==null||o.setTargeting(a,this.keyValue[a])}),Object.keys(this.keyValue).includes("project")||(i=this.rewardedSlot)==null||i.setTargeting("project",this.project)),googletag.display(this.rewardedSlot))}),Ae(this,"destroy",i=>{var a,o;this.rewardedPayload=null,this.readyEvent=null,googletag.pubads().removeEventListener("rewardedSlotReady",this.handleSlotReady),googletag.pubads().removeEventListener("rewardedSlotClosed",this.handleSlotClosed),googletag.pubads().removeEventListener("rewardedSlotGranted",this.handleSlotGranted),googletag.pubads().removeEventListener("slotRenderEnded",this.handleSlotRenderEnded),this.rewardedSlot&&(googletag.destroySlots([this.rewardedSlot]),this.rewardedSlot=null),(o=(a=this.adsContext)==null?void 0:a.adBreakDone)==null||o.call(a,i),i!=="ignored"&&(this.adsContext=null)}),Ae(this,"reinit",i=>{this.destroy(i),this.init()}),Ae(this,"handleSlotReady",i=>{i.slot===this.rewardedSlot&&(this.readyEvent=i)}),Ae(this,"handleSlotClosed",i=>{var a,o;if(this.adsContext&&i.slot===this.rewardedSlot){let s=this.rewardedPayload?"viewed":"dismissed";s==="viewed"?this.adsContext.adViewed():this.adsContext.adDismissed(),(o=(a=this.adsContext).afterAd)==null||o.call(a),this.withCommand(()=>{this.reinit(s)})}}),Ae(this,"handleSlotGranted",i=>{this.adsContext&&i.slot===this.rewardedSlot&&(this.rewardedPayload=i.payload)}),Ae(this,"handleSlotRenderEnded",i=>{i.slot===this.rewardedSlot&&i.isEmpty&&this.adsContext&&this.withCommand(()=>{this.reinit("frequencyCapped")})}),Ae(this,"requestAds",i=>{this.withCommand(()=>{if(this.adsContext){this.destroy("ignored");return}if(this.rewardedSlot||this.init(),this.adsContext=i,!this.rewardedSlot){this.reinit("notReady");return}if(this.readyEvent)this.adsContext.beforeReward(()=>{var a,o,s;(o=(a=this.adsContext)==null?void 0:a.beforeAd)==null||o.call(a),(s=this.readyEvent)==null||s.makeRewardedVisible()});else{let a=o=>{o.slot===this.rewardedSlot&&this.adsContext&&(googletag.pubads().removeEventListener("rewardedSlotReady",a),this.readyEvent=o,this.adsContext.beforeReward(()=>{var s,l,c;(l=(s=this.adsContext)==null?void 0:s.beforeAd)==null||l.call(s),(c=this.readyEvent)==null||c.makeRewardedVisible()}))};googletag.pubads().addEventListener("rewardedSlotReady",a),window.setTimeout(()=>{this.readyEvent||(this.reinit("timeout"),googletag.pubads().removeEventListener("rewardedSlotReady",a))},500)}})}),this.adUnit=t,this.project=r,this.keyValue=n,lu(),this.withCommand(()=>{this.init()})}};function De(e,t,r){return(t=sg(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sg(e){var t=lg(e,"string");return typeof t=="symbol"?t:t+""}function lg(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 Zo=class{constructor(t,r,n){var i=this;De(this,"adUnit",void 0),De(this,"project",void 0),De(this,"keyValue",void 0),De(this,"adsContext",null),De(this,"gamingInterstitialSlot",null),De(this,"readyEvent",null),De(this,"isRetrying",!1),De(this,"withCommand",function(){googletag.cmd.push(...arguments)}),De(this,"init",()=>{var a;this.gamingInterstitialSlot=googletag.defineOutOfPageSlot(this.adUnit,googletag.enums.OutOfPageFormat.GAME_MANUAL_INTERSTITIAL),this.gamingInterstitialSlot&&(this.gamingInterstitialSlot.addService(googletag.pubads()),googletag.pubads().addEventListener("gameManualInterstitialSlotReady",this.handleSlotReady),googletag.pubads().addEventListener("gameManualInterstitialSlotClosed",this.handleSlotClosed),this.keyValue&&(Object.keys(this.keyValue).forEach(o=>{var s;(s=this.gamingInterstitialSlot)==null||s.setTargeting(o,this.keyValue[o])}),Object.keys(this.keyValue).includes("project")||(a=this.gamingInterstitialSlot)==null||a.setTargeting("project",this.project)),googletag.display(this.gamingInterstitialSlot))}),De(this,"destroy",function(a){var o,s;(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&((s=(o=i.adsContext)==null?void 0:o.onEnd)==null||s.call(o,a),a!=="ignored"&&(i.adsContext=null)),googletag.pubads().removeEventListener("gameManualInterstitialSlotReady",i.handleSlotReady),googletag.pubads().removeEventListener("gameManualInterstitialSlotClosed",i.handleSlotClosed),i.gamingInterstitialSlot&&(googletag.destroySlots([i.gamingInterstitialSlot]),i.gamingInterstitialSlot=null,i.readyEvent=null)}),De(this,"reinit",function(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;i.destroy(a,o),i.init()}),De(this,"handleSlotReady",a=>{this.gamingInterstitialSlot===a.slot&&(this.readyEvent=a)}),De(this,"handleSlotClosed",a=>{var o,s;this.adsContext&&this.gamingInterstitialSlot===a.slot&&((s=(o=this.adsContext).afterAd)==null||s.call(o),this.withCommand(()=>{this.reinit("viewed")}))}),De(this,"requestAds",a=>{this.withCommand(()=>{var o,s,l;if(this.adsContext){this.destroy("ignored");return}if(this.gamingInterstitialSlot||this.init(),this.adsContext=a,!this.gamingInterstitialSlot){this.reinit("notReady");return}this.readyEvent?((o=a.beforeAd)==null||o.call(a),this.readyEvent.makeGameManualInterstitialVisible()):((l=(s=this.adsContext).onEnd)==null||l.call(s,"frequencyCapped"),this.adsContext=null,this.isRetrying||(this.isRetrying=!0,window.setTimeout(()=>{this.readyEvent||this.withCommand(()=>{this.reinit("frequencyCapped",!1)}),this.isRetrying=!1},31e3)))})}),lu(),this.adUnit=t,this.project=r,this.keyValue=n,this.withCommand(()=>{this.init()})}};function Jt(e,t,r){return(t=cg(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cg(e){var t=dg(e,"string");return typeof t=="symbol"?t:t+""}function dg(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 es=class{constructor(t,r){Jt(this,"name","GOOGLE_GPT"),Jt(this,"context",void 0),Jt(this,"contextInfo",void 0),Jt(this,"initParams",void 0),Jt(this,"rewardAdManager",void 0),Jt(this,"interstitialManager",void 0),Jt(this,"insertScript",()=>{let n="jolibox-google-gpt",i=document.getElementById(n);i||(i=window.document.createElement("script"),i.id=n,i.async=!0,i.src="https://securepubads.g.doubleclick.net/tag/js/gpt.js",i.crossOrigin="anonymous",document.head.appendChild(i))}),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,this.insertScript()}init(){return A(this,null,function*(){let t=this.contextInfo.testAdsMode?"/22639388115/rewarded_web_example":this.initParams.rewardedSlot,r=this.contextInfo.testAdsMode?"/6355419/Travel/Europe/France/Paris":this.initParams.interstitialSlot,n=`minigame-${this.contextInfo.runtimeType==="APP"?"app":"h5"}`;t&&(this.rewardAdManager=new Qo(t,n,this.initParams.keyValue)),r&&(this.interstitialManager=new Zo(r,n,this.initParams.keyValue))})}adConfig(t,r){}adBreak(t,r){var n,i,a;switch(t.type){case"preroll":{(n=t.adBreakDone)==null||n.call(t,{breakType:"preroll",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"reward":{if(!this.rewardAdManager){(i=t.adBreakDone)==null||i.call(t,{breakName:t.name,breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}this.rewardAdManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,adDismissed:t.adDismissed,adViewed:t.adViewed,beforeReward:t.beforeReward,adBreakDone:o=>{var s;(s=t.adBreakDone)==null||s.call(t,{breakName:t.name,breakType:t.type,breakFormat:"reward",breakStatus:o})}});break}default:{if(!this.interstitialManager){(a=t.adBreakDone)==null||a.call(t,{breakName:t.name,breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}this.interstitialManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,onEnd:o=>{var s;(s=t.adBreakDone)==null||s.call(t,{breakName:t.name,breakType:t.type,breakFormat:"interstitial",breakStatus:o})}});break}}}};function So(e,t,r){return(t=ug(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ug(e){var t=fg(e,"string");return typeof t=="symbol"?t:t+""}function fg(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 ts=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";So(this,"context",void 0),So(this,"placement","GAME"),So(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:Gd.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:Bd.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:Md.WebSDK};return fp(i)}};function Te(e,t,r){return(t=hg(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hg(e){var t=mg(e,"string");return typeof t=="symbol"?t:t+""}function mg(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 Ii=class{constructor(t){Te(this,"context",void 0),Te(this,"adsTrackSerializer",void 0),Te(this,"contextInfo",void 0),this.context=t,this.contextInfo=t.getContextInfo(),this.adsTrackSerializer=new ts(this.context)}getRequestContextData(t){var r,n;this.contextInfo=this.context.getContextInfo();let{width:i,height:a}=this.context.getWindowInfo();return{report:JSON.stringify(this.adsTrackSerializer.serialize(t,{sessionId:this.contextInfo.sessionId,objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId,testAdsMode:this.contextInfo.testAdsMode})),osType:this.contextInfo.osType,runtimeType:this.contextInfo.runtimeType,sessionId:this.contextInfo.sessionId,deviceId:this.contextInfo.deviceId,adId:this.contextInfo.adId,deviceModel:(r=this.contextInfo.deviceModel)!=null?r:"UnknownModel",deviceBrand:(n=this.contextInfo.deviceBrand)!=null?n:"UnknownBrand",dimension:{width:i,height:a}}}getRequestBizParams(){return{objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId}}},rs=class{constructor(t,r){var n=this;Te(this,"context",void 0),Te(this,"contextInfo",void 0),Te(this,"requestContext",void 0),Te(this,"pendingAFGAdsInfo",{REWARD:Promise.resolve(null),INTERSTITIAL:Promise.resolve(null)}),Te(this,"pendingAFVAdsInfo",Promise.resolve(null)),Te(this,"doFetchAdsInfo",i=>A(this,null,function*(){let a=i==="afv"?"AdsAFVSDKRequest":"AdsAFGSDKAdBreak",o=[];switch(i){case"afv":{o=["REWARD_INTERSTITIAL","REWARD"];break}case"reward":{o=["REWARD_INTERSTITIAL","REWARD"];break}default:{o=["INTERSTITIAL"];break}}let s=i==="afv"?void 0:"cached",{data:l,code:c}=yield this.context.httpClient.post("/api/ads/info",{data:{contextData:this.requestContext.getRequestContextData(a),bizParams:this.requestContext.getRequestBizParams(),adsTypes:o,testAdsMode:this.contextInfo.testAdsMode,name:s}});return c==="SUCCESS"||c==="BYPASS_ADS"?{code:c,data:l}:null})),Te(this,"cacheRewardInfo",()=>{this.pendingAFGAdsInfo.REWARD=this.doFetchAdsInfo("reward").catch(()=>null)}),Te(this,"cacheInterstitialInfo",i=>{this.pendingAFGAdsInfo.INTERSTITIAL=this.doFetchAdsInfo(i).catch(()=>null)}),Te(this,"cacheAFVInfo",()=>{this.pendingAFVAdsInfo=this.doFetchAdsInfo("afv").catch(()=>null)}),Te(this,"cacheNextAFGAdsInfo",i=>A(this,null,function*(){i==="reward"?this.cacheRewardInfo():this.cacheInterstitialInfo(i)})),Te(this,"getAFGAdsInfo",i=>A(this,null,function*(){let a=yield i==="reward"?this.pendingAFGAdsInfo.REWARD:this.pendingAFGAdsInfo.INTERSTITIAL;return this.cacheNextAFGAdsInfo(i),a})),Te(this,"getAFVAdsInfo",function(){return A(this,arguments,function*(){if(!(arguments.length>0&&arguments[0]!==void 0)||arguments[0]){let i=yield n.pendingAFVAdsInfo;return n.cacheAFVInfo(),i}else return n.cacheAFVInfo(),yield n.pendingAFVAdsInfo})}),this.context=t,this.contextInfo=this.context.getContextInfo(),this.requestContext=new Ii(t),r!=null&&r.reward&&this.cacheRewardInfo(),r!=null&&r.interstitial&&this.cacheInterstitialInfo("start"),r!=null&&r.afv&&this.cacheAFVInfo()}},pg=Object.defineProperty,vg=Object.defineProperties,gg=Object.getOwnPropertyDescriptors,Ai=Object.getOwnPropertySymbols,cu=Object.prototype.hasOwnProperty,du=Object.prototype.propertyIsEnumerable,Id=(e,t,r)=>t in e?pg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gt=(e,t)=>{for(var r in t||(t={}))cu.call(t,r)&&Id(e,r,t[r]);if(Ai)for(var r of Ai(t))du.call(t,r)&&Id(e,r,t[r]);return e},_g=(e,t)=>vg(e,gg(t)),yg=(e,t)=>{var r={};for(var n in e)cu.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ai)for(var n of Ai(e))t.indexOf(n)<0&&du.call(e,n)&&(r[n]=e[n]);return r},Si=(e,t,r)=>new Promise((n,i)=>{var a=l=>{try{s(r.next(l))}catch(c){i(c)}},o=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(a,o);s((r=r.apply(e,t)).next())});function bg(e){return!!(e!=null&&e.__nativeBuffers__)}var wg=e=>{let t=atob(e),r=t.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=t.charCodeAt(i);return n.buffer};function ns(e){if(typeof e=="string")try{e=JSON.parse(e)}catch(r){return{}}if(typeof e!="object"||e===null)return{};if(!bg(e))return e;let t=e.__nativeBuffers__;if(delete e.__nativeBuffers__,t)for(let r=0;r<t.length;r++){let n=t[r];if(n){let i;n.value?i=n.value:n.base64&&(i=wg(n.base64)),typeof i!="undefined"&&i instanceof ArrayBuffer&&(e[n.key]=i)}}return e}var Eg=e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let i=0;i<n;i++)t+=String.fromCharCode(r[i]);return btoa(t)};function Ig(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=e,n=[];for(let[i,a]of Object.entries(r))if(a!==void 0&&a instanceof ArrayBuffer&&a.byteLength!==void 0){let o=t?{value:a,key:i}:{base64:Eg(a),key:i};n.push(o),delete r[i]}return n.length>0&&(r.__nativeBuffers__=n),r}var Ag=Object.defineProperty,Sg=(e,t)=>{for(var r in t)Ag(e,r,{get:t[r],enumerable:!0})},uu=(e,t,r,n)=>{for(var i=t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=o(i)||i);return i},Cg=(e,t,r)=>new Promise((n,i)=>{var a=l=>{try{s(r.next(l))}catch(c){i(c)}},o=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(a,o);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 Rg(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}var Og=class{constructor(){this.state="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.state==="pending"&&(this.state="fulfilled",e(r))},this.reject=r=>{this.state==="pending"&&(this.state="rejected",t(r))}})}};function fu(e){return typeof e=="string"}function sr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Ad(e){return typeof e=="number"&&!isNaN(e)}function kg(e){return typeof e=="undefined"}function Tg(e){return kg(e)||e===null}function hu(e){return typeof e=="function"}function xg(e){return sr(e)&&hu(e.then)}function mu(e){let t=e,r=null,n=function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return r||(r=new t(...a)),r};return n.prototype=t.prototype,n}var Pg=(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))(Pg||{}),Ng=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}},xi=class extends Ng{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Dg=class extends xi{constructor(){super(...arguments),this.name="INTERNAL_INVOKE_NATIVE_ERROR"}},Lg=class extends xi{constructor(e,t,r,n){super(e),this.errNo=t,this.name="INTERNAL_APPLY_NATIVE_ERROR",this.errorType=r,this.errorCode=n}},Ug=class extends xi{constructor(){super(...arguments),this.name="INTERNAL_JSCORE_ERROR",this.priority="P0"}},Co=class extends xi{constructor(){super(...arguments),this.name="INTERNAL_METRIC_REPORT_ERROR"}};function Ur(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}var Pi={log:Ur("log"),warn:Ur("warn"),info:Ur("info"),error:Ur("error"),debug:Ur("debug")};Object.assign(globalThis,{logger:Pi});var Sd=Symbol.for("Jolibox.canIUseMap"),Bg={};globalThis[Sd]||(globalThis[Sd]=Bg);function Mg(e,t,r){let n=e;for(let i of t)if(n&&typeof n=="object")n=n[i];else return r;return n===void 0?r:n}var is=Symbol.for("Jolibox.canIUseMap.native"),Gg={};globalThis[is]||(globalThis[is]=Gg);var as={get config(){return globalThis[is]}},Jg=(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))(Jg||{}),Fg=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Fg||{}),jg=(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))(jg||{});function Hg(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};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}}Hg();var ir=typeof window=="undefined",qg=()=>!ir&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");!ir&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),!ir&&navigator.userAgent.includes("Android"),!ir&&navigator.userAgent.includes("Mac"),!ir&&navigator.userAgent.includes("FB_IAB"),!ir&&!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var os=class ss{constructor(t){this.element=t,this.next=ss.Undefined,this.prev=ss.Undefined}};os.Undefined=new os(void 0);var le=os,Vg=class{constructor(){this._first=le.Undefined,this._last=le.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===le.Undefined}clear(){let e=this._first;for(;e!==le.Undefined;){let t=e.next;e.prev=le.Undefined,e.next=le.Undefined,e=t}this._first=le.Undefined,this._last=le.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new le(e);if(this._first===le.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!==le.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==le.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==le.Undefined&&e.next!==le.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===le.Undefined&&e.next===le.Undefined?(this._first=le.Undefined,this._last=le.Undefined):e.next===le.Undefined?(this._last=this._last.prev,this._last.next=le.Undefined):e.prev===le.Undefined&&(this._first=this._first.next,this._first.prev=le.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==le.Undefined;)yield e.element,e=e.next}},$g=0,Br=class{constructor(e){this.value=e,this.id=$g++}},Vr=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 Br&&(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,a,o,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let l=new Br(e);return this._listeners?this._listeners instanceof Br?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,(a=(i=this.options)==null?void 0:i.onDidFirstListener)==null||a.call(i,this)),(s=(o=this.options)==null?void 0:o.onDidAddListener)==null||s.call(o,this),this._size++,()=>{var c,p,u,m;if(!this._disposed){if(this._listeners instanceof Br)this._listeners.id===l.id&&(this._listeners=void 0,this._size=0,(p=(c=this.options)==null?void 0:c.onDidRemoveLastListener)==null||p.call(c));else if(this._listeners){let h=this._listeners.indexOf(l);h>=0&&(this._listeners.splice(h,1),this._size--,this._size===0&&((m=(u=this.options)==null?void 0:u.onDidRemoveLastListener)==null||m.call(u)))}}}}),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 Br?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},ls=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 Vr,a=l=>t(...l.args),o=i.event(a);this.listerHandlerMap.set(t,{handler:a,dispose:o}),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),a=1;a<n;a++)i[a-1]=arguments[a];r||(r=new Vg,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)}},cs={};Sg(cs,{None:()=>Kg,filter:()=>zg,once:()=>pu,toPromise:()=>Wg});var Kg=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function Wg(e){return new Promise(t=>pu(e)(t))}function pu(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 zg(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new Vr(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 Ro=Symbol.for("Jolibox.hostEmitter"),Yg=()=>{let e=new ls;return globalThis[Ro]||(globalThis[Ro]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Ro]};Yg();function Xg(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Qg(e[n],t[n])}function Qg(e,t){if(fu(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(hu(t)){try{if(e instanceof t)return}catch(r){}if(!Tg(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 ds=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Vr,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,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return Xg(a,r),n(...a)}}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}};ds=uu([mu],ds);var Cd=class{constructor(){this._onWillExecuteCommand=new Vr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Vr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new ds,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Rg(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 Cg(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),cs.toPromise(cs.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 a=this.invokeFunction(t.handler,...n);return this._onDidExecuteCommand.fire({commandId:e,args:n}),a}_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{}}};Cd=uu([mu],Cd);Ve("requestPaymentSync",{version:1e6,properties:{paymentBody:{appStoreProductId:102e4}}});Ve("requestProductDetailsAsync",{version:102e4});Ve("invokeSubscriptionPanelSync",{version:107e4,properties:{type:{game:107e4,drama:107e4}}});Ve("loginSync",{version:1e6,properties:{skipLogin:102e4,triggerFrom:102e4}});Ve("getABTest",{version:1050100,platforms:{android:1050100,ios:!1}});Ve("userTrackAsync",{version:1e6});Ve("openMiniapp",{version:1050100});Ve("requestCoinDetailsSync",{version:1070100});Ve("requestCoinDetailsAsync",{version:1070100});Ve("sendServerEventAsync",{version:1070100});Ve("loadAdsAsync",{version:1070200});Ve("showAdAsync",{version:1070200});function Ve(e,t){if(as.config[e]){Pi.warn(`[can i use] ${e} already registered`);return}as.config[e]=gt({},t)}var Zg=(e,t)=>{function r(i){var a;let[o,...s]=i.split(":");if(!o)return!1;let l=as.config[o];if(!l)return!1;let c=(a=t==null?void 0:t())!=null?a:"",p=l.version;if(l.platforms&&c in l.platforms){let m=l.platforms[c];if(m===!1)return!1;typeof m=="number"&&(p=m)}if(typeof p!="number")return!1;let u=e();return typeof u!="number"||u<p?!1:s.length===0?!0:n(l,s,u)||n(l.properties,s,u)}function n(i,a,o){if(!i)return!1;let s=Mg(i,a);if(!s)return!1;if(sr(s)){let l=s.version;return Ad(l)?typeof o=="number"&&o>=l:!0}return Ad(s)?typeof o=="number"&&o>=s:s===!0}return{canIUseNative:r}};function Rd(e,t){return`[${e}]:${t}`}var e_=()=>qg(),Fr="custom_event_",t_=[],r_=[],n_=["env","createRequestTask","login"],vu="__batch_event__",i_="__native_batch_event__",a_=e=>e==="pv"?e:"default",gi=class{constructor(e){this.interval=30,this.lastReportTime=0,this.cache={};let{reporter:t,interval:r=30,eventName:n,tagNameOrder:i,metricName:a,type:o}=e;this.reporter=t,this.interval=r,this.eventName=n,this.tagNameOrder=i,this.metricName=a,this.type=a_(o)}report(e){this.type==="pv"?this.addPVPoint(e):this.addPoint(e),this.tryReport(!1)}flush(){this.tryReport(!0)}tryReport(e){if(Object.keys(this.cache).length){if(e){this.reporter(this.processPoints(this.cache)),this.clearPoints();return}this.lastReportTime=this.lastReportTime||Date.now(),Date.now()-this.lastReportTime>=this.interval*1e3&&(this.reporter(this.processPoints(this.cache)),this.clearPoints(),this.lastReportTime=Date.now())}}addPoint(e){let t=(r,n,i,a)=>{let o=n.shift();if(o){let s=a[o];r[s]||(r[s]={}),t(r[s],n,i,a)}else r[i]||(r[i]=[]),r[i].push(a[i])};t(this.cache,[...this.tagNameOrder],this.metricName,e)}addPVPoint(e){let t=(n,i,a,o)=>{let s=i.shift();if(!s&&sr(o))throw new Co(`report value failed to match tagNameOrder, ${JSON.stringify(r)}`);if(s){let l=[];if(sr(o))l.push(...Object.keys(o));else if(fu(o)){if(i.length>0)throw new Co(`report value failed to match tagNameOrder, ${JSON.stringify(r)}`);l.push(o)}else throw new Co(`expected metric value to be a string, but got a(n) ${typeof o}, ${JSON.stringify(r)}`);l.forEach(c=>{n[c]||(n[c]={});let p=sr(o)?o[c]:o;t(n[c],[...i],a,p)})}else n[a]?n[a]++:n[a]=1},r={point:e,metricName:this.metricName,tagNameOrder:this.tagNameOrder};t(this.cache,[...this.tagNameOrder],this.metricName,e)}processPoints(e){return{eventName:this.eventName,tagNameOrder:this.tagNameOrder,metricName:this.metricName,metricAggregateType:this.type==="pv"?"itoa":"arr",data:e}}clearPoints(){this.cache={}}},Od=!1,Oo,ko,To;function o_(e,t){Od||(Oo=new gi({eventName:"jolibox_invoke",tagNameOrder:["status","method","errNo","errMsg","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),ko=new gi({eventName:"jolibox_invoke_js2native",tagNameOrder:["status","method","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),To=new gi({eventName:"jolibox_invoke_native2js",tagNameOrder:["status","method","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),t("onJoliboxEnterBackground",()=>{Oo.flush(),ko.flush(),To.flush()}),Od=!0);function r(i){var a,o;let{method:s,args:l,startTime:c,isForeground:p,errMsg:u=`${s}:fail no errMsg`,errNo:m=0,__timing:h={receiveJSInvoke:0,invokeCallback:0}}=i,{receiveJSInvoke:w,invokeCallback:E}=h,I=(o=(a=u.match(/\S:(\S+)\s?/))==null?void 0:a[1])!=null?o:"fail";Oo.report({status:I,method:n(s,l),errNo:`${m}`,errMsg:u,isForeground:p,duration:Date.now()-c}),c&&w&&E&&(ko.report({status:I,method:s,isForeground:p,duration:Number((w-c).toFixed(3))}),To.report({status:I,method:s,isForeground:p,duration:Number((Date.now()-E).toFixed(3))}))}function n(i,a){return(i==="callHostMethod"||i==="callHostMethodSync")&&a!=null&&a.method?`${i}-${a.method}`:i}return r}var xo=[],us=Symbol.for("Jolibox.invokeResolverInstance"),s_=new Map;globalThis[us]||(globalThis[us]=s_);var l_={get resolveMap(){return globalThis[us]}};function c_(e,t){let r=0,n=!0,i=l_.resolveMap,a=o_(e,t);t("onJoliboxEnterBackground",()=>{n=!1}),t("onJoliboxEnterForeground",()=>{n=!0,xo.forEach(l=>Si(this,[l],function(c){let{method:p,args:u,resolve:m}=c;return function*(){let h=yield s(p,u);m(h)}()})),xo.length=0});let o=(l,c)=>{let p=i.get(Number(l));if(!p)return;let u=ns(c);p(u),i.delete(Number(l))},s=(l,c)=>{var p,u;let m=Date.now(),h=`${n}`;r+=1;let w=new Og;if(i.set(r,w.resolve),!n&&r_.includes(l))return new Promise(D=>{xo.push({method:l,args:c,resolve:D})});let E=_g(gt({},{method:l,startTime:m,args:c,isForeground:h}),{invokeType:"js-bridge"}),I=t_.includes(l),b=Ig(c,I),R=I?b:JSON.stringify(b),k;if(l.endsWith("Sync")||n_.includes(l)?k=(p=e.call)==null?void 0:p.call(e,l,b,r):typeof R=="string"?k=e.invoke(l,R,r):k=(u=e.call)==null?void 0:u.call(e,l,R,r),k){try{typeof k=="string"&&(k=JSON.parse(k)),k=ns(k)}catch(D){Pi.error(D)}return i.delete(r),k.errorCode&&(k.errorCode=Rd(l,k.errorCode)),a(gt(gt({},E),k)),k}return l.endsWith("Sync")&&i.delete(r),w.promise.then(D=>(D.errorCode&&(D.errorCode=Rd(l,D.errorCode)),a(gt(gt({},E),D)),D))};return{invokeNative:s,applyNative:(l,c)=>{let p=s(l,c);return xg(p)?p.then(u=>kd(l,u)):kd(l,p)},invokeHandler:o}}function kd(e,t){if(!sr(t)){Pi.warn(`[Jolibox SDK]${e} no response value`);return}let r=t,{errMsg:n,errNo:i,errorType:a,errorCode:o}=r,s=yg(r,["errMsg","errNo","errorType","errorCode"]);if(n&&n!==`${e}:ok`)throw new Lg(n,i,a,o);return s}var di=Symbol.for("Jolibox.subscribeInstance");function d_(e){if(globalThis[di])return globalThis[di];let t=new ls,r=new ls,n=new gi({eventName:"jolibox_publish",tagNameOrder:["type","event"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}});return t.on("onJoliboxEnterBackground",()=>{n.flush()}),globalThis[di]={onNative:t.on.bind(t),offNative:t.off.bind(t),subscribe:r.on.bind(r),unsubscribe:r.off.bind(r),subscribeHandler(i,a,o){let s=ns(a),l;if(s.__extra){l=s.params;let{type:c,startTime:p}=s.__extra;n.report({type:c,event:i,duration:Date.now()-p})}else l=s;if(i===vu){l.forEach(c=>{let[p,u]=c;try{r.emit(p.slice(Fr.length),u,o)}catch(m){}});return}if(i.startsWith(Fr)){r.emit(i.slice(Fr.length),l,o);return}t.emit(i,l,o)}},globalThis[di]}function u_(e){let t=new Map,r=new Map,n,i;return{publish:(a,o,s,l)=>{if(l){let p=s!==void 0?s==="*"?"*":[s]:void 0;e.publish(`${Fr}${a}`,o,p);return}n||(n=Promise.resolve().then(()=>{t.forEach((p,u)=>{try{let m=u!==void 0?u==="*"?"*":[u]:void 0;e.publish(vu,p,m)}catch(m){}}),n=void 0,t.clear()}));let c=t.get(s);c||(c=[],t.set(s,c)),c.push([`${Fr}${a}`,o])},emitNative:(a,o,s,l)=>{if(l){let p=s!==void 0?s==="*"?"*":[s]:void 0;e.publish(a,o,p),console.log("emitNative",a,o,p);return}i||(i=Promise.resolve().then(()=>{r.forEach((p,u)=>{try{let m=u!==void 0?u==="*"?"*":[u]:void 0;e.publish(i_,p,m)}catch(m){}}),i=void 0,r.clear()}));let c=r.get(s);c||(c=[],r.set(s,c)),c.push([a,o])}}}function f_(e){let{subscribeHandler:t,onNative:r,offNative:n,subscribe:i,unsubscribe:a}=d_(e),{invokeNative:o,invokeHandler:s,applyNative:l}=c_(e,r),{publish:c,emitNative:p}=u_(e);return{invokeHandler:s,subscribeHandler:t,applyNative:l,invokeNative:o,onNative:r,offNative:n,emitNative:p,publish:c,subscribe:i,unsubscribe:a}}function gu(e,t){return{params:e,__extra:{startTime:Date.now(),type:t}}}var ys,St={trigger(){},exit(){return Promise.resolve(!1)},backPress(){return Promise.resolve(!1)},onReady(e){St.trigger=e},onDoExit(e){St.exit=e},onDoBackPress(e){St.backPress=e}},_u=e=>{let t=window.prompt("invoke",JSON.stringify({event:"envSync",paramsString:JSON.stringify({})}));if(!t)e.onError(new Dg("native env failed"));else{let{data:r}=JSON.parse(t);return r!=null?r:void 0}};if(typeof window!="undefined"&&window.webkit){let e=window.webkit.messageHandlers,t=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";St.trigger(),e.onDocumentReady.postMessage({path:i})},r=i=>Si(void 0,null,function*(){let a=yield St.exit();e.doExit.postMessage({uuid:i,shouldInterrupt:a})});ys={onDocumentReady:t,doExit:r,invoke(i,a,o){e.invoke.postMessage({event:i,paramsString:a,callbackId:o})},publish(i,a,o){let s=gu(a,"joliboxJSCore");window.prompt("publish",JSON.stringify({event:i,paramsString:JSON.stringify(s),webviewIds:o}))},call(i,a,o){let s=window.prompt("invoke",JSON.stringify({event:i,paramsString:JSON.stringify(a),callbackId:o}));if(s)return JSON.parse(s)}};let n={onDocumentReady:t,env:_u,doExit:r};globalThis.joliboxJSCore=gt({},n)}if(typeof window!="undefined"&&window.JoliAndroidSDKBridge){let e=window.JoliAndroidSDKBridge,t=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";St.trigger(),e.onDocumentReady(JSON.stringify({path:i}))},r=i=>Si(void 0,null,function*(){let a=yield St.exit();e.doExit(JSON.stringify({uuid:i,shouldInterrupt:a}))});ys={onDocumentReady:t,invoke(i,a,o){e.invoke(JSON.stringify({event:i,paramsString:a,callbackId:o}))},doExit:r,publish(i,a,o){let s=gu(a,"joliboxJSCore");e.publish(JSON.stringify({event:i,paramsString:JSON.stringify(s),webviewIds:o}))},call(i,a,o){let s=window.prompt("invoke",JSON.stringify({event:i,paramsString:JSON.stringify(a),callbackId:o}));if(s)return JSON.parse(s)},doBackPress(i){return Si(this,null,function*(){let a=yield St.backPress();e.doBackPress(JSON.stringify({uuid:i,shouldInterrupt:a}))})}};let n={onDocumentReady:t,env:_u,doExit:r};globalThis.joliboxJSCore=gt({},n)}var yu=ys;if(!yu&&e_())throw new Ug("No joliboxJScore is found, native bridge not found.");var h_=gt({},yu),bu=f_(h_),{invokeHandler:Td}=bu,{invokeNative:Po,onNative:m_,offNative:p_,subscribeHandler:v_}=bu;globalThis.joliboxJSBridge={callHandler:Td,invokeHandler:Td,subscribeHandler:v_};function g_(e,t,r){return(t=__(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function __(e){var t=y_(e,"string");return typeof t=="symbol"?t:t+""}function y_(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 b_=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(e)try{e(...r)}catch(i){console.error("[JoliboxSDK] Callback error:",i)}},Ci=class{constructor(t){this.context=t,g_(this,"canIUseHelper",void 0),this.context=t;let{canIUseNative:r}=Zg(()=>this.context.getContextInfo().deviceInfo.nativeSDKVersionCode||1e6,()=>this.context.getContextInfo().deviceInfo.platform||"h5");this.canIUseHelper=r}loadAdsAsync(t){return A(this,null,function*(){try{let{errNo:r,errMsg:n}=yield Po("loadAdsAsync",{params:{providers:t.providers}});return r!==0||n.length>0?{code:"FAILURE",message:n||"Failed to load ads"}:{code:"SUCCESS",message:"Ads loaded successfully"}}catch(r){return{code:"FAILURE",message:`Failed to load ads: ${r instanceof Error?r.message:String(r)}`}}})}canIUse(){return No()&&this.canIUseHelper("loadAdsAsync")&&this.canIUseHelper("showAdAsync")}showAdAsync(t){return A(this,null,function*(){try{let r=yield Po("showAdAsync",{params:{providers:t.providers}});if(r.errNo!==0)return{code:"FAILURE",message:r.errMsg||"Failed to show ad"};let n=r.data.UUID;if(t.callbacks){let i=t.timeout!==void 0?t.timeout:3e5,a=null,o=()=>{p_("onAdsStateChange",s),a&&(clearTimeout(a),a=null)},s=l=>{var c;if(l.UUID!==n)return;let p=(c=t.callbacks)==null?void 0:c[l.event];p&&b_(p,l.data),["onAdClosed","onAdError","onAdDismissed"].includes(l.event)&&o()};m_("onAdsStateChange",s),i>0&&(a=setTimeout(()=>{o(),console.warn(`[JoliboxSDK] Event listener for ad ${n} auto-cleaned after ${i}ms timeout`)},i))}return{code:"SUCCESS",message:"Ad shown successfully"}}catch(r){return{code:"FAILURE",message:`Failed to show ad: ${r instanceof Error?r.message:String(r)}`}}})}isAdsReadySync(t){try{let{errNo:r,data:n}=Po("isAdsReadySync",{params:{providers:t.providers}});return r!==0||!n?(console.warn("[Jolibox SDK]isAdsReadySync returned an error or no data"),!1):!0}catch(r){return console.warn("[Jolibox SDK]isAdsReadySync invocation failed:",r),!1}}};function mt(e,t,r){return(t=w_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w_(e){var t=E_(e,"string");return typeof t=="symbol"?t:t+""}function E_(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 fs=class{get isAdsReady(){return this._isAdsReady}constructor(t,r){mt(this,"providers",void 0),mt(this,"helper",void 0),mt(this,"adsContext",null),mt(this,"_isAdsReady",!1),mt(this,"init",()=>A(this,null,function*(){this.helper.canIUse()&&((yield this.helper.loadAdsAsync({providers:this.providers})).code==="SUCCESS"?this._isAdsReady=!0:this._isAdsReady=!1)})),mt(this,"destroy",n=>{var i,a;this._isAdsReady=!1,(a=(i=this.adsContext)==null?void 0:i.adBreakDone)==null||a.call(i,n),n!=="ignored"&&(this.adsContext=null)}),mt(this,"reinit",n=>A(this,null,function*(){this.destroy(n),yield this.init()})),mt(this,"requestAds",(n,i)=>A(this,null,function*(){if(this.adsContext){this.destroy("ignored");return}this.adsContext=n,i&&i.length>0&&(this.providers=i);try{this.isAdsReady?this.showAd():yield this.reinit("frequencyCapped")}catch(a){this.destroy("notReady")}})),mt(this,"showAd",()=>{if(!this.adsContext){this.destroy("error");return}let n=!1,i=!1;this.adsContext.beforeReward(()=>A(this,null,function*(){var a,o;(o=(a=this.adsContext)==null?void 0:a.beforeAd)==null||o.call(a);let s=c=>{var p,u,m;i||(i=!0,c==="dismissed"&&((p=this.adsContext)==null||p.adDismissed()),(m=(u=this.adsContext)==null?void 0:u.afterAd)==null||m.call(u),this.reinit(c))},l={onAdShow:()=>{},onAdError:()=>{s("error")},onAdRewarded:()=>{var c;n=!0,(c=this.adsContext)==null||c.adViewed()},onAdDismissed:()=>{s(n?"viewed":"dismissed")},onAdClosed:()=>{s(n?"viewed":"dismissed")}};(yield this.helper.showAdAsync({providers:this.providers,callbacks:l,timeout:2e3})).code!=="SUCCESS"&&this.reinit("noAdPreloaded")}))}),this.providers=r,this.helper=new Ci(t),this.init()}};function pt(e,t,r){return(t=I_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function I_(e){var t=A_(e,"string");return typeof t=="symbol"?t:t+""}function A_(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 hs=class{get isAdsReady(){return this._isAdsReady}constructor(t,r){var n=this;pt(this,"providers",void 0),pt(this,"helper",void 0),pt(this,"adsContext",null),pt(this,"_isAdsReady",!1),pt(this,"init",()=>A(this,null,function*(){this.helper.canIUse()&&((yield this.helper.loadAdsAsync({providers:this.providers})).code==="SUCCESS"?this._isAdsReady=!0:this._isAdsReady=!1)})),pt(this,"destroy",function(i){var a,o;let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;n._isAdsReady=!1,s&&((o=(a=n.adsContext)==null?void 0:a.onEnd)==null||o.call(a,i),i!=="ignored"&&(n.adsContext=null))}),pt(this,"reinit",function(a){return A(this,arguments,function*(i){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;n.destroy(i,o),yield n.init()})}),pt(this,"requestAds",(i,a)=>A(this,null,function*(){if(this.adsContext){this.destroy("ignored");return}this.adsContext=i,a&&a.length>0&&(this.providers=a);try{this.isAdsReady?yield this.showAd():yield this.reinit("frequencyCapped")}catch(o){this.destroy("notReady")}})),pt(this,"showAd",()=>A(this,null,function*(){var i,a;if(!this.adsContext){this.destroy("error");return}let o=!1;(a=(i=this.adsContext).beforeAd)==null||a.call(i);let s=c=>{var p,u;o||(o=!0,(u=(p=this.adsContext)==null?void 0:p.afterAd)==null||u.call(p),this.reinit(c))},l={onAdShow:()=>{},onAdError:()=>{s("error")},onAdDismissed:()=>{s("dismissed")},onAdClosed:()=>{s("viewed")}};(yield this.helper.showAdAsync({providers:this.providers,callbacks:l,timeout:2e3})).code!=="SUCCESS"&&this.reinit("noAdPreloaded")})),this.providers=r,this.helper=new Ci(t),this.init()}};function Mr(e,t,r){return(t=S_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S_(e){var t=C_(e,"string");return typeof t=="symbol"?t:t+""}function C_(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 ms=class{constructor(t,r){Mr(this,"name","INTERNAL_NATIVE"),Mr(this,"context",void 0),Mr(this,"rewardAdManager",void 0),Mr(this,"interstitialManager",void 0),Mr(this,"initProviders",void 0),this.context=t,this.initProviders=r.providers;let n=this.getConfigsByTypes(["REWARD","REWARD_INTERSTITIAL"],r.providers),i=this.getConfigsByTypes(["INTERSTITIAL"],r.providers);n.length>0&&(this.rewardAdManager=new fs(this.context,n)),i.length>0&&(this.interstitialManager=new hs(this.context,i))}getConfigsByTypes(t,r,n){let i=[];return(n?n.map(a=>r.find(o=>o.provider===a.provider)).filter(a=>!!a):r).forEach(a=>{t.forEach(o=>{let s="";o==="REWARD"&&(s=a.params.adUnitId.reward),o==="REWARD_INTERSTITIAL"&&(s=a.params.adUnitId.rewardInterstitial),o==="INTERSTITIAL"&&(s=a.params.adUnitId.interstitial),s&&i.push({provider:a.provider,params:{placementId:s,adsType:o,extra:a.params.extra}})})}),i}init(){return A(this,null,function*(){})}adConfig(t,r){}adBreak(t,r){var n,i,a;switch(t.type){case"preroll":{(n=t.adBreakDone)==null||n.call(t,{breakType:"preroll",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"reward":{if(!this.rewardAdManager){(i=t.adBreakDone)==null||i.call(t,{breakName:t.name,breakType:t.type,breakFormat:"reward",breakStatus:"noAdPreloaded"});return}let o=this.getConfigsByTypes(["REWARD","REWARD_INTERSTITIAL"],this.initProviders,r.params);this.rewardAdManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,adDismissed:t.adDismissed,adViewed:t.adViewed,beforeReward:t.beforeReward,adBreakDone:s=>{var l;(l=t.adBreakDone)==null||l.call(t,{breakName:t.name,breakType:t.type,breakFormat:"reward",breakStatus:s})}},o);break}default:{let o=t;if(!this.interstitialManager){(a=t.adBreakDone)==null||a.call(t,{breakName:o.name,breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}let s=this.getConfigsByTypes(["INTERSTITIAL"],this.initProviders,r.params);this.interstitialManager.requestAds({beforeAd:o.beforeAd,afterAd:o.afterAd,onEnd:l=>{var c;(c=t.adBreakDone)==null||c.call(t,{breakName:o.name,breakType:t.type,breakFormat:"interstitial",breakStatus:l})}},s);break}}}};function We(e,t,r){return(t=R_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function R_(e){var t=O_(e,"string");return typeof t=="symbol"?t:t+""}function O_(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 $r=class{constructor(t){if(We(this,"context",void 0),We(this,"contextInfo",void 0),We(this,"providers",{}),We(this,"channelPolicy",void 0),We(this,"adsActionDetection",void 0),We(this,"requestContext",void 0),We(this,"adsRequest",void 0),We(this,"initialized",!1),We(this,"adsIsShowing",!1),We(this,"lastAdBreak",void 0),We(this,"initializedTimeStamp",Date.now()),t)this.context=t,this.channelPolicy=new Jo(this.context),this.adsActionDetection=new Go(this.context),this.contextInfo=this.context.getContextInfo(),this.adsRequest=new rs(t),this.requestContext=new Ii(t);else throw new Error("JoliboxAdsForGame requires a configuration object")}init(t){return A(this,null,function*(){window.adsbygoogle=window.adsbygoogle||[];let{data:r}=yield this.context.httpClient.post("/api/ads/init",{data:{contextData:this.requestContext.getRequestContextData("AdsAFGSDKInit"),bizParams:this.requestContext.getRequestBizParams(),testAdsMode:this.contextInfo.testAdsMode}});if((r==null?void 0:r.length)>0){let n=r.filter(s=>s.isNative),i=r.filter(s=>!s.isNative),a={provider:"INTERNAL_NATIVE",params:{providers:n}},o=i.concat([a]);for(let s of o)switch(s.provider){case"GOOGLE_GPT":{let l=new es(this.context,s.params);yield l.init(),this.providers[s.provider]=l;break}case"ADSENSE":case"ADSENSE_ADMOB":{let l=new Fo(this.context,s.params);yield l.init(),this.providers[s.provider]=l;break}case"OKSPIN":{let l=new zo(this.context,s.params);yield l.init(),this.providers.OKSPIN=l;break}case"APPSROCKETS":{let l=new Xo(this.context,s.params);yield l.init(),this.providers.APPSROCKETS=l;break}case"ADSENSE_BANNER_AS_AFG":{let l=new Yo(this.context,s.params);yield l.init(),this.providers.ADSENSE_BANNER_AS_AFG=l;break}case"INTERNAL_NATIVE":{let l=new ms(this.context,s.params);yield l.init(),this.providers.INTERNAL_NATIVE=l;break}}}this.adsRequest.cacheInterstitialInfo("start"),this.adsRequest.cacheRewardInfo(),this.initialized=!0})}adConfig(t){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(t):window.adsbygoogle.push(t)}adBreak(t){return A(this,null,function*(){var r,n,i,a,o,s,l,c,p,u,m,h,w,E,I,b;let R=Date.now();if(R-this.initializedTimeStamp<3e3){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}if(this.lastAdBreak&&R-this.lastAdBreak<500){console.warn("[Jolibox SDK Ads] You can't call adBreak too frequently"),(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.lastAdBreak=R,this.adsIsShowing){console.warn("[Jolibox SDK Ads] You can't call adBreak while ad is showing"),(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.initialized||(yield this.init()),t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}if(!this.context.checkNetwork()){(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}try{let k=yield this.adsRequest.getAFGAdsInfo(t.type),D=k==null?void 0:k.data,J=k==null?void 0:k.code;if(J==="BYPASS_ADS"){switch(t.type){case"preroll":{(s=t.adBreakDone)==null||s.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"viewed"});break}case"reward":{t.beforeReward(()=>{var S,N,F,H;(S=t.beforeAd)==null||S.call(t),(N=t.adViewed)==null||N.call(t),(F=t.afterAd)==null||F.call(t),(H=t.adBreakDone)==null||H.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"viewed"})});break}default:{(l=t.beforeAd)==null||l.call(t),(c=t.afterAd)==null||c.call(t),(p=t.adBreakDone)==null||p.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"});break}}return}if(!D||J!=="SUCCESS"){(u=t.adBreakDone)==null||u.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{if(D.length===0){(m=t.adBreakDone)==null||m.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let S=!0,N=null,F=new Mo(this.context);this.adsActionDetection.adBreakIsShowing=!0;let H=D.filter(G=>G.isNative),U=D.filter(G=>!G.isNative),M=[{seq:(w=(h=H[0])==null?void 0:h.seq)!=null?w:0,provider:"INTERNAL_NATIVE",params:H}].concat(U);for(M.sort((G,K)=>G.seq-K.seq).map((G,K)=>qm(Nd({},G),{seq:K}));M.length>0;){let G=M.shift(),K=this.providers[G.provider];if(K){let[Y,Ue]=yield F.callAdBreakAndContinue(K,t,G,Rt=>{var jt;this.adsIsShowing=Rt,(jt=this.context.eventEmitter)==null||jt.emit("isAdShowing",Rt)});S=Y,N=Ue}else S=!0,N={breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!S)break}S&&N&&((E=t.adBreakDone)==null||E.call(t,N))}}catch(k){(I=t.adBreakDone)==null||I.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{this.adsIsShowing=!1,(b=this.context.eventEmitter)==null||b.emit("isAdShowing",!1),this.adsActionDetection.adBreakIsShowing=!1}})}adUnit(t){console.warn("This method has been deprecated. We will not support AdSense AdUnit in the future.")}};var fS=Ce`
|
|
259
|
+
${ge}
|
|
260
260
|
position: fixed;
|
|
261
261
|
left: 0;
|
|
262
262
|
top: 0;
|
|
@@ -267,7 +267,7 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
267
267
|
height: 100vh;
|
|
268
268
|
|
|
269
269
|
.ads-wrapper {
|
|
270
|
-
${
|
|
270
|
+
${ge}
|
|
271
271
|
position: relative;
|
|
272
272
|
width: 100%;
|
|
273
273
|
height: 100%;
|
|
@@ -290,7 +290,7 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
.retry-button {
|
|
293
|
-
${
|
|
293
|
+
${ge}
|
|
294
294
|
position: absolute;
|
|
295
295
|
width: 100%;
|
|
296
296
|
height: 100%;
|
|
@@ -300,7 +300,7 @@ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super
|
|
|
300
300
|
cursor: pointer;
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
`;fe();var OI=xa(pu());var Nn=class{constructor(e){this.ads=e}getAdsInstance(){return this.ads}init(){}adConfig(e){var n,r;(r=(n=this.ads)==null?void 0:n.adConfig)==null||r.call(n,e)}adBreak(e){this.ads.adBreak(e)}adUnit(){}};var Un=class t{constructor(){this.callbacksId=0,this.callbackMap=new Map,this.initOnMessage()}static getInstance(){return t.instance||(t.instance=new t),t.instance}initOnMessage(){window.addEventListener("message",e=>{var n,r,a,i,o,s,l,d,_;if(console.log(`HuaweiQuickAdsHandler,event => ${e}`),e.origin==window.location.origin&&e.data&&e.data.type==null){let f=JSON.parse(e.data);switch(console.log(`HuaweiQuickAdsHandler type => ${f.type}`),f.type){case"huawei_quick_ads_on_message_init":console.log("HuaweiQuickAdsHandler window.addEventListener init",f);break;case"huawei_quick_ads_on_message_ad_config":{let p=f.callbackId;if(p){let h=this.callbackMap.get(p);(n=h==null?void 0:h.onReady)==null||n.call(h)}console.log("HuaweiQuickAdsHandler window.addEventListener adConfig",f)}break;case"huawei_quick_ads_on_message_ad_break":{let p=f.callbackId;if(p){let h=this.callbackMap.get(p),b="noAdPreloaded",E=!1;switch(f.adsRes){case"viewed":b="viewed",(r=h==null?void 0:h.adViewed)==null||r.call(h),E=!1;break;case"dismissed":b="dismissed",(a=h==null?void 0:h.adDismissed)==null||a.call(h),E=!1;break;case"notReady":case"timeout":case"error":case"noAdPreloaded":case"frequencyCapped":case"ignored":case"other":b=f.adsRes,E=!0;break;case"breakDone":b=f.params,E=!0;break;case"beforeReward":(i=h==null?void 0:h.beforeReward)==null||i.call(h,()=>{window.system.postMessage(JSON.stringify({type:"huawei_quick_ads_ad_operation"})),console.log("HuaweiQuickAdsHandler beforeReward postMessage AD_OPERATION")}),E=!1;break;case"beforeAd":(o=h==null?void 0:h.beforeAd)==null||o.call(h),E=!1;break;case"afterAd":(s=h==null?void 0:h.afterAd)==null||s.call(h),E=!1;break}E&&((_=h==null?void 0:h.adBreakDone)==null||_.call(h,{breakType:(l=h.breakType)!=null?l:"",breakName:h.breakName,breakFormat:(d=h.breakFormat)!=null?d:"interstitial",breakStatus:b}))}console.log("HuaweiQuickAdsHandler window.addEventListener adBreak",f)}break;case"huawei_quick_ads_on_message_ad_unit":console.log("HuaweiQuickAdsHandler window.addEventListener adUnit",f);break;default:break}}})}getAdsInstance(){return t.getInstance()}init(e){try{this.sendPostMessage("huawei_quick_ads_init",void 0,e)}catch(n){console.error("init failed",n)}}adConfig(e){try{let n;e.onReady&&(n=++this.callbacksId,this.callbackMap.set(n,{onReady:e.onReady})),this.sendPostMessage("huawei_quick_ads_ad_config",n,e)}catch(n){console.error("adConfig failed",n)}}adBreak(e){var n;try{let r=++this.callbacksId,a={};a.breakType=e.type,e.type!=="preroll"&&e.name&&(a.breakName=e.name),a.breakFormat=e.type==="reward"?"reward":"interstitial",e.adBreakDone&&(a.adBreakDone=e.adBreakDone),e.type!=="preroll"&&e.beforeAd&&(a.beforeAd=e.beforeAd),e.type!=="preroll"&&e.afterAd&&(a.afterAd=e.afterAd),e.type==="reward"&&e.beforeReward&&(a.beforeReward=e.beforeReward),e.type==="reward"&&e.adDismissed&&(a.adDismissed=e.adDismissed),e.type==="reward"&&e.adViewed&&(a.adViewed=e.adViewed),this.callbackMap.set(r,a),this.sendPostMessage("huawei_quick_ads_ad_break",r,e)}catch(r){(n=e.adBreakDone)==null||n.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}}adUnit(e){try{this.sendPostMessage("huawei_quick_ads_ad_unit",void 0,e)}catch(n){console.error("adUnit failed",n)}}sendPostMessage(e,n,r){var a;try{if(!((a=window.system)!=null&&a.postMessage))throw new Error("window.system.postMessage is not available");let i=W(W({type:e},n!==void 0&&{callbackId:n}),r!==void 0&&{data:r});window.system.postMessage(JSON.stringify(i))}catch(i){throw console.error("sendPostMessage failed",i),i}}};var Bn=class t{constructor(){}static getInstance(){return t.instance||(t.instance=new t),t.instance}getAdsInstance(){return t.getInstance()}init(){}adConfig(e){e.onReady&&e.onReady()}adBreak(e){var n;try{e.type==="reward"?window.gdsdk.preloadAd("rewarded").then(()=>{var r;(r=e.beforeReward)==null||r.call(e,()=>{e.beforeAd&&e.beforeAd(),window.gdsdk.showAd("rewarded").then(a=>{var i,o,s,l,d;(i=a==null?void 0:a.args)!=null&&i.success?(o=e.adViewed)==null||o.call(e):(s=e.adDismissed)==null||s.call(e),e.afterAd&&e.afterAd(),(d=e.adBreakDone)==null||d.call(e,{breakType:e.type,breakName:e.name,breakFormat:"reward",breakStatus:(l=a==null?void 0:a.args)!=null&&l.success?"viewed":"dismissed"})}).catch(a=>{var i;console.log("showReward error => ",a),(i=e.adBreakDone)==null||i.call(e,{breakType:e.type,breakName:e.name,breakFormat:"reward",breakStatus:"noAdPreloaded"})})})}).catch(r=>{var a;console.log("preloadAd error => ",r),(a=e.adBreakDone)==null||a.call(e,{breakType:e.type,breakName:e.name,breakFormat:"reward",breakStatus:"noAdPreloaded"})}):(e.type!=="preroll"&&e.beforeAd&&e.beforeAd(),window.gdsdk.showAd("interstitial").then(()=>{var r;e.type!=="preroll"&&e.afterAd&&e.afterAd(),(r=e.adBreakDone)==null||r.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:"interstitial",breakStatus:"viewed"})}))}catch(r){console.log("adBreak error => ",r),(n=e.adBreakDone)==null||n.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"error"})}}adUnit(){}};fe();var Lt=class{constructor(e,n){this.ads=e;this.httpClient=n}getAdsInstance(){return this.ads}init(e){this.ads.init(e)}adConfig(e){this.ads.adConfig(e)}adBreak(e){return S(this,null,function*(){var r,a;if((r=L.hostUserInfo)==null?void 0:r.isSubUser){this.wrapAdBreadDoneViewed(e);return}if(e.type==="reward")try{let i=yield Xe.getRewardsTypes(this.httpClient);if(!(yield Xe.handleReward(i,e)))throw new Error("handleReward failed: fallback to unlock failed")}catch(i){console.info("handleReward failed",i),(a=e.adBreakDone)==null||a.call(e,{breakType:e.type,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}else this.ads.adBreak(e)})}adUnit(e){this.ads.adUnit(e)}wrapAdBreadDoneViewed(e){var n,r,a;(r=e.adBreakDone)==null||r.call(e,{breakType:e.type,breakName:"name"in e&&(n=e.name)!=null?n:"",breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"viewed"}),"adViewed"in e&&((a=e.adViewed)==null||a.call(e))}};var Mn=class t extends Lt{constructor(e,n){super(e,n),this.startTimes=Date.now()}adBreak(e){return S(this,null,function*(){var n,r;if(e.type!=="reward"){if(e.type==="preroll"){(n=e.adBreakDone)==null||n.call(e,{breakType:e.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}let a=Date.now();if(console.log("FunmaxAdsHandler time => ",a-this.startTimes),a-this.startTimes<4e4){(r=e.adBreakDone)==null||r.call(e,{breakType:e.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}}cs(t.prototype,this,"adBreak").call(this,e)})}};var Do=class{constructor(e){this.cacheHandler=null;this.context=e}createAdsHandler(e){if(this.cacheHandler)return this.cacheHandler;switch(e){case"dlightek":{this.cacheHandler=new Nn(window.h5sdk);break}case"huaweiQuick":{this.cacheHandler=Un.getInstance();break}case"gamedistribution":{this.cacheHandler=Bn.getInstance();break}case"funmax":{let n=new xn(this.context);this.cacheHandler=new Mn(n,wt);break}default:{let n=new xn(this.context);this.cacheHandler=new Lt(n,wt);break}}return this.cacheHandler}getAdsHandler(e){return this.createAdsHandler(e)}},ha=we(),vu=new $e,wt=qe.create(),lv={httpClient:wt,checkNetwork:()=>qe.getNetworkStatus(),track:Te,eventEmitter:vu,getWindowInfo:()=>({width:window.innerWidth*window.devicePixelRatio,height:window.innerHeight*window.devicePixelRatio,statusBarHeight:0}),handleLinkClicked:t=>{window.open(t,"_blank")},getContextInfo:()=>{var t,e,n,r,a,i,o,s,l;return{hostAppId:(e=(t=L.hostInfo)==null?void 0:t.aid)!=null?e:"1",deviceId:(n=L.deviceInfo.did)!=null?n:"",adId:(r=L.deviceInfo.adId)!=null?r:"",sessionId:(a=L.sessionId)!=null?a:"",userId:(o=(i=L.hostUserInfo)==null?void 0:i.uid)!=null?o:"",objectType:"GAME",objectId:L.mpId,testAdsMode:L.testAdsMode,channel:(s=L.joliSource)!=null?s:"",deviceBrand:L.deviceInfo.brand,deviceModel:L.deviceInfo.model,osType:Re.isAndroid?"ANDROID":Re.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3,joliSource:(l=L.joliSource)!=null?l:""}}},gu=t=>{Ke("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:t}),Te("jolicoin_unlock_success",{quantity:t.quantity})},cv=()=>{Te("subscription_unlock_success",{})},uv=new Do(lv),Gn=uv.getAdsHandler(L.sdkEnvironment);Xe.registerRewardHandler("ADS",vl(Gn.getAdsInstance()));Xe.registerRewardHandler("JOLI_COIN",_l(wt,{onUnlockSuccess:gu.bind(void 0),hasSubscription:()=>!0}));Xe.registerRewardHandler("JOLI_COIN_ONLY",yl(wt,{onUnlockSuccess:gu.bind(void 0),hasSubscription:()=>!0}));Xe.registerRewardHandler("SUBSCRIPTION",Il(wt,{onSubSuccess:cv.bind(void 0),hasSubscription:()=>!0}));Ti(wt);Lr(wt);vu.on("isAdShowing",t=>{Ke("JOLIBOX_ADS_EVENT",{isAdShowing:t})});ha.registerCommand("AdsSDK.init",t=>{Gn.init(t)});ha.registerCommand("AdsSDK.adConfig",t=>{Gn.adConfig(t)});ha.registerCommand("AdsSDK.adBreak",t=>{Gn.adBreak(t)});ha.registerCommand("AdsSDK.adUnit",t=>{Gn.adUnit(t)});q();vt();var _u=we();_u.registerCommand("RuntimeSDK.loadFinishedEvent",()=>{let t=performance.now();Te("loadFinished",{duration:t})});_u.registerCommand("RuntimeSDK.loadProgressEvent",t=>{console.log("RuntimeSDK.loadProgressEvent",t)});q();vt();var Au=-1,pa=function(t){addEventListener("pageshow",function(e){e.persisted&&(Au=e.timeStamp,t(e))},!0)},No=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},va=function(){var t=No();return t&&t.activationStart||0},rn=function(t,e){var n=No(),r="navigate";return Au>=0?r="back-forward-cache":n&&(document.prerendering||va()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:e===void 0?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Su=function(t,e,n){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver(function(a){Promise.resolve().then(function(){e(a.getEntries())})});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(a){}},an=function(t,e,n,r){var a,i;return function(o){e.value>=0&&(o||r)&&((i=e.value-(a||0))||a===void 0)&&(a=e.value,e.delta=i,e.rating=function(s,l){return s>l[1]?"poor":s>l[0]?"needs-improvement":"good"}(e.value,n),t(e))}},Cu=function(t){requestAnimationFrame(function(){return requestAnimationFrame(function(){return t()})})},Ru=function(t){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&t()})},Ou=function(t){var e=!1;return function(){e||(t(),e=!0)}},nn=-1,yu=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},ma=function(t){document.visibilityState==="hidden"&&nn>-1&&(nn=t.type==="visibilitychange"?t.timeStamp:0,dv())},wu=function(){addEventListener("visibilitychange",ma,!0),addEventListener("prerenderingchange",ma,!0)},dv=function(){removeEventListener("visibilitychange",ma,!0),removeEventListener("prerenderingchange",ma,!0)},ku=function(){return nn<0&&(nn=yu(),wu(),pa(function(){setTimeout(function(){nn=yu(),wu()},0)})),{get firstHiddenTime(){return nn}}},Uo=function(t){document.prerendering?addEventListener("prerenderingchange",function(){return t()},!0):t()},bu=[1800,3e3],Tu=function(t,e){e=e||{},Uo(function(){var n,r=ku(),a=rn("FCP"),i=Su("paint",function(o){o.forEach(function(s){s.name==="first-contentful-paint"&&(i.disconnect(),s.startTime<r.firstHiddenTime&&(a.value=Math.max(s.startTime-va(),0),a.entries.push(s),n(!0)))})});i&&(n=an(t,a,bu,e.reportAllChanges),pa(function(o){a=rn("FCP"),n=an(t,a,bu,e.reportAllChanges),Cu(function(){a.value=performance.now()-o.timeStamp,n(!0)})}))})};var fv=function(t){var e=self.requestIdleCallback||self.setTimeout,n=-1;return t=Ou(t),document.visibilityState==="hidden"?t():(n=e(t),Ru(t)),n};var Eu=[2500,4e3],Lo={},xu=function(t,e){e=e||{},Uo(function(){var n,r=ku(),a=rn("LCP"),i=function(l){e.reportAllChanges||(l=l.slice(-1)),l.forEach(function(d){d.startTime<r.firstHiddenTime&&(a.value=Math.max(d.startTime-va(),0),a.entries=[d],n())})},o=Su("largest-contentful-paint",i);if(o){n=an(t,a,Eu,e.reportAllChanges);var s=Ou(function(){Lo[a.id]||(i(o.takeRecords()),o.disconnect(),Lo[a.id]=!0,n(!0))});["keydown","click"].forEach(function(l){addEventListener(l,function(){return fv(s)},{once:!0,capture:!0})}),Ru(s),pa(function(l){a=rn("LCP"),n=an(t,a,Eu,e.reportAllChanges),Cu(function(){a.value=performance.now()-l.timeStamp,Lo[a.id]=!0,n(!0)})})}})},Iu=[800,1800],hv=function t(e){document.prerendering?Uo(function(){return t(e)}):document.readyState!=="complete"?addEventListener("load",function(){return t(e)},!0):setTimeout(e,0)},Pu=function(t,e){e=e||{};var n=rn("TTFB"),r=an(t,n,Iu,e.reportAllChanges);hv(function(){var a=No();a&&(n.value=Math.max(a.responseStart-va(),0),n.entries=[a],r(!0),pa(function(){n=rn("TTFB",0),(r=an(t,n,Iu,e.reportAllChanges))(!0)}))})};fe();Jt();et();q();Ir();q();var ga=new Map,Du=!1,mv=()=>{Du||(Ct("ON_JOLIBOX_GET_USER_SUB_STATUS",t=>{let e=ga.get(t.sequenceId);e&&(clearTimeout(e.timeoutId),e.resolve(t.isSubUser),ga.delete(t.sequenceId))}),Du=!0)};function Bo(){return S(this,null,function*(){return mv(),new Promise((t,e)=>{let n=je(),r=setTimeout(()=>{ga.delete(n),e(new Error("Timeout waiting for user sub status response"))},3e3);ga.set(n,{resolve:t,reject:e,timeoutId:r}),Ke("JOLIBOX_GET_USER_SUB_STATUS",{sequenceId:n})})})}function Lu(){return S(this,null,function*(){let t=qe.create();try{let e=yield t.get("/api/users/info");return!(e.code!=="SUCCESS"||!e.data)}catch(e){return Ue(new $n(e)),!1}})}function pv(){Tu(t=>{Te("GameFCP",{value:t.value,rating:t.rating,navigationType:t.navigationType})}),xu(t=>{Te("GameLCP",{value:t.value,rating:t.rating,navigationType:t.navigationType})}),Pu(t=>{Te("GameTTFB",{value:t.value,rating:t.rating,navigationType:t.navigationType})})}function vv(){pt.on("onDocumentReady",t=>S(this,null,function*(){let e=yield Lu(),n=yield Bo().catch(()=>!1);L.onEnvConfigChanged({hostUserInfo:{isLogin:e,isSubUser:n}}),pt.emit("LifecycleEvent.onReady",W({},L.hostUserInfo?L.hostUserInfo:{isLogin:!1})),L.mpType==="game"&&nt.start(Date.now()-t)}))}function Nu(){vv(),pv()}Nu();
|
|
303
|
+
`;he();var cC=Xi(Eu());var Yr=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(){}adConfig(t){var r,n;(n=(r=this.ads)==null?void 0:r.adConfig)==null||n.call(r,t)}adBreak(t){this.ads.adBreak(t)}adUnit(){}};var Xr=class e{constructor(){this.callbacksId=0,this.callbackMap=new Map,this.initOnMessage()}static getInstance(){return e.instance||(e.instance=new e),e.instance}initOnMessage(){window.addEventListener("message",t=>{var r,n,i,a,o,s,l,c,p;if(console.log(`HuaweiQuickAdsHandler,event => ${t}`),t.origin==window.location.origin&&t.data&&t.data.type==null){let u=JSON.parse(t.data);switch(console.log(`HuaweiQuickAdsHandler type => ${u.type}`),u.type){case"huawei_quick_ads_on_message_init":console.log("HuaweiQuickAdsHandler window.addEventListener init",u);break;case"huawei_quick_ads_on_message_ad_config":{let m=u.callbackId;if(m){let h=this.callbackMap.get(m);(r=h==null?void 0:h.onReady)==null||r.call(h)}console.log("HuaweiQuickAdsHandler window.addEventListener adConfig",u)}break;case"huawei_quick_ads_on_message_ad_break":{let m=u.callbackId;if(m){let h=this.callbackMap.get(m),w="noAdPreloaded",E=!1;switch(u.adsRes){case"viewed":w="viewed",(n=h==null?void 0:h.adViewed)==null||n.call(h),E=!1;break;case"dismissed":w="dismissed",(i=h==null?void 0:h.adDismissed)==null||i.call(h),E=!1;break;case"notReady":case"timeout":case"error":case"noAdPreloaded":case"frequencyCapped":case"ignored":case"other":w=u.adsRes,E=!0;break;case"breakDone":w=u.params,E=!0;break;case"beforeReward":(a=h==null?void 0:h.beforeReward)==null||a.call(h,()=>{window.system.postMessage(JSON.stringify({type:"huawei_quick_ads_ad_operation"})),console.log("HuaweiQuickAdsHandler beforeReward postMessage AD_OPERATION")}),E=!1;break;case"beforeAd":(o=h==null?void 0:h.beforeAd)==null||o.call(h),E=!1;break;case"afterAd":(s=h==null?void 0:h.afterAd)==null||s.call(h),E=!1;break}E&&((p=h==null?void 0:h.adBreakDone)==null||p.call(h,{breakType:(l=h.breakType)!=null?l:"",breakName:h.breakName,breakFormat:(c=h.breakFormat)!=null?c:"interstitial",breakStatus:w}))}console.log("HuaweiQuickAdsHandler window.addEventListener adBreak",u)}break;case"huawei_quick_ads_on_message_ad_unit":console.log("HuaweiQuickAdsHandler window.addEventListener adUnit",u);break;default:break}}})}getAdsInstance(){return e.getInstance()}init(t){try{this.sendPostMessage("huawei_quick_ads_init",void 0,t)}catch(r){console.error("init failed",r)}}adConfig(t){try{let r;t.onReady&&(r=++this.callbacksId,this.callbackMap.set(r,{onReady:t.onReady})),this.sendPostMessage("huawei_quick_ads_ad_config",r,t)}catch(r){console.error("adConfig failed",r)}}adBreak(t){var r;try{let n=++this.callbacksId,i={};i.breakType=t.type,t.type!=="preroll"&&t.name&&(i.breakName=t.name),i.breakFormat=t.type==="reward"?"reward":"interstitial",t.adBreakDone&&(i.adBreakDone=t.adBreakDone),t.type!=="preroll"&&t.beforeAd&&(i.beforeAd=t.beforeAd),t.type!=="preroll"&&t.afterAd&&(i.afterAd=t.afterAd),t.type==="reward"&&t.beforeReward&&(i.beforeReward=t.beforeReward),t.type==="reward"&&t.adDismissed&&(i.adDismissed=t.adDismissed),t.type==="reward"&&t.adViewed&&(i.adViewed=t.adViewed),this.callbackMap.set(n,i),this.sendPostMessage("huawei_quick_ads_ad_break",n,t)}catch(n){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}}adUnit(t){try{this.sendPostMessage("huawei_quick_ads_ad_unit",void 0,t)}catch(r){console.error("adUnit failed",r)}}sendPostMessage(t,r,n){var i;try{if(!((i=window.system)!=null&&i.postMessage))throw new Error("window.system.postMessage is not available");let a=z(z({type:t},r!==void 0&&{callbackId:r}),n!==void 0&&{data:n});window.system.postMessage(JSON.stringify(a))}catch(a){throw console.error("sendPostMessage failed",a),a}}};var Qr=class e{constructor(){}static getInstance(){return e.instance||(e.instance=new e),e.instance}getAdsInstance(){return e.getInstance()}init(){}adConfig(t){t.onReady&&t.onReady()}adBreak(t){var r;try{t.type==="reward"?window.gdsdk.preloadAd("rewarded").then(()=>{var n;(n=t.beforeReward)==null||n.call(t,()=>{t.beforeAd&&t.beforeAd(),window.gdsdk.showAd("rewarded").then(i=>{var a,o,s,l,c;(a=i==null?void 0:i.args)!=null&&a.success?(o=t.adViewed)==null||o.call(t):(s=t.adDismissed)==null||s.call(t),t.afterAd&&t.afterAd(),(c=t.adBreakDone)==null||c.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:(l=i==null?void 0:i.args)!=null&&l.success?"viewed":"dismissed"})}).catch(i=>{var a;console.log("showReward error => ",i),(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"noAdPreloaded"})})})}).catch(n=>{var i;console.log("preloadAd error => ",n),(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"noAdPreloaded"})}):(t.type!=="preroll"&&t.beforeAd&&t.beforeAd(),window.gdsdk.showAd("interstitial").then(()=>{var n;t.type!=="preroll"&&t.afterAd&&t.afterAd(),(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:"interstitial",breakStatus:"viewed"})}))}catch(n){console.log("adBreak error => ",n),(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"error"})}}adUnit(){}};he();var Ft=class{constructor(t,r){this.ads=t;this.httpClient=r}getAdsInstance(){return this.ads}init(t){this.ads.init(t)}adConfig(t){this.ads.adConfig(t)}adBreak(t){return A(this,null,function*(){var n,i;if((n=L.hostUserInfo)==null?void 0:n.isSubUser){this.wrapAdBreadDoneViewed(t);return}if(t.type==="reward")try{let a=yield Qe.getRewardsTypes(this.httpClient);if(!(yield Qe.handleReward(a,t)))throw new Error("handleReward failed: fallback to unlock failed")}catch(a){console.info("handleReward failed",a),(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}else this.ads.adBreak(t)})}adUnit(t){this.ads.adUnit(t)}wrapAdBreadDoneViewed(t){var r,n,i;(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:"name"in t&&(r=t.name)!=null?r:"",breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"viewed"}),"adViewed"in t&&((i=t.adViewed)==null||i.call(t))}};var Zr=class e extends Ft{constructor(t,r){super(t,r),this.startTimes=Date.now()}adBreak(t){return A(this,null,function*(){var r,n;if(t.type!=="reward"){if(t.type==="preroll"){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}let i=Date.now();if(console.log("FunmaxAdsHandler time => ",i-this.startTimes),i-this.startTimes<4e4){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}}Ys(e.prototype,this,"adBreak").call(this,t)})}};var bs=class{constructor(t){this.cacheHandler=null;this.context=t}createAdsHandler(t){if(this.cacheHandler)return this.cacheHandler;switch(t){case"dlightek":{this.cacheHandler=new Yr(window.h5sdk);break}case"huaweiQuick":{this.cacheHandler=Xr.getInstance();break}case"gamedistribution":{this.cacheHandler=Qr.getInstance();break}case"funmax":{let r=new $r(this.context);this.cacheHandler=new Zr(r,Ct);break}default:{let r=new $r(this.context);this.cacheHandler=new Ft(r,Ct);break}}return this.cacheHandler}getAdsHandler(t){return this.createAdsHandler(t)}},Di=we(),Iu=new ze,Ct=Ke.create(),k_={httpClient:Ct,checkNetwork:()=>Ke.getNetworkStatus(),track:xe,eventEmitter:Iu,getWindowInfo:()=>({width:window.innerWidth*window.devicePixelRatio,height:window.innerHeight*window.devicePixelRatio,statusBarHeight:0}),handleLinkClicked:e=>{window.open(e,"_blank")},getContextInfo:()=>{var e,t,r,n,i,a,o,s,l;return{hostAppId:(t=(e=L.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(r=L.deviceInfo.did)!=null?r:"",adId:(n=L.deviceInfo.adId)!=null?n:"",sessionId:(i=L.sessionId)!=null?i:"",userId:(o=(a=L.hostUserInfo)==null?void 0:a.uid)!=null?o:"",objectType:"GAME",objectId:L.mpId,testAdsMode:L.testAdsMode,channel:(s=L.joliSource)!=null?s:"",deviceBrand:L.deviceInfo.brand,deviceModel:L.deviceInfo.model,osType:Oe.isAndroid?"ANDROID":Oe.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3,joliSource:(l=L.joliSource)!=null?l:"",deviceInfo:{platform:"h5",nativeSDKVersionCode:0}}}},Au=e=>{Ge("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e}),xe("jolicoin_unlock_success",{quantity:e.quantity})},T_=()=>{xe("subscription_unlock_success",{})},x_=new bs(k_),en=x_.getAdsHandler(L.sdkEnvironment);Qe.registerRewardHandler("ADS",nc(en.getAdsInstance()));Qe.registerRewardHandler("JOLI_COIN",ac(Ct,{onUnlockSuccess:Au.bind(void 0),hasSubscription:()=>!0}));Qe.registerRewardHandler("JOLI_COIN_ONLY",oc(Ct,{onUnlockSuccess:Au.bind(void 0),hasSubscription:()=>!0}));Qe.registerRewardHandler("SUBSCRIPTION",dc(Ct,{onSubSuccess:T_.bind(void 0),hasSubscription:()=>!0}));Ya(Ct);Wn(Ct);Iu.on("isAdShowing",e=>{Ge("JOLIBOX_ADS_EVENT",{isAdShowing:e})});Di.registerCommand("AdsSDK.init",e=>{en.init(e)});Di.registerCommand("AdsSDK.adConfig",e=>{en.adConfig(e)});Di.registerCommand("AdsSDK.adBreak",e=>{en.adBreak(e)});Di.registerCommand("AdsSDK.adUnit",e=>{en.adUnit(e)});q();wt();Ar();var Su=we();Su.registerCommand("RuntimeSDK.loadFinishedEvent",()=>{let e=performance.now();Ge("CP_LOAD_FINISH",{}),xe("loadFinished",{duration:e})});Su.registerCommand("RuntimeSDK.loadProgressEvent",e=>{Ge("CP_LOAD_PROGRESS",{progress:e}),console.log("RuntimeSDK.loadProgressEvent",e)});q();wt();var xu=-1,Ui=function(e){addEventListener("pageshow",function(t){t.persisted&&(xu=t.timeStamp,e(t))},!0)},Es=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Bi=function(){var e=Es();return e&&e.activationStart||0},hr=function(e,t){var r=Es(),n="navigate";return xu>=0?n="back-forward-cache":r&&(document.prerendering||Bi()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},Pu=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(i){Promise.resolve().then(function(){t(i.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(i){}},mr=function(e,t,r,n){var i,a;return function(o){t.value>=0&&(o||n)&&((a=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=a,t.rating=function(s,l){return s>l[1]?"poor":s>l[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Nu=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},Du=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},Lu=function(e){var t=!1;return function(){t||(e(),t=!0)}},fr=-1,Cu=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Li=function(e){document.visibilityState==="hidden"&&fr>-1&&(fr=e.type==="visibilitychange"?e.timeStamp:0,P_())},Ru=function(){addEventListener("visibilitychange",Li,!0),addEventListener("prerenderingchange",Li,!0)},P_=function(){removeEventListener("visibilitychange",Li,!0),removeEventListener("prerenderingchange",Li,!0)},Uu=function(){return fr<0&&(fr=Cu(),Ru(),Ui(function(){setTimeout(function(){fr=Cu(),Ru()},0)})),{get firstHiddenTime(){return fr}}},Is=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},Ou=[1800,3e3],Bu=function(e,t){t=t||{},Is(function(){var r,n=Uu(),i=hr("FCP"),a=Pu("paint",function(o){o.forEach(function(s){s.name==="first-contentful-paint"&&(a.disconnect(),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-Bi(),0),i.entries.push(s),r(!0)))})});a&&(r=mr(e,i,Ou,t.reportAllChanges),Ui(function(o){i=hr("FCP"),r=mr(e,i,Ou,t.reportAllChanges),Nu(function(){i.value=performance.now()-o.timeStamp,r(!0)})}))})};var N_=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=Lu(e),document.visibilityState==="hidden"?e():(r=t(e),Du(e)),r};var ku=[2500,4e3],ws={},Mu=function(e,t){t=t||{},Is(function(){var r,n=Uu(),i=hr("LCP"),a=function(l){t.reportAllChanges||(l=l.slice(-1)),l.forEach(function(c){c.startTime<n.firstHiddenTime&&(i.value=Math.max(c.startTime-Bi(),0),i.entries=[c],r())})},o=Pu("largest-contentful-paint",a);if(o){r=mr(e,i,ku,t.reportAllChanges);var s=Lu(function(){ws[i.id]||(a(o.takeRecords()),o.disconnect(),ws[i.id]=!0,r(!0))});["keydown","click"].forEach(function(l){addEventListener(l,function(){return N_(s)},{once:!0,capture:!0})}),Du(s),Ui(function(l){i=hr("LCP"),r=mr(e,i,ku,t.reportAllChanges),Nu(function(){i.value=performance.now()-l.timeStamp,ws[i.id]=!0,r(!0)})})}})},Tu=[800,1800],D_=function e(t){document.prerendering?Is(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},Gu=function(e,t){t=t||{};var r=hr("TTFB"),n=mr(e,r,Tu,t.reportAllChanges);D_(function(){var i=Es();i&&(r.value=Math.max(i.responseStart-Bi(),0),r.entries=[i],n(!0),Ui(function(){r=hr("TTFB",0),(n=mr(e,r,Tu,t.reportAllChanges))(!0)}))})};he();Wt();rt();q();Ar();q();var Mi=new Map,Ju=!1,L_=()=>{Ju||(Nt("ON_JOLIBOX_GET_USER_SUB_STATUS",e=>{let t=Mi.get(e.sequenceId);t&&(clearTimeout(t.timeoutId),t.resolve(e.isSubUser),Mi.delete(e.sequenceId))}),Ju=!0)};function As(){return A(this,null,function*(){return L_(),new Promise((e,t)=>{let r=$e(),n=setTimeout(()=>{Mi.delete(r),t(new Error("Timeout waiting for user sub status response"))},3e3);Mi.set(r,{resolve:e,reject:t,timeoutId:n}),Ge("JOLIBOX_GET_USER_SUB_STATUS",{sequenceId:r})})})}function Fu(){return A(this,null,function*(){let e=Ke.create();try{let t=yield e.get("/api/users/info");return!(t.code!=="SUCCESS"||!t.data)}catch(t){return Me(new sn(t)),!1}})}function U_(){Bu(e=>{xe("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Mu(e=>{xe("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Gu(e=>{xe("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function B_(){bt.on("onDocumentReady",e=>A(this,null,function*(){let t=yield Fu(),r=yield As().catch(()=>!1);L.onEnvConfigChanged({hostUserInfo:{isLogin:t,isSubUser:r}}),bt.emit("LifecycleEvent.onReady",z({},L.hostUserInfo?L.hostUserInfo:{isLogin:!1})),L.mpType==="game"&&it.start(Date.now()-e)}))}function ju(){B_(),U_()}ju();
|
|
304
304
|
/*! Bundled license information:
|
|
305
305
|
|
|
306
306
|
localforage/dist/localforage.js:
|