@jolibox/implement 1.1.54 → 1.1.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"packages/implement/.eslintrc.js": "7a3d2747dc887655ca9e2d3ff621f7dfd98500b9",
|
|
5
5
|
"packages/implement/README.md": "5660cd88848b7a5428394cc34d881a35dd402188",
|
|
6
6
|
"packages/implement/esbuild.config.js": "876db4e384d8543b66a0b61d8f7b277a36dfb4e0",
|
|
7
|
-
"packages/implement/package.json": "
|
|
7
|
+
"packages/implement/package.json": "2cf390658839c83bd5fd092d2bc501455cbfc653",
|
|
8
8
|
"packages/implement/src/common/ads/ads-action-detection.ts": "5a7b9f85d7eab9e744f8a9fc7638063f43baa214",
|
|
9
9
|
"packages/implement/src/common/ads/anti-cheating.test.ts": "e2ff3dc6760cfd28d0f8c15703d7fb20d43df583",
|
|
10
10
|
"packages/implement/src/common/ads/anti-cheating.ts": "a3ffb6a78e289e1c0ce45c7f7c0cee000e75e541",
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Kc=Object.create;var ui=Object.defineProperty,Wc=Object.defineProperties,zc=Object.getOwnPropertyDescriptor,Qc=Object.getOwnPropertyDescriptors,Yc=Object.getOwnPropertyNames,Pr=Object.getOwnPropertySymbols,Ca=Object.getPrototypeOf,ci=Object.prototype.hasOwnProperty,ka=Object.prototype.propertyIsEnumerable,Xc=Reflect.get;var Ra=(e,t,r)=>t in e?ui(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Q=(e,t)=>{for(var r in t||(t={}))ci.call(t,r)&&Ra(e,r,t[r]);if(Pr)for(var r of Pr(t))ka.call(t,r)&&Ra(e,r,t[r]);return e},ke=(e,t)=>Wc(e,Qc(t));var Wt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ta=(e,t)=>{var r={};for(var n in e)ci.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Pr)for(var n of Pr(e))t.indexOf(n)<0&&ka.call(e,n)&&(r[n]=e[n]);return r};var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var di=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Zc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Yc(t))!ci.call(e,i)&&i!==r&&ui(e,i,{get:()=>t[i],enumerable:!(n=zc(t,i))||n.enumerable});return e};var fi=(e,t,r)=>(r=e!=null?Kc(Ca(e)):{},Zc(t||!e||!e.__esModule?ui(r,"default",{value:e,enumerable:!0}):r,e));var xa=(e,t,r)=>Xc(Ca(e),r,t);var P=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});function ld(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Ba(e){return new Promise(t=>setTimeout(t,e))}function wi(e){return typeof e=="string"}function Fa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function ja(e){return typeof e=="object"&&Array.isArray(e)}function ud(e){return typeof e=="undefined"}function cd(e){return ud(e)||e===null}function dd(e){return typeof e=="function"}function Ja(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Va(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,o){for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=i[a],u=o[a],d=r(s,u,a,i,o);d!==void 0?i[a]=d:Da(u)&&Da(s)?i[a]=n(Ua({},s),u):Array.isArray(u)&&Array.isArray(s)?i[a]=[...s,...u]:i[a]=u}return i}return n(e,t)}function Da(e){return e&&typeof e=="object"&&e.constructor===Object}function Ha(e,t){if(Array.isArray(e))return e.concat(t)}function Xt(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:u=!0}=r,d=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),y=function(...h){i=h,o=this;let p=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,u&&!p&&d()},t),p)return d()};return y.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},y.flush=()=>{if(n)return clearTimeout(n),n=null,d()},y}function md(e,t){return(...r)=>t(e,...r)}function Ka(e){return t=>md(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new hd(`${i}`))}})}function zt(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function Dr(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function wd(e){let t=e.location?Dr(e.location,La):null,r=e.target?Dr(e.target,La):null;return Dr(od(Ua({},e),{location:t,target:r}),gd)}function Si(e){let t=e.events.map(n=>wd(n)),r=Dr(e.device,yd);return[e.protocolVersion,t,r,e.project]}function bd(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function Qa(e,t,r){let n=window.location.hostname,i=n.split("."),o=r?t:e;if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n))return`${o}.jolibox.com`;if(i.length>=2){let a=i.slice(-2).join(".");return`${o}.${a}`}return`${o}.jolibox.com`}function ki(e){return Qa("api","stg-api",e)}function At(e){return`https://${ki(e)}`}function kd(e){return Qa("collect","stg-collect",e)}function Ya(e){return`https://${kd(e)}`}function Pd(e){return new Promise(t=>Xa(e)(t))}function Xa(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function Dd(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Yt(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function Ld(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Ud(e[n],t[n])}function Ud(e,t){if(wi(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(dd(t)){try{if(e instanceof t)return}catch(r){}if(!cd(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 Md(){return typeof globalThis!="undefined"?globalThis[Za]:void 0}function Bd(e){typeof globalThis!="undefined"&&(globalThis[Za]=e)}function _e(e=!1){let t=Md();if(!e&&t)return t;let r=new Nr,n=new gi,i={registerCommand(o,a,s){r.registerCommand({id:o,handler:a,metadata:s})},executeCommand(o,...a){return n.executeCommand(o,...a)},excuteCommandSync(o,...a){return n.executeCommandThowErr(o,...a)}};return Bd(i),i}var yi,ed,td,rd,Oa,nd,id,Pa,Ua,od,ad,Ma,sd,fd,bi,Ei,$a,Ga,hd,qa,Lr,Ur,Ai,Ne,mi,pd,Ii,Na,vd,ct,Et,_d,La,gd,yd,dt,bt,Ed,Ee,Ad,Id,Sd,Wa,Ri,Ci,Rd,Cd,za,pi,te,Td,xd,Qt,Yt,je,_i,Od,hi,Nd,ft,Nr,gi,Za,V=Z(()=>{"use strict";yi=Object.defineProperty,ed=Object.defineProperties,td=Object.getOwnPropertyDescriptor,rd=Object.getOwnPropertyDescriptors,Oa=Object.getOwnPropertySymbols,nd=Object.prototype.hasOwnProperty,id=Object.prototype.propertyIsEnumerable,Pa=(e,t,r)=>t in e?yi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ua=(e,t)=>{for(var r in t||(t={}))nd.call(t,r)&&Pa(e,r,t[r]);if(Oa)for(var r of Oa(t))id.call(t,r)&&Pa(e,r,t[r]);return e},od=(e,t)=>ed(e,rd(t)),ad=(e,t)=>{for(var r in t)yi(e,r,{get:t[r],enumerable:!0})},Ma=(e,t,r,n)=>{for(var i=n>1?void 0:n?td(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&yi(t,r,i),i},sd=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}fd=(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))(fd||{}),bi=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}},Ei=class extends bi{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},$a=class extends bi{constructor(){super(...arguments),this.kind="USER_ERROR"}},Ga=class extends $a{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},hd=class extends $a{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="USER_CUSTOM_ERROR",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},qa=class extends Ei{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},Lr=class extends Ei{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},Ur=class extends bi{constructor(e,t,r,n,i){super(e),this.message=e,this.code=t,this.kind="API_ERROR",this.name="API_ERROR",r&&(this.errorType=r),n!==void 0&&(this.stack=n),i&&(this.priority=i)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},Ai=class extends Ei{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Ne={log:zt("log"),warn:zt("warn"),info:zt("info"),error:zt("error"),debug:zt("debug")};Object.assign(globalThis,{logger:Ne});mi=Symbol.for("Jolibox.canIUseMap"),pd={};globalThis[mi]||(globalThis[mi]=pd);Ii={get config(){return globalThis[mi]}},Na=Symbol.for("Jolibox.canIUseMap.native"),vd={};globalThis[Na]||(globalThis[Na]=vd);ct=(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))(ct||{}),Et=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Et||{}),_d=(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))(_d||{}),La=["name","params"],gd=["name","type","location","target","extra","timestamp","userId"],yd=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];dt=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});bd();bt=typeof window=="undefined",Ed=()=>!bt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Ee={isiOS:!bt&&(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:!bt&&navigator.userAgent.includes("Android"),isMac:!bt&&navigator.userAgent.includes("Mac"),isFacebook:!bt&&navigator.userAgent.includes("FB_IAB"),isPC:!bt&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},Ad=()=>Ee.isiOS?"iOS":Ee.isAndroid?"Android":Ee.isMac?"Mac":Ee.isFacebook?"Facebook":"PC",Id="device_id",Sd="advertising_id",Wa=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,dt()),window.__joliboxLocalStorage__.getItem(e)),Ri=()=>new URLSearchParams(window.location.search).get("deviceId")||Wa(Id),Ci=()=>new URLSearchParams(window.location.search).get("advertisingId")||Wa(Sd),Rd=e=>e.charAt(0).toUpperCase()+e.slice(1),Cd=()=>{var e;let t=new URLSearchParams(window.location.search);return Rd((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},za=e=>{if(Ed())return window.navigator.userAgent;let t="JoliboxWebSDK",r=Ad(),n=navigator.language,i=Ri(),o=Ci();return`${t} (${Cd()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`};pi=class vi{constructor(t){this.element=t,this.next=vi.Undefined,this.prev=vi.Undefined}};pi.Undefined=new pi(void 0);te=pi,Td=class{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let e=this._first;for(;e!==te.Undefined;){let t=e.next;e.prev=te.Undefined,e.next=te.Undefined,e=t}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new te(e);if(this._first===te.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==te.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==te.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==te.Undefined&&e.next!==te.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===te.Undefined&&e.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):e.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):e.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==te.Undefined;)yield e.element,e=e.next}},xd=0,Qt=class{constructor(e){this.value=e,this.id=xd++}},Yt=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof Qt&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,u;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let d=new Qt(t);return this._listeners?this._listeners instanceof Qt?this._listeners=[this._listeners,d]:this._listeners.push(d):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=d,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(u=(s=this.options)==null?void 0:s.onDidAddListener)==null||u.call(s,this),this._size++,()=>{var y,h,p,f;if(!this._disposed){if(this._listeners instanceof Qt)this._listeners.id===d.id&&(this._listeners=void 0,this._size=0,(h=(y=this.options)==null?void 0:y.onDidRemoveLastListener)==null||h.call(y));else if(this._listeners){let 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 r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Qt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},je=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Yt,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new Td,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},_i={};ad(_i,{None:()=>Od,filter:()=>Dd,once:()=>Xa,toPromise:()=>Pd});Od=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});hi=Symbol.for("Jolibox.hostEmitter"),Nd=()=>{let e=new je;return globalThis[hi]||(globalThis[hi]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[hi]},ft=Nd();Nr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Yt,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(...i){return Ld(i,r),n(...i)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};Nr=Ma([Ja],Nr);gi=class{constructor(){this._onWillExecuteCommand=new Yt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Yt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Nr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=ld(3e4)),this._starActivation}executeCommand(e,...t){return sd(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),_i.toPromise(_i.filter(this.registry.onDidRegisterCommand,r=>r===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let r=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),n}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e,...t){let r=!1;try{return e(...t)}finally{r=!0}}};gi=Ma([Ja],gi);Za=Symbol.for("Jolibox.commands")});function Te(e,t={}){Ti.emit("ERROR_REPORT",{error:e,options:t})}var Ti,ht,Ge=Z(()=>{"use strict";V();V();Ti=new je,ht=new je;Te.debounce=Xt(Te,50,{leading:!0})});var xi,Fd,es,ts,rs=Z(()=>{"use strict";V();Ge();xi=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4===0?"":"=".repeat(4-t.length%4),n=atob(t+r);try{return JSON.parse(n)}catch(i){return{}}},Fd=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},es=e=>{var t;try{let i=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(i!=null&&i.length){let[o,a,s]=i;return{headerJson:xi(o),payloadJson:xi(a),signature:xi(s)}}else throw"joli_source is missing"}catch(r){return Te(new qa(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},ts=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=Fd(e),o=r[2];return`${n}.${i}.${o}`}return t}});var jd,Mr,ns,Oi=Z(()=>{"use strict";V();jd="1.1.54",Mr=()=>jd,ns=()=>{let e=Mr();return`${za(e)}`}});function Di(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var Jd,is,Pi,os,ne,Vd,D,me=Z(()=>{"use strict";V();rs();Oi();V();Jd={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:Ri(),adId:Ci(),pixelRatio:window.devicePixelRatio||1,platform:Ee.isAndroid?"android":Ee.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:Mr()},schema:window.location.href,platform:Ee.isAndroid?"android":Ee.isiOS?"ios":"h5"},Pi=(is=globalThis.joliboxJSCore)==null?void 0:is.env,ne=Object.assign({},(os=Pi==null?void 0:Pi())!=null?os:Jd);Vd=()=>{var f,w,A,R,b,T,N,j,H,S,L;let{payloadJson:e,headerJson:t,signature:r}=ne.schema.length?es(ne.schema):{},n=`${ne.deviceInfo.did}-${new Date().getTime()}`,o=new URL(ne.schema.length?ne.schema:window.location.href).searchParams,a=(A=(w=(f=o.get("mpId"))!=null?f:o.get("appId"))!=null?w:o.get("gameId"))!=null?A:"",s=(T=(b=(R=ne.clientSessionId)!=null?R:e==null?void 0:e.sessionId)!=null?b:o.get("sessionId"))!=null?T:n,u=!!((j=(N=e==null?void 0:e.testAdsMode)!=null?N:e==null?void 0:e.__testAdsMode)!=null?j:o.get("testAdsMode")==="true"),d=(L=(S=(H=e==null?void 0:e.joliboxEnv)!=null?H:e==null?void 0:e.__joliboxEnv)!=null?S:o.get("joliboxEnv"))!=null?L:"production",y=d==="staging",h=t==null?void 0:t.channel,p=e==null?void 0:e.__shouldInterupt;return{get startTime(){var x;return(x=performance.timeOrigin)!=null?x:performance.timing.navigationStart},get testMode(){return y},get testAdsMode(){return u},get joliboxEnv(){return d},get joliSource(){var x;return(x=o.get("joliSource"))!=null?x:null},get mpId(){var x;return(x=a!=null?a:e==null?void 0:e.id)!=null?x:""},get mpVersion(){var x;return(x=t==null?void 0:t.ver)!=null?x:Mr()},get mpType(){var x,M;return(M=(x=t==null?void 0:t.__mpType)!=null?x:e==null?void 0:e.__mpType)!=null?M:"game"},get platform(){var x;return((x=ne.platform)!=null?x:ne.deviceInfo.platform).toLowerCase()},get deviceInfo(){return ne.deviceInfo},get sdkInfo(){return ne.sdkInfo},get hostInfo(){return ne.hostInfo},get hostUserInfo(){return ne.hostUserInfo},get sessionId(){var x,M;return(M=(x=ne.clientSessionId)!=null?x:s)!=null?M:n},get channel(){return h},get webviewId(){var x;return(x=ne.webviewId)!=null?x:-1},get shouldInterupt(){return p},get from(){return e==null?void 0:e.__from},get baseApiHost(){return ki(y)},get adId(){var x;return(x=ne.deviceInfo.adId)!=null?x:ne.deviceInfo.did},get language(){return ne.deviceInfo.lang},get sdkEnvironment(){return Di("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":Di("gamedistribution","jolibox")?"gamedistribution":Di("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var W,ee,he;let x=(W=ne.deviceInfo.pixelRatio)!=null?W:1,M=(ee=ne.deviceInfo.statusBarHeight)!=null?ee:e==null?void 0:e.__androidStatusBarHeight,K=(he=ne.deviceInfo.navigationBarHeight)!=null?he:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:M!==void 0?M/x:20,navigationBarHeight:K!==void 0?K/x:10}},get abTests(){var x,M;return(M=(x=ne.abValues)==null?void 0:x.split(","))!=null?M:[]},onEnvConfigChanged:x=>{Va(ne,x,Ha)},encodeJoliSourceQuery:x=>{var M,K;return t&&r?ts(Q(Q({},e),x),(M=o.get("joliSource"))!=null?M:""):(K=o.get("joliSource"))!=null?K:""},setDoExitDirectly:()=>{p=!1}}},D=Vd()});var Ni,ss,Hd,$d,as,Gd,ls=Z(()=>{"use strict";V();Ge();me();V();Ni=!1,ss=(e,t)=>e==null?!1:t in e,Hd=e=>ss(e,"kind"),$d=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},as=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=D.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:$d(e.name)},i=ke(Q({},n),{env:t.environment,isFromUser:r});r?ht.emit("GLOBAL_USER_ERROR",e,i):ht.emit("GLOBAL_ERROR",e,i)},Gd=e=>ss(e,"kind")&&e.kind==="USER_ERROR";Ti.on("ERROR_REPORT",({error:e,options:t})=>{if(Ni)return;Ni=!0;let r=Hd(e)&&e.raw?e.raw:e;try{let n=Gd(e);as(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new Ai(`${i}, origin error: ${r.message}`);Ne.error(o),as(new Ai(o.message),{environment:t.environment},!1)}finally{Ni=!1}})});var Li,Ui=Z(()=>{"use strict";Ge();V();Ge();Li=e=>new Ga(e)});function us(e,t){let r=(n,i,o)=>{let d=i!=null?i:{},{eventType:a}=d,s=Ta(d,["eventType"]),u=ke(Q({tag:n,eventType:o!=null?o:a!=null?a:ct.Other},t),{extra:Q({},s)});n=="globalJsError"?Te(new Lr(JSON.stringify(u))):e("systemLog",u,D.webviewId)};return r.debounce=Xt(r,500,{leading:!0}),r}function cs(e){let t=(r,n,i)=>{var s;let o=(s=i&&JSON.stringify(i))!=null?s:0,a={speed_value_type:r,total_duration:n};o&&Object.assign(a,{extra:o}),e("joliboxSpeedAnalysis",a)};return t.debounce=Xt(t,500,{leading:!0}),t}var ds=Z(()=>{"use strict";V();V();Ge();me()});function fs(e,t){let r=us(e,t),n=cs(r);return{track:r,trackPerformance:n}}var hs=Z(()=>{"use strict";ds()});var Mi=Z(()=>{"use strict"});var Br,ms=Z(()=>{"use strict";me();V();V();Br=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return P(this,null,function*(){let r=`${At(D.testMode)}/api/fe-configs/js-sdk/samples-config`,n=yield(yield fetch(r)).json();this.samplesConfig=n})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:r}=this.samplesConfig;for(let[n,i]of Object.entries(r))if(i.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,i,o,a,s;let{nativeSDKVersion:t,jssdkVersion:r}=D.sdkInfo;return{platform:1e3,os:D.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(o=(i=D.hostInfo)==null?void 0:i.aid)!=null?o:"1",model:(a=D.deviceInfo.model)!=null?a:"UnknownModel",brand:(s=D.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:D.deviceInfo.did,jsSdkVersion:r,extra:{}}}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:"GamePage",params:r}}trackEvent(t,r,n){return P(this,null,function*(){if(this.checkIsSampled(t))return;let i=t.location?t.location:yield this.getLocation(),o=t.target||null,a=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let s=this.deviceInfo,d={protocolVersion:"1.0.0",events:[ke(Q({},t),{location:i,target:o,extra:a,timestamp:Date.now(),userId:null})],device:s,project:r};try{n?yield this.doReport(Si(d),n):yield this.doReport(Si(d))}catch(y){Ne.log("[Jolibox SDK] report API error",y)}})}}});var Bi=Z(()=>{"use strict";hs();Mi();ms()});var Fi,ps,qe,Fr,Be,It=Z(()=>{"use strict";Oi();me();V();Fi=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(ps=AbortSignal.timeout)!=null||(AbortSignal.timeout=Fi);qe=class e{constructor(){this.httpClients=new WeakSet;this.networkRequests=[];this.maxRequestsToTrack=20;this.getNetworkStatus=()=>this.networkRequests.length===0?!0:this.networkRequests.filter(n=>n).length/this.networkRequests.length>=.6}static getInstance(){return e._instance||(e._instance=new e),e._instance}create(t){let r=new Fr(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},Fr=class{constructor(t){this.xua=ns();this.getJoliSource=()=>D.joliSource;var n;let r=At(D.testMode);this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return P(this,null,function*(){try{let{query:n,timeout:i}=r!=null?r:{},{headers:o}=r!=null?r:{},a=n?new URLSearchParams(n):null,s=a==null?void 0:a.toString(),u=`${this.baseUrl}${t}${s?`?${s}`:""}`,d=this.xua,y=this.getJoliSource();o=Object.assign({},o!=null?o:{},d?{"x-user-agent":d}:{},y?{"x-joli-source":y}:{});let h=yield fetch(u,{method:"GET",headers:o,credentials:"include",signal:Fi(i!=null?i:3e4)});return qe.getInstance().recordNetworkRequest(!0),yield h.json()}catch(n){throw qe.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return P(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,y=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{},{"x-os-type":Ee.isAndroid?"ANDROID":Ee.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let p=yield fetch(d,{method:"POST",headers:a,body:JSON.stringify(n),signal:Fi(o!=null?o:3e4),credentials:"include"});qe.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(n){throw qe.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return P(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,y=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{});let p=yield fetch(d,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!p.ok)throw qe.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${p.status}`);return qe.getInstance().recordNetworkRequest(!0),yield p.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=Fr;Be=qe.getInstance()});var ji,jr,Ji=Z(()=>{"use strict";me();Bi();It();V();ji=class extends Br{constructor(){super(...arguments);this.httpClient=Be.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var r;return Ya((r=D.testMode)!=null?r:!1)}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},jr=new ji});var qd,vs=Z(()=>{"use strict";ls();V();Ui();V();Ji();me();qd=(e,t)=>{var i,o,a;let r={message:t.message,stack:(i=t.stack)!=null?i:"",errorType:t.name,source:0},n={name:e,type:ct.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:null};jr.trackEvent(n,Et.WebSDK)};ht.on("GLOBAL_ERROR",(e,t)=>{qd(t.tag,e)});ht.on("GLOBAL_USER_ERROR",(e,t)=>{Ne.log("UserError",e,t)})});var Jr,_s=Z(()=>{"use strict";Jr=class{constructor(t,r){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.timer=this.createRAFTimer(t=>{this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t})});this.interval=r!=null?r:5*1e3,t.on("visible",n=>{this.visible=n})}start(t){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:t!=null?t:0}}),this.tracker("OpenGame",{duration:t!=null?t:0}),this.timer.start()}close(t){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:t}}),this.tracker("CloseGame",{duration:t}),this.timer.stop()}createRAFTimer(t){let r=Date.now(),n,i,o=!1,a=0,s=()=>{if(!o)return;let f=Date.now(),w=f-r;w>=this.interval&&(this.visible&&(a+=Math.min(w,this.interval+1e3),t(a)),r=f),n=requestAnimationFrame(s)},u=()=>{y(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let f=Date.now();f-r>=this.interval&&(r=f)},this.interval)},d=()=>{h(),r=Date.now(),n=requestAnimationFrame(s)},y=()=>{n&&(cancelAnimationFrame(n),n=0)},h=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",f=>{o&&(console.log("visible",f),f?d():u())});let p=this.visible;return{start(){o||(o=!0,p?d():u())},stop(){o=!1,y(),h()}}}}});var Vr,gs=Z(()=>{"use strict";me();_s();It();Vr=class extends Jr{constructor(r,n,i){super(n,i);this.httpClient=Be.create();this.gameId=D.mpId,this.sessionId=D.sessionId,this.track=r}reporter(r){return P(this,null,function*(){let{event:n,params:i,extraParams:o}=r,a={eventType:n,gameInfo:Q({gameId:this.gameId,sessionId:this.sessionId},i)};o&&Object.assign(a,o),yield this.httpClient.post("/api/base/app-event",{data:a})})}tracker(r,n=null){this.track(r,n)}}});var ys,Kd,Le,Wd,Vi,Ke,it=Z(()=>{"use strict";vs();V();V();Bi();Ji();gs();me();Mi();ys=_e(),Kd={type:Et.WebSDK,platform:"h5",jssdk_version:D.sdkInfo.jssdkVersion,mp_id:D.mpId,mp_version:D.mpVersion},{track:Le,trackPerformance:Wd}=fs((...e)=>{var a,s,u,d;let[,t]=e,r=t,n=Fa(r.extra)?r.extra:wi(r.extra)?JSON.parse(r.extra):{},i=ke(Q({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(s=r.mp_version)!=null?s:""}),o={name:t.tag,type:ct.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(d=(u=D.hostUserInfo)==null?void 0:u.uid)!=null?d:null};jr.trackEvent(o,Et.WebSDK)},Kd);ys.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Wd(e,t,r)});ys.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Le(e,t)});Vi=new je,Ke=new Vr(Le,Vi)});function ws(e){let t=Ii.config[e];return t||(t={},Ii.config[e]=t),(r,n)=>{if(t[r]){Ne.warn(`[can i use] ${r} already registered`);return}t[r]=Q({},n)}}var bs=Z(()=>{"use strict";V()});function Hi(e){Es=e}function Hr(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>Hr(t)):Object.keys(e).reduce((t,r)=>(t[r]=Hr(e[r]),t),{})}function We(e){return typeof e=="number"}function $i(e){let t=Gi(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function Gi(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var Es,ce,$r,Gr,qr,Kr,St,Wr,zr,Qr,Yr,Xr,Zr,en,tn,rn,nn,on,an,qi=Z(()=>{"use strict";Es=!1;ce=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(Es)if(typeof t=="string")this.errors.push(t);else{let r=`${this.path} should be ${t.expect}`;this._optional&&t.expect!=="undefined"?r+=" or undefined, ":r+=", ",r+=`but got ${$i(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return Hr(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:Hr(this._default)}optional(){return this._optional=!0,this}};$r=class extends ce{validate(t){return this._optional&&t===void 0?!0:We(t)?We(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):We(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):We(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}},Gr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},qr=class extends ce{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(We(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(We(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}},Kr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},St=class extends ce{validate(t){return!0}},Wr=class extends ce{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},zr=class extends ce{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},Qr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Yr=class extends ce{constructor(...t){super(),this._items=t}validate(t){if(this._optional&&t===void 0)return!0;if(!this._items.includes(t)){let r=this._items.map(n=>JSON.stringify(n)).join(", ");return this.fail(`expect ${this.path} to be one of ${r}, but got ${$i(t)}`)}return!0}},Xr=class extends ce{constructor(r){super();this._item=r}validate(r){if(this._optional&&r===void 0)return!0;if(!Array.isArray(r))return this.fail({expect:"array",actual:r});if(We(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(We(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(We(this._length)&&r.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let n=this._item;if(!n)return!0;let i=!0;if(r.forEach((o,a)=>{if(n.path=`${this.path}[${a}]`,n.errors=this.errors,o===void 0&&n.hasDefault){r[a]=n.defaultValue;return}n.validate(o)||(n.hasFallback?r[a]=n.fallbackValue:i=!1)}),this._uniqueItems){let o=new Map;for(let a in r)o.has(r[a])?i=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${o.get(r[a])}] and ${this.path}[${a}] are identical)`):o.set(r[a],a)}return i}minItems(r){return this._minItems=r,this}maxItems(r){return this._maxItems=r,this}uniqueItems(){return this._uniqueItems=!0,this}length(r){return this._length=r,this}},Zr=class extends ce{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(Gi(r)!=="object")return this.fail({expect:"object",actual:r});let i=r,o=this._value;o.errors=this.errors;let a=!0;for(let s in i){let u=i[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?o.path=`${this.path}.${s}`:o.path=`${this.path}["${s}"]`,!(u===void 0&&o._optional)){if(u===void 0&&o.hasDefault){i[s]=o.defaultValue;continue}o.validate(u)||(o.hasFallback?i[s]=o.fallbackValue:a=!1)}}return a}},en=class extends ce{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(Gi(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,i=!0;for(let o in this._object){let a=n[o],s=this._object[o];if(s.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(o)?s.path=`${this.path}.${o}`:s.path=`${this.path}["${o}"]`,!(s._optional&&a===void 0)){if(a===void 0&&s.hasDefault){n[o]=s.defaultValue;continue}s.validate(a)||(s.hasFallback?n[o]=s.fallbackValue:i=!1)}}return i}},tn=class extends ce{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:$i(this.value),actual:r}):!0}},rn=class extends ce{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,i=this._items.length;for(let o=0;o<i;o++){let a=this._items[o];if(a.errors=[],a.path=this.path,!a.validate(t))r.push(a.errors.join("; "));else if(!n){n=!0;break}}if(!n){let o=r.join(`
|
|
1
|
+
var Kc=Object.create;var ui=Object.defineProperty,Wc=Object.defineProperties,zc=Object.getOwnPropertyDescriptor,Qc=Object.getOwnPropertyDescriptors,Yc=Object.getOwnPropertyNames,Pr=Object.getOwnPropertySymbols,Ca=Object.getPrototypeOf,ci=Object.prototype.hasOwnProperty,ka=Object.prototype.propertyIsEnumerable,Xc=Reflect.get;var Ra=(e,t,r)=>t in e?ui(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Q=(e,t)=>{for(var r in t||(t={}))ci.call(t,r)&&Ra(e,r,t[r]);if(Pr)for(var r of Pr(t))ka.call(t,r)&&Ra(e,r,t[r]);return e},ke=(e,t)=>Wc(e,Qc(t));var Wt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ta=(e,t)=>{var r={};for(var n in e)ci.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Pr)for(var n of Pr(e))t.indexOf(n)<0&&ka.call(e,n)&&(r[n]=e[n]);return r};var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var di=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Zc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Yc(t))!ci.call(e,i)&&i!==r&&ui(e,i,{get:()=>t[i],enumerable:!(n=zc(t,i))||n.enumerable});return e};var fi=(e,t,r)=>(r=e!=null?Kc(Ca(e)):{},Zc(t||!e||!e.__esModule?ui(r,"default",{value:e,enumerable:!0}):r,e));var xa=(e,t,r)=>Xc(Ca(e),r,t);var P=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});function ld(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Ba(e){return new Promise(t=>setTimeout(t,e))}function wi(e){return typeof e=="string"}function Fa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function ja(e){return typeof e=="object"&&Array.isArray(e)}function ud(e){return typeof e=="undefined"}function cd(e){return ud(e)||e===null}function dd(e){return typeof e=="function"}function Ja(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Va(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,o){for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=i[a],u=o[a],d=r(s,u,a,i,o);d!==void 0?i[a]=d:Da(u)&&Da(s)?i[a]=n(Ua({},s),u):Array.isArray(u)&&Array.isArray(s)?i[a]=[...s,...u]:i[a]=u}return i}return n(e,t)}function Da(e){return e&&typeof e=="object"&&e.constructor===Object}function Ha(e,t){if(Array.isArray(e))return e.concat(t)}function Xt(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:u=!0}=r,d=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),y=function(...h){i=h,o=this;let p=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,u&&!p&&d()},t),p)return d()};return y.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},y.flush=()=>{if(n)return clearTimeout(n),n=null,d()},y}function md(e,t){return(...r)=>t(e,...r)}function Ka(e){return t=>md(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new hd(`${i}`))}})}function zt(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function Dr(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function wd(e){let t=e.location?Dr(e.location,La):null,r=e.target?Dr(e.target,La):null;return Dr(od(Ua({},e),{location:t,target:r}),gd)}function Si(e){let t=e.events.map(n=>wd(n)),r=Dr(e.device,yd);return[e.protocolVersion,t,r,e.project]}function bd(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function Qa(e,t,r){let n=window.location.hostname,i=n.split("."),o=r?t:e;if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n))return`${o}.jolibox.com`;if(i.length>=2){let a=i.slice(-2).join(".");if(a==="jolibox.com"||a==="pico-game.com")return`${o}.${a}`}return`${o}.jolibox.com`}function ki(e){return Qa("api","stg-api",e)}function At(e){return`https://${ki(e)}`}function kd(e){return Qa("collect","stg-collect",e)}function Ya(e){return`https://${kd(e)}`}function Pd(e){return new Promise(t=>Xa(e)(t))}function Xa(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function Dd(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Yt(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function Ld(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Ud(e[n],t[n])}function Ud(e,t){if(wi(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(dd(t)){try{if(e instanceof t)return}catch(r){}if(!cd(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 Md(){return typeof globalThis!="undefined"?globalThis[Za]:void 0}function Bd(e){typeof globalThis!="undefined"&&(globalThis[Za]=e)}function _e(e=!1){let t=Md();if(!e&&t)return t;let r=new Nr,n=new gi,i={registerCommand(o,a,s){r.registerCommand({id:o,handler:a,metadata:s})},executeCommand(o,...a){return n.executeCommand(o,...a)},excuteCommandSync(o,...a){return n.executeCommandThowErr(o,...a)}};return Bd(i),i}var yi,ed,td,rd,Oa,nd,id,Pa,Ua,od,ad,Ma,sd,fd,bi,Ei,$a,Ga,hd,qa,Lr,Ur,Ai,Ne,mi,pd,Ii,Na,vd,ct,Et,_d,La,gd,yd,dt,bt,Ed,Ee,Ad,Id,Sd,Wa,Ri,Ci,Rd,Cd,za,pi,te,Td,xd,Qt,Yt,je,_i,Od,hi,Nd,ft,Nr,gi,Za,V=Z(()=>{"use strict";yi=Object.defineProperty,ed=Object.defineProperties,td=Object.getOwnPropertyDescriptor,rd=Object.getOwnPropertyDescriptors,Oa=Object.getOwnPropertySymbols,nd=Object.prototype.hasOwnProperty,id=Object.prototype.propertyIsEnumerable,Pa=(e,t,r)=>t in e?yi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ua=(e,t)=>{for(var r in t||(t={}))nd.call(t,r)&&Pa(e,r,t[r]);if(Oa)for(var r of Oa(t))id.call(t,r)&&Pa(e,r,t[r]);return e},od=(e,t)=>ed(e,rd(t)),ad=(e,t)=>{for(var r in t)yi(e,r,{get:t[r],enumerable:!0})},Ma=(e,t,r,n)=>{for(var i=n>1?void 0:n?td(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&yi(t,r,i),i},sd=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}fd=(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))(fd||{}),bi=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}},Ei=class extends bi{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},$a=class extends bi{constructor(){super(...arguments),this.kind="USER_ERROR"}},Ga=class extends $a{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},hd=class extends $a{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="USER_CUSTOM_ERROR",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},qa=class extends Ei{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},Lr=class extends Ei{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},Ur=class extends bi{constructor(e,t,r,n,i){super(e),this.message=e,this.code=t,this.kind="API_ERROR",this.name="API_ERROR",r&&(this.errorType=r),n!==void 0&&(this.stack=n),i&&(this.priority=i)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},Ai=class extends Ei{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Ne={log:zt("log"),warn:zt("warn"),info:zt("info"),error:zt("error"),debug:zt("debug")};Object.assign(globalThis,{logger:Ne});mi=Symbol.for("Jolibox.canIUseMap"),pd={};globalThis[mi]||(globalThis[mi]=pd);Ii={get config(){return globalThis[mi]}},Na=Symbol.for("Jolibox.canIUseMap.native"),vd={};globalThis[Na]||(globalThis[Na]=vd);ct=(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))(ct||{}),Et=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Et||{}),_d=(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))(_d||{}),La=["name","params"],gd=["name","type","location","target","extra","timestamp","userId"],yd=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];dt=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});bd();bt=typeof window=="undefined",Ed=()=>!bt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Ee={isiOS:!bt&&(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:!bt&&navigator.userAgent.includes("Android"),isMac:!bt&&navigator.userAgent.includes("Mac"),isFacebook:!bt&&navigator.userAgent.includes("FB_IAB"),isPC:!bt&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},Ad=()=>Ee.isiOS?"iOS":Ee.isAndroid?"Android":Ee.isMac?"Mac":Ee.isFacebook?"Facebook":"PC",Id="device_id",Sd="advertising_id",Wa=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,dt()),window.__joliboxLocalStorage__.getItem(e)),Ri=()=>new URLSearchParams(window.location.search).get("deviceId")||Wa(Id),Ci=()=>new URLSearchParams(window.location.search).get("advertisingId")||Wa(Sd),Rd=e=>e.charAt(0).toUpperCase()+e.slice(1),Cd=()=>{var e;let t=new URLSearchParams(window.location.search);return Rd((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},za=e=>{if(Ed())return window.navigator.userAgent;let t="JoliboxWebSDK",r=Ad(),n=navigator.language,i=Ri(),o=Ci();return`${t} (${Cd()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`};pi=class vi{constructor(t){this.element=t,this.next=vi.Undefined,this.prev=vi.Undefined}};pi.Undefined=new pi(void 0);te=pi,Td=class{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let e=this._first;for(;e!==te.Undefined;){let t=e.next;e.prev=te.Undefined,e.next=te.Undefined,e=t}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new te(e);if(this._first===te.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==te.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==te.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==te.Undefined&&e.next!==te.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===te.Undefined&&e.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):e.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):e.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==te.Undefined;)yield e.element,e=e.next}},xd=0,Qt=class{constructor(e){this.value=e,this.id=xd++}},Yt=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof Qt&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,u;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let d=new Qt(t);return this._listeners?this._listeners instanceof Qt?this._listeners=[this._listeners,d]:this._listeners.push(d):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=d,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(u=(s=this.options)==null?void 0:s.onDidAddListener)==null||u.call(s,this),this._size++,()=>{var y,h,p,f;if(!this._disposed){if(this._listeners instanceof Qt)this._listeners.id===d.id&&(this._listeners=void 0,this._size=0,(h=(y=this.options)==null?void 0:y.onDidRemoveLastListener)==null||h.call(y));else if(this._listeners){let 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 r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Qt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},je=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Yt,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new Td,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},_i={};ad(_i,{None:()=>Od,filter:()=>Dd,once:()=>Xa,toPromise:()=>Pd});Od=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});hi=Symbol.for("Jolibox.hostEmitter"),Nd=()=>{let e=new je;return globalThis[hi]||(globalThis[hi]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[hi]},ft=Nd();Nr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Yt,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(...i){return Ld(i,r),n(...i)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};Nr=Ma([Ja],Nr);gi=class{constructor(){this._onWillExecuteCommand=new Yt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Yt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Nr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=ld(3e4)),this._starActivation}executeCommand(e,...t){return sd(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),_i.toPromise(_i.filter(this.registry.onDidRegisterCommand,r=>r===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let r=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),n}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e,...t){let r=!1;try{return e(...t)}finally{r=!0}}};gi=Ma([Ja],gi);Za=Symbol.for("Jolibox.commands")});function Te(e,t={}){Ti.emit("ERROR_REPORT",{error:e,options:t})}var Ti,ht,Ge=Z(()=>{"use strict";V();V();Ti=new je,ht=new je;Te.debounce=Xt(Te,50,{leading:!0})});var xi,Fd,es,ts,rs=Z(()=>{"use strict";V();Ge();xi=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4===0?"":"=".repeat(4-t.length%4),n=atob(t+r);try{return JSON.parse(n)}catch(i){return{}}},Fd=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},es=e=>{var t;try{let i=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(i!=null&&i.length){let[o,a,s]=i;return{headerJson:xi(o),payloadJson:xi(a),signature:xi(s)}}else throw"joli_source is missing"}catch(r){return Te(new qa(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},ts=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=Fd(e),o=r[2];return`${n}.${i}.${o}`}return t}});var jd,Mr,ns,Oi=Z(()=>{"use strict";V();jd="1.1.55",Mr=()=>jd,ns=()=>{let e=Mr();return`${za(e)}`}});function Di(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var Jd,is,Pi,os,ne,Vd,D,me=Z(()=>{"use strict";V();rs();Oi();V();Jd={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:Ri(),adId:Ci(),pixelRatio:window.devicePixelRatio||1,platform:Ee.isAndroid?"android":Ee.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:Mr()},schema:window.location.href,platform:Ee.isAndroid?"android":Ee.isiOS?"ios":"h5"},Pi=(is=globalThis.joliboxJSCore)==null?void 0:is.env,ne=Object.assign({},(os=Pi==null?void 0:Pi())!=null?os:Jd);Vd=()=>{var f,w,A,R,b,T,N,j,H,S,L;let{payloadJson:e,headerJson:t,signature:r}=ne.schema.length?es(ne.schema):{},n=`${ne.deviceInfo.did}-${new Date().getTime()}`,o=new URL(ne.schema.length?ne.schema:window.location.href).searchParams,a=(A=(w=(f=o.get("mpId"))!=null?f:o.get("appId"))!=null?w:o.get("gameId"))!=null?A:"",s=(T=(b=(R=ne.clientSessionId)!=null?R:e==null?void 0:e.sessionId)!=null?b:o.get("sessionId"))!=null?T:n,u=!!((j=(N=e==null?void 0:e.testAdsMode)!=null?N:e==null?void 0:e.__testAdsMode)!=null?j:o.get("testAdsMode")==="true"),d=(L=(S=(H=e==null?void 0:e.joliboxEnv)!=null?H:e==null?void 0:e.__joliboxEnv)!=null?S:o.get("joliboxEnv"))!=null?L:"production",y=d==="staging",h=t==null?void 0:t.channel,p=e==null?void 0:e.__shouldInterupt;return{get startTime(){var x;return(x=performance.timeOrigin)!=null?x:performance.timing.navigationStart},get testMode(){return y},get testAdsMode(){return u},get joliboxEnv(){return d},get joliSource(){var x;return(x=o.get("joliSource"))!=null?x:null},get mpId(){var x;return(x=a!=null?a:e==null?void 0:e.id)!=null?x:""},get mpVersion(){var x;return(x=t==null?void 0:t.ver)!=null?x:Mr()},get mpType(){var x,M;return(M=(x=t==null?void 0:t.__mpType)!=null?x:e==null?void 0:e.__mpType)!=null?M:"game"},get platform(){var x;return((x=ne.platform)!=null?x:ne.deviceInfo.platform).toLowerCase()},get deviceInfo(){return ne.deviceInfo},get sdkInfo(){return ne.sdkInfo},get hostInfo(){return ne.hostInfo},get hostUserInfo(){return ne.hostUserInfo},get sessionId(){var x,M;return(M=(x=ne.clientSessionId)!=null?x:s)!=null?M:n},get channel(){return h},get webviewId(){var x;return(x=ne.webviewId)!=null?x:-1},get shouldInterupt(){return p},get from(){return e==null?void 0:e.__from},get baseApiHost(){return ki(y)},get adId(){var x;return(x=ne.deviceInfo.adId)!=null?x:ne.deviceInfo.did},get language(){return ne.deviceInfo.lang},get sdkEnvironment(){return Di("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":Di("gamedistribution","jolibox")?"gamedistribution":Di("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var W,ee,he;let x=(W=ne.deviceInfo.pixelRatio)!=null?W:1,M=(ee=ne.deviceInfo.statusBarHeight)!=null?ee:e==null?void 0:e.__androidStatusBarHeight,K=(he=ne.deviceInfo.navigationBarHeight)!=null?he:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:M!==void 0?M/x:20,navigationBarHeight:K!==void 0?K/x:10}},get abTests(){var x,M;return(M=(x=ne.abValues)==null?void 0:x.split(","))!=null?M:[]},onEnvConfigChanged:x=>{Va(ne,x,Ha)},encodeJoliSourceQuery:x=>{var M,K;return t&&r?ts(Q(Q({},e),x),(M=o.get("joliSource"))!=null?M:""):(K=o.get("joliSource"))!=null?K:""},setDoExitDirectly:()=>{p=!1}}},D=Vd()});var Ni,ss,Hd,$d,as,Gd,ls=Z(()=>{"use strict";V();Ge();me();V();Ni=!1,ss=(e,t)=>e==null?!1:t in e,Hd=e=>ss(e,"kind"),$d=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},as=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=D.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:$d(e.name)},i=ke(Q({},n),{env:t.environment,isFromUser:r});r?ht.emit("GLOBAL_USER_ERROR",e,i):ht.emit("GLOBAL_ERROR",e,i)},Gd=e=>ss(e,"kind")&&e.kind==="USER_ERROR";Ti.on("ERROR_REPORT",({error:e,options:t})=>{if(Ni)return;Ni=!0;let r=Hd(e)&&e.raw?e.raw:e;try{let n=Gd(e);as(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new Ai(`${i}, origin error: ${r.message}`);Ne.error(o),as(new Ai(o.message),{environment:t.environment},!1)}finally{Ni=!1}})});var Li,Ui=Z(()=>{"use strict";Ge();V();Ge();Li=e=>new Ga(e)});function us(e,t){let r=(n,i,o)=>{let d=i!=null?i:{},{eventType:a}=d,s=Ta(d,["eventType"]),u=ke(Q({tag:n,eventType:o!=null?o:a!=null?a:ct.Other},t),{extra:Q({},s)});n=="globalJsError"?Te(new Lr(JSON.stringify(u))):e("systemLog",u,D.webviewId)};return r.debounce=Xt(r,500,{leading:!0}),r}function cs(e){let t=(r,n,i)=>{var s;let o=(s=i&&JSON.stringify(i))!=null?s:0,a={speed_value_type:r,total_duration:n};o&&Object.assign(a,{extra:o}),e("joliboxSpeedAnalysis",a)};return t.debounce=Xt(t,500,{leading:!0}),t}var ds=Z(()=>{"use strict";V();V();Ge();me()});function fs(e,t){let r=us(e,t),n=cs(r);return{track:r,trackPerformance:n}}var hs=Z(()=>{"use strict";ds()});var Mi=Z(()=>{"use strict"});var Br,ms=Z(()=>{"use strict";me();V();V();Br=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return P(this,null,function*(){let r=`${At(D.testMode)}/api/fe-configs/js-sdk/samples-config`,n=yield(yield fetch(r)).json();this.samplesConfig=n})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:r}=this.samplesConfig;for(let[n,i]of Object.entries(r))if(i.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,i,o,a,s;let{nativeSDKVersion:t,jssdkVersion:r}=D.sdkInfo;return{platform:1e3,os:D.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(o=(i=D.hostInfo)==null?void 0:i.aid)!=null?o:"1",model:(a=D.deviceInfo.model)!=null?a:"UnknownModel",brand:(s=D.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:D.deviceInfo.did,jsSdkVersion:r,extra:{}}}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:"GamePage",params:r}}trackEvent(t,r,n){return P(this,null,function*(){if(this.checkIsSampled(t))return;let i=t.location?t.location:yield this.getLocation(),o=t.target||null,a=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let s=this.deviceInfo,d={protocolVersion:"1.0.0",events:[ke(Q({},t),{location:i,target:o,extra:a,timestamp:Date.now(),userId:null})],device:s,project:r};try{n?yield this.doReport(Si(d),n):yield this.doReport(Si(d))}catch(y){Ne.log("[Jolibox SDK] report API error",y)}})}}});var Bi=Z(()=>{"use strict";hs();Mi();ms()});var Fi,ps,qe,Fr,Be,It=Z(()=>{"use strict";Oi();me();V();Fi=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(ps=AbortSignal.timeout)!=null||(AbortSignal.timeout=Fi);qe=class e{constructor(){this.httpClients=new WeakSet;this.networkRequests=[];this.maxRequestsToTrack=20;this.getNetworkStatus=()=>this.networkRequests.length===0?!0:this.networkRequests.filter(n=>n).length/this.networkRequests.length>=.6}static getInstance(){return e._instance||(e._instance=new e),e._instance}create(t){let r=new Fr(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},Fr=class{constructor(t){this.xua=ns();this.getJoliSource=()=>D.joliSource;var n;let r=At(D.testMode);this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return P(this,null,function*(){try{let{query:n,timeout:i}=r!=null?r:{},{headers:o}=r!=null?r:{},a=n?new URLSearchParams(n):null,s=a==null?void 0:a.toString(),u=`${this.baseUrl}${t}${s?`?${s}`:""}`,d=this.xua,y=this.getJoliSource();o=Object.assign({},o!=null?o:{},d?{"x-user-agent":d}:{},y?{"x-joli-source":y}:{});let h=yield fetch(u,{method:"GET",headers:o,credentials:"include",signal:Fi(i!=null?i:3e4)});return qe.getInstance().recordNetworkRequest(!0),yield h.json()}catch(n){throw qe.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return P(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,y=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{},{"x-os-type":Ee.isAndroid?"ANDROID":Ee.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let p=yield fetch(d,{method:"POST",headers:a,body:JSON.stringify(n),signal:Fi(o!=null?o:3e4),credentials:"include"});qe.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(n){throw qe.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return P(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,y=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{});let p=yield fetch(d,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!p.ok)throw qe.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${p.status}`);return qe.getInstance().recordNetworkRequest(!0),yield p.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=Fr;Be=qe.getInstance()});var ji,jr,Ji=Z(()=>{"use strict";me();Bi();It();V();ji=class extends Br{constructor(){super(...arguments);this.httpClient=Be.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var r;return Ya((r=D.testMode)!=null?r:!1)}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},jr=new ji});var qd,vs=Z(()=>{"use strict";ls();V();Ui();V();Ji();me();qd=(e,t)=>{var i,o,a;let r={message:t.message,stack:(i=t.stack)!=null?i:"",errorType:t.name,source:0},n={name:e,type:ct.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:null};jr.trackEvent(n,Et.WebSDK)};ht.on("GLOBAL_ERROR",(e,t)=>{qd(t.tag,e)});ht.on("GLOBAL_USER_ERROR",(e,t)=>{Ne.log("UserError",e,t)})});var Jr,_s=Z(()=>{"use strict";Jr=class{constructor(t,r){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.timer=this.createRAFTimer(t=>{this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t})});this.interval=r!=null?r:5*1e3,t.on("visible",n=>{this.visible=n})}start(t){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:t!=null?t:0}}),this.tracker("OpenGame",{duration:t!=null?t:0}),this.timer.start()}close(t){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:t}}),this.tracker("CloseGame",{duration:t}),this.timer.stop()}createRAFTimer(t){let r=Date.now(),n,i,o=!1,a=0,s=()=>{if(!o)return;let f=Date.now(),w=f-r;w>=this.interval&&(this.visible&&(a+=Math.min(w,this.interval+1e3),t(a)),r=f),n=requestAnimationFrame(s)},u=()=>{y(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let f=Date.now();f-r>=this.interval&&(r=f)},this.interval)},d=()=>{h(),r=Date.now(),n=requestAnimationFrame(s)},y=()=>{n&&(cancelAnimationFrame(n),n=0)},h=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",f=>{o&&(console.log("visible",f),f?d():u())});let p=this.visible;return{start(){o||(o=!0,p?d():u())},stop(){o=!1,y(),h()}}}}});var Vr,gs=Z(()=>{"use strict";me();_s();It();Vr=class extends Jr{constructor(r,n,i){super(n,i);this.httpClient=Be.create();this.gameId=D.mpId,this.sessionId=D.sessionId,this.track=r}reporter(r){return P(this,null,function*(){let{event:n,params:i,extraParams:o}=r,a={eventType:n,gameInfo:Q({gameId:this.gameId,sessionId:this.sessionId},i)};o&&Object.assign(a,o),yield this.httpClient.post("/api/base/app-event",{data:a})})}tracker(r,n=null){this.track(r,n)}}});var ys,Kd,Le,Wd,Vi,Ke,it=Z(()=>{"use strict";vs();V();V();Bi();Ji();gs();me();Mi();ys=_e(),Kd={type:Et.WebSDK,platform:"h5",jssdk_version:D.sdkInfo.jssdkVersion,mp_id:D.mpId,mp_version:D.mpVersion},{track:Le,trackPerformance:Wd}=fs((...e)=>{var a,s,u,d;let[,t]=e,r=t,n=Fa(r.extra)?r.extra:wi(r.extra)?JSON.parse(r.extra):{},i=ke(Q({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(s=r.mp_version)!=null?s:""}),o={name:t.tag,type:ct.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(d=(u=D.hostUserInfo)==null?void 0:u.uid)!=null?d:null};jr.trackEvent(o,Et.WebSDK)},Kd);ys.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Wd(e,t,r)});ys.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Le(e,t)});Vi=new je,Ke=new Vr(Le,Vi)});function ws(e){let t=Ii.config[e];return t||(t={},Ii.config[e]=t),(r,n)=>{if(t[r]){Ne.warn(`[can i use] ${r} already registered`);return}t[r]=Q({},n)}}var bs=Z(()=>{"use strict";V()});function Hi(e){Es=e}function Hr(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>Hr(t)):Object.keys(e).reduce((t,r)=>(t[r]=Hr(e[r]),t),{})}function We(e){return typeof e=="number"}function $i(e){let t=Gi(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function Gi(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var Es,ce,$r,Gr,qr,Kr,St,Wr,zr,Qr,Yr,Xr,Zr,en,tn,rn,nn,on,an,qi=Z(()=>{"use strict";Es=!1;ce=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(Es)if(typeof t=="string")this.errors.push(t);else{let r=`${this.path} should be ${t.expect}`;this._optional&&t.expect!=="undefined"?r+=" or undefined, ":r+=", ",r+=`but got ${$i(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return Hr(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:Hr(this._default)}optional(){return this._optional=!0,this}};$r=class extends ce{validate(t){return this._optional&&t===void 0?!0:We(t)?We(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):We(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):We(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}},Gr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},qr=class extends ce{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(We(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(We(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}},Kr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},St=class extends ce{validate(t){return!0}},Wr=class extends ce{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},zr=class extends ce{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},Qr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Yr=class extends ce{constructor(...t){super(),this._items=t}validate(t){if(this._optional&&t===void 0)return!0;if(!this._items.includes(t)){let r=this._items.map(n=>JSON.stringify(n)).join(", ");return this.fail(`expect ${this.path} to be one of ${r}, but got ${$i(t)}`)}return!0}},Xr=class extends ce{constructor(r){super();this._item=r}validate(r){if(this._optional&&r===void 0)return!0;if(!Array.isArray(r))return this.fail({expect:"array",actual:r});if(We(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(We(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(We(this._length)&&r.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let n=this._item;if(!n)return!0;let i=!0;if(r.forEach((o,a)=>{if(n.path=`${this.path}[${a}]`,n.errors=this.errors,o===void 0&&n.hasDefault){r[a]=n.defaultValue;return}n.validate(o)||(n.hasFallback?r[a]=n.fallbackValue:i=!1)}),this._uniqueItems){let o=new Map;for(let a in r)o.has(r[a])?i=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${o.get(r[a])}] and ${this.path}[${a}] are identical)`):o.set(r[a],a)}return i}minItems(r){return this._minItems=r,this}maxItems(r){return this._maxItems=r,this}uniqueItems(){return this._uniqueItems=!0,this}length(r){return this._length=r,this}},Zr=class extends ce{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(Gi(r)!=="object")return this.fail({expect:"object",actual:r});let i=r,o=this._value;o.errors=this.errors;let a=!0;for(let s in i){let u=i[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?o.path=`${this.path}.${s}`:o.path=`${this.path}["${s}"]`,!(u===void 0&&o._optional)){if(u===void 0&&o.hasDefault){i[s]=o.defaultValue;continue}o.validate(u)||(o.hasFallback?i[s]=o.fallbackValue:a=!1)}}return a}},en=class extends ce{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(Gi(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,i=!0;for(let o in this._object){let a=n[o],s=this._object[o];if(s.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(o)?s.path=`${this.path}.${o}`:s.path=`${this.path}["${o}"]`,!(s._optional&&a===void 0)){if(a===void 0&&s.hasDefault){n[o]=s.defaultValue;continue}s.validate(a)||(s.hasFallback?n[o]=s.fallbackValue:i=!1)}}return i}},tn=class extends ce{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:$i(this.value),actual:r}):!0}},rn=class extends ce{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,i=this._items.length;for(let o=0;o<i;o++){let a=this._items[o];if(a.errors=[],a.path=this.path,!a.validate(t))r.push(a.errors.join("; "));else if(!n){n=!0;break}}if(!n){let o=r.join(`
|
|
2
2
|
or `);this.errors.push(o)}return n}},nn=class extends ce{constructor(...t){super(),this._items=t;let r=0,n=t.length-1;for(;n>=0;n--){let i=t[n];if(i._optional||i.hasDefault)r+=1;else break}this._minItems=t.length-r}validate(t){if(t===void 0&&this._optional)return!0;if(!Array.isArray(t))return this.fail({expect:"array",actual:t});if(t.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);let r=!0;return this._items.forEach((n,i)=>{if(n.path=`${this.path}[${i}]`,n.errors=this.errors,t[i]===void 0&&n.hasDefault){t[i]=n.defaultValue;return}n.validate(t[i])||(n.hasFallback?t[i]=n._fallback:r=!1)}),r}},on=class extends ce{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},an=class extends ce{constructor(t){super(),this._ctor=t}validate(t){return t===void 0&&this._optional||t instanceof this._ctor?!0:this.fail({expect:`typedarray of ${this._ctor.name}`,actual:t})}}});function Ki(e,t,r="param"){if(e.errors=[],e.path=r,Hi(!0),!e.validate(t)){let n=e.errors.join(`
|
|
3
3
|
`);throw e.errors.length=0,Hi(!1),new TypeError(n)}}var F,Wi=Z(()=>{"use strict";qi();qi();F={object(e){return new en(e)},array(e){return new Xr(e)},tuple(...e){return new nn(...e)},literal(e){return new tn(e)},or(...e){return new rn(...e)},symbol(){return new Kr},record(e){return new Zr(e)},function(){return new Qr},boolean(){return new Gr},string(){return new qr},number(){return new $r},undefined(){return new Wr},null(){return new zr},unknown(){return new St},any(){return new St},as(){return new St},arraybuffer(){return new on},enum(...e){return new Yr(...e)},typedarray(e){return new an(e)}}});var sn,As,Is=Z(()=>{"use strict";V();Ge();Wi();Ui();sn=1,As=e=>{function t(n,i){return(...o)=>{var h,p,f,w;let a=Date.now(),s={method:n,trace_id:sn};sn+=1;let u="SUCCESS",d=`${n}:ok`,y=0;try{if(i.paramsSchema)try{Ki(i.paramsSchema,o,"params")}catch(T){throw Li(`${n}:fail ${T.message}`)}let A=i.implement(...o),R=A,b=`${n}:ok`;if(A&&"code"in A){let{code:T,data:N,message:j}=A;u=T,R=N,b=j}return{code:u,message:b,data:R}}catch(A){let R=A;y=(p=(h=R.code)!=null?h:R.errNo)!=null?p:2e3,u="FAILURE";let b=(w=(f=R.message)!=null?f:R.errMsg)!=null?w:`${A}`;return d=`${n}:${u} ${b.replace(/^\S+:(fail|cancel)\s?/,"")}`,Te(new Ur(d,y)),{code:u,message:d}}finally{let A=Date.now()-a}}}function r(n,i){return(...o)=>P(this,null,function*(){var p,f,w,A;let a=ja(o)?o:[o],s=Date.now(),u={method:n,trace_id:sn};sn+=1;let d=`${n}:ok`,y="SUCCESS",h={code:y,message:d};try{if(i.paramsSchema)try{Ki(i.paramsSchema,a,"params")}catch(T){throw Li(T.message)}let b=yield i.implement(...a);if(b&&"code"in b){let{code:T,data:N,message:j}=b;y=T,d=j,b=N}return Object.assign(h,{code:y,message:d,data:b}),h}catch(R){let b=R,T=(f=(p=b.code)!=null?p:b.errNo)!=null?f:2e3;y="FAILURE";let N=(A=(w=b.message)!=null?w:b.errMsg)!=null?A:`${R}`,j=`${n}:${y} ${N.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(h,{code:y,message:j}),Te(new Ur(j,T)),h}finally{let R=Date.now()-s}})}return{createAPI:r,createSyncAPI:t}}});var ze,mt,ge,Zt=Z(()=>{"use strict";bs();it();Is();Wi();({createAPI:ze,createSyncAPI:mt}=As(Le)),ge=ws("h5")});var ks=di((Cs,Xi)=>{(function(e){if(typeof Cs=="object"&&typeof Xi!="undefined")Xi.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window!="undefined"?t=window:typeof global!="undefined"?t=global:typeof self!="undefined"?t=self:t=this,t.localforage=e()}})(function(){var e,t,r;return function n(i,o,a){function s(y,h){if(!o[y]){if(!i[y]){var p=typeof Wt=="function"&&Wt;if(!h&&p)return p(y,!0);if(u)return u(y,!0);var f=new Error("Cannot find module '"+y+"'");throw f.code="MODULE_NOT_FOUND",f}var w=o[y]={exports:{}};i[y][0].call(w.exports,function(A){var R=i[y][1][A];return s(R||A)},w,w.exports,n,i,o,a)}return o[y].exports}for(var u=typeof Wt=="function"&&Wt,d=0;d<a.length;d++)s(a[d]);return s}({1:[function(n,i,o){(function(a){"use strict";var s=a.MutationObserver||a.WebKitMutationObserver,u;if(s){var d=0,y=new s(A),h=a.document.createTextNode("");y.observe(h,{characterData:!0}),u=function(){h.data=d=++d%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var p=new a.MessageChannel;p.port1.onmessage=A,u=function(){p.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?u=function(){var b=a.document.createElement("script");b.onreadystatechange=function(){A(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},a.document.documentElement.appendChild(b)}:u=function(){setTimeout(A,0)};var f,w=[];function A(){f=!0;for(var b,T,N=w.length;N;){for(T=w,w=[],b=-1;++b<N;)T[b]();N=w.length}f=!1}i.exports=R;function R(b){w.push(b)===1&&!f&&u()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,i,o){"use strict";var a=n(1);function s(){}var u={},d=["REJECTED"],y=["FULFILLED"],h=["PENDING"];i.exports=p;function p(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,S!==s&&R(this,S)}p.prototype.catch=function(S){return this.then(null,S)},p.prototype.then=function(S,L){if(typeof S!="function"&&this.state===y||typeof L!="function"&&this.state===d)return this;var x=new this.constructor(s);if(this.state!==h){var M=this.state===y?S:L;w(x,M,this.outcome)}else this.queue.push(new f(x,S,L));return x};function f(S,L,x){this.promise=S,typeof L=="function"&&(this.onFulfilled=L,this.callFulfilled=this.otherCallFulfilled),typeof x=="function"&&(this.onRejected=x,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(S){u.resolve(this.promise,S)},f.prototype.otherCallFulfilled=function(S){w(this.promise,this.onFulfilled,S)},f.prototype.callRejected=function(S){u.reject(this.promise,S)},f.prototype.otherCallRejected=function(S){w(this.promise,this.onRejected,S)};function w(S,L,x){a(function(){var M;try{M=L(x)}catch(K){return u.reject(S,K)}M===S?u.reject(S,new TypeError("Cannot resolve promise with itself")):u.resolve(S,M)})}u.resolve=function(S,L){var x=b(A,L);if(x.status==="error")return u.reject(S,x.value);var M=x.value;if(M)R(S,M);else{S.state=y,S.outcome=L;for(var K=-1,W=S.queue.length;++K<W;)S.queue[K].callFulfilled(L)}return S},u.reject=function(S,L){S.state=d,S.outcome=L;for(var x=-1,M=S.queue.length;++x<M;)S.queue[x].callRejected(L);return S};function A(S){var L=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof L=="function")return function(){L.apply(S,arguments)}}function R(S,L){var x=!1;function M(he){x||(x=!0,u.reject(S,he))}function K(he){x||(x=!0,u.resolve(S,he))}function W(){L(K,M)}var ee=b(W);ee.status==="error"&&M(ee.value)}function b(S,L){var x={};try{x.value=S(L),x.status="success"}catch(M){x.status="error",x.value=M}return x}p.resolve=T;function T(S){return S instanceof this?S:u.resolve(new this(s),S)}p.reject=N;function N(S){var L=new this(s);return u.reject(L,S)}p.all=j;function j(S){var L=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var x=S.length,M=!1;if(!x)return this.resolve([]);for(var K=new Array(x),W=0,ee=-1,he=new this(s);++ee<x;)He(S[ee],ee);return he;function He(Gt,Tr){L.resolve(Gt).then(Zn,function(yt){M||(M=!0,u.reject(he,yt))});function Zn(yt){K[Tr]=yt,++W===x&&!M&&(M=!0,u.resolve(he,K))}}}p.race=H;function H(S){var L=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var x=S.length,M=!1;if(!x)return this.resolve([]);for(var K=-1,W=new this(s);++K<x;)ee(S[K]);return W;function ee(he){L.resolve(he).then(function(He){M||(M=!0,u.resolve(W,He))},function(He){M||(M=!0,u.reject(W,He))})}}},{1:1}],3:[function(n,i,o){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=n(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(n,i,o){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l};function s(l,m){if(!(l instanceof m))throw new TypeError("Cannot call a class as a function")}function u(){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(l){return}}var d=u();function y(){try{if(!d||!d.open)return!1;var l=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(!l||m)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(c){return!1}}function h(l,m){l=l||[],m=m||{};try{return new Blob(l,m)}catch(v){if(v.name!=="TypeError")throw v;for(var c=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,_=new c,g=0;g<l.length;g+=1)_.append(l[g]);return _.getBlob(m.type)}}typeof Promise=="undefined"&&n(3);var p=Promise;function f(l,m){m&&l.then(function(c){m(null,c)},function(c){m(c)})}function w(l,m,c){typeof m=="function"&&l.then(m),typeof c=="function"&&l.catch(c)}function A(l){return typeof l!="string"&&(console.warn(l+" used as a key, but it is not a string."),l=String(l)),l}function R(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var b="local-forage-detect-blob-support",T=void 0,N={},j=Object.prototype.toString,H="readonly",S="readwrite";function L(l){for(var m=l.length,c=new ArrayBuffer(m),_=new Uint8Array(c),g=0;g<m;g++)_[g]=l.charCodeAt(g);return c}function x(l){return new p(function(m){var c=l.transaction(b,S),_=h([""]);c.objectStore(b).put(_,"key"),c.onabort=function(g){g.preventDefault(),g.stopPropagation(),m(!1)},c.oncomplete=function(){var g=navigator.userAgent.match(/Chrome\/(\d+)/),v=navigator.userAgent.match(/Edge\//);m(v||!g||parseInt(g[1],10)>=43)}}).catch(function(){return!1})}function M(l){return typeof T=="boolean"?p.resolve(T):x(l).then(function(m){return T=m,T})}function K(l){var m=N[l.name],c={};c.promise=new p(function(_,g){c.resolve=_,c.reject=g}),m.deferredOperations.push(c),m.dbReady?m.dbReady=m.dbReady.then(function(){return c.promise}):m.dbReady=c.promise}function W(l){var m=N[l.name],c=m.deferredOperations.pop();if(c)return c.resolve(),c.promise}function ee(l,m){var c=N[l.name],_=c.deferredOperations.pop();if(_)return _.reject(m),_.promise}function he(l,m){return new p(function(c,_){if(N[l.name]=N[l.name]||aa(),l.db)if(m)K(l),l.db.close();else return c(l.db);var g=[l.name];m&&g.push(l.version);var v=d.open.apply(d,g);m&&(v.onupgradeneeded=function(E){var I=v.result;try{I.createObjectStore(l.storeName),E.oldVersion<=1&&I.createObjectStore(b)}catch(C){if(C.name==="ConstraintError")console.warn('The database "'+l.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+l.storeName+'" already exists.');else throw C}}),v.onerror=function(E){E.preventDefault(),_(v.error)},v.onsuccess=function(){var E=v.result;E.onversionchange=function(I){I.target.close()},c(E),W(l)}})}function He(l){return he(l,!1)}function Gt(l){return he(l,!0)}function Tr(l,m){if(!l.db)return!0;var c=!l.db.objectStoreNames.contains(l.storeName),_=l.version<l.db.version,g=l.version>l.db.version;if(_&&(l.version!==m&&console.warn('The database "'+l.name+`" can't be downgraded from version `+l.db.version+" to version "+l.version+"."),l.version=l.db.version),g||c){if(c){var v=l.db.version+1;v>l.version&&(l.version=v)}return!0}return!1}function Zn(l){return new p(function(m,c){var _=new FileReader;_.onerror=c,_.onloadend=function(g){var v=btoa(g.target.result||"");m({__local_forage_encoded_blob:!0,data:v,type:l.type})},_.readAsBinaryString(l)})}function yt(l){var m=L(atob(l.data));return h([m],{type:l.type})}function oa(l){return l&&l.__local_forage_encoded_blob}function Wu(l){var m=this,c=m._initReady().then(function(){var _=N[m._dbInfo.name];if(_&&_.dbReady)return _.dbReady});return w(c,l,l),c}function zu(l){K(l);for(var m=N[l.name],c=m.forages,_=0;_<c.length;_++){var g=c[_];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return l.db=null,He(l).then(function(v){return l.db=v,Tr(l)?Gt(l):v}).then(function(v){l.db=m.db=v;for(var E=0;E<c.length;E++)c[E]._dbInfo.db=v}).catch(function(v){throw ee(l,v),v})}function $e(l,m,c,_){_===void 0&&(_=1);try{var g=l.db.transaction(l.storeName,m);c(null,g)}catch(v){if(_>0&&(!l.db||v.name==="InvalidStateError"||v.name==="NotFoundError"))return p.resolve().then(function(){if(!l.db||v.name==="NotFoundError"&&!l.db.objectStoreNames.contains(l.storeName)&&l.version<=l.db.version)return l.db&&(l.version=l.db.version+1),Gt(l)}).then(function(){return zu(l).then(function(){$e(l,m,c,_-1)})}).catch(c);c(v)}}function aa(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Qu(l){var m=this,c={db:null};if(l)for(var _ in l)c[_]=l[_];var g=N[c.name];g||(g=aa(),N[c.name]=g),g.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=Wu);var v=[];function E(){return p.resolve()}for(var I=0;I<g.forages.length;I++){var C=g.forages[I];C!==m&&v.push(C._initReady().catch(E))}var k=g.forages.slice(0);return p.all(v).then(function(){return c.db=g.db,He(c)}).then(function(O){return c.db=O,Tr(c,m._defaultConfig.version)?Gt(c):O}).then(function(O){c.db=g.db=O,m._dbInfo=c;for(var U=0;U<k.length;U++){var J=k[U];J!==m&&(J._dbInfo.db=c.db,J._dbInfo.version=c.version)}})}function Yu(l,m){var c=this;l=A(l);var _=new p(function(g,v){c.ready().then(function(){$e(c._dbInfo,H,function(E,I){if(E)return v(E);try{var C=I.objectStore(c._dbInfo.storeName),k=C.get(l);k.onsuccess=function(){var O=k.result;O===void 0&&(O=null),oa(O)&&(O=yt(O)),g(O)},k.onerror=function(){v(k.error)}}catch(O){v(O)}})}).catch(v)});return f(_,m),_}function Xu(l,m){var c=this,_=new p(function(g,v){c.ready().then(function(){$e(c._dbInfo,H,function(E,I){if(E)return v(E);try{var C=I.objectStore(c._dbInfo.storeName),k=C.openCursor(),O=1;k.onsuccess=function(){var U=k.result;if(U){var J=U.value;oa(J)&&(J=yt(J));var q=l(J,U.key,O++);q!==void 0?g(q):U.continue()}else g()},k.onerror=function(){v(k.error)}}catch(U){v(U)}})}).catch(v)});return f(_,m),_}function Zu(l,m,c){var _=this;l=A(l);var g=new p(function(v,E){var I;_.ready().then(function(){return I=_._dbInfo,j.call(m)==="[object Blob]"?M(I.db).then(function(C){return C?m:Zn(m)}):m}).then(function(C){$e(_._dbInfo,S,function(k,O){if(k)return E(k);try{var U=O.objectStore(_._dbInfo.storeName);C===null&&(C=void 0);var J=U.put(C,l);O.oncomplete=function(){C===void 0&&(C=null),v(C)},O.onabort=O.onerror=function(){var q=J.error?J.error:J.transaction.error;E(q)}}catch(q){E(q)}})}).catch(E)});return f(g,c),g}function ec(l,m){var c=this;l=A(l);var _=new p(function(g,v){c.ready().then(function(){$e(c._dbInfo,S,function(E,I){if(E)return v(E);try{var C=I.objectStore(c._dbInfo.storeName),k=C.delete(l);I.oncomplete=function(){g()},I.onerror=function(){v(k.error)},I.onabort=function(){var O=k.error?k.error:k.transaction.error;v(O)}}catch(O){v(O)}})}).catch(v)});return f(_,m),_}function tc(l){var m=this,c=new p(function(_,g){m.ready().then(function(){$e(m._dbInfo,S,function(v,E){if(v)return g(v);try{var I=E.objectStore(m._dbInfo.storeName),C=I.clear();E.oncomplete=function(){_()},E.onabort=E.onerror=function(){var k=C.error?C.error:C.transaction.error;g(k)}}catch(k){g(k)}})}).catch(g)});return f(c,l),c}function rc(l){var m=this,c=new p(function(_,g){m.ready().then(function(){$e(m._dbInfo,H,function(v,E){if(v)return g(v);try{var I=E.objectStore(m._dbInfo.storeName),C=I.count();C.onsuccess=function(){_(C.result)},C.onerror=function(){g(C.error)}}catch(k){g(k)}})}).catch(g)});return f(c,l),c}function nc(l,m){var c=this,_=new p(function(g,v){if(l<0){g(null);return}c.ready().then(function(){$e(c._dbInfo,H,function(E,I){if(E)return v(E);try{var C=I.objectStore(c._dbInfo.storeName),k=!1,O=C.openKeyCursor();O.onsuccess=function(){var U=O.result;if(!U){g(null);return}l===0||k?g(U.key):(k=!0,U.advance(l))},O.onerror=function(){v(O.error)}}catch(U){v(U)}})}).catch(v)});return f(_,m),_}function ic(l){var m=this,c=new p(function(_,g){m.ready().then(function(){$e(m._dbInfo,H,function(v,E){if(v)return g(v);try{var I=E.objectStore(m._dbInfo.storeName),C=I.openKeyCursor(),k=[];C.onsuccess=function(){var O=C.result;if(!O){_(k);return}k.push(O.key),O.continue()},C.onerror=function(){g(C.error)}}catch(O){g(O)}})}).catch(g)});return f(c,l),c}function oc(l,m){m=R.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var _=this,g;if(!l.name)g=p.reject("Invalid arguments");else{var v=l.name===c.name&&_._dbInfo.db,E=v?p.resolve(_._dbInfo.db):He(l).then(function(I){var C=N[l.name],k=C.forages;C.db=I;for(var O=0;O<k.length;O++)k[O]._dbInfo.db=I;return I});l.storeName?g=E.then(function(I){if(I.objectStoreNames.contains(l.storeName)){var C=I.version+1;K(l);var k=N[l.name],O=k.forages;I.close();for(var U=0;U<O.length;U++){var J=O[U];J._dbInfo.db=null,J._dbInfo.version=C}var q=new p(function(z,ue){var oe=d.open(l.name,C);oe.onerror=function(De){var Kt=oe.result;Kt.close(),ue(De)},oe.onupgradeneeded=function(){var De=oe.result;De.deleteObjectStore(l.storeName)},oe.onsuccess=function(){var De=oe.result;De.close(),z(De)}});return q.then(function(z){k.db=z;for(var ue=0;ue<O.length;ue++){var oe=O[ue];oe._dbInfo.db=z,W(oe._dbInfo)}}).catch(function(z){throw(ee(l,z)||p.resolve()).catch(function(){}),z})}}):g=E.then(function(I){K(l);var C=N[l.name],k=C.forages;I.close();for(var O=0;O<k.length;O++){var U=k[O];U._dbInfo.db=null}var J=new p(function(q,z){var ue=d.deleteDatabase(l.name);ue.onerror=function(){var oe=ue.result;oe&&oe.close(),z(ue.error)},ue.onblocked=function(){console.warn('dropInstance blocked for database "'+l.name+'" until all open connections are closed')},ue.onsuccess=function(){var oe=ue.result;oe&&oe.close(),q(oe)}});return J.then(function(q){C.db=q;for(var z=0;z<k.length;z++){var ue=k[z];W(ue._dbInfo)}}).catch(function(q){throw(ee(l,q)||p.resolve()).catch(function(){}),q})})}return f(g,m),g}var ac={_driver:"asyncStorage",_initStorage:Qu,_support:y(),iterate:Xu,getItem:Yu,setItem:Zu,removeItem:ec,clear:tc,length:rc,key:nc,keys:ic,dropInstance:oc};function sc(){return typeof openDatabase=="function"}var rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lc="~~local_forage_type~",sa=/^~~local_forage_type~([^~]+)~/,xr="__lfsc__:",ei=xr.length,ti="arbf",ri="blob",la="si08",ua="ui08",ca="uic8",da="si16",fa="si32",ha="ur16",ma="ui32",pa="fl32",va="fl64",_a=ei+ti.length,ga=Object.prototype.toString;function ya(l){var m=l.length*.75,c=l.length,_,g=0,v,E,I,C;l[l.length-1]==="="&&(m--,l[l.length-2]==="="&&m--);var k=new ArrayBuffer(m),O=new Uint8Array(k);for(_=0;_<c;_+=4)v=rt.indexOf(l[_]),E=rt.indexOf(l[_+1]),I=rt.indexOf(l[_+2]),C=rt.indexOf(l[_+3]),O[g++]=v<<2|E>>4,O[g++]=(E&15)<<4|I>>2,O[g++]=(I&3)<<6|C&63;return k}function ni(l){var m=new Uint8Array(l),c="",_;for(_=0;_<m.length;_+=3)c+=rt[m[_]>>2],c+=rt[(m[_]&3)<<4|m[_+1]>>4],c+=rt[(m[_+1]&15)<<2|m[_+2]>>6],c+=rt[m[_+2]&63];return m.length%3===2?c=c.substring(0,c.length-1)+"=":m.length%3===1&&(c=c.substring(0,c.length-2)+"=="),c}function uc(l,m){var c="";if(l&&(c=ga.call(l)),l&&(c==="[object ArrayBuffer]"||l.buffer&&ga.call(l.buffer)==="[object ArrayBuffer]")){var _,g=xr;l instanceof ArrayBuffer?(_=l,g+=ti):(_=l.buffer,c==="[object Int8Array]"?g+=la:c==="[object Uint8Array]"?g+=ua:c==="[object Uint8ClampedArray]"?g+=ca:c==="[object Int16Array]"?g+=da:c==="[object Uint16Array]"?g+=ha:c==="[object Int32Array]"?g+=fa:c==="[object Uint32Array]"?g+=ma:c==="[object Float32Array]"?g+=pa:c==="[object Float64Array]"?g+=va:m(new Error("Failed to get type for BinaryArray"))),m(g+ni(_))}else if(c==="[object Blob]"){var v=new FileReader;v.onload=function(){var E=lc+l.type+"~"+ni(this.result);m(xr+ri+E)},v.readAsArrayBuffer(l)}else try{m(JSON.stringify(l))}catch(E){console.error("Couldn't convert value into a JSON string: ",l),m(null,E)}}function cc(l){if(l.substring(0,ei)!==xr)return JSON.parse(l);var m=l.substring(_a),c=l.substring(ei,_a),_;if(c===ri&&sa.test(m)){var g=m.match(sa);_=g[1],m=m.substring(g[0].length)}var v=ya(m);switch(c){case ti:return v;case ri:return h([v],{type:_});case la:return new Int8Array(v);case ua:return new Uint8Array(v);case ca:return new Uint8ClampedArray(v);case da:return new Int16Array(v);case ha:return new Uint16Array(v);case fa:return new Int32Array(v);case ma:return new Uint32Array(v);case pa:return new Float32Array(v);case va:return new Float64Array(v);default:throw new Error("Unkown type: "+c)}}var ii={serialize:uc,deserialize:cc,stringToBuffer:ya,bufferToString:ni};function wa(l,m,c,_){l.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,_)}function dc(l){var m=this,c={db:null};if(l)for(var _ in l)c[_]=typeof l[_]!="string"?l[_].toString():l[_];var g=new p(function(v,E){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(I){return E(I)}c.db.transaction(function(I){wa(I,c,function(){m._dbInfo=c,v()},function(C,k){E(k)})},E)});return c.serializer=ii,g}function nt(l,m,c,_,g,v){l.executeSql(c,_,g,function(E,I){I.code===I.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[m.storeName],function(C,k){k.rows.length?v(C,I):wa(C,m,function(){C.executeSql(c,_,g,v)},v)},v):v(E,I)},v)}function fc(l,m){var c=this;l=A(l);var _=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){nt(I,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[l],function(C,k){var O=k.rows.length?k.rows.item(0).value:null;O&&(O=E.serializer.deserialize(O)),g(O)},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function hc(l,m){var c=this,_=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){nt(I,E,"SELECT * FROM "+E.storeName,[],function(C,k){for(var O=k.rows,U=O.length,J=0;J<U;J++){var q=O.item(J),z=q.value;if(z&&(z=E.serializer.deserialize(z)),z=l(z,q.key,J+1),z!==void 0){g(z);return}}g()},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function ba(l,m,c,_){var g=this;l=A(l);var v=new p(function(E,I){g.ready().then(function(){m===void 0&&(m=null);var C=m,k=g._dbInfo;k.serializer.serialize(m,function(O,U){U?I(U):k.db.transaction(function(J){nt(J,k,"INSERT OR REPLACE INTO "+k.storeName+" (key, value) VALUES (?, ?)",[l,O],function(){E(C)},function(q,z){I(z)})},function(J){if(J.code===J.QUOTA_ERR){if(_>0){E(ba.apply(g,[l,C,c,_-1]));return}I(J)}})})}).catch(I)});return f(v,c),v}function mc(l,m,c){return ba.apply(this,[l,m,c,1])}function pc(l,m){var c=this;l=A(l);var _=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){nt(I,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[l],function(){g()},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function vc(l){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){nt(E,v,"DELETE FROM "+v.storeName,[],function(){_()},function(I,C){g(C)})})}).catch(g)});return f(c,l),c}function _c(l){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){nt(E,v,"SELECT COUNT(key) as c FROM "+v.storeName,[],function(I,C){var k=C.rows.item(0).c;_(k)},function(I,C){g(C)})})}).catch(g)});return f(c,l),c}function gc(l,m){var c=this,_=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){nt(I,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[l+1],function(C,k){var O=k.rows.length?k.rows.item(0).key:null;g(O)},function(C,k){v(k)})})}).catch(v)});return f(_,m),_}function yc(l){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){nt(E,v,"SELECT key FROM "+v.storeName,[],function(I,C){for(var k=[],O=0;O<C.rows.length;O++)k.push(C.rows.item(O).key);_(k)},function(I,C){g(C)})})}).catch(g)});return f(c,l),c}function wc(l){return new p(function(m,c){l.transaction(function(_){_.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(g,v){for(var E=[],I=0;I<v.rows.length;I++)E.push(v.rows.item(I).name);m({db:l,storeNames:E})},function(g,v){c(v)})},function(_){c(_)})})}function bc(l,m){m=R.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var _=this,g;return l.name?g=new p(function(v){var E;l.name===c.name?E=_._dbInfo.db:E=openDatabase(l.name,"","",0),l.storeName?v({db:E,storeNames:[l.storeName]}):v(wc(E))}).then(function(v){return new p(function(E,I){v.db.transaction(function(C){function k(q){return new p(function(z,ue){C.executeSql("DROP TABLE IF EXISTS "+q,[],function(){z()},function(oe,De){ue(De)})})}for(var O=[],U=0,J=v.storeNames.length;U<J;U++)O.push(k(v.storeNames[U]));p.all(O).then(function(){E()}).catch(function(q){I(q)})},function(C){I(C)})})}):g=p.reject("Invalid arguments"),f(g,m),g}var Ec={_driver:"webSQLStorage",_initStorage:dc,_support:sc(),iterate:hc,getItem:fc,setItem:mc,removeItem:pc,clear:vc,length:_c,key:gc,keys:yc,dropInstance:bc};function Ac(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(l){return!1}}function Ea(l,m){var c=l.name+"/";return l.storeName!==m.storeName&&(c+=l.storeName+"/"),c}function Ic(){var l="_localforage_support_test";try{return localStorage.setItem(l,!0),localStorage.removeItem(l),!1}catch(m){return!0}}function Sc(){return!Ic()||localStorage.length>0}function Rc(l){var m=this,c={};if(l)for(var _ in l)c[_]=l[_];return c.keyPrefix=Ea(l,m._defaultConfig),Sc()?(m._dbInfo=c,c.serializer=ii,p.resolve()):p.reject()}function Cc(l){var m=this,c=m.ready().then(function(){for(var _=m._dbInfo.keyPrefix,g=localStorage.length-1;g>=0;g--){var v=localStorage.key(g);v.indexOf(_)===0&&localStorage.removeItem(v)}});return f(c,l),c}function kc(l,m){var c=this;l=A(l);var _=c.ready().then(function(){var g=c._dbInfo,v=localStorage.getItem(g.keyPrefix+l);return v&&(v=g.serializer.deserialize(v)),v});return f(_,m),_}function Tc(l,m){var c=this,_=c.ready().then(function(){for(var g=c._dbInfo,v=g.keyPrefix,E=v.length,I=localStorage.length,C=1,k=0;k<I;k++){var O=localStorage.key(k);if(O.indexOf(v)===0){var U=localStorage.getItem(O);if(U&&(U=g.serializer.deserialize(U)),U=l(U,O.substring(E),C++),U!==void 0)return U}}});return f(_,m),_}function xc(l,m){var c=this,_=c.ready().then(function(){var g=c._dbInfo,v;try{v=localStorage.key(l)}catch(E){v=null}return v&&(v=v.substring(g.keyPrefix.length)),v});return f(_,m),_}function Oc(l){var m=this,c=m.ready().then(function(){for(var _=m._dbInfo,g=localStorage.length,v=[],E=0;E<g;E++){var I=localStorage.key(E);I.indexOf(_.keyPrefix)===0&&v.push(I.substring(_.keyPrefix.length))}return v});return f(c,l),c}function Pc(l){var m=this,c=m.keys().then(function(_){return _.length});return f(c,l),c}function Dc(l,m){var c=this;l=A(l);var _=c.ready().then(function(){var g=c._dbInfo;localStorage.removeItem(g.keyPrefix+l)});return f(_,m),_}function Nc(l,m,c){var _=this;l=A(l);var g=_.ready().then(function(){m===void 0&&(m=null);var v=m;return new p(function(E,I){var C=_._dbInfo;C.serializer.serialize(m,function(k,O){if(O)I(O);else try{localStorage.setItem(C.keyPrefix+l,k),E(v)}catch(U){(U.name==="QuotaExceededError"||U.name==="NS_ERROR_DOM_QUOTA_REACHED")&&I(U),I(U)}})})});return f(g,c),g}function Lc(l,m){if(m=R.apply(this,arguments),l=typeof l!="function"&&l||{},!l.name){var c=this.config();l.name=l.name||c.name,l.storeName=l.storeName||c.storeName}var _=this,g;return l.name?g=new p(function(v){l.storeName?v(Ea(l,_._defaultConfig)):v(l.name+"/")}).then(function(v){for(var E=localStorage.length-1;E>=0;E--){var I=localStorage.key(E);I.indexOf(v)===0&&localStorage.removeItem(I)}}):g=p.reject("Invalid arguments"),f(g,m),g}var Uc={_driver:"localStorageWrapper",_initStorage:Rc,_support:Ac(),iterate:Tc,getItem:kc,setItem:Nc,removeItem:Dc,clear:Cc,length:Pc,key:xc,keys:Oc,dropInstance:Lc},Mc=function(m,c){return m===c||typeof m=="number"&&typeof c=="number"&&isNaN(m)&&isNaN(c)},Bc=function(m,c){for(var _=m.length,g=0;g<_;){if(Mc(m[g],c))return!0;g++}return!1},Aa=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"},qt={},Ia={},wt={INDEXEDDB:ac,WEBSQL:Ec,LOCALSTORAGE:Uc},Fc=[wt.INDEXEDDB._driver,wt.WEBSQL._driver,wt.LOCALSTORAGE._driver],Or=["dropInstance"],oi=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Or),jc={description:"",driver:Fc.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Jc(l,m){l[m]=function(){var c=arguments;return l.ready().then(function(){return l[m].apply(l,c)})}}function ai(){for(var l=1;l<arguments.length;l++){var m=arguments[l];if(m)for(var c in m)m.hasOwnProperty(c)&&(Aa(m[c])?arguments[0][c]=m[c].slice():arguments[0][c]=m[c])}return arguments[0]}var Vc=function(){function l(m){s(this,l);for(var c in wt)if(wt.hasOwnProperty(c)){var _=wt[c],g=_._driver;this[c]=g,qt[g]||this.defineDriver(_)}this._defaultConfig=ai({},jc),this._config=ai({},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 l.prototype.config=function(c){if((typeof c=="undefined"?"undefined":a(c))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var _ in c){if(_==="storeName"&&(c[_]=c[_].replace(/\W/g,"_")),_==="version"&&typeof c[_]!="number")return new Error("Database version must be a number.");this._config[_]=c[_]}return"driver"in c&&c.driver?this.setDriver(this._config.driver):!0}else return typeof c=="string"?this._config[c]:this._config},l.prototype.defineDriver=function(c,_,g){var v=new p(function(E,I){try{var C=c._driver,k=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!c._driver){I(k);return}for(var O=oi.concat("_initStorage"),U=0,J=O.length;U<J;U++){var q=O[U],z=!Bc(Or,q);if((z||c[q])&&typeof c[q]!="function"){I(k);return}}var ue=function(){for(var Kt=function(Gc){return function(){var qc=new Error("Method "+Gc+" is not implemented by the current driver"),Sa=p.reject(qc);return f(Sa,arguments[arguments.length-1]),Sa}},si=0,$c=Or.length;si<$c;si++){var li=Or[si];c[li]||(c[li]=Kt(li))}};ue();var oe=function(Kt){qt[C]&&console.info("Redefining LocalForage driver: "+C),qt[C]=c,Ia[C]=Kt,E()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(oe,I):oe(!!c._support):oe(!0)}catch(De){I(De)}});return w(v,_,g),v},l.prototype.driver=function(){return this._driver||null},l.prototype.getDriver=function(c,_,g){var v=qt[c]?p.resolve(qt[c]):p.reject(new Error("Driver not found."));return w(v,_,g),v},l.prototype.getSerializer=function(c){var _=p.resolve(ii);return w(_,c),_},l.prototype.ready=function(c){var _=this,g=_._driverSet.then(function(){return _._ready===null&&(_._ready=_._initDriver()),_._ready});return w(g,c,c),g},l.prototype.setDriver=function(c,_,g){var v=this;Aa(c)||(c=[c]);var E=this._getSupportedDrivers(c);function I(){v._config.driver=v.driver()}function C(U){return v._extend(U),I(),v._ready=v._initStorage(v._config),v._ready}function k(U){return function(){var J=0;function q(){for(;J<U.length;){var z=U[J];return J++,v._dbInfo=null,v._ready=null,v.getDriver(z).then(C).catch(q)}I();var ue=new Error("No available storage method found.");return v._driverSet=p.reject(ue),v._driverSet}return q()}}var O=this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve();return this._driverSet=O.then(function(){var U=E[0];return v._dbInfo=null,v._ready=null,v.getDriver(U).then(function(J){v._driver=J._driver,I(),v._wrapLibraryMethodsWithReady(),v._initDriver=k(E)})}).catch(function(){I();var U=new Error("No available storage method found.");return v._driverSet=p.reject(U),v._driverSet}),w(this._driverSet,_,g),this._driverSet},l.prototype.supports=function(c){return!!Ia[c]},l.prototype._extend=function(c){ai(this,c)},l.prototype._getSupportedDrivers=function(c){for(var _=[],g=0,v=c.length;g<v;g++){var E=c[g];this.supports(E)&&_.push(E)}return _},l.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,_=oi.length;c<_;c++)Jc(this,oi[c])},l.prototype.createInstance=function(c){return new l(c)},l}(),Hc=new Vc;i.exports=Hc},{3:3}]},{},[4])(4)})});var xs=di(fn=>{"use strict";V();Zt();it();var eo=_e(),hf=ze("levelFinished",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),duration:F.number().optional(),rating:F.number().optional(),score:F.number().optional(),variation:F.string().optional()})),implement:e=>P(fn,null,function*(){let{levelId:t,duration:r,rating:n,score:i,variation:o}=e;Ne.info("onLevelFinished",r,n,i,o),yield Promise.all([Ke.reporter({event:"COMPLETE_GAME_LEVEL",extraParams:{inGameInfo:{levelId:t,duration:r,rating:n,score:i}}}),Ke.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i,variation:o})])})}),mf=ze("gamePlayEnded",{paramsSchema:F.tuple(F.object({duration:F.number().optional(),rating:F.number().optional(),score:F.number(),variation:F.string().optional()})),implement:e=>P(fn,null,function*(){let{duration:t,rating:r,score:n,variation:i}=e;Ne.info("onGamePlayEnded",t,r,n,i),yield Promise.all([Ke.tracker("GamePlayEnded",{duration:t,rating:r,score:n,variation:i}),Ke.reporter({event:"GAME_ENDED",extraParams:{inGameInfo:{duration:t,rating:r,score:n}}})])})}),pf=ze("levelUpgrade",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),name:F.string().optional()})),implement:r=>P(fn,[r],function*({levelId:e,name:t}){yield Promise.all([Ke.tracker("LevelUpgrade",{name:t,levelId:e}),Ke.reporter({event:"GAME_LEVEL_UP",extraParams:{inGameInfo:{levelId:e,levelName:t}}})])})});eo.registerCommand("TaskTrackerSDK.levelFinished",hf);eo.registerCommand("TaskTrackerSDK.gamePlayEnded",mf);eo.registerCommand("TaskTrackerSDK.levelUpgrade",pf);ge("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});ge("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});ge("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var pt,Rt,Os,to,vf,hn,ro=Z(()=>{"use strict";pt=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},Rt=new Map,Os=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=Rt.get(t.type);r&&r.forEach(n=>{try{n(t.data)}catch(i){console.warn("Callback execution failed:",i)}})}}catch(t){console.warn("Failed to parse message:",t)}},to=!1,vf=()=>{to||(window.addEventListener("message",Os),to=!0)},hn=(e,t)=>{vf(),Rt.has(e)||Rt.set(e,new Set);let r=Rt.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&Rt.delete(e),Rt.size===0&&(window.removeEventListener("message",Os),to=!1)}}});var mn,pn,vn,_n,gn,Ps,yn,wn,Ct,_f,ae,kt,Tt,Ue=Z(()=>{"use strict";V();mn="UNLOCK_OPTIONS_CHANGED",pn="INVOKE_PAYMENT",vn="ON_PAYMENT_RESULT",_n="ON_USE_MODAL_EVENT",gn="ON_USE_MODAL_RESULT",Ps="ON_USE_MODAL_FREQUENCY",yn="ON_USE_UNLOGIN_MODAL_EVENT",wn="INVOKE_UNLOGIN_MODAL_EVENT",Ct=new je,_f=()=>({on:Ct.on.bind(Ct),off:Ct.off.bind(Ct),emit:Ct.emit.bind(Ct)}),ae=_f(),kt={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}},Tt={show:!0,minInterval:8*60*60*1e3}});var Tu=di(ea=>{"use strict";me();Ue();ro();V();var ku={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};hn("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",ku[e.result],e.result),ae.emit(gn,{useModalResult:ku[e.result]})});ae.on(_n,(e,t)=>{var r;pt("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:dt()})});hn("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{ae.emit(vn,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin})});ae.on(pn,(e,t)=>P(ea,null,function*(){var r;pt("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:dt()})}));hn("ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT",e=>{var t,r,n,i,o;ae.emit(yn,{result:e.result=="ADS"?"FAILED":e.result,rewards:{jolicoin:{claimedRewardValue:(i=(n=(r=(t=e.extra)==null?void 0:t.firstLogin)==null?void 0:r.reward)==null?void 0:n.rewardValue)!=null?i:0,isFirstLogin:(o=e.isFirstLogin)!=null?o:!1}}}),e.result==="SUCCESS"&&D.onEnvConfigChanged({hostUserInfo:{isLogin:!0}})});ae.on(wn,e=>P(ea,null,function*(){pt("JOLIBOX_JOLI_UNLOGIN_MODAL_EVENT",{sequenceId:dt(),type:e})}))});it();me();Zt();V();var Ss=_e(),Qd="env",Yd="getSystemInfoSync",Xd=()=>{var i,o,a,s;let e={system:D.deviceInfo.system,platform:D.deviceInfo.platform.toLowerCase(),brand:D.deviceInfo.brand,pixelRatio:D.deviceInfo.pixelRatio,language:D.deviceInfo.lang,version:D.sdkInfo.jssdkVersion,appName:(i=D.hostInfo)==null?void 0:i.appName,SDKVersion:D.sdkInfo.nativeSDKVersion},t=(o=D.hostInfo)==null?void 0:o.version;t&&(e=ke(Q({},e),{version:t}));let r=(a=D.hostInfo)==null?void 0:a.appName;r&&(e=ke(Q({},e),{appName:r}));let n=(s=D.sdkInfo)==null?void 0:s.jssdkVersion;return n&&(e=ke(Q({},e),{SDKVersion:n})),e},Zd=mt(Yd,{implement:Xd}),ef=mt(Qd,{implement:()=>ke(Q({},D.hostInfo),{sdkInfo:D.sdkInfo,platform:D.platform,deviceInfo:D.deviceInfo})});Ss.registerCommand("API.env",ef);Ss.registerCommand("API.getSystemInfoSync",Zd);ge("env",{version:"1.0.0"});ge("getSystemInfoSync",{version:"1.0.0"});V();Zt();Ge();it();var tf="onJoliboxShow",rf="onJoliboxHide",nf="onReady",Qi=_e(),Yi=Ka(Te),zi=!0,er=!0,ln=0,un=Vi;function of(){let e=Date.now();if(e-ln<100)return;ln=e;let t=document.visibilityState==="visible";t!==zi&&(zi=t,un.emit("visible",zi))}function Rs(e){let t=Date.now();t-ln<100||(ln=t,e==="focus"&&!er?er=!0:e==="blur"&&er&&(er=!1),un.emit("visible",er))}document.addEventListener("visibilitychange",of);window.addEventListener("focus",()=>Rs("focus"));window.addEventListener("blur",()=>Rs("blur"));var af=mt(tf,{paramsSchema:F.tuple(F.function()),implement(e){let t=Yi(e);un.on("visible",r=>{r&&t()})}}),sf=mt(rf,{paramsSchema:F.tuple(F.function()),implement(e){let t=Yi(e);un.on("visible",r=>{!r&&t()})}}),lf=mt(nf,{paramsSchema:F.tuple(F.function()),implement(e){let t=Yi(e);ft.on("LifecycleEvent.onReady",r=>{t(r)})}});Qi.registerCommand("LifecycleSDK.onReady",lf);Qi.registerCommand("LifecycleSDK.onJoliboxShow",af);Qi.registerCommand("LifecycleSDK.onJoliboxHide",sf);ge("lifeCycle.onReady",{version:"1.0.0"});ge("lifeCycle.onJoliboxShow",{version:"1.0.0"});ge("lifeCycle.onJoliboxHide",{version:"1.0.0"});Zt();V();It();me();var Ts=fi(ks());var cn=_e(),Zi=class{constructor(){this.httpClient=Be.create({baseUrl:At(D.testMode)});this.getGameId=()=>D.mpId;this.getItem=t=>P(this,null,function*(){let{code:r,data:n,message:i}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),o=n==null?void 0:n.value,a=i;return r!=="SUCCESS"&&(o=yield this.gameStore.getItem(t),console.info("[SDK] cloud storage getItem failed, read from localstorage",o),a+="fallback to localstorage"),{code:r,message:a,data:o&&o!=="undefined"?o:null}});this.setItem=(t,r)=>P(this,null,function*(){let n=typeof r=="string"?r:String(r),{code:i,message:o}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}`,{data:{key:t,value:n}});return yield this.gameStore.setItem(t,n),{code:i,message:o}});this.removeItem=t=>P(this,null,function*(){yield this.gameStore.removeItem(t);let{code:r,message:n}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/remove`,{data:{key:t}});return{code:r,message:n}});this.clear=()=>P(this,null,function*(){yield this.gameStore.clear();let{code:t,message:r}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/clear`,{});return{code:t,message:r}});this.gameId=this.getGameId(),this.gameStore=Ts.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},dn=new Zi,uf=ze("getLocalStorage",{paramsSchema:F.tuple(F.string()),implement(e){return P(this,null,function*(){return yield dn.getItem(e)})}});cn.registerCommand("StorageSDK.getItem",uf);ge("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var cf=ze("setStorage",{paramsSchema:F.tuple(F.string(),F.or(F.string(),F.boolean(),F.number())),implement(e,t){return P(this,null,function*(){return yield dn.setItem(e,t)})}});cn.registerCommand("StorageSDK.setItem",cf);ge("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var df=ze("removeStorage",{paramsSchema:F.tuple(F.string()),implement(e){return P(this,null,function*(){return yield dn.removeItem(e)})}});cn.registerCommand("StorageSDK.removeItem",df);ge("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var ff=ze("clearStorage",{implement(){return P(this,null,function*(){return yield dn.clear()})}});cn.registerCommand("StorageSDK.clear",ff);ge("storage.clear",{version:"1.0.0"});var Pw=fi(xs());it();V();It();ro();me();Ue();var Ds=D.testMode;function Ns(){let e=new Map,t,r;return{registerRewardHandler(i,o){e.set(i,o)},handleReward(i,...o){return P(this,null,function*(){return yield i.reduce((s,u)=>P(this,null,function*(){let d=yield s;if(d===!0)return!0;Ds&&console.log(`handleReward ${u}`);let y=e.get(u),h=y?yield y(...o):d;return Ds&&console.log(`handleReward ${u} ${h}`),h}),Promise.resolve(!1))})},registerRewardsFetcher(i){return P(this,null,function*(){t=(...o)=>P(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),["ADS"]}})})},registerRewardFrequencyConfigFetcher(i){return P(this,null,function*(){r=(...o)=>P(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),{joliCoinUseAndCharge:kt,loginGuide:Tt}}})})},getRewardsTypes(...i){return P(this,null,function*(){return t?yield t(...i):["ADS"]})},getRewardFrequencyConfig(...i){return P(this,null,function*(){return r?yield r(...i):{joliCoinUseAndCharge:kt,loginGuide:Tt}})}}}Ue();V();var gf=()=>(e,t)=>e==="JOLI_COIN"&&t==="ADS"?-1:e==="ADS"&&t==="JOLI_COIN"?1:0,yf=e=>e.length?e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(gf()):["ADS"],Ls=e=>{e.registerRewardsFetcher(t=>P(void 0,null,function*(){var n,i,o,a;let r=["ADS"];try{let s=yield t.post("/api/games/unlock-options",{});if(s.code!=="SUCCESS")return r;ae.emit(mn,{options:((n=s.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=s.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1}});let u=((a=(o=s.data)==null?void 0:o.unlockOptions)==null?void 0:a.map(d=>d.type))||Array.from(r);return yf(u)}catch(s){return console.error("getRewardOptions error:",s),r}}))},Us=e=>{e.registerRewardFrequencyConfigFetcher(t=>P(void 0,null,function*(){var n,i,o,a;let r=yield t.get("/api/fe-configs/web-common/global-config",{});return ae.emit(Ps,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||kt,loginGuide:((i=r.data)==null?void 0:i.loginGuide)||Tt}),r.data&&ft.emit("onGlobalConfigChanged",{globalConfig:r.data}),{joliCoinUseAndCharge:((o=r.data)==null?void 0:o.joliCoinUseAndCharge)||kt,loginGuide:((a=r.data)==null?void 0:a.loginGuide)||Tt}}))};var Ms=e=>t=>P(void 0,null,function*(){try{console.log("trigger @jolibox/ads reward",t),yield e.adBreak(t)}catch(r){console.error("-----createAdsRewardHandler error-----",r)}return!0});Ue();function ot(e,t){let r=null,n=null,i=null,o=()=>{if(i){r=Promise.resolve(i);return}r=new Promise(a=>{n=a})};return o(),e.on(t,(...a)=>{let s=a[0];i=s,n&&(n(s),n=null)}),{getData:()=>(r||o(),r),getCachedData:()=>i,clearCache:()=>{i=null,r=null},getFreshData:()=>(i=null,r=null,o(),r),updateData:a=>{if(i)return i=Q(Q({},i),a),r=Promise.resolve(i),n&&(n(i),n=null),i}}}Ue();var Me=ot(ae,mn);me();V();V();var at=_e();Ue();Ue();var no=(e,t)=>{let{showUnlockWithJolicoinModal:r}=t;at.registerCommand(`Rewards.${e}.useJolicoin`,()=>P(void 0,null,function*(){var s,u,d,y;let n=yield Me.getData(),i=!!((s=n==null?void 0:n.userJoliCoin)!=null&&s.enableAutoDeduct),o=(y=(d=(u=n==null?void 0:n.options)==null?void 0:u.find(h=>h.type==="JOLI_COIN"))==null?void 0:d.joliCoinChoices[0].joliCoinQuantity)!=null?y:0;return console.log("-----unlockOptions usemodal-----",n,i,o),(yield r({enableAutoDeduct:i,userJoliCoin:n==null?void 0:n.userJoliCoin,joliCoinQuantity:o}))!=="CONFIRM"?{result:"FAILED"}:{result:"SUCCESS"}}))},tr=(e,t)=>r=>P(void 0,null,function*(){let n=ot(ae,gn);return ae.emit(_n,e,{enableAutoDeduct:r.enableAutoDeduct,userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult});var bn=e=>P(void 0,null,function*(){return(yield e.get("/api/joli-coin/balance",{query:{type:"JOLI_COIN"}})).data});var Bs=(e,t)=>e.some(r=>r.type==="JOLI_COIN"&&r.joliCoinChoices.some(n=>{var i;return n.joliCoinQuantity<=((i=t==null?void 0:t.balance)!=null?i:0)}));Ue();Ue();var io=(e,t)=>{let{httpClient:r,initiateAndAwaitPayment:n}=t;at.registerCommand(`Rewards.${e}.usePayment`,()=>P(void 0,null,function*(){var u,d,y,h,p,f;let i=yield Me.getData(),o=yield bn(r),a=(y=(d=(u=i==null?void 0:i.options)==null?void 0:u.find(w=>w.type==="JOLI_COIN"))==null?void 0:d.joliCoinChoices[0].joliCoinQuantity)!=null?y:0,s={balance:(h=o==null?void 0:o.balance)!=null?h:0,enableAutoDeduct:(f=(p=i==null?void 0:i.userJoliCoin)==null?void 0:p.enableAutoDeduct)!=null?f:!1};return Me.updateData({userJoliCoin:s}),console.log("-----unlockOptions payment-----",i,s,a),Bs((i==null?void 0:i.options)||[],s)?{result:"CONTINUE"}:{result:(yield n({userJoliCoin:s,joliCoinQuantity:a}))==="SUCCESS"?"SUCCESS":"FAILED"}}))},rr=(e,t)=>r=>P(void 0,null,function*(){let n=ot(ae,vn);return ae.emit(pn,e,{userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,enableAutoDeduct:r.userJoliCoin.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult});me();Ue();Ue();V();var oo=(e,t)=>{let{showUnloginModal:r,httpClient:n}=t;at.registerCommand(`Rewards.${e}.useUnloginModal`,()=>P(void 0,null,function*(){var a,s,u,d,y,h,p,f,w;let i=(a=D.hostUserInfo)==null?void 0:a.isLogin,o=yield Me.getData();if(console.log("-----isLogin-----",!!i),!i){let A=yield r();if(console.log("-----unloginModalResult-----",A),A.result=="FAILED"||A.result=="CANCEL")return{result:"FAILED"};let{isFirstLogin:R,claimedRewardValue:b}=(u=(s=A.rewards)==null?void 0:s.jolicoin)!=null?u:{};if(A.result=="SUCCESS"){R&&b&&(yield Ba(3e3));let T=yield bn(n),N=(h=(y=(d=o==null?void 0:o.options)==null?void 0:d.find(H=>H.type==="JOLI_COIN"))==null?void 0:y.joliCoinChoices[0].joliCoinQuantity)!=null?h:0,j={balance:(p=T==null?void 0:T.balance)!=null?p:0,enableAutoDeduct:(w=(f=o==null?void 0:o.userJoliCoin)==null?void 0:f.enableAutoDeduct)!=null?w:!1};if(Me.updateData({userJoliCoin:j}),j.balance>=N)return{result:"SUCCESS"}}}return{result:"CONTINUE"}}))},nr=(e,t)=>()=>P(void 0,null,function*(){let r=ot(ae,yn);return ae.emit(wn,e,{confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),yield r.getFreshData()});var En=(e,t,{handlers:{handleUnlockSuccess:r,handleUnlockFailed:n,unlockOptionsHandler:i,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:a,showUnloginModal:s}})=>{oo(e,{httpClient:t,showUnloginModal:s}),io(e,{httpClient:t,initiateAndAwaitPayment:o}),no(e,{showUnlockWithJolicoinModal:a});let u=D.abTests.find(y=>y.startsWith("coinOpt_v1")),d=[];return u?d=[`Rewards.${e}.usePayment`,`Rewards.${e}.useJolicoin`]:d=[`Rewards.${e}.useUnloginModal`,`Rewards.${e}.usePayment`,`Rewards.${e}.useJolicoin`],y=>P(void 0,null,function*(){var h,p,f;try{let w=!0;for(let R of d){let b=yield at.executeCommand(R);if(w=w&&b.result!=="FAILED",b.result!=="CONTINUE")break}if(!w)return n==null||n(y),!1;let A=yield t.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${dt()}-${D.mpType}-${Date.now()}`,gameInfo:{gameId:D.mpId}}});if(console.log("-----unlockWithJolicoin request result-----",A),A.code=="SUCCESS"){try{(p=y.adBreakDone)==null||p.call(y,{breakType:y.type,breakName:"name"in y&&(h=y.name)!=null?h:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in y&&((f=y.adViewed)==null||f.call(y))}catch(R){console.error("-----unlockWithJolicoin adBreakDone error-----",R)}return r==null||r({quantity:A.data.quantity,balance:A.data.balance}),!0}return n==null||n(y),!1}catch(w){if(console.info("JolicoinRewardHandler error:",w),w instanceof Error&&w.message=="CANCEL")throw w;return n==null||n(y),!1}finally{i.clearCache()}})};var Fs=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=()=>{r==null||r()},i=tr("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),o=rr("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"}),a=nr("ADS-JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noWatchAds"});return En("ADS-JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:Me,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:i,showUnloginModal:a}})};var js=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=u=>{var d;r==null||r(),(d=u.adBreakDone)==null||d.call(u,{breakType:u.type,breakFormat:u.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},i=tr("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),o=rr("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"}),a=nr("JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noThanks"});return En("JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:Me,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:i,showUnloginModal:a}})};var Qe=Ns();Ls(Qe);Us(Qe);var Rn,B,Gs,lo,vt,Js,qs,Ks,Ws,uo,ao,so,wf,ir={},zs=[],bf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,or=Array.isArray;function Ye(e,t){for(var r in t)e[r]=t[r];return e}function co(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ar(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Rn.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return In(e,a,n,i,null)}function In(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++Gs:i,__i:-1,__u:0};return i==null&&B.vnode!=null&&B.vnode(o),o}function st(e){return e.children}function xe(e,t){this.props=e,this.context=t}function xt(e,t){if(t==null)return e.__?xt(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?xt(e):null}function Qs(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Qs(e)}}function Vs(e){(!e.__d&&(e.__d=!0)&&vt.push(e)&&!Sn.__r++||Js!==B.debounceRendering)&&((Js=B.debounceRendering)||qs)(Sn)}function Sn(){for(var e,t,r,n,i,o,a,s=1;vt.length;)vt.length>s&&vt.sort(Ks),e=vt.shift(),s=vt.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=Ye({},n)).__v=n.__v+1,B.vnode&&B.vnode(r),fo(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i==null?xt(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,Zs(o,r,a),r.__e!=i&&Qs(r)));Sn.__r=0}function Ys(e,t,r,n,i,o,a,s,u,d,y){var h,p,f,w,A,R,b=n&&n.__k||zs,T=t.length;for(u=Ef(r,t,b,u,T),h=0;h<T;h++)(f=r.__k[h])!=null&&(p=f.__i===-1?ir:b[f.__i]||ir,f.__i=h,R=fo(e,f,p,i,o,a,s,u,d,y),w=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&ho(p.ref,null,f),y.push(f.ref,f.__c||w,f)),A==null&&w!=null&&(A=w),4&f.__u||p.__k===f.__k?u=Xs(f,u,e):typeof f.type=="function"&&R!==void 0?u=R:w&&(u=w.nextSibling),f.__u&=-7);return r.__e=A,u}function Ef(e,t,r,n,i){var o,a,s,u,d,y=r.length,h=y,p=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+p,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?In(null,a,null,null,null):or(a)?In(st,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?In(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,(d=a.__i=Af(a,r,u,h))!==-1&&(h--,(s=r[d])&&(s.__u|=2)),s==null||s.__v===null?(d==-1&&(i>y?p--:i<y&&p++),typeof a.type!="function"&&(a.__u|=4)):d!=u&&(d==u-1?p--:d==u+1?p++:(d>u?p--:p++,a.__u|=4))):e.__k[o]=null;if(h)for(o=0;o<y;o++)(s=r[o])!=null&&!(2&s.__u)&&(s.__e==n&&(n=xt(s)),tl(s,s));return n}function Xs(e,t,r){var n,i;if(typeof e.type=="function"){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=Xs(n[i],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=xt(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function sr(e,t){return t=t||[],e==null||typeof e=="boolean"||(or(e)?e.some(function(r){sr(r,t)}):t.push(e)),t}function Af(e,t,r,n){var i,o,a=e.key,s=e.type,u=t[r];if(u===null&&e.key==null||u&&a==u.key&&s===u.type&&!(2&u.__u))return r;if(n>(u!=null&&!(2&u.__u)?1:0))for(i=r-1,o=r+1;i>=0||o<t.length;){if(i>=0){if((u=t[i])&&!(2&u.__u)&&a==u.key&&s===u.type)return i;i--}if(o<t.length){if((u=t[o])&&!(2&u.__u)&&a==u.key&&s===u.type)return o;o++}}return-1}function Hs(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||bf.test(t)?r:r+"px"}function An(e,t,r,n,i){var o;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Hs(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Hs(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(Ws,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.t=n.t:(r.t=uo,e.addEventListener(t,o?so:ao,o)):e.removeEventListener(t,o?so:ao,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r==null?"":r;break e}catch(a){}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function $s(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=uo++;else if(t.u<r.t)return;return r(B.event?B.event(t):t)}}}function fo(e,t,r,n,i,o,a,s,u,d){var y,h,p,f,w,A,R,b,T,N,j,H,S,L,x,M,K,W=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),o=[s=t.__e=r.__e]),(y=B.__b)&&y(t);e:if(typeof W=="function")try{if(b=t.props,T="prototype"in W&&W.prototype.render,N=(y=W.contextType)&&n[y.__c],j=y?N?N.props.value:y.__:n,r.__c?R=(h=t.__c=r.__c).__=h.__E:(T?t.__c=h=new W(b,j):(t.__c=h=new xe(b,j),h.constructor=W,h.render=Sf),N&&N.sub(h),h.props=b,h.state||(h.state={}),h.context=j,h.__n=n,p=h.__d=!0,h.__h=[],h._sb=[]),T&&h.__s==null&&(h.__s=h.state),T&&W.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Ye({},h.__s)),Ye(h.__s,W.getDerivedStateFromProps(b,h.__s))),f=h.props,w=h.state,h.__v=t,p)T&&W.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),T&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(T&&W.getDerivedStateFromProps==null&&b!==f&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(b,j),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(b,h.__s,j)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(ee){ee&&(ee.__=t)}),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(b,h.__s,j),T&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(f,w,A)})}if(h.context=j,h.props=b,h.__P=e,h.__e=!1,S=B.__r,L=0,T){for(h.state=h.__s,h.__d=!1,S&&S(t),y=h.render(h.props,h.state,h.context),x=0;x<h._sb.length;x++)h.__h.push(h._sb[x]);h._sb=[]}else do h.__d=!1,S&&S(t),y=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++L<25);h.state=h.__s,h.getChildContext!=null&&(n=Ye(Ye({},n),h.getChildContext())),T&&!p&&h.getSnapshotBeforeUpdate!=null&&(A=h.getSnapshotBeforeUpdate(f,w)),M=y,y!=null&&y.type===st&&y.key==null&&(M=el(y.props.children)),s=Ys(e,or(M)?M:[M],t,r,n,i,o,a,s,u,d),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),R&&(h.__E=h.__=null)}catch(ee){if(t.__v=null,u||o!=null)if(ee.then){for(t.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else for(K=o.length;K--;)co(o[K]);else t.__e=r.__e,t.__k=r.__k;B.__e(ee,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=If(r.__e,t,r,n,i,o,a,u,d);return(y=B.diffed)&&y(t),128&t.__u?void 0:s}function Zs(e,t,r){for(var n=0;n<r.length;n++)ho(r[n],r[++n],r[++n]);B.__c&&B.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){B.__e(o,i.__v)}})}function el(e){return typeof e!="object"||e==null?e:or(e)?e.map(el):Ye({},e)}function If(e,t,r,n,i,o,a,s,u){var d,y,h,p,f,w,A,R=r.props,b=t.props,T=t.type;if(T=="svg"?i="http://www.w3.org/2000/svg":T=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(d=0;d<o.length;d++)if((f=o[d])&&"setAttribute"in f==!!T&&(T?f.localName==T:f.nodeType==3)){e=f,o[d]=null;break}}if(e==null){if(T==null)return document.createTextNode(b);e=document.createElementNS(i,T,b.is&&b),s&&(B.__m&&B.__m(t,o),s=!1),o=null}if(T===null)R===b||s&&e.data===b||(e.data=b);else{if(o=o&&Rn.call(e.childNodes),R=r.props||ir,!s&&o!=null)for(R={},d=0;d<e.attributes.length;d++)R[(f=e.attributes[d]).name]=f.value;for(d in R)if(f=R[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;An(e,d,null,f,i)}}for(d in b)f=b[d],d=="children"?p=f:d=="dangerouslySetInnerHTML"?y=f:d=="value"?w=f:d=="checked"?A=f:s&&typeof f!="function"||R[d]===f||An(e,d,f,R[d],i);if(y)s||h&&(y.__html===h.__html||y.__html===e.innerHTML)||(e.innerHTML=y.__html),t.__k=[];else if(h&&(e.innerHTML=""),Ys(t.type==="template"?e.content:e,or(p)?p:[p],t,r,n,T=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&xt(r,0),s,u),o!=null)for(d=o.length;d--;)co(o[d]);s||(d="value",T=="progress"&&w==null?e.removeAttribute("value"):w!==void 0&&(w!==e[d]||T=="progress"&&!w||T=="option"&&w!==R[d])&&An(e,d,w,R[d],i),d="checked",A!==void 0&&A!==e[d]&&An(e,d,A,R[d],i))}return e}function ho(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){B.__e(i,r)}}function tl(e,t,r){var n,i;if(B.unmount&&B.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||ho(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){B.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&tl(n[i],t,r||typeof e.type!="function");r||co(e.__e),e.__c=e.__=e.__e=void 0}function Sf(e,t,r){return this.constructor(e,r)}function rl(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),B.__&&B.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],fo(t,e=(!n&&r||t).__k=ar(st,null,[e]),i||ir,ir,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?Rn.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),Zs(o,e,a)}Rn=zs.slice,B={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},Gs=0,lo=function(e){return e!=null&&e.constructor==null},xe.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ye({},this.state),typeof e=="function"&&(e=e(Ye({},r),this.props)),e&&Ye(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Vs(this))},xe.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Vs(this))},xe.prototype.render=st,vt=[],qs=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ks=function(e,t){return e.__v.__b-t.__v.__b},Sn.__r=0,Ws=/(PointerCapture)$|Capture$/i,uo=0,ao=$s(!1),so=$s(!0),wf=0;var Ot,ie,mo,nl,lr=0,dl=[],se=B,il=se.__b,ol=se.__r,al=se.diffed,sl=se.__c,ll=se.unmount,ul=se.__;function kn(e,t){se.__h&&se.__h(ie,e,lr||t),lr=0;var r=ie.__H||(ie.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Tn(e){return lr=1,fl(hl,e)}function fl(e,t,r){var n=kn(Ot++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):hl(void 0,t),function(s){var u=n.__N?n.__N[0]:n.__[0],d=n.t(u,s);u!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=ie,!ie.__f)){var i=function(s,u,d){if(!n.__c.__H)return!0;var y=n.__c.__H.__.filter(function(p){return!!p.__c});if(y.every(function(p){return!p.__N}))return!o||o.call(this,s,u,d);var h=n.__c.props!==s;return y.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(h=!0)}}),o&&o.call(this,s,u,d)||h};ie.__f=!0;var o=ie.shouldComponentUpdate,a=ie.componentWillUpdate;ie.componentWillUpdate=function(s,u,d){if(this.__e){var y=o;o=void 0,i(s,u,d),o=y}a&&a.call(this,s,u,d)},ie.shouldComponentUpdate=i}return n.__N||n.__}function ur(e,t){var r=kn(Ot++,3);!se.__s&&yo(r.__H,t)&&(r.__=e,r.u=t,ie.__H.__h.push(r))}function vo(e,t){var r=kn(Ot++,4);!se.__s&&yo(r.__H,t)&&(r.__=e,r.u=t,ie.__h.push(r))}function _o(e){return lr=5,cr(function(){return{current:e}},[])}function cr(e,t){var r=kn(Ot++,7);return yo(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function go(e,t){return lr=8,cr(function(){return e},t)}function Rf(){for(var e;e=dl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Cn),e.__H.__h.forEach(po),e.__H.__h=[]}catch(t){e.__H.__h=[],se.__e(t,e.__v)}}se.__b=function(e){ie=null,il&&il(e)},se.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ul&&ul(e,t)},se.__r=function(e){ol&&ol(e),Ot=0;var t=(ie=e.__c).__H;t&&(mo===ie?(t.__h=[],ie.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Cn),t.__h.forEach(po),t.__h=[],Ot=0)),mo=ie},se.diffed=function(e){al&&al(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(dl.push(t)!==1&&nl===se.requestAnimationFrame||((nl=se.requestAnimationFrame)||Cf)(Rf)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),mo=ie=null},se.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Cn),r.__h=r.__h.filter(function(n){return!n.__||po(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],se.__e(n,r.__v)}}),sl&&sl(e,t)},se.unmount=function(e){ll&&ll(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Cn(n)}catch(i){t=i}}),r.__H=void 0,t&&se.__e(t,r.__v))};var cl=typeof requestAnimationFrame=="function";function Cf(e){var t,r=function(){clearTimeout(n),cl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);cl&&(t=requestAnimationFrame(r))}function Cn(e){var t=ie,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),ie=t}function po(e){var t=ie;e.__c=e.__(),ie=t}function yo(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function hl(e,t){return typeof t=="function"?t(e):t}function Tf(e,t){for(var r in t)e[r]=t[r];return e}function ml(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function pl(e,t){this.props=e,this.context=t}(pl.prototype=new xe).isPureReactComponent=!0,pl.prototype.shouldComponentUpdate=function(e,t){return ml(this.props,e)||ml(this.state,t)};var vl=B.__b;B.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),vl&&vl(e)};var Dy=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var xf=B.__e;B.__e=function(e,t,r,n){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}xf(e,t,r,n)};var _l=B.unmount;function Il(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=Tf({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Il(n,t,r)})),e}function Sl(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Sl(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function wo(){this.__u=0,this.o=null,this.__b=null}function Rl(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function xn(){this.i=null,this.l=null}B.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),_l&&_l(e)},(wo.prototype=new xe).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=Rl(n.__v),o=!1,a=function(){o||(o=!0,r.__R=null,i?i(s):s())};r.__R=a;var s=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=Sl(u,u.__c.__P,u.__c.__O)}var d;for(n.setState({__a:n.__b=null});d=n.o.pop();)d.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},wo.prototype.componentWillUnmount=function(){this.o=[]},wo.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Il(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&ar(st,null,e.fallback);return i&&(i.__u&=-33),[ar(st,null,t.__a?null:e.children),i]};var gl=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(xn.prototype=new xe).__a=function(e){var t=this,r=Rl(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),gl(t,e,n)):i()};r?r(o):o()}},xn.prototype.render=function(e){this.i=null,this.l=new Map;var t=sr(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},xn.prototype.componentDidUpdate=xn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){gl(e,r,t)})};var Of=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,Pf=/^(?: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]/,Df=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Nf=/[A-Z0-9]/g,Lf=typeof document!="undefined",Uf=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function bo(e,t,r){return t.__k==null&&(t.textContent=""),rl(e,t),typeof r=="function"&&r(),e?e.__c:null}xe.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(xe.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var yl=B.event;function Mf(){}function Bf(){return this.cancelBubble}function Ff(){return this.defaultPrevented}B.event=function(e){return yl&&(e=yl(e)),e.persist=Mf,e.isPropagationStopped=Bf,e.isDefaultPrevented=Ff,e.nativeEvent=e};var Cl,jf={enumerable:!1,configurable:!0,get:function(){return this.class}},wl=B.vnode;B.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={},o=n.indexOf("-")===-1;for(var a in r){var s=r[a];if(!(a==="value"&&"defaultValue"in r&&s==null||Lf&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var u=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&s===!0?s="":u==="translate"&&s==="no"?s=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?a="ondblclick":u!=="onchange"||n!=="input"&&n!=="textarea"||Uf(r.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":Df.test(a)&&(a=u):u=a="oninput":o&&Pf.test(a)?a=a.replace(Nf,"-$&").toLowerCase():s===null&&(s=void 0),u==="oninput"&&i[a=u]&&(a="oninputCapture"),i[a]=s}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=sr(r.children).forEach(function(d){d.props.selected=i.value.indexOf(d.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=sr(r.children).forEach(function(d){d.props.selected=i.multiple?i.defaultValue.indexOf(d.props.value)!=-1:i.defaultValue==d.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",jf)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=Of,wl&&wl(e)};var bl=B.__r;B.__r=function(e){bl&&bl(e),Cl=e.__c};var El=B.diffed;B.diffed=function(e){El&&El(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),Cl=null};var kl=Object.getOwnPropertySymbols,Jf=Object.prototype.hasOwnProperty,Vf=Object.prototype.propertyIsEnumerable,Hf=(e,t)=>{var r={};for(var n in e)Jf.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&kl)for(var n of kl(e))t.indexOf(n)<0&&Vf.call(e,n)&&(r[n]=e[n]);return r},Zl=Object.defineProperty,$f=Object.defineProperties,Gf=Object.getOwnPropertyDescriptors,Tl=Object.getOwnPropertySymbols,qf=Object.prototype.hasOwnProperty,Kf=Object.prototype.propertyIsEnumerable,xl=(e,t,r)=>t in e?Zl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Wf=(e,t)=>{for(var r in t||(t={}))qf.call(t,r)&&xl(e,r,t[r]);if(Tl)for(var r of Tl(t))Kf.call(t,r)&&xl(e,r,t[r]);return e},zf=(e,t)=>$f(e,Gf(t)),Qf=(e,t)=>{for(var r in t)Zl(e,r,{get:t[r],enumerable:!0})},eu=(e,t,r,n)=>{for(var i=t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=a(i)||i);return i},Yf=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}function Xf(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Zf(e){return typeof e=="string"}function eh(e){return typeof e=="undefined"}function th(e){return eh(e)||e===null}function rh(e){return typeof e=="function"}function tu(e){let t=e,r=null,n=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r||(r=new t(...o)),r};return n.prototype=t.prototype,n}var nh=(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))(nh||{});function dr(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}var ih={log:dr("log"),warn:dr("warn"),info:dr("info"),error:dr("error"),debug:dr("debug")};Object.assign(globalThis,{logger:ih});var Ol=Symbol.for("Jolibox.canIUseMap"),oh={};globalThis[Ol]||(globalThis[Ol]=oh);var Pl=Symbol.for("Jolibox.canIUseMap.native"),ah={};globalThis[Pl]||(globalThis[Pl]=ah);var ru=(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))(ru||{}),nu=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(nu||{}),iu=(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))(iu||{}),Dl=["name","params"],sh=["name","type","location","target","extra","timestamp","userId"],lh=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function Nn(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function uh(e){let t=e.location?Nn(e.location,Dl):null,r=e.target?Nn(e.target,Dl):null;return Nn(zf(Wf({},e),{location:t,target:r}),sh)}function ch(e){let t=e.events.map(n=>uh(n)),r=Nn(e.device,lh);return[e.protocolVersion,t,r,e.project]}function dh(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}dh();var Nt=typeof window=="undefined",Nl=()=>!Nt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");!Nt&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),!Nt&&navigator.userAgent.includes("Android"),!Nt&&navigator.userAgent.includes("Mac"),!Nt&&navigator.userAgent.includes("FB_IAB"),!Nt&&!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var ko=class To{constructor(t){this.element=t,this.next=To.Undefined,this.prev=To.Undefined}};ko.Undefined=new ko(void 0);var re=ko,fh=class{constructor(){this._first=re.Undefined,this._last=re.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===re.Undefined}clear(){let e=this._first;for(;e!==re.Undefined;){let t=e.next;e.prev=re.Undefined,e.next=re.Undefined,e=t}this._first=re.Undefined,this._last=re.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new re(e);if(this._first===re.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==re.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==re.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==re.Undefined&&e.next!==re.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===re.Undefined&&e.next===re.Undefined?(this._first=re.Undefined,this._last=re.Undefined):e.next===re.Undefined?(this._last=this._last.prev,this._last.next=re.Undefined):e.prev===re.Undefined&&(this._first=this._first.next,this._first.prev=re.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==re.Undefined;)yield e.element,e=e.next}},hh=0,fr=class{constructor(e){this.value=e,this.id=hh++}},vr=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof fr&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){return this._event!=null||(this._event=(e,t)=>{var r,n,i,o,a,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let u=new fr(e);return this._listeners?this._listeners instanceof fr?this._listeners=[this._listeners,u]:this._listeners.push(u):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=u,(o=(i=this.options)==null?void 0:i.onDidFirstListener)==null||o.call(i,this)),(s=(a=this.options)==null?void 0:a.onDidAddListener)==null||s.call(a,this),this._size++,()=>{var d,y,h,p;if(!this._disposed){if(this._listeners instanceof fr)this._listeners.id===u.id&&(this._listeners=void 0,this._size=0,(y=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||y.call(d));else if(this._listeners){let f=this._listeners.indexOf(u);f>=0&&(this._listeners.splice(f,1),this._size--,this._size===0&&((p=(h=this.options)==null?void 0:h.onDidRemoveLastListener)==null||p.call(h)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof fr?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},mh=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;var n;let i=(n=this.listeners.get(e))!=null?n:new vr,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e){let t=this.listeners.get(e),r=this.cachedEventQueue.get(e);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r||(r=new fh,this.cachedEventQueue.set(e,r)),r.push({args:i}),t&&t.fire({event:e,args:i})}once(e,t){var r=this;let n=function(){t(...arguments),r.off(e,n)};this.on(e,n,!1)}},xo={};Qf(xo,{None:()=>ph,filter:()=>_h,once:()=>ou,toPromise:()=>vh});var ph=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function vh(e){return new Promise(t=>ou(e)(t))}function ou(e){return function(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function _h(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new vr(n);return i.event})(function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e(i=>t(i)&&r.call(n,i),null)})}var Eo=Symbol.for("Jolibox.hostEmitter"),gh=()=>{let e=new mh;return globalThis[Eo]||(globalThis[Eo]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Eo]};gh();function yh(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)wh(e[n],t[n])}function wh(e,t){if(Zf(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(rh(t)){try{if(e instanceof t)return}catch(r){}if(!th(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 vr,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return yh(o,r),n(...o)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};Oo=eu([tu],Oo);var Ll=class{constructor(){this._onWillExecuteCommand=new vr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new vr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Oo,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Xf(3e4)),this._starActivation}executeCommand(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return Yf(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),xo.toPromise(xo.filter(this.registry.onDidRegisterCommand,i=>i===e))])]),this._tryExecuteCommand(e,r))})}executeCommandThowErr(e){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let t=this.registry.getCommand(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this._onWillExecuteCommand.fire({commandId:e,args:n});let o=this.invokeFunction(t.handler,...n);return this._onDidExecuteCommand.fire({commandId:e,args:n}),o}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e){try{for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e(...r)}finally{}}};Ll=eu([tu],Ll);function Ie(e,t,r){return(t=bh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bh(e){var t=Eh(e,"string");return typeof t=="symbol"?t:t+""}function Eh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Pt=e=>e?function(){try{for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e==null||e(...r)}catch(i){console.error("Error calling function",i)}}:()=>{console.log("wrapUserFunction: fn is undefined")},Po=class{constructor(t){Ie(this,"context",void 0),Ie(this,"continueCallback",void 0),Ie(this,"adIsShowingCallback",void 0),Ie(this,"isBeforeAdCalled",!1),Ie(this,"isBeforeRewardCalled",!1),Ie(this,"isAdDismissedCalled",!1),Ie(this,"isAdViewedCalled",!1),Ie(this,"isAfterAdCalled",!1),Ie(this,"currentProvider",void 0),Ie(this,"currentClientParams",void 0),Ie(this,"adsHasResponse",!1),Ie(this,"videoChecker",window.document.createElement("video")),Ie(this,"contextInfo",void 0),Ie(this,"wrapShowAdFn",r=>()=>{var n,i,o;this.adsHasResponse=!0;let a=!1;this.videoChecker.play().catch(()=>{a=!1}),a=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:a},this.paramsToTrack)),Nl()&&this.context.track("mmp_ad_impression",{ad_network:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:"",ad_format:"rewarded",module:"game",game_id:this.contextInfo.objectId}),(o=this.adIsShowingCallback)==null||o.call(this,!0);let s=Pt(r);s==null||s()}),this.context=t,this.contextInfo=t.getContextInfo()}get paramsToTrack(){var t,r,n,i,o,a;return{provider:(r=(t=this.currentProvider)==null?void 0:t.name)!=null?r:null,type:(n=this.currentClientParams)==null?void 0:n.type,name:((i=this.currentClientParams)==null?void 0:i.type)==="preroll"?null:(a=(o=this.currentClientParams)==null?void 0:o.name)!=null?a:""}}wrapBeforeAd(t){return()=>{var r,n,i,o;if(this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),!this.isBeforeAdCalled){this.isBeforeAdCalled=!0;let a=Pt(t);a==null||a(),((r=this.currentClientParams)==null?void 0:r.type)!=="reward"&&((n=this.adIsShowingCallback)==null||n.call(this,!0),Nl()&&this.context.track("mmp_ad_impression",{ad_network:(o=(i=this.currentProvider)==null?void 0:i.name)!=null?o:"",ad_format:"interstitial",module:"game",game_id:this.contextInfo.objectId}))}}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdDismissedCalled){this.isAdDismissedCalled=!0;let r=Pt(t);r==null||r()}}}wrapAdViewed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdViewedCalled){this.isAdViewedCalled=!0;let r=Pt(t);r==null||r()}}}wrapAfterAd(t){return()=>{if(this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),!this.isAfterAdCalled){this.isAfterAdCalled=!0;let r=Pt(t);r==null||r()}}}wrapAdBreakDone(t){return r=>{var n,i,o,a,s,u;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:null,breakType:r.breakType,breakName:(o=r.breakName)!=null?o:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{let d=Pt(t);d==null||d(r),(a=this.adIsShowingCallback)==null||a.call(this,!1),(s=this.continueCallback)==null||s.call(this,[!1,r]);break}default:{(u=this.continueCallback)==null||u.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n,i){return P(this,null,function*(){return this.currentProvider=t,this.currentClientParams=r,this.adsHasResponse=!1,new Promise(o=>{this.continueCallback=o,this.adIsShowingCallback=i;let a;switch(r.type){case"preroll":{a={type:r.type,adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}case"reward":{a={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),beforeReward:this.wrapBeforeReward(r.beforeReward),adDismissed:this.wrapAdDismissed(r.adDismissed),adViewed:this.wrapAdViewed(r.adViewed),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}default:{a={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}}window.setTimeout(()=>{var s,u,d,y,h;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(u=(s=this.currentProvider)==null?void 0:s.name)!=null?u:null}),(y=this.continueCallback)==null||y.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(d=r.name)!=null?d:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(h=this.adIsShowingCallback)==null||h.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(a,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};function On(e,t,r){return(t=Ah(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ah(e){var t=Ih(e,"string");return typeof t=="symbol"?t:t+""}function Ih(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Do=class{constructor(t){On(this,"context",void 0),On(this,"adBreakIsShowing",!1),On(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),On(this,"reportPageHide",()=>{this.context.track("AdBreakHide",{context:"AdsActionDetection"})}),this.context=t,window.addEventListener("visibilitychange",()=>{document.hidden&&this.adBreakIsShowing&&this.reportPageHide()}),window.addEventListener("beforeunload",r=>{this.adBreakIsShowing&&this.reportPageJumpOut()})}};function Pn(e,t,r){return(t=Sh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sh(e){var t=Rh(e,"string");return typeof t=="symbol"?t:t+""}function Rh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var No=class{constructor(t){Pn(this,"configs",null),Pn(this,"firstRun",!0),Pn(this,"context",void 0),Pn(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return P(this,null,function*(){try{this.configs=yield this.context.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config",{})}catch(t){}})}shouldBypassCallingInterstitial(){var t,r;let n;if(!this.configs)this.init(),n=!this.firstRun;else{let i=(t=this.contextInfo.channel)!=null?t:"",o=this.configs[i],a=(r=o==null?void 0:o.interstitialRate)!=null?r:1;n=Math.random()<a}return this.firstRun=!1,n}};function Xe(e,t,r){return(t=Ch(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ch(e){var t=kh(e,"string");return typeof t=="symbol"?t:t+""}function kh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lo=class{constructor(t,r){Xe(this,"name","ADSENSE"),Xe(this,"context",void 0),Xe(this,"contextInfo",void 0),Xe(this,"configured",!1),Xe(this,"initParams",void 0),Xe(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),Xe(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=Hf(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),Xe(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),Xe(this,"adUnit",n=>P(this,null,function*(){var i,o,a,s;if(this.context.track("CallAdUnit",{adFormat:(o=(i=n.adFormat)==null?void 0:i.toString())!=null?o:null,fullWidthResponsive:(a=n.fullWidthResponsive)!=null?a:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:u,slot:d,adFormat:y,fullWidthResponsive:h,style:p}=n,f;if(!u)throw new Error("targeting element is required");if(typeof u=="string"?f=document.querySelector(u):f=u,!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 y=="object"&&Array.isArray(y)?y.join(", "):y,R=document.createElement("ins");if(R.className="adsbygoogle",R.id="jolibox-ads",R.style.display="block",R.setAttribute("data-ad-client",this.initParams.clientId),R.setAttribute("data-ad-slot",w),A&&R.setAttribute("data-ad-format",A),h&&R.setAttribute("data-full-width-responsive",h),p&&R.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",R.style.position="relative",f.appendChild(R),R.appendChild(b)}else f.appendChild(R),new MutationObserver(b=>{b.forEach(T=>{if(T.type==="attributes"&&T.attributeName==="data-ad-status"){let N=R.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:N!=null?N:"null"})}})}).observe(R,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})})),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,window.adsbygoogle=window.adsbygoogle||[]}init(){return P(this,null,function*(){var t;if(this.context.track("CallAdsInit",{provider:this.name}),typeof window=="undefined")return;let r="google-adsense",n=(t=this.contextInfo.testAdsMode)!=null?t:!1;if(!document.getElementById(r)&&this.initParams.clientId){let i=document.createElement("script");i.id=r,i.async=!0,i.crossOrigin="anonymous",i.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,n&&i.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&i.setAttribute("data-ad-channel",this.initParams.channelId),this.initParams.admobInterstitialSlot&&i.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),this.initParams.admobRewardedSlot&&i.setAttribute("data-admob-rewarded-slot",this.initParams.admobRewardedSlot),this.initParams.admobOnly&&i.setAttribute("data-admob-ads-only","on"),document.head.appendChild(i),this.context.track("LoadAdsenseCompleted",null)}})}};function Th(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 xh(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 Oh=function(){function e(r){var n=this;this._insertTag=function(i){var o;n.tags.length===0?n.insertionPoint?o=n.insertionPoint.nextSibling:n.prepend?o=n.container.firstChild:o=n.before:o=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(i,o),n.tags.push(i)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(xh(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=Th(n);try{i.insertRule(r,i.cssRules.length)}catch(o){}}else n.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var n;return(n=r.parentNode)==null?void 0:n.removeChild(r)}),this.tags=[],this.ctr=0},e}(),we="-ms-",jn="-moz-",$="-webkit-",au="comm",Qo="rule",Yo="decl",Ph="@import",su="@keyframes",Dh="@layer",Nh=Math.abs,Gn=String.fromCharCode,Lh=Object.assign;function Uh(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 lu(e){return e.trim()}function Mh(e,t){return(e=t.exec(e))?e[0]:e}function G(e,t,r){return e.replace(t,r)}function Uo(e,t){return e.indexOf(t)}function pe(e,t){return e.charCodeAt(t)|0}function _r(e,t,r){return e.slice(t,r)}function Je(e){return e.length}function Xo(e){return e.length}function Dn(e,t){return t.push(e),e}function Bh(e,t){return e.map(t).join("")}var qn=1,Mt=1,uu=0,Ce=0,de=0,Bt="";function Kn(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:qn,column:Mt,length:a,return:""}}function hr(e,t){return Lh(Kn("",null,null,"",null,null,0),e,{length:-e.length},t)}function Fh(){return de}function jh(){return de=Ce>0?pe(Bt,--Ce):0,Mt--,de===10&&(Mt=1,qn--),de}function Pe(){return de=Ce<uu?pe(Bt,Ce++):0,Mt++,de===10&&(Mt=1,qn++),de}function Ve(){return pe(Bt,Ce)}function Ln(){return Ce}function wr(e,t){return _r(Bt,e,t)}function gr(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 cu(e){return qn=Mt=1,uu=Je(Bt=e),Ce=0,[]}function du(e){return Bt="",e}function Un(e){return lu(wr(Ce-1,Mo(e===91?e+2:e===40?e+1:e)))}function Jh(e){for(;(de=Ve())&&de<33;)Pe();return gr(e)>2||gr(de)>3?"":" "}function Vh(e,t){for(;--t&&Pe()&&!(de<48||de>102||de>57&&de<65||de>70&&de<97););return wr(e,Ln()+(t<6&&Ve()==32&&Pe()==32))}function Mo(e){for(;Pe();)switch(de){case e:return Ce;case 34:case 39:e!==34&&e!==39&&Mo(de);break;case 40:e===41&&Mo(e);break;case 92:Pe();break}return Ce}function Hh(e,t){for(;Pe()&&e+de!==57&&!(e+de===84&&Ve()===47););return"/*"+wr(t,Ce-1)+"*"+Gn(e===47?e:Pe())}function $h(e){for(;!gr(Ve());)Pe();return wr(e,Ce)}function Gh(e){return du(Mn("",null,null,null,[""],e=cu(e),0,[0],e))}function Mn(e,t,r,n,i,o,a,s,u){for(var d=0,y=0,h=a,p=0,f=0,w=0,A=1,R=1,b=1,T=0,N="",j=i,H=o,S=n,L=N;R;)switch(w=T,T=Pe()){case 40:if(w!=108&&pe(L,h-1)==58){Uo(L+=G(Un(T),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:L+=Un(T);break;case 9:case 10:case 13:case 32:L+=Jh(w);break;case 92:L+=Vh(Ln()-1,7);continue;case 47:switch(Ve()){case 42:case 47:Dn(qh(Hh(Pe(),Ln()),t,r),u);break;default:L+="/"}break;case 123*A:s[d++]=Je(L)*b;case 125*A:case 59:case 0:switch(T){case 0:case 125:R=0;case 59+y:b==-1&&(L=G(L,/\f/g,"")),f>0&&Je(L)-h&&Dn(f>32?Ml(L+";",n,r,h-1):Ml(G(L," ","")+";",n,r,h-2),u);break;case 59:L+=";";default:if(Dn(S=Ul(L,t,r,d,y,i,s,N,j=[],H=[],h),o),T===123)if(y===0)Mn(L,t,S,S,j,o,h,s,H);else switch(p===99&&pe(L,3)===110?100:p){case 100:case 108:case 109:case 115:Mn(e,S,S,n&&Dn(Ul(e,S,S,0,0,i,s,N,i,j=[],h),H),i,H,h,s,n?j:H);break;default:Mn(L,S,S,S,[""],H,0,s,H)}}d=y=f=0,A=b=1,N=L="",h=a;break;case 58:h=1+Je(L),f=w;default:if(A<1){if(T==123)--A;else if(T==125&&A++==0&&jh()==125)continue}switch(L+=Gn(T),T*A){case 38:b=y>0?1:(L+="\f",-1);break;case 44:s[d++]=(Je(L)-1)*b,b=1;break;case 64:Ve()===45&&(L+=Un(Pe())),p=Ve(),y=h=Je(N=L+=$h(Ln())),T++;break;case 45:w===45&&Je(L)==2&&(A=0)}}return o}function Ul(e,t,r,n,i,o,a,s,u,d,y){for(var h=i-1,p=i===0?o:[""],f=Xo(p),w=0,A=0,R=0;w<n;++w)for(var b=0,T=_r(e,h+1,h=Nh(A=a[w])),N=e;b<f;++b)(N=lu(A>0?p[b]+" "+T:G(T,/&\f/g,p[b])))&&(u[R++]=N);return Kn(e,t,r,i===0?Qo:s,u,d,y)}function qh(e,t,r){return Kn(e,t,r,au,Gn(Fh()),_r(e,2,-2),0)}function Ml(e,t,r,n){return Kn(e,t,r,Yo,_r(e,0,n),_r(e,n+1,-1),n)}function Ut(e,t){for(var r="",n=Xo(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function Kh(e,t,r,n){switch(e.type){case Dh:if(e.children.length)break;case Ph:case Yo:return e.return=e.return||e.value;case au:return"";case su:return e.return=e.value+"{"+Ut(e.children,n)+"}";case Qo:e.value=e.props.join(",")}return Je(r=Ut(e.children,n))?e.return=e.value+"{"+r+"}":""}function Wh(e){var t=Xo(e);return function(r,n,i,o){for(var a="",s=0;s<t;s++)a+=e[s](r,n,i,o)||"";return a}}function zh(e){return function(t){t.root||(t=t.return)&&e(t)}}function Qh(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Yh=function(e,t,r){for(var n=0,i=0;n=i,i=Ve(),n===38&&i===12&&(t[r]=1),!gr(i);)Pe();return wr(e,Ce)},Xh=function(e,t){var r=-1,n=44;do switch(gr(n)){case 0:n===38&&Ve()===12&&(t[r]=1),e[r]+=Yh(Ce-1,t,r);break;case 2:e[r]+=Un(n);break;case 4:if(n===44){e[++r]=Ve()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=Gn(n)}while(n=Pe());return e},Zh=function(e,t){return du(Xh(cu(e),t))},Bl=new WeakMap,em=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!Bl.get(r))&&!n){Bl.set(e,!0);for(var i=[],o=Zh(t,i),a=r.props,s=0,u=0;s<o.length;s++)for(var d=0;d<a.length;d++,u++)e.props[u]=i[s]?o[s].replace(/&\f/g,a[d]):a[d]+" "+o[s]}}},tm=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function fu(e,t){switch(Uh(e,t)){case 5103:return $+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return $+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return $+e+jn+e+we+e+e;case 6828:case 4268:return $+e+we+e+e;case 6165:return $+e+we+"flex-"+e+e;case 5187:return $+e+G(e,/(\w+).+(:[^]+)/,$+"box-$1$2"+we+"flex-$1$2")+e;case 5443:return $+e+we+"flex-item-"+G(e,/flex-|-self/,"")+e;case 4675:return $+e+we+"flex-line-pack"+G(e,/align-content|flex-|-self/,"")+e;case 5548:return $+e+we+G(e,"shrink","negative")+e;case 5292:return $+e+we+G(e,"basis","preferred-size")+e;case 6060:return $+"box-"+G(e,"-grow","")+$+e+we+G(e,"grow","positive")+e;case 4554:return $+G(e,/([^-])(transform)/g,"$1"+$+"$2")+e;case 6187:return G(G(G(e,/(zoom-|grab)/,$+"$1"),/(image-set)/,$+"$1"),e,"")+e;case 5495:case 3959:return G(e,/(image-set\([^]*)/,$+"$1$`$1");case 4968:return G(G(e,/(.+:)(flex-)?(.*)/,$+"box-pack:$3"+we+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+$+e+e;case 4095:case 3583:case 4068:case 2532:return G(e,/(.+)-inline(.+)/,$+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Je(e)-1-t>6)switch(pe(e,t+1)){case 109:if(pe(e,t+4)!==45)break;case 102:return G(e,/(.+:)(.+)-([^]+)/,"$1"+$+"$2-$3$1"+jn+(pe(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Uo(e,"stretch")?fu(G(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(pe(e,t+1)!==115)break;case 6444:switch(pe(e,Je(e)-3-(~Uo(e,"!important")&&10))){case 107:return G(e,":",":"+$)+e;case 101:return G(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+$+(pe(e,14)===45?"inline-":"")+"box$3$1"+$+"$2$3$1"+we+"$2box$3")+e}break;case 5936:switch(pe(e,t+11)){case 114:return $+e+we+G(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return $+e+we+G(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return $+e+we+G(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return $+e+we+e+e}return e}var rm=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case Yo:e.return=fu(e.value,e.length);break;case su:return Ut([hr(e,{value:G(e.value,"@","@"+$)})],n);case Qo:if(e.length)return Bh(e.props,function(i){switch(Mh(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ut([hr(e,{props:[G(i,/:(read-\w+)/,":"+jn+"$1")]})],n);case"::placeholder":return Ut([hr(e,{props:[G(i,/:(plac\w+)/,":"+$+"input-$1")]}),hr(e,{props:[G(i,/:(plac\w+)/,":"+jn+"$1")]}),hr(e,{props:[G(i,/:(plac\w+)/,we+"input-$1")]})],n)}return""})}},nm=[rm],im=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var A=w.getAttribute("data-emotion");A.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var n=e.stylisPlugins||nm,i={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(w){for(var A=w.getAttribute("data-emotion").split(" "),R=1;R<A.length;R++)i[A[R]]=!0;a.push(w)});var s,u=[em,tm];{var d,y=[Kh,zh(function(w){d.insert(w)})],h=Wh(u.concat(n,y)),p=function(w){return Ut(Gh(w),h)};s=function(w,A,R,b){d=R,p(w?w+"{"+A.styles+"}":A.styles),b&&(f.inserted[A.name]=!0)}}var f={key:t,sheet:new Oh({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return f.sheet.hydrate(a),f};function om(e){for(var t=0,r,n=0,i=e.length;i>=4;++n,i-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var am={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},sm=/[A-Z]|^ms/g,lm=/_EMO_([^_]+?)_([^]*?)_EMO_/g,hu=function(e){return e.charCodeAt(1)===45},Fl=function(e){return e!=null&&typeof e!="boolean"},Ao=Qh(function(e){return hu(e)?e:e.replace(sm,"-$&").toLowerCase()}),jl=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(lm,function(r,n,i){return lt={name:n,styles:i,next:lt},n})}return am[e]!==1&&!hu(e)&&typeof t=="number"&&t!==0?t+"px":t};function Jn(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var i=r;if(i.anim===1)return lt={name:i.name,styles:i.styles,next:lt},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)lt={name:a.name,styles:a.styles,next:lt},a=a.next;var s=o.styles+";";return s}return um(e,t,r)}}var u=r;if(t==null)return u;var d=t[u];return d!==void 0?d:u}function um(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=Jn(e,t,r[i])+";";else for(var o in r){var a=r[o];if(typeof a!="object"){var s=a;t!=null&&t[s]!==void 0?n+=o+"{"+t[s]+"}":Fl(s)&&(n+=Ao(o)+":"+jl(o,s)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var u=0;u<a.length;u++)Fl(a[u])&&(n+=Ao(o)+":"+jl(o,a[u])+";");else{var d=Jn(e,t,a);switch(o){case"animation":case"animationName":{n+=Ao(o)+":"+d+";";break}default:n+=o+"{"+d+"}"}}}return n}var Jl=/label:\s*([^\s;{]+)\s*(;|$)/g,lt;function Io(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,i="";lt=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=Jn(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=Jn(r,t,e[s]),n){var u=o;i+=u[s]}Jl.lastIndex=0;for(var d="",y;(y=Jl.exec(i))!==null;)d+="-"+y[1];var h=om(i)+d;return{name:h,styles:i,next:lt}}function mu(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}var cm=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},dm=function(e,t,r){cm(e,t);var n=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var i=t;do e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next;while(i!==void 0)}};function Vl(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function Hl(e,t,r){var n=[],i=mu(e,n,r);return n.length<2?r:i+t(n)}var fm=function(e){var t=im(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Io(s,t.registered,void 0);return dm(t,d),t.key+"-"+d.name},n=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Io(s,t.registered),y="animation-"+d.name;return Vl(t,{name:d.name,styles:"@keyframes "+y+"{"+d.styles+"}"}),y},i=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Io(s,t.registered);Vl(t,d)},o=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return Hl(t.registered,r,hm(s))};return{css:r,cx:o,injectGlobal:i,keyframes:n,hydrate:function(a){a.forEach(function(s){t.inserted[s]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:mu.bind(null,t.registered),merge:Hl.bind(null,t.registered,r)}},hm=function e(t){for(var r="",n=0;n<t.length;n++){var i=t[n];if(i!=null){var o=void 0;switch(typeof i){case"boolean":break;case"object":{if(Array.isArray(i))o=e(i);else{o="";for(var a in i)i[a]&&a&&(o&&(o+=" "),o+=a)}break}default:o=i}o&&(r&&(r+=" "),r+=o)}}return r},mm=fm({key:"css"}),Ft=mm.css,Bo,Oe,So,$l,Gl=0,pu=[],fe=B,ql=fe.__b,Kl=fe.__r,Wl=fe.diffed,zl=fe.__c,Ql=fe.unmount,Yl=fe.__;function pm(e,t){fe.__h&&fe.__h(Oe,e,Gl||t),Gl=0;var r=Oe.__H||(Oe.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function vu(e,t){var r=pm(Bo++,7);return gm(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function vm(){for(var e;e=pu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Bn),e.__H.__h.forEach(Fo),e.__H.__h=[]}catch(t){e.__H.__h=[],fe.__e(t,e.__v)}}fe.__b=function(e){Oe=null,ql&&ql(e)},fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Yl&&Yl(e,t)},fe.__r=function(e){Kl&&Kl(e),Bo=0;var t=(Oe=e.__c).__H;t&&(So===Oe?(t.__h=[],Oe.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Bn),t.__h.forEach(Fo),t.__h=[],Bo=0)),So=Oe},fe.diffed=function(e){Wl&&Wl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(pu.push(t)!==1&&$l===fe.requestAnimationFrame||(($l=fe.requestAnimationFrame)||_m)(vm)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),So=Oe=null},fe.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Bn),r.__h=r.__h.filter(function(n){return!n.__||Fo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],fe.__e(n,r.__v)}}),zl&&zl(e,t)},fe.unmount=function(e){Ql&&Ql(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Bn(n)}catch(i){t=i}}),r.__H=void 0,t&&fe.__e(t,r.__v))};var Xl=typeof requestAnimationFrame=="function";function _m(e){var t,r=function(){clearTimeout(n),Xl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Xl&&(t=requestAnimationFrame(r))}function Bn(e){var t=Oe,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Oe=t}function Fo(e){var t=Oe;e.__c=e.__(),Oe=t}function gm(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var ym=Symbol.for("preact-signals");function Wn(){if(ut>1)ut--;else{for(var e,t=!1;mr!==void 0;){var r=mr;for(mr=void 0,jo++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&gu(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(jo=0,ut--,t)throw e}}function Re(e){if(ut>0)return e();ut++;try{return e()}finally{Wn()}}var Y=void 0,mr=void 0,ut=0,jo=0,Vn=0;function _u(e){if(Y!==void 0){var t=e.n;if(t===void 0||t.t!==Y)return t={i:0,S:e,p:Y.s,n:void 0,t:Y,e:void 0,x:void 0,r:t},Y.s!==void 0&&(Y.s.n=t),Y.s=t,e.n=t,32&Y.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Y.s,t.n=void 0,Y.s.n=t,Y.s=t),t}}function ve(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}ve.prototype.brand=ym;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,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}};ve.prototype.subscribe=function(e){var t=this;return Er(function(){var r=t.value,n=Y;Y=void 0;try{e(r)}finally{Y=n}})};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=Y;Y=void 0;try{return this.value}finally{Y=e}};Object.defineProperty(ve.prototype,"value",{get:function(){var e=_u(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(jo>100)throw new Error("Cycle detected");this.v=e,this.i++,Vn++,ut++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Wn()}}}});function X(e){return new ve(e)}function gu(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 yu(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function wu(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function jt(e){ve.call(this,void 0),this.x=e,this.s=void 0,this.g=Vn-1,this.f=4}(jt.prototype=new ve).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Vn))return!0;if(this.g=Vn,this.f|=1,this.i>0&&!gu(this))return this.f&=-2,!0;var e=Y;try{yu(this),Y=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Y=e,wu(this),this.f&=-2,!0};jt.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)};jt.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)}};jt.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(jt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=_u(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function pr(e){return new jt(e)}function bu(e){var t=e.u;if(e.u=void 0,typeof t=="function"){ut++;var r=Y;Y=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Zo(e),n}finally{Y=r,Wn()}}}function Zo(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,bu(e)}function wm(e){if(Y!==this)throw new Error("Out-of-order effect");wu(this),Y=e,this.f&=-2,8&this.f&&Zo(this),Wn()}function br(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}br.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()}};br.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,bu(this),yu(this),ut++;var e=Y;return Y=this,wm.bind(this,e)};br.prototype.N=function(){2&this.f||(this.f|=2,this.o=mr,mr=this)};br.prototype.d=function(){this.f|=8,1&this.f||Zo(this)};function Er(e){var t=new br(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var Eu,Ro,Au=[];Er(function(){Eu=this.N})();function Jt(e,t){B[e]=t.bind(null,B[e]||function(){})}function Hn(e){Ro&&Ro(),Ro=e&&e.S()}function Iu(e){var t=this,r=e.data,n=Su(r);n.value=r;var i=vu(function(){for(var s=t,u=t.__v;u=u.__;)if(u.__c){u.__c.__$f|=4;break}var d=pr(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),y=pr(function(){return!Array.isArray(d.value)&&!lo(d.value)}),h=Er(function(){if(this.N=Ru,y.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),p=t.__$u.d;return t.__$u.d=function(){h(),p.call(this)},[y,d]},[]),o=i[0],a=i[1];return o.value?a.peek():a.value}Iu.displayName="_st";Object.defineProperties(ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Iu},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Jt("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof ve&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});Jt("__r",function(e,t){Hn();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return Er(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),Hn(r),e(t)});Jt("__e",function(e,t,r,n){Hn(),e(t,r,n)});Jt("diffed",function(e,t){Hn();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var s=o[a];s!==void 0&&!(a in n)&&(s.d(),o[a]=void 0)}else o={},r.U=o;for(var u in n){var d=o[u],y=n[u];d===void 0?(d=bm(r,u,y,i),o[u]=d):d.o(y,i)}}}e(t)});function bm(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=X(r);return{o:function(a,s){o.value=a,n=s},d:Er(function(){this.N=Ru;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}Jt("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var a=t.__c;if(a){var s=a.__$u;s&&(a.__$u=void 0,s.d())}}e(t)});Jt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});xe.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u,n=r&&r.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var o=2&this.__$f;if(!(n||o||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var a in e)if(a!=="__source"&&e[a]!==this.props[a])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function Su(e){return vu(function(){return X(e)},[])}var Em=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Am(){Re(function(){for(var e;e=Au.shift();)Eu.call(e)})}function Ru(){Au.push(this)===1&&(B.requestAnimationFrame||Em)(Am)}var be=Ft`
|
|
4
4
|
inset: 0;
|
package/dist/index.native.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var r1=Object.create;var xo=Object.defineProperty,n1=Object.defineProperties,i1=Object.getOwnPropertyDescriptor,o1=Object.getOwnPropertyDescriptors,a1=Object.getOwnPropertyNames,Eo=Object.getOwnPropertySymbols,s1=Object.getPrototypeOf,yl=Object.prototype.hasOwnProperty,gp=Object.prototype.propertyIsEnumerable;var vp=(e,t,r)=>t in e?xo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T=(e,t)=>{for(var r in t||(t={}))yl.call(t,r)&&vp(e,r,t[r]);if(Eo)for(var r of Eo(t))gp.call(t,r)&&vp(e,r,t[r]);return e},B=(e,t)=>n1(e,o1(t));var je=(e,t)=>{var r={};for(var n in e)yl.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Eo)for(var n of Eo(e))t.indexOf(n)<0&&gp.call(e,n)&&(r[n]=e[n]);return r};var k=(e,t)=>()=>(e&&(t=e(e=0)),t);var h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),yp=(e,t)=>{for(var r in t)xo(e,r,{get:t[r],enumerable:!0})},l1=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of a1(t))!yl.call(e,i)&&i!==r&&xo(e,i,{get:()=>t[i],enumerable:!(n=i1(t,i))||n.enumerable});return e};var ie=(e,t,r)=>(r=e!=null?r1(s1(e)):{},l1(t||!e||!e.__esModule?xo(r,"default",{value:e,enumerable:!0}):r,e));var w=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});function h1(e){return!!(e!=null&&e.__nativeBuffers__)}function xl(e){if(typeof e=="string")try{e=JSON.parse(e)}catch(r){return{}}if(typeof e!="object"||e===null)return{};if(!h1(e))return e;let t=e.__nativeBuffers__;if(delete e.__nativeBuffers__,t)for(let r=0;r<t.length;r++){let n=t[r];if(n){let i;n.value?i=n.value:n.base64&&(i=m1(n.base64)),typeof i!="undefined"&&i instanceof ArrayBuffer&&(e[n.key]=i)}}return e}function g1(e={},t=!1){let r=e,n=[];for(let[i,o]of Object.entries(r))if(o!==void 0&&o instanceof ArrayBuffer&&o.byteLength!==void 0){let a=t?{value:o,key:i}:{base64:v1(o),key:i};n.push(a),delete r[i]}return n.length>0&&(r.__nativeBuffers__=n),r}function w1(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Op(e){return typeof e=="string"}function Wr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function bp(e){return typeof e=="number"&&!isNaN(e)}function S1(e){return typeof e=="undefined"}function E1(e){return S1(e)||e===null}function Rp(e){return typeof e=="function"}function x1(e){return Wr(e)&&Rp(e.then)}function Np(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function $n(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function R1(e,t,r){let n=e;for(let i of t)if(n&&typeof n=="object")n=n[i];else return r;return n===void 0?r:n}function F1(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function J1(e){return new Promise(t=>Dp(e)(t))}function Dp(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function H1(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new zn(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function V1(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)G1(e[n],t[n])}function G1(e,t){if(Op(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Rp(t)){try{if(e instanceof t)return}catch(r){}if(!E1(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 Dl(e,t){if(Al.config[e]){Oo.warn(`[can i use] ${e} already registered`);return}Al.config[e]=$t({},t)}function Sp(e,t){return`[${e}]:${t}`}function Z1(e,t){Ep||(wl=new Ao({eventName:"jolibox_invoke",tagNameOrder:["status","method","errNo","errMsg","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),Il=new Ao({eventName:"jolibox_invoke_js2native",tagNameOrder:["status","method","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),Sl=new Ao({eventName:"jolibox_invoke_native2js",tagNameOrder:["status","method","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),t("onJoliboxEnterBackground",()=>{wl.flush(),Il.flush(),Sl.flush()}),Ep=!0);function r(i){var o,a;let{method:s,args:l,startTime:c,isForeground:d,errMsg:u=`${s}:fail no errMsg`,errNo:f=0,__timing:p={receiveJSInvoke:0,invokeCallback:0}}=i,{receiveJSInvoke:m,invokeCallback:g}=p,_=(a=(o=u.match(/\S:(\S+)\s?/))==null?void 0:o[1])!=null?a:"fail";wl.report({status:_,method:n(s,l),errNo:`${f}`,errMsg:u,isForeground:d,duration:Date.now()-c}),c&&m&&g&&(Il.report({status:_,method:s,isForeground:d,duration:Number((m-c).toFixed(3))}),Sl.report({status:_,method:s,isForeground:d,duration:Number((Date.now()-g).toFixed(3))}))}function n(i,o){return(i==="callHostMethod"||i==="callHostMethodSync")&&o!=null&&o.method?`${i}-${o.method}`:i}return r}function nT(e,t){let r=0,n=!0,i=rT.resolveMap,o=Z1(e,t);t("onJoliboxEnterBackground",()=>{n=!1}),t("onJoliboxEnterForeground",()=>{n=!0,El.forEach(l=>Co(this,[l],function*({method:c,args:d,resolve:u}){let f=yield s(c,d);u(f)})),El.length=0});let a=(l,c)=>{let d=i.get(Number(l));if(!d)return;let u=xl(c);d(u),i.delete(Number(l))},s=(l,c)=>{var d,u;let f=Date.now(),p=`${n}`;r+=1;let m=new I1;if(i.set(r,m.resolve),!n&&K1.includes(l))return new Promise(A=>{El.push({method:l,args:c,resolve:A})});let g=f1($t({},{method:l,startTime:f,args:c,isForeground:p}),{invokeType:"js-bridge"}),_=!eT&&W1.includes(l),v=g1(c,_),b=_?v:JSON.stringify(v),I;if(l.endsWith("Sync")||Q1.includes(l)?I=(d=e.call)==null?void 0:d.call(e,l,v,r):typeof b=="string"?I=e.invoke(l,b,r):I=(u=e.call)==null?void 0:u.call(e,l,b,r),I){try{typeof I=="string"&&(I=JSON.parse(I)),I=xl(I)}catch(A){Oo.error(A)}return i.delete(r),I.errorCode&&(I.errorCode=Sp(l,I.errorCode)),o($t($t({},g),I)),I}return l.endsWith("Sync")&&i.delete(r),m.promise.then(A=>(A.errorCode&&(A.errorCode=Sp(l,A.errorCode)),o($t($t({},g),A)),A))};return{invokeNative:s,applyNative:(l,c)=>{let d=s(l,c);return x1(d)?d.then(u=>xp(l,u)):xp(l,d)},invokeHandler:a}}function xp(e,t){if(!Wr(t)){Oo.warn(`[Jolibox SDK]${e} no response value`);return}let r=t,{errMsg:n,errNo:i,errorType:o,errorCode:a}=r,s=p1(r,["errMsg","errNo","errorType","errorCode"]);if(n&&n!==`${e}:ok`)throw new C1(n,i,o,a);return s}function iT(e){if(globalThis[ko])return globalThis[ko];let t=new Pl,r=new Pl,n=new Ao({eventName:"jolibox_publish",tagNameOrder:["type","event"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}});return t.on("onJoliboxEnterBackground",()=>{n.flush()}),globalThis[ko]={onNative:t.on.bind(t),offNative:t.off.bind(t),subscribe:r.on.bind(r),unsubscribe:r.off.bind(r),subscribeHandler(i,o,a){let s=xl(o),l;if(s.__extra){l=s.params;let{type:c,startTime:d}=s.__extra;n.report({type:c,event:i,duration:Date.now()-d})}else l=s;if(i===qp){l.forEach(c=>{let[d,u]=c;try{r.emit(d.slice(Gn.length),u,a)}catch(f){}});return}if(i.startsWith(Gn)){r.emit(i.slice(Gn.length),l,a);return}t.emit(i,l,a)}},globalThis[ko]}function oT(e){let t=new Map,r=new Map,n,i;return{publish:(o,a,s,l)=>{if(l){let d=s!==void 0?s==="*"?"*":[s]:void 0;e.publish(`${Gn}${o}`,a,d);return}n||(n=Promise.resolve().then(()=>{t.forEach((d,u)=>{try{let f=u!==void 0?u==="*"?"*":[u]:void 0;e.publish(qp,d,f)}catch(f){}}),n=void 0,t.clear()}));let c=t.get(s);c||(c=[],t.set(s,c)),c.push([`${Gn}${o}`,a])},emitNative:(o,a,s,l)=>{if(l){let d=s!==void 0?s==="*"?"*":[s]:void 0;e.publish(o,a,d),console.log("emitNative",o,a,d);return}i||(i=Promise.resolve().then(()=>{r.forEach((d,u)=>{try{let f=u!==void 0?u==="*"?"*":[u]:void 0;e.publish(Y1,d,f)}catch(f){}}),i=void 0,r.clear()}));let c=r.get(s);c||(c=[],r.set(s,c)),c.push([o,a])}}}function aT(e){let{subscribeHandler:t,onNative:r,offNative:n,subscribe:i,unsubscribe:o}=iT(e),{invokeNative:a,invokeHandler:s,applyNative:l}=nT(e,r),{publish:c,emitNative:d}=oT(e);return{invokeHandler:s,subscribeHandler:t,applyNative:l,invokeNative:a,onNative:r,offNative:n,emitNative:d,publish:c,subscribe:i,unsubscribe:o}}function Fp(e,t){return{params:e,__extra:{startTime:Date.now(),type:t}}}var c1,u1,d1,To,Ap,Tp,_p,$t,f1,p1,Co,m1,v1,Cp,y1,_1,Pp,b1,I1,k1,A1,Po,T1,C1,P1,_l,Oo,wp,O1,kl,N1,Al,D1,L1,q1,zr,M1,c$,Tl,se,U1,j1,Vn,zn,Pl,Ol,B1,bl,$1,u$,Rl,Ip,d$,Lp,z1,Gn,W1,K1,Q1,qp,Y1,X1,Ao,Ep,wl,Il,Sl,El,eT,Nl,tT,rT,ko,Ll,ht,Mp,Up,sT,jp,kp,ye,j,Ze,f$,lT,Bp,ql,p$,h$,_e=k(()=>{"use strict";c1=Object.defineProperty,u1=Object.defineProperties,d1=Object.getOwnPropertyDescriptors,To=Object.getOwnPropertySymbols,Ap=Object.prototype.hasOwnProperty,Tp=Object.prototype.propertyIsEnumerable,_p=(e,t,r)=>t in e?c1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$t=(e,t)=>{for(var r in t||(t={}))Ap.call(t,r)&&_p(e,r,t[r]);if(To)for(var r of To(t))Tp.call(t,r)&&_p(e,r,t[r]);return e},f1=(e,t)=>u1(e,d1(t)),p1=(e,t)=>{var r={};for(var n in e)Ap.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&To)for(var n of To(e))t.indexOf(n)<0&&Tp.call(e,n)&&(r[n]=e[n]);return r},Co=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});m1=e=>{let t=atob(e),r=t.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=t.charCodeAt(i);return n.buffer};v1=e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let i=0;i<n;i++)t+=String.fromCharCode(r[i]);return btoa(t)};Cp=Object.defineProperty,y1=Object.getOwnPropertyDescriptor,_1=(e,t)=>{for(var r in t)Cp(e,r,{get:t[r],enumerable:!0})},Pp=(e,t,r,n)=>{for(var i=n>1?void 0:n?y1(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&Cp(t,r,i),i},b1=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}I1=class{constructor(){this.state="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.state==="pending"&&(this.state="fulfilled",e(r))},this.reject=r=>{this.state==="pending"&&(this.state="rejected",t(r))}})}};k1=(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))(k1||{}),A1=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}},Po=class extends A1{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},T1=class extends Po{constructor(){super(...arguments),this.name="INTERNAL_INVOKE_NATIVE_ERROR"}},C1=class extends Po{constructor(e,t,r,n){super(e),this.errNo=t,this.name="INTERNAL_APPLY_NATIVE_ERROR",this.errorType=r,this.errorCode=n}},P1=class extends Po{constructor(){super(...arguments),this.name="INTERNAL_JSCORE_ERROR",this.priority="P0"}},_l=class extends Po{constructor(){super(...arguments),this.name="INTERNAL_METRIC_REPORT_ERROR"}};Oo={log:$n("log"),warn:$n("warn"),info:$n("info"),error:$n("error"),debug:$n("debug")};Object.assign(globalThis,{logger:Oo});wp=Symbol.for("Jolibox.canIUseMap"),O1={};globalThis[wp]||(globalThis[wp]=O1);kl=Symbol.for("Jolibox.canIUseMap.native"),N1={};globalThis[kl]||(globalThis[kl]=N1);Al={get config(){return globalThis[kl]}},D1=(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))(D1||{}),L1=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(L1||{}),q1=(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))(q1||{});F1();zr=typeof window=="undefined",M1=()=>!zr&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),c$={isiOS:!zr&&(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:!zr&&navigator.userAgent.includes("Android"),isMac:!zr&&navigator.userAgent.includes("Mac"),isFacebook:!zr&&navigator.userAgent.includes("FB_IAB"),isPC:!zr&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},Tl=class Cl{constructor(t){this.element=t,this.next=Cl.Undefined,this.prev=Cl.Undefined}};Tl.Undefined=new Tl(void 0);se=Tl,U1=class{constructor(){this._first=se.Undefined,this._last=se.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===se.Undefined}clear(){let e=this._first;for(;e!==se.Undefined;){let t=e.next;e.prev=se.Undefined,e.next=se.Undefined,e=t}this._first=se.Undefined,this._last=se.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new se(e);if(this._first===se.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==se.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==se.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==se.Undefined&&e.next!==se.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===se.Undefined&&e.next===se.Undefined?(this._first=se.Undefined,this._last=se.Undefined):e.next===se.Undefined?(this._last=this._last.prev,this._last.next=se.Undefined):e.prev===se.Undefined&&(this._first=this._first.next,this._first.prev=se.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==se.Undefined;)yield e.element,e=e.next}},j1=0,Vn=class{constructor(e){this.value=e,this.id=j1++}},zn=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof Vn&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let c=new Vn(t);return this._listeners?this._listeners instanceof Vn?this._listeners=[this._listeners,c]:this._listeners.push(c):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=c,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var d,u,f,p;if(!this._disposed){if(this._listeners instanceof Vn)this._listeners.id===c.id&&(this._listeners=void 0,this._size=0,(u=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||u.call(d));else if(this._listeners){let m=this._listeners.indexOf(c);m>=0&&(this._listeners.splice(m,1),this._size--,this._size===0&&((p=(f=this.options)==null?void 0:f.onDidRemoveLastListener)==null||p.call(f)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Vn?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Pl=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new zn,o=l=>t(...l.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new U1,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},Ol={};_1(Ol,{None:()=>B1,filter:()=>H1,once:()=>Dp,toPromise:()=>J1});B1=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});bl=Symbol.for("Jolibox.hostEmitter"),$1=()=>{let e=new Pl;return globalThis[bl]||(globalThis[bl]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[bl]},u$=$1();Rl=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new zn,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(...i){return V1(i,r),n(...i)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};Rl=Pp([Np],Rl);Ip=class{constructor(){this._onWillExecuteCommand=new zn,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new zn,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Rl,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=w1(3e4)),this._starActivation}executeCommand(e,...t){return b1(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),Ol.toPromise(Ol.filter(this.registry.onDidRegisterCommand,r=>r===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let r=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),n}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e,...t){let r=!1;try{return e(...t)}finally{r=!0}}};Ip=Pp([Np],Ip);d$=Symbol.for("Jolibox.commands");Dl("requestPaymentSync",{version:1e6,properties:{paymentBody:{appStoreProductId:102e4}}});Dl("requestProductDetailsAsync",{version:102e4});Dl("loginSync",{version:1e6,properties:{skipLogin:102e4,triggerFrom:102e4}});Lp=(e,t)=>{function r(i){var o;let[a,...s]=i.split(":");if(!a)return!1;let l=Al.config[a];if(!l)return!1;let c=(o=t==null?void 0:t())!=null?o:"";if(l.platforms&&!l.platforms.includes(c))return!1;let d=l.version;if(typeof d!="number")return!1;let u=e();return typeof u!="number"||u<d?!1:s.length===0?!0:n(l,s,u)||n(l.properties,s,u)}function n(i,o,a){if(!i)return!1;let s=R1(i,o);if(!s)return!1;if(Wr(s)){let l=s.version;return bp(l)?typeof a=="number"&&a>=l:!0}return bp(s)?typeof a=="number"&&a>=s:s===!0}return{canIUseNative:r}};z1=()=>M1(),Gn="custom_event_",W1=[],K1=[],Q1=["env","createRequestTask","login"],qp="__batch_event__",Y1="__native_batch_event__",X1=e=>e==="pv"?e:"default",Ao=class{constructor(e){this.interval=30,this.lastReportTime=0,this.cache={};let{reporter:t,interval:r=30,eventName:n,tagNameOrder:i,metricName:o,type:a}=e;this.reporter=t,this.interval=r,this.eventName=n,this.tagNameOrder=i,this.metricName=o,this.type=X1(a)}report(e){this.type==="pv"?this.addPVPoint(e):this.addPoint(e),this.tryReport(!1)}flush(){this.tryReport(!0)}tryReport(e){if(Object.keys(this.cache).length){if(e){this.reporter(this.processPoints(this.cache)),this.clearPoints();return}this.lastReportTime=this.lastReportTime||Date.now(),Date.now()-this.lastReportTime>=this.interval*1e3&&(this.reporter(this.processPoints(this.cache)),this.clearPoints(),this.lastReportTime=Date.now())}}addPoint(e){let t=(r,n,i,o)=>{let a=n.shift();if(a){let s=o[a];r[s]||(r[s]={}),t(r[s],n,i,o)}else r[i]||(r[i]=[]),r[i].push(o[i])};t(this.cache,[...this.tagNameOrder],this.metricName,e)}addPVPoint(e){let t=(n,i,o,a)=>{let s=i.shift();if(!s&&Wr(a))throw new _l(`report value failed to match tagNameOrder, ${JSON.stringify(r)}`);if(s){let l=[];if(Wr(a))l.push(...Object.keys(a));else if(Op(a)){if(i.length>0)throw new _l(`report value failed to match tagNameOrder, ${JSON.stringify(r)}`);l.push(a)}else throw new _l(`expected metric value to be a string, but got a(n) ${typeof a}, ${JSON.stringify(r)}`);l.forEach(c=>{n[c]||(n[c]={});let d=Wr(a)?a[c]:a;t(n[c],[...i],o,d)})}else n[o]?n[o]++:n[o]=1},r={point:e,metricName:this.metricName,tagNameOrder:this.tagNameOrder};t(this.cache,[...this.tagNameOrder],this.metricName,e)}processPoints(e){return{eventName:this.eventName,tagNameOrder:this.tagNameOrder,metricName:this.metricName,metricAggregateType:this.type==="pv"?"itoa":"arr",data:e}}clearPoints(){this.cache={}}},Ep=!1;El=[],eT=!1,Nl=Symbol.for("Jolibox.invokeResolverInstance"),tT=new Map;globalThis[Nl]||(globalThis[Nl]=tT);rT={get resolveMap(){return globalThis[Nl]}};ko=Symbol.for("Jolibox.subscribeInstance");ht={trigger(){},exit(){return Promise.resolve(!1)},backPress(){return Promise.resolve(!1)},onReady(e){ht.trigger=e},onDoExit(e){ht.exit=e},onDoBackPress(e){ht.backPress=e}},Mp=e=>{let t=window.prompt("invoke",JSON.stringify({event:"envSync",paramsString:JSON.stringify({})}));if(!t)e.onError(new T1("native env failed"));else{let{data:r}=JSON.parse(t);return r!=null?r:void 0}};if(typeof window!="undefined"&&window.webkit){let e=window.webkit.messageHandlers,t=(i="")=>{ht.trigger(),e.onDocumentReady.postMessage({path:i})},r=i=>Co(void 0,null,function*(){let o=yield ht.exit();e.doExit.postMessage({uuid:i,shouldInterrupt:o})});Ll={onDocumentReady:t,doExit:r,invoke(i,o,a){e.invoke.postMessage({event:i,paramsString:o,callbackId:a})},publish(i,o,a){let s=Fp(o,"joliboxJSCore");window.prompt("publish",JSON.stringify({event:i,paramsString:JSON.stringify(s),webviewIds:a}))},call(i,o,a){let s=window.prompt("invoke",JSON.stringify({event:i,paramsString:JSON.stringify(o),callbackId:a}));if(s)return JSON.parse(s)}};let n={onDocumentReady:t,env:Mp,doExit:r};globalThis.joliboxJSCore=$t({},n)}if(typeof window!="undefined"&&window.JoliAndroidSDKBridge){let e,t=window.JoliAndroidSDKBridge,r=(o="")=>{ht.trigger(),t.onDocumentReady(JSON.stringify({path:o}))},n=o=>Co(void 0,null,function*(){let a=yield ht.exit();t.doExit(JSON.stringify({uuid:o,shouldInterrupt:a}))});Ll={onDocumentReady:r,invoke(o,a,s){t.invoke(JSON.stringify({event:o,paramsString:a,callbackId:s}))},doExit:n,publish(o,a,s){let l=Fp(a,"joliboxJSCore");t.publish(JSON.stringify({event:o,paramsString:JSON.stringify(l),webviewIds:s}))},call(o,a,s){let l=window.prompt("invoke",JSON.stringify({event:o,paramsString:JSON.stringify(a),callbackId:s}));if(l)return JSON.parse(l)},doBackPress(o){return Co(this,null,function*(){let a=yield ht.backPress();t.doBackPress(JSON.stringify({uuid:o,shouldInterrupt:a}))})}};let i={onDocumentReady:r,env:Mp,doExit:n};globalThis.joliboxJSCore=$t({},i)}Up=Ll;if(!Up&&z1())throw new P1("No joliboxJScore is found, native bridge not found.");sT=$t({},Up),jp=aT(sT),{invokeHandler:kp}=jp,{applyNative:ye,invokeNative:j,onNative:Ze,offNative:f$,subscribeHandler:lT,publish:Bp,emitNative:ql,subscribe:p$,unsubscribe:h$}=jp;globalThis.joliboxJSBridge={callHandler:kp,invokeHandler:kp,subscribeHandler:lT}});function mT(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function zp(e){return new Promise(t=>setTimeout(t,e))}function Xn(e){return typeof e=="string"}function Tr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Wp(e){return typeof e=="object"&&Array.isArray(e)}function Kp(e){return typeof e=="number"&&!isNaN(e)}function Kr(e){return e===!0||e===!1}function Qp(e){return typeof e=="undefined"}function $l(e){return Qp(e)||e===null}function vT(e){return typeof e=="function"}function Yp(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Xp(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,o){for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=i[a],l=o[a],c=r(s,l,a,i,o);c!==void 0?i[a]=c:$p(l)&&$p(s)?i[a]=n(fT({},s),l):Array.isArray(l)&&Array.isArray(s)?i[a]=[...s,...l]:i[a]=l}return i}return n(e,t)}function $p(e){return e&&typeof e=="object"&&e.constructor===Object}function Zp(e,t){if(Array.isArray(e))return e.concat(t)}function Zn(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:l=!0}=r,c=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),d=function(...u){i=u,o=this;let f=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,l&&!f&&c()},t),f)return c()};return d.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},d.flush=()=>{if(n)return clearTimeout(n),n=null,c()},d}function yT(e,t){return(...r)=>t(e,...r)}function No(e){return t=>yT(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new lr(`${i}`))}})}function Wn(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function ah(e,t,r){let n=0;if(e!==t){let i=e.split("."),o=t.split("."),a=Math.max(i.length,o.length);for(let s=0;s<a;s++){let l=parseInt(i[s],10)||0,c=parseInt(o[s],10)||0;if(l>c){n=1;break}else if(l<c){n=-1;break}}}if(!r)return n;switch(r){case">":return n>0;case"<":return n<0;case"=":return n===0;case">=":return n>=0;case"<=":return n<=0;default:return!1}}function Ql(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function ET(e,t,r){let n=window.location.hostname,i=n.split("."),o=r?t:e;if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n))return`${o}.jolibox.com`;if(i.length>=2){let a=i.slice(-2).join(".");return`${o}.${a}`}return`${o}.jolibox.com`}function Yl(e){return ET("api","stg-api",e)}function Cr(e){return`https://${Yl(e)}`}function TT(e){return new Promise(t=>uh(e)(t))}function uh(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function CT(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Yn(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function OT(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)RT(e[n],t[n])}function RT(e,t){if(Xn(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(vT(t)){try{if(e instanceof t)return}catch(r){}if(!$l(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 NT(){return typeof globalThis!="undefined"?globalThis[dh]:void 0}function DT(e){typeof globalThis!="undefined"&&(globalThis[dh]=e)}function X(e=!1){let t=NT();if(!e&&t)return t;let r=new Ro,n=new Jl,i={registerCommand(o,a,s){r.registerCommand({id:o,handler:a,metadata:s})},executeCommand(o,...a){return n.executeCommand(o,...a)},excuteCommandSync(o,...a){return n.executeCommandThowErr(o,...a)}};return DT(i),i}var Hl,cT,Jp,uT,dT,Hp,fT,pT,Gp,hT,Ct,gT,Vl,ei,Gl,eh,lr,th,rh,nh,ih,oh,ti,zl,Pt,Ml,_T,Wl,Vp,bT,J,Kl,wT,Do,Kn,ri,IT,ST,sh,lh,ch,Ul,le,xT,kT,Qn,Yn,Ot,Bl,AT,Fl,PT,ne,Ro,Jl,dh,N=k(()=>{"use strict";Hl=Object.defineProperty,cT=Object.getOwnPropertyDescriptor,Jp=Object.getOwnPropertySymbols,uT=Object.prototype.hasOwnProperty,dT=Object.prototype.propertyIsEnumerable,Hp=(e,t,r)=>t in e?Hl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fT=(e,t)=>{for(var r in t||(t={}))uT.call(t,r)&&Hp(e,r,t[r]);if(Jp)for(var r of Jp(t))dT.call(t,r)&&Hp(e,r,t[r]);return e},pT=(e,t)=>{for(var r in t)Hl(e,r,{get:t[r],enumerable:!0})},Gp=(e,t,r,n)=>{for(var i=n>1?void 0:n?cT(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&Hl(t,r,i),i},hT=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}Ct=class{constructor(){this.state="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.state==="pending"&&(this.state="fulfilled",e(r))},this.reject=r=>{this.state==="pending"&&(this.state="rejected",t(r))}})}};gT=(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))(gT||{}),Vl=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}},ei=class extends Vl{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Gl=class extends Vl{constructor(){super(...arguments),this.kind="USER_ERROR"}},eh=class extends Gl{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},lr=class extends Gl{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="USER_CUSTOM_ERROR",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},th=class extends Gl{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="USER_PAYMENT_ERROR",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},rh=class extends ei{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},nh=class extends ei{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="INTERNAL_PAYMENT_ERROR",this.priority="P0",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},ih=class extends ei{constructor(){super(...arguments),this.name="INTERNAL_INVOKE_METHOD_ERROR"}},oh=class extends ei{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},ti=class extends Vl{constructor(e,t,r,n,i){super(e),this.message=e,this.code=t,this.kind="API_ERROR",this.name="API_ERROR",r&&(this.errorType=r),n!==void 0&&(this.stack=n),i&&(this.priority=i)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},zl=class extends ei{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Pt={log:Wn("log"),warn:Wn("warn"),info:Wn("info"),error:Wn("error"),debug:Wn("debug")};Object.assign(globalThis,{logger:Pt});Ml=Symbol.for("Jolibox.canIUseMap"),_T={};globalThis[Ml]||(globalThis[Ml]=_T);Wl={get config(){return globalThis[Ml]}},Vp=Symbol.for("Jolibox.canIUseMap.native"),bT={};globalThis[Vp]||(globalThis[Vp]=bT);J=(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))(J||{}),Kl=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Kl||{}),wT=(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))(wT||{}),Do=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});Ql();Kn=typeof window=="undefined",ri={isiOS:!Kn&&(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:!Kn&&navigator.userAgent.includes("Android"),isMac:!Kn&&navigator.userAgent.includes("Mac"),isFacebook:!Kn&&navigator.userAgent.includes("FB_IAB"),isPC:!Kn&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},IT="device_id",ST="advertising_id",sh=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,Do()),window.__joliboxLocalStorage__.getItem(e)),lh=()=>new URLSearchParams(window.location.search).get("deviceId")||sh(IT),ch=()=>new URLSearchParams(window.location.search).get("advertisingId")||sh(ST);Ul=class jl{constructor(t){this.element=t,this.next=jl.Undefined,this.prev=jl.Undefined}};Ul.Undefined=new Ul(void 0);le=Ul,xT=class{constructor(){this._first=le.Undefined,this._last=le.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===le.Undefined}clear(){let e=this._first;for(;e!==le.Undefined;){let t=e.next;e.prev=le.Undefined,e.next=le.Undefined,e=t}this._first=le.Undefined,this._last=le.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new le(e);if(this._first===le.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==le.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==le.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==le.Undefined&&e.next!==le.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===le.Undefined&&e.next===le.Undefined?(this._first=le.Undefined,this._last=le.Undefined):e.next===le.Undefined?(this._last=this._last.prev,this._last.next=le.Undefined):e.prev===le.Undefined&&(this._first=this._first.next,this._first.prev=le.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==le.Undefined;)yield e.element,e=e.next}},kT=0,Qn=class{constructor(e){this.value=e,this.id=kT++}},Yn=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof Qn&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let c=new Qn(t);return this._listeners?this._listeners instanceof Qn?this._listeners=[this._listeners,c]:this._listeners.push(c):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=c,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var d,u,f,p;if(!this._disposed){if(this._listeners instanceof Qn)this._listeners.id===c.id&&(this._listeners=void 0,this._size=0,(u=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||u.call(d));else if(this._listeners){let m=this._listeners.indexOf(c);m>=0&&(this._listeners.splice(m,1),this._size--,this._size===0&&((p=(f=this.options)==null?void 0:f.onDidRemoveLastListener)==null||p.call(f)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Qn?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Ot=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Yn,o=l=>t(...l.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new xT,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},Bl={};pT(Bl,{None:()=>AT,filter:()=>CT,once:()=>uh,toPromise:()=>TT});AT=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Fl=Symbol.for("Jolibox.hostEmitter"),PT=()=>{let e=new Ot;return globalThis[Fl]||(globalThis[Fl]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Fl]},ne=PT();Ro=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Yn,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(...i){return OT(i,r),n(...i)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};Ro=Gp([Yp],Ro);Jl=class{constructor(){this._onWillExecuteCommand=new Yn,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Yn,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Ro,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=mT(3e4)),this._starActivation}executeCommand(e,...t){return hT(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),Bl.toPromise(Bl.filter(this.registry.onDidRegisterCommand,r=>r===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let r=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),n}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e,...t){let r=!1;try{return e(...t)}finally{r=!0}}};Jl=Gp([Yp],Jl);dh=Symbol.for("Jolibox.commands")});function ke(e,t={}){Xl.emit("ERROR_REPORT",{error:e,options:t})}var Xl,Pr,mt=k(()=>{"use strict";N();N();Xl=new Ot,Pr=new Ot;ke.debounce=Zn(ke,50,{leading:!0})});var Zl,LT,fh,ph,hh=k(()=>{"use strict";N();mt();Zl=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4===0?"":"=".repeat(4-t.length%4),n=atob(t+r);try{return JSON.parse(n)}catch(i){return{}}},LT=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},fh=e=>{var t;try{let i=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(i!=null&&i.length){let[o,a,s]=i;return{headerJson:Zl(o),payloadJson:Zl(a),signature:Zl(s)}}else throw"joli_source is missing"}catch(r){return ke(new rh(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},ph=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=LT(e),o=r[2];return`${n}.${i}.${o}`}return t}});var qT,ec,mh=k(()=>{"use strict";N();qT="1.1.54",ec=()=>qT});function rc(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var FT,vh,tc,gh,de,MT,S,H=k(()=>{"use strict";N();hh();mh();N();FT={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:lh(),adId:ch(),pixelRatio:window.devicePixelRatio||1,platform:ri.isAndroid?"android":ri.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:ec()},schema:window.location.href,platform:ri.isAndroid?"android":ri.isiOS?"ios":"h5"},tc=(vh=globalThis.joliboxJSCore)==null?void 0:vh.env,de=Object.assign({},(gh=tc==null?void 0:tc())!=null?gh:FT);MT=()=>{var p,m,g,_,v,b,I,A,P,O,x;let{payloadJson:e,headerJson:t,signature:r}=de.schema.length?fh(de.schema):{},n=`${de.deviceInfo.did}-${new Date().getTime()}`,o=new URL(de.schema.length?de.schema:window.location.href).searchParams,a=(g=(m=(p=o.get("mpId"))!=null?p:o.get("appId"))!=null?m:o.get("gameId"))!=null?g:"",s=(b=(v=(_=de.clientSessionId)!=null?_:e==null?void 0:e.sessionId)!=null?v:o.get("sessionId"))!=null?b:n,l=!!((A=(I=e==null?void 0:e.testAdsMode)!=null?I:e==null?void 0:e.__testAdsMode)!=null?A:o.get("testAdsMode")==="true"),c=(x=(O=(P=e==null?void 0:e.joliboxEnv)!=null?P:e==null?void 0:e.__joliboxEnv)!=null?O:o.get("joliboxEnv"))!=null?x:"production",d=c==="staging",u=t==null?void 0:t.channel,f=e==null?void 0:e.__shouldInterupt;return{get startTime(){var C;return(C=performance.timeOrigin)!=null?C:performance.timing.navigationStart},get testMode(){return d},get testAdsMode(){return l},get joliboxEnv(){return c},get joliSource(){var C;return(C=o.get("joliSource"))!=null?C:null},get mpId(){var C;return(C=a!=null?a:e==null?void 0:e.id)!=null?C:""},get mpVersion(){var C;return(C=t==null?void 0:t.ver)!=null?C:ec()},get mpType(){var C,U;return(U=(C=t==null?void 0:t.__mpType)!=null?C:e==null?void 0:e.__mpType)!=null?U:"game"},get platform(){var C;return((C=de.platform)!=null?C:de.deviceInfo.platform).toLowerCase()},get deviceInfo(){return de.deviceInfo},get sdkInfo(){return de.sdkInfo},get hostInfo(){return de.hostInfo},get hostUserInfo(){return de.hostUserInfo},get sessionId(){var C,U;return(U=(C=de.clientSessionId)!=null?C:s)!=null?U:n},get channel(){return u},get webviewId(){var C;return(C=de.webviewId)!=null?C:-1},get shouldInterupt(){return f},get from(){return e==null?void 0:e.__from},get baseApiHost(){return Yl(d)},get adId(){var C;return(C=de.deviceInfo.adId)!=null?C:de.deviceInfo.did},get language(){return de.deviceInfo.lang},get sdkEnvironment(){return rc("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":rc("gamedistribution","jolibox")?"gamedistribution":rc("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var q,Re,Ne;let C=(q=de.deviceInfo.pixelRatio)!=null?q:1,U=(Re=de.deviceInfo.statusBarHeight)!=null?Re:e==null?void 0:e.__androidStatusBarHeight,We=(Ne=de.deviceInfo.navigationBarHeight)!=null?Ne:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:U!==void 0?U/C:20,navigationBarHeight:We!==void 0?We/C:10}},get abTests(){var C,U;return(U=(C=de.abValues)==null?void 0:C.split(","))!=null?U:[]},onEnvConfigChanged:C=>{Xp(de,C,Zp)},encodeJoliSourceQuery:C=>{var U,We;return t&&r?ph(T(T({},e),C),(U=o.get("joliSource"))!=null?U:""):(We=o.get("joliSource"))!=null?We:""},setDoExitDirectly:()=>{f=!1}}},S=MT()});var nc,_h,UT,jT,yh,BT,bh=k(()=>{"use strict";N();mt();H();N();nc=!1,_h=(e,t)=>e==null?!1:t in e,UT=e=>_h(e,"kind"),jT=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},yh=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=S.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=S.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:jT(e.name)},i=B(T({},n),{env:t.environment,isFromUser:r});r?Pr.emit("GLOBAL_USER_ERROR",e,i):Pr.emit("GLOBAL_ERROR",e,i)},BT=e=>_h(e,"kind")&&e.kind==="USER_ERROR";Xl.on("ERROR_REPORT",({error:e,options:t})=>{if(nc)return;nc=!0;let r=UT(e)&&e.raw?e.raw:e;try{let n=BT(e);yh(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new zl(`${i}, origin error: ${r.message}`);Pt.error(o),yh(new zl(o.message),{environment:t.environment},!1)}finally{nc=!1}})});var cr,ic,Qr=k(()=>{"use strict";mt();N();mt();cr=(e,t)=>{var r,n;return new ti((n=(r=t==null?void 0:t.errMsg)!=null?r:e.msg)!=null?n:"",e.code,e.type)},ic=e=>new eh(e)});var wh=k(()=>{"use strict";bh();Qr();N();_e();Pr.on("GLOBAL_ERROR",(e,t)=>{var n;let r={message:e.message,stack:(n=e.stack)!=null?n:"",errorType:e.name,source:0};j("trackAsync",{event:"reportJsError",data:r})});Pr.on("GLOBAL_USER_ERROR",(e,t)=>{Pt.log("UserError",e,t)})});var oc=k(()=>{"use strict"});function Ih(e,t){let r=(n,i,o)=>{let c=i!=null?i:{},{eventType:a}=c,s=je(c,["eventType"]),l=B(T({tag:n,eventType:o!=null?o:a!=null?a:J.Other},t),{extra:T({},s)});n=="globalJsError"?ke(new oh(JSON.stringify(l))):e("systemLog",l,S.webviewId)};return r.debounce=Zn(r,500,{leading:!0}),r}function Sh(e){let t=(r,n,i)=>{var s;let o=(s=i&&JSON.stringify(i))!=null?s:0,a={speed_value_type:r,total_duration:n};o&&Object.assign(a,{extra:o}),e("joliboxSpeedAnalysis",a)};return t.debounce=Zn(t,500,{leading:!0}),t}var Eh=k(()=>{"use strict";N();N();mt();H()});function xh(e,t){let r=Ih(e,t),n=Sh(r);return{track:r,trackPerformance:n}}var kh=k(()=>{"use strict";Eh()});var Ah=k(()=>{"use strict";H();N();N()});var Th=k(()=>{"use strict";kh();oc();Ah()});var Lo,Ch=k(()=>{"use strict";Lo=class{constructor(t,r){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.timer=this.createRAFTimer(t=>{this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t})});this.interval=r!=null?r:5*1e3,t.on("visible",n=>{this.visible=n})}start(t){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:t!=null?t:0}}),this.tracker("OpenGame",{duration:t!=null?t:0}),this.timer.start()}close(t){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:t}}),this.tracker("CloseGame",{duration:t}),this.timer.stop()}createRAFTimer(t){let r=Date.now(),n,i,o=!1,a=0,s=()=>{if(!o)return;let p=Date.now(),m=p-r;m>=this.interval&&(this.visible&&(a+=Math.min(m,this.interval+1e3),t(a)),r=p),n=requestAnimationFrame(s)},l=()=>{d(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let p=Date.now();p-r>=this.interval&&(r=p)},this.interval)},c=()=>{u(),r=Date.now(),n=requestAnimationFrame(s)},d=()=>{n&&(cancelAnimationFrame(n),n=0)},u=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",p=>{o&&(console.log("visible",p),p?c():l())});let f=this.visible;return{start(){o||(o=!0,f?c():l())},stop(){o=!1,d(),u()}}}}});function qo(e,t,r){var l,c,d;let n=new Map,i=(l=r==null?void 0:r.baseUrl)!=null?l:Cr(S.testMode),o=(c=r==null?void 0:r.type)!=null?c:"public",a=(d=r==null?void 0:r.defaultHeaders)!=null?d:{};return Ze("onRequestTaskStateChange",u=>{if(typeof u.requestTaskId!="string")return;let f=n.get(u.requestTaskId);if(f)if(u.state==="success"){let p=u,{requestTaskId:g,state:_}=p,v=je(p,["requestTaskId","state"]);u.statusCode===200?f.resolve(v):f.reject(v),n.delete(g)}else if(u.state==="fail"){let m=u,{requestTaskId:g,state:_}=m,v=je(m,["requestTaskId","state"]);f.reject(v),n.delete(g)}else Pt.warn("onRequestTaskStateChange unknown event",u)}),ne.on("onLoginComplete",({isLogin:u,token:f})=>{o!=="public"&&u&&f&&(a["X-JOLI-TOKEN"]=f)}),(p,...m)=>w(this,[p,...m],function*(u,f={}){let g=Date.now(),_=JT(u,B(T({},f),{baseUrl:i})),{method:v="GET",responseType:b="text",dataType:I="json",timeout:A,enableCache:P=!1,appendHostCookie:O=!0}=f,x=Object.assign({"content-type":"application/json"},a,f.header),C={url:_,method:v,header:x,enableCache:P,responseType:b,appendHostCookie:O};if(v=="POST"||v=="PUT"){let Ne=$T(f.data,x["content-type"]);C.data=Ne}A&&Object.assign(C,{timeout:A});let{data:{requestTaskId:U}}=j(e,C);if(typeof U!="string")throw cr({code:-1,msg:"requestTaskId is not a string"});let{resolve:We,reject:q,promise:Re}=new Ct;n.set(U,{resolve:We,reject:q});try{let Ne=yield Re,{data:Ar}=Ne;return I==="json"&&typeof Ar=="string"&&(Ar=HT(Ar)),{url:_,timeout:A,method:v,response:B(T({},Ne),{data:Ar})}}catch(Ne){let Ar=Ne;if(Tr(Ar)){let{errMsg:gl,prefetchDetail:a$,isPrefetch:s$,errNo:t1}=Ar;Xn(gl)&&ke(cr({code:-1,msg:gl},{errNo:t1,errMsg:gl}))}throw Ne}})}function HT(e){try{return JSON.parse(e.trim())}catch(t){return e}}function $T(e,t="application/json"){let r=t.toLowerCase();return e===void 0?"":typeof e=="string"||e instanceof ArrayBuffer?e:r.includes("application/x-www-form-urlencoded")||r.includes("application/json")||typeof e=="object"?JSON.stringify(e):String(e)}var JT,ac=k(()=>{"use strict";N();_e();mt();Qr();H();JT=(e,t)=>{if(/^https?:\/\//.test(e))return e;let r=t==null?void 0:t.query,i=new URLSearchParams(r).toString();return t!=null&&t.baseUrl?`${t.baseUrl}${e}${i?`?${i}`:""}`:`${e}${i?`?${i}`:""}`}});var sc,Ph,te,vt=k(()=>{"use strict";ac();H();N();sc={};(Ph=S.hostUserInfo)!=null&&Ph.token&&(sc["x-joli-token"]=S.hostUserInfo.token);S.joliSource&&(sc["x-joli-source"]=S.joliSource);te=qo("createRequestTaskSync","operateRequestTaskSync",{type:"inner",baseUrl:Cr(S.testMode),defaultHeaders:sc})});var Fo,Oh=k(()=>{"use strict";H();Ch();N();vt();_e();Fo=class extends Lo{constructor(t,r,n){super(r,n),this.gameId=S.mpId,this.sessionId=S.sessionId,this.track=t,this.taskUrl=Cr(S.testMode)+"/api/base/app-event"}reporter(t){return w(this,null,function*(){let{event:r,params:n,extraParams:i}=t,o={eventType:r,gameInfo:T({gameId:this.gameId,sessionId:this.sessionId},n)};i&&Object.assign(o,i),yield S.platform==="android"?te("/api/base/app-event",{method:"POST",data:o}):ye("trackAppEventAsync",{url:this.taskUrl,body:JSON.stringify(o)})})}reportToNative(t){return w(this,null,function*(){let{event:r,params:n}=t;yield ye("userTrackAsync",{event:r,params:T({},n),gameId:this.gameId})})}tracker(t,r=null){this.track(t,r)}}});var qh={};yp(qh,{nativeTaskEmitter:()=>ni,taskTracker:()=>It,track:()=>M,trackPerformance:()=>Dh});var VT,Rh,Nh,M,Dh,Lh,ni,It,gt=k(()=>{"use strict";wh();N();oc();Th();H();Oh();_e();VT=(e,t,r)=>{var s,l,c,d,u,f;let n=t,i=Tr(n.extra)?n.extra:Xn(n.extra)?JSON.parse(n.extra):{},o=B(T({},i),{mp_id:(s=n.mp_id)!=null?s:"",mp_version:(l=n.mp_version)!=null?l:"",session_id:S.sessionId,user_id:(d=(c=S.hostUserInfo)==null?void 0:c.uid)!=null?d:""}),a=(u=n.eventType)!=null?u:J.Other;j("trackAsync",{event:(f=t.tag)!=null?f:e,data:o,webviewId:r,eventType:a})},{track:M,trackPerformance:Dh}=xh(VT,{type:Kl.AppSDK,platform:"native",jssdk_version:(Nh=(Rh=S.sdkInfo)==null?void 0:Rh.jssdkVersion)!=null?Nh:"1.0.0",mp_id:S.mpId,mp_version:S.mpVersion}),Lh=X();Lh.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Dh(e,t,r)});Lh.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{M(e,t)});ni=new Ot,It=new Fo(M,ni)});function Fh(){let e=null,t=null,r=window.fetch,n=()=>{t=document.createElement("meta"),t.setAttribute("name","viewport"),t.setAttribute("content","viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"),t.setAttribute("data-jolibox-sdk","viewport-meta"),e=document.createElement("style"),e.setAttribute("data-jolibox-sdk","default-styles");let s=`
|
|
1
|
+
var r1=Object.create;var xo=Object.defineProperty,n1=Object.defineProperties,i1=Object.getOwnPropertyDescriptor,o1=Object.getOwnPropertyDescriptors,a1=Object.getOwnPropertyNames,Eo=Object.getOwnPropertySymbols,s1=Object.getPrototypeOf,yl=Object.prototype.hasOwnProperty,gp=Object.prototype.propertyIsEnumerable;var vp=(e,t,r)=>t in e?xo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T=(e,t)=>{for(var r in t||(t={}))yl.call(t,r)&&vp(e,r,t[r]);if(Eo)for(var r of Eo(t))gp.call(t,r)&&vp(e,r,t[r]);return e},B=(e,t)=>n1(e,o1(t));var je=(e,t)=>{var r={};for(var n in e)yl.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Eo)for(var n of Eo(e))t.indexOf(n)<0&&gp.call(e,n)&&(r[n]=e[n]);return r};var k=(e,t)=>()=>(e&&(t=e(e=0)),t);var h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),yp=(e,t)=>{for(var r in t)xo(e,r,{get:t[r],enumerable:!0})},l1=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of a1(t))!yl.call(e,i)&&i!==r&&xo(e,i,{get:()=>t[i],enumerable:!(n=i1(t,i))||n.enumerable});return e};var ie=(e,t,r)=>(r=e!=null?r1(s1(e)):{},l1(t||!e||!e.__esModule?xo(r,"default",{value:e,enumerable:!0}):r,e));var w=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});function h1(e){return!!(e!=null&&e.__nativeBuffers__)}function xl(e){if(typeof e=="string")try{e=JSON.parse(e)}catch(r){return{}}if(typeof e!="object"||e===null)return{};if(!h1(e))return e;let t=e.__nativeBuffers__;if(delete e.__nativeBuffers__,t)for(let r=0;r<t.length;r++){let n=t[r];if(n){let i;n.value?i=n.value:n.base64&&(i=m1(n.base64)),typeof i!="undefined"&&i instanceof ArrayBuffer&&(e[n.key]=i)}}return e}function g1(e={},t=!1){let r=e,n=[];for(let[i,o]of Object.entries(r))if(o!==void 0&&o instanceof ArrayBuffer&&o.byteLength!==void 0){let a=t?{value:o,key:i}:{base64:v1(o),key:i};n.push(a),delete r[i]}return n.length>0&&(r.__nativeBuffers__=n),r}function w1(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Op(e){return typeof e=="string"}function Wr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function bp(e){return typeof e=="number"&&!isNaN(e)}function S1(e){return typeof e=="undefined"}function E1(e){return S1(e)||e===null}function Rp(e){return typeof e=="function"}function x1(e){return Wr(e)&&Rp(e.then)}function Np(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function $n(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function R1(e,t,r){let n=e;for(let i of t)if(n&&typeof n=="object")n=n[i];else return r;return n===void 0?r:n}function F1(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function J1(e){return new Promise(t=>Dp(e)(t))}function Dp(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function H1(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new zn(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function V1(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)G1(e[n],t[n])}function G1(e,t){if(Op(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Rp(t)){try{if(e instanceof t)return}catch(r){}if(!E1(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 Dl(e,t){if(Al.config[e]){Oo.warn(`[can i use] ${e} already registered`);return}Al.config[e]=$t({},t)}function Sp(e,t){return`[${e}]:${t}`}function Z1(e,t){Ep||(wl=new Ao({eventName:"jolibox_invoke",tagNameOrder:["status","method","errNo","errMsg","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),Il=new Ao({eventName:"jolibox_invoke_js2native",tagNameOrder:["status","method","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),Sl=new Ao({eventName:"jolibox_invoke_native2js",tagNameOrder:["status","method","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),t("onJoliboxEnterBackground",()=>{wl.flush(),Il.flush(),Sl.flush()}),Ep=!0);function r(i){var o,a;let{method:s,args:l,startTime:c,isForeground:d,errMsg:u=`${s}:fail no errMsg`,errNo:f=0,__timing:p={receiveJSInvoke:0,invokeCallback:0}}=i,{receiveJSInvoke:m,invokeCallback:g}=p,_=(a=(o=u.match(/\S:(\S+)\s?/))==null?void 0:o[1])!=null?a:"fail";wl.report({status:_,method:n(s,l),errNo:`${f}`,errMsg:u,isForeground:d,duration:Date.now()-c}),c&&m&&g&&(Il.report({status:_,method:s,isForeground:d,duration:Number((m-c).toFixed(3))}),Sl.report({status:_,method:s,isForeground:d,duration:Number((Date.now()-g).toFixed(3))}))}function n(i,o){return(i==="callHostMethod"||i==="callHostMethodSync")&&o!=null&&o.method?`${i}-${o.method}`:i}return r}function nT(e,t){let r=0,n=!0,i=rT.resolveMap,o=Z1(e,t);t("onJoliboxEnterBackground",()=>{n=!1}),t("onJoliboxEnterForeground",()=>{n=!0,El.forEach(l=>Co(this,[l],function*({method:c,args:d,resolve:u}){let f=yield s(c,d);u(f)})),El.length=0});let a=(l,c)=>{let d=i.get(Number(l));if(!d)return;let u=xl(c);d(u),i.delete(Number(l))},s=(l,c)=>{var d,u;let f=Date.now(),p=`${n}`;r+=1;let m=new I1;if(i.set(r,m.resolve),!n&&K1.includes(l))return new Promise(A=>{El.push({method:l,args:c,resolve:A})});let g=f1($t({},{method:l,startTime:f,args:c,isForeground:p}),{invokeType:"js-bridge"}),_=!eT&&W1.includes(l),v=g1(c,_),b=_?v:JSON.stringify(v),I;if(l.endsWith("Sync")||Q1.includes(l)?I=(d=e.call)==null?void 0:d.call(e,l,v,r):typeof b=="string"?I=e.invoke(l,b,r):I=(u=e.call)==null?void 0:u.call(e,l,b,r),I){try{typeof I=="string"&&(I=JSON.parse(I)),I=xl(I)}catch(A){Oo.error(A)}return i.delete(r),I.errorCode&&(I.errorCode=Sp(l,I.errorCode)),o($t($t({},g),I)),I}return l.endsWith("Sync")&&i.delete(r),m.promise.then(A=>(A.errorCode&&(A.errorCode=Sp(l,A.errorCode)),o($t($t({},g),A)),A))};return{invokeNative:s,applyNative:(l,c)=>{let d=s(l,c);return x1(d)?d.then(u=>xp(l,u)):xp(l,d)},invokeHandler:a}}function xp(e,t){if(!Wr(t)){Oo.warn(`[Jolibox SDK]${e} no response value`);return}let r=t,{errMsg:n,errNo:i,errorType:o,errorCode:a}=r,s=p1(r,["errMsg","errNo","errorType","errorCode"]);if(n&&n!==`${e}:ok`)throw new C1(n,i,o,a);return s}function iT(e){if(globalThis[ko])return globalThis[ko];let t=new Pl,r=new Pl,n=new Ao({eventName:"jolibox_publish",tagNameOrder:["type","event"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}});return t.on("onJoliboxEnterBackground",()=>{n.flush()}),globalThis[ko]={onNative:t.on.bind(t),offNative:t.off.bind(t),subscribe:r.on.bind(r),unsubscribe:r.off.bind(r),subscribeHandler(i,o,a){let s=xl(o),l;if(s.__extra){l=s.params;let{type:c,startTime:d}=s.__extra;n.report({type:c,event:i,duration:Date.now()-d})}else l=s;if(i===qp){l.forEach(c=>{let[d,u]=c;try{r.emit(d.slice(Gn.length),u,a)}catch(f){}});return}if(i.startsWith(Gn)){r.emit(i.slice(Gn.length),l,a);return}t.emit(i,l,a)}},globalThis[ko]}function oT(e){let t=new Map,r=new Map,n,i;return{publish:(o,a,s,l)=>{if(l){let d=s!==void 0?s==="*"?"*":[s]:void 0;e.publish(`${Gn}${o}`,a,d);return}n||(n=Promise.resolve().then(()=>{t.forEach((d,u)=>{try{let f=u!==void 0?u==="*"?"*":[u]:void 0;e.publish(qp,d,f)}catch(f){}}),n=void 0,t.clear()}));let c=t.get(s);c||(c=[],t.set(s,c)),c.push([`${Gn}${o}`,a])},emitNative:(o,a,s,l)=>{if(l){let d=s!==void 0?s==="*"?"*":[s]:void 0;e.publish(o,a,d),console.log("emitNative",o,a,d);return}i||(i=Promise.resolve().then(()=>{r.forEach((d,u)=>{try{let f=u!==void 0?u==="*"?"*":[u]:void 0;e.publish(Y1,d,f)}catch(f){}}),i=void 0,r.clear()}));let c=r.get(s);c||(c=[],r.set(s,c)),c.push([o,a])}}}function aT(e){let{subscribeHandler:t,onNative:r,offNative:n,subscribe:i,unsubscribe:o}=iT(e),{invokeNative:a,invokeHandler:s,applyNative:l}=nT(e,r),{publish:c,emitNative:d}=oT(e);return{invokeHandler:s,subscribeHandler:t,applyNative:l,invokeNative:a,onNative:r,offNative:n,emitNative:d,publish:c,subscribe:i,unsubscribe:o}}function Fp(e,t){return{params:e,__extra:{startTime:Date.now(),type:t}}}var c1,u1,d1,To,Ap,Tp,_p,$t,f1,p1,Co,m1,v1,Cp,y1,_1,Pp,b1,I1,k1,A1,Po,T1,C1,P1,_l,Oo,wp,O1,kl,N1,Al,D1,L1,q1,zr,M1,c$,Tl,se,U1,j1,Vn,zn,Pl,Ol,B1,bl,$1,u$,Rl,Ip,d$,Lp,z1,Gn,W1,K1,Q1,qp,Y1,X1,Ao,Ep,wl,Il,Sl,El,eT,Nl,tT,rT,ko,Ll,ht,Mp,Up,sT,jp,kp,ye,j,Ze,f$,lT,Bp,ql,p$,h$,_e=k(()=>{"use strict";c1=Object.defineProperty,u1=Object.defineProperties,d1=Object.getOwnPropertyDescriptors,To=Object.getOwnPropertySymbols,Ap=Object.prototype.hasOwnProperty,Tp=Object.prototype.propertyIsEnumerable,_p=(e,t,r)=>t in e?c1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$t=(e,t)=>{for(var r in t||(t={}))Ap.call(t,r)&&_p(e,r,t[r]);if(To)for(var r of To(t))Tp.call(t,r)&&_p(e,r,t[r]);return e},f1=(e,t)=>u1(e,d1(t)),p1=(e,t)=>{var r={};for(var n in e)Ap.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&To)for(var n of To(e))t.indexOf(n)<0&&Tp.call(e,n)&&(r[n]=e[n]);return r},Co=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});m1=e=>{let t=atob(e),r=t.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=t.charCodeAt(i);return n.buffer};v1=e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let i=0;i<n;i++)t+=String.fromCharCode(r[i]);return btoa(t)};Cp=Object.defineProperty,y1=Object.getOwnPropertyDescriptor,_1=(e,t)=>{for(var r in t)Cp(e,r,{get:t[r],enumerable:!0})},Pp=(e,t,r,n)=>{for(var i=n>1?void 0:n?y1(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&Cp(t,r,i),i},b1=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}I1=class{constructor(){this.state="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.state==="pending"&&(this.state="fulfilled",e(r))},this.reject=r=>{this.state==="pending"&&(this.state="rejected",t(r))}})}};k1=(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))(k1||{}),A1=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}},Po=class extends A1{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},T1=class extends Po{constructor(){super(...arguments),this.name="INTERNAL_INVOKE_NATIVE_ERROR"}},C1=class extends Po{constructor(e,t,r,n){super(e),this.errNo=t,this.name="INTERNAL_APPLY_NATIVE_ERROR",this.errorType=r,this.errorCode=n}},P1=class extends Po{constructor(){super(...arguments),this.name="INTERNAL_JSCORE_ERROR",this.priority="P0"}},_l=class extends Po{constructor(){super(...arguments),this.name="INTERNAL_METRIC_REPORT_ERROR"}};Oo={log:$n("log"),warn:$n("warn"),info:$n("info"),error:$n("error"),debug:$n("debug")};Object.assign(globalThis,{logger:Oo});wp=Symbol.for("Jolibox.canIUseMap"),O1={};globalThis[wp]||(globalThis[wp]=O1);kl=Symbol.for("Jolibox.canIUseMap.native"),N1={};globalThis[kl]||(globalThis[kl]=N1);Al={get config(){return globalThis[kl]}},D1=(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))(D1||{}),L1=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(L1||{}),q1=(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))(q1||{});F1();zr=typeof window=="undefined",M1=()=>!zr&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),c$={isiOS:!zr&&(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:!zr&&navigator.userAgent.includes("Android"),isMac:!zr&&navigator.userAgent.includes("Mac"),isFacebook:!zr&&navigator.userAgent.includes("FB_IAB"),isPC:!zr&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},Tl=class Cl{constructor(t){this.element=t,this.next=Cl.Undefined,this.prev=Cl.Undefined}};Tl.Undefined=new Tl(void 0);se=Tl,U1=class{constructor(){this._first=se.Undefined,this._last=se.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===se.Undefined}clear(){let e=this._first;for(;e!==se.Undefined;){let t=e.next;e.prev=se.Undefined,e.next=se.Undefined,e=t}this._first=se.Undefined,this._last=se.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new se(e);if(this._first===se.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==se.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==se.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==se.Undefined&&e.next!==se.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===se.Undefined&&e.next===se.Undefined?(this._first=se.Undefined,this._last=se.Undefined):e.next===se.Undefined?(this._last=this._last.prev,this._last.next=se.Undefined):e.prev===se.Undefined&&(this._first=this._first.next,this._first.prev=se.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==se.Undefined;)yield e.element,e=e.next}},j1=0,Vn=class{constructor(e){this.value=e,this.id=j1++}},zn=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof Vn&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let c=new Vn(t);return this._listeners?this._listeners instanceof Vn?this._listeners=[this._listeners,c]:this._listeners.push(c):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=c,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var d,u,f,p;if(!this._disposed){if(this._listeners instanceof Vn)this._listeners.id===c.id&&(this._listeners=void 0,this._size=0,(u=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||u.call(d));else if(this._listeners){let m=this._listeners.indexOf(c);m>=0&&(this._listeners.splice(m,1),this._size--,this._size===0&&((p=(f=this.options)==null?void 0:f.onDidRemoveLastListener)==null||p.call(f)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Vn?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Pl=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new zn,o=l=>t(...l.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new U1,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},Ol={};_1(Ol,{None:()=>B1,filter:()=>H1,once:()=>Dp,toPromise:()=>J1});B1=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});bl=Symbol.for("Jolibox.hostEmitter"),$1=()=>{let e=new Pl;return globalThis[bl]||(globalThis[bl]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[bl]},u$=$1();Rl=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new zn,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(...i){return V1(i,r),n(...i)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};Rl=Pp([Np],Rl);Ip=class{constructor(){this._onWillExecuteCommand=new zn,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new zn,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Rl,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=w1(3e4)),this._starActivation}executeCommand(e,...t){return b1(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),Ol.toPromise(Ol.filter(this.registry.onDidRegisterCommand,r=>r===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let r=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),n}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e,...t){let r=!1;try{return e(...t)}finally{r=!0}}};Ip=Pp([Np],Ip);d$=Symbol.for("Jolibox.commands");Dl("requestPaymentSync",{version:1e6,properties:{paymentBody:{appStoreProductId:102e4}}});Dl("requestProductDetailsAsync",{version:102e4});Dl("loginSync",{version:1e6,properties:{skipLogin:102e4,triggerFrom:102e4}});Lp=(e,t)=>{function r(i){var o;let[a,...s]=i.split(":");if(!a)return!1;let l=Al.config[a];if(!l)return!1;let c=(o=t==null?void 0:t())!=null?o:"";if(l.platforms&&!l.platforms.includes(c))return!1;let d=l.version;if(typeof d!="number")return!1;let u=e();return typeof u!="number"||u<d?!1:s.length===0?!0:n(l,s,u)||n(l.properties,s,u)}function n(i,o,a){if(!i)return!1;let s=R1(i,o);if(!s)return!1;if(Wr(s)){let l=s.version;return bp(l)?typeof a=="number"&&a>=l:!0}return bp(s)?typeof a=="number"&&a>=s:s===!0}return{canIUseNative:r}};z1=()=>M1(),Gn="custom_event_",W1=[],K1=[],Q1=["env","createRequestTask","login"],qp="__batch_event__",Y1="__native_batch_event__",X1=e=>e==="pv"?e:"default",Ao=class{constructor(e){this.interval=30,this.lastReportTime=0,this.cache={};let{reporter:t,interval:r=30,eventName:n,tagNameOrder:i,metricName:o,type:a}=e;this.reporter=t,this.interval=r,this.eventName=n,this.tagNameOrder=i,this.metricName=o,this.type=X1(a)}report(e){this.type==="pv"?this.addPVPoint(e):this.addPoint(e),this.tryReport(!1)}flush(){this.tryReport(!0)}tryReport(e){if(Object.keys(this.cache).length){if(e){this.reporter(this.processPoints(this.cache)),this.clearPoints();return}this.lastReportTime=this.lastReportTime||Date.now(),Date.now()-this.lastReportTime>=this.interval*1e3&&(this.reporter(this.processPoints(this.cache)),this.clearPoints(),this.lastReportTime=Date.now())}}addPoint(e){let t=(r,n,i,o)=>{let a=n.shift();if(a){let s=o[a];r[s]||(r[s]={}),t(r[s],n,i,o)}else r[i]||(r[i]=[]),r[i].push(o[i])};t(this.cache,[...this.tagNameOrder],this.metricName,e)}addPVPoint(e){let t=(n,i,o,a)=>{let s=i.shift();if(!s&&Wr(a))throw new _l(`report value failed to match tagNameOrder, ${JSON.stringify(r)}`);if(s){let l=[];if(Wr(a))l.push(...Object.keys(a));else if(Op(a)){if(i.length>0)throw new _l(`report value failed to match tagNameOrder, ${JSON.stringify(r)}`);l.push(a)}else throw new _l(`expected metric value to be a string, but got a(n) ${typeof a}, ${JSON.stringify(r)}`);l.forEach(c=>{n[c]||(n[c]={});let d=Wr(a)?a[c]:a;t(n[c],[...i],o,d)})}else n[o]?n[o]++:n[o]=1},r={point:e,metricName:this.metricName,tagNameOrder:this.tagNameOrder};t(this.cache,[...this.tagNameOrder],this.metricName,e)}processPoints(e){return{eventName:this.eventName,tagNameOrder:this.tagNameOrder,metricName:this.metricName,metricAggregateType:this.type==="pv"?"itoa":"arr",data:e}}clearPoints(){this.cache={}}},Ep=!1;El=[],eT=!1,Nl=Symbol.for("Jolibox.invokeResolverInstance"),tT=new Map;globalThis[Nl]||(globalThis[Nl]=tT);rT={get resolveMap(){return globalThis[Nl]}};ko=Symbol.for("Jolibox.subscribeInstance");ht={trigger(){},exit(){return Promise.resolve(!1)},backPress(){return Promise.resolve(!1)},onReady(e){ht.trigger=e},onDoExit(e){ht.exit=e},onDoBackPress(e){ht.backPress=e}},Mp=e=>{let t=window.prompt("invoke",JSON.stringify({event:"envSync",paramsString:JSON.stringify({})}));if(!t)e.onError(new T1("native env failed"));else{let{data:r}=JSON.parse(t);return r!=null?r:void 0}};if(typeof window!="undefined"&&window.webkit){let e=window.webkit.messageHandlers,t=(i="")=>{ht.trigger(),e.onDocumentReady.postMessage({path:i})},r=i=>Co(void 0,null,function*(){let o=yield ht.exit();e.doExit.postMessage({uuid:i,shouldInterrupt:o})});Ll={onDocumentReady:t,doExit:r,invoke(i,o,a){e.invoke.postMessage({event:i,paramsString:o,callbackId:a})},publish(i,o,a){let s=Fp(o,"joliboxJSCore");window.prompt("publish",JSON.stringify({event:i,paramsString:JSON.stringify(s),webviewIds:a}))},call(i,o,a){let s=window.prompt("invoke",JSON.stringify({event:i,paramsString:JSON.stringify(o),callbackId:a}));if(s)return JSON.parse(s)}};let n={onDocumentReady:t,env:Mp,doExit:r};globalThis.joliboxJSCore=$t({},n)}if(typeof window!="undefined"&&window.JoliAndroidSDKBridge){let e,t=window.JoliAndroidSDKBridge,r=(o="")=>{ht.trigger(),t.onDocumentReady(JSON.stringify({path:o}))},n=o=>Co(void 0,null,function*(){let a=yield ht.exit();t.doExit(JSON.stringify({uuid:o,shouldInterrupt:a}))});Ll={onDocumentReady:r,invoke(o,a,s){t.invoke(JSON.stringify({event:o,paramsString:a,callbackId:s}))},doExit:n,publish(o,a,s){let l=Fp(a,"joliboxJSCore");t.publish(JSON.stringify({event:o,paramsString:JSON.stringify(l),webviewIds:s}))},call(o,a,s){let l=window.prompt("invoke",JSON.stringify({event:o,paramsString:JSON.stringify(a),callbackId:s}));if(l)return JSON.parse(l)},doBackPress(o){return Co(this,null,function*(){let a=yield ht.backPress();t.doBackPress(JSON.stringify({uuid:o,shouldInterrupt:a}))})}};let i={onDocumentReady:r,env:Mp,doExit:n};globalThis.joliboxJSCore=$t({},i)}Up=Ll;if(!Up&&z1())throw new P1("No joliboxJScore is found, native bridge not found.");sT=$t({},Up),jp=aT(sT),{invokeHandler:kp}=jp,{applyNative:ye,invokeNative:j,onNative:Ze,offNative:f$,subscribeHandler:lT,publish:Bp,emitNative:ql,subscribe:p$,unsubscribe:h$}=jp;globalThis.joliboxJSBridge={callHandler:kp,invokeHandler:kp,subscribeHandler:lT}});function mT(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function zp(e){return new Promise(t=>setTimeout(t,e))}function Xn(e){return typeof e=="string"}function Tr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Wp(e){return typeof e=="object"&&Array.isArray(e)}function Kp(e){return typeof e=="number"&&!isNaN(e)}function Kr(e){return e===!0||e===!1}function Qp(e){return typeof e=="undefined"}function $l(e){return Qp(e)||e===null}function vT(e){return typeof e=="function"}function Yp(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Xp(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,o){for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=i[a],l=o[a],c=r(s,l,a,i,o);c!==void 0?i[a]=c:$p(l)&&$p(s)?i[a]=n(fT({},s),l):Array.isArray(l)&&Array.isArray(s)?i[a]=[...s,...l]:i[a]=l}return i}return n(e,t)}function $p(e){return e&&typeof e=="object"&&e.constructor===Object}function Zp(e,t){if(Array.isArray(e))return e.concat(t)}function Zn(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:l=!0}=r,c=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),d=function(...u){i=u,o=this;let f=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,l&&!f&&c()},t),f)return c()};return d.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},d.flush=()=>{if(n)return clearTimeout(n),n=null,c()},d}function yT(e,t){return(...r)=>t(e,...r)}function No(e){return t=>yT(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new lr(`${i}`))}})}function Wn(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function ah(e,t,r){let n=0;if(e!==t){let i=e.split("."),o=t.split("."),a=Math.max(i.length,o.length);for(let s=0;s<a;s++){let l=parseInt(i[s],10)||0,c=parseInt(o[s],10)||0;if(l>c){n=1;break}else if(l<c){n=-1;break}}}if(!r)return n;switch(r){case">":return n>0;case"<":return n<0;case"=":return n===0;case">=":return n>=0;case"<=":return n<=0;default:return!1}}function Ql(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function ET(e,t,r){let n=window.location.hostname,i=n.split("."),o=r?t:e;if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n))return`${o}.jolibox.com`;if(i.length>=2){let a=i.slice(-2).join(".");if(a==="jolibox.com"||a==="pico-game.com")return`${o}.${a}`}return`${o}.jolibox.com`}function Yl(e){return ET("api","stg-api",e)}function Cr(e){return`https://${Yl(e)}`}function TT(e){return new Promise(t=>uh(e)(t))}function uh(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function CT(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Yn(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function OT(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)RT(e[n],t[n])}function RT(e,t){if(Xn(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(vT(t)){try{if(e instanceof t)return}catch(r){}if(!$l(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 NT(){return typeof globalThis!="undefined"?globalThis[dh]:void 0}function DT(e){typeof globalThis!="undefined"&&(globalThis[dh]=e)}function X(e=!1){let t=NT();if(!e&&t)return t;let r=new Ro,n=new Jl,i={registerCommand(o,a,s){r.registerCommand({id:o,handler:a,metadata:s})},executeCommand(o,...a){return n.executeCommand(o,...a)},excuteCommandSync(o,...a){return n.executeCommandThowErr(o,...a)}};return DT(i),i}var Hl,cT,Jp,uT,dT,Hp,fT,pT,Gp,hT,Ct,gT,Vl,ei,Gl,eh,lr,th,rh,nh,ih,oh,ti,zl,Pt,Ml,_T,Wl,Vp,bT,J,Kl,wT,Do,Kn,ri,IT,ST,sh,lh,ch,Ul,le,xT,kT,Qn,Yn,Ot,Bl,AT,Fl,PT,ne,Ro,Jl,dh,N=k(()=>{"use strict";Hl=Object.defineProperty,cT=Object.getOwnPropertyDescriptor,Jp=Object.getOwnPropertySymbols,uT=Object.prototype.hasOwnProperty,dT=Object.prototype.propertyIsEnumerable,Hp=(e,t,r)=>t in e?Hl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fT=(e,t)=>{for(var r in t||(t={}))uT.call(t,r)&&Hp(e,r,t[r]);if(Jp)for(var r of Jp(t))dT.call(t,r)&&Hp(e,r,t[r]);return e},pT=(e,t)=>{for(var r in t)Hl(e,r,{get:t[r],enumerable:!0})},Gp=(e,t,r,n)=>{for(var i=n>1?void 0:n?cT(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&Hl(t,r,i),i},hT=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}Ct=class{constructor(){this.state="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.state==="pending"&&(this.state="fulfilled",e(r))},this.reject=r=>{this.state==="pending"&&(this.state="rejected",t(r))}})}};gT=(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))(gT||{}),Vl=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}},ei=class extends Vl{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Gl=class extends Vl{constructor(){super(...arguments),this.kind="USER_ERROR"}},eh=class extends Gl{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},lr=class extends Gl{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="USER_CUSTOM_ERROR",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},th=class extends Gl{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="USER_PAYMENT_ERROR",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},rh=class extends ei{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},nh=class extends ei{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="INTERNAL_PAYMENT_ERROR",this.priority="P0",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},ih=class extends ei{constructor(){super(...arguments),this.name="INTERNAL_INVOKE_METHOD_ERROR"}},oh=class extends ei{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},ti=class extends Vl{constructor(e,t,r,n,i){super(e),this.message=e,this.code=t,this.kind="API_ERROR",this.name="API_ERROR",r&&(this.errorType=r),n!==void 0&&(this.stack=n),i&&(this.priority=i)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},zl=class extends ei{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Pt={log:Wn("log"),warn:Wn("warn"),info:Wn("info"),error:Wn("error"),debug:Wn("debug")};Object.assign(globalThis,{logger:Pt});Ml=Symbol.for("Jolibox.canIUseMap"),_T={};globalThis[Ml]||(globalThis[Ml]=_T);Wl={get config(){return globalThis[Ml]}},Vp=Symbol.for("Jolibox.canIUseMap.native"),bT={};globalThis[Vp]||(globalThis[Vp]=bT);J=(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))(J||{}),Kl=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Kl||{}),wT=(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))(wT||{}),Do=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});Ql();Kn=typeof window=="undefined",ri={isiOS:!Kn&&(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:!Kn&&navigator.userAgent.includes("Android"),isMac:!Kn&&navigator.userAgent.includes("Mac"),isFacebook:!Kn&&navigator.userAgent.includes("FB_IAB"),isPC:!Kn&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},IT="device_id",ST="advertising_id",sh=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,Do()),window.__joliboxLocalStorage__.getItem(e)),lh=()=>new URLSearchParams(window.location.search).get("deviceId")||sh(IT),ch=()=>new URLSearchParams(window.location.search).get("advertisingId")||sh(ST);Ul=class jl{constructor(t){this.element=t,this.next=jl.Undefined,this.prev=jl.Undefined}};Ul.Undefined=new Ul(void 0);le=Ul,xT=class{constructor(){this._first=le.Undefined,this._last=le.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===le.Undefined}clear(){let e=this._first;for(;e!==le.Undefined;){let t=e.next;e.prev=le.Undefined,e.next=le.Undefined,e=t}this._first=le.Undefined,this._last=le.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new le(e);if(this._first===le.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==le.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==le.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==le.Undefined&&e.next!==le.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===le.Undefined&&e.next===le.Undefined?(this._first=le.Undefined,this._last=le.Undefined):e.next===le.Undefined?(this._last=this._last.prev,this._last.next=le.Undefined):e.prev===le.Undefined&&(this._first=this._first.next,this._first.prev=le.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==le.Undefined;)yield e.element,e=e.next}},kT=0,Qn=class{constructor(e){this.value=e,this.id=kT++}},Yn=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof Qn&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let c=new Qn(t);return this._listeners?this._listeners instanceof Qn?this._listeners=[this._listeners,c]:this._listeners.push(c):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=c,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var d,u,f,p;if(!this._disposed){if(this._listeners instanceof Qn)this._listeners.id===c.id&&(this._listeners=void 0,this._size=0,(u=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||u.call(d));else if(this._listeners){let m=this._listeners.indexOf(c);m>=0&&(this._listeners.splice(m,1),this._size--,this._size===0&&((p=(f=this.options)==null?void 0:f.onDidRemoveLastListener)==null||p.call(f)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Qn?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Ot=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Yn,o=l=>t(...l.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new xT,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},Bl={};pT(Bl,{None:()=>AT,filter:()=>CT,once:()=>uh,toPromise:()=>TT});AT=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Fl=Symbol.for("Jolibox.hostEmitter"),PT=()=>{let e=new Ot;return globalThis[Fl]||(globalThis[Fl]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Fl]},ne=PT();Ro=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Yn,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(...i){return OT(i,r),n(...i)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};Ro=Gp([Yp],Ro);Jl=class{constructor(){this._onWillExecuteCommand=new Yn,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Yn,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Ro,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=mT(3e4)),this._starActivation}executeCommand(e,...t){return hT(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),Bl.toPromise(Bl.filter(this.registry.onDidRegisterCommand,r=>r===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let r=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),n}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e,...t){let r=!1;try{return e(...t)}finally{r=!0}}};Jl=Gp([Yp],Jl);dh=Symbol.for("Jolibox.commands")});function ke(e,t={}){Xl.emit("ERROR_REPORT",{error:e,options:t})}var Xl,Pr,mt=k(()=>{"use strict";N();N();Xl=new Ot,Pr=new Ot;ke.debounce=Zn(ke,50,{leading:!0})});var Zl,LT,fh,ph,hh=k(()=>{"use strict";N();mt();Zl=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4===0?"":"=".repeat(4-t.length%4),n=atob(t+r);try{return JSON.parse(n)}catch(i){return{}}},LT=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},fh=e=>{var t;try{let i=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(i!=null&&i.length){let[o,a,s]=i;return{headerJson:Zl(o),payloadJson:Zl(a),signature:Zl(s)}}else throw"joli_source is missing"}catch(r){return ke(new rh(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},ph=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=LT(e),o=r[2];return`${n}.${i}.${o}`}return t}});var qT,ec,mh=k(()=>{"use strict";N();qT="1.1.55",ec=()=>qT});function rc(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var FT,vh,tc,gh,de,MT,S,H=k(()=>{"use strict";N();hh();mh();N();FT={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:lh(),adId:ch(),pixelRatio:window.devicePixelRatio||1,platform:ri.isAndroid?"android":ri.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:ec()},schema:window.location.href,platform:ri.isAndroid?"android":ri.isiOS?"ios":"h5"},tc=(vh=globalThis.joliboxJSCore)==null?void 0:vh.env,de=Object.assign({},(gh=tc==null?void 0:tc())!=null?gh:FT);MT=()=>{var p,m,g,_,v,b,I,A,P,O,x;let{payloadJson:e,headerJson:t,signature:r}=de.schema.length?fh(de.schema):{},n=`${de.deviceInfo.did}-${new Date().getTime()}`,o=new URL(de.schema.length?de.schema:window.location.href).searchParams,a=(g=(m=(p=o.get("mpId"))!=null?p:o.get("appId"))!=null?m:o.get("gameId"))!=null?g:"",s=(b=(v=(_=de.clientSessionId)!=null?_:e==null?void 0:e.sessionId)!=null?v:o.get("sessionId"))!=null?b:n,l=!!((A=(I=e==null?void 0:e.testAdsMode)!=null?I:e==null?void 0:e.__testAdsMode)!=null?A:o.get("testAdsMode")==="true"),c=(x=(O=(P=e==null?void 0:e.joliboxEnv)!=null?P:e==null?void 0:e.__joliboxEnv)!=null?O:o.get("joliboxEnv"))!=null?x:"production",d=c==="staging",u=t==null?void 0:t.channel,f=e==null?void 0:e.__shouldInterupt;return{get startTime(){var C;return(C=performance.timeOrigin)!=null?C:performance.timing.navigationStart},get testMode(){return d},get testAdsMode(){return l},get joliboxEnv(){return c},get joliSource(){var C;return(C=o.get("joliSource"))!=null?C:null},get mpId(){var C;return(C=a!=null?a:e==null?void 0:e.id)!=null?C:""},get mpVersion(){var C;return(C=t==null?void 0:t.ver)!=null?C:ec()},get mpType(){var C,U;return(U=(C=t==null?void 0:t.__mpType)!=null?C:e==null?void 0:e.__mpType)!=null?U:"game"},get platform(){var C;return((C=de.platform)!=null?C:de.deviceInfo.platform).toLowerCase()},get deviceInfo(){return de.deviceInfo},get sdkInfo(){return de.sdkInfo},get hostInfo(){return de.hostInfo},get hostUserInfo(){return de.hostUserInfo},get sessionId(){var C,U;return(U=(C=de.clientSessionId)!=null?C:s)!=null?U:n},get channel(){return u},get webviewId(){var C;return(C=de.webviewId)!=null?C:-1},get shouldInterupt(){return f},get from(){return e==null?void 0:e.__from},get baseApiHost(){return Yl(d)},get adId(){var C;return(C=de.deviceInfo.adId)!=null?C:de.deviceInfo.did},get language(){return de.deviceInfo.lang},get sdkEnvironment(){return rc("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":rc("gamedistribution","jolibox")?"gamedistribution":rc("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var q,Re,Ne;let C=(q=de.deviceInfo.pixelRatio)!=null?q:1,U=(Re=de.deviceInfo.statusBarHeight)!=null?Re:e==null?void 0:e.__androidStatusBarHeight,We=(Ne=de.deviceInfo.navigationBarHeight)!=null?Ne:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:U!==void 0?U/C:20,navigationBarHeight:We!==void 0?We/C:10}},get abTests(){var C,U;return(U=(C=de.abValues)==null?void 0:C.split(","))!=null?U:[]},onEnvConfigChanged:C=>{Xp(de,C,Zp)},encodeJoliSourceQuery:C=>{var U,We;return t&&r?ph(T(T({},e),C),(U=o.get("joliSource"))!=null?U:""):(We=o.get("joliSource"))!=null?We:""},setDoExitDirectly:()=>{f=!1}}},S=MT()});var nc,_h,UT,jT,yh,BT,bh=k(()=>{"use strict";N();mt();H();N();nc=!1,_h=(e,t)=>e==null?!1:t in e,UT=e=>_h(e,"kind"),jT=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},yh=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=S.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=S.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:jT(e.name)},i=B(T({},n),{env:t.environment,isFromUser:r});r?Pr.emit("GLOBAL_USER_ERROR",e,i):Pr.emit("GLOBAL_ERROR",e,i)},BT=e=>_h(e,"kind")&&e.kind==="USER_ERROR";Xl.on("ERROR_REPORT",({error:e,options:t})=>{if(nc)return;nc=!0;let r=UT(e)&&e.raw?e.raw:e;try{let n=BT(e);yh(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new zl(`${i}, origin error: ${r.message}`);Pt.error(o),yh(new zl(o.message),{environment:t.environment},!1)}finally{nc=!1}})});var cr,ic,Qr=k(()=>{"use strict";mt();N();mt();cr=(e,t)=>{var r,n;return new ti((n=(r=t==null?void 0:t.errMsg)!=null?r:e.msg)!=null?n:"",e.code,e.type)},ic=e=>new eh(e)});var wh=k(()=>{"use strict";bh();Qr();N();_e();Pr.on("GLOBAL_ERROR",(e,t)=>{var n;let r={message:e.message,stack:(n=e.stack)!=null?n:"",errorType:e.name,source:0};j("trackAsync",{event:"reportJsError",data:r})});Pr.on("GLOBAL_USER_ERROR",(e,t)=>{Pt.log("UserError",e,t)})});var oc=k(()=>{"use strict"});function Ih(e,t){let r=(n,i,o)=>{let c=i!=null?i:{},{eventType:a}=c,s=je(c,["eventType"]),l=B(T({tag:n,eventType:o!=null?o:a!=null?a:J.Other},t),{extra:T({},s)});n=="globalJsError"?ke(new oh(JSON.stringify(l))):e("systemLog",l,S.webviewId)};return r.debounce=Zn(r,500,{leading:!0}),r}function Sh(e){let t=(r,n,i)=>{var s;let o=(s=i&&JSON.stringify(i))!=null?s:0,a={speed_value_type:r,total_duration:n};o&&Object.assign(a,{extra:o}),e("joliboxSpeedAnalysis",a)};return t.debounce=Zn(t,500,{leading:!0}),t}var Eh=k(()=>{"use strict";N();N();mt();H()});function xh(e,t){let r=Ih(e,t),n=Sh(r);return{track:r,trackPerformance:n}}var kh=k(()=>{"use strict";Eh()});var Ah=k(()=>{"use strict";H();N();N()});var Th=k(()=>{"use strict";kh();oc();Ah()});var Lo,Ch=k(()=>{"use strict";Lo=class{constructor(t,r){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.timer=this.createRAFTimer(t=>{this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t})});this.interval=r!=null?r:5*1e3,t.on("visible",n=>{this.visible=n})}start(t){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:t!=null?t:0}}),this.tracker("OpenGame",{duration:t!=null?t:0}),this.timer.start()}close(t){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:t}}),this.tracker("CloseGame",{duration:t}),this.timer.stop()}createRAFTimer(t){let r=Date.now(),n,i,o=!1,a=0,s=()=>{if(!o)return;let p=Date.now(),m=p-r;m>=this.interval&&(this.visible&&(a+=Math.min(m,this.interval+1e3),t(a)),r=p),n=requestAnimationFrame(s)},l=()=>{d(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let p=Date.now();p-r>=this.interval&&(r=p)},this.interval)},c=()=>{u(),r=Date.now(),n=requestAnimationFrame(s)},d=()=>{n&&(cancelAnimationFrame(n),n=0)},u=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",p=>{o&&(console.log("visible",p),p?c():l())});let f=this.visible;return{start(){o||(o=!0,f?c():l())},stop(){o=!1,d(),u()}}}}});function qo(e,t,r){var l,c,d;let n=new Map,i=(l=r==null?void 0:r.baseUrl)!=null?l:Cr(S.testMode),o=(c=r==null?void 0:r.type)!=null?c:"public",a=(d=r==null?void 0:r.defaultHeaders)!=null?d:{};return Ze("onRequestTaskStateChange",u=>{if(typeof u.requestTaskId!="string")return;let f=n.get(u.requestTaskId);if(f)if(u.state==="success"){let p=u,{requestTaskId:g,state:_}=p,v=je(p,["requestTaskId","state"]);u.statusCode===200?f.resolve(v):f.reject(v),n.delete(g)}else if(u.state==="fail"){let m=u,{requestTaskId:g,state:_}=m,v=je(m,["requestTaskId","state"]);f.reject(v),n.delete(g)}else Pt.warn("onRequestTaskStateChange unknown event",u)}),ne.on("onLoginComplete",({isLogin:u,token:f})=>{o!=="public"&&u&&f&&(a["X-JOLI-TOKEN"]=f)}),(p,...m)=>w(this,[p,...m],function*(u,f={}){let g=Date.now(),_=JT(u,B(T({},f),{baseUrl:i})),{method:v="GET",responseType:b="text",dataType:I="json",timeout:A,enableCache:P=!1,appendHostCookie:O=!0}=f,x=Object.assign({"content-type":"application/json"},a,f.header),C={url:_,method:v,header:x,enableCache:P,responseType:b,appendHostCookie:O};if(v=="POST"||v=="PUT"){let Ne=$T(f.data,x["content-type"]);C.data=Ne}A&&Object.assign(C,{timeout:A});let{data:{requestTaskId:U}}=j(e,C);if(typeof U!="string")throw cr({code:-1,msg:"requestTaskId is not a string"});let{resolve:We,reject:q,promise:Re}=new Ct;n.set(U,{resolve:We,reject:q});try{let Ne=yield Re,{data:Ar}=Ne;return I==="json"&&typeof Ar=="string"&&(Ar=HT(Ar)),{url:_,timeout:A,method:v,response:B(T({},Ne),{data:Ar})}}catch(Ne){let Ar=Ne;if(Tr(Ar)){let{errMsg:gl,prefetchDetail:a$,isPrefetch:s$,errNo:t1}=Ar;Xn(gl)&&ke(cr({code:-1,msg:gl},{errNo:t1,errMsg:gl}))}throw Ne}})}function HT(e){try{return JSON.parse(e.trim())}catch(t){return e}}function $T(e,t="application/json"){let r=t.toLowerCase();return e===void 0?"":typeof e=="string"||e instanceof ArrayBuffer?e:r.includes("application/x-www-form-urlencoded")||r.includes("application/json")||typeof e=="object"?JSON.stringify(e):String(e)}var JT,ac=k(()=>{"use strict";N();_e();mt();Qr();H();JT=(e,t)=>{if(/^https?:\/\//.test(e))return e;let r=t==null?void 0:t.query,i=new URLSearchParams(r).toString();return t!=null&&t.baseUrl?`${t.baseUrl}${e}${i?`?${i}`:""}`:`${e}${i?`?${i}`:""}`}});var sc,Ph,te,vt=k(()=>{"use strict";ac();H();N();sc={};(Ph=S.hostUserInfo)!=null&&Ph.token&&(sc["x-joli-token"]=S.hostUserInfo.token);S.joliSource&&(sc["x-joli-source"]=S.joliSource);te=qo("createRequestTaskSync","operateRequestTaskSync",{type:"inner",baseUrl:Cr(S.testMode),defaultHeaders:sc})});var Fo,Oh=k(()=>{"use strict";H();Ch();N();vt();_e();Fo=class extends Lo{constructor(t,r,n){super(r,n),this.gameId=S.mpId,this.sessionId=S.sessionId,this.track=t,this.taskUrl=Cr(S.testMode)+"/api/base/app-event"}reporter(t){return w(this,null,function*(){let{event:r,params:n,extraParams:i}=t,o={eventType:r,gameInfo:T({gameId:this.gameId,sessionId:this.sessionId},n)};i&&Object.assign(o,i),yield S.platform==="android"?te("/api/base/app-event",{method:"POST",data:o}):ye("trackAppEventAsync",{url:this.taskUrl,body:JSON.stringify(o)})})}reportToNative(t){return w(this,null,function*(){let{event:r,params:n}=t;yield ye("userTrackAsync",{event:r,params:T({},n),gameId:this.gameId})})}tracker(t,r=null){this.track(t,r)}}});var qh={};yp(qh,{nativeTaskEmitter:()=>ni,taskTracker:()=>It,track:()=>M,trackPerformance:()=>Dh});var VT,Rh,Nh,M,Dh,Lh,ni,It,gt=k(()=>{"use strict";wh();N();oc();Th();H();Oh();_e();VT=(e,t,r)=>{var s,l,c,d,u,f;let n=t,i=Tr(n.extra)?n.extra:Xn(n.extra)?JSON.parse(n.extra):{},o=B(T({},i),{mp_id:(s=n.mp_id)!=null?s:"",mp_version:(l=n.mp_version)!=null?l:"",session_id:S.sessionId,user_id:(d=(c=S.hostUserInfo)==null?void 0:c.uid)!=null?d:""}),a=(u=n.eventType)!=null?u:J.Other;j("trackAsync",{event:(f=t.tag)!=null?f:e,data:o,webviewId:r,eventType:a})},{track:M,trackPerformance:Dh}=xh(VT,{type:Kl.AppSDK,platform:"native",jssdk_version:(Nh=(Rh=S.sdkInfo)==null?void 0:Rh.jssdkVersion)!=null?Nh:"1.0.0",mp_id:S.mpId,mp_version:S.mpVersion}),Lh=X();Lh.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Dh(e,t,r)});Lh.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{M(e,t)});ni=new Ot,It=new Fo(M,ni)});function Fh(){let e=null,t=null,r=window.fetch,n=()=>{t=document.createElement("meta"),t.setAttribute("name","viewport"),t.setAttribute("content","viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"),t.setAttribute("data-jolibox-sdk","viewport-meta"),e=document.createElement("style"),e.setAttribute("data-jolibox-sdk","default-styles");let s=`
|
|
2
2
|
html[data-jolibox-root] {
|
|
3
3
|
height: 100%;
|
|
4
4
|
margin: 0;
|
package/implement.build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Invoking: npm run clean && npm run build:esm && tsc
|
|
2
2
|
|
|
3
|
-
> @jolibox/implement@1.1.
|
|
3
|
+
> @jolibox/implement@1.1.55 clean
|
|
4
4
|
> rimraf ./dist
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
> @jolibox/implement@1.1.
|
|
7
|
+
> @jolibox/implement@1.1.55 build:esm
|
|
8
8
|
> BUILD_VERSION=$(node -p "require('./package.json').version") node esbuild.config.js --format=esm
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jolibox/implement",
|
|
3
3
|
"description": "This project is Jolibox JS-SDk implement for Native && H5",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.55",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@jolibox/common": "1.1.
|
|
10
|
-
"@jolibox/types": "1.1.
|
|
11
|
-
"@jolibox/native-bridge": "1.1.
|
|
12
|
-
"@jolibox/ads": "1.1.
|
|
9
|
+
"@jolibox/common": "1.1.55",
|
|
10
|
+
"@jolibox/types": "1.1.55",
|
|
11
|
+
"@jolibox/native-bridge": "1.1.55",
|
|
12
|
+
"@jolibox/ads": "1.1.55",
|
|
13
13
|
"localforage": "1.10.0",
|
|
14
14
|
"@jolibox/ui": "1.0.0",
|
|
15
15
|
"web-vitals": "4.2.4"
|