@jolibox/implement 1.1.18 → 1.1.19-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/package-deps_build.json +23 -16
- package/.rush/temp/shrinkwrap-deps.json +1 -1
- package/dist/common/rewards/index.d.ts +1 -10
- package/dist/common/rewards/registers/use-ads.d.ts +3 -2
- package/dist/common/rewards/registers/use-jolicoin-only.d.ts +10 -0
- package/dist/common/rewards/registers/utils/coins/index.d.ts +32 -0
- package/dist/common/rewards/registers/utils/event-listener.d.ts +15 -0
- package/dist/common/rewards/registers/utils/index.d.ts +1 -0
- package/dist/common/rewards/reward-emitter.d.ts +58 -0
- package/dist/common/rewards/reward-helper.d.ts +2 -1
- package/dist/common/utils/index.d.ts +49 -2
- package/dist/h5/api/ads.d.ts +1 -1
- package/dist/h5/http/index.d.ts +1 -1
- package/dist/h5/rewards/index.d.ts +4 -0
- package/dist/index.js +197 -3
- package/dist/index.native.js +402 -21
- package/dist/native/api/ads.d.ts +1 -1
- package/dist/native/api/login.d.ts +4 -1
- package/dist/native/rewards/index.d.ts +4 -0
- package/dist/native/ui/modal-iframe.d.ts +26 -0
- package/implement.build.log +2 -2
- package/package.json +5 -4
- package/src/common/context/index.ts +3 -3
- package/src/common/rewards/fetch-reward.ts +9 -3
- package/src/common/rewards/index.ts +1 -12
- package/src/common/rewards/registers/use-ads.ts +3 -2
- package/src/common/rewards/registers/use-jolicoin-only.ts +57 -0
- package/src/common/rewards/registers/use-jolicoin.ts +27 -77
- package/src/common/rewards/registers/utils/coins/index.ts +186 -0
- package/src/common/rewards/registers/utils/event-listener.ts +66 -0
- package/src/common/rewards/registers/utils/index.ts +8 -0
- package/src/common/rewards/reward-emitter.ts +79 -0
- package/src/common/rewards/reward-helper.ts +3 -2
- package/src/common/utils/index.ts +117 -4
- package/src/h5/api/ads.ts +65 -12
- package/src/h5/http/index.ts +2 -2
- package/src/h5/rewards/index.ts +69 -0
- package/src/native/api/ads.ts +95 -33
- package/src/native/api/login.ts +1 -1
- package/src/native/api/navigate.ts +13 -1
- package/src/native/bootstrap/index.ts +25 -1
- package/src/native/rewards/index.ts +138 -0
- package/src/native/ui/modal-iframe.ts +271 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,200 @@
|
|
|
1
|
-
var Li=Object.create;var Qt=Object.defineProperty,Ni=Object.defineProperties,Ui=Object.getOwnPropertyDescriptor,Fi=Object.getOwnPropertyDescriptors,Bi=Object.getOwnPropertyNames,Xe=Object.getOwnPropertySymbols,Mi=Object.getPrototypeOf,Xt=Object.prototype.hasOwnProperty,fn=Object.prototype.propertyIsEnumerable;var dn=(e,t,r)=>t in e?Qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,V=(e,t)=>{for(var r in t||(t={}))Xt.call(t,r)&&dn(e,r,t[r]);if(Xe)for(var r of Xe(t))fn.call(t,r)&&dn(e,r,t[r]);return e},z=(e,t)=>Ni(e,Fi(t));var Me=(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 mn=(e,t)=>{var r={};for(var n in e)Xt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Xe)for(var n of Xe(e))t.indexOf(n)<0&&fn.call(e,n)&&(r[n]=e[n]);return r};var J=(e,t)=>()=>(e&&(t=e(e=0)),t);var pn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ji=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Bi(t))!Xt.call(e,i)&&i!==r&&Qt(e,i,{get:()=>t[i],enumerable:!(n=Ui(t,i))||n.enumerable});return e};var hn=(e,t,r)=>(r=e!=null?Li(Mi(e)):{},ji(t||!e||!e.__esModule?Qt(r,"default",{value:e,enumerable:!0}):r,e));var D=(e,t,r)=>new Promise((n,i)=>{var c=p=>{try{m(r.next(p))}catch(b){i(b)}},d=p=>{try{m(r.throw(p))}catch(b){i(b)}},m=p=>p.done?n(p.value):Promise.resolve(p.value).then(c,d);m((r=r.apply(e,t)).next())});function zi(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function ar(e){return typeof e=="string"}function En(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function In(e){return typeof e=="object"&&Array.isArray(e)}function Yi(e){return typeof e=="undefined"}function Qi(e){return Yi(e)||e===null}function Xi(e){return typeof e=="function"}function Tn(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Sn(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,c){for(let d in c)if(Object.prototype.hasOwnProperty.call(c,d)){let m=i[d],p=c[d],b=r(m,p,d,i,c);b!==void 0?i[d]=b:yn(p)&&yn(m)?i[d]=n(_n({},m),p):Array.isArray(p)&&Array.isArray(m)?i[d]=[...m,...p]:i[d]=p}return i}return n(e,t)}function yn(e){return e&&typeof e=="object"&&e.constructor===Object}function Rn(e,t){if(Array.isArray(e))return e.concat(t)}function He(e,t,r={}){let n=null,i,c,d,{leading:m=!1,trailing:p=!0}=r,b=()=>(d=e.apply(c,i),i=void 0,c=void 0,d),v=function(...T){i=T,c=this;let g=m&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,p&&!g&&b()},t),g)return b()};return v.cancel=()=>{n&&clearTimeout(n),n=null,i=c=void 0},v.flush=()=>{if(n)return clearTimeout(n),n=null,b()},v}function ta(e,t){return(...r)=>t(e,...r)}function Pn(e){return t=>ta(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new ea(`${i}`))}})}function je(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function et(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,c)=>(i[c]=String(n[c]),i),{})}return e[r]})}function aa(e){let t=e.location?et(e.location,bn):null,r=e.target?et(e.target,bn):null;return et(Gi(_n({},e),{location:t,target:r}),oa)}function dr(e){let t=e.events.map(n=>aa(n)),r=et(e.device,ia);return[e.protocolVersion,t,r,e.project]}function mr(){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 va(e){return new Promise(t=>Ln(e)(t))}function Ln(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function ya(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(c.fire,c)}},c=new Ve(i);return c.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function _a(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)wa(e[n],t[n])}function wa(e,t){if(ar(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Xi(t)){try{if(e instanceof t)return}catch(r){}if(!Qi(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 Ea(){return typeof globalThis!="undefined"?globalThis[Nn]:void 0}function Ia(e){typeof globalThis!="undefined"&&(globalThis[Nn]=e)}function ie(){let e=Ea();if(e)return e;let t=new tt,r=new or,n={registerCommand(i,c,d){t.registerCommand({id:i,handler:c,metadata:d})},executeCommand(i,...c){return r.executeCommand(i,...c)},excuteCommandSync(i,...c){return r.executeCommandThowErr(i,...c)}};return Ia(n),n}var ir,$i,Vi,Hi,gn,Ji,Ki,vn,_n,Gi,qi,wn,Wi,Zi,sr,cr,An,xn,ea,kn,Cn,rt,lr,se,er,ra,ur,Je,xe,na,bn,oa,ia,fr,sa,Ze,ca,la,ua,On,pr,da,fa,ma,Dn,tr,K,pa,ha,$e,Ve,de,nr,ga,Zt,ba,Ke,tt,or,Nn,j=J(()=>{"use strict";ir=Object.defineProperty,$i=Object.defineProperties,Vi=Object.getOwnPropertyDescriptor,Hi=Object.getOwnPropertyDescriptors,gn=Object.getOwnPropertySymbols,Ji=Object.prototype.hasOwnProperty,Ki=Object.prototype.propertyIsEnumerable,vn=(e,t,r)=>t in e?ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_n=(e,t)=>{for(var r in t||(t={}))Ji.call(t,r)&&vn(e,r,t[r]);if(gn)for(var r of gn(t))Ki.call(t,r)&&vn(e,r,t[r]);return e},Gi=(e,t)=>$i(e,Hi(t)),qi=(e,t)=>{for(var r in t)ir(e,r,{get:t[r],enumerable:!0})},wn=(e,t,r,n)=>{for(var i=n>1?void 0:n?Vi(t,r):t,c=e.length-1,d;c>=0;c--)(d=e[c])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ir(t,r,i),i},Wi=(e,t,r)=>new Promise((n,i)=>{var c=p=>{try{m(r.next(p))}catch(b){i(b)}},d=p=>{try{m(r.throw(p))}catch(b){i(b)}},m=p=>p.done?n(p.value):Promise.resolve(p.value).then(c,d);m((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}Zi=(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))(Zi||{}),sr=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}},cr=class extends sr{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},An=class extends sr{constructor(){super(...arguments),this.kind="USER_ERROR"}},xn=class extends An{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},ea=class extends An{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))}},kn=class extends cr{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},Cn=class extends cr{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},rt=class extends sr{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}}},lr=class extends cr{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};se={log:je("log"),warn:je("warn"),info:je("info"),error:je("error"),debug:je("debug")};Object.assign(globalThis,{logger:se});er=Symbol.for("Jolibox.canIUseMap"),ra={};globalThis[er]||(globalThis[er]=ra);ur={get config(){return globalThis[er]}},Je=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Je||{}),xe=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(xe||{}),na=(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))(na||{}),bn=["name","params"],oa=["name","type","location","target","extra","timestamp","userId"],ia=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];fr=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});mr();sa=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Ze={isiOS:navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),iosVersion:()=>{let e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||"0",10)]},isAndroid:navigator.userAgent.includes("Android"),isMac:navigator.userAgent.includes("Mac"),isFacebook:navigator.userAgent.includes("FB_IAB"),isPC:!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},ca=()=>Ze.isiOS?"iOS":Ze.isAndroid?"Android":Ze.isMac?"Mac":Ze.isFacebook?"Facebook":"PC",la="device_id",ua="advertising_id",On=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,fr()),window.__joliboxLocalStorage__.getItem(e)),pr=()=>new URLSearchParams(window.location.search).get("deviceId")||On(la),da=()=>On(ua),fa=e=>e.charAt(0).toUpperCase()+e.slice(1),ma=()=>{var e;let t=new URLSearchParams(window.location.search);return fa((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},Dn=e=>{if(sa())return window.navigator.userAgent;let t="JoliboxWebSDK",r=ca(),n=navigator.language,i=pr(),c=da();return`${t} (${ma()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${c} version/${e||""}`},tr=class rr{constructor(t){this.element=t,this.next=rr.Undefined,this.prev=rr.Undefined}};tr.Undefined=new tr(void 0);K=tr,pa=class{constructor(){this._first=K.Undefined,this._last=K.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===K.Undefined}clear(){let e=this._first;for(;e!==K.Undefined;){let t=e.next;e.prev=K.Undefined,e.next=K.Undefined,e=t}this._first=K.Undefined,this._last=K.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new K(e);if(this._first===K.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!==K.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==K.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==K.Undefined&&e.next!==K.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===K.Undefined&&e.next===K.Undefined?(this._first=K.Undefined,this._last=K.Undefined):e.next===K.Undefined?(this._last=this._last.prev,this._last.next=K.Undefined):e.prev===K.Undefined&&(this._first=this._first.next,this._first.prev=K.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==K.Undefined;)yield e.element,e=e.next}},ha=0,$e=class{constructor(e){this.value=e,this.id=ha++}},Ve=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 $e&&(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,c,d,m,p;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let b=new $e(t);return this._listeners?this._listeners instanceof $e?this._listeners=[this._listeners,b]:this._listeners.push(b):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=b,(d=(c=this.options)==null?void 0:c.onDidFirstListener)==null||d.call(c,this)),(p=(m=this.options)==null?void 0:m.onDidAddListener)==null||p.call(m,this),this._size++,()=>{var v,T,g,E;if(!this._disposed){if(this._listeners instanceof $e)this._listeners.id===b.id&&(this._listeners=void 0,this._size=0,(T=(v=this.options)==null?void 0:v.onDidRemoveLastListener)==null||T.call(v));else if(this._listeners){let P=this._listeners.indexOf(b);P>=0&&(this._listeners.splice(P,1),this._size--,this._size===0&&((E=(g=this.options)==null?void 0:g.onDidRemoveLastListener)==null||E.call(g)))}}}}),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 $e?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},de=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){var r;let n=(r=this.listeners.get(e))!=null?r:new Ve,i=m=>t(...m.args),c=n.event(i);this.listerHandlerMap.set(t,{handler:i,dispose:c}),this.listeners.set(e,n);let d=this.cachedEventQueue.get(e);if(d)for(let m of d)t(...m.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 pa,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}},nr={};qi(nr,{None:()=>ga,filter:()=>ya,once:()=>Ln,toPromise:()=>va});ga=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Zt=Symbol.for("Jolibox.hostEmitter"),ba=()=>{let e=new de;return globalThis[Zt]||(globalThis[Zt]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e)}),globalThis[Zt]},Ke=ba();tt=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Ve,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 _a(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}};tt=wn([Tn],tt);or=class{constructor(){this._onWillExecuteCommand=new Ve,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Ve,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new tt,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=zi(3e4)),this._starActivation}executeCommand(e,...t){return Wi(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),nr.toPromise(nr.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}}};or=wn([Tn],or);Nn=Symbol.for("Jolibox.commands")});function ce(e,t={}){hr.emit("ERROR_REPORT",{error:e,options:t})}var hr,we,_e=J(()=>{"use strict";j();j();hr=new de,we=new de;ce.debounce=He(ce,50,{leading:!0})});var gr,Ta,Un,Fn,Bn=J(()=>{"use strict";j();_e();gr=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{}}},Ta=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},Un=e=>{var t;try{let i=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(i!=null&&i.length){let[c,d,m]=i;return{headerJson:gr(c),payloadJson:gr(d),signature:gr(m)}}else throw"joli_source is missing"}catch(r){return ce(new kn(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},Fn=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=Ta(e),c=r[2];return`${n}.${i}.${c}`}return t}});var Sa,nt,Mn,vr=J(()=>{"use strict";j();Sa="1.1.18",nt=()=>Sa,Mn=()=>{let e=nt();return`${Dn(e)}`}});var Ra,jn,yr,$n,X,Aa,A,Z=J(()=>{"use strict";j();Bn();vr();j();Ra={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:pr(),pixelRatio:window.devicePixelRatio||1,platform:"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:nt()},schema:window.location.href,platform:"h5"},yr=(jn=globalThis.joliboxJSCore)==null?void 0:jn.env,X=Object.assign({},($n=yr==null?void 0:yr())!=null?$n:Ra),Aa=()=>{var g,E,P,N,O,L,H,F,ee,ue,S;let{payloadJson:e,headerJson:t,signature:r}=X.schema.length?Un(X.schema):{},n=`${X.deviceInfo.did}-${new Date().getTime()}`,c=new URL(X.schema.length?X.schema:window.location.href).searchParams,d=(P=(E=(g=c.get("mpId"))!=null?g:c.get("appId"))!=null?E:c.get("gameId"))!=null?P:"",m=(L=(O=(N=X.clientSessionId)!=null?N:e==null?void 0:e.sessionId)!=null?O:c.get("sessionId"))!=null?L:n,p=!!((F=(H=e==null?void 0:e.testAdsMode)!=null?H:e==null?void 0:e.__testAdsMode)!=null?F:c.get("testAdsMode")==="true"),b=(S=(ue=(ee=e==null?void 0:e.joliboxEnv)!=null?ee:e==null?void 0:e.__joliboxEnv)!=null?ue:c.get("joliboxEnv"))!=null?S:"production",v=b==="staging",T=t==null?void 0:t.channel;return{get testMode(){return v},get testAdsMode(){return p},get joliboxEnv(){return b},get joliSource(){var x;return(x=c.get("joliSource"))!=null?x:null},get mpId(){var x;return(x=d!=null?d:e==null?void 0:e.id)!=null?x:""},get mpVersion(){var x;return(x=t==null?void 0:t.ver)!=null?x:nt()},get mpType(){var x,C;return(C=(x=t==null?void 0:t.__mpType)!=null?x:e==null?void 0:e.__mpType)!=null?C:"game"},get platform(){var x;return((x=X.platform)!=null?x:X.deviceInfo.platform).toLowerCase()},get deviceInfo(){return X.deviceInfo},get sdkInfo(){return X.sdkInfo},get hostInfo(){return X.hostInfo},get hostUserInfo(){return X.hostUserInfo},get sessionId(){var x,C;return(C=(x=X.clientSessionId)!=null?x:m)!=null?C:n},get channel(){return T},get webviewId(){var x;return(x=X.webviewId)!=null?x:-1},get shouldInterupt(){return e==null?void 0:e.__shouldInterupt},get from(){return e==null?void 0:e.__from},get baseApiHost(){return v?"https://stg-api.jolibox.com":"https://api.jolibox.com"},onEnvConfigChanged:x=>{Sn(X,x,Rn)},encodeJoliSourceQuery:x=>{var C,B;return t&&r?Fn(V(V({},e),x),(C=c.get("joliSource"))!=null?C:""):(B=c.get("joliSource"))!=null?B:""}}},A=Aa()});var br,Hn,xa,ka,Vn,Ca,Jn=J(()=>{"use strict";j();_e();Z();j();br=!1,Hn=(e,t)=>e==null?!1:t in e,xa=e=>Hn(e,"kind"),ka=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},Vn=(e,t={},r)=>{var c,d,m;let n={user_id:(d=(c=A.hostUserInfo)==null?void 0:c.uid)!=null?d:"",device_id:(m=A.deviceInfo.did)!=null?m:"",timestamp:Date.now(),tag:ka(e.name)},i=z(V({},n),{env:t.environment,isFromUser:r});r?we.emit("GLOBAL_USER_ERROR",e,i):we.emit("GLOBAL_ERROR",e,i)},Ca=e=>Hn(e,"kind")&&e.kind==="USER_ERROR";hr.on("ERROR_REPORT",({error:e,options:t})=>{if(br)return;br=!0;let r=xa(e)&&e.raw?e.raw:e;try{let n=Ca(e);Vn(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),c=new lr(`${i}, origin error: ${r.message}`);se.error(c),Vn(new lr(c.message),{environment:t.environment},!1)}finally{br=!1}})});var _r,wr=J(()=>{"use strict";_e();j();_e();_r=e=>new xn(e)});function Kn(e,t){let r=(n,i,c)=>{let d=z(V({tag:n},t),{extra:V({},i)});n=="globalJsError"?ce(new Cn(JSON.stringify(d))):e("systemLog",d,c)};return r.debounce=He(r,500,{leading:!0}),r}function Gn(e){let t=(r,n,i)=>{var m;let c=(m=i&&JSON.stringify(i))!=null?m:0,d={speed_value_type:r,total_duration:n};c&&Object.assign(d,{extra:c}),e("joliboxSpeedAnalysis",d)};return t.debounce=He(t,500,{leading:!0}),t}var qn=J(()=>{"use strict";j();j();_e()});function Wn(e,t){let r=Kn(e,t),n=Gn(r);return{track:r,trackPerformance:n}}var zn=J(()=>{"use strict";qn()});var Er=J(()=>{"use strict"});var ot,Yn=J(()=>{"use strict";Z();j();j();ot=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return D(this,null,function*(){let r=`${A.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"}/api/fe-configs/js-sdk/samples-config`,n=yield(yield fetch(r)).json();this.samplesConfig=n})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:r}=this.samplesConfig;for(let[n,i]of Object.entries(r))if(i.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,i,c,d,m;let{nativeSDKVersion:t,jssdkVersion:r}=A.sdkInfo;return{platform:1e3,os:A.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(c=(i=A.hostInfo)==null?void 0:i.aid)!=null?c:"1",model:(d=A.deviceInfo.model)!=null?d:"UnknownModel",brand:(m=A.deviceInfo.brand)!=null?m:"UnknownBrand",uuid:A.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 D(this,null,function*(){if(this.checkIsSampled(t))return;let i=t.location?t.location:yield this.getLocation(),c=t.target||null,d=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let m=this.deviceInfo,b={protocolVersion:"1.0.0",events:[z(V({},t),{location:i,target:c,extra:d,timestamp:Date.now(),userId:null})],device:m,project:r};try{n?yield this.doReport(dr(b),n):yield this.doReport(dr(b))}catch(v){se.log("[Jolibox SDK] report API error",v)}})}}});var Ir=J(()=>{"use strict";zn();Er();Yn()});var Tr,Qn,he,it,ge,Ge=J(()=>{"use strict";vr();Z();Tr=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(Qn=AbortSignal.timeout)!=null||(AbortSignal.timeout=Tr);he=class e{constructor(){this.httpClients=new WeakSet;this.networkRequests=[];this.maxRequestsToTrack=20}static getInstance(){return e._instance||(e._instance=new e),e._instance}create(t){let r=new it(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}getNetworkStatus(){return this.networkRequests.length===0?!0:this.networkRequests.filter(n=>n).length/this.networkRequests.length>=.6}},it=class{constructor(t){this.xua=Mn();this.getJoliSource=()=>A.joliSource;var n;let r=A.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com";this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return D(this,null,function*(){try{let{query:n,timeout:i}=r!=null?r:{},{headers:c}=r!=null?r:{},d=n?new URLSearchParams(n):null,m=d==null?void 0:d.toString(),p=`${this.baseUrl}${t}${m?`?${m}`:""}`,b=this.xua,v=this.getJoliSource();c=Object.assign({},c!=null?c:{},b?{"x-user-agent":b}:{},v?{"x-joli-source":v}:{});let T=yield fetch(p,{method:"GET",headers:c,credentials:"include",signal:Tr(i!=null?i:3e4)});return he.getInstance().recordNetworkRequest(!0),yield T.json()}catch(n){throw he.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return D(this,null,function*(){try{let{data:n,query:i,timeout:c}=r!=null?r:{},{headers:d}=r!=null?r:{},m=i?new URLSearchParams(i):null,p=m==null?void 0:m.toString(),b=`${this.baseUrl}${t}${p?`?${p}`:""}`,v=this.xua,T=this.getJoliSource();d=Object.assign({},d!=null?d:{},{"Content-Type":"application/json"},v?{"x-user-agent":v}:{},T?{"x-joli-source":T}:{});let g=yield fetch(b,{method:"POST",headers:d,body:JSON.stringify(n),signal:Tr(c!=null?c:3e4),credentials:"include"});he.getInstance().recordNetworkRequest(!0);let E=g.headers.get("content-type");if(E!=null&&E.includes("application/octet-stream"))try{return g.blob()}catch(P){return yield g.arrayBuffer()}if(E!=null&&E.includes("multipart/form-data")||E!=null&&E.includes("application/x-www-form-urlencoded"))try{return g.formData()}catch(P){return yield g.text()}if(E!=null&&E.includes("application/json"))try{return yield g.json()}catch(P){return yield g.text()}return g}catch(n){throw he.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return D(this,null,function*(){try{let{data:n,query:i,timeout:c}=r!=null?r:{},{headers:d}=r!=null?r:{},m=i?new URLSearchParams(i):null,p=m==null?void 0:m.toString(),b=`${this.baseUrl}${t}${p?`?${p}`:""}`,v=this.xua,T=this.getJoliSource();d=Object.assign({},d!=null?d:{},{"Content-Type":"application/json"},v?{"x-user-agent":v}:{},T?{"x-joli-source":T}:{});let g=yield fetch(b,{method:"PUT",headers:d,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!g.ok)throw he.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${g.status}`);return he.getInstance().recordNetworkRequest(!0),yield g.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=it;ge=he.getInstance()});var Sr,at,Rr=J(()=>{"use strict";Z();Ir();Ge();Sr=class extends ot{constructor(){super(...arguments);this.hostToApiMap={default:{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.jolibox.com":{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.pico-game.com":{test:"https://stg-collect.pico-game.com",prod:"https://collect.pico-game.com"}};this.httpClient=ge.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n,i;let r=(n=this.hostToApiMap[window.location.host])!=null?n:this.hostToApiMap.default;return(i=A.testMode)!=null&&i?r.test:r.prod}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},at=new Sr});var Pa,Xn=J(()=>{"use strict";Jn();j();wr();j();Rr();Z();Pa=(e,t)=>{var i,c,d;let r={message:t.message,stack:(i=t.stack)!=null?i:"",errorType:t.name,source:0},n={name:e,type:Je.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(d=(c=A.hostUserInfo)==null?void 0:c.uid)!=null?d:null};at.trackEvent(n,xe.WebSDK)};we.on("GLOBAL_ERROR",(e,t)=>{Pa(t.tag,e)});we.on("GLOBAL_USER_ERROR",(e,t)=>{se.log("UserError",e,t)})});var st,Zn=J(()=>{"use strict";st=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,c=!1,d=0,m=()=>{if(!c)return;let E=Date.now(),P=E-r;P>=this.interval&&(this.visible&&(d+=P,t(d)),r=E),n=requestAnimationFrame(m)},p=()=>{v(),r=Date.now(),i=window.setInterval(()=>{if(!c)return;let E=Date.now();E-r>=this.interval&&(r=E)},this.interval)},b=()=>{T(),r=Date.now(),n=requestAnimationFrame(m)},v=()=>{n&&(cancelAnimationFrame(n),n=0)},T=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",E=>{c&&(console.log("visible",E),E?b():p())});let g=this.visible;return{start(){c||(c=!0,g?b():p())},stop(){c=!1,v(),T()}}}}});var ct,eo=J(()=>{"use strict";Z();Zn();Ge();ct=class extends st{constructor(r,n,i){super(n,i);this.httpClient=ge.create();this.gameId=A.mpId,this.sessionId=A.sessionId,this.track=r}reporter(r){return D(this,null,function*(){let{event:n,params:i}=r;yield this.httpClient.post("/api/base/app-event",{data:{eventType:n,gameInfo:V({gameId:this.gameId,sessionId:this.sessionId},i)}})})}tracker(r,n=null){this.track(r,n)}}});var to,Oa,fe,Da,Ar,le,Ee=J(()=>{"use strict";Xn();j();j();Ir();Rr();eo();Z();Er();to=ie(),Oa={type:xe.WebSDK,platform:"h5",jssdk_version:A.sdkInfo.jssdkVersion,mp_id:A.mpId,mp_version:A.mpVersion},{track:fe,trackPerformance:Da}=Wn((...e)=>{var d,m,p,b;let[,t]=e,r=t,n=En(r.extra)?r.extra:ar(r.extra)?JSON.parse(r.extra):{},i=z(V({},n),{mp_id:(d=r.mp_id)!=null?d:"",mp_version:(m=r.mp_version)!=null?m:""}),c={name:t.tag,type:Je.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(b=(p=A.hostUserInfo)==null?void 0:p.uid)!=null?b:null};at.trackEvent(c,xe.WebSDK)},Oa);to.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Da(e,t,r)});to.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{fe(e,t)});Ar=new de,le=new ct(fe,Ar)});function ro(e){let t=ur.config[e];return t||(t={},ur.config[e]=t),(r,n)=>{if(t[r]){se.warn(`[can i use] ${r} already registered`);return}t[r]=V({},n)}}var no=J(()=>{"use strict";j()});function xr(e){oo=e}function lt(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>lt(t)):Object.keys(e).reduce((t,r)=>(t[r]=lt(e[r]),t),{})}function ve(e){return typeof e=="number"}function kr(e){let t=Cr(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function Cr(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var oo,W,ut,dt,ft,mt,ke,pt,ht,gt,vt,yt,bt,_t,wt,Et,It,Tt,St,Pr=J(()=>{"use strict";oo=!1;W=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(oo)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 ${kr(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return lt(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:lt(this._default)}optional(){return this._optional=!0,this}};ut=class extends W{validate(t){return this._optional&&t===void 0?!0:ve(t)?ve(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):ve(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):ve(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}},dt=class extends W{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},ft=class extends W{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(ve(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(ve(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}},mt=class extends W{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},ke=class extends W{validate(t){return!0}},pt=class extends W{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},ht=class extends W{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},gt=class extends W{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},vt=class extends W{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 ${kr(t)}`)}return!0}},yt=class extends W{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(ve(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(ve(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(ve(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((c,d)=>{if(n.path=`${this.path}[${d}]`,n.errors=this.errors,c===void 0&&n.hasDefault){r[d]=n.defaultValue;return}n.validate(c)||(n.hasFallback?r[d]=n.fallbackValue:i=!1)}),this._uniqueItems){let c=new Map;for(let d in r)c.has(r[d])?i=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${c.get(r[d])}] and ${this.path}[${d}] are identical)`):c.set(r[d],d)}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}},bt=class extends W{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(Cr(r)!=="object")return this.fail({expect:"object",actual:r});let i=r,c=this._value;c.errors=this.errors;let d=!0;for(let m in i){let p=i[m];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(m)?c.path=`${this.path}.${m}`:c.path=`${this.path}["${m}"]`,!(p===void 0&&c._optional)){if(p===void 0&&c.hasDefault){i[m]=c.defaultValue;continue}c.validate(p)||(c.hasFallback?i[m]=c.fallbackValue:d=!1)}}return d}},_t=class extends W{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(Cr(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,i=!0;for(let c in this._object){let d=n[c],m=this._object[c];if(m.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(c)?m.path=`${this.path}.${c}`:m.path=`${this.path}["${c}"]`,!(m._optional&&d===void 0)){if(d===void 0&&m.hasDefault){n[c]=m.defaultValue;continue}m.validate(d)||(m.hasFallback?n[c]=m.fallbackValue:i=!1)}}return i}},wt=class extends W{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:kr(this.value),actual:r}):!0}},Et=class extends W{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 c=0;c<i;c++){let d=this._items[c];if(d.errors=[],d.path=this.path,!d.validate(t))r.push(d.errors.join("; "));else if(!n){n=!0;break}}if(!n){let c=r.join(`
|
|
2
|
-
or `);this.errors.push(
|
|
3
|
-
`);throw e.errors.length=0,xr(!1),new TypeError(n)}}var k,Dr=J(()=>{"use strict";Pr();Pr();k={object(e){return new _t(e)},array(e){return new yt(e)},tuple(...e){return new It(...e)},literal(e){return new wt(e)},or(...e){return new Et(...e)},symbol(){return new mt},record(e){return new bt(e)},function(){return new gt},boolean(){return new dt},string(){return new ft},number(){return new ut},undefined(){return new pt},null(){return new ht},unknown(){return new ke},any(){return new ke},as(){return new ke},arraybuffer(){return new Tt},enum(...e){return new vt(...e)},typedarray(e){return new St(e)}}});var Rt,io,ao=J(()=>{"use strict";j();_e();Dr();wr();Rt=1,io=e=>{function t(n,i){return(...c)=>{var T,g,E,P;let d=Date.now(),m={method:n,trace_id:Rt};Rt+=1;let p="SUCCESS",b=`${n}:ok`,v=0;try{if(i.paramsSchema)try{Or(i.paramsSchema,c,"params")}catch(H){throw _r(`${n}:fail ${H.message}`)}let N=i.implement(...c),O=N,L=`${n}:ok`;if(N&&"code"in N){let{code:H,data:F,message:ee}=N;p=H,O=F,L=ee}return{code:p,message:L,data:O}}catch(N){let O=N;v=(g=(T=O.code)!=null?T:O.errNo)!=null?g:2e3,p="FAILURE";let L=(P=(E=O.message)!=null?E:O.errMsg)!=null?P:`${N}`;return b=`${n}:${p} ${L.replace(/^\S+:(fail|cancel)\s?/,"")}`,ce(new rt(b,v)),{code:p,message:b}}finally{let N=Date.now()-d;e("apiInvoked",z(V({},m),{duration:N,status:p}))}}}function r(n,i){return(...c)=>D(this,null,function*(){var g,E,P,N;let d=In(c)?c:[c],m=Date.now(),p={method:n,trace_id:Rt};Rt+=1;let b=`${n}:ok`,v="SUCCESS",T={code:v,message:b};try{if(i.paramsSchema)try{Or(i.paramsSchema,d,"params")}catch(H){throw _r(H.message)}let L=yield i.implement(...d);if(L&&"code"in L){let{code:H,data:F,message:ee}=L;v=H,b=ee,L=F}return Object.assign(T,{code:v,message:b,data:L}),T}catch(O){let L=O,H=(E=(g=L.code)!=null?g:L.errNo)!=null?E:2e3;v="FAILURE";let F=(N=(P=L.message)!=null?P:L.errMsg)!=null?N:`${O}`,ee=`${n}:${v} ${F.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(T,{code:v,message:ee}),ce(new rt(ee,H)),T}finally{let O=Date.now()-m;e("apiInvoked",z(V({},p),{duration:O,status:v}))}})}return{createAPI:r,createSyncAPI:t}}});var ae,Ie,Y,qe=J(()=>{"use strict";no();Ee();ao();Dr();({createAPI:ae,createSyncAPI:Ie}=io(fe)),Y=ro("h5")});var uo=pn((lo,Fr)=>{(function(e){if(typeof lo=="object"&&typeof Fr!="undefined")Fr.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,c,d){function m(v,T){if(!c[v]){if(!i[v]){var g=typeof Me=="function"&&Me;if(!T&&g)return g(v,!0);if(p)return p(v,!0);var E=new Error("Cannot find module '"+v+"'");throw E.code="MODULE_NOT_FOUND",E}var P=c[v]={exports:{}};i[v][0].call(P.exports,function(N){var O=i[v][1][N];return m(O||N)},P,P.exports,n,i,c,d)}return c[v].exports}for(var p=typeof Me=="function"&&Me,b=0;b<d.length;b++)m(d[b]);return m}({1:[function(n,i,c){(function(d){"use strict";var m=d.MutationObserver||d.WebKitMutationObserver,p;if(m){var b=0,v=new m(N),T=d.document.createTextNode("");v.observe(T,{characterData:!0}),p=function(){T.data=b=++b%2}}else if(!d.setImmediate&&typeof d.MessageChannel!="undefined"){var g=new d.MessageChannel;g.port1.onmessage=N,p=function(){g.port2.postMessage(0)}}else"document"in d&&"onreadystatechange"in d.document.createElement("script")?p=function(){var L=d.document.createElement("script");L.onreadystatechange=function(){N(),L.onreadystatechange=null,L.parentNode.removeChild(L),L=null},d.document.documentElement.appendChild(L)}:p=function(){setTimeout(N,0)};var E,P=[];function N(){E=!0;for(var L,H,F=P.length;F;){for(H=P,P=[],L=-1;++L<F;)H[L]();F=P.length}E=!1}i.exports=O;function O(L){P.push(L)===1&&!E&&p()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,i,c){"use strict";var d=n(1);function m(){}var p={},b=["REJECTED"],v=["FULFILLED"],T=["PENDING"];i.exports=g;function g(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=T,this.queue=[],this.outcome=void 0,S!==m&&O(this,S)}g.prototype.catch=function(S){return this.then(null,S)},g.prototype.then=function(S,x){if(typeof S!="function"&&this.state===v||typeof x!="function"&&this.state===b)return this;var C=new this.constructor(m);if(this.state!==T){var B=this.state===v?S:x;P(C,B,this.outcome)}else this.queue.push(new E(C,S,x));return C};function E(S,x,C){this.promise=S,typeof x=="function"&&(this.onFulfilled=x,this.callFulfilled=this.otherCallFulfilled),typeof C=="function"&&(this.onRejected=C,this.callRejected=this.otherCallRejected)}E.prototype.callFulfilled=function(S){p.resolve(this.promise,S)},E.prototype.otherCallFulfilled=function(S){P(this.promise,this.onFulfilled,S)},E.prototype.callRejected=function(S){p.reject(this.promise,S)},E.prototype.otherCallRejected=function(S){P(this.promise,this.onRejected,S)};function P(S,x,C){d(function(){var B;try{B=x(C)}catch(Q){return p.reject(S,Q)}B===S?p.reject(S,new TypeError("Cannot resolve promise with itself")):p.resolve(S,B)})}p.resolve=function(S,x){var C=L(N,x);if(C.status==="error")return p.reject(S,C.value);var B=C.value;if(B)O(S,B);else{S.state=v,S.outcome=x;for(var Q=-1,te=S.queue.length;++Q<te;)S.queue[Q].callFulfilled(x)}return S},p.reject=function(S,x){S.state=b,S.outcome=x;for(var C=-1,B=S.queue.length;++C<B;)S.queue[C].callRejected(x);return S};function N(S){var x=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof x=="function")return function(){x.apply(S,arguments)}}function O(S,x){var C=!1;function B(ne){C||(C=!0,p.reject(S,ne))}function Q(ne){C||(C=!0,p.resolve(S,ne))}function te(){x(Q,B)}var re=L(te);re.status==="error"&&B(re.value)}function L(S,x){var C={};try{C.value=S(x),C.status="success"}catch(B){C.status="error",C.value=B}return C}g.resolve=H;function H(S){return S instanceof this?S:p.resolve(new this(m),S)}g.reject=F;function F(S){var x=new this(m);return p.reject(x,S)}g.all=ee;function ee(S){var x=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=S.length,B=!1;if(!C)return this.resolve([]);for(var Q=new Array(C),te=0,re=-1,ne=new this(m);++re<C;)me(S[re],re);return ne;function me(Ue,ze){x.resolve(Ue).then($t,function(Re){B||(B=!0,p.reject(ne,Re))});function $t(Re){Q[ze]=Re,++te===C&&!B&&(B=!0,p.resolve(ne,Q))}}}g.race=ue;function ue(S){var x=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=S.length,B=!1;if(!C)return this.resolve([]);for(var Q=-1,te=new this(m);++Q<C;)re(S[Q]);return te;function re(ne){x.resolve(ne).then(function(me){B||(B=!0,p.resolve(te,me))},function(me){B||(B=!0,p.reject(te,me))})}}},{1:1}],3:[function(n,i,c){(function(d){"use strict";typeof d.Promise!="function"&&(d.Promise=n(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(n,i,c){"use strict";var d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function m(o,s){if(!(o instanceof s))throw new TypeError("Cannot call a class as a function")}function p(){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(o){return}}var b=p();function v(){try{if(!b||!b.open)return!1;var o=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),s=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!o||s)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(a){return!1}}function T(o,s){o=o||[],s=s||{};try{return new Blob(o,s)}catch(l){if(l.name!=="TypeError")throw l;for(var a=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,u=new a,f=0;f<o.length;f+=1)u.append(o[f]);return u.getBlob(s.type)}}typeof Promise=="undefined"&&n(3);var g=Promise;function E(o,s){s&&o.then(function(a){s(null,a)},function(a){s(a)})}function P(o,s,a){typeof s=="function"&&o.then(s),typeof a=="function"&&o.catch(a)}function N(o){return typeof o!="string"&&(console.warn(o+" used as a key, but it is not a string."),o=String(o)),o}function O(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var L="local-forage-detect-blob-support",H=void 0,F={},ee=Object.prototype.toString,ue="readonly",S="readwrite";function x(o){for(var s=o.length,a=new ArrayBuffer(s),u=new Uint8Array(a),f=0;f<s;f++)u[f]=o.charCodeAt(f);return a}function C(o){return new g(function(s){var a=o.transaction(L,S),u=T([""]);a.objectStore(L).put(u,"key"),a.onabort=function(f){f.preventDefault(),f.stopPropagation(),s(!1)},a.oncomplete=function(){var f=navigator.userAgent.match(/Chrome\/(\d+)/),l=navigator.userAgent.match(/Edge\//);s(l||!f||parseInt(f[1],10)>=43)}}).catch(function(){return!1})}function B(o){return typeof H=="boolean"?g.resolve(H):C(o).then(function(s){return H=s,H})}function Q(o){var s=F[o.name],a={};a.promise=new g(function(u,f){a.resolve=u,a.reject=f}),s.deferredOperations.push(a),s.dbReady?s.dbReady=s.dbReady.then(function(){return a.promise}):s.dbReady=a.promise}function te(o){var s=F[o.name],a=s.deferredOperations.pop();if(a)return a.resolve(),a.promise}function re(o,s){var a=F[o.name],u=a.deferredOperations.pop();if(u)return u.reject(s),u.promise}function ne(o,s){return new g(function(a,u){if(F[o.name]=F[o.name]||Jr(),o.db)if(s)Q(o),o.db.close();else return a(o.db);var f=[o.name];s&&f.push(o.version);var l=b.open.apply(b,f);s&&(l.onupgradeneeded=function(h){var y=l.result;try{y.createObjectStore(o.storeName),h.oldVersion<=1&&y.createObjectStore(L)}catch(_){if(_.name==="ConstraintError")console.warn('The database "'+o.name+'" has been upgraded from version '+h.oldVersion+" to version "+h.newVersion+', but the storage "'+o.storeName+'" already exists.');else throw _}}),l.onerror=function(h){h.preventDefault(),u(l.error)},l.onsuccess=function(){var h=l.result;h.onversionchange=function(y){y.target.close()},a(h),te(o)}})}function me(o){return ne(o,!1)}function Ue(o){return ne(o,!0)}function ze(o,s){if(!o.db)return!0;var a=!o.db.objectStoreNames.contains(o.storeName),u=o.version<o.db.version,f=o.version>o.db.version;if(u&&(o.version!==s&&console.warn('The database "'+o.name+`" can't be downgraded from version `+o.db.version+" to version "+o.version+"."),o.version=o.db.version),f||a){if(a){var l=o.db.version+1;l>o.version&&(o.version=l)}return!0}return!1}function $t(o){return new g(function(s,a){var u=new FileReader;u.onerror=a,u.onloadend=function(f){var l=btoa(f.target.result||"");s({__local_forage_encoded_blob:!0,data:l,type:o.type})},u.readAsBinaryString(o)})}function Re(o){var s=x(atob(o.data));return T([s],{type:o.type})}function Hr(o){return o&&o.__local_forage_encoded_blob}function No(o){var s=this,a=s._initReady().then(function(){var u=F[s._dbInfo.name];if(u&&u.dbReady)return u.dbReady});return P(a,o,o),a}function Uo(o){Q(o);for(var s=F[o.name],a=s.forages,u=0;u<a.length;u++){var f=a[u];f._dbInfo.db&&(f._dbInfo.db.close(),f._dbInfo.db=null)}return o.db=null,me(o).then(function(l){return o.db=l,ze(o)?Ue(o):l}).then(function(l){o.db=s.db=l;for(var h=0;h<a.length;h++)a[h]._dbInfo.db=l}).catch(function(l){throw re(o,l),l})}function pe(o,s,a,u){u===void 0&&(u=1);try{var f=o.db.transaction(o.storeName,s);a(null,f)}catch(l){if(u>0&&(!o.db||l.name==="InvalidStateError"||l.name==="NotFoundError"))return g.resolve().then(function(){if(!o.db||l.name==="NotFoundError"&&!o.db.objectStoreNames.contains(o.storeName)&&o.version<=o.db.version)return o.db&&(o.version=o.db.version+1),Ue(o)}).then(function(){return Uo(o).then(function(){pe(o,s,a,u-1)})}).catch(a);a(l)}}function Jr(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Fo(o){var s=this,a={db:null};if(o)for(var u in o)a[u]=o[u];var f=F[a.name];f||(f=Jr(),F[a.name]=f),f.forages.push(s),s._initReady||(s._initReady=s.ready,s.ready=No);var l=[];function h(){return g.resolve()}for(var y=0;y<f.forages.length;y++){var _=f.forages[y];_!==s&&l.push(_._initReady().catch(h))}var w=f.forages.slice(0);return g.all(l).then(function(){return a.db=f.db,me(a)}).then(function(I){return a.db=I,ze(a,s._defaultConfig.version)?Ue(a):I}).then(function(I){a.db=f.db=I,s._dbInfo=a;for(var R=0;R<w.length;R++){var U=w[R];U!==s&&(U._dbInfo.db=a.db,U._dbInfo.version=a.version)}})}function Bo(o,s){var a=this;o=N(o);var u=new g(function(f,l){a.ready().then(function(){pe(a._dbInfo,ue,function(h,y){if(h)return l(h);try{var _=y.objectStore(a._dbInfo.storeName),w=_.get(o);w.onsuccess=function(){var I=w.result;I===void 0&&(I=null),Hr(I)&&(I=Re(I)),f(I)},w.onerror=function(){l(w.error)}}catch(I){l(I)}})}).catch(l)});return E(u,s),u}function Mo(o,s){var a=this,u=new g(function(f,l){a.ready().then(function(){pe(a._dbInfo,ue,function(h,y){if(h)return l(h);try{var _=y.objectStore(a._dbInfo.storeName),w=_.openCursor(),I=1;w.onsuccess=function(){var R=w.result;if(R){var U=R.value;Hr(U)&&(U=Re(U));var M=o(U,R.key,I++);M!==void 0?f(M):R.continue()}else f()},w.onerror=function(){l(w.error)}}catch(R){l(R)}})}).catch(l)});return E(u,s),u}function jo(o,s,a){var u=this;o=N(o);var f=new g(function(l,h){var y;u.ready().then(function(){return y=u._dbInfo,ee.call(s)==="[object Blob]"?B(y.db).then(function(_){return _?s:$t(s)}):s}).then(function(_){pe(u._dbInfo,S,function(w,I){if(w)return h(w);try{var R=I.objectStore(u._dbInfo.storeName);_===null&&(_=void 0);var U=R.put(_,o);I.oncomplete=function(){_===void 0&&(_=null),l(_)},I.onabort=I.onerror=function(){var M=U.error?U.error:U.transaction.error;h(M)}}catch(M){h(M)}})}).catch(h)});return E(f,a),f}function $o(o,s){var a=this;o=N(o);var u=new g(function(f,l){a.ready().then(function(){pe(a._dbInfo,S,function(h,y){if(h)return l(h);try{var _=y.objectStore(a._dbInfo.storeName),w=_.delete(o);y.oncomplete=function(){f()},y.onerror=function(){l(w.error)},y.onabort=function(){var I=w.error?w.error:w.transaction.error;l(I)}}catch(I){l(I)}})}).catch(l)});return E(u,s),u}function Vo(o){var s=this,a=new g(function(u,f){s.ready().then(function(){pe(s._dbInfo,S,function(l,h){if(l)return f(l);try{var y=h.objectStore(s._dbInfo.storeName),_=y.clear();h.oncomplete=function(){u()},h.onabort=h.onerror=function(){var w=_.error?_.error:_.transaction.error;f(w)}}catch(w){f(w)}})}).catch(f)});return E(a,o),a}function Ho(o){var s=this,a=new g(function(u,f){s.ready().then(function(){pe(s._dbInfo,ue,function(l,h){if(l)return f(l);try{var y=h.objectStore(s._dbInfo.storeName),_=y.count();_.onsuccess=function(){u(_.result)},_.onerror=function(){f(_.error)}}catch(w){f(w)}})}).catch(f)});return E(a,o),a}function Jo(o,s){var a=this,u=new g(function(f,l){if(o<0){f(null);return}a.ready().then(function(){pe(a._dbInfo,ue,function(h,y){if(h)return l(h);try{var _=y.objectStore(a._dbInfo.storeName),w=!1,I=_.openKeyCursor();I.onsuccess=function(){var R=I.result;if(!R){f(null);return}o===0||w?f(R.key):(w=!0,R.advance(o))},I.onerror=function(){l(I.error)}}catch(R){l(R)}})}).catch(l)});return E(u,s),u}function Ko(o){var s=this,a=new g(function(u,f){s.ready().then(function(){pe(s._dbInfo,ue,function(l,h){if(l)return f(l);try{var y=h.objectStore(s._dbInfo.storeName),_=y.openKeyCursor(),w=[];_.onsuccess=function(){var I=_.result;if(!I){u(w);return}w.push(I.key),I.continue()},_.onerror=function(){f(_.error)}}catch(I){f(I)}})}).catch(f)});return E(a,o),a}function Go(o,s){s=O.apply(this,arguments);var a=this.config();o=typeof o!="function"&&o||{},o.name||(o.name=o.name||a.name,o.storeName=o.storeName||a.storeName);var u=this,f;if(!o.name)f=g.reject("Invalid arguments");else{var l=o.name===a.name&&u._dbInfo.db,h=l?g.resolve(u._dbInfo.db):me(o).then(function(y){var _=F[o.name],w=_.forages;_.db=y;for(var I=0;I<w.length;I++)w[I]._dbInfo.db=y;return y});o.storeName?f=h.then(function(y){if(y.objectStoreNames.contains(o.storeName)){var _=y.version+1;Q(o);var w=F[o.name],I=w.forages;y.close();for(var R=0;R<I.length;R++){var U=I[R];U._dbInfo.db=null,U._dbInfo.version=_}var M=new g(function($,q){var G=b.open(o.name,_);G.onerror=function(oe){var Be=G.result;Be.close(),q(oe)},G.onupgradeneeded=function(){var oe=G.result;oe.deleteObjectStore(o.storeName)},G.onsuccess=function(){var oe=G.result;oe.close(),$(oe)}});return M.then(function($){w.db=$;for(var q=0;q<I.length;q++){var G=I[q];G._dbInfo.db=$,te(G._dbInfo)}}).catch(function($){throw(re(o,$)||g.resolve()).catch(function(){}),$})}}):f=h.then(function(y){Q(o);var _=F[o.name],w=_.forages;y.close();for(var I=0;I<w.length;I++){var R=w[I];R._dbInfo.db=null}var U=new g(function(M,$){var q=b.deleteDatabase(o.name);q.onerror=function(){var G=q.result;G&&G.close(),$(q.error)},q.onblocked=function(){console.warn('dropInstance blocked for database "'+o.name+'" until all open connections are closed')},q.onsuccess=function(){var G=q.result;G&&G.close(),M(G)}});return U.then(function(M){_.db=M;for(var $=0;$<w.length;$++){var q=w[$];te(q._dbInfo)}}).catch(function(M){throw(re(o,M)||g.resolve()).catch(function(){}),M})})}return E(f,s),f}var qo={_driver:"asyncStorage",_initStorage:Fo,_support:v(),iterate:Mo,getItem:Bo,setItem:jo,removeItem:$o,clear:Vo,length:Ho,key:Jo,keys:Ko,dropInstance:Go};function Wo(){return typeof openDatabase=="function"}var ye="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zo="~~local_forage_type~",Kr=/^~~local_forage_type~([^~]+)~/,Ye="__lfsc__:",Vt=Ye.length,Ht="arbf",Jt="blob",Gr="si08",qr="ui08",Wr="uic8",zr="si16",Yr="si32",Qr="ur16",Xr="ui32",Zr="fl32",en="fl64",tn=Vt+Ht.length,rn=Object.prototype.toString;function nn(o){var s=o.length*.75,a=o.length,u,f=0,l,h,y,_;o[o.length-1]==="="&&(s--,o[o.length-2]==="="&&s--);var w=new ArrayBuffer(s),I=new Uint8Array(w);for(u=0;u<a;u+=4)l=ye.indexOf(o[u]),h=ye.indexOf(o[u+1]),y=ye.indexOf(o[u+2]),_=ye.indexOf(o[u+3]),I[f++]=l<<2|h>>4,I[f++]=(h&15)<<4|y>>2,I[f++]=(y&3)<<6|_&63;return w}function Kt(o){var s=new Uint8Array(o),a="",u;for(u=0;u<s.length;u+=3)a+=ye[s[u]>>2],a+=ye[(s[u]&3)<<4|s[u+1]>>4],a+=ye[(s[u+1]&15)<<2|s[u+2]>>6],a+=ye[s[u+2]&63];return s.length%3===2?a=a.substring(0,a.length-1)+"=":s.length%3===1&&(a=a.substring(0,a.length-2)+"=="),a}function Yo(o,s){var a="";if(o&&(a=rn.call(o)),o&&(a==="[object ArrayBuffer]"||o.buffer&&rn.call(o.buffer)==="[object ArrayBuffer]")){var u,f=Ye;o instanceof ArrayBuffer?(u=o,f+=Ht):(u=o.buffer,a==="[object Int8Array]"?f+=Gr:a==="[object Uint8Array]"?f+=qr:a==="[object Uint8ClampedArray]"?f+=Wr:a==="[object Int16Array]"?f+=zr:a==="[object Uint16Array]"?f+=Qr:a==="[object Int32Array]"?f+=Yr:a==="[object Uint32Array]"?f+=Xr:a==="[object Float32Array]"?f+=Zr:a==="[object Float64Array]"?f+=en:s(new Error("Failed to get type for BinaryArray"))),s(f+Kt(u))}else if(a==="[object Blob]"){var l=new FileReader;l.onload=function(){var h=zo+o.type+"~"+Kt(this.result);s(Ye+Jt+h)},l.readAsArrayBuffer(o)}else try{s(JSON.stringify(o))}catch(h){console.error("Couldn't convert value into a JSON string: ",o),s(null,h)}}function Qo(o){if(o.substring(0,Vt)!==Ye)return JSON.parse(o);var s=o.substring(tn),a=o.substring(Vt,tn),u;if(a===Jt&&Kr.test(s)){var f=s.match(Kr);u=f[1],s=s.substring(f[0].length)}var l=nn(s);switch(a){case Ht:return l;case Jt:return T([l],{type:u});case Gr:return new Int8Array(l);case qr:return new Uint8Array(l);case Wr:return new Uint8ClampedArray(l);case zr:return new Int16Array(l);case Qr:return new Uint16Array(l);case Yr:return new Int32Array(l);case Xr:return new Uint32Array(l);case Zr:return new Float32Array(l);case en:return new Float64Array(l);default:throw new Error("Unkown type: "+a)}}var Gt={serialize:Yo,deserialize:Qo,stringToBuffer:nn,bufferToString:Kt};function on(o,s,a,u){o.executeSql("CREATE TABLE IF NOT EXISTS "+s.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],a,u)}function Xo(o){var s=this,a={db:null};if(o)for(var u in o)a[u]=typeof o[u]!="string"?o[u].toString():o[u];var f=new g(function(l,h){try{a.db=openDatabase(a.name,String(a.version),a.description,a.size)}catch(y){return h(y)}a.db.transaction(function(y){on(y,a,function(){s._dbInfo=a,l()},function(_,w){h(w)})},h)});return a.serializer=Gt,f}function be(o,s,a,u,f,l){o.executeSql(a,u,f,function(h,y){y.code===y.SYNTAX_ERR?h.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[s.storeName],function(_,w){w.rows.length?l(_,y):on(_,s,function(){_.executeSql(a,u,f,l)},l)},l):l(h,y)},l)}function Zo(o,s){var a=this;o=N(o);var u=new g(function(f,l){a.ready().then(function(){var h=a._dbInfo;h.db.transaction(function(y){be(y,h,"SELECT * FROM "+h.storeName+" WHERE key = ? LIMIT 1",[o],function(_,w){var I=w.rows.length?w.rows.item(0).value:null;I&&(I=h.serializer.deserialize(I)),f(I)},function(_,w){l(w)})})}).catch(l)});return E(u,s),u}function ei(o,s){var a=this,u=new g(function(f,l){a.ready().then(function(){var h=a._dbInfo;h.db.transaction(function(y){be(y,h,"SELECT * FROM "+h.storeName,[],function(_,w){for(var I=w.rows,R=I.length,U=0;U<R;U++){var M=I.item(U),$=M.value;if($&&($=h.serializer.deserialize($)),$=o($,M.key,U+1),$!==void 0){f($);return}}f()},function(_,w){l(w)})})}).catch(l)});return E(u,s),u}function an(o,s,a,u){var f=this;o=N(o);var l=new g(function(h,y){f.ready().then(function(){s===void 0&&(s=null);var _=s,w=f._dbInfo;w.serializer.serialize(s,function(I,R){R?y(R):w.db.transaction(function(U){be(U,w,"INSERT OR REPLACE INTO "+w.storeName+" (key, value) VALUES (?, ?)",[o,I],function(){h(_)},function(M,$){y($)})},function(U){if(U.code===U.QUOTA_ERR){if(u>0){h(an.apply(f,[o,_,a,u-1]));return}y(U)}})})}).catch(y)});return E(l,a),l}function ti(o,s,a){return an.apply(this,[o,s,a,1])}function ri(o,s){var a=this;o=N(o);var u=new g(function(f,l){a.ready().then(function(){var h=a._dbInfo;h.db.transaction(function(y){be(y,h,"DELETE FROM "+h.storeName+" WHERE key = ?",[o],function(){f()},function(_,w){l(w)})})}).catch(l)});return E(u,s),u}function ni(o){var s=this,a=new g(function(u,f){s.ready().then(function(){var l=s._dbInfo;l.db.transaction(function(h){be(h,l,"DELETE FROM "+l.storeName,[],function(){u()},function(y,_){f(_)})})}).catch(f)});return E(a,o),a}function oi(o){var s=this,a=new g(function(u,f){s.ready().then(function(){var l=s._dbInfo;l.db.transaction(function(h){be(h,l,"SELECT COUNT(key) as c FROM "+l.storeName,[],function(y,_){var w=_.rows.item(0).c;u(w)},function(y,_){f(_)})})}).catch(f)});return E(a,o),a}function ii(o,s){var a=this,u=new g(function(f,l){a.ready().then(function(){var h=a._dbInfo;h.db.transaction(function(y){be(y,h,"SELECT key FROM "+h.storeName+" WHERE id = ? LIMIT 1",[o+1],function(_,w){var I=w.rows.length?w.rows.item(0).key:null;f(I)},function(_,w){l(w)})})}).catch(l)});return E(u,s),u}function ai(o){var s=this,a=new g(function(u,f){s.ready().then(function(){var l=s._dbInfo;l.db.transaction(function(h){be(h,l,"SELECT key FROM "+l.storeName,[],function(y,_){for(var w=[],I=0;I<_.rows.length;I++)w.push(_.rows.item(I).key);u(w)},function(y,_){f(_)})})}).catch(f)});return E(a,o),a}function si(o){return new g(function(s,a){o.transaction(function(u){u.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(f,l){for(var h=[],y=0;y<l.rows.length;y++)h.push(l.rows.item(y).name);s({db:o,storeNames:h})},function(f,l){a(l)})},function(u){a(u)})})}function ci(o,s){s=O.apply(this,arguments);var a=this.config();o=typeof o!="function"&&o||{},o.name||(o.name=o.name||a.name,o.storeName=o.storeName||a.storeName);var u=this,f;return o.name?f=new g(function(l){var h;o.name===a.name?h=u._dbInfo.db:h=openDatabase(o.name,"","",0),o.storeName?l({db:h,storeNames:[o.storeName]}):l(si(h))}).then(function(l){return new g(function(h,y){l.db.transaction(function(_){function w(M){return new g(function($,q){_.executeSql("DROP TABLE IF EXISTS "+M,[],function(){$()},function(G,oe){q(oe)})})}for(var I=[],R=0,U=l.storeNames.length;R<U;R++)I.push(w(l.storeNames[R]));g.all(I).then(function(){h()}).catch(function(M){y(M)})},function(_){y(_)})})}):f=g.reject("Invalid arguments"),E(f,s),f}var li={_driver:"webSQLStorage",_initStorage:Xo,_support:Wo(),iterate:ei,getItem:Zo,setItem:ti,removeItem:ri,clear:ni,length:oi,key:ii,keys:ai,dropInstance:ci};function ui(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(o){return!1}}function sn(o,s){var a=o.name+"/";return o.storeName!==s.storeName&&(a+=o.storeName+"/"),a}function di(){var o="_localforage_support_test";try{return localStorage.setItem(o,!0),localStorage.removeItem(o),!1}catch(s){return!0}}function fi(){return!di()||localStorage.length>0}function mi(o){var s=this,a={};if(o)for(var u in o)a[u]=o[u];return a.keyPrefix=sn(o,s._defaultConfig),fi()?(s._dbInfo=a,a.serializer=Gt,g.resolve()):g.reject()}function pi(o){var s=this,a=s.ready().then(function(){for(var u=s._dbInfo.keyPrefix,f=localStorage.length-1;f>=0;f--){var l=localStorage.key(f);l.indexOf(u)===0&&localStorage.removeItem(l)}});return E(a,o),a}function hi(o,s){var a=this;o=N(o);var u=a.ready().then(function(){var f=a._dbInfo,l=localStorage.getItem(f.keyPrefix+o);return l&&(l=f.serializer.deserialize(l)),l});return E(u,s),u}function gi(o,s){var a=this,u=a.ready().then(function(){for(var f=a._dbInfo,l=f.keyPrefix,h=l.length,y=localStorage.length,_=1,w=0;w<y;w++){var I=localStorage.key(w);if(I.indexOf(l)===0){var R=localStorage.getItem(I);if(R&&(R=f.serializer.deserialize(R)),R=o(R,I.substring(h),_++),R!==void 0)return R}}});return E(u,s),u}function vi(o,s){var a=this,u=a.ready().then(function(){var f=a._dbInfo,l;try{l=localStorage.key(o)}catch(h){l=null}return l&&(l=l.substring(f.keyPrefix.length)),l});return E(u,s),u}function yi(o){var s=this,a=s.ready().then(function(){for(var u=s._dbInfo,f=localStorage.length,l=[],h=0;h<f;h++){var y=localStorage.key(h);y.indexOf(u.keyPrefix)===0&&l.push(y.substring(u.keyPrefix.length))}return l});return E(a,o),a}function bi(o){var s=this,a=s.keys().then(function(u){return u.length});return E(a,o),a}function _i(o,s){var a=this;o=N(o);var u=a.ready().then(function(){var f=a._dbInfo;localStorage.removeItem(f.keyPrefix+o)});return E(u,s),u}function wi(o,s,a){var u=this;o=N(o);var f=u.ready().then(function(){s===void 0&&(s=null);var l=s;return new g(function(h,y){var _=u._dbInfo;_.serializer.serialize(s,function(w,I){if(I)y(I);else try{localStorage.setItem(_.keyPrefix+o,w),h(l)}catch(R){(R.name==="QuotaExceededError"||R.name==="NS_ERROR_DOM_QUOTA_REACHED")&&y(R),y(R)}})})});return E(f,a),f}function Ei(o,s){if(s=O.apply(this,arguments),o=typeof o!="function"&&o||{},!o.name){var a=this.config();o.name=o.name||a.name,o.storeName=o.storeName||a.storeName}var u=this,f;return o.name?f=new g(function(l){o.storeName?l(sn(o,u._defaultConfig)):l(o.name+"/")}).then(function(l){for(var h=localStorage.length-1;h>=0;h--){var y=localStorage.key(h);y.indexOf(l)===0&&localStorage.removeItem(y)}}):f=g.reject("Invalid arguments"),E(f,s),f}var Ii={_driver:"localStorageWrapper",_initStorage:mi,_support:ui(),iterate:gi,getItem:hi,setItem:wi,removeItem:_i,clear:pi,length:bi,key:vi,keys:yi,dropInstance:Ei},Ti=function(s,a){return s===a||typeof s=="number"&&typeof a=="number"&&isNaN(s)&&isNaN(a)},Si=function(s,a){for(var u=s.length,f=0;f<u;){if(Ti(s[f],a))return!0;f++}return!1},cn=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"},Fe={},ln={},Ae={INDEXEDDB:qo,WEBSQL:li,LOCALSTORAGE:Ii},Ri=[Ae.INDEXEDDB._driver,Ae.WEBSQL._driver,Ae.LOCALSTORAGE._driver],Qe=["dropInstance"],qt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Qe),Ai={description:"",driver:Ri.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function xi(o,s){o[s]=function(){var a=arguments;return o.ready().then(function(){return o[s].apply(o,a)})}}function Wt(){for(var o=1;o<arguments.length;o++){var s=arguments[o];if(s)for(var a in s)s.hasOwnProperty(a)&&(cn(s[a])?arguments[0][a]=s[a].slice():arguments[0][a]=s[a])}return arguments[0]}var ki=function(){function o(s){m(this,o);for(var a in Ae)if(Ae.hasOwnProperty(a)){var u=Ae[a],f=u._driver;this[a]=f,Fe[f]||this.defineDriver(u)}this._defaultConfig=Wt({},Ai),this._config=Wt({},this._defaultConfig,s),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return o.prototype.config=function(a){if((typeof a=="undefined"?"undefined":d(a))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var u in a){if(u==="storeName"&&(a[u]=a[u].replace(/\W/g,"_")),u==="version"&&typeof a[u]!="number")return new Error("Database version must be a number.");this._config[u]=a[u]}return"driver"in a&&a.driver?this.setDriver(this._config.driver):!0}else return typeof a=="string"?this._config[a]:this._config},o.prototype.defineDriver=function(a,u,f){var l=new g(function(h,y){try{var _=a._driver,w=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!a._driver){y(w);return}for(var I=qt.concat("_initStorage"),R=0,U=I.length;R<U;R++){var M=I[R],$=!Si(Qe,M);if(($||a[M])&&typeof a[M]!="function"){y(w);return}}var q=function(){for(var Be=function(Oi){return function(){var Di=new Error("Method "+Oi+" is not implemented by the current driver"),un=g.reject(Di);return E(un,arguments[arguments.length-1]),un}},zt=0,Pi=Qe.length;zt<Pi;zt++){var Yt=Qe[zt];a[Yt]||(a[Yt]=Be(Yt))}};q();var G=function(Be){Fe[_]&&console.info("Redefining LocalForage driver: "+_),Fe[_]=a,ln[_]=Be,h()};"_support"in a?a._support&&typeof a._support=="function"?a._support().then(G,y):G(!!a._support):G(!0)}catch(oe){y(oe)}});return P(l,u,f),l},o.prototype.driver=function(){return this._driver||null},o.prototype.getDriver=function(a,u,f){var l=Fe[a]?g.resolve(Fe[a]):g.reject(new Error("Driver not found."));return P(l,u,f),l},o.prototype.getSerializer=function(a){var u=g.resolve(Gt);return P(u,a),u},o.prototype.ready=function(a){var u=this,f=u._driverSet.then(function(){return u._ready===null&&(u._ready=u._initDriver()),u._ready});return P(f,a,a),f},o.prototype.setDriver=function(a,u,f){var l=this;cn(a)||(a=[a]);var h=this._getSupportedDrivers(a);function y(){l._config.driver=l.driver()}function _(R){return l._extend(R),y(),l._ready=l._initStorage(l._config),l._ready}function w(R){return function(){var U=0;function M(){for(;U<R.length;){var $=R[U];return U++,l._dbInfo=null,l._ready=null,l.getDriver($).then(_).catch(M)}y();var q=new Error("No available storage method found.");return l._driverSet=g.reject(q),l._driverSet}return M()}}var I=this._driverSet!==null?this._driverSet.catch(function(){return g.resolve()}):g.resolve();return this._driverSet=I.then(function(){var R=h[0];return l._dbInfo=null,l._ready=null,l.getDriver(R).then(function(U){l._driver=U._driver,y(),l._wrapLibraryMethodsWithReady(),l._initDriver=w(h)})}).catch(function(){y();var R=new Error("No available storage method found.");return l._driverSet=g.reject(R),l._driverSet}),P(this._driverSet,u,f),this._driverSet},o.prototype.supports=function(a){return!!ln[a]},o.prototype._extend=function(a){Wt(this,a)},o.prototype._getSupportedDrivers=function(a){for(var u=[],f=0,l=a.length;f<l;f++){var h=a[f];this.supports(h)&&u.push(h)}return u},o.prototype._wrapLibraryMethodsWithReady=function(){for(var a=0,u=qt.length;a<u;a++)xi(this,qt[a])},o.prototype.createInstance=function(a){return new o(a)},o}(),Ci=new ki;i.exports=Ci},{3:3}]},{},[4])(4)})});var mo=pn(Te=>{"use strict";j();qe();Ee();var Ce=ie(),Qa=ae("levelFinished",{paramsSchema:k.tuple(k.string(),k.object({result:k.boolean(),duration:k.number()})),implement:(e,t)=>D(Te,null,function*(){let{result:r,duration:n}=t;se.info("onLevelFinished",r,n),yield Promise.all([le.reporter({event:"COMPLETE_GAME_LEVEL"}),le.tracker("LevelFinished",{levelId:e,result:r,duration:n})])})}),Xa=ae("taskFinished",{paramsSchema:k.tuple(k.string(),k.object({duration:k.number()})),implement:(e,t)=>D(Te,null,function*(){let{duration:r}=t;yield le.tracker("TaskFinished",{duration:r,taskId:e})})}),Za=ae("levelUpgrade",{paramsSchema:k.tuple(k.string(),k.string()),implement:(e,t)=>D(Te,null,function*(){return yield le.tracker("LevelUpgrade",{name:t,levelId:e})})}),es=ae("onHistoryUserLevel",{paramsSchema:k.tuple(k.number()),implement:e=>D(Te,null,function*(){return yield le.tracker("HistoryUserLevel",{level:e})})}),ts=ae("onHistoryUserScore",{paramsSchema:k.tuple(k.number()),implement:e=>D(Te,null,function*(){return yield le.tracker("HistoryUserScore",{score:e})})}),rs=ae("taskEvent",{paramsSchema:k.tuple(k.string(),k.object({tools:k.array(k.object({id:k.string(),name:k.string(),count:k.number(),description:k.string().optional(),price:k.object({amount:k.number(),unit:k.string()}).optional()})).optional(),awards:k.array(k.object({id:k.string(),name:k.string()})).optional()})),implement:(e,t)=>D(Te,null,function*(){var r;(r=t.tools)!=null&&r.length&&(yield Promise.all([le.reporter({event:"USE_GAME_ITEM"}),le.tracker("UseGameItem",V({taskId:e},t))]))})});Ce.registerCommand("TaskTrackerSDK.levelFinished",Qa);Ce.registerCommand("TaskTrackerSDK.taskFinished",Xa);Ce.registerCommand("TaskTrackerSDK.levelUpgrade",Za);Ce.registerCommand("TaskTrackerSDK.historyUserLevel",es);Ce.registerCommand("TaskTrackerSDK.historyUserScore",ts);Ce.registerCommand("TaskTrackerSDK.taskEvent",rs);Y("TaskTrackerSDK.onLevelFinished",{version:"1.0.0",properties:{levelId:"1.0.0",params:{result:"1.0.0",duration:"1.0.0"}}});Y("TaskTrackerSDK.onTaskFinished",{version:"1.0.0",properties:{taskId:"1.0.0",duration:"1.0.0"}});Y("TaskTrackerSDK.onLevelUpgrade",{version:"1.0.0",properties:{levelId:"1.0.0",name:"1.0.0"}});Y("TaskTrackerSDK.onHistoryUserLevel",{version:"1.0.0",properties:{level:"1.0.0"}});Y("TaskTrackerSDK.onHistoryUserScore",{version:"1.0.0",properties:{score:"1.0.0"}});Y("TaskTrackerSDK.onTaskEvent",{version:"1.0.0",properties:{taskId:"1.0.0",params:{tools:{id:"1.0.0",name:"1.0.0",count:"1.0.0",description:"1.0.0",price:{amount:"1.0.0",unit:"1.0.0"}},awards:{id:"1.0.0",name:"1.0.0"}}}})});Ee();Z();qe();j();var so=ie(),Na="env",Ua="getSystemInfoSync",Fa=()=>{var i,c,d,m;let e={system:A.deviceInfo.system,platform:A.deviceInfo.platform.toLowerCase(),brand:A.deviceInfo.brand,pixelRatio:A.deviceInfo.pixelRatio,language:A.deviceInfo.lang,version:A.sdkInfo.jssdkVersion,appName:(i=A.hostInfo)==null?void 0:i.appName,SDKVersion:A.sdkInfo.nativeSDKVersion},t=(c=A.hostInfo)==null?void 0:c.version;t&&(e=z(V({},e),{version:t}));let r=(d=A.hostInfo)==null?void 0:d.appName;r&&(e=z(V({},e),{appName:r}));let n=(m=A.sdkInfo)==null?void 0:m.jssdkVersion;return n&&(e=z(V({},e),{SDKVersion:n})),e},Ba=Ie(Ua,{implement:Fa}),Ma=Ie(Na,{implement:()=>z(V({},A.hostInfo),{sdkInfo:A.sdkInfo,platform:A.platform,deviceInfo:A.deviceInfo})});so.registerCommand("API.env",Ma);so.registerCommand("API.getSystemInfoSync",Ba);Y("env",{version:"1.0.0"});Y("getSystemInfoSync",{version:"1.0.0"});j();qe();_e();Ee();var ja="onJoliboxShow",$a="onJoliboxHide",Va="onReady",Nr=ie(),Ur=Pn(ce),Lr=!0,We=!0,At=0,xt=Ar;function Ha(){let e=Date.now();if(e-At<100)return;At=e;let t=document.visibilityState==="visible";t!==Lr&&(Lr=t,xt.emit("visible",Lr))}function co(e){let t=Date.now();t-At<100||(At=t,e==="focus"&&!We?We=!0:e==="blur"&&We&&(We=!1),xt.emit("visible",We))}document.addEventListener("visibilitychange",Ha);window.addEventListener("focus",()=>co("focus"));window.addEventListener("blur",()=>co("blur"));var Ja=Ie(ja,{paramsSchema:k.tuple(k.function()),implement(e){let t=Ur(e);xt.on("visible",r=>{r&&t()})}}),Ka=Ie($a,{paramsSchema:k.tuple(k.function()),implement(e){let t=Ur(e);xt.on("visible",r=>{!r&&t()})}}),Ga=Ie(Va,{paramsSchema:k.tuple(k.function()),implement(e){let t=Ur(e);Ke.on("LifecycleEvent.onReady",r=>{t(r)})}});Nr.registerCommand("LifecycleSDK.onReady",Ga);Nr.registerCommand("LifecycleSDK.onJoliboxShow",Ja);Nr.registerCommand("LifecycleSDK.onJoliboxHide",Ka);Y("lifeCycle.onReady",{version:"1.0.0"});Y("lifeCycle.onJoliboxShow",{version:"1.0.0"});Y("lifeCycle.onJoliboxHide",{version:"1.0.0"});qe();j();Ge();Z();var fo=hn(uo());var kt=ie(),Br=class{constructor(){this.httpClient=ge.create({baseUrl:A.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"});this.getGameId=()=>A.mpId;this.getItem=t=>D(this,null,function*(){let{code:r,data:n,message:i}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),c=n==null?void 0:n.value,d=i;return r!=="SUCCESS"&&(c=yield this.gameStore.getItem(t),console.info("[SDK] cloud storage getItem failed, read from localstorage",c),d+="fallback to localstorage"),{code:r,message:d,data:c&&c!=="undefined"?c:null}});this.setItem=(t,r)=>D(this,null,function*(){let n=typeof r=="string"?r:String(r),{code:i,message:c}=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:c}});this.removeItem=t=>D(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=()=>D(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=fo.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},Ct=new Br,qa=ae("getLocalStorage",{paramsSchema:k.tuple(k.string()),implement(e){return D(this,null,function*(){return yield Ct.getItem(e)})}});kt.registerCommand("StorageSDK.getItem",qa);Y("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Wa=ae("setStorage",{paramsSchema:k.tuple(k.string(),k.or(k.string(),k.boolean(),k.number())),implement(e,t){return D(this,null,function*(){return yield Ct.setItem(e,t)})}});kt.registerCommand("StorageSDK.setItem",Wa);Y("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var za=ae("removeStorage",{paramsSchema:k.tuple(k.string()),implement(e){return D(this,null,function*(){return yield Ct.removeItem(e)})}});kt.registerCommand("StorageSDK.removeItem",za);Y("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var Ya=ae("clearStorage",{implement(){return D(this,null,function*(){return yield Ct.clear()})}});kt.registerCommand("StorageSDK.clear",Ya);Y("storage.clear",{version:"1.0.0"});var Mu=hn(mo());var Pt=class{constructor(t){this.track=t;this.adBreakIsShowing=!1;this.reportPageJumpOut=()=>{this.track("AdBreakJumpOut",{context:"AdsActionDetection"})};this.reportPageHide=()=>{this.track("AdBreakHide",{context:"AdsActionDetection"})};window.addEventListener("visibilitychange",()=>{document.hidden&&this.adBreakIsShowing&&this.reportPageHide()}),window.addEventListener("beforeunload",r=>{this.adBreakIsShowing&&this.reportPageJumpOut()})}};j();mr();var Ot=class{constructor(t,r,n,i){this.track=t;this.httpClient=r;this.checkNetwork=n;this.checkAdsDisplayPermission=t=>{if(!this.checkNetwork())return{reason:"NETWORK_NOT_OK"};let r=this.checkShouldBanInitial();if(r)return{reason:r};let n=this.checkShouldBanForSession(t);if(n)return{reason:n};let i=this.checkShouldBanHighFreq(t);if(i)return i;let c=this.checkShouldBanForTime(t);return c?{reason:c}:{reason:"ALLOWED"}};var g,E,P,N,O,L,H;let c=(g=i==null?void 0:i.maxAllowedAdsForTime)!=null?g:8,d=(E=i==null?void 0:i.banForTimeThreshold)!=null?E:6e4,m=(P=i==null?void 0:i.bannedReleaseTime)!=null?P:6e4,p=(N=i==null?void 0:i.maxAllowedAdsForSession)!=null?N:200,b=(O=i==null?void 0:i.banForSessionThreshold)!=null?O:6e5,v=(L=i==null?void 0:i.initialThreshold)!=null?L:2e3,T=(H=i==null?void 0:i.highFreqThreshold)!=null?H:2e3;this.checkShouldBanInitial=is(v),this.checkShouldBanHighFreq=as(T),this.checkShouldBanForTime=os(c,d,m),this.checkShouldBanForSession=ns(p,b)}report(t,r){let n=r?{reason:t,count:r}:{reason:t};this.track("PreventAdsCheating",n),this.httpClient.post("/api/base/app-event",{data:{eventType:"PREVENT_ADS_CHEATING",adsInfo:n}})}},ns=(e,t)=>{let r=!1,n=[];return c=>{if(r)return"BANNED_FOR_SESSION";let d=Date.now();if(n=n.concat({timestamp:d,type:c}),n.length!==1&&(n.length>e&&(n=n.slice(-e)),n.length===e&&d-n[0].timestamp<=t))return r=!0,"BANNED_FOR_SESSION"}},os=(e,t,r)=>{let n=null,i=v=>{n&&(window.clearTimeout(n),n=null),n=window.setTimeout(()=>{p.value=!1,n=null},v)},c="jolibox-sdk-ads-callbreak-timestamps",d="jolibox-sdk-ads-ban-for-time",m={_records:[],init(){var v;try{let T=JSON.parse((v=window.__joliboxLocalStorage__.getItem(c))!=null?v:"[]");Array.isArray(T)?this._records=T:this._records=[]}catch(T){this._records=[]}},get values(){return this._records},set values(v){try{window.__joliboxLocalStorage__.setItem(c,JSON.stringify(v))}catch(T){}this._records=v}},p={_record:!1,init(){var v;try{let T=JSON.parse((v=window.__joliboxLocalStorage__.getItem(d))!=null?v:"false");typeof T=="boolean"&&(this._record=T)}catch(T){this._record=!1}if(this._record){let T=m.values[m.values.length-1],g=T?Date.now()-T.timestamp:r;g<=r&&g>0?i(g):this._record=!1}},get value(){return this._record},set value(v){try{window.__joliboxLocalStorage__.setItem(d,JSON.stringify(v))}catch(T){}this._record=v}};return m.init(),p.init(),v=>{if(p.value)return"WAITING_BANNED_RELEASE";let T=Date.now();if(m.values=m.values.concat({timestamp:T,type:v}),m.values.length!==1&&(m.values.length>e&&(m.values=m.values.slice(-e)),m.values.length===e&&T-m.values[0].timestamp<=t))return p.value=!0,i(r),"BANNED_FOR_TIME"}},is=e=>{let t=Date.now();return()=>{if(Date.now()-t<=e)return"BLOCK_INITIAL"}},as=(e=2e3)=>{let t=0,r=null;return i=>{if(i==="reward"){if(r)return t+=1,{reason:"HOLDING_HIGH_FREQ",info:{count:t}};r=window.setTimeout(()=>{r&&(window.clearTimeout(r),r=0,t=0)},e)}}};Z();Z();var Dt=class{constructor(t){this.httpClient=t;this.configs=null;this.firstRun=!0;this.init()}init(){return D(this,null,function*(){try{this.configs=yield this.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config")}catch(t){}})}shouldBypassCallingInterstitial(){var r,n;let t;if(!this.configs)this.init(),t=!this.firstRun;else{let i=(r=A.channel)!=null?r:"",c=this.configs[i],d=(n=c==null?void 0:c.interstitialRate)!=null?n:1;t=Math.random()<d}return this.firstRun=!1,t}};j();var Pe=new de,Lt=class{constructor(t,r,n){this.track=t;this.httpClient=r;this.checkNetwork=n;this.configured=!1;this.config={};this.getGameId=()=>A.mpId;this.getTestAdsMode=()=>A.testAdsMode;this.asyncLoad=()=>D(this,null,function*(){var d,m,p,b,v;let t="ca-pub-7171363994453626",r,n,i=window.encodeURIComponent(window.btoa((d=this.getGameId())!=null?d:"")),c=(m=this.getTestAdsMode())!=null?m:!1;try{let T=yield this.httpClient.get("/public/ads",{query:{objectId:i,testAdsMode:`${c}`}});t=(p=T.data)==null?void 0:p.clientId,r=(b=T.data)==null?void 0:b.channelId,n=(v=T.data)==null?void 0:v.unitId}catch(T){console.error("Failed to fetch client info",T)}this.clientId=t,this.channelId=r,this.unitId=n});this.asyncInit=t=>D(this,null,function*(){var i;if(typeof window=="undefined")return;yield this.asyncLoad();let r="google-adsense",n=(i=this.getTestAdsMode())!=null?i:!1;if(!document.getElementById(r)&&this.clientId){let c=document.createElement("script");c.id=r,c.async=!0,c.crossOrigin="anonymous",c.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.clientId}`,n&&c.setAttribute("data-adbreak-test","on"),this.channelId&&c.setAttribute("data-ad-channel",this.channelId),document.head.appendChild(c),this.track("LoadAdsenseCompleted",null)}});this.push=(t={})=>{window.adsbygoogle.push(t)};this.wrapAdBreakParams=t=>{let r=!1,n=t.adBreakDone,i=d=>{var m;r=!0,this.adsActionDetection.adBreakIsShowing=!1,this.track("CallAdBreakDone",{breakType:d.breakType,breakName:(m=d.breakName)!=null?m:"",breakFormat:d.breakFormat,breakStatus:d.breakStatus}),n&&n(d)};if(t.adBreakDone=i,t.type==="reward"){let d=t.beforeReward,m=b=>()=>{this.track("CallShowAdFn",null),b()},p=b=>{r=!0,d&&d(m(b))};t.beforeReward=p,window.setTimeout(()=>{var b,v;r||(this.track("CallAdBreakTimeout",{type:t.type}),(v=t.adBreakDone)==null||v.call(t,{breakType:t.type,breakName:(b=t.name)!=null?b:"",breakFormat:"reward",breakStatus:"timeout"}))},5e3)}if((d=>d.type==="preroll")(t)){Pe.emit("isAdShowing",!0);let d=t.adBreakDone,m=p=>{Pe.emit("isAdShowing",!1),d&&d(p)};return z(V({},t),{adBreakDone:m})}else{let d=t.beforeAd,m=t.afterAd,p=()=>{var v;r=!0,Pe.emit("isAdShowing",!0),this.track("CallBeforeAd",{type:t.type,name:(v=t.name)!=null?v:""}),d&&d()},b=()=>{var v;r=!0,Pe.emit("isAdShowing",!1),this.track("CallAfterAd",{type:t.type,name:(v=t.name)!=null?v:""}),m&&m()};return z(V({},t),{beforeAd:p,afterAd:b})}};this.adConfig=t=>{let i=t,{onReady:r}=i,n=mn(i,["onReady"]);this.track("CallAdConfig",n),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(t))};this.adBreak=t=>{var m,p,b,v,T,g;if(!this.getGameId()){console.warn("Game ID is not set, skip calling adBreak");return}if(t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(m=t.adBreakDone)==null||m.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}let{reason:r,info:n}=this.antiCheating.checkAdsDisplayPermission(t.type==="reward"?"reward":"interstitial");switch(r){case"NETWORK_NOT_OK":case"BANNED_FOR_SESSION":(p=t.adBreakDone)==null||p.call(t,{breakType:t.type,breakName:r,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"}),this.antiCheating.report(r);return;case"BLOCK_INITIAL":case"BANNED_FOR_TIME":case"WAITING_BANNED_RELEASE":(b=t.adBreakDone)==null||b.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"}),this.antiCheating.report(r);return;case"HOLDING_HIGH_FREQ":(T=t.adBreakDone)==null||T.call(t,{breakFormat:t.type==="reward"?"reward":"interstitial",breakName:"",breakStatus:((v=n==null?void 0:n.count)!=null?v:0)>6?"other":"frequencyCapped",breakType:t.type}),n!=null&&n.count&&n.count!==0&&n.count%3===0&&this.antiCheating.report(r,n==null?void 0:n.count);return;default:break}let i=t.type,c;switch(i){case"preroll":c={type:i};break;case"start":case"pause":case"next":case"browse":case"reward":c={type:i,name:(g=t.name)!=null?g:""};break}this.adsActionDetection.adBreakIsShowing=!0,this.track("CallAdBreak",c);let d=this.wrapAdBreakParams(t);this.push(d),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")};this.adUnit=t=>D(this,null,function*(){var g,E,P,N;if(this.track("CallAdUnit",{adFormat:(E=(g=t.adFormat)==null?void 0:g.toString())!=null?E:null,fullWidthResponsive:(P=t.fullWidthResponsive)!=null?P:null}),this.clientId||(yield this.asyncLoad()),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:r,slot:n,adFormat:i,fullWidthResponsive:c,style:d}=t,m;if(!r)throw new Error("targeting element is required");if(typeof r=="string"?m=document.querySelector(r):m=r,!m)throw new Error("targeting element not found");let p=n;if(p||(p=this.unitId),!p)throw new Error("slot is required");let b=typeof i=="object"&&Array.isArray(i)?i.join(", "):i,v=document.createElement("ins");if(v.className="adsbygoogle",v.id="jolibox-ads",v.style.display="block",v.setAttribute("data-ad-client",this.clientId),v.setAttribute("data-ad-slot",p),b&&v.setAttribute("data-ad-format",b),c&&v.setAttribute("data-full-width-responsive",c),d&&v.setAttribute("style",d),(N=this.getTestAdsMode())!=null?N:!1){let O=document.createElement("div");O.style.position="absolute",O.style.top="0",O.style.left="0",O.style.width="100%",O.style.height="100%",O.style.display="flex",O.style.justifyContent="center",O.style.alignItems="center",O.style.backgroundColor="rgba(0, 0, 0, 0.5)",O.style.color="white",O.innerHTML="Test Ad",v.style.position="relative",m.appendChild(v),v.appendChild(O)}else m.appendChild(v),new MutationObserver(L=>{L.forEach(H=>{if(H.type==="attributes"&&H.attributeName==="data-ad-status"){let F=v.getAttribute("data-ad-status");this.track("AdSenseUnitStatusChanged",{status:F!=null?F:"null"})}})}).observe(v,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})});this.antiCheating=new Ot(t,r,n),this.adsActionDetection=new Pt(this.track),this.channelPolicy=new Dt(r)}init(t){this.track("CallAdsInit",null),typeof window!="undefined"&&(this.config=t!=null?t:{},window.adsbygoogle=window.adsbygoogle||[],this.asyncInit(t))}};Ee();j();Ge();var Mr=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")};Z();var po=A.testMode;function ho(){let e=new Map,t;return{registerRewardHandler(n,i){e.set(n,i)},handleReward(n,...i){return D(this,null,function*(){return yield n.reduce((d,m)=>D(this,null,function*(){let p=yield d;if(p===!0)return!0;po&&console.log(`handleReward ${m}`);let b=e.get(m),v=b?yield b(...i):p;return po&&console.log(`handleReward ${m} ${v}`),v}),Promise.resolve(!1))})},registerRewardsFetcher(n){return D(this,null,function*(){t=(...i)=>D(this,null,function*(){try{return yield n(...i)}catch(c){return console.error("getRewardOptions error:",c),["ADS"]}})})},getRewardsTypes(...n){return D(this,null,function*(){return t?yield t(...n):["ADS"]})}}}var ss=()=>(e,t)=>e==="JOLI_COIN"&&t==="ADS"?-1:e==="ADS"&&t==="JOLI_COIN"?1:0,go=e=>{e.registerRewardsFetcher(t=>D(void 0,null,function*(){var n,i,c,d;let r=["ADS"];try{let m=yield t.post("/api/games/unlock-options",{});return m.code!=="SUCCESS"?r:(Ut.emit(Nt,{options:((n=m.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=m.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1}}),(((d=(c=m.data)==null?void 0:c.unlockOptions)==null?void 0:d.map(b=>b.type))||Array.from(r)).sort(ss()))}catch(m){return console.error("getRewardOptions error:",m),r}}))};j();var vo=e=>t=>D(void 0,null,function*(){return e.adBreak(t),!0});Z();j();var yo=(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)&&!!(t!=null&&t.enableAutoDeduct)}));var bo=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=null,i=null,c=null,d=()=>{if(c){n=Promise.resolve(c);return}n=new Promise(m=>{i=m})};return d(),Ut.on(Nt,m=>{c=m,i&&(i(m),i=null)}),m=>D(void 0,null,function*(){var p,b,v;try{n||d();let T=yield n;if(!yo((T==null?void 0:T.options)||[],T==null?void 0:T.userJoliCoin))return r==null||r(),!1;let g=yield e.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${fr()}-${A.mpType}-${Date.now()}`,gameInfo:{gameId:A.mpId}}});return g.code=="SUCCESS"?((b=m.adBreakDone)==null||b.call(m,{breakType:m.type,breakName:"name"in m&&(p=m.name)!=null?p:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in m&&((v=m.adViewed)==null||v.call(m)),t==null||t({quantity:g.data.quantity,balance:g.data.balance}),!0):(r==null||r(),!1)}catch(T){return console.error("JolicoinRewardHandler error:",T),r==null||r(),!1}})};var Oe=ho();go(Oe);var Nt="UNLOCK_OPTIONS_CHANGED",Ut=new de;var Ft=ie(),cs=ge.create(),Se=new Lt(fe,cs,()=>ge.getNetworkStatus());Oe.registerRewardHandler("ADS",vo(Se));Oe.registerRewardHandler("JOLI_COIN",bo(Se.httpClient,{onUnlockSuccess:e=>{Mr("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})}}));Pe.on("isAdShowing",e=>{Mr("JOLIBOX_ADS_EVENT",{isAdShowing:e})});Ft.registerCommand("AdsSDK.init",e=>{Se.init(e)});Ft.registerCommand("AdsSDK.adConfig",e=>{Se.adConfig(e)});Ft.registerCommand("AdsSDK.adBreak",e=>{e.type==="reward"?Oe.getRewardsTypes(Se.httpClient).then(t=>{Oe.handleReward(t,e)}):Se.adBreak(e)});Ft.registerCommand("AdsSDK.adUnit",e=>{Se.adUnit(e)});j();Ee();var So=-1,Mt=function(e){addEventListener("pageshow",function(t){t.persisted&&(So=t.timeStamp,e(t))},!0)},$r=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},jt=function(){var e=$r();return e&&e.activationStart||0},Le=function(e,t){var r=$r(),n="navigate";return So>=0?n="back-forward-cache":r&&(document.prerendering||jt()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},Ro=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(i){Promise.resolve().then(function(){t(i.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(i){}},Ne=function(e,t,r,n){var i,c;return function(d){t.value>=0&&(d||n)&&((c=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=c,t.rating=function(m,p){return m>p[1]?"poor":m>p[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Ao=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},xo=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},ko=function(e){var t=!1;return function(){t||(e(),t=!0)}},De=-1,_o=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Bt=function(e){document.visibilityState==="hidden"&&De>-1&&(De=e.type==="visibilitychange"?e.timeStamp:0,ls())},wo=function(){addEventListener("visibilitychange",Bt,!0),addEventListener("prerenderingchange",Bt,!0)},ls=function(){removeEventListener("visibilitychange",Bt,!0),removeEventListener("prerenderingchange",Bt,!0)},Co=function(){return De<0&&(De=_o(),wo(),Mt(function(){setTimeout(function(){De=_o(),wo()},0)})),{get firstHiddenTime(){return De}}},Vr=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},Eo=[1800,3e3],Po=function(e,t){t=t||{},Vr(function(){var r,n=Co(),i=Le("FCP"),c=Ro("paint",function(d){d.forEach(function(m){m.name==="first-contentful-paint"&&(c.disconnect(),m.startTime<n.firstHiddenTime&&(i.value=Math.max(m.startTime-jt(),0),i.entries.push(m),r(!0)))})});c&&(r=Ne(e,i,Eo,t.reportAllChanges),Mt(function(d){i=Le("FCP"),r=Ne(e,i,Eo,t.reportAllChanges),Ao(function(){i.value=performance.now()-d.timeStamp,r(!0)})}))})};var us=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=ko(e),document.visibilityState==="hidden"?e():(r=t(e),xo(e)),r};var Io=[2500,4e3],jr={},Oo=function(e,t){t=t||{},Vr(function(){var r,n=Co(),i=Le("LCP"),c=function(p){t.reportAllChanges||(p=p.slice(-1)),p.forEach(function(b){b.startTime<n.firstHiddenTime&&(i.value=Math.max(b.startTime-jt(),0),i.entries=[b],r())})},d=Ro("largest-contentful-paint",c);if(d){r=Ne(e,i,Io,t.reportAllChanges);var m=ko(function(){jr[i.id]||(c(d.takeRecords()),d.disconnect(),jr[i.id]=!0,r(!0))});["keydown","click"].forEach(function(p){addEventListener(p,function(){return us(m)},{once:!0,capture:!0})}),xo(m),Mt(function(p){i=Le("LCP"),r=Ne(e,i,Io,t.reportAllChanges),Ao(function(){i.value=performance.now()-p.timeStamp,jr[i.id]=!0,r(!0)})})}})},To=[800,1800],ds=function e(t){document.prerendering?Vr(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},Do=function(e,t){t=t||{};var r=Le("TTFB"),n=Ne(e,r,To,t.reportAllChanges);ds(function(){var i=$r();i&&(r.value=Math.max(i.responseStart-jt(),0),r.entries=[i],n(!0),Mt(function(){r=Le("TTFB",0),(n=Ne(e,r,To,t.reportAllChanges))(!0)}))})};Z();function fs(){Po(e=>{fe("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Oo(e=>{fe("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Do(e=>{fe("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function ms(){Ke.on("onDocumentReady",e=>{Ke.emit("LifecycleEvent.onReady",{isLogin:!1}),A.mpType==="game"&&le.start(Date.now()-e)})}function Lo(){ms(),fs()}Lo();
|
|
1
|
+
var Fc=Object.create;var Dn=Object.defineProperty,Vc=Object.defineProperties,Jc=Object.getOwnPropertyDescriptor,$c=Object.getOwnPropertyDescriptors,Hc=Object.getOwnPropertyNames,ko=Object.getOwnPropertySymbols,Kc=Object.getPrototypeOf,Do=Object.prototype.hasOwnProperty,Gc=Object.prototype.propertyIsEnumerable;var Po=(e,t,r)=>t in e?Dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,z=(e,t)=>{for(var r in t||(t={}))Do.call(t,r)&&Po(e,r,t[r]);if(ko)for(var r of ko(t))Gc.call(t,r)&&Po(e,r,t[r]);return e},fe=(e,t)=>Vc(e,$c(t));var Ot=(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 V=(e,t)=>()=>(e&&(t=e(e=0)),t);var ir=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var qc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Hc(t))!Do.call(e,i)&&i!==r&&Dn(e,i,{get:()=>t[i],enumerable:!(n=Jc(t,i))||n.enumerable});return e};var or=(e,t,r)=>(r=e!=null?Fc(Kc(e)):{},qc(t||!e||!e.__esModule?Dn(r,"default",{value:e,enumerable:!0}):r,e));var L=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{l(r.next(u))}catch(f){i(f)}},a=u=>{try{l(r.throw(u))}catch(f){i(f)}},l=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);l((r=r.apply(e,t)).next())});function ru(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Vn(e){return typeof e=="string"}function Fo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Vo(e){return typeof e=="object"&&Array.isArray(e)}function nu(e){return typeof e=="undefined"}function iu(e){return nu(e)||e===null}function ou(e){return typeof e=="function"}function Jo(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function $o(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 l=i[a],u=o[a],f=r(l,u,a,i,o);f!==void 0?i[a]=f:Uo(u)&&Uo(l)?i[a]=n(Bo({},l),u):Array.isArray(u)&&Array.isArray(l)?i[a]=[...l,...u]:i[a]=u}return i}return n(e,t)}function Uo(e){return e&&typeof e=="object"&&e.constructor===Object}function Ho(e,t){if(Array.isArray(e))return e.concat(t)}function Dt(e,t,r={}){let n=null,i,o,a,{leading:l=!1,trailing:u=!0}=r,f=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),y=function(...p){i=p,o=this;let g=l&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,u&&!g&&f()},t),g)return f()};return y.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},y.flush=()=>{if(n)return clearTimeout(n),n=null,f()},y}function lu(e,t){return(...r)=>t(e,...r)}function zo(e){return t=>lu(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new su(`${i}`))}})}function Ct(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function ar(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 hu(e){let t=e.location?ar(e.location,Mo):null,r=e.target?ar(e.target,Mo):null;return ar(Zc(Bo({},e),{location:t,target:r}),du)}function Gn(e){let t=e.events.map(n=>hu(n)),r=ar(e.device,fu);return[e.protocolVersion,t,r,e.project]}function pu(){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 Ru(e){return new Promise(t=>Xo(e)(t))}function Xo(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function Su(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Pt(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function xu(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Ou(e[n],t[n])}function Ou(e,t){if(Vn(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(ou(t)){try{if(e instanceof t)return}catch(r){}if(!iu(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 Cu(){return typeof globalThis!="undefined"?globalThis[Zo]:void 0}function ku(e){typeof globalThis!="undefined"&&(globalThis[Zo]=e)}function Ie(){let e=Cu();if(e)return e;let t=new sr,r=new jn,n={registerCommand(i,o,a){t.registerCommand({id:i,handler:o,metadata:a})},executeCommand(i,...o){return r.executeCommand(i,...o)},excuteCommandSync(i,...o){return r.executeCommandThowErr(i,...o)}};return ku(n),n}var Fn,Wc,zc,Yc,No,Qc,Xc,Lo,Bo,Zc,eu,jo,tu,au,Jn,$n,Ko,Go,su,qo,Wo,lr,Hn,xe,Ln,cu,Kn,Nt,st,uu,Mo,du,fu,lt,mu,Ae,vu,_u,gu,Yo,qn,yu,bu,Eu,Qo,Un,X,wu,Au,kt,Pt,Pe,Bn,Iu,Nn,Tu,Lt,sr,jn,Zo,q=V(()=>{"use strict";Fn=Object.defineProperty,Wc=Object.defineProperties,zc=Object.getOwnPropertyDescriptor,Yc=Object.getOwnPropertyDescriptors,No=Object.getOwnPropertySymbols,Qc=Object.prototype.hasOwnProperty,Xc=Object.prototype.propertyIsEnumerable,Lo=(e,t,r)=>t in e?Fn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Bo=(e,t)=>{for(var r in t||(t={}))Qc.call(t,r)&&Lo(e,r,t[r]);if(No)for(var r of No(t))Xc.call(t,r)&&Lo(e,r,t[r]);return e},Zc=(e,t)=>Wc(e,Yc(t)),eu=(e,t)=>{for(var r in t)Fn(e,r,{get:t[r],enumerable:!0})},jo=(e,t,r,n)=>{for(var i=n>1?void 0:n?zc(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&&Fn(t,r,i),i},tu=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{l(r.next(u))}catch(f){i(f)}},a=u=>{try{l(r.throw(u))}catch(f){i(f)}},l=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);l((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}au=(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))(au||{}),Jn=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}},$n=class extends Jn{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Ko=class extends Jn{constructor(){super(...arguments),this.kind="USER_ERROR"}},Go=class extends Ko{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},su=class extends Ko{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))}},qo=class extends $n{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},Wo=class extends $n{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},lr=class extends Jn{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}}},Hn=class extends $n{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};xe={log:Ct("log"),warn:Ct("warn"),info:Ct("info"),error:Ct("error"),debug:Ct("debug")};Object.assign(globalThis,{logger:xe});Ln=Symbol.for("Jolibox.canIUseMap"),cu={};globalThis[Ln]||(globalThis[Ln]=cu);Kn={get config(){return globalThis[Ln]}},Nt=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Nt||{}),st=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(st||{}),uu=(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))(uu||{}),Mo=["name","params"],du=["name","type","location","target","extra","timestamp","userId"],fu=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];lt=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});pu();mu=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Ae={isiOS:navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),iosVersion:()=>{let e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||"0",10)]},isAndroid:navigator.userAgent.includes("Android"),isMac:navigator.userAgent.includes("Mac"),isFacebook:navigator.userAgent.includes("FB_IAB"),isPC:!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},vu=()=>Ae.isiOS?"iOS":Ae.isAndroid?"Android":Ae.isMac?"Mac":Ae.isFacebook?"Facebook":"PC",_u="device_id",gu="advertising_id",Yo=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,lt()),window.__joliboxLocalStorage__.getItem(e)),qn=()=>new URLSearchParams(window.location.search).get("deviceId")||Yo(_u),yu=()=>Yo(gu),bu=e=>e.charAt(0).toUpperCase()+e.slice(1),Eu=()=>{var e;let t=new URLSearchParams(window.location.search);return bu((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},Qo=e=>{if(mu())return window.navigator.userAgent;let t="JoliboxWebSDK",r=vu(),n=navigator.language,i=qn(),o=yu();return`${t} (${Eu()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`},Un=class Mn{constructor(t){this.element=t,this.next=Mn.Undefined,this.prev=Mn.Undefined}};Un.Undefined=new Un(void 0);X=Un,wu=class{constructor(){this._first=X.Undefined,this._last=X.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===X.Undefined}clear(){let e=this._first;for(;e!==X.Undefined;){let t=e.next;e.prev=X.Undefined,e.next=X.Undefined,e=t}this._first=X.Undefined,this._last=X.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new X(e);if(this._first===X.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!==X.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==X.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==X.Undefined&&e.next!==X.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===X.Undefined&&e.next===X.Undefined?(this._first=X.Undefined,this._last=X.Undefined):e.next===X.Undefined?(this._last=this._last.prev,this._last.next=X.Undefined):e.prev===X.Undefined&&(this._first=this._first.next,this._first.prev=X.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==X.Undefined;)yield e.element,e=e.next}},Au=0,kt=class{constructor(e){this.value=e,this.id=Au++}},Pt=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 kt&&(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,l,u;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let f=new kt(t);return this._listeners?this._listeners instanceof kt?this._listeners=[this._listeners,f]:this._listeners.push(f):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=f,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(u=(l=this.options)==null?void 0:l.onDidAddListener)==null||u.call(l,this),this._size++,()=>{var y,p,g,_;if(!this._disposed){if(this._listeners instanceof kt)this._listeners.id===f.id&&(this._listeners=void 0,this._size=0,(p=(y=this.options)==null?void 0:y.onDidRemoveLastListener)==null||p.call(y));else if(this._listeners){let w=this._listeners.indexOf(f);w>=0&&(this._listeners.splice(w,1),this._size--,this._size===0&&((_=(g=this.options)==null?void 0:g.onDidRemoveLastListener)==null||_.call(g)))}}}}),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 kt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Pe=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){var r;let n=(r=this.listeners.get(e))!=null?r:new Pt,i=l=>t(...l.args),o=n.event(i);this.listerHandlerMap.set(t,{handler:i,dispose:o}),this.listeners.set(e,n);let a=this.cachedEventQueue.get(e);if(a)for(let l of a)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 wu,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}},Bn={};eu(Bn,{None:()=>Iu,filter:()=>Su,once:()=>Xo,toPromise:()=>Ru});Iu=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Nn=Symbol.for("Jolibox.hostEmitter"),Tu=()=>{let e=new Pe;return globalThis[Nn]||(globalThis[Nn]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e)}),globalThis[Nn]},Lt=Tu();sr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Pt,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 xu(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}};sr=jo([Jo],sr);jn=class{constructor(){this._onWillExecuteCommand=new Pt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Pt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new sr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=ru(3e4)),this._starActivation}executeCommand(e,...t){return tu(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),Bn.toPromise(Bn.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}}};jn=jo([Jo],jn);Zo=Symbol.for("Jolibox.commands")});function Oe(e,t={}){Wn.emit("ERROR_REPORT",{error:e,options:t})}var Wn,Ye,qe=V(()=>{"use strict";q();q();Wn=new Pe,Ye=new Pe;Oe.debounce=Dt(Oe,50,{leading:!0})});var zn,Pu,ea,ta,ra=V(()=>{"use strict";q();qe();zn=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{}}},Pu=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},ea=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,l]=i;return{headerJson:zn(o),payloadJson:zn(a),signature:zn(l)}}else throw"joli_source is missing"}catch(r){return Oe(new qo(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},ta=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=Pu(e),o=r[2];return`${n}.${i}.${o}`}return t}});var Du,cr,na,Yn=V(()=>{"use strict";q();Du="1.1.19-beta.6",cr=()=>Du,na=()=>{let e=cr();return`${Qo(e)}`}});var Nu,ia,Qn,oa,me,Lu,P,_e=V(()=>{"use strict";q();ra();Yn();q();Nu={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:qn(),pixelRatio:window.devicePixelRatio||1,platform:Ae.isAndroid?"android":Ae.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:cr()},schema:window.location.href,platform:Ae.isAndroid?"android":Ae.isiOS?"ios":"h5"},Qn=(ia=globalThis.joliboxJSCore)==null?void 0:ia.env,me=Object.assign({},(oa=Qn==null?void 0:Qn())!=null?oa:Nu),Lu=()=>{var g,_,w,A,O,b,k,N,K,Q,S;let{payloadJson:e,headerJson:t,signature:r}=me.schema.length?ea(me.schema):{},n=`${me.deviceInfo.did}-${new Date().getTime()}`,o=new URL(me.schema.length?me.schema:window.location.href).searchParams,a=(w=(_=(g=o.get("mpId"))!=null?g:o.get("appId"))!=null?_:o.get("gameId"))!=null?w:"",l=(b=(O=(A=me.clientSessionId)!=null?A:e==null?void 0:e.sessionId)!=null?O:o.get("sessionId"))!=null?b:n,u=!!((N=(k=e==null?void 0:e.testAdsMode)!=null?k:e==null?void 0:e.__testAdsMode)!=null?N:o.get("testAdsMode")==="true"),f=(S=(Q=(K=e==null?void 0:e.joliboxEnv)!=null?K:e==null?void 0:e.__joliboxEnv)!=null?Q:o.get("joliboxEnv"))!=null?S:"production",y=f==="staging",p=t==null?void 0:t.channel;return{get testMode(){return y},get testAdsMode(){return u},get joliboxEnv(){return f},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:cr()},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=me.platform)!=null?x:me.deviceInfo.platform).toLowerCase()},get deviceInfo(){return me.deviceInfo},get sdkInfo(){return me.sdkInfo},get hostInfo(){return me.hostInfo},get hostUserInfo(){return me.hostUserInfo},get sessionId(){var x,M;return(M=(x=me.clientSessionId)!=null?x:l)!=null?M:n},get channel(){return p},get webviewId(){var x;return(x=me.webviewId)!=null?x:-1},get shouldInterupt(){return e==null?void 0:e.__shouldInterupt},get from(){return e==null?void 0:e.__from},get baseApiHost(){return y?"https://stg-api.jolibox.com":"https://api.jolibox.com"},onEnvConfigChanged:x=>{$o(me,x,Ho)},encodeJoliSourceQuery:x=>{var M,F;return t&&r?ta(z(z({},e),x),(M=o.get("joliSource"))!=null?M:""):(F=o.get("joliSource"))!=null?F:""}}},P=Lu()});var Xn,sa,Uu,Mu,aa,Bu,la=V(()=>{"use strict";q();qe();_e();q();Xn=!1,sa=(e,t)=>e==null?!1:t in e,Uu=e=>sa(e,"kind"),Mu=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},aa=(e,t={},r)=>{var o,a,l;let n={user_id:(a=(o=P.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(l=P.deviceInfo.did)!=null?l:"",timestamp:Date.now(),tag:Mu(e.name)},i=fe(z({},n),{env:t.environment,isFromUser:r});r?Ye.emit("GLOBAL_USER_ERROR",e,i):Ye.emit("GLOBAL_ERROR",e,i)},Bu=e=>sa(e,"kind")&&e.kind==="USER_ERROR";Wn.on("ERROR_REPORT",({error:e,options:t})=>{if(Xn)return;Xn=!0;let r=Uu(e)&&e.raw?e.raw:e;try{let n=Bu(e);aa(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new Hn(`${i}, origin error: ${r.message}`);xe.error(o),aa(new Hn(o.message),{environment:t.environment},!1)}finally{Xn=!1}})});var Zn,ei=V(()=>{"use strict";qe();q();qe();Zn=e=>new Go(e)});function ca(e,t){let r=(n,i,o)=>{let a=fe(z({tag:n},t),{extra:z({},i)});n=="globalJsError"?Oe(new Wo(JSON.stringify(a))):e("systemLog",a,o)};return r.debounce=Dt(r,500,{leading:!0}),r}function ua(e){let t=(r,n,i)=>{var l;let o=(l=i&&JSON.stringify(i))!=null?l:0,a={speed_value_type:r,total_duration:n};o&&Object.assign(a,{extra:o}),e("joliboxSpeedAnalysis",a)};return t.debounce=Dt(t,500,{leading:!0}),t}var da=V(()=>{"use strict";q();q();qe()});function fa(e,t){let r=ca(e,t),n=ua(r);return{track:r,trackPerformance:n}}var ha=V(()=>{"use strict";da()});var ti=V(()=>{"use strict"});var ur,pa=V(()=>{"use strict";_e();q();q();ur=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return L(this,null,function*(){let r=`${P.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"}/api/fe-configs/js-sdk/samples-config`,n=yield(yield fetch(r)).json();this.samplesConfig=n})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:r}=this.samplesConfig;for(let[n,i]of Object.entries(r))if(i.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,i,o,a,l;let{nativeSDKVersion:t,jssdkVersion:r}=P.sdkInfo;return{platform:1e3,os:P.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(o=(i=P.hostInfo)==null?void 0:i.aid)!=null?o:"1",model:(a=P.deviceInfo.model)!=null?a:"UnknownModel",brand:(l=P.deviceInfo.brand)!=null?l:"UnknownBrand",uuid:P.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 L(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 l=this.deviceInfo,f={protocolVersion:"1.0.0",events:[fe(z({},t),{location:i,target:o,extra:a,timestamp:Date.now(),userId:null})],device:l,project:r};try{n?yield this.doReport(Gn(f),n):yield this.doReport(Gn(f))}catch(y){xe.log("[Jolibox SDK] report API error",y)}})}}});var ri=V(()=>{"use strict";ha();ti();pa()});var ni,ma,Be,dr,je,Ut=V(()=>{"use strict";Yn();_e();ni=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(ma=AbortSignal.timeout)!=null||(AbortSignal.timeout=ni);Be=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 dr(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},dr=class{constructor(t){this.xua=na();this.getJoliSource=()=>P.joliSource;var n;let r=P.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com";this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return L(this,null,function*(){try{let{query:n,timeout:i}=r!=null?r:{},{headers:o}=r!=null?r:{},a=n?new URLSearchParams(n):null,l=a==null?void 0:a.toString(),u=`${this.baseUrl}${t}${l?`?${l}`:""}`,f=this.xua,y=this.getJoliSource();o=Object.assign({},o!=null?o:{},f?{"x-user-agent":f}:{},y?{"x-joli-source":y}:{});let p=yield fetch(u,{method:"GET",headers:o,credentials:"include",signal:ni(i!=null?i:3e4)});return Be.getInstance().recordNetworkRequest(!0),yield p.json()}catch(n){throw Be.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return L(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},l=i?new URLSearchParams(i):null,u=l==null?void 0:l.toString(),f=`${this.baseUrl}${t}${u?`?${u}`:""}`,y=this.xua,p=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},p?{"x-joli-source":p}:{});let g=yield fetch(f,{method:"POST",headers:a,body:JSON.stringify(n),signal:ni(o!=null?o:3e4),credentials:"include"});Be.getInstance().recordNetworkRequest(!0);let _=g.headers.get("content-type");if(_!=null&&_.includes("application/octet-stream"))try{return g.blob()}catch(w){return yield g.arrayBuffer()}if(_!=null&&_.includes("multipart/form-data")||_!=null&&_.includes("application/x-www-form-urlencoded"))try{return g.formData()}catch(w){return yield g.text()}if(_!=null&&_.includes("application/json"))try{return yield g.json()}catch(w){return yield g.text()}return g}catch(n){throw Be.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return L(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},l=i?new URLSearchParams(i):null,u=l==null?void 0:l.toString(),f=`${this.baseUrl}${t}${u?`?${u}`:""}`,y=this.xua,p=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},p?{"x-joli-source":p}:{});let g=yield fetch(f,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!g.ok)throw Be.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${g.status}`);return Be.getInstance().recordNetworkRequest(!0),yield g.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=dr;je=Be.getInstance()});var ii,fr,oi=V(()=>{"use strict";_e();ri();Ut();ii=class extends ur{constructor(){super(...arguments);this.hostToApiMap={default:{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.jolibox.com":{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.pico-game.com":{test:"https://stg-collect.pico-game.com",prod:"https://collect.pico-game.com"}};this.httpClient=je.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n,i;let r=(n=this.hostToApiMap[window.location.host])!=null?n:this.hostToApiMap.default;return(i=P.testMode)!=null&&i?r.test:r.prod}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},fr=new ii});var ju,va=V(()=>{"use strict";la();q();ei();q();oi();_e();ju=(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:Nt.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=P.hostUserInfo)==null?void 0:o.uid)!=null?a:null};fr.trackEvent(n,st.WebSDK)};Ye.on("GLOBAL_ERROR",(e,t)=>{ju(t.tag,e)});Ye.on("GLOBAL_USER_ERROR",(e,t)=>{xe.log("UserError",e,t)})});var hr,_a=V(()=>{"use strict";hr=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,l=()=>{if(!o)return;let _=Date.now(),w=_-r;w>=this.interval&&(this.visible&&(a+=w,t(a)),r=_),n=requestAnimationFrame(l)},u=()=>{y(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let _=Date.now();_-r>=this.interval&&(r=_)},this.interval)},f=()=>{p(),r=Date.now(),n=requestAnimationFrame(l)},y=()=>{n&&(cancelAnimationFrame(n),n=0)},p=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",_=>{o&&(console.log("visible",_),_?f():u())});let g=this.visible;return{start(){o||(o=!0,g?f():u())},stop(){o=!1,y(),p()}}}}});var pr,ga=V(()=>{"use strict";_e();_a();Ut();pr=class extends hr{constructor(r,n,i){super(n,i);this.httpClient=je.create();this.gameId=P.mpId,this.sessionId=P.sessionId,this.track=r}reporter(r){return L(this,null,function*(){let{event:n,params:i}=r;yield this.httpClient.post("/api/base/app-event",{data:{eventType:n,gameInfo:z({gameId:this.gameId,sessionId:this.sessionId},i)}})})}tracker(r,n=null){this.track(r,n)}}});var ya,Fu,De,Vu,ai,Ce,Qe=V(()=>{"use strict";va();q();q();ri();oi();ga();_e();ti();ya=Ie(),Fu={type:st.WebSDK,platform:"h5",jssdk_version:P.sdkInfo.jssdkVersion,mp_id:P.mpId,mp_version:P.mpVersion},{track:De,trackPerformance:Vu}=fa((...e)=>{var a,l,u,f;let[,t]=e,r=t,n=Fo(r.extra)?r.extra:Vn(r.extra)?JSON.parse(r.extra):{},i=fe(z({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(l=r.mp_version)!=null?l:""}),o={name:t.tag,type:Nt.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(f=(u=P.hostUserInfo)==null?void 0:u.uid)!=null?f:null};fr.trackEvent(o,st.WebSDK)},Fu);ya.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Vu(e,t,r)});ya.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{De(e,t)});ai=new Pe,Ce=new pr(De,ai)});function ba(e){let t=Kn.config[e];return t||(t={},Kn.config[e]=t),(r,n)=>{if(t[r]){xe.warn(`[can i use] ${r} already registered`);return}t[r]=z({},n)}}var Ea=V(()=>{"use strict";q()});function si(e){wa=e}function mr(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>mr(t)):Object.keys(e).reduce((t,r)=>(t[r]=mr(e[r]),t),{})}function Fe(e){return typeof e=="number"}function li(e){let t=ci(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function ci(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var wa,ie,vr,_r,gr,yr,ct,br,Er,wr,Ar,Ir,Rr,Sr,Tr,xr,Or,Cr,kr,ui=V(()=>{"use strict";wa=!1;ie=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(wa)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 ${li(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return mr(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:mr(this._default)}optional(){return this._optional=!0,this}};vr=class extends ie{validate(t){return this._optional&&t===void 0?!0:Fe(t)?Fe(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):Fe(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):Fe(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}},_r=class extends ie{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},gr=class extends ie{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(Fe(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(Fe(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}},yr=class extends ie{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},ct=class extends ie{validate(t){return!0}},br=class extends ie{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},Er=class extends ie{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},wr=class extends ie{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Ar=class extends ie{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 ${li(t)}`)}return!0}},Ir=class extends ie{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(Fe(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(Fe(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(Fe(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}},Rr=class extends ie{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(ci(r)!=="object")return this.fail({expect:"object",actual:r});let i=r,o=this._value;o.errors=this.errors;let a=!0;for(let l in i){let u=i[l];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(l)?o.path=`${this.path}.${l}`:o.path=`${this.path}["${l}"]`,!(u===void 0&&o._optional)){if(u===void 0&&o.hasDefault){i[l]=o.defaultValue;continue}o.validate(u)||(o.hasFallback?i[l]=o.fallbackValue:a=!1)}}return a}},Sr=class extends ie{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(ci(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,i=!0;for(let o in this._object){let a=n[o],l=this._object[o];if(l.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(o)?l.path=`${this.path}.${o}`:l.path=`${this.path}["${o}"]`,!(l._optional&&a===void 0)){if(a===void 0&&l.hasDefault){n[o]=l.defaultValue;continue}l.validate(a)||(l.hasFallback?n[o]=l.fallbackValue:i=!1)}}return i}},Tr=class extends ie{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:li(this.value),actual:r}):!0}},xr=class extends ie{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
|
+
or `);this.errors.push(o)}return n}},Or=class extends ie{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}},Cr=class extends ie{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},kr=class extends ie{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 di(e,t,r="param"){if(e.errors=[],e.path=r,si(!0),!e.validate(t)){let n=e.errors.join(`
|
|
3
|
+
`);throw e.errors.length=0,si(!1),new TypeError(n)}}var U,fi=V(()=>{"use strict";ui();ui();U={object(e){return new Sr(e)},array(e){return new Ir(e)},tuple(...e){return new Or(...e)},literal(e){return new Tr(e)},or(...e){return new xr(...e)},symbol(){return new yr},record(e){return new Rr(e)},function(){return new wr},boolean(){return new _r},string(){return new gr},number(){return new vr},undefined(){return new br},null(){return new Er},unknown(){return new ct},any(){return new ct},as(){return new ct},arraybuffer(){return new Cr},enum(...e){return new Ar(...e)},typedarray(e){return new kr(e)}}});var Pr,Aa,Ia=V(()=>{"use strict";q();qe();fi();ei();Pr=1,Aa=e=>{function t(n,i){return(...o)=>{var p,g,_,w;let a=Date.now(),l={method:n,trace_id:Pr};Pr+=1;let u="SUCCESS",f=`${n}:ok`,y=0;try{if(i.paramsSchema)try{di(i.paramsSchema,o,"params")}catch(k){throw Zn(`${n}:fail ${k.message}`)}let A=i.implement(...o),O=A,b=`${n}:ok`;if(A&&"code"in A){let{code:k,data:N,message:K}=A;u=k,O=N,b=K}return{code:u,message:b,data:O}}catch(A){let O=A;y=(g=(p=O.code)!=null?p:O.errNo)!=null?g:2e3,u="FAILURE";let b=(w=(_=O.message)!=null?_:O.errMsg)!=null?w:`${A}`;return f=`${n}:${u} ${b.replace(/^\S+:(fail|cancel)\s?/,"")}`,Oe(new lr(f,y)),{code:u,message:f}}finally{let A=Date.now()-a;e("apiInvoked",fe(z({},l),{duration:A,status:u}))}}}function r(n,i){return(...o)=>L(this,null,function*(){var g,_,w,A;let a=Vo(o)?o:[o],l=Date.now(),u={method:n,trace_id:Pr};Pr+=1;let f=`${n}:ok`,y="SUCCESS",p={code:y,message:f};try{if(i.paramsSchema)try{di(i.paramsSchema,a,"params")}catch(k){throw Zn(k.message)}let b=yield i.implement(...a);if(b&&"code"in b){let{code:k,data:N,message:K}=b;y=k,f=K,b=N}return Object.assign(p,{code:y,message:f,data:b}),p}catch(O){let b=O,k=(_=(g=b.code)!=null?g:b.errNo)!=null?_:2e3;y="FAILURE";let N=(A=(w=b.message)!=null?w:b.errMsg)!=null?A:`${O}`,K=`${n}:${y} ${N.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(p,{code:y,message:K}),Oe(new lr(K,k)),p}finally{let O=Date.now()-l;e("apiInvoked",fe(z({},u),{duration:O,status:y}))}})}return{createAPI:r,createSyncAPI:t}}});var Re,Xe,ae,Mt=V(()=>{"use strict";Ea();Qe();Ia();fi();({createAPI:Re,createSyncAPI:Xe}=Aa(De)),ae=ba("h5")});var xa=ir((Ta,vi)=>{(function(e){if(typeof Ta=="object"&&typeof vi!="undefined")vi.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 l(y,p){if(!o[y]){if(!i[y]){var g=typeof Ot=="function"&&Ot;if(!p&&g)return g(y,!0);if(u)return u(y,!0);var _=new Error("Cannot find module '"+y+"'");throw _.code="MODULE_NOT_FOUND",_}var w=o[y]={exports:{}};i[y][0].call(w.exports,function(A){var O=i[y][1][A];return l(O||A)},w,w.exports,n,i,o,a)}return o[y].exports}for(var u=typeof Ot=="function"&&Ot,f=0;f<a.length;f++)l(a[f]);return l}({1:[function(n,i,o){(function(a){"use strict";var l=a.MutationObserver||a.WebKitMutationObserver,u;if(l){var f=0,y=new l(A),p=a.document.createTextNode("");y.observe(p,{characterData:!0}),u=function(){p.data=f=++f%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var g=new a.MessageChannel;g.port1.onmessage=A,u=function(){g.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 _,w=[];function A(){_=!0;for(var b,k,N=w.length;N;){for(k=w,w=[],b=-1;++b<N;)k[b]();N=w.length}_=!1}i.exports=O;function O(b){w.push(b)===1&&!_&&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 l(){}var u={},f=["REJECTED"],y=["FULFILLED"],p=["PENDING"];i.exports=g;function g(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,S!==l&&O(this,S)}g.prototype.catch=function(S){return this.then(null,S)},g.prototype.then=function(S,x){if(typeof S!="function"&&this.state===y||typeof x!="function"&&this.state===f)return this;var M=new this.constructor(l);if(this.state!==p){var F=this.state===y?S:x;w(M,F,this.outcome)}else this.queue.push(new _(M,S,x));return M};function _(S,x,M){this.promise=S,typeof x=="function"&&(this.onFulfilled=x,this.callFulfilled=this.otherCallFulfilled),typeof M=="function"&&(this.onRejected=M,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(S){u.resolve(this.promise,S)},_.prototype.otherCallFulfilled=function(S){w(this.promise,this.onFulfilled,S)},_.prototype.callRejected=function(S){u.reject(this.promise,S)},_.prototype.otherCallRejected=function(S){w(this.promise,this.onRejected,S)};function w(S,x,M){a(function(){var F;try{F=x(M)}catch(ee){return u.reject(S,ee)}F===S?u.reject(S,new TypeError("Cannot resolve promise with itself")):u.resolve(S,F)})}u.resolve=function(S,x){var M=b(A,x);if(M.status==="error")return u.reject(S,M.value);var F=M.value;if(F)O(S,F);else{S.state=y,S.outcome=x;for(var ee=-1,Y=S.queue.length;++ee<Y;)S.queue[ee].callFulfilled(x)}return S},u.reject=function(S,x){S.state=f,S.outcome=x;for(var M=-1,F=S.queue.length;++M<F;)S.queue[M].callRejected(x);return S};function A(S){var x=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof x=="function")return function(){x.apply(S,arguments)}}function O(S,x){var M=!1;function F(Ee){M||(M=!0,u.reject(S,Ee))}function ee(Ee){M||(M=!0,u.resolve(S,Ee))}function Y(){x(ee,F)}var se=b(Y);se.status==="error"&&F(se.value)}function b(S,x){var M={};try{M.value=S(x),M.status="success"}catch(F){M.status="error",M.value=F}return M}g.resolve=k;function k(S){return S instanceof this?S:u.resolve(new this(l),S)}g.reject=N;function N(S){var x=new this(l);return u.reject(x,S)}g.all=K;function K(S){var x=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var M=S.length,F=!1;if(!M)return this.resolve([]);for(var ee=new Array(M),Y=0,se=-1,Ee=new this(l);++se<M;)Ue(S[se],se);return Ee;function Ue(St,tr){x.resolve(St).then(An,function(ot){F||(F=!0,u.reject(Ee,ot))});function An(ot){ee[tr]=ot,++Y===M&&!F&&(F=!0,u.resolve(Ee,ee))}}}g.race=Q;function Q(S){var x=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var M=S.length,F=!1;if(!M)return this.resolve([]);for(var ee=-1,Y=new this(l);++ee<M;)se(S[ee]);return Y;function se(Ee){x.resolve(Ee).then(function(Ue){F||(F=!0,u.resolve(Y,Ue))},function(Ue){F||(F=!0,u.reject(Y,Ue))})}}},{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(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s};function l(s,d){if(!(s instanceof d))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(s){return}}var f=u();function y(){try{if(!f||!f.open)return!1;var s=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),d=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!s||d)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(c){return!1}}function p(s,d){s=s||[],d=d||{};try{return new Blob(s,d)}catch(h){if(h.name!=="TypeError")throw h;for(var c=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,m=new c,v=0;v<s.length;v+=1)m.append(s[v]);return m.getBlob(d.type)}}typeof Promise=="undefined"&&n(3);var g=Promise;function _(s,d){d&&s.then(function(c){d(null,c)},function(c){d(c)})}function w(s,d,c){typeof d=="function"&&s.then(d),typeof c=="function"&&s.catch(c)}function A(s){return typeof s!="string"&&(console.warn(s+" used as a key, but it is not a string."),s=String(s)),s}function O(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var b="local-forage-detect-blob-support",k=void 0,N={},K=Object.prototype.toString,Q="readonly",S="readwrite";function x(s){for(var d=s.length,c=new ArrayBuffer(d),m=new Uint8Array(c),v=0;v<d;v++)m[v]=s.charCodeAt(v);return c}function M(s){return new g(function(d){var c=s.transaction(b,S),m=p([""]);c.objectStore(b).put(m,"key"),c.onabort=function(v){v.preventDefault(),v.stopPropagation(),d(!1)},c.oncomplete=function(){var v=navigator.userAgent.match(/Chrome\/(\d+)/),h=navigator.userAgent.match(/Edge\//);d(h||!v||parseInt(v[1],10)>=43)}}).catch(function(){return!1})}function F(s){return typeof k=="boolean"?g.resolve(k):M(s).then(function(d){return k=d,k})}function ee(s){var d=N[s.name],c={};c.promise=new g(function(m,v){c.resolve=m,c.reject=v}),d.deferredOperations.push(c),d.dbReady?d.dbReady=d.dbReady.then(function(){return c.promise}):d.dbReady=c.promise}function Y(s){var d=N[s.name],c=d.deferredOperations.pop();if(c)return c.resolve(),c.promise}function se(s,d){var c=N[s.name],m=c.deferredOperations.pop();if(m)return m.reject(d),m.promise}function Ee(s,d){return new g(function(c,m){if(N[s.name]=N[s.name]||uo(),s.db)if(d)ee(s),s.db.close();else return c(s.db);var v=[s.name];d&&v.push(s.version);var h=f.open.apply(f,v);d&&(h.onupgradeneeded=function(E){var I=h.result;try{I.createObjectStore(s.storeName),E.oldVersion<=1&&I.createObjectStore(b)}catch(R){if(R.name==="ConstraintError")console.warn('The database "'+s.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+s.storeName+'" already exists.');else throw R}}),h.onerror=function(E){E.preventDefault(),m(h.error)},h.onsuccess=function(){var E=h.result;E.onversionchange=function(I){I.target.close()},c(E),Y(s)}})}function Ue(s){return Ee(s,!1)}function St(s){return Ee(s,!0)}function tr(s,d){if(!s.db)return!0;var c=!s.db.objectStoreNames.contains(s.storeName),m=s.version<s.db.version,v=s.version>s.db.version;if(m&&(s.version!==d&&console.warn('The database "'+s.name+`" can't be downgraded from version `+s.db.version+" to version "+s.version+"."),s.version=s.db.version),v||c){if(c){var h=s.db.version+1;h>s.version&&(s.version=h)}return!0}return!1}function An(s){return new g(function(d,c){var m=new FileReader;m.onerror=c,m.onloadend=function(v){var h=btoa(v.target.result||"");d({__local_forage_encoded_blob:!0,data:h,type:s.type})},m.readAsBinaryString(s)})}function ot(s){var d=x(atob(s.data));return p([d],{type:s.type})}function co(s){return s&&s.__local_forage_encoded_blob}function Vl(s){var d=this,c=d._initReady().then(function(){var m=N[d._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return w(c,s,s),c}function Jl(s){ee(s);for(var d=N[s.name],c=d.forages,m=0;m<c.length;m++){var v=c[m];v._dbInfo.db&&(v._dbInfo.db.close(),v._dbInfo.db=null)}return s.db=null,Ue(s).then(function(h){return s.db=h,tr(s)?St(s):h}).then(function(h){s.db=d.db=h;for(var E=0;E<c.length;E++)c[E]._dbInfo.db=h}).catch(function(h){throw se(s,h),h})}function Me(s,d,c,m){m===void 0&&(m=1);try{var v=s.db.transaction(s.storeName,d);c(null,v)}catch(h){if(m>0&&(!s.db||h.name==="InvalidStateError"||h.name==="NotFoundError"))return g.resolve().then(function(){if(!s.db||h.name==="NotFoundError"&&!s.db.objectStoreNames.contains(s.storeName)&&s.version<=s.db.version)return s.db&&(s.version=s.db.version+1),St(s)}).then(function(){return Jl(s).then(function(){Me(s,d,c,m-1)})}).catch(c);c(h)}}function uo(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function $l(s){var d=this,c={db:null};if(s)for(var m in s)c[m]=s[m];var v=N[c.name];v||(v=uo(),N[c.name]=v),v.forages.push(d),d._initReady||(d._initReady=d.ready,d.ready=Vl);var h=[];function E(){return g.resolve()}for(var I=0;I<v.forages.length;I++){var R=v.forages[I];R!==d&&h.push(R._initReady().catch(E))}var T=v.forages.slice(0);return g.all(h).then(function(){return c.db=v.db,Ue(c)}).then(function(C){return c.db=C,tr(c,d._defaultConfig.version)?St(c):C}).then(function(C){c.db=v.db=C,d._dbInfo=c;for(var D=0;D<T.length;D++){var j=T[D];j!==d&&(j._dbInfo.db=c.db,j._dbInfo.version=c.version)}})}function Hl(s,d){var c=this;s=A(s);var m=new g(function(v,h){c.ready().then(function(){Me(c._dbInfo,Q,function(E,I){if(E)return h(E);try{var R=I.objectStore(c._dbInfo.storeName),T=R.get(s);T.onsuccess=function(){var C=T.result;C===void 0&&(C=null),co(C)&&(C=ot(C)),v(C)},T.onerror=function(){h(T.error)}}catch(C){h(C)}})}).catch(h)});return _(m,d),m}function Kl(s,d){var c=this,m=new g(function(v,h){c.ready().then(function(){Me(c._dbInfo,Q,function(E,I){if(E)return h(E);try{var R=I.objectStore(c._dbInfo.storeName),T=R.openCursor(),C=1;T.onsuccess=function(){var D=T.result;if(D){var j=D.value;co(j)&&(j=ot(j));var H=s(j,D.key,C++);H!==void 0?v(H):D.continue()}else v()},T.onerror=function(){h(T.error)}}catch(D){h(D)}})}).catch(h)});return _(m,d),m}function Gl(s,d,c){var m=this;s=A(s);var v=new g(function(h,E){var I;m.ready().then(function(){return I=m._dbInfo,K.call(d)==="[object Blob]"?F(I.db).then(function(R){return R?d:An(d)}):d}).then(function(R){Me(m._dbInfo,S,function(T,C){if(T)return E(T);try{var D=C.objectStore(m._dbInfo.storeName);R===null&&(R=void 0);var j=D.put(R,s);C.oncomplete=function(){R===void 0&&(R=null),h(R)},C.onabort=C.onerror=function(){var H=j.error?j.error:j.transaction.error;E(H)}}catch(H){E(H)}})}).catch(E)});return _(v,c),v}function ql(s,d){var c=this;s=A(s);var m=new g(function(v,h){c.ready().then(function(){Me(c._dbInfo,S,function(E,I){if(E)return h(E);try{var R=I.objectStore(c._dbInfo.storeName),T=R.delete(s);I.oncomplete=function(){v()},I.onerror=function(){h(T.error)},I.onabort=function(){var C=T.error?T.error:T.transaction.error;h(C)}}catch(C){h(C)}})}).catch(h)});return _(m,d),m}function Wl(s){var d=this,c=new g(function(m,v){d.ready().then(function(){Me(d._dbInfo,S,function(h,E){if(h)return v(h);try{var I=E.objectStore(d._dbInfo.storeName),R=I.clear();E.oncomplete=function(){m()},E.onabort=E.onerror=function(){var T=R.error?R.error:R.transaction.error;v(T)}}catch(T){v(T)}})}).catch(v)});return _(c,s),c}function zl(s){var d=this,c=new g(function(m,v){d.ready().then(function(){Me(d._dbInfo,Q,function(h,E){if(h)return v(h);try{var I=E.objectStore(d._dbInfo.storeName),R=I.count();R.onsuccess=function(){m(R.result)},R.onerror=function(){v(R.error)}}catch(T){v(T)}})}).catch(v)});return _(c,s),c}function Yl(s,d){var c=this,m=new g(function(v,h){if(s<0){v(null);return}c.ready().then(function(){Me(c._dbInfo,Q,function(E,I){if(E)return h(E);try{var R=I.objectStore(c._dbInfo.storeName),T=!1,C=R.openKeyCursor();C.onsuccess=function(){var D=C.result;if(!D){v(null);return}s===0||T?v(D.key):(T=!0,D.advance(s))},C.onerror=function(){h(C.error)}}catch(D){h(D)}})}).catch(h)});return _(m,d),m}function Ql(s){var d=this,c=new g(function(m,v){d.ready().then(function(){Me(d._dbInfo,Q,function(h,E){if(h)return v(h);try{var I=E.objectStore(d._dbInfo.storeName),R=I.openKeyCursor(),T=[];R.onsuccess=function(){var C=R.result;if(!C){m(T);return}T.push(C.key),C.continue()},R.onerror=function(){v(R.error)}}catch(C){v(C)}})}).catch(v)});return _(c,s),c}function Xl(s,d){d=O.apply(this,arguments);var c=this.config();s=typeof s!="function"&&s||{},s.name||(s.name=s.name||c.name,s.storeName=s.storeName||c.storeName);var m=this,v;if(!s.name)v=g.reject("Invalid arguments");else{var h=s.name===c.name&&m._dbInfo.db,E=h?g.resolve(m._dbInfo.db):Ue(s).then(function(I){var R=N[s.name],T=R.forages;R.db=I;for(var C=0;C<T.length;C++)T[C]._dbInfo.db=I;return I});s.storeName?v=E.then(function(I){if(I.objectStoreNames.contains(s.storeName)){var R=I.version+1;ee(s);var T=N[s.name],C=T.forages;I.close();for(var D=0;D<C.length;D++){var j=C[D];j._dbInfo.db=null,j._dbInfo.version=R}var H=new g(function(G,ne){var te=f.open(s.name,R);te.onerror=function(we){var xt=te.result;xt.close(),ne(we)},te.onupgradeneeded=function(){var we=te.result;we.deleteObjectStore(s.storeName)},te.onsuccess=function(){var we=te.result;we.close(),G(we)}});return H.then(function(G){T.db=G;for(var ne=0;ne<C.length;ne++){var te=C[ne];te._dbInfo.db=G,Y(te._dbInfo)}}).catch(function(G){throw(se(s,G)||g.resolve()).catch(function(){}),G})}}):v=E.then(function(I){ee(s);var R=N[s.name],T=R.forages;I.close();for(var C=0;C<T.length;C++){var D=T[C];D._dbInfo.db=null}var j=new g(function(H,G){var ne=f.deleteDatabase(s.name);ne.onerror=function(){var te=ne.result;te&&te.close(),G(ne.error)},ne.onblocked=function(){console.warn('dropInstance blocked for database "'+s.name+'" until all open connections are closed')},ne.onsuccess=function(){var te=ne.result;te&&te.close(),H(te)}});return j.then(function(H){R.db=H;for(var G=0;G<T.length;G++){var ne=T[G];Y(ne._dbInfo)}}).catch(function(H){throw(se(s,H)||g.resolve()).catch(function(){}),H})})}return _(v,d),v}var Zl={_driver:"asyncStorage",_initStorage:$l,_support:y(),iterate:Kl,getItem:Hl,setItem:Gl,removeItem:ql,clear:Wl,length:zl,key:Yl,keys:Ql,dropInstance:Xl};function ec(){return typeof openDatabase=="function"}var Ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tc="~~local_forage_type~",fo=/^~~local_forage_type~([^~]+)~/,rr="__lfsc__:",In=rr.length,Rn="arbf",Sn="blob",ho="si08",po="ui08",mo="uic8",vo="si16",_o="si32",go="ur16",yo="ui32",bo="fl32",Eo="fl64",wo=In+Rn.length,Ao=Object.prototype.toString;function Io(s){var d=s.length*.75,c=s.length,m,v=0,h,E,I,R;s[s.length-1]==="="&&(d--,s[s.length-2]==="="&&d--);var T=new ArrayBuffer(d),C=new Uint8Array(T);for(m=0;m<c;m+=4)h=Ke.indexOf(s[m]),E=Ke.indexOf(s[m+1]),I=Ke.indexOf(s[m+2]),R=Ke.indexOf(s[m+3]),C[v++]=h<<2|E>>4,C[v++]=(E&15)<<4|I>>2,C[v++]=(I&3)<<6|R&63;return T}function Tn(s){var d=new Uint8Array(s),c="",m;for(m=0;m<d.length;m+=3)c+=Ke[d[m]>>2],c+=Ke[(d[m]&3)<<4|d[m+1]>>4],c+=Ke[(d[m+1]&15)<<2|d[m+2]>>6],c+=Ke[d[m+2]&63];return d.length%3===2?c=c.substring(0,c.length-1)+"=":d.length%3===1&&(c=c.substring(0,c.length-2)+"=="),c}function rc(s,d){var c="";if(s&&(c=Ao.call(s)),s&&(c==="[object ArrayBuffer]"||s.buffer&&Ao.call(s.buffer)==="[object ArrayBuffer]")){var m,v=rr;s instanceof ArrayBuffer?(m=s,v+=Rn):(m=s.buffer,c==="[object Int8Array]"?v+=ho:c==="[object Uint8Array]"?v+=po:c==="[object Uint8ClampedArray]"?v+=mo:c==="[object Int16Array]"?v+=vo:c==="[object Uint16Array]"?v+=go:c==="[object Int32Array]"?v+=_o:c==="[object Uint32Array]"?v+=yo:c==="[object Float32Array]"?v+=bo:c==="[object Float64Array]"?v+=Eo:d(new Error("Failed to get type for BinaryArray"))),d(v+Tn(m))}else if(c==="[object Blob]"){var h=new FileReader;h.onload=function(){var E=tc+s.type+"~"+Tn(this.result);d(rr+Sn+E)},h.readAsArrayBuffer(s)}else try{d(JSON.stringify(s))}catch(E){console.error("Couldn't convert value into a JSON string: ",s),d(null,E)}}function nc(s){if(s.substring(0,In)!==rr)return JSON.parse(s);var d=s.substring(wo),c=s.substring(In,wo),m;if(c===Sn&&fo.test(d)){var v=d.match(fo);m=v[1],d=d.substring(v[0].length)}var h=Io(d);switch(c){case Rn:return h;case Sn:return p([h],{type:m});case ho:return new Int8Array(h);case po:return new Uint8Array(h);case mo:return new Uint8ClampedArray(h);case vo:return new Int16Array(h);case go:return new Uint16Array(h);case _o:return new Int32Array(h);case yo:return new Uint32Array(h);case bo:return new Float32Array(h);case Eo:return new Float64Array(h);default:throw new Error("Unkown type: "+c)}}var xn={serialize:rc,deserialize:nc,stringToBuffer:Io,bufferToString:Tn};function Ro(s,d,c,m){s.executeSql("CREATE TABLE IF NOT EXISTS "+d.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,m)}function ic(s){var d=this,c={db:null};if(s)for(var m in s)c[m]=typeof s[m]!="string"?s[m].toString():s[m];var v=new g(function(h,E){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(I){return E(I)}c.db.transaction(function(I){Ro(I,c,function(){d._dbInfo=c,h()},function(R,T){E(T)})},E)});return c.serializer=xn,v}function Ge(s,d,c,m,v,h){s.executeSql(c,m,v,function(E,I){I.code===I.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[d.storeName],function(R,T){T.rows.length?h(R,I):Ro(R,d,function(){R.executeSql(c,m,v,h)},h)},h):h(E,I)},h)}function oc(s,d){var c=this;s=A(s);var m=new g(function(v,h){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){Ge(I,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[s],function(R,T){var C=T.rows.length?T.rows.item(0).value:null;C&&(C=E.serializer.deserialize(C)),v(C)},function(R,T){h(T)})})}).catch(h)});return _(m,d),m}function ac(s,d){var c=this,m=new g(function(v,h){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){Ge(I,E,"SELECT * FROM "+E.storeName,[],function(R,T){for(var C=T.rows,D=C.length,j=0;j<D;j++){var H=C.item(j),G=H.value;if(G&&(G=E.serializer.deserialize(G)),G=s(G,H.key,j+1),G!==void 0){v(G);return}}v()},function(R,T){h(T)})})}).catch(h)});return _(m,d),m}function So(s,d,c,m){var v=this;s=A(s);var h=new g(function(E,I){v.ready().then(function(){d===void 0&&(d=null);var R=d,T=v._dbInfo;T.serializer.serialize(d,function(C,D){D?I(D):T.db.transaction(function(j){Ge(j,T,"INSERT OR REPLACE INTO "+T.storeName+" (key, value) VALUES (?, ?)",[s,C],function(){E(R)},function(H,G){I(G)})},function(j){if(j.code===j.QUOTA_ERR){if(m>0){E(So.apply(v,[s,R,c,m-1]));return}I(j)}})})}).catch(I)});return _(h,c),h}function sc(s,d,c){return So.apply(this,[s,d,c,1])}function lc(s,d){var c=this;s=A(s);var m=new g(function(v,h){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){Ge(I,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[s],function(){v()},function(R,T){h(T)})})}).catch(h)});return _(m,d),m}function cc(s){var d=this,c=new g(function(m,v){d.ready().then(function(){var h=d._dbInfo;h.db.transaction(function(E){Ge(E,h,"DELETE FROM "+h.storeName,[],function(){m()},function(I,R){v(R)})})}).catch(v)});return _(c,s),c}function uc(s){var d=this,c=new g(function(m,v){d.ready().then(function(){var h=d._dbInfo;h.db.transaction(function(E){Ge(E,h,"SELECT COUNT(key) as c FROM "+h.storeName,[],function(I,R){var T=R.rows.item(0).c;m(T)},function(I,R){v(R)})})}).catch(v)});return _(c,s),c}function dc(s,d){var c=this,m=new g(function(v,h){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(I){Ge(I,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[s+1],function(R,T){var C=T.rows.length?T.rows.item(0).key:null;v(C)},function(R,T){h(T)})})}).catch(h)});return _(m,d),m}function fc(s){var d=this,c=new g(function(m,v){d.ready().then(function(){var h=d._dbInfo;h.db.transaction(function(E){Ge(E,h,"SELECT key FROM "+h.storeName,[],function(I,R){for(var T=[],C=0;C<R.rows.length;C++)T.push(R.rows.item(C).key);m(T)},function(I,R){v(R)})})}).catch(v)});return _(c,s),c}function hc(s){return new g(function(d,c){s.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(v,h){for(var E=[],I=0;I<h.rows.length;I++)E.push(h.rows.item(I).name);d({db:s,storeNames:E})},function(v,h){c(h)})},function(m){c(m)})})}function pc(s,d){d=O.apply(this,arguments);var c=this.config();s=typeof s!="function"&&s||{},s.name||(s.name=s.name||c.name,s.storeName=s.storeName||c.storeName);var m=this,v;return s.name?v=new g(function(h){var E;s.name===c.name?E=m._dbInfo.db:E=openDatabase(s.name,"","",0),s.storeName?h({db:E,storeNames:[s.storeName]}):h(hc(E))}).then(function(h){return new g(function(E,I){h.db.transaction(function(R){function T(H){return new g(function(G,ne){R.executeSql("DROP TABLE IF EXISTS "+H,[],function(){G()},function(te,we){ne(we)})})}for(var C=[],D=0,j=h.storeNames.length;D<j;D++)C.push(T(h.storeNames[D]));g.all(C).then(function(){E()}).catch(function(H){I(H)})},function(R){I(R)})})}):v=g.reject("Invalid arguments"),_(v,d),v}var mc={_driver:"webSQLStorage",_initStorage:ic,_support:ec(),iterate:ac,getItem:oc,setItem:sc,removeItem:lc,clear:cc,length:uc,key:dc,keys:fc,dropInstance:pc};function vc(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(s){return!1}}function To(s,d){var c=s.name+"/";return s.storeName!==d.storeName&&(c+=s.storeName+"/"),c}function _c(){var s="_localforage_support_test";try{return localStorage.setItem(s,!0),localStorage.removeItem(s),!1}catch(d){return!0}}function gc(){return!_c()||localStorage.length>0}function yc(s){var d=this,c={};if(s)for(var m in s)c[m]=s[m];return c.keyPrefix=To(s,d._defaultConfig),gc()?(d._dbInfo=c,c.serializer=xn,g.resolve()):g.reject()}function bc(s){var d=this,c=d.ready().then(function(){for(var m=d._dbInfo.keyPrefix,v=localStorage.length-1;v>=0;v--){var h=localStorage.key(v);h.indexOf(m)===0&&localStorage.removeItem(h)}});return _(c,s),c}function Ec(s,d){var c=this;s=A(s);var m=c.ready().then(function(){var v=c._dbInfo,h=localStorage.getItem(v.keyPrefix+s);return h&&(h=v.serializer.deserialize(h)),h});return _(m,d),m}function wc(s,d){var c=this,m=c.ready().then(function(){for(var v=c._dbInfo,h=v.keyPrefix,E=h.length,I=localStorage.length,R=1,T=0;T<I;T++){var C=localStorage.key(T);if(C.indexOf(h)===0){var D=localStorage.getItem(C);if(D&&(D=v.serializer.deserialize(D)),D=s(D,C.substring(E),R++),D!==void 0)return D}}});return _(m,d),m}function Ac(s,d){var c=this,m=c.ready().then(function(){var v=c._dbInfo,h;try{h=localStorage.key(s)}catch(E){h=null}return h&&(h=h.substring(v.keyPrefix.length)),h});return _(m,d),m}function Ic(s){var d=this,c=d.ready().then(function(){for(var m=d._dbInfo,v=localStorage.length,h=[],E=0;E<v;E++){var I=localStorage.key(E);I.indexOf(m.keyPrefix)===0&&h.push(I.substring(m.keyPrefix.length))}return h});return _(c,s),c}function Rc(s){var d=this,c=d.keys().then(function(m){return m.length});return _(c,s),c}function Sc(s,d){var c=this;s=A(s);var m=c.ready().then(function(){var v=c._dbInfo;localStorage.removeItem(v.keyPrefix+s)});return _(m,d),m}function Tc(s,d,c){var m=this;s=A(s);var v=m.ready().then(function(){d===void 0&&(d=null);var h=d;return new g(function(E,I){var R=m._dbInfo;R.serializer.serialize(d,function(T,C){if(C)I(C);else try{localStorage.setItem(R.keyPrefix+s,T),E(h)}catch(D){(D.name==="QuotaExceededError"||D.name==="NS_ERROR_DOM_QUOTA_REACHED")&&I(D),I(D)}})})});return _(v,c),v}function xc(s,d){if(d=O.apply(this,arguments),s=typeof s!="function"&&s||{},!s.name){var c=this.config();s.name=s.name||c.name,s.storeName=s.storeName||c.storeName}var m=this,v;return s.name?v=new g(function(h){s.storeName?h(To(s,m._defaultConfig)):h(s.name+"/")}).then(function(h){for(var E=localStorage.length-1;E>=0;E--){var I=localStorage.key(E);I.indexOf(h)===0&&localStorage.removeItem(I)}}):v=g.reject("Invalid arguments"),_(v,d),v}var Oc={_driver:"localStorageWrapper",_initStorage:yc,_support:vc(),iterate:wc,getItem:Ec,setItem:Tc,removeItem:Sc,clear:bc,length:Rc,key:Ac,keys:Ic,dropInstance:xc},Cc=function(d,c){return d===c||typeof d=="number"&&typeof c=="number"&&isNaN(d)&&isNaN(c)},kc=function(d,c){for(var m=d.length,v=0;v<m;){if(Cc(d[v],c))return!0;v++}return!1},xo=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"},Tt={},Oo={},at={INDEXEDDB:Zl,WEBSQL:mc,LOCALSTORAGE:Oc},Pc=[at.INDEXEDDB._driver,at.WEBSQL._driver,at.LOCALSTORAGE._driver],nr=["dropInstance"],On=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(nr),Dc={description:"",driver:Pc.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Nc(s,d){s[d]=function(){var c=arguments;return s.ready().then(function(){return s[d].apply(s,c)})}}function Cn(){for(var s=1;s<arguments.length;s++){var d=arguments[s];if(d)for(var c in d)d.hasOwnProperty(c)&&(xo(d[c])?arguments[0][c]=d[c].slice():arguments[0][c]=d[c])}return arguments[0]}var Lc=function(){function s(d){l(this,s);for(var c in at)if(at.hasOwnProperty(c)){var m=at[c],v=m._driver;this[c]=v,Tt[v]||this.defineDriver(m)}this._defaultConfig=Cn({},Dc),this._config=Cn({},this._defaultConfig,d),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return s.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 m in c){if(m==="storeName"&&(c[m]=c[m].replace(/\W/g,"_")),m==="version"&&typeof c[m]!="number")return new Error("Database version must be a number.");this._config[m]=c[m]}return"driver"in c&&c.driver?this.setDriver(this._config.driver):!0}else return typeof c=="string"?this._config[c]:this._config},s.prototype.defineDriver=function(c,m,v){var h=new g(function(E,I){try{var R=c._driver,T=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!c._driver){I(T);return}for(var C=On.concat("_initStorage"),D=0,j=C.length;D<j;D++){var H=C[D],G=!kc(nr,H);if((G||c[H])&&typeof c[H]!="function"){I(T);return}}var ne=function(){for(var xt=function(Bc){return function(){var jc=new Error("Method "+Bc+" is not implemented by the current driver"),Co=g.reject(jc);return _(Co,arguments[arguments.length-1]),Co}},kn=0,Mc=nr.length;kn<Mc;kn++){var Pn=nr[kn];c[Pn]||(c[Pn]=xt(Pn))}};ne();var te=function(xt){Tt[R]&&console.info("Redefining LocalForage driver: "+R),Tt[R]=c,Oo[R]=xt,E()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(te,I):te(!!c._support):te(!0)}catch(we){I(we)}});return w(h,m,v),h},s.prototype.driver=function(){return this._driver||null},s.prototype.getDriver=function(c,m,v){var h=Tt[c]?g.resolve(Tt[c]):g.reject(new Error("Driver not found."));return w(h,m,v),h},s.prototype.getSerializer=function(c){var m=g.resolve(xn);return w(m,c),m},s.prototype.ready=function(c){var m=this,v=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return w(v,c,c),v},s.prototype.setDriver=function(c,m,v){var h=this;xo(c)||(c=[c]);var E=this._getSupportedDrivers(c);function I(){h._config.driver=h.driver()}function R(D){return h._extend(D),I(),h._ready=h._initStorage(h._config),h._ready}function T(D){return function(){var j=0;function H(){for(;j<D.length;){var G=D[j];return j++,h._dbInfo=null,h._ready=null,h.getDriver(G).then(R).catch(H)}I();var ne=new Error("No available storage method found.");return h._driverSet=g.reject(ne),h._driverSet}return H()}}var C=this._driverSet!==null?this._driverSet.catch(function(){return g.resolve()}):g.resolve();return this._driverSet=C.then(function(){var D=E[0];return h._dbInfo=null,h._ready=null,h.getDriver(D).then(function(j){h._driver=j._driver,I(),h._wrapLibraryMethodsWithReady(),h._initDriver=T(E)})}).catch(function(){I();var D=new Error("No available storage method found.");return h._driverSet=g.reject(D),h._driverSet}),w(this._driverSet,m,v),this._driverSet},s.prototype.supports=function(c){return!!Oo[c]},s.prototype._extend=function(c){Cn(this,c)},s.prototype._getSupportedDrivers=function(c){for(var m=[],v=0,h=c.length;v<h;v++){var E=c[v];this.supports(E)&&m.push(E)}return m},s.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,m=On.length;c<m;c++)Nc(this,On[c])},s.prototype.createInstance=function(c){return new s(c)},s}(),Uc=new Lc;i.exports=Uc},{3:3}]},{},[4])(4)})});var Ca=ir(Ze=>{"use strict";q();Mt();Qe();var ut=Ie(),od=Re("levelFinished",{paramsSchema:U.tuple(U.string(),U.object({result:U.boolean(),duration:U.number()})),implement:(e,t)=>L(Ze,null,function*(){let{result:r,duration:n}=t;xe.info("onLevelFinished",r,n),yield Promise.all([Ce.reporter({event:"COMPLETE_GAME_LEVEL"}),Ce.tracker("LevelFinished",{levelId:e,result:r,duration:n})])})}),ad=Re("taskFinished",{paramsSchema:U.tuple(U.string(),U.object({duration:U.number()})),implement:(e,t)=>L(Ze,null,function*(){let{duration:r}=t;yield Ce.tracker("TaskFinished",{duration:r,taskId:e})})}),sd=Re("levelUpgrade",{paramsSchema:U.tuple(U.string(),U.string()),implement:(e,t)=>L(Ze,null,function*(){return yield Ce.tracker("LevelUpgrade",{name:t,levelId:e})})}),ld=Re("onHistoryUserLevel",{paramsSchema:U.tuple(U.number()),implement:e=>L(Ze,null,function*(){return yield Ce.tracker("HistoryUserLevel",{level:e})})}),cd=Re("onHistoryUserScore",{paramsSchema:U.tuple(U.number()),implement:e=>L(Ze,null,function*(){return yield Ce.tracker("HistoryUserScore",{score:e})})}),ud=Re("taskEvent",{paramsSchema:U.tuple(U.string(),U.object({tools:U.array(U.object({id:U.string(),name:U.string(),count:U.number(),description:U.string().optional(),price:U.object({amount:U.number(),unit:U.string()}).optional()})).optional(),awards:U.array(U.object({id:U.string(),name:U.string()})).optional()})),implement:(e,t)=>L(Ze,null,function*(){var r;(r=t.tools)!=null&&r.length&&(yield Promise.all([Ce.reporter({event:"USE_GAME_ITEM"}),Ce.tracker("UseGameItem",z({taskId:e},t))]))})});ut.registerCommand("TaskTrackerSDK.levelFinished",od);ut.registerCommand("TaskTrackerSDK.taskFinished",ad);ut.registerCommand("TaskTrackerSDK.levelUpgrade",sd);ut.registerCommand("TaskTrackerSDK.historyUserLevel",ld);ut.registerCommand("TaskTrackerSDK.historyUserScore",cd);ut.registerCommand("TaskTrackerSDK.taskEvent",ud);ae("TaskTrackerSDK.onLevelFinished",{version:"1.0.0",properties:{levelId:"1.0.0",params:{result:"1.0.0",duration:"1.0.0"}}});ae("TaskTrackerSDK.onTaskFinished",{version:"1.0.0",properties:{taskId:"1.0.0",duration:"1.0.0"}});ae("TaskTrackerSDK.onLevelUpgrade",{version:"1.0.0",properties:{levelId:"1.0.0",name:"1.0.0"}});ae("TaskTrackerSDK.onHistoryUserLevel",{version:"1.0.0",properties:{level:"1.0.0"}});ae("TaskTrackerSDK.onHistoryUserScore",{version:"1.0.0",properties:{score:"1.0.0"}});ae("TaskTrackerSDK.onTaskEvent",{version:"1.0.0",properties:{taskId:"1.0.0",params:{tools:{id:"1.0.0",name:"1.0.0",count:"1.0.0",description:"1.0.0",price:{amount:"1.0.0",unit:"1.0.0"}},awards:{id:"1.0.0",name:"1.0.0"}}}})});var ft,dt,ka,gi,dd,yi,bi=V(()=>{"use strict";ft=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},dt=new Map,ka=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=dt.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)}},gi=!1,dd=()=>{gi||(window.addEventListener("message",ka),gi=!0)},yi=(e,t)=>{dd(),dt.has(e)||dt.set(e,new Set);let r=dt.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&dt.delete(e),dt.size===0&&(window.removeEventListener("message",ka),gi=!1)}}});function Da(){let e=new Map,t;return{registerRewardHandler(n,i){e.set(n,i)},handleReward(n,...i){return L(this,null,function*(){return yield n.reduce((a,l)=>L(this,null,function*(){let u=yield a;if(u===!0)return!0;Pa&&console.log(`handleReward ${l}`);let f=e.get(l),y=f?yield f(...i):u;return Pa&&console.log(`handleReward ${l} ${y}`),y}),Promise.resolve(!1))})},registerRewardsFetcher(n){return L(this,null,function*(){t=(...i)=>L(this,null,function*(){try{return yield n(...i)}catch(o){return console.error("getRewardOptions error:",o),["ADS"]}})})},getRewardsTypes(...n){return L(this,null,function*(){return t?yield t(...n):["ADS"]})}}}var Pa,Na=V(()=>{"use strict";_e();Pa=P.testMode});var pt,Mr,Br,jr,Fr,ht,fd,he,mt=V(()=>{"use strict";q();pt="UNLOCK_OPTIONS_CHANGED",Mr="INVOKE_PAYMENT",Br="ON_PAYMENT_RESULT",jr="ON_USE_MODAL_EVENT",Fr="ON_USE_MODAL_RESULT",ht=new Pe,fd=()=>({on:ht.on.bind(ht),off:ht.off.bind(ht),emit:ht.emit.bind(ht)}),he=fd()});var hd,pd,La,Ua=V(()=>{"use strict";mt();hd=()=>(e,t)=>e==="JOLI_COIN"&&t==="ADS"?-1:e==="ADS"&&t==="JOLI_COIN"?1:0,pd=e=>e.length?e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(hd()):["ADS"],La=e=>{e.registerRewardsFetcher(t=>L(void 0,null,function*(){var n,i,o,a;let r=["ADS"];try{let l=yield t.post("/api/games/unlock-options",{});if(l.code!=="SUCCESS")return r;he.emit(pt,{options:((n=l.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=l.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1}});let u=((a=(o=l.data)==null?void 0:o.unlockOptions)==null?void 0:a.map(f=>f.type))||Array.from(r);return pd(u)}catch(l){return console.error("getRewardOptions error:",l),r}}))}});var Ma,Ba=V(()=>{"use strict";Ma=e=>t=>L(void 0,null,function*(){return e.adBreak(t),!0})});function et(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 l=a[0];i=l,n&&(n(l),n=null)}),{getData:()=>(r||o(),r),getCachedData:()=>i,clearCache:()=>{i=null,r=null},getFreshData:()=>(i=null,r=null,o(),r)}}var Vr=V(()=>{"use strict"});var ja,Fa=V(()=>{"use strict";ja=(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)}))});var Jr,$r,Va,Hr,Kr=V(()=>{"use strict";_e();q();mt();Fa();Vr();Jr=(e,t)=>r=>L(void 0,null,function*(){let n=et(he,Br);return he.emit(Mr,e,{userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,enableAutoDeduct:r.userJoliCoin.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult}),$r=(e,t)=>r=>L(void 0,null,function*(){let n=et(he,Fr);return he.emit(jr,e,{enableAutoDeduct:r.enableAutoDeduct,userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult}),Va=e=>{if(e=="CANCEL")throw new Error("CANCEL")},Hr=(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:r,unlockOptionsHandler:n,initiateAndAwaitPayment:i,showUnlockWithJolicoinModal:o}})=>a=>L(void 0,null,function*(){var l,u,f,y,p,g,_;try{let w=!1,A=yield n.getData(),O=(f=(u=(l=A==null?void 0:A.options)==null?void 0:l.find(N=>N.type==="JOLI_COIN"))==null?void 0:u.joliCoinChoices[0].joliCoinQuantity)!=null?f:0;if(!ja((A==null?void 0:A.options)||[],A==null?void 0:A.userJoliCoin)){let N=yield i({userJoliCoin:A==null?void 0:A.userJoliCoin,joliCoinQuantity:O});if(Va(N),N!=="SUCCESS")return r==null||r(a),!1;w=!0}let b=!!((y=A==null?void 0:A.userJoliCoin)!=null&&y.enableAutoDeduct);if(!w){let N=yield o({enableAutoDeduct:b,userJoliCoin:A==null?void 0:A.userJoliCoin,joliCoinQuantity:O});if(Va(N),N!=="CONFIRM")return r==null||r(a),!1}let k=yield e.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${lt()}-${P.mpType}-${Date.now()}`,gameInfo:{gameId:P.mpId}}});return k.code=="SUCCESS"?((g=a.adBreakDone)==null||g.call(a,{breakType:a.type,breakName:"name"in a&&(p=a.name)!=null?p:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in a&&((_=a.adViewed)==null||_.call(a)),t==null||t({quantity:k.data.quantity,balance:k.data.balance}),!0):(r==null||r(a),!1)}catch(w){if(console.info("JolicoinRewardHandler error:",w),w instanceof Error&&w.message=="CANCEL")throw w;return r==null||r(a),!1}})});var Ja,$a=V(()=>{"use strict";mt();Vr();Kr();Kr();Ja=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=et(he,pt),i=()=>{r==null||r()},o=$r("ADS-JOLI_COIN",{confirmButtonText:"Use Jolicoin",cancelButtonText:"No watch ads"}),a=Jr("ADS-JOLI_COIN",{confirmButtonText:"Pay and unlock",cancelButtonText:"No watch ads"});return Hr(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:i,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:o}})}});var Ha,Ka=V(()=>{"use strict";mt();Kr();Vr();Ha=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=et(he,pt),i=u=>{var f;r==null||r(),(f=u.adBreakDone)==null||f.call(u,{breakType:u.type,breakFormat:u.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},o=$r("JOLI_COIN",{confirmButtonText:"Use Jolicoin",cancelButtonText:"No thanks"}),a=Jr("JOLI_COIN",{confirmButtonText:"Pay and unlock",cancelButtonText:"No thanks"});return Hr(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:i,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:o}})}});var tt,Ga=V(()=>{"use strict";Na();Ua();Ba();$a();Ka();tt=Da();La(tt)});function Ve(e,t){for(var r in t)e[r]=t[r];return e}function Ri(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Yr(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?zr.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 qr(e,a,n,i,null)}function qr(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?++Qa:i,__i:-1,__u:0};return i==null&&B.vnode!=null&&B.vnode(o),o}function nt(e){return e.children}function ke(e,t){this.props=e,this.context=t}function vt(e,t){if(t==null)return e.__?vt(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"?vt(e):null}function rs(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 rs(e)}}function Wa(e){(!e.__d&&(e.__d=!0)&&rt.push(e)&&!Wr.__r++||qa!==B.debounceRendering)&&((qa=B.debounceRendering)||Xa)(Wr)}function Wr(){for(var e,t,r,n,i,o,a,l=1;rt.length;)rt.length>l&&rt.sort(Za),e=rt.shift(),l=rt.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=Ve({},n)).__v=n.__v+1,B.vnode&&B.vnode(r),Si(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i==null?vt(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,os(o,r,a),r.__e!=i&&rs(r)));Wr.__r=0}function ns(e,t,r,n,i,o,a,l,u,f,y){var p,g,_,w,A,O,b=n&&n.__k||ts,k=t.length;for(u=_d(r,t,b,u,k),p=0;p<k;p++)(_=r.__k[p])!=null&&(g=_.__i===-1?jt:b[_.__i]||jt,_.__i=p,O=Si(e,_,g,i,o,a,l,u,f,y),w=_.__e,_.ref&&g.ref!=_.ref&&(g.ref&&Ti(g.ref,null,_),y.push(_.ref,_.__c||w,_)),A==null&&w!=null&&(A=w),4&_.__u||g.__k===_.__k?u=is(_,u,e):typeof _.type=="function"&&O!==void 0?u=O:w&&(u=w.nextSibling),_.__u&=-7);return r.__e=A,u}function _d(e,t,r,n,i){var o,a,l,u,f,y=r.length,p=y,g=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+g,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?qr(null,a,null,null,null):Ft(a)?qr(nt,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?qr(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,l=null,(f=a.__i=gd(a,r,u,p))!==-1&&(p--,(l=r[f])&&(l.__u|=2)),l==null||l.__v===null?(f==-1&&(i>y?g--:i<y&&g++),typeof a.type!="function"&&(a.__u|=4)):f!=u&&(f==u-1?g--:f==u+1?g++:(f>u?g--:g++,a.__u|=4))):e.__k[o]=null;if(p)for(o=0;o<y;o++)(l=r[o])!=null&&!(2&l.__u)&&(l.__e==n&&(n=vt(l)),ss(l,l));return n}function is(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=is(n[i],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=vt(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Vt(e,t){return t=t||[],e==null||typeof e=="boolean"||(Ft(e)?e.some(function(r){Vt(r,t)}):t.push(e)),t}function gd(e,t,r,n){var i,o,a=e.key,l=e.type,u=t[r];if(u===null&&e.key==null||u&&a==u.key&&l===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&&l===u.type)return i;i--}if(o<t.length){if((u=t[o])&&!(2&u.__u)&&a==u.key&&l===u.type)return o;o++}}return-1}function za(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||vd.test(t)?r:r+"px"}function Gr(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||za(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||za(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(es,"$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=Ii,e.addEventListener(t,o?wi:Ei,o)):e.removeEventListener(t,o?wi:Ei,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 Ya(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=Ii++;else if(t.u<r.t)return;return r(B.event?B.event(t):t)}}}function Si(e,t,r,n,i,o,a,l,u,f){var y,p,g,_,w,A,O,b,k,N,K,Q,S,x,M,F,ee,Y=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),o=[l=t.__e=r.__e]),(y=B.__b)&&y(t);e:if(typeof Y=="function")try{if(b=t.props,k="prototype"in Y&&Y.prototype.render,N=(y=Y.contextType)&&n[y.__c],K=y?N?N.props.value:y.__:n,r.__c?O=(p=t.__c=r.__c).__=p.__E:(k?t.__c=p=new Y(b,K):(t.__c=p=new ke(b,K),p.constructor=Y,p.render=bd),N&&N.sub(p),p.props=b,p.state||(p.state={}),p.context=K,p.__n=n,g=p.__d=!0,p.__h=[],p._sb=[]),k&&p.__s==null&&(p.__s=p.state),k&&Y.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=Ve({},p.__s)),Ve(p.__s,Y.getDerivedStateFromProps(b,p.__s))),_=p.props,w=p.state,p.__v=t,g)k&&Y.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),k&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(k&&Y.getDerivedStateFromProps==null&&b!==_&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(b,K),!p.__e&&(p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(b,p.__s,K)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(p.props=b,p.state=p.__s,p.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(se){se&&(se.__=t)}),Q=0;Q<p._sb.length;Q++)p.__h.push(p._sb[Q]);p._sb=[],p.__h.length&&a.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(b,p.__s,K),k&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(_,w,A)})}if(p.context=K,p.props=b,p.__P=e,p.__e=!1,S=B.__r,x=0,k){for(p.state=p.__s,p.__d=!1,S&&S(t),y=p.render(p.props,p.state,p.context),M=0;M<p._sb.length;M++)p.__h.push(p._sb[M]);p._sb=[]}else do p.__d=!1,S&&S(t),y=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++x<25);p.state=p.__s,p.getChildContext!=null&&(n=Ve(Ve({},n),p.getChildContext())),k&&!g&&p.getSnapshotBeforeUpdate!=null&&(A=p.getSnapshotBeforeUpdate(_,w)),F=y,y!=null&&y.type===nt&&y.key==null&&(F=as(y.props.children)),l=ns(e,Ft(F)?F:[F],t,r,n,i,o,a,l,u,f),p.base=t.__e,t.__u&=-161,p.__h.length&&a.push(p),O&&(p.__E=p.__=null)}catch(se){if(t.__v=null,u||o!=null)if(se.then){for(t.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;o[o.indexOf(l)]=null,t.__e=l}else for(ee=o.length;ee--;)Ri(o[ee]);else t.__e=r.__e,t.__k=r.__k;B.__e(se,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):l=t.__e=yd(r.__e,t,r,n,i,o,a,u,f);return(y=B.diffed)&&y(t),128&t.__u?void 0:l}function os(e,t,r){for(var n=0;n<r.length;n++)Ti(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 as(e){return typeof e!="object"||e==null?e:Ft(e)?e.map(as):Ve({},e)}function yd(e,t,r,n,i,o,a,l,u){var f,y,p,g,_,w,A,O=r.props,b=t.props,k=t.type;if(k=="svg"?i="http://www.w3.org/2000/svg":k=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(f=0;f<o.length;f++)if((_=o[f])&&"setAttribute"in _==!!k&&(k?_.localName==k:_.nodeType==3)){e=_,o[f]=null;break}}if(e==null){if(k==null)return document.createTextNode(b);e=document.createElementNS(i,k,b.is&&b),l&&(B.__m&&B.__m(t,o),l=!1),o=null}if(k===null)O===b||l&&e.data===b||(e.data=b);else{if(o=o&&zr.call(e.childNodes),O=r.props||jt,!l&&o!=null)for(O={},f=0;f<e.attributes.length;f++)O[(_=e.attributes[f]).name]=_.value;for(f in O)if(_=O[f],f!="children"){if(f=="dangerouslySetInnerHTML")p=_;else if(!(f in b)){if(f=="value"&&"defaultValue"in b||f=="checked"&&"defaultChecked"in b)continue;Gr(e,f,null,_,i)}}for(f in b)_=b[f],f=="children"?g=_:f=="dangerouslySetInnerHTML"?y=_:f=="value"?w=_:f=="checked"?A=_:l&&typeof _!="function"||O[f]===_||Gr(e,f,_,O[f],i);if(y)l||p&&(y.__html===p.__html||y.__html===e.innerHTML)||(e.innerHTML=y.__html),t.__k=[];else if(p&&(e.innerHTML=""),ns(t.type==="template"?e.content:e,Ft(g)?g:[g],t,r,n,k=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&vt(r,0),l,u),o!=null)for(f=o.length;f--;)Ri(o[f]);l||(f="value",k=="progress"&&w==null?e.removeAttribute("value"):w!==void 0&&(w!==e[f]||k=="progress"&&!w||k=="option"&&w!==O[f])&&Gr(e,f,w,O[f],i),f="checked",A!==void 0&&A!==e[f]&&Gr(e,f,A,O[f],i))}return e}function Ti(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 ss(e,t,r){var n,i;if(B.unmount&&B.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Ti(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]&&ss(n[i],t,r||typeof e.type!="function");r||Ri(e.__e),e.__c=e.__=e.__e=void 0}function bd(e,t,r){return this.constructor(e,r)}function ls(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=[],Si(t,e=(!n&&r||t).__k=Yr(nt,null,[e]),i||jt,jt,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?zr.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),os(o,e,a)}var zr,B,Qa,Ai,rt,qa,Xa,Za,es,Ii,Ei,wi,md,jt,ts,vd,Ft,cs=V(()=>{jt={},ts=[],vd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ft=Array.isArray;zr=ts.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(l){e=l}throw e}},Qa=0,Ai=function(e){return e!=null&&e.constructor==null},ke.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ve({},this.state),typeof e=="function"&&(e=e(Ve({},r),this.props)),e&&Ve(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Wa(this))},ke.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Wa(this))},ke.prototype.render=nt,rt=[],Xa=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Za=function(e,t){return e.__v.__b-t.__v.__b},Wr.__r=0,es=/(PointerCapture)$|Capture$/i,Ii=0,Ei=Ya(!1),wi=Ya(!0),md=0});function Se(e,t,r){return(t=Id(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Id(e){var t=Rd(e,"string");return typeof t=="symbol"?t:t+""}function Rd(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)}function Qr(e,t,r){return(t=Sd(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sd(e){var t=Td(e,"string");return typeof t=="symbol"?t:t+""}function Td(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)}function Ud(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Md(e){return typeof e=="string"}function Bd(e){return typeof e=="undefined"}function jd(e){return Bd(e)||e===null}function Fd(e){return typeof e=="function"}function $s(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}function Jt(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}function tn(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function Gd(e){let t=e.location?tn(e.location,ps):null,r=e.target?tn(e.target,ps):null;return tn(Dd(Pd({},e),{location:t,target:r}),Hd)}function qd(e){let t=e.events.map(n=>Gd(n)),r=tn(e.device,Kd);return[e.protocolVersion,t,r,e.project]}function Wd(){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 Zd(e){return new Promise(t=>qs(e)(t))}function qs(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 ef(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new qt(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)})}function rf(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)nf(e[n],t[n])}function nf(e,t){if(Md(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Fd(t)){try{if(e instanceof t)return}catch(r){}if(!jd(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 Oi(e,t,r){return(t=of(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function of(e){var t=af(e,"string");return typeof t=="symbol"?t:t+""}function af(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)}function Xr(e,t,r){return(t=sf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sf(e){var t=lf(e,"string");return typeof t=="symbol"?t:t+""}function lf(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)}function Je(e,t,r){return(t=cf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cf(e){var t=uf(e,"string");return typeof t=="symbol"?t:t+""}function uf(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)}function df(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 ff(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}function gf(e,t){return ue(e,0)^45?(((t<<2^ue(e,0))<<2^ue(e,1))<<2^ue(e,2))<<2^ue(e,3):0}function Ys(e){return e.trim()}function yf(e,t){return(e=t.exec(e))?e[0]:e}function $(e,t,r){return e.replace(t,r)}function Hi(e,t){return e.indexOf(t)}function ue(e,t){return e.charCodeAt(t)|0}function Wt(e,t,r){return e.slice(t,r)}function Ne(e){return e.length}function eo(e){return e.length}function Zr(e,t){return t.push(e),e}function bf(e,t){return e.map(t).join("")}function mn(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:pn,column:gt,length:a,return:""}}function Ht(e,t){return _f(mn("",null,null,"",null,null,0),e,{length:-e.length},t)}function Ef(){return oe}function wf(){return oe=ye>0?ue(yt,--ye):0,gt--,oe===10&&(gt=1,pn--),oe}function be(){return oe=ye<Qs?ue(yt,ye++):0,gt++,oe===10&&(gt=1,pn++),oe}function Le(){return ue(yt,ye)}function rn(){return ye}function Qt(e,t){return Wt(yt,e,t)}function zt(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 Xs(e){return pn=gt=1,Qs=Ne(yt=e),ye=0,[]}function Zs(e){return yt="",e}function nn(e){return Ys(Qt(ye-1,Ki(e===91?e+2:e===40?e+1:e)))}function Af(e){for(;(oe=Le())&&oe<33;)be();return zt(e)>2||zt(oe)>3?"":" "}function If(e,t){for(;--t&&be()&&!(oe<48||oe>102||oe>57&&oe<65||oe>70&&oe<97););return Qt(e,rn()+(t<6&&Le()==32&&be()==32))}function Ki(e){for(;be();)switch(oe){case e:return ye;case 34:case 39:e!==34&&e!==39&&Ki(oe);break;case 40:e===41&&Ki(e);break;case 92:be();break}return ye}function Rf(e,t){for(;be()&&e+oe!==57&&!(e+oe===84&&Le()===47););return"/*"+Qt(t,ye-1)+"*"+hn(e===47?e:be())}function Sf(e){for(;!zt(Le());)be();return Qt(e,ye)}function Tf(e){return Zs(on("",null,null,null,[""],e=Xs(e),0,[0],e))}function on(e,t,r,n,i,o,a,l,u){for(var f=0,y=0,p=a,g=0,_=0,w=0,A=1,O=1,b=1,k=0,N="",K=i,Q=o,S=n,x=N;O;)switch(w=k,k=be()){case 40:if(w!=108&&ue(x,p-1)==58){Hi(x+=$(nn(k),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:x+=nn(k);break;case 9:case 10:case 13:case 32:x+=Af(w);break;case 92:x+=If(rn()-1,7);continue;case 47:switch(Le()){case 42:case 47:Zr(xf(Rf(be(),rn()),t,r),u);break;default:x+="/"}break;case 123*A:l[f++]=Ne(x)*b;case 125*A:case 59:case 0:switch(k){case 0:case 125:O=0;case 59+y:b==-1&&(x=$(x,/\f/g,"")),_>0&&Ne(x)-p&&Zr(_>32?_s(x+";",n,r,p-1):_s($(x," ","")+";",n,r,p-2),u);break;case 59:x+=";";default:if(Zr(S=vs(x,t,r,f,y,i,l,N,K=[],Q=[],p),o),k===123)if(y===0)on(x,t,S,S,K,o,p,l,Q);else switch(g===99&&ue(x,3)===110?100:g){case 100:case 108:case 109:case 115:on(e,S,S,n&&Zr(vs(e,S,S,0,0,i,l,N,i,K=[],p),Q),i,Q,p,l,n?K:Q);break;default:on(x,S,S,S,[""],Q,0,l,Q)}}f=y=_=0,A=b=1,N=x="",p=a;break;case 58:p=1+Ne(x),_=w;default:if(A<1){if(k==123)--A;else if(k==125&&A++==0&&wf()==125)continue}switch(x+=hn(k),k*A){case 38:b=y>0?1:(x+="\f",-1);break;case 44:l[f++]=(Ne(x)-1)*b,b=1;break;case 64:Le()===45&&(x+=nn(be())),g=Le(),y=p=Ne(N=x+=Sf(rn())),k++;break;case 45:w===45&&Ne(x)==2&&(A=0)}}return o}function vs(e,t,r,n,i,o,a,l,u,f,y){for(var p=i-1,g=i===0?o:[""],_=eo(g),w=0,A=0,O=0;w<n;++w)for(var b=0,k=Wt(e,p+1,p=vf(A=a[w])),N=e;b<_;++b)(N=Ys(A>0?g[b]+" "+k:$(k,/&\f/g,g[b])))&&(u[O++]=N);return mn(e,t,r,i===0?Xi:l,u,f,y)}function xf(e,t,r){return mn(e,t,r,Ws,hn(Ef()),Wt(e,2,-2),0)}function _s(e,t,r,n){return mn(e,t,r,Zi,Wt(e,0,n),Wt(e,n+1,-1),n)}function _t(e,t){for(var r="",n=eo(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function Of(e,t,r,n){switch(e.type){case mf:if(e.children.length)break;case pf:case Zi:return e.return=e.return||e.value;case Ws:return"";case zs:return e.return=e.value+"{"+_t(e.children,n)+"}";case Xi:e.value=e.props.join(",")}return Ne(r=_t(e.children,n))?e.return=e.value+"{"+r+"}":""}function Cf(e){var t=eo(e);return function(r,n,i,o){for(var a="",l=0;l<t;l++)a+=e[l](r,n,i,o)||"";return a}}function kf(e){return function(t){t.root||(t=t.return)&&e(t)}}function Pf(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}function el(e,t){switch(gf(e,t)){case 5103:return J+"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 J+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return J+e+ln+e+pe+e+e;case 6828:case 4268:return J+e+pe+e+e;case 6165:return J+e+pe+"flex-"+e+e;case 5187:return J+e+$(e,/(\w+).+(:[^]+)/,J+"box-$1$2"+pe+"flex-$1$2")+e;case 5443:return J+e+pe+"flex-item-"+$(e,/flex-|-self/,"")+e;case 4675:return J+e+pe+"flex-line-pack"+$(e,/align-content|flex-|-self/,"")+e;case 5548:return J+e+pe+$(e,"shrink","negative")+e;case 5292:return J+e+pe+$(e,"basis","preferred-size")+e;case 6060:return J+"box-"+$(e,"-grow","")+J+e+pe+$(e,"grow","positive")+e;case 4554:return J+$(e,/([^-])(transform)/g,"$1"+J+"$2")+e;case 6187:return $($($(e,/(zoom-|grab)/,J+"$1"),/(image-set)/,J+"$1"),e,"")+e;case 5495:case 3959:return $(e,/(image-set\([^]*)/,J+"$1$`$1");case 4968:return $($(e,/(.+:)(flex-)?(.*)/,J+"box-pack:$3"+pe+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+J+e+e;case 4095:case 3583:case 4068:case 2532:return $(e,/(.+)-inline(.+)/,J+"$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(Ne(e)-1-t>6)switch(ue(e,t+1)){case 109:if(ue(e,t+4)!==45)break;case 102:return $(e,/(.+:)(.+)-([^]+)/,"$1"+J+"$2-$3$1"+ln+(ue(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Hi(e,"stretch")?el($(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(ue(e,t+1)!==115)break;case 6444:switch(ue(e,Ne(e)-3-(~Hi(e,"!important")&&10))){case 107:return $(e,":",":"+J)+e;case 101:return $(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+J+(ue(e,14)===45?"inline-":"")+"box$3$1"+J+"$2$3$1"+pe+"$2box$3")+e}break;case 5936:switch(ue(e,t+11)){case 114:return J+e+pe+$(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return J+e+pe+$(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return J+e+pe+$(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return J+e+pe+e+e}return e}function Vf(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)}function cn(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 We={name:i.name,styles:i.styles,next:We},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)We={name:a.name,styles:a.styles,next:We},a=a.next;var l=o.styles+";";return l}return Kf(e,t,r)}}var u=r;if(t==null)return u;var f=t[u];return f!==void 0?f:u}function Kf(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=cn(e,t,r[i])+";";else for(var o in r){var a=r[o];if(typeof a!="object"){var l=a;t!=null&&t[l]!==void 0?n+=o+"{"+t[l]+"}":ys(l)&&(n+=Ci(o)+":"+bs(o,l)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var u=0;u<a.length;u++)ys(a[u])&&(n+=Ci(o)+":"+bs(o,a[u])+";");else{var f=cn(e,t,a);switch(o){case"animation":case"animationName":{n+=Ci(o)+":"+f+";";break}default:n+=o+"{"+f+"}"}}}return n}function ki(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="";We=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=cn(r,t,o);else{var a=o;i+=a[0]}for(var l=1;l<e.length;l++)if(i+=cn(r,t,e[l]),n){var u=o;i+=u[l]}Es.lastIndex=0;for(var f="",y;(y=Es.exec(i))!==null;)f+="-"+y[1];var p=Vf(i)+f;return{name:p,styles:i,next:We}}function rl(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}function ws(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function As(e,t,r){var n=[],i=rl(e,n,r);return n.length<2?r:i+t(n)}function to(e,t){re.__h&&re.__h(ve,e,Gi||t),Gi=0;var r=ve.__H||(ve.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function il(e,t){var r=to(Yt++,3);!re.__s&&ro(r.__H,t)&&(r.__=e,r.u=t,ve.__H.__h.push(r))}function Qf(e,t){var r=to(Yt++,4);!re.__s&&ro(r.__H,t)&&(r.__=e,r.u=t,ve.__h.push(r))}function ol(e){return Gi=5,vn(function(){return{current:e}},[])}function vn(e,t){var r=to(Yt++,7);return ro(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Xf(){for(var e;e=nl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(an),e.__H.__h.forEach(qi),e.__H.__h=[]}catch(t){e.__H.__h=[],re.__e(t,e.__v)}}function Zf(e){var t,r=function(){clearTimeout(n),ks&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);ks&&(t=requestAnimationFrame(r))}function an(e){var t=ve,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),ve=t}function qi(e){var t=ve;e.__c=e.__(),ve=t}function ro(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function _n(){if(ze>1)ze--;else{for(var e,t=!1;Kt!==void 0;){var r=Kt;for(Kt=void 0,Wi++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&sl(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(Wi=0,ze--,t)throw e}}function Te(e){if(ze>0)return e();ze++;try{return e()}finally{_n()}}function al(e){if(W!==void 0){var t=e.n;if(t===void 0||t.t!==W)return t={i:0,S:e,p:W.s,n:void 0,t:W,e:void 0,x:void 0,r:t},W.s!==void 0&&(W.s.n=t),W.s=t,e.n=t,32&W.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=W.s,t.n=void 0,W.s.n=t,W.s=t),t}}function de(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function ce(e){return new de(e)}function sl(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 ll(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 cl(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 bt(e){de.call(this,void 0),this.x=e,this.s=void 0,this.g=un-1,this.f=4}function Gt(e){return new bt(e)}function ul(e){var t=e.u;if(e.u=void 0,typeof t=="function"){ze++;var r=W;W=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,no(e),n}finally{W=r,_n()}}}function no(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ul(e)}function th(e){if(W!==this)throw new Error("Out-of-order effect");cl(this),W=e,this.f&=-2,8&this.f&&no(this),_n()}function Zt(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function Et(e){var t=new Zt(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}function wt(e,t){B[e]=t.bind(null,B[e]||function(){})}function dn(e){Di&&Di(),Di=e&&e.S()}function hl(e){var t=this,r=e.data,n=pl(r);n.value=r;var i=vn(function(){for(var l=t,u=t.__v;u=u.__;)if(u.__c){u.__c.__$f|=4;break}var f=Gt(function(){var _=n.value.value;return _===0?0:_===!0?"":_||""}),y=Gt(function(){return!Array.isArray(f.value)&&!Ai(f.value)}),p=Et(function(){if(this.N=ml,y.value){var _=f.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=_)}}),g=t.__$u.d;return t.__$u.d=function(){p(),g.call(this)},[y,f]},[]),o=i[0],a=i[1];return o.value?a.peek():a.value}function rh(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=ce(r);return{o:function(a,l){o.value=a,n=l},d:Et(function(){this.N=ml;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}function pl(e){return vn(function(){return ce(e)},[])}function oh(){Te(function(){for(var e;e=dl.shift();)io.call(e)})}function ah(){dl.push(this)===1&&(B.requestAnimationFrame||nh)(oh)}function sh(){Te(function(){for(var e;e=fl.shift();)io.call(e)})}function ml(){fl.push(this)===1&&(B.requestAnimationFrame||ih)(sh)}function lh(e){var t=ol(e);t.current=e,il(function(){return Et(function(){return this.N=ah,t.current()})},[])}function ch(e,t){for(var r in t)e[r]=t[r];return e}function Ps(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 Ds(e,t){this.props=e,this.context=t}function vl(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=ch({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return vl(n,t,r)})),e}function _l(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return _l(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 Ni(){this.__u=0,this.o=null,this.__b=null}function gl(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function en(){this.i=null,this.l=null}function _h(e,t,r){return t.__k==null&&(t.textContent=""),ls(e,t),typeof r=="function"&&r(),e?e.__c:null}function gh(){}function yh(){return this.cancelBubble}function bh(){return this.defaultPrevented}function wh(e,t){let r=ol(e);Qf(()=>{r.current=e},[e]),il(()=>{if(t===null)return;let n=setInterval(()=>{r.current()},t);return()=>{clearInterval(n)}},[t])}function le(e,t,r,n,i,o){t||(t={});var a,l,u=t;if("ref"in u)for(l in u={},t)l=="ref"?a=t[l]:u[l]=t[l];var f={type:e,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ah,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(l in a)u[l]===void 0&&(u[l]=a[l]);return B.vnode&&B.vnode(f),f}function $e(e,t,r){return(t=Lh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lh(e){var t=Uh(e,"string");return typeof t=="symbol"?t:t+""}function Uh(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)}function it(e,t,r){return(t=Mh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mh(e){var t=Bh(e,"string");return typeof t=="symbol"?t:t+""}function Bh(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 us,Ed,wd,Ad,Li,Ui,Vs,xd,Od,ds,Cd,kd,fs,Pd,Dd,Nd,Js,Ld,Vd,Jd,hs,$d,Hs,Ks,Gs,ps,Hd,Kd,Mi,Z,zd,Yd,$t,qt,Qd,ji,Xd,xi,tf,Fi,ms,Vi,Ji,$i,hf,pe,ln,J,Ws,Xi,Zi,pf,zs,mf,vf,hn,_f,pn,gt,Qs,ye,oe,yt,Df,Nf,Lf,gs,Uf,Mf,Bf,jf,Ff,Jf,$f,Hf,tl,ys,Ci,bs,Es,We,Gf,qf,Wf,zf,Yf,Xt,Yt,ve,Pi,Is,Gi,nl,re,Rs,Ss,Ts,xs,Os,Cs,ks,eh,W,Kt,ze,Wi,un,io,Di,dl,fl,nh,ih,ge,Ns,uh,Ls,Us,dh,fh,hh,ph,mh,vh,Ms,Eh,Bs,js,Fs,Ah,Ih,He,zi,Yi,sn,Rh,Sh,Th,xh,Oh,Ch,kh,Ph,Dh,Nh,Qi,fn,v_,yl=V(()=>{"use strict";cs();us=Object.getOwnPropertySymbols,Ed=Object.prototype.hasOwnProperty,wd=Object.prototype.propertyIsEnumerable,Ad=(e,t)=>{var r={};for(var n in e)Ed.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&us)for(var n of us(e))t.indexOf(n)<0&&wd.call(e,n)&&(r[n]=e[n]);return r};Li=class{constructor(t){Se(this,"context",void 0),Se(this,"continueCallback",void 0),Se(this,"isBeforeAdCalled",!1),Se(this,"isBeforeRewardCalled",!1),Se(this,"isAdDismissedCalled",!1),Se(this,"isAdViewedCalled",!1),Se(this,"isAfterAdCalled",!1),Se(this,"currentProvider",void 0),Se(this,"currentClientParams",void 0),Se(this,"adsHasResponse",!1),Se(this,"videoChecker",window.document.createElement("video")),Se(this,"wrapShowAdFn",r=>()=>{this.adsHasResponse=!0;let n=!1;this.videoChecker.play().catch(()=>{n=!1}),n=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:n},this.paramsToTrack)),r()}),this.context=t}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()=>{this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.isBeforeAdCalled||(this.isBeforeAdCalled=!0,t==null||t())}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{this.adsHasResponse=!0,this.isAdDismissedCalled||(this.isAdDismissedCalled=!0,t==null||t())}}wrapAdViewed(t){return()=>{this.adsHasResponse=!0,this.isAdViewedCalled||(this.isAdViewedCalled=!0,t==null||t())}}wrapAfterAd(t){return()=>{this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.isAfterAdCalled||(this.isAfterAdCalled=!0,t==null||t())}}wrapAdBreakDone(t){return r=>{var n,i,o,a,l;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:null,breakType:r.breakType,breakName:(o=r.breakName)!=null?o:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{t==null||t(r),(a=this.continueCallback)==null||a.call(this,[!1,r]);break}default:{(l=this.continueCallback)==null||l.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n){return L(this,null,function*(){return this.currentProvider=t,this.currentClientParams=r,this.adsHasResponse=!1,new Promise(i=>{this.continueCallback=i;let o;switch(r.type){case"preroll":{o={type:r.type,adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}case"reward":{o={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),beforeReward:this.wrapBeforeReward(r.beforeReward),adDismissed:this.wrapAdDismissed(r.adDismissed),adViewed:this.wrapAdViewed(r.adViewed),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}default:{o={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}}window.setTimeout(()=>{var a,l,u,f;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(l=(a=this.currentProvider)==null?void 0:a.name)!=null?l:null}),(f=this.continueCallback)==null||f.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(u=r.name)!=null?u:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(o,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};Ui=class{constructor(t){Qr(this,"context",void 0),Qr(this,"adBreakIsShowing",!1),Qr(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),Qr(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()})}},Vs=Object.defineProperty,xd=Object.defineProperties,Od=Object.getOwnPropertyDescriptors,ds=Object.getOwnPropertySymbols,Cd=Object.prototype.hasOwnProperty,kd=Object.prototype.propertyIsEnumerable,fs=(e,t,r)=>t in e?Vs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pd=(e,t)=>{for(var r in t||(t={}))Cd.call(t,r)&&fs(e,r,t[r]);if(ds)for(var r of ds(t))kd.call(t,r)&&fs(e,r,t[r]);return e},Dd=(e,t)=>xd(e,Od(t)),Nd=(e,t)=>{for(var r in t)Vs(e,r,{get:t[r],enumerable:!0})},Js=(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},Ld=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{l(r.next(u))}catch(f){i(f)}},a=u=>{try{l(r.throw(u))}catch(f){i(f)}},l=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);l((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}Vd=(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))(Vd||{});Jd={log:Jt("log"),warn:Jt("warn"),info:Jt("info"),error:Jt("error"),debug:Jt("debug")};Object.assign(globalThis,{logger:Jd});hs=Symbol.for("Jolibox.canIUseMap"),$d={};globalThis[hs]||(globalThis[hs]=$d);Hs=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Hs||{}),Ks=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Ks||{}),Gs=(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))(Gs||{}),ps=["name","params"],Hd=["name","type","location","target","extra","timestamp","userId"],Kd=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];Wd();navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),navigator.userAgent.includes("Android"),navigator.userAgent.includes("Mac"),navigator.userAgent.includes("FB_IAB"),!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");Mi=class Bi{constructor(t){this.element=t,this.next=Bi.Undefined,this.prev=Bi.Undefined}};Mi.Undefined=new Mi(void 0);Z=Mi,zd=class{constructor(){this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Z.Undefined}clear(){let e=this._first;for(;e!==Z.Undefined;){let t=e.next;e.prev=Z.Undefined,e.next=Z.Undefined,e=t}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new Z(e);if(this._first===Z.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!==Z.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Z.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Z.Undefined&&e.next!==Z.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Z.Undefined&&e.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):e.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):e.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Z.Undefined;)yield e.element,e=e.next}},Yd=0,$t=class{constructor(e){this.value=e,this.id=Yd++}},qt=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof $t&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){return this._event!=null||(this._event=(e,t)=>{var r,n,i,o,a,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let u=new $t(e);return this._listeners?this._listeners instanceof $t?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)),(l=(a=this.options)==null?void 0:a.onDidAddListener)==null||l.call(a,this),this._size++,()=>{var f,y,p,g;if(!this._disposed){if(this._listeners instanceof $t)this._listeners.id===u.id&&(this._listeners=void 0,this._size=0,(y=(f=this.options)==null?void 0:f.onDidRemoveLastListener)==null||y.call(f));else if(this._listeners){let _=this._listeners.indexOf(u);_>=0&&(this._listeners.splice(_,1),this._size--,this._size===0&&((g=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||g.call(p)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof $t?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Qd=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){var r;let n=(r=this.listeners.get(e))!=null?r:new qt,i=l=>t(...l.args),o=n.event(i);this.listerHandlerMap.set(t,{handler:i,dispose:o}),this.listeners.set(e,n);let a=this.cachedEventQueue.get(e);if(a)for(let l of a)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e){let t=this.listeners.get(e),r=this.cachedEventQueue.get(e);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r||(r=new zd,this.cachedEventQueue.set(e,r)),r.push({args:i}),t&&t.fire({event:e,args:i})}},ji={};Nd(ji,{None:()=>Xd,filter:()=>ef,once:()=>qs,toPromise:()=>Zd});Xd=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});xi=Symbol.for("Jolibox.hostEmitter"),tf=()=>{let e=new Qd;return globalThis[xi]||(globalThis[xi]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e)}),globalThis[xi]};tf();Fi=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new qt,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 rf(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}};Fi=Js([$s],Fi);ms=class{constructor(){this._onWillExecuteCommand=new qt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new qt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Fi,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Ud(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 Ld(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),ji.toPromise(ji.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{}}};ms=Js([$s],ms);Vi=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";Oi(this,"context",void 0),Oi(this,"placement","GAME"),Oi(this,"contextInfo",void 0),this.context=t,this.placement=r,this.contextInfo=this.context.getContextInfo()}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:this.placement==="GAME"?"GamePage":"DramaPage",params:r}}getDevice(){var t,r,n,i;return{platform:(t=this.contextInfo.platform)!=null?t:Gs.WebSDK,os:this.contextInfo.osType+"_"+this.contextInfo.runtimeType,appVersion:"1.0.0",appId:(r=this.contextInfo.hostAppId)!=null?r:"1",model:(n=this.contextInfo.deviceModel)!=null?n:"UnknownModel",brand:(i=this.contextInfo.deviceBrand)!=null?i:"UnknownBrand",uuid:this.contextInfo.deviceId,jsSdkVersion:"1.0.0",extra:{}}}serialize(t,r){var n;let i={protocolVersion:"1.0.0",events:[{name:t,type:Hs.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:Ks.WebSDK};return qd(i)}};Ji=class{constructor(t){Xr(this,"configs",null),Xr(this,"firstRun",!0),Xr(this,"context",void 0),Xr(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return L(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}};$i=class{constructor(t,r){Je(this,"name","ADSENSE"),Je(this,"context",void 0),Je(this,"contextInfo",void 0),Je(this,"configured",!1),Je(this,"initParams",void 0),Je(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),Je(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=Ad(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),Je(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),Je(this,"adUnit",n=>L(this,null,function*(){var i,o,a,l;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:f,adFormat:y,fullWidthResponsive:p,style:g}=n,_;if(!u)throw new Error("targeting element is required");if(typeof u=="string"?_=document.querySelector(u):_=u,!_)throw new Error("targeting element not found");let w=f;if(w||(w=this.initParams.unitId),!w)throw new Error("slot is required");let A=typeof y=="object"&&Array.isArray(y)?y.join(", "):y,O=document.createElement("ins");if(O.className="adsbygoogle",O.id="jolibox-ads",O.style.display="block",O.setAttribute("data-ad-client",this.initParams.clientId),O.setAttribute("data-ad-slot",w),A&&O.setAttribute("data-ad-format",A),p&&O.setAttribute("data-full-width-responsive",p),g&&O.setAttribute("style",g),(l=this.contextInfo.testAdsMode)!=null?l:!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",O.style.position="relative",_.appendChild(O),O.appendChild(b)}else _.appendChild(O),new MutationObserver(b=>{b.forEach(k=>{if(k.type==="attributes"&&k.attributeName==="data-ad-status"){let N=O.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:N!=null?N:"null"})}})}).observe(O,{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 L(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),document.head.appendChild(i),this.context.track("LoadAdsenseCompleted",null)}})}};hf=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(ff(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=df(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}(),pe="-ms-",ln="-moz-",J="-webkit-",Ws="comm",Xi="rule",Zi="decl",pf="@import",zs="@keyframes",mf="@layer",vf=Math.abs,hn=String.fromCharCode,_f=Object.assign;pn=1,gt=1,Qs=0,ye=0,oe=0,yt="";Df=function(e,t,r){for(var n=0,i=0;n=i,i=Le(),n===38&&i===12&&(t[r]=1),!zt(i);)be();return Qt(e,ye)},Nf=function(e,t){var r=-1,n=44;do switch(zt(n)){case 0:n===38&&Le()===12&&(t[r]=1),e[r]+=Df(ye-1,t,r);break;case 2:e[r]+=nn(n);break;case 4:if(n===44){e[++r]=Le()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=hn(n)}while(n=be());return e},Lf=function(e,t){return Zs(Nf(Xs(e),t))},gs=new WeakMap,Uf=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&&!gs.get(r))&&!n){gs.set(e,!0);for(var i=[],o=Lf(t,i),a=r.props,l=0,u=0;l<o.length;l++)for(var f=0;f<a.length;f++,u++)e.props[u]=i[l]?o[l].replace(/&\f/g,a[f]):a[f]+" "+o[l]}}},Mf=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};Bf=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case Zi:e.return=el(e.value,e.length);break;case zs:return _t([Ht(e,{value:$(e.value,"@","@"+J)})],n);case Xi:if(e.length)return bf(e.props,function(i){switch(yf(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return _t([Ht(e,{props:[$(i,/:(read-\w+)/,":"+ln+"$1")]})],n);case"::placeholder":return _t([Ht(e,{props:[$(i,/:(plac\w+)/,":"+J+"input-$1")]}),Ht(e,{props:[$(i,/:(plac\w+)/,":"+ln+"$1")]}),Ht(e,{props:[$(i,/:(plac\w+)/,pe+"input-$1")]})],n)}return""})}},jf=[Bf],Ff=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||jf,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(" "),O=1;O<A.length;O++)i[A[O]]=!0;a.push(w)});var l,u=[Uf,Mf];{var f,y=[Of,kf(function(w){f.insert(w)})],p=Cf(u.concat(n,y)),g=function(w){return _t(Tf(w),p)};l=function(w,A,O,b){f=O,g(w?w+"{"+A.styles+"}":A.styles),b&&(_.inserted[A.name]=!0)}}var _={key:t,sheet:new hf({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:l};return _.sheet.hydrate(a),_};Jf={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},$f=/[A-Z]|^ms/g,Hf=/_EMO_([^_]+?)_([^]*?)_EMO_/g,tl=function(e){return e.charCodeAt(1)===45},ys=function(e){return e!=null&&typeof e!="boolean"},Ci=Pf(function(e){return tl(e)?e:e.replace($f,"-$&").toLowerCase()}),bs=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(Hf,function(r,n,i){return We={name:n,styles:i,next:We},n})}return Jf[e]!==1&&!tl(e)&&typeof t=="number"&&t!==0?t+"px":t};Es=/label:\s*([^\s;{]+)\s*(;|$)/g;Gf=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},qf=function(e,t,r){Gf(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)}};Wf=function(e){var t=Ff(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];var f=ki(l,t.registered,void 0);return qf(t,f),t.key+"-"+f.name},n=function(){for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];var f=ki(l,t.registered),y="animation-"+f.name;return ws(t,{name:f.name,styles:"@keyframes "+y+"{"+f.styles+"}"}),y},i=function(){for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];var f=ki(l,t.registered);ws(t,f)},o=function(){for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];return As(t.registered,r,zf(l))};return{css:r,cx:o,injectGlobal:i,keyframes:n,hydrate:function(a){a.forEach(function(l){t.inserted[l]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:rl.bind(null,t.registered),merge:As.bind(null,t.registered,r)}},zf=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},Yf=Wf({key:"css"}),Xt=Yf.css,Gi=0,nl=[],re=B,Rs=re.__b,Ss=re.__r,Ts=re.diffed,xs=re.__c,Os=re.unmount,Cs=re.__;re.__b=function(e){ve=null,Rs&&Rs(e)},re.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Cs&&Cs(e,t)},re.__r=function(e){Ss&&Ss(e),Yt=0;var t=(ve=e.__c).__H;t&&(Pi===ve?(t.__h=[],ve.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(an),t.__h.forEach(qi),t.__h=[],Yt=0)),Pi=ve},re.diffed=function(e){Ts&&Ts(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(nl.push(t)!==1&&Is===re.requestAnimationFrame||((Is=re.requestAnimationFrame)||Zf)(Xf)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Pi=ve=null},re.__c=function(e,t){t.some(function(r){try{r.__h.forEach(an),r.__h=r.__h.filter(function(n){return!n.__||qi(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],re.__e(n,r.__v)}}),xs&&xs(e,t)},re.unmount=function(e){Os&&Os(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{an(n)}catch(i){t=i}}),r.__H=void 0,t&&re.__e(t,r.__v))};ks=typeof requestAnimationFrame=="function";eh=Symbol.for("preact-signals");W=void 0,Kt=void 0,ze=0,Wi=0,un=0;de.prototype.brand=eh;de.prototype.h=function(){return!0};de.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)};de.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)}};de.prototype.subscribe=function(e){var t=this;return Et(function(){var r=t.value,n=W;W=void 0;try{e(r)}finally{W=n}})};de.prototype.valueOf=function(){return this.value};de.prototype.toString=function(){return this.value+""};de.prototype.toJSON=function(){return this.value};de.prototype.peek=function(){var e=W;W=void 0;try{return this.value}finally{W=e}};Object.defineProperty(de.prototype,"value",{get:function(){var e=al(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Wi>100)throw new Error("Cycle detected");this.v=e,this.i++,un++,ze++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{_n()}}}});(bt.prototype=new de).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===un))return!0;if(this.g=un,this.f|=1,this.i>0&&!sl(this))return this.f&=-2,!0;var e=W;try{ll(this),W=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 W=e,cl(this),this.f&=-2,!0};bt.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)}de.prototype.S.call(this,e)};bt.prototype.U=function(e){if(this.t!==void 0&&(de.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)}};bt.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(bt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=al(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});Zt.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()}};Zt.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ul(this),ll(this),ze++;var e=W;return W=this,th.bind(this,e)};Zt.prototype.N=function(){2&this.f||(this.f|=2,this.o=Kt,Kt=this)};Zt.prototype.d=function(){this.f|=8,1&this.f||no(this)};dl=[],fl=[];Et(function(){io=this.N})();hl.displayName="_st";Object.defineProperties(de.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:hl},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});wt("__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 de&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});wt("__r",function(e,t){dn();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return Et(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),dn(r),e(t)});wt("__e",function(e,t,r,n){dn(),e(t,r,n)});wt("diffed",function(e,t){dn();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 l=o[a];l!==void 0&&!(a in n)&&(l.d(),o[a]=void 0)}else o={},r.U=o;for(var u in n){var f=o[u],y=n[u];f===void 0?(f=rh(r,u,y,i),o[u]=f):f.o(y,i)}}}e(t)});wt("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 l=a.__$u;l&&(a.__$u=void 0,l.d())}}e(t)});wt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});ke.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 l in this.props)if(!(l in e))return!0;return!1};nh=typeof requestAnimationFrame=="undefined"?setTimeout:function(e){var t=function(){clearTimeout(r),cancelAnimationFrame(n),e()},r=setTimeout(t,100),n=requestAnimationFrame(t)},ih=function(e){queueMicrotask(function(){queueMicrotask(e)})};ge=Xt`
|
|
4
|
+
inset: 0;
|
|
5
|
+
clear: none;
|
|
6
|
+
float: none;
|
|
7
|
+
max-height: none;
|
|
8
|
+
max-width: none;
|
|
9
|
+
opacity: 1;
|
|
10
|
+
overflow: visible;
|
|
11
|
+
visibility: visible;
|
|
12
|
+
padding: 0;
|
|
13
|
+
margin: 0;
|
|
14
|
+
top: 0;
|
|
15
|
+
left: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
border: none;
|
|
18
|
+
text-decoration: none;
|
|
19
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
20
|
+
'Helvetica Neue', sans-serif;
|
|
21
|
+
`;(Ds.prototype=new ke).isPureReactComponent=!0,Ds.prototype.shouldComponentUpdate=function(e,t){return Ps(this.props,e)||Ps(this.state,t)};Ns=B.__b;B.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ns&&Ns(e)};uh=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)}uh(e,t,r,n)};Ls=B.unmount;B.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ls&&Ls(e)},(Ni.prototype=new ke).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=gl(n.__v),o=!1,a=function(){o||(o=!0,r.__R=null,i?i(l):l())};r.__R=a;var l=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=_l(u,u.__c.__P,u.__c.__O)}var f;for(n.setState({__a:n.__b=null});f=n.o.pop();)f.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},Ni.prototype.componentWillUnmount=function(){this.o=[]},Ni.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]=vl(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&Yr(nt,null,e.fallback);return i&&(i.__u&=-33),[Yr(nt,null,t.__a?null:e.children),i]};Us=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]}};(en.prototype=new ke).__a=function(e){var t=this,r=gl(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),Us(t,e,n)):i()};r?r(o):o()}},en.prototype.render=function(e){this.i=null,this.l=new Map;var t=Vt(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},en.prototype.componentDidUpdate=en.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Us(e,r,t)})};dh=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,fh=/^(?: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]/,hh=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ph=/[A-Z0-9]/g,mh=typeof document!="undefined",vh=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};ke.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ke.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});Ms=B.event;B.event=function(e){return Ms&&(e=Ms(e)),e.persist=gh,e.isPropagationStopped=yh,e.isDefaultPrevented=bh,e.nativeEvent=e};Eh={enumerable:!1,configurable:!0,get:function(){return this.class}},Bs=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 l=r[a];if(!(a==="value"&&"defaultValue"in r&&l==null||mh&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var u=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&l===!0?l="":u==="translate"&&l==="no"?l=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?a="ondblclick":u!=="onchange"||n!=="input"&&n!=="textarea"||vh(r.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":hh.test(a)&&(a=u):u=a="oninput":o&&fh.test(a)?a=a.replace(ph,"-$&").toLowerCase():l===null&&(l=void 0),u==="oninput"&&i[a=u]&&(a="oninputCapture"),i[a]=l}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=Vt(r.children).forEach(function(f){f.props.selected=i.value.indexOf(f.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=Vt(r.children).forEach(function(f){f.props.selected=i.multiple?i.defaultValue.indexOf(f.props.value)!=-1:i.defaultValue==f.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",Eh)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=dh,Bs&&Bs(e)};js=B.__r;B.__r=function(e){js&&js(e),e.__c};Fs=B.diffed;B.diffed=function(e){Fs&&Fs(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)};Ah=0;Ih=Xt`
|
|
22
|
+
${ge}
|
|
23
|
+
position: fixed;
|
|
24
|
+
top: 0;
|
|
25
|
+
left: 0;
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
align-items: center;
|
|
29
|
+
z-index: 998;
|
|
30
|
+
background: rgba(0, 0, 0, 0.5);
|
|
31
|
+
width: 100vw;
|
|
32
|
+
height: 100vh;
|
|
33
|
+
|
|
34
|
+
.card-wrapper {
|
|
35
|
+
${ge}
|
|
36
|
+
position: relative;
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
align-items: center;
|
|
41
|
+
background: white;
|
|
42
|
+
border-radius: 8px;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
width: 250px;
|
|
45
|
+
min-height: 100px;
|
|
46
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
47
|
+
|
|
48
|
+
.body {
|
|
49
|
+
${ge}
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
width: 100%;
|
|
53
|
+
padding: 16px;
|
|
54
|
+
min-height: 100px;
|
|
55
|
+
box-sizing: border-box;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
.title {
|
|
58
|
+
${ge}
|
|
59
|
+
text-align: center;
|
|
60
|
+
font-size: 16px;
|
|
61
|
+
font-weight: bold;
|
|
62
|
+
margin-bottom: 8px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.content {
|
|
66
|
+
${ge}
|
|
67
|
+
font-size: 14px;
|
|
68
|
+
color: #888;
|
|
69
|
+
margin-bottom: 16px;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.footer {
|
|
74
|
+
${ge}
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
width: 100%;
|
|
78
|
+
height: 40px;
|
|
79
|
+
button {
|
|
80
|
+
${ge}
|
|
81
|
+
border: none;
|
|
82
|
+
outline: none;
|
|
83
|
+
height: 100%;
|
|
84
|
+
font-size: 14px;
|
|
85
|
+
padding: 8px 16px;
|
|
86
|
+
flex: 1;
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
|
|
89
|
+
&.confirm-btm {
|
|
90
|
+
background: rgb(120, 23, 255);
|
|
91
|
+
color: white;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
`,He=ce(null),zi=ce(""),Yi=ce(""),sn=ce(!1),Rh=()=>{var e;(e=He.value)==null||e.call(He,!1)},Sh=()=>{var e;(e=He.value)==null||e.call(He,!0)},Th=e=>L(void 0,null,function*(){let{title:t,content:r}=e;return He.value&&(He.value(!1),Te(()=>{He.value=null,sn.value=!1})),Te(()=>{zi.value=t||"",Yi.value=r||"",sn.value=!0}),new Promise(n=>{He.value=i=>{Te(()=>{He.value=null,sn.value=!1,zi.value="",Yi.value=""}),n(i)}})}),xh=()=>sn.value?le("div",{className:Ih,children:le("div",{className:"card-wrapper",children:[le("div",{className:"body",children:[le("div",{className:"title",children:zi.value}),le("div",{className:"content",children:Yi.value})]}),le("div",{className:"footer",children:[le("button",{onClick:Rh,className:"cancel-btn",children:"Cancel"}),le("button",{onClick:Sh,className:"confirm-btm",children:"Confirm"})]})]})}):null,Oh=Xt`
|
|
97
|
+
${ge}
|
|
98
|
+
position: relative;
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: flex-end;
|
|
102
|
+
background: black;
|
|
103
|
+
padding-top: env(safe-area-inset-top, 20px);
|
|
104
|
+
width: 100%;
|
|
105
|
+
height: 60px;
|
|
106
|
+
padding: 0 20px;
|
|
107
|
+
box-sizing: border-box;
|
|
108
|
+
|
|
109
|
+
.timer {
|
|
110
|
+
color: white;
|
|
111
|
+
margin-right: 20px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
button {
|
|
115
|
+
${ge}
|
|
116
|
+
padding: 0 20px;
|
|
117
|
+
height: 30px;
|
|
118
|
+
line-height: 30px;
|
|
119
|
+
font-size: 16px;
|
|
120
|
+
background: rgb(120, 23, 255);
|
|
121
|
+
border-radius: 100px;
|
|
122
|
+
color: white;
|
|
123
|
+
|
|
124
|
+
&:disabled {
|
|
125
|
+
opacity: 0.5;
|
|
126
|
+
cursor: not-allowed;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
`,Ch=()=>{let e=ce(!1),t=ce(null);return{timerPaused:e,startTimestamp:t,startTimer:()=>{Te(()=>{t.value=Date.now(),e.value=!1})}}},kh=e=>{let{countdown:t=0,mode:r,onClose:n,state:i}=e,{startTimestamp:o,timerPaused:a}=i,l=pl(t);lh(()=>{o.value&&(l.value=t)}),wh(()=>{l.value>0?l.value-=1:Te(()=>{a.value=!0,l.value=0})},a.value?null:1e3);let u=Gt(()=>{if(r==="interstitial"||r==="rewarded_insterstitial"||!o.value)return!1;let _=Date.now()-o.value;return l.value>0&&t-l.value>=5&&_>=5e3}),f=Gt(()=>{if(r==="interstitial")return!0;if(!o.value)return!1;let _=Date.now()-o.value;return l.value<=0&&_>=(t-1)*1e3&&t>5}),y=Gt(()=>r==="interstitial"?!1:!u.value&&!f.value),p=()=>L(void 0,null,function*(){if(a.value=!0,!(yield Th({title:"Are you sure?",content:"You will lose your reward if you dismiss this Ad."}))){a.value=!1;return}n("dismiss"),Te(()=>{a.value=!0,l.value=0,o.value=null})}),g=()=>{n("viewed"),Te(()=>{a.value=!0,l.value=0,o.value=null})};return le("div",{className:Oh,children:[l.value>0&&r!=="interstitial"&&le("div",{className:"timer",children:[l.value,"s"]}),le("button",{onClick:u.value?p:f.value?g:void 0,disabled:y.value,children:le("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:le("path",{d:"M13.3 0.710215C12.91 0.320215 12.28 0.320215 11.89 0.710215L6.99997 5.59022L2.10997 0.700215C1.71997 0.310215 1.08997 0.310215 0.699971 0.700215C0.309971 1.09021 0.309971 1.72022 0.699971 2.11022L5.58997 7.00022L0.699971 11.8902C0.309971 12.2802 0.309971 12.9102 0.699971 13.3002C1.08997 13.6902 1.71997 13.6902 2.10997 13.3002L6.99997 8.41021L11.89 13.3002C12.28 13.6902 12.91 13.6902 13.3 13.3002C13.69 12.9102 13.69 12.2802 13.3 11.8902L8.40997 7.00022L13.3 2.11022C13.68 1.73022 13.68 1.09022 13.3 0.710215Z",fill:"white"})})})]})},Ph=()=>{let e=ce(),t=ce(),r=ce(),n=ce(),i=ce(),o=ce(!1),a=ce(15),l=ce(""),u=ce("reward");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,visible:o,countdown:a,src:l,mode:u}},Dh=Xt`
|
|
130
|
+
${ge}
|
|
131
|
+
position: fixed;
|
|
132
|
+
z-index: 2147483647;
|
|
133
|
+
background: white;
|
|
134
|
+
width: 100vw;
|
|
135
|
+
height: 100vh;
|
|
136
|
+
display: flex;
|
|
137
|
+
flex-direction: column;
|
|
138
|
+
|
|
139
|
+
iframe {
|
|
140
|
+
${ge}
|
|
141
|
+
flex: 1;
|
|
142
|
+
position: relative;
|
|
143
|
+
display: block;
|
|
144
|
+
background: white;
|
|
145
|
+
width: 100%;
|
|
146
|
+
height: 100%;
|
|
147
|
+
}
|
|
148
|
+
`,Nh=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,visible:l,countdown:u,src:f,mode:y}=t,p=vn(()=>Ch(),[]),g=w=>{var A,O,b,k;l.value=!1,w==="dismiss"?(A=n.value)==null||A.call(n):w==="viewed"&&((O=i.value)==null||O.call(i)),(b=r.value)==null||b.call(r),(k=o.value)==null||k.call(o)},_=()=>{var w;(y.value==="reward"||y.value==="rewarded_insterstitial")&&setTimeout(()=>{p.startTimer()},100),(w=a.value)==null||w.call(a)};return l.value?le("div",{className:Dh,children:[le(kh,{mode:y.value,onClose:g,countdown:u.value,state:p}),l.value&&le("iframe",{src:f.value,onLoad:_,sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols"}),le(xh,{})]}):null};Qi=class{constructor(t,r){$e(this,"name","OKSPIN"),$e(this,"initialized",!1),$e(this,"initCompleter",null),$e(this,"context",void 0),$e(this,"initParams",void 0),$e(this,"adsOverlay",null),$e(this,"adsIsShowing",!1),$e(this,"lastUnDisplayedAdBreak",null),$e(this,"state",Ph()),this.context=t,this.initParams=r}init(){return L(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg"),_h(le(Nh,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(t=this.initCompleter)==null||t.call(this)})}adConfig(t){var r;if(this.initialized){(r=t.onReady)==null||r.call(t);return}this.initCompleter=()=>{var n;(n=t.onReady)==null||n.call(t)}}adBreak(t,r){return L(this,null,function*(){var n,i,o,a,l,u,f,y;if(!this.initialized||!this.adsOverlay||!r.params.url){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}switch(t.type){case"preroll":{(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(a=t.beforeAd)==null||a.call(t);let p=()=>{var _;this.adsIsShowing=!1,(_=t.afterAd)==null||_.call(t)},g=()=>{var _;this.adsIsShowing=!1,(_=t.adBreakDone)==null||_.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})};Te(()=>{this.adsIsShowing=!0,this.state.afterAd.value=p,this.state.adBreakDone.value=g,this.state.src.value=r.params.url,this.state.mode.value="interstitial",this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((u=(l=this.lastUnDisplayedAdBreak).adBreakDone)==null||u.call(l,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(f=t.beforeAd)==null||f.call(t);let p=()=>{var b;this.adsIsShowing=!1,(b=t.afterAd)==null||b.call(t)},g={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},_=()=>{var b;this.adsIsShowing=!1,g.breakStatus="dismissed",(b=t.adDismissed)==null||b.call(t)},w=()=>{var b;this.adsIsShowing=!1,g.breakStatus="viewed",(b=t.adViewed)==null||b.call(t)},A=()=>{var b;this.adsIsShowing=!1,(b=t.adBreakDone)==null||b.call(t,g)};Te(()=>{this.state.afterAd.value=p,this.state.adDismissed.value=_,this.state.adViewed.value=w,this.state.adBreakDone.value=A});let O=()=>{var b;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(b=t.adBreakDone)==null||b.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Te(()=>{var k;this.state.countdown.value=(k=r.params.countdown)!=null?k:15,this.state.src.value=r.params.url,this.state.mode.value="reward",this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,O);break}}})}};fn=class{constructor(t){if(it(this,"context",void 0),it(this,"contextInfo",void 0),it(this,"providers",{}),it(this,"channelPolicy",void 0),it(this,"adsActionDetection",void 0),it(this,"adsTrackSerializer",void 0),it(this,"initialized",!1),t)this.context=t,this.channelPolicy=new Ji(this.context),this.adsActionDetection=new Ui(this.context),this.adsTrackSerializer=new Vi(this.context),this.contextInfo=this.context.getContextInfo();else throw new Error("JoliboxAdsForGame requires a configuration object")}getRequestContextData(t){var r,n;return{report:JSON.stringify(this.adsTrackSerializer.serialize(t,{sessionId:this.contextInfo.sessionId,objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId,testAdsMode:this.contextInfo.testAdsMode})),osType:this.contextInfo.osType,runtimeType:this.contextInfo.runtimeType,sessionId:this.contextInfo.sessionId,deviceId:this.contextInfo.deviceId,adId:this.contextInfo.adId,deviceModel:(r=this.contextInfo.deviceModel)!=null?r:"UnknownModel",deviceBrand:(n=this.contextInfo.deviceBrand)!=null?n:"UnknownBrand"}}getRequestBizParams(){return{objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId}}init(t){return L(this,null,function*(){window.adsbygoogle=window.adsbygoogle||[];let{data:r}=yield this.context.httpClient.post("/api/ads/init",{data:{contextData:this.getRequestContextData("AdsAFGSDKInit"),bizParams:this.getRequestBizParams(),testAdsMode:this.contextInfo.testAdsMode}});if((r==null?void 0:r.length)>0)for(let n of r)switch(n.provider){case"ADSENSE":{let i=new $i(this.context,n.params);yield i.init(),this.providers.ADSENSE=i;break}case"OKSPIN":{let i=new Qi(this.context,n.params);yield i.init(),this.providers.OKSPIN=i;break}}this.initialized=!0})}adConfig(t){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(t):window.adsbygoogle.push(t)}adBreak(t){return L(this,null,function*(){var r,n,i,o,a,l,u,f,y;if((r=this.context.eventEmitter)==null||r.emit("isAdShowing",!0),this.adsActionDetection.adBreakIsShowing=!0,this.initialized||(yield this.init()),t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}this.context.checkNetwork()||(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:"NETWORK_NOT_OK",breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});try{let{data:p,code:g}=yield this.context.httpClient.post("/api/ads/info",{data:{contextData:this.getRequestContextData("AdsAFGSDKAdBreak"),bizParams:this.getRequestBizParams(),adsType:t.type==="reward"?"REWARD":"INTERSTITIAL",testAdsMode:this.contextInfo.testAdsMode,name:t.type==="preroll"?"":t.name}});if(g!=="SUCCESS"){(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"UNKNOWN_ERROR",breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let _=p;if(_.length===0){(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:"NO_ADS",breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let w=!0,A=null,O=new Li(this.context);for(;_.length>0;){let b=_.shift(),k=this.providers[b.provider];if(k){let[N,K]=yield O.callAdBreakAndContinue(k,t,b);w=N,A=K}else w=!0,A={breakType:t.type,breakName:t.type==="preroll"?"":(l=t.name)!=null?l:"",breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!w)break}w&&A&&((u=t.adBreakDone)==null||u.call(t,A))}}catch(p){(f=t.adBreakDone)==null||f.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{(y=this.context.eventEmitter)==null||y.emit("isAdShowing",!1),this.adsActionDetection.adBreakIsShowing=!1}})}adUnit(t){console.warn("This method has been deprecated. We will not support AdSense AdUnit in the future.")}},v_=Xt`
|
|
149
|
+
${ge}
|
|
150
|
+
position: fixed;
|
|
151
|
+
left: 0;
|
|
152
|
+
top: 0;
|
|
153
|
+
display: none;
|
|
154
|
+
z-index: 2147483647;
|
|
155
|
+
background: black;
|
|
156
|
+
width: 100vw;
|
|
157
|
+
height: 100vh;
|
|
158
|
+
|
|
159
|
+
&[data-visible='true'] {
|
|
160
|
+
display: block;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.ads-wrapper {
|
|
164
|
+
${ge}
|
|
165
|
+
position: relative;
|
|
166
|
+
width: 100%;
|
|
167
|
+
height: 100%;
|
|
168
|
+
display: block;
|
|
169
|
+
|
|
170
|
+
video {
|
|
171
|
+
position: absolute;
|
|
172
|
+
top: 0;
|
|
173
|
+
left: 0;
|
|
174
|
+
width: 100%;
|
|
175
|
+
height: 100%;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
#ad-container {
|
|
179
|
+
position: absolute;
|
|
180
|
+
top: 0;
|
|
181
|
+
left: 0;
|
|
182
|
+
width: 100%;
|
|
183
|
+
height: 100%;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.retry-button {
|
|
187
|
+
${ge}
|
|
188
|
+
position: absolute;
|
|
189
|
+
width: 100%;
|
|
190
|
+
height: 100%;
|
|
191
|
+
display: flex;
|
|
192
|
+
justify-content: center;
|
|
193
|
+
align-items: center;
|
|
194
|
+
cursor: pointer;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
`});var wl=ir(El=>{"use strict";mt();bi();q();var bl={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};yi("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",bl[e.result]),he.emit(Fr,{useModalResult:bl[e.result]})});he.on(jr,(e,t)=>{var r;ft("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:lt()})});yi("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{he.emit(Br,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin})});he.on(Mr,(e,t)=>L(El,null,function*(){var r;ft("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:lt()})}))});var Rl=ir(oo=>{"use strict";Qe();q();Ut();bi();Ga();yl();_e();var F_=or(wl()),gn=Ie(),Al=new Pe,yn=je.create(),jh={httpClient:yn,checkNetwork:()=>je.getNetworkStatus(),track:De,eventEmitter:Al,getContextInfo:()=>{var e,t,r,n,i,o,a,l;return{hostAppId:(t=(e=P.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(r=P.deviceInfo.did)!=null?r:"",adId:(n=P.deviceInfo.did)!=null?n:"",sessionId:(i=P.sessionId)!=null?i:"",userId:(a=(o=P.hostUserInfo)==null?void 0:o.uid)!=null?a:"",objectType:"GAME",objectId:P.mpId,testAdsMode:P.testAdsMode,channel:(l=P.joliSource)!=null?l:"",deviceBrand:P.deviceInfo.brand,deviceModel:P.deviceInfo.model,osType:Ae.isAndroid?"ANDROID":Ae.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3}}},Il=e=>{ft("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})},er=new fn(jh);tt.registerRewardHandler("ADS",Ma(er));tt.registerRewardHandler("JOLI_COIN",Ja(yn,{onUnlockSuccess:Il.bind(oo)}));tt.registerRewardHandler("JOLI_COIN_ONLY",Ha(yn,{onUnlockSuccess:Il.bind(oo)}));Al.on("isAdShowing",e=>{ft("JOLIBOX_ADS_EVENT",{isAdShowing:e})});gn.registerCommand("AdsSDK.init",e=>{er.init(e)});gn.registerCommand("AdsSDK.adConfig",e=>{er.adConfig(e)});gn.registerCommand("AdsSDK.adBreak",e=>{e.type==="reward"?tt.getRewardsTypes(yn).then(t=>{tt.handleReward(t,e).catch(r=>{var n;console.info("handleReward failed",r),(n=e.adBreakDone)==null||n.call(e,{breakType:e.type,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})})}):er.adBreak(e)});gn.registerCommand("AdsSDK.adUnit",e=>{er.adUnit(e)})});Qe();_e();Mt();q();var Ra=Ie(),$u="env",Hu="getSystemInfoSync",Ku=()=>{var i,o,a,l;let e={system:P.deviceInfo.system,platform:P.deviceInfo.platform.toLowerCase(),brand:P.deviceInfo.brand,pixelRatio:P.deviceInfo.pixelRatio,language:P.deviceInfo.lang,version:P.sdkInfo.jssdkVersion,appName:(i=P.hostInfo)==null?void 0:i.appName,SDKVersion:P.sdkInfo.nativeSDKVersion},t=(o=P.hostInfo)==null?void 0:o.version;t&&(e=fe(z({},e),{version:t}));let r=(a=P.hostInfo)==null?void 0:a.appName;r&&(e=fe(z({},e),{appName:r}));let n=(l=P.sdkInfo)==null?void 0:l.jssdkVersion;return n&&(e=fe(z({},e),{SDKVersion:n})),e},Gu=Xe(Hu,{implement:Ku}),qu=Xe($u,{implement:()=>fe(z({},P.hostInfo),{sdkInfo:P.sdkInfo,platform:P.platform,deviceInfo:P.deviceInfo})});Ra.registerCommand("API.env",qu);Ra.registerCommand("API.getSystemInfoSync",Gu);ae("env",{version:"1.0.0"});ae("getSystemInfoSync",{version:"1.0.0"});q();Mt();qe();Qe();var Wu="onJoliboxShow",zu="onJoliboxHide",Yu="onReady",pi=Ie(),mi=zo(Oe),hi=!0,Bt=!0,Dr=0,Nr=ai;function Qu(){let e=Date.now();if(e-Dr<100)return;Dr=e;let t=document.visibilityState==="visible";t!==hi&&(hi=t,Nr.emit("visible",hi))}function Sa(e){let t=Date.now();t-Dr<100||(Dr=t,e==="focus"&&!Bt?Bt=!0:e==="blur"&&Bt&&(Bt=!1),Nr.emit("visible",Bt))}document.addEventListener("visibilitychange",Qu);window.addEventListener("focus",()=>Sa("focus"));window.addEventListener("blur",()=>Sa("blur"));var Xu=Xe(Wu,{paramsSchema:U.tuple(U.function()),implement(e){let t=mi(e);Nr.on("visible",r=>{r&&t()})}}),Zu=Xe(zu,{paramsSchema:U.tuple(U.function()),implement(e){let t=mi(e);Nr.on("visible",r=>{!r&&t()})}}),ed=Xe(Yu,{paramsSchema:U.tuple(U.function()),implement(e){let t=mi(e);Lt.on("LifecycleEvent.onReady",r=>{t(r)})}});pi.registerCommand("LifecycleSDK.onReady",ed);pi.registerCommand("LifecycleSDK.onJoliboxShow",Xu);pi.registerCommand("LifecycleSDK.onJoliboxHide",Zu);ae("lifeCycle.onReady",{version:"1.0.0"});ae("lifeCycle.onJoliboxShow",{version:"1.0.0"});ae("lifeCycle.onJoliboxHide",{version:"1.0.0"});Mt();q();Ut();_e();var Oa=or(xa());var Lr=Ie(),_i=class{constructor(){this.httpClient=je.create({baseUrl:P.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"});this.getGameId=()=>P.mpId;this.getItem=t=>L(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)=>L(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=>L(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=()=>L(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=Oa.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},Ur=new _i,td=Re("getLocalStorage",{paramsSchema:U.tuple(U.string()),implement(e){return L(this,null,function*(){return yield Ur.getItem(e)})}});Lr.registerCommand("StorageSDK.getItem",td);ae("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var rd=Re("setStorage",{paramsSchema:U.tuple(U.string(),U.or(U.string(),U.boolean(),U.number())),implement(e,t){return L(this,null,function*(){return yield Ur.setItem(e,t)})}});Lr.registerCommand("StorageSDK.setItem",rd);ae("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var nd=Re("removeStorage",{paramsSchema:U.tuple(U.string()),implement(e){return L(this,null,function*(){return yield Ur.removeItem(e)})}});Lr.registerCommand("StorageSDK.removeItem",nd);ae("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var id=Re("clearStorage",{implement(){return L(this,null,function*(){return yield Ur.clear()})}});Lr.registerCommand("StorageSDK.clear",id);ae("storage.clear",{version:"1.0.0"});var K_=or(Ca()),G_=or(Rl());q();Qe();var kl=-1,En=function(e){addEventListener("pageshow",function(t){t.persisted&&(kl=t.timeStamp,e(t))},!0)},so=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},wn=function(){var e=so();return e&&e.activationStart||0},It=function(e,t){var r=so(),n="navigate";return kl>=0?n="back-forward-cache":r&&(document.prerendering||wn()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},Pl=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(i){Promise.resolve().then(function(){t(i.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(i){}},Rt=function(e,t,r,n){var i,o;return function(a){t.value>=0&&(a||n)&&((o=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=o,t.rating=function(l,u){return l>u[1]?"poor":l>u[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Dl=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},Nl=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},Ll=function(e){var t=!1;return function(){t||(e(),t=!0)}},At=-1,Sl=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},bn=function(e){document.visibilityState==="hidden"&&At>-1&&(At=e.type==="visibilitychange"?e.timeStamp:0,Fh())},Tl=function(){addEventListener("visibilitychange",bn,!0),addEventListener("prerenderingchange",bn,!0)},Fh=function(){removeEventListener("visibilitychange",bn,!0),removeEventListener("prerenderingchange",bn,!0)},Ul=function(){return At<0&&(At=Sl(),Tl(),En(function(){setTimeout(function(){At=Sl(),Tl()},0)})),{get firstHiddenTime(){return At}}},lo=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},xl=[1800,3e3],Ml=function(e,t){t=t||{},lo(function(){var r,n=Ul(),i=It("FCP"),o=Pl("paint",function(a){a.forEach(function(l){l.name==="first-contentful-paint"&&(o.disconnect(),l.startTime<n.firstHiddenTime&&(i.value=Math.max(l.startTime-wn(),0),i.entries.push(l),r(!0)))})});o&&(r=Rt(e,i,xl,t.reportAllChanges),En(function(a){i=It("FCP"),r=Rt(e,i,xl,t.reportAllChanges),Dl(function(){i.value=performance.now()-a.timeStamp,r(!0)})}))})};var Vh=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=Ll(e),document.visibilityState==="hidden"?e():(r=t(e),Nl(e)),r};var Ol=[2500,4e3],ao={},Bl=function(e,t){t=t||{},lo(function(){var r,n=Ul(),i=It("LCP"),o=function(u){t.reportAllChanges||(u=u.slice(-1)),u.forEach(function(f){f.startTime<n.firstHiddenTime&&(i.value=Math.max(f.startTime-wn(),0),i.entries=[f],r())})},a=Pl("largest-contentful-paint",o);if(a){r=Rt(e,i,Ol,t.reportAllChanges);var l=Ll(function(){ao[i.id]||(o(a.takeRecords()),a.disconnect(),ao[i.id]=!0,r(!0))});["keydown","click"].forEach(function(u){addEventListener(u,function(){return Vh(l)},{once:!0,capture:!0})}),Nl(l),En(function(u){i=It("LCP"),r=Rt(e,i,Ol,t.reportAllChanges),Dl(function(){i.value=performance.now()-u.timeStamp,ao[i.id]=!0,r(!0)})})}})},Cl=[800,1800],Jh=function e(t){document.prerendering?lo(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},jl=function(e,t){t=t||{};var r=It("TTFB"),n=Rt(e,r,Cl,t.reportAllChanges);Jh(function(){var i=so();i&&(r.value=Math.max(i.responseStart-wn(),0),r.entries=[i],n(!0),En(function(){r=It("TTFB",0),(n=Rt(e,r,Cl,t.reportAllChanges))(!0)}))})};_e();function $h(){Ml(e=>{De("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Bl(e=>{De("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),jl(e=>{De("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function Hh(){Lt.on("onDocumentReady",e=>{Lt.emit("LifecycleEvent.onReady",{isLogin:!1}),P.mpType==="game"&&Ce.start(Date.now()-e)})}function Fl(){Hh(),$h()}Fl();
|
|
4
198
|
/*! Bundled license information:
|
|
5
199
|
|
|
6
200
|
localforage/dist/localforage.js:
|