@jolibox/implement 1.1.52 → 1.1.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.native.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e1=Object.create;var Eo=Object.defineProperty,t1=Object.defineProperties,r1=Object.getOwnPropertyDescriptor,n1=Object.getOwnPropertyDescriptors,i1=Object.getOwnPropertyNames,So=Object.getOwnPropertySymbols,o1=Object.getPrototypeOf,gl=Object.prototype.hasOwnProperty,mf=Object.prototype.propertyIsEnumerable;var hf=(e,t,r)=>t in e?Eo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T=(e,t)=>{for(var r in t||(t={}))gl.call(t,r)&&hf(e,r,t[r]);if(So)for(var r of So(t))mf.call(t,r)&&hf(e,r,t[r]);return e},B=(e,t)=>t1(e,n1(t));var je=(e,t)=>{var r={};for(var n in e)gl.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&So)for(var n of So(e))t.indexOf(n)<0&&mf.call(e,n)&&(r[n]=e[n]);return r};var k=(e,t)=>()=>(e&&(t=e(e=0)),t);var h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vf=(e,t)=>{for(var r in t)Eo(e,r,{get:t[r],enumerable:!0})},a1=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of i1(t))!gl.call(e,i)&&i!==r&&Eo(e,i,{get:()=>t[i],enumerable:!(n=r1(t,i))||n.enumerable});return e};var ie=(e,t,r)=>(r=e!=null?e1(o1(e)):{},a1(t||!e||!e.__esModule?Eo(r,"default",{value:e,enumerable:!0}):r,e));var w=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});function p1(e){return!!(e!=null&&e.__nativeBuffers__)}function El(e){if(typeof e=="string")try{e=JSON.parse(e)}catch(r){return{}}if(typeof e!="object"||e===null)return{};if(!p1(e))return e;let t=e.__nativeBuffers__;if(delete e.__nativeBuffers__,t)for(let r=0;r<t.length;r++){let n=t[r];if(n){let i;n.value?i=n.value:n.base64&&(i=f1(n.base64)),typeof i!="undefined"&&i instanceof ArrayBuffer&&(e[n.key]=i)}}return e}function m1(e={},t=!1){let r=e,n=[];for(let[i,o]of Object.entries(r))if(o!==void 0&&o instanceof ArrayBuffer&&o.byteLength!==void 0){let a=t?{value:o,key:i}:{base64:h1(o),key:i};n.push(a),delete r[i]}return n.length>0&&(r.__nativeBuffers__=n),r}function _1(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Cf(e){return typeof e=="string"}function zr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function yf(e){return typeof e=="number"&&!isNaN(e)}function w1(e){return typeof e=="undefined"}function I1(e){return w1(e)||e===null}function Pf(e){return typeof e=="function"}function S1(e){return zr(e)&&Pf(e.then)}function Of(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Hn(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function P1(e,t,r){let n=e;for(let i of t)if(n&&typeof n=="object")n=n[i];else return r;return n===void 0?r:n}function L1(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function j1(e){return new Promise(t=>Rf(e)(t))}function Rf(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function B1(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Gn(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function H1(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)$1(e[n],t[n])}function $1(e,t){if(Cf(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Pf(t)){try{if(e instanceof t)return}catch(r){}if(!I1(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 Nl(e,t){if(kl.config[e]){Po.warn(`[can i use] ${e} already registered`);return}kl.config[e]=$t({},t)}function wf(e,t){return`[${e}]:${t}`}function Y1(e,t){If||(bl=new ko({eventName:"jolibox_invoke",tagNameOrder:["status","method","errNo","errMsg","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),wl=new ko({eventName:"jolibox_invoke_js2native",tagNameOrder:["status","method","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),Il=new ko({eventName:"jolibox_invoke_native2js",tagNameOrder:["status","method","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),t("onJoliboxEnterBackground",()=>{bl.flush(),wl.flush(),Il.flush()}),If=!0);function r(i){var o,a;let{method:s,args:l,startTime:c,isForeground:d,errMsg:u=`${s}:fail no errMsg`,errNo:p=0,__timing:f={receiveJSInvoke:0,invokeCallback:0}}=i,{receiveJSInvoke:m,invokeCallback:g}=f,_=(a=(o=u.match(/\S:(\S+)\s?/))==null?void 0:o[1])!=null?a:"fail";bl.report({status:_,method:n(s,l),errNo:`${p}`,errMsg:u,isForeground:d,duration:Date.now()-c}),c&&m&&g&&(wl.report({status:_,method:s,isForeground:d,duration:Number((m-c).toFixed(3))}),Il.report({status:_,method:s,isForeground:d,duration:Number((Date.now()-g).toFixed(3))}))}function n(i,o){return(i==="callHostMethod"||i==="callHostMethodSync")&&o!=null&&o.method?`${i}-${o.method}`:i}return r}function tT(e,t){let r=0,n=!0,i=eT.resolveMap,o=Y1(e,t);t("onJoliboxEnterBackground",()=>{n=!1}),t("onJoliboxEnterForeground",()=>{n=!0,Sl.forEach(l=>To(this,[l],function*({method:c,args:d,resolve:u}){let p=yield s(c,d);u(p)})),Sl.length=0});let a=(l,c)=>{let d=i.get(Number(l));if(!d)return;let u=El(c);d(u),i.delete(Number(l))},s=(l,c)=>{var d,u;let p=Date.now(),f=`${n}`;r+=1;let m=new b1;if(i.set(r,m.resolve),!n&&z1.includes(l))return new Promise(A=>{Sl.push({method:l,args:c,resolve:A})});let g=u1($t({},{method:l,startTime:p,args:c,isForeground:f}),{invokeType:"js-bridge"}),_=!X1&&G1.includes(l),v=m1(c,_),b=_?v:JSON.stringify(v),I;if(l.endsWith("Sync")||W1.includes(l)?I=(d=e.call)==null?void 0:d.call(e,l,v,r):typeof b=="string"?I=e.invoke(l,b,r):I=(u=e.call)==null?void 0:u.call(e,l,b,r),I){try{typeof I=="string"&&(I=JSON.parse(I)),I=El(I)}catch(A){Po.error(A)}return i.delete(r),I.errorCode&&(I.errorCode=wf(l,I.errorCode)),o($t($t({},g),I)),I}return l.endsWith("Sync")&&i.delete(r),m.promise.then(A=>(A.errorCode&&(A.errorCode=wf(l,A.errorCode)),o($t($t({},g),A)),A))};return{invokeNative:s,applyNative:(l,c)=>{let d=s(l,c);return S1(d)?d.then(u=>Sf(l,u)):Sf(l,d)},invokeHandler:a}}function Sf(e,t){if(!zr(t)){Po.warn(`[Jolibox SDK]${e} no response value`);return}let r=t,{errMsg:n,errNo:i,errorType:o,errorCode:a}=r,s=d1(r,["errMsg","errNo","errorType","errorCode"]);if(n&&n!==`${e}:ok`)throw new A1(n,i,o,a);return s}function rT(e){if(globalThis[xo])return globalThis[xo];let t=new Cl,r=new Cl,n=new ko({eventName:"jolibox_publish",tagNameOrder:["type","event"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}});return t.on("onJoliboxEnterBackground",()=>{n.flush()}),globalThis[xo]={onNative:t.on.bind(t),offNative:t.off.bind(t),subscribe:r.on.bind(r),unsubscribe:r.off.bind(r),subscribeHandler(i,o,a){let s=El(o),l;if(s.__extra){l=s.params;let{type:c,startTime:d}=s.__extra;n.report({type:c,event:i,duration:Date.now()-d})}else l=s;if(i===Df){l.forEach(c=>{let[d,u]=c;try{r.emit(d.slice(Vn.length),u,a)}catch(p){}});return}if(i.startsWith(Vn)){r.emit(i.slice(Vn.length),l,a);return}t.emit(i,l,a)}},globalThis[xo]}function nT(e){let t=new Map,r=new Map,n,i;return{publish:(o,a,s,l)=>{if(l){let d=s!==void 0?s==="*"?"*":[s]:void 0;e.publish(`${Vn}${o}`,a,d);return}n||(n=Promise.resolve().then(()=>{t.forEach((d,u)=>{try{let p=u!==void 0?u==="*"?"*":[u]:void 0;e.publish(Df,d,p)}catch(p){}}),n=void 0,t.clear()}));let c=t.get(s);c||(c=[],t.set(s,c)),c.push([`${Vn}${o}`,a])},emitNative:(o,a,s,l)=>{if(l){let d=s!==void 0?s==="*"?"*":[s]:void 0;e.publish(o,a,d),console.log("emitNative",o,a,d);return}i||(i=Promise.resolve().then(()=>{r.forEach((d,u)=>{try{let p=u!==void 0?u==="*"?"*":[u]:void 0;e.publish(K1,d,p)}catch(p){}}),i=void 0,r.clear()}));let c=r.get(s);c||(c=[],r.set(s,c)),c.push([o,a])}}}function iT(e){let{subscribeHandler:t,onNative:r,offNative:n,subscribe:i,unsubscribe:o}=rT(e),{invokeNative:a,invokeHandler:s,applyNative:l}=tT(e,r),{publish:c,emitNative:d}=nT(e);return{invokeHandler:s,subscribeHandler:t,applyNative:l,invokeNative:a,onNative:r,offNative:n,emitNative:d,publish:c,subscribe:i,unsubscribe:o}}function Lf(e,t){return{params:e,__extra:{startTime:Date.now(),type:t}}}var s1,l1,c1,Ao,xf,kf,gf,$t,u1,d1,To,f1,h1,Af,v1,g1,Tf,y1,b1,E1,x1,Co,k1,A1,T1,yl,Po,_f,C1,xl,O1,kl,R1,N1,D1,Gr,q1,a9,Al,se,F1,M1,$n,Gn,Cl,Pl,U1,_l,J1,s9,Ol,bf,l9,Nf,V1,Vn,G1,z1,W1,Df,K1,Q1,ko,If,bl,wl,Il,Sl,X1,Rl,Z1,eT,xo,Dl,ht,qf,Ff,oT,Mf,Ef,ye,j,Ze,c9,aT,Uf,Ll,u9,d9,_e=k(()=>{"use strict";s1=Object.defineProperty,l1=Object.defineProperties,c1=Object.getOwnPropertyDescriptors,Ao=Object.getOwnPropertySymbols,xf=Object.prototype.hasOwnProperty,kf=Object.prototype.propertyIsEnumerable,gf=(e,t,r)=>t in e?s1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$t=(e,t)=>{for(var r in t||(t={}))xf.call(t,r)&&gf(e,r,t[r]);if(Ao)for(var r of Ao(t))kf.call(t,r)&&gf(e,r,t[r]);return e},u1=(e,t)=>l1(e,c1(t)),d1=(e,t)=>{var r={};for(var n in e)xf.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ao)for(var n of Ao(e))t.indexOf(n)<0&&kf.call(e,n)&&(r[n]=e[n]);return r},To=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});f1=e=>{let t=atob(e),r=t.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=t.charCodeAt(i);return n.buffer};h1=e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let i=0;i<n;i++)t+=String.fromCharCode(r[i]);return btoa(t)};Af=Object.defineProperty,v1=Object.getOwnPropertyDescriptor,g1=(e,t)=>{for(var r in t)Af(e,r,{get:t[r],enumerable:!0})},Tf=(e,t,r,n)=>{for(var i=n>1?void 0:n?v1(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&&Af(t,r,i),i},y1=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}b1=class{constructor(){this.state="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.state==="pending"&&(this.state="fulfilled",e(r))},this.reject=r=>{this.state==="pending"&&(this.state="rejected",t(r))}})}};E1=(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))(E1||{}),x1=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}},Co=class extends x1{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},k1=class extends Co{constructor(){super(...arguments),this.name="INTERNAL_INVOKE_NATIVE_ERROR"}},A1=class extends Co{constructor(e,t,r,n){super(e),this.errNo=t,this.name="INTERNAL_APPLY_NATIVE_ERROR",this.errorType=r,this.errorCode=n}},T1=class extends Co{constructor(){super(...arguments),this.name="INTERNAL_JSCORE_ERROR",this.priority="P0"}},yl=class extends Co{constructor(){super(...arguments),this.name="INTERNAL_METRIC_REPORT_ERROR"}};Po={log:Hn("log"),warn:Hn("warn"),info:Hn("info"),error:Hn("error"),debug:Hn("debug")};Object.assign(globalThis,{logger:Po});_f=Symbol.for("Jolibox.canIUseMap"),C1={};globalThis[_f]||(globalThis[_f]=C1);xl=Symbol.for("Jolibox.canIUseMap.native"),O1={};globalThis[xl]||(globalThis[xl]=O1);kl={get config(){return globalThis[xl]}},R1=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(R1||{}),N1=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(N1||{}),D1=(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))(D1||{});L1();Gr=typeof window=="undefined",q1=()=>!Gr&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),a9={isiOS:!Gr&&(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:!Gr&&navigator.userAgent.includes("Android"),isMac:!Gr&&navigator.userAgent.includes("Mac"),isFacebook:!Gr&&navigator.userAgent.includes("FB_IAB"),isPC:!Gr&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},Al=class Tl{constructor(t){this.element=t,this.next=Tl.Undefined,this.prev=Tl.Undefined}};Al.Undefined=new Al(void 0);se=Al,F1=class{constructor(){this._first=se.Undefined,this._last=se.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===se.Undefined}clear(){let e=this._first;for(;e!==se.Undefined;){let t=e.next;e.prev=se.Undefined,e.next=se.Undefined,e=t}this._first=se.Undefined,this._last=se.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new se(e);if(this._first===se.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==se.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==se.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==se.Undefined&&e.next!==se.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===se.Undefined&&e.next===se.Undefined?(this._first=se.Undefined,this._last=se.Undefined):e.next===se.Undefined?(this._last=this._last.prev,this._last.next=se.Undefined):e.prev===se.Undefined&&(this._first=this._first.next,this._first.prev=se.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==se.Undefined;)yield e.element,e=e.next}},M1=0,$n=class{constructor(e){this.value=e,this.id=M1++}},Gn=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 $n&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let c=new $n(t);return this._listeners?this._listeners instanceof $n?this._listeners=[this._listeners,c]:this._listeners.push(c):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=c,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var d,u,p,f;if(!this._disposed){if(this._listeners instanceof $n)this._listeners.id===c.id&&(this._listeners=void 0,this._size=0,(u=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||u.call(d));else if(this._listeners){let m=this._listeners.indexOf(c);m>=0&&(this._listeners.splice(m,1),this._size--,this._size===0&&((f=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||f.call(p)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof $n?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Cl=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Gn,o=l=>t(...l.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new F1,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},Pl={};g1(Pl,{None:()=>U1,filter:()=>B1,once:()=>Rf,toPromise:()=>j1});U1=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});_l=Symbol.for("Jolibox.hostEmitter"),J1=()=>{let e=new Cl;return globalThis[_l]||(globalThis[_l]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[_l]},s9=J1();Ol=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Gn,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 H1(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}};Ol=Tf([Of],Ol);bf=class{constructor(){this._onWillExecuteCommand=new Gn,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Gn,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Ol,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=_1(3e4)),this._starActivation}executeCommand(e,...t){return y1(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),Pl.toPromise(Pl.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}}};bf=Tf([Of],bf);l9=Symbol.for("Jolibox.commands");Nl("requestPaymentSync",{version:1e6,properties:{paymentBody:{appStoreProductId:102e4}}});Nl("requestProductDetailsAsync",{version:102e4});Nl("loginSync",{version:1e6,properties:{skipLogin:102e4,triggerFrom:102e4}});Nf=(e,t)=>{function r(i){var o;let[a,...s]=i.split(":");if(!a)return!1;let l=kl.config[a];if(!l)return!1;let c=(o=t==null?void 0:t())!=null?o:"";if(l.platforms&&!l.platforms.includes(c))return!1;let d=l.version;if(typeof d!="number")return!1;let u=e();return typeof u!="number"||u<d?!1:s.length===0?!0:n(l,s,u)||n(l.properties,s,u)}function n(i,o,a){if(!i)return!1;let s=P1(i,o);if(!s)return!1;if(zr(s)){let l=s.version;return yf(l)?typeof a=="number"&&a>=l:!0}return yf(s)?typeof a=="number"&&a>=s:s===!0}return{canIUseNative:r}};V1=()=>q1(),Vn="custom_event_",G1=[],z1=[],W1=["env","createRequestTask","login"],Df="__batch_event__",K1="__native_batch_event__",Q1=e=>e==="pv"?e:"default",ko=class{constructor(e){this.interval=30,this.lastReportTime=0,this.cache={};let{reporter:t,interval:r=30,eventName:n,tagNameOrder:i,metricName:o,type:a}=e;this.reporter=t,this.interval=r,this.eventName=n,this.tagNameOrder=i,this.metricName=o,this.type=Q1(a)}report(e){this.type==="pv"?this.addPVPoint(e):this.addPoint(e),this.tryReport(!1)}flush(){this.tryReport(!0)}tryReport(e){if(Object.keys(this.cache).length){if(e){this.reporter(this.processPoints(this.cache)),this.clearPoints();return}this.lastReportTime=this.lastReportTime||Date.now(),Date.now()-this.lastReportTime>=this.interval*1e3&&(this.reporter(this.processPoints(this.cache)),this.clearPoints(),this.lastReportTime=Date.now())}}addPoint(e){let t=(r,n,i,o)=>{let a=n.shift();if(a){let s=o[a];r[s]||(r[s]={}),t(r[s],n,i,o)}else r[i]||(r[i]=[]),r[i].push(o[i])};t(this.cache,[...this.tagNameOrder],this.metricName,e)}addPVPoint(e){let t=(n,i,o,a)=>{let s=i.shift();if(!s&&zr(a))throw new yl(`report value failed to match tagNameOrder, ${JSON.stringify(r)}`);if(s){let l=[];if(zr(a))l.push(...Object.keys(a));else if(Cf(a)){if(i.length>0)throw new yl(`report value failed to match tagNameOrder, ${JSON.stringify(r)}`);l.push(a)}else throw new yl(`expected metric value to be a string, but got a(n) ${typeof a}, ${JSON.stringify(r)}`);l.forEach(c=>{n[c]||(n[c]={});let d=zr(a)?a[c]:a;t(n[c],[...i],o,d)})}else n[o]?n[o]++:n[o]=1},r={point:e,metricName:this.metricName,tagNameOrder:this.tagNameOrder};t(this.cache,[...this.tagNameOrder],this.metricName,e)}processPoints(e){return{eventName:this.eventName,tagNameOrder:this.tagNameOrder,metricName:this.metricName,metricAggregateType:this.type==="pv"?"itoa":"arr",data:e}}clearPoints(){this.cache={}}},If=!1;Sl=[],X1=!1,Rl=Symbol.for("Jolibox.invokeResolverInstance"),Z1=new Map;globalThis[Rl]||(globalThis[Rl]=Z1);eT={get resolveMap(){return globalThis[Rl]}};xo=Symbol.for("Jolibox.subscribeInstance");ht={trigger(){},exit(){return Promise.resolve(!1)},backPress(){return Promise.resolve(!1)},onReady(e){ht.trigger=e},onDoExit(e){ht.exit=e},onDoBackPress(e){ht.backPress=e}},qf=e=>{let t=window.prompt("invoke",JSON.stringify({event:"envSync",paramsString:JSON.stringify({})}));if(!t)e.onError(new k1("native env failed"));else{let{data:r}=JSON.parse(t);return r!=null?r:void 0}};if(typeof window!="undefined"&&window.webkit){let e=window.webkit.messageHandlers,t=(i="")=>{ht.trigger(),e.onDocumentReady.postMessage({path:i})},r=i=>To(void 0,null,function*(){let o=yield ht.exit();e.doExit.postMessage({uuid:i,shouldInterrupt:o})});Dl={onDocumentReady:t,doExit:r,invoke(i,o,a){e.invoke.postMessage({event:i,paramsString:o,callbackId:a})},publish(i,o,a){let s=Lf(o,"joliboxJSCore");window.prompt("publish",JSON.stringify({event:i,paramsString:JSON.stringify(s),webviewIds:a}))},call(i,o,a){let s=window.prompt("invoke",JSON.stringify({event:i,paramsString:JSON.stringify(o),callbackId:a}));if(s)return JSON.parse(s)}};let n={onDocumentReady:t,env:qf,doExit:r};globalThis.joliboxJSCore=$t({},n)}if(typeof window!="undefined"&&window.JoliAndroidSDKBridge){let e,t=window.JoliAndroidSDKBridge,r=(o="")=>{ht.trigger(),t.onDocumentReady(JSON.stringify({path:o}))},n=o=>To(void 0,null,function*(){let a=yield ht.exit();t.doExit(JSON.stringify({uuid:o,shouldInterrupt:a}))});Dl={onDocumentReady:r,invoke(o,a,s){t.invoke(JSON.stringify({event:o,paramsString:a,callbackId:s}))},doExit:n,publish(o,a,s){let l=Lf(a,"joliboxJSCore");t.publish(JSON.stringify({event:o,paramsString:JSON.stringify(l),webviewIds:s}))},call(o,a,s){let l=window.prompt("invoke",JSON.stringify({event:o,paramsString:JSON.stringify(a),callbackId:s}));if(l)return JSON.parse(l)},doBackPress(o){return To(this,null,function*(){let a=yield ht.backPress();t.doBackPress(JSON.stringify({uuid:o,shouldInterrupt:a}))})}};let i={onDocumentReady:r,env:qf,doExit:n};globalThis.joliboxJSCore=$t({},i)}Ff=Dl;if(!Ff&&V1())throw new T1("No joliboxJScore is found, native bridge not found.");oT=$t({},Ff),Mf=iT(oT),{invokeHandler:Ef}=Mf,{applyNative:ye,invokeNative:j,onNative:Ze,offNative:c9,subscribeHandler:aT,publish:Uf,emitNative:Ll,subscribe:u9,unsubscribe:d9}=Mf;globalThis.joliboxJSBridge={callHandler:Ef,invokeHandler:Ef,subscribeHandler:aT}});function fT(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Vf(e){return new Promise(t=>setTimeout(t,e))}function Yn(e){return typeof e=="string"}function Tr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Gf(e){return typeof e=="object"&&Array.isArray(e)}function zf(e){return typeof e=="number"&&!isNaN(e)}function Wr(e){return e===!0||e===!1}function Wf(e){return typeof e=="undefined"}function Hl(e){return Wf(e)||e===null}function hT(e){return typeof e=="function"}function Kf(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Qf(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,o){for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=i[a],l=o[a],c=r(s,l,a,i,o);c!==void 0?i[a]=c:Jf(l)&&Jf(s)?i[a]=n(uT({},s),l):Array.isArray(l)&&Array.isArray(s)?i[a]=[...s,...l]:i[a]=l}return i}return n(e,t)}function Jf(e){return e&&typeof e=="object"&&e.constructor===Object}function Yf(e,t){if(Array.isArray(e))return e.concat(t)}function Xn(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:l=!0}=r,c=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),d=function(...u){i=u,o=this;let p=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,l&&!p&&c()},t),p)return c()};return d.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},d.flush=()=>{if(n)return clearTimeout(n),n=null,c()},d}function vT(e,t){return(...r)=>t(e,...r)}function Ro(e){return t=>vT(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new lr(`${i}`))}})}function zn(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function ih(e,t,r){let n=0;if(e!==t){let i=e.split("."),o=t.split("."),a=Math.max(i.length,o.length);for(let s=0;s<a;s++){let l=parseInt(i[s],10)||0,c=parseInt(o[s],10)||0;if(l>c){n=1;break}else if(l<c){n=-1;break}}}if(!r)return n;switch(r){case">":return n>0;case"<":return n<0;case"=":return n===0;case">=":return n>=0;case"<=":return n<=0;default:return!1}}function Kl(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function xT(e){return new Promise(t=>lh(e)(t))}function lh(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function kT(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Qn(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function TT(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)CT(e[n],t[n])}function CT(e,t){if(Yn(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(hT(t)){try{if(e instanceof t)return}catch(r){}if(!Hl(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 PT(){return typeof globalThis!="undefined"?globalThis[ch]:void 0}function OT(e){typeof globalThis!="undefined"&&(globalThis[ch]=e)}function X(e=!1){let t=PT();if(!e&&t)return t;let r=new Oo,n=new Bl,i={registerCommand(o,a,s){r.registerCommand({id:o,handler:a,metadata:s})},executeCommand(o,...a){return n.executeCommand(o,...a)},excuteCommandSync(o,...a){return n.executeCommandThowErr(o,...a)}};return OT(i),i}var Jl,sT,jf,lT,cT,Bf,uT,dT,$f,pT,Ct,mT,$l,Zn,Vl,Xf,lr,Zf,eh,th,rh,nh,ei,Gl,Pt,Fl,gT,zl,Hf,yT,J,Wl,_T,No,Wn,ti,bT,wT,oh,ah,sh,Ml,le,IT,ST,Kn,Qn,Ot,jl,ET,ql,AT,ne,Oo,Bl,ch,D=k(()=>{"use strict";Jl=Object.defineProperty,sT=Object.getOwnPropertyDescriptor,jf=Object.getOwnPropertySymbols,lT=Object.prototype.hasOwnProperty,cT=Object.prototype.propertyIsEnumerable,Bf=(e,t,r)=>t in e?Jl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,uT=(e,t)=>{for(var r in t||(t={}))lT.call(t,r)&&Bf(e,r,t[r]);if(jf)for(var r of jf(t))cT.call(t,r)&&Bf(e,r,t[r]);return e},dT=(e,t)=>{for(var r in t)Jl(e,r,{get:t[r],enumerable:!0})},$f=(e,t,r,n)=>{for(var i=n>1?void 0:n?sT(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&&Jl(t,r,i),i},pT=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}Ct=class{constructor(){this.state="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.state==="pending"&&(this.state="fulfilled",e(r))},this.reject=r=>{this.state==="pending"&&(this.state="rejected",t(r))}})}};mT=(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))(mT||{}),$l=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}},Zn=class extends $l{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Vl=class extends $l{constructor(){super(...arguments),this.kind="USER_ERROR"}},Xf=class extends Vl{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},lr=class extends Vl{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))}},Zf=class extends Vl{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="USER_PAYMENT_ERROR",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},eh=class extends Zn{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},th=class extends Zn{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="INTERNAL_PAYMENT_ERROR",this.priority="P0",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},rh=class extends Zn{constructor(){super(...arguments),this.name="INTERNAL_INVOKE_METHOD_ERROR"}},nh=class extends Zn{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},ei=class extends $l{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}}},Gl=class extends Zn{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Pt={log:zn("log"),warn:zn("warn"),info:zn("info"),error:zn("error"),debug:zn("debug")};Object.assign(globalThis,{logger:Pt});Fl=Symbol.for("Jolibox.canIUseMap"),gT={};globalThis[Fl]||(globalThis[Fl]=gT);zl={get config(){return globalThis[Fl]}},Hf=Symbol.for("Jolibox.canIUseMap.native"),yT={};globalThis[Hf]||(globalThis[Hf]=yT);J=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(J||{}),Wl=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Wl||{}),_T=(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))(_T||{}),No=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});Kl();Wn=typeof window=="undefined",ti={isiOS:!Wn&&(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:!Wn&&navigator.userAgent.includes("Android"),isMac:!Wn&&navigator.userAgent.includes("Mac"),isFacebook:!Wn&&navigator.userAgent.includes("FB_IAB"),isPC:!Wn&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},bT="device_id",wT="advertising_id",oh=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,No()),window.__joliboxLocalStorage__.getItem(e)),ah=()=>new URLSearchParams(window.location.search).get("deviceId")||oh(bT),sh=()=>new URLSearchParams(window.location.search).get("advertisingId")||oh(wT),Ml=class Ul{constructor(t){this.element=t,this.next=Ul.Undefined,this.prev=Ul.Undefined}};Ml.Undefined=new Ml(void 0);le=Ml,IT=class{constructor(){this._first=le.Undefined,this._last=le.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===le.Undefined}clear(){let e=this._first;for(;e!==le.Undefined;){let t=e.next;e.prev=le.Undefined,e.next=le.Undefined,e=t}this._first=le.Undefined,this._last=le.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new le(e);if(this._first===le.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==le.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==le.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==le.Undefined&&e.next!==le.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===le.Undefined&&e.next===le.Undefined?(this._first=le.Undefined,this._last=le.Undefined):e.next===le.Undefined?(this._last=this._last.prev,this._last.next=le.Undefined):e.prev===le.Undefined&&(this._first=this._first.next,this._first.prev=le.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==le.Undefined;)yield e.element,e=e.next}},ST=0,Kn=class{constructor(e){this.value=e,this.id=ST++}},Qn=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 Kn&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let c=new Kn(t);return this._listeners?this._listeners instanceof Kn?this._listeners=[this._listeners,c]:this._listeners.push(c):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=c,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var d,u,p,f;if(!this._disposed){if(this._listeners instanceof Kn)this._listeners.id===c.id&&(this._listeners=void 0,this._size=0,(u=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||u.call(d));else if(this._listeners){let m=this._listeners.indexOf(c);m>=0&&(this._listeners.splice(m,1),this._size--,this._size===0&&((f=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||f.call(p)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Kn?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Ot=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Qn,o=l=>t(...l.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new IT,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},jl={};dT(jl,{None:()=>ET,filter:()=>kT,once:()=>lh,toPromise:()=>xT});ET=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});ql=Symbol.for("Jolibox.hostEmitter"),AT=()=>{let e=new Ot;return globalThis[ql]||(globalThis[ql]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[ql]},ne=AT();Oo=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Qn,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 TT(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}};Oo=$f([Kf],Oo);Bl=class{constructor(){this._onWillExecuteCommand=new Qn,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Qn,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Oo,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=fT(3e4)),this._starActivation}executeCommand(e,...t){return pT(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),jl.toPromise(jl.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}}};Bl=$f([Kf],Bl);ch=Symbol.for("Jolibox.commands")});function ke(e,t={}){Ql.emit("ERROR_REPORT",{error:e,options:t})}var Ql,Cr,mt=k(()=>{"use strict";D();D();Ql=new Ot,Cr=new Ot;ke.debounce=Xn(ke,50,{leading:!0})});var Yl,RT,uh,dh,ph=k(()=>{"use strict";D();mt();Yl=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{}}},RT=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},uh=e=>{var t;try{let i=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(i!=null&&i.length){let[o,a,s]=i;return{headerJson:Yl(o),payloadJson:Yl(a),signature:Yl(s)}}else throw"joli_source is missing"}catch(r){return ke(new eh(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},dh=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=RT(e),o=r[2];return`${n}.${i}.${o}`}return t}});var NT,Xl,fh=k(()=>{"use strict";D();NT="1.1.52",Xl=()=>NT});function ec(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var DT,hh,Zl,mh,de,LT,S,K=k(()=>{"use strict";D();ph();fh();D();DT={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:ah(),adId:sh(),pixelRatio:window.devicePixelRatio||1,platform:ti.isAndroid?"android":ti.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:Xl()},schema:window.location.href,platform:ti.isAndroid?"android":ti.isiOS?"ios":"h5"},Zl=(hh=globalThis.joliboxJSCore)==null?void 0:hh.env,de=Object.assign({},(mh=Zl==null?void 0:Zl())!=null?mh:DT);LT=()=>{var f,m,g,_,v,b,I,A,P,O,x;let{payloadJson:e,headerJson:t,signature:r}=de.schema.length?uh(de.schema):{},n=`${de.deviceInfo.did}-${new Date().getTime()}`,o=new URL(de.schema.length?de.schema:window.location.href).searchParams,a=(g=(m=(f=o.get("mpId"))!=null?f:o.get("appId"))!=null?m:o.get("gameId"))!=null?g:"",s=(b=(v=(_=de.clientSessionId)!=null?_:e==null?void 0:e.sessionId)!=null?v:o.get("sessionId"))!=null?b:n,l=!!((A=(I=e==null?void 0:e.testAdsMode)!=null?I:e==null?void 0:e.__testAdsMode)!=null?A:o.get("testAdsMode")==="true"),c=(x=(O=(P=e==null?void 0:e.joliboxEnv)!=null?P:e==null?void 0:e.__joliboxEnv)!=null?O:o.get("joliboxEnv"))!=null?x:"production",d=c==="staging",u=t==null?void 0:t.channel,p=e==null?void 0:e.__shouldInterupt;return{get startTime(){var C;return(C=performance.timeOrigin)!=null?C:performance.timing.navigationStart},get testMode(){return d},get testAdsMode(){return l},get joliboxEnv(){return c},get joliSource(){var C;return(C=o.get("joliSource"))!=null?C:null},get mpId(){var C;return(C=a!=null?a:e==null?void 0:e.id)!=null?C:""},get mpVersion(){var C;return(C=t==null?void 0:t.ver)!=null?C:Xl()},get mpType(){var C,U;return(U=(C=t==null?void 0:t.__mpType)!=null?C:e==null?void 0:e.__mpType)!=null?U:"game"},get platform(){var C;return((C=de.platform)!=null?C:de.deviceInfo.platform).toLowerCase()},get deviceInfo(){return de.deviceInfo},get sdkInfo(){return de.sdkInfo},get hostInfo(){return de.hostInfo},get hostUserInfo(){return de.hostUserInfo},get sessionId(){var C,U;return(U=(C=de.clientSessionId)!=null?C:s)!=null?U:n},get channel(){return u},get webviewId(){var C;return(C=de.webviewId)!=null?C:-1},get shouldInterupt(){return p},get from(){return e==null?void 0:e.__from},get baseApiHost(){return d?"https://stg-api.jolibox.com":"https://api.jolibox.com"},get adId(){var C;return(C=de.deviceInfo.adId)!=null?C:de.deviceInfo.did},get language(){return de.deviceInfo.lang},get sdkEnvironment(){return ec("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":ec("gamedistribution","jolibox")?"gamedistribution":ec("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var q,Re,Ne;let C=(q=de.deviceInfo.pixelRatio)!=null?q:1,U=(Re=de.deviceInfo.statusBarHeight)!=null?Re:e==null?void 0:e.__androidStatusBarHeight,We=(Ne=de.deviceInfo.navigationBarHeight)!=null?Ne:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:U!==void 0?U/C:20,navigationBarHeight:We!==void 0?We/C:10}},get abTests(){var C,U;return(U=(C=de.abValues)==null?void 0:C.split(","))!=null?U:[]},onEnvConfigChanged:C=>{Qf(de,C,Yf)},encodeJoliSourceQuery:C=>{var U,We;return t&&r?dh(T(T({},e),C),(U=o.get("joliSource"))!=null?U:""):(We=o.get("joliSource"))!=null?We:""},setDoExitDirectly:()=>{p=!1}}},S=LT()});var tc,gh,qT,FT,vh,MT,yh=k(()=>{"use strict";D();mt();K();D();tc=!1,gh=(e,t)=>e==null?!1:t in e,qT=e=>gh(e,"kind"),FT=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},vh=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=S.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=S.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:FT(e.name)},i=B(T({},n),{env:t.environment,isFromUser:r});r?Cr.emit("GLOBAL_USER_ERROR",e,i):Cr.emit("GLOBAL_ERROR",e,i)},MT=e=>gh(e,"kind")&&e.kind==="USER_ERROR";Ql.on("ERROR_REPORT",({error:e,options:t})=>{if(tc)return;tc=!0;let r=qT(e)&&e.raw?e.raw:e;try{let n=MT(e);vh(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new Gl(`${i}, origin error: ${r.message}`);Pt.error(o),vh(new Gl(o.message),{environment:t.environment},!1)}finally{tc=!1}})});var cr,rc,Kr=k(()=>{"use strict";mt();D();mt();cr=(e,t)=>{var r,n;return new ei((n=(r=t==null?void 0:t.errMsg)!=null?r:e.msg)!=null?n:"",e.code,e.type)},rc=e=>new Xf(e)});var _h=k(()=>{"use strict";yh();Kr();D();_e();Cr.on("GLOBAL_ERROR",(e,t)=>{var n;let r={message:e.message,stack:(n=e.stack)!=null?n:"",errorType:e.name,source:0};j("trackAsync",{event:"reportJsError",data:r})});Cr.on("GLOBAL_USER_ERROR",(e,t)=>{Pt.log("UserError",e,t)})});var nc=k(()=>{"use strict"});function bh(e,t){let r=(n,i,o)=>{let c=i!=null?i:{},{eventType:a}=c,s=je(c,["eventType"]),l=B(T({tag:n,eventType:o!=null?o:a!=null?a:J.Other},t),{extra:T({},s)});n=="globalJsError"?ke(new nh(JSON.stringify(l))):e("systemLog",l,S.webviewId)};return r.debounce=Xn(r,500,{leading:!0}),r}function wh(e){let t=(r,n,i)=>{var s;let o=(s=i&&JSON.stringify(i))!=null?s:0,a={speed_value_type:r,total_duration:n};o&&Object.assign(a,{extra:o}),e("joliboxSpeedAnalysis",a)};return t.debounce=Xn(t,500,{leading:!0}),t}var Ih=k(()=>{"use strict";D();D();mt();K()});function Sh(e,t){let r=bh(e,t),n=wh(r);return{track:r,trackPerformance:n}}var Eh=k(()=>{"use strict";Ih()});var xh=k(()=>{"use strict";K();D();D()});var kh=k(()=>{"use strict";Eh();nc();xh()});var Do,Ah=k(()=>{"use strict";Do=class{constructor(t,r){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.timer=this.createRAFTimer(t=>{this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t})});this.interval=r!=null?r:5*1e3,t.on("visible",n=>{this.visible=n})}start(t){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:t!=null?t:0}}),this.tracker("OpenGame",{duration:t!=null?t:0}),this.timer.start()}close(t){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:t}}),this.tracker("CloseGame",{duration:t}),this.timer.stop()}createRAFTimer(t){let r=Date.now(),n,i,o=!1,a=0,s=()=>{if(!o)return;let f=Date.now(),m=f-r;m>=this.interval&&(this.visible&&(a+=Math.min(m,this.interval+1e3),t(a)),r=f),n=requestAnimationFrame(s)},l=()=>{d(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let f=Date.now();f-r>=this.interval&&(r=f)},this.interval)},c=()=>{u(),r=Date.now(),n=requestAnimationFrame(s)},d=()=>{n&&(cancelAnimationFrame(n),n=0)},u=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",f=>{o&&(console.log("visible",f),f?c():l())});let p=this.visible;return{start(){o||(o=!0,p?c():l())},stop(){o=!1,d(),u()}}}}});function Lo(e,t,r){var l,c,d;let n=new Map,i=(l=r==null?void 0:r.baseUrl)!=null?l:"https://api.jolibox.com",o=(c=r==null?void 0:r.type)!=null?c:"public",a=(d=r==null?void 0:r.defaultHeaders)!=null?d:{};return Ze("onRequestTaskStateChange",u=>{if(typeof u.requestTaskId!="string")return;let p=n.get(u.requestTaskId);if(p)if(u.state==="success"){let f=u,{requestTaskId:g,state:_}=f,v=je(f,["requestTaskId","state"]);u.statusCode===200?p.resolve(v):p.reject(v),n.delete(g)}else if(u.state==="fail"){let m=u,{requestTaskId:g,state:_}=m,v=je(m,["requestTaskId","state"]);p.reject(v),n.delete(g)}else Pt.warn("onRequestTaskStateChange unknown event",u)}),ne.on("onLoginComplete",({isLogin:u,token:p})=>{o!=="public"&&u&&p&&(a["X-JOLI-TOKEN"]=p)}),(f,...m)=>w(this,[f,...m],function*(u,p={}){let g=Date.now(),_=UT(u,B(T({},p),{baseUrl:i})),{method:v="GET",responseType:b="text",dataType:I="json",timeout:A,enableCache:P=!1,appendHostCookie:O=!0}=p,x=Object.assign({"content-type":"application/json"},a,p.header),C={url:_,method:v,header:x,enableCache:P,responseType:b,appendHostCookie:O};if(v=="POST"||v=="PUT"){let Ne=BT(p.data,x["content-type"]);C.data=Ne}A&&Object.assign(C,{timeout:A});let{data:{requestTaskId:U}}=j(e,C);if(typeof U!="string")throw cr({code:-1,msg:"requestTaskId is not a string"});let{resolve:We,reject:q,promise:Re}=new Ct;n.set(U,{resolve:We,reject:q});try{let Ne=yield Re,{data:Ar}=Ne;return I==="json"&&typeof Ar=="string"&&(Ar=jT(Ar)),{url:_,timeout:A,method:v,response:B(T({},Ne),{data:Ar})}}catch(Ne){let Ar=Ne;if(Tr(Ar)){let{errMsg:vl,prefetchDetail:n9,isPrefetch:i9,errNo:ZA}=Ar;Yn(vl)&&ke(cr({code:-1,msg:vl},{errNo:ZA,errMsg:vl}))}throw Ne}})}function jT(e){try{return JSON.parse(e.trim())}catch(t){return e}}function BT(e,t="application/json"){let r=t.toLowerCase();return e===void 0?"":typeof e=="string"||e instanceof ArrayBuffer?e:r.includes("application/x-www-form-urlencoded")||r.includes("application/json")||typeof e=="object"?JSON.stringify(e):String(e)}var UT,ic=k(()=>{"use strict";D();_e();mt();Kr();UT=(e,t)=>{if(/^https?:\/\//.test(e))return e;let r=t==null?void 0:t.query,i=new URLSearchParams(r).toString();return t!=null&&t.baseUrl?`${t.baseUrl}${e}${i?`?${i}`:""}`:`${e}${i?`?${i}`:""}`}});var oc,Th,te,vt=k(()=>{"use strict";ic();K();oc={};(Th=S.hostUserInfo)!=null&&Th.token&&(oc["x-joli-token"]=S.hostUserInfo.token);S.joliSource&&(oc["x-joli-source"]=S.joliSource);te=Lo("createRequestTaskSync","operateRequestTaskSync",{type:"inner",baseUrl:S.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com",defaultHeaders:oc})});var qo,Ch=k(()=>{"use strict";K();Ah();vt();_e();qo=class extends Do{constructor(t,r,n){super(r,n),this.gameId=S.mpId,this.sessionId=S.sessionId,this.track=t,this.taskUrl=S.testMode?"https://stg-api.jolibox.com/api/base/app-event":"https://api.jolibox.com/api/base/app-event"}reporter(t){return w(this,null,function*(){let{event:r,params:n,extraParams:i}=t,o={eventType:r,gameInfo:T({gameId:this.gameId,sessionId:this.sessionId},n)};i&&Object.assign(o,i),yield S.platform==="android"?te("/api/base/app-event",{method:"POST",data:o}):ye("trackAppEventAsync",{url:this.taskUrl,body:JSON.stringify(o)})})}reportToNative(t){return w(this,null,function*(){let{event:r,params:n}=t;yield ye("userTrackAsync",{event:r,params:T({},n),gameId:this.gameId})})}tracker(t,r=null){this.track(t,r)}}});var Dh={};vf(Dh,{nativeTaskEmitter:()=>ri,taskTracker:()=>It,track:()=>M,trackPerformance:()=>Rh});var JT,Ph,Oh,M,Rh,Nh,ri,It,gt=k(()=>{"use strict";_h();D();nc();kh();K();Ch();_e();JT=(e,t,r)=>{var s,l,c,d,u,p;let n=t,i=Tr(n.extra)?n.extra:Yn(n.extra)?JSON.parse(n.extra):{},o=B(T({},i),{mp_id:(s=n.mp_id)!=null?s:"",mp_version:(l=n.mp_version)!=null?l:"",session_id:S.sessionId,user_id:(d=(c=S.hostUserInfo)==null?void 0:c.uid)!=null?d:""}),a=(u=n.eventType)!=null?u:J.Other;j("trackAsync",{event:(p=t.tag)!=null?p:e,data:o,webviewId:r,eventType:a})},{track:M,trackPerformance:Rh}=Sh(JT,{type:Wl.AppSDK,platform:"native",jssdk_version:(Oh=(Ph=S.sdkInfo)==null?void 0:Ph.jssdkVersion)!=null?Oh:"1.0.0",mp_id:S.mpId,mp_version:S.mpVersion}),Nh=X();Nh.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Rh(e,t,r)});Nh.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{M(e,t)});ri=new Ot,It=new qo(M,ri)});function Lh(){let e=null,t=null,r=window.fetch,n=()=>{t=document.createElement("meta"),t.setAttribute("name","viewport"),t.setAttribute("content","viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"),t.setAttribute("data-jolibox-sdk","viewport-meta"),e=document.createElement("style"),e.setAttribute("data-jolibox-sdk","default-styles");let s=`
|
|
1
|
+
var e1=Object.create;var Eo=Object.defineProperty,t1=Object.defineProperties,r1=Object.getOwnPropertyDescriptor,n1=Object.getOwnPropertyDescriptors,i1=Object.getOwnPropertyNames,So=Object.getOwnPropertySymbols,o1=Object.getPrototypeOf,gl=Object.prototype.hasOwnProperty,mf=Object.prototype.propertyIsEnumerable;var hf=(e,t,r)=>t in e?Eo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T=(e,t)=>{for(var r in t||(t={}))gl.call(t,r)&&hf(e,r,t[r]);if(So)for(var r of So(t))mf.call(t,r)&&hf(e,r,t[r]);return e},B=(e,t)=>t1(e,n1(t));var je=(e,t)=>{var r={};for(var n in e)gl.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&So)for(var n of So(e))t.indexOf(n)<0&&mf.call(e,n)&&(r[n]=e[n]);return r};var k=(e,t)=>()=>(e&&(t=e(e=0)),t);var h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vf=(e,t)=>{for(var r in t)Eo(e,r,{get:t[r],enumerable:!0})},a1=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of i1(t))!gl.call(e,i)&&i!==r&&Eo(e,i,{get:()=>t[i],enumerable:!(n=r1(t,i))||n.enumerable});return e};var ie=(e,t,r)=>(r=e!=null?e1(o1(e)):{},a1(t||!e||!e.__esModule?Eo(r,"default",{value:e,enumerable:!0}):r,e));var w=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});function p1(e){return!!(e!=null&&e.__nativeBuffers__)}function El(e){if(typeof e=="string")try{e=JSON.parse(e)}catch(r){return{}}if(typeof e!="object"||e===null)return{};if(!p1(e))return e;let t=e.__nativeBuffers__;if(delete e.__nativeBuffers__,t)for(let r=0;r<t.length;r++){let n=t[r];if(n){let i;n.value?i=n.value:n.base64&&(i=f1(n.base64)),typeof i!="undefined"&&i instanceof ArrayBuffer&&(e[n.key]=i)}}return e}function m1(e={},t=!1){let r=e,n=[];for(let[i,o]of Object.entries(r))if(o!==void 0&&o instanceof ArrayBuffer&&o.byteLength!==void 0){let a=t?{value:o,key:i}:{base64:h1(o),key:i};n.push(a),delete r[i]}return n.length>0&&(r.__nativeBuffers__=n),r}function _1(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Cf(e){return typeof e=="string"}function zr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function yf(e){return typeof e=="number"&&!isNaN(e)}function w1(e){return typeof e=="undefined"}function I1(e){return w1(e)||e===null}function Pf(e){return typeof e=="function"}function S1(e){return zr(e)&&Pf(e.then)}function Of(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Hn(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function P1(e,t,r){let n=e;for(let i of t)if(n&&typeof n=="object")n=n[i];else return r;return n===void 0?r:n}function L1(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function j1(e){return new Promise(t=>Rf(e)(t))}function Rf(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function B1(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Gn(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function H1(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)$1(e[n],t[n])}function $1(e,t){if(Cf(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Pf(t)){try{if(e instanceof t)return}catch(r){}if(!I1(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 Nl(e,t){if(kl.config[e]){Po.warn(`[can i use] ${e} already registered`);return}kl.config[e]=$t({},t)}function wf(e,t){return`[${e}]:${t}`}function Y1(e,t){If||(bl=new ko({eventName:"jolibox_invoke",tagNameOrder:["status","method","errNo","errMsg","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),wl=new ko({eventName:"jolibox_invoke_js2native",tagNameOrder:["status","method","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),Il=new ko({eventName:"jolibox_invoke_native2js",tagNameOrder:["status","method","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),t("onJoliboxEnterBackground",()=>{bl.flush(),wl.flush(),Il.flush()}),If=!0);function r(i){var o,a;let{method:s,args:l,startTime:c,isForeground:d,errMsg:u=`${s}:fail no errMsg`,errNo:p=0,__timing:f={receiveJSInvoke:0,invokeCallback:0}}=i,{receiveJSInvoke:m,invokeCallback:g}=f,_=(a=(o=u.match(/\S:(\S+)\s?/))==null?void 0:o[1])!=null?a:"fail";bl.report({status:_,method:n(s,l),errNo:`${p}`,errMsg:u,isForeground:d,duration:Date.now()-c}),c&&m&&g&&(wl.report({status:_,method:s,isForeground:d,duration:Number((m-c).toFixed(3))}),Il.report({status:_,method:s,isForeground:d,duration:Number((Date.now()-g).toFixed(3))}))}function n(i,o){return(i==="callHostMethod"||i==="callHostMethodSync")&&o!=null&&o.method?`${i}-${o.method}`:i}return r}function tT(e,t){let r=0,n=!0,i=eT.resolveMap,o=Y1(e,t);t("onJoliboxEnterBackground",()=>{n=!1}),t("onJoliboxEnterForeground",()=>{n=!0,Sl.forEach(l=>To(this,[l],function*({method:c,args:d,resolve:u}){let p=yield s(c,d);u(p)})),Sl.length=0});let a=(l,c)=>{let d=i.get(Number(l));if(!d)return;let u=El(c);d(u),i.delete(Number(l))},s=(l,c)=>{var d,u;let p=Date.now(),f=`${n}`;r+=1;let m=new b1;if(i.set(r,m.resolve),!n&&z1.includes(l))return new Promise(A=>{Sl.push({method:l,args:c,resolve:A})});let g=u1($t({},{method:l,startTime:p,args:c,isForeground:f}),{invokeType:"js-bridge"}),_=!X1&&G1.includes(l),v=m1(c,_),b=_?v:JSON.stringify(v),I;if(l.endsWith("Sync")||W1.includes(l)?I=(d=e.call)==null?void 0:d.call(e,l,v,r):typeof b=="string"?I=e.invoke(l,b,r):I=(u=e.call)==null?void 0:u.call(e,l,b,r),I){try{typeof I=="string"&&(I=JSON.parse(I)),I=El(I)}catch(A){Po.error(A)}return i.delete(r),I.errorCode&&(I.errorCode=wf(l,I.errorCode)),o($t($t({},g),I)),I}return l.endsWith("Sync")&&i.delete(r),m.promise.then(A=>(A.errorCode&&(A.errorCode=wf(l,A.errorCode)),o($t($t({},g),A)),A))};return{invokeNative:s,applyNative:(l,c)=>{let d=s(l,c);return S1(d)?d.then(u=>Sf(l,u)):Sf(l,d)},invokeHandler:a}}function Sf(e,t){if(!zr(t)){Po.warn(`[Jolibox SDK]${e} no response value`);return}let r=t,{errMsg:n,errNo:i,errorType:o,errorCode:a}=r,s=d1(r,["errMsg","errNo","errorType","errorCode"]);if(n&&n!==`${e}:ok`)throw new A1(n,i,o,a);return s}function rT(e){if(globalThis[xo])return globalThis[xo];let t=new Cl,r=new Cl,n=new ko({eventName:"jolibox_publish",tagNameOrder:["type","event"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}});return t.on("onJoliboxEnterBackground",()=>{n.flush()}),globalThis[xo]={onNative:t.on.bind(t),offNative:t.off.bind(t),subscribe:r.on.bind(r),unsubscribe:r.off.bind(r),subscribeHandler(i,o,a){let s=El(o),l;if(s.__extra){l=s.params;let{type:c,startTime:d}=s.__extra;n.report({type:c,event:i,duration:Date.now()-d})}else l=s;if(i===Df){l.forEach(c=>{let[d,u]=c;try{r.emit(d.slice(Vn.length),u,a)}catch(p){}});return}if(i.startsWith(Vn)){r.emit(i.slice(Vn.length),l,a);return}t.emit(i,l,a)}},globalThis[xo]}function nT(e){let t=new Map,r=new Map,n,i;return{publish:(o,a,s,l)=>{if(l){let d=s!==void 0?s==="*"?"*":[s]:void 0;e.publish(`${Vn}${o}`,a,d);return}n||(n=Promise.resolve().then(()=>{t.forEach((d,u)=>{try{let p=u!==void 0?u==="*"?"*":[u]:void 0;e.publish(Df,d,p)}catch(p){}}),n=void 0,t.clear()}));let c=t.get(s);c||(c=[],t.set(s,c)),c.push([`${Vn}${o}`,a])},emitNative:(o,a,s,l)=>{if(l){let d=s!==void 0?s==="*"?"*":[s]:void 0;e.publish(o,a,d),console.log("emitNative",o,a,d);return}i||(i=Promise.resolve().then(()=>{r.forEach((d,u)=>{try{let p=u!==void 0?u==="*"?"*":[u]:void 0;e.publish(K1,d,p)}catch(p){}}),i=void 0,r.clear()}));let c=r.get(s);c||(c=[],r.set(s,c)),c.push([o,a])}}}function iT(e){let{subscribeHandler:t,onNative:r,offNative:n,subscribe:i,unsubscribe:o}=rT(e),{invokeNative:a,invokeHandler:s,applyNative:l}=tT(e,r),{publish:c,emitNative:d}=nT(e);return{invokeHandler:s,subscribeHandler:t,applyNative:l,invokeNative:a,onNative:r,offNative:n,emitNative:d,publish:c,subscribe:i,unsubscribe:o}}function Lf(e,t){return{params:e,__extra:{startTime:Date.now(),type:t}}}var s1,l1,c1,Ao,xf,kf,gf,$t,u1,d1,To,f1,h1,Af,v1,g1,Tf,y1,b1,E1,x1,Co,k1,A1,T1,yl,Po,_f,C1,xl,O1,kl,R1,N1,D1,Gr,q1,a9,Al,se,F1,M1,$n,Gn,Cl,Pl,U1,_l,J1,s9,Ol,bf,l9,Nf,V1,Vn,G1,z1,W1,Df,K1,Q1,ko,If,bl,wl,Il,Sl,X1,Rl,Z1,eT,xo,Dl,ht,qf,Ff,oT,Mf,Ef,ye,j,Ze,c9,aT,Uf,Ll,u9,d9,_e=k(()=>{"use strict";s1=Object.defineProperty,l1=Object.defineProperties,c1=Object.getOwnPropertyDescriptors,Ao=Object.getOwnPropertySymbols,xf=Object.prototype.hasOwnProperty,kf=Object.prototype.propertyIsEnumerable,gf=(e,t,r)=>t in e?s1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$t=(e,t)=>{for(var r in t||(t={}))xf.call(t,r)&&gf(e,r,t[r]);if(Ao)for(var r of Ao(t))kf.call(t,r)&&gf(e,r,t[r]);return e},u1=(e,t)=>l1(e,c1(t)),d1=(e,t)=>{var r={};for(var n in e)xf.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ao)for(var n of Ao(e))t.indexOf(n)<0&&kf.call(e,n)&&(r[n]=e[n]);return r},To=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});f1=e=>{let t=atob(e),r=t.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=t.charCodeAt(i);return n.buffer};h1=e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let i=0;i<n;i++)t+=String.fromCharCode(r[i]);return btoa(t)};Af=Object.defineProperty,v1=Object.getOwnPropertyDescriptor,g1=(e,t)=>{for(var r in t)Af(e,r,{get:t[r],enumerable:!0})},Tf=(e,t,r,n)=>{for(var i=n>1?void 0:n?v1(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&&Af(t,r,i),i},y1=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}b1=class{constructor(){this.state="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.state==="pending"&&(this.state="fulfilled",e(r))},this.reject=r=>{this.state==="pending"&&(this.state="rejected",t(r))}})}};E1=(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))(E1||{}),x1=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}},Co=class extends x1{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},k1=class extends Co{constructor(){super(...arguments),this.name="INTERNAL_INVOKE_NATIVE_ERROR"}},A1=class extends Co{constructor(e,t,r,n){super(e),this.errNo=t,this.name="INTERNAL_APPLY_NATIVE_ERROR",this.errorType=r,this.errorCode=n}},T1=class extends Co{constructor(){super(...arguments),this.name="INTERNAL_JSCORE_ERROR",this.priority="P0"}},yl=class extends Co{constructor(){super(...arguments),this.name="INTERNAL_METRIC_REPORT_ERROR"}};Po={log:Hn("log"),warn:Hn("warn"),info:Hn("info"),error:Hn("error"),debug:Hn("debug")};Object.assign(globalThis,{logger:Po});_f=Symbol.for("Jolibox.canIUseMap"),C1={};globalThis[_f]||(globalThis[_f]=C1);xl=Symbol.for("Jolibox.canIUseMap.native"),O1={};globalThis[xl]||(globalThis[xl]=O1);kl={get config(){return globalThis[xl]}},R1=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(R1||{}),N1=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(N1||{}),D1=(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))(D1||{});L1();Gr=typeof window=="undefined",q1=()=>!Gr&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),a9={isiOS:!Gr&&(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:!Gr&&navigator.userAgent.includes("Android"),isMac:!Gr&&navigator.userAgent.includes("Mac"),isFacebook:!Gr&&navigator.userAgent.includes("FB_IAB"),isPC:!Gr&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},Al=class Tl{constructor(t){this.element=t,this.next=Tl.Undefined,this.prev=Tl.Undefined}};Al.Undefined=new Al(void 0);se=Al,F1=class{constructor(){this._first=se.Undefined,this._last=se.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===se.Undefined}clear(){let e=this._first;for(;e!==se.Undefined;){let t=e.next;e.prev=se.Undefined,e.next=se.Undefined,e=t}this._first=se.Undefined,this._last=se.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new se(e);if(this._first===se.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==se.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==se.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==se.Undefined&&e.next!==se.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===se.Undefined&&e.next===se.Undefined?(this._first=se.Undefined,this._last=se.Undefined):e.next===se.Undefined?(this._last=this._last.prev,this._last.next=se.Undefined):e.prev===se.Undefined&&(this._first=this._first.next,this._first.prev=se.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==se.Undefined;)yield e.element,e=e.next}},M1=0,$n=class{constructor(e){this.value=e,this.id=M1++}},Gn=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 $n&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let c=new $n(t);return this._listeners?this._listeners instanceof $n?this._listeners=[this._listeners,c]:this._listeners.push(c):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=c,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var d,u,p,f;if(!this._disposed){if(this._listeners instanceof $n)this._listeners.id===c.id&&(this._listeners=void 0,this._size=0,(u=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||u.call(d));else if(this._listeners){let m=this._listeners.indexOf(c);m>=0&&(this._listeners.splice(m,1),this._size--,this._size===0&&((f=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||f.call(p)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof $n?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Cl=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Gn,o=l=>t(...l.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new F1,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},Pl={};g1(Pl,{None:()=>U1,filter:()=>B1,once:()=>Rf,toPromise:()=>j1});U1=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});_l=Symbol.for("Jolibox.hostEmitter"),J1=()=>{let e=new Cl;return globalThis[_l]||(globalThis[_l]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[_l]},s9=J1();Ol=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Gn,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 H1(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}};Ol=Tf([Of],Ol);bf=class{constructor(){this._onWillExecuteCommand=new Gn,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Gn,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Ol,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=_1(3e4)),this._starActivation}executeCommand(e,...t){return y1(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),Pl.toPromise(Pl.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}}};bf=Tf([Of],bf);l9=Symbol.for("Jolibox.commands");Nl("requestPaymentSync",{version:1e6,properties:{paymentBody:{appStoreProductId:102e4}}});Nl("requestProductDetailsAsync",{version:102e4});Nl("loginSync",{version:1e6,properties:{skipLogin:102e4,triggerFrom:102e4}});Nf=(e,t)=>{function r(i){var o;let[a,...s]=i.split(":");if(!a)return!1;let l=kl.config[a];if(!l)return!1;let c=(o=t==null?void 0:t())!=null?o:"";if(l.platforms&&!l.platforms.includes(c))return!1;let d=l.version;if(typeof d!="number")return!1;let u=e();return typeof u!="number"||u<d?!1:s.length===0?!0:n(l,s,u)||n(l.properties,s,u)}function n(i,o,a){if(!i)return!1;let s=P1(i,o);if(!s)return!1;if(zr(s)){let l=s.version;return yf(l)?typeof a=="number"&&a>=l:!0}return yf(s)?typeof a=="number"&&a>=s:s===!0}return{canIUseNative:r}};V1=()=>q1(),Vn="custom_event_",G1=[],z1=[],W1=["env","createRequestTask","login"],Df="__batch_event__",K1="__native_batch_event__",Q1=e=>e==="pv"?e:"default",ko=class{constructor(e){this.interval=30,this.lastReportTime=0,this.cache={};let{reporter:t,interval:r=30,eventName:n,tagNameOrder:i,metricName:o,type:a}=e;this.reporter=t,this.interval=r,this.eventName=n,this.tagNameOrder=i,this.metricName=o,this.type=Q1(a)}report(e){this.type==="pv"?this.addPVPoint(e):this.addPoint(e),this.tryReport(!1)}flush(){this.tryReport(!0)}tryReport(e){if(Object.keys(this.cache).length){if(e){this.reporter(this.processPoints(this.cache)),this.clearPoints();return}this.lastReportTime=this.lastReportTime||Date.now(),Date.now()-this.lastReportTime>=this.interval*1e3&&(this.reporter(this.processPoints(this.cache)),this.clearPoints(),this.lastReportTime=Date.now())}}addPoint(e){let t=(r,n,i,o)=>{let a=n.shift();if(a){let s=o[a];r[s]||(r[s]={}),t(r[s],n,i,o)}else r[i]||(r[i]=[]),r[i].push(o[i])};t(this.cache,[...this.tagNameOrder],this.metricName,e)}addPVPoint(e){let t=(n,i,o,a)=>{let s=i.shift();if(!s&&zr(a))throw new yl(`report value failed to match tagNameOrder, ${JSON.stringify(r)}`);if(s){let l=[];if(zr(a))l.push(...Object.keys(a));else if(Cf(a)){if(i.length>0)throw new yl(`report value failed to match tagNameOrder, ${JSON.stringify(r)}`);l.push(a)}else throw new yl(`expected metric value to be a string, but got a(n) ${typeof a}, ${JSON.stringify(r)}`);l.forEach(c=>{n[c]||(n[c]={});let d=zr(a)?a[c]:a;t(n[c],[...i],o,d)})}else n[o]?n[o]++:n[o]=1},r={point:e,metricName:this.metricName,tagNameOrder:this.tagNameOrder};t(this.cache,[...this.tagNameOrder],this.metricName,e)}processPoints(e){return{eventName:this.eventName,tagNameOrder:this.tagNameOrder,metricName:this.metricName,metricAggregateType:this.type==="pv"?"itoa":"arr",data:e}}clearPoints(){this.cache={}}},If=!1;Sl=[],X1=!1,Rl=Symbol.for("Jolibox.invokeResolverInstance"),Z1=new Map;globalThis[Rl]||(globalThis[Rl]=Z1);eT={get resolveMap(){return globalThis[Rl]}};xo=Symbol.for("Jolibox.subscribeInstance");ht={trigger(){},exit(){return Promise.resolve(!1)},backPress(){return Promise.resolve(!1)},onReady(e){ht.trigger=e},onDoExit(e){ht.exit=e},onDoBackPress(e){ht.backPress=e}},qf=e=>{let t=window.prompt("invoke",JSON.stringify({event:"envSync",paramsString:JSON.stringify({})}));if(!t)e.onError(new k1("native env failed"));else{let{data:r}=JSON.parse(t);return r!=null?r:void 0}};if(typeof window!="undefined"&&window.webkit){let e=window.webkit.messageHandlers,t=(i="")=>{ht.trigger(),e.onDocumentReady.postMessage({path:i})},r=i=>To(void 0,null,function*(){let o=yield ht.exit();e.doExit.postMessage({uuid:i,shouldInterrupt:o})});Dl={onDocumentReady:t,doExit:r,invoke(i,o,a){e.invoke.postMessage({event:i,paramsString:o,callbackId:a})},publish(i,o,a){let s=Lf(o,"joliboxJSCore");window.prompt("publish",JSON.stringify({event:i,paramsString:JSON.stringify(s),webviewIds:a}))},call(i,o,a){let s=window.prompt("invoke",JSON.stringify({event:i,paramsString:JSON.stringify(o),callbackId:a}));if(s)return JSON.parse(s)}};let n={onDocumentReady:t,env:qf,doExit:r};globalThis.joliboxJSCore=$t({},n)}if(typeof window!="undefined"&&window.JoliAndroidSDKBridge){let e,t=window.JoliAndroidSDKBridge,r=(o="")=>{ht.trigger(),t.onDocumentReady(JSON.stringify({path:o}))},n=o=>To(void 0,null,function*(){let a=yield ht.exit();t.doExit(JSON.stringify({uuid:o,shouldInterrupt:a}))});Dl={onDocumentReady:r,invoke(o,a,s){t.invoke(JSON.stringify({event:o,paramsString:a,callbackId:s}))},doExit:n,publish(o,a,s){let l=Lf(a,"joliboxJSCore");t.publish(JSON.stringify({event:o,paramsString:JSON.stringify(l),webviewIds:s}))},call(o,a,s){let l=window.prompt("invoke",JSON.stringify({event:o,paramsString:JSON.stringify(a),callbackId:s}));if(l)return JSON.parse(l)},doBackPress(o){return To(this,null,function*(){let a=yield ht.backPress();t.doBackPress(JSON.stringify({uuid:o,shouldInterrupt:a}))})}};let i={onDocumentReady:r,env:qf,doExit:n};globalThis.joliboxJSCore=$t({},i)}Ff=Dl;if(!Ff&&V1())throw new T1("No joliboxJScore is found, native bridge not found.");oT=$t({},Ff),Mf=iT(oT),{invokeHandler:Ef}=Mf,{applyNative:ye,invokeNative:j,onNative:Ze,offNative:c9,subscribeHandler:aT,publish:Uf,emitNative:Ll,subscribe:u9,unsubscribe:d9}=Mf;globalThis.joliboxJSBridge={callHandler:Ef,invokeHandler:Ef,subscribeHandler:aT}});function fT(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Vf(e){return new Promise(t=>setTimeout(t,e))}function Yn(e){return typeof e=="string"}function Tr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Gf(e){return typeof e=="object"&&Array.isArray(e)}function zf(e){return typeof e=="number"&&!isNaN(e)}function Wr(e){return e===!0||e===!1}function Wf(e){return typeof e=="undefined"}function Hl(e){return Wf(e)||e===null}function hT(e){return typeof e=="function"}function Kf(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Qf(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,o){for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=i[a],l=o[a],c=r(s,l,a,i,o);c!==void 0?i[a]=c:Jf(l)&&Jf(s)?i[a]=n(uT({},s),l):Array.isArray(l)&&Array.isArray(s)?i[a]=[...s,...l]:i[a]=l}return i}return n(e,t)}function Jf(e){return e&&typeof e=="object"&&e.constructor===Object}function Yf(e,t){if(Array.isArray(e))return e.concat(t)}function Xn(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:l=!0}=r,c=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),d=function(...u){i=u,o=this;let p=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,l&&!p&&c()},t),p)return c()};return d.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},d.flush=()=>{if(n)return clearTimeout(n),n=null,c()},d}function vT(e,t){return(...r)=>t(e,...r)}function Ro(e){return t=>vT(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new lr(`${i}`))}})}function zn(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function ih(e,t,r){let n=0;if(e!==t){let i=e.split("."),o=t.split("."),a=Math.max(i.length,o.length);for(let s=0;s<a;s++){let l=parseInt(i[s],10)||0,c=parseInt(o[s],10)||0;if(l>c){n=1;break}else if(l<c){n=-1;break}}}if(!r)return n;switch(r){case">":return n>0;case"<":return n<0;case"=":return n===0;case">=":return n>=0;case"<=":return n<=0;default:return!1}}function Kl(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function xT(e){return new Promise(t=>lh(e)(t))}function lh(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function kT(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Qn(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function TT(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)CT(e[n],t[n])}function CT(e,t){if(Yn(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(hT(t)){try{if(e instanceof t)return}catch(r){}if(!Hl(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 PT(){return typeof globalThis!="undefined"?globalThis[ch]:void 0}function OT(e){typeof globalThis!="undefined"&&(globalThis[ch]=e)}function X(e=!1){let t=PT();if(!e&&t)return t;let r=new Oo,n=new Bl,i={registerCommand(o,a,s){r.registerCommand({id:o,handler:a,metadata:s})},executeCommand(o,...a){return n.executeCommand(o,...a)},excuteCommandSync(o,...a){return n.executeCommandThowErr(o,...a)}};return OT(i),i}var Jl,sT,jf,lT,cT,Bf,uT,dT,$f,pT,Ct,mT,$l,Zn,Vl,Xf,lr,Zf,eh,th,rh,nh,ei,Gl,Pt,Fl,gT,zl,Hf,yT,J,Wl,_T,No,Wn,ti,bT,wT,oh,ah,sh,Ml,le,IT,ST,Kn,Qn,Ot,jl,ET,ql,AT,ne,Oo,Bl,ch,D=k(()=>{"use strict";Jl=Object.defineProperty,sT=Object.getOwnPropertyDescriptor,jf=Object.getOwnPropertySymbols,lT=Object.prototype.hasOwnProperty,cT=Object.prototype.propertyIsEnumerable,Bf=(e,t,r)=>t in e?Jl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,uT=(e,t)=>{for(var r in t||(t={}))lT.call(t,r)&&Bf(e,r,t[r]);if(jf)for(var r of jf(t))cT.call(t,r)&&Bf(e,r,t[r]);return e},dT=(e,t)=>{for(var r in t)Jl(e,r,{get:t[r],enumerable:!0})},$f=(e,t,r,n)=>{for(var i=n>1?void 0:n?sT(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&&Jl(t,r,i),i},pT=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}Ct=class{constructor(){this.state="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.state==="pending"&&(this.state="fulfilled",e(r))},this.reject=r=>{this.state==="pending"&&(this.state="rejected",t(r))}})}};mT=(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))(mT||{}),$l=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}},Zn=class extends $l{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Vl=class extends $l{constructor(){super(...arguments),this.kind="USER_ERROR"}},Xf=class extends Vl{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},lr=class extends Vl{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))}},Zf=class extends Vl{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="USER_PAYMENT_ERROR",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},eh=class extends Zn{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},th=class extends Zn{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="INTERNAL_PAYMENT_ERROR",this.priority="P0",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},rh=class extends Zn{constructor(){super(...arguments),this.name="INTERNAL_INVOKE_METHOD_ERROR"}},nh=class extends Zn{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},ei=class extends $l{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}}},Gl=class extends Zn{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Pt={log:zn("log"),warn:zn("warn"),info:zn("info"),error:zn("error"),debug:zn("debug")};Object.assign(globalThis,{logger:Pt});Fl=Symbol.for("Jolibox.canIUseMap"),gT={};globalThis[Fl]||(globalThis[Fl]=gT);zl={get config(){return globalThis[Fl]}},Hf=Symbol.for("Jolibox.canIUseMap.native"),yT={};globalThis[Hf]||(globalThis[Hf]=yT);J=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(J||{}),Wl=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Wl||{}),_T=(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))(_T||{}),No=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});Kl();Wn=typeof window=="undefined",ti={isiOS:!Wn&&(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:!Wn&&navigator.userAgent.includes("Android"),isMac:!Wn&&navigator.userAgent.includes("Mac"),isFacebook:!Wn&&navigator.userAgent.includes("FB_IAB"),isPC:!Wn&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},bT="device_id",wT="advertising_id",oh=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,No()),window.__joliboxLocalStorage__.getItem(e)),ah=()=>new URLSearchParams(window.location.search).get("deviceId")||oh(bT),sh=()=>new URLSearchParams(window.location.search).get("advertisingId")||oh(wT),Ml=class Ul{constructor(t){this.element=t,this.next=Ul.Undefined,this.prev=Ul.Undefined}};Ml.Undefined=new Ml(void 0);le=Ml,IT=class{constructor(){this._first=le.Undefined,this._last=le.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===le.Undefined}clear(){let e=this._first;for(;e!==le.Undefined;){let t=e.next;e.prev=le.Undefined,e.next=le.Undefined,e=t}this._first=le.Undefined,this._last=le.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new le(e);if(this._first===le.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==le.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==le.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==le.Undefined&&e.next!==le.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===le.Undefined&&e.next===le.Undefined?(this._first=le.Undefined,this._last=le.Undefined):e.next===le.Undefined?(this._last=this._last.prev,this._last.next=le.Undefined):e.prev===le.Undefined&&(this._first=this._first.next,this._first.prev=le.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==le.Undefined;)yield e.element,e=e.next}},ST=0,Kn=class{constructor(e){this.value=e,this.id=ST++}},Qn=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 Kn&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let c=new Kn(t);return this._listeners?this._listeners instanceof Kn?this._listeners=[this._listeners,c]:this._listeners.push(c):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=c,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var d,u,p,f;if(!this._disposed){if(this._listeners instanceof Kn)this._listeners.id===c.id&&(this._listeners=void 0,this._size=0,(u=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||u.call(d));else if(this._listeners){let m=this._listeners.indexOf(c);m>=0&&(this._listeners.splice(m,1),this._size--,this._size===0&&((f=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||f.call(p)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Kn?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Ot=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Qn,o=l=>t(...l.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new IT,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},jl={};dT(jl,{None:()=>ET,filter:()=>kT,once:()=>lh,toPromise:()=>xT});ET=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});ql=Symbol.for("Jolibox.hostEmitter"),AT=()=>{let e=new Ot;return globalThis[ql]||(globalThis[ql]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[ql]},ne=AT();Oo=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Qn,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 TT(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}};Oo=$f([Kf],Oo);Bl=class{constructor(){this._onWillExecuteCommand=new Qn,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Qn,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Oo,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=fT(3e4)),this._starActivation}executeCommand(e,...t){return pT(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),jl.toPromise(jl.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}}};Bl=$f([Kf],Bl);ch=Symbol.for("Jolibox.commands")});function ke(e,t={}){Ql.emit("ERROR_REPORT",{error:e,options:t})}var Ql,Cr,mt=k(()=>{"use strict";D();D();Ql=new Ot,Cr=new Ot;ke.debounce=Xn(ke,50,{leading:!0})});var Yl,RT,uh,dh,ph=k(()=>{"use strict";D();mt();Yl=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{}}},RT=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},uh=e=>{var t;try{let i=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(i!=null&&i.length){let[o,a,s]=i;return{headerJson:Yl(o),payloadJson:Yl(a),signature:Yl(s)}}else throw"joli_source is missing"}catch(r){return ke(new eh(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},dh=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=RT(e),o=r[2];return`${n}.${i}.${o}`}return t}});var NT,Xl,fh=k(()=>{"use strict";D();NT="1.1.53",Xl=()=>NT});function ec(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var DT,hh,Zl,mh,de,LT,S,K=k(()=>{"use strict";D();ph();fh();D();DT={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:ah(),adId:sh(),pixelRatio:window.devicePixelRatio||1,platform:ti.isAndroid?"android":ti.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:Xl()},schema:window.location.href,platform:ti.isAndroid?"android":ti.isiOS?"ios":"h5"},Zl=(hh=globalThis.joliboxJSCore)==null?void 0:hh.env,de=Object.assign({},(mh=Zl==null?void 0:Zl())!=null?mh:DT);LT=()=>{var f,m,g,_,v,b,I,A,P,O,x;let{payloadJson:e,headerJson:t,signature:r}=de.schema.length?uh(de.schema):{},n=`${de.deviceInfo.did}-${new Date().getTime()}`,o=new URL(de.schema.length?de.schema:window.location.href).searchParams,a=(g=(m=(f=o.get("mpId"))!=null?f:o.get("appId"))!=null?m:o.get("gameId"))!=null?g:"",s=(b=(v=(_=de.clientSessionId)!=null?_:e==null?void 0:e.sessionId)!=null?v:o.get("sessionId"))!=null?b:n,l=!!((A=(I=e==null?void 0:e.testAdsMode)!=null?I:e==null?void 0:e.__testAdsMode)!=null?A:o.get("testAdsMode")==="true"),c=(x=(O=(P=e==null?void 0:e.joliboxEnv)!=null?P:e==null?void 0:e.__joliboxEnv)!=null?O:o.get("joliboxEnv"))!=null?x:"production",d=c==="staging",u=t==null?void 0:t.channel,p=e==null?void 0:e.__shouldInterupt;return{get startTime(){var C;return(C=performance.timeOrigin)!=null?C:performance.timing.navigationStart},get testMode(){return d},get testAdsMode(){return l},get joliboxEnv(){return c},get joliSource(){var C;return(C=o.get("joliSource"))!=null?C:null},get mpId(){var C;return(C=a!=null?a:e==null?void 0:e.id)!=null?C:""},get mpVersion(){var C;return(C=t==null?void 0:t.ver)!=null?C:Xl()},get mpType(){var C,U;return(U=(C=t==null?void 0:t.__mpType)!=null?C:e==null?void 0:e.__mpType)!=null?U:"game"},get platform(){var C;return((C=de.platform)!=null?C:de.deviceInfo.platform).toLowerCase()},get deviceInfo(){return de.deviceInfo},get sdkInfo(){return de.sdkInfo},get hostInfo(){return de.hostInfo},get hostUserInfo(){return de.hostUserInfo},get sessionId(){var C,U;return(U=(C=de.clientSessionId)!=null?C:s)!=null?U:n},get channel(){return u},get webviewId(){var C;return(C=de.webviewId)!=null?C:-1},get shouldInterupt(){return p},get from(){return e==null?void 0:e.__from},get baseApiHost(){return d?"https://stg-api.jolibox.com":"https://api.jolibox.com"},get adId(){var C;return(C=de.deviceInfo.adId)!=null?C:de.deviceInfo.did},get language(){return de.deviceInfo.lang},get sdkEnvironment(){return ec("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":ec("gamedistribution","jolibox")?"gamedistribution":ec("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var q,Re,Ne;let C=(q=de.deviceInfo.pixelRatio)!=null?q:1,U=(Re=de.deviceInfo.statusBarHeight)!=null?Re:e==null?void 0:e.__androidStatusBarHeight,We=(Ne=de.deviceInfo.navigationBarHeight)!=null?Ne:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:U!==void 0?U/C:20,navigationBarHeight:We!==void 0?We/C:10}},get abTests(){var C,U;return(U=(C=de.abValues)==null?void 0:C.split(","))!=null?U:[]},onEnvConfigChanged:C=>{Qf(de,C,Yf)},encodeJoliSourceQuery:C=>{var U,We;return t&&r?dh(T(T({},e),C),(U=o.get("joliSource"))!=null?U:""):(We=o.get("joliSource"))!=null?We:""},setDoExitDirectly:()=>{p=!1}}},S=LT()});var tc,gh,qT,FT,vh,MT,yh=k(()=>{"use strict";D();mt();K();D();tc=!1,gh=(e,t)=>e==null?!1:t in e,qT=e=>gh(e,"kind"),FT=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},vh=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=S.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=S.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:FT(e.name)},i=B(T({},n),{env:t.environment,isFromUser:r});r?Cr.emit("GLOBAL_USER_ERROR",e,i):Cr.emit("GLOBAL_ERROR",e,i)},MT=e=>gh(e,"kind")&&e.kind==="USER_ERROR";Ql.on("ERROR_REPORT",({error:e,options:t})=>{if(tc)return;tc=!0;let r=qT(e)&&e.raw?e.raw:e;try{let n=MT(e);vh(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new Gl(`${i}, origin error: ${r.message}`);Pt.error(o),vh(new Gl(o.message),{environment:t.environment},!1)}finally{tc=!1}})});var cr,rc,Kr=k(()=>{"use strict";mt();D();mt();cr=(e,t)=>{var r,n;return new ei((n=(r=t==null?void 0:t.errMsg)!=null?r:e.msg)!=null?n:"",e.code,e.type)},rc=e=>new Xf(e)});var _h=k(()=>{"use strict";yh();Kr();D();_e();Cr.on("GLOBAL_ERROR",(e,t)=>{var n;let r={message:e.message,stack:(n=e.stack)!=null?n:"",errorType:e.name,source:0};j("trackAsync",{event:"reportJsError",data:r})});Cr.on("GLOBAL_USER_ERROR",(e,t)=>{Pt.log("UserError",e,t)})});var nc=k(()=>{"use strict"});function bh(e,t){let r=(n,i,o)=>{let c=i!=null?i:{},{eventType:a}=c,s=je(c,["eventType"]),l=B(T({tag:n,eventType:o!=null?o:a!=null?a:J.Other},t),{extra:T({},s)});n=="globalJsError"?ke(new nh(JSON.stringify(l))):e("systemLog",l,S.webviewId)};return r.debounce=Xn(r,500,{leading:!0}),r}function wh(e){let t=(r,n,i)=>{var s;let o=(s=i&&JSON.stringify(i))!=null?s:0,a={speed_value_type:r,total_duration:n};o&&Object.assign(a,{extra:o}),e("joliboxSpeedAnalysis",a)};return t.debounce=Xn(t,500,{leading:!0}),t}var Ih=k(()=>{"use strict";D();D();mt();K()});function Sh(e,t){let r=bh(e,t),n=wh(r);return{track:r,trackPerformance:n}}var Eh=k(()=>{"use strict";Ih()});var xh=k(()=>{"use strict";K();D();D()});var kh=k(()=>{"use strict";Eh();nc();xh()});var Do,Ah=k(()=>{"use strict";Do=class{constructor(t,r){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.timer=this.createRAFTimer(t=>{this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t})});this.interval=r!=null?r:5*1e3,t.on("visible",n=>{this.visible=n})}start(t){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:t!=null?t:0}}),this.tracker("OpenGame",{duration:t!=null?t:0}),this.timer.start()}close(t){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:t}}),this.tracker("CloseGame",{duration:t}),this.timer.stop()}createRAFTimer(t){let r=Date.now(),n,i,o=!1,a=0,s=()=>{if(!o)return;let f=Date.now(),m=f-r;m>=this.interval&&(this.visible&&(a+=Math.min(m,this.interval+1e3),t(a)),r=f),n=requestAnimationFrame(s)},l=()=>{d(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let f=Date.now();f-r>=this.interval&&(r=f)},this.interval)},c=()=>{u(),r=Date.now(),n=requestAnimationFrame(s)},d=()=>{n&&(cancelAnimationFrame(n),n=0)},u=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",f=>{o&&(console.log("visible",f),f?c():l())});let p=this.visible;return{start(){o||(o=!0,p?c():l())},stop(){o=!1,d(),u()}}}}});function Lo(e,t,r){var l,c,d;let n=new Map,i=(l=r==null?void 0:r.baseUrl)!=null?l:"https://api.jolibox.com",o=(c=r==null?void 0:r.type)!=null?c:"public",a=(d=r==null?void 0:r.defaultHeaders)!=null?d:{};return Ze("onRequestTaskStateChange",u=>{if(typeof u.requestTaskId!="string")return;let p=n.get(u.requestTaskId);if(p)if(u.state==="success"){let f=u,{requestTaskId:g,state:_}=f,v=je(f,["requestTaskId","state"]);u.statusCode===200?p.resolve(v):p.reject(v),n.delete(g)}else if(u.state==="fail"){let m=u,{requestTaskId:g,state:_}=m,v=je(m,["requestTaskId","state"]);p.reject(v),n.delete(g)}else Pt.warn("onRequestTaskStateChange unknown event",u)}),ne.on("onLoginComplete",({isLogin:u,token:p})=>{o!=="public"&&u&&p&&(a["X-JOLI-TOKEN"]=p)}),(f,...m)=>w(this,[f,...m],function*(u,p={}){let g=Date.now(),_=UT(u,B(T({},p),{baseUrl:i})),{method:v="GET",responseType:b="text",dataType:I="json",timeout:A,enableCache:P=!1,appendHostCookie:O=!0}=p,x=Object.assign({"content-type":"application/json"},a,p.header),C={url:_,method:v,header:x,enableCache:P,responseType:b,appendHostCookie:O};if(v=="POST"||v=="PUT"){let Ne=BT(p.data,x["content-type"]);C.data=Ne}A&&Object.assign(C,{timeout:A});let{data:{requestTaskId:U}}=j(e,C);if(typeof U!="string")throw cr({code:-1,msg:"requestTaskId is not a string"});let{resolve:We,reject:q,promise:Re}=new Ct;n.set(U,{resolve:We,reject:q});try{let Ne=yield Re,{data:Ar}=Ne;return I==="json"&&typeof Ar=="string"&&(Ar=jT(Ar)),{url:_,timeout:A,method:v,response:B(T({},Ne),{data:Ar})}}catch(Ne){let Ar=Ne;if(Tr(Ar)){let{errMsg:vl,prefetchDetail:n9,isPrefetch:i9,errNo:ZA}=Ar;Yn(vl)&&ke(cr({code:-1,msg:vl},{errNo:ZA,errMsg:vl}))}throw Ne}})}function jT(e){try{return JSON.parse(e.trim())}catch(t){return e}}function BT(e,t="application/json"){let r=t.toLowerCase();return e===void 0?"":typeof e=="string"||e instanceof ArrayBuffer?e:r.includes("application/x-www-form-urlencoded")||r.includes("application/json")||typeof e=="object"?JSON.stringify(e):String(e)}var UT,ic=k(()=>{"use strict";D();_e();mt();Kr();UT=(e,t)=>{if(/^https?:\/\//.test(e))return e;let r=t==null?void 0:t.query,i=new URLSearchParams(r).toString();return t!=null&&t.baseUrl?`${t.baseUrl}${e}${i?`?${i}`:""}`:`${e}${i?`?${i}`:""}`}});var oc,Th,te,vt=k(()=>{"use strict";ic();K();oc={};(Th=S.hostUserInfo)!=null&&Th.token&&(oc["x-joli-token"]=S.hostUserInfo.token);S.joliSource&&(oc["x-joli-source"]=S.joliSource);te=Lo("createRequestTaskSync","operateRequestTaskSync",{type:"inner",baseUrl:S.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com",defaultHeaders:oc})});var qo,Ch=k(()=>{"use strict";K();Ah();vt();_e();qo=class extends Do{constructor(t,r,n){super(r,n),this.gameId=S.mpId,this.sessionId=S.sessionId,this.track=t,this.taskUrl=S.testMode?"https://stg-api.jolibox.com/api/base/app-event":"https://api.jolibox.com/api/base/app-event"}reporter(t){return w(this,null,function*(){let{event:r,params:n,extraParams:i}=t,o={eventType:r,gameInfo:T({gameId:this.gameId,sessionId:this.sessionId},n)};i&&Object.assign(o,i),yield S.platform==="android"?te("/api/base/app-event",{method:"POST",data:o}):ye("trackAppEventAsync",{url:this.taskUrl,body:JSON.stringify(o)})})}reportToNative(t){return w(this,null,function*(){let{event:r,params:n}=t;yield ye("userTrackAsync",{event:r,params:T({},n),gameId:this.gameId})})}tracker(t,r=null){this.track(t,r)}}});var Dh={};vf(Dh,{nativeTaskEmitter:()=>ri,taskTracker:()=>It,track:()=>M,trackPerformance:()=>Rh});var JT,Ph,Oh,M,Rh,Nh,ri,It,gt=k(()=>{"use strict";_h();D();nc();kh();K();Ch();_e();JT=(e,t,r)=>{var s,l,c,d,u,p;let n=t,i=Tr(n.extra)?n.extra:Yn(n.extra)?JSON.parse(n.extra):{},o=B(T({},i),{mp_id:(s=n.mp_id)!=null?s:"",mp_version:(l=n.mp_version)!=null?l:"",session_id:S.sessionId,user_id:(d=(c=S.hostUserInfo)==null?void 0:c.uid)!=null?d:""}),a=(u=n.eventType)!=null?u:J.Other;j("trackAsync",{event:(p=t.tag)!=null?p:e,data:o,webviewId:r,eventType:a})},{track:M,trackPerformance:Rh}=Sh(JT,{type:Wl.AppSDK,platform:"native",jssdk_version:(Oh=(Ph=S.sdkInfo)==null?void 0:Ph.jssdkVersion)!=null?Oh:"1.0.0",mp_id:S.mpId,mp_version:S.mpVersion}),Nh=X();Nh.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Rh(e,t,r)});Nh.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{M(e,t)});ri=new Ot,It=new qo(M,ri)});function Lh(){let e=null,t=null,r=window.fetch,n=()=>{t=document.createElement("meta"),t.setAttribute("name","viewport"),t.setAttribute("content","viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"),t.setAttribute("data-jolibox-sdk","viewport-meta"),e=document.createElement("style"),e.setAttribute("data-jolibox-sdk","default-styles");let s=`
|
|
2
2
|
html[data-jolibox-root] {
|
|
3
3
|
height: 100%;
|
|
4
4
|
margin: 0;
|
|
@@ -604,7 +604,7 @@ If multiple caches share the same key they might "fight" for each other's style
|
|
|
604
604
|
}
|
|
605
605
|
`,b5=()=>y("div",{style:gE.container,children:[y("style",{children:_5}),y("div",{style:gE.spinner})]});h7=ro()});function hx(){return w(this,null,function*(){if(Xd)return Xd;let t=`${S.testMode?"https://stg-game.jolibox.com":"https://game.jolibox.com"}/api/user-retention/exit-recommendations?objectId=${S.mpId}&from=GAME_DETAIL`,{response:{data:r}}=yield te(t);return Xd=r,r})}function mx(){return w(this,null,function*(){let e=new Ct;if(S.mpType!=="game")return e.resolve(!1),e.promise;if(Zd)return e.resolve(!0),e.promise;let t=yield hx();if(t.code!=="SUCCESS")return e.resolve(!1),e.promise;let{gameListInfo:r,title:n,buttons:i}=t.data;Zd=!0;let o={domain:"GAME",buttons:t.data.buttons.map(s=>`${s.type}-${s.text}`).join(","),list:r.games.map(s=>s.gameId).join(",")};M("RecommendedGuide",T({eventType:J.View},o));let a=XE({games:r.games,title:n,buttons:i,onClose:s=>{var l;switch(Zd=!1,s.type){case"quit":M("RecommendedGuide",{eventType:J.Click,type:"QUIT",domain:"GAME"}),e.resolve(!1);break;case"dismiss":M("RecommendedGuide",T({eventType:J.Hide},o)),e.resolve(!0),a.destroy();break;case"navigate":if((l=s.data)!=null&&l.game){let c=s.data.game;w5(c),M("GameItem",{eventType:J.Click,gameId:c.gameId,layerName:"RecommendedGuide",domain:"GAME"}),setTimeout(()=>{e.resolve(!1)},0)}else e.resolve(!0);a.destroy();break;default:M("RecommendedGuide",T({eventType:J.Hide},o)),e.resolve(!0);break}}});return e.promise})}var Xd,w5,Zd,vx=k(()=>{"use strict";K();_e();D();er();vt();gt();Xd=null;hx();w5=e=>{var a;let{data:t}=j("envSync"),r=new URL(t.schema),n=new URLSearchParams(r.search);n.set("gameId",e.gameId),n.set("joliSource",S.encodeJoliSourceQuery({__mpType:"game",__orientation:(a=e.orientation)!=null?a:"VERTICAL"}));let o=`${`https://${e.gameId}.content.jolibox.com/`}index.html?${n.toString()}`;j("openSchemaSync",{schema:o})},Zd=!1});function S5(e){let t=T(T({},I5),e),{url:r,height:n,showCloseButton:i,enableDragClose:o,useAnimation:a,onClose:s,onLoad:l}=t,c=0,d=0,u=!1,p=()=>a?{overlayTransition:"opacity 0.3s ease",containerTransition:"transform 0.3s ease",iframeTransition:"opacity 0.3s ease"}:{overlayTransition:"none",containerTransition:"none",iframeTransition:"none"},f=()=>a?300:0;function m(){let{overlayTransition:b,containerTransition:I,iframeTransition:A}=p();ae=document.createElement("div"),ae.id="jolibox-modal-overlay",ae.style.cssText=`position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.5); z-index:1000; display:flex; justify-content:center; align-items:flex-end; transition:${b}; opacity:0; visibility:hidden;`,Y=document.createElement("div"),Y.id="jolibox-modal-container",Y.style.cssText=`width:100%; height:${n}; background:white; border-radius:12px 12px 0 0; overflow:hidden; box-shadow:0 -2px 10px rgba(0,0,0,0.2); transform:translateY(100%); transition:${I};`;let P=document.createElement("div");P.id="jolibox-modal-loading",P.style.cssText="position:absolute; top:50%; left:50%; transform:translate(-50%, -50%); width:40px; height:40px; border:4px solid #f3f3f3; border-top:4px solid #3498db; border-radius:50%; animation:spin 1s linear infinite;";let O=document.createElement("style");O.textContent="@keyframes spin { 0% { transform: translate(-50%, -50%) rotate(0deg); } 100% { transform: translate(-50%, -50%) rotate(360deg); } }",document.head.appendChild(O);let x=document.createElement("div");if(x.style.cssText="width:100%; height:100%; display:flex; flex-direction:column; padding-bottom:env(safe-area-inset-bottom, 0); position:relative;",bt=document.createElement("iframe"),bt.style.cssText=`width:100%; flex:1; border:none; opacity:0; transition:${A};`,bt.src=r,bt.onload=()=>{P.parentNode&&P.parentNode.removeChild(P),bt.style.opacity="1",g(),l==null||l(),ne.emit("onModalIframeLoaded",{url:r})},x.appendChild(bt),x.appendChild(P),Y.appendChild(x),i){let C=document.createElement("div");C.style.cssText="position:absolute; top:10px; right:10px; width:30px; height:30px; background:rgba(0,0,0,0.1); border-radius:15px; display:flex; justify-content:center; align-items:center; cursor:pointer; z-index:10;",C.innerHTML="\u2715",C.onclick=v,Y.appendChild(C)}ae.appendChild(Y),document.body.appendChild(ae),ae.addEventListener("click",function(C){C.target===ae&&v()}),o&&_()}function g(){!ae||!Y||u||(ae.style.visibility="visible",a?requestAnimationFrame(()=>{ae&&(ae.style.opacity="1"),Y&&(Y.style.transform="translateY(0)"),u=!0}):(ae&&(ae.style.opacity="1"),Y&&(Y.style.transform="translateY(0)"),u=!0),j("updateContainerConfigSync",{displayCapsuleButton:!1,webviewId:S.webviewId}))}function _(){if(!Y)return;let b=P=>{c=P.touches[0].clientY},I=P=>{if(!u)return;d=P.touches[0].clientY;let O=d-c;O>0&&(Y&&(Y.style.transition="none",Y.style.transform=`translateY(${O}px)`),P.preventDefault())},A=()=>{!u||!Y||(Y.style.transition=a?"transform 0.3s ease":"none",d-c>80?v():Y.style.transform="translateY(0)")};Y.addEventListener("touchstart",b),Y.addEventListener("touchmove",I),Y.addEventListener("touchend",A)}function v(){!ae||!Y||!u||(a?(Y.style.transform="translateY(100%)",ae.style.opacity="0"):ae.style.visibility="hidden",u=!1,j("updateContainerConfigSync",{displayCapsuleButton:!0,webviewId:S.webviewId}),setTimeout(()=>{ae&&(ae.remove(),ae=null,Y=null,bt=null,s==null||s(),ne.emit("onModalIframeClosed",{url:r}))},f()))}return m(),{close:v}}function gx(){return window.joliboxUI=B(T({},window.joliboxUI),{createIframeModal:S5}),()=>{window.joliboxUI=void 0,ae&&ae.parentNode&&ae.parentNode.removeChild(ae),Y&&Y.parentNode&&Y.parentNode.removeChild(Y),bt&&bt.parentNode&&bt.parentNode.removeChild(bt),ae=null,Y=null,bt=null}}var I5,ae,Y,bt,yx=k(()=>{"use strict";_e();K();D();I5={height:"50%",showCloseButton:!0,enableDragClose:!0,useAnimation:!0},ae=null,Y=null,bt=null});var Ix={};vf(Ix,{config:()=>D5});function x5(){Fo.on("isAdShowing",e=>{us=e,Wr(us)&&j("updateContainerConfigSync",{displayCapsuleButton:!us,webviewId:S.webviewId})})}function k5(){ne.on("onInterceptSystemExit",({intercept:e})=>{_x=e})}function A5(){ne.on("onInterceptBackPress",({intercept:e})=>{E5=e}),Ze("onBeforeBackPress",({uuid:e,disableExitRecommendDialog:t})=>{var r,n;wx(t),ne.emit("onBackPress",{}),(n=(r=globalThis.joliboxJSCore)==null?void 0:r.doBackPress)==null||n.call(r,e)})}function T5(){ne.on("onDocumentReady",()=>{var e;(e=globalThis.joliboxJSCore)==null||e.onDocumentReady(window.location.href),M("onDocumentReady",{start_timestamp:ps,timestamp:Date.now()})})}function C5(){Ze("onI18nChanged",({language:e})=>{ne.emit("onI18nChanged",{i18n:e})})}function P5(e){S.mpType==="game"&&It.start(e)}function O5(){Ze("onJoliboxServiceReady",({runtimeInfo:e,loadDuration:t})=>{e&&S.onEnvConfigChanged({hostUserInfo:e}),ne.emit("LifecycleEvent.onReady",T({},S.hostUserInfo?S.hostUserInfo:{isLogin:!1})),M("joliboxServiceReady",{start_timestamp:ps,timestamp:Date.now()}),P5(t),GE(()=>S.language)}),Ze("onBeforeExit",({uuid:e,disableExitRecommendDialog:t})=>{var r;wx(t),(r=globalThis.joliboxJSCore)==null||r.doExit(e)})}function R5(){let e=()=>{M("onBeforeExit",{timestamp:Date.now()}),ls==null||ls(),cs==null||cs(),It.close(Date.now()-ps)},t=()=>us||_x;ht.onDoExit(()=>w(this,null,function*(){return t()?!0:Wr(S.shouldInterupt)?(S.shouldInterupt||e(),S.shouldInterupt):ds!=null&&ds.canShowRecommended&&!bx&&(yield mx())?!0:(e(),!1)})),ht.onDoBackPress(()=>w(this,null,function*(){return!!t()}))}function N5(){return w(this,null,function*(){let e=`${S.baseApiHost}/api/fe-configs/js-sdk/basic-meta`,{response:{data:t}}=yield te(e);t&&(ds=t)})}function D5(){ps=Date.now(),O5(),x5(),k5(),A5(),R5(),T5(),C5(),N5(),cs=gx(),ls=Lh()}var ls,cs,ps,us,ds,_x,E5,bx,wx,Sx=k(()=>{"use strict";_e();K();D();gt();qh();ac();vx();vt();er();yx();us=!1,ds=null,_x=!1,E5=!1,bx=!1,wx=e=>{Wr(e)&&(bx=e)};ht.onReady(()=>{})});function Ex(e){let t=zl.config[e];return t||(t={},zl.config[e]=t),(r,n)=>{if(t[r]){Pt.warn(`[can i use] ${r} already registered`);return}t[r]=T({},n)}}var xx=k(()=>{"use strict";D()});function ep(e){kx=e}function fs(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>fs(t)):Object.keys(e).reduce((t,r)=>(t[r]=fs(e[r]),t),{})}function tr(e){return typeof e=="number"}function tp(e){let t=rp(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function rp(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var kx,Ee,hs,ms,vs,gs,kn,ys,_s,bs,ws,Is,Ss,Es,xs,ks,As,Ts,Cs,np=k(()=>{"use strict";kx=!1;Ee=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(kx)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 ${tp(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return fs(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:fs(this._default)}optional(){return this._optional=!0,this}};hs=class extends Ee{validate(t){return this._optional&&t===void 0?!0:tr(t)?tr(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):tr(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):tr(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}},ms=class extends Ee{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},vs=class extends Ee{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(tr(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(tr(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}},gs=class extends Ee{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},kn=class extends Ee{validate(t){return!0}},ys=class extends Ee{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},_s=class extends Ee{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},bs=class extends Ee{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},ws=class extends Ee{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 ${tp(t)}`)}return!0}},Is=class extends Ee{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(tr(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(tr(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(tr(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}},Ss=class extends Ee{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(rp(r)!=="object")return this.fail({expect:"object",actual:r});let i=r,o=this._value;o.errors=this.errors;let a=!0;for(let s in i){let l=i[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?o.path=`${this.path}.${s}`:o.path=`${this.path}["${s}"]`,!(l===void 0&&o._optional)){if(l===void 0&&o.hasDefault){i[s]=o.defaultValue;continue}o.validate(l)||(o.hasFallback?i[s]=o.fallbackValue:a=!1)}}return a}},Es=class extends Ee{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(rp(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,i=!0;for(let o in this._object){let a=n[o],s=this._object[o];if(s.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(o)?s.path=`${this.path}.${o}`:s.path=`${this.path}["${o}"]`,!(s._optional&&a===void 0)){if(a===void 0&&s.hasDefault){n[o]=s.defaultValue;continue}s.validate(a)||(s.hasFallback?n[o]=s.fallbackValue:i=!1)}}return i}},xs=class extends Ee{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:tp(this.value),actual:r}):!0}},ks=class extends Ee{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(`
|
|
606
606
|
or `);this.errors.push(o)}return n}},As=class extends Ee{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}},Ts=class extends Ee{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},Cs=class extends Ee{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 ip(e,t,r="param"){if(e.errors=[],e.path=r,ep(!0),!e.validate(t)){let n=e.errors.join(`
|
|
607
|
-
`);throw e.errors.length=0,ep(!1),new TypeError(n)}}var E,op=k(()=>{"use strict";np();np();E={object(e){return new Es(e)},array(e){return new Is(e)},tuple(...e){return new As(...e)},literal(e){return new xs(e)},or(...e){return new ks(...e)},symbol(){return new gs},record(e){return new Ss(e)},function(){return new bs},boolean(){return new ms},string(){return new vs},number(){return new hs},undefined(){return new ys},null(){return new _s},unknown(){return new kn},any(){return new kn},as(){return new kn},arraybuffer(){return new Ts},enum(...e){return new ws(...e)},typedarray(e){return new Cs(e)}}});var Ps,Ax,Tx=k(()=>{"use strict";D();mt();op();Kr();Ps=1,Ax=e=>{function t(n,i){return(...o)=>{var u,p,f,m;let a=Date.now(),s={method:n,trace_id:Ps};Ps+=1;let l="SUCCESS",c=`${n}:ok`,d=0;try{if(i.paramsSchema)try{ip(i.paramsSchema,o,"params")}catch(b){throw rc(`${n}:fail ${b.message}`)}let g=i.implement(...o),_=g,v=`${n}:ok`;if(g&&"code"in g){let{code:b,data:I,message:A}=g;l=b,_=I,v=A}return{code:l,message:v,data:_}}catch(g){let _=g;d=(p=(u=_.code)!=null?u:_.errNo)!=null?p:2e3,l="FAILURE";let v=(m=(f=_.message)!=null?f:_.errMsg)!=null?m:`${g}`;return c=`${n}:${l} ${v.replace(/^\S+:(fail|cancel)\s?/,"")}`,ke(new ei(c,d)),{code:l,message:c}}finally{let g=Date.now()-a}}}function r(n,i){return(...o)=>w(this,null,function*(){var p,f,m,g;let a=Gf(o)?o:[o],s=Date.now(),l={method:n,trace_id:Ps};Ps+=1;let c=`${n}:ok`,d="SUCCESS",u={code:d,message:c};try{if(i.paramsSchema)try{ip(i.paramsSchema,a,"params")}catch(b){throw rc(b.message)}let v=yield i.implement(...a);if(v&&"code"in v){let{code:b,data:I,message:A}=v;d=b,c=A,v=I}return Object.assign(u,{code:d,message:c,data:v}),u}catch(_){let v=_,b=(f=(p=v.code)!=null?p:v.errNo)!=null?f:2e3;d="FAILURE";let I=(g=(m=v.message)!=null?m:v.errMsg)!=null?g:`${_}`,A=`${n}:${d} ${I.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(u,{code:d,message:A}),ke(new ei(A,b)),u}finally{let _=Date.now()-s}})}return{createAPI:r,createSyncAPI:t}}});function ap(e){if(typeof e!="number"||e<=0)return"0.0.0";let t=e.toString(),r=0,n=0,i=0;return t.length>=1&&(r=parseInt(t.substring(0,1),10)),t.length>=3&&(n=parseInt(t.substring(1,3),10)),t.length>=5&&(i=parseInt(t.substring(3,5),10)),`${r}.${n}.${i}`}var Cx=k(()=>{"use strict"});var Pe,G,L,Px,rt=k(()=>{"use strict";xx();gt();Tx();op();_e();K();Cx();({createAPI:Pe,createSyncAPI:G}=Ax(M)),L=Ex("native"),{canIUseNative:Px}=Nf(()=>S.sdkInfo.nativeSDKVersionCode,()=>S.platform)});var Ox,q5,F5,M5,U5,Rx=k(()=>{"use strict";D();rt();_e();K();Ox=X(),q5="env",F5="getSystemInfoSync",M5=G(F5,{implement:()=>{var r;let e=j("envSync"),{data:t}=e;return{system:t.deviceInfo.system,platform:t.deviceInfo.platform.toLowerCase(),version:t.sdkInfo.jssdkVersion,pixelRatio:t.deviceInfo.pixelRatio,language:t.deviceInfo.lang,brand:t.deviceInfo.brand,appName:(r=t.hostInfo)==null?void 0:r.appName,SDKVersion:t.sdkInfo.jssdkVersion,viewport:{statusBarHeight:S.viewport.statusBarHeight,navigationBarHeight:S.viewport.navigationBarHeight}}}}),U5=G(q5,{implement:()=>{var t;let e=j("envSync");return(t=e==null?void 0:e.data)!=null?t:void 0}});Ox.registerCommand("API.getSystemInfoSync",M5);Ox.registerCommand("API.env",U5);L("env",{version:"1.0.0"});L("getSystemInfoSync",{version:"1.0.0",properties:{viewport:"1.0.33"}})});var Nx=h(sp=>{"use strict";D();rt();mt();_e();gt();K();var j5="exitGame",B5="onReady",J5="onJoliboxShow",H5="onJoliboxHide",Os=X(),Rs=Ro(ke),$5=Pe(j5,{paramsSchema:E.tuple(E.function(),E.boolean().optional().default(!1)),implement:(e,t=!1)=>w(sp,null,function*(){Rs(e).call(sp),Wr(S.shouldInterupt)&&!S.shouldInterupt&&S.from&&Uf("onRetentionResult",{shouldStay:t},S.from,!0),t||S.setDoExitDirectly(),yield ye("exitAppAsync")})}),V5=G(J5,{paramsSchema:E.tuple(E.function()),implement(e){let t=Rs(e);Ze("onJoliboxEnterForeground",()=>{t.call(this),ri.emit("visible",!0)})}}),G5=G(H5,{paramsSchema:E.tuple(E.function()),implement(e){let t=Rs(e);Ze("onJoliboxEnterBackground",()=>{t.call(this),ri.emit("visible",!1)})}}),z5=G(B5,{paramsSchema:E.tuple(E.function()),implement(e){let t=Rs(e);ne.on("LifecycleEvent.onReady",r=>{t(r)})}});Os.registerCommand("LifecycleSDK.exit",$5);Os.registerCommand("LifecycleSDK.onReady",z5);Os.registerCommand("LifecycleSDK.onJoliboxShow",V5);Os.registerCommand("LifecycleSDK.onJoliboxHide",G5);L("lifeCycle.exit",{version:"1.0.0"});L("lifeCycle.onReady",{version:"1.0.0"});L("lifeCycle.onJoliboxShow",{version:"1.0.0"});L("lifeCycle.onJoliboxHide",{version:"1.0.0"})});function Dx(e){let t={};if(!Tr(e))return t;for(let[r,n]of Object.entries(e)){let i=r.toLocaleLowerCase();n?typeof n=="object"?t[i]=Object.prototype.toString.call(n):t[i]=String(n):t[i]=""}return t}function Lx(e="GET"){if(e==="")return"POST";let t=e.toUpperCase();return["GET","OPTIONS","HEAD","POST","PUT","DELETE","TRACE","CONNECT","PATCH"].includes(t)?t:"GET"}function qx(e,t=!1){if(e)return t||e>0&&e<=6e4?Math.ceil(e):6e4}function Fx(e,t,r){if(["POST","PUT","PATCH"].includes(t)||!Tr(r))return e;let[n,i=""]=e.split("?"),o=new URLSearchParams(i);for(let[s,l]of Object.entries(r))l!=null&&o.append(s,String(l));let a=o.toString();return a?`${n}?${a}`:n}var Mx=k(()=>{"use strict";D()});var W5,K5,lp,cp,Ux,Q5,Y5,X5,jx=k(()=>{"use strict";Kr();ic();rt();Mx();D();mt();K();W5=15,K5=Lo("createRequestTaskSync","operateRequestTaskSync",{type:"public",baseUrl:S.baseApiHost}),lp=0,cp=[],Ux=Ro(ke),Q5=(e,t)=>{let r=e.filter(t),n=e.filter(i=>!t(i));return e.length=0,e.push(...n),r},Y5=e=>{let t=new Ct,r=()=>{};return G("request",{paramsSchema:E.tuple(E.object({url:E.string(),method:E.string(),headers:E.object().optional(),data:E.or(E.object(),E.array()).optional(),query:E.object().optional(),dataType:E.string().default("json"),responseType:E.string().default("text"),enableCache:E.boolean().default(!1),appendHostCookie:E.boolean().default(!0),timeout:E.number().default(3e4),success:E.function(),fail:E.function()})),implement(i){let o=()=>w(this,null,function*(){var s,l,c;let a=Ux(i.fail);try{if(lp+=1,t.state!=="pending")return;let{data:d,dataType:u,responseType:p,enableCache:f,appendHostCookie:m}=i,g=Dx((s=i.headers)!=null?s:{}),_=Lx(i.method),v=qx(i.timeout),b=Fx(i.url,_,d),I=Ux(i.success),A=Object.assign({},i,{method:_,header:m?void 0:g,data:_==="GET"||_==="HEAD"?void 0:d,enableCache:f,query:(l=i.query)!=null?l:{},dataType:u,responseType:p,appendHostCookie:m});v&&(A.timeout=v);let P=K5(b,A);{let{response:O}=yield P,{code:x,data:C,message:U}=O;if(C&&typeof C=="object"&&"status"in C&&C.status!==200)throw cr({code:C.status||-1,msg:`request:fail status ${C.status}`});t.resolve({code:x!=null?x:"SUCCESS",data:C,message:U!=null?U:"request:ok"}),I({code:"SUCCESS",message:"request:ok",data:C})}}catch(d){t.reject(d),a({code:"FAILURE",message:"httpRequst: failed"})}finally{lp-=1,(c=cp.shift())==null||c()}});return lp>=W5?(r=()=>{Q5(cp,a=>a===o)},cp.push(o)):o(),t.promise}})(e),{abort(){t.reject(cr({code:-1,msg:"request:fail abort"})),r()}}},X5=X();X5.registerCommand("HttpSDK.request",Y5);L("request",{version:"1.0.0"})});function Bx(e){let t=Object.prototype.toString.call(e).split(" ")[1].split("]")[0].toLocaleLowerCase();return t==="array"&&(t="object"),n3.includes(t)?t:""}function Jx(e,t){try{switch(t){case"string":return e;case"object":return JSON.parse(e);case"number":return parseFloat(e);case"boolean":return e==="true";default:return""}}catch(r){return""}}function Hx(e,t){try{switch(t){case"string":case"number":case"boolean":return`${e}`;case"object":return JSON.stringify(e);default:return""}}catch(r){return""}}var Ns,Z5,e3,t3,r3,VK,GK,n3,up,$x,dp=k(()=>{"use strict";rt();_e();D();vt();K();Ns=X(),Z5=Pe("getLocalStorage",{paramsSchema:E.tuple(E.string()),implement(e){return w(this,null,function*(){let{response:t}=yield te(`/api/games/user-storage/${S.mpId}`,{method:"GET",responseType:"json",appendHostCookie:!0,query:{key:e}}),{data:{code:r,message:n,data:i}}=yield t;if(r==="SUCCESS")return{code:r,message:n,data:i==null?void 0:i.value};try{let{data:{data:o,dataType:a}}=yield ye("getLocalStorageAsync",{key:e}),s=Jx(o,a);return{code:r,message:`${n}. fallback to native`,data:s}}catch(o){return{code:"INTERNAL_ERROR",message:"[Jolibox SDK] get local storage failed",data:null}}})}});Ns.registerCommand("StorageSDK.getItem",Z5);L("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});e3=Pe("setStorage",{paramsSchema:E.tuple(E.string(),E.or(E.string(),E.boolean(),E.number())),implement(e,t){return w(this,null,function*(){let r=S.mpId,n=typeof t=="string"?t:String(t),{response:i}=yield te(`/api/games/user-storage/${r}`,{method:"POST",responseType:"json",appendHostCookie:!0,data:{key:e,value:n}}),{data:{code:o,message:a}}=i,s=Bx(t),l=Hx(t,s);return yield ye("setLocalStorageAsync",{key:e,data:l,dataType:s}),o=="SUCCESS"?{code:o,message:a}:{code:o,message:`${a}. fallback to native`}})}});Ns.registerCommand("StorageSDK.setItem",e3);L("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});t3=Pe("removeStorage",{paramsSchema:E.tuple(E.string()),implement(e){return w(this,null,function*(){let t=S.mpId,{response:r}=yield te(`/api/games/user-storage/${t}/remove`,{method:"POST",responseType:"json",appendHostCookie:!0,data:{key:e}}),{data:{code:n,message:i}}=r;return yield ye("removeLocalStorageAsync",{key:e}),n==="SUCCESS"?{code:n,message:i}:{code:n,message:"[Jolibox SDK] remove item succ"}})}});Ns.registerCommand("StorageSDK.removeItem",t3);L("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});r3=Pe("clearStorage",{implement(){return w(this,null,function*(){let e=S.mpId,{response:t}=yield te(`/api/games/user-storage/${e}/clear`,{method:"POST",appendHostCookie:!0});ye("clearLocalStorageAsync");let{data:{code:r,message:n}}=t;return r==="SUCCESS"?{code:r,message:n}:{code:r,message:`${n}.fallback to native`}})}});Ns.registerCommand("StorageSDK.clear",r3);L("storage.clear",{version:"1.0.0"});VK=Pe("getStorageInfo",{implement(){return w(this,null,function*(){let{data:e}=yield ye("getStorageInfoAsync");return e})}});L("getStorageInfo",{version:"1.0.0",success:{keys:"1.0.0",currentSize:"1.0.0",limitSize:"1.0.0"}});GK=G("getStorageInfoSync",{implement(){return j("getStorageInfoSync")}}),n3=["string","number","boolean","object",""];up=Pe("getGlobalStorage",{paramsSchema:E.tuple(E.string()),implement(e){return w(this,null,function*(){try{let{data:{data:t,dataType:r}}=yield ye("getGlobalStorageAsync",{key:e});return{code:"SUCCESS",message:"success",data:Jx(t,r)}}catch(t){return{code:"INTERNAL_ERROR",message:"[Jolibox SDK] get global storage failed",data:null}}})}}),$x=Pe("setGlobalStorage",{paramsSchema:E.tuple(E.string(),E.or(E.string(),E.boolean(),E.number(),E.array())),implement(e,t){return w(this,null,function*(){try{let r=Bx(t),n=Hx(t,r);return yield ye("setGlobalStorageAsync",{key:e,data:n,dataType:r}),{code:"SUCCESS",message:"success"}}catch(r){return{code:"INTERNAL_ERROR",message:"[Jolibox SDK] set global storage failed"}}})}})});var i3,o3,a3,pp,Vx=k(()=>{"use strict";D();_e();rt();i3=G("showKeyboard",{paramsSchema:E.tuple(E.object({defaultValue:E.string().optional().default(""),multiple:E.boolean().optional().default(!1),maxLength:E.unknown().optional().default(1e5)})),implement(e){var n;let t=Math.floor((n=Number(e.maxLength))!=null?n:1e5),{defaultValue:r}=e;r&&t&&(r=r.slice(0,t)),j("showKeyboardSync",B(T({},e),{defaultValue:r,maxLength:t}))}});L("keyboard.showKeyboard",{version:"1.0.0",properties:{params:{defaultValue:"1.0.0",multiple:"1.0.0",confirmHold:"1.0.0",confirmType:"1.0.0",maxLength:"1.0.0"}},success:{errMsg:"1.0.0"}});o3=G("updateKeyboard",{paramsSchema:E.tuple(E.object({value:E.string()})),implement(e){j("updateKeyboardSync",e)}});L("keyboard.updateKeyboard",{version:"1.0.0",properties:{params:{value:"1.0.0"}}});a3=G("hideKeyboard",{implement(){j("hideKeyboardSync")}});L("keyboard.hideKeyboard",{version:"1.0.0"});pp=X();pp.registerCommand("KeyboardSDK.showKeyboard",i3);pp.registerCommand("KeyboardSDK.updateKeyboard",o3);pp.registerCommand("KeyboardSDK.hideKeyboard",a3)});var Gx=h(Ds=>{"use strict";D();rt();gt();var fp=X(),s3=Pe("levelFinished",{paramsSchema:E.tuple(E.object({levelId:E.or(E.string(),E.number()),duration:E.number().optional(),rating:E.number().optional(),score:E.number().optional(),variation:E.string().optional()})),implement:e=>w(Ds,null,function*(){let{levelId:t,duration:r,rating:n,score:i,variation:o}=e,a=[];a.push(It.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i,variation:o})),a.push(It.reporter({event:"COMPLETE_GAME_LEVEL",extraParams:{inGameInfo:{levelId:t,duration:r,rating:n,score:i}}})),yield Promise.all(a)})}),l3=Pe("gamePlayEnded",{paramsSchema:E.tuple(E.object({duration:E.number().optional(),rating:E.number().optional(),score:E.number(),variation:E.string().optional()})),implement:e=>w(Ds,null,function*(){let{duration:t,rating:r,score:n,variation:i}=e,o=[];o.push(It.tracker("GamePlayEnded",{duration:t,rating:r,score:n,variation:i})),o.push(It.reporter({event:"GAME_ENDED",extraParams:{inGameInfo:{duration:t,rating:r,score:n}}})),yield Promise.all(o)})}),c3=Pe("levelUpgrade",{paramsSchema:E.tuple(E.object({levelId:E.or(E.string(),E.number()),name:E.string().optional()})),implement:r=>w(Ds,[r],function*({levelId:e,name:t}){let n=[];n.push(It.tracker("LevelUpgrade",{name:t,levelId:e})),n.push(It.reporter({event:"GAME_LEVEL_UP",extraParams:{inGameInfo:{levelId:e,levelName:t}}})),yield Promise.all(n)})});fp.registerCommand("TaskTrackerSDK.levelFinished",s3);fp.registerCommand("TaskTrackerSDK.gamePlayEnded",l3);fp.registerCommand("TaskTrackerSDK.levelUpgrade",c3);L("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});L("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});L("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var hp,mp,vp,u3,zx,Ls=k(()=>{"use strict";K();_e();rt();D();Kr();L("login",{version:"1.0.0",properties:{force:"1.0.0"},success:{errMsg:"1.0.0",code:"1.0.0",token:"1.0.0",isLogin:"1.0.0"}});L("checkSession",{version:"1.0.0",success:{errMsg:"1.0.0"}});hp=new Map;Ze("onLoginStateChange",({isLogin:e,token:t,uuid:r,isFirstLogin:n,extra:i})=>{let o=hp.get(r);o&&(o.resolve({isLogin:e,token:t,isFirstLogin:n,extra:i}),hp.delete(r))});mp=(e,t=!1)=>w(void 0,null,function*(){var u;let{data:{isLogin:r}}=yield ye("checkLoginAsync");if(r)return{isLogin:!0,token:(u=S.hostUserInfo)==null?void 0:u.token};let{skipLogin:n,triggerFrom:i}=e!=null?e:{},o=j("loginSync",{skipLogin:n,triggerFrom:i}),{data:{uuid:a}}=o;if(!a)throw cr({code:-1,msg:"login failed"});let s=new Ct;hp.set(a,s);let l=yield s.promise;S.onEnvConfigChanged({hostUserInfo:l});let p=l,{extra:c}=p,d=je(p,["extra"]);return ne.emit("onLoginComplete",d),t?l:d}),vp=Pe("login",{paramsSchema:E.tuple(E.object({skipLogin:E.boolean().optional(),triggerFrom:E.string().optional()}).optional()),implement(e){return w(this,null,function*(){return yield mp(e!=null?e:{})})}}),u3=Pe("checkSession",{implement(){return w(this,null,function*(){let{data:{isLogin:e}}=yield ye("checkLoginAsync");return{isLogin:e}})}}),zx=X();zx.registerCommand("API.login",vp);zx.registerCommand("API.checkSession",u3)});var Wx,Kx=k(()=>{"use strict";Wx=e=>{let t=new Date,r=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),n=r+24*60*60*1e3;return e.filter(i=>i>=r&&i<n)}});function gp(e){return t=>w(this,null,function*(){var l;let{dailyMaxPopUps:r,minInterval:n}=t,i=yield up(e);if(!i.data)return{canShow:!0,isFirst:!0};let o=Qx(i.data),a=Wx(o);if(r&&a.length>=r)return{canShow:!1,isFirst:!1};let s=Date.now();return console.log("todayFrequencies",a,n,s-a[0]),n&&s-((l=a==null?void 0:a[0])!=null?l:0)<n?{canShow:!1,isFirst:!1}:{canShow:!0,isFirst:!1}})}function yp(e){return()=>w(this,null,function*(){var i;let t=Date.now(),r=yield up(e),n=Qx((i=r.data)!=null?i:"[]");n.push(t),n.sort((o,a)=>a-o).splice(8),yield $x(e,JSON.stringify(n))})}var Qx,Yx,Xx,Zx,ek,tk,rk,qs=k(()=>{"use strict";dp();Kx();Qx=e=>{let t;try{t=JSON.parse(e)}catch(r){t=[]}return t};Yx=gp("joli_coin_use_modal_frequency"),Xx=gp("joli_coin_payment_frequency"),Zx=gp("joli_coin_unlogin_modal_frequency");ek=yp("joli_coin_use_modal_frequency"),tk=yp("joli_coin_payment_frequency"),rk=yp("joli_coin_unlogin_modal_frequency")});var _p,Fs,bp=k(()=>{"use strict";vt();_p=Promise.resolve(),Fs=e=>w(void 0,null,function*(){_p=_p.then(()=>w(void 0,null,function*(){yield te("/api/joli-coin/user-config",{method:"POST",appendHostCookie:!0,data:{enableAutoDeduct:e}})})),yield _p})});var Ms,Us,At,js,Hr,wr,rr,Bs,An,d3,F,Tn,Cn,Ye=k(()=>{"use strict";D();Ms="UNLOCK_OPTIONS_CHANGED",Us="INVOKE_PAYMENT",At="ON_PAYMENT_RESULT",js="ON_USE_MODAL_EVENT",Hr="ON_USE_MODAL_RESULT",wr="ON_USE_MODAL_FREQUENCY",rr="ON_USE_UNLOGIN_MODAL_EVENT",Bs="INVOKE_UNLOGIN_MODAL_EVENT",An=new Ot,d3=()=>({on:An.on.bind(An),off:An.off.bind(An),emit:An.emit.bind(An)}),F=d3(),Tn={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}},Cn={show:!0,minInterval:8*60*60*1e3}});function nt(e,t){let r=null,n=null,i=null,o=()=>{if(i){r=Promise.resolve(i);return}r=new Promise(a=>{n=a})};return o(),e.on(t,(...a)=>{let s=a[0];i=s,n&&(n(s),n=null)}),{getData:()=>(r||o(),r),getCachedData:()=>i,clearCache:()=>{i=null,r=null},getFreshData:()=>(i=null,r=null,o(),r),updateData:a=>{if(i)return i=T(T({},i),a),r=Promise.resolve(i),n&&(n(i),n=null),i}}}var Ir=k(()=>{"use strict"});var ok=h(wp=>{"use strict";qs();bp();Ye();Ye();er();gt();D();Ir();var nk=ro(),ik=nt(F,wr);ik.getData();F.on(js,(e,t)=>w(wp,null,function*(){if(e==="ADS-JOLI_COIN"){yield nk.show({duration:3e3});let n=yield ik.getData(),{canShow:i,isFirst:o}=yield Yx(n.joliCoinUseAndCharge.useJolicoin);console.log("use modal show by frequency",i,o),nk.hide();let{balance:a}=t.userJoliCoin;if(a>=t.joliCoinQuantity&&t.enableAutoDeduct&&!o){F.emit(Hr,{useModalResult:"CONFIRM"});return}if(!i){F.emit(Hr,{useModalResult:"FAILED"});return}}M("unlock_popup_show",{eventType:J.View,targetType:"game"});let r=tx({data:{enableAutoDeduct:t.enableAutoDeduct,userJolicoin:t.userJoliCoin,joliCoinQuantity:t.joliCoinQuantity},buttons:{confirm:{text:t.confirmButtonText,onPress:()=>{M("coin_unlock_click",{targetType:"game",eventType:J.Click,coinConsume:t.joliCoinQuantity,ifAutoUnlock:t.enableAutoDeduct}),F.emit(Hr,{useModalResult:"CONFIRM"}),r.destroy()}},cancel:{text:t.cancelButtonText,onPress:({type:n})=>{n==="FAILED"&&M("ad_unlock_click",{targetType:"game",eventType:J.Click}),F.emit(Hr,{useModalResult:(n!=null?n:"")==="CANCEL"?"CANCEL":"FAILED"}),r.destroy()}},onEnableDeductChanged:n=>w(wp,null,function*(){yield Fs(n)})}});yield ek()}))});function ak(){let e=new Map;return{registerPaymentHandler(r,n){e.set(r,n)},invokePayment(r,...n){return w(this,null,function*(){let i=e.get(r);if(!i)return{code:"FAILED",message:`[joliboxSDK]: ${r} payment not supported in this platform`};try{return yield i(...n)}catch(o){return ke(o),{code:"FAILED",message:`[joliboxSDK]: paymenterror ${o}`}}})}}}var sk=k(()=>{"use strict";mt()});var Js=k(()=>{"use strict"});var p3,Pn,Sr,f3,$r,Ip=k(()=>{"use strict";Js();D();K();vt();p3=()=>{let[e,t]=[Zf,th].map(r=>(n,i,o)=>new r(n,i,o));return{createPaymentError:e,createPaymentInternalError:t}},{createPaymentError:Pn,createPaymentInternalError:Sr}=p3(),f3=S.testMode?"https://stg-game.jolibox.com":"https://game.jolibox.com",$r=class{constructor(){this._orderId=null;this._orderStatus="INIT";this.startPayment=t=>w(this,null,function*(){this._orderId&&(yield this.cancelOrder(this.orderId));let{code:r,message:n}=yield this.placeOrder(t);if(r!=="SUCCESS")throw Pn(n,1001);return yield this.pay()});this.cancelOrder=t=>w(this,null,function*(){var n,i;let{response:r}=yield te(`/api/orders/${t}/cancel`,{method:"POST",data:{}});if(r.code!=="SUCCCESS")throw Pn((i=(n=r.message)!=null?n:r.errMsg)!=null?i:"",1003)});this.generateCallbackUrl=()=>{let t=new URLSearchParams("");return t.set("utm_source",S.deviceInfo.platform),t.set("joliSource",S.encodeJoliSourceQuery(T({},this.generatePaymentContext()))),`${f3}//payment/callback?${t.toString()}`}}get orderId(){return this._orderId}get status(){return this._orderStatus}}});var Sp,ck,uk=k(()=>{"use strict";vt();Ip();Js();Sp=class extends $r{constructor(r){super();this.productId=r;this.generatePaymentContext=()=>({type:"JOLI_COIN_ORDER_CONTEXT",state:"TO_VALIDATE",productId:this.productId,orderId:this.orderId});this.pay=()=>w(this,null,function*(){let r=this.generateCallbackUrl();return console.info("callbackUrl",r),{code:"SUCCESS",message:"jolicoin payment success"}})}placeOrder(r){return w(this,null,function*(){var n,i,o,a;try{let{response:s}=yield te("/api/orders/checkout/joli-coin",{method:"POST",data:{productId:r.productId}});if(s.code!=="SUCCESS")throw Pn((i=(n=s.errMsg)!=null?n:s.message)!=null?i:"",1002);return{code:"SUCCESS",message:(o=s.message)!=null?o:"placeorder jolicoin success",data:s.data}}catch(s){throw console.info("[JoliboxSDK] placeorder failed",s),Sr((a=JSON.stringify(s))!=null?a:"jolicoin placeorder failed",1002)}})}},ck=()=>{let e=new Map;return t=>w(void 0,null,function*(){let r=e.get(t);return r||(r=new Sp(t),e.set(t,r)),yield r.startPayment({productId:t}),{code:"SUCCESS",message:"jolicoin payment success"}})}});var dk,pk=k(()=>{"use strict";dk={SUCCESS:"unlockSuccess",FAIL_NOT_LOGIN:"unlockFailedNotLogin",FAIL_PAYING:"unlockFailedPaying",FAIL_PRODUCT_EMPTY:"unlockFailedProductIdNotFound",FAIL_GET_PRODUCT_INFO:"unlockFailedProductInvalid",FAIL_LAUNCH_BILLING:"unlockFailedLaunch",FAIL_TRANSACTION:"unlockFailedTransaction",FAIL_VERIFY:"unlockFaileVerify",TRANSACTION_PENDING:"transactionPending",FAILED:"unlockFailed"}});var Ep,fk,xp,kp,h3,hk,mk=k(()=>{"use strict";vt();Ip();Js();_e();D();K();er();pk();Ep=new Map;Ze("onPaymentStateChange",e=>{console.info("onPaymentStateChange",e);let{orderUUID:t,status:r,totalAmount:n,orderResponse:i}=e,o=Ep.get(t);if(o){if(r==="SUCCESS")Jr("{slot-success} {slot-i18n-jolicoin.unlockSuccess}",{position:"center",duration:3e3}),o.resolve({code:"SUCCESS",message:"jolicoin payment success",data:{totalAmount:n}});else{if(r==="FAILED"&&zf(i==null?void 0:i.errNo)&&(i==null?void 0:i.errNo)!==0)throw Sr(`jolicoin payment failed: ${i==null?void 0:i.errMsg}`,1002);let a=dk[r];a&&Jr(`{slot-error} {slot-i18n-jolicoin.${a}}`,{position:"center",duration:3e3}),o.resolve({code:"FAILED",message:"jolicoin payment failed"})}Ep.delete(t)}});fk=e=>w(void 0,null,function*(){var n,i;let t=new Ct,r;try{let o=yield ye("requestPaymentSync",{paymentBody:{appStoreProductId:e.appStoreProductId,appAccountToken:e.appAccountToken}});if(r=(n=o.data)==null?void 0:n.orderUUID,console.info("---payInApp---",o),!r)throw Sr("orderUUID is null",1002);Ep.set(r,t)}catch(o){throw Sr((i=JSON.stringify(o))!=null?i:"jolicoin payment failed",1002)}return t.promise}),xp=class extends $r{constructor(r,n){super();this.productId=r;this.appStoreProductId=n;this.generatePaymentContext=()=>({type:"JOLI_COIN_IAP_CONTEXT",state:"TO_VALIDATE",productId:this.productId,appStoreProductId:this.appStoreProductId});this.pay=()=>w(this,null,function*(){return yield fk({appStoreProductId:this.appStoreProductId})})}placeOrder(r){return w(this,null,function*(){return{code:"SUCCESS",message:"placeorder jolicoin success in native"}})}},kp=class extends $r{constructor(r,n){super();this.productId=r;this.appStoreProductId=n;this.generatePaymentContext=()=>({type:"JOLI_COIN_IAP_CONTEXT",state:"TO_VALIDATE",productId:this.productId,appStoreProductId:this.appStoreProductId});this.pay=()=>w(this,null,function*(){return yield fk({appStoreProductId:this.appStoreProductId,appAccountToken:this.appAccountToken})})}placeOrder(r){return w(this,null,function*(){var a;console.log("----start place order for ios----");let{response:n}=yield te("/api/orders/iap-init",{method:"GET",appendHostCookie:!0}),{data:i,code:o}=n!=null?n:{};if(console.log("----iap init----",i,o),i.code!=="SUCCESS")throw Sr("iap-init failed",1002);return this.appAccountToken=(a=i==null?void 0:i.data)==null?void 0:a.iapToken,{code:"SUCCESS",message:"placeorder jolicoin success in native"}})}},h3={android:xp,ios:kp},hk=()=>{let e=new Map;return t=>w(void 0,null,function*(){let{productId:r,appStoreProductId:n}=t,i=e.get(r);if(!i){let s=h3[S.platform];if(!s)throw Sr("platform not supported",1002);i=new s(r,n),e.set(r,i)}let{code:o,message:a}=yield i.startPayment({productId:r,appStoreProductId:n});if(o!=="SUCCESS")throw Pn(a,1002);return{code:"SUCCESS",message:"jolicoin payment success"}})}});var Hs,vk=k(()=>{"use strict";sk();uk();mk();Hs=ak();Hs.registerPaymentHandler("JOLI_COIN",ck());Hs.registerPaymentHandler("JOLI_COIN_IAP",hk())});var yk=h(no=>{"use strict";Ye();er();vt();K();Ls();D();qs();vk();er();rt();_e();D();gt();bp();Ir();var On=ro(),m3=nt(F,wr);F.on(Us,(e,t)=>w(no,null,function*(){var r,n;try{if(!Px("requestPaymentSync:paymentBody:appStoreProductId")){console.info("requestPaymentSync:paymentBody:appStoreProductId not supported"),setTimeout(()=>{F.emit(At,{paymentResult:"FAILED"})},0);return}if(e==="ADS-JOLI_COIN"){yield On.show({duration:3e3});let a=yield m3.getData(),{canShow:s}=yield Xx(a.joliCoinUseAndCharge.charge);if(console.log("use payment show by frequency",s),On.hide(),!s){F.emit(At,{paymentResult:"FAILED"});return}console.log("show by frequency")}yield On.show({duration:3e3});let i=yield gk();if(On.hide(),!i){F.emit(At,{paymentResult:"FAILED"});return}M("coinorder_show",{targetType:"game",eventType:J.View});let o=rx({data:{userJolicoin:t.userJoliCoin,joliCoinQuantity:t.joliCoinQuantity,paymentChoices:(n=(r=i.paymentChoices)==null?void 0:r.map(a=>{var s;return B(T({},a),{totalAmountStr:(s=a.totalAmountStr)!=null?s:""})}))!=null?n:[],enableAutoDeduct:i.enableAutoDeduct},buttons:{confirm:{text:t.confirmButtonText,onPress:a=>w(no,null,function*(){var c,d,u,p,f,m,g,_;if(M("order_pay_ensure",{targetType:"game",eventType:J.Click,payWay:"app_iap",coinAmount:t.joliCoinQuantity,orderPrice:(d=(c=i.paymentChoices.find(v=>v.productId===a))==null?void 0:c.totalAmountStr)!=null?d:""}),!((u=S.hostUserInfo)!=null&&u.isLogin)){let{data:v}=yield vp({skipLogin:!0});if(!(v!=null&&v.isLogin)){console.log("login failed");return}let b=yield gk();if(((p=b==null?void 0:b.balance)!=null?p:0)>=t.joliCoinQuantity){F.emit(At,{paymentResult:"SUCCESS"}),o.destroy();return}}console.log("invokeNativePayment",a);let s=(m=(f=i==null?void 0:i.paymentChoices)==null?void 0:f.find(v=>v.productId===a))==null?void 0:m.appStoreProductId;if(!s){F.emit(At,{paymentResult:"FAILED"}),o.destroy();return}yield On.show({duration:3e3});let{code:l}=yield Hs.invokePayment("JOLI_COIN_IAP",{productId:a,appStoreProductId:s});if(On.hide(),M("order_pay_result",{eventType:J.Other,targetType:"game",payWay:"app_iap",coinAmount:t.joliCoinQuantity,orderPrice:(_=(g=i.paymentChoices.find(v=>v.productId===a))==null?void 0:g.totalAmountStr)!=null?_:"",payResult:l}),l!=="SUCCESS"){console.info("[JoliboxSDK] payment failed in payment.invokePaymet");return}F.emit(At,{paymentResult:"SUCCESS"}),o.destroy()})},cancel:{text:t.cancelButtonText,onPress:({type:a})=>{F.emit(At,{paymentResult:(a!=null?a:"")==="CANCEL"?"CANCEL":"FAILED"}),M("ad_unlock_click",{targetType:"game",eventType:J.Click}),o.destroy()}},onEnableDeductChanged:a=>w(no,null,function*(){yield Fs(a)})},onSelect:a=>{var s,l;M("coinorder_click",{targetType:"game",eventType:J.Click,coinAmount:t.joliCoinQuantity,orderPrice:(l=(s=i.paymentChoices.find(c=>c.productId===a))==null?void 0:s.totalAmountStr)!=null?l:""})}});yield tk()}catch(i){console.info("payment failed",i),F.emit(At,{paymentResult:"FAILED"})}}));var v3=(e,t)=>{Object.keys(t).forEach(r=>{let n=e.paymentChoices.find(i=>i.appStoreProductId===r);n&&(n.totalAmountStr=t[r].price)}),e.paymentChoices=e.paymentChoices.filter(r=>!Hl(r.totalAmountStr))},gk=()=>w(no,null,function*(){var r,n,i,o,a,s,l,c,d,u;let{response:e}=yield te("/api/joli-coin/balance-detail",{method:"GET",appendHostCookie:!0,responseType:"json"});console.info("getBalenceDetails",e);let{data:t}=yield ye("requestProductDetailsAsync",{appStoreProductIds:(o=(i=(n=(r=e.data)==null?void 0:r.data)==null?void 0:n.paymentChoices)==null?void 0:i.filter(p=>typeof p.appStoreProductId=="string").map(p=>p.appStoreProductId))!=null?o:[]});if((a=e.data)!=null&&a.data&&t&&v3((s=e.data)==null?void 0:s.data,t),console.info("productDetails",(l=e.data)==null?void 0:l.data),((d=(c=e.data)==null?void 0:c.data)==null?void 0:d.paymentChoices.length)===0)throw new Error("paymentChoices is empty");return(u=e.data)==null?void 0:u.data})});var bk=h($s=>{"use strict";Ye();Ir();qs();vt();mt();D();Ls();er();gt();var _k=nt(F,wr);_k.getData();F.on(Bs,(e,t)=>w($s,null,function*(){var r;try{if(e==="ADS-JOLI_COIN"){let o=yield _k.getData();if(console.log("unlogin guide config",o.loginGuide),!o.loginGuide.show){F.emit(rr,{result:"NOT_SUPPORT"});return}let{canShow:a}=yield Zx(o.loginGuide);if(console.log("canShowUseModal",a),!a){F.emit(rr,{result:"FAILED"});return}}let{firstLogin:n}=(r=yield g3())!=null?r:{};if(!(n!=null&&n.reward)){console.log("[JoliboxSDK] unlogin modal reward is empty"),F.emit(rr,{result:"NOT_SUPPORT"});return}M("LoginGuideModal",{eventType:J.Expose},J.Expose);let i=nx({data:{rewardType:e,rewardValue:n.reward.rewardValue},buttons:{confirm:{text:t.confirmButtonText,onPress:()=>w($s,null,function*(){var l,c,d,u;M("LoginGuideModal",{type:"click_confirm",eventType:J.Click},J.Click);let{isLogin:o,extra:a,isFirstLogin:s}=yield mp({},!0);if(!o){console.log("login failed");return}if(M("LoginGuideModal",{type:"click_confirm_login",isFirstLogin:s,eventType:J.Click},J.Click),s&&((l=a==null?void 0:a.firstLogin)!=null&&l.reward)){let{rewardValue:p}=a.firstLogin.reward;Jr("{slot-i18ntran-loginGuide.rewardTips}",{i18nParams:{text:"Jolicoin Used",coin:p},position:"top",duration:3e3})}F.emit(rr,{result:"SUCCESS",rewards:{jolicoin:{claimedRewardValue:(u=(d=(c=a==null?void 0:a.firstLogin)==null?void 0:c.reward)==null?void 0:d.rewardValue)!=null?u:0,isFirstLogin:s!=null?s:!1}}}),i.destroy()})},cancel:{text:t.cancelButtonText,onPress:({type:o})=>{M("LoginGuideModal",{eventType:J.Hide},J.Hide),M("LoginGuideModal",{type:o==="CANCEL"?"click_close":"click_watch_ads",eventType:J.Click},J.Click),F.emit(rr,{result:"FAILED"}),i.destroy()}}}});yield rk()}catch(n){ke(new rh(n)),F.emit(rr,{result:"FAILED"})}}));var g3=()=>w($s,null,function*(){var t;let{response:e}=yield te("/api/base/global-config",{method:"GET",appendHostCookie:!0,responseType:"json"});return(t=e.data)==null?void 0:t.data})});var zY,WY,KY,wk=k(()=>{"use strict";zY=ie(ok()),WY=ie(yk()),KY=ie(bk())});function C3(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function P3(e){return typeof e=="string"}function O3(e){return typeof e=="undefined"}function R3(e){return O3(e)||e===null}function N3(e){return typeof e=="function"}function Kk(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 io(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}function Ws(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 j3(e){let t=e.location?Ws(e.location,Ak):null,r=e.target?Ws(e.target,Ak):null;return Ws(k3(x3({},e),{location:t,target:r}),M3)}function B3(e){let t=e.events.map(n=>j3(n)),r=Ws(e.device,U3);return[e.protocolVersion,t,r,e.project]}function J3(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function z3(e){return new Promise(t=>Zk(e)(t))}function Zk(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 W3(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new co(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 Q3(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Y3(e[n],t[n])}function Y3(e,t){if(P3(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(N3(t)){try{if(e instanceof t)return}catch(r){}if(!R3(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 it(e,t,r){return(t=X3(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X3(e){var t=Z3(e,"string");return typeof t=="symbol"?t:t+""}function Z3(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 Vs(e,t,r){return(t=e4(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function e4(e){var t=t4(e,"string");return typeof t=="symbol"?t:t+""}function t4(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 Gs(e,t,r){return(t=r4(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r4(e){var t=n4(e,"string");return typeof t=="symbol"?t:t+""}function n4(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 nr(e,t,r){return(t=i4(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i4(e){var t=o4(e,"string");return typeof t=="symbol"?t:t+""}function o4(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 a4(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 s4(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 f4(e,t){return Me(e,0)^45?(((t<<2^Me(e,0))<<2^Me(e,1))<<2^Me(e,2))<<2^Me(e,3):0}function rA(e){return e.trim()}function h4(e,t){return(e=t.exec(e))?e[0]:e}function W(e,t,r){return e.replace(t,r)}function Bp(e,t){return e.indexOf(t)}function Me(e,t){return e.charCodeAt(t)|0}function uo(e,t,r){return e.slice(t,r)}function Jt(e){return e.length}function nf(e){return e.length}function zs(e,t){return t.push(e),e}function m4(e,t){return e.map(t).join("")}function ll(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:sl,column:Fn,length:a,return:""}}function ao(e,t){return p4(ll("",null,null,"",null,null,0),e,{length:-e.length},t)}function v4(){return xe}function g4(){return xe=st>0?Me(Mn,--st):0,Fn--,xe===10&&(Fn=1,sl--),xe}function ft(){return xe=st<nA?Me(Mn,st++):0,Fn++,xe===10&&(Fn=1,sl++),xe}function Ht(){return Me(Mn,st)}function Ks(){return st}function fo(e,t){return uo(Mn,e,t)}function po(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 iA(e){return sl=Fn=1,nA=Jt(Mn=e),st=0,[]}function oA(e){return Mn="",e}function Qs(e){return rA(fo(st-1,Jp(e===91?e+2:e===40?e+1:e)))}function y4(e){for(;(xe=Ht())&&xe<33;)ft();return po(e)>2||po(xe)>3?"":" "}function _4(e,t){for(;--t&&ft()&&!(xe<48||xe>102||xe>57&&xe<65||xe>70&&xe<97););return fo(e,Ks()+(t<6&&Ht()==32&&ft()==32))}function Jp(e){for(;ft();)switch(xe){case e:return st;case 34:case 39:e!==34&&e!==39&&Jp(xe);break;case 40:e===41&&Jp(e);break;case 92:ft();break}return st}function b4(e,t){for(;ft()&&e+xe!==57&&!(e+xe===84&&Ht()===47););return"/*"+fo(t,st-1)+"*"+al(e===47?e:ft())}function w4(e){for(;!po(Ht());)ft();return fo(e,st)}function I4(e){return oA(Ys("",null,null,null,[""],e=iA(e),0,[0],e))}function Ys(e,t,r,n,i,o,a,s,l){for(var c=0,d=0,u=a,p=0,f=0,m=0,g=1,_=1,v=1,b=0,I="",A=i,P=o,O=n,x=I;_;)switch(m=b,b=ft()){case 40:if(m!=108&&Me(x,u-1)==58){Bp(x+=W(Qs(b),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:x+=Qs(b);break;case 9:case 10:case 13:case 32:x+=y4(m);break;case 92:x+=_4(Ks()-1,7);continue;case 47:switch(Ht()){case 42:case 47:zs(S4(b4(ft(),Ks()),t,r),l);break;default:x+="/"}break;case 123*g:s[c++]=Jt(x)*v;case 125*g:case 59:case 0:switch(b){case 0:case 125:_=0;case 59+d:v==-1&&(x=W(x,/\f/g,"")),f>0&&Jt(x)-u&&zs(f>32?Ok(x+";",n,r,u-1):Ok(W(x," ","")+";",n,r,u-2),l);break;case 59:x+=";";default:if(zs(O=Pk(x,t,r,c,d,i,s,I,A=[],P=[],u),o),b===123)if(d===0)Ys(x,t,O,O,A,o,u,s,P);else switch(p===99&&Me(x,3)===110?100:p){case 100:case 108:case 109:case 115:Ys(e,O,O,n&&zs(Pk(e,O,O,0,0,i,s,I,i,A=[],u),P),i,P,u,s,n?A:P);break;default:Ys(x,O,O,O,[""],P,0,s,P)}}c=d=f=0,g=v=1,I=x="",u=a;break;case 58:u=1+Jt(x),f=m;default:if(g<1){if(b==123)--g;else if(b==125&&g++==0&&g4()==125)continue}switch(x+=al(b),b*g){case 38:v=d>0?1:(x+="\f",-1);break;case 44:s[c++]=(Jt(x)-1)*v,v=1;break;case 64:Ht()===45&&(x+=Qs(ft())),p=Ht(),d=u=Jt(I=x+=w4(Ks())),b++;break;case 45:m===45&&Jt(x)==2&&(g=0)}}return o}function Pk(e,t,r,n,i,o,a,s,l,c,d){for(var u=i-1,p=i===0?o:[""],f=nf(p),m=0,g=0,_=0;m<n;++m)for(var v=0,b=uo(e,u+1,u=d4(g=a[m])),I=e;v<f;++v)(I=rA(g>0?p[v]+" "+b:W(b,/&\f/g,p[v])))&&(l[_++]=I);return ll(e,t,r,i===0?tf:s,l,c,d)}function S4(e,t,r){return ll(e,t,r,eA,al(v4()),uo(e,2,-2),0)}function Ok(e,t,r,n){return ll(e,t,r,rf,uo(e,0,n),uo(e,n+1,-1),n)}function qn(e,t){for(var r="",n=nf(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function E4(e,t,r,n){switch(e.type){case u4:if(e.children.length)break;case c4:case rf:return e.return=e.return||e.value;case eA:return"";case tA:return e.return=e.value+"{"+qn(e.children,n)+"}";case tf:e.value=e.props.join(",")}return Jt(r=qn(e.children,n))?e.return=e.value+"{"+r+"}":""}function x4(e){var t=nf(e);return function(r,n,i,o){for(var a="",s=0;s<t;s++)a+=e[s](r,n,i,o)||"";return a}}function k4(e){return function(t){t.root||(t=t.return)&&e(t)}}function A4(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}function aA(e,t){switch(f4(e,t)){case 5103:return z+"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 z+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return z+e+el+e+Ge+e+e;case 6828:case 4268:return z+e+Ge+e+e;case 6165:return z+e+Ge+"flex-"+e+e;case 5187:return z+e+W(e,/(\w+).+(:[^]+)/,z+"box-$1$2"+Ge+"flex-$1$2")+e;case 5443:return z+e+Ge+"flex-item-"+W(e,/flex-|-self/,"")+e;case 4675:return z+e+Ge+"flex-line-pack"+W(e,/align-content|flex-|-self/,"")+e;case 5548:return z+e+Ge+W(e,"shrink","negative")+e;case 5292:return z+e+Ge+W(e,"basis","preferred-size")+e;case 6060:return z+"box-"+W(e,"-grow","")+z+e+Ge+W(e,"grow","positive")+e;case 4554:return z+W(e,/([^-])(transform)/g,"$1"+z+"$2")+e;case 6187:return W(W(W(e,/(zoom-|grab)/,z+"$1"),/(image-set)/,z+"$1"),e,"")+e;case 5495:case 3959:return W(e,/(image-set\([^]*)/,z+"$1$`$1");case 4968:return W(W(e,/(.+:)(flex-)?(.*)/,z+"box-pack:$3"+Ge+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+z+e+e;case 4095:case 3583:case 4068:case 2532:return W(e,/(.+)-inline(.+)/,z+"$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(Jt(e)-1-t>6)switch(Me(e,t+1)){case 109:if(Me(e,t+4)!==45)break;case 102:return W(e,/(.+:)(.+)-([^]+)/,"$1"+z+"$2-$3$1"+el+(Me(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Bp(e,"stretch")?aA(W(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Me(e,t+1)!==115)break;case 6444:switch(Me(e,Jt(e)-3-(~Bp(e,"!important")&&10))){case 107:return W(e,":",":"+z)+e;case 101:return W(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+z+(Me(e,14)===45?"inline-":"")+"box$3$1"+z+"$2$3$1"+Ge+"$2box$3")+e}break;case 5936:switch(Me(e,t+11)){case 114:return z+e+Ge+W(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return z+e+Ge+W(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return z+e+Ge+W(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return z+e+Ge+e+e}return e}function q4(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 tl(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 Er={name:i.name,styles:i.styles,next:Er},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)Er={name:a.name,styles:a.styles,next:Er},a=a.next;var s=o.styles+";";return s}return j4(e,t,r)}}var l=r;if(t==null)return l;var c=t[l];return c!==void 0?c:l}function j4(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=tl(e,t,r[i])+";";else for(var o in r){var a=r[o];if(typeof a!="object"){var s=a;t!=null&&t[s]!==void 0?n+=o+"{"+t[s]+"}":Nk(s)&&(n+=Tp(o)+":"+Dk(o,s)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var l=0;l<a.length;l++)Nk(a[l])&&(n+=Tp(o)+":"+Dk(o,a[l])+";");else{var c=tl(e,t,a);switch(o){case"animation":case"animationName":{n+=Tp(o)+":"+c+";";break}default:n+=o+"{"+c+"}"}}}return n}function Cp(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="";Er=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=tl(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=tl(r,t,e[s]),n){var l=o;i+=l[s]}Lk.lastIndex=0;for(var c="",d;(d=Lk.exec(i))!==null;)c+="-"+d[1];var u=q4(i)+c;return{name:u,styles:i,next:Er}}function lA(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}function qk(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function Fk(e,t,r){var n=[],i=lA(e,n,r);return n.length<2?r:i+t(n)}function G4(e,t){Oe.__h&&Oe.__h(pt,e,Uk||t),Uk=0;var r=pt.__H||(pt.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function uA(e,t){var r=G4(Hp++,7);return K4(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function z4(){for(var e;e=cA.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Xs),e.__H.__h.forEach($p),e.__H.__h=[]}catch(t){e.__H.__h=[],Oe.__e(t,e.__v)}}function W4(e){var t,r=function(){clearTimeout(n),Gk&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Gk&&(t=requestAnimationFrame(r))}function Xs(e){var t=pt,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),pt=t}function $p(e){var t=pt;e.__c=e.__(),pt=t}function K4(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function cl(){if(xr>1)xr--;else{for(var e,t=!1;so!==void 0;){var r=so;for(so=void 0,Vp++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&pA(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(Vp=0,xr--,t)throw e}}function at(e){if(xr>0)return e();xr++;try{return e()}finally{cl()}}function dA(e){if(ee!==void 0){var t=e.n;if(t===void 0||t.t!==ee)return t={i:0,S:e,p:ee.s,n:void 0,t:ee,e:void 0,x:void 0,r:t},ee.s!==void 0&&(ee.s.n=t),ee.s=t,e.n=t,32&ee.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=ee.s,t.n=void 0,ee.s.n=t,ee.s=t),t}}function Ue(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function re(e){return new Ue(e)}function pA(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 fA(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 hA(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 jn(e){Ue.call(this,void 0),this.x=e,this.s=void 0,this.g=rl-1,this.f=4}function lo(e){return new jn(e)}function mA(e){var t=e.u;if(e.u=void 0,typeof t=="function"){xr++;var r=ee;ee=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,of(e),n}finally{ee=r,cl()}}}function of(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,mA(e)}function Y4(e){if(ee!==this)throw new Error("Out-of-order effect");hA(this),ee=e,this.f&=-2,8&this.f&&of(this),cl()}function ho(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function mo(e){var t=new ho(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}function Bn(e,t){R[e]=t.bind(null,R[e]||function(){})}function nl(e){Op&&Op(),Op=e&&e.S()}function yA(e){var t=this,r=e.data,n=_A(r);n.value=r;var i=uA(function(){for(var s=t,l=t.__v;l=l.__;)if(l.__c){l.__c.__$f|=4;break}var c=lo(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),d=lo(function(){return!Array.isArray(c.value)&&!uc(c.value)}),u=mo(function(){if(this.N=bA,d.value){var f=c.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),p=t.__$u.d;return t.__$u.d=function(){u(),p.call(this)},[d,c]},[]),o=i[0],a=i[1];return o.value?a.peek():a.value}function X4(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=re(r);return{o:function(a,s){o.value=a,n=s},d:mo(function(){this.N=bA;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}function _A(e){return uA(function(){return re(e)},[])}function eH(){at(function(){for(var e;e=gA.shift();)vA.call(e)})}function bA(){gA.push(this)===1&&(R.requestAnimationFrame||Z4)(eH)}function tH(e,t){let r=xi(e);ln(()=>{r.current=e},[e]),Ei(()=>{if(t===null)return;let n=setInterval(()=>{r.current()},t);return()=>{clearInterval(n)}},[t])}function ge(e,t,r,n,i,o){t||(t={});var a,s,l=t;if("ref"in l)for(s in l={},t)s=="ref"?a=t[s]:l[s]=t[s];var c={type:e,props:l,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--rH,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return R.vnode&&R.vnode(c),c}function ir(e,t,r){return(t=hH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hH(e){var t=mH(e,"string");return typeof t=="symbol"?t:t+""}function mH(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 or(e,t,r){return(t=_H(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _H(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)}function Ve(e,t,r){return(t=wH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wH(e){var t=IH(e,"string");return typeof t=="symbol"?t:t+""}function IH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ot(e,t,r){return(t=SH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SH(e){var t=EH(e,"string");return typeof t=="symbol"?t:t+""}function EH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vr(e,t,r){return(t=xH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xH(e){var t=kH(e,"string");return typeof t=="symbol"?t:t+""}function kH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rp(e,t,r){return(t=AH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AH(e){var t=TH(e,"string");return typeof t=="symbol"?t:t+""}function TH(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 Xe(e,t,r){return(t=CH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CH(e){var t=PH(e,"string");return typeof t=="symbol"?t:t+""}function PH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tt(e,t,r){return(t=OH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OH(e){var t=RH(e,"string");return typeof t=="symbol"?t:t+""}function RH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ik,y3,_3,b3,zk,w3,I3,Sk,S3,E3,Ek,x3,k3,A3,Wk,T3,D3,L3,xk,q3,kk,F3,Qk,Yk,Xk,Ak,M3,U3,Dn,Tk,Np,ue,H3,$3,oo,co,V3,Lp,G3,Ap,K3,qp,Ck,Rn,Fp,Mp,Up,jp,l4,Ge,el,z,eA,tf,rf,c4,tA,u4,d4,al,p4,sl,Fn,nA,st,xe,Mn,T4,C4,P4,Rk,O4,R4,N4,D4,L4,F4,M4,U4,sA,Nk,Tp,Dk,Lk,Er,B4,J4,H4,$4,V4,Un,Hp,pt,Pp,Mk,Uk,cA,Oe,jk,Bk,Jk,Hk,$k,Vk,Gk,Q4,ee,so,xr,Vp,rl,vA,Op,gA,Z4,ze,rH,nH,ar,Gp,zp,Zs,iH,oH,aH,sH,lH,cH,uH,dH,pH,fH,Wp,Ln,Nn,vH,gH,yH,Kp,wA,Qp,Yp,Xp,Zp,il,ef,ol,XY,IA=k(()=>{"use strict";Yr();ra();Ik=Object.getOwnPropertySymbols,y3=Object.prototype.hasOwnProperty,_3=Object.prototype.propertyIsEnumerable,b3=(e,t)=>{var r={};for(var n in e)y3.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ik)for(var n of Ik(e))t.indexOf(n)<0&&_3.call(e,n)&&(r[n]=e[n]);return r},zk=Object.defineProperty,w3=Object.defineProperties,I3=Object.getOwnPropertyDescriptors,Sk=Object.getOwnPropertySymbols,S3=Object.prototype.hasOwnProperty,E3=Object.prototype.propertyIsEnumerable,Ek=(e,t,r)=>t in e?zk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x3=(e,t)=>{for(var r in t||(t={}))S3.call(t,r)&&Ek(e,r,t[r]);if(Sk)for(var r of Sk(t))E3.call(t,r)&&Ek(e,r,t[r]);return e},k3=(e,t)=>w3(e,I3(t)),A3=(e,t)=>{for(var r in t)zk(e,r,{get:t[r],enumerable:!0})},Wk=(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},T3=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}D3=(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))(D3||{});L3={log:io("log"),warn:io("warn"),info:io("info"),error:io("error"),debug:io("debug")};Object.assign(globalThis,{logger:L3});xk=Symbol.for("Jolibox.canIUseMap"),q3={};globalThis[xk]||(globalThis[xk]=q3);kk=Symbol.for("Jolibox.canIUseMap.native"),F3={};globalThis[kk]||(globalThis[kk]=F3);Qk=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Qk||{}),Yk=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Yk||{}),Xk=(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))(Xk||{}),Ak=["name","params"],M3=["name","type","location","target","extra","timestamp","userId"],U3=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];J3();Dn=typeof window=="undefined",Tk=()=>!Dn&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");!Dn&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),!Dn&&navigator.userAgent.includes("Android"),!Dn&&navigator.userAgent.includes("Mac"),!Dn&&navigator.userAgent.includes("FB_IAB"),!Dn&&!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");Np=class Dp{constructor(t){this.element=t,this.next=Dp.Undefined,this.prev=Dp.Undefined}};Np.Undefined=new Np(void 0);ue=Np,H3=class{constructor(){this._first=ue.Undefined,this._last=ue.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ue.Undefined}clear(){let e=this._first;for(;e!==ue.Undefined;){let t=e.next;e.prev=ue.Undefined,e.next=ue.Undefined,e=t}this._first=ue.Undefined,this._last=ue.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new ue(e);if(this._first===ue.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!==ue.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ue.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ue.Undefined&&e.next!==ue.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ue.Undefined&&e.next===ue.Undefined?(this._first=ue.Undefined,this._last=ue.Undefined):e.next===ue.Undefined?(this._last=this._last.prev,this._last.next=ue.Undefined):e.prev===ue.Undefined&&(this._first=this._first.next,this._first.prev=ue.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ue.Undefined;)yield e.element,e=e.next}},$3=0,oo=class{constructor(e){this.value=e,this.id=$3++}},co=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 oo&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){return this._event!=null||(this._event=(e,t)=>{var r,n,i,o,a,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let l=new oo(e);return this._listeners?this._listeners instanceof oo?this._listeners=[this._listeners,l]:this._listeners.push(l):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=l,(o=(i=this.options)==null?void 0:i.onDidFirstListener)==null||o.call(i,this)),(s=(a=this.options)==null?void 0:a.onDidAddListener)==null||s.call(a,this),this._size++,()=>{var c,d,u,p;if(!this._disposed){if(this._listeners instanceof oo)this._listeners.id===l.id&&(this._listeners=void 0,this._size=0,(d=(c=this.options)==null?void 0:c.onDidRemoveLastListener)==null||d.call(c));else if(this._listeners){let f=this._listeners.indexOf(l);f>=0&&(this._listeners.splice(f,1),this._size--,this._size===0&&((p=(u=this.options)==null?void 0:u.onDidRemoveLastListener)==null||p.call(u)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof oo?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},V3=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;var n;let i=(n=this.listeners.get(e))!=null?n:new co,o=l=>t(...l.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e){let t=this.listeners.get(e),r=this.cachedEventQueue.get(e);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r||(r=new H3,this.cachedEventQueue.set(e,r)),r.push({args:i}),t&&t.fire({event:e,args:i})}once(e,t){var r=this;let n=function(){t(...arguments),r.off(e,n)};this.on(e,n,!1)}},Lp={};A3(Lp,{None:()=>G3,filter:()=>W3,once:()=>Zk,toPromise:()=>z3});G3=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Ap=Symbol.for("Jolibox.hostEmitter"),K3=()=>{let e=new V3;return globalThis[Ap]||(globalThis[Ap]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Ap]};K3();qp=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new co,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 Q3(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}};qp=Wk([Kk],qp);Ck=class{constructor(){this._onWillExecuteCommand=new co,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new co,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new qp,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=C3(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 T3(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),Lp.toPromise(Lp.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{}}};Ck=Wk([Kk],Ck);Rn=e=>e?function(){try{for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e==null||e(r)}catch(i){console.error("Error calling function",i)}}:()=>{console.log("wrapUserFunction: fn is undefined")},Fp=class{constructor(t){it(this,"context",void 0),it(this,"continueCallback",void 0),it(this,"adIsShowingCallback",void 0),it(this,"isBeforeAdCalled",!1),it(this,"isBeforeRewardCalled",!1),it(this,"isAdDismissedCalled",!1),it(this,"isAdViewedCalled",!1),it(this,"isAfterAdCalled",!1),it(this,"currentProvider",void 0),it(this,"currentClientParams",void 0),it(this,"adsHasResponse",!1),it(this,"videoChecker",window.document.createElement("video")),it(this,"contextInfo",void 0),it(this,"wrapShowAdFn",r=>()=>{var n,i,o;this.adsHasResponse=!0;let a=!1;this.videoChecker.play().catch(()=>{a=!1}),a=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:a},this.paramsToTrack)),Tk()&&this.context.track("mmp_ad_impression",{ad_network:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:"",ad_format:"rewarded",module:"game",game_id:this.contextInfo.objectId}),(o=this.adIsShowingCallback)==null||o.call(this,!0);let s=Rn(r);s==null||s()}),this.context=t,this.contextInfo=t.getContextInfo()}get paramsToTrack(){var t,r,n,i,o,a;return{provider:(r=(t=this.currentProvider)==null?void 0:t.name)!=null?r:null,type:(n=this.currentClientParams)==null?void 0:n.type,name:((i=this.currentClientParams)==null?void 0:i.type)==="preroll"?null:(a=(o=this.currentClientParams)==null?void 0:o.name)!=null?a:""}}wrapBeforeAd(t){return()=>{var r,n,i,o;if(this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),!this.isBeforeAdCalled){this.isBeforeAdCalled=!0;let a=Rn(t);a==null||a(),((r=this.currentClientParams)==null?void 0:r.type)!=="reward"&&((n=this.adIsShowingCallback)==null||n.call(this,!0),Tk()&&this.context.track("mmp_ad_impression",{ad_network:(o=(i=this.currentProvider)==null?void 0:i.name)!=null?o:"",ad_format:"interstitial",module:"game",game_id:this.contextInfo.objectId}))}}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdDismissedCalled){this.isAdDismissedCalled=!0;let r=Rn(t);r==null||r()}}}wrapAdViewed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdViewedCalled){this.isAdViewedCalled=!0;let r=Rn(t);r==null||r()}}}wrapAfterAd(t){return()=>{if(this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),!this.isAfterAdCalled){this.isAfterAdCalled=!0;let r=Rn(t);r==null||r()}}}wrapAdBreakDone(t){return r=>{var n,i,o,a,s,l;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:null,breakType:r.breakType,breakName:(o=r.breakName)!=null?o:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{let c=Rn(t);c==null||c(r),(a=this.adIsShowingCallback)==null||a.call(this,!1),(s=this.continueCallback)==null||s.call(this,[!1,r]);break}default:{(l=this.continueCallback)==null||l.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n,i){return w(this,null,function*(){return this.currentProvider=t,this.currentClientParams=r,this.adsHasResponse=!1,new Promise(o=>{this.continueCallback=o,this.adIsShowingCallback=i;let a;switch(r.type){case"preroll":{a={type:r.type,adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}case"reward":{a={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),beforeReward:this.wrapBeforeReward(r.beforeReward),adDismissed:this.wrapAdDismissed(r.adDismissed),adViewed:this.wrapAdViewed(r.adViewed),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}default:{a={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}}window.setTimeout(()=>{var s,l,c,d,u;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(l=(s=this.currentProvider)==null?void 0:s.name)!=null?l:null}),(d=this.continueCallback)==null||d.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(c=r.name)!=null?c:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(u=this.adIsShowingCallback)==null||u.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(a,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};Mp=class{constructor(t){Vs(this,"context",void 0),Vs(this,"adBreakIsShowing",!1),Vs(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),Vs(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()})}};Up=class{constructor(t){Gs(this,"configs",null),Gs(this,"firstRun",!0),Gs(this,"context",void 0),Gs(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return w(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}};jp=class{constructor(t,r){nr(this,"name","ADSENSE"),nr(this,"context",void 0),nr(this,"contextInfo",void 0),nr(this,"configured",!1),nr(this,"initParams",void 0),nr(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),nr(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=b3(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),nr(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),nr(this,"adUnit",n=>w(this,null,function*(){var i,o,a,s;if(this.context.track("CallAdUnit",{adFormat:(o=(i=n.adFormat)==null?void 0:i.toString())!=null?o:null,fullWidthResponsive:(a=n.fullWidthResponsive)!=null?a:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:l,slot:c,adFormat:d,fullWidthResponsive:u,style:p}=n,f;if(!l)throw new Error("targeting element is required");if(typeof l=="string"?f=document.querySelector(l):f=l,!f)throw new Error("targeting element not found");let m=c;if(m||(m=this.initParams.unitId),!m)throw new Error("slot is required");let g=typeof d=="object"&&Array.isArray(d)?d.join(", "):d,_=document.createElement("ins");if(_.className="adsbygoogle",_.id="jolibox-ads",_.style.display="block",_.setAttribute("data-ad-client",this.initParams.clientId),_.setAttribute("data-ad-slot",m),g&&_.setAttribute("data-ad-format",g),u&&_.setAttribute("data-full-width-responsive",u),p&&_.setAttribute("style",p),(s=this.contextInfo.testAdsMode)!=null?s:!1){let v=document.createElement("div");v.style.position="absolute",v.style.top="0",v.style.left="0",v.style.width="100%",v.style.height="100%",v.style.display="flex",v.style.justifyContent="center",v.style.alignItems="center",v.style.backgroundColor="rgba(0, 0, 0, 0.5)",v.style.color="white",v.innerHTML="Test Ad",_.style.position="relative",f.appendChild(_),_.appendChild(v)}else f.appendChild(_),new MutationObserver(v=>{v.forEach(b=>{if(b.type==="attributes"&&b.attributeName==="data-ad-status"){let I=_.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:I!=null?I:"null"})}})}).observe(_,{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 w(this,null,function*(){var t;if(this.context.track("CallAdsInit",{provider:this.name}),typeof window=="undefined")return;let r="google-adsense",n=(t=this.contextInfo.testAdsMode)!=null?t:!1;if(!document.getElementById(r)&&this.initParams.clientId){let i=document.createElement("script");i.id=r,i.async=!0,i.crossOrigin="anonymous",i.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,n&&i.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&i.setAttribute("data-ad-channel",this.initParams.channelId),this.initParams.admobInterstitialSlot&&i.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),this.initParams.admobRewardedSlot&&i.setAttribute("data-admob-rewarded-slot",this.initParams.admobRewardedSlot),this.initParams.admobOnly&&i.setAttribute("data-admob-ads-only","on"),document.head.appendChild(i),this.context.track("LoadAdsenseCompleted",null)}})}};l4=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(s4(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=a4(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}(),Ge="-ms-",el="-moz-",z="-webkit-",eA="comm",tf="rule",rf="decl",c4="@import",tA="@keyframes",u4="@layer",d4=Math.abs,al=String.fromCharCode,p4=Object.assign;sl=1,Fn=1,nA=0,st=0,xe=0,Mn="";T4=function(e,t,r){for(var n=0,i=0;n=i,i=Ht(),n===38&&i===12&&(t[r]=1),!po(i);)ft();return fo(e,st)},C4=function(e,t){var r=-1,n=44;do switch(po(n)){case 0:n===38&&Ht()===12&&(t[r]=1),e[r]+=T4(st-1,t,r);break;case 2:e[r]+=Qs(n);break;case 4:if(n===44){e[++r]=Ht()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=al(n)}while(n=ft());return e},P4=function(e,t){return oA(C4(iA(e),t))},Rk=new WeakMap,O4=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&&!Rk.get(r))&&!n){Rk.set(e,!0);for(var i=[],o=P4(t,i),a=r.props,s=0,l=0;s<o.length;s++)for(var c=0;c<a.length;c++,l++)e.props[l]=i[s]?o[s].replace(/&\f/g,a[c]):a[c]+" "+o[s]}}},R4=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};N4=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case rf:e.return=aA(e.value,e.length);break;case tA:return qn([ao(e,{value:W(e.value,"@","@"+z)})],n);case tf:if(e.length)return m4(e.props,function(i){switch(h4(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return qn([ao(e,{props:[W(i,/:(read-\w+)/,":"+el+"$1")]})],n);case"::placeholder":return qn([ao(e,{props:[W(i,/:(plac\w+)/,":"+z+"input-$1")]}),ao(e,{props:[W(i,/:(plac\w+)/,":"+el+"$1")]}),ao(e,{props:[W(i,/:(plac\w+)/,Ge+"input-$1")]})],n)}return""})}},D4=[N4],L4=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(m){var g=m.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var n=e.stylisPlugins||D4,i={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(m){for(var g=m.getAttribute("data-emotion").split(" "),_=1;_<g.length;_++)i[g[_]]=!0;a.push(m)});var s,l=[O4,R4];{var c,d=[E4,k4(function(m){c.insert(m)})],u=x4(l.concat(n,d)),p=function(m){return qn(I4(m),u)};s=function(m,g,_,v){c=_,p(m?m+"{"+g.styles+"}":g.styles),v&&(f.inserted[g.name]=!0)}}var f={key:t,sheet:new l4({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return f.sheet.hydrate(a),f};F4={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},M4=/[A-Z]|^ms/g,U4=/_EMO_([^_]+?)_([^]*?)_EMO_/g,sA=function(e){return e.charCodeAt(1)===45},Nk=function(e){return e!=null&&typeof e!="boolean"},Tp=A4(function(e){return sA(e)?e:e.replace(M4,"-$&").toLowerCase()}),Dk=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(U4,function(r,n,i){return Er={name:n,styles:i,next:Er},n})}return F4[e]!==1&&!sA(e)&&typeof t=="number"&&t!==0?t+"px":t};Lk=/label:\s*([^\s;{]+)\s*(;|$)/g;B4=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},J4=function(e,t,r){B4(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)}};H4=function(e){var t=L4(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var c=Cp(s,t.registered,void 0);return J4(t,c),t.key+"-"+c.name},n=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var c=Cp(s,t.registered),d="animation-"+c.name;return qk(t,{name:c.name,styles:"@keyframes "+d+"{"+c.styles+"}"}),d},i=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var c=Cp(s,t.registered);qk(t,c)},o=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return Fk(t.registered,r,$4(s))};return{css:r,cx:o,injectGlobal:i,keyframes:n,hydrate:function(a){a.forEach(function(s){t.inserted[s]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:lA.bind(null,t.registered),merge:Fk.bind(null,t.registered,r)}},$4=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},V4=H4({key:"css"}),Un=V4.css,Uk=0,cA=[],Oe=R,jk=Oe.__b,Bk=Oe.__r,Jk=Oe.diffed,Hk=Oe.__c,$k=Oe.unmount,Vk=Oe.__;Oe.__b=function(e){pt=null,jk&&jk(e)},Oe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Vk&&Vk(e,t)},Oe.__r=function(e){Bk&&Bk(e),Hp=0;var t=(pt=e.__c).__H;t&&(Pp===pt?(t.__h=[],pt.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Xs),t.__h.forEach($p),t.__h=[],Hp=0)),Pp=pt},Oe.diffed=function(e){Jk&&Jk(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(cA.push(t)!==1&&Mk===Oe.requestAnimationFrame||((Mk=Oe.requestAnimationFrame)||W4)(z4)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Pp=pt=null},Oe.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Xs),r.__h=r.__h.filter(function(n){return!n.__||$p(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],Oe.__e(n,r.__v)}}),Hk&&Hk(e,t)},Oe.unmount=function(e){$k&&$k(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Xs(n)}catch(i){t=i}}),r.__H=void 0,t&&Oe.__e(t,r.__v))};Gk=typeof requestAnimationFrame=="function";Q4=Symbol.for("preact-signals");ee=void 0,so=void 0,xr=0,Vp=0,rl=0;Ue.prototype.brand=Q4;Ue.prototype.h=function(){return!0};Ue.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)};Ue.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)}};Ue.prototype.subscribe=function(e){var t=this;return mo(function(){var r=t.value,n=ee;ee=void 0;try{e(r)}finally{ee=n}})};Ue.prototype.valueOf=function(){return this.value};Ue.prototype.toString=function(){return this.value+""};Ue.prototype.toJSON=function(){return this.value};Ue.prototype.peek=function(){var e=ee;ee=void 0;try{return this.value}finally{ee=e}};Object.defineProperty(Ue.prototype,"value",{get:function(){var e=dA(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Vp>100)throw new Error("Cycle detected");this.v=e,this.i++,rl++,xr++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{cl()}}}});(jn.prototype=new Ue).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===rl))return!0;if(this.g=rl,this.f|=1,this.i>0&&!pA(this))return this.f&=-2,!0;var e=ee;try{fA(this),ee=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 ee=e,hA(this),this.f&=-2,!0};jn.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)}Ue.prototype.S.call(this,e)};jn.prototype.U=function(e){if(this.t!==void 0&&(Ue.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)}};jn.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(jn.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=dA(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});ho.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()}};ho.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,mA(this),fA(this),xr++;var e=ee;return ee=this,Y4.bind(this,e)};ho.prototype.N=function(){2&this.f||(this.f|=2,this.o=so,so=this)};ho.prototype.d=function(){this.f|=8,1&this.f||of(this)};gA=[];mo(function(){vA=this.N})();yA.displayName="_st";Object.defineProperties(Ue.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:yA},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Bn("__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 Ue&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});Bn("__r",function(e,t){nl();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return mo(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),nl(r),e(t)});Bn("__e",function(e,t,r,n){nl(),e(t,r,n)});Bn("diffed",function(e,t){nl();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var s=o[a];s!==void 0&&!(a in n)&&(s.d(),o[a]=void 0)}else o={},r.U=o;for(var l in n){var c=o[l],d=n[l];c===void 0?(c=X4(r,l,d,i),o[l]=c):c.o(d,i)}}}e(t)});Bn("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var a=t.__c;if(a){var s=a.__$u;s&&(a.__$u=void 0,s.d())}}e(t)});Bn("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});lt.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u,n=r&&r.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var o=2&this.__$f;if(!(n||o||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var a in e)if(a!=="__source"&&e[a]!==this.props[a])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};Z4=function(e){queueMicrotask(function(){queueMicrotask(e)})};ze=Un`
|
|
607
|
+
`);throw e.errors.length=0,ep(!1),new TypeError(n)}}var E,op=k(()=>{"use strict";np();np();E={object(e){return new Es(e)},array(e){return new Is(e)},tuple(...e){return new As(...e)},literal(e){return new xs(e)},or(...e){return new ks(...e)},symbol(){return new gs},record(e){return new Ss(e)},function(){return new bs},boolean(){return new ms},string(){return new vs},number(){return new hs},undefined(){return new ys},null(){return new _s},unknown(){return new kn},any(){return new kn},as(){return new kn},arraybuffer(){return new Ts},enum(...e){return new ws(...e)},typedarray(e){return new Cs(e)}}});var Ps,Ax,Tx=k(()=>{"use strict";D();mt();op();Kr();Ps=1,Ax=e=>{function t(n,i){return(...o)=>{var u,p,f,m;let a=Date.now(),s={method:n,trace_id:Ps};Ps+=1;let l="SUCCESS",c=`${n}:ok`,d=0;try{if(i.paramsSchema)try{ip(i.paramsSchema,o,"params")}catch(b){throw rc(`${n}:fail ${b.message}`)}let g=i.implement(...o),_=g,v=`${n}:ok`;if(g&&"code"in g){let{code:b,data:I,message:A}=g;l=b,_=I,v=A}return{code:l,message:v,data:_}}catch(g){let _=g;d=(p=(u=_.code)!=null?u:_.errNo)!=null?p:2e3,l="FAILURE";let v=(m=(f=_.message)!=null?f:_.errMsg)!=null?m:`${g}`;return c=`${n}:${l} ${v.replace(/^\S+:(fail|cancel)\s?/,"")}`,ke(new ei(c,d)),{code:l,message:c}}finally{let g=Date.now()-a}}}function r(n,i){return(...o)=>w(this,null,function*(){var p,f,m,g;let a=Gf(o)?o:[o],s=Date.now(),l={method:n,trace_id:Ps};Ps+=1;let c=`${n}:ok`,d="SUCCESS",u={code:d,message:c};try{if(i.paramsSchema)try{ip(i.paramsSchema,a,"params")}catch(b){throw rc(b.message)}let v=yield i.implement(...a);if(v&&"code"in v){let{code:b,data:I,message:A}=v;d=b,c=A,v=I}return Object.assign(u,{code:d,message:c,data:v}),u}catch(_){let v=_,b=(f=(p=v.code)!=null?p:v.errNo)!=null?f:2e3;d="FAILURE";let I=(g=(m=v.message)!=null?m:v.errMsg)!=null?g:`${_}`,A=`${n}:${d} ${I.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(u,{code:d,message:A}),ke(new ei(A,b)),u}finally{let _=Date.now()-s}})}return{createAPI:r,createSyncAPI:t}}});function ap(e){if(typeof e!="number"||e<=0)return"0.0.0";let t=e.toString(),r=0,n=0,i=0;return t.length>=1&&(r=parseInt(t.substring(0,1),10)),t.length>=3&&(n=parseInt(t.substring(1,3),10)),t.length>=5&&(i=parseInt(t.substring(3,5),10)),`${r}.${n}.${i}`}var Cx=k(()=>{"use strict"});var Pe,G,L,Px,rt=k(()=>{"use strict";xx();gt();Tx();op();_e();K();Cx();({createAPI:Pe,createSyncAPI:G}=Ax(M)),L=Ex("native"),{canIUseNative:Px}=Nf(()=>S.sdkInfo.nativeSDKVersionCode,()=>S.platform)});var Ox,q5,F5,M5,U5,Rx=k(()=>{"use strict";D();rt();_e();K();Ox=X(),q5="env",F5="getSystemInfoSync",M5=G(F5,{implement:()=>{var r;let e=j("envSync"),{data:t}=e;return{system:t.deviceInfo.system,platform:t.deviceInfo.platform.toLowerCase(),version:t.sdkInfo.jssdkVersion,pixelRatio:t.deviceInfo.pixelRatio,language:t.deviceInfo.lang,brand:t.deviceInfo.brand,appName:(r=t.hostInfo)==null?void 0:r.appName,SDKVersion:t.sdkInfo.jssdkVersion,viewport:{statusBarHeight:S.viewport.statusBarHeight,navigationBarHeight:S.viewport.navigationBarHeight}}}}),U5=G(q5,{implement:()=>{var t;let e=j("envSync");return(t=e==null?void 0:e.data)!=null?t:void 0}});Ox.registerCommand("API.getSystemInfoSync",M5);Ox.registerCommand("API.env",U5);L("env",{version:"1.0.0"});L("getSystemInfoSync",{version:"1.0.0",properties:{viewport:"1.0.33"}})});var Nx=h(sp=>{"use strict";D();rt();mt();_e();gt();K();var j5="exitGame",B5="onReady",J5="onJoliboxShow",H5="onJoliboxHide",Os=X(),Rs=Ro(ke),$5=Pe(j5,{paramsSchema:E.tuple(E.function(),E.boolean().optional().default(!1)),implement:(e,t=!1)=>w(sp,null,function*(){Rs(e).call(sp),Wr(S.shouldInterupt)&&!S.shouldInterupt&&S.from&&Uf("onRetentionResult",{shouldStay:t},S.from,!0),t||S.setDoExitDirectly(),yield ye("exitAppAsync")})}),V5=G(J5,{paramsSchema:E.tuple(E.function()),implement(e){let t=Rs(e);Ze("onJoliboxEnterForeground",()=>{t.call(this),ri.emit("visible",!0)})}}),G5=G(H5,{paramsSchema:E.tuple(E.function()),implement(e){let t=Rs(e);Ze("onJoliboxEnterBackground",()=>{t.call(this),ri.emit("visible",!1)})}}),z5=G(B5,{paramsSchema:E.tuple(E.function()),implement(e){let t=Rs(e);ne.on("LifecycleEvent.onReady",r=>{t(r)})}});Os.registerCommand("LifecycleSDK.exit",$5);Os.registerCommand("LifecycleSDK.onReady",z5);Os.registerCommand("LifecycleSDK.onJoliboxShow",V5);Os.registerCommand("LifecycleSDK.onJoliboxHide",G5);L("lifeCycle.exit",{version:"1.0.0"});L("lifeCycle.onReady",{version:"1.0.0"});L("lifeCycle.onJoliboxShow",{version:"1.0.0"});L("lifeCycle.onJoliboxHide",{version:"1.0.0"})});function Dx(e){let t={};if(!Tr(e))return t;for(let[r,n]of Object.entries(e)){let i=r.toLocaleLowerCase();n?typeof n=="object"?t[i]=Object.prototype.toString.call(n):t[i]=String(n):t[i]=""}return t}function Lx(e="GET"){if(e==="")return"POST";let t=e.toUpperCase();return["GET","OPTIONS","HEAD","POST","PUT","DELETE","TRACE","CONNECT","PATCH"].includes(t)?t:"GET"}function qx(e,t=!1){if(e)return t||e>0&&e<=6e4?Math.ceil(e):6e4}function Fx(e,t,r){if(["POST","PUT","PATCH"].includes(t)||!Tr(r))return e;let[n,i=""]=e.split("?"),o=new URLSearchParams(i);for(let[s,l]of Object.entries(r))l!=null&&o.append(s,String(l));let a=o.toString();return a?`${n}?${a}`:n}var Mx=k(()=>{"use strict";D()});var W5,K5,lp,cp,Ux,Q5,Y5,X5,jx=k(()=>{"use strict";Kr();ic();rt();Mx();D();mt();K();W5=15,K5=Lo("createRequestTaskSync","operateRequestTaskSync",{type:"public",baseUrl:S.baseApiHost}),lp=0,cp=[],Ux=Ro(ke),Q5=(e,t)=>{let r=e.filter(t),n=e.filter(i=>!t(i));return e.length=0,e.push(...n),r},Y5=e=>{let t=new Ct,r=()=>{};return G("request",{paramsSchema:E.tuple(E.object({url:E.string(),method:E.string(),headers:E.object().optional(),data:E.or(E.object(),E.array()).optional(),query:E.object().optional(),dataType:E.string().default("json"),responseType:E.string().default("text"),enableCache:E.boolean().default(!1),appendHostCookie:E.boolean().default(!0),timeout:E.number().default(3e4),success:E.function(),fail:E.function()})),implement(i){let o=()=>w(this,null,function*(){var s,l,c;let a=Ux(i.fail);try{if(lp+=1,t.state!=="pending")return;let{data:d,dataType:u,responseType:p,enableCache:f,appendHostCookie:m}=i,g=Dx((s=i.headers)!=null?s:{}),_=Lx(i.method),v=qx(i.timeout),b=Fx(i.url,_,d),I=Ux(i.success),A=Object.assign({},i,{method:_,header:m?void 0:g,data:_==="GET"||_==="HEAD"?void 0:d,enableCache:f,query:(l=i.query)!=null?l:{},dataType:u,responseType:p,appendHostCookie:m});v&&(A.timeout=v);let P=K5(b,A);{let{response:O}=yield P,{code:x,data:C,message:U}=O;if(C&&typeof C=="object"&&"status"in C&&C.status!==200)throw cr({code:C.status||-1,msg:`request:fail status ${C.status}`});t.resolve({code:x!=null?x:"SUCCESS",data:C,message:U!=null?U:"request:ok"}),I({code:"SUCCESS",message:"request:ok",data:C})}}catch(d){t.reject(d),a({code:"FAILURE",message:"httpRequst: failed"})}finally{lp-=1,(c=cp.shift())==null||c()}});return lp>=W5?(r=()=>{Q5(cp,a=>a===o)},cp.push(o)):o(),t.promise}})(e),{abort(){t.reject(cr({code:-1,msg:"request:fail abort"})),r()}}},X5=X();X5.registerCommand("HttpSDK.request",Y5);L("request",{version:"1.0.0"})});function Bx(e){let t=Object.prototype.toString.call(e).split(" ")[1].split("]")[0].toLocaleLowerCase();return t==="array"&&(t="object"),n3.includes(t)?t:""}function Jx(e,t){try{switch(t){case"string":return e;case"object":return JSON.parse(e);case"number":return parseFloat(e);case"boolean":return e==="true";default:return""}}catch(r){return""}}function Hx(e,t){try{switch(t){case"string":case"number":case"boolean":return`${e}`;case"object":return JSON.stringify(e);default:return""}}catch(r){return""}}var Ns,Z5,e3,t3,r3,VK,GK,n3,up,$x,dp=k(()=>{"use strict";rt();_e();D();vt();K();Ns=X(),Z5=Pe("getLocalStorage",{paramsSchema:E.tuple(E.string()),implement(e){return w(this,null,function*(){let{response:t}=yield te(`/api/games/user-storage/${S.mpId}`,{method:"GET",responseType:"json",appendHostCookie:!0,query:{key:e}}),{data:{code:r,message:n,data:i}}=yield t;if(r==="SUCCESS")return{code:r,message:n,data:i==null?void 0:i.value};try{let{data:{data:o,dataType:a}}=yield ye("getLocalStorageAsync",{key:e}),s=Jx(o,a);return{code:r,message:`${n}. fallback to native`,data:s}}catch(o){return{code:"INTERNAL_ERROR",message:"[Jolibox SDK] get local storage failed",data:null}}})}});Ns.registerCommand("StorageSDK.getItem",Z5);L("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});e3=Pe("setStorage",{paramsSchema:E.tuple(E.string(),E.or(E.string(),E.boolean(),E.number())),implement(e,t){return w(this,null,function*(){let r=S.mpId,n=typeof t=="string"?t:String(t),{response:i}=yield te(`/api/games/user-storage/${r}`,{method:"POST",responseType:"json",appendHostCookie:!0,data:{key:e,value:n}}),{data:{code:o,message:a}}=i,s=Bx(t),l=Hx(t,s);return yield ye("setLocalStorageAsync",{key:e,data:l,dataType:s}),o=="SUCCESS"?{code:o,message:a}:{code:o,message:`${a}. fallback to native`}})}});Ns.registerCommand("StorageSDK.setItem",e3);L("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});t3=Pe("removeStorage",{paramsSchema:E.tuple(E.string()),implement(e){return w(this,null,function*(){let t=S.mpId,{response:r}=yield te(`/api/games/user-storage/${t}/remove`,{method:"POST",responseType:"json",appendHostCookie:!0,data:{key:e}}),{data:{code:n,message:i}}=r;return yield ye("removeLocalStorageAsync",{key:e}),n==="SUCCESS"?{code:n,message:i}:{code:n,message:"[Jolibox SDK] remove item succ"}})}});Ns.registerCommand("StorageSDK.removeItem",t3);L("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});r3=Pe("clearStorage",{implement(){return w(this,null,function*(){let e=S.mpId,{response:t}=yield te(`/api/games/user-storage/${e}/clear`,{method:"POST",appendHostCookie:!0});ye("clearLocalStorageAsync");let{data:{code:r,message:n}}=t;return r==="SUCCESS"?{code:r,message:n}:{code:r,message:`${n}.fallback to native`}})}});Ns.registerCommand("StorageSDK.clear",r3);L("storage.clear",{version:"1.0.0"});VK=Pe("getStorageInfo",{implement(){return w(this,null,function*(){let{data:e}=yield ye("getStorageInfoAsync");return e})}});L("getStorageInfo",{version:"1.0.0",success:{keys:"1.0.0",currentSize:"1.0.0",limitSize:"1.0.0"}});GK=G("getStorageInfoSync",{implement(){return j("getStorageInfoSync")}}),n3=["string","number","boolean","object",""];up=Pe("getGlobalStorage",{paramsSchema:E.tuple(E.string()),implement(e){return w(this,null,function*(){try{let{data:{data:t,dataType:r}}=yield ye("getGlobalStorageAsync",{key:e});return{code:"SUCCESS",message:"success",data:Jx(t,r)}}catch(t){return{code:"INTERNAL_ERROR",message:"[Jolibox SDK] get global storage failed",data:null}}})}}),$x=Pe("setGlobalStorage",{paramsSchema:E.tuple(E.string(),E.or(E.string(),E.boolean(),E.number(),E.array())),implement(e,t){return w(this,null,function*(){try{let r=Bx(t),n=Hx(t,r);return yield ye("setGlobalStorageAsync",{key:e,data:n,dataType:r}),{code:"SUCCESS",message:"success"}}catch(r){return{code:"INTERNAL_ERROR",message:"[Jolibox SDK] set global storage failed"}}})}})});var i3,o3,a3,pp,Vx=k(()=>{"use strict";D();_e();rt();i3=G("showKeyboard",{paramsSchema:E.tuple(E.object({defaultValue:E.string().optional().default(""),multiple:E.boolean().optional().default(!1),maxLength:E.unknown().optional().default(1e5)})),implement(e){var n;let t=Math.floor((n=Number(e.maxLength))!=null?n:1e5),{defaultValue:r}=e;r&&t&&(r=r.slice(0,t)),j("showKeyboardSync",B(T({},e),{defaultValue:r,maxLength:t}))}});L("keyboard.showKeyboard",{version:"1.0.0",properties:{params:{defaultValue:"1.0.0",multiple:"1.0.0",confirmHold:"1.0.0",confirmType:"1.0.0",maxLength:"1.0.0"}},success:{errMsg:"1.0.0"}});o3=G("updateKeyboard",{paramsSchema:E.tuple(E.object({value:E.string()})),implement(e){j("updateKeyboardSync",e)}});L("keyboard.updateKeyboard",{version:"1.0.0",properties:{params:{value:"1.0.0"}}});a3=G("hideKeyboard",{implement(){j("hideKeyboardSync")}});L("keyboard.hideKeyboard",{version:"1.0.0"});pp=X();pp.registerCommand("KeyboardSDK.showKeyboard",i3);pp.registerCommand("KeyboardSDK.updateKeyboard",o3);pp.registerCommand("KeyboardSDK.hideKeyboard",a3)});var Gx=h(Ds=>{"use strict";D();rt();gt();var fp=X(),s3=Pe("levelFinished",{paramsSchema:E.tuple(E.object({levelId:E.or(E.string(),E.number()),duration:E.number().optional(),rating:E.number().optional(),score:E.number().optional(),variation:E.string().optional()})),implement:e=>w(Ds,null,function*(){let{levelId:t,duration:r,rating:n,score:i,variation:o}=e,a=[];a.push(It.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i,variation:o})),a.push(It.reporter({event:"COMPLETE_GAME_LEVEL",extraParams:{inGameInfo:{levelId:t,duration:r,rating:n,score:i}}})),yield Promise.all(a)})}),l3=Pe("gamePlayEnded",{paramsSchema:E.tuple(E.object({duration:E.number().optional(),rating:E.number().optional(),score:E.number(),variation:E.string().optional()})),implement:e=>w(Ds,null,function*(){let{duration:t,rating:r,score:n,variation:i}=e,o=[];o.push(It.tracker("GamePlayEnded",{duration:t,rating:r,score:n,variation:i})),o.push(It.reporter({event:"GAME_ENDED",extraParams:{inGameInfo:{duration:t,rating:r,score:n}}})),yield Promise.all(o)})}),c3=Pe("levelUpgrade",{paramsSchema:E.tuple(E.object({levelId:E.or(E.string(),E.number()),name:E.string().optional()})),implement:r=>w(Ds,[r],function*({levelId:e,name:t}){let n=[];n.push(It.tracker("LevelUpgrade",{name:t,levelId:e})),n.push(It.reporter({event:"GAME_LEVEL_UP",extraParams:{inGameInfo:{levelId:e,levelName:t}}})),yield Promise.all(n)})});fp.registerCommand("TaskTrackerSDK.levelFinished",s3);fp.registerCommand("TaskTrackerSDK.gamePlayEnded",l3);fp.registerCommand("TaskTrackerSDK.levelUpgrade",c3);L("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});L("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});L("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var hp,mp,vp,u3,zx,Ls=k(()=>{"use strict";K();_e();rt();D();Kr();L("login",{version:"1.0.0",properties:{force:"1.0.0"},success:{errMsg:"1.0.0",code:"1.0.0",token:"1.0.0",isLogin:"1.0.0"}});L("checkSession",{version:"1.0.0",success:{errMsg:"1.0.0"}});hp=new Map;Ze("onLoginStateChange",({isLogin:e,token:t,uuid:r,isFirstLogin:n,extra:i})=>{let o=hp.get(r);o&&(o.resolve({isLogin:e,token:t,isFirstLogin:n,extra:i}),hp.delete(r))});mp=(e,t=!1)=>w(void 0,null,function*(){var u;let{data:{isLogin:r}}=yield ye("checkLoginAsync");if(r)return{isLogin:!0,token:(u=S.hostUserInfo)==null?void 0:u.token};let{skipLogin:n,triggerFrom:i}=e!=null?e:{},o=j("loginSync",{skipLogin:n,triggerFrom:i}),{data:{uuid:a}}=o;if(!a)throw cr({code:-1,msg:"login failed"});let s=new Ct;hp.set(a,s);let l=yield s.promise;S.onEnvConfigChanged({hostUserInfo:l});let p=l,{extra:c}=p,d=je(p,["extra"]);return ne.emit("onLoginComplete",d),t?l:d}),vp=Pe("login",{paramsSchema:E.tuple(E.object({skipLogin:E.boolean().optional(),triggerFrom:E.string().optional()}).optional()),implement(e){return w(this,null,function*(){return yield mp(e!=null?e:{})})}}),u3=Pe("checkSession",{implement(){return w(this,null,function*(){let{data:{isLogin:e}}=yield ye("checkLoginAsync");return{isLogin:e}})}}),zx=X();zx.registerCommand("API.login",vp);zx.registerCommand("API.checkSession",u3)});var Wx,Kx=k(()=>{"use strict";Wx=e=>{let t=new Date,r=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),n=r+24*60*60*1e3;return e.filter(i=>i>=r&&i<n)}});function gp(e){return t=>w(this,null,function*(){var l;let{dailyMaxPopUps:r,minInterval:n}=t,i=yield up(e);if(!i.data)return{canShow:!0,isFirst:!0};let o=Qx(i.data),a=Wx(o);if(r&&a.length>=r)return{canShow:!1,isFirst:!1};let s=Date.now();return console.log("todayFrequencies",a,n,s-a[0]),n&&s-((l=a==null?void 0:a[0])!=null?l:0)<n?{canShow:!1,isFirst:!1}:{canShow:!0,isFirst:!1}})}function yp(e){return()=>w(this,null,function*(){var i;let t=Date.now(),r=yield up(e),n=Qx((i=r.data)!=null?i:"[]");n.push(t),n.sort((o,a)=>a-o).splice(8),yield $x(e,JSON.stringify(n))})}var Qx,Yx,Xx,Zx,ek,tk,rk,qs=k(()=>{"use strict";dp();Kx();Qx=e=>{let t;try{t=JSON.parse(e)}catch(r){t=[]}return t};Yx=gp("joli_coin_use_modal_frequency"),Xx=gp("joli_coin_payment_frequency"),Zx=gp("joli_coin_unlogin_modal_frequency");ek=yp("joli_coin_use_modal_frequency"),tk=yp("joli_coin_payment_frequency"),rk=yp("joli_coin_unlogin_modal_frequency")});var _p,Fs,bp=k(()=>{"use strict";vt();_p=Promise.resolve(),Fs=e=>w(void 0,null,function*(){_p=_p.then(()=>w(void 0,null,function*(){yield te("/api/joli-coin/user-config",{method:"POST",appendHostCookie:!0,data:{enableAutoDeduct:e}})})),yield _p})});var Ms,Us,At,js,Hr,wr,rr,Bs,An,d3,F,Tn,Cn,Ye=k(()=>{"use strict";D();Ms="UNLOCK_OPTIONS_CHANGED",Us="INVOKE_PAYMENT",At="ON_PAYMENT_RESULT",js="ON_USE_MODAL_EVENT",Hr="ON_USE_MODAL_RESULT",wr="ON_USE_MODAL_FREQUENCY",rr="ON_USE_UNLOGIN_MODAL_EVENT",Bs="INVOKE_UNLOGIN_MODAL_EVENT",An=new Ot,d3=()=>({on:An.on.bind(An),off:An.off.bind(An),emit:An.emit.bind(An)}),F=d3(),Tn={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}},Cn={show:!0,minInterval:8*60*60*1e3}});function nt(e,t){let r=null,n=null,i=null,o=()=>{if(i){r=Promise.resolve(i);return}r=new Promise(a=>{n=a})};return o(),e.on(t,(...a)=>{let s=a[0];i=s,n&&(n(s),n=null)}),{getData:()=>(r||o(),r),getCachedData:()=>i,clearCache:()=>{i=null,r=null},getFreshData:()=>(i=null,r=null,o(),r),updateData:a=>{if(i)return i=T(T({},i),a),r=Promise.resolve(i),n&&(n(i),n=null),i}}}var Ir=k(()=>{"use strict"});var ok=h(wp=>{"use strict";qs();bp();Ye();Ye();er();gt();D();Ir();var nk=ro(),ik=nt(F,wr);ik.getData();F.on(js,(e,t)=>w(wp,null,function*(){if(e==="ADS-JOLI_COIN"){yield nk.show({duration:3e3});let n=yield ik.getData(),{canShow:i,isFirst:o}=yield Yx(n.joliCoinUseAndCharge.useJolicoin);console.log("use modal show by frequency",i,o),nk.hide();let{balance:a}=t.userJoliCoin;if(a>=t.joliCoinQuantity&&t.enableAutoDeduct&&!o){F.emit(Hr,{useModalResult:"CONFIRM"});return}if(!i){F.emit(Hr,{useModalResult:"FAILED"});return}}M("unlock_popup_show",{eventType:J.View,targetType:"game"});let r=tx({data:{enableAutoDeduct:t.enableAutoDeduct,userJolicoin:t.userJoliCoin,joliCoinQuantity:t.joliCoinQuantity},buttons:{confirm:{text:t.confirmButtonText,onPress:()=>{M("coin_unlock_click",{targetType:"game",eventType:J.Click,coinConsume:t.joliCoinQuantity,ifAutoUnlock:t.enableAutoDeduct}),F.emit(Hr,{useModalResult:"CONFIRM"}),r.destroy()}},cancel:{text:t.cancelButtonText,onPress:({type:n})=>{n==="FAILED"&&M("ad_unlock_click",{targetType:"game",eventType:J.Click}),F.emit(Hr,{useModalResult:(n!=null?n:"")==="CANCEL"?"CANCEL":"FAILED"}),r.destroy()}},onEnableDeductChanged:n=>w(wp,null,function*(){yield Fs(n)})}});yield ek()}))});function ak(){let e=new Map;return{registerPaymentHandler(r,n){e.set(r,n)},invokePayment(r,...n){return w(this,null,function*(){let i=e.get(r);if(!i)return{code:"FAILED",message:`[joliboxSDK]: ${r} payment not supported in this platform`};try{return yield i(...n)}catch(o){return ke(o),{code:"FAILED",message:`[joliboxSDK]: paymenterror ${o}`}}})}}}var sk=k(()=>{"use strict";mt()});var Js=k(()=>{"use strict"});var p3,Pn,Sr,f3,$r,Ip=k(()=>{"use strict";Js();D();K();vt();p3=()=>{let[e,t]=[Zf,th].map(r=>(n,i,o)=>new r(n,i,o));return{createPaymentError:e,createPaymentInternalError:t}},{createPaymentError:Pn,createPaymentInternalError:Sr}=p3(),f3=S.testMode?"https://stg-game.jolibox.com":"https://game.jolibox.com",$r=class{constructor(){this._orderId=null;this._orderStatus="INIT";this.startPayment=t=>w(this,null,function*(){this._orderId&&(yield this.cancelOrder(this.orderId));let{code:r,message:n}=yield this.placeOrder(t);if(r!=="SUCCESS")throw Pn(n,1001);return yield this.pay()});this.cancelOrder=t=>w(this,null,function*(){var n,i;let{response:r}=yield te(`/api/orders/${t}/cancel`,{method:"POST",data:{}});if(r.code!=="SUCCCESS")throw Pn((i=(n=r.message)!=null?n:r.errMsg)!=null?i:"",1003)});this.generateCallbackUrl=()=>{let t=new URLSearchParams("");return t.set("utm_source",S.deviceInfo.platform),t.set("joliSource",S.encodeJoliSourceQuery(T({},this.generatePaymentContext()))),`${f3}//payment/callback?${t.toString()}`}}get orderId(){return this._orderId}get status(){return this._orderStatus}}});var Sp,ck,uk=k(()=>{"use strict";vt();Ip();Js();Sp=class extends $r{constructor(r){super();this.productId=r;this.generatePaymentContext=()=>({type:"JOLI_COIN_ORDER_CONTEXT",state:"TO_VALIDATE",productId:this.productId,orderId:this.orderId});this.pay=()=>w(this,null,function*(){let r=this.generateCallbackUrl();return console.info("callbackUrl",r),{code:"SUCCESS",message:"jolicoin payment success"}})}placeOrder(r){return w(this,null,function*(){var n,i,o,a;try{let{response:s}=yield te("/api/orders/checkout/joli-coin",{method:"POST",data:{productId:r.productId}});if(s.code!=="SUCCESS")throw Pn((i=(n=s.errMsg)!=null?n:s.message)!=null?i:"",1002);return{code:"SUCCESS",message:(o=s.message)!=null?o:"placeorder jolicoin success",data:s.data}}catch(s){throw console.info("[JoliboxSDK] placeorder failed",s),Sr((a=JSON.stringify(s))!=null?a:"jolicoin placeorder failed",1002)}})}},ck=()=>{let e=new Map;return t=>w(void 0,null,function*(){let r=e.get(t);return r||(r=new Sp(t),e.set(t,r)),yield r.startPayment({productId:t}),{code:"SUCCESS",message:"jolicoin payment success"}})}});var dk,pk=k(()=>{"use strict";dk={SUCCESS:"unlockSuccess",FAIL_NOT_LOGIN:"unlockFailedNotLogin",FAIL_PAYING:"unlockFailedPaying",FAIL_PRODUCT_EMPTY:"unlockFailedProductIdNotFound",FAIL_GET_PRODUCT_INFO:"unlockFailedProductInvalid",FAIL_LAUNCH_BILLING:"unlockFailedLaunch",FAIL_TRANSACTION:"unlockFailedTransaction",FAIL_VERIFY:"unlockFaileVerify",TRANSACTION_PENDING:"transactionPending",FAILED:"unlockFailed"}});var Ep,fk,xp,kp,h3,hk,mk=k(()=>{"use strict";vt();Ip();Js();_e();D();K();er();pk();Ep=new Map;Ze("onPaymentStateChange",e=>{console.info("onPaymentStateChange",e);let{orderUUID:t,status:r,totalAmount:n,orderResponse:i}=e,o=Ep.get(t);if(o){if(r==="SUCCESS")Jr("{slot-success} {slot-i18n-jolicoin.unlockSuccess}",{position:"center",duration:3e3}),o.resolve({code:"SUCCESS",message:"jolicoin payment success",data:{totalAmount:n}});else{if(r==="FAILED"&&zf(i==null?void 0:i.errNo)&&(i==null?void 0:i.errNo)!==0)throw Sr(`jolicoin payment failed: ${i==null?void 0:i.errMsg}`,1002);let a=dk[r];a&&Jr(`{slot-error} {slot-i18n-jolicoin.${a}}`,{position:"center",duration:3e3}),o.resolve({code:"FAILED",message:"jolicoin payment failed"})}Ep.delete(t)}});fk=e=>w(void 0,null,function*(){var n,i;let t=new Ct,r;try{let o=yield ye("requestPaymentSync",{paymentBody:{appStoreProductId:e.appStoreProductId,appAccountToken:e.appAccountToken}});if(r=(n=o.data)==null?void 0:n.orderUUID,console.info("---payInApp---",o),!r)throw Sr("orderUUID is null",1002);Ep.set(r,t)}catch(o){throw Sr((i=JSON.stringify(o))!=null?i:"jolicoin payment failed",1002)}return t.promise}),xp=class extends $r{constructor(r,n){super();this.productId=r;this.appStoreProductId=n;this.generatePaymentContext=()=>({type:"JOLI_COIN_IAP_CONTEXT",state:"TO_VALIDATE",productId:this.productId,appStoreProductId:this.appStoreProductId});this.pay=()=>w(this,null,function*(){return yield fk({appStoreProductId:this.appStoreProductId})})}placeOrder(r){return w(this,null,function*(){return{code:"SUCCESS",message:"placeorder jolicoin success in native"}})}},kp=class extends $r{constructor(r,n){super();this.productId=r;this.appStoreProductId=n;this.generatePaymentContext=()=>({type:"JOLI_COIN_IAP_CONTEXT",state:"TO_VALIDATE",productId:this.productId,appStoreProductId:this.appStoreProductId});this.pay=()=>w(this,null,function*(){return yield fk({appStoreProductId:this.appStoreProductId,appAccountToken:this.appAccountToken})})}placeOrder(r){return w(this,null,function*(){var a;console.log("----start place order for ios----");let{response:n}=yield te("/api/orders/iap-init",{method:"GET",appendHostCookie:!0}),{data:i,code:o}=n!=null?n:{};if(console.log("----iap init----",i,o),i.code!=="SUCCESS")throw Sr("iap-init failed",1002);return this.appAccountToken=(a=i==null?void 0:i.data)==null?void 0:a.iapToken,{code:"SUCCESS",message:"placeorder jolicoin success in native"}})}},h3={android:xp,ios:kp},hk=()=>{let e=new Map;return t=>w(void 0,null,function*(){let{productId:r,appStoreProductId:n}=t,i=e.get(r);if(!i){let s=h3[S.platform];if(!s)throw Sr("platform not supported",1002);i=new s(r,n),e.set(r,i)}let{code:o,message:a}=yield i.startPayment({productId:r,appStoreProductId:n});if(o!=="SUCCESS")throw Pn(a,1002);return{code:"SUCCESS",message:"jolicoin payment success"}})}});var Hs,vk=k(()=>{"use strict";sk();uk();mk();Hs=ak();Hs.registerPaymentHandler("JOLI_COIN",ck());Hs.registerPaymentHandler("JOLI_COIN_IAP",hk())});var yk=h(no=>{"use strict";Ye();er();vt();K();Ls();D();qs();vk();er();rt();_e();D();gt();bp();Ir();var On=ro(),m3=nt(F,wr);F.on(Us,(e,t)=>w(no,null,function*(){var r,n;try{if(!Px("requestPaymentSync:paymentBody:appStoreProductId")){console.info("requestPaymentSync:paymentBody:appStoreProductId not supported"),setTimeout(()=>{F.emit(At,{paymentResult:"FAILED"})},0);return}if(e==="ADS-JOLI_COIN"){yield On.show({duration:3e3});let a=yield m3.getData(),{canShow:s}=yield Xx(a.joliCoinUseAndCharge.charge);if(console.log("use payment show by frequency",s),On.hide(),!s){F.emit(At,{paymentResult:"FAILED"});return}console.log("show by frequency")}yield On.show({duration:3e3});let i=yield gk();if(On.hide(),!i){F.emit(At,{paymentResult:"FAILED"});return}M("coinorder_show",{targetType:"game",eventType:J.View});let o=rx({data:{userJolicoin:t.userJoliCoin,joliCoinQuantity:t.joliCoinQuantity,paymentChoices:(n=(r=i.paymentChoices)==null?void 0:r.map(a=>{var s;return B(T({},a),{totalAmountStr:(s=a.totalAmountStr)!=null?s:""})}))!=null?n:[],enableAutoDeduct:i.enableAutoDeduct},buttons:{confirm:{text:t.confirmButtonText,onPress:a=>w(no,null,function*(){var c,d,u,p,f,m,g,_;if(M("order_pay_ensure",{targetType:"game",eventType:J.Click,payWay:"app_iap",coinAmount:t.joliCoinQuantity,orderPrice:(d=(c=i.paymentChoices.find(v=>v.productId===a))==null?void 0:c.totalAmountStr)!=null?d:""}),!((u=S.hostUserInfo)!=null&&u.isLogin)){let{data:v}=yield vp({skipLogin:!0});if(!(v!=null&&v.isLogin)){console.log("login failed");return}let b=yield gk();if(((p=b==null?void 0:b.balance)!=null?p:0)>=t.joliCoinQuantity){F.emit(At,{paymentResult:"SUCCESS"}),o.destroy();return}}console.log("invokeNativePayment",a);let s=(m=(f=i==null?void 0:i.paymentChoices)==null?void 0:f.find(v=>v.productId===a))==null?void 0:m.appStoreProductId;if(!s){F.emit(At,{paymentResult:"FAILED"}),o.destroy();return}yield On.show({duration:3e3});let{code:l}=yield Hs.invokePayment("JOLI_COIN_IAP",{productId:a,appStoreProductId:s});if(On.hide(),M("order_pay_result",{eventType:J.Other,targetType:"game",payWay:"app_iap",coinAmount:t.joliCoinQuantity,orderPrice:(_=(g=i.paymentChoices.find(v=>v.productId===a))==null?void 0:g.totalAmountStr)!=null?_:"",payResult:l}),l!=="SUCCESS"){console.info("[JoliboxSDK] payment failed in payment.invokePaymet");return}F.emit(At,{paymentResult:"SUCCESS"}),o.destroy()})},cancel:{text:t.cancelButtonText,onPress:({type:a})=>{F.emit(At,{paymentResult:(a!=null?a:"")==="CANCEL"?"CANCEL":"FAILED"}),M("ad_unlock_click",{targetType:"game",eventType:J.Click}),o.destroy()}},onEnableDeductChanged:a=>w(no,null,function*(){yield Fs(a)})},onSelect:a=>{var s,l;M("coinorder_click",{targetType:"game",eventType:J.Click,coinAmount:t.joliCoinQuantity,orderPrice:(l=(s=i.paymentChoices.find(c=>c.productId===a))==null?void 0:s.totalAmountStr)!=null?l:""})}});yield tk()}catch(i){console.info("payment failed",i),F.emit(At,{paymentResult:"FAILED"})}}));var v3=(e,t)=>{Object.keys(t).forEach(r=>{let n=e.paymentChoices.find(i=>i.appStoreProductId===r);n&&(n.totalAmountStr=t[r].price)}),e.paymentChoices=e.paymentChoices.filter(r=>!Hl(r.totalAmountStr))},gk=()=>w(no,null,function*(){var r,n,i,o,a,s,l,c,d,u;let{response:e}=yield te("/api/joli-coin/balance-detail",{method:"GET",appendHostCookie:!0,responseType:"json"});console.info("getBalenceDetails",e);let{data:t}=yield ye("requestProductDetailsAsync",{appStoreProductIds:(o=(i=(n=(r=e.data)==null?void 0:r.data)==null?void 0:n.paymentChoices)==null?void 0:i.filter(p=>typeof p.appStoreProductId=="string").map(p=>p.appStoreProductId))!=null?o:[]});if((a=e.data)!=null&&a.data&&t&&v3((s=e.data)==null?void 0:s.data,t),console.info("productDetails",(l=e.data)==null?void 0:l.data),((d=(c=e.data)==null?void 0:c.data)==null?void 0:d.paymentChoices.length)===0)throw new Error("paymentChoices is empty");return(u=e.data)==null?void 0:u.data})});var bk=h($s=>{"use strict";Ye();Ir();qs();vt();mt();D();Ls();er();gt();var _k=nt(F,wr);_k.getData();F.on(Bs,(e,t)=>w($s,null,function*(){var r;try{if(e==="ADS-JOLI_COIN"){let o=yield _k.getData();if(console.log("unlogin guide config",o.loginGuide),!o.loginGuide.show){F.emit(rr,{result:"NOT_SUPPORT"});return}let{canShow:a}=yield Zx(o.loginGuide);if(console.log("canShowUseModal",a),!a){F.emit(rr,{result:"FAILED"});return}}let{firstLogin:n}=(r=yield g3())!=null?r:{};if(!(n!=null&&n.reward)){console.log("[JoliboxSDK] unlogin modal reward is empty"),F.emit(rr,{result:"NOT_SUPPORT"});return}M("LoginGuideModal",{eventType:J.Expose},J.Expose);let i=nx({data:{rewardType:e,rewardValue:n.reward.rewardValue},buttons:{confirm:{text:t.confirmButtonText,onPress:()=>w($s,null,function*(){var l,c,d,u;M("LoginGuideModal",{type:"click_confirm",eventType:J.Click},J.Click);let{isLogin:o,extra:a,isFirstLogin:s}=yield mp({},!0);if(!o){console.log("login failed");return}if(M("LoginGuideModal",{type:"click_confirm_login",isFirstLogin:s,eventType:J.Click},J.Click),s&&((l=a==null?void 0:a.firstLogin)!=null&&l.reward)){let{rewardValue:p}=a.firstLogin.reward;Jr("{slot-i18ntran-loginGuide.rewardTips}",{i18nParams:{text:"Jolicoin Used",coin:p},position:"top",duration:3e3})}F.emit(rr,{result:"SUCCESS",rewards:{jolicoin:{claimedRewardValue:(u=(d=(c=a==null?void 0:a.firstLogin)==null?void 0:c.reward)==null?void 0:d.rewardValue)!=null?u:0,isFirstLogin:s!=null?s:!1}}}),i.destroy()})},cancel:{text:t.cancelButtonText,onPress:({type:o})=>{M("LoginGuideModal",{eventType:J.Hide},J.Hide),M("LoginGuideModal",{type:o==="CANCEL"?"click_close":"click_watch_ads",eventType:J.Click},J.Click),F.emit(rr,{result:"FAILED"}),i.destroy()}}}});yield rk()}catch(n){ke(new rh(n)),F.emit(rr,{result:"FAILED"})}}));var g3=()=>w($s,null,function*(){var t;let{response:e}=yield te("/api/base/global-config",{method:"GET",appendHostCookie:!0,responseType:"json"});return(t=e.data)==null?void 0:t.data})});var zY,WY,KY,wk=k(()=>{"use strict";zY=ie(ok()),WY=ie(yk()),KY=ie(bk())});function C3(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function P3(e){return typeof e=="string"}function O3(e){return typeof e=="undefined"}function R3(e){return O3(e)||e===null}function N3(e){return typeof e=="function"}function Kk(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 io(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}function Ws(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 j3(e){let t=e.location?Ws(e.location,Ak):null,r=e.target?Ws(e.target,Ak):null;return Ws(k3(x3({},e),{location:t,target:r}),M3)}function B3(e){let t=e.events.map(n=>j3(n)),r=Ws(e.device,U3);return[e.protocolVersion,t,r,e.project]}function J3(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function z3(e){return new Promise(t=>Zk(e)(t))}function Zk(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 W3(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new co(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 Q3(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Y3(e[n],t[n])}function Y3(e,t){if(P3(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(N3(t)){try{if(e instanceof t)return}catch(r){}if(!R3(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 it(e,t,r){return(t=X3(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X3(e){var t=Z3(e,"string");return typeof t=="symbol"?t:t+""}function Z3(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 Vs(e,t,r){return(t=e4(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function e4(e){var t=t4(e,"string");return typeof t=="symbol"?t:t+""}function t4(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 Gs(e,t,r){return(t=r4(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r4(e){var t=n4(e,"string");return typeof t=="symbol"?t:t+""}function n4(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 nr(e,t,r){return(t=i4(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i4(e){var t=o4(e,"string");return typeof t=="symbol"?t:t+""}function o4(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 a4(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 s4(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 f4(e,t){return Me(e,0)^45?(((t<<2^Me(e,0))<<2^Me(e,1))<<2^Me(e,2))<<2^Me(e,3):0}function rA(e){return e.trim()}function h4(e,t){return(e=t.exec(e))?e[0]:e}function W(e,t,r){return e.replace(t,r)}function Bp(e,t){return e.indexOf(t)}function Me(e,t){return e.charCodeAt(t)|0}function uo(e,t,r){return e.slice(t,r)}function Jt(e){return e.length}function nf(e){return e.length}function zs(e,t){return t.push(e),e}function m4(e,t){return e.map(t).join("")}function ll(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:sl,column:Fn,length:a,return:""}}function ao(e,t){return p4(ll("",null,null,"",null,null,0),e,{length:-e.length},t)}function v4(){return xe}function g4(){return xe=st>0?Me(Mn,--st):0,Fn--,xe===10&&(Fn=1,sl--),xe}function ft(){return xe=st<nA?Me(Mn,st++):0,Fn++,xe===10&&(Fn=1,sl++),xe}function Ht(){return Me(Mn,st)}function Ks(){return st}function fo(e,t){return uo(Mn,e,t)}function po(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 iA(e){return sl=Fn=1,nA=Jt(Mn=e),st=0,[]}function oA(e){return Mn="",e}function Qs(e){return rA(fo(st-1,Jp(e===91?e+2:e===40?e+1:e)))}function y4(e){for(;(xe=Ht())&&xe<33;)ft();return po(e)>2||po(xe)>3?"":" "}function _4(e,t){for(;--t&&ft()&&!(xe<48||xe>102||xe>57&&xe<65||xe>70&&xe<97););return fo(e,Ks()+(t<6&&Ht()==32&&ft()==32))}function Jp(e){for(;ft();)switch(xe){case e:return st;case 34:case 39:e!==34&&e!==39&&Jp(xe);break;case 40:e===41&&Jp(e);break;case 92:ft();break}return st}function b4(e,t){for(;ft()&&e+xe!==57&&!(e+xe===84&&Ht()===47););return"/*"+fo(t,st-1)+"*"+al(e===47?e:ft())}function w4(e){for(;!po(Ht());)ft();return fo(e,st)}function I4(e){return oA(Ys("",null,null,null,[""],e=iA(e),0,[0],e))}function Ys(e,t,r,n,i,o,a,s,l){for(var c=0,d=0,u=a,p=0,f=0,m=0,g=1,_=1,v=1,b=0,I="",A=i,P=o,O=n,x=I;_;)switch(m=b,b=ft()){case 40:if(m!=108&&Me(x,u-1)==58){Bp(x+=W(Qs(b),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:x+=Qs(b);break;case 9:case 10:case 13:case 32:x+=y4(m);break;case 92:x+=_4(Ks()-1,7);continue;case 47:switch(Ht()){case 42:case 47:zs(S4(b4(ft(),Ks()),t,r),l);break;default:x+="/"}break;case 123*g:s[c++]=Jt(x)*v;case 125*g:case 59:case 0:switch(b){case 0:case 125:_=0;case 59+d:v==-1&&(x=W(x,/\f/g,"")),f>0&&Jt(x)-u&&zs(f>32?Ok(x+";",n,r,u-1):Ok(W(x," ","")+";",n,r,u-2),l);break;case 59:x+=";";default:if(zs(O=Pk(x,t,r,c,d,i,s,I,A=[],P=[],u),o),b===123)if(d===0)Ys(x,t,O,O,A,o,u,s,P);else switch(p===99&&Me(x,3)===110?100:p){case 100:case 108:case 109:case 115:Ys(e,O,O,n&&zs(Pk(e,O,O,0,0,i,s,I,i,A=[],u),P),i,P,u,s,n?A:P);break;default:Ys(x,O,O,O,[""],P,0,s,P)}}c=d=f=0,g=v=1,I=x="",u=a;break;case 58:u=1+Jt(x),f=m;default:if(g<1){if(b==123)--g;else if(b==125&&g++==0&&g4()==125)continue}switch(x+=al(b),b*g){case 38:v=d>0?1:(x+="\f",-1);break;case 44:s[c++]=(Jt(x)-1)*v,v=1;break;case 64:Ht()===45&&(x+=Qs(ft())),p=Ht(),d=u=Jt(I=x+=w4(Ks())),b++;break;case 45:m===45&&Jt(x)==2&&(g=0)}}return o}function Pk(e,t,r,n,i,o,a,s,l,c,d){for(var u=i-1,p=i===0?o:[""],f=nf(p),m=0,g=0,_=0;m<n;++m)for(var v=0,b=uo(e,u+1,u=d4(g=a[m])),I=e;v<f;++v)(I=rA(g>0?p[v]+" "+b:W(b,/&\f/g,p[v])))&&(l[_++]=I);return ll(e,t,r,i===0?tf:s,l,c,d)}function S4(e,t,r){return ll(e,t,r,eA,al(v4()),uo(e,2,-2),0)}function Ok(e,t,r,n){return ll(e,t,r,rf,uo(e,0,n),uo(e,n+1,-1),n)}function qn(e,t){for(var r="",n=nf(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function E4(e,t,r,n){switch(e.type){case u4:if(e.children.length)break;case c4:case rf:return e.return=e.return||e.value;case eA:return"";case tA:return e.return=e.value+"{"+qn(e.children,n)+"}";case tf:e.value=e.props.join(",")}return Jt(r=qn(e.children,n))?e.return=e.value+"{"+r+"}":""}function x4(e){var t=nf(e);return function(r,n,i,o){for(var a="",s=0;s<t;s++)a+=e[s](r,n,i,o)||"";return a}}function k4(e){return function(t){t.root||(t=t.return)&&e(t)}}function A4(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}function aA(e,t){switch(f4(e,t)){case 5103:return z+"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 z+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return z+e+el+e+Ge+e+e;case 6828:case 4268:return z+e+Ge+e+e;case 6165:return z+e+Ge+"flex-"+e+e;case 5187:return z+e+W(e,/(\w+).+(:[^]+)/,z+"box-$1$2"+Ge+"flex-$1$2")+e;case 5443:return z+e+Ge+"flex-item-"+W(e,/flex-|-self/,"")+e;case 4675:return z+e+Ge+"flex-line-pack"+W(e,/align-content|flex-|-self/,"")+e;case 5548:return z+e+Ge+W(e,"shrink","negative")+e;case 5292:return z+e+Ge+W(e,"basis","preferred-size")+e;case 6060:return z+"box-"+W(e,"-grow","")+z+e+Ge+W(e,"grow","positive")+e;case 4554:return z+W(e,/([^-])(transform)/g,"$1"+z+"$2")+e;case 6187:return W(W(W(e,/(zoom-|grab)/,z+"$1"),/(image-set)/,z+"$1"),e,"")+e;case 5495:case 3959:return W(e,/(image-set\([^]*)/,z+"$1$`$1");case 4968:return W(W(e,/(.+:)(flex-)?(.*)/,z+"box-pack:$3"+Ge+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+z+e+e;case 4095:case 3583:case 4068:case 2532:return W(e,/(.+)-inline(.+)/,z+"$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(Jt(e)-1-t>6)switch(Me(e,t+1)){case 109:if(Me(e,t+4)!==45)break;case 102:return W(e,/(.+:)(.+)-([^]+)/,"$1"+z+"$2-$3$1"+el+(Me(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Bp(e,"stretch")?aA(W(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Me(e,t+1)!==115)break;case 6444:switch(Me(e,Jt(e)-3-(~Bp(e,"!important")&&10))){case 107:return W(e,":",":"+z)+e;case 101:return W(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+z+(Me(e,14)===45?"inline-":"")+"box$3$1"+z+"$2$3$1"+Ge+"$2box$3")+e}break;case 5936:switch(Me(e,t+11)){case 114:return z+e+Ge+W(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return z+e+Ge+W(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return z+e+Ge+W(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return z+e+Ge+e+e}return e}function q4(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 tl(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 Er={name:i.name,styles:i.styles,next:Er},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)Er={name:a.name,styles:a.styles,next:Er},a=a.next;var s=o.styles+";";return s}return j4(e,t,r)}}var l=r;if(t==null)return l;var c=t[l];return c!==void 0?c:l}function j4(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=tl(e,t,r[i])+";";else for(var o in r){var a=r[o];if(typeof a!="object"){var s=a;t!=null&&t[s]!==void 0?n+=o+"{"+t[s]+"}":Nk(s)&&(n+=Tp(o)+":"+Dk(o,s)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var l=0;l<a.length;l++)Nk(a[l])&&(n+=Tp(o)+":"+Dk(o,a[l])+";");else{var c=tl(e,t,a);switch(o){case"animation":case"animationName":{n+=Tp(o)+":"+c+";";break}default:n+=o+"{"+c+"}"}}}return n}function Cp(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="";Er=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=tl(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=tl(r,t,e[s]),n){var l=o;i+=l[s]}Lk.lastIndex=0;for(var c="",d;(d=Lk.exec(i))!==null;)c+="-"+d[1];var u=q4(i)+c;return{name:u,styles:i,next:Er}}function lA(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}function qk(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function Fk(e,t,r){var n=[],i=lA(e,n,r);return n.length<2?r:i+t(n)}function G4(e,t){Oe.__h&&Oe.__h(pt,e,Uk||t),Uk=0;var r=pt.__H||(pt.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function uA(e,t){var r=G4(Hp++,7);return K4(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function z4(){for(var e;e=cA.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Xs),e.__H.__h.forEach($p),e.__H.__h=[]}catch(t){e.__H.__h=[],Oe.__e(t,e.__v)}}function W4(e){var t,r=function(){clearTimeout(n),Gk&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Gk&&(t=requestAnimationFrame(r))}function Xs(e){var t=pt,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),pt=t}function $p(e){var t=pt;e.__c=e.__(),pt=t}function K4(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function cl(){if(xr>1)xr--;else{for(var e,t=!1;so!==void 0;){var r=so;for(so=void 0,Vp++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&pA(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(Vp=0,xr--,t)throw e}}function at(e){if(xr>0)return e();xr++;try{return e()}finally{cl()}}function dA(e){if(ee!==void 0){var t=e.n;if(t===void 0||t.t!==ee)return t={i:0,S:e,p:ee.s,n:void 0,t:ee,e:void 0,x:void 0,r:t},ee.s!==void 0&&(ee.s.n=t),ee.s=t,e.n=t,32&ee.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=ee.s,t.n=void 0,ee.s.n=t,ee.s=t),t}}function Ue(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function re(e){return new Ue(e)}function pA(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 fA(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 hA(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 jn(e){Ue.call(this,void 0),this.x=e,this.s=void 0,this.g=rl-1,this.f=4}function lo(e){return new jn(e)}function mA(e){var t=e.u;if(e.u=void 0,typeof t=="function"){xr++;var r=ee;ee=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,of(e),n}finally{ee=r,cl()}}}function of(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,mA(e)}function Y4(e){if(ee!==this)throw new Error("Out-of-order effect");hA(this),ee=e,this.f&=-2,8&this.f&&of(this),cl()}function ho(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function mo(e){var t=new ho(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}function Bn(e,t){R[e]=t.bind(null,R[e]||function(){})}function nl(e){Op&&Op(),Op=e&&e.S()}function yA(e){var t=this,r=e.data,n=_A(r);n.value=r;var i=uA(function(){for(var s=t,l=t.__v;l=l.__;)if(l.__c){l.__c.__$f|=4;break}var c=lo(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),d=lo(function(){return!Array.isArray(c.value)&&!uc(c.value)}),u=mo(function(){if(this.N=bA,d.value){var f=c.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),p=t.__$u.d;return t.__$u.d=function(){u(),p.call(this)},[d,c]},[]),o=i[0],a=i[1];return o.value?a.peek():a.value}function X4(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=re(r);return{o:function(a,s){o.value=a,n=s},d:mo(function(){this.N=bA;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}function _A(e){return uA(function(){return re(e)},[])}function eH(){at(function(){for(var e;e=gA.shift();)vA.call(e)})}function bA(){gA.push(this)===1&&(R.requestAnimationFrame||Z4)(eH)}function tH(e,t){let r=xi(e);ln(()=>{r.current=e},[e]),Ei(()=>{if(t===null)return;let n=setInterval(()=>{r.current()},t);return()=>{clearInterval(n)}},[t])}function ge(e,t,r,n,i,o){t||(t={});var a,s,l=t;if("ref"in l)for(s in l={},t)s=="ref"?a=t[s]:l[s]=t[s];var c={type:e,props:l,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--rH,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return R.vnode&&R.vnode(c),c}function ir(e,t,r){return(t=hH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hH(e){var t=mH(e,"string");return typeof t=="symbol"?t:t+""}function mH(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 or(e,t,r){return(t=_H(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _H(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)}function Ve(e,t,r){return(t=wH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wH(e){var t=IH(e,"string");return typeof t=="symbol"?t:t+""}function IH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ot(e,t,r){return(t=SH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SH(e){var t=EH(e,"string");return typeof t=="symbol"?t:t+""}function EH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vr(e,t,r){return(t=xH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xH(e){var t=kH(e,"string");return typeof t=="symbol"?t:t+""}function kH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rp(e,t,r){return(t=AH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AH(e){var t=TH(e,"string");return typeof t=="symbol"?t:t+""}function TH(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 Xe(e,t,r){return(t=CH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CH(e){var t=PH(e,"string");return typeof t=="symbol"?t:t+""}function PH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tt(e,t,r){return(t=OH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OH(e){var t=RH(e,"string");return typeof t=="symbol"?t:t+""}function RH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ik,y3,_3,b3,zk,w3,I3,Sk,S3,E3,Ek,x3,k3,A3,Wk,T3,D3,L3,xk,q3,kk,F3,Qk,Yk,Xk,Ak,M3,U3,Dn,Tk,Np,ue,H3,$3,oo,co,V3,Lp,G3,Ap,K3,qp,Ck,Rn,Fp,Mp,Up,jp,l4,Ge,el,z,eA,tf,rf,c4,tA,u4,d4,al,p4,sl,Fn,nA,st,xe,Mn,T4,C4,P4,Rk,O4,R4,N4,D4,L4,F4,M4,U4,sA,Nk,Tp,Dk,Lk,Er,B4,J4,H4,$4,V4,Un,Hp,pt,Pp,Mk,Uk,cA,Oe,jk,Bk,Jk,Hk,$k,Vk,Gk,Q4,ee,so,xr,Vp,rl,vA,Op,gA,Z4,ze,rH,nH,ar,Gp,zp,Zs,iH,oH,aH,sH,lH,cH,uH,dH,pH,fH,Wp,Ln,Nn,vH,gH,yH,Kp,wA,Qp,Yp,Xp,Zp,il,ef,ol,XY,IA=k(()=>{"use strict";Yr();ra();Ik=Object.getOwnPropertySymbols,y3=Object.prototype.hasOwnProperty,_3=Object.prototype.propertyIsEnumerable,b3=(e,t)=>{var r={};for(var n in e)y3.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ik)for(var n of Ik(e))t.indexOf(n)<0&&_3.call(e,n)&&(r[n]=e[n]);return r},zk=Object.defineProperty,w3=Object.defineProperties,I3=Object.getOwnPropertyDescriptors,Sk=Object.getOwnPropertySymbols,S3=Object.prototype.hasOwnProperty,E3=Object.prototype.propertyIsEnumerable,Ek=(e,t,r)=>t in e?zk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x3=(e,t)=>{for(var r in t||(t={}))S3.call(t,r)&&Ek(e,r,t[r]);if(Sk)for(var r of Sk(t))E3.call(t,r)&&Ek(e,r,t[r]);return e},k3=(e,t)=>w3(e,I3(t)),A3=(e,t)=>{for(var r in t)zk(e,r,{get:t[r],enumerable:!0})},Wk=(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},T3=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}D3=(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))(D3||{});L3={log:io("log"),warn:io("warn"),info:io("info"),error:io("error"),debug:io("debug")};Object.assign(globalThis,{logger:L3});xk=Symbol.for("Jolibox.canIUseMap"),q3={};globalThis[xk]||(globalThis[xk]=q3);kk=Symbol.for("Jolibox.canIUseMap.native"),F3={};globalThis[kk]||(globalThis[kk]=F3);Qk=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Qk||{}),Yk=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Yk||{}),Xk=(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))(Xk||{}),Ak=["name","params"],M3=["name","type","location","target","extra","timestamp","userId"],U3=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];J3();Dn=typeof window=="undefined",Tk=()=>!Dn&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");!Dn&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),!Dn&&navigator.userAgent.includes("Android"),!Dn&&navigator.userAgent.includes("Mac"),!Dn&&navigator.userAgent.includes("FB_IAB"),!Dn&&!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");Np=class Dp{constructor(t){this.element=t,this.next=Dp.Undefined,this.prev=Dp.Undefined}};Np.Undefined=new Np(void 0);ue=Np,H3=class{constructor(){this._first=ue.Undefined,this._last=ue.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ue.Undefined}clear(){let e=this._first;for(;e!==ue.Undefined;){let t=e.next;e.prev=ue.Undefined,e.next=ue.Undefined,e=t}this._first=ue.Undefined,this._last=ue.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new ue(e);if(this._first===ue.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!==ue.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ue.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ue.Undefined&&e.next!==ue.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ue.Undefined&&e.next===ue.Undefined?(this._first=ue.Undefined,this._last=ue.Undefined):e.next===ue.Undefined?(this._last=this._last.prev,this._last.next=ue.Undefined):e.prev===ue.Undefined&&(this._first=this._first.next,this._first.prev=ue.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ue.Undefined;)yield e.element,e=e.next}},$3=0,oo=class{constructor(e){this.value=e,this.id=$3++}},co=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 oo&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){return this._event!=null||(this._event=(e,t)=>{var r,n,i,o,a,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let l=new oo(e);return this._listeners?this._listeners instanceof oo?this._listeners=[this._listeners,l]:this._listeners.push(l):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=l,(o=(i=this.options)==null?void 0:i.onDidFirstListener)==null||o.call(i,this)),(s=(a=this.options)==null?void 0:a.onDidAddListener)==null||s.call(a,this),this._size++,()=>{var c,d,u,p;if(!this._disposed){if(this._listeners instanceof oo)this._listeners.id===l.id&&(this._listeners=void 0,this._size=0,(d=(c=this.options)==null?void 0:c.onDidRemoveLastListener)==null||d.call(c));else if(this._listeners){let f=this._listeners.indexOf(l);f>=0&&(this._listeners.splice(f,1),this._size--,this._size===0&&((p=(u=this.options)==null?void 0:u.onDidRemoveLastListener)==null||p.call(u)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof oo?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},V3=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;var n;let i=(n=this.listeners.get(e))!=null?n:new co,o=l=>t(...l.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e){let t=this.listeners.get(e),r=this.cachedEventQueue.get(e);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r||(r=new H3,this.cachedEventQueue.set(e,r)),r.push({args:i}),t&&t.fire({event:e,args:i})}once(e,t){var r=this;let n=function(){t(...arguments),r.off(e,n)};this.on(e,n,!1)}},Lp={};A3(Lp,{None:()=>G3,filter:()=>W3,once:()=>Zk,toPromise:()=>z3});G3=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Ap=Symbol.for("Jolibox.hostEmitter"),K3=()=>{let e=new V3;return globalThis[Ap]||(globalThis[Ap]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Ap]};K3();qp=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new co,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 Q3(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}};qp=Wk([Kk],qp);Ck=class{constructor(){this._onWillExecuteCommand=new co,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new co,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new qp,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=C3(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 T3(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),Lp.toPromise(Lp.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{}}};Ck=Wk([Kk],Ck);Rn=e=>e?function(){try{for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e==null||e(...r)}catch(i){console.error("Error calling function",i)}}:()=>{console.log("wrapUserFunction: fn is undefined")},Fp=class{constructor(t){it(this,"context",void 0),it(this,"continueCallback",void 0),it(this,"adIsShowingCallback",void 0),it(this,"isBeforeAdCalled",!1),it(this,"isBeforeRewardCalled",!1),it(this,"isAdDismissedCalled",!1),it(this,"isAdViewedCalled",!1),it(this,"isAfterAdCalled",!1),it(this,"currentProvider",void 0),it(this,"currentClientParams",void 0),it(this,"adsHasResponse",!1),it(this,"videoChecker",window.document.createElement("video")),it(this,"contextInfo",void 0),it(this,"wrapShowAdFn",r=>()=>{var n,i,o;this.adsHasResponse=!0;let a=!1;this.videoChecker.play().catch(()=>{a=!1}),a=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:a},this.paramsToTrack)),Tk()&&this.context.track("mmp_ad_impression",{ad_network:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:"",ad_format:"rewarded",module:"game",game_id:this.contextInfo.objectId}),(o=this.adIsShowingCallback)==null||o.call(this,!0);let s=Rn(r);s==null||s()}),this.context=t,this.contextInfo=t.getContextInfo()}get paramsToTrack(){var t,r,n,i,o,a;return{provider:(r=(t=this.currentProvider)==null?void 0:t.name)!=null?r:null,type:(n=this.currentClientParams)==null?void 0:n.type,name:((i=this.currentClientParams)==null?void 0:i.type)==="preroll"?null:(a=(o=this.currentClientParams)==null?void 0:o.name)!=null?a:""}}wrapBeforeAd(t){return()=>{var r,n,i,o;if(this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),!this.isBeforeAdCalled){this.isBeforeAdCalled=!0;let a=Rn(t);a==null||a(),((r=this.currentClientParams)==null?void 0:r.type)!=="reward"&&((n=this.adIsShowingCallback)==null||n.call(this,!0),Tk()&&this.context.track("mmp_ad_impression",{ad_network:(o=(i=this.currentProvider)==null?void 0:i.name)!=null?o:"",ad_format:"interstitial",module:"game",game_id:this.contextInfo.objectId}))}}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdDismissedCalled){this.isAdDismissedCalled=!0;let r=Rn(t);r==null||r()}}}wrapAdViewed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdViewedCalled){this.isAdViewedCalled=!0;let r=Rn(t);r==null||r()}}}wrapAfterAd(t){return()=>{if(this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),!this.isAfterAdCalled){this.isAfterAdCalled=!0;let r=Rn(t);r==null||r()}}}wrapAdBreakDone(t){return r=>{var n,i,o,a,s,l;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:null,breakType:r.breakType,breakName:(o=r.breakName)!=null?o:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{let c=Rn(t);c==null||c(r),(a=this.adIsShowingCallback)==null||a.call(this,!1),(s=this.continueCallback)==null||s.call(this,[!1,r]);break}default:{(l=this.continueCallback)==null||l.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n,i){return w(this,null,function*(){return this.currentProvider=t,this.currentClientParams=r,this.adsHasResponse=!1,new Promise(o=>{this.continueCallback=o,this.adIsShowingCallback=i;let a;switch(r.type){case"preroll":{a={type:r.type,adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}case"reward":{a={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),beforeReward:this.wrapBeforeReward(r.beforeReward),adDismissed:this.wrapAdDismissed(r.adDismissed),adViewed:this.wrapAdViewed(r.adViewed),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}default:{a={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}}window.setTimeout(()=>{var s,l,c,d,u;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(l=(s=this.currentProvider)==null?void 0:s.name)!=null?l:null}),(d=this.continueCallback)==null||d.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(c=r.name)!=null?c:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(u=this.adIsShowingCallback)==null||u.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(a,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};Mp=class{constructor(t){Vs(this,"context",void 0),Vs(this,"adBreakIsShowing",!1),Vs(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),Vs(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()})}};Up=class{constructor(t){Gs(this,"configs",null),Gs(this,"firstRun",!0),Gs(this,"context",void 0),Gs(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return w(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}};jp=class{constructor(t,r){nr(this,"name","ADSENSE"),nr(this,"context",void 0),nr(this,"contextInfo",void 0),nr(this,"configured",!1),nr(this,"initParams",void 0),nr(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),nr(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=b3(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),nr(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),nr(this,"adUnit",n=>w(this,null,function*(){var i,o,a,s;if(this.context.track("CallAdUnit",{adFormat:(o=(i=n.adFormat)==null?void 0:i.toString())!=null?o:null,fullWidthResponsive:(a=n.fullWidthResponsive)!=null?a:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:l,slot:c,adFormat:d,fullWidthResponsive:u,style:p}=n,f;if(!l)throw new Error("targeting element is required");if(typeof l=="string"?f=document.querySelector(l):f=l,!f)throw new Error("targeting element not found");let m=c;if(m||(m=this.initParams.unitId),!m)throw new Error("slot is required");let g=typeof d=="object"&&Array.isArray(d)?d.join(", "):d,_=document.createElement("ins");if(_.className="adsbygoogle",_.id="jolibox-ads",_.style.display="block",_.setAttribute("data-ad-client",this.initParams.clientId),_.setAttribute("data-ad-slot",m),g&&_.setAttribute("data-ad-format",g),u&&_.setAttribute("data-full-width-responsive",u),p&&_.setAttribute("style",p),(s=this.contextInfo.testAdsMode)!=null?s:!1){let v=document.createElement("div");v.style.position="absolute",v.style.top="0",v.style.left="0",v.style.width="100%",v.style.height="100%",v.style.display="flex",v.style.justifyContent="center",v.style.alignItems="center",v.style.backgroundColor="rgba(0, 0, 0, 0.5)",v.style.color="white",v.innerHTML="Test Ad",_.style.position="relative",f.appendChild(_),_.appendChild(v)}else f.appendChild(_),new MutationObserver(v=>{v.forEach(b=>{if(b.type==="attributes"&&b.attributeName==="data-ad-status"){let I=_.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:I!=null?I:"null"})}})}).observe(_,{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 w(this,null,function*(){var t;if(this.context.track("CallAdsInit",{provider:this.name}),typeof window=="undefined")return;let r="google-adsense",n=(t=this.contextInfo.testAdsMode)!=null?t:!1;if(!document.getElementById(r)&&this.initParams.clientId){let i=document.createElement("script");i.id=r,i.async=!0,i.crossOrigin="anonymous",i.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,n&&i.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&i.setAttribute("data-ad-channel",this.initParams.channelId),this.initParams.admobInterstitialSlot&&i.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),this.initParams.admobRewardedSlot&&i.setAttribute("data-admob-rewarded-slot",this.initParams.admobRewardedSlot),this.initParams.admobOnly&&i.setAttribute("data-admob-ads-only","on"),document.head.appendChild(i),this.context.track("LoadAdsenseCompleted",null)}})}};l4=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(s4(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=a4(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}(),Ge="-ms-",el="-moz-",z="-webkit-",eA="comm",tf="rule",rf="decl",c4="@import",tA="@keyframes",u4="@layer",d4=Math.abs,al=String.fromCharCode,p4=Object.assign;sl=1,Fn=1,nA=0,st=0,xe=0,Mn="";T4=function(e,t,r){for(var n=0,i=0;n=i,i=Ht(),n===38&&i===12&&(t[r]=1),!po(i);)ft();return fo(e,st)},C4=function(e,t){var r=-1,n=44;do switch(po(n)){case 0:n===38&&Ht()===12&&(t[r]=1),e[r]+=T4(st-1,t,r);break;case 2:e[r]+=Qs(n);break;case 4:if(n===44){e[++r]=Ht()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=al(n)}while(n=ft());return e},P4=function(e,t){return oA(C4(iA(e),t))},Rk=new WeakMap,O4=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&&!Rk.get(r))&&!n){Rk.set(e,!0);for(var i=[],o=P4(t,i),a=r.props,s=0,l=0;s<o.length;s++)for(var c=0;c<a.length;c++,l++)e.props[l]=i[s]?o[s].replace(/&\f/g,a[c]):a[c]+" "+o[s]}}},R4=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};N4=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case rf:e.return=aA(e.value,e.length);break;case tA:return qn([ao(e,{value:W(e.value,"@","@"+z)})],n);case tf:if(e.length)return m4(e.props,function(i){switch(h4(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return qn([ao(e,{props:[W(i,/:(read-\w+)/,":"+el+"$1")]})],n);case"::placeholder":return qn([ao(e,{props:[W(i,/:(plac\w+)/,":"+z+"input-$1")]}),ao(e,{props:[W(i,/:(plac\w+)/,":"+el+"$1")]}),ao(e,{props:[W(i,/:(plac\w+)/,Ge+"input-$1")]})],n)}return""})}},D4=[N4],L4=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(m){var g=m.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var n=e.stylisPlugins||D4,i={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(m){for(var g=m.getAttribute("data-emotion").split(" "),_=1;_<g.length;_++)i[g[_]]=!0;a.push(m)});var s,l=[O4,R4];{var c,d=[E4,k4(function(m){c.insert(m)})],u=x4(l.concat(n,d)),p=function(m){return qn(I4(m),u)};s=function(m,g,_,v){c=_,p(m?m+"{"+g.styles+"}":g.styles),v&&(f.inserted[g.name]=!0)}}var f={key:t,sheet:new l4({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return f.sheet.hydrate(a),f};F4={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},M4=/[A-Z]|^ms/g,U4=/_EMO_([^_]+?)_([^]*?)_EMO_/g,sA=function(e){return e.charCodeAt(1)===45},Nk=function(e){return e!=null&&typeof e!="boolean"},Tp=A4(function(e){return sA(e)?e:e.replace(M4,"-$&").toLowerCase()}),Dk=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(U4,function(r,n,i){return Er={name:n,styles:i,next:Er},n})}return F4[e]!==1&&!sA(e)&&typeof t=="number"&&t!==0?t+"px":t};Lk=/label:\s*([^\s;{]+)\s*(;|$)/g;B4=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},J4=function(e,t,r){B4(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)}};H4=function(e){var t=L4(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var c=Cp(s,t.registered,void 0);return J4(t,c),t.key+"-"+c.name},n=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var c=Cp(s,t.registered),d="animation-"+c.name;return qk(t,{name:c.name,styles:"@keyframes "+d+"{"+c.styles+"}"}),d},i=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var c=Cp(s,t.registered);qk(t,c)},o=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return Fk(t.registered,r,$4(s))};return{css:r,cx:o,injectGlobal:i,keyframes:n,hydrate:function(a){a.forEach(function(s){t.inserted[s]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:lA.bind(null,t.registered),merge:Fk.bind(null,t.registered,r)}},$4=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},V4=H4({key:"css"}),Un=V4.css,Uk=0,cA=[],Oe=R,jk=Oe.__b,Bk=Oe.__r,Jk=Oe.diffed,Hk=Oe.__c,$k=Oe.unmount,Vk=Oe.__;Oe.__b=function(e){pt=null,jk&&jk(e)},Oe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Vk&&Vk(e,t)},Oe.__r=function(e){Bk&&Bk(e),Hp=0;var t=(pt=e.__c).__H;t&&(Pp===pt?(t.__h=[],pt.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Xs),t.__h.forEach($p),t.__h=[],Hp=0)),Pp=pt},Oe.diffed=function(e){Jk&&Jk(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(cA.push(t)!==1&&Mk===Oe.requestAnimationFrame||((Mk=Oe.requestAnimationFrame)||W4)(z4)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Pp=pt=null},Oe.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Xs),r.__h=r.__h.filter(function(n){return!n.__||$p(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],Oe.__e(n,r.__v)}}),Hk&&Hk(e,t)},Oe.unmount=function(e){$k&&$k(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Xs(n)}catch(i){t=i}}),r.__H=void 0,t&&Oe.__e(t,r.__v))};Gk=typeof requestAnimationFrame=="function";Q4=Symbol.for("preact-signals");ee=void 0,so=void 0,xr=0,Vp=0,rl=0;Ue.prototype.brand=Q4;Ue.prototype.h=function(){return!0};Ue.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)};Ue.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)}};Ue.prototype.subscribe=function(e){var t=this;return mo(function(){var r=t.value,n=ee;ee=void 0;try{e(r)}finally{ee=n}})};Ue.prototype.valueOf=function(){return this.value};Ue.prototype.toString=function(){return this.value+""};Ue.prototype.toJSON=function(){return this.value};Ue.prototype.peek=function(){var e=ee;ee=void 0;try{return this.value}finally{ee=e}};Object.defineProperty(Ue.prototype,"value",{get:function(){var e=dA(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Vp>100)throw new Error("Cycle detected");this.v=e,this.i++,rl++,xr++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{cl()}}}});(jn.prototype=new Ue).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===rl))return!0;if(this.g=rl,this.f|=1,this.i>0&&!pA(this))return this.f&=-2,!0;var e=ee;try{fA(this),ee=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 ee=e,hA(this),this.f&=-2,!0};jn.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)}Ue.prototype.S.call(this,e)};jn.prototype.U=function(e){if(this.t!==void 0&&(Ue.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)}};jn.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(jn.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=dA(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});ho.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()}};ho.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,mA(this),fA(this),xr++;var e=ee;return ee=this,Y4.bind(this,e)};ho.prototype.N=function(){2&this.f||(this.f|=2,this.o=so,so=this)};ho.prototype.d=function(){this.f|=8,1&this.f||of(this)};gA=[];mo(function(){vA=this.N})();yA.displayName="_st";Object.defineProperties(Ue.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:yA},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Bn("__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 Ue&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});Bn("__r",function(e,t){nl();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return mo(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),nl(r),e(t)});Bn("__e",function(e,t,r,n){nl(),e(t,r,n)});Bn("diffed",function(e,t){nl();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var s=o[a];s!==void 0&&!(a in n)&&(s.d(),o[a]=void 0)}else o={},r.U=o;for(var l in n){var c=o[l],d=n[l];c===void 0?(c=X4(r,l,d,i),o[l]=c):c.o(d,i)}}}e(t)});Bn("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var a=t.__c;if(a){var s=a.__$u;s&&(a.__$u=void 0,s.d())}}e(t)});Bn("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});lt.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u,n=r&&r.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var o=2&this.__$f;if(!(n||o||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var a in e)if(a!=="__source"&&e[a]!==this.props[a])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};Z4=function(e){queueMicrotask(function(){queueMicrotask(e)})};ze=Un`
|
|
608
608
|
inset: 0;
|
|
609
609
|
clear: none;
|
|
610
610
|
float: none;
|