@jolibox/implement 1.2.6 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- var Cd=Object.create;var Ia=Object.defineProperty,Rd=Object.defineProperties,Od=Object.getOwnPropertyDescriptor,kd=Object.getOwnPropertyDescriptors,Td=Object.getOwnPropertyNames,Mn=Object.getOwnPropertySymbols,rs=Object.getPrototypeOf,Aa=Object.prototype.hasOwnProperty,as=Object.prototype.propertyIsEnumerable,xd=Reflect.get;var ns=(e,t,n)=>t in e?Ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q=(e,t)=>{for(var n in t||(t={}))Aa.call(t,n)&&ns(e,n,t[n]);if(Mn)for(var n of Mn(t))as.call(t,n)&&ns(e,n,t[n]);return e},Ee=(e,t)=>Rd(e,kd(t));var tn=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var is=(e,t)=>{var n={};for(var r in e)Aa.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Mn)for(var r of Mn(e))t.indexOf(r)<0&&as.call(e,r)&&(n[r]=e[r]);return n};var ee=(e,t)=>()=>(e&&(t=e(e=0)),t);var Sa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Td(t))!Aa.call(e,a)&&a!==n&&Ia(e,a,{get:()=>t[a],enumerable:!(r=Od(t,a))||r.enumerable});return e};var Ca=(e,t,n)=>(n=e!=null?Cd(rs(e)):{},Pd(t||!e||!e.__esModule?Ia(n,"default",{value:e,enumerable:!0}):n,e));var os=(e,t,n)=>xd(rs(e),n,t);var I=(e,t,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(e,t)).next())});function Jd(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Na(e){return typeof e=="string"}function hs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function ms(e){return typeof e=="object"&&Array.isArray(e)}function Fd(e){return typeof e=="undefined"}function Hd(e){return Fd(e)||e===null}function qd(e){return typeof e=="function"}function ps(e){let t=e,n=null,r=function(...a){return n||(n=new t(...a)),n};return r.prototype=t.prototype,r}function vs(e,t,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:cs(l)&&cs(s)?a[o]=r(Da({},s),l):Array.isArray(l)&&Array.isArray(s)?a[o]=[...s,...l]:a[o]=l}return a}return r(e,t)}function cs(e){return e&&typeof e=="object"&&e.constructor===Object}function gs(e,t){if(Array.isArray(e))return e.concat(t)}function on(e,t,n={}){let r=null,a,i,o,{leading:s=!1,trailing:l=!0}=n,d=()=>(o=e.apply(i,a),a=void 0,i=void 0,o),_=function(...h){a=h,i=this;let p=s&&!r;if(r&&clearTimeout(r),r=setTimeout(()=>{r=null,l&&!p&&d()},t),p)return d()};return _.cancel=()=>{r&&clearTimeout(r),r=null,a=i=void 0},_.flush=()=>{if(r)return clearTimeout(r),r=null,d()},_}function $d(e,t){return(...n)=>t(e,...n)}function bs(e){return t=>$d(t,function(n,...r){if(typeof n=="function")try{return n.apply(this,r)}catch(a){e(new Vd(`${a}`))}})}function nn(e){return(...t)=>{var n,r;((r=(n=globalThis.VConsole)==null?void 0:n[e])!=null?r:globalThis.console[e])(...t)}}function Gn(e,t){return t.map(n=>{if(n==="params"&&e[n]){let r=e[n];return Object.keys(r).reduce((a,i)=>(a[i]=String(r[i]),a),{})}return e[n]})}function Qd(e){let t=e.location?Gn(e.location,ds):null,n=e.target?Gn(e.target,ds):null;return Gn(Md(Da({},e),{location:t,target:n}),Xd)}function Ja(e){let t=e.events.map(r=>Qd(r)),n=Gn(e.device,Yd);return[e.protocolVersion,t,n,e.project]}function Zd(){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 r=e.get.call(window);return window.__joliboxLocalStorage__=r,r}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,n=Object.getOwnPropertyDescriptor(t,"localStorage");if(n&&n.get){let r=n.get.call(window);return window.__joliboxLocalStorage__=r,r}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function qa(e,t,n){let r=window.location.hostname,a=r.split("."),i=n?t:e;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")return`${i}.${o}`}return`${i}.jolibox.com`}function As(e){return qa("app","stg-app",e)}function Pt(e){return`https://${qa("api","stg-api",e)}`}function sf(e){return qa("collect","stg-collect",e)}function Ss(e){return`https://${sf(e)}`}function df(e){return new Promise(t=>Cs(e)(t))}function Cs(e){return(t,n=null)=>{let r=!1;return e(a=>{if(!r)return r=!0,t.call(n,a)},null)}}function ff(e,t){return(n=>{let r,a={onWillAddFirstListener(){r=n(i.fire,i)}},i=new an(a);return i.event})((n,r=null)=>e(a=>t(a)&&n.call(r,a),null))}function mf(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)pf(e[r],t[r])}function pf(e,t){if(Na(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(qd(t)){try{if(e instanceof t)return}catch(n){}if(!Hd(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 vf(){return typeof globalThis!="undefined"?globalThis[Rs]:void 0}function gf(e){typeof globalThis!="undefined"&&(globalThis[Rs]=e)}function ge(e=!1){let t=vf();if(!e&&t)return t;let n=new Jn,r=new Pa,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 gf(a),a}var La,Ld,Dd,Nd,ss,Ud,Bd,ls,Da,Md,Gd,fs,vt,jd,Ua,Ba,_s,ys,Vd,ws,Fn,Hn,Ma,Pe,Oa,Wd,Ga,us,Kd,gt,xt,zd,ds,Xd,Yd,Ge,Tt,ef,Ie,tf,nf,rf,Es,Fa,Ha,af,of,Is,_t,ka,ne,lf,cf,rn,an,He,xa,uf,Ra,hf,ut,Jn,Pa,Rs,G=ee(()=>{"use strict";La=Object.defineProperty,Ld=Object.defineProperties,Dd=Object.getOwnPropertyDescriptor,Nd=Object.getOwnPropertyDescriptors,ss=Object.getOwnPropertySymbols,Ud=Object.prototype.hasOwnProperty,Bd=Object.prototype.propertyIsEnumerable,ls=(e,t,n)=>t in e?La(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Da=(e,t)=>{for(var n in t||(t={}))Ud.call(t,n)&&ls(e,n,t[n]);if(ss)for(var n of ss(t))Bd.call(t,n)&&ls(e,n,t[n]);return e},Md=(e,t)=>Ld(e,Nd(t)),Gd=(e,t)=>{for(var n in t)La(e,n,{get:t[n],enumerable:!0})},fs=(e,t,n,r)=>{for(var a=r>1?void 0:r?Dd(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(a=(r?o(t,n,a):o(a))||a);return r&&a&&La(t,n,a),a},vt=(e,t,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(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 n=new Event("abort");this.signal.dispatchEvent(n)};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(n,r){this._eventListeners[n]||(this._eventListeners[n]=[]),this._eventListeners[n].push(r)},t.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)},t.prototype.dispatchEvent=function(n){if(this._eventListeners[n.type])for(let r of this._eventListeners[n.type])r.call(this,n)},window.AbortController=e,window.AbortSignal=t}jd=(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))(jd||{}),Ua=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}},Ba=class extends Ua{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},_s=class extends Ua{constructor(){super(...arguments),this.kind="USER_ERROR"}},ys=class extends _s{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},Vd=class extends _s{constructor(e,t,n){super(e),this.message=e,this.errNo=t,this.name="USER_CUSTOM_ERROR",this.errMsg=e,n&&(this.extra=Object.assign({},this.extra,n))}},ws=class extends Ba{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},Fn=class extends Ba{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},Hn=class extends Ua{constructor(e,t,n,r,a){super(e),this.message=e,this.code=t,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}}},Ma=class extends Ba{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Pe={log:nn("log"),warn:nn("warn"),info:nn("info"),error:nn("error"),debug:nn("debug")};Object.assign(globalThis,{logger:Pe});Oa=Symbol.for("Jolibox.canIUseMap"),Wd={};globalThis[Oa]||(globalThis[Oa]=Wd);Ga={get config(){return globalThis[Oa]}},us=Symbol.for("Jolibox.canIUseMap.native"),Kd={};globalThis[us]||(globalThis[us]=Kd);gt=(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))(gt||{}),xt=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(xt||{}),zd=(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))(zd||{}),ds=["name","params"],Xd=["name","type","location","target","extra","timestamp","userId"],Yd=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];Ge=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});Zd();Tt=typeof window=="undefined",ef=()=>!Tt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Ie={isiOS:!Tt&&(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:!Tt&&navigator.userAgent.includes("Android"),isMac:!Tt&&navigator.userAgent.includes("Mac"),isFacebook:!Tt&&navigator.userAgent.includes("FB_IAB"),isPC:!Tt&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},tf=()=>Ie.isiOS?"iOS":Ie.isAndroid?"Android":Ie.isMac?"Mac":Ie.isFacebook?"Facebook":"PC",nf="device_id",rf="advertising_id",Es=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,Ge()),window.__joliboxLocalStorage__.getItem(e)),Fa=()=>new URLSearchParams(window.location.search).get("deviceId")||Es(nf),Ha=()=>new URLSearchParams(window.location.search).get("advertisingId")||Es(rf),af=e=>e.charAt(0).toUpperCase()+e.slice(1),of=()=>{var e;let t=new URLSearchParams(window.location.search);return af((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},Is=e=>{if(ef())return window.navigator.userAgent;let t="JoliboxWebSDK",n=tf(),r=navigator.language,a=Fa(),i=Ha();return`${t} (${of()}${n}; UnknownModel; UnknownSystemVersion; ${r}) uuid/${a} adid/${i} version/${e||""}`};_t=class{constructor(e,t={}){this.requestAdapter=e,this.cache=new Map,this.pendingRequests=new Map,this.requestSequence=0,this.cacheSequences=new Map,this.config=Da({duration:10*60*1e3,timeout:3e3,keyGenerator:(n,r)=>n,consistencyChecker:()=>!0},t)}request(e,t){return vt(this,null,function*(){let n=this.config.keyGenerator(e,t),r=this.pendingRequests.get(n);if(r)return console.log(`[RequestCacheService] Reusing pending request for ${e}`),r;let a=this.requestInternal(e,t),i=this.createTimeoutPromise(),o=Promise.race([a,i]).catch(s=>vt(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 ${e}`),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 ${e}`)}).catch(s=>{console.warn(`[RequestCacheService] Background request failed for ${e}:`,s)});try{return yield o}finally{this.pendingRequests.delete(n)}})}requestInternal(e,t){return vt(this,null,function*(){var n,r,a,i;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 h=yield this.requestAdapter.execute(e,t),p=this.requestAdapter.extractRealTimeData(h),f=(r=(n=this.requestAdapter).extractCacheableData)==null?void 0:r.call(n,h);return f&&!this.config.consistencyChecker(l,f)?(console.log(`[RequestCacheService] Cache invalidated due to data change for ${e}`),this.setCachedDataWithSequence(o,f,s),h):this.requestAdapter.mergeData(l,p)}catch(h){return console.warn(`[RequestCacheService] Failed to fetch real-time data, using cache only for ${e}:`,h),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 d=yield this.requestAdapter.execute(e,t),_=(i=(a=this.requestAdapter).extractCacheableData)==null?void 0:i.call(a,d);return _&&this.setCachedDataWithSequence(o,_,s),d})}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,n,r){let a=this.cache.get(e);if(a&&a.sequence>n){console.log(`[RequestCacheService] Ignoring stale cache update for ${e} (current: ${a.sequence}, incoming: ${n})`);return}let i=Date.now();this.cache.set(e,{data:JSON.parse(JSON.stringify(t)),timestamp:i,expiresAt:i+this.config.duration,key:e,sequence:n,metadata:r}),this.cacheSequences.set(e,n),console.log(`[RequestCacheService] Updated cache for ${e} with sequence ${n}`)}refreshCache(e,t){return vt(this,null,function*(){let n=this.config.keyGenerator(e,t);return this.cache.delete(n),this.request(e,t)})}forceRequest(e,t){return vt(this,null,function*(){var n,r;let a=this.config.keyGenerator(e,t),i=++this.requestSequence;console.log(`[RequestCacheService] Force request for ${e} (sequence: ${i})`);let o=yield this.requestAdapter.execute(e,t),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 ${e}`)),o})}warmupCache(e,t){return vt(this,null,function*(){let n=this.config.keyGenerator(e,t);if(this.pendingRequests.has(n)){console.log(`[RequestCacheService] Skipping warmup for ${e} - request in progress`);return}if(this.hasValidCache(n)){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(r){console.warn(`[RequestCacheService] Cache warmup failed for ${e}:`,r)}})}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,n]of this.cache)e>n.expiresAt&&(this.cache.delete(t),this.cacheSequences.delete(t));console.log("[RequestCacheService] Cleared expired cache entries")}getCacheStats(){let e=Date.now(),t=0,n=0;for(let r of this.cache.values())e>r.expiresAt?n++:t++;return{cacheCount:this.cache.size,validCount:t,expiredCount:n,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)}},ka=class Ta{constructor(t){this.element=t,this.next=Ta.Undefined,this.prev=Ta.Undefined}};ka.Undefined=new ka(void 0);ne=ka,lf=class{constructor(){this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ne.Undefined}clear(){let e=this._first;for(;e!==ne.Undefined;){let t=e.next;e.prev=ne.Undefined,e.next=ne.Undefined,e=t}this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new ne(e);if(this._first===ne.Undefined)this._first=n,this._last=n;else if(t){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!==ne.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ne.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ne.Undefined&&e.next!==ne.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ne.Undefined&&e.next===ne.Undefined?(this._first=ne.Undefined,this._last=ne.Undefined):e.next===ne.Undefined?(this._last=this._last.prev,this._last.next=ne.Undefined):e.prev===ne.Undefined&&(this._first=this._first.next,this._first.prev=ne.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ne.Undefined;)yield e.element,e=e.next}},cf=0,rn=class{constructor(e){this.value=e,this.id=cf++}},an=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,n;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof rn&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(r=>(r==null?void 0:r.value)===e)):(this._listeners=void 0,this._size=0)),(n=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,n)=>{var r,a,i,o,s,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};n&&(t=t.bind(n));let d=new rn(t);return this._listeners?this._listeners instanceof rn?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 _,h,p,f;if(!this._disposed){if(this._listeners instanceof rn)this._listeners.id===d.id&&(this._listeners=void 0,this._size=0,(h=(_=this.options)==null?void 0:_.onDidRemoveLastListener)==null||h.call(_));else if(this._listeners){let w=this._listeners.indexOf(d);w>=0&&(this._listeners.splice(w,1),this._size--,this._size===0&&((f=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||f.call(p)))}}}}),this._event}_deliver(e,t){var n;if(!e)return;let r=((n=this.options)==null?void 0:n.onListenerError)||Error.constructor;if(!r){e.value(t);return}try{e.value(t)}catch(a){r(a)}}fire(e){this._listeners&&(this._listeners instanceof rn?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},He=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,n=!0){var r;let a=(r=this.listeners.get(e))!=null?r:new an,i=l=>t(...l.args),o=a.event(i);this.listerHandlerMap.set(t,{handler:i,dispose:o}),this.listeners.set(e,a);let s=this.cachedEventQueue.get(e);if(s&&n)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let n=this.listerHandlerMap.get(t);n&&(n.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let n=this.listeners.get(e),r=this.cachedEventQueue.get(e);r||(r=new lf,this.cachedEventQueue.set(e,r)),r.push({args:t}),n&&n.fire({event:e,args:t})}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};this.on(e,n,!1)}},xa={};Gd(xa,{None:()=>uf,filter:()=>ff,once:()=>Cs,toPromise:()=>df});uf=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Ra=Symbol.for("Jolibox.hostEmitter"),hf=()=>{let e=new He;return globalThis[Ra]||(globalThis[Ra]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Ra]},ut=hf();Jn=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new an,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 n=[];for(let a of e.metadata.args)n.push(a.constraint);let r=e.handler;e.handler=function(...a){return mf(a,n),r(...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 n=this.getCommand(t);n&&e.set(t,n)}return e}};Jn=fs([ps],Jn);Pa=class{constructor(){this._onWillExecuteCommand=new an,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new an,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Jn,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Jd(3e4)),this._starActivation}executeCommand(e,...t){return vt(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),xa.toPromise(xa.filter(this.registry.onDidRegisterCommand,n=>n===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let n=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let r=this.invokeFunction(n.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),r}_tryExecuteCommand(e,t){let n=this.registry.getCommand(e);if(!n)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let r=this.invokeFunction(n.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(r)}catch(r){return Promise.reject(r)}}invokeFunction(e,...t){let n=!1;try{return e(...t)}finally{n=!0}}};Pa=fs([ps],Pa);Rs=Symbol.for("Jolibox.commands")});function Le(e,t={}){ja.emit("ERROR_REPORT",{error:e,options:t})}var ja,yt,Xe=ee(()=>{"use strict";G();G();ja=new He,yt=new He;Le.debounce=on(Le,50,{leading:!0})});var Va,_f,Os,ks,Ts=ee(()=>{"use strict";G();Xe();Va=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),r=atob(t+n);try{return JSON.parse(r)}catch(a){return{}}},_f=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},Os=e=>{var t;try{let a=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(a!=null&&a.length){let[i,o,s]=a;return{headerJson:Va(i),payloadJson:Va(o),signature:Va(s)}}else throw"joli_source is missing"}catch(n){return Le(new ws(`${e} not a valid schema: ${n}`)),{headerJson:{},payloadJson:{},signature:{}}}},ks=(e,t)=>{let n=t.split(".");if(n&&n.length===3){let r=n[0],a=_f(e),i=n[2];return`${r}.${a}.${i}`}return t}});var yf,qn,xs,$a=ee(()=>{"use strict";G();yf="1.2.6",qn=()=>yf,xs=()=>{let e=qn();return`${Is(e)}`}});function Ka(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var wf,Ps,Wa,Ls,re,bf,L,ue=ee(()=>{"use strict";G();Ts();$a();G();wf={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:Fa(),adId:Ha(),pixelRatio:window.devicePixelRatio||1,platform:Ie.isAndroid?"android":Ie.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:qn()},schema:window.location.href,platform:Ie.isAndroid?"android":Ie.isiOS?"ios":"h5"},Wa=(Ps=globalThis.joliboxJSCore)==null?void 0:Ps.env,re=Object.assign({},(Ls=Wa==null?void 0:Wa())!=null?Ls:wf);bf=()=>{var f,w,A,C,b,x,D,H,j,R,N;let{payloadJson:e,headerJson:t,signature:n}=re.schema.length?Os(re.schema):{},r=`${re.deviceInfo.did}-${new Date().getTime()}`,i=new URL(re.schema.length?re.schema:window.location.href).searchParams,o=(A=(w=(f=i.get("mpId"))!=null?f:i.get("appId"))!=null?w:i.get("gameId"))!=null?A:"",s=(x=(b=(C=re.clientSessionId)!=null?C:e==null?void 0:e.sessionId)!=null?b:i.get("sessionId"))!=null?x:r,l=!!((H=(D=e==null?void 0:e.testAdsMode)!=null?D:e==null?void 0:e.__testAdsMode)!=null?H:i.get("testAdsMode")==="true"),d=(N=(R=(j=e==null?void 0:e.joliboxEnv)!=null?j:e==null?void 0:e.__joliboxEnv)!=null?R:i.get("joliboxEnv"))!=null?N:"production",_=d==="staging",h=t==null?void 0:t.channel,p=e==null?void 0:e.__shouldInterupt;return{get startTime(){var T;return(T=performance.timeOrigin)!=null?T:performance.timing.navigationStart},get testMode(){return _},get testAdsMode(){return l},get joliboxEnv(){return d},get joliSource(){var T;return(T=i.get("joliSource"))!=null?T:null},get mpId(){var T;return(T=o!=null?o:e==null?void 0:e.id)!=null?T:""},get mpVersion(){var T;return(T=t==null?void 0:t.ver)!=null?T:qn()},get mpType(){var T,B;return(B=(T=t==null?void 0:t.__mpType)!=null?T:e==null?void 0:e.__mpType)!=null?B:"game"},get platform(){var T;return((T=re.platform)!=null?T:re.deviceInfo.platform).toLowerCase()},get deviceInfo(){return re.deviceInfo},get sdkInfo(){return re.sdkInfo},get hostInfo(){return re.hostInfo},get hostUserInfo(){return re.hostUserInfo},get sessionId(){var T,B;return(B=(T=re.clientSessionId)!=null?T:s)!=null?B:r},get channel(){return h},get webviewId(){var T;return(T=re.webviewId)!=null?T:-1},get shouldInterupt(){return p},get from(){return e==null?void 0:e.__from},get baseApiHost(){return As(_)},get adId(){var T;return(T=re.deviceInfo.adId)!=null?T:re.deviceInfo.did},get language(){return re.deviceInfo.lang},get sdkEnvironment(){return Ka("dlightek","jolibox")?"dlightek":i.get("huaweiQuick")==="true"?"huaweiQuick":Ka("gamedistribution","jolibox")?"gamedistribution":Ka("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var z,te,me;let T=(z=re.deviceInfo.pixelRatio)!=null?z:1,B=(te=re.deviceInfo.statusBarHeight)!=null?te:e==null?void 0:e.__androidStatusBarHeight,K=(me=re.deviceInfo.navigationBarHeight)!=null?me:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:B!==void 0?B/T:20,navigationBarHeight:K!==void 0?K/T:10}},get abTests(){var T,B;return(B=(T=re.abValues)==null?void 0:T.split(","))!=null?B:[]},get mpInfo(){var T;return(T=re.mpInfo)!=null?T:{mpName:"unknown"}},onEnvConfigChanged:T=>{vs(re,T,gs)},encodeJoliSourceQuery:T=>{var B,K;return t&&n?ks(q(q({},e),T),(B=i.get("joliSource"))!=null?B:""):(K=i.get("joliSource"))!=null?K:""},setDoExitDirectly:()=>{p=!1}}},L=bf()});var za,Ns,Ef,If,Ds,Af,Us=ee(()=>{"use strict";G();Xe();ue();G();za=!1,Ns=(e,t)=>e==null?!1:t in e,Ef=e=>Ns(e,"kind"),If=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")},Ds=(e,t={},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:If(e.name)},a=Ee(q({},r),{env:t.environment,isFromUser:n});n?yt.emit("GLOBAL_USER_ERROR",e,a):yt.emit("GLOBAL_ERROR",e,a)},Af=e=>Ns(e,"kind")&&e.kind==="USER_ERROR";ja.on("ERROR_REPORT",({error:e,options:t})=>{if(za)return;za=!0;let n=Ef(e)&&e.raw?e.raw:e;try{let r=Af(e);Ds(e,t,r)}catch(r){let a=r instanceof Error?r.message:String(r),i=new Ma(`${a}, origin error: ${n.message}`);Pe.error(i),Ds(new Ma(i.message),{environment:t.environment},!1)}finally{za=!1}})});var Xa,Ya=ee(()=>{"use strict";Xe();G();Xe();Xa=e=>new ys(e)});function Bs(e,t){let n=(r,a,i)=>{let d=a!=null?a:{},{eventType:o}=d,s=is(d,["eventType"]),l=Ee(q({tag:r,eventType:i!=null?i:o!=null?o:gt.Other},t),{extra:q({},s)});r=="globalJsError"?Le(new Fn(JSON.stringify(l))):e("systemLog",l,L.webviewId)};return n.debounce=on(n,500,{leading:!0}),n}function Ms(e){let t=(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}),e("joliboxSpeedAnalysis",o)};return t.debounce=on(t,500,{leading:!0}),t}var Gs=ee(()=>{"use strict";G();G();Xe();ue()});function Js(e,t){let n=Bs(e,t),r=Ms(n);return{track:n,trackPerformance:r}}var Fs=ee(()=>{"use strict";Gs()});var Qa=ee(()=>{"use strict"});var jn,Hs=ee(()=>{"use strict";ue();G();G();jn=class{constructor(t){this.apiHost=t;this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return I(this,null,function*(){let n=`${this.apiHost}/api/fe-configs/js-sdk/samples-config`,r=yield(yield fetch(n)).json();this.samplesConfig=r})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:n}=this.samplesConfig;for(let[r,a]of Object.entries(n))if(a.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(r);return!1}getDevice(){var r,a,i,o,s;let{nativeSDKVersion:t,jssdkVersion:n}=L.sdkInfo;return{platform:1e3,os:L.deviceInfo.platform,appVersion:(r=t!=null?t: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 t=new URLSearchParams(window.location.search),n={};return t.forEach((r,a)=>{n[a]=r}),{name:"GamePage",params:n}}trackEvent(t,n,r){return I(this,null,function*(){if(this.checkIsSampled(t))return;let a=t.location?t.location:yield this.getLocation(),i=t.target||null,o=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let s=this.deviceInfo,d={protocolVersion:"1.0.0",events:[Ee(q({},t),{location:a,target:i,extra:o,timestamp:Date.now(),userId:null})],device:s,project:n};try{r?yield this.doReport(Ja(d),r):yield this.doReport(Ja(d))}catch(_){Pe.log("[Jolibox SDK] report API error",_)}})}}});var Za=ee(()=>{"use strict";Fs();Qa();Hs()});var ei,qs,Ye,Vn,Je,Lt=ee(()=>{"use strict";$a();ue();G();ei=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(qs=AbortSignal.timeout)!=null||(AbortSignal.timeout=ei);Ye=class e{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 e._instance||(e._instance=new e),e._instance}create(t){let n=new Vn(t);return e.getInstance().httpClients.add(n),n}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},Vn=class{constructor(t){this.xua=xs();this.getJoliSource=()=>L.joliSource;var r;let n=Pt(L.testMode);this.baseUrl=(r=t==null?void 0:t.baseUrl)!=null?r:n}get(t,n){return I(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}${t}${s?`?${s}`:""}`,d=this.xua,_=this.getJoliSource();i=Object.assign({},i!=null?i:{},d?{"x-user-agent":d}:{},_?{"x-joli-source":_}:{});let h=yield fetch(l,{method:"GET",headers:i,credentials:"include",signal:ei(a!=null?a:3e4)});return Ye.getInstance().recordNetworkRequest(!0),yield h.json()}catch(r){throw Ye.getInstance().recordNetworkRequest(!1),r}})}post(t,n){return I(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}${t}${l?`?${l}`:""}`,_=this.xua,h=this.getJoliSource();o=Object.assign({},o!=null?o:{},{"Content-Type":"application/json"},_?{"x-user-agent":_}:{},h?{"x-joli-source":h}:{},{"x-os-type":Ie.isAndroid?"ANDROID":Ie.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let p=yield fetch(d,{method:"POST",headers:o,body:JSON.stringify(r),signal:ei(i!=null?i:3e4),credentials:"include"});Ye.getInstance().recordNetworkRequest(!0);let f=p.headers.get("content-type");if(f!=null&&f.includes("application/octet-stream"))try{return p.blob()}catch(w){return yield p.arrayBuffer()}if(f!=null&&f.includes("multipart/form-data")||f!=null&&f.includes("application/x-www-form-urlencoded"))try{return p.formData()}catch(w){return yield p.text()}if(f!=null&&f.includes("application/json"))try{return yield p.json()}catch(w){return yield p.text()}return p}catch(r){throw Ye.getInstance().recordNetworkRequest(!1),r}})}put(t,n){return I(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}${t}${l?`?${l}`:""}`,_=this.xua,h=this.getJoliSource();o=Object.assign({},o!=null?o:{},{"Content-Type":"application/json"},_?{"x-user-agent":_}:{},h?{"x-joli-source":h}:{});let p=yield fetch(d,{method:"PUT",headers:o,credentials:"include",body:JSON.stringify(r!=null?r:{})});if(!p.ok)throw Ye.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${p.status}`);return Ye.getInstance().recordNetworkRequest(!0),yield p.json()}catch(r){throw console.error("Error:",r),r}})}};window.JoliboxHttpClient=Vn;Je=Ye.getInstance()});var ti,$n,ni=ee(()=>{"use strict";ue();Za();Lt();G();ti=class extends jn{constructor(){super(...arguments);this.httpClient=Je.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n;return Ss((n=L.testMode)!=null?n:!1)}doReport(n){this.httpClient.post("/report",{data:n,timeout:5e3}).catch(r=>{console.info("report error",r)})}},$n=new ti(Pt(L.testMode))});var Sf,js=ee(()=>{"use strict";Us();G();Ya();G();ni();ue();Sf=(e,t)=>{var a,i,o;let n={message:t.message,stack:(a=t.stack)!=null?a:"",errorType:t.name,source:0},r={name:e,type:gt.ErrorTrace,location:null,target:null,extra:n,timestamp:Date.now(),userId:(o=(i=L.hostUserInfo)==null?void 0:i.uid)!=null?o:null};$n.trackEvent(r,xt.WebSDK)};yt.on("GLOBAL_ERROR",(e,t)=>{Sf(t.tag,e)});yt.on("GLOBAL_USER_ERROR",(e,t)=>{Pe.log("UserError",e,t)})});var Wn,Vs=ee(()=>{"use strict";Wn=class{constructor(t,n){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.reportCount=0;this.notifyIframeGameEvent=(t,n)=>{window.parent&&window.parent.postMessage({type:t,data:n},"*")};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=n!=null?n:5*1e3,t.on("visible",r=>{this.visible=r})}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 n=Date.now(),r,a,i=!1,o=0,s=()=>{if(!i)return;let f=Date.now(),w=f-n;w>=this.interval&&(this.visible&&(o+=Math.min(w,this.interval+1e3),t(o)),n=f),r=requestAnimationFrame(s)},l=()=>{_(),n=Date.now(),a=window.setInterval(()=>{if(!i)return;let f=Date.now();f-n>=this.interval&&(n=f)},this.interval)},d=()=>{h(),n=Date.now(),r=requestAnimationFrame(s)},_=()=>{r&&(cancelAnimationFrame(r),r=0)},h=()=>{a&&(clearInterval(a),a=0)};this.eventEmitter.on("visible",f=>{i&&(console.log("visible",f),f?d():l())});let p=this.visible;return{start(){i||(i=!0,p?d():l())},stop(){i=!1,_(),h()}}}}});var Kn,$s=ee(()=>{"use strict";ue();Vs();Lt();Kn=class extends Wn{constructor(n,r,a){super(r,a);this.httpClient=Je.create();this.gameId=L.mpId,this.sessionId=L.sessionId,this.track=n}reporter(n){return I(this,null,function*(){let{event:r,params:a,extraParams:i}=n,o={eventType:r,gameInfo:q({gameId:this.gameId,sessionId:this.sessionId},a)};i&&Object.assign(o,i),yield this.httpClient.post("/api/base/app-event",{data:o})})}tracker(n,r=null){this.track(n,r)}}});var Ws,Cf,Se,Rf,ri,Qe,dt=ee(()=>{"use strict";js();G();G();Za();ni();$s();ue();Qa();Ws=ge(),Cf={type:xt.WebSDK,platform:"h5",jssdk_version:L.sdkInfo.jssdkVersion,mp_id:L.mpId,mp_version:L.mpVersion},{track:Se,trackPerformance:Rf}=Js((...e)=>{var o,s,l,d;let[,t]=e,n=t,r=hs(n.extra)?n.extra:Na(n.extra)?JSON.parse(n.extra):{},a=Ee(q({},r),{mp_id:(o=n.mp_id)!=null?o:"",mp_version:(s=n.mp_version)!=null?s:""}),i={name:t.tag,type:gt.System,location:null,target:null,extra:a,timestamp:Date.now(),userId:(d=(l=L.hostUserInfo)==null?void 0:l.uid)!=null?d:null};$n.trackEvent(i,xt.WebSDK)},Cf);Ws.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:n})=>{Rf(e,t,n)});Ws.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Se(e,t)});ri=new He,Qe=new Kn(Se,ri)});function Ks(e){let t=Ga.config[e];return t||(t={},Ga.config[e]=t),(n,r)=>{if(t[n]){Pe.warn(`[can i use] ${n} already registered`);return}t[n]=q({},r)}}var zs=ee(()=>{"use strict";G()});function ai(e){Xs=e}function zn(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>zn(t)):Object.keys(e).reduce((t,n)=>(t[n]=zn(e[n]),t),{})}function Ze(e){return typeof e=="number"}function ii(e){let t=oi(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function oi(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var Xs,de,Xn,Yn,Qn,Zn,Dt,er,tr,nr,rr,ar,ir,or,sr,lr,cr,ur,dr,si=ee(()=>{"use strict";Xs=!1;de=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(Xs)if(typeof t=="string")this.errors.push(t);else{let n=`${this.path} should be ${t.expect}`;this._optional&&t.expect!=="undefined"?n+=" or undefined, ":n+=", ",n+=`but got ${ii(t.actual)}`,this.errors.push(n)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return zn(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:zn(this._default)}optional(){return this._optional=!0,this}};Xn=class extends de{validate(t){return this._optional&&t===void 0?!0:Ze(t)?Ze(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):Ze(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):Ze(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}},Yn=class extends de{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},Qn=class extends de{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(Ze(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(Ze(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}},Zn=class extends de{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},Dt=class extends de{validate(t){return!0}},er=class extends de{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},tr=class extends de{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},nr=class extends de{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},rr=class extends de{constructor(...t){super(),this._items=t}validate(t){if(this._optional&&t===void 0)return!0;if(!this._items.includes(t)){let n=this._items.map(r=>JSON.stringify(r)).join(", ");return this.fail(`expect ${this.path} to be one of ${n}, but got ${ii(t)}`)}return!0}},ar=class extends de{constructor(n){super();this._item=n}validate(n){if(this._optional&&n===void 0)return!0;if(!Array.isArray(n))return this.fail({expect:"array",actual:n});if(Ze(this._minItems)&&n.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(Ze(this._maxItems)&&n.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(Ze(this._length)&&n.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let r=this._item;if(!r)return!0;let a=!0;if(n.forEach((i,o)=>{if(r.path=`${this.path}[${o}]`,r.errors=this.errors,i===void 0&&r.hasDefault){n[o]=r.defaultValue;return}r.validate(i)||(r.hasFallback?n[o]=r.fallbackValue:a=!1)}),this._uniqueItems){let i=new Map;for(let o in n)i.has(n[o])?a=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${i.get(n[o])}] and ${this.path}[${o}] are identical)`):i.set(n[o],o)}return a}minItems(n){return this._minItems=n,this}maxItems(n){return this._maxItems=n,this}uniqueItems(){return this._uniqueItems=!0,this}length(n){return this._length=n,this}},ir=class extends de{constructor(n){super();this._value=n}validate(n){if(this._optional&&n===void 0)return!0;if(oi(n)!=="object")return this.fail({expect:"object",actual:n});let a=n,i=this._value;i.errors=this.errors;let o=!0;for(let s in a){let l=a[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?i.path=`${this.path}.${s}`:i.path=`${this.path}["${s}"]`,!(l===void 0&&i._optional)){if(l===void 0&&i.hasDefault){a[s]=i.defaultValue;continue}i.validate(l)||(i.hasFallback?a[s]=i.fallbackValue:o=!1)}}return o}},or=class extends de{constructor(n={}){super();this._object=n}validate(n){if(this._optional&&n===void 0)return!0;if(oi(n)!=="object")return this.fail({expect:"object",actual:n});let r=n,a=!0;for(let i in this._object){let o=r[i],s=this._object[i];if(s.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(i)?s.path=`${this.path}.${i}`:s.path=`${this.path}["${i}"]`,!(s._optional&&o===void 0)){if(o===void 0&&s.hasDefault){r[i]=s.defaultValue;continue}s.validate(o)||(s.hasFallback?r[i]=s.fallbackValue:a=!1)}}return a}},sr=class extends de{constructor(n){super();this.value=n}validate(n){return n===void 0&&this._optional?!0:n!==this.value?this.fail({expect:ii(this.value),actual:n}):!0}},lr=class extends de{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let n=[],r=!1,a=this._items.length;for(let i=0;i<a;i++){let o=this._items[i];if(o.errors=[],o.path=this.path,!o.validate(t))n.push(o.errors.join("; "));else if(!r){r=!0;break}}if(!r){let i=n.join(`
1
+ var Cd=Object.create;var Ia=Object.defineProperty,Rd=Object.defineProperties,Od=Object.getOwnPropertyDescriptor,kd=Object.getOwnPropertyDescriptors,Td=Object.getOwnPropertyNames,Mn=Object.getOwnPropertySymbols,rs=Object.getPrototypeOf,Aa=Object.prototype.hasOwnProperty,as=Object.prototype.propertyIsEnumerable,xd=Reflect.get;var ns=(e,t,n)=>t in e?Ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q=(e,t)=>{for(var n in t||(t={}))Aa.call(t,n)&&ns(e,n,t[n]);if(Mn)for(var n of Mn(t))as.call(t,n)&&ns(e,n,t[n]);return e},Ee=(e,t)=>Rd(e,kd(t));var tn=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var is=(e,t)=>{var n={};for(var r in e)Aa.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Mn)for(var r of Mn(e))t.indexOf(r)<0&&as.call(e,r)&&(n[r]=e[r]);return n};var ee=(e,t)=>()=>(e&&(t=e(e=0)),t);var Sa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Td(t))!Aa.call(e,a)&&a!==n&&Ia(e,a,{get:()=>t[a],enumerable:!(r=Od(t,a))||r.enumerable});return e};var Ca=(e,t,n)=>(n=e!=null?Cd(rs(e)):{},Pd(t||!e||!e.__esModule?Ia(n,"default",{value:e,enumerable:!0}):n,e));var os=(e,t,n)=>xd(rs(e),n,t);var I=(e,t,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(e,t)).next())});function Jd(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Na(e){return typeof e=="string"}function hs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function ms(e){return typeof e=="object"&&Array.isArray(e)}function Fd(e){return typeof e=="undefined"}function Hd(e){return Fd(e)||e===null}function qd(e){return typeof e=="function"}function ps(e){let t=e,n=null,r=function(...a){return n||(n=new t(...a)),n};return r.prototype=t.prototype,r}function vs(e,t,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:cs(l)&&cs(s)?a[o]=r(Da({},s),l):Array.isArray(l)&&Array.isArray(s)?a[o]=[...s,...l]:a[o]=l}return a}return r(e,t)}function cs(e){return e&&typeof e=="object"&&e.constructor===Object}function gs(e,t){if(Array.isArray(e))return e.concat(t)}function on(e,t,n={}){let r=null,a,i,o,{leading:s=!1,trailing:l=!0}=n,d=()=>(o=e.apply(i,a),a=void 0,i=void 0,o),_=function(...h){a=h,i=this;let p=s&&!r;if(r&&clearTimeout(r),r=setTimeout(()=>{r=null,l&&!p&&d()},t),p)return d()};return _.cancel=()=>{r&&clearTimeout(r),r=null,a=i=void 0},_.flush=()=>{if(r)return clearTimeout(r),r=null,d()},_}function $d(e,t){return(...n)=>t(e,...n)}function bs(e){return t=>$d(t,function(n,...r){if(typeof n=="function")try{return n.apply(this,r)}catch(a){e(new Vd(`${a}`))}})}function nn(e){return(...t)=>{var n,r;((r=(n=globalThis.VConsole)==null?void 0:n[e])!=null?r:globalThis.console[e])(...t)}}function Gn(e,t){return t.map(n=>{if(n==="params"&&e[n]){let r=e[n];return Object.keys(r).reduce((a,i)=>(a[i]=String(r[i]),a),{})}return e[n]})}function Qd(e){let t=e.location?Gn(e.location,ds):null,n=e.target?Gn(e.target,ds):null;return Gn(Md(Da({},e),{location:t,target:n}),Xd)}function Ja(e){let t=e.events.map(r=>Qd(r)),n=Gn(e.device,Yd);return[e.protocolVersion,t,n,e.project]}function Zd(){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 r=e.get.call(window);return window.__joliboxLocalStorage__=r,r}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,n=Object.getOwnPropertyDescriptor(t,"localStorage");if(n&&n.get){let r=n.get.call(window);return window.__joliboxLocalStorage__=r,r}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function qa(e,t,n){let r=window.location.hostname,a=r.split("."),i=n?t:e;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")return`${i}.${o}`}return`${i}.jolibox.com`}function As(e){return qa("app","stg-app",e)}function Pt(e){return`https://${qa("api","stg-api",e)}`}function sf(e){return qa("collect","stg-collect",e)}function Ss(e){return`https://${sf(e)}`}function df(e){return new Promise(t=>Cs(e)(t))}function Cs(e){return(t,n=null)=>{let r=!1;return e(a=>{if(!r)return r=!0,t.call(n,a)},null)}}function ff(e,t){return(n=>{let r,a={onWillAddFirstListener(){r=n(i.fire,i)}},i=new an(a);return i.event})((n,r=null)=>e(a=>t(a)&&n.call(r,a),null))}function mf(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)pf(e[r],t[r])}function pf(e,t){if(Na(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(qd(t)){try{if(e instanceof t)return}catch(n){}if(!Hd(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 vf(){return typeof globalThis!="undefined"?globalThis[Rs]:void 0}function gf(e){typeof globalThis!="undefined"&&(globalThis[Rs]=e)}function ge(e=!1){let t=vf();if(!e&&t)return t;let n=new Jn,r=new Pa,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 gf(a),a}var La,Ld,Dd,Nd,ss,Ud,Bd,ls,Da,Md,Gd,fs,vt,jd,Ua,Ba,_s,ys,Vd,ws,Fn,Hn,Ma,Pe,Oa,Wd,Ga,us,Kd,gt,xt,zd,ds,Xd,Yd,Ge,Tt,ef,Ie,tf,nf,rf,Es,Fa,Ha,af,of,Is,_t,ka,ne,lf,cf,rn,an,He,xa,uf,Ra,hf,ut,Jn,Pa,Rs,G=ee(()=>{"use strict";La=Object.defineProperty,Ld=Object.defineProperties,Dd=Object.getOwnPropertyDescriptor,Nd=Object.getOwnPropertyDescriptors,ss=Object.getOwnPropertySymbols,Ud=Object.prototype.hasOwnProperty,Bd=Object.prototype.propertyIsEnumerable,ls=(e,t,n)=>t in e?La(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Da=(e,t)=>{for(var n in t||(t={}))Ud.call(t,n)&&ls(e,n,t[n]);if(ss)for(var n of ss(t))Bd.call(t,n)&&ls(e,n,t[n]);return e},Md=(e,t)=>Ld(e,Nd(t)),Gd=(e,t)=>{for(var n in t)La(e,n,{get:t[n],enumerable:!0})},fs=(e,t,n,r)=>{for(var a=r>1?void 0:r?Dd(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(a=(r?o(t,n,a):o(a))||a);return r&&a&&La(t,n,a),a},vt=(e,t,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(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 n=new Event("abort");this.signal.dispatchEvent(n)};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(n,r){this._eventListeners[n]||(this._eventListeners[n]=[]),this._eventListeners[n].push(r)},t.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)},t.prototype.dispatchEvent=function(n){if(this._eventListeners[n.type])for(let r of this._eventListeners[n.type])r.call(this,n)},window.AbortController=e,window.AbortSignal=t}jd=(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))(jd||{}),Ua=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}},Ba=class extends Ua{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},_s=class extends Ua{constructor(){super(...arguments),this.kind="USER_ERROR"}},ys=class extends _s{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},Vd=class extends _s{constructor(e,t,n){super(e),this.message=e,this.errNo=t,this.name="USER_CUSTOM_ERROR",this.errMsg=e,n&&(this.extra=Object.assign({},this.extra,n))}},ws=class extends Ba{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},Fn=class extends Ba{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},Hn=class extends Ua{constructor(e,t,n,r,a){super(e),this.message=e,this.code=t,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}}},Ma=class extends Ba{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Pe={log:nn("log"),warn:nn("warn"),info:nn("info"),error:nn("error"),debug:nn("debug")};Object.assign(globalThis,{logger:Pe});Oa=Symbol.for("Jolibox.canIUseMap"),Wd={};globalThis[Oa]||(globalThis[Oa]=Wd);Ga={get config(){return globalThis[Oa]}},us=Symbol.for("Jolibox.canIUseMap.native"),Kd={};globalThis[us]||(globalThis[us]=Kd);gt=(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))(gt||{}),xt=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(xt||{}),zd=(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))(zd||{}),ds=["name","params"],Xd=["name","type","location","target","extra","timestamp","userId"],Yd=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];Ge=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});Zd();Tt=typeof window=="undefined",ef=()=>!Tt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Ie={isiOS:!Tt&&(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:!Tt&&navigator.userAgent.includes("Android"),isMac:!Tt&&navigator.userAgent.includes("Mac"),isFacebook:!Tt&&navigator.userAgent.includes("FB_IAB"),isPC:!Tt&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},tf=()=>Ie.isiOS?"iOS":Ie.isAndroid?"Android":Ie.isMac?"Mac":Ie.isFacebook?"Facebook":"PC",nf="device_id",rf="advertising_id",Es=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,Ge()),window.__joliboxLocalStorage__.getItem(e)),Fa=()=>new URLSearchParams(window.location.search).get("deviceId")||Es(nf),Ha=()=>new URLSearchParams(window.location.search).get("advertisingId")||Es(rf),af=e=>e.charAt(0).toUpperCase()+e.slice(1),of=()=>{var e;let t=new URLSearchParams(window.location.search);return af((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},Is=e=>{if(ef())return window.navigator.userAgent;let t="JoliboxWebSDK",n=tf(),r=navigator.language,a=Fa(),i=Ha();return`${t} (${of()}${n}; UnknownModel; UnknownSystemVersion; ${r}) uuid/${a} adid/${i} version/${e||""}`};_t=class{constructor(e,t={}){this.requestAdapter=e,this.cache=new Map,this.pendingRequests=new Map,this.requestSequence=0,this.cacheSequences=new Map,this.config=Da({duration:10*60*1e3,timeout:3e3,keyGenerator:(n,r)=>n,consistencyChecker:()=>!0},t)}request(e,t){return vt(this,null,function*(){let n=this.config.keyGenerator(e,t),r=this.pendingRequests.get(n);if(r)return console.log(`[RequestCacheService] Reusing pending request for ${e}`),r;let a=this.requestInternal(e,t),i=this.createTimeoutPromise(),o=Promise.race([a,i]).catch(s=>vt(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 ${e}`),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 ${e}`)}).catch(s=>{console.warn(`[RequestCacheService] Background request failed for ${e}:`,s)});try{return yield o}finally{this.pendingRequests.delete(n)}})}requestInternal(e,t){return vt(this,null,function*(){var n,r,a,i;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 h=yield this.requestAdapter.execute(e,t),p=this.requestAdapter.extractRealTimeData(h),f=(r=(n=this.requestAdapter).extractCacheableData)==null?void 0:r.call(n,h);return f&&!this.config.consistencyChecker(l,f)?(console.log(`[RequestCacheService] Cache invalidated due to data change for ${e}`),this.setCachedDataWithSequence(o,f,s),h):this.requestAdapter.mergeData(l,p)}catch(h){return console.warn(`[RequestCacheService] Failed to fetch real-time data, using cache only for ${e}:`,h),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 d=yield this.requestAdapter.execute(e,t),_=(i=(a=this.requestAdapter).extractCacheableData)==null?void 0:i.call(a,d);return _&&this.setCachedDataWithSequence(o,_,s),d})}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,n,r){let a=this.cache.get(e);if(a&&a.sequence>n){console.log(`[RequestCacheService] Ignoring stale cache update for ${e} (current: ${a.sequence}, incoming: ${n})`);return}let i=Date.now();this.cache.set(e,{data:JSON.parse(JSON.stringify(t)),timestamp:i,expiresAt:i+this.config.duration,key:e,sequence:n,metadata:r}),this.cacheSequences.set(e,n),console.log(`[RequestCacheService] Updated cache for ${e} with sequence ${n}`)}refreshCache(e,t){return vt(this,null,function*(){let n=this.config.keyGenerator(e,t);return this.cache.delete(n),this.request(e,t)})}forceRequest(e,t){return vt(this,null,function*(){var n,r;let a=this.config.keyGenerator(e,t),i=++this.requestSequence;console.log(`[RequestCacheService] Force request for ${e} (sequence: ${i})`);let o=yield this.requestAdapter.execute(e,t),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 ${e}`)),o})}warmupCache(e,t){return vt(this,null,function*(){let n=this.config.keyGenerator(e,t);if(this.pendingRequests.has(n)){console.log(`[RequestCacheService] Skipping warmup for ${e} - request in progress`);return}if(this.hasValidCache(n)){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(r){console.warn(`[RequestCacheService] Cache warmup failed for ${e}:`,r)}})}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,n]of this.cache)e>n.expiresAt&&(this.cache.delete(t),this.cacheSequences.delete(t));console.log("[RequestCacheService] Cleared expired cache entries")}getCacheStats(){let e=Date.now(),t=0,n=0;for(let r of this.cache.values())e>r.expiresAt?n++:t++;return{cacheCount:this.cache.size,validCount:t,expiredCount:n,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)}},ka=class Ta{constructor(t){this.element=t,this.next=Ta.Undefined,this.prev=Ta.Undefined}};ka.Undefined=new ka(void 0);ne=ka,lf=class{constructor(){this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ne.Undefined}clear(){let e=this._first;for(;e!==ne.Undefined;){let t=e.next;e.prev=ne.Undefined,e.next=ne.Undefined,e=t}this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new ne(e);if(this._first===ne.Undefined)this._first=n,this._last=n;else if(t){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!==ne.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ne.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ne.Undefined&&e.next!==ne.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ne.Undefined&&e.next===ne.Undefined?(this._first=ne.Undefined,this._last=ne.Undefined):e.next===ne.Undefined?(this._last=this._last.prev,this._last.next=ne.Undefined):e.prev===ne.Undefined&&(this._first=this._first.next,this._first.prev=ne.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ne.Undefined;)yield e.element,e=e.next}},cf=0,rn=class{constructor(e){this.value=e,this.id=cf++}},an=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,n;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof rn&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(r=>(r==null?void 0:r.value)===e)):(this._listeners=void 0,this._size=0)),(n=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,n)=>{var r,a,i,o,s,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};n&&(t=t.bind(n));let d=new rn(t);return this._listeners?this._listeners instanceof rn?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 _,h,p,f;if(!this._disposed){if(this._listeners instanceof rn)this._listeners.id===d.id&&(this._listeners=void 0,this._size=0,(h=(_=this.options)==null?void 0:_.onDidRemoveLastListener)==null||h.call(_));else if(this._listeners){let w=this._listeners.indexOf(d);w>=0&&(this._listeners.splice(w,1),this._size--,this._size===0&&((f=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||f.call(p)))}}}}),this._event}_deliver(e,t){var n;if(!e)return;let r=((n=this.options)==null?void 0:n.onListenerError)||Error.constructor;if(!r){e.value(t);return}try{e.value(t)}catch(a){r(a)}}fire(e){this._listeners&&(this._listeners instanceof rn?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},He=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,n=!0){var r;let a=(r=this.listeners.get(e))!=null?r:new an,i=l=>t(...l.args),o=a.event(i);this.listerHandlerMap.set(t,{handler:i,dispose:o}),this.listeners.set(e,a);let s=this.cachedEventQueue.get(e);if(s&&n)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let n=this.listerHandlerMap.get(t);n&&(n.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let n=this.listeners.get(e),r=this.cachedEventQueue.get(e);r||(r=new lf,this.cachedEventQueue.set(e,r)),r.push({args:t}),n&&n.fire({event:e,args:t})}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};this.on(e,n,!1)}},xa={};Gd(xa,{None:()=>uf,filter:()=>ff,once:()=>Cs,toPromise:()=>df});uf=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Ra=Symbol.for("Jolibox.hostEmitter"),hf=()=>{let e=new He;return globalThis[Ra]||(globalThis[Ra]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Ra]},ut=hf();Jn=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new an,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 n=[];for(let a of e.metadata.args)n.push(a.constraint);let r=e.handler;e.handler=function(...a){return mf(a,n),r(...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 n=this.getCommand(t);n&&e.set(t,n)}return e}};Jn=fs([ps],Jn);Pa=class{constructor(){this._onWillExecuteCommand=new an,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new an,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Jn,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Jd(3e4)),this._starActivation}executeCommand(e,...t){return vt(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),xa.toPromise(xa.filter(this.registry.onDidRegisterCommand,n=>n===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let n=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let r=this.invokeFunction(n.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),r}_tryExecuteCommand(e,t){let n=this.registry.getCommand(e);if(!n)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let r=this.invokeFunction(n.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(r)}catch(r){return Promise.reject(r)}}invokeFunction(e,...t){let n=!1;try{return e(...t)}finally{n=!0}}};Pa=fs([ps],Pa);Rs=Symbol.for("Jolibox.commands")});function Le(e,t={}){ja.emit("ERROR_REPORT",{error:e,options:t})}var ja,yt,Xe=ee(()=>{"use strict";G();G();ja=new He,yt=new He;Le.debounce=on(Le,50,{leading:!0})});var Va,_f,Os,ks,Ts=ee(()=>{"use strict";G();Xe();Va=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),r=atob(t+n);try{return JSON.parse(r)}catch(a){return{}}},_f=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},Os=e=>{var t;try{let a=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(a!=null&&a.length){let[i,o,s]=a;return{headerJson:Va(i),payloadJson:Va(o),signature:Va(s)}}else throw"joli_source is missing"}catch(n){return Le(new ws(`${e} not a valid schema: ${n}`)),{headerJson:{},payloadJson:{},signature:{}}}},ks=(e,t)=>{let n=t.split(".");if(n&&n.length===3){let r=n[0],a=_f(e),i=n[2];return`${r}.${a}.${i}`}return t}});var yf,qn,xs,$a=ee(()=>{"use strict";G();yf="1.2.7",qn=()=>yf,xs=()=>{let e=qn();return`${Is(e)}`}});function Ka(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var wf,Ps,Wa,Ls,re,bf,L,ue=ee(()=>{"use strict";G();Ts();$a();G();wf={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:Fa(),adId:Ha(),pixelRatio:window.devicePixelRatio||1,platform:Ie.isAndroid?"android":Ie.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:qn()},schema:window.location.href,platform:Ie.isAndroid?"android":Ie.isiOS?"ios":"h5"},Wa=(Ps=globalThis.joliboxJSCore)==null?void 0:Ps.env,re=Object.assign({},(Ls=Wa==null?void 0:Wa())!=null?Ls:wf);bf=()=>{var f,w,A,C,b,x,D,H,j,R,N;let{payloadJson:e,headerJson:t,signature:n}=re.schema.length?Os(re.schema):{},r=`${re.deviceInfo.did}-${new Date().getTime()}`,i=new URL(re.schema.length?re.schema:window.location.href).searchParams,o=(A=(w=(f=i.get("mpId"))!=null?f:i.get("appId"))!=null?w:i.get("gameId"))!=null?A:"",s=(x=(b=(C=re.clientSessionId)!=null?C:e==null?void 0:e.sessionId)!=null?b:i.get("sessionId"))!=null?x:r,l=!!((H=(D=e==null?void 0:e.testAdsMode)!=null?D:e==null?void 0:e.__testAdsMode)!=null?H:i.get("testAdsMode")==="true"),d=(N=(R=(j=e==null?void 0:e.joliboxEnv)!=null?j:e==null?void 0:e.__joliboxEnv)!=null?R:i.get("joliboxEnv"))!=null?N:"production",_=d==="staging",h=t==null?void 0:t.channel,p=e==null?void 0:e.__shouldInterupt;return{get startTime(){var T;return(T=performance.timeOrigin)!=null?T:performance.timing.navigationStart},get testMode(){return _},get testAdsMode(){return l},get joliboxEnv(){return d},get joliSource(){var T;return(T=i.get("joliSource"))!=null?T:null},get mpId(){var T;return(T=o!=null?o:e==null?void 0:e.id)!=null?T:""},get mpVersion(){var T;return(T=t==null?void 0:t.ver)!=null?T:qn()},get mpType(){var T,B;return(B=(T=t==null?void 0:t.__mpType)!=null?T:e==null?void 0:e.__mpType)!=null?B:"game"},get platform(){var T;return((T=re.platform)!=null?T:re.deviceInfo.platform).toLowerCase()},get deviceInfo(){return re.deviceInfo},get sdkInfo(){return re.sdkInfo},get hostInfo(){return re.hostInfo},get hostUserInfo(){return re.hostUserInfo},get sessionId(){var T,B;return(B=(T=re.clientSessionId)!=null?T:s)!=null?B:r},get channel(){return h},get webviewId(){var T;return(T=re.webviewId)!=null?T:-1},get shouldInterupt(){return p},get from(){return e==null?void 0:e.__from},get baseApiHost(){return As(_)},get adId(){var T;return(T=re.deviceInfo.adId)!=null?T:re.deviceInfo.did},get language(){return re.deviceInfo.lang},get sdkEnvironment(){return Ka("dlightek","jolibox")?"dlightek":i.get("huaweiQuick")==="true"?"huaweiQuick":Ka("gamedistribution","jolibox")?"gamedistribution":Ka("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var z,te,me;let T=(z=re.deviceInfo.pixelRatio)!=null?z:1,B=(te=re.deviceInfo.statusBarHeight)!=null?te:e==null?void 0:e.__androidStatusBarHeight,K=(me=re.deviceInfo.navigationBarHeight)!=null?me:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:B!==void 0?B/T:20,navigationBarHeight:K!==void 0?K/T:10}},get abTests(){var T,B;return(B=(T=re.abValues)==null?void 0:T.split(","))!=null?B:[]},get mpInfo(){var T;return(T=re.mpInfo)!=null?T:{mpName:"unknown"}},onEnvConfigChanged:T=>{vs(re,T,gs)},encodeJoliSourceQuery:T=>{var B,K;return t&&n?ks(q(q({},e),T),(B=i.get("joliSource"))!=null?B:""):(K=i.get("joliSource"))!=null?K:""},setDoExitDirectly:()=>{p=!1}}},L=bf()});var za,Ns,Ef,If,Ds,Af,Us=ee(()=>{"use strict";G();Xe();ue();G();za=!1,Ns=(e,t)=>e==null?!1:t in e,Ef=e=>Ns(e,"kind"),If=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")},Ds=(e,t={},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:If(e.name)},a=Ee(q({},r),{env:t.environment,isFromUser:n});n?yt.emit("GLOBAL_USER_ERROR",e,a):yt.emit("GLOBAL_ERROR",e,a)},Af=e=>Ns(e,"kind")&&e.kind==="USER_ERROR";ja.on("ERROR_REPORT",({error:e,options:t})=>{if(za)return;za=!0;let n=Ef(e)&&e.raw?e.raw:e;try{let r=Af(e);Ds(e,t,r)}catch(r){let a=r instanceof Error?r.message:String(r),i=new Ma(`${a}, origin error: ${n.message}`);Pe.error(i),Ds(new Ma(i.message),{environment:t.environment},!1)}finally{za=!1}})});var Xa,Ya=ee(()=>{"use strict";Xe();G();Xe();Xa=e=>new ys(e)});function Bs(e,t){let n=(r,a,i)=>{let d=a!=null?a:{},{eventType:o}=d,s=is(d,["eventType"]),l=Ee(q({tag:r,eventType:i!=null?i:o!=null?o:gt.Other},t),{extra:q({},s)});r=="globalJsError"?Le(new Fn(JSON.stringify(l))):e("systemLog",l,L.webviewId)};return n.debounce=on(n,500,{leading:!0}),n}function Ms(e){let t=(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}),e("joliboxSpeedAnalysis",o)};return t.debounce=on(t,500,{leading:!0}),t}var Gs=ee(()=>{"use strict";G();G();Xe();ue()});function Js(e,t){let n=Bs(e,t),r=Ms(n);return{track:n,trackPerformance:r}}var Fs=ee(()=>{"use strict";Gs()});var Qa=ee(()=>{"use strict"});var jn,Hs=ee(()=>{"use strict";ue();G();G();jn=class{constructor(t){this.apiHost=t;this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return I(this,null,function*(){let n=`${this.apiHost}/api/fe-configs/js-sdk/samples-config`,r=yield(yield fetch(n)).json();this.samplesConfig=r})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:n}=this.samplesConfig;for(let[r,a]of Object.entries(n))if(a.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(r);return!1}getDevice(){var r,a,i,o,s;let{nativeSDKVersion:t,jssdkVersion:n}=L.sdkInfo;return{platform:1e3,os:L.deviceInfo.platform,appVersion:(r=t!=null?t: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 t=new URLSearchParams(window.location.search),n={};return t.forEach((r,a)=>{n[a]=r}),{name:"GamePage",params:n}}trackEvent(t,n,r){return I(this,null,function*(){if(this.checkIsSampled(t))return;let a=t.location?t.location:yield this.getLocation(),i=t.target||null,o=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let s=this.deviceInfo,d={protocolVersion:"1.0.0",events:[Ee(q({},t),{location:a,target:i,extra:o,timestamp:Date.now(),userId:null})],device:s,project:n};try{r?yield this.doReport(Ja(d),r):yield this.doReport(Ja(d))}catch(_){Pe.log("[Jolibox SDK] report API error",_)}})}}});var Za=ee(()=>{"use strict";Fs();Qa();Hs()});var ei,qs,Ye,Vn,Je,Lt=ee(()=>{"use strict";$a();ue();G();ei=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(qs=AbortSignal.timeout)!=null||(AbortSignal.timeout=ei);Ye=class e{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 e._instance||(e._instance=new e),e._instance}create(t){let n=new Vn(t);return e.getInstance().httpClients.add(n),n}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},Vn=class{constructor(t){this.xua=xs();this.getJoliSource=()=>L.joliSource;var r;let n=Pt(L.testMode);this.baseUrl=(r=t==null?void 0:t.baseUrl)!=null?r:n}get(t,n){return I(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}${t}${s?`?${s}`:""}`,d=this.xua,_=this.getJoliSource();i=Object.assign({},i!=null?i:{},d?{"x-user-agent":d}:{},_?{"x-joli-source":_}:{});let h=yield fetch(l,{method:"GET",headers:i,credentials:"include",signal:ei(a!=null?a:3e4)});return Ye.getInstance().recordNetworkRequest(!0),yield h.json()}catch(r){throw Ye.getInstance().recordNetworkRequest(!1),r}})}post(t,n){return I(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}${t}${l?`?${l}`:""}`,_=this.xua,h=this.getJoliSource();o=Object.assign({},o!=null?o:{},{"Content-Type":"application/json"},_?{"x-user-agent":_}:{},h?{"x-joli-source":h}:{},{"x-os-type":Ie.isAndroid?"ANDROID":Ie.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let p=yield fetch(d,{method:"POST",headers:o,body:JSON.stringify(r),signal:ei(i!=null?i:3e4),credentials:"include"});Ye.getInstance().recordNetworkRequest(!0);let f=p.headers.get("content-type");if(f!=null&&f.includes("application/octet-stream"))try{return p.blob()}catch(w){return yield p.arrayBuffer()}if(f!=null&&f.includes("multipart/form-data")||f!=null&&f.includes("application/x-www-form-urlencoded"))try{return p.formData()}catch(w){return yield p.text()}if(f!=null&&f.includes("application/json"))try{return yield p.json()}catch(w){return yield p.text()}return p}catch(r){throw Ye.getInstance().recordNetworkRequest(!1),r}})}put(t,n){return I(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}${t}${l?`?${l}`:""}`,_=this.xua,h=this.getJoliSource();o=Object.assign({},o!=null?o:{},{"Content-Type":"application/json"},_?{"x-user-agent":_}:{},h?{"x-joli-source":h}:{});let p=yield fetch(d,{method:"PUT",headers:o,credentials:"include",body:JSON.stringify(r!=null?r:{})});if(!p.ok)throw Ye.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${p.status}`);return Ye.getInstance().recordNetworkRequest(!0),yield p.json()}catch(r){throw console.error("Error:",r),r}})}};window.JoliboxHttpClient=Vn;Je=Ye.getInstance()});var ti,$n,ni=ee(()=>{"use strict";ue();Za();Lt();G();ti=class extends jn{constructor(){super(...arguments);this.httpClient=Je.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n;return Ss((n=L.testMode)!=null?n:!1)}doReport(n){this.httpClient.post("/report",{data:n,timeout:5e3}).catch(r=>{console.info("report error",r)})}},$n=new ti(Pt(L.testMode))});var Sf,js=ee(()=>{"use strict";Us();G();Ya();G();ni();ue();Sf=(e,t)=>{var a,i,o;let n={message:t.message,stack:(a=t.stack)!=null?a:"",errorType:t.name,source:0},r={name:e,type:gt.ErrorTrace,location:null,target:null,extra:n,timestamp:Date.now(),userId:(o=(i=L.hostUserInfo)==null?void 0:i.uid)!=null?o:null};$n.trackEvent(r,xt.WebSDK)};yt.on("GLOBAL_ERROR",(e,t)=>{Sf(t.tag,e)});yt.on("GLOBAL_USER_ERROR",(e,t)=>{Pe.log("UserError",e,t)})});var Wn,Vs=ee(()=>{"use strict";Wn=class{constructor(t,n){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.reportCount=0;this.notifyIframeGameEvent=(t,n)=>{window.parent&&window.parent.postMessage({type:t,data:n},"*")};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=n!=null?n:5*1e3,t.on("visible",r=>{this.visible=r})}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 n=Date.now(),r,a,i=!1,o=0,s=()=>{if(!i)return;let f=Date.now(),w=f-n;w>=this.interval&&(this.visible&&(o+=Math.min(w,this.interval+1e3),t(o)),n=f),r=requestAnimationFrame(s)},l=()=>{_(),n=Date.now(),a=window.setInterval(()=>{if(!i)return;let f=Date.now();f-n>=this.interval&&(n=f)},this.interval)},d=()=>{h(),n=Date.now(),r=requestAnimationFrame(s)},_=()=>{r&&(cancelAnimationFrame(r),r=0)},h=()=>{a&&(clearInterval(a),a=0)};this.eventEmitter.on("visible",f=>{i&&(console.log("visible",f),f?d():l())});let p=this.visible;return{start(){i||(i=!0,p?d():l())},stop(){i=!1,_(),h()}}}}});var Kn,$s=ee(()=>{"use strict";ue();Vs();Lt();Kn=class extends Wn{constructor(n,r,a){super(r,a);this.httpClient=Je.create();this.gameId=L.mpId,this.sessionId=L.sessionId,this.track=n}reporter(n){return I(this,null,function*(){let{event:r,params:a,extraParams:i}=n,o={eventType:r,gameInfo:q({gameId:this.gameId,sessionId:this.sessionId},a)};i&&Object.assign(o,i),yield this.httpClient.post("/api/base/app-event",{data:o})})}tracker(n,r=null){this.track(n,r)}}});var Ws,Cf,Se,Rf,ri,Qe,dt=ee(()=>{"use strict";js();G();G();Za();ni();$s();ue();Qa();Ws=ge(),Cf={type:xt.WebSDK,platform:"h5",jssdk_version:L.sdkInfo.jssdkVersion,mp_id:L.mpId,mp_version:L.mpVersion},{track:Se,trackPerformance:Rf}=Js((...e)=>{var o,s,l,d;let[,t]=e,n=t,r=hs(n.extra)?n.extra:Na(n.extra)?JSON.parse(n.extra):{},a=Ee(q({},r),{mp_id:(o=n.mp_id)!=null?o:"",mp_version:(s=n.mp_version)!=null?s:""}),i={name:t.tag,type:gt.System,location:null,target:null,extra:a,timestamp:Date.now(),userId:(d=(l=L.hostUserInfo)==null?void 0:l.uid)!=null?d:null};$n.trackEvent(i,xt.WebSDK)},Cf);Ws.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:n})=>{Rf(e,t,n)});Ws.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Se(e,t)});ri=new He,Qe=new Kn(Se,ri)});function Ks(e){let t=Ga.config[e];return t||(t={},Ga.config[e]=t),(n,r)=>{if(t[n]){Pe.warn(`[can i use] ${n} already registered`);return}t[n]=q({},r)}}var zs=ee(()=>{"use strict";G()});function ai(e){Xs=e}function zn(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>zn(t)):Object.keys(e).reduce((t,n)=>(t[n]=zn(e[n]),t),{})}function Ze(e){return typeof e=="number"}function ii(e){let t=oi(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function oi(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var Xs,de,Xn,Yn,Qn,Zn,Dt,er,tr,nr,rr,ar,ir,or,sr,lr,cr,ur,dr,si=ee(()=>{"use strict";Xs=!1;de=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(Xs)if(typeof t=="string")this.errors.push(t);else{let n=`${this.path} should be ${t.expect}`;this._optional&&t.expect!=="undefined"?n+=" or undefined, ":n+=", ",n+=`but got ${ii(t.actual)}`,this.errors.push(n)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return zn(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:zn(this._default)}optional(){return this._optional=!0,this}};Xn=class extends de{validate(t){return this._optional&&t===void 0?!0:Ze(t)?Ze(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):Ze(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):Ze(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}},Yn=class extends de{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},Qn=class extends de{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(Ze(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(Ze(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}},Zn=class extends de{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},Dt=class extends de{validate(t){return!0}},er=class extends de{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},tr=class extends de{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},nr=class extends de{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},rr=class extends de{constructor(...t){super(),this._items=t}validate(t){if(this._optional&&t===void 0)return!0;if(!this._items.includes(t)){let n=this._items.map(r=>JSON.stringify(r)).join(", ");return this.fail(`expect ${this.path} to be one of ${n}, but got ${ii(t)}`)}return!0}},ar=class extends de{constructor(n){super();this._item=n}validate(n){if(this._optional&&n===void 0)return!0;if(!Array.isArray(n))return this.fail({expect:"array",actual:n});if(Ze(this._minItems)&&n.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(Ze(this._maxItems)&&n.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(Ze(this._length)&&n.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let r=this._item;if(!r)return!0;let a=!0;if(n.forEach((i,o)=>{if(r.path=`${this.path}[${o}]`,r.errors=this.errors,i===void 0&&r.hasDefault){n[o]=r.defaultValue;return}r.validate(i)||(r.hasFallback?n[o]=r.fallbackValue:a=!1)}),this._uniqueItems){let i=new Map;for(let o in n)i.has(n[o])?a=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${i.get(n[o])}] and ${this.path}[${o}] are identical)`):i.set(n[o],o)}return a}minItems(n){return this._minItems=n,this}maxItems(n){return this._maxItems=n,this}uniqueItems(){return this._uniqueItems=!0,this}length(n){return this._length=n,this}},ir=class extends de{constructor(n){super();this._value=n}validate(n){if(this._optional&&n===void 0)return!0;if(oi(n)!=="object")return this.fail({expect:"object",actual:n});let a=n,i=this._value;i.errors=this.errors;let o=!0;for(let s in a){let l=a[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?i.path=`${this.path}.${s}`:i.path=`${this.path}["${s}"]`,!(l===void 0&&i._optional)){if(l===void 0&&i.hasDefault){a[s]=i.defaultValue;continue}i.validate(l)||(i.hasFallback?a[s]=i.fallbackValue:o=!1)}}return o}},or=class extends de{constructor(n={}){super();this._object=n}validate(n){if(this._optional&&n===void 0)return!0;if(oi(n)!=="object")return this.fail({expect:"object",actual:n});let r=n,a=!0;for(let i in this._object){let o=r[i],s=this._object[i];if(s.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(i)?s.path=`${this.path}.${i}`:s.path=`${this.path}["${i}"]`,!(s._optional&&o===void 0)){if(o===void 0&&s.hasDefault){r[i]=s.defaultValue;continue}s.validate(o)||(s.hasFallback?r[i]=s.fallbackValue:a=!1)}}return a}},sr=class extends de{constructor(n){super();this.value=n}validate(n){return n===void 0&&this._optional?!0:n!==this.value?this.fail({expect:ii(this.value),actual:n}):!0}},lr=class extends de{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let n=[],r=!1,a=this._items.length;for(let i=0;i<a;i++){let o=this._items[i];if(o.errors=[],o.path=this.path,!o.validate(t))n.push(o.errors.join("; "));else if(!r){r=!0;break}}if(!r){let i=n.join(`
2
2
  or `);this.errors.push(i)}return r}},cr=class extends de{constructor(...t){super(),this._items=t;let n=0,r=t.length-1;for(;r>=0;r--){let a=t[r];if(a._optional||a.hasDefault)n+=1;else break}this._minItems=t.length-n}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 n=!0;return this._items.forEach((r,a)=>{if(r.path=`${this.path}[${a}]`,r.errors=this.errors,t[a]===void 0&&r.hasDefault){t[a]=r.defaultValue;return}r.validate(t[a])||(r.hasFallback?t[a]=r._fallback:n=!1)}),n}},ur=class extends de{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},dr=class extends de{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 li(e,t,n="param"){if(e.errors=[],e.path=n,ai(!0),!e.validate(t)){let r=e.errors.join(`
3
- `);throw e.errors.length=0,ai(!1),new TypeError(r)}}var J,ci=ee(()=>{"use strict";si();si();J={object(e){return new or(e)},array(e){return new ar(e)},tuple(...e){return new cr(...e)},literal(e){return new sr(e)},or(...e){return new lr(...e)},symbol(){return new Zn},record(e){return new ir(e)},function(){return new nr},boolean(){return new Yn},string(){return new Qn},number(){return new Xn},undefined(){return new er},null(){return new tr},unknown(){return new Dt},any(){return new Dt},as(){return new Dt},arraybuffer(){return new ur},enum(...e){return new rr(...e)},typedarray(e){return new dr(e)}}});var fr,Ys,Qs=ee(()=>{"use strict";G();Xe();ci();Ya();fr=1,Ys=e=>{function t(r,a){return(...i)=>{var h,p,f,w;let o=Date.now(),s={method:r,trace_id:fr};fr+=1;let l="SUCCESS",d=`${r}:ok`,_=0;try{if(a.paramsSchema)try{li(a.paramsSchema,i,"params")}catch(x){throw Xa(`${r}:fail ${x.message}`)}let A=a.implement(...i),C=A,b=`${r}:ok`;if(A&&"code"in A){let{code:x,data:D,message:H}=A;l=x,C=D,b=H}return{code:l,message:b,data:C}}catch(A){let C=A;_=(p=(h=C.code)!=null?h:C.errNo)!=null?p:2e3,l="FAILURE";let b=(w=(f=C.message)!=null?f:C.errMsg)!=null?w:`${A}`;return d=`${r}:${l} ${b.replace(/^\S+:(fail|cancel)\s?/,"")}`,Le(new Hn(d,_)),{code:l,message:d}}finally{let A=Date.now()-o}}}function n(r,a){return(...i)=>I(this,null,function*(){var p,f,w,A;let o=ms(i)?i:[i],s=Date.now(),l={method:r,trace_id:fr};fr+=1;let d=`${r}:ok`,_="SUCCESS",h={code:_,message:d};try{if(a.paramsSchema)try{li(a.paramsSchema,o,"params")}catch(x){throw Xa(x.message)}let b=yield a.implement(...o);if(b&&"code"in b){let{code:x,data:D,message:H}=b;_=x,d=H,b=D}return Object.assign(h,{code:_,message:d,data:b}),h}catch(C){let b=C,x=(f=(p=b.code)!=null?p:b.errNo)!=null?f:2e3;_="FAILURE";let D=(A=(w=b.message)!=null?w:b.errMsg)!=null?A:`${C}`,H=`${r}:${_} ${D.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(h,{code:_,message:H}),Le(new Hn(H,x)),h}finally{let C=Date.now()-s}})}return{createAPI:n,createSyncAPI:t}}});var et,wt,_e,sn=ee(()=>{"use strict";zs();dt();Qs();ci();({createAPI:et,createSyncAPI:wt}=Ys(Se)),_e=Ks("h5")});var nl=Sa((tl,hi)=>{(function(e){if(typeof tl=="object"&&typeof hi!="undefined")hi.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,n;return function r(a,i,o){function s(_,h){if(!i[_]){if(!a[_]){var p=typeof tn=="function"&&tn;if(!h&&p)return p(_,!0);if(l)return l(_,!0);var f=new Error("Cannot find module '"+_+"'");throw f.code="MODULE_NOT_FOUND",f}var w=i[_]={exports:{}};a[_][0].call(w.exports,function(A){var C=a[_][1][A];return s(C||A)},w,w.exports,r,a,i,o)}return i[_].exports}for(var l=typeof tn=="function"&&tn,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(A),h=o.document.createTextNode("");_.observe(h,{characterData:!0}),l=function(){h.data=d=++d%2}}else if(!o.setImmediate&&typeof o.MessageChannel!="undefined"){var p=new o.MessageChannel;p.port1.onmessage=A,l=function(){p.port2.postMessage(0)}}else"document"in o&&"onreadystatechange"in o.document.createElement("script")?l=function(){var b=o.document.createElement("script");b.onreadystatechange=function(){A(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},o.document.documentElement.appendChild(b)}:l=function(){setTimeout(A,0)};var f,w=[];function A(){f=!0;for(var b,x,D=w.length;D;){for(x=w,w=[],b=-1;++b<D;)x[b]();D=w.length}f=!1}a.exports=C;function C(b){w.push(b)===1&&!f&&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"],h=["PENDING"];a.exports=p;function p(R){if(typeof R!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,R!==s&&C(this,R)}p.prototype.catch=function(R){return this.then(null,R)},p.prototype.then=function(R,N){if(typeof R!="function"&&this.state===_||typeof N!="function"&&this.state===d)return this;var T=new this.constructor(s);if(this.state!==h){var B=this.state===_?R:N;w(T,B,this.outcome)}else this.queue.push(new f(T,R,N));return T};function f(R,N,T){this.promise=R,typeof N=="function"&&(this.onFulfilled=N,this.callFulfilled=this.otherCallFulfilled),typeof T=="function"&&(this.onRejected=T,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(R){l.resolve(this.promise,R)},f.prototype.otherCallFulfilled=function(R){w(this.promise,this.onFulfilled,R)},f.prototype.callRejected=function(R){l.reject(this.promise,R)},f.prototype.otherCallRejected=function(R){w(this.promise,this.onRejected,R)};function w(R,N,T){o(function(){var B;try{B=N(T)}catch(K){return l.reject(R,K)}B===R?l.reject(R,new TypeError("Cannot resolve promise with itself")):l.resolve(R,B)})}l.resolve=function(R,N){var T=b(A,N);if(T.status==="error")return l.reject(R,T.value);var B=T.value;if(B)C(R,B);else{R.state=_,R.outcome=N;for(var K=-1,z=R.queue.length;++K<z;)R.queue[K].callFulfilled(N)}return R},l.reject=function(R,N){R.state=d,R.outcome=N;for(var T=-1,B=R.queue.length;++T<B;)R.queue[T].callRejected(N);return R};function A(R){var N=R&&R.then;if(R&&(typeof R=="object"||typeof R=="function")&&typeof N=="function")return function(){N.apply(R,arguments)}}function C(R,N){var T=!1;function B(me){T||(T=!0,l.reject(R,me))}function K(me){T||(T=!0,l.resolve(R,me))}function z(){N(K,B)}var te=b(z);te.status==="error"&&B(te.value)}function b(R,N){var T={};try{T.value=R(N),T.status="success"}catch(B){T.status="error",T.value=B}return T}p.resolve=x;function x(R){return R instanceof this?R:l.resolve(new this(s),R)}p.reject=D;function D(R){var N=new this(s);return l.reject(N,R)}p.all=H;function H(R){var N=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=R.length,B=!1;if(!T)return this.resolve([]);for(var K=new Array(T),z=0,te=-1,me=new this(s);++te<T;)Ke(R[te],te);return me;function Ke(Qt,Nn){N.resolve(Qt).then(ha,function(Ot){B||(B=!0,l.reject(me,Ot))});function ha(Ot){K[Nn]=Ot,++z===T&&!B&&(B=!0,l.resolve(me,K))}}}p.race=j;function j(R){var N=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=R.length,B=!1;if(!T)return this.resolve([]);for(var K=-1,z=new this(s);++K<T;)te(R[K]);return z;function te(me){N.resolve(me).then(function(Ke){B||(B=!0,l.resolve(z,Ke))},function(Ke){B||(B=!0,l.reject(z,Ke))})}}},{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 h(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 f(c,m){m&&c.then(function(u){m(null,u)},function(u){m(u)})}function w(c,m,u){typeof m=="function"&&c.then(m),typeof u=="function"&&c.catch(u)}function A(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 b="local-forage-detect-blob-support",x=void 0,D={},H=Object.prototype.toString,j="readonly",R="readwrite";function N(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 T(c){return new p(function(m){var u=c.transaction(b,R),g=h([""]);u.objectStore(b).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 B(c){return typeof x=="boolean"?p.resolve(x):T(c).then(function(m){return x=m,x})}function K(c){var m=D[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 z(c){var m=D[c.name],u=m.deferredOperations.pop();if(u)return u.resolve(),u.promise}function te(c,m){var u=D[c.name],g=u.deferredOperations.pop();if(g)return g.reject(m),g.promise}function me(c,m){return new p(function(u,g){if(D[c.name]=D[c.name]||Uo(),c.db)if(m)K(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(E){var S=v.result;try{S.createObjectStore(c.storeName),E.oldVersion<=1&&S.createObjectStore(b)}catch(O){if(O.name==="ConstraintError")console.warn('The database "'+c.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+c.storeName+'" already exists.');else throw O}}),v.onerror=function(E){E.preventDefault(),g(v.error)},v.onsuccess=function(){var E=v.result;E.onversionchange=function(S){S.target.close()},u(E),z(c)}})}function Ke(c){return me(c,!1)}function Qt(c){return me(c,!0)}function Nn(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 ha(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 Ot(c){var m=N(atob(c.data));return h([m],{type:c.type})}function No(c){return c&&c.__local_forage_encoded_blob}function Ru(c){var m=this,u=m._initReady().then(function(){var g=D[m._dbInfo.name];if(g&&g.dbReady)return g.dbReady});return w(u,c,c),u}function Ou(c){K(c);for(var m=D[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,Ke(c).then(function(v){return c.db=v,Nn(c)?Qt(c):v}).then(function(v){c.db=m.db=v;for(var E=0;E<u.length;E++)u[E]._dbInfo.db=v}).catch(function(v){throw te(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),Qt(c)}).then(function(){return Ou(c).then(function(){ze(c,m,u,g-1)})}).catch(u);u(v)}}function Uo(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function ku(c){var m=this,u={db:null};if(c)for(var g in c)u[g]=c[g];var y=D[u.name];y||(y=Uo(),D[u.name]=y),y.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=Ru);var v=[];function E(){return p.resolve()}for(var S=0;S<y.forages.length;S++){var O=y.forages[S];O!==m&&v.push(O._initReady().catch(E))}var k=y.forages.slice(0);return p.all(v).then(function(){return u.db=y.db,Ke(u)}).then(function(P){return u.db=P,Nn(u,m._defaultConfig.version)?Qt(u):P}).then(function(P){u.db=y.db=P,m._dbInfo=u;for(var U=0;U<k.length;U++){var F=k[U];F!==m&&(F._dbInfo.db=u.db,F._dbInfo.version=u.version)}})}function Tu(c,m){var u=this;c=A(c);var g=new p(function(y,v){u.ready().then(function(){ze(u._dbInfo,j,function(E,S){if(E)return v(E);try{var O=S.objectStore(u._dbInfo.storeName),k=O.get(c);k.onsuccess=function(){var P=k.result;P===void 0&&(P=null),No(P)&&(P=Ot(P)),y(P)},k.onerror=function(){v(k.error)}}catch(P){v(P)}})}).catch(v)});return f(g,m),g}function xu(c,m){var u=this,g=new p(function(y,v){u.ready().then(function(){ze(u._dbInfo,j,function(E,S){if(E)return v(E);try{var O=S.objectStore(u._dbInfo.storeName),k=O.openCursor(),P=1;k.onsuccess=function(){var U=k.result;if(U){var F=U.value;No(F)&&(F=Ot(F));var W=c(F,U.key,P++);W!==void 0?y(W):U.continue()}else y()},k.onerror=function(){v(k.error)}}catch(U){v(U)}})}).catch(v)});return f(g,m),g}function Pu(c,m,u){var g=this;c=A(c);var y=new p(function(v,E){var S;g.ready().then(function(){return S=g._dbInfo,H.call(m)==="[object Blob]"?B(S.db).then(function(O){return O?m:ha(m)}):m}).then(function(O){ze(g._dbInfo,R,function(k,P){if(k)return E(k);try{var U=P.objectStore(g._dbInfo.storeName);O===null&&(O=void 0);var F=U.put(O,c);P.oncomplete=function(){O===void 0&&(O=null),v(O)},P.onabort=P.onerror=function(){var W=F.error?F.error:F.transaction.error;E(W)}}catch(W){E(W)}})}).catch(E)});return f(y,u),y}function Lu(c,m){var u=this;c=A(c);var g=new p(function(y,v){u.ready().then(function(){ze(u._dbInfo,R,function(E,S){if(E)return v(E);try{var O=S.objectStore(u._dbInfo.storeName),k=O.delete(c);S.oncomplete=function(){y()},S.onerror=function(){v(k.error)},S.onabort=function(){var P=k.error?k.error:k.transaction.error;v(P)}}catch(P){v(P)}})}).catch(v)});return f(g,m),g}function Du(c){var m=this,u=new p(function(g,y){m.ready().then(function(){ze(m._dbInfo,R,function(v,E){if(v)return y(v);try{var S=E.objectStore(m._dbInfo.storeName),O=S.clear();E.oncomplete=function(){g()},E.onabort=E.onerror=function(){var k=O.error?O.error:O.transaction.error;y(k)}}catch(k){y(k)}})}).catch(y)});return f(u,c),u}function Nu(c){var m=this,u=new p(function(g,y){m.ready().then(function(){ze(m._dbInfo,j,function(v,E){if(v)return y(v);try{var S=E.objectStore(m._dbInfo.storeName),O=S.count();O.onsuccess=function(){g(O.result)},O.onerror=function(){y(O.error)}}catch(k){y(k)}})}).catch(y)});return f(u,c),u}function Uu(c,m){var u=this,g=new p(function(y,v){if(c<0){y(null);return}u.ready().then(function(){ze(u._dbInfo,j,function(E,S){if(E)return v(E);try{var O=S.objectStore(u._dbInfo.storeName),k=!1,P=O.openKeyCursor();P.onsuccess=function(){var U=P.result;if(!U){y(null);return}c===0||k?y(U.key):(k=!0,U.advance(c))},P.onerror=function(){v(P.error)}}catch(U){v(U)}})}).catch(v)});return f(g,m),g}function Bu(c){var m=this,u=new p(function(g,y){m.ready().then(function(){ze(m._dbInfo,j,function(v,E){if(v)return y(v);try{var S=E.objectStore(m._dbInfo.storeName),O=S.openKeyCursor(),k=[];O.onsuccess=function(){var P=O.result;if(!P){g(k);return}k.push(P.key),P.continue()},O.onerror=function(){y(O.error)}}catch(P){y(P)}})}).catch(y)});return f(u,c),u}function Mu(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,E=v?p.resolve(g._dbInfo.db):Ke(c).then(function(S){var O=D[c.name],k=O.forages;O.db=S;for(var P=0;P<k.length;P++)k[P]._dbInfo.db=S;return S});c.storeName?y=E.then(function(S){if(S.objectStoreNames.contains(c.storeName)){var O=S.version+1;K(c);var k=D[c.name],P=k.forages;S.close();for(var U=0;U<P.length;U++){var F=P[U];F._dbInfo.db=null,F._dbInfo.version=O}var W=new p(function(X,ce){var oe=d.open(c.name,O);oe.onerror=function(Be){var en=oe.result;en.close(),ce(Be)},oe.onupgradeneeded=function(){var Be=oe.result;Be.deleteObjectStore(c.storeName)},oe.onsuccess=function(){var Be=oe.result;Be.close(),X(Be)}});return W.then(function(X){k.db=X;for(var ce=0;ce<P.length;ce++){var oe=P[ce];oe._dbInfo.db=X,z(oe._dbInfo)}}).catch(function(X){throw(te(c,X)||p.resolve()).catch(function(){}),X})}}):y=E.then(function(S){K(c);var O=D[c.name],k=O.forages;S.close();for(var P=0;P<k.length;P++){var U=k[P];U._dbInfo.db=null}var F=new p(function(W,X){var ce=d.deleteDatabase(c.name);ce.onerror=function(){var oe=ce.result;oe&&oe.close(),X(ce.error)},ce.onblocked=function(){console.warn('dropInstance blocked for database "'+c.name+'" until all open connections are closed')},ce.onsuccess=function(){var oe=ce.result;oe&&oe.close(),W(oe)}});return F.then(function(W){O.db=W;for(var X=0;X<k.length;X++){var ce=k[X];z(ce._dbInfo)}}).catch(function(W){throw(te(c,W)||p.resolve()).catch(function(){}),W})})}return f(y,m),y}var Gu={_driver:"asyncStorage",_initStorage:ku,_support:_(),iterate:xu,getItem:Tu,setItem:Pu,removeItem:Lu,clear:Du,length:Nu,key:Uu,keys:Bu,dropInstance:Mu};function Ju(){return typeof openDatabase=="function"}var lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fu="~~local_forage_type~",Bo=/^~~local_forage_type~([^~]+)~/,Un="__lfsc__:",ma=Un.length,pa="arbf",va="blob",Mo="si08",Go="ui08",Jo="uic8",Fo="si16",Ho="si32",qo="ur16",jo="ui32",Vo="fl32",$o="fl64",Wo=ma+pa.length,Ko=Object.prototype.toString;function zo(c){var m=c.length*.75,u=c.length,g,y=0,v,E,S,O;c[c.length-1]==="="&&(m--,c[c.length-2]==="="&&m--);var k=new ArrayBuffer(m),P=new Uint8Array(k);for(g=0;g<u;g+=4)v=lt.indexOf(c[g]),E=lt.indexOf(c[g+1]),S=lt.indexOf(c[g+2]),O=lt.indexOf(c[g+3]),P[y++]=v<<2|E>>4,P[y++]=(E&15)<<4|S>>2,P[y++]=(S&3)<<6|O&63;return k}function ga(c){var m=new Uint8Array(c),u="",g;for(g=0;g<m.length;g+=3)u+=lt[m[g]>>2],u+=lt[(m[g]&3)<<4|m[g+1]>>4],u+=lt[(m[g+1]&15)<<2|m[g+2]>>6],u+=lt[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 Hu(c,m){var u="";if(c&&(u=Ko.call(c)),c&&(u==="[object ArrayBuffer]"||c.buffer&&Ko.call(c.buffer)==="[object ArrayBuffer]")){var g,y=Un;c instanceof ArrayBuffer?(g=c,y+=pa):(g=c.buffer,u==="[object Int8Array]"?y+=Mo:u==="[object Uint8Array]"?y+=Go:u==="[object Uint8ClampedArray]"?y+=Jo:u==="[object Int16Array]"?y+=Fo:u==="[object Uint16Array]"?y+=qo:u==="[object Int32Array]"?y+=Ho:u==="[object Uint32Array]"?y+=jo:u==="[object Float32Array]"?y+=Vo:u==="[object Float64Array]"?y+=$o:m(new Error("Failed to get type for BinaryArray"))),m(y+ga(g))}else if(u==="[object Blob]"){var v=new FileReader;v.onload=function(){var E=Fu+c.type+"~"+ga(this.result);m(Un+va+E)},v.readAsArrayBuffer(c)}else try{m(JSON.stringify(c))}catch(E){console.error("Couldn't convert value into a JSON string: ",c),m(null,E)}}function qu(c){if(c.substring(0,ma)!==Un)return JSON.parse(c);var m=c.substring(Wo),u=c.substring(ma,Wo),g;if(u===va&&Bo.test(m)){var y=m.match(Bo);g=y[1],m=m.substring(y[0].length)}var v=zo(m);switch(u){case pa:return v;case va:return h([v],{type:g});case Mo:return new Int8Array(v);case Go:return new Uint8Array(v);case Jo:return new Uint8ClampedArray(v);case Fo:return new Int16Array(v);case qo:return new Uint16Array(v);case Ho:return new Int32Array(v);case jo:return new Uint32Array(v);case Vo:return new Float32Array(v);case $o:return new Float64Array(v);default:throw new Error("Unkown type: "+u)}}var _a={serialize:Hu,deserialize:qu,stringToBuffer:zo,bufferToString:ga};function Xo(c,m,u,g){c.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],u,g)}function ju(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,E){try{u.db=openDatabase(u.name,String(u.version),u.description,u.size)}catch(S){return E(S)}u.db.transaction(function(S){Xo(S,u,function(){m._dbInfo=u,v()},function(O,k){E(k)})},E)});return u.serializer=_a,y}function ct(c,m,u,g,y,v){c.executeSql(u,g,y,function(E,S){S.code===S.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[m.storeName],function(O,k){k.rows.length?v(O,S):Xo(O,m,function(){O.executeSql(u,g,y,v)},v)},v):v(E,S)},v)}function Vu(c,m){var u=this;c=A(c);var g=new p(function(y,v){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(S){ct(S,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[c],function(O,k){var P=k.rows.length?k.rows.item(0).value:null;P&&(P=E.serializer.deserialize(P)),y(P)},function(O,k){v(k)})})}).catch(v)});return f(g,m),g}function $u(c,m){var u=this,g=new p(function(y,v){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(S){ct(S,E,"SELECT * FROM "+E.storeName,[],function(O,k){for(var P=k.rows,U=P.length,F=0;F<U;F++){var W=P.item(F),X=W.value;if(X&&(X=E.serializer.deserialize(X)),X=c(X,W.key,F+1),X!==void 0){y(X);return}}y()},function(O,k){v(k)})})}).catch(v)});return f(g,m),g}function Yo(c,m,u,g){var y=this;c=A(c);var v=new p(function(E,S){y.ready().then(function(){m===void 0&&(m=null);var O=m,k=y._dbInfo;k.serializer.serialize(m,function(P,U){U?S(U):k.db.transaction(function(F){ct(F,k,"INSERT OR REPLACE INTO "+k.storeName+" (key, value) VALUES (?, ?)",[c,P],function(){E(O)},function(W,X){S(X)})},function(F){if(F.code===F.QUOTA_ERR){if(g>0){E(Yo.apply(y,[c,O,u,g-1]));return}S(F)}})})}).catch(S)});return f(v,u),v}function Wu(c,m,u){return Yo.apply(this,[c,m,u,1])}function Ku(c,m){var u=this;c=A(c);var g=new p(function(y,v){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(S){ct(S,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[c],function(){y()},function(O,k){v(k)})})}).catch(v)});return f(g,m),g}function zu(c){var m=this,u=new p(function(g,y){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){ct(E,v,"DELETE FROM "+v.storeName,[],function(){g()},function(S,O){y(O)})})}).catch(y)});return f(u,c),u}function Xu(c){var m=this,u=new p(function(g,y){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){ct(E,v,"SELECT COUNT(key) as c FROM "+v.storeName,[],function(S,O){var k=O.rows.item(0).c;g(k)},function(S,O){y(O)})})}).catch(y)});return f(u,c),u}function Yu(c,m){var u=this,g=new p(function(y,v){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(S){ct(S,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[c+1],function(O,k){var P=k.rows.length?k.rows.item(0).key:null;y(P)},function(O,k){v(k)})})}).catch(v)});return f(g,m),g}function Qu(c){var m=this,u=new p(function(g,y){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){ct(E,v,"SELECT key FROM "+v.storeName,[],function(S,O){for(var k=[],P=0;P<O.rows.length;P++)k.push(O.rows.item(P).key);g(k)},function(S,O){y(O)})})}).catch(y)});return f(u,c),u}function Zu(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 E=[],S=0;S<v.rows.length;S++)E.push(v.rows.item(S).name);m({db:c,storeNames:E})},function(y,v){u(v)})},function(g){u(g)})})}function ed(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 E;c.name===u.name?E=g._dbInfo.db:E=openDatabase(c.name,"","",0),c.storeName?v({db:E,storeNames:[c.storeName]}):v(Zu(E))}).then(function(v){return new p(function(E,S){v.db.transaction(function(O){function k(W){return new p(function(X,ce){O.executeSql("DROP TABLE IF EXISTS "+W,[],function(){X()},function(oe,Be){ce(Be)})})}for(var P=[],U=0,F=v.storeNames.length;U<F;U++)P.push(k(v.storeNames[U]));p.all(P).then(function(){E()}).catch(function(W){S(W)})},function(O){S(O)})})}):y=p.reject("Invalid arguments"),f(y,m),y}var td={_driver:"webSQLStorage",_initStorage:ju,_support:Ju(),iterate:$u,getItem:Vu,setItem:Wu,removeItem:Ku,clear:zu,length:Xu,key:Yu,keys:Qu,dropInstance:ed};function nd(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(c){return!1}}function Qo(c,m){var u=c.name+"/";return c.storeName!==m.storeName&&(u+=c.storeName+"/"),u}function rd(){var c="_localforage_support_test";try{return localStorage.setItem(c,!0),localStorage.removeItem(c),!1}catch(m){return!0}}function ad(){return!rd()||localStorage.length>0}function id(c){var m=this,u={};if(c)for(var g in c)u[g]=c[g];return u.keyPrefix=Qo(c,m._defaultConfig),ad()?(m._dbInfo=u,u.serializer=_a,p.resolve()):p.reject()}function od(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 f(u,c),u}function sd(c,m){var u=this;c=A(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 f(g,m),g}function ld(c,m){var u=this,g=u.ready().then(function(){for(var y=u._dbInfo,v=y.keyPrefix,E=v.length,S=localStorage.length,O=1,k=0;k<S;k++){var P=localStorage.key(k);if(P.indexOf(v)===0){var U=localStorage.getItem(P);if(U&&(U=y.serializer.deserialize(U)),U=c(U,P.substring(E),O++),U!==void 0)return U}}});return f(g,m),g}function cd(c,m){var u=this,g=u.ready().then(function(){var y=u._dbInfo,v;try{v=localStorage.key(c)}catch(E){v=null}return v&&(v=v.substring(y.keyPrefix.length)),v});return f(g,m),g}function ud(c){var m=this,u=m.ready().then(function(){for(var g=m._dbInfo,y=localStorage.length,v=[],E=0;E<y;E++){var S=localStorage.key(E);S.indexOf(g.keyPrefix)===0&&v.push(S.substring(g.keyPrefix.length))}return v});return f(u,c),u}function dd(c){var m=this,u=m.keys().then(function(g){return g.length});return f(u,c),u}function fd(c,m){var u=this;c=A(c);var g=u.ready().then(function(){var y=u._dbInfo;localStorage.removeItem(y.keyPrefix+c)});return f(g,m),g}function hd(c,m,u){var g=this;c=A(c);var y=g.ready().then(function(){m===void 0&&(m=null);var v=m;return new p(function(E,S){var O=g._dbInfo;O.serializer.serialize(m,function(k,P){if(P)S(P);else try{localStorage.setItem(O.keyPrefix+c,k),E(v)}catch(U){(U.name==="QuotaExceededError"||U.name==="NS_ERROR_DOM_QUOTA_REACHED")&&S(U),S(U)}})})});return f(y,u),y}function md(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(Qo(c,g._defaultConfig)):v(c.name+"/")}).then(function(v){for(var E=localStorage.length-1;E>=0;E--){var S=localStorage.key(E);S.indexOf(v)===0&&localStorage.removeItem(S)}}):y=p.reject("Invalid arguments"),f(y,m),y}var pd={_driver:"localStorageWrapper",_initStorage:id,_support:nd(),iterate:ld,getItem:sd,setItem:hd,removeItem:fd,clear:od,length:dd,key:cd,keys:ud,dropInstance:md},vd=function(m,u){return m===u||typeof m=="number"&&typeof u=="number"&&isNaN(m)&&isNaN(u)},gd=function(m,u){for(var g=m.length,y=0;y<g;){if(vd(m[y],u))return!0;y++}return!1},Zo=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},Zt={},es={},kt={INDEXEDDB:Gu,WEBSQL:td,LOCALSTORAGE:pd},_d=[kt.INDEXEDDB._driver,kt.WEBSQL._driver,kt.LOCALSTORAGE._driver],Bn=["dropInstance"],ya=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Bn),yd={description:"",driver:_d.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function wd(c,m){c[m]=function(){var u=arguments;return c.ready().then(function(){return c[m].apply(c,u)})}}function wa(){for(var c=1;c<arguments.length;c++){var m=arguments[c];if(m)for(var u in m)m.hasOwnProperty(u)&&(Zo(m[u])?arguments[0][u]=m[u].slice():arguments[0][u]=m[u])}return arguments[0]}var bd=function(){function c(m){s(this,c);for(var u in kt)if(kt.hasOwnProperty(u)){var g=kt[u],y=g._driver;this[u]=y,Zt[y]||this.defineDriver(g)}this._defaultConfig=wa({},yd),this._config=wa({},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(E,S){try{var O=u._driver,k=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!u._driver){S(k);return}for(var P=ya.concat("_initStorage"),U=0,F=P.length;U<F;U++){var W=P[U],X=!gd(Bn,W);if((X||u[W])&&typeof u[W]!="function"){S(k);return}}var ce=function(){for(var en=function(Ad){return function(){var Sd=new Error("Method "+Ad+" is not implemented by the current driver"),ts=p.reject(Sd);return f(ts,arguments[arguments.length-1]),ts}},ba=0,Id=Bn.length;ba<Id;ba++){var Ea=Bn[ba];u[Ea]||(u[Ea]=en(Ea))}};ce();var oe=function(en){Zt[O]&&console.info("Redefining LocalForage driver: "+O),Zt[O]=u,es[O]=en,E()};"_support"in u?u._support&&typeof u._support=="function"?u._support().then(oe,S):oe(!!u._support):oe(!0)}catch(Be){S(Be)}});return w(v,g,y),v},c.prototype.driver=function(){return this._driver||null},c.prototype.getDriver=function(u,g,y){var v=Zt[u]?p.resolve(Zt[u]):p.reject(new Error("Driver not found."));return w(v,g,y),v},c.prototype.getSerializer=function(u){var g=p.resolve(_a);return w(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 w(y,u,u),y},c.prototype.setDriver=function(u,g,y){var v=this;Zo(u)||(u=[u]);var E=this._getSupportedDrivers(u);function S(){v._config.driver=v.driver()}function O(U){return v._extend(U),S(),v._ready=v._initStorage(v._config),v._ready}function k(U){return function(){var F=0;function W(){for(;F<U.length;){var X=U[F];return F++,v._dbInfo=null,v._ready=null,v.getDriver(X).then(O).catch(W)}S();var ce=new Error("No available storage method found.");return v._driverSet=p.reject(ce),v._driverSet}return W()}}var P=this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve();return this._driverSet=P.then(function(){var U=E[0];return v._dbInfo=null,v._ready=null,v.getDriver(U).then(function(F){v._driver=F._driver,S(),v._wrapLibraryMethodsWithReady(),v._initDriver=k(E)})}).catch(function(){S();var U=new Error("No available storage method found.");return v._driverSet=p.reject(U),v._driverSet}),w(this._driverSet,g,y),this._driverSet},c.prototype.supports=function(u){return!!es[u]},c.prototype._extend=function(u){wa(this,u)},c.prototype._getSupportedDrivers=function(u){for(var g=[],y=0,v=u.length;y<v;y++){var E=u[y];this.supports(E)&&g.push(E)}return g},c.prototype._wrapLibraryMethodsWithReady=function(){for(var u=0,g=ya.length;u<g;u++)wd(this,ya[u])},c.prototype.createInstance=function(u){return new c(u)},c}(),Ed=new bd;a.exports=Ed},{3:3}]},{},[4])(4)})});var al=Sa(gr=>{"use strict";G();sn();dt();var pi=(e,t)=>{window.parent&&window.parent.postMessage({type:e,data:t},"*")},vi=ge(),Vf=et("levelFinished",{paramsSchema:J.tuple(J.object({levelId:J.or(J.string(),J.number()),duration:J.number().optional(),rating:J.number().optional(),score:J.number().optional(),variation:J.string().optional()})),implement:e=>I(gr,null,function*(){let{levelId:t,duration:n,rating:r,score:a,variation:i}=e;Pe.info("onLevelFinished",n,r,a,i),pi("JOLIBOX_GAME_TASK_LEVEL_FINISHED",{levelId:t,duration:n,rating:r,score:a,variation:i}),yield Promise.all([Qe.reporter({event:"COMPLETE_GAME_LEVEL",extraParams:{inGameInfo:{levelId:t,duration:n,rating:r,score:a}}}),Qe.tracker("LevelFinished",{levelId:t,duration:n,rating:r,score:a,variation:i})])})}),$f=et("gamePlayEnded",{paramsSchema:J.tuple(J.object({duration:J.number().optional(),rating:J.number().optional(),score:J.number(),variation:J.string().optional()})),implement:e=>I(gr,null,function*(){let{duration:t,rating:n,score:r,variation:a}=e;Pe.info("onGamePlayEnded",t,n,r,a),pi("JOLIBOX_GAME_TASK_GAME_PLAY_ENDED",{duration:t,rating:n,score:r,variation:a}),yield Promise.all([Qe.tracker("GamePlayEnded",{duration:t,rating:n,score:r,variation:a}),Qe.reporter({event:"GAME_ENDED",extraParams:{inGameInfo:{duration:t,rating:n,score:r}}})])})}),Wf=et("levelUpgrade",{paramsSchema:J.tuple(J.object({levelId:J.or(J.string(),J.number()),name:J.string().optional()})),implement:n=>I(gr,[n],function*({levelId:e,name:t}){Pe.info("onLevelUpgrade",e,t),pi("JOLIBOX_GAME_TASK_LEVEL_UPGRADE",{levelId:e,name:t}),yield Promise.all([Qe.tracker("LevelUpgrade",{name:t,levelId:e}),Qe.reporter({event:"GAME_LEVEL_UP",extraParams:{inGameInfo:{levelId:e,levelName:t}}})])})});vi.registerCommand("TaskTrackerSDK.levelFinished",Vf);vi.registerCommand("TaskTrackerSDK.gamePlayEnded",$f);vi.registerCommand("TaskTrackerSDK.levelUpgrade",Wf);_e("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"}}});_e("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});_e("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var qe,Nt,il,gi,Kf,bt,_r=ee(()=>{"use strict";qe=(e,t)=>{var n;window.dispatchEvent(new CustomEvent(e,{detail:t})),(n=window.parent)==null||n.postMessage({type:e,data:{detail:t}},"*")},Nt=new Map,il=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let n=Nt.get(t.type);n&&n.forEach(r=>{try{r(t.data)}catch(a){console.warn("Callback execution failed:",a)}})}}catch(t){console.warn("Failed to parse message:",t)}},gi=!1,Kf=()=>{gi||(window.addEventListener("message",il),gi=!0)},bt=(e,t)=>{Kf(),Nt.has(e)||Nt.set(e,new Set);let n=Nt.get(e);return n.add(t),()=>{n.delete(t),n.size===0&&Nt.delete(e),Nt.size===0&&(window.removeEventListener("message",il),gi=!1)}}});var yr,wr,br,Er,Ir,_i,Ar,Sr,Cr,Rr,Ut,zf,Y,tt,nt,Ce=ee(()=>{"use strict";G();yr="UNLOCK_OPTIONS_CHANGED",wr="INVOKE_PAYMENT",br="ON_PAYMENT_RESULT",Er="ON_USE_MODAL_EVENT",Ir="ON_USE_MODAL_RESULT",_i="ON_USE_MODAL_FREQUENCY",Ar="ON_USE_UNLOGIN_MODAL_EVENT",Sr="INVOKE_UNLOGIN_MODAL_EVENT",Cr="INVOKE_SUBSCRIPTION_EVENT",Rr="ON_USE_SUBSCRIPTION_RESULT",Ut=new He,zf=()=>({on:Ut.on.bind(Ut),off:Ut.off.bind(Ut),emit:Ut.emit.bind(Ut)}),Y=zf(),tt={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}},nt={show:!0,minInterval:8*60*60*1e3}});var ou=Sa(sa=>{"use strict";ue();Ce();_r();G();var iu={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};bt("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",iu[e.result],e.result),Y.emit(Ir,{useModalResult:iu[e.result]})});Y.on(Er,(e,t)=>{var n;e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||qe("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.quantity,balance:t.userCurrency.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(n=t.sequenceId)!=null?n:Ge()})});bt("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{Y.emit(br,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin,currency:"JOLI_COIN"})});Y.on(wr,(e,t)=>I(sa,null,function*(){var n;e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||qe("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.quantity,balance:t.userCurrency.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(n=t.sequenceId)!=null?n:Ge()})}));bt("ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT",e=>{var t,n,r,a,i;Y.emit(Ar,{result:e.result=="ADS"?"FAILED":e.result,rewards:{claimedRewardValue:(a=(r=(n=(t=e.extra)==null?void 0:t.firstLogin)==null?void 0:n.reward)==null?void 0:r.rewardValue)!=null?a:0,isFirstLogin:(i=e.isFirstLogin)!=null?i:!1}}),e.result==="SUCCESS"&&L.onEnvConfigChanged({hostUserInfo:{isLogin:!0}})});Y.on(Sr,e=>I(sa,null,function*(){e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||qe("JOLIBOX_JOLI_UNLOGIN_MODAL_EVENT",{sequenceId:Ge(),type:e})}));bt("ON_JOLIBOX_SUB_RESULT_EVENT",e=>{console.log("----on custom event ON_JOLIBOX_SUB_RESULT_EVENT-----",e),Y.emit(Rr,{result:e.result})});Y.on(Cr,e=>I(sa,null,function*(){console.log("----notify custom event-----",e),qe("JOLIBOX_SUB_EVENT",{sequenceId:Ge()})}))});dt();ue();sn();G();var Zs=ge(),kf="env",Tf="getSystemInfoSync",xf=()=>{var a,i,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:(a=L.hostInfo)==null?void 0:a.appName,SDKVersion:L.sdkInfo.nativeSDKVersion},t=(i=L.hostInfo)==null?void 0:i.version;t&&(e=Ee(q({},e),{version:t}));let n=(o=L.hostInfo)==null?void 0:o.appName;n&&(e=Ee(q({},e),{appName:n}));let r=(s=L.sdkInfo)==null?void 0:s.jssdkVersion;return r&&(e=Ee(q({},e),{SDKVersion:r})),e},Pf=wt(Tf,{implement:xf}),Lf=wt(kf,{implement:()=>Ee(q({},L.hostInfo),{sdkInfo:L.sdkInfo,platform:L.platform,deviceInfo:L.deviceInfo})});Zs.registerCommand("API.env",Lf);Zs.registerCommand("API.getSystemInfoSync",Pf);_e("env",{version:"1.0.0"});_e("getSystemInfoSync",{version:"1.0.0"});G();sn();Xe();dt();var Df="onJoliboxShow",Nf="onJoliboxHide",Uf="onReady",di=ge(),fi=bs(Le),ui=!0,ln=!0,hr=0,mr=ri;function Bf(){let e=Date.now();if(e-hr<100)return;hr=e;let t=document.visibilityState==="visible";t!==ui&&(ui=t,mr.emit("visible",ui))}function el(e){let t=Date.now();t-hr<100||(hr=t,e==="focus"&&!ln?ln=!0:e==="blur"&&ln&&(ln=!1),mr.emit("visible",ln))}document.addEventListener("visibilitychange",Bf);window.addEventListener("focus",()=>el("focus"));window.addEventListener("blur",()=>el("blur"));var Mf=wt(Df,{paramsSchema:J.tuple(J.function()),implement(e){let t=fi(e);mr.on("visible",n=>{n&&t()})}}),Gf=wt(Nf,{paramsSchema:J.tuple(J.function()),implement(e){let t=fi(e);mr.on("visible",n=>{!n&&t()})}}),Jf=wt(Uf,{paramsSchema:J.tuple(J.function()),implement(e){let t=fi(e);ut.on("LifecycleEvent.onReady",n=>{t(n)})}});di.registerCommand("LifecycleSDK.onReady",Jf);di.registerCommand("LifecycleSDK.onJoliboxShow",Mf);di.registerCommand("LifecycleSDK.onJoliboxHide",Gf);_e("lifeCycle.onReady",{version:"1.0.0"});_e("lifeCycle.onJoliboxShow",{version:"1.0.0"});_e("lifeCycle.onJoliboxHide",{version:"1.0.0"});sn();G();Lt();ue();var rl=Ca(nl());var pr=ge(),mi=class{constructor(){this.httpClient=Je.create({baseUrl:Pt(L.testMode)});this.getGameId=()=>L.mpId;this.getItem=t=>I(this,null,function*(){let{code:n,data:r,message:a}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),i=r==null?void 0:r.value,o=a;return n!=="SUCCESS"&&(i=yield this.gameStore.getItem(t),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=(t,n)=>I(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:t,value:r}});return yield this.gameStore.setItem(t,r),{code:a,message:i}});this.removeItem=t=>I(this,null,function*(){yield this.gameStore.removeItem(t);let{code:n,message:r}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/remove`,{data:{key:t}});return{code:n,message:r}});this.clear=()=>I(this,null,function*(){yield this.gameStore.clear();let{code:t,message:n}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/clear`,{});return{code:t,message:n}});this.gameId=this.getGameId(),this.gameStore=rl.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},vr=new mi,Ff=et("getLocalStorage",{paramsSchema:J.tuple(J.string()),implement(e){return I(this,null,function*(){return yield vr.getItem(e)})}});pr.registerCommand("StorageSDK.getItem",Ff);_e("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Hf=et("setStorage",{paramsSchema:J.tuple(J.string(),J.or(J.string(),J.boolean(),J.number())),implement(e,t){return I(this,null,function*(){return yield vr.setItem(e,t)})}});pr.registerCommand("StorageSDK.setItem",Hf);_e("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var qf=et("removeStorage",{paramsSchema:J.tuple(J.string()),implement(e){return I(this,null,function*(){return yield vr.removeItem(e)})}});pr.registerCommand("StorageSDK.removeItem",qf);_e("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var jf=et("clearStorage",{implement(){return I(this,null,function*(){return yield vr.clear()})}});pr.registerCommand("StorageSDK.clear",jf);_e("storage.clear",{version:"1.0.0"});var tI=Ca(al());dt();G();Lt();_r();ue();Ce();var ol=L.testMode;function sl(){let e=new Map,t,n;return{registerRewardHandler(a,i){e.set(a,i)},handleReward(a,...i){return I(this,null,function*(){return yield a.reduce((s,l)=>I(this,null,function*(){let d=yield s;if(d===!0)return!0;ol&&console.log(`handleReward ${l}`);let _=e.get(l),h=_?yield _(...i):d;return ol&&console.log(`handleReward ${l} ${h}`),h}),Promise.resolve(!1))})},registerRewardsFetcher(a){return I(this,null,function*(){t=(...i)=>I(this,null,function*(){try{return yield a(...i)}catch(o){return console.error("getRewardOptions error:",o),["ADS"]}})})},registerRewardFrequencyConfigFetcher(a){return I(this,null,function*(){n=(...i)=>I(this,null,function*(){try{return yield a(...i)}catch(o){return console.error("getRewardOptions error:",o),{joliCoinUseAndCharge:tt,loginGuide:nt}}})})},getRewardsTypes(...a){return I(this,null,function*(){return t?yield t(...a):["ADS"]})},getRewardFrequencyConfig(...a){return I(this,null,function*(){return n?yield n(...a):{joliCoinUseAndCharge:tt,loginGuide:nt}})}}}G();var yi=class{constructor(t){this.httpClient=t}execute(t,n){return I(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(t,a):yield this.httpClient.post(t,a)})}extractCacheableData(t){var n,r,a;return{unlockOptions:((n=t.data)==null?void 0:n.unlockOptions)||[],joliCoin:(r=t.extra)==null?void 0:r.joliCoin,joliGem:((a=t.extra)==null?void 0:a.joliGem)||{balance:0,enableAutoDeduct:!1}}}mergeData(t,n){return{code:"SUCCESS",message:"success",data:{unlockOptions:t.unlockOptions},extra:{joliCoin:t.joliCoin,joliGem:t.joliGem}}}processCachedData(t){return{code:"SUCCESS",message:"success from cache",data:{unlockOptions:t.unlockOptions},extra:{joliCoin:t.joliCoin,joliGem:t.joliGem}}}},wi=class{constructor(t){this.httpClient=t}execute(t,n){return I(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(t,a):yield this.httpClient.post(t,a)})}extractCacheableData(t){let n=t.data;return q({joliCoinUseAndCharge:n==null?void 0:n.joliCoinUseAndCharge,loginGuide:n==null?void 0:n.loginGuide},n)}processCachedData(t){return{code:"SUCCESS",message:"success from cache",data:t}}},Or=class{constructor(t){this.unlockOptionsService=new _t(new yi(t),{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 _t(new wi(t),{duration:60*60*1e3,timeout:1e3,keyGenerator:n=>n})}getUnlockOptions(){return I(this,arguments,function*(t={}){return yield this.unlockOptionsService.request("/api/games/unlock-options",{endpoint:"/api/games/unlock-options",body:t,method:"POST"})})}getGlobalConfig(){return I(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 I(this,arguments,function*(t={}){return yield this.unlockOptionsService.forceRequest("/api/games/unlock-options",{endpoint:"/api/games/unlock-options",body:t,method:"POST"})})}refreshGlobalConfig(){return I(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 I(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()}};Ce();G();var Xf=()=>(e,t)=>{let n={SUBSCRIPTION:4,JOLI_GEM:3,JOLI_GEM_ONLY:3,JOLI_COIN:2,JOLI_COIN_ONLY:2,ADS:1};return n[t]-n[e]},Yf=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(Xf())},bi=null;function Ei(e){return bi||(bi=new Or(e)),bi}var Ii=e=>{e.registerRewardsFetcher(t=>I(void 0,null,function*(){var a,i,o,s,l;let n=["ADS"],r=Ei(t);try{let d=yield r.getUnlockOptions({});if(d.code!=="SUCCESS")return n;Y.emit(yr,{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(h=>h.type))||Array.from(n);return Yf(_)}catch(d){return console.error("getRewardOptions error (cached):",d),n}}))},Ai=e=>{e.registerRewardFrequencyConfigFetcher(t=>I(void 0,null,function*(){var r,a,i,o;let n=Ei(t);try{let s=yield n.getGlobalConfig();return Y.emit(_i,{joliCoinUseAndCharge:((r=s.data)==null?void 0:r.joliCoinUseAndCharge)||tt,loginGuide:((a=s.data)==null?void 0:a.loginGuide)||nt}),s.data&&ut.emit("onGlobalConfigChanged",{globalConfig:s.data}),{joliCoinUseAndCharge:((i=s.data)==null?void 0:i.joliCoinUseAndCharge)||tt,loginGuide:((o=s.data)==null?void 0:o.loginGuide)||nt}}catch(s){return console.error("getGlobalConfig error (cached):",s),Y.emit(_i,{joliCoinUseAndCharge:tt,loginGuide:nt}),ut.emit("onGlobalConfigChanged",{globalConfig:{joliCoinUseAndCharge:tt,loginGuide:nt}}),{joliCoinUseAndCharge:tt,loginGuide:nt}}}))};var Si=e=>I(void 0,null,function*(){yield Ei(e).warmupCache(),console.log("Reward cache warmed up")});var ll=e=>t=>I(void 0,null,function*(){try{console.log("trigger @jolibox/ads reward",t),yield e.adBreak(t)}catch(n){console.error("-----createAdsRewardHandler error-----",n)}return!0});Ce();function je(e,t){let n=null,r=null,a=null,i=()=>{if(a){n=Promise.resolve(a);return}n=new Promise(o=>{r=o})};return i(),e.on(t,(...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=q(q({},a),o),n=Promise.resolve(a),r&&(r(a),r=null),a}}}Ce();var Re=je(Y,yr);ue();G();var Ci={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"}};G();var Me=ge();Ce();Ce();G();var Oi=class{constructor(t){this.httpClient=t}execute(t,n){return I(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(t,{query:a}):yield this.httpClient.post(t,{query:a})})}extractCacheableData(t){var n;return{balance:((n=t.data)==null?void 0:n.balance)||0,timestamp:Date.now()}}processCachedData(t){return{code:"SUCCESS",message:"success from cache",data:{balance:t.balance}}}},ki=class{constructor(t){this.balanceService=new _t(new Oi(t),{duration:20*60*1e3,timeout:1e3,keyGenerator:(n,r)=>{let a=r!=null&&r.query?JSON.stringify(r.query):"";return`${n}:${a}`}})}getBalance(t="JOLI_COIN"){return I(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 I(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 I(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()}},Ri=null;function Ti(e){return Ri||(Ri=new ki(e)),Ri}var xi=(e,t="JOLI_COIN")=>I(void 0,null,function*(){return yield Ti(e).getBalance(t)}),cn=(e,t="JOLI_COIN")=>I(void 0,null,function*(){let r=yield Ti(e).refreshBalance(t);return console.log(`Balance cache refreshed for type: ${t}`),r}),kr=(e,t="JOLI_COIN")=>I(void 0,null,function*(){yield Ti(e).warmupBalance(t),console.log(`Balance cache warmed up for type: ${t}`)});G();var Li=class{constructor(t){this.httpClient=t}execute(t,n){return I(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(t,{query:a}):yield this.httpClient.post(t,{query:a})})}extractCacheableData(t){var n;return{balance:((n=t.data)==null?void 0:n.balance)||0,timestamp:Date.now()}}processCachedData(t){return{code:"SUCCESS",message:"success from cache",data:{balance:t.balance}}}},Di=class{constructor(t){this.gemBalanceService=new _t(new Li(t),{duration:20*60*1e3,timeout:1e3,keyGenerator:(n,r)=>{let a=r!=null&&r.query?JSON.stringify(r.query):"";return`${n}:${a}`}})}getGemBalance(t="GEM"){return I(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 I(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 I(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()}},Pi=null;function cl(e){return Pi||(Pi=new Di(e)),Pi}var Ni=(e,t="GEM")=>I(void 0,null,function*(){return yield cl(e).getGemBalance(t)}),Tr=(e,t="GEM")=>I(void 0,null,function*(){let r=yield cl(e).refreshGemBalance(t);return console.log(`Gem balance cache refreshed for type: ${t}`),r});var un={JOLI_COIN:{fetchBalance:xi,getQuantity:e=>{var t,n,r;return(r=(n=(t=e==null?void 0:e.options)==null?void 0:t.find(a=>a.type==="JOLI_COIN"))==null?void 0:n.joliCoinChoices[0].joliCoinQuantity)!=null?r: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 n,r;return(r=(n=e==null?void 0:e.options)==null?void 0:n.some(a=>a.type==="JOLI_COIN"&&a.joliCoinChoices.some(i=>{var o;return i.joliCoinQuantity<=((o=t==null?void 0:t.balance)!=null?o:0)})))!=null?r:!1}},JOLI_GEM:{fetchBalance:Ni,getQuantity:e=>{var t,n,r,a;return(a=(r=(n=(t=e==null?void 0:e.options)==null?void 0:t.find(i=>i.type==="JOLI_GEM"))==null?void 0:n.joliGemChoice)==null?void 0:r.joliGemQuantity)!=null?a: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 r,a,i;let n=e==null?void 0:e.options.find(o=>o.type==="JOLI_GEM");return n?((a=(r=n.joliGemChoice)==null?void 0:r.joliGemQuantity)!=null?a:0)<=((i=t==null?void 0:t.balance)!=null?i:0):!1}}};var xr=(e,t,n)=>{let{showUnlockWithCurrencyModal:r}=n;Me.registerCommand(`Rewards.${e}.useJolicoin`,()=>I(void 0,null,function*(){let a=yield Re.getData(),i=un[t],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:t}))!=="CONFIRM"?{result:"FAILED"}:{result:"SUCCESS"}}))},Et=(e,t)=>n=>I(void 0,null,function*(){let r=je(Y,Ir);return Y.emit(Er,e,{enableAutoDeduct:n.enableAutoDeduct,userCurrency:n.userCurrency,quantity:n.quantity,currency:n.currency,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield r.getFreshData()).useModalResult});Ce();Ce();var Pr=(e,t,n)=>{let{httpClient:r,initiateAndAwaitPayment:a}=n;Me.registerCommand(`Rewards.${e}.usePayment`,()=>I(void 0,null,function*(){var p;let i=yield Re.getData(),o=un[t],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),h=o.getUpdateKey();if(Re.updateData({[h]:_}),console.log("-----unlockOptions payment-----",i,_,l,t),!o.isEnough(i,_)){let f=yield a({userCurrency:_,currencyQuantity:l,currency:t});return t==="JOLI_GEM"?Tr(r):cn(r),{result:f==="SUCCESS"?"SUCCESS":"FAILED"}}return{result:"CONTINUE"}}))},It=(e,t)=>n=>I(void 0,null,function*(){let r=je(Y,br);return Y.emit(wr,e,{userCurrency:n.userCurrency,quantity:n.currencyQuantity,currency:n.currency,enableAutoDeduct:n.userCurrency.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield r.getFreshData()).paymentResult});ue();Ce();Ce();G();var At=(e,t)=>n=>I(void 0,null,function*(){let r=je(Y,Ar);return Y.emit(Sr,e,{confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText,currency:n}),yield r.getFreshData()});var eh=(e,t,n,{handlers:{handleUnlockSuccess:r,handleUnlockFailed:a,unlockOptionsHandler:i,initiateAndAwaitPayment:o,showUnlockWithCurrencyModal:s,showUnloginModal:l}})=>{Pr(e,"JOLI_COIN",{httpClient:t,initiateAndAwaitPayment:o}),xr(e,"JOLI_COIN",{showUnlockWithCurrencyModal:s});let d=[`Rewards.${e}.usePayment`,`Rewards.${e}.useJolicoin`];return _=>I(void 0,null,function*(){var h,p,f;try{let w=!0;for(let b of d){let x=yield Me.executeCommand(b);if(w=w&&x.result!=="FAILED",x.result!=="CONTINUE")break}if(!w)return a==null||a(_),!1;let A=Ci[n],C=yield t.post(A.unlockEndpoint,{data:{type:"GAME_REWARD",reqId:`${Ge()}-${L.mpType}-${Date.now()}`,gameInfo:{gameId:L.mpId}}});if(console.log("-----unlockWithCurrency request result-----",C),C.code=="SUCCESS"){try{(p=_.adBreakDone)==null||p.call(_,{breakType:_.type,breakName:"name"in _&&(h=_.name)!=null?h:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in _&&((f=_.adViewed)==null||f.call(_)),cn(t)}catch(b){console.error("-----unlockWithJolicoin adBreakDone error-----",b)}return r==null||r({quantity:C.data.quantity,balance:C.data.balance}),!0}return a==null||a(_),!1}catch(w){if(console.info("JolicoinRewardHandler error:",w),w instanceof Error&&w.message=="CANCEL")throw w;return a==null||a(_),!1}finally{i.clearCache()}})},Lr=(e,t,n)=>eh(e,t,"JOLI_COIN",n);var ul=(e,{onUnlockSuccess:t,onUnlockFailed:n})=>{let r=()=>{n==null||n()},a=Et("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),i=It("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"}),o=At("ADS-JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noWatchAds"});return Lr("ADS-JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:r,unlockOptionsHandler:Re,initiateAndAwaitPayment:i,showUnlockWithCurrencyModal:a,showUnloginModal:o}})};var dl=(e,{onUnlockSuccess:t,onUnlockFailed:n})=>{let r=l=>{var d;n==null||n(),(d=l.adBreakDone)==null||d.call(l,{breakType:l.type,breakFormat:l.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},a=Et("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),i=It("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"}),o=At("JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noThanks"});return Lr("JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:r,unlockOptionsHandler:Re,initiateAndAwaitPayment:i,showUnlockWithCurrencyModal:a,showUnloginModal:o}})};ue();G();Ce();Ce();var fl=e=>{let{showSubscriptionModal:t}=e;Me.registerCommand("Rewards.subscription",()=>I(void 0,null,function*(){return{result:(yield t())==="SUCCESS"?"SUCCESS":"FAILED"}}))},hl=e=>()=>I(void 0,null,function*(){let t=je(Y,Rr);return Y.emit(Cr,e),(yield t.getFreshData()).result});ue();var ml=(e,t,{handlers:{handleSubSuccess:n,handleSubFailed:r,unlockOptionsHandler:a,showSubscriptionModal:i}})=>{fl({showSubscriptionModal:i});let o=["Rewards.subscription"];return s=>I(void 0,null,function*(){var l,d,_,h,p,f;try{let w=!0;for(let A of o){let C=yield Me.executeCommand(A);if(w=w&&C.result!=="FAILED",C.result!=="CONTINUE")break}if(!w)return r==null||r(s),!1;if(console.log("-----unlockWithSubscription result-----"),w){try{(d=s.adBreakDone)==null||d.call(s,{breakType:s.type,breakName:"name"in s&&(l=s.name)!=null?l:"",breakFormat:s.type==="reward"?"reward":"interstitial",breakStatus:"viewed"}),"adViewed"in s&&((_=s.adViewed)==null||_.call(s)),(f=(p=L).onEnvConfigChanged)==null||f.call(p,{hostUserInfo:Ee(q({},(h=L.hostUserInfo)!=null?h:{isLogin:!1}),{isSubUser:!0})})}catch(A){console.error("-----unlockWithSubscription adBreakDone error-----",A)}return n==null||n(),!0}return r==null||r(s),!1}catch(w){if(console.info("SubscriptionRewardHandler error:",w),w instanceof Error&&w.message=="CANCEL")throw w;return r==null||r(s),!1}finally{a.clearCache()}})};var pl=(e,{onSubSuccess:t,onSubFailed:n})=>{let r=()=>{n==null||n()},a=hl("SUBSCRIPTION");return ml("SUBSCRIPTION",e,{handlers:{handleSubSuccess:t,handleSubFailed:r,unlockOptionsHandler:Re,showSubscriptionModal:a}})};var Ve=sl();Ii(Ve);Ai(Ve);var Br,M,wl,Mi,St,vl,bl,El,Il,Gi,Ui,Bi,nh,dn={},Al=[],rh=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,fn=Array.isArray;function rt(e,t){for(var n in t)e[n]=t[n];return e}function Ji(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function hn(e,t,n){var r,a,i,o={};for(i in t)i=="key"?r=t[i]:i=="ref"?a=t[i]:o[i]=t[i];if(arguments.length>2&&(o.children=arguments.length>3?Br.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)o[i]===void 0&&(o[i]=e.defaultProps[i]);return Nr(e,o,r,a,null)}function Nr(e,t,n,r,a){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a==null?++wl:a,__i:-1,__u:0};return a==null&&M.vnode!=null&&M.vnode(i),i}function ft(e){return e.children}function De(e,t){this.props=e,this.context=t}function Bt(e,t){if(t==null)return e.__?Bt(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Bt(e):null}function Sl(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Sl(e)}}function gl(e){(!e.__d&&(e.__d=!0)&&St.push(e)&&!Ur.__r++||vl!==M.debounceRendering)&&((vl=M.debounceRendering)||bl)(Ur)}function Ur(){for(var e,t,n,r,a,i,o,s=1;St.length;)St.length>s&&St.sort(El),e=St.shift(),s=St.length,e.__d&&(n=void 0,a=(r=(t=e).__v).__e,i=[],o=[],t.__P&&((n=rt({},r)).__v=r.__v+1,M.vnode&&M.vnode(n),Fi(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[a]:null,i,a==null?Bt(r):a,!!(32&r.__u),o),n.__v=r.__v,n.__.__k[n.__i]=n,Ol(i,n,o),n.__e!=a&&Sl(n)));Ur.__r=0}function Cl(e,t,n,r,a,i,o,s,l,d,_){var h,p,f,w,A,C,b=r&&r.__k||Al,x=t.length;for(l=ah(n,t,b,l,x),h=0;h<x;h++)(f=n.__k[h])!=null&&(p=f.__i===-1?dn:b[f.__i]||dn,f.__i=h,C=Fi(e,f,p,a,i,o,s,l,d,_),w=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&Hi(p.ref,null,f),_.push(f.ref,f.__c||w,f)),A==null&&w!=null&&(A=w),4&f.__u||p.__k===f.__k?l=Rl(f,l,e):typeof f.type=="function"&&C!==void 0?l=C:w&&(l=w.nextSibling),f.__u&=-7);return n.__e=A,l}function ah(e,t,n,r,a){var i,o,s,l,d,_=n.length,h=_,p=0;for(e.__k=new Array(a),i=0;i<a;i++)(o=t[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(l=i+p,(o=e.__k[i]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Nr(null,o,null,null,null):fn(o)?Nr(ft,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Nr(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(d=o.__i=ih(o,n,l,h))!==-1&&(h--,(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))):e.__k[i]=null;if(h)for(i=0;i<_;i++)(s=n[i])!=null&&!(2&s.__u)&&(s.__e==r&&(r=Bt(s)),Tl(s,s));return r}function Rl(e,t,n){var r,a;if(typeof e.type=="function"){for(r=e.__k,a=0;r&&a<r.length;a++)r[a]&&(r[a].__=e,t=Rl(r[a],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=Bt(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function mn(e,t){return t=t||[],e==null||typeof e=="boolean"||(fn(e)?e.some(function(n){mn(n,t)}):t.push(e)),t}function ih(e,t,n,r){var a,i,o=e.key,s=e.type,l=t[n];if(l===null&&e.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<t.length;){if(a>=0){if((l=t[a])&&!(2&l.__u)&&o==l.key&&s===l.type)return a;a--}if(i<t.length){if((l=t[i])&&!(2&l.__u)&&o==l.key&&s===l.type)return i;i++}}return-1}function _l(e,t,n){t[0]=="-"?e.setProperty(t,n==null?"":n):e[t]=n==null?"":typeof n!="number"||rh.test(t)?n:n+"px"}function Dr(e,t,n,r,a){var i;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||_l(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||_l(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Il,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.t=r.t:(n.t=Gi,e.addEventListener(t,i?Bi:Ui,i)):e.removeEventListener(t,i?Bi:Ui,i);else{if(a=="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]=n==null?"":n;break e}catch(o){}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function yl(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.u==null)t.u=Gi++;else if(t.u<n.t)return;return n(M.event?M.event(t):t)}}}function Fi(e,t,n,r,a,i,o,s,l,d){var _,h,p,f,w,A,C,b,x,D,H,j,R,N,T,B,K,z=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=t.__e=n.__e]),(_=M.__b)&&_(t);e:if(typeof z=="function")try{if(b=t.props,x="prototype"in z&&z.prototype.render,D=(_=z.contextType)&&r[_.__c],H=_?D?D.props.value:_.__:r,n.__c?C=(h=t.__c=n.__c).__=h.__E:(x?t.__c=h=new z(b,H):(t.__c=h=new De(b,H),h.constructor=z,h.render=sh),D&&D.sub(h),h.props=b,h.state||(h.state={}),h.context=H,h.__n=r,p=h.__d=!0,h.__h=[],h._sb=[]),x&&h.__s==null&&(h.__s=h.state),x&&z.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=rt({},h.__s)),rt(h.__s,z.getDerivedStateFromProps(b,h.__s))),f=h.props,w=h.state,h.__v=t,p)x&&z.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),x&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(x&&z.getDerivedStateFromProps==null&&b!==f&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(b,H),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(b,h.__s,H)===!1||t.__v==n.__v)){for(t.__v!=n.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(te){te&&(te.__=t)}),j=0;j<h._sb.length;j++)h.__h.push(h._sb[j]);h._sb=[],h.__h.length&&o.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(b,h.__s,H),x&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(f,w,A)})}if(h.context=H,h.props=b,h.__P=e,h.__e=!1,R=M.__r,N=0,x){for(h.state=h.__s,h.__d=!1,R&&R(t),_=h.render(h.props,h.state,h.context),T=0;T<h._sb.length;T++)h.__h.push(h._sb[T]);h._sb=[]}else do h.__d=!1,R&&R(t),_=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++N<25);h.state=h.__s,h.getChildContext!=null&&(r=rt(rt({},r),h.getChildContext())),x&&!p&&h.getSnapshotBeforeUpdate!=null&&(A=h.getSnapshotBeforeUpdate(f,w)),B=_,_!=null&&_.type===ft&&_.key==null&&(B=kl(_.props.children)),s=Cl(e,fn(B)?B:[B],t,n,r,a,i,o,s,l,d),h.base=t.__e,t.__u&=-161,h.__h.length&&o.push(h),C&&(h.__E=h.__=null)}catch(te){if(t.__v=null,l||i!=null)if(te.then){for(t.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else for(K=i.length;K--;)Ji(i[K]);else t.__e=n.__e,t.__k=n.__k;M.__e(te,t,n)}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=oh(n.__e,t,n,r,a,i,o,l,d);return(_=M.diffed)&&_(t),128&t.__u?void 0:s}function Ol(e,t,n){for(var r=0;r<n.length;r++)Hi(n[r],n[++r],n[++r]);M.__c&&M.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){M.__e(i,a.__v)}})}function kl(e){return typeof e!="object"||e==null?e:fn(e)?e.map(kl):rt({},e)}function oh(e,t,n,r,a,i,o,s,l){var d,_,h,p,f,w,A,C=n.props,b=t.props,x=t.type;if(x=="svg"?a="http://www.w3.org/2000/svg":x=="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((f=i[d])&&"setAttribute"in f==!!x&&(x?f.localName==x:f.nodeType==3)){e=f,i[d]=null;break}}if(e==null){if(x==null)return document.createTextNode(b);e=document.createElementNS(a,x,b.is&&b),s&&(M.__m&&M.__m(t,i),s=!1),i=null}if(x===null)C===b||s&&e.data===b||(e.data=b);else{if(i=i&&Br.call(e.childNodes),C=n.props||dn,!s&&i!=null)for(C={},d=0;d<e.attributes.length;d++)C[(f=e.attributes[d]).name]=f.value;for(d in C)if(f=C[d],d!="children"){if(d=="dangerouslySetInnerHTML")h=f;else if(!(d in b)){if(d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b)continue;Dr(e,d,null,f,a)}}for(d in b)f=b[d],d=="children"?p=f:d=="dangerouslySetInnerHTML"?_=f:d=="value"?w=f:d=="checked"?A=f:s&&typeof f!="function"||C[d]===f||Dr(e,d,f,C[d],a);if(_)s||h&&(_.__html===h.__html||_.__html===e.innerHTML)||(e.innerHTML=_.__html),t.__k=[];else if(h&&(e.innerHTML=""),Cl(t.type==="template"?e.content:e,fn(p)?p:[p],t,n,r,x=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,o,i?i[0]:n.__k&&Bt(n,0),s,l),i!=null)for(d=i.length;d--;)Ji(i[d]);s||(d="value",x=="progress"&&w==null?e.removeAttribute("value"):w!==void 0&&(w!==e[d]||x=="progress"&&!w||x=="option"&&w!==C[d])&&Dr(e,d,w,C[d],a),d="checked",A!==void 0&&A!==e[d]&&Dr(e,d,A,C[d],a))}return e}function Hi(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(a){M.__e(a,n)}}function Tl(e,t,n){var r,a;if(M.unmount&&M.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Hi(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){M.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(a=0;a<r.length;a++)r[a]&&Tl(r[a],t,n||typeof e.type!="function");n||Ji(e.__e),e.__c=e.__=e.__e=void 0}function sh(e,t,n){return this.constructor(e,n)}function xl(e,t,n){var r,a,i,o;t==document&&(t=document.documentElement),M.__&&M.__(e,t),a=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],o=[],Fi(t,e=(!r&&n||t).__k=hn(ft,null,[e]),a||dn,dn,t.namespaceURI,!r&&n?[n]:a?null:t.firstChild?Br.call(t.childNodes):null,i,!r&&n?n:a?a.__e:t.firstChild,r,o),Ol(i,e,o)}Br=Al.slice,M={__e:function(e,t,n,r){for(var a,i,o;t=t.__;)if((a=t.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(e)),o=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,r||{}),o=a.__d),o)return a.__E=a}catch(s){e=s}throw e}},wl=0,Mi=function(e){return e!=null&&e.constructor==null},De.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=rt({},this.state),typeof e=="function"&&(e=e(rt({},n),this.props)),e&&rt(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),gl(this))},De.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),gl(this))},De.prototype.render=ft,St=[],bl=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,El=function(e,t){return e.__v.__b-t.__v.__b},Ur.__r=0,Il=/(PointerCapture)$|Capture$/i,Gi=0,Ui=yl(!1),Bi=yl(!0),nh=0;var Mt,ie,qi,Pl,pn=0,Jl=[],se=M,Ll=se.__b,Dl=se.__r,Nl=se.diffed,Ul=se.__c,Bl=se.unmount,Ml=se.__;function Gr(e,t){se.__h&&se.__h(ie,e,pn||t),pn=0;var n=ie.__H||(ie.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Jr(e){return pn=1,Fl(Hl,e)}function Fl(e,t,n){var r=Gr(Mt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Hl(void 0,t),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=ie,!ie.__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 h=r.__c.props!==s;return _.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(h=!0)}}),i&&i.call(this,s,l,d)||h};ie.__f=!0;var i=ie.shouldComponentUpdate,o=ie.componentWillUpdate;ie.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)},ie.shouldComponentUpdate=a}return r.__N||r.__}function vn(e,t){var n=Gr(Mt++,3);!se.__s&&Ki(n.__H,t)&&(n.__=e,n.u=t,ie.__H.__h.push(n))}function Vi(e,t){var n=Gr(Mt++,4);!se.__s&&Ki(n.__H,t)&&(n.__=e,n.u=t,ie.__h.push(n))}function $i(e){return pn=5,gn(function(){return{current:e}},[])}function gn(e,t){var n=Gr(Mt++,7);return Ki(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Wi(e,t){return pn=8,gn(function(){return e},t)}function lh(){for(var e;e=Jl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Mr),e.__H.__h.forEach(ji),e.__H.__h=[]}catch(t){e.__H.__h=[],se.__e(t,e.__v)}}se.__b=function(e){ie=null,Ll&&Ll(e)},se.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ml&&Ml(e,t)},se.__r=function(e){Dl&&Dl(e),Mt=0;var t=(ie=e.__c).__H;t&&(qi===ie?(t.__h=[],ie.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(Mr),t.__h.forEach(ji),t.__h=[],Mt=0)),qi=ie},se.diffed=function(e){Nl&&Nl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Jl.push(t)!==1&&Pl===se.requestAnimationFrame||((Pl=se.requestAnimationFrame)||ch)(lh)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),qi=ie=null},se.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Mr),n.__h=n.__h.filter(function(r){return!r.__||ji(r)})}catch(r){t.some(function(a){a.__h&&(a.__h=[])}),t=[],se.__e(r,n.__v)}}),Ul&&Ul(e,t)},se.unmount=function(e){Bl&&Bl(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Mr(r)}catch(a){t=a}}),n.__H=void 0,t&&se.__e(t,n.__v))};var Gl=typeof requestAnimationFrame=="function";function ch(e){var t,n=function(){clearTimeout(r),Gl&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Gl&&(t=requestAnimationFrame(n))}function Mr(e){var t=ie,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),ie=t}function ji(e){var t=ie;e.__c=e.__(),ie=t}function Ki(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Hl(e,t){return typeof t=="function"?t(e):t}function dh(e,t){for(var n in t)e[n]=t[n];return e}function ql(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function jl(e,t){this.props=e,this.context=t}(jl.prototype=new De).isPureReactComponent=!0,jl.prototype.shouldComponentUpdate=function(e,t){return ql(this.props,e)||ql(this.state,t)};var Vl=M.__b;M.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Vl&&Vl(e)};var Zb=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var fh=M.__e;M.__e=function(e,t,n,r){if(e.then){for(var a,i=t;i=i.__;)if((a=i.__c)&&a.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),a.__c(e,t)}fh(e,t,n,r)};var $l=M.unmount;function Zl(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=dh({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Zl(r,t,n)})),e}function ec(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return ec(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function zi(){this.__u=0,this.o=null,this.__b=null}function tc(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Fr(){this.i=null,this.l=null}M.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),$l&&$l(e)},(zi.prototype=new De).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var a=tc(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]=ec(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&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},zi.prototype.componentWillUnmount=function(){this.o=[]},zi.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Zl(this.__b,n,r.__O=r.__P)}this.__b=null}var a=t.__a&&hn(ft,null,e.fallback);return a&&(a.__u&=-33),[hn(ft,null,t.__a?null:e.children),a]};var Wl=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Fr.prototype=new De).__a=function(e){var t=this,n=tc(t.__v),r=t.l.get(e);return r[0]++,function(a){var i=function(){t.props.revealOrder?(r.push(a),Wl(t,e,r)):a()};n?n(i):i()}},Fr.prototype.render=function(e){this.i=null,this.l=new Map;var t=mn(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Fr.prototype.componentDidUpdate=Fr.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Wl(e,n,t)})};var hh=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,mh=/^(?: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]/,ph=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,vh=/[A-Z0-9]/g,gh=typeof document!="undefined",_h=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Xi(e,t,n){return t.__k==null&&(t.textContent=""),xl(e,t),typeof n=="function"&&n(),e?e.__c:null}De.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(De.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Kl=M.event;function yh(){}function wh(){return this.cancelBubble}function bh(){return this.defaultPrevented}M.event=function(e){return Kl&&(e=Kl(e)),e.persist=yh,e.isPropagationStopped=wh,e.isDefaultPrevented=bh,e.nativeEvent=e};var nc,Eh={enumerable:!1,configurable:!0,get:function(){return this.class}},zl=M.vnode;M.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,a={},i=r.indexOf("-")===-1;for(var o in n){var s=n[o];if(!(o==="value"&&"defaultValue"in n&&s==null||gh&&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"||_h(n.type)?l==="onfocus"?o="onfocusin":l==="onblur"?o="onfocusout":ph.test(o)&&(o=l):l=o="oninput":i&&mh.test(o)?o=o.replace(vh,"-$&").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=mn(n.children).forEach(function(d){d.props.selected=a.value.indexOf(d.props.value)!=-1})),r=="select"&&a.defaultValue!=null&&(a.value=mn(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",Eh)):(n.className&&!n.class||n.class&&n.className)&&(a.class=a.className=n.className),t.props=a}(e),e.$$typeof=hh,zl&&zl(e)};var Xl=M.__r;M.__r=function(e){Xl&&Xl(e),nc=e.__c};var Yl=M.diffed;M.diffed=function(e){Yl&&Yl(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),nc=null};var Ih=Object.defineProperty,Yr=Object.getOwnPropertySymbols,Oc=Object.prototype.hasOwnProperty,kc=Object.prototype.propertyIsEnumerable,rc=(e,t,n)=>t in e?Ih(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ah=(e,t)=>{for(var n in t||(t={}))Oc.call(t,n)&&rc(e,n,t[n]);if(Yr)for(var n of Yr(t))kc.call(t,n)&&rc(e,n,t[n]);return e},Sh=(e,t)=>{var n={};for(var r in e)Oc.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Yr)for(var r of Yr(e))t.indexOf(r)<0&&kc.call(e,r)&&(n[r]=e[r]);return n},Tc=Object.defineProperty,Ch=Object.defineProperties,Rh=Object.getOwnPropertyDescriptors,ac=Object.getOwnPropertySymbols,Oh=Object.prototype.hasOwnProperty,kh=Object.prototype.propertyIsEnumerable,ic=(e,t,n)=>t in e?Tc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Th=(e,t)=>{for(var n in t||(t={}))Oh.call(t,n)&&ic(e,n,t[n]);if(ac)for(var n of ac(t))kh.call(t,n)&&ic(e,n,t[n]);return e},xh=(e,t)=>Ch(e,Rh(t)),Ph=(e,t)=>{for(var n in t)Tc(e,n,{get:t[n],enumerable:!0})},xc=(e,t,n,r)=>{for(var a=t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(a=o(a)||a);return a},Lh=(e,t,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(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 n=new Event("abort");this.signal.dispatchEvent(n)};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(n,r){this._eventListeners[n]||(this._eventListeners[n]=[]),this._eventListeners[n].push(r)},t.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)},t.prototype.dispatchEvent=function(n){if(this._eventListeners[n.type])for(let r of this._eventListeners[n.type])r.call(this,n)},window.AbortController=e,window.AbortSignal=t}function Dh(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Nh(e){return typeof e=="string"}function Uh(e){return typeof e=="undefined"}function Bh(e){return Uh(e)||e===null}function Mh(e){return typeof e=="function"}function Pc(e){let t=e,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 t(...i)),n};return r.prototype=t.prototype,r}var Gh=(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))(Gh||{});function _n(e){return function(){var t,n;((n=(t=globalThis.VConsole)==null?void 0:t[e])!=null?n:globalThis.console[e])(...arguments)}}var Jh={log:_n("log"),warn:_n("warn"),info:_n("info"),error:_n("error"),debug:_n("debug")};Object.assign(globalThis,{logger:Jh});var oc=Symbol.for("Jolibox.canIUseMap"),Fh={};globalThis[oc]||(globalThis[oc]=Fh);var sc=Symbol.for("Jolibox.canIUseMap.native"),Hh={};globalThis[sc]||(globalThis[sc]=Hh);var Lc=(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))(Lc||{}),Dc=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Dc||{}),Nc=(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))(Nc||{}),lc=["name","params"],qh=["name","type","location","target","extra","timestamp","userId"],jh=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function Vr(e,t){return t.map(n=>{if(n==="params"&&e[n]){let r=e[n];return Object.keys(r).reduce((a,i)=>(a[i]=String(r[i]),a),{})}return e[n]})}function Vh(e){let t=e.location?Vr(e.location,lc):null,n=e.target?Vr(e.target,lc):null;return Vr(xh(Th({},e),{location:t,target:n}),qh)}function $h(e){let t=e.events.map(r=>Vh(r)),n=Vr(e.device,jh);return[e.protocolVersion,t,n,e.project]}function Wh(){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 r=e.get.call(window);return window.__joliboxLocalStorage__=r,r}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,n=Object.getOwnPropertyDescriptor(t,"localStorage");if(n&&n.get){let r=n.get.call(window);return window.__joliboxLocalStorage__=r,r}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}Wh();var Ft=typeof window=="undefined",cc=()=>!Ft&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");!Ft&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),!Ft&&navigator.userAgent.includes("Android"),!Ft&&navigator.userAgent.includes("Mac"),!Ft&&navigator.userAgent.includes("FB_IAB"),!Ft&&!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var ro=class ao{constructor(t){this.element=t,this.next=ao.Undefined,this.prev=ao.Undefined}};ro.Undefined=new ro(void 0);var ae=ro,Kh=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 n=new ae(e);if(this._first===ae.Undefined)this._first=n,this._last=n;else if(t){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!==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}},zh=0,yn=class{constructor(e){this.value=e,this.id=zh++}},In=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,n;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof yn&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(r=>(r==null?void 0:r.value)===e)):(this._listeners=void 0,this._size=0)),(n=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t))}get event(){return this._event!=null||(this._event=(e,t)=>{var n,r,a,i,o,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let l=new yn(e);return this._listeners?this._listeners instanceof yn?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,_,h,p;if(!this._disposed){if(this._listeners instanceof yn)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 f=this._listeners.indexOf(l);f>=0&&(this._listeners.splice(f,1),this._size--,this._size===0&&((p=(h=this.options)==null?void 0:h.onDidRemoveLastListener)==null||p.call(h)))}}}}),this._event}_deliver(e,t){var n;if(!e)return;let r=((n=this.options)==null?void 0:n.onListenerError)||Error.constructor;if(!r){e.value(t);return}try{e.value(t)}catch(a){r(a)}}fire(e){this._listeners&&(this._listeners instanceof yn?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Xh=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;var r;let a=(r=this.listeners.get(e))!=null?r:new In,i=l=>t(...l.args),o=a.event(i);this.listerHandlerMap.set(t,{handler:i,dispose:o}),this.listeners.set(e,a);let s=this.cachedEventQueue.get(e);if(s&&n)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let n=this.listerHandlerMap.get(t);n&&(n.dispose(),this.listerHandlerMap.delete(t))}emit(e){let t=this.listeners.get(e),n=this.cachedEventQueue.get(e);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 Kh,this.cachedEventQueue.set(e,n)),n.push({args:a}),t&&t.fire({event:e,args:a})}once(e,t){var n=this;let r=function(){t(...arguments),n.off(e,r)};this.on(e,r,!1)}},io={};Ph(io,{None:()=>Yh,filter:()=>Zh,once:()=>Uc,toPromise:()=>Qh});var Yh=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function Qh(e){return new Promise(t=>Uc(e)(t))}function Uc(e){return function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=!1;return e(a=>{if(!r)return r=!0,t.call(n,a)},null)}}function Zh(e,t){return(n=>{let r={onWillAddFirstListener(){n(a.fire,a)}},a=new In(r);return a.event})(function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e(a=>t(a)&&n.call(r,a),null)})}var Yi=Symbol.for("Jolibox.hostEmitter"),em=()=>{let e=new Xh;return globalThis[Yi]||(globalThis[Yi]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Yi]};em();function tm(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)nm(e[r],t[r])}function nm(e,t){if(Nh(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Mh(t)){try{if(e instanceof t)return}catch(n){}if(!Bh(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 oo=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new In,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 n=[];for(let a of e.metadata.args)n.push(a.constraint);let r=e.handler;e.handler=function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return tm(i,n),r(...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 n=this.getCommand(t);n&&e.set(t,n)}return e}};oo=xc([Pc],oo);var uc=class{constructor(){this._onWillExecuteCommand=new In,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new In,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new oo,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Dh(3e4)),this._starActivation}executeCommand(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Lh(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,n):(yield Promise.all([Promise.race([this._activateStar(),io.toPromise(io.filter(this.registry.onDidRegisterCommand,a=>a===e))])]),this._tryExecuteCommand(e,n))})}executeCommandThowErr(e){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let t=this.registry.getCommand(e);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:e,args:r});let i=this.invokeFunction(t.handler,...r);return this._onDidExecuteCommand.fire({commandId:e,args:r}),i}_tryExecuteCommand(e,t){let n=this.registry.getCommand(e);if(!n)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let r=this.invokeFunction(n.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(r)}catch(r){return Promise.reject(r)}}invokeFunction(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e(...n)}finally{}}};uc=xc([Pc],uc);function Oe(e,t,n){return(t=rm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rm(e){var t=am(e,"string");return typeof t=="symbol"?t:t+""}function am(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gt=e=>e?function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e==null||e(...n)}catch(a){console.error("Error calling function",a)}}:()=>{console.log("wrapUserFunction: fn is undefined")},so=class{constructor(t){Oe(this,"context",void 0),Oe(this,"continueCallback",void 0),Oe(this,"adIsShowingCallback",void 0),Oe(this,"isBeforeAdCalled",!1),Oe(this,"isBeforeRewardCalled",!1),Oe(this,"isAdDismissedCalled",!1),Oe(this,"isAdViewedCalled",!1),Oe(this,"isAfterAdCalled",!1),Oe(this,"currentProvider",void 0),Oe(this,"currentClientParams",void 0),Oe(this,"adsHasResponse",!1),Oe(this,"videoChecker",window.document.createElement("video")),Oe(this,"contextInfo",void 0),Oe(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",Ah({userEvent:o},this.paramsToTrack)),cc()&&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=Gt(n);s==null||s()}),this.context=t,this.contextInfo=t.getContextInfo()}notifyIframeAdsEvent(t,n){window.parent&&window.parent.postMessage({type:t,data:n},"*"),window.dispatchEvent(new CustomEvent(t,{detail:n}))}get paramsToTrack(){var t,n,r,a,i,o;return{provider:(n=(t=this.currentProvider)==null?void 0:t.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(t){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=Gt(t);o==null||o(),((n=this.currentClientParams)==null?void 0:n.type)!=="reward"&&((r=this.adIsShowingCallback)==null||r.call(this,!0),cc()&&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(t){return n=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(n)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(n)))}}wrapAdDismissed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdDismissedCalled){this.isAdDismissedCalled=!0;let n=Gt(t);n==null||n()}}}wrapAdViewed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdViewedCalled){this.isAdViewedCalled=!0;let n=Gt(t);n==null||n()}}}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 n=Gt(t);n==null||n()}}}wrapAdBreakDone(t){return n=>{var r,a,i,o,s,l,d,_,h;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=Gt(t);p==null||p(n),(d=this.adIsShowingCallback)==null||d.call(this,!1),(_=this.continueCallback)==null||_.call(this,[!1,n]);break}default:{(h=this.continueCallback)==null||h.call(this,[!0,n]);break}}}}callAdBreakAndContinue(t,n,r,a){return I(this,null,function*(){return this.currentProvider=t,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,_,h,p,f;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"?"":(h=n.name)!=null?h:"",breakFormat:n.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(f=this.adIsShowingCallback)==null||f.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AD_BREAK",this.paramsToTrack),t.adBreak(o,r),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};function Hr(e,t,n){return(t=im(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function im(e){var t=om(e,"string");return typeof t=="symbol"?t:t+""}function om(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lo=class{constructor(t){Hr(this,"context",void 0),Hr(this,"adBreakIsShowing",!1),Hr(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),Hr(this,"reportPageHide",()=>{this.context.track("AdBreakHide",{context:"AdsActionDetection"})}),this.context=t,window.addEventListener("visibilitychange",()=>{document.hidden&&this.adBreakIsShowing&&this.reportPageHide()}),window.addEventListener("beforeunload",n=>{this.adBreakIsShowing&&this.reportPageJumpOut()})}};function qr(e,t,n){return(t=sm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sm(e){var t=lm(e,"string");return typeof t=="symbol"?t:t+""}function lm(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var co=class{constructor(t){qr(this,"configs",null),qr(this,"firstRun",!0),qr(this,"context",void 0),qr(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return I(this,null,function*(){try{this.configs=yield this.context.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config",{})}catch(t){}})}shouldBypassCallingInterstitial(){var t,n;let r;if(!this.configs)this.init(),r=!this.firstRun;else{let a=(t=this.contextInfo.channel)!=null?t:"",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 at(e,t,n){return(t=cm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cm(e){var t=um(e,"string");return typeof t=="symbol"?t:t+""}function um(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uo=class{constructor(t,n){at(this,"name","ADSENSE"),at(this,"context",void 0),at(this,"contextInfo",void 0),at(this,"configured",!1),at(this,"initParams",void 0),at(this,"push",function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(r)}),at(this,"adConfig",r=>{let a=r,{onReady:i}=a,o=Sh(a,["onReady"]);this.context.track("CallAdConfig",o),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(r))}),at(this,"adBreak",r=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(r)}),at(this,"adUnit",r=>I(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:h,style:p}=r,f;if(!l)throw new Error("targeting element is required");if(typeof l=="string"?f=document.querySelector(l):f=l,!f)throw new Error("targeting element not found");let w=d;if(w||(w=this.initParams.unitId),!w)throw new Error("slot is required");let A=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",w),A&&C.setAttribute("data-ad-format",A),h&&C.setAttribute("data-full-width-responsive",h),p&&C.setAttribute("style",p),(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",C.style.position="relative",f.appendChild(C),C.appendChild(b)}else f.appendChild(C),new MutationObserver(b=>{b.forEach(x=>{if(x.type==="attributes"&&x.attributeName==="data-ad-status"){let D=C.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:D!=null?D:"null"})}})}).observe(C,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})})),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=n,window.adsbygoogle=window.adsbygoogle||[]}init(){return I(this,null,function*(){var t;if(this.context.track("CallAdsInit",{provider:this.name}),typeof window=="undefined")return;let n="google-adsense",r=(t=this.contextInfo.testAdsMode)!=null?t:!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 dm(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 fm(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 hm=function(){function e(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 t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(fm(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var a=dm(r);try{a.insertRule(n,a.cssRules.length)}catch(i){}}else r.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){var r;return(r=n.parentNode)==null?void 0:r.removeChild(n)}),this.tags=[],this.ctr=0},e}(),we="-ms-",Qr="-moz-",V="-webkit-",Bc="comm",Co="rule",Ro="decl",mm="@import",Mc="@keyframes",pm="@layer",vm=Math.abs,ra=String.fromCharCode,gm=Object.assign;function _m(e,t){return pe(e,0)^45?(((t<<2^pe(e,0))<<2^pe(e,1))<<2^pe(e,2))<<2^pe(e,3):0}function Gc(e){return e.trim()}function ym(e,t){return(e=t.exec(e))?e[0]:e}function $(e,t,n){return e.replace(t,n)}function fo(e,t){return e.indexOf(t)}function pe(e,t){return e.charCodeAt(t)|0}function An(e,t,n){return e.slice(t,n)}function $e(e){return e.length}function Oo(e){return e.length}function jr(e,t){return t.push(e),e}function wm(e,t){return e.map(t).join("")}var aa=1,jt=1,Jc=0,xe=0,fe=0,Vt="";function ia(e,t,n,r,a,i,o){return{value:e,root:t,parent:n,type:r,props:a,children:i,line:aa,column:jt,length:o,return:""}}function wn(e,t){return gm(ia("",null,null,"",null,null,0),e,{length:-e.length},t)}function bm(){return fe}function Em(){return fe=xe>0?pe(Vt,--xe):0,jt--,fe===10&&(jt=1,aa--),fe}function Ue(){return fe=xe<Jc?pe(Vt,xe++):0,jt++,fe===10&&(jt=1,aa++),fe}function We(){return pe(Vt,xe)}function $r(){return xe}function Rn(e,t){return An(Vt,e,t)}function Sn(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 Fc(e){return aa=jt=1,Jc=$e(Vt=e),xe=0,[]}function Hc(e){return Vt="",e}function Wr(e){return Gc(Rn(xe-1,ho(e===91?e+2:e===40?e+1:e)))}function Im(e){for(;(fe=We())&&fe<33;)Ue();return Sn(e)>2||Sn(fe)>3?"":" "}function Am(e,t){for(;--t&&Ue()&&!(fe<48||fe>102||fe>57&&fe<65||fe>70&&fe<97););return Rn(e,$r()+(t<6&&We()==32&&Ue()==32))}function ho(e){for(;Ue();)switch(fe){case e:return xe;case 34:case 39:e!==34&&e!==39&&ho(fe);break;case 40:e===41&&ho(e);break;case 92:Ue();break}return xe}function Sm(e,t){for(;Ue()&&e+fe!==57&&!(e+fe===84&&We()===47););return"/*"+Rn(t,xe-1)+"*"+ra(e===47?e:Ue())}function Cm(e){for(;!Sn(We());)Ue();return Rn(e,xe)}function Rm(e){return Hc(Kr("",null,null,null,[""],e=Fc(e),0,[0],e))}function Kr(e,t,n,r,a,i,o,s,l){for(var d=0,_=0,h=o,p=0,f=0,w=0,A=1,C=1,b=1,x=0,D="",H=a,j=i,R=r,N=D;C;)switch(w=x,x=Ue()){case 40:if(w!=108&&pe(N,h-1)==58){fo(N+=$(Wr(x),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:N+=Wr(x);break;case 9:case 10:case 13:case 32:N+=Im(w);break;case 92:N+=Am($r()-1,7);continue;case 47:switch(We()){case 42:case 47:jr(Om(Sm(Ue(),$r()),t,n),l);break;default:N+="/"}break;case 123*A:s[d++]=$e(N)*b;case 125*A:case 59:case 0:switch(x){case 0:case 125:C=0;case 59+_:b==-1&&(N=$(N,/\f/g,"")),f>0&&$e(N)-h&&jr(f>32?fc(N+";",r,n,h-1):fc($(N," ","")+";",r,n,h-2),l);break;case 59:N+=";";default:if(jr(R=dc(N,t,n,d,_,a,s,D,H=[],j=[],h),i),x===123)if(_===0)Kr(N,t,R,R,H,i,h,s,j);else switch(p===99&&pe(N,3)===110?100:p){case 100:case 108:case 109:case 115:Kr(e,R,R,r&&jr(dc(e,R,R,0,0,a,s,D,a,H=[],h),j),a,j,h,s,r?H:j);break;default:Kr(N,R,R,R,[""],j,0,s,j)}}d=_=f=0,A=b=1,D=N="",h=o;break;case 58:h=1+$e(N),f=w;default:if(A<1){if(x==123)--A;else if(x==125&&A++==0&&Em()==125)continue}switch(N+=ra(x),x*A){case 38:b=_>0?1:(N+="\f",-1);break;case 44:s[d++]=($e(N)-1)*b,b=1;break;case 64:We()===45&&(N+=Wr(Ue())),p=We(),_=h=$e(D=N+=Cm($r())),x++;break;case 45:w===45&&$e(N)==2&&(A=0)}}return i}function dc(e,t,n,r,a,i,o,s,l,d,_){for(var h=a-1,p=a===0?i:[""],f=Oo(p),w=0,A=0,C=0;w<r;++w)for(var b=0,x=An(e,h+1,h=vm(A=o[w])),D=e;b<f;++b)(D=Gc(A>0?p[b]+" "+x:$(x,/&\f/g,p[b])))&&(l[C++]=D);return ia(e,t,n,a===0?Co:s,l,d,_)}function Om(e,t,n){return ia(e,t,n,Bc,ra(bm()),An(e,2,-2),0)}function fc(e,t,n,r){return ia(e,t,n,Ro,An(e,0,r),An(e,r+1,-1),r)}function qt(e,t){for(var n="",r=Oo(e),a=0;a<r;a++)n+=t(e[a],a,e,t)||"";return n}function km(e,t,n,r){switch(e.type){case pm:if(e.children.length)break;case mm:case Ro:return e.return=e.return||e.value;case Bc:return"";case Mc:return e.return=e.value+"{"+qt(e.children,r)+"}";case Co:e.value=e.props.join(",")}return $e(n=qt(e.children,r))?e.return=e.value+"{"+n+"}":""}function Tm(e){var t=Oo(e);return function(n,r,a,i){for(var o="",s=0;s<t;s++)o+=e[s](n,r,a,i)||"";return o}}function xm(e){return function(t){t.root||(t=t.return)&&e(t)}}function Pm(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Lm=function(e,t,n){for(var r=0,a=0;r=a,a=We(),r===38&&a===12&&(t[n]=1),!Sn(a);)Ue();return Rn(e,xe)},Dm=function(e,t){var n=-1,r=44;do switch(Sn(r)){case 0:r===38&&We()===12&&(t[n]=1),e[n]+=Lm(xe-1,t,n);break;case 2:e[n]+=Wr(r);break;case 4:if(r===44){e[++n]=We()===58?"&\f":"",t[n]=e[n].length;break}default:e[n]+=ra(r)}while(r=Ue());return e},Nm=function(e,t){return Hc(Dm(Fc(e),t))},hc=new WeakMap,Um=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!hc.get(n))&&!r){hc.set(e,!0);for(var a=[],i=Nm(t,a),o=n.props,s=0,l=0;s<i.length;s++)for(var d=0;d<o.length;d++,l++)e.props[l]=a[s]?i[s].replace(/&\f/g,o[d]):o[d]+" "+i[s]}}},Bm=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function qc(e,t){switch(_m(e,t)){case 5103:return V+"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 V+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return V+e+Qr+e+we+e+e;case 6828:case 4268:return V+e+we+e+e;case 6165:return V+e+we+"flex-"+e+e;case 5187:return V+e+$(e,/(\w+).+(:[^]+)/,V+"box-$1$2"+we+"flex-$1$2")+e;case 5443:return V+e+we+"flex-item-"+$(e,/flex-|-self/,"")+e;case 4675:return V+e+we+"flex-line-pack"+$(e,/align-content|flex-|-self/,"")+e;case 5548:return V+e+we+$(e,"shrink","negative")+e;case 5292:return V+e+we+$(e,"basis","preferred-size")+e;case 6060:return V+"box-"+$(e,"-grow","")+V+e+we+$(e,"grow","positive")+e;case 4554:return V+$(e,/([^-])(transform)/g,"$1"+V+"$2")+e;case 6187:return $($($(e,/(zoom-|grab)/,V+"$1"),/(image-set)/,V+"$1"),e,"")+e;case 5495:case 3959:return $(e,/(image-set\([^]*)/,V+"$1$`$1");case 4968:return $($(e,/(.+:)(flex-)?(.*)/,V+"box-pack:$3"+we+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+V+e+e;case 4095:case 3583:case 4068:case 2532:return $(e,/(.+)-inline(.+)/,V+"$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($e(e)-1-t>6)switch(pe(e,t+1)){case 109:if(pe(e,t+4)!==45)break;case 102:return $(e,/(.+:)(.+)-([^]+)/,"$1"+V+"$2-$3$1"+Qr+(pe(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~fo(e,"stretch")?qc($(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(pe(e,t+1)!==115)break;case 6444:switch(pe(e,$e(e)-3-(~fo(e,"!important")&&10))){case 107:return $(e,":",":"+V)+e;case 101:return $(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+V+(pe(e,14)===45?"inline-":"")+"box$3$1"+V+"$2$3$1"+we+"$2box$3")+e}break;case 5936:switch(pe(e,t+11)){case 114:return V+e+we+$(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return V+e+we+$(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return V+e+we+$(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return V+e+we+e+e}return e}var Mm=function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Ro:e.return=qc(e.value,e.length);break;case Mc:return qt([wn(e,{value:$(e.value,"@","@"+V)})],r);case Co:if(e.length)return wm(e.props,function(a){switch(ym(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return qt([wn(e,{props:[$(a,/:(read-\w+)/,":"+Qr+"$1")]})],r);case"::placeholder":return qt([wn(e,{props:[$(a,/:(plac\w+)/,":"+V+"input-$1")]}),wn(e,{props:[$(a,/:(plac\w+)/,":"+Qr+"$1")]}),wn(e,{props:[$(a,/:(plac\w+)/,we+"input-$1")]})],r)}return""})}},Gm=[Mm],Jm=function(e){var t=e.key;if(t==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(w){var A=w.getAttribute("data-emotion");A.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var r=e.stylisPlugins||Gm,a={},i,o=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(w){for(var A=w.getAttribute("data-emotion").split(" "),C=1;C<A.length;C++)a[A[C]]=!0;o.push(w)});var s,l=[Um,Bm];{var d,_=[km,xm(function(w){d.insert(w)})],h=Tm(l.concat(r,_)),p=function(w){return qt(Rm(w),h)};s=function(w,A,C,b){d=C,p(w?w+"{"+A.styles+"}":A.styles),b&&(f.inserted[A.name]=!0)}}var f={key:t,sheet:new hm({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:s};return f.sheet.hydrate(o),f};function Fm(e){for(var t=0,n,r=0,a=e.length;a>=4;++r,a-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&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 Hm={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},qm=/[A-Z]|^ms/g,jm=/_EMO_([^_]+?)_([^]*?)_EMO_/g,jc=function(e){return e.charCodeAt(1)===45},mc=function(e){return e!=null&&typeof e!="boolean"},Qi=Pm(function(e){return jc(e)?e:e.replace(qm,"-$&").toLowerCase()}),pc=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(jm,function(n,r,a){return ht={name:r,styles:a,next:ht},r})}return Hm[e]!==1&&!jc(e)&&typeof t=="number"&&t!==0?t+"px":t};function Zr(e,t,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 ht={name:a.name,styles:a.styles,next:ht},a.name;var i=n;if(i.styles!==void 0){var o=i.next;if(o!==void 0)for(;o!==void 0;)ht={name:o.name,styles:o.styles,next:ht},o=o.next;var s=i.styles+";";return s}return Vm(e,t,n)}}var l=n;if(t==null)return l;var d=t[l];return d!==void 0?d:l}function Vm(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a<n.length;a++)r+=Zr(e,t,n[a])+";";else for(var i in n){var o=n[i];if(typeof o!="object"){var s=o;t!=null&&t[s]!==void 0?r+=i+"{"+t[s]+"}":mc(s)&&(r+=Qi(i)+":"+pc(i,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++)mc(o[l])&&(r+=Qi(i)+":"+pc(i,o[l])+";");else{var d=Zr(e,t,o);switch(i){case"animation":case"animationName":{r+=Qi(i)+":"+d+";";break}default:r+=i+"{"+d+"}"}}}return r}var vc=/label:\s*([^\s;{]+)\s*(;|$)/g,ht;function Zi(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,a="";ht=void 0;var i=e[0];if(i==null||i.raw===void 0)r=!1,a+=Zr(n,t,i);else{var o=i;a+=o[0]}for(var s=1;s<e.length;s++)if(a+=Zr(n,t,e[s]),r){var l=i;a+=l[s]}vc.lastIndex=0;for(var d="",_;(_=vc.exec(a))!==null;)d+="-"+_[1];var h=Fm(a)+d;return{name:h,styles:a,next:ht}}function Vc(e,t,n){var r="";return n.split(" ").forEach(function(a){e[a]!==void 0?t.push(e[a]+";"):a&&(r+=a+" ")}),r}var $m=function(e,t,n){var r=e.key+"-"+t.name;e.registered[r]===void 0&&(e.registered[r]=t.styles)},Wm=function(e,t,n){$m(e,t);var r=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var a=t;do e.insert(t===a?"."+r:"",a,e.sheet,!0),a=a.next;while(a!==void 0)}};function gc(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function _c(e,t,n){var r=[],a=Vc(e,r,n);return r.length<2?n:a+t(r)}var Km=function(e){var t=Jm(e);t.sheet.speedy=function(o){this.isSpeedy=o},t.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=Zi(s,t.registered,void 0);return Wm(t,d),t.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=Zi(s,t.registered),_="animation-"+d.name;return gc(t,{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=Zi(s,t.registered);gc(t,d)},i=function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return _c(t.registered,n,zm(s))};return{css:n,cx:i,injectGlobal:a,keyframes:r,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:Vc.bind(null,t.registered),merge:_c.bind(null,t.registered,n)}},zm=function e(t){for(var n="",r=0;r<t.length;r++){var a=t[r];if(a!=null){var i=void 0;switch(typeof a){case"boolean":break;case"object":{if(Array.isArray(a))i=e(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},Xm=Km({key:"css"}),$t=Xm.css,mo,Ne,eo,yc,wc=0,$c=[],he=M,bc=he.__b,Ec=he.__r,Ic=he.diffed,Ac=he.__c,Sc=he.unmount,Cc=he.__;function Ym(e,t){he.__h&&he.__h(Ne,e,wc||t),wc=0;var n=Ne.__H||(Ne.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Wc(e,t){var n=Ym(mo++,7);return ep(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Qm(){for(var e;e=$c.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(zr),e.__H.__h.forEach(po),e.__H.__h=[]}catch(t){e.__H.__h=[],he.__e(t,e.__v)}}he.__b=function(e){Ne=null,bc&&bc(e)},he.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Cc&&Cc(e,t)},he.__r=function(e){Ec&&Ec(e),mo=0;var t=(Ne=e.__c).__H;t&&(eo===Ne?(t.__h=[],Ne.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(zr),t.__h.forEach(po),t.__h=[],mo=0)),eo=Ne},he.diffed=function(e){Ic&&Ic(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&($c.push(t)!==1&&yc===he.requestAnimationFrame||((yc=he.requestAnimationFrame)||Zm)(Qm)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),eo=Ne=null},he.__c=function(e,t){t.some(function(n){try{n.__h.forEach(zr),n.__h=n.__h.filter(function(r){return!r.__||po(r)})}catch(r){t.some(function(a){a.__h&&(a.__h=[])}),t=[],he.__e(r,n.__v)}}),Ac&&Ac(e,t)},he.unmount=function(e){Sc&&Sc(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{zr(r)}catch(a){t=a}}),n.__H=void 0,t&&he.__e(t,n.__v))};var Rc=typeof requestAnimationFrame=="function";function Zm(e){var t,n=function(){clearTimeout(r),Rc&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Rc&&(t=requestAnimationFrame(n))}function zr(e){var t=Ne,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Ne=t}function po(e){var t=Ne;e.__c=e.__(),Ne=t}function ep(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}var tp=Symbol.for("preact-signals");function oa(){if(mt>1)mt--;else{for(var e,t=!1;bn!==void 0;){var n=bn;for(bn=void 0,vo++;n!==void 0;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&zc(n))try{n.c()}catch(a){t||(e=a,t=!0)}n=r}}if(vo=0,mt--,t)throw e}}function Te(e){if(mt>0)return e();mt++;try{return e()}finally{oa()}}var Q=void 0,bn=void 0,mt=0,vo=0,ea=0;function Kc(e){if(Q!==void 0){var t=e.n;if(t===void 0||t.t!==Q)return t={i:0,S:e,p:Q.s,n:void 0,t:Q,e:void 0,x:void 0,r:t},Q.s!==void 0&&(Q.s.n=t),Q.s=t,e.n=t,32&Q.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=Q.s,t.n=void 0,Q.s.n=t,Q.s=t),t}}function ve(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}ve.prototype.brand=tp;ve.prototype.h=function(){return!0};ve.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)};ve.prototype.U=function(e){if(this.t!==void 0){var t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}};ve.prototype.subscribe=function(e){var t=this;return kn(function(){var n=t.value,r=Q;Q=void 0;try{e(n)}finally{Q=r}})};ve.prototype.valueOf=function(){return this.value};ve.prototype.toString=function(){return this.value+""};ve.prototype.toJSON=function(){return this.value};ve.prototype.peek=function(){var e=Q;Q=void 0;try{return this.value}finally{Q=e}};Object.defineProperty(ve.prototype,"value",{get:function(){var e=Kc(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(vo>100)throw new Error("Cycle detected");this.v=e,this.i++,ea++,mt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{oa()}}}});function Z(e){return new ve(e)}function zc(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 Xc(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Yc(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function Wt(e){ve.call(this,void 0),this.x=e,this.s=void 0,this.g=ea-1,this.f=4}(Wt.prototype=new ve).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ea))return!0;if(this.g=ea,this.f|=1,this.i>0&&!zc(this))return this.f&=-2,!0;var e=Q;try{Xc(this),Q=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return Q=e,Yc(this),this.f&=-2,!0};Wt.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)}ve.prototype.S.call(this,e)};Wt.prototype.U=function(e){if(this.t!==void 0&&(ve.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)}};Wt.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(Wt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Kc(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function En(e){return new Wt(e)}function Qc(e){var t=e.u;if(e.u=void 0,typeof t=="function"){mt++;var n=Q;Q=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,ko(e),r}finally{Q=n,oa()}}}function ko(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Qc(e)}function np(e){if(Q!==this)throw new Error("Out-of-order effect");Yc(this),Q=e,this.f&=-2,8&this.f&&ko(this),oa()}function On(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}On.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()}};On.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Qc(this),Xc(this),mt++;var e=Q;return Q=this,np.bind(this,e)};On.prototype.N=function(){2&this.f||(this.f|=2,this.o=bn,bn=this)};On.prototype.d=function(){this.f|=8,1&this.f||ko(this)};function kn(e){var t=new On(e);try{t.c()}catch(n){throw t.d(),n}return t.d.bind(t)}var Zc,to,eu=[];kn(function(){Zc=this.N})();function Kt(e,t){M[e]=t.bind(null,M[e]||function(){})}function ta(e){to&&to(),to=e&&e.S()}function tu(e){var t=this,n=e.data,r=nu(n);r.value=n;var a=Wc(function(){for(var s=t,l=t.__v;l=l.__;)if(l.__c){l.__c.__$f|=4;break}var d=En(function(){var f=r.value.value;return f===0?0:f===!0?"":f||""}),_=En(function(){return!Array.isArray(d.value)&&!Mi(d.value)}),h=kn(function(){if(this.N=ru,_.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),p=t.__$u.d;return t.__$u.d=function(){h(),p.call(this)},[_,d]},[]),i=a[0],o=a[1];return i.value?o.peek():o.value}tu.displayName="_st";Object.defineProperties(ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:tu},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Kt("__b",function(e,t){if(typeof t.type=="string"){var n,r=t.props;for(var a in r)if(a!=="children"){var i=r[a];i instanceof ve&&(n||(t.__np=n={}),n[a]=i,r[a]=i.peek())}}e(t)});Kt("__r",function(e,t){ta();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(a){var i;return kn(function(){i=this}),i.c=function(){r.__$f|=1,r.setState({})},i}())),ta(n),e(t)});Kt("__e",function(e,t,n,r){ta(),e(t,n,r)});Kt("diffed",function(e,t){ta();var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,a=t.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=rp(n,l,_,a),i[l]=d):d.o(_,a)}}}e(t)});function rp(e,t,n,r){var a=t in e&&e.ownerSVGElement===void 0,i=Z(n);return{o:function(o,s){i.value=o,r=s},d:kn(function(){this.N=ru;var o=i.value.value;r[t]!==o&&(r[t]=o,a?e[t]=o:o?e.setAttribute(t,o):e.removeAttribute(t))})}}Kt("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__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=t.__c;if(o){var s=o.__$u;s&&(o.__$u=void 0,s.d())}}e(t)});Kt("__h",function(e,t,n,r){(r<3||r===9)&&(t.__$f|=2),e(t,n,r)});De.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u,r=n&&n.s!==void 0;for(var a in t)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 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 nu(e){return Wc(function(){return Z(e)},[])}var ap=function(e){queueMicrotask(function(){queueMicrotask(e)})};function ip(){Te(function(){for(var e;e=eu.shift();)Zc.call(e)})}function ru(){eu.push(this)===1&&(M.requestAnimationFrame||ap)(ip)}var be=$t`
3
+ `);throw e.errors.length=0,ai(!1),new TypeError(r)}}var J,ci=ee(()=>{"use strict";si();si();J={object(e){return new or(e)},array(e){return new ar(e)},tuple(...e){return new cr(...e)},literal(e){return new sr(e)},or(...e){return new lr(...e)},symbol(){return new Zn},record(e){return new ir(e)},function(){return new nr},boolean(){return new Yn},string(){return new Qn},number(){return new Xn},undefined(){return new er},null(){return new tr},unknown(){return new Dt},any(){return new Dt},as(){return new Dt},arraybuffer(){return new ur},enum(...e){return new rr(...e)},typedarray(e){return new dr(e)}}});var fr,Ys,Qs=ee(()=>{"use strict";G();Xe();ci();Ya();fr=1,Ys=e=>{function t(r,a){return(...i)=>{var h,p,f,w;let o=Date.now(),s={method:r,trace_id:fr};fr+=1;let l="SUCCESS",d=`${r}:ok`,_=0;try{if(a.paramsSchema)try{li(a.paramsSchema,i,"params")}catch(x){throw Xa(`${r}:fail ${x.message}`)}let A=a.implement(...i),C=A,b=`${r}:ok`;if(A&&"code"in A){let{code:x,data:D,message:H}=A;l=x,C=D,b=H}return{code:l,message:b,data:C}}catch(A){let C=A;_=(p=(h=C.code)!=null?h:C.errNo)!=null?p:2e3,l="FAILURE";let b=(w=(f=C.message)!=null?f:C.errMsg)!=null?w:`${A}`;return d=`${r}:${l} ${b.replace(/^\S+:(fail|cancel)\s?/,"")}`,Le(new Hn(d,_)),{code:l,message:d}}finally{let A=Date.now()-o}}}function n(r,a){return(...i)=>I(this,null,function*(){var p,f,w,A;let o=ms(i)?i:[i],s=Date.now(),l={method:r,trace_id:fr};fr+=1;let d=`${r}:ok`,_="SUCCESS",h={code:_,message:d};try{if(a.paramsSchema)try{li(a.paramsSchema,o,"params")}catch(x){throw Xa(x.message)}let b=yield a.implement(...o);if(b&&"code"in b){let{code:x,data:D,message:H}=b;_=x,d=H,b=D}return Object.assign(h,{code:_,message:d,data:b}),h}catch(C){let b=C,x=(f=(p=b.code)!=null?p:b.errNo)!=null?f:2e3;_="FAILURE";let D=(A=(w=b.message)!=null?w:b.errMsg)!=null?A:`${C}`,H=`${r}:${_} ${D.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(h,{code:_,message:H}),Le(new Hn(H,x)),h}finally{let C=Date.now()-s}})}return{createAPI:n,createSyncAPI:t}}});var et,wt,_e,sn=ee(()=>{"use strict";zs();dt();Qs();ci();({createAPI:et,createSyncAPI:wt}=Ys(Se)),_e=Ks("h5")});var nl=Sa((tl,hi)=>{(function(e){if(typeof tl=="object"&&typeof hi!="undefined")hi.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,n;return function r(a,i,o){function s(_,h){if(!i[_]){if(!a[_]){var p=typeof tn=="function"&&tn;if(!h&&p)return p(_,!0);if(l)return l(_,!0);var f=new Error("Cannot find module '"+_+"'");throw f.code="MODULE_NOT_FOUND",f}var w=i[_]={exports:{}};a[_][0].call(w.exports,function(A){var C=a[_][1][A];return s(C||A)},w,w.exports,r,a,i,o)}return i[_].exports}for(var l=typeof tn=="function"&&tn,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(A),h=o.document.createTextNode("");_.observe(h,{characterData:!0}),l=function(){h.data=d=++d%2}}else if(!o.setImmediate&&typeof o.MessageChannel!="undefined"){var p=new o.MessageChannel;p.port1.onmessage=A,l=function(){p.port2.postMessage(0)}}else"document"in o&&"onreadystatechange"in o.document.createElement("script")?l=function(){var b=o.document.createElement("script");b.onreadystatechange=function(){A(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},o.document.documentElement.appendChild(b)}:l=function(){setTimeout(A,0)};var f,w=[];function A(){f=!0;for(var b,x,D=w.length;D;){for(x=w,w=[],b=-1;++b<D;)x[b]();D=w.length}f=!1}a.exports=C;function C(b){w.push(b)===1&&!f&&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"],h=["PENDING"];a.exports=p;function p(R){if(typeof R!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,R!==s&&C(this,R)}p.prototype.catch=function(R){return this.then(null,R)},p.prototype.then=function(R,N){if(typeof R!="function"&&this.state===_||typeof N!="function"&&this.state===d)return this;var T=new this.constructor(s);if(this.state!==h){var B=this.state===_?R:N;w(T,B,this.outcome)}else this.queue.push(new f(T,R,N));return T};function f(R,N,T){this.promise=R,typeof N=="function"&&(this.onFulfilled=N,this.callFulfilled=this.otherCallFulfilled),typeof T=="function"&&(this.onRejected=T,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(R){l.resolve(this.promise,R)},f.prototype.otherCallFulfilled=function(R){w(this.promise,this.onFulfilled,R)},f.prototype.callRejected=function(R){l.reject(this.promise,R)},f.prototype.otherCallRejected=function(R){w(this.promise,this.onRejected,R)};function w(R,N,T){o(function(){var B;try{B=N(T)}catch(K){return l.reject(R,K)}B===R?l.reject(R,new TypeError("Cannot resolve promise with itself")):l.resolve(R,B)})}l.resolve=function(R,N){var T=b(A,N);if(T.status==="error")return l.reject(R,T.value);var B=T.value;if(B)C(R,B);else{R.state=_,R.outcome=N;for(var K=-1,z=R.queue.length;++K<z;)R.queue[K].callFulfilled(N)}return R},l.reject=function(R,N){R.state=d,R.outcome=N;for(var T=-1,B=R.queue.length;++T<B;)R.queue[T].callRejected(N);return R};function A(R){var N=R&&R.then;if(R&&(typeof R=="object"||typeof R=="function")&&typeof N=="function")return function(){N.apply(R,arguments)}}function C(R,N){var T=!1;function B(me){T||(T=!0,l.reject(R,me))}function K(me){T||(T=!0,l.resolve(R,me))}function z(){N(K,B)}var te=b(z);te.status==="error"&&B(te.value)}function b(R,N){var T={};try{T.value=R(N),T.status="success"}catch(B){T.status="error",T.value=B}return T}p.resolve=x;function x(R){return R instanceof this?R:l.resolve(new this(s),R)}p.reject=D;function D(R){var N=new this(s);return l.reject(N,R)}p.all=H;function H(R){var N=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=R.length,B=!1;if(!T)return this.resolve([]);for(var K=new Array(T),z=0,te=-1,me=new this(s);++te<T;)Ke(R[te],te);return me;function Ke(Qt,Nn){N.resolve(Qt).then(ha,function(Ot){B||(B=!0,l.reject(me,Ot))});function ha(Ot){K[Nn]=Ot,++z===T&&!B&&(B=!0,l.resolve(me,K))}}}p.race=j;function j(R){var N=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=R.length,B=!1;if(!T)return this.resolve([]);for(var K=-1,z=new this(s);++K<T;)te(R[K]);return z;function te(me){N.resolve(me).then(function(Ke){B||(B=!0,l.resolve(z,Ke))},function(Ke){B||(B=!0,l.reject(z,Ke))})}}},{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 h(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 f(c,m){m&&c.then(function(u){m(null,u)},function(u){m(u)})}function w(c,m,u){typeof m=="function"&&c.then(m),typeof u=="function"&&c.catch(u)}function A(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 b="local-forage-detect-blob-support",x=void 0,D={},H=Object.prototype.toString,j="readonly",R="readwrite";function N(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 T(c){return new p(function(m){var u=c.transaction(b,R),g=h([""]);u.objectStore(b).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 B(c){return typeof x=="boolean"?p.resolve(x):T(c).then(function(m){return x=m,x})}function K(c){var m=D[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 z(c){var m=D[c.name],u=m.deferredOperations.pop();if(u)return u.resolve(),u.promise}function te(c,m){var u=D[c.name],g=u.deferredOperations.pop();if(g)return g.reject(m),g.promise}function me(c,m){return new p(function(u,g){if(D[c.name]=D[c.name]||Uo(),c.db)if(m)K(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(E){var S=v.result;try{S.createObjectStore(c.storeName),E.oldVersion<=1&&S.createObjectStore(b)}catch(O){if(O.name==="ConstraintError")console.warn('The database "'+c.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+c.storeName+'" already exists.');else throw O}}),v.onerror=function(E){E.preventDefault(),g(v.error)},v.onsuccess=function(){var E=v.result;E.onversionchange=function(S){S.target.close()},u(E),z(c)}})}function Ke(c){return me(c,!1)}function Qt(c){return me(c,!0)}function Nn(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 ha(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 Ot(c){var m=N(atob(c.data));return h([m],{type:c.type})}function No(c){return c&&c.__local_forage_encoded_blob}function Ru(c){var m=this,u=m._initReady().then(function(){var g=D[m._dbInfo.name];if(g&&g.dbReady)return g.dbReady});return w(u,c,c),u}function Ou(c){K(c);for(var m=D[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,Ke(c).then(function(v){return c.db=v,Nn(c)?Qt(c):v}).then(function(v){c.db=m.db=v;for(var E=0;E<u.length;E++)u[E]._dbInfo.db=v}).catch(function(v){throw te(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),Qt(c)}).then(function(){return Ou(c).then(function(){ze(c,m,u,g-1)})}).catch(u);u(v)}}function Uo(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function ku(c){var m=this,u={db:null};if(c)for(var g in c)u[g]=c[g];var y=D[u.name];y||(y=Uo(),D[u.name]=y),y.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=Ru);var v=[];function E(){return p.resolve()}for(var S=0;S<y.forages.length;S++){var O=y.forages[S];O!==m&&v.push(O._initReady().catch(E))}var k=y.forages.slice(0);return p.all(v).then(function(){return u.db=y.db,Ke(u)}).then(function(P){return u.db=P,Nn(u,m._defaultConfig.version)?Qt(u):P}).then(function(P){u.db=y.db=P,m._dbInfo=u;for(var U=0;U<k.length;U++){var F=k[U];F!==m&&(F._dbInfo.db=u.db,F._dbInfo.version=u.version)}})}function Tu(c,m){var u=this;c=A(c);var g=new p(function(y,v){u.ready().then(function(){ze(u._dbInfo,j,function(E,S){if(E)return v(E);try{var O=S.objectStore(u._dbInfo.storeName),k=O.get(c);k.onsuccess=function(){var P=k.result;P===void 0&&(P=null),No(P)&&(P=Ot(P)),y(P)},k.onerror=function(){v(k.error)}}catch(P){v(P)}})}).catch(v)});return f(g,m),g}function xu(c,m){var u=this,g=new p(function(y,v){u.ready().then(function(){ze(u._dbInfo,j,function(E,S){if(E)return v(E);try{var O=S.objectStore(u._dbInfo.storeName),k=O.openCursor(),P=1;k.onsuccess=function(){var U=k.result;if(U){var F=U.value;No(F)&&(F=Ot(F));var W=c(F,U.key,P++);W!==void 0?y(W):U.continue()}else y()},k.onerror=function(){v(k.error)}}catch(U){v(U)}})}).catch(v)});return f(g,m),g}function Pu(c,m,u){var g=this;c=A(c);var y=new p(function(v,E){var S;g.ready().then(function(){return S=g._dbInfo,H.call(m)==="[object Blob]"?B(S.db).then(function(O){return O?m:ha(m)}):m}).then(function(O){ze(g._dbInfo,R,function(k,P){if(k)return E(k);try{var U=P.objectStore(g._dbInfo.storeName);O===null&&(O=void 0);var F=U.put(O,c);P.oncomplete=function(){O===void 0&&(O=null),v(O)},P.onabort=P.onerror=function(){var W=F.error?F.error:F.transaction.error;E(W)}}catch(W){E(W)}})}).catch(E)});return f(y,u),y}function Lu(c,m){var u=this;c=A(c);var g=new p(function(y,v){u.ready().then(function(){ze(u._dbInfo,R,function(E,S){if(E)return v(E);try{var O=S.objectStore(u._dbInfo.storeName),k=O.delete(c);S.oncomplete=function(){y()},S.onerror=function(){v(k.error)},S.onabort=function(){var P=k.error?k.error:k.transaction.error;v(P)}}catch(P){v(P)}})}).catch(v)});return f(g,m),g}function Du(c){var m=this,u=new p(function(g,y){m.ready().then(function(){ze(m._dbInfo,R,function(v,E){if(v)return y(v);try{var S=E.objectStore(m._dbInfo.storeName),O=S.clear();E.oncomplete=function(){g()},E.onabort=E.onerror=function(){var k=O.error?O.error:O.transaction.error;y(k)}}catch(k){y(k)}})}).catch(y)});return f(u,c),u}function Nu(c){var m=this,u=new p(function(g,y){m.ready().then(function(){ze(m._dbInfo,j,function(v,E){if(v)return y(v);try{var S=E.objectStore(m._dbInfo.storeName),O=S.count();O.onsuccess=function(){g(O.result)},O.onerror=function(){y(O.error)}}catch(k){y(k)}})}).catch(y)});return f(u,c),u}function Uu(c,m){var u=this,g=new p(function(y,v){if(c<0){y(null);return}u.ready().then(function(){ze(u._dbInfo,j,function(E,S){if(E)return v(E);try{var O=S.objectStore(u._dbInfo.storeName),k=!1,P=O.openKeyCursor();P.onsuccess=function(){var U=P.result;if(!U){y(null);return}c===0||k?y(U.key):(k=!0,U.advance(c))},P.onerror=function(){v(P.error)}}catch(U){v(U)}})}).catch(v)});return f(g,m),g}function Bu(c){var m=this,u=new p(function(g,y){m.ready().then(function(){ze(m._dbInfo,j,function(v,E){if(v)return y(v);try{var S=E.objectStore(m._dbInfo.storeName),O=S.openKeyCursor(),k=[];O.onsuccess=function(){var P=O.result;if(!P){g(k);return}k.push(P.key),P.continue()},O.onerror=function(){y(O.error)}}catch(P){y(P)}})}).catch(y)});return f(u,c),u}function Mu(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,E=v?p.resolve(g._dbInfo.db):Ke(c).then(function(S){var O=D[c.name],k=O.forages;O.db=S;for(var P=0;P<k.length;P++)k[P]._dbInfo.db=S;return S});c.storeName?y=E.then(function(S){if(S.objectStoreNames.contains(c.storeName)){var O=S.version+1;K(c);var k=D[c.name],P=k.forages;S.close();for(var U=0;U<P.length;U++){var F=P[U];F._dbInfo.db=null,F._dbInfo.version=O}var W=new p(function(X,ce){var oe=d.open(c.name,O);oe.onerror=function(Be){var en=oe.result;en.close(),ce(Be)},oe.onupgradeneeded=function(){var Be=oe.result;Be.deleteObjectStore(c.storeName)},oe.onsuccess=function(){var Be=oe.result;Be.close(),X(Be)}});return W.then(function(X){k.db=X;for(var ce=0;ce<P.length;ce++){var oe=P[ce];oe._dbInfo.db=X,z(oe._dbInfo)}}).catch(function(X){throw(te(c,X)||p.resolve()).catch(function(){}),X})}}):y=E.then(function(S){K(c);var O=D[c.name],k=O.forages;S.close();for(var P=0;P<k.length;P++){var U=k[P];U._dbInfo.db=null}var F=new p(function(W,X){var ce=d.deleteDatabase(c.name);ce.onerror=function(){var oe=ce.result;oe&&oe.close(),X(ce.error)},ce.onblocked=function(){console.warn('dropInstance blocked for database "'+c.name+'" until all open connections are closed')},ce.onsuccess=function(){var oe=ce.result;oe&&oe.close(),W(oe)}});return F.then(function(W){O.db=W;for(var X=0;X<k.length;X++){var ce=k[X];z(ce._dbInfo)}}).catch(function(W){throw(te(c,W)||p.resolve()).catch(function(){}),W})})}return f(y,m),y}var Gu={_driver:"asyncStorage",_initStorage:ku,_support:_(),iterate:xu,getItem:Tu,setItem:Pu,removeItem:Lu,clear:Du,length:Nu,key:Uu,keys:Bu,dropInstance:Mu};function Ju(){return typeof openDatabase=="function"}var lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fu="~~local_forage_type~",Bo=/^~~local_forage_type~([^~]+)~/,Un="__lfsc__:",ma=Un.length,pa="arbf",va="blob",Mo="si08",Go="ui08",Jo="uic8",Fo="si16",Ho="si32",qo="ur16",jo="ui32",Vo="fl32",$o="fl64",Wo=ma+pa.length,Ko=Object.prototype.toString;function zo(c){var m=c.length*.75,u=c.length,g,y=0,v,E,S,O;c[c.length-1]==="="&&(m--,c[c.length-2]==="="&&m--);var k=new ArrayBuffer(m),P=new Uint8Array(k);for(g=0;g<u;g+=4)v=lt.indexOf(c[g]),E=lt.indexOf(c[g+1]),S=lt.indexOf(c[g+2]),O=lt.indexOf(c[g+3]),P[y++]=v<<2|E>>4,P[y++]=(E&15)<<4|S>>2,P[y++]=(S&3)<<6|O&63;return k}function ga(c){var m=new Uint8Array(c),u="",g;for(g=0;g<m.length;g+=3)u+=lt[m[g]>>2],u+=lt[(m[g]&3)<<4|m[g+1]>>4],u+=lt[(m[g+1]&15)<<2|m[g+2]>>6],u+=lt[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 Hu(c,m){var u="";if(c&&(u=Ko.call(c)),c&&(u==="[object ArrayBuffer]"||c.buffer&&Ko.call(c.buffer)==="[object ArrayBuffer]")){var g,y=Un;c instanceof ArrayBuffer?(g=c,y+=pa):(g=c.buffer,u==="[object Int8Array]"?y+=Mo:u==="[object Uint8Array]"?y+=Go:u==="[object Uint8ClampedArray]"?y+=Jo:u==="[object Int16Array]"?y+=Fo:u==="[object Uint16Array]"?y+=qo:u==="[object Int32Array]"?y+=Ho:u==="[object Uint32Array]"?y+=jo:u==="[object Float32Array]"?y+=Vo:u==="[object Float64Array]"?y+=$o:m(new Error("Failed to get type for BinaryArray"))),m(y+ga(g))}else if(u==="[object Blob]"){var v=new FileReader;v.onload=function(){var E=Fu+c.type+"~"+ga(this.result);m(Un+va+E)},v.readAsArrayBuffer(c)}else try{m(JSON.stringify(c))}catch(E){console.error("Couldn't convert value into a JSON string: ",c),m(null,E)}}function qu(c){if(c.substring(0,ma)!==Un)return JSON.parse(c);var m=c.substring(Wo),u=c.substring(ma,Wo),g;if(u===va&&Bo.test(m)){var y=m.match(Bo);g=y[1],m=m.substring(y[0].length)}var v=zo(m);switch(u){case pa:return v;case va:return h([v],{type:g});case Mo:return new Int8Array(v);case Go:return new Uint8Array(v);case Jo:return new Uint8ClampedArray(v);case Fo:return new Int16Array(v);case qo:return new Uint16Array(v);case Ho:return new Int32Array(v);case jo:return new Uint32Array(v);case Vo:return new Float32Array(v);case $o:return new Float64Array(v);default:throw new Error("Unkown type: "+u)}}var _a={serialize:Hu,deserialize:qu,stringToBuffer:zo,bufferToString:ga};function Xo(c,m,u,g){c.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],u,g)}function ju(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,E){try{u.db=openDatabase(u.name,String(u.version),u.description,u.size)}catch(S){return E(S)}u.db.transaction(function(S){Xo(S,u,function(){m._dbInfo=u,v()},function(O,k){E(k)})},E)});return u.serializer=_a,y}function ct(c,m,u,g,y,v){c.executeSql(u,g,y,function(E,S){S.code===S.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[m.storeName],function(O,k){k.rows.length?v(O,S):Xo(O,m,function(){O.executeSql(u,g,y,v)},v)},v):v(E,S)},v)}function Vu(c,m){var u=this;c=A(c);var g=new p(function(y,v){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(S){ct(S,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[c],function(O,k){var P=k.rows.length?k.rows.item(0).value:null;P&&(P=E.serializer.deserialize(P)),y(P)},function(O,k){v(k)})})}).catch(v)});return f(g,m),g}function $u(c,m){var u=this,g=new p(function(y,v){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(S){ct(S,E,"SELECT * FROM "+E.storeName,[],function(O,k){for(var P=k.rows,U=P.length,F=0;F<U;F++){var W=P.item(F),X=W.value;if(X&&(X=E.serializer.deserialize(X)),X=c(X,W.key,F+1),X!==void 0){y(X);return}}y()},function(O,k){v(k)})})}).catch(v)});return f(g,m),g}function Yo(c,m,u,g){var y=this;c=A(c);var v=new p(function(E,S){y.ready().then(function(){m===void 0&&(m=null);var O=m,k=y._dbInfo;k.serializer.serialize(m,function(P,U){U?S(U):k.db.transaction(function(F){ct(F,k,"INSERT OR REPLACE INTO "+k.storeName+" (key, value) VALUES (?, ?)",[c,P],function(){E(O)},function(W,X){S(X)})},function(F){if(F.code===F.QUOTA_ERR){if(g>0){E(Yo.apply(y,[c,O,u,g-1]));return}S(F)}})})}).catch(S)});return f(v,u),v}function Wu(c,m,u){return Yo.apply(this,[c,m,u,1])}function Ku(c,m){var u=this;c=A(c);var g=new p(function(y,v){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(S){ct(S,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[c],function(){y()},function(O,k){v(k)})})}).catch(v)});return f(g,m),g}function zu(c){var m=this,u=new p(function(g,y){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){ct(E,v,"DELETE FROM "+v.storeName,[],function(){g()},function(S,O){y(O)})})}).catch(y)});return f(u,c),u}function Xu(c){var m=this,u=new p(function(g,y){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){ct(E,v,"SELECT COUNT(key) as c FROM "+v.storeName,[],function(S,O){var k=O.rows.item(0).c;g(k)},function(S,O){y(O)})})}).catch(y)});return f(u,c),u}function Yu(c,m){var u=this,g=new p(function(y,v){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(S){ct(S,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[c+1],function(O,k){var P=k.rows.length?k.rows.item(0).key:null;y(P)},function(O,k){v(k)})})}).catch(v)});return f(g,m),g}function Qu(c){var m=this,u=new p(function(g,y){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){ct(E,v,"SELECT key FROM "+v.storeName,[],function(S,O){for(var k=[],P=0;P<O.rows.length;P++)k.push(O.rows.item(P).key);g(k)},function(S,O){y(O)})})}).catch(y)});return f(u,c),u}function Zu(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 E=[],S=0;S<v.rows.length;S++)E.push(v.rows.item(S).name);m({db:c,storeNames:E})},function(y,v){u(v)})},function(g){u(g)})})}function ed(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 E;c.name===u.name?E=g._dbInfo.db:E=openDatabase(c.name,"","",0),c.storeName?v({db:E,storeNames:[c.storeName]}):v(Zu(E))}).then(function(v){return new p(function(E,S){v.db.transaction(function(O){function k(W){return new p(function(X,ce){O.executeSql("DROP TABLE IF EXISTS "+W,[],function(){X()},function(oe,Be){ce(Be)})})}for(var P=[],U=0,F=v.storeNames.length;U<F;U++)P.push(k(v.storeNames[U]));p.all(P).then(function(){E()}).catch(function(W){S(W)})},function(O){S(O)})})}):y=p.reject("Invalid arguments"),f(y,m),y}var td={_driver:"webSQLStorage",_initStorage:ju,_support:Ju(),iterate:$u,getItem:Vu,setItem:Wu,removeItem:Ku,clear:zu,length:Xu,key:Yu,keys:Qu,dropInstance:ed};function nd(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(c){return!1}}function Qo(c,m){var u=c.name+"/";return c.storeName!==m.storeName&&(u+=c.storeName+"/"),u}function rd(){var c="_localforage_support_test";try{return localStorage.setItem(c,!0),localStorage.removeItem(c),!1}catch(m){return!0}}function ad(){return!rd()||localStorage.length>0}function id(c){var m=this,u={};if(c)for(var g in c)u[g]=c[g];return u.keyPrefix=Qo(c,m._defaultConfig),ad()?(m._dbInfo=u,u.serializer=_a,p.resolve()):p.reject()}function od(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 f(u,c),u}function sd(c,m){var u=this;c=A(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 f(g,m),g}function ld(c,m){var u=this,g=u.ready().then(function(){for(var y=u._dbInfo,v=y.keyPrefix,E=v.length,S=localStorage.length,O=1,k=0;k<S;k++){var P=localStorage.key(k);if(P.indexOf(v)===0){var U=localStorage.getItem(P);if(U&&(U=y.serializer.deserialize(U)),U=c(U,P.substring(E),O++),U!==void 0)return U}}});return f(g,m),g}function cd(c,m){var u=this,g=u.ready().then(function(){var y=u._dbInfo,v;try{v=localStorage.key(c)}catch(E){v=null}return v&&(v=v.substring(y.keyPrefix.length)),v});return f(g,m),g}function ud(c){var m=this,u=m.ready().then(function(){for(var g=m._dbInfo,y=localStorage.length,v=[],E=0;E<y;E++){var S=localStorage.key(E);S.indexOf(g.keyPrefix)===0&&v.push(S.substring(g.keyPrefix.length))}return v});return f(u,c),u}function dd(c){var m=this,u=m.keys().then(function(g){return g.length});return f(u,c),u}function fd(c,m){var u=this;c=A(c);var g=u.ready().then(function(){var y=u._dbInfo;localStorage.removeItem(y.keyPrefix+c)});return f(g,m),g}function hd(c,m,u){var g=this;c=A(c);var y=g.ready().then(function(){m===void 0&&(m=null);var v=m;return new p(function(E,S){var O=g._dbInfo;O.serializer.serialize(m,function(k,P){if(P)S(P);else try{localStorage.setItem(O.keyPrefix+c,k),E(v)}catch(U){(U.name==="QuotaExceededError"||U.name==="NS_ERROR_DOM_QUOTA_REACHED")&&S(U),S(U)}})})});return f(y,u),y}function md(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(Qo(c,g._defaultConfig)):v(c.name+"/")}).then(function(v){for(var E=localStorage.length-1;E>=0;E--){var S=localStorage.key(E);S.indexOf(v)===0&&localStorage.removeItem(S)}}):y=p.reject("Invalid arguments"),f(y,m),y}var pd={_driver:"localStorageWrapper",_initStorage:id,_support:nd(),iterate:ld,getItem:sd,setItem:hd,removeItem:fd,clear:od,length:dd,key:cd,keys:ud,dropInstance:md},vd=function(m,u){return m===u||typeof m=="number"&&typeof u=="number"&&isNaN(m)&&isNaN(u)},gd=function(m,u){for(var g=m.length,y=0;y<g;){if(vd(m[y],u))return!0;y++}return!1},Zo=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},Zt={},es={},kt={INDEXEDDB:Gu,WEBSQL:td,LOCALSTORAGE:pd},_d=[kt.INDEXEDDB._driver,kt.WEBSQL._driver,kt.LOCALSTORAGE._driver],Bn=["dropInstance"],ya=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Bn),yd={description:"",driver:_d.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function wd(c,m){c[m]=function(){var u=arguments;return c.ready().then(function(){return c[m].apply(c,u)})}}function wa(){for(var c=1;c<arguments.length;c++){var m=arguments[c];if(m)for(var u in m)m.hasOwnProperty(u)&&(Zo(m[u])?arguments[0][u]=m[u].slice():arguments[0][u]=m[u])}return arguments[0]}var bd=function(){function c(m){s(this,c);for(var u in kt)if(kt.hasOwnProperty(u)){var g=kt[u],y=g._driver;this[u]=y,Zt[y]||this.defineDriver(g)}this._defaultConfig=wa({},yd),this._config=wa({},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(E,S){try{var O=u._driver,k=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!u._driver){S(k);return}for(var P=ya.concat("_initStorage"),U=0,F=P.length;U<F;U++){var W=P[U],X=!gd(Bn,W);if((X||u[W])&&typeof u[W]!="function"){S(k);return}}var ce=function(){for(var en=function(Ad){return function(){var Sd=new Error("Method "+Ad+" is not implemented by the current driver"),ts=p.reject(Sd);return f(ts,arguments[arguments.length-1]),ts}},ba=0,Id=Bn.length;ba<Id;ba++){var Ea=Bn[ba];u[Ea]||(u[Ea]=en(Ea))}};ce();var oe=function(en){Zt[O]&&console.info("Redefining LocalForage driver: "+O),Zt[O]=u,es[O]=en,E()};"_support"in u?u._support&&typeof u._support=="function"?u._support().then(oe,S):oe(!!u._support):oe(!0)}catch(Be){S(Be)}});return w(v,g,y),v},c.prototype.driver=function(){return this._driver||null},c.prototype.getDriver=function(u,g,y){var v=Zt[u]?p.resolve(Zt[u]):p.reject(new Error("Driver not found."));return w(v,g,y),v},c.prototype.getSerializer=function(u){var g=p.resolve(_a);return w(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 w(y,u,u),y},c.prototype.setDriver=function(u,g,y){var v=this;Zo(u)||(u=[u]);var E=this._getSupportedDrivers(u);function S(){v._config.driver=v.driver()}function O(U){return v._extend(U),S(),v._ready=v._initStorage(v._config),v._ready}function k(U){return function(){var F=0;function W(){for(;F<U.length;){var X=U[F];return F++,v._dbInfo=null,v._ready=null,v.getDriver(X).then(O).catch(W)}S();var ce=new Error("No available storage method found.");return v._driverSet=p.reject(ce),v._driverSet}return W()}}var P=this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve();return this._driverSet=P.then(function(){var U=E[0];return v._dbInfo=null,v._ready=null,v.getDriver(U).then(function(F){v._driver=F._driver,S(),v._wrapLibraryMethodsWithReady(),v._initDriver=k(E)})}).catch(function(){S();var U=new Error("No available storage method found.");return v._driverSet=p.reject(U),v._driverSet}),w(this._driverSet,g,y),this._driverSet},c.prototype.supports=function(u){return!!es[u]},c.prototype._extend=function(u){wa(this,u)},c.prototype._getSupportedDrivers=function(u){for(var g=[],y=0,v=u.length;y<v;y++){var E=u[y];this.supports(E)&&g.push(E)}return g},c.prototype._wrapLibraryMethodsWithReady=function(){for(var u=0,g=ya.length;u<g;u++)wd(this,ya[u])},c.prototype.createInstance=function(u){return new c(u)},c}(),Ed=new bd;a.exports=Ed},{3:3}]},{},[4])(4)})});var al=Sa(gr=>{"use strict";G();sn();dt();var pi=(e,t)=>{window.parent&&window.parent.postMessage({type:e,data:t},"*")},vi=ge(),Vf=et("levelFinished",{paramsSchema:J.tuple(J.object({levelId:J.or(J.string(),J.number()),duration:J.number().optional(),rating:J.number().optional(),score:J.number().optional(),variation:J.string().optional()})),implement:e=>I(gr,null,function*(){let{levelId:t,duration:n,rating:r,score:a,variation:i}=e;Pe.info("onLevelFinished",n,r,a,i),pi("JOLIBOX_GAME_TASK_LEVEL_FINISHED",{levelId:t,duration:n,rating:r,score:a,variation:i}),yield Promise.all([Qe.reporter({event:"COMPLETE_GAME_LEVEL",extraParams:{inGameInfo:{levelId:t,duration:n,rating:r,score:a}}}),Qe.tracker("LevelFinished",{levelId:t,duration:n,rating:r,score:a,variation:i})])})}),$f=et("gamePlayEnded",{paramsSchema:J.tuple(J.object({duration:J.number().optional(),rating:J.number().optional(),score:J.number(),variation:J.string().optional()})),implement:e=>I(gr,null,function*(){let{duration:t,rating:n,score:r,variation:a}=e;Pe.info("onGamePlayEnded",t,n,r,a),pi("JOLIBOX_GAME_TASK_GAME_PLAY_ENDED",{duration:t,rating:n,score:r,variation:a}),yield Promise.all([Qe.tracker("GamePlayEnded",{duration:t,rating:n,score:r,variation:a}),Qe.reporter({event:"GAME_ENDED",extraParams:{inGameInfo:{duration:t,rating:n,score:r}}})])})}),Wf=et("levelUpgrade",{paramsSchema:J.tuple(J.object({levelId:J.or(J.string(),J.number()),name:J.string().optional()})),implement:n=>I(gr,[n],function*({levelId:e,name:t}){Pe.info("onLevelUpgrade",e,t),pi("JOLIBOX_GAME_TASK_LEVEL_UPGRADE",{levelId:e,name:t}),yield Promise.all([Qe.tracker("LevelUpgrade",{name:t,levelId:e}),Qe.reporter({event:"GAME_LEVEL_UP",extraParams:{inGameInfo:{levelId:e,levelName:t}}})])})});vi.registerCommand("TaskTrackerSDK.levelFinished",Vf);vi.registerCommand("TaskTrackerSDK.gamePlayEnded",$f);vi.registerCommand("TaskTrackerSDK.levelUpgrade",Wf);_e("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"}}});_e("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});_e("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var qe,Nt,il,gi,Kf,bt,_r=ee(()=>{"use strict";qe=(e,t)=>{var n;window.dispatchEvent(new CustomEvent(e,{detail:t})),(n=window.parent)==null||n.postMessage({type:e,data:{detail:t}},"*")},Nt=new Map,il=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let n=Nt.get(t.type);n&&n.forEach(r=>{try{r(t.data)}catch(a){console.warn("Callback execution failed:",a)}})}}catch(t){console.warn("Failed to parse message:",t)}},gi=!1,Kf=()=>{gi||(window.addEventListener("message",il),gi=!0)},bt=(e,t)=>{Kf(),Nt.has(e)||Nt.set(e,new Set);let n=Nt.get(e);return n.add(t),()=>{n.delete(t),n.size===0&&Nt.delete(e),Nt.size===0&&(window.removeEventListener("message",il),gi=!1)}}});var yr,wr,br,Er,Ir,_i,Ar,Sr,Cr,Rr,Ut,zf,Y,tt,nt,Ce=ee(()=>{"use strict";G();yr="UNLOCK_OPTIONS_CHANGED",wr="INVOKE_PAYMENT",br="ON_PAYMENT_RESULT",Er="ON_USE_MODAL_EVENT",Ir="ON_USE_MODAL_RESULT",_i="ON_USE_MODAL_FREQUENCY",Ar="ON_USE_UNLOGIN_MODAL_EVENT",Sr="INVOKE_UNLOGIN_MODAL_EVENT",Cr="INVOKE_SUBSCRIPTION_EVENT",Rr="ON_USE_SUBSCRIPTION_RESULT",Ut=new He,zf=()=>({on:Ut.on.bind(Ut),off:Ut.off.bind(Ut),emit:Ut.emit.bind(Ut)}),Y=zf(),tt={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}},nt={show:!0,minInterval:8*60*60*1e3}});var ou=Sa(sa=>{"use strict";ue();Ce();_r();G();var iu={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};bt("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",iu[e.result],e.result),Y.emit(Ir,{useModalResult:iu[e.result]})});Y.on(Er,(e,t)=>{var n;e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||qe("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.quantity,balance:t.userCurrency.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(n=t.sequenceId)!=null?n:Ge()})});bt("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{Y.emit(br,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin,currency:"JOLI_COIN"})});Y.on(wr,(e,t)=>I(sa,null,function*(){var n;e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||qe("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.quantity,balance:t.userCurrency.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(n=t.sequenceId)!=null?n:Ge()})}));bt("ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT",e=>{var t,n,r,a,i;Y.emit(Ar,{result:e.result=="ADS"?"FAILED":e.result,rewards:{claimedRewardValue:(a=(r=(n=(t=e.extra)==null?void 0:t.firstLogin)==null?void 0:n.reward)==null?void 0:r.rewardValue)!=null?a:0,isFirstLogin:(i=e.isFirstLogin)!=null?i:!1}}),e.result==="SUCCESS"&&L.onEnvConfigChanged({hostUserInfo:{isLogin:!0}})});Y.on(Sr,e=>I(sa,null,function*(){e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||qe("JOLIBOX_JOLI_UNLOGIN_MODAL_EVENT",{sequenceId:Ge(),type:e})}));bt("ON_JOLIBOX_SUB_RESULT_EVENT",e=>{console.log("----on custom event ON_JOLIBOX_SUB_RESULT_EVENT-----",e),Y.emit(Rr,{result:e.result})});Y.on(Cr,e=>I(sa,null,function*(){console.log("----notify custom event-----",e),qe("JOLIBOX_SUB_EVENT",{sequenceId:Ge()})}))});dt();ue();sn();G();var Zs=ge(),kf="env",Tf="getSystemInfoSync",xf=()=>{var a,i,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:(a=L.hostInfo)==null?void 0:a.appName,SDKVersion:L.sdkInfo.nativeSDKVersion},t=(i=L.hostInfo)==null?void 0:i.version;t&&(e=Ee(q({},e),{version:t}));let n=(o=L.hostInfo)==null?void 0:o.appName;n&&(e=Ee(q({},e),{appName:n}));let r=(s=L.sdkInfo)==null?void 0:s.jssdkVersion;return r&&(e=Ee(q({},e),{SDKVersion:r})),e},Pf=wt(Tf,{implement:xf}),Lf=wt(kf,{implement:()=>Ee(q({},L.hostInfo),{sdkInfo:L.sdkInfo,platform:L.platform,deviceInfo:L.deviceInfo})});Zs.registerCommand("API.env",Lf);Zs.registerCommand("API.getSystemInfoSync",Pf);_e("env",{version:"1.0.0"});_e("getSystemInfoSync",{version:"1.0.0"});G();sn();Xe();dt();var Df="onJoliboxShow",Nf="onJoliboxHide",Uf="onReady",di=ge(),fi=bs(Le),ui=!0,ln=!0,hr=0,mr=ri;function Bf(){let e=Date.now();if(e-hr<100)return;hr=e;let t=document.visibilityState==="visible";t!==ui&&(ui=t,mr.emit("visible",ui))}function el(e){let t=Date.now();t-hr<100||(hr=t,e==="focus"&&!ln?ln=!0:e==="blur"&&ln&&(ln=!1),mr.emit("visible",ln))}document.addEventListener("visibilitychange",Bf);window.addEventListener("focus",()=>el("focus"));window.addEventListener("blur",()=>el("blur"));var Mf=wt(Df,{paramsSchema:J.tuple(J.function()),implement(e){let t=fi(e);mr.on("visible",n=>{n&&t()})}}),Gf=wt(Nf,{paramsSchema:J.tuple(J.function()),implement(e){let t=fi(e);mr.on("visible",n=>{!n&&t()})}}),Jf=wt(Uf,{paramsSchema:J.tuple(J.function()),implement(e){let t=fi(e);ut.on("LifecycleEvent.onReady",n=>{t(n)})}});di.registerCommand("LifecycleSDK.onReady",Jf);di.registerCommand("LifecycleSDK.onJoliboxShow",Mf);di.registerCommand("LifecycleSDK.onJoliboxHide",Gf);_e("lifeCycle.onReady",{version:"1.0.0"});_e("lifeCycle.onJoliboxShow",{version:"1.0.0"});_e("lifeCycle.onJoliboxHide",{version:"1.0.0"});sn();G();Lt();ue();var rl=Ca(nl());var pr=ge(),mi=class{constructor(){this.httpClient=Je.create({baseUrl:Pt(L.testMode)});this.getGameId=()=>L.mpId;this.getItem=t=>I(this,null,function*(){let{code:n,data:r,message:a}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),i=r==null?void 0:r.value,o=a;return n!=="SUCCESS"&&(i=yield this.gameStore.getItem(t),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=(t,n)=>I(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:t,value:r}});return yield this.gameStore.setItem(t,r),{code:a,message:i}});this.removeItem=t=>I(this,null,function*(){yield this.gameStore.removeItem(t);let{code:n,message:r}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/remove`,{data:{key:t}});return{code:n,message:r}});this.clear=()=>I(this,null,function*(){yield this.gameStore.clear();let{code:t,message:n}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/clear`,{});return{code:t,message:n}});this.gameId=this.getGameId(),this.gameStore=rl.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},vr=new mi,Ff=et("getLocalStorage",{paramsSchema:J.tuple(J.string()),implement(e){return I(this,null,function*(){return yield vr.getItem(e)})}});pr.registerCommand("StorageSDK.getItem",Ff);_e("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Hf=et("setStorage",{paramsSchema:J.tuple(J.string(),J.or(J.string(),J.boolean(),J.number())),implement(e,t){return I(this,null,function*(){return yield vr.setItem(e,t)})}});pr.registerCommand("StorageSDK.setItem",Hf);_e("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var qf=et("removeStorage",{paramsSchema:J.tuple(J.string()),implement(e){return I(this,null,function*(){return yield vr.removeItem(e)})}});pr.registerCommand("StorageSDK.removeItem",qf);_e("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var jf=et("clearStorage",{implement(){return I(this,null,function*(){return yield vr.clear()})}});pr.registerCommand("StorageSDK.clear",jf);_e("storage.clear",{version:"1.0.0"});var tI=Ca(al());dt();G();Lt();_r();ue();Ce();var ol=L.testMode;function sl(){let e=new Map,t,n;return{registerRewardHandler(a,i){e.set(a,i)},handleReward(a,...i){return I(this,null,function*(){return yield a.reduce((s,l)=>I(this,null,function*(){let d=yield s;if(d===!0)return!0;ol&&console.log(`handleReward ${l}`);let _=e.get(l),h=_?yield _(...i):d;return ol&&console.log(`handleReward ${l} ${h}`),h}),Promise.resolve(!1))})},registerRewardsFetcher(a){return I(this,null,function*(){t=(...i)=>I(this,null,function*(){try{return yield a(...i)}catch(o){return console.error("getRewardOptions error:",o),["ADS"]}})})},registerRewardFrequencyConfigFetcher(a){return I(this,null,function*(){n=(...i)=>I(this,null,function*(){try{return yield a(...i)}catch(o){return console.error("getRewardOptions error:",o),{joliCoinUseAndCharge:tt,loginGuide:nt}}})})},getRewardsTypes(...a){return I(this,null,function*(){return t?yield t(...a):["ADS"]})},getRewardFrequencyConfig(...a){return I(this,null,function*(){return n?yield n(...a):{joliCoinUseAndCharge:tt,loginGuide:nt}})}}}G();var yi=class{constructor(t){this.httpClient=t}execute(t,n){return I(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(t,a):yield this.httpClient.post(t,a)})}extractCacheableData(t){var n,r,a;return{unlockOptions:((n=t.data)==null?void 0:n.unlockOptions)||[],joliCoin:((r=t.extra)==null?void 0:r.joliCoin)||{balance:0,enableAutoDeduct:!1},joliGem:((a=t.extra)==null?void 0:a.joliGem)||{balance:0,enableAutoDeduct:!1}}}mergeData(t,n){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}}}},wi=class{constructor(t){this.httpClient=t}execute(t,n){return I(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(t,a):yield this.httpClient.post(t,a)})}extractCacheableData(t){let n=t.data;return q({joliCoinUseAndCharge:n==null?void 0:n.joliCoinUseAndCharge,loginGuide:n==null?void 0:n.loginGuide},n)}processCachedData(t){return{code:"SUCCESS",message:"success from cache",data:t}}},Or=class{constructor(t){this.unlockOptionsService=new _t(new yi(t),{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 _t(new wi(t),{duration:60*60*1e3,timeout:1e3,keyGenerator:n=>n})}getUnlockOptions(){return I(this,arguments,function*(t={}){return yield this.unlockOptionsService.request("/api/games/unlock-options",{endpoint:"/api/games/unlock-options",body:t,method:"POST"})})}getGlobalConfig(){return I(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 I(this,arguments,function*(t={}){return yield this.unlockOptionsService.forceRequest("/api/games/unlock-options",{endpoint:"/api/games/unlock-options",body:t,method:"POST"})})}refreshGlobalConfig(){return I(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 I(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()}};Ce();G();var Xf=()=>(e,t)=>{let n={SUBSCRIPTION:4,JOLI_GEM:3,JOLI_GEM_ONLY:3,JOLI_COIN:2,JOLI_COIN_ONLY:2,ADS:1};return n[t]-n[e]},Yf=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(Xf())},bi=null;function Ei(e){return bi||(bi=new Or(e)),bi}var Ii=e=>{e.registerRewardsFetcher(t=>I(void 0,null,function*(){var a,i,o,s,l;let n=["ADS"],r=Ei(t);try{let d=yield r.getUnlockOptions({});if(d.code!=="SUCCESS")return n;Y.emit(yr,{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(h=>h.type))||Array.from(n);return Yf(_)}catch(d){return console.error("getRewardOptions error (cached):",d),n}}))},Ai=e=>{e.registerRewardFrequencyConfigFetcher(t=>I(void 0,null,function*(){var r,a,i,o;let n=Ei(t);try{let s=yield n.getGlobalConfig();return Y.emit(_i,{joliCoinUseAndCharge:((r=s.data)==null?void 0:r.joliCoinUseAndCharge)||tt,loginGuide:((a=s.data)==null?void 0:a.loginGuide)||nt}),s.data&&ut.emit("onGlobalConfigChanged",{globalConfig:s.data}),{joliCoinUseAndCharge:((i=s.data)==null?void 0:i.joliCoinUseAndCharge)||tt,loginGuide:((o=s.data)==null?void 0:o.loginGuide)||nt}}catch(s){return console.error("getGlobalConfig error (cached):",s),Y.emit(_i,{joliCoinUseAndCharge:tt,loginGuide:nt}),ut.emit("onGlobalConfigChanged",{globalConfig:{joliCoinUseAndCharge:tt,loginGuide:nt}}),{joliCoinUseAndCharge:tt,loginGuide:nt}}}))};var Si=e=>I(void 0,null,function*(){yield Ei(e).warmupCache(),console.log("Reward cache warmed up")});var ll=e=>t=>I(void 0,null,function*(){try{console.log("trigger @jolibox/ads reward",t),yield e.adBreak(t)}catch(n){console.error("-----createAdsRewardHandler error-----",n)}return!0});Ce();function je(e,t){let n=null,r=null,a=null,i=()=>{if(a){n=Promise.resolve(a);return}n=new Promise(o=>{r=o})};return i(),e.on(t,(...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=q(q({},a),o),n=Promise.resolve(a),r&&(r(a),r=null),a}}}Ce();var Re=je(Y,yr);ue();G();var Ci={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"}};G();var Me=ge();Ce();Ce();G();var Oi=class{constructor(t){this.httpClient=t}execute(t,n){return I(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(t,{query:a}):yield this.httpClient.post(t,{query:a})})}extractCacheableData(t){var n;return{balance:((n=t.data)==null?void 0:n.balance)||0,timestamp:Date.now()}}processCachedData(t){return{code:"SUCCESS",message:"success from cache",data:{balance:t.balance}}}},ki=class{constructor(t){this.balanceService=new _t(new Oi(t),{duration:20*60*1e3,timeout:1e3,keyGenerator:(n,r)=>{let a=r!=null&&r.query?JSON.stringify(r.query):"";return`${n}:${a}`}})}getBalance(t="JOLI_COIN"){return I(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 I(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 I(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()}},Ri=null;function Ti(e){return Ri||(Ri=new ki(e)),Ri}var xi=(e,t="JOLI_COIN")=>I(void 0,null,function*(){return yield Ti(e).getBalance(t)}),cn=(e,t="JOLI_COIN")=>I(void 0,null,function*(){let r=yield Ti(e).refreshBalance(t);return console.log(`Balance cache refreshed for type: ${t}`),r}),kr=(e,t="JOLI_COIN")=>I(void 0,null,function*(){yield Ti(e).warmupBalance(t),console.log(`Balance cache warmed up for type: ${t}`)});G();var Li=class{constructor(t){this.httpClient=t}execute(t,n){return I(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(t,{query:a}):yield this.httpClient.post(t,{query:a})})}extractCacheableData(t){var n;return{balance:((n=t.data)==null?void 0:n.balance)||0,timestamp:Date.now()}}processCachedData(t){return{code:"SUCCESS",message:"success from cache",data:{balance:t.balance}}}},Di=class{constructor(t){this.gemBalanceService=new _t(new Li(t),{duration:20*60*1e3,timeout:1e3,keyGenerator:(n,r)=>{let a=r!=null&&r.query?JSON.stringify(r.query):"";return`${n}:${a}`}})}getGemBalance(t="GEM"){return I(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 I(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 I(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()}},Pi=null;function cl(e){return Pi||(Pi=new Di(e)),Pi}var Ni=(e,t="GEM")=>I(void 0,null,function*(){return yield cl(e).getGemBalance(t)}),Tr=(e,t="GEM")=>I(void 0,null,function*(){let r=yield cl(e).refreshGemBalance(t);return console.log(`Gem balance cache refreshed for type: ${t}`),r});var un={JOLI_COIN:{fetchBalance:xi,getQuantity:e=>{var t,n,r;return(r=(n=(t=e==null?void 0:e.options)==null?void 0:t.find(a=>a.type==="JOLI_COIN"))==null?void 0:n.joliCoinChoices[0].joliCoinQuantity)!=null?r: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 n,r;return(r=(n=e==null?void 0:e.options)==null?void 0:n.some(a=>a.type==="JOLI_COIN"&&a.joliCoinChoices.some(i=>{var o;return i.joliCoinQuantity<=((o=t==null?void 0:t.balance)!=null?o:0)})))!=null?r:!1}},JOLI_GEM:{fetchBalance:Ni,getQuantity:e=>{var t,n,r,a;return(a=(r=(n=(t=e==null?void 0:e.options)==null?void 0:t.find(i=>i.type==="JOLI_GEM"))==null?void 0:n.joliGemChoice)==null?void 0:r.joliGemQuantity)!=null?a: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 r,a,i;let n=e==null?void 0:e.options.find(o=>o.type==="JOLI_GEM");return n?((a=(r=n.joliGemChoice)==null?void 0:r.joliGemQuantity)!=null?a:0)<=((i=t==null?void 0:t.balance)!=null?i:0):!1}}};var xr=(e,t,n)=>{let{showUnlockWithCurrencyModal:r}=n;Me.registerCommand(`Rewards.${e}.useJolicoin`,()=>I(void 0,null,function*(){let a=yield Re.getData(),i=un[t],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:t}))!=="CONFIRM"?{result:"FAILED"}:{result:"SUCCESS"}}))},Et=(e,t)=>n=>I(void 0,null,function*(){let r=je(Y,Ir);return Y.emit(Er,e,{enableAutoDeduct:n.enableAutoDeduct,userCurrency:n.userCurrency,quantity:n.quantity,currency:n.currency,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield r.getFreshData()).useModalResult});Ce();Ce();var Pr=(e,t,n)=>{let{httpClient:r,initiateAndAwaitPayment:a}=n;Me.registerCommand(`Rewards.${e}.usePayment`,()=>I(void 0,null,function*(){var p;let i=yield Re.getData(),o=un[t],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),h=o.getUpdateKey();if(Re.updateData({[h]:_}),console.log("-----unlockOptions payment-----",i,_,l,t),!o.isEnough(i,_)){let f=yield a({userCurrency:_,currencyQuantity:l,currency:t});return t==="JOLI_GEM"?Tr(r):cn(r),{result:f==="SUCCESS"?"SUCCESS":"FAILED"}}return{result:"CONTINUE"}}))},It=(e,t)=>n=>I(void 0,null,function*(){let r=je(Y,br);return Y.emit(wr,e,{userCurrency:n.userCurrency,quantity:n.currencyQuantity,currency:n.currency,enableAutoDeduct:n.userCurrency.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield r.getFreshData()).paymentResult});ue();Ce();Ce();G();var At=(e,t)=>n=>I(void 0,null,function*(){let r=je(Y,Ar);return Y.emit(Sr,e,{confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText,currency:n}),yield r.getFreshData()});var eh=(e,t,n,{handlers:{handleUnlockSuccess:r,handleUnlockFailed:a,unlockOptionsHandler:i,initiateAndAwaitPayment:o,showUnlockWithCurrencyModal:s,showUnloginModal:l}})=>{Pr(e,"JOLI_COIN",{httpClient:t,initiateAndAwaitPayment:o}),xr(e,"JOLI_COIN",{showUnlockWithCurrencyModal:s});let d=[`Rewards.${e}.usePayment`,`Rewards.${e}.useJolicoin`];return _=>I(void 0,null,function*(){var h,p,f;try{let w=!0;for(let b of d){let x=yield Me.executeCommand(b);if(w=w&&x.result!=="FAILED",x.result!=="CONTINUE")break}if(!w)return a==null||a(_),!1;let A=Ci[n],C=yield t.post(A.unlockEndpoint,{data:{type:"GAME_REWARD",reqId:`${Ge()}-${L.mpType}-${Date.now()}`,gameInfo:{gameId:L.mpId}}});if(console.log("-----unlockWithCurrency request result-----",C),C.code=="SUCCESS"){try{(p=_.adBreakDone)==null||p.call(_,{breakType:_.type,breakName:"name"in _&&(h=_.name)!=null?h:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in _&&((f=_.adViewed)==null||f.call(_)),cn(t)}catch(b){console.error("-----unlockWithJolicoin adBreakDone error-----",b)}return r==null||r({quantity:C.data.quantity,balance:C.data.balance}),!0}return a==null||a(_),!1}catch(w){if(console.info("JolicoinRewardHandler error:",w),w instanceof Error&&w.message=="CANCEL")throw w;return a==null||a(_),!1}finally{i.clearCache()}})},Lr=(e,t,n)=>eh(e,t,"JOLI_COIN",n);var ul=(e,{onUnlockSuccess:t,onUnlockFailed:n})=>{let r=()=>{n==null||n()},a=Et("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),i=It("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"}),o=At("ADS-JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noWatchAds"});return Lr("ADS-JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:r,unlockOptionsHandler:Re,initiateAndAwaitPayment:i,showUnlockWithCurrencyModal:a,showUnloginModal:o}})};var dl=(e,{onUnlockSuccess:t,onUnlockFailed:n})=>{let r=l=>{var d;n==null||n(),(d=l.adBreakDone)==null||d.call(l,{breakType:l.type,breakFormat:l.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},a=Et("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),i=It("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"}),o=At("JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noThanks"});return Lr("JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:r,unlockOptionsHandler:Re,initiateAndAwaitPayment:i,showUnlockWithCurrencyModal:a,showUnloginModal:o}})};ue();G();Ce();Ce();var fl=e=>{let{showSubscriptionModal:t}=e;Me.registerCommand("Rewards.subscription",()=>I(void 0,null,function*(){return{result:(yield t())==="SUCCESS"?"SUCCESS":"FAILED"}}))},hl=e=>()=>I(void 0,null,function*(){let t=je(Y,Rr);return Y.emit(Cr,e),(yield t.getFreshData()).result});ue();var ml=(e,t,{handlers:{handleSubSuccess:n,handleSubFailed:r,unlockOptionsHandler:a,showSubscriptionModal:i}})=>{fl({showSubscriptionModal:i});let o=["Rewards.subscription"];return s=>I(void 0,null,function*(){var l,d,_,h,p,f;try{let w=!0;for(let A of o){let C=yield Me.executeCommand(A);if(w=w&&C.result!=="FAILED",C.result!=="CONTINUE")break}if(!w)return r==null||r(s),!1;if(console.log("-----unlockWithSubscription result-----"),w){try{(d=s.adBreakDone)==null||d.call(s,{breakType:s.type,breakName:"name"in s&&(l=s.name)!=null?l:"",breakFormat:s.type==="reward"?"reward":"interstitial",breakStatus:"viewed"}),"adViewed"in s&&((_=s.adViewed)==null||_.call(s)),(f=(p=L).onEnvConfigChanged)==null||f.call(p,{hostUserInfo:Ee(q({},(h=L.hostUserInfo)!=null?h:{isLogin:!1}),{isSubUser:!0})})}catch(A){console.error("-----unlockWithSubscription adBreakDone error-----",A)}return n==null||n(),!0}return r==null||r(s),!1}catch(w){if(console.info("SubscriptionRewardHandler error:",w),w instanceof Error&&w.message=="CANCEL")throw w;return r==null||r(s),!1}finally{a.clearCache()}})};var pl=(e,{onSubSuccess:t,onSubFailed:n})=>{let r=()=>{n==null||n()},a=hl("SUBSCRIPTION");return ml("SUBSCRIPTION",e,{handlers:{handleSubSuccess:t,handleSubFailed:r,unlockOptionsHandler:Re,showSubscriptionModal:a}})};var Ve=sl();Ii(Ve);Ai(Ve);var Br,M,wl,Mi,St,vl,bl,El,Il,Gi,Ui,Bi,nh,dn={},Al=[],rh=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,fn=Array.isArray;function rt(e,t){for(var n in t)e[n]=t[n];return e}function Ji(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function hn(e,t,n){var r,a,i,o={};for(i in t)i=="key"?r=t[i]:i=="ref"?a=t[i]:o[i]=t[i];if(arguments.length>2&&(o.children=arguments.length>3?Br.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)o[i]===void 0&&(o[i]=e.defaultProps[i]);return Nr(e,o,r,a,null)}function Nr(e,t,n,r,a){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a==null?++wl:a,__i:-1,__u:0};return a==null&&M.vnode!=null&&M.vnode(i),i}function ft(e){return e.children}function De(e,t){this.props=e,this.context=t}function Bt(e,t){if(t==null)return e.__?Bt(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Bt(e):null}function Sl(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Sl(e)}}function gl(e){(!e.__d&&(e.__d=!0)&&St.push(e)&&!Ur.__r++||vl!==M.debounceRendering)&&((vl=M.debounceRendering)||bl)(Ur)}function Ur(){for(var e,t,n,r,a,i,o,s=1;St.length;)St.length>s&&St.sort(El),e=St.shift(),s=St.length,e.__d&&(n=void 0,a=(r=(t=e).__v).__e,i=[],o=[],t.__P&&((n=rt({},r)).__v=r.__v+1,M.vnode&&M.vnode(n),Fi(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[a]:null,i,a==null?Bt(r):a,!!(32&r.__u),o),n.__v=r.__v,n.__.__k[n.__i]=n,Ol(i,n,o),n.__e!=a&&Sl(n)));Ur.__r=0}function Cl(e,t,n,r,a,i,o,s,l,d,_){var h,p,f,w,A,C,b=r&&r.__k||Al,x=t.length;for(l=ah(n,t,b,l,x),h=0;h<x;h++)(f=n.__k[h])!=null&&(p=f.__i===-1?dn:b[f.__i]||dn,f.__i=h,C=Fi(e,f,p,a,i,o,s,l,d,_),w=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&Hi(p.ref,null,f),_.push(f.ref,f.__c||w,f)),A==null&&w!=null&&(A=w),4&f.__u||p.__k===f.__k?l=Rl(f,l,e):typeof f.type=="function"&&C!==void 0?l=C:w&&(l=w.nextSibling),f.__u&=-7);return n.__e=A,l}function ah(e,t,n,r,a){var i,o,s,l,d,_=n.length,h=_,p=0;for(e.__k=new Array(a),i=0;i<a;i++)(o=t[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(l=i+p,(o=e.__k[i]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Nr(null,o,null,null,null):fn(o)?Nr(ft,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Nr(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(d=o.__i=ih(o,n,l,h))!==-1&&(h--,(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))):e.__k[i]=null;if(h)for(i=0;i<_;i++)(s=n[i])!=null&&!(2&s.__u)&&(s.__e==r&&(r=Bt(s)),Tl(s,s));return r}function Rl(e,t,n){var r,a;if(typeof e.type=="function"){for(r=e.__k,a=0;r&&a<r.length;a++)r[a]&&(r[a].__=e,t=Rl(r[a],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=Bt(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function mn(e,t){return t=t||[],e==null||typeof e=="boolean"||(fn(e)?e.some(function(n){mn(n,t)}):t.push(e)),t}function ih(e,t,n,r){var a,i,o=e.key,s=e.type,l=t[n];if(l===null&&e.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<t.length;){if(a>=0){if((l=t[a])&&!(2&l.__u)&&o==l.key&&s===l.type)return a;a--}if(i<t.length){if((l=t[i])&&!(2&l.__u)&&o==l.key&&s===l.type)return i;i++}}return-1}function _l(e,t,n){t[0]=="-"?e.setProperty(t,n==null?"":n):e[t]=n==null?"":typeof n!="number"||rh.test(t)?n:n+"px"}function Dr(e,t,n,r,a){var i;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||_l(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||_l(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Il,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.t=r.t:(n.t=Gi,e.addEventListener(t,i?Bi:Ui,i)):e.removeEventListener(t,i?Bi:Ui,i);else{if(a=="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]=n==null?"":n;break e}catch(o){}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function yl(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.u==null)t.u=Gi++;else if(t.u<n.t)return;return n(M.event?M.event(t):t)}}}function Fi(e,t,n,r,a,i,o,s,l,d){var _,h,p,f,w,A,C,b,x,D,H,j,R,N,T,B,K,z=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=t.__e=n.__e]),(_=M.__b)&&_(t);e:if(typeof z=="function")try{if(b=t.props,x="prototype"in z&&z.prototype.render,D=(_=z.contextType)&&r[_.__c],H=_?D?D.props.value:_.__:r,n.__c?C=(h=t.__c=n.__c).__=h.__E:(x?t.__c=h=new z(b,H):(t.__c=h=new De(b,H),h.constructor=z,h.render=sh),D&&D.sub(h),h.props=b,h.state||(h.state={}),h.context=H,h.__n=r,p=h.__d=!0,h.__h=[],h._sb=[]),x&&h.__s==null&&(h.__s=h.state),x&&z.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=rt({},h.__s)),rt(h.__s,z.getDerivedStateFromProps(b,h.__s))),f=h.props,w=h.state,h.__v=t,p)x&&z.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),x&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(x&&z.getDerivedStateFromProps==null&&b!==f&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(b,H),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(b,h.__s,H)===!1||t.__v==n.__v)){for(t.__v!=n.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(te){te&&(te.__=t)}),j=0;j<h._sb.length;j++)h.__h.push(h._sb[j]);h._sb=[],h.__h.length&&o.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(b,h.__s,H),x&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(f,w,A)})}if(h.context=H,h.props=b,h.__P=e,h.__e=!1,R=M.__r,N=0,x){for(h.state=h.__s,h.__d=!1,R&&R(t),_=h.render(h.props,h.state,h.context),T=0;T<h._sb.length;T++)h.__h.push(h._sb[T]);h._sb=[]}else do h.__d=!1,R&&R(t),_=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++N<25);h.state=h.__s,h.getChildContext!=null&&(r=rt(rt({},r),h.getChildContext())),x&&!p&&h.getSnapshotBeforeUpdate!=null&&(A=h.getSnapshotBeforeUpdate(f,w)),B=_,_!=null&&_.type===ft&&_.key==null&&(B=kl(_.props.children)),s=Cl(e,fn(B)?B:[B],t,n,r,a,i,o,s,l,d),h.base=t.__e,t.__u&=-161,h.__h.length&&o.push(h),C&&(h.__E=h.__=null)}catch(te){if(t.__v=null,l||i!=null)if(te.then){for(t.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else for(K=i.length;K--;)Ji(i[K]);else t.__e=n.__e,t.__k=n.__k;M.__e(te,t,n)}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=oh(n.__e,t,n,r,a,i,o,l,d);return(_=M.diffed)&&_(t),128&t.__u?void 0:s}function Ol(e,t,n){for(var r=0;r<n.length;r++)Hi(n[r],n[++r],n[++r]);M.__c&&M.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){M.__e(i,a.__v)}})}function kl(e){return typeof e!="object"||e==null?e:fn(e)?e.map(kl):rt({},e)}function oh(e,t,n,r,a,i,o,s,l){var d,_,h,p,f,w,A,C=n.props,b=t.props,x=t.type;if(x=="svg"?a="http://www.w3.org/2000/svg":x=="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((f=i[d])&&"setAttribute"in f==!!x&&(x?f.localName==x:f.nodeType==3)){e=f,i[d]=null;break}}if(e==null){if(x==null)return document.createTextNode(b);e=document.createElementNS(a,x,b.is&&b),s&&(M.__m&&M.__m(t,i),s=!1),i=null}if(x===null)C===b||s&&e.data===b||(e.data=b);else{if(i=i&&Br.call(e.childNodes),C=n.props||dn,!s&&i!=null)for(C={},d=0;d<e.attributes.length;d++)C[(f=e.attributes[d]).name]=f.value;for(d in C)if(f=C[d],d!="children"){if(d=="dangerouslySetInnerHTML")h=f;else if(!(d in b)){if(d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b)continue;Dr(e,d,null,f,a)}}for(d in b)f=b[d],d=="children"?p=f:d=="dangerouslySetInnerHTML"?_=f:d=="value"?w=f:d=="checked"?A=f:s&&typeof f!="function"||C[d]===f||Dr(e,d,f,C[d],a);if(_)s||h&&(_.__html===h.__html||_.__html===e.innerHTML)||(e.innerHTML=_.__html),t.__k=[];else if(h&&(e.innerHTML=""),Cl(t.type==="template"?e.content:e,fn(p)?p:[p],t,n,r,x=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,o,i?i[0]:n.__k&&Bt(n,0),s,l),i!=null)for(d=i.length;d--;)Ji(i[d]);s||(d="value",x=="progress"&&w==null?e.removeAttribute("value"):w!==void 0&&(w!==e[d]||x=="progress"&&!w||x=="option"&&w!==C[d])&&Dr(e,d,w,C[d],a),d="checked",A!==void 0&&A!==e[d]&&Dr(e,d,A,C[d],a))}return e}function Hi(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(a){M.__e(a,n)}}function Tl(e,t,n){var r,a;if(M.unmount&&M.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Hi(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){M.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(a=0;a<r.length;a++)r[a]&&Tl(r[a],t,n||typeof e.type!="function");n||Ji(e.__e),e.__c=e.__=e.__e=void 0}function sh(e,t,n){return this.constructor(e,n)}function xl(e,t,n){var r,a,i,o;t==document&&(t=document.documentElement),M.__&&M.__(e,t),a=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],o=[],Fi(t,e=(!r&&n||t).__k=hn(ft,null,[e]),a||dn,dn,t.namespaceURI,!r&&n?[n]:a?null:t.firstChild?Br.call(t.childNodes):null,i,!r&&n?n:a?a.__e:t.firstChild,r,o),Ol(i,e,o)}Br=Al.slice,M={__e:function(e,t,n,r){for(var a,i,o;t=t.__;)if((a=t.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(e)),o=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,r||{}),o=a.__d),o)return a.__E=a}catch(s){e=s}throw e}},wl=0,Mi=function(e){return e!=null&&e.constructor==null},De.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=rt({},this.state),typeof e=="function"&&(e=e(rt({},n),this.props)),e&&rt(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),gl(this))},De.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),gl(this))},De.prototype.render=ft,St=[],bl=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,El=function(e,t){return e.__v.__b-t.__v.__b},Ur.__r=0,Il=/(PointerCapture)$|Capture$/i,Gi=0,Ui=yl(!1),Bi=yl(!0),nh=0;var Mt,ie,qi,Pl,pn=0,Jl=[],se=M,Ll=se.__b,Dl=se.__r,Nl=se.diffed,Ul=se.__c,Bl=se.unmount,Ml=se.__;function Gr(e,t){se.__h&&se.__h(ie,e,pn||t),pn=0;var n=ie.__H||(ie.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Jr(e){return pn=1,Fl(Hl,e)}function Fl(e,t,n){var r=Gr(Mt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Hl(void 0,t),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=ie,!ie.__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 h=r.__c.props!==s;return _.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(h=!0)}}),i&&i.call(this,s,l,d)||h};ie.__f=!0;var i=ie.shouldComponentUpdate,o=ie.componentWillUpdate;ie.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)},ie.shouldComponentUpdate=a}return r.__N||r.__}function vn(e,t){var n=Gr(Mt++,3);!se.__s&&Ki(n.__H,t)&&(n.__=e,n.u=t,ie.__H.__h.push(n))}function Vi(e,t){var n=Gr(Mt++,4);!se.__s&&Ki(n.__H,t)&&(n.__=e,n.u=t,ie.__h.push(n))}function $i(e){return pn=5,gn(function(){return{current:e}},[])}function gn(e,t){var n=Gr(Mt++,7);return Ki(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Wi(e,t){return pn=8,gn(function(){return e},t)}function lh(){for(var e;e=Jl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Mr),e.__H.__h.forEach(ji),e.__H.__h=[]}catch(t){e.__H.__h=[],se.__e(t,e.__v)}}se.__b=function(e){ie=null,Ll&&Ll(e)},se.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ml&&Ml(e,t)},se.__r=function(e){Dl&&Dl(e),Mt=0;var t=(ie=e.__c).__H;t&&(qi===ie?(t.__h=[],ie.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(Mr),t.__h.forEach(ji),t.__h=[],Mt=0)),qi=ie},se.diffed=function(e){Nl&&Nl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Jl.push(t)!==1&&Pl===se.requestAnimationFrame||((Pl=se.requestAnimationFrame)||ch)(lh)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),qi=ie=null},se.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Mr),n.__h=n.__h.filter(function(r){return!r.__||ji(r)})}catch(r){t.some(function(a){a.__h&&(a.__h=[])}),t=[],se.__e(r,n.__v)}}),Ul&&Ul(e,t)},se.unmount=function(e){Bl&&Bl(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Mr(r)}catch(a){t=a}}),n.__H=void 0,t&&se.__e(t,n.__v))};var Gl=typeof requestAnimationFrame=="function";function ch(e){var t,n=function(){clearTimeout(r),Gl&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Gl&&(t=requestAnimationFrame(n))}function Mr(e){var t=ie,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),ie=t}function ji(e){var t=ie;e.__c=e.__(),ie=t}function Ki(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Hl(e,t){return typeof t=="function"?t(e):t}function dh(e,t){for(var n in t)e[n]=t[n];return e}function ql(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function jl(e,t){this.props=e,this.context=t}(jl.prototype=new De).isPureReactComponent=!0,jl.prototype.shouldComponentUpdate=function(e,t){return ql(this.props,e)||ql(this.state,t)};var Vl=M.__b;M.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Vl&&Vl(e)};var Zb=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var fh=M.__e;M.__e=function(e,t,n,r){if(e.then){for(var a,i=t;i=i.__;)if((a=i.__c)&&a.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),a.__c(e,t)}fh(e,t,n,r)};var $l=M.unmount;function Zl(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=dh({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Zl(r,t,n)})),e}function ec(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return ec(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function zi(){this.__u=0,this.o=null,this.__b=null}function tc(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Fr(){this.i=null,this.l=null}M.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),$l&&$l(e)},(zi.prototype=new De).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var a=tc(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]=ec(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&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},zi.prototype.componentWillUnmount=function(){this.o=[]},zi.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Zl(this.__b,n,r.__O=r.__P)}this.__b=null}var a=t.__a&&hn(ft,null,e.fallback);return a&&(a.__u&=-33),[hn(ft,null,t.__a?null:e.children),a]};var Wl=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Fr.prototype=new De).__a=function(e){var t=this,n=tc(t.__v),r=t.l.get(e);return r[0]++,function(a){var i=function(){t.props.revealOrder?(r.push(a),Wl(t,e,r)):a()};n?n(i):i()}},Fr.prototype.render=function(e){this.i=null,this.l=new Map;var t=mn(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Fr.prototype.componentDidUpdate=Fr.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Wl(e,n,t)})};var hh=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,mh=/^(?: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]/,ph=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,vh=/[A-Z0-9]/g,gh=typeof document!="undefined",_h=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Xi(e,t,n){return t.__k==null&&(t.textContent=""),xl(e,t),typeof n=="function"&&n(),e?e.__c:null}De.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(De.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Kl=M.event;function yh(){}function wh(){return this.cancelBubble}function bh(){return this.defaultPrevented}M.event=function(e){return Kl&&(e=Kl(e)),e.persist=yh,e.isPropagationStopped=wh,e.isDefaultPrevented=bh,e.nativeEvent=e};var nc,Eh={enumerable:!1,configurable:!0,get:function(){return this.class}},zl=M.vnode;M.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,a={},i=r.indexOf("-")===-1;for(var o in n){var s=n[o];if(!(o==="value"&&"defaultValue"in n&&s==null||gh&&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"||_h(n.type)?l==="onfocus"?o="onfocusin":l==="onblur"?o="onfocusout":ph.test(o)&&(o=l):l=o="oninput":i&&mh.test(o)?o=o.replace(vh,"-$&").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=mn(n.children).forEach(function(d){d.props.selected=a.value.indexOf(d.props.value)!=-1})),r=="select"&&a.defaultValue!=null&&(a.value=mn(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",Eh)):(n.className&&!n.class||n.class&&n.className)&&(a.class=a.className=n.className),t.props=a}(e),e.$$typeof=hh,zl&&zl(e)};var Xl=M.__r;M.__r=function(e){Xl&&Xl(e),nc=e.__c};var Yl=M.diffed;M.diffed=function(e){Yl&&Yl(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),nc=null};var Ih=Object.defineProperty,Yr=Object.getOwnPropertySymbols,Oc=Object.prototype.hasOwnProperty,kc=Object.prototype.propertyIsEnumerable,rc=(e,t,n)=>t in e?Ih(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ah=(e,t)=>{for(var n in t||(t={}))Oc.call(t,n)&&rc(e,n,t[n]);if(Yr)for(var n of Yr(t))kc.call(t,n)&&rc(e,n,t[n]);return e},Sh=(e,t)=>{var n={};for(var r in e)Oc.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Yr)for(var r of Yr(e))t.indexOf(r)<0&&kc.call(e,r)&&(n[r]=e[r]);return n},Tc=Object.defineProperty,Ch=Object.defineProperties,Rh=Object.getOwnPropertyDescriptors,ac=Object.getOwnPropertySymbols,Oh=Object.prototype.hasOwnProperty,kh=Object.prototype.propertyIsEnumerable,ic=(e,t,n)=>t in e?Tc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Th=(e,t)=>{for(var n in t||(t={}))Oh.call(t,n)&&ic(e,n,t[n]);if(ac)for(var n of ac(t))kh.call(t,n)&&ic(e,n,t[n]);return e},xh=(e,t)=>Ch(e,Rh(t)),Ph=(e,t)=>{for(var n in t)Tc(e,n,{get:t[n],enumerable:!0})},xc=(e,t,n,r)=>{for(var a=t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(a=o(a)||a);return a},Lh=(e,t,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(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 n=new Event("abort");this.signal.dispatchEvent(n)};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(n,r){this._eventListeners[n]||(this._eventListeners[n]=[]),this._eventListeners[n].push(r)},t.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)},t.prototype.dispatchEvent=function(n){if(this._eventListeners[n.type])for(let r of this._eventListeners[n.type])r.call(this,n)},window.AbortController=e,window.AbortSignal=t}function Dh(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Nh(e){return typeof e=="string"}function Uh(e){return typeof e=="undefined"}function Bh(e){return Uh(e)||e===null}function Mh(e){return typeof e=="function"}function Pc(e){let t=e,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 t(...i)),n};return r.prototype=t.prototype,r}var Gh=(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))(Gh||{});function _n(e){return function(){var t,n;((n=(t=globalThis.VConsole)==null?void 0:t[e])!=null?n:globalThis.console[e])(...arguments)}}var Jh={log:_n("log"),warn:_n("warn"),info:_n("info"),error:_n("error"),debug:_n("debug")};Object.assign(globalThis,{logger:Jh});var oc=Symbol.for("Jolibox.canIUseMap"),Fh={};globalThis[oc]||(globalThis[oc]=Fh);var sc=Symbol.for("Jolibox.canIUseMap.native"),Hh={};globalThis[sc]||(globalThis[sc]=Hh);var Lc=(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))(Lc||{}),Dc=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Dc||{}),Nc=(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))(Nc||{}),lc=["name","params"],qh=["name","type","location","target","extra","timestamp","userId"],jh=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function Vr(e,t){return t.map(n=>{if(n==="params"&&e[n]){let r=e[n];return Object.keys(r).reduce((a,i)=>(a[i]=String(r[i]),a),{})}return e[n]})}function Vh(e){let t=e.location?Vr(e.location,lc):null,n=e.target?Vr(e.target,lc):null;return Vr(xh(Th({},e),{location:t,target:n}),qh)}function $h(e){let t=e.events.map(r=>Vh(r)),n=Vr(e.device,jh);return[e.protocolVersion,t,n,e.project]}function Wh(){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 r=e.get.call(window);return window.__joliboxLocalStorage__=r,r}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,n=Object.getOwnPropertyDescriptor(t,"localStorage");if(n&&n.get){let r=n.get.call(window);return window.__joliboxLocalStorage__=r,r}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}Wh();var Ft=typeof window=="undefined",cc=()=>!Ft&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");!Ft&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),!Ft&&navigator.userAgent.includes("Android"),!Ft&&navigator.userAgent.includes("Mac"),!Ft&&navigator.userAgent.includes("FB_IAB"),!Ft&&!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var ro=class ao{constructor(t){this.element=t,this.next=ao.Undefined,this.prev=ao.Undefined}};ro.Undefined=new ro(void 0);var ae=ro,Kh=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 n=new ae(e);if(this._first===ae.Undefined)this._first=n,this._last=n;else if(t){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!==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}},zh=0,yn=class{constructor(e){this.value=e,this.id=zh++}},In=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,n;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof yn&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(r=>(r==null?void 0:r.value)===e)):(this._listeners=void 0,this._size=0)),(n=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t))}get event(){return this._event!=null||(this._event=(e,t)=>{var n,r,a,i,o,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let l=new yn(e);return this._listeners?this._listeners instanceof yn?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,_,h,p;if(!this._disposed){if(this._listeners instanceof yn)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 f=this._listeners.indexOf(l);f>=0&&(this._listeners.splice(f,1),this._size--,this._size===0&&((p=(h=this.options)==null?void 0:h.onDidRemoveLastListener)==null||p.call(h)))}}}}),this._event}_deliver(e,t){var n;if(!e)return;let r=((n=this.options)==null?void 0:n.onListenerError)||Error.constructor;if(!r){e.value(t);return}try{e.value(t)}catch(a){r(a)}}fire(e){this._listeners&&(this._listeners instanceof yn?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Xh=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;var r;let a=(r=this.listeners.get(e))!=null?r:new In,i=l=>t(...l.args),o=a.event(i);this.listerHandlerMap.set(t,{handler:i,dispose:o}),this.listeners.set(e,a);let s=this.cachedEventQueue.get(e);if(s&&n)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let n=this.listerHandlerMap.get(t);n&&(n.dispose(),this.listerHandlerMap.delete(t))}emit(e){let t=this.listeners.get(e),n=this.cachedEventQueue.get(e);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 Kh,this.cachedEventQueue.set(e,n)),n.push({args:a}),t&&t.fire({event:e,args:a})}once(e,t){var n=this;let r=function(){t(...arguments),n.off(e,r)};this.on(e,r,!1)}},io={};Ph(io,{None:()=>Yh,filter:()=>Zh,once:()=>Uc,toPromise:()=>Qh});var Yh=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function Qh(e){return new Promise(t=>Uc(e)(t))}function Uc(e){return function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=!1;return e(a=>{if(!r)return r=!0,t.call(n,a)},null)}}function Zh(e,t){return(n=>{let r={onWillAddFirstListener(){n(a.fire,a)}},a=new In(r);return a.event})(function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e(a=>t(a)&&n.call(r,a),null)})}var Yi=Symbol.for("Jolibox.hostEmitter"),em=()=>{let e=new Xh;return globalThis[Yi]||(globalThis[Yi]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Yi]};em();function tm(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)nm(e[r],t[r])}function nm(e,t){if(Nh(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Mh(t)){try{if(e instanceof t)return}catch(n){}if(!Bh(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 oo=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new In,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 n=[];for(let a of e.metadata.args)n.push(a.constraint);let r=e.handler;e.handler=function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return tm(i,n),r(...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 n=this.getCommand(t);n&&e.set(t,n)}return e}};oo=xc([Pc],oo);var uc=class{constructor(){this._onWillExecuteCommand=new In,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new In,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new oo,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Dh(3e4)),this._starActivation}executeCommand(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Lh(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,n):(yield Promise.all([Promise.race([this._activateStar(),io.toPromise(io.filter(this.registry.onDidRegisterCommand,a=>a===e))])]),this._tryExecuteCommand(e,n))})}executeCommandThowErr(e){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let t=this.registry.getCommand(e);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:e,args:r});let i=this.invokeFunction(t.handler,...r);return this._onDidExecuteCommand.fire({commandId:e,args:r}),i}_tryExecuteCommand(e,t){let n=this.registry.getCommand(e);if(!n)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let r=this.invokeFunction(n.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(r)}catch(r){return Promise.reject(r)}}invokeFunction(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e(...n)}finally{}}};uc=xc([Pc],uc);function Oe(e,t,n){return(t=rm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rm(e){var t=am(e,"string");return typeof t=="symbol"?t:t+""}function am(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gt=e=>e?function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e==null||e(...n)}catch(a){console.error("Error calling function",a)}}:()=>{console.log("wrapUserFunction: fn is undefined")},so=class{constructor(t){Oe(this,"context",void 0),Oe(this,"continueCallback",void 0),Oe(this,"adIsShowingCallback",void 0),Oe(this,"isBeforeAdCalled",!1),Oe(this,"isBeforeRewardCalled",!1),Oe(this,"isAdDismissedCalled",!1),Oe(this,"isAdViewedCalled",!1),Oe(this,"isAfterAdCalled",!1),Oe(this,"currentProvider",void 0),Oe(this,"currentClientParams",void 0),Oe(this,"adsHasResponse",!1),Oe(this,"videoChecker",window.document.createElement("video")),Oe(this,"contextInfo",void 0),Oe(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",Ah({userEvent:o},this.paramsToTrack)),cc()&&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=Gt(n);s==null||s()}),this.context=t,this.contextInfo=t.getContextInfo()}notifyIframeAdsEvent(t,n){window.parent&&window.parent.postMessage({type:t,data:n},"*"),window.dispatchEvent(new CustomEvent(t,{detail:n}))}get paramsToTrack(){var t,n,r,a,i,o;return{provider:(n=(t=this.currentProvider)==null?void 0:t.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(t){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=Gt(t);o==null||o(),((n=this.currentClientParams)==null?void 0:n.type)!=="reward"&&((r=this.adIsShowingCallback)==null||r.call(this,!0),cc()&&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(t){return n=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(n)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(n)))}}wrapAdDismissed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdDismissedCalled){this.isAdDismissedCalled=!0;let n=Gt(t);n==null||n()}}}wrapAdViewed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdViewedCalled){this.isAdViewedCalled=!0;let n=Gt(t);n==null||n()}}}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 n=Gt(t);n==null||n()}}}wrapAdBreakDone(t){return n=>{var r,a,i,o,s,l,d,_,h;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=Gt(t);p==null||p(n),(d=this.adIsShowingCallback)==null||d.call(this,!1),(_=this.continueCallback)==null||_.call(this,[!1,n]);break}default:{(h=this.continueCallback)==null||h.call(this,[!0,n]);break}}}}callAdBreakAndContinue(t,n,r,a){return I(this,null,function*(){return this.currentProvider=t,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,_,h,p,f;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"?"":(h=n.name)!=null?h:"",breakFormat:n.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(f=this.adIsShowingCallback)==null||f.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AD_BREAK",this.paramsToTrack),t.adBreak(o,r),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};function Hr(e,t,n){return(t=im(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function im(e){var t=om(e,"string");return typeof t=="symbol"?t:t+""}function om(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lo=class{constructor(t){Hr(this,"context",void 0),Hr(this,"adBreakIsShowing",!1),Hr(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),Hr(this,"reportPageHide",()=>{this.context.track("AdBreakHide",{context:"AdsActionDetection"})}),this.context=t,window.addEventListener("visibilitychange",()=>{document.hidden&&this.adBreakIsShowing&&this.reportPageHide()}),window.addEventListener("beforeunload",n=>{this.adBreakIsShowing&&this.reportPageJumpOut()})}};function qr(e,t,n){return(t=sm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sm(e){var t=lm(e,"string");return typeof t=="symbol"?t:t+""}function lm(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var co=class{constructor(t){qr(this,"configs",null),qr(this,"firstRun",!0),qr(this,"context",void 0),qr(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return I(this,null,function*(){try{this.configs=yield this.context.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config",{})}catch(t){}})}shouldBypassCallingInterstitial(){var t,n;let r;if(!this.configs)this.init(),r=!this.firstRun;else{let a=(t=this.contextInfo.channel)!=null?t:"",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 at(e,t,n){return(t=cm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cm(e){var t=um(e,"string");return typeof t=="symbol"?t:t+""}function um(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uo=class{constructor(t,n){at(this,"name","ADSENSE"),at(this,"context",void 0),at(this,"contextInfo",void 0),at(this,"configured",!1),at(this,"initParams",void 0),at(this,"push",function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(r)}),at(this,"adConfig",r=>{let a=r,{onReady:i}=a,o=Sh(a,["onReady"]);this.context.track("CallAdConfig",o),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(r))}),at(this,"adBreak",r=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(r)}),at(this,"adUnit",r=>I(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:h,style:p}=r,f;if(!l)throw new Error("targeting element is required");if(typeof l=="string"?f=document.querySelector(l):f=l,!f)throw new Error("targeting element not found");let w=d;if(w||(w=this.initParams.unitId),!w)throw new Error("slot is required");let A=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",w),A&&C.setAttribute("data-ad-format",A),h&&C.setAttribute("data-full-width-responsive",h),p&&C.setAttribute("style",p),(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",C.style.position="relative",f.appendChild(C),C.appendChild(b)}else f.appendChild(C),new MutationObserver(b=>{b.forEach(x=>{if(x.type==="attributes"&&x.attributeName==="data-ad-status"){let D=C.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:D!=null?D:"null"})}})}).observe(C,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})})),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=n,window.adsbygoogle=window.adsbygoogle||[]}init(){return I(this,null,function*(){var t;if(this.context.track("CallAdsInit",{provider:this.name}),typeof window=="undefined")return;let n="google-adsense",r=(t=this.contextInfo.testAdsMode)!=null?t:!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 dm(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 fm(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 hm=function(){function e(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 t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(fm(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var a=dm(r);try{a.insertRule(n,a.cssRules.length)}catch(i){}}else r.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){var r;return(r=n.parentNode)==null?void 0:r.removeChild(n)}),this.tags=[],this.ctr=0},e}(),we="-ms-",Qr="-moz-",V="-webkit-",Bc="comm",Co="rule",Ro="decl",mm="@import",Mc="@keyframes",pm="@layer",vm=Math.abs,ra=String.fromCharCode,gm=Object.assign;function _m(e,t){return pe(e,0)^45?(((t<<2^pe(e,0))<<2^pe(e,1))<<2^pe(e,2))<<2^pe(e,3):0}function Gc(e){return e.trim()}function ym(e,t){return(e=t.exec(e))?e[0]:e}function $(e,t,n){return e.replace(t,n)}function fo(e,t){return e.indexOf(t)}function pe(e,t){return e.charCodeAt(t)|0}function An(e,t,n){return e.slice(t,n)}function $e(e){return e.length}function Oo(e){return e.length}function jr(e,t){return t.push(e),e}function wm(e,t){return e.map(t).join("")}var aa=1,jt=1,Jc=0,xe=0,fe=0,Vt="";function ia(e,t,n,r,a,i,o){return{value:e,root:t,parent:n,type:r,props:a,children:i,line:aa,column:jt,length:o,return:""}}function wn(e,t){return gm(ia("",null,null,"",null,null,0),e,{length:-e.length},t)}function bm(){return fe}function Em(){return fe=xe>0?pe(Vt,--xe):0,jt--,fe===10&&(jt=1,aa--),fe}function Ue(){return fe=xe<Jc?pe(Vt,xe++):0,jt++,fe===10&&(jt=1,aa++),fe}function We(){return pe(Vt,xe)}function $r(){return xe}function Rn(e,t){return An(Vt,e,t)}function Sn(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 Fc(e){return aa=jt=1,Jc=$e(Vt=e),xe=0,[]}function Hc(e){return Vt="",e}function Wr(e){return Gc(Rn(xe-1,ho(e===91?e+2:e===40?e+1:e)))}function Im(e){for(;(fe=We())&&fe<33;)Ue();return Sn(e)>2||Sn(fe)>3?"":" "}function Am(e,t){for(;--t&&Ue()&&!(fe<48||fe>102||fe>57&&fe<65||fe>70&&fe<97););return Rn(e,$r()+(t<6&&We()==32&&Ue()==32))}function ho(e){for(;Ue();)switch(fe){case e:return xe;case 34:case 39:e!==34&&e!==39&&ho(fe);break;case 40:e===41&&ho(e);break;case 92:Ue();break}return xe}function Sm(e,t){for(;Ue()&&e+fe!==57&&!(e+fe===84&&We()===47););return"/*"+Rn(t,xe-1)+"*"+ra(e===47?e:Ue())}function Cm(e){for(;!Sn(We());)Ue();return Rn(e,xe)}function Rm(e){return Hc(Kr("",null,null,null,[""],e=Fc(e),0,[0],e))}function Kr(e,t,n,r,a,i,o,s,l){for(var d=0,_=0,h=o,p=0,f=0,w=0,A=1,C=1,b=1,x=0,D="",H=a,j=i,R=r,N=D;C;)switch(w=x,x=Ue()){case 40:if(w!=108&&pe(N,h-1)==58){fo(N+=$(Wr(x),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:N+=Wr(x);break;case 9:case 10:case 13:case 32:N+=Im(w);break;case 92:N+=Am($r()-1,7);continue;case 47:switch(We()){case 42:case 47:jr(Om(Sm(Ue(),$r()),t,n),l);break;default:N+="/"}break;case 123*A:s[d++]=$e(N)*b;case 125*A:case 59:case 0:switch(x){case 0:case 125:C=0;case 59+_:b==-1&&(N=$(N,/\f/g,"")),f>0&&$e(N)-h&&jr(f>32?fc(N+";",r,n,h-1):fc($(N," ","")+";",r,n,h-2),l);break;case 59:N+=";";default:if(jr(R=dc(N,t,n,d,_,a,s,D,H=[],j=[],h),i),x===123)if(_===0)Kr(N,t,R,R,H,i,h,s,j);else switch(p===99&&pe(N,3)===110?100:p){case 100:case 108:case 109:case 115:Kr(e,R,R,r&&jr(dc(e,R,R,0,0,a,s,D,a,H=[],h),j),a,j,h,s,r?H:j);break;default:Kr(N,R,R,R,[""],j,0,s,j)}}d=_=f=0,A=b=1,D=N="",h=o;break;case 58:h=1+$e(N),f=w;default:if(A<1){if(x==123)--A;else if(x==125&&A++==0&&Em()==125)continue}switch(N+=ra(x),x*A){case 38:b=_>0?1:(N+="\f",-1);break;case 44:s[d++]=($e(N)-1)*b,b=1;break;case 64:We()===45&&(N+=Wr(Ue())),p=We(),_=h=$e(D=N+=Cm($r())),x++;break;case 45:w===45&&$e(N)==2&&(A=0)}}return i}function dc(e,t,n,r,a,i,o,s,l,d,_){for(var h=a-1,p=a===0?i:[""],f=Oo(p),w=0,A=0,C=0;w<r;++w)for(var b=0,x=An(e,h+1,h=vm(A=o[w])),D=e;b<f;++b)(D=Gc(A>0?p[b]+" "+x:$(x,/&\f/g,p[b])))&&(l[C++]=D);return ia(e,t,n,a===0?Co:s,l,d,_)}function Om(e,t,n){return ia(e,t,n,Bc,ra(bm()),An(e,2,-2),0)}function fc(e,t,n,r){return ia(e,t,n,Ro,An(e,0,r),An(e,r+1,-1),r)}function qt(e,t){for(var n="",r=Oo(e),a=0;a<r;a++)n+=t(e[a],a,e,t)||"";return n}function km(e,t,n,r){switch(e.type){case pm:if(e.children.length)break;case mm:case Ro:return e.return=e.return||e.value;case Bc:return"";case Mc:return e.return=e.value+"{"+qt(e.children,r)+"}";case Co:e.value=e.props.join(",")}return $e(n=qt(e.children,r))?e.return=e.value+"{"+n+"}":""}function Tm(e){var t=Oo(e);return function(n,r,a,i){for(var o="",s=0;s<t;s++)o+=e[s](n,r,a,i)||"";return o}}function xm(e){return function(t){t.root||(t=t.return)&&e(t)}}function Pm(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Lm=function(e,t,n){for(var r=0,a=0;r=a,a=We(),r===38&&a===12&&(t[n]=1),!Sn(a);)Ue();return Rn(e,xe)},Dm=function(e,t){var n=-1,r=44;do switch(Sn(r)){case 0:r===38&&We()===12&&(t[n]=1),e[n]+=Lm(xe-1,t,n);break;case 2:e[n]+=Wr(r);break;case 4:if(r===44){e[++n]=We()===58?"&\f":"",t[n]=e[n].length;break}default:e[n]+=ra(r)}while(r=Ue());return e},Nm=function(e,t){return Hc(Dm(Fc(e),t))},hc=new WeakMap,Um=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!hc.get(n))&&!r){hc.set(e,!0);for(var a=[],i=Nm(t,a),o=n.props,s=0,l=0;s<i.length;s++)for(var d=0;d<o.length;d++,l++)e.props[l]=a[s]?i[s].replace(/&\f/g,o[d]):o[d]+" "+i[s]}}},Bm=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function qc(e,t){switch(_m(e,t)){case 5103:return V+"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 V+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return V+e+Qr+e+we+e+e;case 6828:case 4268:return V+e+we+e+e;case 6165:return V+e+we+"flex-"+e+e;case 5187:return V+e+$(e,/(\w+).+(:[^]+)/,V+"box-$1$2"+we+"flex-$1$2")+e;case 5443:return V+e+we+"flex-item-"+$(e,/flex-|-self/,"")+e;case 4675:return V+e+we+"flex-line-pack"+$(e,/align-content|flex-|-self/,"")+e;case 5548:return V+e+we+$(e,"shrink","negative")+e;case 5292:return V+e+we+$(e,"basis","preferred-size")+e;case 6060:return V+"box-"+$(e,"-grow","")+V+e+we+$(e,"grow","positive")+e;case 4554:return V+$(e,/([^-])(transform)/g,"$1"+V+"$2")+e;case 6187:return $($($(e,/(zoom-|grab)/,V+"$1"),/(image-set)/,V+"$1"),e,"")+e;case 5495:case 3959:return $(e,/(image-set\([^]*)/,V+"$1$`$1");case 4968:return $($(e,/(.+:)(flex-)?(.*)/,V+"box-pack:$3"+we+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+V+e+e;case 4095:case 3583:case 4068:case 2532:return $(e,/(.+)-inline(.+)/,V+"$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($e(e)-1-t>6)switch(pe(e,t+1)){case 109:if(pe(e,t+4)!==45)break;case 102:return $(e,/(.+:)(.+)-([^]+)/,"$1"+V+"$2-$3$1"+Qr+(pe(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~fo(e,"stretch")?qc($(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(pe(e,t+1)!==115)break;case 6444:switch(pe(e,$e(e)-3-(~fo(e,"!important")&&10))){case 107:return $(e,":",":"+V)+e;case 101:return $(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+V+(pe(e,14)===45?"inline-":"")+"box$3$1"+V+"$2$3$1"+we+"$2box$3")+e}break;case 5936:switch(pe(e,t+11)){case 114:return V+e+we+$(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return V+e+we+$(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return V+e+we+$(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return V+e+we+e+e}return e}var Mm=function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Ro:e.return=qc(e.value,e.length);break;case Mc:return qt([wn(e,{value:$(e.value,"@","@"+V)})],r);case Co:if(e.length)return wm(e.props,function(a){switch(ym(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return qt([wn(e,{props:[$(a,/:(read-\w+)/,":"+Qr+"$1")]})],r);case"::placeholder":return qt([wn(e,{props:[$(a,/:(plac\w+)/,":"+V+"input-$1")]}),wn(e,{props:[$(a,/:(plac\w+)/,":"+Qr+"$1")]}),wn(e,{props:[$(a,/:(plac\w+)/,we+"input-$1")]})],r)}return""})}},Gm=[Mm],Jm=function(e){var t=e.key;if(t==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(w){var A=w.getAttribute("data-emotion");A.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var r=e.stylisPlugins||Gm,a={},i,o=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(w){for(var A=w.getAttribute("data-emotion").split(" "),C=1;C<A.length;C++)a[A[C]]=!0;o.push(w)});var s,l=[Um,Bm];{var d,_=[km,xm(function(w){d.insert(w)})],h=Tm(l.concat(r,_)),p=function(w){return qt(Rm(w),h)};s=function(w,A,C,b){d=C,p(w?w+"{"+A.styles+"}":A.styles),b&&(f.inserted[A.name]=!0)}}var f={key:t,sheet:new hm({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:s};return f.sheet.hydrate(o),f};function Fm(e){for(var t=0,n,r=0,a=e.length;a>=4;++r,a-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&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 Hm={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},qm=/[A-Z]|^ms/g,jm=/_EMO_([^_]+?)_([^]*?)_EMO_/g,jc=function(e){return e.charCodeAt(1)===45},mc=function(e){return e!=null&&typeof e!="boolean"},Qi=Pm(function(e){return jc(e)?e:e.replace(qm,"-$&").toLowerCase()}),pc=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(jm,function(n,r,a){return ht={name:r,styles:a,next:ht},r})}return Hm[e]!==1&&!jc(e)&&typeof t=="number"&&t!==0?t+"px":t};function Zr(e,t,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 ht={name:a.name,styles:a.styles,next:ht},a.name;var i=n;if(i.styles!==void 0){var o=i.next;if(o!==void 0)for(;o!==void 0;)ht={name:o.name,styles:o.styles,next:ht},o=o.next;var s=i.styles+";";return s}return Vm(e,t,n)}}var l=n;if(t==null)return l;var d=t[l];return d!==void 0?d:l}function Vm(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a<n.length;a++)r+=Zr(e,t,n[a])+";";else for(var i in n){var o=n[i];if(typeof o!="object"){var s=o;t!=null&&t[s]!==void 0?r+=i+"{"+t[s]+"}":mc(s)&&(r+=Qi(i)+":"+pc(i,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++)mc(o[l])&&(r+=Qi(i)+":"+pc(i,o[l])+";");else{var d=Zr(e,t,o);switch(i){case"animation":case"animationName":{r+=Qi(i)+":"+d+";";break}default:r+=i+"{"+d+"}"}}}return r}var vc=/label:\s*([^\s;{]+)\s*(;|$)/g,ht;function Zi(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,a="";ht=void 0;var i=e[0];if(i==null||i.raw===void 0)r=!1,a+=Zr(n,t,i);else{var o=i;a+=o[0]}for(var s=1;s<e.length;s++)if(a+=Zr(n,t,e[s]),r){var l=i;a+=l[s]}vc.lastIndex=0;for(var d="",_;(_=vc.exec(a))!==null;)d+="-"+_[1];var h=Fm(a)+d;return{name:h,styles:a,next:ht}}function Vc(e,t,n){var r="";return n.split(" ").forEach(function(a){e[a]!==void 0?t.push(e[a]+";"):a&&(r+=a+" ")}),r}var $m=function(e,t,n){var r=e.key+"-"+t.name;e.registered[r]===void 0&&(e.registered[r]=t.styles)},Wm=function(e,t,n){$m(e,t);var r=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var a=t;do e.insert(t===a?"."+r:"",a,e.sheet,!0),a=a.next;while(a!==void 0)}};function gc(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function _c(e,t,n){var r=[],a=Vc(e,r,n);return r.length<2?n:a+t(r)}var Km=function(e){var t=Jm(e);t.sheet.speedy=function(o){this.isSpeedy=o},t.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=Zi(s,t.registered,void 0);return Wm(t,d),t.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=Zi(s,t.registered),_="animation-"+d.name;return gc(t,{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=Zi(s,t.registered);gc(t,d)},i=function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return _c(t.registered,n,zm(s))};return{css:n,cx:i,injectGlobal:a,keyframes:r,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:Vc.bind(null,t.registered),merge:_c.bind(null,t.registered,n)}},zm=function e(t){for(var n="",r=0;r<t.length;r++){var a=t[r];if(a!=null){var i=void 0;switch(typeof a){case"boolean":break;case"object":{if(Array.isArray(a))i=e(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},Xm=Km({key:"css"}),$t=Xm.css,mo,Ne,eo,yc,wc=0,$c=[],he=M,bc=he.__b,Ec=he.__r,Ic=he.diffed,Ac=he.__c,Sc=he.unmount,Cc=he.__;function Ym(e,t){he.__h&&he.__h(Ne,e,wc||t),wc=0;var n=Ne.__H||(Ne.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Wc(e,t){var n=Ym(mo++,7);return ep(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Qm(){for(var e;e=$c.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(zr),e.__H.__h.forEach(po),e.__H.__h=[]}catch(t){e.__H.__h=[],he.__e(t,e.__v)}}he.__b=function(e){Ne=null,bc&&bc(e)},he.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Cc&&Cc(e,t)},he.__r=function(e){Ec&&Ec(e),mo=0;var t=(Ne=e.__c).__H;t&&(eo===Ne?(t.__h=[],Ne.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(zr),t.__h.forEach(po),t.__h=[],mo=0)),eo=Ne},he.diffed=function(e){Ic&&Ic(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&($c.push(t)!==1&&yc===he.requestAnimationFrame||((yc=he.requestAnimationFrame)||Zm)(Qm)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),eo=Ne=null},he.__c=function(e,t){t.some(function(n){try{n.__h.forEach(zr),n.__h=n.__h.filter(function(r){return!r.__||po(r)})}catch(r){t.some(function(a){a.__h&&(a.__h=[])}),t=[],he.__e(r,n.__v)}}),Ac&&Ac(e,t)},he.unmount=function(e){Sc&&Sc(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{zr(r)}catch(a){t=a}}),n.__H=void 0,t&&he.__e(t,n.__v))};var Rc=typeof requestAnimationFrame=="function";function Zm(e){var t,n=function(){clearTimeout(r),Rc&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Rc&&(t=requestAnimationFrame(n))}function zr(e){var t=Ne,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Ne=t}function po(e){var t=Ne;e.__c=e.__(),Ne=t}function ep(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}var tp=Symbol.for("preact-signals");function oa(){if(mt>1)mt--;else{for(var e,t=!1;bn!==void 0;){var n=bn;for(bn=void 0,vo++;n!==void 0;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&zc(n))try{n.c()}catch(a){t||(e=a,t=!0)}n=r}}if(vo=0,mt--,t)throw e}}function Te(e){if(mt>0)return e();mt++;try{return e()}finally{oa()}}var Q=void 0,bn=void 0,mt=0,vo=0,ea=0;function Kc(e){if(Q!==void 0){var t=e.n;if(t===void 0||t.t!==Q)return t={i:0,S:e,p:Q.s,n:void 0,t:Q,e:void 0,x:void 0,r:t},Q.s!==void 0&&(Q.s.n=t),Q.s=t,e.n=t,32&Q.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=Q.s,t.n=void 0,Q.s.n=t,Q.s=t),t}}function ve(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}ve.prototype.brand=tp;ve.prototype.h=function(){return!0};ve.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)};ve.prototype.U=function(e){if(this.t!==void 0){var t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}};ve.prototype.subscribe=function(e){var t=this;return kn(function(){var n=t.value,r=Q;Q=void 0;try{e(n)}finally{Q=r}})};ve.prototype.valueOf=function(){return this.value};ve.prototype.toString=function(){return this.value+""};ve.prototype.toJSON=function(){return this.value};ve.prototype.peek=function(){var e=Q;Q=void 0;try{return this.value}finally{Q=e}};Object.defineProperty(ve.prototype,"value",{get:function(){var e=Kc(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(vo>100)throw new Error("Cycle detected");this.v=e,this.i++,ea++,mt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{oa()}}}});function Z(e){return new ve(e)}function zc(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 Xc(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Yc(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function Wt(e){ve.call(this,void 0),this.x=e,this.s=void 0,this.g=ea-1,this.f=4}(Wt.prototype=new ve).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ea))return!0;if(this.g=ea,this.f|=1,this.i>0&&!zc(this))return this.f&=-2,!0;var e=Q;try{Xc(this),Q=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return Q=e,Yc(this),this.f&=-2,!0};Wt.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)}ve.prototype.S.call(this,e)};Wt.prototype.U=function(e){if(this.t!==void 0&&(ve.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)}};Wt.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(Wt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Kc(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function En(e){return new Wt(e)}function Qc(e){var t=e.u;if(e.u=void 0,typeof t=="function"){mt++;var n=Q;Q=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,ko(e),r}finally{Q=n,oa()}}}function ko(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Qc(e)}function np(e){if(Q!==this)throw new Error("Out-of-order effect");Yc(this),Q=e,this.f&=-2,8&this.f&&ko(this),oa()}function On(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}On.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()}};On.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Qc(this),Xc(this),mt++;var e=Q;return Q=this,np.bind(this,e)};On.prototype.N=function(){2&this.f||(this.f|=2,this.o=bn,bn=this)};On.prototype.d=function(){this.f|=8,1&this.f||ko(this)};function kn(e){var t=new On(e);try{t.c()}catch(n){throw t.d(),n}return t.d.bind(t)}var Zc,to,eu=[];kn(function(){Zc=this.N})();function Kt(e,t){M[e]=t.bind(null,M[e]||function(){})}function ta(e){to&&to(),to=e&&e.S()}function tu(e){var t=this,n=e.data,r=nu(n);r.value=n;var a=Wc(function(){for(var s=t,l=t.__v;l=l.__;)if(l.__c){l.__c.__$f|=4;break}var d=En(function(){var f=r.value.value;return f===0?0:f===!0?"":f||""}),_=En(function(){return!Array.isArray(d.value)&&!Mi(d.value)}),h=kn(function(){if(this.N=ru,_.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),p=t.__$u.d;return t.__$u.d=function(){h(),p.call(this)},[_,d]},[]),i=a[0],o=a[1];return i.value?o.peek():o.value}tu.displayName="_st";Object.defineProperties(ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:tu},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Kt("__b",function(e,t){if(typeof t.type=="string"){var n,r=t.props;for(var a in r)if(a!=="children"){var i=r[a];i instanceof ve&&(n||(t.__np=n={}),n[a]=i,r[a]=i.peek())}}e(t)});Kt("__r",function(e,t){ta();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(a){var i;return kn(function(){i=this}),i.c=function(){r.__$f|=1,r.setState({})},i}())),ta(n),e(t)});Kt("__e",function(e,t,n,r){ta(),e(t,n,r)});Kt("diffed",function(e,t){ta();var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,a=t.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=rp(n,l,_,a),i[l]=d):d.o(_,a)}}}e(t)});function rp(e,t,n,r){var a=t in e&&e.ownerSVGElement===void 0,i=Z(n);return{o:function(o,s){i.value=o,r=s},d:kn(function(){this.N=ru;var o=i.value.value;r[t]!==o&&(r[t]=o,a?e[t]=o:o?e.setAttribute(t,o):e.removeAttribute(t))})}}Kt("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__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=t.__c;if(o){var s=o.__$u;s&&(o.__$u=void 0,s.d())}}e(t)});Kt("__h",function(e,t,n,r){(r<3||r===9)&&(t.__$f|=2),e(t,n,r)});De.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u,r=n&&n.s!==void 0;for(var a in t)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 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 nu(e){return Wc(function(){return Z(e)},[])}var ap=function(e){queueMicrotask(function(){queueMicrotask(e)})};function ip(){Te(function(){for(var e;e=eu.shift();)Zc.call(e)})}function ru(){eu.push(this)===1&&(M.requestAnimationFrame||ap)(ip)}var be=$t`
4
4
  inset: 0;
5
5
  clear: none;
6
6
  float: none;