@jolibox/implement 1.1.31 → 1.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- var Sc=Object.create;var $n=Object.defineProperty,Rc=Object.defineProperties,Tc=Object.getOwnPropertyDescriptor,xc=Object.getOwnPropertyDescriptors,Cc=Object.getOwnPropertyNames,Zo=Object.getOwnPropertySymbols,kc=Object.getPrototypeOf,ta=Object.prototype.hasOwnProperty,Oc=Object.prototype.propertyIsEnumerable;var ea=(e,t,r)=>t in e?$n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Z=(e,t)=>{for(var r in t||(t={}))ta.call(t,r)&&ea(e,r,t[r]);if(Zo)for(var r of Zo(t))Oc.call(t,r)&&ea(e,r,t[r]);return e},me=(e,t)=>Rc(e,xc(t));var Nt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var V=(e,t)=>()=>(e&&(t=e(e=0)),t);var hr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Cc(t))!ta.call(e,i)&&i!==r&&$n(e,i,{get:()=>t[i],enumerable:!(n=Tc(t,i))||n.enumerable});return e};var pr=(e,t,r)=>(r=e!=null?Sc(kc(e)):{},Pc(t||!e||!e.__esModule?$n(r,"default",{value:e,enumerable:!0}):r,e));var U=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});function Vc(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Xn(e){return typeof e=="string"}function ua(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function ca(e){return typeof e=="object"&&Array.isArray(e)}function Jc(e){return typeof e=="undefined"}function Hc(e){return Jc(e)||e===null}function $c(e){return typeof e=="function"}function da(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function fa(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,o){for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=i[a],u=o[a],d=r(s,u,a,i,o);d!==void 0?i[a]=d:ia(u)&&ia(s)?i[a]=n(sa({},s),u):Array.isArray(u)&&Array.isArray(s)?i[a]=[...s,...u]:i[a]=u}return i}return n(e,t)}function ia(e){return e&&typeof e=="object"&&e.constructor===Object}function ha(e,t){if(Array.isArray(e))return e.concat(t)}function Bt(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:u=!0}=r,d=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),y=function(...h){i=h,o=this;let v=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,u&&!v&&d()},t),v)return d()};return y.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},y.flush=()=>{if(n)return clearTimeout(n),n=null,d()},y}function Kc(e,t){return(...r)=>t(e,...r)}function ga(e){return t=>Kc(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new Gc(`${i}`))}})}function Lt(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function mr(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 Zc(e){let t=e.location?mr(e.location,aa):null,r=e.target?mr(e.target,aa):null;return mr(Bc(sa({},e),{location:t,target:r}),Qc)}function ni(e){let t=e.events.map(n=>Zc(n)),r=mr(e.device,Xc);return[e.protocolVersion,t,r,e.project]}function ed(){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 cd(e){return new Promise(t=>wa(e)(t))}function wa(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function dd(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Mt(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function hd(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)pd(e[n],t[n])}function pd(e,t){if(Xn(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if($c(t)){try{if(e instanceof t)return}catch(r){}if(!Hc(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function md(){return typeof globalThis!="undefined"?globalThis[Ea]:void 0}function vd(e){typeof globalThis!="undefined"&&(globalThis[Ea]=e)}function ke(){let e=md();if(e)return e;let t=new vr,r=new Yn,n={registerCommand(i,o,a){t.registerCommand({id:i,handler:o,metadata:a})},executeCommand(i,...o){return r.executeCommand(i,...o)},excuteCommandSync(i,...o){return r.executeCommandThowErr(i,...o)}};return vd(n),n}var Qn,Dc,Nc,Lc,ra,Uc,Mc,na,sa,Bc,Fc,la,jc,qc,Zn,ei,pa,ma,Gc,va,_a,_r,ti,Ce,Gn,zc,ri,oa,Wc,Ft,ct,Yc,aa,Qc,Xc,dt,td,be,rd,nd,id,ya,ii,oi,od,ad,ba,Kn,ee,sd,ld,Ut,Mt,Pe,Wn,ud,qn,fd,jt,vr,Yn,Ea,G=V(()=>{"use strict";Qn=Object.defineProperty,Dc=Object.defineProperties,Nc=Object.getOwnPropertyDescriptor,Lc=Object.getOwnPropertyDescriptors,ra=Object.getOwnPropertySymbols,Uc=Object.prototype.hasOwnProperty,Mc=Object.prototype.propertyIsEnumerable,na=(e,t,r)=>t in e?Qn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sa=(e,t)=>{for(var r in t||(t={}))Uc.call(t,r)&&na(e,r,t[r]);if(ra)for(var r of ra(t))Mc.call(t,r)&&na(e,r,t[r]);return e},Bc=(e,t)=>Dc(e,Lc(t)),Fc=(e,t)=>{for(var r in t)Qn(e,r,{get:t[r],enumerable:!0})},la=(e,t,r,n)=>{for(var i=n>1?void 0:n?Nc(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&&Qn(t,r,i),i},jc=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}qc=(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))(qc||{}),Zn=class extends Error{constructor(e){if(typeof e=="string"){super(e),this.priority="P1";return}super(e.message),this.priority="P1",this.stack=e.stack,this.raw=e}},ei=class extends Zn{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},pa=class extends Zn{constructor(){super(...arguments),this.kind="USER_ERROR"}},ma=class extends pa{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},Gc=class extends pa{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))}},va=class extends ei{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},_a=class extends ei{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},_r=class extends Zn{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}}},ti=class extends ei{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Ce={log:Lt("log"),warn:Lt("warn"),info:Lt("info"),error:Lt("error"),debug:Lt("debug")};Object.assign(globalThis,{logger:Ce});Gn=Symbol.for("Jolibox.canIUseMap"),zc={};globalThis[Gn]||(globalThis[Gn]=zc);ri={get config(){return globalThis[Gn]}},oa=Symbol.for("Jolibox.canIUseMap.native"),Wc={};globalThis[oa]||(globalThis[oa]=Wc);Ft=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Ft||{}),ct=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(ct||{}),Yc=(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))(Yc||{}),aa=["name","params"],Qc=["name","type","location","target","extra","timestamp","userId"],Xc=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];dt=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});ed();td=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),be={isiOS:navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),iosVersion:()=>{let e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||"0",10)]},isAndroid:navigator.userAgent.includes("Android"),isMac:navigator.userAgent.includes("Mac"),isFacebook:navigator.userAgent.includes("FB_IAB"),isPC:!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},rd=()=>be.isiOS?"iOS":be.isAndroid?"Android":be.isMac?"Mac":be.isFacebook?"Facebook":"PC",nd="device_id",id="advertising_id",ya=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,dt()),window.__joliboxLocalStorage__.getItem(e)),ii=()=>new URLSearchParams(window.location.search).get("deviceId")||ya(nd),oi=()=>new URLSearchParams(window.location.search).get("advertisingId")||ya(id),od=e=>e.charAt(0).toUpperCase()+e.slice(1),ad=()=>{var e;let t=new URLSearchParams(window.location.search);return od((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},ba=e=>{if(td())return window.navigator.userAgent;let t="JoliboxWebSDK",r=rd(),n=navigator.language,i=ii(),o=oi();return`${t} (${ad()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`},Kn=class zn{constructor(t){this.element=t,this.next=zn.Undefined,this.prev=zn.Undefined}};Kn.Undefined=new Kn(void 0);ee=Kn,sd=class{constructor(){this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ee.Undefined}clear(){let e=this._first;for(;e!==ee.Undefined;){let t=e.next;e.prev=ee.Undefined,e.next=ee.Undefined,e=t}this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new ee(e);if(this._first===ee.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!==ee.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ee.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ee.Undefined&&e.next!==ee.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ee.Undefined&&e.next===ee.Undefined?(this._first=ee.Undefined,this._last=ee.Undefined):e.next===ee.Undefined?(this._last=this._last.prev,this._last.next=ee.Undefined):e.prev===ee.Undefined&&(this._first=this._first.next,this._first.prev=ee.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ee.Undefined;)yield e.element,e=e.next}},ld=0,Ut=class{constructor(e){this.value=e,this.id=ld++}},Mt=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 Ut&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,u;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let d=new Ut(t);return this._listeners?this._listeners instanceof Ut?this._listeners=[this._listeners,d]:this._listeners.push(d):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=d,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(u=(s=this.options)==null?void 0:s.onDidAddListener)==null||u.call(s,this),this._size++,()=>{var y,h,v,_;if(!this._disposed){if(this._listeners instanceof Ut)this._listeners.id===d.id&&(this._listeners=void 0,this._size=0,(h=(y=this.options)==null?void 0:y.onDidRemoveLastListener)==null||h.call(y));else if(this._listeners){let w=this._listeners.indexOf(d);w>=0&&(this._listeners.splice(w,1),this._size--,this._size===0&&((_=(v=this.options)==null?void 0:v.onDidRemoveLastListener)==null||_.call(v)))}}}}),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 Ut?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Pe=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Mt,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new sd,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)}},Wn={};Fc(Wn,{None:()=>ud,filter:()=>dd,once:()=>wa,toPromise:()=>cd});ud=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});qn=Symbol.for("Jolibox.hostEmitter"),fd=()=>{let e=new Pe;return globalThis[qn]||(globalThis[qn]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[qn]},jt=fd();vr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Mt,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 hd(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}};vr=la([da],vr);Yn=class{constructor(){this._onWillExecuteCommand=new Mt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Mt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new vr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Vc(3e4)),this._starActivation}executeCommand(e,...t){return jc(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),Wn.toPromise(Wn.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}}};Yn=la([da],Yn);Ea=Symbol.for("Jolibox.commands")});function Oe(e,t={}){ai.emit("ERROR_REPORT",{error:e,options:t})}var ai,tt,Ye=V(()=>{"use strict";G();G();ai=new Pe,tt=new Pe;Oe.debounce=Bt(Oe,50,{leading:!0})});var si,_d,Ia,Aa,Sa=V(()=>{"use strict";G();Ye();si=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{}}},_d=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},Ia=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:si(o),payloadJson:si(a),signature:si(s)}}else throw"joli_source is missing"}catch(r){return Oe(new va(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},Aa=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=_d(e),o=r[2];return`${n}.${i}.${o}`}return t}});var gd,gr,Ra,li=V(()=>{"use strict";G();gd="1.1.31",gr=()=>gd,Ra=()=>{let e=gr();return`${ba(e)}`}});function bd(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var yd,Ta,ui,xa,oe,wd,N,we=V(()=>{"use strict";G();Sa();li();G();yd={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:ii(),adId:oi(),pixelRatio:window.devicePixelRatio||1,platform:be.isAndroid?"android":be.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:gr()},schema:window.location.href,platform:be.isAndroid?"android":be.isiOS?"ios":"h5"},ui=(Ta=globalThis.joliboxJSCore)==null?void 0:Ta.env,oe=Object.assign({},(xa=ui==null?void 0:ui())!=null?xa:yd);wd=()=>{var _,w,I,S,b,C,O,J,X,R,D;let{payloadJson:e,headerJson:t,signature:r}=oe.schema.length?Ia(oe.schema):{},n=`${oe.deviceInfo.did}-${new Date().getTime()}`,o=new URL(oe.schema.length?oe.schema:window.location.href).searchParams,a=(I=(w=(_=o.get("mpId"))!=null?_:o.get("appId"))!=null?w:o.get("gameId"))!=null?I:"",s=(C=(b=(S=oe.clientSessionId)!=null?S:e==null?void 0:e.sessionId)!=null?b:o.get("sessionId"))!=null?C:n,u=!!((J=(O=e==null?void 0:e.testAdsMode)!=null?O:e==null?void 0:e.__testAdsMode)!=null?J:o.get("testAdsMode")==="true"),d=(D=(R=(X=e==null?void 0:e.joliboxEnv)!=null?X:e==null?void 0:e.__joliboxEnv)!=null?R:o.get("joliboxEnv"))!=null?D:"production",y=d==="staging",h=t==null?void 0:t.channel,v=e==null?void 0:e.__shouldInterupt;return{get testMode(){return y},get testAdsMode(){return u},get joliboxEnv(){return d},get joliSource(){var P;return(P=o.get("joliSource"))!=null?P:null},get mpId(){var P;return(P=a!=null?a:e==null?void 0:e.id)!=null?P:""},get mpVersion(){var P;return(P=t==null?void 0:t.ver)!=null?P:gr()},get mpType(){var P,B;return(B=(P=t==null?void 0:t.__mpType)!=null?P:e==null?void 0:e.__mpType)!=null?B:"game"},get platform(){var P;return((P=oe.platform)!=null?P:oe.deviceInfo.platform).toLowerCase()},get deviceInfo(){return oe.deviceInfo},get sdkInfo(){return oe.sdkInfo},get hostInfo(){return oe.hostInfo},get hostUserInfo(){return oe.hostUserInfo},get sessionId(){var P,B;return(B=(P=oe.clientSessionId)!=null?P:s)!=null?B:n},get channel(){return h},get webviewId(){var P;return(P=oe.webviewId)!=null?P:-1},get shouldInterupt(){return v},get from(){return e==null?void 0:e.__from},get baseApiHost(){return y?"https://stg-api.jolibox.com":"https://api.jolibox.com"},get adId(){var P;return(P=oe.deviceInfo.adId)!=null?P:oe.deviceInfo.did},get language(){return oe.deviceInfo.lang},get sdkEnvironment(){return bd("dlightek","jolibox")?"dlightek":"jolibox"},get viewport(){var W,ne,ye;let P=(W=oe.deviceInfo.pixelRatio)!=null?W:1,B=(ne=oe.deviceInfo.statusBarHeight)!=null?ne:e==null?void 0:e.__androidStatusBarHeight,z=(ye=oe.deviceInfo.navigationBarHeight)!=null?ye:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:B!==void 0?B/P:20,navigationBarHeight:z!==void 0?z/P:10}},onEnvConfigChanged:P=>{fa(oe,P,ha)},encodeJoliSourceQuery:P=>{var B,z;return t&&r?Aa(Z(Z({},e),P),(B=o.get("joliSource"))!=null?B:""):(z=o.get("joliSource"))!=null?z:""},setDoExitDirectly:()=>{v=!1}}},N=wd()});var ci,ka,Ed,Id,Ca,Ad,Oa=V(()=>{"use strict";G();Ye();we();G();ci=!1,ka=(e,t)=>e==null?!1:t in e,Ed=e=>ka(e,"kind"),Id=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},Ca=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=N.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=N.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:Id(e.name)},i=me(Z({},n),{env:t.environment,isFromUser:r});r?tt.emit("GLOBAL_USER_ERROR",e,i):tt.emit("GLOBAL_ERROR",e,i)},Ad=e=>ka(e,"kind")&&e.kind==="USER_ERROR";ai.on("ERROR_REPORT",({error:e,options:t})=>{if(ci)return;ci=!0;let r=Ed(e)&&e.raw?e.raw:e;try{let n=Ad(e);Ca(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new ti(`${i}, origin error: ${r.message}`);Ce.error(o),Ca(new ti(o.message),{environment:t.environment},!1)}finally{ci=!1}})});var di,fi=V(()=>{"use strict";Ye();G();Ye();di=e=>new ma(e)});function Pa(e,t){let r=(n,i,o)=>{let a=me(Z({tag:n},t),{extra:Z({},i)});n=="globalJsError"?Oe(new _a(JSON.stringify(a))):e("systemLog",a,o)};return r.debounce=Bt(r,500,{leading:!0}),r}function Da(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=Bt(t,500,{leading:!0}),t}var Na=V(()=>{"use strict";G();G();Ye()});function La(e,t){let r=Pa(e,t),n=Da(r);return{track:r,trackPerformance:n}}var Ua=V(()=>{"use strict";Na()});var hi=V(()=>{"use strict"});var yr,Ma=V(()=>{"use strict";we();G();G();yr=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return U(this,null,function*(){let r=`${N.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"}/api/fe-configs/js-sdk/samples-config`,n=yield(yield fetch(r)).json();this.samplesConfig=n})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:r}=this.samplesConfig;for(let[n,i]of Object.entries(r))if(i.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,i,o,a,s;let{nativeSDKVersion:t,jssdkVersion:r}=N.sdkInfo;return{platform:1e3,os:N.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(o=(i=N.hostInfo)==null?void 0:i.aid)!=null?o:"1",model:(a=N.deviceInfo.model)!=null?a:"UnknownModel",brand:(s=N.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:N.deviceInfo.did,jsSdkVersion:r,extra:{}}}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:"GamePage",params:r}}trackEvent(t,r,n){return U(this,null,function*(){if(this.checkIsSampled(t))return;let i=t.location?t.location:yield this.getLocation(),o=t.target||null,a=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let s=this.deviceInfo,d={protocolVersion:"1.0.0",events:[me(Z({},t),{location:i,target:o,extra:a,timestamp:Date.now(),userId:null})],device:s,project:r};try{n?yield this.doReport(ni(d),n):yield this.doReport(ni(d))}catch(y){Ce.log("[Jolibox SDK] report API error",y)}})}}});var pi=V(()=>{"use strict";Ua();hi();Ma()});var mi,Ba,Fe,br,je,Vt=V(()=>{"use strict";li();we();G();mi=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(Ba=AbortSignal.timeout)!=null||(AbortSignal.timeout=mi);Fe=class e{constructor(){this.httpClients=new WeakSet;this.networkRequests=[];this.maxRequestsToTrack=20;this.getNetworkStatus=()=>this.networkRequests.length===0?!0:this.networkRequests.filter(n=>n).length/this.networkRequests.length>=.6}static getInstance(){return e._instance||(e._instance=new e),e._instance}create(t){let r=new br(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},br=class{constructor(t){this.xua=Ra();this.getJoliSource=()=>N.joliSource;var n;let r=N.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com";this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return U(this,null,function*(){try{let{query:n,timeout:i}=r!=null?r:{},{headers:o}=r!=null?r:{},a=n?new URLSearchParams(n):null,s=a==null?void 0:a.toString(),u=`${this.baseUrl}${t}${s?`?${s}`:""}`,d=this.xua,y=this.getJoliSource();o=Object.assign({},o!=null?o:{},d?{"x-user-agent":d}:{},y?{"x-joli-source":y}:{});let h=yield fetch(u,{method:"GET",headers:o,credentials:"include",signal:mi(i!=null?i:3e4)});return Fe.getInstance().recordNetworkRequest(!0),yield h.json()}catch(n){throw Fe.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return U(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,y=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{},{"x-os-type":be.isAndroid?"ANDROID":be.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let v=yield fetch(d,{method:"POST",headers:a,body:JSON.stringify(n),signal:mi(o!=null?o:3e4),credentials:"include"});Fe.getInstance().recordNetworkRequest(!0);let _=v.headers.get("content-type");if(_!=null&&_.includes("application/octet-stream"))try{return v.blob()}catch(w){return yield v.arrayBuffer()}if(_!=null&&_.includes("multipart/form-data")||_!=null&&_.includes("application/x-www-form-urlencoded"))try{return v.formData()}catch(w){return yield v.text()}if(_!=null&&_.includes("application/json"))try{return yield v.json()}catch(w){return yield v.text()}return v}catch(n){throw Fe.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return U(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,y=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{});let v=yield fetch(d,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!v.ok)throw Fe.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${v.status}`);return Fe.getInstance().recordNetworkRequest(!0),yield v.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=br;je=Fe.getInstance()});var vi,wr,_i=V(()=>{"use strict";we();pi();Vt();vi=class extends yr{constructor(){super(...arguments);this.hostToApiMap={default:{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.jolibox.com":{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.pico-game.com":{test:"https://stg-collect.pico-game.com",prod:"https://collect.pico-game.com"}};this.httpClient=je.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n,i;let r=(n=this.hostToApiMap[window.location.host])!=null?n:this.hostToApiMap.default;return(i=N.testMode)!=null&&i?r.test:r.prod}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},wr=new vi});var Sd,Fa=V(()=>{"use strict";Oa();G();fi();G();_i();we();Sd=(e,t)=>{var i,o,a;let r={message:t.message,stack:(i=t.stack)!=null?i:"",errorType:t.name,source:0},n={name:e,type:Ft.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=N.hostUserInfo)==null?void 0:o.uid)!=null?a:null};wr.trackEvent(n,ct.WebSDK)};tt.on("GLOBAL_ERROR",(e,t)=>{Sd(t.tag,e)});tt.on("GLOBAL_USER_ERROR",(e,t)=>{Ce.log("UserError",e,t)})});var Er,ja=V(()=>{"use strict";Er=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 _=Date.now(),w=_-r;w>=this.interval&&(this.visible&&(a+=Math.min(w,this.interval+1e3),t(a)),r=_),n=requestAnimationFrame(s)},u=()=>{y(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let _=Date.now();_-r>=this.interval&&(r=_)},this.interval)},d=()=>{h(),r=Date.now(),n=requestAnimationFrame(s)},y=()=>{n&&(cancelAnimationFrame(n),n=0)},h=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",_=>{o&&(console.log("visible",_),_?d():u())});let v=this.visible;return{start(){o||(o=!0,v?d():u())},stop(){o=!1,y(),h()}}}}});var Ir,Va=V(()=>{"use strict";we();ja();Vt();Ir=class extends Er{constructor(r,n,i){super(n,i);this.httpClient=je.create();this.gameId=N.mpId,this.sessionId=N.sessionId,this.track=r}reporter(r){return U(this,null,function*(){let{event:n,params:i}=r;yield this.httpClient.post("/api/base/app-event",{data:{eventType:n,gameInfo:Z({gameId:this.gameId,sessionId:this.sessionId},i)}})})}tracker(r,n=null){this.track(r,n)}}});var Ja,Rd,De,Td,gi,rt,nt=V(()=>{"use strict";Fa();G();G();pi();_i();Va();we();hi();Ja=ke(),Rd={type:ct.WebSDK,platform:"h5",jssdk_version:N.sdkInfo.jssdkVersion,mp_id:N.mpId,mp_version:N.mpVersion},{track:De,trackPerformance:Td}=La((...e)=>{var a,s,u,d;let[,t]=e,r=t,n=ua(r.extra)?r.extra:Xn(r.extra)?JSON.parse(r.extra):{},i=me(Z({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(s=r.mp_version)!=null?s:""}),o={name:t.tag,type:Ft.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(d=(u=N.hostUserInfo)==null?void 0:u.uid)!=null?d:null};wr.trackEvent(o,ct.WebSDK)},Rd);Ja.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Td(e,t,r)});Ja.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{De(e,t)});gi=new Pe,rt=new Ir(De,gi)});function Ha(e){let t=ri.config[e];return t||(t={},ri.config[e]=t),(r,n)=>{if(t[r]){Ce.warn(`[can i use] ${r} already registered`);return}t[r]=Z({},n)}}var $a=V(()=>{"use strict";G()});function yi(e){qa=e}function Ar(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>Ar(t)):Object.keys(e).reduce((t,r)=>(t[r]=Ar(e[r]),t),{})}function Ve(e){return typeof e=="number"}function bi(e){let t=wi(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function wi(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var qa,ue,Sr,Rr,Tr,xr,ft,Cr,kr,Or,Pr,Dr,Nr,Lr,Ur,Mr,Br,Fr,jr,Ei=V(()=>{"use strict";qa=!1;ue=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(qa)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 ${bi(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return Ar(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:Ar(this._default)}optional(){return this._optional=!0,this}};Sr=class extends ue{validate(t){return this._optional&&t===void 0?!0:Ve(t)?Ve(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):Ve(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):Ve(this._greater)&&t<=this._greater?this.fail(`the value of ${this.path} should be greater than ${this._greater}`):this._isInt&&t!==Math.floor(t)?this.fail(`the value of ${this.path} should be integer but got ${t}`):!0:this.fail({expect:"number",actual:t})}min(t){return this._min=t,this}max(t){return this._max=t,this}isInt(t){return this._isInt=t,this}greater(t){return this._greater=t,this}},Rr=class extends ue{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},Tr=class extends ue{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(Ve(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(Ve(this._minLength)&&t.length<this._minLength)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minLength}`);if(typeof this._pattern=="string"){if(!new RegExp(this._pattern).test(t))return this.fail(`${this.path} should match pattern "${this._pattern}"`)}else if(this._pattern&&!this._pattern.test(t))return this.fail(`${this.path} should match pattern "${this._pattern.toString()}"`);return!0}minLength(t){return this._minLength=t,this}maxLength(t){return this._maxLength=t,this}pattern(t){return this._pattern=t,this}},xr=class extends ue{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},ft=class extends ue{validate(t){return!0}},Cr=class extends ue{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},kr=class extends ue{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},Or=class extends ue{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Pr=class extends ue{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 ${bi(t)}`)}return!0}},Dr=class extends ue{constructor(r){super();this._item=r}validate(r){if(this._optional&&r===void 0)return!0;if(!Array.isArray(r))return this.fail({expect:"array",actual:r});if(Ve(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(Ve(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(Ve(this._length)&&r.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let n=this._item;if(!n)return!0;let i=!0;if(r.forEach((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}},Nr=class extends ue{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(wi(r)!=="object")return this.fail({expect:"object",actual:r});let i=r,o=this._value;o.errors=this.errors;let a=!0;for(let s in i){let u=i[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?o.path=`${this.path}.${s}`:o.path=`${this.path}["${s}"]`,!(u===void 0&&o._optional)){if(u===void 0&&o.hasDefault){i[s]=o.defaultValue;continue}o.validate(u)||(o.hasFallback?i[s]=o.fallbackValue:a=!1)}}return a}},Lr=class extends ue{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(wi(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}},Ur=class extends ue{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:bi(this.value),actual:r}):!0}},Mr=class extends ue{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,i=this._items.length;for(let o=0;o<i;o++){let a=this._items[o];if(a.errors=[],a.path=this.path,!a.validate(t))r.push(a.errors.join("; "));else if(!n){n=!0;break}}if(!n){let o=r.join(`
2
- or `);this.errors.push(o)}return n}},Br=class extends ue{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}},Fr=class extends ue{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},jr=class extends ue{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 Ii(e,t,r="param"){if(e.errors=[],e.path=r,yi(!0),!e.validate(t)){let n=e.errors.join(`
3
- `);throw e.errors.length=0,yi(!1),new TypeError(n)}}var F,Ai=V(()=>{"use strict";Ei();Ei();F={object(e){return new Lr(e)},array(e){return new Dr(e)},tuple(...e){return new Br(...e)},literal(e){return new Ur(e)},or(...e){return new Mr(...e)},symbol(){return new xr},record(e){return new Nr(e)},function(){return new Or},boolean(){return new Rr},string(){return new Tr},number(){return new Sr},undefined(){return new Cr},null(){return new kr},unknown(){return new ft},any(){return new ft},as(){return new ft},arraybuffer(){return new Fr},enum(...e){return new Pr(...e)},typedarray(e){return new jr(e)}}});var Vr,Ga,Ka=V(()=>{"use strict";G();Ye();Ai();fi();Vr=1,Ga=e=>{function t(n,i){return(...o)=>{var h,v,_,w;let a=Date.now(),s={method:n,trace_id:Vr};Vr+=1;let u="SUCCESS",d=`${n}:ok`,y=0;try{if(i.paramsSchema)try{Ii(i.paramsSchema,o,"params")}catch(C){throw di(`${n}:fail ${C.message}`)}let I=i.implement(...o),S=I,b=`${n}:ok`;if(I&&"code"in I){let{code:C,data:O,message:J}=I;u=C,S=O,b=J}return{code:u,message:b,data:S}}catch(I){let S=I;y=(v=(h=S.code)!=null?h:S.errNo)!=null?v:2e3,u="FAILURE";let b=(w=(_=S.message)!=null?_:S.errMsg)!=null?w:`${I}`;return d=`${n}:${u} ${b.replace(/^\S+:(fail|cancel)\s?/,"")}`,Oe(new _r(d,y)),{code:u,message:d}}finally{let I=Date.now()-a;e("apiInvoked",me(Z({},s),{duration:I,status:u}))}}}function r(n,i){return(...o)=>U(this,null,function*(){var v,_,w,I;let a=ca(o)?o:[o],s=Date.now(),u={method:n,trace_id:Vr};Vr+=1;let d=`${n}:ok`,y="SUCCESS",h={code:y,message:d};try{if(i.paramsSchema)try{Ii(i.paramsSchema,a,"params")}catch(C){throw di(C.message)}let b=yield i.implement(...a);if(b&&"code"in b){let{code:C,data:O,message:J}=b;y=C,d=J,b=O}return Object.assign(h,{code:y,message:d,data:b}),h}catch(S){let b=S,C=(_=(v=b.code)!=null?v:b.errNo)!=null?_:2e3;y="FAILURE";let O=(I=(w=b.message)!=null?w:b.errMsg)!=null?I:`${S}`,J=`${n}:${y} ${O.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(h,{code:y,message:J}),Oe(new _r(J,C)),h}finally{let S=Date.now()-s;e("apiInvoked",me(Z({},u),{duration:S,status:y}))}})}return{createAPI:r,createSyncAPI:t}}});var Je,it,ve,Jt=V(()=>{"use strict";$a();nt();Ka();Ai();({createAPI:Je,createSyncAPI:it}=Ga(De)),ve=Ha("h5")});var Qa=hr((Ya,xi)=>{(function(e){if(typeof Ya=="object"&&typeof xi!="undefined")xi.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window!="undefined"?t=window:typeof global!="undefined"?t=global:typeof self!="undefined"?t=self:t=this,t.localforage=e()}})(function(){var e,t,r;return function n(i,o,a){function s(y,h){if(!o[y]){if(!i[y]){var v=typeof Nt=="function"&&Nt;if(!h&&v)return v(y,!0);if(u)return u(y,!0);var _=new Error("Cannot find module '"+y+"'");throw _.code="MODULE_NOT_FOUND",_}var w=o[y]={exports:{}};i[y][0].call(w.exports,function(I){var S=i[y][1][I];return s(S||I)},w,w.exports,n,i,o,a)}return o[y].exports}for(var u=typeof Nt=="function"&&Nt,d=0;d<a.length;d++)s(a[d]);return s}({1:[function(n,i,o){(function(a){"use strict";var s=a.MutationObserver||a.WebKitMutationObserver,u;if(s){var d=0,y=new s(I),h=a.document.createTextNode("");y.observe(h,{characterData:!0}),u=function(){h.data=d=++d%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var v=new a.MessageChannel;v.port1.onmessage=I,u=function(){v.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?u=function(){var b=a.document.createElement("script");b.onreadystatechange=function(){I(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},a.document.documentElement.appendChild(b)}:u=function(){setTimeout(I,0)};var _,w=[];function I(){_=!0;for(var b,C,O=w.length;O;){for(C=w,w=[],b=-1;++b<O;)C[b]();O=w.length}_=!1}i.exports=S;function S(b){w.push(b)===1&&!_&&u()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,i,o){"use strict";var a=n(1);function s(){}var u={},d=["REJECTED"],y=["FULFILLED"],h=["PENDING"];i.exports=v;function v(R){if(typeof R!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,R!==s&&S(this,R)}v.prototype.catch=function(R){return this.then(null,R)},v.prototype.then=function(R,D){if(typeof R!="function"&&this.state===y||typeof D!="function"&&this.state===d)return this;var P=new this.constructor(s);if(this.state!==h){var B=this.state===y?R:D;w(P,B,this.outcome)}else this.queue.push(new _(P,R,D));return P};function _(R,D,P){this.promise=R,typeof D=="function"&&(this.onFulfilled=D,this.callFulfilled=this.otherCallFulfilled),typeof P=="function"&&(this.onRejected=P,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(R){u.resolve(this.promise,R)},_.prototype.otherCallFulfilled=function(R){w(this.promise,this.onFulfilled,R)},_.prototype.callRejected=function(R){u.reject(this.promise,R)},_.prototype.otherCallRejected=function(R){w(this.promise,this.onRejected,R)};function w(R,D,P){a(function(){var B;try{B=D(P)}catch(z){return u.reject(R,z)}B===R?u.reject(R,new TypeError("Cannot resolve promise with itself")):u.resolve(R,B)})}u.resolve=function(R,D){var P=b(I,D);if(P.status==="error")return u.reject(R,P.value);var B=P.value;if(B)S(R,B);else{R.state=y,R.outcome=D;for(var z=-1,W=R.queue.length;++z<W;)R.queue[z].callFulfilled(D)}return R},u.reject=function(R,D){R.state=d,R.outcome=D;for(var P=-1,B=R.queue.length;++P<B;)R.queue[P].callRejected(D);return R};function I(R){var D=R&&R.then;if(R&&(typeof R=="object"||typeof R=="function")&&typeof D=="function")return function(){D.apply(R,arguments)}}function S(R,D){var P=!1;function B(ye){P||(P=!0,u.reject(R,ye))}function z(ye){P||(P=!0,u.resolve(R,ye))}function W(){D(z,B)}var ne=b(W);ne.status==="error"&&B(ne.value)}function b(R,D){var P={};try{P.value=R(D),P.status="success"}catch(B){P.status="error",P.value=B}return P}v.resolve=C;function C(R){return R instanceof this?R:u.resolve(new this(s),R)}v.reject=O;function O(R){var D=new this(s);return u.reject(D,R)}v.all=J;function J(R){var D=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var P=R.length,B=!1;if(!P)return this.resolve([]);for(var z=new Array(P),W=0,ne=-1,ye=new this(s);++ne<P;)Me(R[ne],ne);return ye;function Me(Ot,cr){D.resolve(Ot).then(Nn,function(lt){B||(B=!0,u.reject(ye,lt))});function Nn(lt){z[cr]=lt,++W===P&&!B&&(B=!0,u.resolve(ye,z))}}}v.race=X;function X(R){var D=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var P=R.length,B=!1;if(!P)return this.resolve([]);for(var z=-1,W=new this(s);++z<P;)ne(R[z]);return W;function ne(ye){D.resolve(ye).then(function(Me){B||(B=!0,u.resolve(W,Me))},function(Me){B||(B=!0,u.reject(W,Me))})}}},{1:1}],3:[function(n,i,o){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=n(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(n,i,o){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l};function s(l,f){if(!(l instanceof f))throw new TypeError("Cannot call a class as a function")}function u(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(l){return}}var d=u();function y(){try{if(!d||!d.open)return!1;var l=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),f=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!l||f)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(c){return!1}}function h(l,f){l=l||[],f=f||{};try{return new Blob(l,f)}catch(p){if(p.name!=="TypeError")throw p;for(var c=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,m=new c,g=0;g<l.length;g+=1)m.append(l[g]);return m.getBlob(f.type)}}typeof Promise=="undefined"&&n(3);var v=Promise;function _(l,f){f&&l.then(function(c){f(null,c)},function(c){f(c)})}function w(l,f,c){typeof f=="function"&&l.then(f),typeof c=="function"&&l.catch(c)}function I(l){return typeof l!="string"&&(console.warn(l+" used as a key, but it is not a string."),l=String(l)),l}function S(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var b="local-forage-detect-blob-support",C=void 0,O={},J=Object.prototype.toString,X="readonly",R="readwrite";function D(l){for(var f=l.length,c=new ArrayBuffer(f),m=new Uint8Array(c),g=0;g<f;g++)m[g]=l.charCodeAt(g);return c}function P(l){return new v(function(f){var c=l.transaction(b,R),m=h([""]);c.objectStore(b).put(m,"key"),c.onabort=function(g){g.preventDefault(),g.stopPropagation(),f(!1)},c.oncomplete=function(){var g=navigator.userAgent.match(/Chrome\/(\d+)/),p=navigator.userAgent.match(/Edge\//);f(p||!g||parseInt(g[1],10)>=43)}}).catch(function(){return!1})}function B(l){return typeof C=="boolean"?v.resolve(C):P(l).then(function(f){return C=f,C})}function z(l){var f=O[l.name],c={};c.promise=new v(function(m,g){c.resolve=m,c.reject=g}),f.deferredOperations.push(c),f.dbReady?f.dbReady=f.dbReady.then(function(){return c.promise}):f.dbReady=c.promise}function W(l){var f=O[l.name],c=f.deferredOperations.pop();if(c)return c.resolve(),c.promise}function ne(l,f){var c=O[l.name],m=c.deferredOperations.pop();if(m)return m.reject(f),m.promise}function ye(l,f){return new v(function(c,m){if(O[l.name]=O[l.name]||Do(),l.db)if(f)z(l),l.db.close();else return c(l.db);var g=[l.name];f&&g.push(l.version);var p=d.open.apply(d,g);f&&(p.onupgradeneeded=function(E){var A=p.result;try{A.createObjectStore(l.storeName),E.oldVersion<=1&&A.createObjectStore(b)}catch(T){if(T.name==="ConstraintError")console.warn('The database "'+l.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+l.storeName+'" already exists.');else throw T}}),p.onerror=function(E){E.preventDefault(),m(p.error)},p.onsuccess=function(){var E=p.result;E.onversionchange=function(A){A.target.close()},c(E),W(l)}})}function Me(l){return ye(l,!1)}function Ot(l){return ye(l,!0)}function cr(l,f){if(!l.db)return!0;var c=!l.db.objectStoreNames.contains(l.storeName),m=l.version<l.db.version,g=l.version>l.db.version;if(m&&(l.version!==f&&console.warn('The database "'+l.name+`" can't be downgraded from version `+l.db.version+" to version "+l.version+"."),l.version=l.db.version),g||c){if(c){var p=l.db.version+1;p>l.version&&(l.version=p)}return!0}return!1}function Nn(l){return new v(function(f,c){var m=new FileReader;m.onerror=c,m.onloadend=function(g){var p=btoa(g.target.result||"");f({__local_forage_encoded_blob:!0,data:p,type:l.type})},m.readAsBinaryString(l)})}function lt(l){var f=D(atob(l.data));return h([f],{type:l.type})}function Po(l){return l&&l.__local_forage_encoded_blob}function Ru(l){var f=this,c=f._initReady().then(function(){var m=O[f._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return w(c,l,l),c}function Tu(l){z(l);for(var f=O[l.name],c=f.forages,m=0;m<c.length;m++){var g=c[m];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return l.db=null,Me(l).then(function(p){return l.db=p,cr(l)?Ot(l):p}).then(function(p){l.db=f.db=p;for(var E=0;E<c.length;E++)c[E]._dbInfo.db=p}).catch(function(p){throw ne(l,p),p})}function Be(l,f,c,m){m===void 0&&(m=1);try{var g=l.db.transaction(l.storeName,f);c(null,g)}catch(p){if(m>0&&(!l.db||p.name==="InvalidStateError"||p.name==="NotFoundError"))return v.resolve().then(function(){if(!l.db||p.name==="NotFoundError"&&!l.db.objectStoreNames.contains(l.storeName)&&l.version<=l.db.version)return l.db&&(l.version=l.db.version+1),Ot(l)}).then(function(){return Tu(l).then(function(){Be(l,f,c,m-1)})}).catch(c);c(p)}}function Do(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function xu(l){var f=this,c={db:null};if(l)for(var m in l)c[m]=l[m];var g=O[c.name];g||(g=Do(),O[c.name]=g),g.forages.push(f),f._initReady||(f._initReady=f.ready,f.ready=Ru);var p=[];function E(){return v.resolve()}for(var A=0;A<g.forages.length;A++){var T=g.forages[A];T!==f&&p.push(T._initReady().catch(E))}var x=g.forages.slice(0);return v.all(p).then(function(){return c.db=g.db,Me(c)}).then(function(k){return c.db=k,cr(c,f._defaultConfig.version)?Ot(c):k}).then(function(k){c.db=g.db=k,f._dbInfo=c;for(var L=0;L<x.length;L++){var j=x[L];j!==f&&(j._dbInfo.db=c.db,j._dbInfo.version=c.version)}})}function Cu(l,f){var c=this;l=I(l);var m=new v(function(g,p){c.ready().then(function(){Be(c._dbInfo,X,function(E,A){if(E)return p(E);try{var T=A.objectStore(c._dbInfo.storeName),x=T.get(l);x.onsuccess=function(){var k=x.result;k===void 0&&(k=null),Po(k)&&(k=lt(k)),g(k)},x.onerror=function(){p(x.error)}}catch(k){p(k)}})}).catch(p)});return _(m,f),m}function ku(l,f){var c=this,m=new v(function(g,p){c.ready().then(function(){Be(c._dbInfo,X,function(E,A){if(E)return p(E);try{var T=A.objectStore(c._dbInfo.storeName),x=T.openCursor(),k=1;x.onsuccess=function(){var L=x.result;if(L){var j=L.value;Po(j)&&(j=lt(j));var q=l(j,L.key,k++);q!==void 0?g(q):L.continue()}else g()},x.onerror=function(){p(x.error)}}catch(L){p(L)}})}).catch(p)});return _(m,f),m}function Ou(l,f,c){var m=this;l=I(l);var g=new v(function(p,E){var A;m.ready().then(function(){return A=m._dbInfo,J.call(f)==="[object Blob]"?B(A.db).then(function(T){return T?f:Nn(f)}):f}).then(function(T){Be(m._dbInfo,R,function(x,k){if(x)return E(x);try{var L=k.objectStore(m._dbInfo.storeName);T===null&&(T=void 0);var j=L.put(T,l);k.oncomplete=function(){T===void 0&&(T=null),p(T)},k.onabort=k.onerror=function(){var q=j.error?j.error:j.transaction.error;E(q)}}catch(q){E(q)}})}).catch(E)});return _(g,c),g}function Pu(l,f){var c=this;l=I(l);var m=new v(function(g,p){c.ready().then(function(){Be(c._dbInfo,R,function(E,A){if(E)return p(E);try{var T=A.objectStore(c._dbInfo.storeName),x=T.delete(l);A.oncomplete=function(){g()},A.onerror=function(){p(x.error)},A.onabort=function(){var k=x.error?x.error:x.transaction.error;p(k)}}catch(k){p(k)}})}).catch(p)});return _(m,f),m}function Du(l){var f=this,c=new v(function(m,g){f.ready().then(function(){Be(f._dbInfo,R,function(p,E){if(p)return g(p);try{var A=E.objectStore(f._dbInfo.storeName),T=A.clear();E.oncomplete=function(){m()},E.onabort=E.onerror=function(){var x=T.error?T.error:T.transaction.error;g(x)}}catch(x){g(x)}})}).catch(g)});return _(c,l),c}function Nu(l){var f=this,c=new v(function(m,g){f.ready().then(function(){Be(f._dbInfo,X,function(p,E){if(p)return g(p);try{var A=E.objectStore(f._dbInfo.storeName),T=A.count();T.onsuccess=function(){m(T.result)},T.onerror=function(){g(T.error)}}catch(x){g(x)}})}).catch(g)});return _(c,l),c}function Lu(l,f){var c=this,m=new v(function(g,p){if(l<0){g(null);return}c.ready().then(function(){Be(c._dbInfo,X,function(E,A){if(E)return p(E);try{var T=A.objectStore(c._dbInfo.storeName),x=!1,k=T.openKeyCursor();k.onsuccess=function(){var L=k.result;if(!L){g(null);return}l===0||x?g(L.key):(x=!0,L.advance(l))},k.onerror=function(){p(k.error)}}catch(L){p(L)}})}).catch(p)});return _(m,f),m}function Uu(l){var f=this,c=new v(function(m,g){f.ready().then(function(){Be(f._dbInfo,X,function(p,E){if(p)return g(p);try{var A=E.objectStore(f._dbInfo.storeName),T=A.openKeyCursor(),x=[];T.onsuccess=function(){var k=T.result;if(!k){m(x);return}x.push(k.key),k.continue()},T.onerror=function(){g(T.error)}}catch(k){g(k)}})}).catch(g)});return _(c,l),c}function Mu(l,f){f=S.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var m=this,g;if(!l.name)g=v.reject("Invalid arguments");else{var p=l.name===c.name&&m._dbInfo.db,E=p?v.resolve(m._dbInfo.db):Me(l).then(function(A){var T=O[l.name],x=T.forages;T.db=A;for(var k=0;k<x.length;k++)x[k]._dbInfo.db=A;return A});l.storeName?g=E.then(function(A){if(A.objectStoreNames.contains(l.storeName)){var T=A.version+1;z(l);var x=O[l.name],k=x.forages;A.close();for(var L=0;L<k.length;L++){var j=k[L];j._dbInfo.db=null,j._dbInfo.version=T}var q=new v(function(K,le){var ie=d.open(l.name,T);ie.onerror=function(xe){var Dt=ie.result;Dt.close(),le(xe)},ie.onupgradeneeded=function(){var xe=ie.result;xe.deleteObjectStore(l.storeName)},ie.onsuccess=function(){var xe=ie.result;xe.close(),K(xe)}});return q.then(function(K){x.db=K;for(var le=0;le<k.length;le++){var ie=k[le];ie._dbInfo.db=K,W(ie._dbInfo)}}).catch(function(K){throw(ne(l,K)||v.resolve()).catch(function(){}),K})}}):g=E.then(function(A){z(l);var T=O[l.name],x=T.forages;A.close();for(var k=0;k<x.length;k++){var L=x[k];L._dbInfo.db=null}var j=new v(function(q,K){var le=d.deleteDatabase(l.name);le.onerror=function(){var ie=le.result;ie&&ie.close(),K(le.error)},le.onblocked=function(){console.warn('dropInstance blocked for database "'+l.name+'" until all open connections are closed')},le.onsuccess=function(){var ie=le.result;ie&&ie.close(),q(ie)}});return j.then(function(q){T.db=q;for(var K=0;K<x.length;K++){var le=x[K];W(le._dbInfo)}}).catch(function(q){throw(ne(l,q)||v.resolve()).catch(function(){}),q})})}return _(g,f),g}var Bu={_driver:"asyncStorage",_initStorage:xu,_support:y(),iterate:ku,getItem:Cu,setItem:Ou,removeItem:Pu,clear:Du,length:Nu,key:Lu,keys:Uu,dropInstance:Mu};function Fu(){return typeof openDatabase=="function"}var ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ju="~~local_forage_type~",No=/^~~local_forage_type~([^~]+)~/,dr="__lfsc__:",Ln=dr.length,Un="arbf",Mn="blob",Lo="si08",Uo="ui08",Mo="uic8",Bo="si16",Fo="si32",jo="ur16",Vo="ui32",Jo="fl32",Ho="fl64",$o=Ln+Un.length,qo=Object.prototype.toString;function Go(l){var f=l.length*.75,c=l.length,m,g=0,p,E,A,T;l[l.length-1]==="="&&(f--,l[l.length-2]==="="&&f--);var x=new ArrayBuffer(f),k=new Uint8Array(x);for(m=0;m<c;m+=4)p=ze.indexOf(l[m]),E=ze.indexOf(l[m+1]),A=ze.indexOf(l[m+2]),T=ze.indexOf(l[m+3]),k[g++]=p<<2|E>>4,k[g++]=(E&15)<<4|A>>2,k[g++]=(A&3)<<6|T&63;return x}function Bn(l){var f=new Uint8Array(l),c="",m;for(m=0;m<f.length;m+=3)c+=ze[f[m]>>2],c+=ze[(f[m]&3)<<4|f[m+1]>>4],c+=ze[(f[m+1]&15)<<2|f[m+2]>>6],c+=ze[f[m+2]&63];return f.length%3===2?c=c.substring(0,c.length-1)+"=":f.length%3===1&&(c=c.substring(0,c.length-2)+"=="),c}function Vu(l,f){var c="";if(l&&(c=qo.call(l)),l&&(c==="[object ArrayBuffer]"||l.buffer&&qo.call(l.buffer)==="[object ArrayBuffer]")){var m,g=dr;l instanceof ArrayBuffer?(m=l,g+=Un):(m=l.buffer,c==="[object Int8Array]"?g+=Lo:c==="[object Uint8Array]"?g+=Uo:c==="[object Uint8ClampedArray]"?g+=Mo:c==="[object Int16Array]"?g+=Bo:c==="[object Uint16Array]"?g+=jo:c==="[object Int32Array]"?g+=Fo:c==="[object Uint32Array]"?g+=Vo:c==="[object Float32Array]"?g+=Jo:c==="[object Float64Array]"?g+=Ho:f(new Error("Failed to get type for BinaryArray"))),f(g+Bn(m))}else if(c==="[object Blob]"){var p=new FileReader;p.onload=function(){var E=ju+l.type+"~"+Bn(this.result);f(dr+Mn+E)},p.readAsArrayBuffer(l)}else try{f(JSON.stringify(l))}catch(E){console.error("Couldn't convert value into a JSON string: ",l),f(null,E)}}function Ju(l){if(l.substring(0,Ln)!==dr)return JSON.parse(l);var f=l.substring($o),c=l.substring(Ln,$o),m;if(c===Mn&&No.test(f)){var g=f.match(No);m=g[1],f=f.substring(g[0].length)}var p=Go(f);switch(c){case Un:return p;case Mn:return h([p],{type:m});case Lo:return new Int8Array(p);case Uo:return new Uint8Array(p);case Mo:return new Uint8ClampedArray(p);case Bo:return new Int16Array(p);case jo:return new Uint16Array(p);case Fo:return new Int32Array(p);case Vo:return new Uint32Array(p);case Jo:return new Float32Array(p);case Ho:return new Float64Array(p);default:throw new Error("Unkown type: "+c)}}var Fn={serialize:Vu,deserialize:Ju,stringToBuffer:Go,bufferToString:Bn};function Ko(l,f,c,m){l.executeSql("CREATE TABLE IF NOT EXISTS "+f.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,m)}function Hu(l){var f=this,c={db:null};if(l)for(var m in l)c[m]=typeof l[m]!="string"?l[m].toString():l[m];var g=new v(function(p,E){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(A){return E(A)}c.db.transaction(function(A){Ko(A,c,function(){f._dbInfo=c,p()},function(T,x){E(x)})},E)});return c.serializer=Fn,g}function We(l,f,c,m,g,p){l.executeSql(c,m,g,function(E,A){A.code===A.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[f.storeName],function(T,x){x.rows.length?p(T,A):Ko(T,f,function(){T.executeSql(c,m,g,p)},p)},p):p(E,A)},p)}function $u(l,f){var c=this;l=I(l);var m=new v(function(g,p){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){We(A,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[l],function(T,x){var k=x.rows.length?x.rows.item(0).value:null;k&&(k=E.serializer.deserialize(k)),g(k)},function(T,x){p(x)})})}).catch(p)});return _(m,f),m}function qu(l,f){var c=this,m=new v(function(g,p){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){We(A,E,"SELECT * FROM "+E.storeName,[],function(T,x){for(var k=x.rows,L=k.length,j=0;j<L;j++){var q=k.item(j),K=q.value;if(K&&(K=E.serializer.deserialize(K)),K=l(K,q.key,j+1),K!==void 0){g(K);return}}g()},function(T,x){p(x)})})}).catch(p)});return _(m,f),m}function zo(l,f,c,m){var g=this;l=I(l);var p=new v(function(E,A){g.ready().then(function(){f===void 0&&(f=null);var T=f,x=g._dbInfo;x.serializer.serialize(f,function(k,L){L?A(L):x.db.transaction(function(j){We(j,x,"INSERT OR REPLACE INTO "+x.storeName+" (key, value) VALUES (?, ?)",[l,k],function(){E(T)},function(q,K){A(K)})},function(j){if(j.code===j.QUOTA_ERR){if(m>0){E(zo.apply(g,[l,T,c,m-1]));return}A(j)}})})}).catch(A)});return _(p,c),p}function Gu(l,f,c){return zo.apply(this,[l,f,c,1])}function Ku(l,f){var c=this;l=I(l);var m=new v(function(g,p){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){We(A,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[l],function(){g()},function(T,x){p(x)})})}).catch(p)});return _(m,f),m}function zu(l){var f=this,c=new v(function(m,g){f.ready().then(function(){var p=f._dbInfo;p.db.transaction(function(E){We(E,p,"DELETE FROM "+p.storeName,[],function(){m()},function(A,T){g(T)})})}).catch(g)});return _(c,l),c}function Wu(l){var f=this,c=new v(function(m,g){f.ready().then(function(){var p=f._dbInfo;p.db.transaction(function(E){We(E,p,"SELECT COUNT(key) as c FROM "+p.storeName,[],function(A,T){var x=T.rows.item(0).c;m(x)},function(A,T){g(T)})})}).catch(g)});return _(c,l),c}function Yu(l,f){var c=this,m=new v(function(g,p){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){We(A,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[l+1],function(T,x){var k=x.rows.length?x.rows.item(0).key:null;g(k)},function(T,x){p(x)})})}).catch(p)});return _(m,f),m}function Qu(l){var f=this,c=new v(function(m,g){f.ready().then(function(){var p=f._dbInfo;p.db.transaction(function(E){We(E,p,"SELECT key FROM "+p.storeName,[],function(A,T){for(var x=[],k=0;k<T.rows.length;k++)x.push(T.rows.item(k).key);m(x)},function(A,T){g(T)})})}).catch(g)});return _(c,l),c}function Xu(l){return new v(function(f,c){l.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(g,p){for(var E=[],A=0;A<p.rows.length;A++)E.push(p.rows.item(A).name);f({db:l,storeNames:E})},function(g,p){c(p)})},function(m){c(m)})})}function Zu(l,f){f=S.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var m=this,g;return l.name?g=new v(function(p){var E;l.name===c.name?E=m._dbInfo.db:E=openDatabase(l.name,"","",0),l.storeName?p({db:E,storeNames:[l.storeName]}):p(Xu(E))}).then(function(p){return new v(function(E,A){p.db.transaction(function(T){function x(q){return new v(function(K,le){T.executeSql("DROP TABLE IF EXISTS "+q,[],function(){K()},function(ie,xe){le(xe)})})}for(var k=[],L=0,j=p.storeNames.length;L<j;L++)k.push(x(p.storeNames[L]));v.all(k).then(function(){E()}).catch(function(q){A(q)})},function(T){A(T)})})}):g=v.reject("Invalid arguments"),_(g,f),g}var ec={_driver:"webSQLStorage",_initStorage:Hu,_support:Fu(),iterate:qu,getItem:$u,setItem:Gu,removeItem:Ku,clear:zu,length:Wu,key:Yu,keys:Qu,dropInstance:Zu};function tc(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(l){return!1}}function Wo(l,f){var c=l.name+"/";return l.storeName!==f.storeName&&(c+=l.storeName+"/"),c}function rc(){var l="_localforage_support_test";try{return localStorage.setItem(l,!0),localStorage.removeItem(l),!1}catch(f){return!0}}function nc(){return!rc()||localStorage.length>0}function ic(l){var f=this,c={};if(l)for(var m in l)c[m]=l[m];return c.keyPrefix=Wo(l,f._defaultConfig),nc()?(f._dbInfo=c,c.serializer=Fn,v.resolve()):v.reject()}function oc(l){var f=this,c=f.ready().then(function(){for(var m=f._dbInfo.keyPrefix,g=localStorage.length-1;g>=0;g--){var p=localStorage.key(g);p.indexOf(m)===0&&localStorage.removeItem(p)}});return _(c,l),c}function ac(l,f){var c=this;l=I(l);var m=c.ready().then(function(){var g=c._dbInfo,p=localStorage.getItem(g.keyPrefix+l);return p&&(p=g.serializer.deserialize(p)),p});return _(m,f),m}function sc(l,f){var c=this,m=c.ready().then(function(){for(var g=c._dbInfo,p=g.keyPrefix,E=p.length,A=localStorage.length,T=1,x=0;x<A;x++){var k=localStorage.key(x);if(k.indexOf(p)===0){var L=localStorage.getItem(k);if(L&&(L=g.serializer.deserialize(L)),L=l(L,k.substring(E),T++),L!==void 0)return L}}});return _(m,f),m}function lc(l,f){var c=this,m=c.ready().then(function(){var g=c._dbInfo,p;try{p=localStorage.key(l)}catch(E){p=null}return p&&(p=p.substring(g.keyPrefix.length)),p});return _(m,f),m}function uc(l){var f=this,c=f.ready().then(function(){for(var m=f._dbInfo,g=localStorage.length,p=[],E=0;E<g;E++){var A=localStorage.key(E);A.indexOf(m.keyPrefix)===0&&p.push(A.substring(m.keyPrefix.length))}return p});return _(c,l),c}function cc(l){var f=this,c=f.keys().then(function(m){return m.length});return _(c,l),c}function dc(l,f){var c=this;l=I(l);var m=c.ready().then(function(){var g=c._dbInfo;localStorage.removeItem(g.keyPrefix+l)});return _(m,f),m}function fc(l,f,c){var m=this;l=I(l);var g=m.ready().then(function(){f===void 0&&(f=null);var p=f;return new v(function(E,A){var T=m._dbInfo;T.serializer.serialize(f,function(x,k){if(k)A(k);else try{localStorage.setItem(T.keyPrefix+l,x),E(p)}catch(L){(L.name==="QuotaExceededError"||L.name==="NS_ERROR_DOM_QUOTA_REACHED")&&A(L),A(L)}})})});return _(g,c),g}function hc(l,f){if(f=S.apply(this,arguments),l=typeof l!="function"&&l||{},!l.name){var c=this.config();l.name=l.name||c.name,l.storeName=l.storeName||c.storeName}var m=this,g;return l.name?g=new v(function(p){l.storeName?p(Wo(l,m._defaultConfig)):p(l.name+"/")}).then(function(p){for(var E=localStorage.length-1;E>=0;E--){var A=localStorage.key(E);A.indexOf(p)===0&&localStorage.removeItem(A)}}):g=v.reject("Invalid arguments"),_(g,f),g}var pc={_driver:"localStorageWrapper",_initStorage:ic,_support:tc(),iterate:sc,getItem:ac,setItem:fc,removeItem:dc,clear:oc,length:cc,key:lc,keys:uc,dropInstance:hc},mc=function(f,c){return f===c||typeof f=="number"&&typeof c=="number"&&isNaN(f)&&isNaN(c)},vc=function(f,c){for(var m=f.length,g=0;g<m;){if(mc(f[g],c))return!0;g++}return!1},Yo=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"},Pt={},Qo={},ut={INDEXEDDB:Bu,WEBSQL:ec,LOCALSTORAGE:pc},_c=[ut.INDEXEDDB._driver,ut.WEBSQL._driver,ut.LOCALSTORAGE._driver],fr=["dropInstance"],jn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(fr),gc={description:"",driver:_c.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function yc(l,f){l[f]=function(){var c=arguments;return l.ready().then(function(){return l[f].apply(l,c)})}}function Vn(){for(var l=1;l<arguments.length;l++){var f=arguments[l];if(f)for(var c in f)f.hasOwnProperty(c)&&(Yo(f[c])?arguments[0][c]=f[c].slice():arguments[0][c]=f[c])}return arguments[0]}var bc=function(){function l(f){s(this,l);for(var c in ut)if(ut.hasOwnProperty(c)){var m=ut[c],g=m._driver;this[c]=g,Pt[g]||this.defineDriver(m)}this._defaultConfig=Vn({},gc),this._config=Vn({},this._defaultConfig,f),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return l.prototype.config=function(c){if((typeof c=="undefined"?"undefined":a(c))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var m in c){if(m==="storeName"&&(c[m]=c[m].replace(/\W/g,"_")),m==="version"&&typeof c[m]!="number")return new Error("Database version must be a number.");this._config[m]=c[m]}return"driver"in c&&c.driver?this.setDriver(this._config.driver):!0}else return typeof c=="string"?this._config[c]:this._config},l.prototype.defineDriver=function(c,m,g){var p=new v(function(E,A){try{var T=c._driver,x=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!c._driver){A(x);return}for(var k=jn.concat("_initStorage"),L=0,j=k.length;L<j;L++){var q=k[L],K=!vc(fr,q);if((K||c[q])&&typeof c[q]!="function"){A(x);return}}var le=function(){for(var Dt=function(Ic){return function(){var Ac=new Error("Method "+Ic+" is not implemented by the current driver"),Xo=v.reject(Ac);return _(Xo,arguments[arguments.length-1]),Xo}},Jn=0,Ec=fr.length;Jn<Ec;Jn++){var Hn=fr[Jn];c[Hn]||(c[Hn]=Dt(Hn))}};le();var ie=function(Dt){Pt[T]&&console.info("Redefining LocalForage driver: "+T),Pt[T]=c,Qo[T]=Dt,E()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(ie,A):ie(!!c._support):ie(!0)}catch(xe){A(xe)}});return w(p,m,g),p},l.prototype.driver=function(){return this._driver||null},l.prototype.getDriver=function(c,m,g){var p=Pt[c]?v.resolve(Pt[c]):v.reject(new Error("Driver not found."));return w(p,m,g),p},l.prototype.getSerializer=function(c){var m=v.resolve(Fn);return w(m,c),m},l.prototype.ready=function(c){var m=this,g=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return w(g,c,c),g},l.prototype.setDriver=function(c,m,g){var p=this;Yo(c)||(c=[c]);var E=this._getSupportedDrivers(c);function A(){p._config.driver=p.driver()}function T(L){return p._extend(L),A(),p._ready=p._initStorage(p._config),p._ready}function x(L){return function(){var j=0;function q(){for(;j<L.length;){var K=L[j];return j++,p._dbInfo=null,p._ready=null,p.getDriver(K).then(T).catch(q)}A();var le=new Error("No available storage method found.");return p._driverSet=v.reject(le),p._driverSet}return q()}}var k=this._driverSet!==null?this._driverSet.catch(function(){return v.resolve()}):v.resolve();return this._driverSet=k.then(function(){var L=E[0];return p._dbInfo=null,p._ready=null,p.getDriver(L).then(function(j){p._driver=j._driver,A(),p._wrapLibraryMethodsWithReady(),p._initDriver=x(E)})}).catch(function(){A();var L=new Error("No available storage method found.");return p._driverSet=v.reject(L),p._driverSet}),w(this._driverSet,m,g),this._driverSet},l.prototype.supports=function(c){return!!Qo[c]},l.prototype._extend=function(c){Vn(this,c)},l.prototype._getSupportedDrivers=function(c){for(var m=[],g=0,p=c.length;g<p;g++){var E=c[g];this.supports(E)&&m.push(E)}return m},l.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,m=jn.length;c<m;c++)yc(this,jn[c])},l.prototype.createInstance=function(c){return new l(c)},l}(),wc=new bc;i.exports=wc},{3:3}]},{},[4])(4)})});var Za=hr(Gr=>{"use strict";G();Jt();nt();var ki=ke(),qd=Je("levelFinished",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),duration:F.number().optional(),rating:F.number().optional(),score:F.number().optional()})),implement:e=>U(Gr,null,function*(){let{levelId:t,duration:r,rating:n,score:i}=e;Ce.info("onLevelFinished",r,n,i),yield Promise.all([rt.reporter({event:"COMPLETE_GAME_LEVEL"}),rt.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i})])})}),Gd=Je("gamePlayEnded",{paramsSchema:F.tuple(F.object({duration:F.number().optional(),rating:F.number().optional(),score:F.number()})),implement:e=>U(Gr,null,function*(){let{duration:t,rating:r,score:n}=e;return Ce.info("onGamePlayEnded",t,r,n),rt.tracker("GamePlayEnded",{duration:t,rating:r,score:n})})}),Kd=Je("levelUpgrade",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),name:F.string().optional()})),implement:r=>U(Gr,[r],function*({levelId:e,name:t}){return rt.tracker("LevelUpgrade",{name:t,levelId:e})})});ki.registerCommand("TaskTrackerSDK.levelFinished",qd);ki.registerCommand("TaskTrackerSDK.gamePlayEnded",Gd);ki.registerCommand("TaskTrackerSDK.levelUpgrade",Kd);ve("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ve("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ve("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var pt,ht,es,Oi,zd,Pi,Di=V(()=>{"use strict";pt=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},ht=new Map,es=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=ht.get(t.type);r&&r.forEach(n=>{try{n(t.data)}catch(i){console.warn("Callback execution failed:",i)}})}}catch(t){console.warn("Failed to parse message:",t)}},Oi=!1,zd=()=>{Oi||(window.addEventListener("message",es),Oi=!0)},Pi=(e,t)=>{zd(),ht.has(e)||ht.set(e,new Set);let r=ht.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&ht.delete(e),ht.size===0&&(window.removeEventListener("message",es),Oi=!1)}}});var vt,Kr,zr,Wr,Yr,ts,mt,Wd,fe,_t,ot=V(()=>{"use strict";G();vt="UNLOCK_OPTIONS_CHANGED",Kr="INVOKE_PAYMENT",zr="ON_PAYMENT_RESULT",Wr="ON_USE_MODAL_EVENT",Yr="ON_USE_MODAL_RESULT",ts="ON_USE_MODAL_FREQUENCY",mt=new Pe,Wd=()=>({on:mt.on.bind(mt),off:mt.off.bind(mt),emit:mt.emit.bind(mt)}),fe=Wd(),_t={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}}});function ns(){let e=new Map,t,r;return{registerRewardHandler(i,o){e.set(i,o)},handleReward(i,...o){return U(this,null,function*(){return yield i.reduce((s,u)=>U(this,null,function*(){let d=yield s;if(d===!0)return!0;rs&&console.log(`handleReward ${u}`);let y=e.get(u),h=y?yield y(...o):d;return rs&&console.log(`handleReward ${u} ${h}`),h}),Promise.resolve(!1))})},registerRewardsFetcher(i){return U(this,null,function*(){t=(...o)=>U(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),["ADS"]}})})},registerRewardFrequencyConfigFetcher(i){return U(this,null,function*(){r=(...o)=>U(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),{joliCoinUseAndCharge:_t}}})})},getRewardsTypes(...i){return U(this,null,function*(){return t?yield t(...i):["ADS"]})},getRewardFrequencyConfig(...i){return U(this,null,function*(){return r?yield r(...i):{joliCoinUseAndCharge:_t}})}}}var rs,is=V(()=>{"use strict";we();ot();rs=N.testMode});var Yd,Qd,os,as,ss=V(()=>{"use strict";ot();Yd=()=>(e,t)=>e==="JOLI_COIN"&&t==="ADS"?-1:e==="ADS"&&t==="JOLI_COIN"?1:0,Qd=e=>e.length?e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(Yd()):["ADS"],os=e=>{e.registerRewardsFetcher(t=>U(void 0,null,function*(){var n,i,o,a;let r=["ADS"];try{let s=yield t.post("/api/games/unlock-options",{});if(s.code!=="SUCCESS")return r;fe.emit(vt,{options:((n=s.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=s.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1}});let u=((a=(o=s.data)==null?void 0:o.unlockOptions)==null?void 0:a.map(d=>d.type))||Array.from(r);return Qd(u)}catch(s){return console.error("getRewardOptions error:",s),r}}))},as=e=>{e.registerRewardFrequencyConfigFetcher(t=>U(void 0,null,function*(){var n,i;let r=yield t.get("/api/fe-configs/web-common/global-config",{});return fe.emit(ts,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||_t}),{joliCoinUseAndCharge:((i=r.data)==null?void 0:i.joliCoinUseAndCharge)||_t}}))}});var ls,us=V(()=>{"use strict";ls=e=>t=>U(void 0,null,function*(){return console.log("trigger @jolibox/ads reward",t),e.adBreak(t),!0})});function at(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)}}var Qr=V(()=>{"use strict"});var cs,ds=V(()=>{"use strict";cs=(e,t)=>e.some(r=>r.type==="JOLI_COIN"&&r.joliCoinChoices.some(n=>{var i;return n.joliCoinQuantity<=((i=t==null?void 0:t.balance)!=null?i:0)}))});var Xr,Zr,fs,en,tn=V(()=>{"use strict";we();G();ot();ds();Qr();Xr=(e,t)=>r=>U(void 0,null,function*(){let n=at(fe,zr);return fe.emit(Kr,e,{userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,enableAutoDeduct:r.userJoliCoin.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult}),Zr=(e,t)=>r=>U(void 0,null,function*(){let n=at(fe,Yr);return fe.emit(Wr,e,{enableAutoDeduct:r.enableAutoDeduct,userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult}),fs=e=>{if(e=="CANCEL")throw new Error("CANCEL")},en=(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:r,unlockOptionsHandler:n,initiateAndAwaitPayment:i,showUnlockWithJolicoinModal:o}})=>a=>U(void 0,null,function*(){var s,u,d,y,h,v,_;try{let w=!1,I=yield n.getData(),S=(d=(u=(s=I==null?void 0:I.options)==null?void 0:s.find(O=>O.type==="JOLI_COIN"))==null?void 0:u.joliCoinChoices[0].joliCoinQuantity)!=null?d:0;if(!cs((I==null?void 0:I.options)||[],I==null?void 0:I.userJoliCoin)){let O=yield i({userJoliCoin:I==null?void 0:I.userJoliCoin,joliCoinQuantity:S});if(fs(O),O!=="SUCCESS")return r==null||r(a),!1;w=!0}let b=!!((y=I==null?void 0:I.userJoliCoin)!=null&&y.enableAutoDeduct);if(!w){let O=yield o({enableAutoDeduct:b,userJoliCoin:I==null?void 0:I.userJoliCoin,joliCoinQuantity:S});if(fs(O),O!=="CONFIRM")return r==null||r(a),!1}let C=yield e.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${dt()}-${N.mpType}-${Date.now()}`,gameInfo:{gameId:N.mpId}}});return C.code=="SUCCESS"?((v=a.adBreakDone)==null||v.call(a,{breakType:a.type,breakName:"name"in a&&(h=a.name)!=null?h:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in a&&((_=a.adViewed)==null||_.call(a)),t==null||t({quantity:C.data.quantity,balance:C.data.balance}),!0):(r==null||r(a),!1)}catch(w){if(console.info("JolicoinRewardHandler error:",w),w instanceof Error&&w.message=="CANCEL")throw w;return r==null||r(a),!1}finally{n.clearCache()}})});var hs,ps=V(()=>{"use strict";ot();Qr();tn();tn();hs=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=at(fe,vt),i=()=>{r==null||r()},o=Zr("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),a=Xr("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"});return en(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:i,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:o}})}});var ms,vs=V(()=>{"use strict";ot();tn();Qr();ms=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=at(fe,vt),i=u=>{var d;r==null||r(),(d=u.adBreakDone)==null||d.call(u,{breakType:u.type,breakFormat:u.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},o=Zr("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),a=Xr("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"});return en(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:i,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:o}})}});var Qe,_s=V(()=>{"use strict";is();ss();us();ps();vs();Qe=ns();os(Qe);as(Qe)});function He(e,t){for(var r in t)e[r]=t[r];return e}function Bi(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Gt(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?an.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return nn(e,a,n,i,null)}function nn(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++Es:i,__i:-1,__u:0};return i==null&&M.vnode!=null&&M.vnode(o),o}function Xe(e){return e.children}function Ae(e,t){this.props=e,this.context=t}function gt(e,t){if(t==null)return e.__?gt(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?gt(e):null}function Ts(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Ts(e)}}function ys(e){(!e.__d&&(e.__d=!0)&&st.push(e)&&!on.__r++||gs!==M.debounceRendering)&&((gs=M.debounceRendering)||Is)(on)}function on(){for(var e,t,r,n,i,o,a,s=1;st.length;)st.length>s&&st.sort(As),e=st.shift(),s=st.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=He({},n)).__v=n.__v+1,M.vnode&&M.vnode(r),Fi(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i==null?gt(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,ks(o,r,a),r.__e!=i&&Ts(r)));on.__r=0}function xs(e,t,r,n,i,o,a,s,u,d,y){var h,v,_,w,I,S,b=n&&n.__k||Rs,C=t.length;for(u=ef(r,t,b,u,C),h=0;h<C;h++)(_=r.__k[h])!=null&&(v=_.__i===-1?$t:b[_.__i]||$t,_.__i=h,S=Fi(e,_,v,i,o,a,s,u,d,y),w=_.__e,_.ref&&v.ref!=_.ref&&(v.ref&&ji(v.ref,null,_),y.push(_.ref,_.__c||w,_)),I==null&&w!=null&&(I=w),4&_.__u||v.__k===_.__k?u=Cs(_,u,e):typeof _.type=="function"&&S!==void 0?u=S:w&&(u=w.nextSibling),_.__u&=-7);return r.__e=I,u}function ef(e,t,r,n,i){var o,a,s,u,d,y=r.length,h=y,v=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+v,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?nn(null,a,null,null,null):qt(a)?nn(Xe,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?nn(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,(d=a.__i=tf(a,r,u,h))!==-1&&(h--,(s=r[d])&&(s.__u|=2)),s==null||s.__v===null?(d==-1&&(i>y?v--:i<y&&v++),typeof a.type!="function"&&(a.__u|=4)):d!=u&&(d==u-1?v--:d==u+1?v++:(d>u?v--:v++,a.__u|=4))):e.__k[o]=null;if(h)for(o=0;o<y;o++)(s=r[o])!=null&&!(2&s.__u)&&(s.__e==n&&(n=gt(s)),Ps(s,s));return n}function Cs(e,t,r){var n,i;if(typeof e.type=="function"){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=Cs(n[i],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=gt(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Kt(e,t){return t=t||[],e==null||typeof e=="boolean"||(qt(e)?e.some(function(r){Kt(r,t)}):t.push(e)),t}function tf(e,t,r,n){var i,o,a=e.key,s=e.type,u=t[r];if(u===null&&e.key==null||u&&a==u.key&&s===u.type&&!(2&u.__u))return r;if(n>(u!=null&&!(2&u.__u)?1:0))for(i=r-1,o=r+1;i>=0||o<t.length;){if(i>=0){if((u=t[i])&&!(2&u.__u)&&a==u.key&&s===u.type)return i;i--}if(o<t.length){if((u=t[o])&&!(2&u.__u)&&a==u.key&&s===u.type)return o;o++}}return-1}function bs(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||Zd.test(t)?r:r+"px"}function rn(e,t,r,n,i){var o;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||bs(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||bs(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(Ss,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.t=n.t:(r.t=Mi,e.addEventListener(t,o?Li:Ni,o)):e.removeEventListener(t,o?Li:Ni,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r==null?"":r;break e}catch(a){}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function ws(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=Mi++;else if(t.u<r.t)return;return r(M.event?M.event(t):t)}}}function Fi(e,t,r,n,i,o,a,s,u,d){var y,h,v,_,w,I,S,b,C,O,J,X,R,D,P,B,z,W=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),o=[s=t.__e=r.__e]),(y=M.__b)&&y(t);e:if(typeof W=="function")try{if(b=t.props,C="prototype"in W&&W.prototype.render,O=(y=W.contextType)&&n[y.__c],J=y?O?O.props.value:y.__:n,r.__c?S=(h=t.__c=r.__c).__=h.__E:(C?t.__c=h=new W(b,J):(t.__c=h=new Ae(b,J),h.constructor=W,h.render=nf),O&&O.sub(h),h.props=b,h.state||(h.state={}),h.context=J,h.__n=n,v=h.__d=!0,h.__h=[],h._sb=[]),C&&h.__s==null&&(h.__s=h.state),C&&W.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=He({},h.__s)),He(h.__s,W.getDerivedStateFromProps(b,h.__s))),_=h.props,w=h.state,h.__v=t,v)C&&W.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),C&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(C&&W.getDerivedStateFromProps==null&&b!==_&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(b,J),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(b,h.__s,J)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(ne){ne&&(ne.__=t)}),X=0;X<h._sb.length;X++)h.__h.push(h._sb[X]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(b,h.__s,J),C&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(_,w,I)})}if(h.context=J,h.props=b,h.__P=e,h.__e=!1,R=M.__r,D=0,C){for(h.state=h.__s,h.__d=!1,R&&R(t),y=h.render(h.props,h.state,h.context),P=0;P<h._sb.length;P++)h.__h.push(h._sb[P]);h._sb=[]}else do h.__d=!1,R&&R(t),y=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++D<25);h.state=h.__s,h.getChildContext!=null&&(n=He(He({},n),h.getChildContext())),C&&!v&&h.getSnapshotBeforeUpdate!=null&&(I=h.getSnapshotBeforeUpdate(_,w)),B=y,y!=null&&y.type===Xe&&y.key==null&&(B=Os(y.props.children)),s=xs(e,qt(B)?B:[B],t,r,n,i,o,a,s,u,d),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),S&&(h.__E=h.__=null)}catch(ne){if(t.__v=null,u||o!=null)if(ne.then){for(t.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else for(z=o.length;z--;)Bi(o[z]);else t.__e=r.__e,t.__k=r.__k;M.__e(ne,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=rf(r.__e,t,r,n,i,o,a,u,d);return(y=M.diffed)&&y(t),128&t.__u?void 0:s}function ks(e,t,r){for(var n=0;n<r.length;n++)ji(r[n],r[++n],r[++n]);M.__c&&M.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){M.__e(o,i.__v)}})}function Os(e){return typeof e!="object"||e==null?e:qt(e)?e.map(Os):He({},e)}function rf(e,t,r,n,i,o,a,s,u){var d,y,h,v,_,w,I,S=r.props,b=t.props,C=t.type;if(C=="svg"?i="http://www.w3.org/2000/svg":C=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(d=0;d<o.length;d++)if((_=o[d])&&"setAttribute"in _==!!C&&(C?_.localName==C:_.nodeType==3)){e=_,o[d]=null;break}}if(e==null){if(C==null)return document.createTextNode(b);e=document.createElementNS(i,C,b.is&&b),s&&(M.__m&&M.__m(t,o),s=!1),o=null}if(C===null)S===b||s&&e.data===b||(e.data=b);else{if(o=o&&an.call(e.childNodes),S=r.props||$t,!s&&o!=null)for(S={},d=0;d<e.attributes.length;d++)S[(_=e.attributes[d]).name]=_.value;for(d in S)if(_=S[d],d!="children"){if(d=="dangerouslySetInnerHTML")h=_;else if(!(d in b)){if(d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b)continue;rn(e,d,null,_,i)}}for(d in b)_=b[d],d=="children"?v=_:d=="dangerouslySetInnerHTML"?y=_:d=="value"?w=_:d=="checked"?I=_:s&&typeof _!="function"||S[d]===_||rn(e,d,_,S[d],i);if(y)s||h&&(y.__html===h.__html||y.__html===e.innerHTML)||(e.innerHTML=y.__html),t.__k=[];else if(h&&(e.innerHTML=""),xs(t.type==="template"?e.content:e,qt(v)?v:[v],t,r,n,C=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&gt(r,0),s,u),o!=null)for(d=o.length;d--;)Bi(o[d]);s||(d="value",C=="progress"&&w==null?e.removeAttribute("value"):w!==void 0&&(w!==e[d]||C=="progress"&&!w||C=="option"&&w!==S[d])&&rn(e,d,w,S[d],i),d="checked",I!==void 0&&I!==e[d]&&rn(e,d,I,S[d],i))}return e}function ji(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){M.__e(i,r)}}function Ps(e,t,r){var n,i;if(M.unmount&&M.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||ji(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){M.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Ps(n[i],t,r||typeof e.type!="function");r||Bi(e.__e),e.__c=e.__=e.__e=void 0}function nf(e,t,r){return this.constructor(e,r)}function Ds(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),M.__&&M.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],Fi(t,e=(!n&&r||t).__k=Gt(Xe,null,[e]),i||$t,$t,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?an.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),ks(o,e,a)}var an,M,Es,Ui,st,gs,Is,As,Ss,Mi,Ni,Li,Xd,$t,Rs,Zd,qt,zt=V(()=>{$t={},Rs=[],Zd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qt=Array.isArray;an=Rs.slice,M={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},Es=0,Ui=function(e){return e!=null&&e.constructor==null},Ae.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=He({},this.state),typeof e=="function"&&(e=e(He({},r),this.props)),e&&He(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),ys(this))},Ae.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ys(this))},Ae.prototype.render=Xe,st=[],Is=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,As=function(e,t){return e.__v.__b-t.__v.__b},on.__r=0,Ss=/(PointerCapture)$|Capture$/i,Mi=0,Ni=ws(!1),Li=ws(!0),Xd=0});function ln(e,t){ae.__h&&ae.__h(re,e,Wt||t),Wt=0;var r=re.__H||(re.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function un(e){return Wt=1,Hs($s,e)}function Hs(e,t,r){var n=ln(yt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):$s(void 0,t),function(s){var u=n.__N?n.__N[0]:n.__[0],d=n.t(u,s);u!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=re,!re.__f)){var i=function(s,u,d){if(!n.__c.__H)return!0;var y=n.__c.__H.__.filter(function(v){return!!v.__c});if(y.every(function(v){return!v.__N}))return!o||o.call(this,s,u,d);var h=n.__c.props!==s;return y.forEach(function(v){if(v.__N){var _=v.__[0];v.__=v.__N,v.__N=void 0,_!==v.__[0]&&(h=!0)}}),o&&o.call(this,s,u,d)||h};re.__f=!0;var o=re.shouldComponentUpdate,a=re.componentWillUpdate;re.componentWillUpdate=function(s,u,d){if(this.__e){var y=o;o=void 0,i(s,u,d),o=y}a&&a.call(this,s,u,d)},re.shouldComponentUpdate=i}return n.__N||n.__}function Yt(e,t){var r=ln(yt++,3);!ae.__s&&Gi(r.__H,t)&&(r.__=e,r.u=t,re.__H.__h.push(r))}function Hi(e,t){var r=ln(yt++,4);!ae.__s&&Gi(r.__H,t)&&(r.__=e,r.u=t,re.__h.push(r))}function $i(e){return Wt=5,Qt(function(){return{current:e}},[])}function Qt(e,t){var r=ln(yt++,7);return Gi(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function qi(e,t){return Wt=8,Qt(function(){return e},t)}function of(){for(var e;e=Js.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(sn),e.__H.__h.forEach(Ji),e.__H.__h=[]}catch(t){e.__H.__h=[],ae.__e(t,e.__v)}}function af(e){var t,r=function(){clearTimeout(n),Vs&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Vs&&(t=requestAnimationFrame(r))}function sn(e){var t=re,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),re=t}function Ji(e){var t=re;e.__c=e.__(),re=t}function Gi(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function $s(e,t){return typeof t=="function"?t(e):t}var yt,re,Vi,Ns,Wt,Js,ae,Ls,Us,Ms,Bs,Fs,js,Vs,Ki=V(()=>{zt();Wt=0,Js=[],ae=M,Ls=ae.__b,Us=ae.__r,Ms=ae.diffed,Bs=ae.__c,Fs=ae.unmount,js=ae.__;ae.__b=function(e){re=null,Ls&&Ls(e)},ae.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),js&&js(e,t)},ae.__r=function(e){Us&&Us(e),yt=0;var t=(re=e.__c).__H;t&&(Vi===re?(t.__h=[],re.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(sn),t.__h.forEach(Ji),t.__h=[],yt=0)),Vi=re},ae.diffed=function(e){Ms&&Ms(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Js.push(t)!==1&&Ns===ae.requestAnimationFrame||((Ns=ae.requestAnimationFrame)||af)(of)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Vi=re=null},ae.__c=function(e,t){t.some(function(r){try{r.__h.forEach(sn),r.__h=r.__h.filter(function(n){return!n.__||Ji(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],ae.__e(n,r.__v)}}),Bs&&Bs(e,t)},ae.unmount=function(e){Fs&&Fs(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{sn(n)}catch(i){t=i}}),r.__H=void 0,t&&ae.__e(t,r.__v))};Vs=typeof requestAnimationFrame=="function"});function lf(e,t){for(var r in t)e[r]=t[r];return e}function qs(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function Gs(e,t){this.props=e,this.context=t}function tl(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=lf({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return tl(n,t,r)})),e}function rl(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return rl(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function zi(){this.__u=0,this.o=null,this.__b=null}function nl(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function cn(){this.i=null,this.l=null}function Wi(e,t,r){return t.__k==null&&(t.textContent=""),Ds(e,t),typeof r=="function"&&r(),e?e.__c:null}function vf(){}function _f(){return this.cancelBubble}function gf(){return this.defaultPrevented}var Ks,_g,uf,zs,Ws,cf,df,ff,hf,pf,mf,Ys,il,yf,Qs,Xs,Zs,ol=V(()=>{zt();zt();Ki();Ki();(Gs.prototype=new Ae).isPureReactComponent=!0,Gs.prototype.shouldComponentUpdate=function(e,t){return qs(this.props,e)||qs(this.state,t)};Ks=M.__b;M.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ks&&Ks(e)};_g=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911,uf=M.__e;M.__e=function(e,t,r,n){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}uf(e,t,r,n)};zs=M.unmount;M.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),zs&&zs(e)},(zi.prototype=new Ae).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=nl(n.__v),o=!1,a=function(){o||(o=!0,r.__R=null,i?i(s):s())};r.__R=a;var s=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=rl(u,u.__c.__P,u.__c.__O)}var d;for(n.setState({__a:n.__b=null});d=n.o.pop();)d.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},zi.prototype.componentWillUnmount=function(){this.o=[]},zi.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=tl(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&Gt(Xe,null,e.fallback);return i&&(i.__u&=-33),[Gt(Xe,null,t.__a?null:e.children),i]};Ws=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(cn.prototype=new Ae).__a=function(e){var t=this,r=nl(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),Ws(t,e,n)):i()};r?r(o):o()}},cn.prototype.render=function(e){this.i=null,this.l=new Map;var t=Kt(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},cn.prototype.componentDidUpdate=cn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Ws(e,r,t)})};cf=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,df=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,ff=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,hf=/[A-Z0-9]/g,pf=typeof document!="undefined",mf=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};Ae.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Ae.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});Ys=M.event;M.event=function(e){return Ys&&(e=Ys(e)),e.persist=vf,e.isPropagationStopped=_f,e.isDefaultPrevented=gf,e.nativeEvent=e};yf={enumerable:!1,configurable:!0,get:function(){return this.class}},Qs=M.vnode;M.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={},o=n.indexOf("-")===-1;for(var a in r){var s=r[a];if(!(a==="value"&&"defaultValue"in r&&s==null||pf&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var u=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&s===!0?s="":u==="translate"&&s==="no"?s=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?a="ondblclick":u!=="onchange"||n!=="input"&&n!=="textarea"||mf(r.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":ff.test(a)&&(a=u):u=a="oninput":o&&df.test(a)?a=a.replace(hf,"-$&").toLowerCase():s===null&&(s=void 0),u==="oninput"&&i[a=u]&&(a="oninputCapture"),i[a]=s}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=Kt(r.children).forEach(function(d){d.props.selected=i.value.indexOf(d.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=Kt(r.children).forEach(function(d){d.props.selected=i.multiple?i.defaultValue.indexOf(d.props.value)!=-1:i.defaultValue==d.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",yf)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=cf,Qs&&Qs(e)};Xs=M.__r;M.__r=function(e){Xs&&Xs(e),il=e.__c};Zs=M.diffed;M.diffed=function(e){Zs&&Zs(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),il=null}});function Se(e,t,r){return(t=If(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function If(e){var t=Af(e,"string");return typeof t=="symbol"?t:t+""}function Af(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dn(e,t,r){return(t=Sf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sf(e){var t=Rf(e,"string");return typeof t=="symbol"?t:t+""}function Rf(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 Lf(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Uf(e){return typeof e=="string"}function Mf(e){return typeof e=="undefined"}function Bf(e){return Mf(e)||e===null}function Ff(e){return typeof e=="function"}function Pl(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 Xt(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}function pn(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 Gf(e){let t=e.location?pn(e.location,dl):null,r=e.target?pn(e.target,dl):null;return pn(Pf(Of({},e),{location:t,target:r}),$f)}function Kf(e){let t=e.events.map(n=>Gf(n)),r=pn(e.device,qf);return[e.protocolVersion,t,r,e.project]}function zf(){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 Zf(e){return new Promise(t=>Ul(e)(t))}function Ul(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 eh(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new nr(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 rh(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)nh(e[n],t[n])}function nh(e,t){if(Uf(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Ff(t)){try{if(e instanceof t)return}catch(r){}if(!Bf(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 Qi(e,t,r){return(t=ih(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ih(e){var t=oh(e,"string");return typeof t=="symbol"?t:t+""}function oh(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 fn(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=sh(e,"string");return typeof t=="symbol"?t:t+""}function sh(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 $e(e,t,r){return(t=lh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lh(e){var t=uh(e,"string");return typeof t=="symbol"?t:t+""}function uh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ch(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 dh(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 _h(e,t){return he(e,0)^45?(((t<<2^he(e,0))<<2^he(e,1))<<2^he(e,2))<<2^he(e,3):0}function Fl(e){return e.trim()}function gh(e,t){return(e=t.exec(e))?e[0]:e}function $(e,t,r){return e.replace(t,r)}function fo(e,t){return e.indexOf(t)}function he(e,t){return e.charCodeAt(t)|0}function ir(e,t,r){return e.slice(t,r)}function Le(e){return e.length}function Io(e){return e.length}function hn(e,t){return t.push(e),e}function yh(e,t){return e.map(t).join("")}function Tn(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:Rn,column:It,length:a,return:""}}function er(e,t){return vh(Tn("",null,null,"",null,null,0),e,{length:-e.length},t)}function bh(){return ce}function wh(){return ce=Ie>0?he(At,--Ie):0,It--,ce===10&&(It=1,Rn--),ce}function Te(){return ce=Ie<jl?he(At,Ie++):0,It++,ce===10&&(It=1,Rn++),ce}function Ue(){return he(At,Ie)}function mn(){return Ie}function ar(e,t){return ir(At,e,t)}function or(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 Vl(e){return Rn=It=1,jl=Le(At=e),Ie=0,[]}function Jl(e){return At="",e}function vn(e){return Fl(ar(Ie-1,ho(e===91?e+2:e===40?e+1:e)))}function Eh(e){for(;(ce=Ue())&&ce<33;)Te();return or(e)>2||or(ce)>3?"":" "}function Ih(e,t){for(;--t&&Te()&&!(ce<48||ce>102||ce>57&&ce<65||ce>70&&ce<97););return ar(e,mn()+(t<6&&Ue()==32&&Te()==32))}function ho(e){for(;Te();)switch(ce){case e:return Ie;case 34:case 39:e!==34&&e!==39&&ho(ce);break;case 40:e===41&&ho(e);break;case 92:Te();break}return Ie}function Ah(e,t){for(;Te()&&e+ce!==57&&!(e+ce===84&&Ue()===47););return"/*"+ar(t,Ie-1)+"*"+Sn(e===47?e:Te())}function Sh(e){for(;!or(Ue());)Te();return ar(e,Ie)}function Rh(e){return Jl(_n("",null,null,null,[""],e=Vl(e),0,[0],e))}function _n(e,t,r,n,i,o,a,s,u){for(var d=0,y=0,h=a,v=0,_=0,w=0,I=1,S=1,b=1,C=0,O="",J=i,X=o,R=n,D=O;S;)switch(w=C,C=Te()){case 40:if(w!=108&&he(D,h-1)==58){fo(D+=$(vn(C),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:D+=vn(C);break;case 9:case 10:case 13:case 32:D+=Eh(w);break;case 92:D+=Ih(mn()-1,7);continue;case 47:switch(Ue()){case 42:case 47:hn(Th(Ah(Te(),mn()),t,r),u);break;default:D+="/"}break;case 123*I:s[d++]=Le(D)*b;case 125*I:case 59:case 0:switch(C){case 0:case 125:S=0;case 59+y:b==-1&&(D=$(D,/\f/g,"")),_>0&&Le(D)-h&&hn(_>32?pl(D+";",n,r,h-1):pl($(D," ","")+";",n,r,h-2),u);break;case 59:D+=";";default:if(hn(R=hl(D,t,r,d,y,i,s,O,J=[],X=[],h),o),C===123)if(y===0)_n(D,t,R,R,J,o,h,s,X);else switch(v===99&&he(D,3)===110?100:v){case 100:case 108:case 109:case 115:_n(e,R,R,n&&hn(hl(e,R,R,0,0,i,s,O,i,J=[],h),X),i,X,h,s,n?J:X);break;default:_n(D,R,R,R,[""],X,0,s,X)}}d=y=_=0,I=b=1,O=D="",h=a;break;case 58:h=1+Le(D),_=w;default:if(I<1){if(C==123)--I;else if(C==125&&I++==0&&wh()==125)continue}switch(D+=Sn(C),C*I){case 38:b=y>0?1:(D+="\f",-1);break;case 44:s[d++]=(Le(D)-1)*b,b=1;break;case 64:Ue()===45&&(D+=vn(Te())),v=Ue(),y=h=Le(O=D+=Sh(mn())),C++;break;case 45:w===45&&Le(D)==2&&(I=0)}}return o}function hl(e,t,r,n,i,o,a,s,u,d,y){for(var h=i-1,v=i===0?o:[""],_=Io(v),w=0,I=0,S=0;w<n;++w)for(var b=0,C=ir(e,h+1,h=mh(I=a[w])),O=e;b<_;++b)(O=Fl(I>0?v[b]+" "+C:$(C,/&\f/g,v[b])))&&(u[S++]=O);return Tn(e,t,r,i===0?wo:s,u,d,y)}function Th(e,t,r){return Tn(e,t,r,Ml,Sn(bh()),ir(e,2,-2),0)}function pl(e,t,r,n){return Tn(e,t,r,Eo,ir(e,0,n),ir(e,n+1,-1),n)}function Et(e,t){for(var r="",n=Io(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function xh(e,t,r,n){switch(e.type){case ph:if(e.children.length)break;case hh:case Eo:return e.return=e.return||e.value;case Ml:return"";case Bl:return e.return=e.value+"{"+Et(e.children,n)+"}";case wo:e.value=e.props.join(",")}return Le(r=Et(e.children,n))?e.return=e.value+"{"+r+"}":""}function Ch(e){var t=Io(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 kh(e){return function(t){t.root||(t=t.return)&&e(t)}}function Oh(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}function Hl(e,t){switch(_h(e,t)){case 5103:return H+"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 H+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return H+e+bn+e+_e+e+e;case 6828:case 4268:return H+e+_e+e+e;case 6165:return H+e+_e+"flex-"+e+e;case 5187:return H+e+$(e,/(\w+).+(:[^]+)/,H+"box-$1$2"+_e+"flex-$1$2")+e;case 5443:return H+e+_e+"flex-item-"+$(e,/flex-|-self/,"")+e;case 4675:return H+e+_e+"flex-line-pack"+$(e,/align-content|flex-|-self/,"")+e;case 5548:return H+e+_e+$(e,"shrink","negative")+e;case 5292:return H+e+_e+$(e,"basis","preferred-size")+e;case 6060:return H+"box-"+$(e,"-grow","")+H+e+_e+$(e,"grow","positive")+e;case 4554:return H+$(e,/([^-])(transform)/g,"$1"+H+"$2")+e;case 6187:return $($($(e,/(zoom-|grab)/,H+"$1"),/(image-set)/,H+"$1"),e,"")+e;case 5495:case 3959:return $(e,/(image-set\([^]*)/,H+"$1$`$1");case 4968:return $($(e,/(.+:)(flex-)?(.*)/,H+"box-pack:$3"+_e+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+H+e+e;case 4095:case 3583:case 4068:case 2532:return $(e,/(.+)-inline(.+)/,H+"$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(Le(e)-1-t>6)switch(he(e,t+1)){case 109:if(he(e,t+4)!==45)break;case 102:return $(e,/(.+:)(.+)-([^]+)/,"$1"+H+"$2-$3$1"+bn+(he(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~fo(e,"stretch")?Hl($(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(he(e,t+1)!==115)break;case 6444:switch(he(e,Le(e)-3-(~fo(e,"!important")&&10))){case 107:return $(e,":",":"+H)+e;case 101:return $(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+H+(he(e,14)===45?"inline-":"")+"box$3$1"+H+"$2$3$1"+_e+"$2box$3")+e}break;case 5936:switch(he(e,t+11)){case 114:return H+e+_e+$(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return H+e+_e+$(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return H+e+_e+$(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return H+e+_e+e+e}return e}function jh(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 wn(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 Ze={name:i.name,styles:i.styles,next:Ze},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)Ze={name:a.name,styles:a.styles,next:Ze},a=a.next;var s=o.styles+";";return s}return $h(e,t,r)}}var u=r;if(t==null)return u;var d=t[u];return d!==void 0?d:u}function $h(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=wn(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]+"}":vl(s)&&(n+=Xi(o)+":"+_l(o,s)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var u=0;u<a.length;u++)vl(a[u])&&(n+=Xi(o)+":"+_l(o,a[u])+";");else{var d=wn(e,t,a);switch(o){case"animation":case"animationName":{n+=Xi(o)+":"+d+";";break}default:n+=o+"{"+d+"}"}}}return n}function Zi(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="";Ze=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=wn(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=wn(r,t,e[s]),n){var u=o;i+=u[s]}gl.lastIndex=0;for(var d="",y;(y=gl.exec(i))!==null;)d+="-"+y[1];var h=jh(i)+d;return{name:h,styles:i,next:Ze}}function ql(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}function yl(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function bl(e,t,r){var n=[],i=ql(e,n,r);return n.length<2?r:i+t(n)}function Yh(e,t){de.__h&&de.__h(Re,e,El||t),El=0;var r=Re.__H||(Re.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Kl(e,t){var r=Yh(po++,7);return Zh(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Qh(){for(var e;e=Gl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(gn),e.__H.__h.forEach(mo),e.__H.__h=[]}catch(t){e.__H.__h=[],de.__e(t,e.__v)}}function Xh(e){var t,r=function(){clearTimeout(n),Cl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Cl&&(t=requestAnimationFrame(r))}function gn(e){var t=Re,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Re=t}function mo(e){var t=Re;e.__c=e.__(),Re=t}function Zh(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function xn(){if(et>1)et--;else{for(var e,t=!1;tr!==void 0;){var r=tr;for(tr=void 0,vo++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Wl(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(vo=0,et--,t)throw e}}function Ee(e){if(et>0)return e();et++;try{return e()}finally{xn()}}function zl(e){if(Y!==void 0){var t=e.n;if(t===void 0||t.t!==Y)return t={i:0,S:e,p:Y.s,n:void 0,t:Y,e:void 0,x:void 0,r:t},Y.s!==void 0&&(Y.s.n=t),Y.s=t,e.n=t,32&Y.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Y.s,t.n=void 0,Y.s.n=t,Y.s=t),t}}function pe(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function Q(e){return new pe(e)}function Wl(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 Yl(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 Ql(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 Rt(e){pe.call(this,void 0),this.x=e,this.s=void 0,this.g=En-1,this.f=4}function rr(e){return new Rt(e)}function Xl(e){var t=e.u;if(e.u=void 0,typeof t=="function"){et++;var r=Y;Y=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Ao(e),n}finally{Y=r,xn()}}}function Ao(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Xl(e)}function tp(e){if(Y!==this)throw new Error("Out-of-order effect");Ql(this),Y=e,this.f&=-2,8&this.f&&Ao(this),xn()}function sr(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function lr(e){var t=new sr(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}function Tt(e,t){M[e]=t.bind(null,M[e]||function(){})}function In(e){to&&to(),to=e&&e.S()}function tu(e){var t=this,r=e.data,n=ru(r);n.value=r;var i=Kl(function(){for(var s=t,u=t.__v;u=u.__;)if(u.__c){u.__c.__$f|=4;break}var d=rr(function(){var _=n.value.value;return _===0?0:_===!0?"":_||""}),y=rr(function(){return!Array.isArray(d.value)&&!Ui(d.value)}),h=lr(function(){if(this.N=nu,y.value){var _=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=_)}}),v=t.__$u.d;return t.__$u.d=function(){h(),v.call(this)},[y,d]},[]),o=i[0],a=i[1];return o.value?a.peek():a.value}function rp(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=Q(r);return{o:function(a,s){o.value=a,n=s},d:lr(function(){this.N=nu;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}function ru(e){return Kl(function(){return Q(e)},[])}function ip(){Ee(function(){for(var e;e=eu.shift();)Zl.call(e)})}function nu(){eu.push(this)===1&&(M.requestAnimationFrame||np)(ip)}function op(e,t){let r=$i(e);Hi(()=>{r.current=e},[e]),Yt(()=>{if(t===null)return;let n=setInterval(()=>{r.current()},t);return()=>{clearInterval(n)}},[t])}function se(e,t,r,n,i,o){t||(t={});var a,s,u=t;if("ref"in u)for(s in u={},t)s=="ref"?a=t[s]:u[s]=t[s];var d={type:e,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ap,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return M.vnode&&M.vnode(d),d}function qe(e,t,r){return(t=gp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gp(e){var t=yp(e,"string");return typeof t=="symbol"?t:t+""}function yp(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 Ge(e,t,r){return(t=Ip(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ip(e){var t=Ap(e,"string");return typeof t=="symbol"?t:t+""}function Ap(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ne(e,t,r){return(t=Sp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sp(e){var t=Rp(e,"string");return typeof t=="symbol"?t:t+""}function Rp(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 al,bf,wf,Ef,ro,no,kl,Tf,xf,sl,Cf,kf,ll,Of,Pf,Df,Ol,Nf,jf,Vf,ul,Jf,cl,Hf,Dl,Nl,Ll,dl,$f,qf,io,te,Wf,Yf,Zt,nr,Qf,ao,Xf,Yi,th,so,fl,lo,uo,co,fh,_e,bn,H,Ml,wo,Eo,hh,Bl,ph,mh,Sn,vh,Rn,It,jl,Ie,ce,At,Ph,Dh,Nh,ml,Lh,Uh,Mh,Bh,Fh,Vh,Jh,Hh,$l,vl,Xi,_l,gl,Ze,qh,Gh,Kh,zh,Wh,St,po,Re,eo,wl,El,Gl,de,Il,Al,Sl,Rl,Tl,xl,Cl,ep,Y,tr,et,vo,En,Zl,to,eu,np,ge,ap,sp,Ke,_o,go,yn,lp,up,cp,dp,fp,hp,pp,mp,vp,_p,yo,wt,bt,bp,wp,Ep,bo,An,Ig,iu=V(()=>{"use strict";zt();ol();al=Object.getOwnPropertySymbols,bf=Object.prototype.hasOwnProperty,wf=Object.prototype.propertyIsEnumerable,Ef=(e,t)=>{var r={};for(var n in e)bf.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&al)for(var n of al(e))t.indexOf(n)<0&&wf.call(e,n)&&(r[n]=e[n]);return r};ro=class{constructor(t){Se(this,"context",void 0),Se(this,"continueCallback",void 0),Se(this,"adIsShowingCallback",void 0),Se(this,"isBeforeAdCalled",!1),Se(this,"isBeforeRewardCalled",!1),Se(this,"isAdDismissedCalled",!1),Se(this,"isAdViewedCalled",!1),Se(this,"isAfterAdCalled",!1),Se(this,"currentProvider",void 0),Se(this,"currentClientParams",void 0),Se(this,"adsHasResponse",!1),Se(this,"videoChecker",window.document.createElement("video")),Se(this,"wrapShowAdFn",r=>()=>{var n;this.adsHasResponse=!0;let i=!1;this.videoChecker.play().catch(()=>{i=!1}),i=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:i},this.paramsToTrack)),(n=this.adIsShowingCallback)==null||n.call(this,!0),r()}),this.context=t}get paramsToTrack(){var t,r,n,i,o,a;return{provider:(r=(t=this.currentProvider)==null?void 0:t.name)!=null?r:null,type:(n=this.currentClientParams)==null?void 0:n.type,name:((i=this.currentClientParams)==null?void 0:i.type)==="preroll"?null:(a=(o=this.currentClientParams)==null?void 0:o.name)!=null?a:""}}wrapBeforeAd(t){return()=>{var r,n;this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.isBeforeAdCalled||(this.isBeforeAdCalled=!0,t==null||t(),((r=this.currentClientParams)==null?void 0:r.type)!=="reward"&&((n=this.adIsShowingCallback)==null||n.call(this,!0)))}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{this.adsHasResponse=!0,this.isAdDismissedCalled||(this.isAdDismissedCalled=!0,t==null||t())}}wrapAdViewed(t){return()=>{this.adsHasResponse=!0,this.isAdViewedCalled||(this.isAdViewedCalled=!0,t==null||t())}}wrapAfterAd(t){return()=>{this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.isAfterAdCalled||(this.isAfterAdCalled=!0,t==null||t())}}wrapAdBreakDone(t){return r=>{var n,i,o,a,s,u;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:null,breakType:r.breakType,breakName:(o=r.breakName)!=null?o:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{t==null||t(r),(a=this.adIsShowingCallback)==null||a.call(this,!1),(s=this.continueCallback)==null||s.call(this,[!1,r]);break}default:{(u=this.continueCallback)==null||u.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n,i){return U(this,null,function*(){return this.currentProvider=t,this.currentClientParams=r,this.adsHasResponse=!1,new Promise(o=>{this.continueCallback=o,this.adIsShowingCallback=i;let a;switch(r.type){case"preroll":{a={type:r.type,adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}case"reward":{a={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),beforeReward:this.wrapBeforeReward(r.beforeReward),adDismissed:this.wrapAdDismissed(r.adDismissed),adViewed:this.wrapAdViewed(r.adViewed),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}default:{a={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}}window.setTimeout(()=>{var s,u,d,y,h;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(u=(s=this.currentProvider)==null?void 0:s.name)!=null?u:null}),(y=this.continueCallback)==null||y.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(d=r.name)!=null?d:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(h=this.adIsShowingCallback)==null||h.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(a,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};no=class{constructor(t){dn(this,"context",void 0),dn(this,"adBreakIsShowing",!1),dn(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),dn(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()})}},kl=Object.defineProperty,Tf=Object.defineProperties,xf=Object.getOwnPropertyDescriptors,sl=Object.getOwnPropertySymbols,Cf=Object.prototype.hasOwnProperty,kf=Object.prototype.propertyIsEnumerable,ll=(e,t,r)=>t in e?kl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Of=(e,t)=>{for(var r in t||(t={}))Cf.call(t,r)&&ll(e,r,t[r]);if(sl)for(var r of sl(t))kf.call(t,r)&&ll(e,r,t[r]);return e},Pf=(e,t)=>Tf(e,xf(t)),Df=(e,t)=>{for(var r in t)kl(e,r,{get:t[r],enumerable:!0})},Ol=(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},Nf=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}jf=(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))(jf||{});Vf={log:Xt("log"),warn:Xt("warn"),info:Xt("info"),error:Xt("error"),debug:Xt("debug")};Object.assign(globalThis,{logger:Vf});ul=Symbol.for("Jolibox.canIUseMap"),Jf={};globalThis[ul]||(globalThis[ul]=Jf);cl=Symbol.for("Jolibox.canIUseMap.native"),Hf={};globalThis[cl]||(globalThis[cl]=Hf);Dl=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Dl||{}),Nl=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Nl||{}),Ll=(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))(Ll||{}),dl=["name","params"],$f=["name","type","location","target","extra","timestamp","userId"],qf=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];zf();navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),navigator.userAgent.includes("Android"),navigator.userAgent.includes("Mac"),navigator.userAgent.includes("FB_IAB"),!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");io=class oo{constructor(t){this.element=t,this.next=oo.Undefined,this.prev=oo.Undefined}};io.Undefined=new io(void 0);te=io,Wf=class{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let e=this._first;for(;e!==te.Undefined;){let t=e.next;e.prev=te.Undefined,e.next=te.Undefined,e=t}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new te(e);if(this._first===te.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==te.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==te.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==te.Undefined&&e.next!==te.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===te.Undefined&&e.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):e.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):e.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==te.Undefined;)yield e.element,e=e.next}},Yf=0,Zt=class{constructor(e){this.value=e,this.id=Yf++}},nr=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 Zt&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){return this._event!=null||(this._event=(e,t)=>{var r,n,i,o,a,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let u=new Zt(e);return this._listeners?this._listeners instanceof Zt?this._listeners=[this._listeners,u]:this._listeners.push(u):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=u,(o=(i=this.options)==null?void 0:i.onDidFirstListener)==null||o.call(i,this)),(s=(a=this.options)==null?void 0:a.onDidAddListener)==null||s.call(a,this),this._size++,()=>{var d,y,h,v;if(!this._disposed){if(this._listeners instanceof Zt)this._listeners.id===u.id&&(this._listeners=void 0,this._size=0,(y=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||y.call(d));else if(this._listeners){let _=this._listeners.indexOf(u);_>=0&&(this._listeners.splice(_,1),this._size--,this._size===0&&((v=(h=this.options)==null?void 0:h.onDidRemoveLastListener)==null||v.call(h)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Zt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Qf=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 nr,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e){let t=this.listeners.get(e),r=this.cachedEventQueue.get(e);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r||(r=new Wf,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)}},ao={};Df(ao,{None:()=>Xf,filter:()=>eh,once:()=>Ul,toPromise:()=>Zf});Xf=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Yi=Symbol.for("Jolibox.hostEmitter"),th=()=>{let e=new Qf;return globalThis[Yi]||(globalThis[Yi]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Yi]};th();so=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new nr,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 rh(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}};so=Ol([Pl],so);fl=class{constructor(){this._onWillExecuteCommand=new nr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new nr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new so,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Lf(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 Nf(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),ao.toPromise(ao.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{}}};fl=Ol([Pl],fl);lo=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";Qi(this,"context",void 0),Qi(this,"placement","GAME"),Qi(this,"contextInfo",void 0),this.context=t,this.placement=r,this.contextInfo=this.context.getContextInfo()}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:this.placement==="GAME"?"GamePage":"DramaPage",params:r}}getDevice(){var t,r,n,i;return{platform:(t=this.contextInfo.platform)!=null?t:Ll.WebSDK,os:this.contextInfo.osType+"_"+this.contextInfo.runtimeType,appVersion:"1.0.0",appId:(r=this.contextInfo.hostAppId)!=null?r:"1",model:(n=this.contextInfo.deviceModel)!=null?n:"UnknownModel",brand:(i=this.contextInfo.deviceBrand)!=null?i:"UnknownBrand",uuid:this.contextInfo.deviceId,jsSdkVersion:"1.0.0",extra:{}}}serialize(t,r){var n;let i={protocolVersion:"1.0.0",events:[{name:t,type:Dl.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:Nl.WebSDK};return Kf(i)}};uo=class{constructor(t){fn(this,"configs",null),fn(this,"firstRun",!0),fn(this,"context",void 0),fn(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return U(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}};co=class{constructor(t,r){$e(this,"name","ADSENSE"),$e(this,"context",void 0),$e(this,"contextInfo",void 0),$e(this,"configured",!1),$e(this,"initParams",void 0),$e(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),$e(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=Ef(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),$e(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),$e(this,"adUnit",n=>U(this,null,function*(){var i,o,a,s;if(this.context.track("CallAdUnit",{adFormat:(o=(i=n.adFormat)==null?void 0:i.toString())!=null?o:null,fullWidthResponsive:(a=n.fullWidthResponsive)!=null?a:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:u,slot:d,adFormat:y,fullWidthResponsive:h,style:v}=n,_;if(!u)throw new Error("targeting element is required");if(typeof u=="string"?_=document.querySelector(u):_=u,!_)throw new Error("targeting element not found");let w=d;if(w||(w=this.initParams.unitId),!w)throw new Error("slot is required");let I=typeof y=="object"&&Array.isArray(y)?y.join(", "):y,S=document.createElement("ins");if(S.className="adsbygoogle",S.id="jolibox-ads",S.style.display="block",S.setAttribute("data-ad-client",this.initParams.clientId),S.setAttribute("data-ad-slot",w),I&&S.setAttribute("data-ad-format",I),h&&S.setAttribute("data-full-width-responsive",h),v&&S.setAttribute("style",v),(s=this.contextInfo.testAdsMode)!=null?s:!1){let b=document.createElement("div");b.style.position="absolute",b.style.top="0",b.style.left="0",b.style.width="100%",b.style.height="100%",b.style.display="flex",b.style.justifyContent="center",b.style.alignItems="center",b.style.backgroundColor="rgba(0, 0, 0, 0.5)",b.style.color="white",b.innerHTML="Test Ad",S.style.position="relative",_.appendChild(S),S.appendChild(b)}else _.appendChild(S),new MutationObserver(b=>{b.forEach(C=>{if(C.type==="attributes"&&C.attributeName==="data-ad-status"){let O=S.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:O!=null?O:"null"})}})}).observe(S,{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 U(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&&this.initParams.admobRewardedSlot&&(i.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),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)}})}};fh=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(dh(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=ch(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}(),_e="-ms-",bn="-moz-",H="-webkit-",Ml="comm",wo="rule",Eo="decl",hh="@import",Bl="@keyframes",ph="@layer",mh=Math.abs,Sn=String.fromCharCode,vh=Object.assign;Rn=1,It=1,jl=0,Ie=0,ce=0,At="";Ph=function(e,t,r){for(var n=0,i=0;n=i,i=Ue(),n===38&&i===12&&(t[r]=1),!or(i);)Te();return ar(e,Ie)},Dh=function(e,t){var r=-1,n=44;do switch(or(n)){case 0:n===38&&Ue()===12&&(t[r]=1),e[r]+=Ph(Ie-1,t,r);break;case 2:e[r]+=vn(n);break;case 4:if(n===44){e[++r]=Ue()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=Sn(n)}while(n=Te());return e},Nh=function(e,t){return Jl(Dh(Vl(e),t))},ml=new WeakMap,Lh=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&&!ml.get(r))&&!n){ml.set(e,!0);for(var i=[],o=Nh(t,i),a=r.props,s=0,u=0;s<o.length;s++)for(var d=0;d<a.length;d++,u++)e.props[u]=i[s]?o[s].replace(/&\f/g,a[d]):a[d]+" "+o[s]}}},Uh=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};Mh=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case Eo:e.return=Hl(e.value,e.length);break;case Bl:return Et([er(e,{value:$(e.value,"@","@"+H)})],n);case wo:if(e.length)return yh(e.props,function(i){switch(gh(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Et([er(e,{props:[$(i,/:(read-\w+)/,":"+bn+"$1")]})],n);case"::placeholder":return Et([er(e,{props:[$(i,/:(plac\w+)/,":"+H+"input-$1")]}),er(e,{props:[$(i,/:(plac\w+)/,":"+bn+"$1")]}),er(e,{props:[$(i,/:(plac\w+)/,_e+"input-$1")]})],n)}return""})}},Bh=[Mh],Fh=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var I=w.getAttribute("data-emotion");I.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var n=e.stylisPlugins||Bh,i={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(w){for(var I=w.getAttribute("data-emotion").split(" "),S=1;S<I.length;S++)i[I[S]]=!0;a.push(w)});var s,u=[Lh,Uh];{var d,y=[xh,kh(function(w){d.insert(w)})],h=Ch(u.concat(n,y)),v=function(w){return Et(Rh(w),h)};s=function(w,I,S,b){d=S,v(w?w+"{"+I.styles+"}":I.styles),b&&(_.inserted[I.name]=!0)}}var _={key:t,sheet:new fh({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 _.sheet.hydrate(a),_};Vh={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},Jh=/[A-Z]|^ms/g,Hh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,$l=function(e){return e.charCodeAt(1)===45},vl=function(e){return e!=null&&typeof e!="boolean"},Xi=Oh(function(e){return $l(e)?e:e.replace(Jh,"-$&").toLowerCase()}),_l=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(Hh,function(r,n,i){return Ze={name:n,styles:i,next:Ze},n})}return Vh[e]!==1&&!$l(e)&&typeof t=="number"&&t!==0?t+"px":t};gl=/label:\s*([^\s;{]+)\s*(;|$)/g;qh=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},Gh=function(e,t,r){qh(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)}};Kh=function(e){var t=Fh(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Zi(s,t.registered,void 0);return Gh(t,d),t.key+"-"+d.name},n=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Zi(s,t.registered),y="animation-"+d.name;return yl(t,{name:d.name,styles:"@keyframes "+y+"{"+d.styles+"}"}),y},i=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Zi(s,t.registered);yl(t,d)},o=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return bl(t.registered,r,zh(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:ql.bind(null,t.registered),merge:bl.bind(null,t.registered,r)}},zh=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},Wh=Kh({key:"css"}),St=Wh.css,El=0,Gl=[],de=M,Il=de.__b,Al=de.__r,Sl=de.diffed,Rl=de.__c,Tl=de.unmount,xl=de.__;de.__b=function(e){Re=null,Il&&Il(e)},de.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),xl&&xl(e,t)},de.__r=function(e){Al&&Al(e),po=0;var t=(Re=e.__c).__H;t&&(eo===Re?(t.__h=[],Re.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(gn),t.__h.forEach(mo),t.__h=[],po=0)),eo=Re},de.diffed=function(e){Sl&&Sl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Gl.push(t)!==1&&wl===de.requestAnimationFrame||((wl=de.requestAnimationFrame)||Xh)(Qh)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),eo=Re=null},de.__c=function(e,t){t.some(function(r){try{r.__h.forEach(gn),r.__h=r.__h.filter(function(n){return!n.__||mo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],de.__e(n,r.__v)}}),Rl&&Rl(e,t)},de.unmount=function(e){Tl&&Tl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{gn(n)}catch(i){t=i}}),r.__H=void 0,t&&de.__e(t,r.__v))};Cl=typeof requestAnimationFrame=="function";ep=Symbol.for("preact-signals");Y=void 0,tr=void 0,et=0,vo=0,En=0;pe.prototype.brand=ep;pe.prototype.h=function(){return!0};pe.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)};pe.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)}};pe.prototype.subscribe=function(e){var t=this;return lr(function(){var r=t.value,n=Y;Y=void 0;try{e(r)}finally{Y=n}})};pe.prototype.valueOf=function(){return this.value};pe.prototype.toString=function(){return this.value+""};pe.prototype.toJSON=function(){return this.value};pe.prototype.peek=function(){var e=Y;Y=void 0;try{return this.value}finally{Y=e}};Object.defineProperty(pe.prototype,"value",{get:function(){var e=zl(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(vo>100)throw new Error("Cycle detected");this.v=e,this.i++,En++,et++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{xn()}}}});(Rt.prototype=new pe).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===En))return!0;if(this.g=En,this.f|=1,this.i>0&&!Wl(this))return this.f&=-2,!0;var e=Y;try{Yl(this),Y=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Y=e,Ql(this),this.f&=-2,!0};Rt.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)}pe.prototype.S.call(this,e)};Rt.prototype.U=function(e){if(this.t!==void 0&&(pe.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)}};Rt.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(Rt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=zl(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});sr.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()}};sr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Xl(this),Yl(this),et++;var e=Y;return Y=this,tp.bind(this,e)};sr.prototype.N=function(){2&this.f||(this.f|=2,this.o=tr,tr=this)};sr.prototype.d=function(){this.f|=8,1&this.f||Ao(this)};eu=[];lr(function(){Zl=this.N})();tu.displayName="_st";Object.defineProperties(pe.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:tu},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Tt("__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 pe&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});Tt("__r",function(e,t){In();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return lr(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),In(r),e(t)});Tt("__e",function(e,t,r,n){In(),e(t,r,n)});Tt("diffed",function(e,t){In();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var s=o[a];s!==void 0&&!(a in n)&&(s.d(),o[a]=void 0)}else o={},r.U=o;for(var u in n){var d=o[u],y=n[u];d===void 0?(d=rp(r,u,y,i),o[u]=d):d.o(y,i)}}}e(t)});Tt("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)});Tt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});Ae.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};np=function(e){queueMicrotask(function(){queueMicrotask(e)})};ge=St`
1
+ var Rc=Object.create;var qn=Object.defineProperty,Tc=Object.defineProperties,xc=Object.getOwnPropertyDescriptor,Cc=Object.getOwnPropertyDescriptors,kc=Object.getOwnPropertyNames,hr=Object.getOwnPropertySymbols,Oc=Object.getPrototypeOf,Gn=Object.prototype.hasOwnProperty,ra=Object.prototype.propertyIsEnumerable;var ta=(e,t,r)=>t in e?qn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Z=(e,t)=>{for(var r in t||(t={}))Gn.call(t,r)&&ta(e,r,t[r]);if(hr)for(var r of hr(t))ra.call(t,r)&&ta(e,r,t[r]);return e},me=(e,t)=>Tc(e,Cc(t));var Lt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var na=(e,t)=>{var r={};for(var n in e)Gn.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&hr)for(var n of hr(e))t.indexOf(n)<0&&ra.call(e,n)&&(r[n]=e[n]);return r};var V=(e,t)=>()=>(e&&(t=e(e=0)),t);var pr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of kc(t))!Gn.call(e,i)&&i!==r&&qn(e,i,{get:()=>t[i],enumerable:!(n=xc(t,i))||n.enumerable});return e};var mr=(e,t,r)=>(r=e!=null?Rc(Oc(e)):{},Pc(t||!e||!e.__esModule?qn(r,"default",{value:e,enumerable:!0}):r,e));var U=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});function Vc(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function ei(e){return typeof e=="string"}function da(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function fa(e){return typeof e=="object"&&Array.isArray(e)}function Jc(e){return typeof e=="undefined"}function Hc(e){return Jc(e)||e===null}function $c(e){return typeof e=="function"}function ha(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function pa(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,o){for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=i[a],u=o[a],d=r(s,u,a,i,o);d!==void 0?i[a]=d:aa(u)&&aa(s)?i[a]=n(ua({},s),u):Array.isArray(u)&&Array.isArray(s)?i[a]=[...s,...u]:i[a]=u}return i}return n(e,t)}function aa(e){return e&&typeof e=="object"&&e.constructor===Object}function ma(e,t){if(Array.isArray(e))return e.concat(t)}function Ft(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:u=!0}=r,d=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),y=function(...h){i=h,o=this;let v=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,u&&!v&&d()},t),v)return d()};return y.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},y.flush=()=>{if(n)return clearTimeout(n),n=null,d()},y}function Kc(e,t){return(...r)=>t(e,...r)}function ba(e){return t=>Kc(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new Gc(`${i}`))}})}function Ut(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function vr(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 Zc(e){let t=e.location?vr(e.location,la):null,r=e.target?vr(e.target,la):null;return vr(Bc(ua({},e),{location:t,target:r}),Qc)}function oi(e){let t=e.events.map(n=>Zc(n)),r=vr(e.device,Xc);return[e.protocolVersion,t,r,e.project]}function ed(){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 cd(e){return new Promise(t=>Ia(e)(t))}function Ia(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function dd(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Bt(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function hd(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)pd(e[n],t[n])}function pd(e,t){if(ei(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if($c(t)){try{if(e instanceof t)return}catch(r){}if(!Hc(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function md(){return typeof globalThis!="undefined"?globalThis[Aa]:void 0}function vd(e){typeof globalThis!="undefined"&&(globalThis[Aa]=e)}function ke(){let e=md();if(e)return e;let t=new _r,r=new Xn,n={registerCommand(i,o,a){t.registerCommand({id:i,handler:o,metadata:a})},executeCommand(i,...o){return r.executeCommand(i,...o)},excuteCommandSync(i,...o){return r.executeCommandThowErr(i,...o)}};return vd(n),n}var Zn,Dc,Nc,Lc,ia,Uc,Mc,oa,ua,Bc,Fc,ca,jc,qc,ti,ri,va,_a,Gc,ga,ya,gr,ni,Ce,zn,zc,ii,sa,Wc,tt,dt,Yc,la,Qc,Xc,ft,td,be,rd,nd,id,wa,ai,si,od,ad,Ea,Wn,ee,sd,ld,Mt,Bt,Pe,Qn,ud,Kn,fd,jt,_r,Xn,Aa,G=V(()=>{"use strict";Zn=Object.defineProperty,Dc=Object.defineProperties,Nc=Object.getOwnPropertyDescriptor,Lc=Object.getOwnPropertyDescriptors,ia=Object.getOwnPropertySymbols,Uc=Object.prototype.hasOwnProperty,Mc=Object.prototype.propertyIsEnumerable,oa=(e,t,r)=>t in e?Zn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ua=(e,t)=>{for(var r in t||(t={}))Uc.call(t,r)&&oa(e,r,t[r]);if(ia)for(var r of ia(t))Mc.call(t,r)&&oa(e,r,t[r]);return e},Bc=(e,t)=>Dc(e,Lc(t)),Fc=(e,t)=>{for(var r in t)Zn(e,r,{get:t[r],enumerable:!0})},ca=(e,t,r,n)=>{for(var i=n>1?void 0:n?Nc(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&&Zn(t,r,i),i},jc=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}qc=(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))(qc||{}),ti=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}},ri=class extends ti{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},va=class extends ti{constructor(){super(...arguments),this.kind="USER_ERROR"}},_a=class extends va{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},Gc=class extends va{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))}},ga=class extends ri{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},ya=class extends ri{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},gr=class extends ti{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}}},ni=class extends ri{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Ce={log:Ut("log"),warn:Ut("warn"),info:Ut("info"),error:Ut("error"),debug:Ut("debug")};Object.assign(globalThis,{logger:Ce});zn=Symbol.for("Jolibox.canIUseMap"),zc={};globalThis[zn]||(globalThis[zn]=zc);ii={get config(){return globalThis[zn]}},sa=Symbol.for("Jolibox.canIUseMap.native"),Wc={};globalThis[sa]||(globalThis[sa]=Wc);tt=(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))(tt||{}),dt=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(dt||{}),Yc=(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))(Yc||{}),la=["name","params"],Qc=["name","type","location","target","extra","timestamp","userId"],Xc=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];ft=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});ed();td=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),be={isiOS:navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),iosVersion:()=>{let e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||"0",10)]},isAndroid:navigator.userAgent.includes("Android"),isMac:navigator.userAgent.includes("Mac"),isFacebook:navigator.userAgent.includes("FB_IAB"),isPC:!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},rd=()=>be.isiOS?"iOS":be.isAndroid?"Android":be.isMac?"Mac":be.isFacebook?"Facebook":"PC",nd="device_id",id="advertising_id",wa=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,ft()),window.__joliboxLocalStorage__.getItem(e)),ai=()=>new URLSearchParams(window.location.search).get("deviceId")||wa(nd),si=()=>new URLSearchParams(window.location.search).get("advertisingId")||wa(id),od=e=>e.charAt(0).toUpperCase()+e.slice(1),ad=()=>{var e;let t=new URLSearchParams(window.location.search);return od((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},Ea=e=>{if(td())return window.navigator.userAgent;let t="JoliboxWebSDK",r=rd(),n=navigator.language,i=ai(),o=si();return`${t} (${ad()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`},Wn=class Yn{constructor(t){this.element=t,this.next=Yn.Undefined,this.prev=Yn.Undefined}};Wn.Undefined=new Wn(void 0);ee=Wn,sd=class{constructor(){this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ee.Undefined}clear(){let e=this._first;for(;e!==ee.Undefined;){let t=e.next;e.prev=ee.Undefined,e.next=ee.Undefined,e=t}this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new ee(e);if(this._first===ee.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!==ee.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ee.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ee.Undefined&&e.next!==ee.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ee.Undefined&&e.next===ee.Undefined?(this._first=ee.Undefined,this._last=ee.Undefined):e.next===ee.Undefined?(this._last=this._last.prev,this._last.next=ee.Undefined):e.prev===ee.Undefined&&(this._first=this._first.next,this._first.prev=ee.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ee.Undefined;)yield e.element,e=e.next}},ld=0,Mt=class{constructor(e){this.value=e,this.id=ld++}},Bt=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 Mt&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,u;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let d=new Mt(t);return this._listeners?this._listeners instanceof Mt?this._listeners=[this._listeners,d]:this._listeners.push(d):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=d,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(u=(s=this.options)==null?void 0:s.onDidAddListener)==null||u.call(s,this),this._size++,()=>{var y,h,v,_;if(!this._disposed){if(this._listeners instanceof Mt)this._listeners.id===d.id&&(this._listeners=void 0,this._size=0,(h=(y=this.options)==null?void 0:y.onDidRemoveLastListener)==null||h.call(y));else if(this._listeners){let w=this._listeners.indexOf(d);w>=0&&(this._listeners.splice(w,1),this._size--,this._size===0&&((_=(v=this.options)==null?void 0:v.onDidRemoveLastListener)==null||_.call(v)))}}}}),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 Mt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Pe=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Bt,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new sd,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)}},Qn={};Fc(Qn,{None:()=>ud,filter:()=>dd,once:()=>Ia,toPromise:()=>cd});ud=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Kn=Symbol.for("Jolibox.hostEmitter"),fd=()=>{let e=new Pe;return globalThis[Kn]||(globalThis[Kn]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Kn]},jt=fd();_r=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Bt,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 hd(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}};_r=ca([ha],_r);Xn=class{constructor(){this._onWillExecuteCommand=new Bt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Bt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new _r,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Vc(3e4)),this._starActivation}executeCommand(e,...t){return jc(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),Qn.toPromise(Qn.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}}};Xn=ca([ha],Xn);Aa=Symbol.for("Jolibox.commands")});function Oe(e,t={}){li.emit("ERROR_REPORT",{error:e,options:t})}var li,rt,Ye=V(()=>{"use strict";G();G();li=new Pe,rt=new Pe;Oe.debounce=Ft(Oe,50,{leading:!0})});var ui,_d,Sa,Ra,Ta=V(()=>{"use strict";G();Ye();ui=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{}}},_d=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},Sa=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:ui(o),payloadJson:ui(a),signature:ui(s)}}else throw"joli_source is missing"}catch(r){return Oe(new ga(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},Ra=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=_d(e),o=r[2];return`${n}.${i}.${o}`}return t}});var gd,yr,xa,ci=V(()=>{"use strict";G();gd="1.1.33",yr=()=>gd,xa=()=>{let e=yr();return`${Ea(e)}`}});function bd(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var yd,Ca,di,ka,oe,wd,N,we=V(()=>{"use strict";G();Ta();ci();G();yd={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:ai(),adId:si(),pixelRatio:window.devicePixelRatio||1,platform:be.isAndroid?"android":be.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:yr()},schema:window.location.href,platform:be.isAndroid?"android":be.isiOS?"ios":"h5"},di=(Ca=globalThis.joliboxJSCore)==null?void 0:Ca.env,oe=Object.assign({},(ka=di==null?void 0:di())!=null?ka:yd);wd=()=>{var _,w,I,S,b,C,P,J,X,R,D;let{payloadJson:e,headerJson:t,signature:r}=oe.schema.length?Sa(oe.schema):{},n=`${oe.deviceInfo.did}-${new Date().getTime()}`,o=new URL(oe.schema.length?oe.schema:window.location.href).searchParams,a=(I=(w=(_=o.get("mpId"))!=null?_:o.get("appId"))!=null?w:o.get("gameId"))!=null?I:"",s=(C=(b=(S=oe.clientSessionId)!=null?S:e==null?void 0:e.sessionId)!=null?b:o.get("sessionId"))!=null?C:n,u=!!((J=(P=e==null?void 0:e.testAdsMode)!=null?P:e==null?void 0:e.__testAdsMode)!=null?J:o.get("testAdsMode")==="true"),d=(D=(R=(X=e==null?void 0:e.joliboxEnv)!=null?X:e==null?void 0:e.__joliboxEnv)!=null?R:o.get("joliboxEnv"))!=null?D:"production",y=d==="staging",h=t==null?void 0:t.channel,v=e==null?void 0:e.__shouldInterupt;return{get testMode(){return y},get testAdsMode(){return u},get joliboxEnv(){return d},get joliSource(){var O;return(O=o.get("joliSource"))!=null?O:null},get mpId(){var O;return(O=a!=null?a:e==null?void 0:e.id)!=null?O:""},get mpVersion(){var O;return(O=t==null?void 0:t.ver)!=null?O:yr()},get mpType(){var O,B;return(B=(O=t==null?void 0:t.__mpType)!=null?O:e==null?void 0:e.__mpType)!=null?B:"game"},get platform(){var O;return((O=oe.platform)!=null?O:oe.deviceInfo.platform).toLowerCase()},get deviceInfo(){return oe.deviceInfo},get sdkInfo(){return oe.sdkInfo},get hostInfo(){return oe.hostInfo},get hostUserInfo(){return oe.hostUserInfo},get sessionId(){var O,B;return(B=(O=oe.clientSessionId)!=null?O:s)!=null?B:n},get channel(){return h},get webviewId(){var O;return(O=oe.webviewId)!=null?O:-1},get shouldInterupt(){return v},get from(){return e==null?void 0:e.__from},get baseApiHost(){return y?"https://stg-api.jolibox.com":"https://api.jolibox.com"},get adId(){var O;return(O=oe.deviceInfo.adId)!=null?O:oe.deviceInfo.did},get language(){return oe.deviceInfo.lang},get sdkEnvironment(){return bd("dlightek","jolibox")?"dlightek":"jolibox"},get viewport(){var W,ne,ye;let O=(W=oe.deviceInfo.pixelRatio)!=null?W:1,B=(ne=oe.deviceInfo.statusBarHeight)!=null?ne:e==null?void 0:e.__androidStatusBarHeight,z=(ye=oe.deviceInfo.navigationBarHeight)!=null?ye:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:B!==void 0?B/O:20,navigationBarHeight:z!==void 0?z/O:10}},onEnvConfigChanged:O=>{pa(oe,O,ma)},encodeJoliSourceQuery:O=>{var B,z;return t&&r?Ra(Z(Z({},e),O),(B=o.get("joliSource"))!=null?B:""):(z=o.get("joliSource"))!=null?z:""},setDoExitDirectly:()=>{v=!1}}},N=wd()});var fi,Pa,Ed,Id,Oa,Ad,Da=V(()=>{"use strict";G();Ye();we();G();fi=!1,Pa=(e,t)=>e==null?!1:t in e,Ed=e=>Pa(e,"kind"),Id=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},Oa=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=N.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=N.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:Id(e.name)},i=me(Z({},n),{env:t.environment,isFromUser:r});r?rt.emit("GLOBAL_USER_ERROR",e,i):rt.emit("GLOBAL_ERROR",e,i)},Ad=e=>Pa(e,"kind")&&e.kind==="USER_ERROR";li.on("ERROR_REPORT",({error:e,options:t})=>{if(fi)return;fi=!0;let r=Ed(e)&&e.raw?e.raw:e;try{let n=Ad(e);Oa(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new ni(`${i}, origin error: ${r.message}`);Ce.error(o),Oa(new ni(o.message),{environment:t.environment},!1)}finally{fi=!1}})});var hi,pi=V(()=>{"use strict";Ye();G();Ye();hi=e=>new _a(e)});function Na(e,t){let r=(n,i,o)=>{let d=i!=null?i:{},{eventType:a}=d,s=na(d,["eventType"]),u=me(Z({tag:n,eventType:a!=null?a:tt.Other},t),{extra:Z({},s)});n=="globalJsError"?Oe(new ya(JSON.stringify(u))):e("systemLog",u,o)};return r.debounce=Ft(r,500,{leading:!0}),r}function La(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=Ft(t,500,{leading:!0}),t}var Ua=V(()=>{"use strict";G();G();Ye()});function Ma(e,t){let r=Na(e,t),n=La(r);return{track:r,trackPerformance:n}}var Ba=V(()=>{"use strict";Ua()});var mi=V(()=>{"use strict"});var br,Fa=V(()=>{"use strict";we();G();G();br=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return U(this,null,function*(){let r=`${N.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"}/api/fe-configs/js-sdk/samples-config`,n=yield(yield fetch(r)).json();this.samplesConfig=n})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:r}=this.samplesConfig;for(let[n,i]of Object.entries(r))if(i.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,i,o,a,s;let{nativeSDKVersion:t,jssdkVersion:r}=N.sdkInfo;return{platform:1e3,os:N.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(o=(i=N.hostInfo)==null?void 0:i.aid)!=null?o:"1",model:(a=N.deviceInfo.model)!=null?a:"UnknownModel",brand:(s=N.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:N.deviceInfo.did,jsSdkVersion:r,extra:{}}}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:"GamePage",params:r}}trackEvent(t,r,n){return U(this,null,function*(){if(this.checkIsSampled(t))return;let i=t.location?t.location:yield this.getLocation(),o=t.target||null,a=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let s=this.deviceInfo,d={protocolVersion:"1.0.0",events:[me(Z({},t),{location:i,target:o,extra:a,timestamp:Date.now(),userId:null})],device:s,project:r};try{n?yield this.doReport(oi(d),n):yield this.doReport(oi(d))}catch(y){Ce.log("[Jolibox SDK] report API error",y)}})}}});var vi=V(()=>{"use strict";Ba();mi();Fa()});var _i,ja,Fe,wr,je,Vt=V(()=>{"use strict";ci();we();G();_i=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(ja=AbortSignal.timeout)!=null||(AbortSignal.timeout=_i);Fe=class e{constructor(){this.httpClients=new WeakSet;this.networkRequests=[];this.maxRequestsToTrack=20;this.getNetworkStatus=()=>this.networkRequests.length===0?!0:this.networkRequests.filter(n=>n).length/this.networkRequests.length>=.6}static getInstance(){return e._instance||(e._instance=new e),e._instance}create(t){let r=new wr(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},wr=class{constructor(t){this.xua=xa();this.getJoliSource=()=>N.joliSource;var n;let r=N.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com";this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return U(this,null,function*(){try{let{query:n,timeout:i}=r!=null?r:{},{headers:o}=r!=null?r:{},a=n?new URLSearchParams(n):null,s=a==null?void 0:a.toString(),u=`${this.baseUrl}${t}${s?`?${s}`:""}`,d=this.xua,y=this.getJoliSource();o=Object.assign({},o!=null?o:{},d?{"x-user-agent":d}:{},y?{"x-joli-source":y}:{});let h=yield fetch(u,{method:"GET",headers:o,credentials:"include",signal:_i(i!=null?i:3e4)});return Fe.getInstance().recordNetworkRequest(!0),yield h.json()}catch(n){throw Fe.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return U(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,y=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{},{"x-os-type":be.isAndroid?"ANDROID":be.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let v=yield fetch(d,{method:"POST",headers:a,body:JSON.stringify(n),signal:_i(o!=null?o:3e4),credentials:"include"});Fe.getInstance().recordNetworkRequest(!0);let _=v.headers.get("content-type");if(_!=null&&_.includes("application/octet-stream"))try{return v.blob()}catch(w){return yield v.arrayBuffer()}if(_!=null&&_.includes("multipart/form-data")||_!=null&&_.includes("application/x-www-form-urlencoded"))try{return v.formData()}catch(w){return yield v.text()}if(_!=null&&_.includes("application/json"))try{return yield v.json()}catch(w){return yield v.text()}return v}catch(n){throw Fe.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return U(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,y=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{});let v=yield fetch(d,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!v.ok)throw Fe.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${v.status}`);return Fe.getInstance().recordNetworkRequest(!0),yield v.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=wr;je=Fe.getInstance()});var gi,Er,yi=V(()=>{"use strict";we();vi();Vt();gi=class extends br{constructor(){super(...arguments);this.hostToApiMap={default:{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.jolibox.com":{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.pico-game.com":{test:"https://stg-collect.pico-game.com",prod:"https://collect.pico-game.com"}};this.httpClient=je.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n,i;let r=(n=this.hostToApiMap[window.location.host])!=null?n:this.hostToApiMap.default;return(i=N.testMode)!=null&&i?r.test:r.prod}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},Er=new gi});var Sd,Va=V(()=>{"use strict";Da();G();pi();G();yi();we();Sd=(e,t)=>{var i,o,a;let r={message:t.message,stack:(i=t.stack)!=null?i:"",errorType:t.name,source:0},n={name:e,type:tt.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=N.hostUserInfo)==null?void 0:o.uid)!=null?a:null};Er.trackEvent(n,dt.WebSDK)};rt.on("GLOBAL_ERROR",(e,t)=>{Sd(t.tag,e)});rt.on("GLOBAL_USER_ERROR",(e,t)=>{Ce.log("UserError",e,t)})});var Ir,Ja=V(()=>{"use strict";Ir=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 _=Date.now(),w=_-r;w>=this.interval&&(this.visible&&(a+=Math.min(w,this.interval+1e3),t(a)),r=_),n=requestAnimationFrame(s)},u=()=>{y(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let _=Date.now();_-r>=this.interval&&(r=_)},this.interval)},d=()=>{h(),r=Date.now(),n=requestAnimationFrame(s)},y=()=>{n&&(cancelAnimationFrame(n),n=0)},h=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",_=>{o&&(console.log("visible",_),_?d():u())});let v=this.visible;return{start(){o||(o=!0,v?d():u())},stop(){o=!1,y(),h()}}}}});var Ar,Ha=V(()=>{"use strict";we();Ja();Vt();Ar=class extends Ir{constructor(r,n,i){super(n,i);this.httpClient=je.create();this.gameId=N.mpId,this.sessionId=N.sessionId,this.track=r}reporter(r){return U(this,null,function*(){let{event:n,params:i}=r;yield this.httpClient.post("/api/base/app-event",{data:{eventType:n,gameInfo:Z({gameId:this.gameId,sessionId:this.sessionId},i)}})})}tracker(r,n=null){this.track(r,n)}}});var $a,Rd,De,Td,bi,nt,it=V(()=>{"use strict";Va();G();G();vi();yi();Ha();we();mi();$a=ke(),Rd={type:dt.WebSDK,platform:"h5",jssdk_version:N.sdkInfo.jssdkVersion,mp_id:N.mpId,mp_version:N.mpVersion},{track:De,trackPerformance:Td}=Ma((...e)=>{var a,s,u,d;let[,t]=e,r=t,n=da(r.extra)?r.extra:ei(r.extra)?JSON.parse(r.extra):{},i=me(Z({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(s=r.mp_version)!=null?s:""}),o={name:t.tag,type:tt.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(d=(u=N.hostUserInfo)==null?void 0:u.uid)!=null?d:null};Er.trackEvent(o,dt.WebSDK)},Rd);$a.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Td(e,t,r)});$a.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{De(e,t)});bi=new Pe,nt=new Ar(De,bi)});function qa(e){let t=ii.config[e];return t||(t={},ii.config[e]=t),(r,n)=>{if(t[r]){Ce.warn(`[can i use] ${r} already registered`);return}t[r]=Z({},n)}}var Ga=V(()=>{"use strict";G()});function wi(e){Ka=e}function Sr(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>Sr(t)):Object.keys(e).reduce((t,r)=>(t[r]=Sr(e[r]),t),{})}function Ve(e){return typeof e=="number"}function Ei(e){let t=Ii(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function Ii(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var Ka,ue,Rr,Tr,xr,Cr,ht,kr,Or,Pr,Dr,Nr,Lr,Ur,Mr,Br,Fr,jr,Vr,Ai=V(()=>{"use strict";Ka=!1;ue=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(Ka)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 ${Ei(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return Sr(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:Sr(this._default)}optional(){return this._optional=!0,this}};Rr=class extends ue{validate(t){return this._optional&&t===void 0?!0:Ve(t)?Ve(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):Ve(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):Ve(this._greater)&&t<=this._greater?this.fail(`the value of ${this.path} should be greater than ${this._greater}`):this._isInt&&t!==Math.floor(t)?this.fail(`the value of ${this.path} should be integer but got ${t}`):!0:this.fail({expect:"number",actual:t})}min(t){return this._min=t,this}max(t){return this._max=t,this}isInt(t){return this._isInt=t,this}greater(t){return this._greater=t,this}},Tr=class extends ue{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},xr=class extends ue{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(Ve(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(Ve(this._minLength)&&t.length<this._minLength)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minLength}`);if(typeof this._pattern=="string"){if(!new RegExp(this._pattern).test(t))return this.fail(`${this.path} should match pattern "${this._pattern}"`)}else if(this._pattern&&!this._pattern.test(t))return this.fail(`${this.path} should match pattern "${this._pattern.toString()}"`);return!0}minLength(t){return this._minLength=t,this}maxLength(t){return this._maxLength=t,this}pattern(t){return this._pattern=t,this}},Cr=class extends ue{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},ht=class extends ue{validate(t){return!0}},kr=class extends ue{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},Or=class extends ue{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},Pr=class extends ue{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Dr=class extends ue{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 ${Ei(t)}`)}return!0}},Nr=class extends ue{constructor(r){super();this._item=r}validate(r){if(this._optional&&r===void 0)return!0;if(!Array.isArray(r))return this.fail({expect:"array",actual:r});if(Ve(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(Ve(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(Ve(this._length)&&r.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let n=this._item;if(!n)return!0;let i=!0;if(r.forEach((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}},Lr=class extends ue{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(Ii(r)!=="object")return this.fail({expect:"object",actual:r});let i=r,o=this._value;o.errors=this.errors;let a=!0;for(let s in i){let u=i[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?o.path=`${this.path}.${s}`:o.path=`${this.path}["${s}"]`,!(u===void 0&&o._optional)){if(u===void 0&&o.hasDefault){i[s]=o.defaultValue;continue}o.validate(u)||(o.hasFallback?i[s]=o.fallbackValue:a=!1)}}return a}},Ur=class extends ue{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(Ii(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}},Mr=class extends ue{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:Ei(this.value),actual:r}):!0}},Br=class extends ue{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,i=this._items.length;for(let o=0;o<i;o++){let a=this._items[o];if(a.errors=[],a.path=this.path,!a.validate(t))r.push(a.errors.join("; "));else if(!n){n=!0;break}}if(!n){let o=r.join(`
2
+ or `);this.errors.push(o)}return n}},Fr=class extends ue{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}},jr=class extends ue{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},Vr=class extends ue{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 Si(e,t,r="param"){if(e.errors=[],e.path=r,wi(!0),!e.validate(t)){let n=e.errors.join(`
3
+ `);throw e.errors.length=0,wi(!1),new TypeError(n)}}var F,Ri=V(()=>{"use strict";Ai();Ai();F={object(e){return new Ur(e)},array(e){return new Nr(e)},tuple(...e){return new Fr(...e)},literal(e){return new Mr(e)},or(...e){return new Br(...e)},symbol(){return new Cr},record(e){return new Lr(e)},function(){return new Pr},boolean(){return new Tr},string(){return new xr},number(){return new Rr},undefined(){return new kr},null(){return new Or},unknown(){return new ht},any(){return new ht},as(){return new ht},arraybuffer(){return new jr},enum(...e){return new Dr(...e)},typedarray(e){return new Vr(e)}}});var Jr,za,Wa=V(()=>{"use strict";G();Ye();Ri();pi();Jr=1,za=e=>{function t(n,i){return(...o)=>{var h,v,_,w;let a=Date.now(),s={method:n,trace_id:Jr};Jr+=1;let u="SUCCESS",d=`${n}:ok`,y=0;try{if(i.paramsSchema)try{Si(i.paramsSchema,o,"params")}catch(C){throw hi(`${n}:fail ${C.message}`)}let I=i.implement(...o),S=I,b=`${n}:ok`;if(I&&"code"in I){let{code:C,data:P,message:J}=I;u=C,S=P,b=J}return{code:u,message:b,data:S}}catch(I){let S=I;y=(v=(h=S.code)!=null?h:S.errNo)!=null?v:2e3,u="FAILURE";let b=(w=(_=S.message)!=null?_:S.errMsg)!=null?w:`${I}`;return d=`${n}:${u} ${b.replace(/^\S+:(fail|cancel)\s?/,"")}`,Oe(new gr(d,y)),{code:u,message:d}}finally{let I=Date.now()-a;e("apiInvoked",me(Z({},s),{duration:I,status:u}))}}}function r(n,i){return(...o)=>U(this,null,function*(){var v,_,w,I;let a=fa(o)?o:[o],s=Date.now(),u={method:n,trace_id:Jr};Jr+=1;let d=`${n}:ok`,y="SUCCESS",h={code:y,message:d};try{if(i.paramsSchema)try{Si(i.paramsSchema,a,"params")}catch(C){throw hi(C.message)}let b=yield i.implement(...a);if(b&&"code"in b){let{code:C,data:P,message:J}=b;y=C,d=J,b=P}return Object.assign(h,{code:y,message:d,data:b}),h}catch(S){let b=S,C=(_=(v=b.code)!=null?v:b.errNo)!=null?_:2e3;y="FAILURE";let P=(I=(w=b.message)!=null?w:b.errMsg)!=null?I:`${S}`,J=`${n}:${y} ${P.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(h,{code:y,message:J}),Oe(new gr(J,C)),h}finally{let S=Date.now()-s;e("apiInvoked",me(Z({},u),{duration:S,status:y}))}})}return{createAPI:r,createSyncAPI:t}}});var Je,ot,ve,Jt=V(()=>{"use strict";Ga();it();Wa();Ri();({createAPI:Je,createSyncAPI:ot}=za(De)),ve=qa("h5")});var Za=pr((Xa,ki)=>{(function(e){if(typeof Xa=="object"&&typeof ki!="undefined")ki.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window!="undefined"?t=window:typeof global!="undefined"?t=global:typeof self!="undefined"?t=self:t=this,t.localforage=e()}})(function(){var e,t,r;return function n(i,o,a){function s(y,h){if(!o[y]){if(!i[y]){var v=typeof Lt=="function"&&Lt;if(!h&&v)return v(y,!0);if(u)return u(y,!0);var _=new Error("Cannot find module '"+y+"'");throw _.code="MODULE_NOT_FOUND",_}var w=o[y]={exports:{}};i[y][0].call(w.exports,function(I){var S=i[y][1][I];return s(S||I)},w,w.exports,n,i,o,a)}return o[y].exports}for(var u=typeof Lt=="function"&&Lt,d=0;d<a.length;d++)s(a[d]);return s}({1:[function(n,i,o){(function(a){"use strict";var s=a.MutationObserver||a.WebKitMutationObserver,u;if(s){var d=0,y=new s(I),h=a.document.createTextNode("");y.observe(h,{characterData:!0}),u=function(){h.data=d=++d%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var v=new a.MessageChannel;v.port1.onmessage=I,u=function(){v.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?u=function(){var b=a.document.createElement("script");b.onreadystatechange=function(){I(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},a.document.documentElement.appendChild(b)}:u=function(){setTimeout(I,0)};var _,w=[];function I(){_=!0;for(var b,C,P=w.length;P;){for(C=w,w=[],b=-1;++b<P;)C[b]();P=w.length}_=!1}i.exports=S;function S(b){w.push(b)===1&&!_&&u()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,i,o){"use strict";var a=n(1);function s(){}var u={},d=["REJECTED"],y=["FULFILLED"],h=["PENDING"];i.exports=v;function v(R){if(typeof R!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,R!==s&&S(this,R)}v.prototype.catch=function(R){return this.then(null,R)},v.prototype.then=function(R,D){if(typeof R!="function"&&this.state===y||typeof D!="function"&&this.state===d)return this;var O=new this.constructor(s);if(this.state!==h){var B=this.state===y?R:D;w(O,B,this.outcome)}else this.queue.push(new _(O,R,D));return O};function _(R,D,O){this.promise=R,typeof D=="function"&&(this.onFulfilled=D,this.callFulfilled=this.otherCallFulfilled),typeof O=="function"&&(this.onRejected=O,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(R){u.resolve(this.promise,R)},_.prototype.otherCallFulfilled=function(R){w(this.promise,this.onFulfilled,R)},_.prototype.callRejected=function(R){u.reject(this.promise,R)},_.prototype.otherCallRejected=function(R){w(this.promise,this.onRejected,R)};function w(R,D,O){a(function(){var B;try{B=D(O)}catch(z){return u.reject(R,z)}B===R?u.reject(R,new TypeError("Cannot resolve promise with itself")):u.resolve(R,B)})}u.resolve=function(R,D){var O=b(I,D);if(O.status==="error")return u.reject(R,O.value);var B=O.value;if(B)S(R,B);else{R.state=y,R.outcome=D;for(var z=-1,W=R.queue.length;++z<W;)R.queue[z].callFulfilled(D)}return R},u.reject=function(R,D){R.state=d,R.outcome=D;for(var O=-1,B=R.queue.length;++O<B;)R.queue[O].callRejected(D);return R};function I(R){var D=R&&R.then;if(R&&(typeof R=="object"||typeof R=="function")&&typeof D=="function")return function(){D.apply(R,arguments)}}function S(R,D){var O=!1;function B(ye){O||(O=!0,u.reject(R,ye))}function z(ye){O||(O=!0,u.resolve(R,ye))}function W(){D(z,B)}var ne=b(W);ne.status==="error"&&B(ne.value)}function b(R,D){var O={};try{O.value=R(D),O.status="success"}catch(B){O.status="error",O.value=B}return O}v.resolve=C;function C(R){return R instanceof this?R:u.resolve(new this(s),R)}v.reject=P;function P(R){var D=new this(s);return u.reject(D,R)}v.all=J;function J(R){var D=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var O=R.length,B=!1;if(!O)return this.resolve([]);for(var z=new Array(O),W=0,ne=-1,ye=new this(s);++ne<O;)Me(R[ne],ne);return ye;function Me(Pt,cr){D.resolve(Pt).then(Ln,function(ut){B||(B=!0,u.reject(ye,ut))});function Ln(ut){z[cr]=ut,++W===O&&!B&&(B=!0,u.resolve(ye,z))}}}v.race=X;function X(R){var D=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var O=R.length,B=!1;if(!O)return this.resolve([]);for(var z=-1,W=new this(s);++z<O;)ne(R[z]);return W;function ne(ye){D.resolve(ye).then(function(Me){B||(B=!0,u.resolve(W,Me))},function(Me){B||(B=!0,u.reject(W,Me))})}}},{1:1}],3:[function(n,i,o){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=n(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(n,i,o){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l};function s(l,f){if(!(l instanceof f))throw new TypeError("Cannot call a class as a function")}function u(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(l){return}}var d=u();function y(){try{if(!d||!d.open)return!1;var l=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),f=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!l||f)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(c){return!1}}function h(l,f){l=l||[],f=f||{};try{return new Blob(l,f)}catch(p){if(p.name!=="TypeError")throw p;for(var c=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,m=new c,g=0;g<l.length;g+=1)m.append(l[g]);return m.getBlob(f.type)}}typeof Promise=="undefined"&&n(3);var v=Promise;function _(l,f){f&&l.then(function(c){f(null,c)},function(c){f(c)})}function w(l,f,c){typeof f=="function"&&l.then(f),typeof c=="function"&&l.catch(c)}function I(l){return typeof l!="string"&&(console.warn(l+" used as a key, but it is not a string."),l=String(l)),l}function S(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var b="local-forage-detect-blob-support",C=void 0,P={},J=Object.prototype.toString,X="readonly",R="readwrite";function D(l){for(var f=l.length,c=new ArrayBuffer(f),m=new Uint8Array(c),g=0;g<f;g++)m[g]=l.charCodeAt(g);return c}function O(l){return new v(function(f){var c=l.transaction(b,R),m=h([""]);c.objectStore(b).put(m,"key"),c.onabort=function(g){g.preventDefault(),g.stopPropagation(),f(!1)},c.oncomplete=function(){var g=navigator.userAgent.match(/Chrome\/(\d+)/),p=navigator.userAgent.match(/Edge\//);f(p||!g||parseInt(g[1],10)>=43)}}).catch(function(){return!1})}function B(l){return typeof C=="boolean"?v.resolve(C):O(l).then(function(f){return C=f,C})}function z(l){var f=P[l.name],c={};c.promise=new v(function(m,g){c.resolve=m,c.reject=g}),f.deferredOperations.push(c),f.dbReady?f.dbReady=f.dbReady.then(function(){return c.promise}):f.dbReady=c.promise}function W(l){var f=P[l.name],c=f.deferredOperations.pop();if(c)return c.resolve(),c.promise}function ne(l,f){var c=P[l.name],m=c.deferredOperations.pop();if(m)return m.reject(f),m.promise}function ye(l,f){return new v(function(c,m){if(P[l.name]=P[l.name]||Lo(),l.db)if(f)z(l),l.db.close();else return c(l.db);var g=[l.name];f&&g.push(l.version);var p=d.open.apply(d,g);f&&(p.onupgradeneeded=function(E){var A=p.result;try{A.createObjectStore(l.storeName),E.oldVersion<=1&&A.createObjectStore(b)}catch(T){if(T.name==="ConstraintError")console.warn('The database "'+l.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+l.storeName+'" already exists.');else throw T}}),p.onerror=function(E){E.preventDefault(),m(p.error)},p.onsuccess=function(){var E=p.result;E.onversionchange=function(A){A.target.close()},c(E),W(l)}})}function Me(l){return ye(l,!1)}function Pt(l){return ye(l,!0)}function cr(l,f){if(!l.db)return!0;var c=!l.db.objectStoreNames.contains(l.storeName),m=l.version<l.db.version,g=l.version>l.db.version;if(m&&(l.version!==f&&console.warn('The database "'+l.name+`" can't be downgraded from version `+l.db.version+" to version "+l.version+"."),l.version=l.db.version),g||c){if(c){var p=l.db.version+1;p>l.version&&(l.version=p)}return!0}return!1}function Ln(l){return new v(function(f,c){var m=new FileReader;m.onerror=c,m.onloadend=function(g){var p=btoa(g.target.result||"");f({__local_forage_encoded_blob:!0,data:p,type:l.type})},m.readAsBinaryString(l)})}function ut(l){var f=D(atob(l.data));return h([f],{type:l.type})}function No(l){return l&&l.__local_forage_encoded_blob}function Tu(l){var f=this,c=f._initReady().then(function(){var m=P[f._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return w(c,l,l),c}function xu(l){z(l);for(var f=P[l.name],c=f.forages,m=0;m<c.length;m++){var g=c[m];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return l.db=null,Me(l).then(function(p){return l.db=p,cr(l)?Pt(l):p}).then(function(p){l.db=f.db=p;for(var E=0;E<c.length;E++)c[E]._dbInfo.db=p}).catch(function(p){throw ne(l,p),p})}function Be(l,f,c,m){m===void 0&&(m=1);try{var g=l.db.transaction(l.storeName,f);c(null,g)}catch(p){if(m>0&&(!l.db||p.name==="InvalidStateError"||p.name==="NotFoundError"))return v.resolve().then(function(){if(!l.db||p.name==="NotFoundError"&&!l.db.objectStoreNames.contains(l.storeName)&&l.version<=l.db.version)return l.db&&(l.version=l.db.version+1),Pt(l)}).then(function(){return xu(l).then(function(){Be(l,f,c,m-1)})}).catch(c);c(p)}}function Lo(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Cu(l){var f=this,c={db:null};if(l)for(var m in l)c[m]=l[m];var g=P[c.name];g||(g=Lo(),P[c.name]=g),g.forages.push(f),f._initReady||(f._initReady=f.ready,f.ready=Tu);var p=[];function E(){return v.resolve()}for(var A=0;A<g.forages.length;A++){var T=g.forages[A];T!==f&&p.push(T._initReady().catch(E))}var x=g.forages.slice(0);return v.all(p).then(function(){return c.db=g.db,Me(c)}).then(function(k){return c.db=k,cr(c,f._defaultConfig.version)?Pt(c):k}).then(function(k){c.db=g.db=k,f._dbInfo=c;for(var L=0;L<x.length;L++){var j=x[L];j!==f&&(j._dbInfo.db=c.db,j._dbInfo.version=c.version)}})}function ku(l,f){var c=this;l=I(l);var m=new v(function(g,p){c.ready().then(function(){Be(c._dbInfo,X,function(E,A){if(E)return p(E);try{var T=A.objectStore(c._dbInfo.storeName),x=T.get(l);x.onsuccess=function(){var k=x.result;k===void 0&&(k=null),No(k)&&(k=ut(k)),g(k)},x.onerror=function(){p(x.error)}}catch(k){p(k)}})}).catch(p)});return _(m,f),m}function Ou(l,f){var c=this,m=new v(function(g,p){c.ready().then(function(){Be(c._dbInfo,X,function(E,A){if(E)return p(E);try{var T=A.objectStore(c._dbInfo.storeName),x=T.openCursor(),k=1;x.onsuccess=function(){var L=x.result;if(L){var j=L.value;No(j)&&(j=ut(j));var q=l(j,L.key,k++);q!==void 0?g(q):L.continue()}else g()},x.onerror=function(){p(x.error)}}catch(L){p(L)}})}).catch(p)});return _(m,f),m}function Pu(l,f,c){var m=this;l=I(l);var g=new v(function(p,E){var A;m.ready().then(function(){return A=m._dbInfo,J.call(f)==="[object Blob]"?B(A.db).then(function(T){return T?f:Ln(f)}):f}).then(function(T){Be(m._dbInfo,R,function(x,k){if(x)return E(x);try{var L=k.objectStore(m._dbInfo.storeName);T===null&&(T=void 0);var j=L.put(T,l);k.oncomplete=function(){T===void 0&&(T=null),p(T)},k.onabort=k.onerror=function(){var q=j.error?j.error:j.transaction.error;E(q)}}catch(q){E(q)}})}).catch(E)});return _(g,c),g}function Du(l,f){var c=this;l=I(l);var m=new v(function(g,p){c.ready().then(function(){Be(c._dbInfo,R,function(E,A){if(E)return p(E);try{var T=A.objectStore(c._dbInfo.storeName),x=T.delete(l);A.oncomplete=function(){g()},A.onerror=function(){p(x.error)},A.onabort=function(){var k=x.error?x.error:x.transaction.error;p(k)}}catch(k){p(k)}})}).catch(p)});return _(m,f),m}function Nu(l){var f=this,c=new v(function(m,g){f.ready().then(function(){Be(f._dbInfo,R,function(p,E){if(p)return g(p);try{var A=E.objectStore(f._dbInfo.storeName),T=A.clear();E.oncomplete=function(){m()},E.onabort=E.onerror=function(){var x=T.error?T.error:T.transaction.error;g(x)}}catch(x){g(x)}})}).catch(g)});return _(c,l),c}function Lu(l){var f=this,c=new v(function(m,g){f.ready().then(function(){Be(f._dbInfo,X,function(p,E){if(p)return g(p);try{var A=E.objectStore(f._dbInfo.storeName),T=A.count();T.onsuccess=function(){m(T.result)},T.onerror=function(){g(T.error)}}catch(x){g(x)}})}).catch(g)});return _(c,l),c}function Uu(l,f){var c=this,m=new v(function(g,p){if(l<0){g(null);return}c.ready().then(function(){Be(c._dbInfo,X,function(E,A){if(E)return p(E);try{var T=A.objectStore(c._dbInfo.storeName),x=!1,k=T.openKeyCursor();k.onsuccess=function(){var L=k.result;if(!L){g(null);return}l===0||x?g(L.key):(x=!0,L.advance(l))},k.onerror=function(){p(k.error)}}catch(L){p(L)}})}).catch(p)});return _(m,f),m}function Mu(l){var f=this,c=new v(function(m,g){f.ready().then(function(){Be(f._dbInfo,X,function(p,E){if(p)return g(p);try{var A=E.objectStore(f._dbInfo.storeName),T=A.openKeyCursor(),x=[];T.onsuccess=function(){var k=T.result;if(!k){m(x);return}x.push(k.key),k.continue()},T.onerror=function(){g(T.error)}}catch(k){g(k)}})}).catch(g)});return _(c,l),c}function Bu(l,f){f=S.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var m=this,g;if(!l.name)g=v.reject("Invalid arguments");else{var p=l.name===c.name&&m._dbInfo.db,E=p?v.resolve(m._dbInfo.db):Me(l).then(function(A){var T=P[l.name],x=T.forages;T.db=A;for(var k=0;k<x.length;k++)x[k]._dbInfo.db=A;return A});l.storeName?g=E.then(function(A){if(A.objectStoreNames.contains(l.storeName)){var T=A.version+1;z(l);var x=P[l.name],k=x.forages;A.close();for(var L=0;L<k.length;L++){var j=k[L];j._dbInfo.db=null,j._dbInfo.version=T}var q=new v(function(K,le){var ie=d.open(l.name,T);ie.onerror=function(xe){var Nt=ie.result;Nt.close(),le(xe)},ie.onupgradeneeded=function(){var xe=ie.result;xe.deleteObjectStore(l.storeName)},ie.onsuccess=function(){var xe=ie.result;xe.close(),K(xe)}});return q.then(function(K){x.db=K;for(var le=0;le<k.length;le++){var ie=k[le];ie._dbInfo.db=K,W(ie._dbInfo)}}).catch(function(K){throw(ne(l,K)||v.resolve()).catch(function(){}),K})}}):g=E.then(function(A){z(l);var T=P[l.name],x=T.forages;A.close();for(var k=0;k<x.length;k++){var L=x[k];L._dbInfo.db=null}var j=new v(function(q,K){var le=d.deleteDatabase(l.name);le.onerror=function(){var ie=le.result;ie&&ie.close(),K(le.error)},le.onblocked=function(){console.warn('dropInstance blocked for database "'+l.name+'" until all open connections are closed')},le.onsuccess=function(){var ie=le.result;ie&&ie.close(),q(ie)}});return j.then(function(q){T.db=q;for(var K=0;K<x.length;K++){var le=x[K];W(le._dbInfo)}}).catch(function(q){throw(ne(l,q)||v.resolve()).catch(function(){}),q})})}return _(g,f),g}var Fu={_driver:"asyncStorage",_initStorage:Cu,_support:y(),iterate:Ou,getItem:ku,setItem:Pu,removeItem:Du,clear:Nu,length:Lu,key:Uu,keys:Mu,dropInstance:Bu};function ju(){return typeof openDatabase=="function"}var ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vu="~~local_forage_type~",Uo=/^~~local_forage_type~([^~]+)~/,dr="__lfsc__:",Un=dr.length,Mn="arbf",Bn="blob",Mo="si08",Bo="ui08",Fo="uic8",jo="si16",Vo="si32",Jo="ur16",Ho="ui32",$o="fl32",qo="fl64",Go=Un+Mn.length,Ko=Object.prototype.toString;function zo(l){var f=l.length*.75,c=l.length,m,g=0,p,E,A,T;l[l.length-1]==="="&&(f--,l[l.length-2]==="="&&f--);var x=new ArrayBuffer(f),k=new Uint8Array(x);for(m=0;m<c;m+=4)p=ze.indexOf(l[m]),E=ze.indexOf(l[m+1]),A=ze.indexOf(l[m+2]),T=ze.indexOf(l[m+3]),k[g++]=p<<2|E>>4,k[g++]=(E&15)<<4|A>>2,k[g++]=(A&3)<<6|T&63;return x}function Fn(l){var f=new Uint8Array(l),c="",m;for(m=0;m<f.length;m+=3)c+=ze[f[m]>>2],c+=ze[(f[m]&3)<<4|f[m+1]>>4],c+=ze[(f[m+1]&15)<<2|f[m+2]>>6],c+=ze[f[m+2]&63];return f.length%3===2?c=c.substring(0,c.length-1)+"=":f.length%3===1&&(c=c.substring(0,c.length-2)+"=="),c}function Ju(l,f){var c="";if(l&&(c=Ko.call(l)),l&&(c==="[object ArrayBuffer]"||l.buffer&&Ko.call(l.buffer)==="[object ArrayBuffer]")){var m,g=dr;l instanceof ArrayBuffer?(m=l,g+=Mn):(m=l.buffer,c==="[object Int8Array]"?g+=Mo:c==="[object Uint8Array]"?g+=Bo:c==="[object Uint8ClampedArray]"?g+=Fo:c==="[object Int16Array]"?g+=jo:c==="[object Uint16Array]"?g+=Jo:c==="[object Int32Array]"?g+=Vo:c==="[object Uint32Array]"?g+=Ho:c==="[object Float32Array]"?g+=$o:c==="[object Float64Array]"?g+=qo:f(new Error("Failed to get type for BinaryArray"))),f(g+Fn(m))}else if(c==="[object Blob]"){var p=new FileReader;p.onload=function(){var E=Vu+l.type+"~"+Fn(this.result);f(dr+Bn+E)},p.readAsArrayBuffer(l)}else try{f(JSON.stringify(l))}catch(E){console.error("Couldn't convert value into a JSON string: ",l),f(null,E)}}function Hu(l){if(l.substring(0,Un)!==dr)return JSON.parse(l);var f=l.substring(Go),c=l.substring(Un,Go),m;if(c===Bn&&Uo.test(f)){var g=f.match(Uo);m=g[1],f=f.substring(g[0].length)}var p=zo(f);switch(c){case Mn:return p;case Bn:return h([p],{type:m});case Mo:return new Int8Array(p);case Bo:return new Uint8Array(p);case Fo:return new Uint8ClampedArray(p);case jo:return new Int16Array(p);case Jo:return new Uint16Array(p);case Vo:return new Int32Array(p);case Ho:return new Uint32Array(p);case $o:return new Float32Array(p);case qo:return new Float64Array(p);default:throw new Error("Unkown type: "+c)}}var jn={serialize:Ju,deserialize:Hu,stringToBuffer:zo,bufferToString:Fn};function Wo(l,f,c,m){l.executeSql("CREATE TABLE IF NOT EXISTS "+f.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,m)}function $u(l){var f=this,c={db:null};if(l)for(var m in l)c[m]=typeof l[m]!="string"?l[m].toString():l[m];var g=new v(function(p,E){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(A){return E(A)}c.db.transaction(function(A){Wo(A,c,function(){f._dbInfo=c,p()},function(T,x){E(x)})},E)});return c.serializer=jn,g}function We(l,f,c,m,g,p){l.executeSql(c,m,g,function(E,A){A.code===A.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[f.storeName],function(T,x){x.rows.length?p(T,A):Wo(T,f,function(){T.executeSql(c,m,g,p)},p)},p):p(E,A)},p)}function qu(l,f){var c=this;l=I(l);var m=new v(function(g,p){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){We(A,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[l],function(T,x){var k=x.rows.length?x.rows.item(0).value:null;k&&(k=E.serializer.deserialize(k)),g(k)},function(T,x){p(x)})})}).catch(p)});return _(m,f),m}function Gu(l,f){var c=this,m=new v(function(g,p){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){We(A,E,"SELECT * FROM "+E.storeName,[],function(T,x){for(var k=x.rows,L=k.length,j=0;j<L;j++){var q=k.item(j),K=q.value;if(K&&(K=E.serializer.deserialize(K)),K=l(K,q.key,j+1),K!==void 0){g(K);return}}g()},function(T,x){p(x)})})}).catch(p)});return _(m,f),m}function Yo(l,f,c,m){var g=this;l=I(l);var p=new v(function(E,A){g.ready().then(function(){f===void 0&&(f=null);var T=f,x=g._dbInfo;x.serializer.serialize(f,function(k,L){L?A(L):x.db.transaction(function(j){We(j,x,"INSERT OR REPLACE INTO "+x.storeName+" (key, value) VALUES (?, ?)",[l,k],function(){E(T)},function(q,K){A(K)})},function(j){if(j.code===j.QUOTA_ERR){if(m>0){E(Yo.apply(g,[l,T,c,m-1]));return}A(j)}})})}).catch(A)});return _(p,c),p}function Ku(l,f,c){return Yo.apply(this,[l,f,c,1])}function zu(l,f){var c=this;l=I(l);var m=new v(function(g,p){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){We(A,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[l],function(){g()},function(T,x){p(x)})})}).catch(p)});return _(m,f),m}function Wu(l){var f=this,c=new v(function(m,g){f.ready().then(function(){var p=f._dbInfo;p.db.transaction(function(E){We(E,p,"DELETE FROM "+p.storeName,[],function(){m()},function(A,T){g(T)})})}).catch(g)});return _(c,l),c}function Yu(l){var f=this,c=new v(function(m,g){f.ready().then(function(){var p=f._dbInfo;p.db.transaction(function(E){We(E,p,"SELECT COUNT(key) as c FROM "+p.storeName,[],function(A,T){var x=T.rows.item(0).c;m(x)},function(A,T){g(T)})})}).catch(g)});return _(c,l),c}function Qu(l,f){var c=this,m=new v(function(g,p){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){We(A,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[l+1],function(T,x){var k=x.rows.length?x.rows.item(0).key:null;g(k)},function(T,x){p(x)})})}).catch(p)});return _(m,f),m}function Xu(l){var f=this,c=new v(function(m,g){f.ready().then(function(){var p=f._dbInfo;p.db.transaction(function(E){We(E,p,"SELECT key FROM "+p.storeName,[],function(A,T){for(var x=[],k=0;k<T.rows.length;k++)x.push(T.rows.item(k).key);m(x)},function(A,T){g(T)})})}).catch(g)});return _(c,l),c}function Zu(l){return new v(function(f,c){l.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(g,p){for(var E=[],A=0;A<p.rows.length;A++)E.push(p.rows.item(A).name);f({db:l,storeNames:E})},function(g,p){c(p)})},function(m){c(m)})})}function ec(l,f){f=S.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var m=this,g;return l.name?g=new v(function(p){var E;l.name===c.name?E=m._dbInfo.db:E=openDatabase(l.name,"","",0),l.storeName?p({db:E,storeNames:[l.storeName]}):p(Zu(E))}).then(function(p){return new v(function(E,A){p.db.transaction(function(T){function x(q){return new v(function(K,le){T.executeSql("DROP TABLE IF EXISTS "+q,[],function(){K()},function(ie,xe){le(xe)})})}for(var k=[],L=0,j=p.storeNames.length;L<j;L++)k.push(x(p.storeNames[L]));v.all(k).then(function(){E()}).catch(function(q){A(q)})},function(T){A(T)})})}):g=v.reject("Invalid arguments"),_(g,f),g}var tc={_driver:"webSQLStorage",_initStorage:$u,_support:ju(),iterate:Gu,getItem:qu,setItem:Ku,removeItem:zu,clear:Wu,length:Yu,key:Qu,keys:Xu,dropInstance:ec};function rc(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(l){return!1}}function Qo(l,f){var c=l.name+"/";return l.storeName!==f.storeName&&(c+=l.storeName+"/"),c}function nc(){var l="_localforage_support_test";try{return localStorage.setItem(l,!0),localStorage.removeItem(l),!1}catch(f){return!0}}function ic(){return!nc()||localStorage.length>0}function oc(l){var f=this,c={};if(l)for(var m in l)c[m]=l[m];return c.keyPrefix=Qo(l,f._defaultConfig),ic()?(f._dbInfo=c,c.serializer=jn,v.resolve()):v.reject()}function ac(l){var f=this,c=f.ready().then(function(){for(var m=f._dbInfo.keyPrefix,g=localStorage.length-1;g>=0;g--){var p=localStorage.key(g);p.indexOf(m)===0&&localStorage.removeItem(p)}});return _(c,l),c}function sc(l,f){var c=this;l=I(l);var m=c.ready().then(function(){var g=c._dbInfo,p=localStorage.getItem(g.keyPrefix+l);return p&&(p=g.serializer.deserialize(p)),p});return _(m,f),m}function lc(l,f){var c=this,m=c.ready().then(function(){for(var g=c._dbInfo,p=g.keyPrefix,E=p.length,A=localStorage.length,T=1,x=0;x<A;x++){var k=localStorage.key(x);if(k.indexOf(p)===0){var L=localStorage.getItem(k);if(L&&(L=g.serializer.deserialize(L)),L=l(L,k.substring(E),T++),L!==void 0)return L}}});return _(m,f),m}function uc(l,f){var c=this,m=c.ready().then(function(){var g=c._dbInfo,p;try{p=localStorage.key(l)}catch(E){p=null}return p&&(p=p.substring(g.keyPrefix.length)),p});return _(m,f),m}function cc(l){var f=this,c=f.ready().then(function(){for(var m=f._dbInfo,g=localStorage.length,p=[],E=0;E<g;E++){var A=localStorage.key(E);A.indexOf(m.keyPrefix)===0&&p.push(A.substring(m.keyPrefix.length))}return p});return _(c,l),c}function dc(l){var f=this,c=f.keys().then(function(m){return m.length});return _(c,l),c}function fc(l,f){var c=this;l=I(l);var m=c.ready().then(function(){var g=c._dbInfo;localStorage.removeItem(g.keyPrefix+l)});return _(m,f),m}function hc(l,f,c){var m=this;l=I(l);var g=m.ready().then(function(){f===void 0&&(f=null);var p=f;return new v(function(E,A){var T=m._dbInfo;T.serializer.serialize(f,function(x,k){if(k)A(k);else try{localStorage.setItem(T.keyPrefix+l,x),E(p)}catch(L){(L.name==="QuotaExceededError"||L.name==="NS_ERROR_DOM_QUOTA_REACHED")&&A(L),A(L)}})})});return _(g,c),g}function pc(l,f){if(f=S.apply(this,arguments),l=typeof l!="function"&&l||{},!l.name){var c=this.config();l.name=l.name||c.name,l.storeName=l.storeName||c.storeName}var m=this,g;return l.name?g=new v(function(p){l.storeName?p(Qo(l,m._defaultConfig)):p(l.name+"/")}).then(function(p){for(var E=localStorage.length-1;E>=0;E--){var A=localStorage.key(E);A.indexOf(p)===0&&localStorage.removeItem(A)}}):g=v.reject("Invalid arguments"),_(g,f),g}var mc={_driver:"localStorageWrapper",_initStorage:oc,_support:rc(),iterate:lc,getItem:sc,setItem:hc,removeItem:fc,clear:ac,length:dc,key:uc,keys:cc,dropInstance:pc},vc=function(f,c){return f===c||typeof f=="number"&&typeof c=="number"&&isNaN(f)&&isNaN(c)},_c=function(f,c){for(var m=f.length,g=0;g<m;){if(vc(f[g],c))return!0;g++}return!1},Xo=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"},Dt={},Zo={},ct={INDEXEDDB:Fu,WEBSQL:tc,LOCALSTORAGE:mc},gc=[ct.INDEXEDDB._driver,ct.WEBSQL._driver,ct.LOCALSTORAGE._driver],fr=["dropInstance"],Vn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(fr),yc={description:"",driver:gc.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function bc(l,f){l[f]=function(){var c=arguments;return l.ready().then(function(){return l[f].apply(l,c)})}}function Jn(){for(var l=1;l<arguments.length;l++){var f=arguments[l];if(f)for(var c in f)f.hasOwnProperty(c)&&(Xo(f[c])?arguments[0][c]=f[c].slice():arguments[0][c]=f[c])}return arguments[0]}var wc=function(){function l(f){s(this,l);for(var c in ct)if(ct.hasOwnProperty(c)){var m=ct[c],g=m._driver;this[c]=g,Dt[g]||this.defineDriver(m)}this._defaultConfig=Jn({},yc),this._config=Jn({},this._defaultConfig,f),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return l.prototype.config=function(c){if((typeof c=="undefined"?"undefined":a(c))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var m in c){if(m==="storeName"&&(c[m]=c[m].replace(/\W/g,"_")),m==="version"&&typeof c[m]!="number")return new Error("Database version must be a number.");this._config[m]=c[m]}return"driver"in c&&c.driver?this.setDriver(this._config.driver):!0}else return typeof c=="string"?this._config[c]:this._config},l.prototype.defineDriver=function(c,m,g){var p=new v(function(E,A){try{var T=c._driver,x=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!c._driver){A(x);return}for(var k=Vn.concat("_initStorage"),L=0,j=k.length;L<j;L++){var q=k[L],K=!_c(fr,q);if((K||c[q])&&typeof c[q]!="function"){A(x);return}}var le=function(){for(var Nt=function(Ac){return function(){var Sc=new Error("Method "+Ac+" is not implemented by the current driver"),ea=v.reject(Sc);return _(ea,arguments[arguments.length-1]),ea}},Hn=0,Ic=fr.length;Hn<Ic;Hn++){var $n=fr[Hn];c[$n]||(c[$n]=Nt($n))}};le();var ie=function(Nt){Dt[T]&&console.info("Redefining LocalForage driver: "+T),Dt[T]=c,Zo[T]=Nt,E()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(ie,A):ie(!!c._support):ie(!0)}catch(xe){A(xe)}});return w(p,m,g),p},l.prototype.driver=function(){return this._driver||null},l.prototype.getDriver=function(c,m,g){var p=Dt[c]?v.resolve(Dt[c]):v.reject(new Error("Driver not found."));return w(p,m,g),p},l.prototype.getSerializer=function(c){var m=v.resolve(jn);return w(m,c),m},l.prototype.ready=function(c){var m=this,g=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return w(g,c,c),g},l.prototype.setDriver=function(c,m,g){var p=this;Xo(c)||(c=[c]);var E=this._getSupportedDrivers(c);function A(){p._config.driver=p.driver()}function T(L){return p._extend(L),A(),p._ready=p._initStorage(p._config),p._ready}function x(L){return function(){var j=0;function q(){for(;j<L.length;){var K=L[j];return j++,p._dbInfo=null,p._ready=null,p.getDriver(K).then(T).catch(q)}A();var le=new Error("No available storage method found.");return p._driverSet=v.reject(le),p._driverSet}return q()}}var k=this._driverSet!==null?this._driverSet.catch(function(){return v.resolve()}):v.resolve();return this._driverSet=k.then(function(){var L=E[0];return p._dbInfo=null,p._ready=null,p.getDriver(L).then(function(j){p._driver=j._driver,A(),p._wrapLibraryMethodsWithReady(),p._initDriver=x(E)})}).catch(function(){A();var L=new Error("No available storage method found.");return p._driverSet=v.reject(L),p._driverSet}),w(this._driverSet,m,g),this._driverSet},l.prototype.supports=function(c){return!!Zo[c]},l.prototype._extend=function(c){Jn(this,c)},l.prototype._getSupportedDrivers=function(c){for(var m=[],g=0,p=c.length;g<p;g++){var E=c[g];this.supports(E)&&m.push(E)}return m},l.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,m=Vn.length;c<m;c++)bc(this,Vn[c])},l.prototype.createInstance=function(c){return new l(c)},l}(),Ec=new wc;i.exports=Ec},{3:3}]},{},[4])(4)})});var ts=pr(Kr=>{"use strict";G();Jt();it();var Pi=ke(),qd=Je("levelFinished",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),duration:F.number().optional(),rating:F.number().optional(),score:F.number().optional()})),implement:e=>U(Kr,null,function*(){let{levelId:t,duration:r,rating:n,score:i}=e;Ce.info("onLevelFinished",r,n,i),yield Promise.all([nt.reporter({event:"COMPLETE_GAME_LEVEL"}),nt.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i})])})}),Gd=Je("gamePlayEnded",{paramsSchema:F.tuple(F.object({duration:F.number().optional(),rating:F.number().optional(),score:F.number()})),implement:e=>U(Kr,null,function*(){let{duration:t,rating:r,score:n}=e;return Ce.info("onGamePlayEnded",t,r,n),nt.tracker("GamePlayEnded",{duration:t,rating:r,score:n})})}),Kd=Je("levelUpgrade",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),name:F.string().optional()})),implement:r=>U(Kr,[r],function*({levelId:e,name:t}){return nt.tracker("LevelUpgrade",{name:t,levelId:e})})});Pi.registerCommand("TaskTrackerSDK.levelFinished",qd);Pi.registerCommand("TaskTrackerSDK.gamePlayEnded",Gd);Pi.registerCommand("TaskTrackerSDK.levelUpgrade",Kd);ve("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ve("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ve("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var mt,pt,rs,Di,zd,Ni,Li=V(()=>{"use strict";mt=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},pt=new Map,rs=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=pt.get(t.type);r&&r.forEach(n=>{try{n(t.data)}catch(i){console.warn("Callback execution failed:",i)}})}}catch(t){console.warn("Failed to parse message:",t)}},Di=!1,zd=()=>{Di||(window.addEventListener("message",rs),Di=!0)},Ni=(e,t)=>{zd(),pt.has(e)||pt.set(e,new Set);let r=pt.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&pt.delete(e),pt.size===0&&(window.removeEventListener("message",rs),Di=!1)}}});var _t,zr,Wr,Yr,Qr,ns,vt,Wd,fe,gt,at=V(()=>{"use strict";G();_t="UNLOCK_OPTIONS_CHANGED",zr="INVOKE_PAYMENT",Wr="ON_PAYMENT_RESULT",Yr="ON_USE_MODAL_EVENT",Qr="ON_USE_MODAL_RESULT",ns="ON_USE_MODAL_FREQUENCY",vt=new Pe,Wd=()=>({on:vt.on.bind(vt),off:vt.off.bind(vt),emit:vt.emit.bind(vt)}),fe=Wd(),gt={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}}});function os(){let e=new Map,t,r;return{registerRewardHandler(i,o){e.set(i,o)},handleReward(i,...o){return U(this,null,function*(){return yield i.reduce((s,u)=>U(this,null,function*(){let d=yield s;if(d===!0)return!0;is&&console.log(`handleReward ${u}`);let y=e.get(u),h=y?yield y(...o):d;return is&&console.log(`handleReward ${u} ${h}`),h}),Promise.resolve(!1))})},registerRewardsFetcher(i){return U(this,null,function*(){t=(...o)=>U(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),["ADS"]}})})},registerRewardFrequencyConfigFetcher(i){return U(this,null,function*(){r=(...o)=>U(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),{joliCoinUseAndCharge:gt}}})})},getRewardsTypes(...i){return U(this,null,function*(){return t?yield t(...i):["ADS"]})},getRewardFrequencyConfig(...i){return U(this,null,function*(){return r?yield r(...i):{joliCoinUseAndCharge:gt}})}}}var is,as=V(()=>{"use strict";we();at();is=N.testMode});var Yd,Qd,ss,ls,us=V(()=>{"use strict";at();Yd=()=>(e,t)=>e==="JOLI_COIN"&&t==="ADS"?-1:e==="ADS"&&t==="JOLI_COIN"?1:0,Qd=e=>e.length?e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(Yd()):["ADS"],ss=e=>{e.registerRewardsFetcher(t=>U(void 0,null,function*(){var n,i,o,a;let r=["ADS"];try{let s=yield t.post("/api/games/unlock-options",{});if(s.code!=="SUCCESS")return r;fe.emit(_t,{options:((n=s.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=s.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1}});let u=((a=(o=s.data)==null?void 0:o.unlockOptions)==null?void 0:a.map(d=>d.type))||Array.from(r);return Qd(u)}catch(s){return console.error("getRewardOptions error:",s),r}}))},ls=e=>{e.registerRewardFrequencyConfigFetcher(t=>U(void 0,null,function*(){var n,i;let r=yield t.get("/api/fe-configs/web-common/global-config",{});return fe.emit(ns,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||gt}),{joliCoinUseAndCharge:((i=r.data)==null?void 0:i.joliCoinUseAndCharge)||gt}}))}});var cs,ds=V(()=>{"use strict";cs=e=>t=>U(void 0,null,function*(){return console.log("trigger @jolibox/ads reward",t),e.adBreak(t),!0})});function st(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)}}var Xr=V(()=>{"use strict"});var fs,hs=V(()=>{"use strict";fs=(e,t)=>e.some(r=>r.type==="JOLI_COIN"&&r.joliCoinChoices.some(n=>{var i;return n.joliCoinQuantity<=((i=t==null?void 0:t.balance)!=null?i:0)}))});var Zr,en,tn,rn=V(()=>{"use strict";we();G();at();hs();Xr();Zr=(e,t)=>r=>U(void 0,null,function*(){let n=st(fe,Wr);return fe.emit(zr,e,{userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,enableAutoDeduct:r.userJoliCoin.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult}),en=(e,t)=>r=>U(void 0,null,function*(){let n=st(fe,Qr);return fe.emit(Yr,e,{enableAutoDeduct:r.enableAutoDeduct,userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult}),tn=(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:r,unlockOptionsHandler:n,initiateAndAwaitPayment:i,showUnlockWithJolicoinModal:o}})=>a=>U(void 0,null,function*(){var s,u,d,y,h,v,_;try{let w=!1,I=yield n.getData(),S=(d=(u=(s=I==null?void 0:I.options)==null?void 0:s.find(P=>P.type==="JOLI_COIN"))==null?void 0:u.joliCoinChoices[0].joliCoinQuantity)!=null?d:0;if(!fs((I==null?void 0:I.options)||[],I==null?void 0:I.userJoliCoin)){if((yield i({userJoliCoin:I==null?void 0:I.userJoliCoin,joliCoinQuantity:S}))!=="SUCCESS")return r==null||r(a),!1;w=!0}let b=!!((y=I==null?void 0:I.userJoliCoin)!=null&&y.enableAutoDeduct);if(!w&&(yield o({enableAutoDeduct:b,userJoliCoin:I==null?void 0:I.userJoliCoin,joliCoinQuantity:S}))!=="CONFIRM")return r==null||r(a),!1;let C=yield e.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${ft()}-${N.mpType}-${Date.now()}`,gameInfo:{gameId:N.mpId}}});return C.code=="SUCCESS"?((v=a.adBreakDone)==null||v.call(a,{breakType:a.type,breakName:"name"in a&&(h=a.name)!=null?h:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in a&&((_=a.adViewed)==null||_.call(a)),t==null||t({quantity:C.data.quantity,balance:C.data.balance}),!0):(r==null||r(a),!1)}catch(w){if(console.info("JolicoinRewardHandler error:",w),w instanceof Error&&w.message=="CANCEL")throw w;return r==null||r(a),!1}finally{n.clearCache()}})});var ps,ms=V(()=>{"use strict";at();Xr();rn();rn();ps=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=st(fe,_t),i=()=>{r==null||r()},o=en("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),a=Zr("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"});return tn(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:i,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:o}})}});var vs,_s=V(()=>{"use strict";at();rn();Xr();vs=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=st(fe,_t),i=u=>{var d;r==null||r(),(d=u.adBreakDone)==null||d.call(u,{breakType:u.type,breakFormat:u.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},o=en("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),a=Zr("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"});return tn(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:i,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:o}})}});var Qe,gs=V(()=>{"use strict";as();us();ds();ms();_s();Qe=os();ss(Qe);ls(Qe)});function He(e,t){for(var r in t)e[r]=t[r];return e}function ji(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Gt(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?sn.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return on(e,a,n,i,null)}function on(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++Is:i,__i:-1,__u:0};return i==null&&M.vnode!=null&&M.vnode(o),o}function Xe(e){return e.children}function Ae(e,t){this.props=e,this.context=t}function yt(e,t){if(t==null)return e.__?yt(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?yt(e):null}function xs(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return xs(e)}}function bs(e){(!e.__d&&(e.__d=!0)&&lt.push(e)&&!an.__r++||ys!==M.debounceRendering)&&((ys=M.debounceRendering)||As)(an)}function an(){for(var e,t,r,n,i,o,a,s=1;lt.length;)lt.length>s&&lt.sort(Ss),e=lt.shift(),s=lt.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=He({},n)).__v=n.__v+1,M.vnode&&M.vnode(r),Vi(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i==null?yt(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,Os(o,r,a),r.__e!=i&&xs(r)));an.__r=0}function Cs(e,t,r,n,i,o,a,s,u,d,y){var h,v,_,w,I,S,b=n&&n.__k||Ts,C=t.length;for(u=ef(r,t,b,u,C),h=0;h<C;h++)(_=r.__k[h])!=null&&(v=_.__i===-1?$t:b[_.__i]||$t,_.__i=h,S=Vi(e,_,v,i,o,a,s,u,d,y),w=_.__e,_.ref&&v.ref!=_.ref&&(v.ref&&Ji(v.ref,null,_),y.push(_.ref,_.__c||w,_)),I==null&&w!=null&&(I=w),4&_.__u||v.__k===_.__k?u=ks(_,u,e):typeof _.type=="function"&&S!==void 0?u=S:w&&(u=w.nextSibling),_.__u&=-7);return r.__e=I,u}function ef(e,t,r,n,i){var o,a,s,u,d,y=r.length,h=y,v=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+v,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?on(null,a,null,null,null):qt(a)?on(Xe,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?on(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,(d=a.__i=tf(a,r,u,h))!==-1&&(h--,(s=r[d])&&(s.__u|=2)),s==null||s.__v===null?(d==-1&&(i>y?v--:i<y&&v++),typeof a.type!="function"&&(a.__u|=4)):d!=u&&(d==u-1?v--:d==u+1?v++:(d>u?v--:v++,a.__u|=4))):e.__k[o]=null;if(h)for(o=0;o<y;o++)(s=r[o])!=null&&!(2&s.__u)&&(s.__e==n&&(n=yt(s)),Ds(s,s));return n}function ks(e,t,r){var n,i;if(typeof e.type=="function"){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=ks(n[i],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=yt(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Kt(e,t){return t=t||[],e==null||typeof e=="boolean"||(qt(e)?e.some(function(r){Kt(r,t)}):t.push(e)),t}function tf(e,t,r,n){var i,o,a=e.key,s=e.type,u=t[r];if(u===null&&e.key==null||u&&a==u.key&&s===u.type&&!(2&u.__u))return r;if(n>(u!=null&&!(2&u.__u)?1:0))for(i=r-1,o=r+1;i>=0||o<t.length;){if(i>=0){if((u=t[i])&&!(2&u.__u)&&a==u.key&&s===u.type)return i;i--}if(o<t.length){if((u=t[o])&&!(2&u.__u)&&a==u.key&&s===u.type)return o;o++}}return-1}function ws(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||Zd.test(t)?r:r+"px"}function nn(e,t,r,n,i){var o;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||ws(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||ws(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(Rs,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.t=n.t:(r.t=Fi,e.addEventListener(t,o?Mi:Ui,o)):e.removeEventListener(t,o?Mi:Ui,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r==null?"":r;break e}catch(a){}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function Es(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=Fi++;else if(t.u<r.t)return;return r(M.event?M.event(t):t)}}}function Vi(e,t,r,n,i,o,a,s,u,d){var y,h,v,_,w,I,S,b,C,P,J,X,R,D,O,B,z,W=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),o=[s=t.__e=r.__e]),(y=M.__b)&&y(t);e:if(typeof W=="function")try{if(b=t.props,C="prototype"in W&&W.prototype.render,P=(y=W.contextType)&&n[y.__c],J=y?P?P.props.value:y.__:n,r.__c?S=(h=t.__c=r.__c).__=h.__E:(C?t.__c=h=new W(b,J):(t.__c=h=new Ae(b,J),h.constructor=W,h.render=nf),P&&P.sub(h),h.props=b,h.state||(h.state={}),h.context=J,h.__n=n,v=h.__d=!0,h.__h=[],h._sb=[]),C&&h.__s==null&&(h.__s=h.state),C&&W.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=He({},h.__s)),He(h.__s,W.getDerivedStateFromProps(b,h.__s))),_=h.props,w=h.state,h.__v=t,v)C&&W.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),C&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(C&&W.getDerivedStateFromProps==null&&b!==_&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(b,J),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(b,h.__s,J)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(ne){ne&&(ne.__=t)}),X=0;X<h._sb.length;X++)h.__h.push(h._sb[X]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(b,h.__s,J),C&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(_,w,I)})}if(h.context=J,h.props=b,h.__P=e,h.__e=!1,R=M.__r,D=0,C){for(h.state=h.__s,h.__d=!1,R&&R(t),y=h.render(h.props,h.state,h.context),O=0;O<h._sb.length;O++)h.__h.push(h._sb[O]);h._sb=[]}else do h.__d=!1,R&&R(t),y=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++D<25);h.state=h.__s,h.getChildContext!=null&&(n=He(He({},n),h.getChildContext())),C&&!v&&h.getSnapshotBeforeUpdate!=null&&(I=h.getSnapshotBeforeUpdate(_,w)),B=y,y!=null&&y.type===Xe&&y.key==null&&(B=Ps(y.props.children)),s=Cs(e,qt(B)?B:[B],t,r,n,i,o,a,s,u,d),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),S&&(h.__E=h.__=null)}catch(ne){if(t.__v=null,u||o!=null)if(ne.then){for(t.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else for(z=o.length;z--;)ji(o[z]);else t.__e=r.__e,t.__k=r.__k;M.__e(ne,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=rf(r.__e,t,r,n,i,o,a,u,d);return(y=M.diffed)&&y(t),128&t.__u?void 0:s}function Os(e,t,r){for(var n=0;n<r.length;n++)Ji(r[n],r[++n],r[++n]);M.__c&&M.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){M.__e(o,i.__v)}})}function Ps(e){return typeof e!="object"||e==null?e:qt(e)?e.map(Ps):He({},e)}function rf(e,t,r,n,i,o,a,s,u){var d,y,h,v,_,w,I,S=r.props,b=t.props,C=t.type;if(C=="svg"?i="http://www.w3.org/2000/svg":C=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(d=0;d<o.length;d++)if((_=o[d])&&"setAttribute"in _==!!C&&(C?_.localName==C:_.nodeType==3)){e=_,o[d]=null;break}}if(e==null){if(C==null)return document.createTextNode(b);e=document.createElementNS(i,C,b.is&&b),s&&(M.__m&&M.__m(t,o),s=!1),o=null}if(C===null)S===b||s&&e.data===b||(e.data=b);else{if(o=o&&sn.call(e.childNodes),S=r.props||$t,!s&&o!=null)for(S={},d=0;d<e.attributes.length;d++)S[(_=e.attributes[d]).name]=_.value;for(d in S)if(_=S[d],d!="children"){if(d=="dangerouslySetInnerHTML")h=_;else if(!(d in b)){if(d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b)continue;nn(e,d,null,_,i)}}for(d in b)_=b[d],d=="children"?v=_:d=="dangerouslySetInnerHTML"?y=_:d=="value"?w=_:d=="checked"?I=_:s&&typeof _!="function"||S[d]===_||nn(e,d,_,S[d],i);if(y)s||h&&(y.__html===h.__html||y.__html===e.innerHTML)||(e.innerHTML=y.__html),t.__k=[];else if(h&&(e.innerHTML=""),Cs(t.type==="template"?e.content:e,qt(v)?v:[v],t,r,n,C=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&yt(r,0),s,u),o!=null)for(d=o.length;d--;)ji(o[d]);s||(d="value",C=="progress"&&w==null?e.removeAttribute("value"):w!==void 0&&(w!==e[d]||C=="progress"&&!w||C=="option"&&w!==S[d])&&nn(e,d,w,S[d],i),d="checked",I!==void 0&&I!==e[d]&&nn(e,d,I,S[d],i))}return e}function Ji(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){M.__e(i,r)}}function Ds(e,t,r){var n,i;if(M.unmount&&M.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Ji(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){M.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Ds(n[i],t,r||typeof e.type!="function");r||ji(e.__e),e.__c=e.__=e.__e=void 0}function nf(e,t,r){return this.constructor(e,r)}function Ns(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),M.__&&M.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],Vi(t,e=(!n&&r||t).__k=Gt(Xe,null,[e]),i||$t,$t,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?sn.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),Os(o,e,a)}var sn,M,Is,Bi,lt,ys,As,Ss,Rs,Fi,Ui,Mi,Xd,$t,Ts,Zd,qt,zt=V(()=>{$t={},Ts=[],Zd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qt=Array.isArray;sn=Ts.slice,M={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},Is=0,Bi=function(e){return e!=null&&e.constructor==null},Ae.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=He({},this.state),typeof e=="function"&&(e=e(He({},r),this.props)),e&&He(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),bs(this))},Ae.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),bs(this))},Ae.prototype.render=Xe,lt=[],As=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ss=function(e,t){return e.__v.__b-t.__v.__b},an.__r=0,Rs=/(PointerCapture)$|Capture$/i,Fi=0,Ui=Es(!1),Mi=Es(!0),Xd=0});function un(e,t){ae.__h&&ae.__h(re,e,Wt||t),Wt=0;var r=re.__H||(re.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function cn(e){return Wt=1,$s(qs,e)}function $s(e,t,r){var n=un(bt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):qs(void 0,t),function(s){var u=n.__N?n.__N[0]:n.__[0],d=n.t(u,s);u!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=re,!re.__f)){var i=function(s,u,d){if(!n.__c.__H)return!0;var y=n.__c.__H.__.filter(function(v){return!!v.__c});if(y.every(function(v){return!v.__N}))return!o||o.call(this,s,u,d);var h=n.__c.props!==s;return y.forEach(function(v){if(v.__N){var _=v.__[0];v.__=v.__N,v.__N=void 0,_!==v.__[0]&&(h=!0)}}),o&&o.call(this,s,u,d)||h};re.__f=!0;var o=re.shouldComponentUpdate,a=re.componentWillUpdate;re.componentWillUpdate=function(s,u,d){if(this.__e){var y=o;o=void 0,i(s,u,d),o=y}a&&a.call(this,s,u,d)},re.shouldComponentUpdate=i}return n.__N||n.__}function Yt(e,t){var r=un(bt++,3);!ae.__s&&zi(r.__H,t)&&(r.__=e,r.u=t,re.__H.__h.push(r))}function qi(e,t){var r=un(bt++,4);!ae.__s&&zi(r.__H,t)&&(r.__=e,r.u=t,re.__h.push(r))}function Gi(e){return Wt=5,Qt(function(){return{current:e}},[])}function Qt(e,t){var r=un(bt++,7);return zi(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Ki(e,t){return Wt=8,Qt(function(){return e},t)}function of(){for(var e;e=Hs.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ln),e.__H.__h.forEach($i),e.__H.__h=[]}catch(t){e.__H.__h=[],ae.__e(t,e.__v)}}function af(e){var t,r=function(){clearTimeout(n),Js&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Js&&(t=requestAnimationFrame(r))}function ln(e){var t=re,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),re=t}function $i(e){var t=re;e.__c=e.__(),re=t}function zi(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function qs(e,t){return typeof t=="function"?t(e):t}var bt,re,Hi,Ls,Wt,Hs,ae,Us,Ms,Bs,Fs,js,Vs,Js,Wi=V(()=>{zt();Wt=0,Hs=[],ae=M,Us=ae.__b,Ms=ae.__r,Bs=ae.diffed,Fs=ae.__c,js=ae.unmount,Vs=ae.__;ae.__b=function(e){re=null,Us&&Us(e)},ae.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Vs&&Vs(e,t)},ae.__r=function(e){Ms&&Ms(e),bt=0;var t=(re=e.__c).__H;t&&(Hi===re?(t.__h=[],re.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(ln),t.__h.forEach($i),t.__h=[],bt=0)),Hi=re},ae.diffed=function(e){Bs&&Bs(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Hs.push(t)!==1&&Ls===ae.requestAnimationFrame||((Ls=ae.requestAnimationFrame)||af)(of)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Hi=re=null},ae.__c=function(e,t){t.some(function(r){try{r.__h.forEach(ln),r.__h=r.__h.filter(function(n){return!n.__||$i(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],ae.__e(n,r.__v)}}),Fs&&Fs(e,t)},ae.unmount=function(e){js&&js(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{ln(n)}catch(i){t=i}}),r.__H=void 0,t&&ae.__e(t,r.__v))};Js=typeof requestAnimationFrame=="function"});function lf(e,t){for(var r in t)e[r]=t[r];return e}function Gs(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function Ks(e,t){this.props=e,this.context=t}function rl(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=lf({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return rl(n,t,r)})),e}function nl(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return nl(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function Yi(){this.__u=0,this.o=null,this.__b=null}function il(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function dn(){this.i=null,this.l=null}function Qi(e,t,r){return t.__k==null&&(t.textContent=""),Ns(e,t),typeof r=="function"&&r(),e?e.__c:null}function vf(){}function _f(){return this.cancelBubble}function gf(){return this.defaultPrevented}var zs,_g,uf,Ws,Ys,cf,df,ff,hf,pf,mf,Qs,ol,yf,Xs,Zs,el,al=V(()=>{zt();zt();Wi();Wi();(Ks.prototype=new Ae).isPureReactComponent=!0,Ks.prototype.shouldComponentUpdate=function(e,t){return Gs(this.props,e)||Gs(this.state,t)};zs=M.__b;M.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),zs&&zs(e)};_g=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911,uf=M.__e;M.__e=function(e,t,r,n){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}uf(e,t,r,n)};Ws=M.unmount;M.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ws&&Ws(e)},(Yi.prototype=new Ae).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=il(n.__v),o=!1,a=function(){o||(o=!0,r.__R=null,i?i(s):s())};r.__R=a;var s=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=nl(u,u.__c.__P,u.__c.__O)}var d;for(n.setState({__a:n.__b=null});d=n.o.pop();)d.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},Yi.prototype.componentWillUnmount=function(){this.o=[]},Yi.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=rl(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&Gt(Xe,null,e.fallback);return i&&(i.__u&=-33),[Gt(Xe,null,t.__a?null:e.children),i]};Ys=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(dn.prototype=new Ae).__a=function(e){var t=this,r=il(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),Ys(t,e,n)):i()};r?r(o):o()}},dn.prototype.render=function(e){this.i=null,this.l=new Map;var t=Kt(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},dn.prototype.componentDidUpdate=dn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Ys(e,r,t)})};cf=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,df=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,ff=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,hf=/[A-Z0-9]/g,pf=typeof document!="undefined",mf=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};Ae.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Ae.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});Qs=M.event;M.event=function(e){return Qs&&(e=Qs(e)),e.persist=vf,e.isPropagationStopped=_f,e.isDefaultPrevented=gf,e.nativeEvent=e};yf={enumerable:!1,configurable:!0,get:function(){return this.class}},Xs=M.vnode;M.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={},o=n.indexOf("-")===-1;for(var a in r){var s=r[a];if(!(a==="value"&&"defaultValue"in r&&s==null||pf&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var u=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&s===!0?s="":u==="translate"&&s==="no"?s=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?a="ondblclick":u!=="onchange"||n!=="input"&&n!=="textarea"||mf(r.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":ff.test(a)&&(a=u):u=a="oninput":o&&df.test(a)?a=a.replace(hf,"-$&").toLowerCase():s===null&&(s=void 0),u==="oninput"&&i[a=u]&&(a="oninputCapture"),i[a]=s}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=Kt(r.children).forEach(function(d){d.props.selected=i.value.indexOf(d.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=Kt(r.children).forEach(function(d){d.props.selected=i.multiple?i.defaultValue.indexOf(d.props.value)!=-1:i.defaultValue==d.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",yf)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=cf,Xs&&Xs(e)};Zs=M.__r;M.__r=function(e){Zs&&Zs(e),ol=e.__c};el=M.diffed;M.diffed=function(e){el&&el(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),ol=null}});function Se(e,t,r){return(t=If(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function If(e){var t=Af(e,"string");return typeof t=="symbol"?t:t+""}function Af(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fn(e,t,r){return(t=Sf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sf(e){var t=Rf(e,"string");return typeof t=="symbol"?t:t+""}function Rf(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 Lf(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Uf(e){return typeof e=="string"}function Mf(e){return typeof e=="undefined"}function Bf(e){return Mf(e)||e===null}function Ff(e){return typeof e=="function"}function Dl(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 Xt(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}function mn(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 Gf(e){let t=e.location?mn(e.location,fl):null,r=e.target?mn(e.target,fl):null;return mn(Pf(Of({},e),{location:t,target:r}),$f)}function Kf(e){let t=e.events.map(n=>Gf(n)),r=mn(e.device,qf);return[e.protocolVersion,t,r,e.project]}function zf(){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 Zf(e){return new Promise(t=>Ml(e)(t))}function Ml(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 eh(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new nr(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 rh(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)nh(e[n],t[n])}function nh(e,t){if(Uf(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Ff(t)){try{if(e instanceof t)return}catch(r){}if(!Bf(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 Zi(e,t,r){return(t=ih(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ih(e){var t=oh(e,"string");return typeof t=="symbol"?t:t+""}function oh(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 hn(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=sh(e,"string");return typeof t=="symbol"?t:t+""}function sh(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 $e(e,t,r){return(t=lh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lh(e){var t=uh(e,"string");return typeof t=="symbol"?t:t+""}function uh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ch(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 dh(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 _h(e,t){return he(e,0)^45?(((t<<2^he(e,0))<<2^he(e,1))<<2^he(e,2))<<2^he(e,3):0}function jl(e){return e.trim()}function gh(e,t){return(e=t.exec(e))?e[0]:e}function $(e,t,r){return e.replace(t,r)}function po(e,t){return e.indexOf(t)}function he(e,t){return e.charCodeAt(t)|0}function ir(e,t,r){return e.slice(t,r)}function Le(e){return e.length}function So(e){return e.length}function pn(e,t){return t.push(e),e}function yh(e,t){return e.map(t).join("")}function xn(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:Tn,column:At,length:a,return:""}}function er(e,t){return vh(xn("",null,null,"",null,null,0),e,{length:-e.length},t)}function bh(){return ce}function wh(){return ce=Ie>0?he(St,--Ie):0,At--,ce===10&&(At=1,Tn--),ce}function Te(){return ce=Ie<Vl?he(St,Ie++):0,At++,ce===10&&(At=1,Tn++),ce}function Ue(){return he(St,Ie)}function vn(){return Ie}function ar(e,t){return ir(St,e,t)}function or(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 Jl(e){return Tn=At=1,Vl=Le(St=e),Ie=0,[]}function Hl(e){return St="",e}function _n(e){return jl(ar(Ie-1,mo(e===91?e+2:e===40?e+1:e)))}function Eh(e){for(;(ce=Ue())&&ce<33;)Te();return or(e)>2||or(ce)>3?"":" "}function Ih(e,t){for(;--t&&Te()&&!(ce<48||ce>102||ce>57&&ce<65||ce>70&&ce<97););return ar(e,vn()+(t<6&&Ue()==32&&Te()==32))}function mo(e){for(;Te();)switch(ce){case e:return Ie;case 34:case 39:e!==34&&e!==39&&mo(ce);break;case 40:e===41&&mo(e);break;case 92:Te();break}return Ie}function Ah(e,t){for(;Te()&&e+ce!==57&&!(e+ce===84&&Ue()===47););return"/*"+ar(t,Ie-1)+"*"+Rn(e===47?e:Te())}function Sh(e){for(;!or(Ue());)Te();return ar(e,Ie)}function Rh(e){return Hl(gn("",null,null,null,[""],e=Jl(e),0,[0],e))}function gn(e,t,r,n,i,o,a,s,u){for(var d=0,y=0,h=a,v=0,_=0,w=0,I=1,S=1,b=1,C=0,P="",J=i,X=o,R=n,D=P;S;)switch(w=C,C=Te()){case 40:if(w!=108&&he(D,h-1)==58){po(D+=$(_n(C),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:D+=_n(C);break;case 9:case 10:case 13:case 32:D+=Eh(w);break;case 92:D+=Ih(vn()-1,7);continue;case 47:switch(Ue()){case 42:case 47:pn(Th(Ah(Te(),vn()),t,r),u);break;default:D+="/"}break;case 123*I:s[d++]=Le(D)*b;case 125*I:case 59:case 0:switch(C){case 0:case 125:S=0;case 59+y:b==-1&&(D=$(D,/\f/g,"")),_>0&&Le(D)-h&&pn(_>32?ml(D+";",n,r,h-1):ml($(D," ","")+";",n,r,h-2),u);break;case 59:D+=";";default:if(pn(R=pl(D,t,r,d,y,i,s,P,J=[],X=[],h),o),C===123)if(y===0)gn(D,t,R,R,J,o,h,s,X);else switch(v===99&&he(D,3)===110?100:v){case 100:case 108:case 109:case 115:gn(e,R,R,n&&pn(pl(e,R,R,0,0,i,s,P,i,J=[],h),X),i,X,h,s,n?J:X);break;default:gn(D,R,R,R,[""],X,0,s,X)}}d=y=_=0,I=b=1,P=D="",h=a;break;case 58:h=1+Le(D),_=w;default:if(I<1){if(C==123)--I;else if(C==125&&I++==0&&wh()==125)continue}switch(D+=Rn(C),C*I){case 38:b=y>0?1:(D+="\f",-1);break;case 44:s[d++]=(Le(D)-1)*b,b=1;break;case 64:Ue()===45&&(D+=_n(Te())),v=Ue(),y=h=Le(P=D+=Sh(vn())),C++;break;case 45:w===45&&Le(D)==2&&(I=0)}}return o}function pl(e,t,r,n,i,o,a,s,u,d,y){for(var h=i-1,v=i===0?o:[""],_=So(v),w=0,I=0,S=0;w<n;++w)for(var b=0,C=ir(e,h+1,h=mh(I=a[w])),P=e;b<_;++b)(P=jl(I>0?v[b]+" "+C:$(C,/&\f/g,v[b])))&&(u[S++]=P);return xn(e,t,r,i===0?Io:s,u,d,y)}function Th(e,t,r){return xn(e,t,r,Bl,Rn(bh()),ir(e,2,-2),0)}function ml(e,t,r,n){return xn(e,t,r,Ao,ir(e,0,n),ir(e,n+1,-1),n)}function It(e,t){for(var r="",n=So(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function xh(e,t,r,n){switch(e.type){case ph:if(e.children.length)break;case hh:case Ao:return e.return=e.return||e.value;case Bl:return"";case Fl:return e.return=e.value+"{"+It(e.children,n)+"}";case Io:e.value=e.props.join(",")}return Le(r=It(e.children,n))?e.return=e.value+"{"+r+"}":""}function Ch(e){var t=So(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 kh(e){return function(t){t.root||(t=t.return)&&e(t)}}function Oh(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}function $l(e,t){switch(_h(e,t)){case 5103:return H+"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 H+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return H+e+wn+e+_e+e+e;case 6828:case 4268:return H+e+_e+e+e;case 6165:return H+e+_e+"flex-"+e+e;case 5187:return H+e+$(e,/(\w+).+(:[^]+)/,H+"box-$1$2"+_e+"flex-$1$2")+e;case 5443:return H+e+_e+"flex-item-"+$(e,/flex-|-self/,"")+e;case 4675:return H+e+_e+"flex-line-pack"+$(e,/align-content|flex-|-self/,"")+e;case 5548:return H+e+_e+$(e,"shrink","negative")+e;case 5292:return H+e+_e+$(e,"basis","preferred-size")+e;case 6060:return H+"box-"+$(e,"-grow","")+H+e+_e+$(e,"grow","positive")+e;case 4554:return H+$(e,/([^-])(transform)/g,"$1"+H+"$2")+e;case 6187:return $($($(e,/(zoom-|grab)/,H+"$1"),/(image-set)/,H+"$1"),e,"")+e;case 5495:case 3959:return $(e,/(image-set\([^]*)/,H+"$1$`$1");case 4968:return $($(e,/(.+:)(flex-)?(.*)/,H+"box-pack:$3"+_e+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+H+e+e;case 4095:case 3583:case 4068:case 2532:return $(e,/(.+)-inline(.+)/,H+"$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(Le(e)-1-t>6)switch(he(e,t+1)){case 109:if(he(e,t+4)!==45)break;case 102:return $(e,/(.+:)(.+)-([^]+)/,"$1"+H+"$2-$3$1"+wn+(he(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~po(e,"stretch")?$l($(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(he(e,t+1)!==115)break;case 6444:switch(he(e,Le(e)-3-(~po(e,"!important")&&10))){case 107:return $(e,":",":"+H)+e;case 101:return $(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+H+(he(e,14)===45?"inline-":"")+"box$3$1"+H+"$2$3$1"+_e+"$2box$3")+e}break;case 5936:switch(he(e,t+11)){case 114:return H+e+_e+$(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return H+e+_e+$(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return H+e+_e+$(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return H+e+_e+e+e}return e}function jh(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 En(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 Ze={name:i.name,styles:i.styles,next:Ze},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)Ze={name:a.name,styles:a.styles,next:Ze},a=a.next;var s=o.styles+";";return s}return $h(e,t,r)}}var u=r;if(t==null)return u;var d=t[u];return d!==void 0?d:u}function $h(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=En(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]+"}":_l(s)&&(n+=eo(o)+":"+gl(o,s)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var u=0;u<a.length;u++)_l(a[u])&&(n+=eo(o)+":"+gl(o,a[u])+";");else{var d=En(e,t,a);switch(o){case"animation":case"animationName":{n+=eo(o)+":"+d+";";break}default:n+=o+"{"+d+"}"}}}return n}function to(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="";Ze=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=En(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=En(r,t,e[s]),n){var u=o;i+=u[s]}yl.lastIndex=0;for(var d="",y;(y=yl.exec(i))!==null;)d+="-"+y[1];var h=jh(i)+d;return{name:h,styles:i,next:Ze}}function Gl(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}function bl(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function wl(e,t,r){var n=[],i=Gl(e,n,r);return n.length<2?r:i+t(n)}function Yh(e,t){de.__h&&de.__h(Re,e,Il||t),Il=0;var r=Re.__H||(Re.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function zl(e,t){var r=Yh(vo++,7);return Zh(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Qh(){for(var e;e=Kl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(yn),e.__H.__h.forEach(_o),e.__H.__h=[]}catch(t){e.__H.__h=[],de.__e(t,e.__v)}}function Xh(e){var t,r=function(){clearTimeout(n),kl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);kl&&(t=requestAnimationFrame(r))}function yn(e){var t=Re,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Re=t}function _o(e){var t=Re;e.__c=e.__(),Re=t}function Zh(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Cn(){if(et>1)et--;else{for(var e,t=!1;tr!==void 0;){var r=tr;for(tr=void 0,go++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Yl(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(go=0,et--,t)throw e}}function Ee(e){if(et>0)return e();et++;try{return e()}finally{Cn()}}function Wl(e){if(Y!==void 0){var t=e.n;if(t===void 0||t.t!==Y)return t={i:0,S:e,p:Y.s,n:void 0,t:Y,e:void 0,x:void 0,r:t},Y.s!==void 0&&(Y.s.n=t),Y.s=t,e.n=t,32&Y.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Y.s,t.n=void 0,Y.s.n=t,Y.s=t),t}}function pe(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function Q(e){return new pe(e)}function Yl(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 Ql(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 Xl(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 Tt(e){pe.call(this,void 0),this.x=e,this.s=void 0,this.g=In-1,this.f=4}function rr(e){return new Tt(e)}function Zl(e){var t=e.u;if(e.u=void 0,typeof t=="function"){et++;var r=Y;Y=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Ro(e),n}finally{Y=r,Cn()}}}function Ro(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Zl(e)}function tp(e){if(Y!==this)throw new Error("Out-of-order effect");Xl(this),Y=e,this.f&=-2,8&this.f&&Ro(this),Cn()}function sr(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function lr(e){var t=new sr(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}function xt(e,t){M[e]=t.bind(null,M[e]||function(){})}function An(e){no&&no(),no=e&&e.S()}function ru(e){var t=this,r=e.data,n=nu(r);n.value=r;var i=zl(function(){for(var s=t,u=t.__v;u=u.__;)if(u.__c){u.__c.__$f|=4;break}var d=rr(function(){var _=n.value.value;return _===0?0:_===!0?"":_||""}),y=rr(function(){return!Array.isArray(d.value)&&!Bi(d.value)}),h=lr(function(){if(this.N=iu,y.value){var _=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=_)}}),v=t.__$u.d;return t.__$u.d=function(){h(),v.call(this)},[y,d]},[]),o=i[0],a=i[1];return o.value?a.peek():a.value}function rp(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=Q(r);return{o:function(a,s){o.value=a,n=s},d:lr(function(){this.N=iu;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}function nu(e){return zl(function(){return Q(e)},[])}function ip(){Ee(function(){for(var e;e=tu.shift();)eu.call(e)})}function iu(){tu.push(this)===1&&(M.requestAnimationFrame||np)(ip)}function op(e,t){let r=Gi(e);qi(()=>{r.current=e},[e]),Yt(()=>{if(t===null)return;let n=setInterval(()=>{r.current()},t);return()=>{clearInterval(n)}},[t])}function se(e,t,r,n,i,o){t||(t={});var a,s,u=t;if("ref"in u)for(s in u={},t)s=="ref"?a=t[s]:u[s]=t[s];var d={type:e,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ap,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return M.vnode&&M.vnode(d),d}function qe(e,t,r){return(t=gp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gp(e){var t=yp(e,"string");return typeof t=="symbol"?t:t+""}function yp(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 Ge(e,t,r){return(t=Ip(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ip(e){var t=Ap(e,"string");return typeof t=="symbol"?t:t+""}function Ap(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ne(e,t,r){return(t=Sp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sp(e){var t=Rp(e,"string");return typeof t=="symbol"?t:t+""}function Rp(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 sl,bf,wf,Ef,io,oo,Ol,Tf,xf,ll,Cf,kf,ul,Of,Pf,Df,Pl,Nf,jf,Vf,cl,Jf,dl,Hf,Nl,Ll,Ul,fl,$f,qf,ao,te,Wf,Yf,Zt,nr,Qf,lo,Xf,Xi,th,uo,hl,co,fo,ho,fh,_e,wn,H,Bl,Io,Ao,hh,Fl,ph,mh,Rn,vh,Tn,At,Vl,Ie,ce,St,Ph,Dh,Nh,vl,Lh,Uh,Mh,Bh,Fh,Vh,Jh,Hh,ql,_l,eo,gl,yl,Ze,qh,Gh,Kh,zh,Wh,Rt,vo,Re,ro,El,Il,Kl,de,Al,Sl,Rl,Tl,xl,Cl,kl,ep,Y,tr,et,go,In,eu,no,tu,np,ge,ap,sp,Ke,yo,bo,bn,lp,up,cp,dp,fp,hp,pp,mp,vp,_p,wo,Et,wt,bp,wp,Ep,Eo,Sn,Ig,ou=V(()=>{"use strict";zt();al();sl=Object.getOwnPropertySymbols,bf=Object.prototype.hasOwnProperty,wf=Object.prototype.propertyIsEnumerable,Ef=(e,t)=>{var r={};for(var n in e)bf.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&sl)for(var n of sl(e))t.indexOf(n)<0&&wf.call(e,n)&&(r[n]=e[n]);return r};io=class{constructor(t){Se(this,"context",void 0),Se(this,"continueCallback",void 0),Se(this,"adIsShowingCallback",void 0),Se(this,"isBeforeAdCalled",!1),Se(this,"isBeforeRewardCalled",!1),Se(this,"isAdDismissedCalled",!1),Se(this,"isAdViewedCalled",!1),Se(this,"isAfterAdCalled",!1),Se(this,"currentProvider",void 0),Se(this,"currentClientParams",void 0),Se(this,"adsHasResponse",!1),Se(this,"videoChecker",window.document.createElement("video")),Se(this,"wrapShowAdFn",r=>()=>{var n;this.adsHasResponse=!0;let i=!1;this.videoChecker.play().catch(()=>{i=!1}),i=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:i},this.paramsToTrack)),(n=this.adIsShowingCallback)==null||n.call(this,!0),r()}),this.context=t}get paramsToTrack(){var t,r,n,i,o,a;return{provider:(r=(t=this.currentProvider)==null?void 0:t.name)!=null?r:null,type:(n=this.currentClientParams)==null?void 0:n.type,name:((i=this.currentClientParams)==null?void 0:i.type)==="preroll"?null:(a=(o=this.currentClientParams)==null?void 0:o.name)!=null?a:""}}wrapBeforeAd(t){return()=>{var r,n;this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.isBeforeAdCalled||(this.isBeforeAdCalled=!0,t==null||t(),((r=this.currentClientParams)==null?void 0:r.type)!=="reward"&&((n=this.adIsShowingCallback)==null||n.call(this,!0)))}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{this.adsHasResponse=!0,this.isAdDismissedCalled||(this.isAdDismissedCalled=!0,t==null||t())}}wrapAdViewed(t){return()=>{this.adsHasResponse=!0,this.isAdViewedCalled||(this.isAdViewedCalled=!0,t==null||t())}}wrapAfterAd(t){return()=>{this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.isAfterAdCalled||(this.isAfterAdCalled=!0,t==null||t())}}wrapAdBreakDone(t){return r=>{var n,i,o,a,s,u;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:null,breakType:r.breakType,breakName:(o=r.breakName)!=null?o:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{t==null||t(r),(a=this.adIsShowingCallback)==null||a.call(this,!1),(s=this.continueCallback)==null||s.call(this,[!1,r]);break}default:{(u=this.continueCallback)==null||u.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n,i){return U(this,null,function*(){return this.currentProvider=t,this.currentClientParams=r,this.adsHasResponse=!1,new Promise(o=>{this.continueCallback=o,this.adIsShowingCallback=i;let a;switch(r.type){case"preroll":{a={type:r.type,adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}case"reward":{a={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),beforeReward:this.wrapBeforeReward(r.beforeReward),adDismissed:this.wrapAdDismissed(r.adDismissed),adViewed:this.wrapAdViewed(r.adViewed),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}default:{a={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}}window.setTimeout(()=>{var s,u,d,y,h;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(u=(s=this.currentProvider)==null?void 0:s.name)!=null?u:null}),(y=this.continueCallback)==null||y.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(d=r.name)!=null?d:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(h=this.adIsShowingCallback)==null||h.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(a,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};oo=class{constructor(t){fn(this,"context",void 0),fn(this,"adBreakIsShowing",!1),fn(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),fn(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()})}},Ol=Object.defineProperty,Tf=Object.defineProperties,xf=Object.getOwnPropertyDescriptors,ll=Object.getOwnPropertySymbols,Cf=Object.prototype.hasOwnProperty,kf=Object.prototype.propertyIsEnumerable,ul=(e,t,r)=>t in e?Ol(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Of=(e,t)=>{for(var r in t||(t={}))Cf.call(t,r)&&ul(e,r,t[r]);if(ll)for(var r of ll(t))kf.call(t,r)&&ul(e,r,t[r]);return e},Pf=(e,t)=>Tf(e,xf(t)),Df=(e,t)=>{for(var r in t)Ol(e,r,{get:t[r],enumerable:!0})},Pl=(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},Nf=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}jf=(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))(jf||{});Vf={log:Xt("log"),warn:Xt("warn"),info:Xt("info"),error:Xt("error"),debug:Xt("debug")};Object.assign(globalThis,{logger:Vf});cl=Symbol.for("Jolibox.canIUseMap"),Jf={};globalThis[cl]||(globalThis[cl]=Jf);dl=Symbol.for("Jolibox.canIUseMap.native"),Hf={};globalThis[dl]||(globalThis[dl]=Hf);Nl=(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))(Nl||{}),Ll=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Ll||{}),Ul=(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))(Ul||{}),fl=["name","params"],$f=["name","type","location","target","extra","timestamp","userId"],qf=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];zf();navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),navigator.userAgent.includes("Android"),navigator.userAgent.includes("Mac"),navigator.userAgent.includes("FB_IAB"),!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");ao=class so{constructor(t){this.element=t,this.next=so.Undefined,this.prev=so.Undefined}};ao.Undefined=new ao(void 0);te=ao,Wf=class{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let e=this._first;for(;e!==te.Undefined;){let t=e.next;e.prev=te.Undefined,e.next=te.Undefined,e=t}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new te(e);if(this._first===te.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==te.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==te.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==te.Undefined&&e.next!==te.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===te.Undefined&&e.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):e.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):e.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==te.Undefined;)yield e.element,e=e.next}},Yf=0,Zt=class{constructor(e){this.value=e,this.id=Yf++}},nr=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 Zt&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){return this._event!=null||(this._event=(e,t)=>{var r,n,i,o,a,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let u=new Zt(e);return this._listeners?this._listeners instanceof Zt?this._listeners=[this._listeners,u]:this._listeners.push(u):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=u,(o=(i=this.options)==null?void 0:i.onDidFirstListener)==null||o.call(i,this)),(s=(a=this.options)==null?void 0:a.onDidAddListener)==null||s.call(a,this),this._size++,()=>{var d,y,h,v;if(!this._disposed){if(this._listeners instanceof Zt)this._listeners.id===u.id&&(this._listeners=void 0,this._size=0,(y=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||y.call(d));else if(this._listeners){let _=this._listeners.indexOf(u);_>=0&&(this._listeners.splice(_,1),this._size--,this._size===0&&((v=(h=this.options)==null?void 0:h.onDidRemoveLastListener)==null||v.call(h)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Zt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Qf=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 nr,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e){let t=this.listeners.get(e),r=this.cachedEventQueue.get(e);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r||(r=new Wf,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)}},lo={};Df(lo,{None:()=>Xf,filter:()=>eh,once:()=>Ml,toPromise:()=>Zf});Xf=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Xi=Symbol.for("Jolibox.hostEmitter"),th=()=>{let e=new Qf;return globalThis[Xi]||(globalThis[Xi]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Xi]};th();uo=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new nr,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 rh(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}};uo=Pl([Dl],uo);hl=class{constructor(){this._onWillExecuteCommand=new nr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new nr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new uo,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Lf(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 Nf(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),lo.toPromise(lo.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{}}};hl=Pl([Dl],hl);co=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";Zi(this,"context",void 0),Zi(this,"placement","GAME"),Zi(this,"contextInfo",void 0),this.context=t,this.placement=r,this.contextInfo=this.context.getContextInfo()}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:this.placement==="GAME"?"GamePage":"DramaPage",params:r}}getDevice(){var t,r,n,i;return{platform:(t=this.contextInfo.platform)!=null?t:Ul.WebSDK,os:this.contextInfo.osType+"_"+this.contextInfo.runtimeType,appVersion:"1.0.0",appId:(r=this.contextInfo.hostAppId)!=null?r:"1",model:(n=this.contextInfo.deviceModel)!=null?n:"UnknownModel",brand:(i=this.contextInfo.deviceBrand)!=null?i:"UnknownBrand",uuid:this.contextInfo.deviceId,jsSdkVersion:"1.0.0",extra:{}}}serialize(t,r){var n;let i={protocolVersion:"1.0.0",events:[{name:t,type:Nl.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:Ll.WebSDK};return Kf(i)}};fo=class{constructor(t){hn(this,"configs",null),hn(this,"firstRun",!0),hn(this,"context",void 0),hn(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return U(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}};ho=class{constructor(t,r){$e(this,"name","ADSENSE"),$e(this,"context",void 0),$e(this,"contextInfo",void 0),$e(this,"configured",!1),$e(this,"initParams",void 0),$e(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),$e(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=Ef(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),$e(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),$e(this,"adUnit",n=>U(this,null,function*(){var i,o,a,s;if(this.context.track("CallAdUnit",{adFormat:(o=(i=n.adFormat)==null?void 0:i.toString())!=null?o:null,fullWidthResponsive:(a=n.fullWidthResponsive)!=null?a:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:u,slot:d,adFormat:y,fullWidthResponsive:h,style:v}=n,_;if(!u)throw new Error("targeting element is required");if(typeof u=="string"?_=document.querySelector(u):_=u,!_)throw new Error("targeting element not found");let w=d;if(w||(w=this.initParams.unitId),!w)throw new Error("slot is required");let I=typeof y=="object"&&Array.isArray(y)?y.join(", "):y,S=document.createElement("ins");if(S.className="adsbygoogle",S.id="jolibox-ads",S.style.display="block",S.setAttribute("data-ad-client",this.initParams.clientId),S.setAttribute("data-ad-slot",w),I&&S.setAttribute("data-ad-format",I),h&&S.setAttribute("data-full-width-responsive",h),v&&S.setAttribute("style",v),(s=this.contextInfo.testAdsMode)!=null?s:!1){let b=document.createElement("div");b.style.position="absolute",b.style.top="0",b.style.left="0",b.style.width="100%",b.style.height="100%",b.style.display="flex",b.style.justifyContent="center",b.style.alignItems="center",b.style.backgroundColor="rgba(0, 0, 0, 0.5)",b.style.color="white",b.innerHTML="Test Ad",S.style.position="relative",_.appendChild(S),S.appendChild(b)}else _.appendChild(S),new MutationObserver(b=>{b.forEach(C=>{if(C.type==="attributes"&&C.attributeName==="data-ad-status"){let P=S.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:P!=null?P:"null"})}})}).observe(S,{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 U(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&&this.initParams.admobRewardedSlot&&(i.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),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)}})}};fh=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(dh(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=ch(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}(),_e="-ms-",wn="-moz-",H="-webkit-",Bl="comm",Io="rule",Ao="decl",hh="@import",Fl="@keyframes",ph="@layer",mh=Math.abs,Rn=String.fromCharCode,vh=Object.assign;Tn=1,At=1,Vl=0,Ie=0,ce=0,St="";Ph=function(e,t,r){for(var n=0,i=0;n=i,i=Ue(),n===38&&i===12&&(t[r]=1),!or(i);)Te();return ar(e,Ie)},Dh=function(e,t){var r=-1,n=44;do switch(or(n)){case 0:n===38&&Ue()===12&&(t[r]=1),e[r]+=Ph(Ie-1,t,r);break;case 2:e[r]+=_n(n);break;case 4:if(n===44){e[++r]=Ue()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=Rn(n)}while(n=Te());return e},Nh=function(e,t){return Hl(Dh(Jl(e),t))},vl=new WeakMap,Lh=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&&!vl.get(r))&&!n){vl.set(e,!0);for(var i=[],o=Nh(t,i),a=r.props,s=0,u=0;s<o.length;s++)for(var d=0;d<a.length;d++,u++)e.props[u]=i[s]?o[s].replace(/&\f/g,a[d]):a[d]+" "+o[s]}}},Uh=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};Mh=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case Ao:e.return=$l(e.value,e.length);break;case Fl:return It([er(e,{value:$(e.value,"@","@"+H)})],n);case Io:if(e.length)return yh(e.props,function(i){switch(gh(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return It([er(e,{props:[$(i,/:(read-\w+)/,":"+wn+"$1")]})],n);case"::placeholder":return It([er(e,{props:[$(i,/:(plac\w+)/,":"+H+"input-$1")]}),er(e,{props:[$(i,/:(plac\w+)/,":"+wn+"$1")]}),er(e,{props:[$(i,/:(plac\w+)/,_e+"input-$1")]})],n)}return""})}},Bh=[Mh],Fh=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var I=w.getAttribute("data-emotion");I.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var n=e.stylisPlugins||Bh,i={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(w){for(var I=w.getAttribute("data-emotion").split(" "),S=1;S<I.length;S++)i[I[S]]=!0;a.push(w)});var s,u=[Lh,Uh];{var d,y=[xh,kh(function(w){d.insert(w)})],h=Ch(u.concat(n,y)),v=function(w){return It(Rh(w),h)};s=function(w,I,S,b){d=S,v(w?w+"{"+I.styles+"}":I.styles),b&&(_.inserted[I.name]=!0)}}var _={key:t,sheet:new fh({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 _.sheet.hydrate(a),_};Vh={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},Jh=/[A-Z]|^ms/g,Hh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,ql=function(e){return e.charCodeAt(1)===45},_l=function(e){return e!=null&&typeof e!="boolean"},eo=Oh(function(e){return ql(e)?e:e.replace(Jh,"-$&").toLowerCase()}),gl=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(Hh,function(r,n,i){return Ze={name:n,styles:i,next:Ze},n})}return Vh[e]!==1&&!ql(e)&&typeof t=="number"&&t!==0?t+"px":t};yl=/label:\s*([^\s;{]+)\s*(;|$)/g;qh=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},Gh=function(e,t,r){qh(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)}};Kh=function(e){var t=Fh(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=to(s,t.registered,void 0);return Gh(t,d),t.key+"-"+d.name},n=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=to(s,t.registered),y="animation-"+d.name;return bl(t,{name:d.name,styles:"@keyframes "+y+"{"+d.styles+"}"}),y},i=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=to(s,t.registered);bl(t,d)},o=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return wl(t.registered,r,zh(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:Gl.bind(null,t.registered),merge:wl.bind(null,t.registered,r)}},zh=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},Wh=Kh({key:"css"}),Rt=Wh.css,Il=0,Kl=[],de=M,Al=de.__b,Sl=de.__r,Rl=de.diffed,Tl=de.__c,xl=de.unmount,Cl=de.__;de.__b=function(e){Re=null,Al&&Al(e)},de.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Cl&&Cl(e,t)},de.__r=function(e){Sl&&Sl(e),vo=0;var t=(Re=e.__c).__H;t&&(ro===Re?(t.__h=[],Re.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(yn),t.__h.forEach(_o),t.__h=[],vo=0)),ro=Re},de.diffed=function(e){Rl&&Rl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Kl.push(t)!==1&&El===de.requestAnimationFrame||((El=de.requestAnimationFrame)||Xh)(Qh)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),ro=Re=null},de.__c=function(e,t){t.some(function(r){try{r.__h.forEach(yn),r.__h=r.__h.filter(function(n){return!n.__||_o(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],de.__e(n,r.__v)}}),Tl&&Tl(e,t)},de.unmount=function(e){xl&&xl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{yn(n)}catch(i){t=i}}),r.__H=void 0,t&&de.__e(t,r.__v))};kl=typeof requestAnimationFrame=="function";ep=Symbol.for("preact-signals");Y=void 0,tr=void 0,et=0,go=0,In=0;pe.prototype.brand=ep;pe.prototype.h=function(){return!0};pe.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)};pe.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)}};pe.prototype.subscribe=function(e){var t=this;return lr(function(){var r=t.value,n=Y;Y=void 0;try{e(r)}finally{Y=n}})};pe.prototype.valueOf=function(){return this.value};pe.prototype.toString=function(){return this.value+""};pe.prototype.toJSON=function(){return this.value};pe.prototype.peek=function(){var e=Y;Y=void 0;try{return this.value}finally{Y=e}};Object.defineProperty(pe.prototype,"value",{get:function(){var e=Wl(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(go>100)throw new Error("Cycle detected");this.v=e,this.i++,In++,et++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Cn()}}}});(Tt.prototype=new pe).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===In))return!0;if(this.g=In,this.f|=1,this.i>0&&!Yl(this))return this.f&=-2,!0;var e=Y;try{Ql(this),Y=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Y=e,Xl(this),this.f&=-2,!0};Tt.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)}pe.prototype.S.call(this,e)};Tt.prototype.U=function(e){if(this.t!==void 0&&(pe.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)}};Tt.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(Tt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Wl(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});sr.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()}};sr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Zl(this),Ql(this),et++;var e=Y;return Y=this,tp.bind(this,e)};sr.prototype.N=function(){2&this.f||(this.f|=2,this.o=tr,tr=this)};sr.prototype.d=function(){this.f|=8,1&this.f||Ro(this)};tu=[];lr(function(){eu=this.N})();ru.displayName="_st";Object.defineProperties(pe.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ru},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});xt("__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 pe&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});xt("__r",function(e,t){An();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return lr(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),An(r),e(t)});xt("__e",function(e,t,r,n){An(),e(t,r,n)});xt("diffed",function(e,t){An();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var s=o[a];s!==void 0&&!(a in n)&&(s.d(),o[a]=void 0)}else o={},r.U=o;for(var u in n){var d=o[u],y=n[u];d===void 0?(d=rp(r,u,y,i),o[u]=d):d.o(y,i)}}}e(t)});xt("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)});xt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});Ae.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};np=function(e){queueMicrotask(function(){queueMicrotask(e)})};ge=Rt`
4
4
  inset: 0;
5
5
  clear: none;
6
6
  float: none;
@@ -18,7 +18,7 @@ or `);this.errors.push(o)}return n}},Br=class extends ue{constructor(...t){super
18
18
  text-decoration: none;
19
19
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
20
20
  'Helvetica Neue', sans-serif;
21
- `;ap=0;sp=St`
21
+ `;ap=0;sp=Rt`
22
22
  ${ge}
23
23
  position: fixed;
24
24
  top: 0;
@@ -93,7 +93,7 @@ or `);this.errors.push(o)}return n}},Br=class extends ue{constructor(...t){super
93
93
  }
94
94
  }
95
95
  }
96
- `,Ke=Q(null),_o=Q(""),go=Q(""),yn=Q(!1),lp=()=>{var e;(e=Ke.value)==null||e.call(Ke,!1)},up=()=>{var e;(e=Ke.value)==null||e.call(Ke,!0)},cp=e=>U(void 0,null,function*(){let{title:t,content:r}=e;return Ke.value&&(Ke.value(!1),Ee(()=>{Ke.value=null,yn.value=!1})),Ee(()=>{_o.value=t||"",go.value=r||"",yn.value=!0}),new Promise(n=>{Ke.value=i=>{Ee(()=>{Ke.value=null,yn.value=!1,_o.value="",go.value=""}),n(i)}})}),dp=()=>yn.value?se("div",{className:sp,children:se("div",{className:"card-wrapper",children:[se("div",{className:"body",children:[se("div",{className:"title",children:_o.value}),se("div",{className:"content",children:go.value})]}),se("div",{className:"footer",children:[se("button",{onClick:lp,className:"cancel-btn",children:"Cancel"}),se("button",{onClick:up,className:"confirm-btm",children:"Confirm"})]})]})}):null,fp=St`
96
+ `,Ke=Q(null),yo=Q(""),bo=Q(""),bn=Q(!1),lp=()=>{var e;(e=Ke.value)==null||e.call(Ke,!1)},up=()=>{var e;(e=Ke.value)==null||e.call(Ke,!0)},cp=e=>U(void 0,null,function*(){let{title:t,content:r}=e;return Ke.value&&(Ke.value(!1),Ee(()=>{Ke.value=null,bn.value=!1})),Ee(()=>{yo.value=t||"",bo.value=r||"",bn.value=!0}),new Promise(n=>{Ke.value=i=>{Ee(()=>{Ke.value=null,bn.value=!1,yo.value="",bo.value=""}),n(i)}})}),dp=()=>bn.value?se("div",{className:sp,children:se("div",{className:"card-wrapper",children:[se("div",{className:"body",children:[se("div",{className:"title",children:yo.value}),se("div",{className:"content",children:bo.value})]}),se("div",{className:"footer",children:[se("button",{onClick:lp,className:"cancel-btn",children:"Cancel"}),se("button",{onClick:up,className:"confirm-btm",children:"Confirm"})]})]})}):null,fp=Rt`
97
97
  ${ge}
98
98
  position: relative;
99
99
  display: flex;
@@ -126,7 +126,7 @@ or `);this.errors.push(o)}return n}},Br=class extends ue{constructor(...t){super
126
126
  cursor: not-allowed;
127
127
  }
128
128
  }
129
- `,hp=()=>{let e=Q(!1),t=Q(null);return{timerPaused:e,startTimestamp:t,startTimer:()=>{Ee(()=>{t.value=Date.now(),e.value=!1})}}},pp=e=>{let{countdown:t=0,mode:r,onClose:n,state:i}=e,{startTimestamp:o,timerPaused:a}=i,s=ru(t);op(()=>{s.value>0?s.value-=1:Ee(()=>{a.value=!0,s.value=0})},a.value?null:1e3);let u=rr(()=>{if(r==="interstitial"||r==="rewarded_insterstitial"||!o.value)return!1;let _=Date.now()-o.value;return s.value>0&&t-s.value>=5&&_>=5e3}),d=rr(()=>{if(r==="interstitial")return!0;if(!o.value)return!1;let _=Date.now()-o.value;return s.value<=0&&_>=(t-1)*1e3&&t>5}),y=rr(()=>r==="interstitial"?!1:!u.value&&!d.value),h=()=>U(void 0,null,function*(){if(a.value=!0,!(yield cp({title:"Are you sure?",content:"You will lose your reward if you dismiss this Ad."}))){a.value=!1;return}n("dismiss"),Ee(()=>{a.value=!0,s.value=0,o.value=null})}),v=()=>{n("viewed"),Ee(()=>{a.value=!0,s.value=0,o.value=null})};return se("div",{className:fp,children:[s.value>0&&r!=="interstitial"&&se("div",{className:"timer",children:[s.value,"s"]}),se("button",{onClick:u.value?h:d.value?v:void 0,disabled:y.value,children:se("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:se("path",{d:"M13.3 0.710215C12.91 0.320215 12.28 0.320215 11.89 0.710215L6.99997 5.59022L2.10997 0.700215C1.71997 0.310215 1.08997 0.310215 0.699971 0.700215C0.309971 1.09021 0.309971 1.72022 0.699971 2.11022L5.58997 7.00022L0.699971 11.8902C0.309971 12.2802 0.309971 12.9102 0.699971 13.3002C1.08997 13.6902 1.71997 13.6902 2.10997 13.3002L6.99997 8.41021L11.89 13.3002C12.28 13.6902 12.91 13.6902 13.3 13.3002C13.69 12.9102 13.69 12.2802 13.3 11.8902L8.40997 7.00022L13.3 2.11022C13.68 1.73022 13.68 1.09022 13.3 0.710215Z",fill:"white"})})})]})},mp=()=>{let e=Q(),t=Q(),r=Q(),n=Q(),i=Q(),o=Q(!1),a=Q(15),s=Q(""),u=Q("reward");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,visible:o,countdown:a,src:s,mode:u}},vp=St`
129
+ `,hp=()=>{let e=Q(!1),t=Q(null);return{timerPaused:e,startTimestamp:t,startTimer:()=>{Ee(()=>{t.value=Date.now(),e.value=!1})}}},pp=e=>{let{countdown:t=0,mode:r,onClose:n,state:i}=e,{startTimestamp:o,timerPaused:a}=i,s=nu(t);op(()=>{s.value>0?s.value-=1:Ee(()=>{a.value=!0,s.value=0})},a.value?null:1e3);let u=rr(()=>{if(r==="interstitial"||r==="rewarded_insterstitial"||!o.value)return!1;let _=Date.now()-o.value;return s.value>0&&t-s.value>=5&&_>=5e3}),d=rr(()=>{if(r==="interstitial")return!0;if(!o.value)return!1;let _=Date.now()-o.value;return s.value<=0&&_>=(t-1)*1e3&&t>5}),y=rr(()=>r==="interstitial"?!1:!u.value&&!d.value),h=()=>U(void 0,null,function*(){if(a.value=!0,!(yield cp({title:"Are you sure?",content:"You will lose your reward if you dismiss this Ad."}))){a.value=!1;return}n("dismiss"),Ee(()=>{a.value=!0,s.value=0,o.value=null})}),v=()=>{n("viewed"),Ee(()=>{a.value=!0,s.value=0,o.value=null})};return se("div",{className:fp,children:[s.value>0&&r!=="interstitial"&&se("div",{className:"timer",children:[s.value,"s"]}),se("button",{onClick:u.value?h:d.value?v:void 0,disabled:y.value,children:se("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:se("path",{d:"M13.3 0.710215C12.91 0.320215 12.28 0.320215 11.89 0.710215L6.99997 5.59022L2.10997 0.700215C1.71997 0.310215 1.08997 0.310215 0.699971 0.700215C0.309971 1.09021 0.309971 1.72022 0.699971 2.11022L5.58997 7.00022L0.699971 11.8902C0.309971 12.2802 0.309971 12.9102 0.699971 13.3002C1.08997 13.6902 1.71997 13.6902 2.10997 13.3002L6.99997 8.41021L11.89 13.3002C12.28 13.6902 12.91 13.6902 13.3 13.3002C13.69 12.9102 13.69 12.2802 13.3 11.8902L8.40997 7.00022L13.3 2.11022C13.68 1.73022 13.68 1.09022 13.3 0.710215Z",fill:"white"})})})]})},mp=()=>{let e=Q(),t=Q(),r=Q(),n=Q(),i=Q(),o=Q(!1),a=Q(15),s=Q(""),u=Q("reward");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,visible:o,countdown:a,src:s,mode:u}},vp=Rt`
130
130
  ${ge}
131
131
  position: fixed;
132
132
  z-index: 2147483647;
@@ -145,7 +145,7 @@ or `);this.errors.push(o)}return n}},Br=class extends ue{constructor(...t){super
145
145
  width: 100%;
146
146
  height: 100%;
147
147
  }
148
- `,_p=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,visible:s,countdown:u,src:d,mode:y}=t,h=Qt(()=>hp(),[]),[v,_]=un(!1),w=S=>{var b,C,O,J;s.value=!1,S==="dismiss"?(b=n.value)==null||b.call(n):S==="viewed"&&((C=i.value)==null||C.call(i)),(O=r.value)==null||O.call(r),(J=o.value)==null||J.call(o),_(!1)},I=qi(()=>{var S;v||(_(!0),(S=a.value)==null||S.call(a))},[v]);return Yt(()=>{v&&(y.value==="reward"||y.value==="rewarded_insterstitial")&&setTimeout(()=>{h.startTimer()},100)},[v,y.value]),s.value?se("div",{className:vp,children:[se(pp,{mode:y.value,onClose:w,countdown:u.value,state:h}),s.value&&se("iframe",{src:d.value,onLoad:I,sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols"}),se(dp,{})]}):null};yo=class{constructor(t,r){qe(this,"name","OKSPIN"),qe(this,"initialized",!1),qe(this,"initCompleter",null),qe(this,"context",void 0),qe(this,"initParams",void 0),qe(this,"adsOverlay",null),qe(this,"adsIsShowing",!1),qe(this,"lastUnDisplayedAdBreak",null),qe(this,"state",mp()),this.context=t,this.initParams=r}init(){return U(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg"),Wi(se(_p,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(t=this.initCompleter)==null||t.call(this)})}adConfig(t){var r;if(this.initialized){(r=t.onReady)==null||r.call(t);return}this.initCompleter=()=>{var n;(n=t.onReady)==null||n.call(t)}}adBreak(t,r){return U(this,null,function*(){var n,i,o,a,s,u,d,y;if(!this.initialized||!this.adsOverlay||!r.params.url){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}switch(t.type){case"preroll":{(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(a=t.beforeAd)==null||a.call(t);let h=()=>{var _;this.adsIsShowing=!1,(_=t.afterAd)==null||_.call(t)},v=()=>{var _;this.adsIsShowing=!1,(_=t.adBreakDone)==null||_.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})};Ee(()=>{this.adsIsShowing=!0,this.state.afterAd.value=h,this.state.adBreakDone.value=v,this.state.src.value=r.params.url,this.state.mode.value="interstitial",this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((u=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||u.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(d=t.beforeAd)==null||d.call(t);let h=()=>{var b;this.adsIsShowing=!1,(b=t.afterAd)==null||b.call(t)},v={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},_=()=>{var b;this.adsIsShowing=!1,v.breakStatus="dismissed",(b=t.adDismissed)==null||b.call(t)},w=()=>{var b;this.adsIsShowing=!1,v.breakStatus="viewed",(b=t.adViewed)==null||b.call(t)},I=()=>{var b;this.adsIsShowing=!1,(b=t.adBreakDone)==null||b.call(t,v)};Ee(()=>{this.state.afterAd.value=h,this.state.adDismissed.value=_,this.state.adViewed.value=w,this.state.adBreakDone.value=I});let S=()=>{var b;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(b=t.adBreakDone)==null||b.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Ee(()=>{var C;this.state.countdown.value=(C=r.params.countdown)!=null?C:15,this.state.src.value=r.params.url,this.state.mode.value="reward",this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,S);break}}})}},wt={};window.addEventListener("message",e=>{e.origin!=="https://ads.appsrockets.com"&&e.origin!=="https://stg-ads.appsrockets.com"||wt[e.data.type]&&wt[e.data.type].forEach(t=>{t(e.data.data)})});bt=(e,t)=>{Yt(()=>(wt[e]||(wt[e]=new Set),wt[e].add(t),()=>{wt[e].delete(t)}),[e,t])},bp=()=>{let e=Q(),t=Q(),r=Q(),n=Q(),i=Q(),o=Q(),a=Q(),s=Q(!1),u=Q("");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,adLinkClicked:o,adError:a,visible:s,src:u}},wp=St`
148
+ `,_p=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,visible:s,countdown:u,src:d,mode:y}=t,h=Qt(()=>hp(),[]),[v,_]=cn(!1),w=S=>{var b,C,P,J;s.value=!1,S==="dismiss"?(b=n.value)==null||b.call(n):S==="viewed"&&((C=i.value)==null||C.call(i)),(P=r.value)==null||P.call(r),(J=o.value)==null||J.call(o),_(!1)},I=Ki(()=>{var S;v||(_(!0),(S=a.value)==null||S.call(a))},[v]);return Yt(()=>{v&&(y.value==="reward"||y.value==="rewarded_insterstitial")&&setTimeout(()=>{h.startTimer()},100)},[v,y.value]),s.value?se("div",{className:vp,children:[se(pp,{mode:y.value,onClose:w,countdown:u.value,state:h}),s.value&&se("iframe",{src:d.value,onLoad:I,sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols"}),se(dp,{})]}):null};wo=class{constructor(t,r){qe(this,"name","OKSPIN"),qe(this,"initialized",!1),qe(this,"initCompleter",null),qe(this,"context",void 0),qe(this,"initParams",void 0),qe(this,"adsOverlay",null),qe(this,"adsIsShowing",!1),qe(this,"lastUnDisplayedAdBreak",null),qe(this,"state",mp()),this.context=t,this.initParams=r}init(){return U(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg"),Qi(se(_p,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(t=this.initCompleter)==null||t.call(this)})}adConfig(t){var r;if(this.initialized){(r=t.onReady)==null||r.call(t);return}this.initCompleter=()=>{var n;(n=t.onReady)==null||n.call(t)}}adBreak(t,r){return U(this,null,function*(){var n,i,o,a,s,u,d,y;if(!this.initialized||!this.adsOverlay||!r.params.url){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}switch(t.type){case"preroll":{(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(a=t.beforeAd)==null||a.call(t);let h=()=>{var _;this.adsIsShowing=!1,(_=t.afterAd)==null||_.call(t)},v=()=>{var _;this.adsIsShowing=!1,(_=t.adBreakDone)==null||_.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})};Ee(()=>{this.adsIsShowing=!0,this.state.afterAd.value=h,this.state.adBreakDone.value=v,this.state.src.value=r.params.url,this.state.mode.value="interstitial",this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((u=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||u.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(d=t.beforeAd)==null||d.call(t);let h=()=>{var b;this.adsIsShowing=!1,(b=t.afterAd)==null||b.call(t)},v={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},_=()=>{var b;this.adsIsShowing=!1,v.breakStatus="dismissed",(b=t.adDismissed)==null||b.call(t)},w=()=>{var b;this.adsIsShowing=!1,v.breakStatus="viewed",(b=t.adViewed)==null||b.call(t)},I=()=>{var b;this.adsIsShowing=!1,(b=t.adBreakDone)==null||b.call(t,v)};Ee(()=>{this.state.afterAd.value=h,this.state.adDismissed.value=_,this.state.adViewed.value=w,this.state.adBreakDone.value=I});let S=()=>{var b;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(b=t.adBreakDone)==null||b.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Ee(()=>{var C;this.state.countdown.value=(C=r.params.countdown)!=null?C:15,this.state.src.value=r.params.url,this.state.mode.value="reward",this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,S);break}}})}},Et={};window.addEventListener("message",e=>{e.origin!=="https://ads.appsrockets.com"&&e.origin!=="https://stg-ads.appsrockets.com"||Et[e.data.type]&&Et[e.data.type].forEach(t=>{t(e.data.data)})});wt=(e,t)=>{Yt(()=>(Et[e]||(Et[e]=new Set),Et[e].add(t),()=>{Et[e].delete(t)}),[e,t])},bp=()=>{let e=Q(),t=Q(),r=Q(),n=Q(),i=Q(),o=Q(),a=Q(),s=Q(!1),u=Q("");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,adLinkClicked:o,adError:a,visible:s,src:u}},wp=Rt`
149
149
  ${ge}
150
150
  position: fixed;
151
151
  z-index: 2147483647;
@@ -164,7 +164,7 @@ or `);this.errors.push(o)}return n}},Br=class extends ue{constructor(...t){super
164
164
  width: 100%;
165
165
  height: 100%;
166
166
  }
167
- `,Ep=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,adLinkClicked:s,visible:u,src:d}=t,[y,h]=un(!1),v=w=>{var I,S,b,C;h(!1),u.value=!1,w==="dismiss"?(I=n.value)==null||I.call(n):w==="viewed"&&((S=i.value)==null||S.call(i)),(b=r.value)==null||b.call(r),(C=o.value)==null||C.call(o)},_=()=>{var w;(w=a.value)==null||w.call(a)};return bt("appsrockets_ad_dismissed",()=>v("dismiss")),bt("appsrockets_ad_rewarded",()=>v("viewed")),bt("appsrockets_ad_completed",()=>v("viewed")),bt("appsrockets_ad_skipped",()=>v("viewed")),bt("appsrockets_ad_clicked",w=>{var I;return(I=s.value)==null?void 0:I.call(s,w)}),bt("appsrockets_ad_loaded",()=>h(!0)),u.value?se("div",{className:wp,style:{display:y?"flex":"none"},children:u.value&&se("iframe",{src:d.value,onLoad:_,allowFullScreen:!0,allow:"autoplay",sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols"})}):null};bo=class{constructor(t,r){Ge(this,"name","APPSROCKETS"),Ge(this,"initialized",!1),Ge(this,"initCompleter",null),Ge(this,"context",void 0),Ge(this,"adsOverlay",null),Ge(this,"adsIsShowing",!1),Ge(this,"lastUnDisplayedAdBreak",null),Ge(this,"state",bp()),Ge(this,"processUrl",n=>{var i;let o=this.context.getContextInfo(),a=new URL(n),s=new URLSearchParams(a.search);return s.has("joliSource")||s.set("joliSource",o.joliSource),s.get("osType")||s.set("osType",o.osType),s.get("runtimeType")||s.set("runtimeType",o.runtimeType),s.get("mode")||s.set("mode","AFG"),s.get("deviceId")||s.set("deviceId",o.deviceId),s.get("statusBarHeight")||s.set("statusBarHeight",((i=this.context.getWindowInfo().statusBarHeight)!=null?i:0).toString()),a.search=s.toString(),a.toString()}),this.context=t}init(){return U(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg-appsrockets"),Wi(se(Ep,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(t=this.initCompleter)==null||t.call(this)})}adConfig(t){var r;if(this.initialized){(r=t.onReady)==null||r.call(t);return}this.initCompleter=()=>{var n;(n=t.onReady)==null||n.call(t)}}adBreak(t,r){var n,i,o,a,s,u,d,y;if(!this.initialized||!this.adsOverlay||!r.params.url){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}let h=v=>{var _,w;(w=(_=this.context).handleLinkClicked)==null||w.call(_,v)};switch(t.type){case"preroll":{(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(a=t.beforeAd)==null||a.call(t);let v=()=>{var I;this.adsIsShowing=!1,(I=t.afterAd)==null||I.call(t)},_=()=>{var I;this.adsIsShowing=!1,(I=t.adBreakDone)==null||I.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})},w=()=>{var I;this.adsIsShowing=!1,(I=t.adBreakDone)==null||I.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"noAdPreloaded"})};Ee(()=>{this.adsIsShowing=!0,this.state.afterAd.value=v,this.state.adBreakDone.value=_,this.state.src.value=this.processUrl(r.params.url),this.state.adLinkClicked.value=h,this.state.adError.value=w,this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((u=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||u.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(d=t.beforeAd)==null||d.call(t);let v=()=>{var O;this.adsIsShowing=!1,(O=t.afterAd)==null||O.call(t)},_={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},w=()=>{var O;this.adsIsShowing=!1,_.breakStatus="dismissed",(O=t.adDismissed)==null||O.call(t)},I=()=>{var O;this.adsIsShowing=!1,_.breakStatus="viewed",(O=t.adViewed)==null||O.call(t)},S=()=>{var O;this.adsIsShowing=!1,(O=t.adBreakDone)==null||O.call(t,_)},b=()=>{this.adsIsShowing=!1,_.breakStatus="noAdPreloaded"};Ee(()=>{this.state.afterAd.value=v,this.state.adDismissed.value=w,this.state.adViewed.value=I,this.state.adBreakDone.value=S,this.state.adLinkClicked.value=h,this.state.adError.value=b});let C=()=>{var O;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(O=t.adBreakDone)==null||O.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Ee(()=>{this.state.src.value=this.processUrl(r.params.url),this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,C);break}}}};An=class{constructor(t){if(Ne(this,"context",void 0),Ne(this,"contextInfo",void 0),Ne(this,"providers",{}),Ne(this,"channelPolicy",void 0),Ne(this,"adsActionDetection",void 0),Ne(this,"adsTrackSerializer",void 0),Ne(this,"initialized",!1),Ne(this,"adsIsShowing",!1),Ne(this,"lastAdBreak",void 0),Ne(this,"initializedTimeStamp",Date.now()),t)this.context=t,this.channelPolicy=new uo(this.context),this.adsActionDetection=new no(this.context),this.adsTrackSerializer=new lo(this.context),this.contextInfo=this.context.getContextInfo();else throw new Error("JoliboxAdsForGame requires a configuration object")}getRequestContextData(t){var r,n;let{width:i,height:o}=this.context.getWindowInfo();return{report:JSON.stringify(this.adsTrackSerializer.serialize(t,{sessionId:this.contextInfo.sessionId,objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId,testAdsMode:this.contextInfo.testAdsMode})),osType:this.contextInfo.osType,runtimeType:this.contextInfo.runtimeType,sessionId:this.contextInfo.sessionId,deviceId:this.contextInfo.deviceId,adId:this.contextInfo.adId,deviceModel:(r=this.contextInfo.deviceModel)!=null?r:"UnknownModel",deviceBrand:(n=this.contextInfo.deviceBrand)!=null?n:"UnknownBrand",dimension:{width:i,height:o}}}getRequestBizParams(){return{objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId}}init(t){return U(this,null,function*(){window.adsbygoogle=window.adsbygoogle||[];let{data:r}=yield this.context.httpClient.post("/api/ads/init",{data:{contextData:this.getRequestContextData("AdsAFGSDKInit"),bizParams:this.getRequestBizParams(),testAdsMode:this.contextInfo.testAdsMode}});if((r==null?void 0:r.length)>0)for(let n of r)switch(n.provider){case"ADSENSE":case"ADSENSE_ADMOB":{let i=new co(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"OKSPIN":{let i=new yo(this.context,n.params);yield i.init(),this.providers.OKSPIN=i;break}case"APPSROCKETS":{let i=new bo(this.context,n.params);yield i.init(),this.providers.APPSROCKETS=i;break}}this.initialized=!0})}adConfig(t){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(t):window.adsbygoogle.push(t)}adBreak(t){return U(this,null,function*(){var r,n,i,o,a,s,u,d,y,h;let v=Date.now();if(v-this.initializedTimeStamp<3e3){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}if(this.lastAdBreak&&v-this.lastAdBreak<500){console.warn("[Jolibox SDK Ads] You can't call adBreak too frequently"),(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.lastAdBreak=v,this.adsIsShowing){console.warn("[Jolibox SDK Ads] You can't call adBreak while ad is showing"),(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.initialized||(yield this.init()),t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}if(!this.context.checkNetwork()){(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}try{let{data:_,code:w}=yield this.context.httpClient.post("/api/ads/info",{data:{contextData:this.getRequestContextData("AdsAFGSDKAdBreak"),bizParams:this.getRequestBizParams(),adsType:t.type==="reward"?"REWARD":"INTERSTITIAL",testAdsMode:this.contextInfo.testAdsMode,name:t.type==="preroll"?"":t.name}});if(w!=="SUCCESS"){(s=t.adBreakDone)==null||s.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let I=_==null?void 0:_.sort((O,J)=>O.seq-J.seq);if(I.length===0){(u=t.adBreakDone)==null||u.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let S=!0,b=null,C=new ro(this.context);for(this.adsActionDetection.adBreakIsShowing=!0;I.length>0;){let O=I.shift(),J=this.providers[O.provider];if(J){let[X,R]=yield C.callAdBreakAndContinue(J,t,O,D=>{var P;this.adsIsShowing=D,(P=this.context.eventEmitter)==null||P.emit("isAdShowing",D)});S=X,b=R}else S=!0,b={breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!S)break}S&&b&&((d=t.adBreakDone)==null||d.call(t,b))}}catch(_){(y=t.adBreakDone)==null||y.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{this.adsIsShowing=!1,(h=this.context.eventEmitter)==null||h.emit("isAdShowing",!1),this.adsActionDetection.adBreakIsShowing=!1}})}adUnit(t){console.warn("This method has been deprecated. We will not support AdSense AdUnit in the future.")}},Ig=St`
167
+ `,Ep=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,adLinkClicked:s,visible:u,src:d}=t,[y,h]=cn(!1),v=w=>{var I,S,b,C;h(!1),u.value=!1,w==="dismiss"?(I=n.value)==null||I.call(n):w==="viewed"&&((S=i.value)==null||S.call(i)),(b=r.value)==null||b.call(r),(C=o.value)==null||C.call(o)},_=()=>{var w;(w=a.value)==null||w.call(a)};return wt("appsrockets_ad_dismissed",()=>v("dismiss")),wt("appsrockets_ad_rewarded",()=>v("viewed")),wt("appsrockets_ad_completed",()=>v("viewed")),wt("appsrockets_ad_skipped",()=>v("viewed")),wt("appsrockets_ad_clicked",w=>{var I;return(I=s.value)==null?void 0:I.call(s,w)}),wt("appsrockets_ad_loaded",()=>h(!0)),u.value?se("div",{className:wp,style:{display:y?"flex":"none"},children:u.value&&se("iframe",{src:d.value,onLoad:_,allowFullScreen:!0,allow:"autoplay",sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols"})}):null};Eo=class{constructor(t,r){Ge(this,"name","APPSROCKETS"),Ge(this,"initialized",!1),Ge(this,"initCompleter",null),Ge(this,"context",void 0),Ge(this,"adsOverlay",null),Ge(this,"adsIsShowing",!1),Ge(this,"lastUnDisplayedAdBreak",null),Ge(this,"state",bp()),Ge(this,"processUrl",n=>{var i;let o=this.context.getContextInfo(),a=new URL(n),s=new URLSearchParams(a.search);return s.has("joliSource")||s.set("joliSource",o.joliSource),s.get("osType")||s.set("osType",o.osType),s.get("runtimeType")||s.set("runtimeType",o.runtimeType),s.get("mode")||s.set("mode","AFG"),s.get("deviceId")||s.set("deviceId",o.deviceId),s.get("statusBarHeight")||s.set("statusBarHeight",((i=this.context.getWindowInfo().statusBarHeight)!=null?i:0).toString()),a.search=s.toString(),a.toString()}),this.context=t}init(){return U(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg-appsrockets"),Qi(se(Ep,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(t=this.initCompleter)==null||t.call(this)})}adConfig(t){var r;if(this.initialized){(r=t.onReady)==null||r.call(t);return}this.initCompleter=()=>{var n;(n=t.onReady)==null||n.call(t)}}adBreak(t,r){var n,i,o,a,s,u,d,y;if(!this.initialized||!this.adsOverlay||!r.params.url){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}let h=v=>{var _,w;(w=(_=this.context).handleLinkClicked)==null||w.call(_,v)};switch(t.type){case"preroll":{(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(a=t.beforeAd)==null||a.call(t);let v=()=>{var I;this.adsIsShowing=!1,(I=t.afterAd)==null||I.call(t)},_=()=>{var I;this.adsIsShowing=!1,(I=t.adBreakDone)==null||I.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})},w=()=>{var I;this.adsIsShowing=!1,(I=t.adBreakDone)==null||I.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"noAdPreloaded"})};Ee(()=>{this.adsIsShowing=!0,this.state.afterAd.value=v,this.state.adBreakDone.value=_,this.state.src.value=this.processUrl(r.params.url),this.state.adLinkClicked.value=h,this.state.adError.value=w,this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((u=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||u.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(d=t.beforeAd)==null||d.call(t);let v=()=>{var P;this.adsIsShowing=!1,(P=t.afterAd)==null||P.call(t)},_={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},w=()=>{var P;this.adsIsShowing=!1,_.breakStatus="dismissed",(P=t.adDismissed)==null||P.call(t)},I=()=>{var P;this.adsIsShowing=!1,_.breakStatus="viewed",(P=t.adViewed)==null||P.call(t)},S=()=>{var P;this.adsIsShowing=!1,(P=t.adBreakDone)==null||P.call(t,_)},b=()=>{this.adsIsShowing=!1,_.breakStatus="noAdPreloaded"};Ee(()=>{this.state.afterAd.value=v,this.state.adDismissed.value=w,this.state.adViewed.value=I,this.state.adBreakDone.value=S,this.state.adLinkClicked.value=h,this.state.adError.value=b});let C=()=>{var P;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(P=t.adBreakDone)==null||P.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Ee(()=>{this.state.src.value=this.processUrl(r.params.url),this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,C);break}}}};Sn=class{constructor(t){if(Ne(this,"context",void 0),Ne(this,"contextInfo",void 0),Ne(this,"providers",{}),Ne(this,"channelPolicy",void 0),Ne(this,"adsActionDetection",void 0),Ne(this,"adsTrackSerializer",void 0),Ne(this,"initialized",!1),Ne(this,"adsIsShowing",!1),Ne(this,"lastAdBreak",void 0),Ne(this,"initializedTimeStamp",Date.now()),t)this.context=t,this.channelPolicy=new fo(this.context),this.adsActionDetection=new oo(this.context),this.adsTrackSerializer=new co(this.context),this.contextInfo=this.context.getContextInfo();else throw new Error("JoliboxAdsForGame requires a configuration object")}getRequestContextData(t){var r,n;let{width:i,height:o}=this.context.getWindowInfo();return{report:JSON.stringify(this.adsTrackSerializer.serialize(t,{sessionId:this.contextInfo.sessionId,objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId,testAdsMode:this.contextInfo.testAdsMode})),osType:this.contextInfo.osType,runtimeType:this.contextInfo.runtimeType,sessionId:this.contextInfo.sessionId,deviceId:this.contextInfo.deviceId,adId:this.contextInfo.adId,deviceModel:(r=this.contextInfo.deviceModel)!=null?r:"UnknownModel",deviceBrand:(n=this.contextInfo.deviceBrand)!=null?n:"UnknownBrand",dimension:{width:i,height:o}}}getRequestBizParams(){return{objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId}}init(t){return U(this,null,function*(){window.adsbygoogle=window.adsbygoogle||[];let{data:r}=yield this.context.httpClient.post("/api/ads/init",{data:{contextData:this.getRequestContextData("AdsAFGSDKInit"),bizParams:this.getRequestBizParams(),testAdsMode:this.contextInfo.testAdsMode}});if((r==null?void 0:r.length)>0)for(let n of r)switch(n.provider){case"ADSENSE":case"ADSENSE_ADMOB":{let i=new ho(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"OKSPIN":{let i=new wo(this.context,n.params);yield i.init(),this.providers.OKSPIN=i;break}case"APPSROCKETS":{let i=new Eo(this.context,n.params);yield i.init(),this.providers.APPSROCKETS=i;break}}this.initialized=!0})}adConfig(t){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(t):window.adsbygoogle.push(t)}adBreak(t){return U(this,null,function*(){var r,n,i,o,a,s,u,d,y,h;let v=Date.now();if(v-this.initializedTimeStamp<3e3){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}if(this.lastAdBreak&&v-this.lastAdBreak<500){console.warn("[Jolibox SDK Ads] You can't call adBreak too frequently"),(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.lastAdBreak=v,this.adsIsShowing){console.warn("[Jolibox SDK Ads] You can't call adBreak while ad is showing"),(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.initialized||(yield this.init()),t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}if(!this.context.checkNetwork()){(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}try{let{data:_,code:w}=yield this.context.httpClient.post("/api/ads/info",{data:{contextData:this.getRequestContextData("AdsAFGSDKAdBreak"),bizParams:this.getRequestBizParams(),adsType:t.type==="reward"?"REWARD":"INTERSTITIAL",testAdsMode:this.contextInfo.testAdsMode,name:t.type==="preroll"?"":t.name}});if(w!=="SUCCESS"){(s=t.adBreakDone)==null||s.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let I=_==null?void 0:_.sort((P,J)=>P.seq-J.seq);if(I.length===0){(u=t.adBreakDone)==null||u.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let S=!0,b=null,C=new io(this.context);for(this.adsActionDetection.adBreakIsShowing=!0;I.length>0;){let P=I.shift(),J=this.providers[P.provider];if(J){let[X,R]=yield C.callAdBreakAndContinue(J,t,P,D=>{var O;this.adsIsShowing=D,(O=this.context.eventEmitter)==null||O.emit("isAdShowing",D)});S=X,b=R}else S=!0,b={breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!S)break}S&&b&&((d=t.adBreakDone)==null||d.call(t,b))}}catch(_){(y=t.adBreakDone)==null||y.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{this.adsIsShowing=!1,(h=this.context.eventEmitter)==null||h.emit("isAdShowing",!1),this.adsActionDetection.adBreakIsShowing=!1}})}adUnit(t){console.warn("This method has been deprecated. We will not support AdSense AdUnit in the future.")}},Ig=Rt`
168
168
  ${ge}
169
169
  position: fixed;
170
170
  left: 0;
@@ -213,7 +213,7 @@ or `);this.errors.push(o)}return n}},Br=class extends ue{constructor(...t){super
213
213
  cursor: pointer;
214
214
  }
215
215
  }
216
- `});var su=hr(au=>{"use strict";ot();Di();G();var ou={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};Pi("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",ou[e.result],e.result),fe.emit(Yr,{useModalResult:ou[e.result]})});fe.on(Wr,(e,t)=>{var r;pt("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:dt()})});Pi("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{fe.emit(zr,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin})});fe.on(Kr,(e,t)=>U(au,null,function*(){var r;pt("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:dt()})}))});var cu=hr(xo=>{"use strict";nt();G();Vt();Di();_s();iu();we();var zg=pr(su()),So=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(t){}adConfig(t){this.ads.adConfig(t)}adBreak(t){this.ads.adBreak(t)}adUnit(t){}},Ro=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(t){this.ads.init(t)}adConfig(t){this.ads.adConfig(t)}adBreak(t){return U(this,null,function*(){var r;if(t.type==="reward")try{let n=yield Qe.getRewardsTypes(kn);yield Qe.handleReward(n,t)}catch(n){console.info("handleReward failed",n),(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}else this.ads.adBreak(t)})}adUnit(t){this.ads.adUnit(t)}},To=class{constructor(t){this.cacheHandler=null;this.context=t}createAdsHandler(t){if(this.cacheHandler)return this.cacheHandler;switch(t){case"dlightek":{this.cacheHandler=new So(window.h5sdk);break}default:{let r=new An(this.context);this.cacheHandler=new Ro(r);break}}return this.cacheHandler}getAdsHandler(t){return this.createAdsHandler(t)}},Cn=ke(),lu=new Pe,kn=je.create(),Tp={httpClient:kn,checkNetwork:()=>je.getNetworkStatus(),track:De,eventEmitter:lu,getWindowInfo:()=>({width:window.innerWidth*window.devicePixelRatio,height:window.innerHeight*window.devicePixelRatio,statusBarHeight:0}),handleLinkClicked:e=>{window.open(e,"_blank")},getContextInfo:()=>{var e,t,r,n,i,o,a,s,u;return{hostAppId:(t=(e=N.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(r=N.deviceInfo.did)!=null?r:"",adId:(n=N.deviceInfo.adId)!=null?n:"",sessionId:(i=N.sessionId)!=null?i:"",userId:(a=(o=N.hostUserInfo)==null?void 0:o.uid)!=null?a:"",objectType:"GAME",objectId:N.mpId,testAdsMode:N.testAdsMode,channel:(s=N.joliSource)!=null?s:"",deviceBrand:N.deviceInfo.brand,deviceModel:N.deviceInfo.model,osType:be.isAndroid?"ANDROID":be.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3,joliSource:(u=N.joliSource)!=null?u:""}}},uu=e=>{pt("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})},xp=new To(Tp),ur=xp.getAdsHandler(N.sdkEnvironment);Qe.registerRewardHandler("ADS",ls(ur.getAdsInstance()));Qe.registerRewardHandler("JOLI_COIN",hs(kn,{onUnlockSuccess:uu.bind(xo)}));Qe.registerRewardHandler("JOLI_COIN_ONLY",ms(kn,{onUnlockSuccess:uu.bind(xo)}));lu.on("isAdShowing",e=>{pt("JOLIBOX_ADS_EVENT",{isAdShowing:e})});Cn.registerCommand("AdsSDK.init",e=>{ur.init(e)});Cn.registerCommand("AdsSDK.adConfig",e=>{ur.adConfig(e)});Cn.registerCommand("AdsSDK.adBreak",e=>{ur.adBreak(e)});Cn.registerCommand("AdsSDK.adUnit",e=>{ur.adUnit(e)})});nt();we();Jt();G();var za=ke(),Cd="env",kd="getSystemInfoSync",Od=()=>{var i,o,a,s;let e={system:N.deviceInfo.system,platform:N.deviceInfo.platform.toLowerCase(),brand:N.deviceInfo.brand,pixelRatio:N.deviceInfo.pixelRatio,language:N.deviceInfo.lang,version:N.sdkInfo.jssdkVersion,appName:(i=N.hostInfo)==null?void 0:i.appName,SDKVersion:N.sdkInfo.nativeSDKVersion},t=(o=N.hostInfo)==null?void 0:o.version;t&&(e=me(Z({},e),{version:t}));let r=(a=N.hostInfo)==null?void 0:a.appName;r&&(e=me(Z({},e),{appName:r}));let n=(s=N.sdkInfo)==null?void 0:s.jssdkVersion;return n&&(e=me(Z({},e),{SDKVersion:n})),e},Pd=it(kd,{implement:Od}),Dd=it(Cd,{implement:()=>me(Z({},N.hostInfo),{sdkInfo:N.sdkInfo,platform:N.platform,deviceInfo:N.deviceInfo})});za.registerCommand("API.env",Dd);za.registerCommand("API.getSystemInfoSync",Pd);ve("env",{version:"1.0.0"});ve("getSystemInfoSync",{version:"1.0.0"});G();Jt();Ye();nt();var Nd="onJoliboxShow",Ld="onJoliboxHide",Ud="onReady",Ri=ke(),Ti=ga(Oe),Si=!0,Ht=!0,Jr=0,Hr=gi;function Md(){let e=Date.now();if(e-Jr<100)return;Jr=e;let t=document.visibilityState==="visible";t!==Si&&(Si=t,Hr.emit("visible",Si))}function Wa(e){let t=Date.now();t-Jr<100||(Jr=t,e==="focus"&&!Ht?Ht=!0:e==="blur"&&Ht&&(Ht=!1),Hr.emit("visible",Ht))}document.addEventListener("visibilitychange",Md);window.addEventListener("focus",()=>Wa("focus"));window.addEventListener("blur",()=>Wa("blur"));var Bd=it(Nd,{paramsSchema:F.tuple(F.function()),implement(e){let t=Ti(e);Hr.on("visible",r=>{r&&t()})}}),Fd=it(Ld,{paramsSchema:F.tuple(F.function()),implement(e){let t=Ti(e);Hr.on("visible",r=>{!r&&t()})}}),jd=it(Ud,{paramsSchema:F.tuple(F.function()),implement(e){let t=Ti(e);jt.on("LifecycleEvent.onReady",r=>{t(r)})}});Ri.registerCommand("LifecycleSDK.onReady",jd);Ri.registerCommand("LifecycleSDK.onJoliboxShow",Bd);Ri.registerCommand("LifecycleSDK.onJoliboxHide",Fd);ve("lifeCycle.onReady",{version:"1.0.0"});ve("lifeCycle.onJoliboxShow",{version:"1.0.0"});ve("lifeCycle.onJoliboxHide",{version:"1.0.0"});Jt();G();Vt();we();var Xa=pr(Qa());var $r=ke(),Ci=class{constructor(){this.httpClient=je.create({baseUrl:N.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"});this.getGameId=()=>N.mpId;this.getItem=t=>U(this,null,function*(){let{code:r,data:n,message:i}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),o=n==null?void 0:n.value,a=i;return r!=="SUCCESS"&&(o=yield this.gameStore.getItem(t),console.info("[SDK] cloud storage getItem failed, read from localstorage",o),a+="fallback to localstorage"),{code:r,message:a,data:o&&o!=="undefined"?o:null}});this.setItem=(t,r)=>U(this,null,function*(){let n=typeof r=="string"?r:String(r),{code:i,message:o}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}`,{data:{key:t,value:n}});return yield this.gameStore.setItem(t,n),{code:i,message:o}});this.removeItem=t=>U(this,null,function*(){yield this.gameStore.removeItem(t);let{code:r,message:n}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/remove`,{data:{key:t}});return{code:r,message:n}});this.clear=()=>U(this,null,function*(){yield this.gameStore.clear();let{code:t,message:r}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/clear`,{});return{code:t,message:r}});this.gameId=this.getGameId(),this.gameStore=Xa.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},qr=new Ci,Vd=Je("getLocalStorage",{paramsSchema:F.tuple(F.string()),implement(e){return U(this,null,function*(){return yield qr.getItem(e)})}});$r.registerCommand("StorageSDK.getItem",Vd);ve("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Jd=Je("setStorage",{paramsSchema:F.tuple(F.string(),F.or(F.string(),F.boolean(),F.number())),implement(e,t){return U(this,null,function*(){return yield qr.setItem(e,t)})}});$r.registerCommand("StorageSDK.setItem",Jd);ve("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Hd=Je("removeStorage",{paramsSchema:F.tuple(F.string()),implement(e){return U(this,null,function*(){return yield qr.removeItem(e)})}});$r.registerCommand("StorageSDK.removeItem",Hd);ve("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var $d=Je("clearStorage",{implement(){return U(this,null,function*(){return yield qr.clear()})}});$r.registerCommand("StorageSDK.clear",$d);ve("storage.clear",{version:"1.0.0"});var ey=pr(Za()),ty=pr(cu());G();nt();var vu=-1,Pn=function(e){addEventListener("pageshow",function(t){t.persisted&&(vu=t.timeStamp,e(t))},!0)},ko=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Dn=function(){var e=ko();return e&&e.activationStart||0},Ct=function(e,t){var r=ko(),n="navigate";return vu>=0?n="back-forward-cache":r&&(document.prerendering||Dn()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},_u=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(i){Promise.resolve().then(function(){t(i.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(i){}},kt=function(e,t,r,n){var i,o;return function(a){t.value>=0&&(a||n)&&((o=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=o,t.rating=function(s,u){return s>u[1]?"poor":s>u[0]?"needs-improvement":"good"}(t.value,r),e(t))}},gu=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},yu=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},bu=function(e){var t=!1;return function(){t||(e(),t=!0)}},xt=-1,du=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},On=function(e){document.visibilityState==="hidden"&&xt>-1&&(xt=e.type==="visibilitychange"?e.timeStamp:0,Cp())},fu=function(){addEventListener("visibilitychange",On,!0),addEventListener("prerenderingchange",On,!0)},Cp=function(){removeEventListener("visibilitychange",On,!0),removeEventListener("prerenderingchange",On,!0)},wu=function(){return xt<0&&(xt=du(),fu(),Pn(function(){setTimeout(function(){xt=du(),fu()},0)})),{get firstHiddenTime(){return xt}}},Oo=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},hu=[1800,3e3],Eu=function(e,t){t=t||{},Oo(function(){var r,n=wu(),i=Ct("FCP"),o=_u("paint",function(a){a.forEach(function(s){s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-Dn(),0),i.entries.push(s),r(!0)))})});o&&(r=kt(e,i,hu,t.reportAllChanges),Pn(function(a){i=Ct("FCP"),r=kt(e,i,hu,t.reportAllChanges),gu(function(){i.value=performance.now()-a.timeStamp,r(!0)})}))})};var kp=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=bu(e),document.visibilityState==="hidden"?e():(r=t(e),yu(e)),r};var pu=[2500,4e3],Co={},Iu=function(e,t){t=t||{},Oo(function(){var r,n=wu(),i=Ct("LCP"),o=function(u){t.reportAllChanges||(u=u.slice(-1)),u.forEach(function(d){d.startTime<n.firstHiddenTime&&(i.value=Math.max(d.startTime-Dn(),0),i.entries=[d],r())})},a=_u("largest-contentful-paint",o);if(a){r=kt(e,i,pu,t.reportAllChanges);var s=bu(function(){Co[i.id]||(o(a.takeRecords()),a.disconnect(),Co[i.id]=!0,r(!0))});["keydown","click"].forEach(function(u){addEventListener(u,function(){return kp(s)},{once:!0,capture:!0})}),yu(s),Pn(function(u){i=Ct("LCP"),r=kt(e,i,pu,t.reportAllChanges),gu(function(){i.value=performance.now()-u.timeStamp,Co[i.id]=!0,r(!0)})})}})},mu=[800,1800],Op=function e(t){document.prerendering?Oo(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},Au=function(e,t){t=t||{};var r=Ct("TTFB"),n=kt(e,r,mu,t.reportAllChanges);Op(function(){var i=ko();i&&(r.value=Math.max(i.responseStart-Dn(),0),r.entries=[i],n(!0),Pn(function(){r=Ct("TTFB",0),(n=kt(e,r,mu,t.reportAllChanges))(!0)}))})};we();function Pp(){Eu(e=>{De("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Iu(e=>{De("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Au(e=>{De("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function Dp(){jt.on("onDocumentReady",e=>{jt.emit("LifecycleEvent.onReady",{isLogin:!1}),N.mpType==="game"&&rt.start(Date.now()-e)})}function Su(){Dp(),Pp()}Su();
216
+ `});var lu=pr(su=>{"use strict";at();Li();G();var au={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};Ni("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",au[e.result],e.result),fe.emit(Qr,{useModalResult:au[e.result]})});fe.on(Yr,(e,t)=>{var r;mt("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:ft()})});Ni("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{fe.emit(Wr,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin})});fe.on(zr,(e,t)=>U(su,null,function*(){var r;mt("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:ft()})}))});var du=pr(ko=>{"use strict";it();G();Vt();Li();gs();ou();we();var zg=mr(lu()),To=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(t){}adConfig(t){this.ads.adConfig(t)}adBreak(t){this.ads.adBreak(t)}adUnit(t){}},xo=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(t){this.ads.init(t)}adConfig(t){this.ads.adConfig(t)}adBreak(t){return U(this,null,function*(){var r;if(t.type==="reward")try{let n=yield Qe.getRewardsTypes(On);yield Qe.handleReward(n,t)}catch(n){console.info("handleReward failed",n),(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}else this.ads.adBreak(t)})}adUnit(t){this.ads.adUnit(t)}},Co=class{constructor(t){this.cacheHandler=null;this.context=t}createAdsHandler(t){if(this.cacheHandler)return this.cacheHandler;switch(t){case"dlightek":{this.cacheHandler=new To(window.h5sdk);break}default:{let r=new Sn(this.context);this.cacheHandler=new xo(r);break}}return this.cacheHandler}getAdsHandler(t){return this.createAdsHandler(t)}},kn=ke(),uu=new Pe,On=je.create(),Tp={httpClient:On,checkNetwork:()=>je.getNetworkStatus(),track:De,eventEmitter:uu,getWindowInfo:()=>({width:window.innerWidth*window.devicePixelRatio,height:window.innerHeight*window.devicePixelRatio,statusBarHeight:0}),handleLinkClicked:e=>{window.open(e,"_blank")},getContextInfo:()=>{var e,t,r,n,i,o,a,s,u;return{hostAppId:(t=(e=N.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(r=N.deviceInfo.did)!=null?r:"",adId:(n=N.deviceInfo.adId)!=null?n:"",sessionId:(i=N.sessionId)!=null?i:"",userId:(a=(o=N.hostUserInfo)==null?void 0:o.uid)!=null?a:"",objectType:"GAME",objectId:N.mpId,testAdsMode:N.testAdsMode,channel:(s=N.joliSource)!=null?s:"",deviceBrand:N.deviceInfo.brand,deviceModel:N.deviceInfo.model,osType:be.isAndroid?"ANDROID":be.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3,joliSource:(u=N.joliSource)!=null?u:""}}},cu=e=>{mt("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})},xp=new Co(Tp),ur=xp.getAdsHandler(N.sdkEnvironment);Qe.registerRewardHandler("ADS",cs(ur.getAdsInstance()));Qe.registerRewardHandler("JOLI_COIN",ps(On,{onUnlockSuccess:cu.bind(ko)}));Qe.registerRewardHandler("JOLI_COIN_ONLY",vs(On,{onUnlockSuccess:cu.bind(ko)}));uu.on("isAdShowing",e=>{mt("JOLIBOX_ADS_EVENT",{isAdShowing:e})});kn.registerCommand("AdsSDK.init",e=>{ur.init(e)});kn.registerCommand("AdsSDK.adConfig",e=>{ur.adConfig(e)});kn.registerCommand("AdsSDK.adBreak",e=>{ur.adBreak(e)});kn.registerCommand("AdsSDK.adUnit",e=>{ur.adUnit(e)})});it();we();Jt();G();var Ya=ke(),Cd="env",kd="getSystemInfoSync",Od=()=>{var i,o,a,s;let e={system:N.deviceInfo.system,platform:N.deviceInfo.platform.toLowerCase(),brand:N.deviceInfo.brand,pixelRatio:N.deviceInfo.pixelRatio,language:N.deviceInfo.lang,version:N.sdkInfo.jssdkVersion,appName:(i=N.hostInfo)==null?void 0:i.appName,SDKVersion:N.sdkInfo.nativeSDKVersion},t=(o=N.hostInfo)==null?void 0:o.version;t&&(e=me(Z({},e),{version:t}));let r=(a=N.hostInfo)==null?void 0:a.appName;r&&(e=me(Z({},e),{appName:r}));let n=(s=N.sdkInfo)==null?void 0:s.jssdkVersion;return n&&(e=me(Z({},e),{SDKVersion:n})),e},Pd=ot(kd,{implement:Od}),Dd=ot(Cd,{implement:()=>me(Z({},N.hostInfo),{sdkInfo:N.sdkInfo,platform:N.platform,deviceInfo:N.deviceInfo})});Ya.registerCommand("API.env",Dd);Ya.registerCommand("API.getSystemInfoSync",Pd);ve("env",{version:"1.0.0"});ve("getSystemInfoSync",{version:"1.0.0"});G();Jt();Ye();it();var Nd="onJoliboxShow",Ld="onJoliboxHide",Ud="onReady",xi=ke(),Ci=ba(Oe),Ti=!0,Ht=!0,Hr=0,$r=bi;function Md(){let e=Date.now();if(e-Hr<100)return;Hr=e;let t=document.visibilityState==="visible";t!==Ti&&(Ti=t,$r.emit("visible",Ti))}function Qa(e){let t=Date.now();t-Hr<100||(Hr=t,e==="focus"&&!Ht?Ht=!0:e==="blur"&&Ht&&(Ht=!1),$r.emit("visible",Ht))}document.addEventListener("visibilitychange",Md);window.addEventListener("focus",()=>Qa("focus"));window.addEventListener("blur",()=>Qa("blur"));var Bd=ot(Nd,{paramsSchema:F.tuple(F.function()),implement(e){let t=Ci(e);$r.on("visible",r=>{r&&t()})}}),Fd=ot(Ld,{paramsSchema:F.tuple(F.function()),implement(e){let t=Ci(e);$r.on("visible",r=>{!r&&t()})}}),jd=ot(Ud,{paramsSchema:F.tuple(F.function()),implement(e){let t=Ci(e);jt.on("LifecycleEvent.onReady",r=>{t(r)})}});xi.registerCommand("LifecycleSDK.onReady",jd);xi.registerCommand("LifecycleSDK.onJoliboxShow",Bd);xi.registerCommand("LifecycleSDK.onJoliboxHide",Fd);ve("lifeCycle.onReady",{version:"1.0.0"});ve("lifeCycle.onJoliboxShow",{version:"1.0.0"});ve("lifeCycle.onJoliboxHide",{version:"1.0.0"});Jt();G();Vt();we();var es=mr(Za());var qr=ke(),Oi=class{constructor(){this.httpClient=je.create({baseUrl:N.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"});this.getGameId=()=>N.mpId;this.getItem=t=>U(this,null,function*(){let{code:r,data:n,message:i}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),o=n==null?void 0:n.value,a=i;return r!=="SUCCESS"&&(o=yield this.gameStore.getItem(t),console.info("[SDK] cloud storage getItem failed, read from localstorage",o),a+="fallback to localstorage"),{code:r,message:a,data:o&&o!=="undefined"?o:null}});this.setItem=(t,r)=>U(this,null,function*(){let n=typeof r=="string"?r:String(r),{code:i,message:o}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}`,{data:{key:t,value:n}});return yield this.gameStore.setItem(t,n),{code:i,message:o}});this.removeItem=t=>U(this,null,function*(){yield this.gameStore.removeItem(t);let{code:r,message:n}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/remove`,{data:{key:t}});return{code:r,message:n}});this.clear=()=>U(this,null,function*(){yield this.gameStore.clear();let{code:t,message:r}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/clear`,{});return{code:t,message:r}});this.gameId=this.getGameId(),this.gameStore=es.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},Gr=new Oi,Vd=Je("getLocalStorage",{paramsSchema:F.tuple(F.string()),implement(e){return U(this,null,function*(){return yield Gr.getItem(e)})}});qr.registerCommand("StorageSDK.getItem",Vd);ve("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Jd=Je("setStorage",{paramsSchema:F.tuple(F.string(),F.or(F.string(),F.boolean(),F.number())),implement(e,t){return U(this,null,function*(){return yield Gr.setItem(e,t)})}});qr.registerCommand("StorageSDK.setItem",Jd);ve("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Hd=Je("removeStorage",{paramsSchema:F.tuple(F.string()),implement(e){return U(this,null,function*(){return yield Gr.removeItem(e)})}});qr.registerCommand("StorageSDK.removeItem",Hd);ve("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var $d=Je("clearStorage",{implement(){return U(this,null,function*(){return yield Gr.clear()})}});qr.registerCommand("StorageSDK.clear",$d);ve("storage.clear",{version:"1.0.0"});var ey=mr(ts()),ty=mr(du());G();it();var _u=-1,Dn=function(e){addEventListener("pageshow",function(t){t.persisted&&(_u=t.timeStamp,e(t))},!0)},Po=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Nn=function(){var e=Po();return e&&e.activationStart||0},kt=function(e,t){var r=Po(),n="navigate";return _u>=0?n="back-forward-cache":r&&(document.prerendering||Nn()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},gu=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(i){Promise.resolve().then(function(){t(i.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(i){}},Ot=function(e,t,r,n){var i,o;return function(a){t.value>=0&&(a||n)&&((o=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=o,t.rating=function(s,u){return s>u[1]?"poor":s>u[0]?"needs-improvement":"good"}(t.value,r),e(t))}},yu=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},bu=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},wu=function(e){var t=!1;return function(){t||(e(),t=!0)}},Ct=-1,fu=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Pn=function(e){document.visibilityState==="hidden"&&Ct>-1&&(Ct=e.type==="visibilitychange"?e.timeStamp:0,Cp())},hu=function(){addEventListener("visibilitychange",Pn,!0),addEventListener("prerenderingchange",Pn,!0)},Cp=function(){removeEventListener("visibilitychange",Pn,!0),removeEventListener("prerenderingchange",Pn,!0)},Eu=function(){return Ct<0&&(Ct=fu(),hu(),Dn(function(){setTimeout(function(){Ct=fu(),hu()},0)})),{get firstHiddenTime(){return Ct}}},Do=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},pu=[1800,3e3],Iu=function(e,t){t=t||{},Do(function(){var r,n=Eu(),i=kt("FCP"),o=gu("paint",function(a){a.forEach(function(s){s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-Nn(),0),i.entries.push(s),r(!0)))})});o&&(r=Ot(e,i,pu,t.reportAllChanges),Dn(function(a){i=kt("FCP"),r=Ot(e,i,pu,t.reportAllChanges),yu(function(){i.value=performance.now()-a.timeStamp,r(!0)})}))})};var kp=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=wu(e),document.visibilityState==="hidden"?e():(r=t(e),bu(e)),r};var mu=[2500,4e3],Oo={},Au=function(e,t){t=t||{},Do(function(){var r,n=Eu(),i=kt("LCP"),o=function(u){t.reportAllChanges||(u=u.slice(-1)),u.forEach(function(d){d.startTime<n.firstHiddenTime&&(i.value=Math.max(d.startTime-Nn(),0),i.entries=[d],r())})},a=gu("largest-contentful-paint",o);if(a){r=Ot(e,i,mu,t.reportAllChanges);var s=wu(function(){Oo[i.id]||(o(a.takeRecords()),a.disconnect(),Oo[i.id]=!0,r(!0))});["keydown","click"].forEach(function(u){addEventListener(u,function(){return kp(s)},{once:!0,capture:!0})}),bu(s),Dn(function(u){i=kt("LCP"),r=Ot(e,i,mu,t.reportAllChanges),yu(function(){i.value=performance.now()-u.timeStamp,Oo[i.id]=!0,r(!0)})})}})},vu=[800,1800],Op=function e(t){document.prerendering?Do(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},Su=function(e,t){t=t||{};var r=kt("TTFB"),n=Ot(e,r,vu,t.reportAllChanges);Op(function(){var i=Po();i&&(r.value=Math.max(i.responseStart-Nn(),0),r.entries=[i],n(!0),Dn(function(){r=kt("TTFB",0),(n=Ot(e,r,vu,t.reportAllChanges))(!0)}))})};we();function Pp(){Iu(e=>{De("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Au(e=>{De("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Su(e=>{De("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function Dp(){jt.on("onDocumentReady",e=>{jt.emit("LifecycleEvent.onReady",{isLogin:!1}),N.mpType==="game"&&nt.start(Date.now()-e)})}function Ru(){Dp(),Pp()}Ru();
217
217
  /*! Bundled license information:
218
218
 
219
219
  localforage/dist/localforage.js: