diff --git a/extensions/reviewed/PlaygamaBridge.json b/extensions/reviewed/PlaygamaBridge.json index c5a4cc1e8..57acf9173 100644 --- a/extensions/reviewed/PlaygamaBridge.json +++ b/extensions/reviewed/PlaygamaBridge.json @@ -9,7 +9,7 @@ "name": "PlaygamaBridge", "previewIconUrl": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xMTcgMTU0LjM2MlY5Ni4wMDAxSDIyMy4xMjlWNDE2SDExN1YzNTkuMjU0SDE1OC40NFYxNTQuMzYySDExN1oiIGZpbGw9ImJsYWNrIi8+CjxwYXRoIGQ9Ik0zOTUgMTU0LjM2MlY5NkgyODguODcxVjQxNkgzOTVWMzU5LjI1NEgzNTMuNTZWMTU0LjM2MkgzOTVaIiBmaWxsPSJibGFjayIvPgo8L3N2Zz4K", "shortDescription": "One SDK for cross-platform publishing HTML5 games.", - "version": "1.26.1", + "version": "1.27.0", "description": [ "One SDK for cross-platform publishing HTML5 games. ", "Please refer to [Playgama documentation](https://wiki.playgama.com/playgama/sdk/engines/gdevelop) for detailed guidance." @@ -43,6 +43,10 @@ "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ "window.bridgeOptions = {", + " \"device\": {", + " \"useBuiltInOrientationPopup\": true,", + " \"supportedOrientations\": [\"landscape\", \"portrait\"]", + " },", " \"platforms\": {", " \"game_distribution\": {", " \"gameId\": \"\"", @@ -87,9 +91,15 @@ " },", " \"youtube\": {", " \"sendAnalyticsEvents\": false", + " },", + " \"xiaomi\": {", + " \"adSenseId\": \"\",", + " \"hostId\": \"\"", " }", " },", " \"advertisement\": {", + " \"banner\": {", + " },", " \"interstitial\": {", " \"preloadOnStart\": true", " },", @@ -598,7 +608,8 @@ "document.head.appendChild(bridgeScript)", "", "function evalLocalScript() {", - " (()=>{var e={611:e=>{!function(t){e.exports=t;var r=\"listeners\",n={on:function(e,t){return a(this,e).push(t),this},once:function(e,t){var r=this;return n.originalListener=t,a(r,e).push(n),r;function n(){i.call(r,e,n),t.apply(this,arguments)}},off:i,emit:function(e,t){var r=this,n=a(r,e,!0);if(!n)return!1;var o=arguments.length;if(1===o)n.forEach((function(e){e.call(r)}));else if(2===o)n.forEach((function(e){e.call(r,t)}));else{var i=Array.prototype.slice.call(arguments,1);n.forEach((function(e){e.apply(r,i)}))}return!!n.length}};function o(e){for(var t in n)e[t]=n[t];return e}function i(e,t){var n,o=this;if(arguments.length){if(t){if(n=a(o,e,!0)){if(!(n=n.filter((function(e){return e!==t&&e.originalListener!==t}))).length)return i.call(o,e);o[r][e]=n}}else if((n=o[r])&&(delete n[e],!Object.keys(n).length))return i.call(o)}else delete o[r];return o}function a(e,t,n){if(!n||e[r]){var o=e[r]||(e[r]={});return o[t]||(o[t]=[])}}o(t.prototype),t.mixin=o}((function e(){if(!(this instanceof e))return new e}))}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{\"use strict\";var e={VK:\"vk\",OK:\"ok\",YANDEX:\"yandex\",CRAZY_GAMES:\"crazy_games\",ABSOLUTE_GAMES:\"absolute_games\",GAME_DISTRIBUTION:\"game_distribution\",PLAYGAMA:\"playgama\",PLAYDECK:\"playdeck\",TELEGRAM:\"telegram\",Y8:\"y8\",LAGGED:\"lagged\",FACEBOOK:\"facebook\",POKI:\"poki\",MOCK:\"mock\",QA_TOOL:\"qa_tool\",MSN:\"msn\",HUAWEI:\"huawei\",BITQUEST:\"bitquest\",GAMEPUSH:\"gamepush\",DISCORD:\"discord\",JIO_GAMES:\"jio_games\",YOUTUBE:\"youtube\",PORTAL:\"portal\",REDDIT:\"reddit\"},t={PLATFORM:\"platform\",PLAYER:\"player\",GAME:\"game\",STORAGE:\"storage\",ADVERTISEMENT:\"advertisement\",SOCIAL:\"social\",DEVICE:\"device\",LEADERBOARDS:\"leaderboards\",PAYMENTS:\"payments\",REMOTE_CONFIG:\"remote_config\",CLIPBOARD:\"clipboard\",ACHIEVEMENTS:\"achievements\"},n={INTERSTITIAL_STATE_CHANGED:\"interstitial_state_changed\",REWARDED_STATE_CHANGED:\"rewarded_state_changed\",BANNER_STATE_CHANGED:\"banner_state_changed\",VISIBILITY_STATE_CHANGED:\"visibility_state_changed\",AUDIO_STATE_CHANGED:\"audio_state_changed\",PAUSE_STATE_CHANGED:\"pause_state_changed\"},o={VISIBLE:\"visible\",HIDDEN:\"hidden\"},i={LOADING:\"loading\",OPENED:\"opened\",CLOSED:\"closed\",FAILED:\"failed\"},a={LOADING:\"loading\",OPENED:\"opened\",CLOSED:\"closed\",FAILED:\"failed\",REWARDED:\"rewarded\"},s={LOADING:\"loading\",SHOWN:\"shown\",HIDDEN:\"hidden\",FAILED:\"failed\"},c=\"banner-container\",u={LOCAL_STORAGE:\"local_storage\",PLATFORM_INTERNAL:\"platform_internal\"},l={DESKTOP:\"desktop\",MOBILE:\"mobile\",TABLET:\"tablet\",TV:\"tv\"},f={GAME_READY:\"game_ready\",IN_GAME_LOADING_STARTED:\"in_game_loading_started\",IN_GAME_LOADING_STOPPED:\"in_game_loading_stopped\",GAMEPLAY_STARTED:\"gameplay_started\",GAMEPLAY_STOPPED:\"gameplay_stopped\",PLAYER_GOT_ACHIEVEMENT:\"player_got_achievement\",GAME_OVER:\"game_over\"},p=\"not_available\",d=\"in_game\",h=\"native\",y={INITIALIZE:\"initialize\",AUTHORIZE_PLAYER:\"authorize_player\",SHARE:\"share\",INVITE_FRIENDS:\"invite_friends\",JOIN_COMMUNITY:\"join_community\",CREATE_POST:\"create_post\",ADD_TO_HOME_SCREEN:\"add_to_home_screen\",ADD_TO_FAVORITES:\"add_to_favorites\",RATE:\"rate\",LEADERBOARDS_SET_SCORE:\"leaderboards_set_score\",LEADERBOARDS_GET_ENTRIES:\"leaderboards_get_entries\",LEADERBOARDS_SHOW_NATIVE_POPUP:\"leaderboards_show_native_popup\",GET_PURCHASES:\"get_purchases\",GET_CATALOG:\"get_catalog\",PURCHASE:\"purchase\",CONSUME_PURCHASE:\"consume_purchase\",GET_REMOTE_CONFIG:\"get_remote_config\",GET_STORAGE_DATA:\"get_storage_data\",SET_STORAGE_DATA:\"set_storage_data\",DELETE_STORAGE_DATA:\"delete_storage_data\",CLIPBOARD_WRITE:\"clipboard_write\",ADBLOCK_DETECT:\"adblock_detect\",SET_INTERSTITIAL_STATE:\"set_interstitial_state\",SET_REWARDED_STATE:\"set_rewarded_state\",SHOW_INTERSTITIAL:\"show_interstitial\",SHOW_REWARDED:\"show_rewarded\"},m={message:\"Before using the SDK you must initialize it\"},v={message:\"Storage not supported\"},_={message:\"Storage not available\"},g={message:\"GameDistribution Game ID is undefined\"},S={message:\"Y8 Game params are not found\"},b={message:\"OK Game params are not found\"},E={message:\"Lagged Game params are not found\"},P={message:\"Huawei Game params are not found\"},w={message:\"GamePush Game params are not found\"},A={message:\"Message is too long\"},O={message:\"Discord Game params are not found\"};function k(e){return k=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},k(e)}function T(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,n){var o=document.createElement(\"script\");o.src=e;for(var i=0;i2&&void 0!==arguments[2]&&arguments[2];return Array.isArray(e)?e.reduce((function(e,n,o){if(e[o]=we(t,n),r)try{e[o]=JSON.parse(e[o])}catch(e){}return e}),new Array(e.length)):we(t,e)}function Oe(e,t){for(var r=function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];if(!(this._loadingProcessCompleted||t&&null!==this._currentLoadingProgress)){var r=document.getElementById(\"fillRect\"),n=document.getElementById(\"gradientMover\"),o=document.getElementById(\"logo\"),i=document.getElementById(\"loading-overlay\");if(r&&n&&o&&i){this._currentLoadingProgress=e;var a=Math.max(0,Math.min(100,e)),s=100-a;r.style.transform=\"translateY(\".concat(s,\"%)\"),100===a?(this._loadingProcessCompleted=!0,setTimeout((function(){r.style.display=\"none\",n.style.display=\"block\",n.classList.add(\"gradient-mover\")}),400),setTimeout((function(){return o.classList.add(\"logo-fade-out\")}),900),setTimeout((function(){return i.remove()}),1400)):n.classList.remove(\"gradient-mover\")}}}}],r&&Te(t.prototype,r),Object.defineProperty(t,\"prototype\",{writable:!1}),s}(W);H().mixin(Ce.prototype);const Ne=Ce;function Ge(e){return Ge=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Ge(e)}function Be(e,t){for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(t){var n=t[this._platformBridge.platformId];if(n)return this.get(e,n,r)}var o=t;return o||(o=this.defaultType),this._platformBridge.isStorageAvailable(o)?this._platformBridge.getDataFromStorage(e,o,r):Promise.reject()}},{key:\"set\",value:function(e,t,r){if(r){var n=r[this._platformBridge.platformId];if(n)return this.set(e,t,n)}var o=r;return o||(o=this.defaultType),this._platformBridge.isStorageAvailable(o)?this._platformBridge.setDataToStorage(e,t,o):Promise.reject()}},{key:\"delete\",value:function(e,t){if(t){var r=t[this._platformBridge.platformId];if(r)return this.delete(e,r)}var n=t;return n||(n=this.defaultType),this._platformBridge.isStorageAvailable(n)?this._platformBridge.deleteDataFromStorage(e,n):Promise.reject()}}],r&&Be(t.prototype,r),Object.defineProperty(t,\"prototype\",{writable:!1}),a}(W);function Ue(e){return Ue=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Ue(e)}function Ve(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:\"bottom\",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.bannerState!==s.LOADING&&this.bannerState!==s.SHOWN)if(gt(this,Ct,zt).call(this,s.LOADING),this.isBannerSupported){var n,o=r;o||null!==(n=this._platformBridge.options)&&void 0!==n&&null!==(n=n.advertisement)&&void 0!==n&&null!==(n=n.banner)&&void 0!==n&&n.placementFallback&&(o=this._platformBridge.options.advertisement.banner.placementFallback);var i=null===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e||null===(e=e.banner)||void 0===e?void 0:e.placements,a=gt(this,Bt,Jt).call(this,o,i);this._platformBridge.showBanner(t,a)}else gt(this,Ct,zt).call(this,s.FAILED)}},{key:\"hideBanner\",value:function(){this.bannerState!==s.LOADING&&this.bannerState!==s.HIDDEN&&this.isBannerSupported&&this._platformBridge.hideBanner()}},{key:\"preloadInterstitial\",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isInterstitialSupported){var r,n=t;n&&\"string\"==typeof n||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.interstitial)&&void 0!==r&&r.placementFallback&&(n=this._platformBridge.options.advertisement.interstitial.placementFallback);var o=null===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e||null===(e=e.interstitial)||void 0===e?void 0:e.placements,i=gt(this,Bt,Jt).call(this,n,o);this._platformBridge.preloadInterstitial(i)}}},{key:\"showInterstitial\",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!gt(this,jt,Wt).call(this))if(gt(this,Nt,Zt).call(this,i.LOADING),this.isInterstitialSupported)if(this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&St(this,wt)&&St(this,wt).state===Qe)gt(this,Nt,Zt).call(this,i.FAILED);else{var r,n=t;n||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.interstitial)&&void 0!==r&&r.placementFallback&&(n=this._platformBridge.options.advertisement.interstitial.placementFallback);var o=null===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e||null===(e=e.interstitial)||void 0===e?void 0:e.placements,a=gt(this,Bt,Jt).call(this,n,o);this._platformBridge.showInterstitial(a)}else gt(this,Nt,Zt).call(this,i.FAILED)}},{key:\"preloadRewarded\",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isRewardedSupported){var r,n=t;n&&\"string\"==typeof n||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.rewarded)&&void 0!==r&&r.placementFallback&&(n=this._platformBridge.options.advertisement.rewarded.placementFallback);var o=null===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e||null===(e=e.rewarded)||void 0===e?void 0:e.placements,i=gt(this,Bt,Jt).call(this,n,o);this._platformBridge.preloadRewarded(i)}}},{key:\"showRewarded\",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!gt(this,jt,Wt).call(this)){var r;_t(this,kt,t),St(this,kt)||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.rewarded)&&void 0!==r&&r.placementFallback&&_t(this,kt,this._platformBridge.options.advertisement.rewarded.placementFallback);var n=null===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e||null===(e=e.rewarded)||void 0===e?void 0:e.placements,o=gt(this,Bt,Jt).call(this,St(this,kt),n);gt(this,Gt,Yt).call(this,a.LOADING),this.isRewardedSupported?this._platformBridge.showRewarded(o):gt(this,Gt,Yt).call(this,a.FAILED)}}},{key:\"checkAdBlock\",value:function(){return this._platformBridge.checkAdBlock()}}],r&<(t.prototype,r),Object.defineProperty(t,\"prototype\",{writable:!1}),l}(W);function Ht(e){_t(this,At,e),St(this,wt)&&(St(this,wt).stop(),gt(this,Lt,Vt).call(this))}function Ft(e){if(\"number\"==typeof e)return e;if(\"string\"==typeof e){var t=parseInt(e,10);return Number.isNaN(t)?null:t}return null}function xt(){var e=gt(this,Rt,Ut).call(this);if(void 0!==e){var t=gt(this,Dt,Ft).call(this,e);null!==t&>(this,Tt,Ht).call(this,t)}}function Ut(){var e;return null===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e?void 0:e.minimumDelayBetweenInterstitial}function Vt(){St(this,At)>0&&this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&(_t(this,wt,new ct(St(this,At))),St(this,wt).start())}function Wt(){var e=[i.LOADING,i.OPENED].includes(St(this,Pt)),t=[a.LOADING,a.OPENED,a.REWARDED].includes(St(this,Ot));return e||t}function zt(e){St(this,Et)!==e&&(_t(this,Et,e),this.emit(n.BANNER_STATE_CHANGED,St(this,Et)))}function Zt(e){St(this,Pt)!==e&&(_t(this,Pt,e),this.emit(n.INTERSTITIAL_STATE_CHANGED,St(this,Pt)))}function Yt(e){St(this,Ot)!==e&&(_t(this,Ot,e),this.emit(n.REWARDED_STATE_CHANGED,St(this,Ot)))}function Jt(e,t){if(!e)return e;if(!t)return e;var r=t.find((function(t){return t.id===e}));return r&&r[this._platformBridge.platformId]?r[this._platformBridge.platformId]:e}H().mixin(Mt.prototype);const Kt=Mt;function qt(e){return qt=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},qt(e)}function Xt(e,t){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:\"result\",i=this._getPromiseDecorator(e);return i||(i=this._createPromiseDecorator(e),this._platformSdk.send(t,n).then((function(t){t[o]?r._resolvePromiseDecorator(e):r._rejectPromiseDecorator(e)})).catch((function(t){r._rejectPromiseDecorator(e,t)}))),i.promise}const Rn=function(t){!function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&Sn(e,t)}(p,t);var r,n,o,c,f=(o=p,c=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=En(o);if(c){var r=En(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&(\"object\"===vn(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return bn(e)}(this,e)});function p(){var e,t,r;!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,p);for(var n=arguments.length,o=new Array(n),i=0;i0?e.entries.map((function(e){return{id:e.player.uniqueID,name:e.player.publicName,score:e.score,rank:e.rank,photo:e.player.getAvatarSrc(\"large\")}})):[],t._resolvePromiseDecorator(y.LEADERBOARDS_GET_ENTRIES,r)})).catch((function(e){t._rejectPromiseDecorator(y.LEADERBOARDS_GET_ENTRIES,e)}))}return r.promise}},{key:\"paymentsPurchase\",value:function(e){var t=this;if(!zn(this,Kn))return Promise.reject();var r=this._paymentsGetProductPlatformData(e);r||(r={id:e});var n=this._getPromiseDecorator(y.PURCHASE);return n||(n=this._createPromiseDecorator(y.PURCHASE),zn(this,Kn).purchase(r).then((function(r){var n=Cn({id:e},r.purchaseData);delete n.productID,t._paymentsPurchases.push(n),t._resolvePromiseDecorator(y.PURCHASE,n)})).catch((function(e){t._rejectPromiseDecorator(y.PURCHASE,e)}))),n.promise}},{key:\"paymentsConsumePurchase\",value:function(e){var t=this;if(!zn(this,Kn))return Promise.reject();var r=this._paymentsPurchases.findIndex((function(t){return t.id===e}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(y.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(y.CONSUME_PURCHASE),zn(this,Kn).consumePurchase(this._paymentsPurchases[r].purchaseToken).then((function(){t._paymentsPurchases.splice(r,1),t._resolvePromiseDecorator(y.CONSUME_PURCHASE,{id:e})})).catch((function(e){t._rejectPromiseDecorator(y.CONSUME_PURCHASE,e)}))),n.promise}},{key:\"paymentsGetCatalog\",value:function(){var e=this;if(!zn(this,Kn))return Promise.reject();var t=this._paymentsGetProductsPlatformData(),r=this._getPromiseDecorator(y.GET_CATALOG);return r||(r=this._createPromiseDecorator(y.GET_CATALOG),zn(this,Kn).getCatalog().then((function(r){var n=t.map((function(e){var t,n=r.find((function(t){return t.id===e.id}));return{id:e.id,title:n.title,description:n.description,imageURI:n.imageURI,price:n.price,priceCurrencyCode:n.priceCurrencyCode,priceValue:n.priceValue,priceCurrencyImage:null===(t=n.getPriceCurrencyImage)||void 0===t?void 0:t.call(n,\"medium\")}}));e._resolvePromiseDecorator(y.GET_CATALOG,n)})).catch((function(t){e._rejectPromiseDecorator(y.GET_CATALOG,t)}))),r.promise}},{key:\"paymentsGetPurchases\",value:function(){var e=this;if(!zn(this,Kn))return Promise.reject();var t=this._getPromiseDecorator(y.GET_PURCHASES);return t||(t=this._createPromiseDecorator(y.GET_PURCHASES),zn(this,Kn).getPurchases().then((function(t){var r=e._paymentsGetProductsPlatformData();e._paymentsPurchases=t.map((function(e){var t=Cn({id:r.find((function(t){return t.id===e.productID})).id},e.purchaseData);return delete t.productID,t})),e._resolvePromiseDecorator(y.GET_PURCHASES,e._paymentsPurchases)})).catch((function(t){e._rejectPromiseDecorator(y.GET_PURCHASES,t)}))),t.promise}},{key:\"getRemoteConfig\",value:function(e){var t=this;if(!this._platformSdk)return Promise.reject();var r=e;r||(r={}),r.clientFeatures||(r.clientFeatures=[]);var n=this._getPromiseDecorator(y.GET_REMOTE_CONFIG);return n||(n=this._createPromiseDecorator(y.GET_REMOTE_CONFIG),this._platformSdk.getFlags(r).then((function(e){t._resolvePromiseDecorator(y.GET_REMOTE_CONFIG,e)})).catch((function(e){t._rejectPromiseDecorator(y.GET_REMOTE_CONFIG,e)}))),n.promise}},{key:\"clipboardWrite\",value:function(e){var t=this,r=this._getPromiseDecorator(y.CLIPBOARD_WRITE);return r||(r=this._createPromiseDecorator(y.CLIPBOARD_WRITE),this._platformSdk.clipboard.writeText(e).then((function(){t._resolvePromiseDecorator(y.CLIPBOARD_WRITE,!0)})).catch((function(e){t._rejectPromiseDecorator(y.CLIPBOARD_WRITE,e)}))),r.promise}}])&&Nn(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),h}(mn);function eo(e){return eo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},eo(e)}function to(){to=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i=\"function\"==typeof Symbol?Symbol:{},a=i.iterator||\"@@iterator\",s=i.asyncIterator||\"@@asyncIterator\",c=i.toStringTag||\"@@toStringTag\";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},\"\")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,\"_invoke\",{value:O(e,r,s)}),a}function f(e,t,r){try{return{type:\"normal\",arg:e.call(t,r)}}catch(e){return{type:\"throw\",arg:e}}}t.wrap=l;var p=\"suspendedStart\",d=\"suspendedYield\",h=\"executing\",y=\"completed\",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(e){[\"next\",\"throw\",\"return\"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=f(e[o],e,i);if(\"throw\"!==c.type){var u=c.arg,l=u.value;return l&&\"object\"==eo(l)&&n.call(l,\"__await\")?t.resolve(l.__await).then((function(e){r(\"next\",e,a,s)}),(function(e){r(\"throw\",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r(\"throw\",e,a,s)}))}s(c.arg)}var i;o(this,\"_invoke\",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error(\"Generator is already running\");if(o===y){if(\"throw\"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===m)continue;return c}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=h;var u=f(t,r,n);if(\"normal\"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}\"throw\"===u.type&&(o=y,n.method=\"throw\",n.arg=u.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,\"throw\"===n&&t.iterator.return&&(r.method=\"return\",r.arg=e,k(t,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),m;var i=f(o,t.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=e),r.delegate=null,m):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type=\"normal\",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:\"root\"}],e.forEach(T,this),this.reset(!0)}function R(t){if(t||\"\"===t){var r=t[a];if(r)return r.call(t);if(\"function\"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var c=n.call(a,\"catchLoc\"),u=n.call(a,\"finallyLoc\");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),m}},t}function ro(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function no(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ro(i,n,o,a,s,\"next\",e)}function s(e){ro(i,n,o,a,s,\"throw\",e)}a(void 0)}))}}function oo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function io(e){for(var t=1;t120?this._rejectPromiseDecorator(y.INVITE_FRIENDS,A):this._platformSdk.UI.showInvite(t)),r.promise}},{key:\"rate\",value:function(){var e=this._getPromiseDecorator(y.RATE);return e||(e=this._createPromiseDecorator(y.RATE),this._platformSdk.UI.showRatingDialog()),e.promise}},{key:\"createPost\",value:function(e){if(!e||null==e||!e.media)return Promise.reject();var t,r=this._getPromiseDecorator(y.CREATE_POST);return r||(r=this._createPromiseDecorator(y.CREATE_POST),this._platformSdk.UI.postMediatopic(e,null!==(t=e.status)&&void 0!==t&&t)),r.promise}},{key:\"joinCommunity\",value:function(e){if(!e||null==e||!e.groupId)return Promise.reject();var t,r=this._getPromiseDecorator(y.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(y.JOIN_COMMUNITY),this._platformSdk.UI.joinGroup(e.groupId,null!==(t=e.enableMessages)&&void 0!==t&&t)),r.promise}}])&&ai(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),l}(mn);function sa(e){return sa=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},sa(e)}function ca(){ca=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i=\"function\"==typeof Symbol?Symbol:{},a=i.iterator||\"@@iterator\",s=i.asyncIterator||\"@@asyncIterator\",c=i.toStringTag||\"@@toStringTag\";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},\"\")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,\"_invoke\",{value:O(e,r,s)}),a}function f(e,t,r){try{return{type:\"normal\",arg:e.call(t,r)}}catch(e){return{type:\"throw\",arg:e}}}t.wrap=l;var p=\"suspendedStart\",d=\"suspendedYield\",h=\"executing\",y=\"completed\",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(e){[\"next\",\"throw\",\"return\"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=f(e[o],e,i);if(\"throw\"!==c.type){var u=c.arg,l=u.value;return l&&\"object\"==sa(l)&&n.call(l,\"__await\")?t.resolve(l.__await).then((function(e){r(\"next\",e,a,s)}),(function(e){r(\"throw\",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r(\"throw\",e,a,s)}))}s(c.arg)}var i;o(this,\"_invoke\",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error(\"Generator is already running\");if(o===y){if(\"throw\"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===m)continue;return c}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=h;var u=f(t,r,n);if(\"normal\"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}\"throw\"===u.type&&(o=y,n.method=\"throw\",n.arg=u.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,\"throw\"===n&&t.iterator.return&&(r.method=\"return\",r.arg=e,k(t,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),m;var i=f(o,t.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=e),r.delegate=null,m):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type=\"normal\",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:\"root\"}],e.forEach(T,this),this.reset(!0)}function R(t){if(t||\"\"===t){var r=t[a];if(r)return r.call(t);if(\"function\"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var c=n.call(a,\"catchLoc\"),u=n.call(a,\"finallyLoc\");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),m}},t}function ua(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function la(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fa(e){for(var t=1;t1&&void 0!==n[1]&&n[1],this._platformStorageCachedData){e.next=5;break}return e.next=4,this.platformSdk.cloudSaveApi.getState();case 4:this._platformStorageCachedData=e.sent;case 5:return e.abrupt(\"return\",Ae(t,this._platformStorageCachedData,r));case 6:case\"end\":return e.stop()}}),e,this)})),wa=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ua(i,n,o,a,s,\"next\",e)}function s(e){ua(i,n,o,a,s,\"throw\",e)}a(void 0)}))},wa.apply(this,arguments)}const Aa=function(t){!function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&ya(e,t)}(l,t);var r,n,o,s,c=(o=l,s=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=va(o);if(s){var r=va(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&(\"object\"===sa(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return ma(e)}(this,e)});function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,l);for(var t=arguments.length,r=new Array(t),n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,is)),{},{playerid:t.playerid,playername:t.playername,lastupdated:t.lastupdated,date:t.date,rdate:t.rdate})}))):n(new Error(e.errorcode))}))}))}},{key:\"showAchievementsNativePopup\",value:function(e){return this._platformSdk.GameAPI.Achievements.list(e),Promise.resolve()}}])&&us(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),l}(mn);function ws(e){return ws=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},ws(e)}function As(e,t){for(var r=0;r0&&(e._playerId=o,e._playerName=i,e._playerPhotos.push(a),e._isPlayerAuthorized=!0),e._isInitialized=!0,e._resolvePromiseDecorator(y.INITIALIZE)}))}))})):this._rejectPromiseDecorator(y.INITIALIZE,E)),t.promise}},{key:\"isStorageSupported\",value:function(e){return e!==u.PLATFORM_INTERNAL&&ks(Ds(l.prototype),\"isStorageSupported\",this).call(this,e)}},{key:\"isStorageAvailable\",value:function(e){return e!==u.PLATFORM_INTERNAL&&ks(Ds(l.prototype),\"isStorageAvailable\",this).call(this,e)}},{key:\"showInterstitial\",value:function(){var e=this;this._setInterstitialState(i.OPENED),this._platformSdk.APIAds.show((function(){e._setInterstitialState(i.CLOSED)}))}},{key:\"showRewarded\",value:function(){var e=this;this._setRewardedState(a.OPENED),this._platformSdk.GEvents.reward((function(t,r){t?r():e._setRewardedState(a.FAILED)}),(function(t){t?(e._setRewardedState(a.REWARDED),e._setRewardedState(a.CLOSED)):e._setRewardedState(a.FAILED)}))}},{key:\"leaderboardsSetScore\",value:function(e,t){var r=this,n=this._getPromiseDecorator(y.LEADERBOARDS_SET_SCORE);if(!n){n=this._createPromiseDecorator(y.LEADERBOARDS_SET_SCORE);var o={score:t,board:e};this._platformSdk.Scores.save(o,(function(e){e.success?r._resolvePromiseDecorator(y.LEADERBOARDS_SET_SCORE):r._rejectPromiseDecorator(y.LEADERBOARDS_SET_SCORE,e.errormsg)}))}return n.promise}},{key:\"unlockAchievement\",value:function(e){var t=this;return e.achievement?new Promise((function(r,n){t._platformSdk.Achievements.save(Array.isArray(e.achievement)?e.achievement:[e.achievement],(function(e){e.success?r(e):n(e.errormsg)}))})):Promise.reject()}}])&&As(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),l}(mn);function Rs(){Rs=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i=\"function\"==typeof Symbol?Symbol:{},a=i.iterator||\"@@iterator\",s=i.asyncIterator||\"@@asyncIterator\",c=i.toStringTag||\"@@toStringTag\";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},\"\")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,\"_invoke\",{value:O(e,r,s)}),a}function f(e,t,r){try{return{type:\"normal\",arg:e.call(t,r)}}catch(e){return{type:\"throw\",arg:e}}}t.wrap=l;var p=\"suspendedStart\",d=\"suspendedYield\",h=\"executing\",y=\"completed\",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(e){[\"next\",\"throw\",\"return\"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=f(e[o],e,i);if(\"throw\"!==c.type){var u=c.arg,l=u.value;return l&&\"object\"==Ns(l)&&n.call(l,\"__await\")?t.resolve(l.__await).then((function(e){r(\"next\",e,a,s)}),(function(e){r(\"throw\",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r(\"throw\",e,a,s)}))}s(c.arg)}var i;o(this,\"_invoke\",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error(\"Generator is already running\");if(o===y){if(\"throw\"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===m)continue;return c}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=h;var u=f(t,r,n);if(\"normal\"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}\"throw\"===u.type&&(o=y,n.method=\"throw\",n.arg=u.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,\"throw\"===n&&t.iterator.return&&(r.method=\"return\",r.arg=e,k(t,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),m;var i=f(o,t.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=e),r.delegate=null,m):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type=\"normal\",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:\"root\"}],e.forEach(T,this),this.reset(!0)}function R(t){if(t||\"\"===t){var r=t[a];if(r)return r.call(t);if(\"function\"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var c=n.call(a,\"catchLoc\"),u=n.call(a,\"finallyLoc\");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),m}},t}function Ls(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function js(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cs(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedInterstitialPromises[e])return this._preloadedInterstitialPromises[e];var r=null;return this._preloadedInterstitialPromises[e]=this._platformSdk.getInterstitialAdAsync(e).then((function(e){return r=e,e.loadAsync()})).then((function(){return r})).catch((function(){return t._preloadedInterstitialPromises[e]=null,Promise.reject()})),this._preloadedInterstitialPromises[e]}function rc(e){var t=this;if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedRewardedPromises[e])return this._preloadedRewardedPromises[e];var r=null;return this._preloadedRewardedPromises[e]=this._platformSdk.getRewardedVideoAsync(e).then((function(e){return r=e,e.loadAsync()})).then((function(){return r})).catch((function(){return t._preloadedRewardedPromises[e]=null,Promise.reject()})),this._preloadedRewardedPromises[e]}function nc(){return oc.apply(this,arguments)}function oc(){var e;return e=Rs().mark((function e(){return Rs().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._platformSdk.player.isSubscribedBotAsync();case 3:if(!e.sent){e.next=6;break}return e.abrupt(\"return\",Promise.resolve());case 6:e.next=14;break;case 8:if(e.prev=8,e.t0=e.catch(0),\"INVALID_OPERATION\"!==(null===e.t0||void 0===e.t0?void 0:e.t0.code)){e.next=13;break}e.next=14;break;case 13:throw new Error(e.t0);case 14:return e.prev=15,e.next=18,this._platformSdk.player.canSubscribeBotAsync();case 18:if(!e.sent){e.next=21;break}return e.abrupt(\"return\",this._platformSdk.player.subscribeBotAsync());case 21:e.next=28;break;case 23:if(e.prev=23,e.t1=e.catch(15),\"INVALID_OPERATION\"!==(null===e.t1||void 0===e.t1?void 0:e.t1.code)){e.next=27;break}return e.abrupt(\"return\",Promise.resolve());case 27:throw new Error(e.t1);case 28:return e.abrupt(\"return\",Promise.resolve());case 29:case\"end\":return e.stop()}}),e,this,[[0,8],[15,23]])})),oc=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Ls(i,n,o,a,s,\"next\",e)}function s(e){Ls(i,n,o,a,s,\"throw\",e)}a(void 0)}))},oc.apply(this,arguments)}const ic=function(t){!function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&Hs(e,t)}(d,t);var r,n,o,c,p=(o=d,c=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=xs(o);if(c){var r=xs(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&(\"object\"===Ns(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return Fs(e)}(this,e)});function d(){var e,t,r,n;!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,d);for(var o=arguments.length,i=new Array(o),a=0;a\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n',\"\",{players:r},(function(e){e.showAsync(),t._overlay=e,n.remove(),t._resolvePromiseDecorator(y.LEADERBOARDS_SHOW_NATIVE_POPUP)}),(function(e,r){n.remove(),t._rejectPromiseDecorator(y.LEADERBOARDS_SHOW_NATIVE_POPUP,r)})).iframeElement;o.style.zIndex=9999,o.style.position=\"absolute\",o.style.top=0,o.style.left=0,o.style.height=\"100vh\",o.style.width=\"100vw\",o.style.border=0,o.id=o.name,document.body.appendChild(o)})).catch((function(e){n.remove(),t._rejectPromiseDecorator(y.LEADERBOARDS_SHOW_NATIVE_POPUP,e)}))}return r.promise}},{key:\"paymentsPurchase\",value:function(e){var t=this,r=this._paymentsGetProductPlatformData(e);r||(r={id:e});var n=this._getPromiseDecorator(y.PURCHASE);return n||(n=this._createPromiseDecorator(y.PURCHASE),this._platformSdk.payments.purchaseAsync({productID:r.platformProductId}).then((function(r){var n=Cs({id:e},r);delete n.productID,t._paymentsPurchases.push(n),t._resolvePromiseDecorator(y.PURCHASE,n)})).catch((function(e){t._rejectPromiseDecorator(y.PURCHASE,e)}))),n.promise}},{key:\"paymentsConsumePurchase\",value:function(e){var t=this,r=this._paymentsPurchases.findIndex((function(t){return t.id===e}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(y.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(y.CONSUME_PURCHASE),this._platformSdk.payments.consumePurchaseAsync(this._paymentsPurchases[r].purchaseToken).then((function(){t._paymentsPurchases.splice(r,1),t._resolvePromiseDecorator(y.CONSUME_PURCHASE,{id:e})})).catch((function(e){t._rejectPromiseDecorator(y.CONSUME_PURCHASE,e)}))),n.promise}},{key:\"paymentsGetCatalog\",value:function(){var e=this,t=this._paymentsGetProductsPlatformData();if(!t)return Promise.reject();var r=this._getPromiseDecorator(y.GET_CATALOG);return r||(r=this._createPromiseDecorator(y.GET_CATALOG),this._platformSdk.payments.getCatalogAsync().then((function(r){var n=t.map((function(e){var t=r.find((function(t){return t.productID===e.platformProductId}));return{id:e.id,title:t.title,description:t.description,imageURI:t.imageURI,price:t.price,priceCurrencyCode:t.priceCurrencyCode,priceValue:t.priceAmount}}));e._resolvePromiseDecorator(y.GET_CATALOG,n)})).catch((function(t){e._rejectPromiseDecorator(y.GET_CATALOG,t)}))),r.promise}},{key:\"paymentsGetPurchases\",value:function(){var e=this,t=this._getPromiseDecorator(y.GET_PURCHASES);return t||(t=this._createPromiseDecorator(y.GET_PURCHASES),this._platformSdk.payments.getPurchasesAsync().then((function(t){var r=e._paymentsGetProductsPlatformData();e._paymentsPurchases=t.map((function(e){var t=Cs({id:r.find((function(t){return t.id===e.productID})).id},e);return delete t.productID,t})),e._resolvePromiseDecorator(y.GET_PURCHASES,e._paymentsPurchases)})).catch((function(t){e._rejectPromiseDecorator(y.GET_PURCHASES,t)}))),t.promise}},{key:\"inviteFriends\",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!t.image||!t.text)return Promise.reject();if(!Pe(t.image))return Promise.reject(new Error(\"Image is not base64\"));var r=this._getPromiseDecorator(y.INVITE_FRIENDS);return r||(r=this._createPromiseDecorator(y.INVITE_FRIENDS),this._platformSdk.inviteAsync(t).then((function(){e._resolvePromiseDecorator(y.INVITE_FRIENDS)})).catch((function(t){e._rejectPromiseDecorator(y.INVITE_FRIENDS,t)}))),r.promise}},{key:\"joinCommunity\",value:function(e){var t=this,r=this._getPromiseDecorator(y.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(y.JOIN_COMMUNITY),e&&!0===e.isPage?this._platformSdk.community.followOfficialPageAsync().then((function(e){return t._resolvePromiseDecorator(y.JOIN_COMMUNITY,e)})).catch((function(e){return t._rejectPromiseDecorator(y.JOIN_COMMUNITY,e)})):this._platformSdk.community.joinOfficialGroupAsync().then((function(e){return t._resolvePromiseDecorator(y.JOIN_COMMUNITY,e)})).catch((function(e){return t._rejectPromiseDecorator(y.JOIN_COMMUNITY,e)}))),r.promise}},{key:\"share\",value:function(e){var t=this;if(!e.image||!e.text)return Promise.reject();if(!Pe(e.image))return Promise.reject(new Error(\"Image is not base64\"));var r=this._getPromiseDecorator(y.SHARE);return r||(r=this._createPromiseDecorator(y.SHARE),this._platformSdk.shareAsync(Cs({intent:\"REQUEST\"},e)).then((function(){t._resolvePromiseDecorator(y.SHARE)})).catch((function(e){t._rejectPromiseDecorator(y.SHARE,e)}))),r.promise}}],n&&Bs(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),d}(mn);function ac(e){return ac=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},ac(e)}function sc(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:\"*\";window.parent&&window.parent.postMessage(e,t)}},{key:\"addListener\",value:function(e){window.addEventListener(\"message\",e)}},{key:\"removeListener\",value:function(e){window.removeEventListener(\"message\",e)}},{key:\"generateMessageId\",value:function(){return\"\".concat(Date.now(),\"-\").concat(Math.random())}}],r&&sc(t.prototype,r),Object.defineProperty(t,\"prototype\",{writable:!1}),e}();function fc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pc(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:[],n=Array.isArray(r)?r:[],o=performance.getEntriesByType(\"resource\")||[],i=n.length>0?n:[\"name\",\"initiatorType\"],a=o.map((function(e){var t={};return i.forEach((function(r){r in e&&(t[r]=e[r])})),t}));return Ac(this,Gc).send({type:t.PLATFORM,action:Lc,id:e,options:{resources:a}}),Promise.resolve(o)}uc=Hc;const Uc=Hc;function Vc(e){return Vc=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Vc(e)}function Wc(e,t){for(var r=0;r=0&&this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(y.CONSUME_PURCHASE,e)}else this._rejectPromiseDecorator(y.CONSUME_PURCHASE,new Error(e))}function el(e){if(e.success){var t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.data.map((function(e){var r=JSON.parse(e),n=Eu({id:t.find((function(e){return e.id===r.productId})).id},r);return delete n.productId,n})),this._resolvePromiseDecorator(y.GET_PURCHASES,this._paymentsPurchases)}else this._rejectPromiseDecorator(y.GET_PURCHASES,new Error(e))}function tl(e){e.success?this._resolvePromiseDecorator(y.GET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(y.GET_STORAGE_DATA,new Error(e))}function rl(e){e.success?this._resolvePromiseDecorator(y.SET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(y.SET_STORAGE_DATA,new Error(e))}function nl(e){e.success?this._resolvePromiseDecorator(y.DELETE_STORAGE_DATA,e.data):this._rejectPromiseDecorator(y.DELETE_STORAGE_DATA,new Error(e))}const ol=function(t){!function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&Au(e,t)}(s,t);var r,n,o,i,a=(o=s,i=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ku(o);if(i){var r=ku(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&(\"object\"===Su(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return Ou(e)}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,s);for(var t=arguments.length,r=new Array(t),n=0;n=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var c=n.call(a,\"catchLoc\"),u=n.call(a,\"finallyLoc\");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),m}},t}function ul(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function ll(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ul(i,n,o,a,s,\"next\",e)}function s(e){ul(i,n,o,a,s,\"throw\",e)}a(void 0)}))}}function fl(e,t){for(var r=0;rr.indexOf(\".\")?parseFloat(r.replace(/\\./g,\"\").replace(\",\",\".\")):r.includes(\",\")&&-1!==r.lastIndexOf(\",\")&&r.lastIndexOf(\",\")===r.length-4?parseInt(r.replace(/,/,\"\"),10):r.includes(\",\")&&-1!==r.lastIndexOf(\",\")&&r.lastIndexOf(\",\")!==r.length-3?parseFloat(r.replace(\",\",\".\")):r.includes(\".\")&&-1!==r.lastIndexOf(\".\")&&r.lastIndexOf(\".\")===r.length-4?parseInt(r.replace(/\\./,\"\"),10):r.includes(\".\")?parseFloat(r):parseInt(r,10),a=null===(t=o.price)||void 0===t||null===(t=t.currency)||void 0===t?void 0:t.toUpperCase(),s=\"\".concat(i,\" \").concat(a);return{id:e.id,title:o.name,price:s,priceValue:i,priceCurrencyCode:a}}));e._resolvePromiseDecorator(y.GET_CATALOG,o)})).catch((function(t){e._rejectPromiseDecorator(y.GET_CATALOG,t)}))),r.promise}},{key:\"paymentsGetPurchases\",value:function(){var e=this,t=this._getPromiseDecorator(y.GET_PURCHASES);return t||(t=this._createPromiseDecorator(y.GET_PURCHASES),this._platformSdk.commands.getEntitlements().then((function(t){var r=e._paymentsGetProductsPlatformData();e._paymentsPurchases=t.entitlements.map((function(e){return Bl({id:r.find((function(t){return t.id===e.id})).id},e)})),e._resolvePromiseDecorator(y.GET_PURCHASES,e._paymentsPurchases)})).catch((function(t){e._rejectPromiseDecorator(y.GET_PURCHASES,t)}))),t.promise}},{key:\"inviteFriends\",value:function(){var e=this,t=this._getPromiseDecorator(y.INVITE_FRIENDS);return t||(t=this._createPromiseDecorator(y.INVITE_FRIENDS),this._platformSdk.commands.openInviteDialog().then((function(){e._resolvePromiseDecorator(y.INVITE_FRIENDS)})).catch((function(t){e._rejectPromiseDecorator(y.INVITE_FRIENDS,t)}))),t.promise}},{key:\"share\",value:function(e){var t=this;if(!e.mediaUrl)return Promise.reject();var r=this._getPromiseDecorator(y.SHARE);return r||(r=this._createPromiseDecorator(y.SHARE),this._platformSdk.commands.openShareMomentDialog({mediaUrl:e.mediaUrl}).then((function(){t._resolvePromiseDecorator(y.SHARE)})).catch((function(e){t._rejectPromiseDecorator(y.SHARE,e)}))),r.promise}}])&&Ml(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),s}(mn);function zl(e){return zl=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},zl(e)}function Zl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yl(e){for(var t=1;t2?t.slice(0,2):t,function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError(\"attempted to set read only private field\");t.value=r}}(r,tf(r,n,\"set\"),o)}));e._platformStorageCachedData={};var r=e._platformSdk.game.loadData().then((function(t){\"string\"==typeof t&&\"\"!==t&&(e._platformStorageCachedData=JSON.parse(t))}));e._platformSdk.system.onAudioEnabledChange((function(t){e._setAudioState(t)})),e._platformSdk.system.onPause((function(){e._setPauseState(!0)})),e._platformSdk.system.onResume((function(){e._setPauseState(!1)})),Promise.all([t,r]).finally((function(){e._isInitialized=!0,e._resolvePromiseDecorator(y.INITIALIZE),e._platformSdk.game.firstFrameReady()}))}))}))),t.promise}},{key:\"isStorageSupported\",value:function(e){return e===u.PLATFORM_INTERNAL||ql($l(l.prototype),\"isStorageSupported\",this).call(this,e)}},{key:\"isStorageAvailable\",value:function(e){return e===u.PLATFORM_INTERNAL||ql($l(l.prototype),\"isStorageAvailable\",this).call(this,e)}},{key:\"getDataFromStorage\",value:function(e,t,r){var n=this;return t===u.PLATFORM_INTERNAL?new Promise((function(t,o){n._platformSdk.game.loadData().then((function(o){if(\"string\"==typeof o&&\"\"!==o&&(n._platformStorageCachedData=JSON.parse(o)),Array.isArray(e)){for(var i=[],a=0;a=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,af);e.playerId=r||null,e.playerName=n||null,o&&e.playerPhotos.push(o),e.playerExtra=i,e._isPlayerAuthorized=!0}e._isInitialized=!0,e._resolvePromiseDecorator(y.INITIALIZE)},window.onBannerReady=function(){e._isBannerAvailable=!0},Se(\"https://jiogames.akamaized.net/gameSDK/jiogames/stable/v2.0/jiogames_sdk.js\",this._options.adTestMode?{\"data-jg-test-environment\":\"on\"}:{}).catch((function(t){e._rejectPromiseDecorator(y.INITIALIZE,JSON.stringify(t))}))),t.promise}},{key:\"preloadInterstitial\",value:function(){hf(this,yf,vf).call(this)}},{key:\"showInterstitial\",value:function(){var e=this;hf(this,yf,vf).call(this).then((function(){var t;e._platformSdk.showAd(null===(t=window.AdType)||void 0===t?void 0:t.Interstitial,{onAdClosed:function(){e._setInterstitialState(i.CLOSED)},onAdFailedToLoad:function(t){console.error(t),e._setInterstitialState(i.FAILED)}}),e._setInterstitialState(i.OPENED),e._preloadInterstitialPromise=null}))}},{key:\"preloadRewarded\",value:function(){hf(this,mf,_f).call(this)}},{key:\"showRewarded\",value:function(){var e=this;hf(this,mf,_f).call(this).then((function(){var t;e._platformSdk.showAd(null===(t=window.AdType)||void 0===t?void 0:t.Rewarded,{onAdClosed:function(t){t&&e._setRewardedState(a.REWARDED),e._setRewardedState(a.CLOSED)},onAdFailedToLoad:function(t){console.error(t),e._setRewardedState(a.FAILED)}}),e._setRewardedState(a.OPENED),e._preloadRewardedPromise=null}))}},{key:\"showBanner\",value:function(e){var t,r=this;this._isBannerAvailable?null===(t=window.JGBanner)||void 0===t||t.loadBanner().then((function(){var t,n;r._setBannerState(s.SHOWN),null===(t=window.JGBanner)||void 0===t||t.showBanner(e||(null===(n=window.BannerPosition)||void 0===n?void 0:n.TOP))})).catch((function(e){console.error(e),r._setBannerState(s.FAILED)})):this._setBannerState(s.FAILED)}},{key:\"hideBanner\",value:function(){var e;null===(e=window.JGBanner)||void 0===e||e.hideBanner(),this._setBannerState(s.HIDDEN)}},{key:\"leaderboardsSetScore\",value:function(e,t,r){if(!r)return Promise.reject();var n=\"string\"==typeof t?parseInt(t,10):t;return this._platformSdk.postScore(n),Promise.resolve()}}])&&sf(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),l}(mn);function Sf(e){return Sf=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Sf(e)}function bf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ef(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var c=n.call(a,\"catchLoc\"),u=n.call(a,\"finallyLoc\");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),m}},t}function Rf(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function Lf(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Rf(i,n,o,a,s,\"next\",e)}function s(e){Rf(i,n,o,a,s,\"throw\",e)}a(void 0)}))}}function jf(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};window.parent.postMessage({type:e,data:t},\"*\")}function Qf(e){this._isPlayerAuthorized=e.isPlayerAuthorized,this._isPlayerAuthorized&&(this._playerId=e.playerId,this._playerName=e.playerName,e.playerPhoto&&this._playerPhotos.push(e.playerPhoto)),this._isInitialized=!0,this._resolvePromiseDecorator(y.INITIALIZE)}function $f(e){var t,r;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.GET_STORAGE_DATA,null!==(r=e.data.data)&&void 0!==r?r:null):this._rejectPromiseDecorator(y.GET_STORAGE_DATA)}function ep(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.SET_STORAGE_DATA):this._rejectPromiseDecorator(y.SET_STORAGE_DATA)}function tp(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.DELETE_STORAGE_DATA):this._rejectPromiseDecorator(y.DELETE_STORAGE_DATA)}function rp(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.PURCHASE,e.data):this._rejectPromiseDecorator(y.PURCHASE,e.data)}function np(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.GET_CATALOG,e.data):this._rejectPromiseDecorator(y.GET_CATALOG,e.data)}function op(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.GET_PURCHASES,e.data):this._rejectPromiseDecorator(y.GET_PURCHASES,e.data)}function ip(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.CREATE_POST):this._rejectPromiseDecorator(y.CREATE_POST)}function ap(e){var t;null!==(t=e.data)&&void 0!==t&&t.success?this._resolvePromiseDecorator(y.JOIN_COMMUNITY):this._rejectPromiseDecorator(y.JOIN_COMMUNITY)}const sp=function(t){!function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&Gf(e,t)}(l,t);var r,n,o,i,a,s,c=(a=l,s=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Mf(a);if(s){var r=Mf(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&(\"object\"===Df(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return Bf(e)}(this,e)});function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,l);for(var t=arguments.length,r=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=this._getPromiseDecorator(y.CREATE_POST);return t||(t=this._createPromiseDecorator(y.CREATE_POST),Ff(this,xf,Xf).call(this,y.CREATE_POST,{options:e})),t.promise}},{key:\"joinCommunity\",value:function(){var e=this._getPromiseDecorator(y.JOIN_COMMUNITY);return e||(e=this._createPromiseDecorator(y.JOIN_COMMUNITY),Ff(this,xf,Xf).call(this,y.JOIN_COMMUNITY)),e.promise}}],n&&jf(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),l}(mn);function cp(e){return cp=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},cp(e)}function up(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lp(e){for(var t=1;t{var t={258:t=>{!function(e){t.exports=e;var r=\"listeners\",n={on:function(t,e){return a(this,t).push(e),this},once:function(t,e){var r=this;return n.originalListener=e,a(r,t).push(n),r;function n(){i.call(r,t,n),e.apply(this,arguments)}},off:i,emit:function(t,e){var r=this,n=a(r,t,!0);if(!n)return!1;var o=arguments.length;if(1===o)n.forEach((function(t){t.call(r)}));else if(2===o)n.forEach((function(t){t.call(r,e)}));else{var i=Array.prototype.slice.call(arguments,1);n.forEach((function(t){t.apply(r,i)}))}return!!n.length}};function o(t){for(var e in n)t[e]=n[e];return t}function i(t,e){var n,o=this;if(arguments.length){if(e){if(n=a(o,t,!0)){if(!(n=n.filter((function(t){return t!==e&&t.originalListener!==e}))).length)return i.call(o,t);o[r][t]=n}}else if((n=o[r])&&(delete n[t],!Object.keys(n).length))return i.call(o)}else delete o[r];return o}function a(t,e,n){if(!n||t[r]){var o=t[r]||(t[r]={});return o[e]||(o[e]=[])}}o(e.prototype),e.mixin=o}((function t(){if(!(this instanceof t))return new t}))}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{\"use strict\";var t={VK:\"vk\",OK:\"ok\",YANDEX:\"yandex\",CRAZY_GAMES:\"crazy_games\",ABSOLUTE_GAMES:\"absolute_games\",GAME_DISTRIBUTION:\"game_distribution\",PLAYGAMA:\"playgama\",PLAYDECK:\"playdeck\",TELEGRAM:\"telegram\",Y8:\"y8\",LAGGED:\"lagged\",FACEBOOK:\"facebook\",POKI:\"poki\",MOCK:\"mock\",QA_TOOL:\"qa_tool\",MSN:\"msn\",HUAWEI:\"huawei\",BITQUEST:\"bitquest\",GAMEPUSH:\"gamepush\",DISCORD:\"discord\",JIO_GAMES:\"jio_games\",YOUTUBE:\"youtube\",PORTAL:\"portal\",REDDIT:\"reddit\",XIAOMI:\"xiaomi\"},e={CORE:\"core\",PLATFORM:\"platform\",PLAYER:\"player\",GAME:\"game\",STORAGE:\"storage\",ADVERTISEMENT:\"advertisement\",SOCIAL:\"social\",DEVICE:\"device\",LEADERBOARDS:\"leaderboards\",PAYMENTS:\"payments\",REMOTE_CONFIG:\"remote_config\",CLIPBOARD:\"clipboard\",ACHIEVEMENTS:\"achievements\",ANALYTICS:\"analytics\"},n={INTERSTITIAL_STATE_CHANGED:\"interstitial_state_changed\",REWARDED_STATE_CHANGED:\"rewarded_state_changed\",BANNER_STATE_CHANGED:\"banner_state_changed\",VISIBILITY_STATE_CHANGED:\"visibility_state_changed\",AUDIO_STATE_CHANGED:\"audio_state_changed\",PAUSE_STATE_CHANGED:\"pause_state_changed\",ORIENTATION_STATE_CHANGED:\"orientation_state_changed\"},o={VISIBLE:\"visible\",HIDDEN:\"hidden\"},i={LOADING:\"loading\",OPENED:\"opened\",CLOSED:\"closed\",FAILED:\"failed\"},a={LOADING:\"loading\",OPENED:\"opened\",CLOSED:\"closed\",FAILED:\"failed\",REWARDED:\"rewarded\"},s={LOADING:\"loading\",SHOWN:\"shown\",HIDDEN:\"hidden\",FAILED:\"failed\"},c=\"banner-container\",u={LOCAL_STORAGE:\"local_storage\",PLATFORM_INTERNAL:\"platform_internal\"},l={DESKTOP:\"desktop\",MOBILE:\"mobile\",TABLET:\"tablet\",TV:\"tv\"},f={PORTRAIT:\"portrait\",LANDSCAPE:\"landscape\"},p=\"bridge-orientation-overlay\",h={GAME_READY:\"game_ready\",IN_GAME_LOADING_STARTED:\"in_game_loading_started\",IN_GAME_LOADING_STOPPED:\"in_game_loading_stopped\",GAMEPLAY_STARTED:\"gameplay_started\",GAMEPLAY_STOPPED:\"gameplay_stopped\",PLAYER_GOT_ACHIEVEMENT:\"player_got_achievement\",GAME_OVER:\"game_over\"},d=\"not_available\",y=\"in_game\",m=\"native\",v={INITIALIZE:\"initialize\",AUTHORIZE_PLAYER:\"authorize_player\",SHARE:\"share\",INVITE_FRIENDS:\"invite_friends\",JOIN_COMMUNITY:\"join_community\",CREATE_POST:\"create_post\",ADD_TO_HOME_SCREEN:\"add_to_home_screen\",ADD_TO_FAVORITES:\"add_to_favorites\",RATE:\"rate\",LEADERBOARDS_SET_SCORE:\"leaderboards_set_score\",LEADERBOARDS_GET_ENTRIES:\"leaderboards_get_entries\",LEADERBOARDS_SHOW_NATIVE_POPUP:\"leaderboards_show_native_popup\",GET_PURCHASES:\"get_purchases\",GET_CATALOG:\"get_catalog\",PURCHASE:\"purchase\",CONSUME_PURCHASE:\"consume_purchase\",GET_REMOTE_CONFIG:\"get_remote_config\",GET_STORAGE_DATA:\"get_storage_data\",SET_STORAGE_DATA:\"set_storage_data\",DELETE_STORAGE_DATA:\"delete_storage_data\",CLIPBOARD_WRITE:\"clipboard_write\",ADBLOCK_DETECT:\"adblock_detect\",SET_INTERSTITIAL_STATE:\"set_interstitial_state\",SET_REWARDED_STATE:\"set_rewarded_state\",SHOW_INTERSTITIAL:\"show_interstitial\",SHOW_REWARDED:\"show_rewarded\"},_={SDK_NOT_INITIALIZED:{message:\"Before using the SDK you must initialize it\"},STORAGE_NOT_SUPPORTED:{message:\"Storage not supported\"},STORAGE_NOT_AVAILABLE:{message:\"Storage not available\"},GAME_PARAMS_NOT_FOUND:{message:\"Game params are not found\"},INVITE_FRIENDS_MESSAGE_LENGTH_ERROR:{message:\"Message is too long\"}};function g(t){return g=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},g(t)}function S(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r2&&void 0!==arguments[2]?arguments[2]:{};if(!1!==(null===(r=this._platformBridge.options)||void 0===r?void 0:r.sendAnalyticsEvents)){var i=window.location.href;if(!(i.startsWith(\"file://\")||i.includes(\"localhost\")||i.includes(\"127.0.0.1\"))){var a={event_name:t,module:e,bridge_version:M,platform_id:this._platformBridge.platformId,game_id:J(this,et),timestamp:(new Date).toISOString(),data:o};J(this,Q).push(a),J(this,$)&&clearTimeout(J(this,$)),q(this,$,setTimeout((function(){K(n,nt,ct).call(n)}),3e3))}}}}],n&&H(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),s}(G));function dt(t){return dt=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},dt(t)}function yt(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,n){var o=document.createElement(\"script\");o.src=t;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(t){var a=document.createElement(\"script\");a.src=\"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\",a.setAttribute(\"data-ad-client\",e),r?a.setAttribute(\"data-ad-channel\",r):n&&a.setAttribute(\"data-ad-host\",n),o&&a.setAttribute(\"data-admob-interstitial-slot\",o),i&&a.setAttribute(\"data-admob-rewarded-slot\",i),u&&a.setAttribute(\"data-adbreak-test\",\"on\"),a.setAttribute(\"data-ad-frequency-hint\",s),a.setAttribute(\"crossorigin\",\"anonymous\"),a.addEventListener(\"load\",(function(){window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push(Gt({preloadAdBreaks:\"on\",sound:\"on\",onReady:function(){}},l)),t((function(t){return window.adsbygoogle.push(t)}))})),document.head.appendChild(a)}))};function Ht(t){var e=document.createElement(\"div\");return e.id=c,e.style.position=\"absolute\",document.body.appendChild(e),\"top\"===t?(e.style.top=\"0px\",e.style.height=\"90px\",e.style.width=\"100%\"):(e.style.bottom=\"0px\",e.style.height=\"90px\",e.style.width=\"100%\"),e}var Ft=function(){for(var t=arguments.length,e=new Array(t),r=0;r2&&void 0!==arguments[2]&&arguments[2];if(Array.isArray(t))return t.reduce((function(t,n,o){if(t[o]=Vt(e,n),r)try{t[o]=JSON.parse(t[o])}catch(t){}return t}),new Array(t.length));var n=Vt(e,t);if(r&&\"string\"==typeof n)try{n=JSON.parse(n)}catch(t){}return n}function zt(t,e){for(var r=Gt({},t),n=Object.keys(e),o=0;o1&&void 0!==arguments[1]?arguments[1]:\"*\";window.parent&&window.parent[Mt](t,e)}function Yt(t){return Yt=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},Yt(t)}function Jt(t,e){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];if(!(this._loadingProcessCompleted||e&&null!==this._currentLoadingProgress)){var r=document.getElementById(\"fillRect\"),n=document.getElementById(\"gradientMover\"),o=document.getElementById(\"logo\"),i=document.getElementById(\"loading-overlay\");if(r&&n&&o&&i){this._currentLoadingProgress=t;var a=Math.max(0,Math.min(100,t)),s=100-a;r.style.transform=\"translateY(\".concat(s,\"%)\"),100===a?(this._loadingProcessCompleted=!0,setTimeout((function(){r.style.display=\"none\",n.style.display=\"block\",n.classList.add(\"gradient-mover\")}),400),setTimeout((function(){return o.classList.add(\"logo-fade-out\")}),900),setTimeout((function(){return i.remove()}),1400)):n.classList.remove(\"gradient-mover\")}}}}],o&&Jt(r.prototype,o),Object.defineProperty(r,\"prototype\",{writable:!1}),c}(G);R().mixin(te.prototype);const ee=te;function re(t){return re=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},re(t)}function ne(t,e){for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(e){var n=e[this._platformBridge.platformId];if(n)return this.get(t,n,r)}var o=e;return o||(o=this.defaultType),this._platformBridge.isStorageAvailable(o)?Array.isArray(t)&&0===t.length?Promise.resolve([]):this._platformBridge.getDataFromStorage(t,o,r):Promise.reject()}},{key:\"set\",value:function(t,e,r){if(r){var n=r[this._platformBridge.platformId];if(n)return this.set(t,e,n)}var o=r;if(o||(o=this.defaultType),!this._platformBridge.isStorageAvailable(o))return Promise.reject();if(Array.isArray(t)){if(!Array.isArray(e))return Promise.reject(new Error(\"Value must be an array when key is an array\"));if(t.length!==e.length)return Promise.reject(new Error(\"Key and value arrays must have the same length\"));if(0===t.length)return Promise.resolve()}return this._platformBridge.setDataToStorage(t,e,o)}},{key:\"delete\",value:function(t,e){if(e){var r=e[this._platformBridge.platformId];if(r)return this.delete(t,r)}var n=e;return n||(n=this.defaultType),this._platformBridge.isStorageAvailable(n)?Array.isArray(t)&&0===t.length?Promise.resolve():this._platformBridge.deleteDataFromStorage(t,n):Promise.reject()}}],r&&ne(e.prototype,r),Object.defineProperty(e,\"prototype\",{writable:!1}),a}(G);function ce(t){return ce=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},ce(t)}function ue(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:\"bottom\",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.bannerState!==s.LOADING&&this.bannerState!==s.SHOWN){Be(this,Ve,e);var n,o=r;if(o||null!==(n=this._platformBridge.options)&&void 0!==n&&null!==(n=n.advertisement)&&void 0!==n&&null!==(n=n.banner)&&void 0!==n&&n.placementFallback&&(o=this._platformBridge.options.advertisement.banner.placementFallback),Be(this,We,o),xe(this,nr,dr).call(this,s.LOADING),this.isBannerSupported){var i=null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t||null===(t=t.banner)||void 0===t?void 0:t.placements,a=xe(this,ar,vr).call(this,o,i);this._platformBridge.showBanner(e,a)}else xe(this,nr,dr).call(this,s.FAILED)}}},{key:\"hideBanner\",value:function(){this.bannerState!==s.LOADING&&this.bannerState!==s.HIDDEN&&this.isBannerSupported&&this._platformBridge.hideBanner()}},{key:\"preloadInterstitial\",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isInterstitialSupported){var r,n=e;n&&\"string\"==typeof n||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.interstitial)&&void 0!==r&&r.placementFallback&&(n=this._platformBridge.options.advertisement.interstitial.placementFallback);var o=null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t||null===(t=t.interstitial)||void 0===t?void 0:t.placements,i=xe(this,ar,vr).call(this,n,o);this._platformBridge.preloadInterstitial(i)}}},{key:\"showInterstitial\",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!xe(this,rr,hr).call(this)){var r,n=e;if(n||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.interstitial)&&void 0!==r&&r.placementFallback&&(n=this._platformBridge.options.advertisement.interstitial.placementFallback),Be(this,Ze,n),xe(this,or,yr).call(this,i.LOADING),this.isInterstitialSupported)if(this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&He(this,Ye)&&He(this,Ye).state===_e)xe(this,or,yr).call(this,i.FAILED);else{var o=null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t||null===(t=t.interstitial)||void 0===t?void 0:t.placements,a=xe(this,ar,vr).call(this,n,o);this._platformBridge.showInterstitial(a)}else xe(this,or,yr).call(this,i.FAILED)}}},{key:\"preloadRewarded\",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isRewardedSupported){var r,n=e;n&&\"string\"==typeof n||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.rewarded)&&void 0!==r&&r.placementFallback&&(n=this._platformBridge.options.advertisement.rewarded.placementFallback);var o=null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t||null===(t=t.rewarded)||void 0===t?void 0:t.placements,i=xe(this,ar,vr).call(this,n,o);this._platformBridge.preloadRewarded(i)}}},{key:\"showRewarded\",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!xe(this,rr,hr).call(this)){var r;Be(this,qe,e),He(this,qe)||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.rewarded)&&void 0!==r&&r.placementFallback&&Be(this,qe,this._platformBridge.options.advertisement.rewarded.placementFallback);var n=null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t||null===(t=t.rewarded)||void 0===t?void 0:t.placements,o=xe(this,ar,vr).call(this,He(this,qe),n);xe(this,ir,mr).call(this,a.LOADING),this.isRewardedSupported?this._platformBridge.showRewarded(o):xe(this,ir,mr).call(this,a.FAILED)}}},{key:\"checkAdBlock\",value:function(){return this._platformBridge.checkAdBlock()}}],r&&Ie(e.prototype,r),Object.defineProperty(e,\"prototype\",{writable:!1}),l}(G);function cr(t){Be(this,Je,t),He(this,Ye)&&(He(this,Ye).stop(),xe(this,er,pr).call(this))}function ur(t){if(\"number\"==typeof t)return t;if(\"string\"==typeof t){var e=parseInt(t,10);return Number.isNaN(e)?null:e}return null}function lr(){var t=xe(this,tr,fr).call(this);if(void 0!==t){var e=xe(this,Qe,ur).call(this,t);null!==e&&xe(this,Xe,cr).call(this,e)}}function fr(){var t;return null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t?void 0:t.minimumDelayBetweenInterstitial}function pr(){He(this,Je)>0&&this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&(Be(this,Ye,new ke(He(this,Je))),He(this,Ye).start())}function hr(){var t=[i.LOADING,i.OPENED].includes(He(this,ze)),e=[a.LOADING,a.OPENED,a.REWARDED].includes(He(this,Ke));return t||e}function dr(t){He(this,Ue)!==t&&(Be(this,Ue,t),ht.send(\"\".concat(e.ADVERTISEMENT,\"_banner_\").concat(t),e.ADVERTISEMENT,{position:He(this,Ve),placement:He(this,We)}),this.emit(n.BANNER_STATE_CHANGED,He(this,Ue)))}function yr(t){He(this,ze)!==t&&(Be(this,ze,t),ht.send(\"\".concat(e.ADVERTISEMENT,\"_interstitial_\").concat(t),e.ADVERTISEMENT,{placement:He(this,Ze)}),this.emit(n.INTERSTITIAL_STATE_CHANGED,He(this,ze)))}function mr(t){He(this,Ke)!==t&&(Be(this,Ke,t),ht.send(\"\".concat(e.ADVERTISEMENT,\"_rewarded_\").concat(t),e.ADVERTISEMENT,{placement:He(this,qe)}),this.emit(n.REWARDED_STATE_CHANGED,He(this,Ke)))}function vr(t,e){if(!t)return t;if(!e)return t;var r=e.find((function(e){return e.id===t}));return r&&r[this._platformBridge.platformId]?r[this._platformBridge.platformId]:t}R().mixin(sr.prototype);const _r=sr;function gr(t){return gr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},gr(t)}function Sr(t,e){for(var r=0;rwindow.innerWidth?f.PORTRAIT:f.LANDSCAPE}function Xr(){var t=Cr(this,Vr,qr).call(this);t!==Gr(this,Br)&&(Nr(this,Br,t),this.emit(n.ORIENTATION_STATE_CHANGED,Gr(this,Br)),Cr(this,zr,Qr).call(this))}function Qr(){if(Gr(this,Fr))if(1===Gr(this,Hr).length){var t=Gr(this,Hr)[0];Gr(this,Br)!==t?Cr(this,Zr,$r).call(this):Cr(this,Yr,tn).call(this)}else Cr(this,Yr,tn).call(this)}function $r(){Gr(this,xr)||(Nr(this,xr,function(){if(!document.getElementById(\"bridge-orientation-overlay-styles\")){var t=document.createElement(\"style\");t.id=\"bridge-orientation-overlay-styles\",t.textContent=\"\\n #\".concat(p,\" {\\n position: fixed;\\n top: 0;\\n left: 0;\\n width: 100vw;\\n height: 100vh;\\n background-color: rgba(0, 0, 0, 0.95);\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n z-index: 9999999;\\n }\\n\\n #bridge-orientation-icon {\\n width: 80px;\\n height: 80px;\\n animation: bridge-rotate-phone 1.5s ease-in-out infinite;\\n }\\n\\n #bridge-orientation-message {\\n color: #fff;\\n font-size: 18px;\\n font-family: Arial, sans-serif;\\n margin-top: 20px;\\n text-align: center;\\n }\\n\\n @keyframes bridge-rotate-phone {\\n 0%, 100% { transform: rotate(0deg); }\\n 50% { transform: rotate(90deg); }\\n }\\n \"),document.head.appendChild(t)}var e=document.createElement(\"div\");e.id=p;var r=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");r.setAttribute(\"id\",\"bridge-orientation-icon\"),r.setAttribute(\"viewBox\",\"0 0 24 24\"),r.setAttribute(\"fill\",\"none\"),r.setAttribute(\"xmlns\",\"http://www.w3.org/2000/svg\"),r.innerHTML='\\n \\n \\n ';var n=document.createElement(\"div\");return n.id=\"bridge-orientation-message\",n.innerText=\"Please rotate your device\",e.appendChild(r),e.appendChild(n),e}()),document.body.appendChild(Gr(this,xr)))}function tn(){Gr(this,xr)&&(Gr(this,xr).remove(),Nr(this,xr,null))}R().mixin(Jr.prototype);const en=Jr;function rn(t){return rn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},rn(t)}function nn(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:\"result\",i=this._getPromiseDecorator(t);return i||(i=this._createPromiseDecorator(t),this._platformSdk.send(e,n).then((function(e){e[o]?r._resolvePromiseDecorator(t):r._rejectPromiseDecorator(t)})).catch((function(e){r._rejectPromiseDecorator(t,e)}))),i.promise}const Oo=function(e){!function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,\"prototype\",{writable:!1}),e&&yo(t,e)}(p,e);var r,n,o,c,f=(o=p,c=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=vo(o);if(c){var r=vo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&(\"object\"===fo(e)||\"function\"==typeof e))return e;if(void 0!==e)throw new TypeError(\"Derived constructors may only return object or undefined\");return mo(t)}(this,t)});function p(){var t,e,r;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,p);for(var n=arguments.length,o=new Array(n),i=0;i0?t.entries.map((function(t){return{id:t.player.uniqueID,name:t.player.publicName,score:t.score,rank:t.rank,photo:t.player.getAvatarSrc(\"large\")}})):[],e._resolvePromiseDecorator(v.LEADERBOARDS_GET_ENTRIES,r)})).catch((function(t){e._rejectPromiseDecorator(v.LEADERBOARDS_GET_ENTRIES,t)}))}return r.promise}},{key:\"paymentsPurchase\",value:function(t){var e=this;if(!Ho(this,Wo))return Promise.reject();var r=this._paymentsGetProductPlatformData(t);r||(r={id:t});var n=this._getPromiseDecorator(v.PURCHASE);return n||(n=this._createPromiseDecorator(v.PURCHASE),Ho(this,Wo).purchase(r).then((function(r){var n=Do({id:t},r.purchaseData);delete n.productID,e._paymentsPurchases.push(n),e._resolvePromiseDecorator(v.PURCHASE,n)})).catch((function(t){e._rejectPromiseDecorator(v.PURCHASE,t)}))),n.promise}},{key:\"paymentsConsumePurchase\",value:function(t){var e=this;if(!Ho(this,Wo))return Promise.reject();var r=this._paymentsPurchases.findIndex((function(e){return e.id===t}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(v.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(v.CONSUME_PURCHASE),Ho(this,Wo).consumePurchase(this._paymentsPurchases[r].purchaseToken).then((function(){e._paymentsPurchases.splice(r,1),e._resolvePromiseDecorator(v.CONSUME_PURCHASE,{id:t})})).catch((function(t){e._rejectPromiseDecorator(v.CONSUME_PURCHASE,t)}))),n.promise}},{key:\"paymentsGetCatalog\",value:function(){var t=this;if(!Ho(this,Wo))return Promise.reject();var e=this._paymentsGetProductsPlatformData(),r=this._getPromiseDecorator(v.GET_CATALOG);return r||(r=this._createPromiseDecorator(v.GET_CATALOG),Ho(this,Wo).getCatalog().then((function(r){var n=e.map((function(t){var e,n=r.find((function(e){return e.id===t.id}));return{id:t.id,title:n.title,description:n.description,imageURI:n.imageURI,price:n.price,priceCurrencyCode:n.priceCurrencyCode,priceValue:n.priceValue,priceCurrencyImage:null===(e=n.getPriceCurrencyImage)||void 0===e?void 0:e.call(n,\"medium\")}}));t._resolvePromiseDecorator(v.GET_CATALOG,n)})).catch((function(e){t._rejectPromiseDecorator(v.GET_CATALOG,e)}))),r.promise}},{key:\"paymentsGetPurchases\",value:function(){var t=this;if(!Ho(this,Wo))return Promise.reject();var e=this._getPromiseDecorator(v.GET_PURCHASES);return e||(e=this._createPromiseDecorator(v.GET_PURCHASES),Ho(this,Wo).getPurchases().then((function(e){var r=t._paymentsGetProductsPlatformData();t._paymentsPurchases=e.map((function(t){var e=Do({id:r.find((function(e){return e.id===t.productID})).id},t.purchaseData);return delete e.productID,e})),t._resolvePromiseDecorator(v.GET_PURCHASES,t._paymentsPurchases)})).catch((function(e){t._rejectPromiseDecorator(v.GET_PURCHASES,e)}))),e.promise}},{key:\"getRemoteConfig\",value:function(t){var e=this;if(!this._platformSdk)return Promise.reject();var r=t;r||(r={}),r.clientFeatures||(r.clientFeatures=[]);var n=this._getPromiseDecorator(v.GET_REMOTE_CONFIG);return n||(n=this._createPromiseDecorator(v.GET_REMOTE_CONFIG),this._platformSdk.getFlags(r).then((function(t){e._resolvePromiseDecorator(v.GET_REMOTE_CONFIG,t)})).catch((function(t){e._rejectPromiseDecorator(v.GET_REMOTE_CONFIG,t)}))),n.promise}},{key:\"clipboardWrite\",value:function(t){var e=this,r=this._getPromiseDecorator(v.CLIPBOARD_WRITE);return r||(r=this._createPromiseDecorator(v.CLIPBOARD_WRITE),this._platformSdk.clipboard.writeText(t).then((function(){e._resolvePromiseDecorator(v.CLIPBOARD_WRITE,!0)})).catch((function(t){e._rejectPromiseDecorator(v.CLIPBOARD_WRITE,t)}))),r.promise}}])&&Io(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),p}(lo);function Ko(t){return Ko=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},Ko(t)}function qo(){qo=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i=\"function\"==typeof Symbol?Symbol:{},a=i.iterator||\"@@iterator\",s=i.asyncIterator||\"@@asyncIterator\",c=i.toStringTag||\"@@toStringTag\";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},\"\")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,\"_invoke\",{value:O(t,r,s)}),a}function f(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}e.wrap=l;var p=\"suspendedStart\",h=\"suspendedYield\",d=\"executing\",y=\"completed\",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(t){[\"next\",\"throw\",\"return\"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if(\"throw\"!==c.type){var u=c.arg,l=u.value;return l&&\"object\"==Ko(l)&&n.call(l,\"__await\")?e.resolve(l.__await).then((function(t){r(\"next\",t,a,s)}),(function(t){r(\"throw\",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r(\"throw\",t,a,s)}))}s(c.arg)}var i;o(this,\"_invoke\",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw new Error(\"Generator is already running\");if(o===y){if(\"throw\"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=T(s,n);if(c){if(c===m)continue;return c}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=d;var u=f(e,r,n);if(\"normal\"===u.type){if(o=n.done?y:h,u.arg===m)continue;return{value:u.arg,done:n.done}}\"throw\"===u.type&&(o=y,n.method=\"throw\",n.arg=u.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,\"throw\"===n&&e.iterator.return&&(r.method=\"return\",r.arg=t,T(e,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),m;var i=f(o,e.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=t),r.delegate=null,m):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,m)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(k,this),this.reset(!0)}function R(e){if(e||\"\"===e){var r=e[a];if(r)return r.call(e);if(\"function\"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var c=n.call(a,\"catchLoc\"),u=n.call(a,\"finallyLoc\");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),m}},e}function Xo(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Qo(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Xo(i,n,o,a,s,\"next\",t)}function s(t){Xo(i,n,o,a,s,\"throw\",t)}a(void 0)}))}}function $o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ti(t){for(var e=1;e120?this._rejectPromiseDecorator(v.INVITE_FRIENDS,_.INVITE_FRIENDS_MESSAGE_LENGTH_ERROR):this._platformSdk.UI.showInvite(e)),r.promise}},{key:\"rate\",value:function(){var t=this._getPromiseDecorator(v.RATE);return t||(t=this._createPromiseDecorator(v.RATE),this._platformSdk.UI.showRatingDialog()),t.promise}},{key:\"createPost\",value:function(t){if(!t||null==t||!t.media)return Promise.reject();var e,r=this._getPromiseDecorator(v.CREATE_POST);return r||(r=this._createPromiseDecorator(v.CREATE_POST),this._platformSdk.UI.postMediatopic(t,null!==(e=t.status)&&void 0!==e&&e)),r.promise}},{key:\"joinCommunity\",value:function(t){if(!t||null==t||!t.groupId)return Promise.reject();var e,r=this._getPromiseDecorator(v.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(v.JOIN_COMMUNITY),this._platformSdk.UI.joinGroup(t.groupId,null!==(e=t.enableMessages)&&void 0!==e&&e)),r.promise}}])&&ea(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),l}(lo);function rs(t){return rs=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},rs(t)}function ns(){ns=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i=\"function\"==typeof Symbol?Symbol:{},a=i.iterator||\"@@iterator\",s=i.asyncIterator||\"@@asyncIterator\",c=i.toStringTag||\"@@toStringTag\";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},\"\")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,\"_invoke\",{value:O(t,r,s)}),a}function f(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}e.wrap=l;var p=\"suspendedStart\",h=\"suspendedYield\",d=\"executing\",y=\"completed\",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(t){[\"next\",\"throw\",\"return\"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if(\"throw\"!==c.type){var u=c.arg,l=u.value;return l&&\"object\"==rs(l)&&n.call(l,\"__await\")?e.resolve(l.__await).then((function(t){r(\"next\",t,a,s)}),(function(t){r(\"throw\",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r(\"throw\",t,a,s)}))}s(c.arg)}var i;o(this,\"_invoke\",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw new Error(\"Generator is already running\");if(o===y){if(\"throw\"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=T(s,n);if(c){if(c===m)continue;return c}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=d;var u=f(e,r,n);if(\"normal\"===u.type){if(o=n.done?y:h,u.arg===m)continue;return{value:u.arg,done:n.done}}\"throw\"===u.type&&(o=y,n.method=\"throw\",n.arg=u.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,\"throw\"===n&&e.iterator.return&&(r.method=\"return\",r.arg=t,T(e,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),m;var i=f(o,e.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=t),r.delegate=null,m):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,m)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(k,this),this.reset(!0)}function R(e){if(e||\"\"===e){var r=e[a];if(r)return r.call(e);if(\"function\"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var c=n.call(a,\"catchLoc\"),u=n.call(a,\"finallyLoc\");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),m}},e}function os(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function is(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function as(t){for(var e=1;e1&&void 0!==n[1])||n[1],this._platformStorageCachedData){t.next=5;break}return t.next=4,this.platformSdk.cloudSaveApi.getState();case 4:this._platformStorageCachedData=t.sent;case 5:return t.abrupt(\"return\",Wt(e,this._platformStorageCachedData,r));case 6:case\"end\":return t.stop()}}),t,this)})),gs=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){os(i,n,o,a,s,\"next\",t)}function s(t){os(i,n,o,a,s,\"throw\",t)}a(void 0)}))},gs.apply(this,arguments)}const Ss=function(e){!function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,\"prototype\",{writable:!1}),e&&ls(t,e)}(l,e);var r,n,o,s,c=(o=l,s=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ps(o);if(s){var r=ps(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&(\"object\"===rs(e)||\"function\"==typeof e))return e;if(void 0!==e)throw new TypeError(\"Derived constructors may only return object or undefined\");return fs(t)}(this,t)});function l(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,l);for(var e=arguments.length,r=new Array(e),n=0;n=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,tc)),{},{playerid:e.playerid,playername:e.playername,lastupdated:e.lastupdated,date:e.date,rdate:e.rdate})}))):n(new Error(t.errorcode))}))}))}},{key:\"showAchievementsNativePopup\",value:function(t){return this._platformSdk.GameAPI.Achievements.list(t),Promise.resolve()}}])&&oc(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),l}(lo);function gc(t){return gc=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},gc(t)}function Sc(t,e){for(var r=0;r0&&(t._playerId=o,t._playerName=i,t._playerPhotos.push(a),t._isPlayerAuthorized=!0),t._isInitialized=!0,t._resolvePromiseDecorator(v.INITIALIZE)}))}))})):this._rejectPromiseDecorator(v.INITIALIZE,_.GAME_PARAMS_NOT_FOUND)),e.promise}},{key:\"isStorageSupported\",value:function(t){return t!==u.PLATFORM_INTERNAL&&Ec(wc(l.prototype),\"isStorageSupported\",this).call(this,t)}},{key:\"isStorageAvailable\",value:function(t){return t!==u.PLATFORM_INTERNAL&&Ec(wc(l.prototype),\"isStorageAvailable\",this).call(this,t)}},{key:\"showInterstitial\",value:function(){var t=this;this._setInterstitialState(i.OPENED),this._platformSdk.APIAds.show((function(){t._setInterstitialState(i.CLOSED)}))}},{key:\"showRewarded\",value:function(){var t=this;this._setRewardedState(a.OPENED),this._platformSdk.GEvents.reward((function(e,r){e?r():t._setRewardedState(a.FAILED)}),(function(e){e?(t._setRewardedState(a.REWARDED),t._setRewardedState(a.CLOSED)):t._setRewardedState(a.FAILED)}))}},{key:\"leaderboardsSetScore\",value:function(t,e){var r=this,n=this._getPromiseDecorator(v.LEADERBOARDS_SET_SCORE);if(!n){n=this._createPromiseDecorator(v.LEADERBOARDS_SET_SCORE);var o={score:e,board:t};this._platformSdk.Scores.save(o,(function(t){t.success?r._resolvePromiseDecorator(v.LEADERBOARDS_SET_SCORE):r._rejectPromiseDecorator(v.LEADERBOARDS_SET_SCORE,t.errormsg)}))}return n.promise}},{key:\"unlockAchievement\",value:function(t){var e=this;return t.achievement?new Promise((function(r,n){e._platformSdk.Achievements.save(Array.isArray(t.achievement)?t.achievement:[t.achievement],(function(t){t.success?r(t):n(t.errormsg)}))})):Promise.reject()}}])&&Sc(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),l}(lo);function Oc(){Oc=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i=\"function\"==typeof Symbol?Symbol:{},a=i.iterator||\"@@iterator\",s=i.asyncIterator||\"@@asyncIterator\",c=i.toStringTag||\"@@toStringTag\";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},\"\")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,\"_invoke\",{value:O(t,r,s)}),a}function f(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}e.wrap=l;var p=\"suspendedStart\",h=\"suspendedYield\",d=\"executing\",y=\"completed\",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(t){[\"next\",\"throw\",\"return\"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if(\"throw\"!==c.type){var u=c.arg,l=u.value;return l&&\"object\"==Ic(l)&&n.call(l,\"__await\")?e.resolve(l.__await).then((function(t){r(\"next\",t,a,s)}),(function(t){r(\"throw\",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r(\"throw\",t,a,s)}))}s(c.arg)}var i;o(this,\"_invoke\",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw new Error(\"Generator is already running\");if(o===y){if(\"throw\"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=T(s,n);if(c){if(c===m)continue;return c}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=d;var u=f(e,r,n);if(\"normal\"===u.type){if(o=n.done?y:h,u.arg===m)continue;return{value:u.arg,done:n.done}}\"throw\"===u.type&&(o=y,n.method=\"throw\",n.arg=u.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,\"throw\"===n&&e.iterator.return&&(r.method=\"return\",r.arg=t,T(e,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),m;var i=f(o,e.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=t),r.delegate=null,m):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,m)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(k,this),this.reset(!0)}function R(e){if(e||\"\"===e){var r=e[a];if(r)return r.call(e);if(\"function\"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var c=n.call(a,\"catchLoc\"),u=n.call(a,\"finallyLoc\");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),m}},e}function Tc(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function kc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Dc(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedInterstitialPromises[t])return this._preloadedInterstitialPromises[t];var r=null;return this._preloadedInterstitialPromises[t]=this._platformSdk.getInterstitialAdAsync(t).then((function(t){return r=t,t.loadAsync()})).then((function(){return r})).catch((function(){return e._preloadedInterstitialPromises[t]=null,Promise.reject()})),this._preloadedInterstitialPromises[t]}function Xc(t){var e=this;if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedRewardedPromises[t])return this._preloadedRewardedPromises[t];var r=null;return this._preloadedRewardedPromises[t]=this._platformSdk.getRewardedVideoAsync(t).then((function(t){return r=t,t.loadAsync()})).then((function(){return r})).catch((function(){return e._preloadedRewardedPromises[t]=null,Promise.reject()})),this._preloadedRewardedPromises[t]}function Qc(){return $c.apply(this,arguments)}function $c(){var t;return t=Oc().mark((function t(){return Oc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._platformSdk.player.isSubscribedBotAsync();case 3:if(!t.sent){t.next=6;break}return t.abrupt(\"return\",Promise.resolve());case 6:t.next=14;break;case 8:if(t.prev=8,t.t0=t.catch(0),\"INVALID_OPERATION\"!==(null===t.t0||void 0===t.t0?void 0:t.t0.code)){t.next=13;break}t.next=14;break;case 13:throw new Error(t.t0);case 14:return t.prev=15,t.next=18,this._platformSdk.player.canSubscribeBotAsync();case 18:if(!t.sent){t.next=21;break}return t.abrupt(\"return\",this._platformSdk.player.subscribeBotAsync());case 21:t.next=28;break;case 23:if(t.prev=23,t.t1=t.catch(15),\"INVALID_OPERATION\"!==(null===t.t1||void 0===t.t1?void 0:t.t1.code)){t.next=27;break}return t.abrupt(\"return\",Promise.resolve());case 27:throw new Error(t.t1);case 28:return t.abrupt(\"return\",Promise.resolve());case 29:case\"end\":return t.stop()}}),t,this,[[0,8],[15,23]])})),$c=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Tc(i,n,o,a,s,\"next\",t)}function s(t){Tc(i,n,o,a,s,\"throw\",t)}a(void 0)}))},$c.apply(this,arguments)}const tu=function(e){!function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,\"prototype\",{writable:!1}),e&&Nc(t,e)}(p,e);var r,n,o,c,f=(o=p,c=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Gc(o);if(c){var r=Gc(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&(\"object\"===Ic(e)||\"function\"==typeof e))return e;if(void 0!==e)throw new TypeError(\"Derived constructors may only return object or undefined\");return Cc(t)}(this,t)});function p(){var t,e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,p);for(var o=arguments.length,i=new Array(o),a=0;a\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n',\"\",{players:r},(function(t){t.showAsync(),e._overlay=t,n.remove(),e._resolvePromiseDecorator(v.LEADERBOARDS_SHOW_NATIVE_POPUP)}),(function(t,r){n.remove(),e._rejectPromiseDecorator(v.LEADERBOARDS_SHOW_NATIVE_POPUP,r)})).iframeElement;o.style.zIndex=9999,o.style.position=\"absolute\",o.style.top=0,o.style.left=0,o.style.height=\"100vh\",o.style.width=\"100vw\",o.style.border=0,o.id=o.name,document.body.appendChild(o)})).catch((function(t){n.remove(),e._rejectPromiseDecorator(v.LEADERBOARDS_SHOW_NATIVE_POPUP,t)}))}return r.promise}},{key:\"paymentsPurchase\",value:function(t){var e=this,r=this._paymentsGetProductPlatformData(t);r||(r={id:t});var n=this._getPromiseDecorator(v.PURCHASE);return n||(n=this._createPromiseDecorator(v.PURCHASE),this._platformSdk.payments.purchaseAsync({productID:r.platformProductId}).then((function(r){var n=Dc({id:t},r);delete n.productID,e._paymentsPurchases.push(n),e._resolvePromiseDecorator(v.PURCHASE,n)})).catch((function(t){e._rejectPromiseDecorator(v.PURCHASE,t)}))),n.promise}},{key:\"paymentsConsumePurchase\",value:function(t){var e=this,r=this._paymentsPurchases.findIndex((function(e){return e.id===t}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(v.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(v.CONSUME_PURCHASE),this._platformSdk.payments.consumePurchaseAsync(this._paymentsPurchases[r].purchaseToken).then((function(){e._paymentsPurchases.splice(r,1),e._resolvePromiseDecorator(v.CONSUME_PURCHASE,{id:t})})).catch((function(t){e._rejectPromiseDecorator(v.CONSUME_PURCHASE,t)}))),n.promise}},{key:\"paymentsGetCatalog\",value:function(){var t=this,e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();var r=this._getPromiseDecorator(v.GET_CATALOG);return r||(r=this._createPromiseDecorator(v.GET_CATALOG),this._platformSdk.payments.getCatalogAsync().then((function(r){var n=e.map((function(t){var e=r.find((function(e){return e.productID===t.platformProductId}));return{id:t.id,title:e.title,description:e.description,imageURI:e.imageURI,price:e.price,priceCurrencyCode:e.priceCurrencyCode,priceValue:e.priceAmount}}));t._resolvePromiseDecorator(v.GET_CATALOG,n)})).catch((function(e){t._rejectPromiseDecorator(v.GET_CATALOG,e)}))),r.promise}},{key:\"paymentsGetPurchases\",value:function(){var t=this,e=this._getPromiseDecorator(v.GET_PURCHASES);return e||(e=this._createPromiseDecorator(v.GET_PURCHASES),this._platformSdk.payments.getPurchasesAsync().then((function(e){var r=t._paymentsGetProductsPlatformData();t._paymentsPurchases=e.map((function(t){var e=Dc({id:r.find((function(e){return e.id===t.productID})).id},t);return delete e.productID,e})),t._resolvePromiseDecorator(v.GET_PURCHASES,t._paymentsPurchases)})).catch((function(e){t._rejectPromiseDecorator(v.GET_PURCHASES,e)}))),e.promise}},{key:\"inviteFriends\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.image||!e.text)return Promise.reject();if(!Ut(e.image))return Promise.reject(new Error(\"Image is not base64\"));var r=this._getPromiseDecorator(v.INVITE_FRIENDS);return r||(r=this._createPromiseDecorator(v.INVITE_FRIENDS),this._platformSdk.inviteAsync(e).then((function(){t._resolvePromiseDecorator(v.INVITE_FRIENDS)})).catch((function(e){t._rejectPromiseDecorator(v.INVITE_FRIENDS,e)}))),r.promise}},{key:\"joinCommunity\",value:function(t){var e=this,r=this._getPromiseDecorator(v.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(v.JOIN_COMMUNITY),t&&!0===t.isPage?this._platformSdk.community.followOfficialPageAsync().then((function(t){return e._resolvePromiseDecorator(v.JOIN_COMMUNITY,t)})).catch((function(t){return e._rejectPromiseDecorator(v.JOIN_COMMUNITY,t)})):this._platformSdk.community.joinOfficialGroupAsync().then((function(t){return e._resolvePromiseDecorator(v.JOIN_COMMUNITY,t)})).catch((function(t){return e._rejectPromiseDecorator(v.JOIN_COMMUNITY,t)}))),r.promise}},{key:\"share\",value:function(t){var e=this;if(!t.image||!t.text)return Promise.reject();if(!Ut(t.image))return Promise.reject(new Error(\"Image is not base64\"));var r=this._getPromiseDecorator(v.SHARE);return r||(r=this._createPromiseDecorator(v.SHARE),this._platformSdk.shareAsync(Dc({intent:\"REQUEST\"},t)).then((function(){e._resolvePromiseDecorator(v.SHARE)})).catch((function(t){e._rejectPromiseDecorator(v.SHARE,t)}))),r.promise}}],n&&Lc(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),p}(lo);function eu(t){return eu=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},eu(t)}function ru(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:\"*\")}},{key:\"addListener\",value:function(t){window.addEventListener(\"message\",t)}},{key:\"removeListener\",value:function(t){window.removeEventListener(\"message\",t)}},{key:\"generateMessageId\",value:function(){return\"\".concat(Date.now(),\"-\").concat(Math.random())}}],r&&ru(e.prototype,r),Object.defineProperty(e,\"prototype\",{writable:!1}),t}();function au(){au=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i=\"function\"==typeof Symbol?Symbol:{},a=i.iterator||\"@@iterator\",s=i.asyncIterator||\"@@asyncIterator\",c=i.toStringTag||\"@@toStringTag\";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},\"\")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,\"_invoke\",{value:O(t,r,s)}),a}function f(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}e.wrap=l;var p=\"suspendedStart\",h=\"suspendedYield\",d=\"executing\",y=\"completed\",m={};function v(){}function _(){}function g(){}var S={};u(S,a,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(R([])));E&&E!==r&&n.call(E,a)&&(S=E);var P=g.prototype=v.prototype=Object.create(S);function w(t){[\"next\",\"throw\",\"return\"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if(\"throw\"!==c.type){var u=c.arg,l=u.value;return l&&\"object\"==fu(l)&&n.call(l,\"__await\")?e.resolve(l.__await).then((function(t){r(\"next\",t,a,s)}),(function(t){r(\"throw\",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r(\"throw\",t,a,s)}))}s(c.arg)}var i;o(this,\"_invoke\",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw new Error(\"Generator is already running\");if(o===y){if(\"throw\"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=T(s,n);if(c){if(c===m)continue;return c}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=d;var u=f(e,r,n);if(\"normal\"===u.type){if(o=n.done?y:h,u.arg===m)continue;return{value:u.arg,done:n.done}}\"throw\"===u.type&&(o=y,n.method=\"throw\",n.arg=u.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,\"throw\"===n&&e.iterator.return&&(r.method=\"return\",r.arg=t,T(e,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),m;var i=f(o,e.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=t),r.delegate=null,m):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,m)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(k,this),this.reset(!0)}function R(e){if(e||\"\"===e){var r=e[a];if(r)return r.call(e);if(\"function\"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var c=n.call(a,\"catchLoc\"),u=n.call(a,\"finallyLoc\");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),m}},e}function su(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:[],n=Array.isArray(r)?r:[],o=performance.getEntriesByType(\"resource\")||[],i=n.length>0?n:[\"name\",\"initiatorType\"],a=o.map((function(t){var e={};return i.forEach((function(r){r in t&&(e[r]=t[r])})),e}));return Eu(this,Lu,xu).call(this,{type:e.PLATFORM,action:Au.GET_PERFORMANCE_RESOURCES,id:t,options:{resources:a}}),Promise.resolve(o)}function xu(t){bu(this,Du).send(lu({source:wu},t))}function Hu(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=bu(this,Du).generateMessageId(),a=lu({timeout:0},o);return new Promise((function(s,c){var u=function n(o){var a=o.data;(null==a?void 0:a.type)===t&&(null==a?void 0:a.action)===e&&(null==a?void 0:a.id)===i&&(null==a?void 0:a.source)!==wu&&(bu(r,Du).removeListener(n),s(a))};bu(r,Du).addListener(u),Eu(r,Lu,xu).call(r,lu({type:t,action:e,id:i,options:o},n)),a.timeout>0&&setTimeout((function(){c(new Error(\"Request timeout\")),bu(r,Du).removeListener(u)}),a.timeout)}))}function Fu(){return Uu.apply(this,arguments)}function Uu(){var t;return t=au().mark((function t(){var r=this;return au().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt(\"return\",Eu(this,ju,Hu).call(this,e.PLAYER,Au.GET_PLAYER).then((function(t){var e,n=t.player;null!=n&&n.isAuthorized?(r._playerId=n.userId,r._isPlayerAuthorized=n.isAuthorized,r._playerName=n.name,Array.isArray(n.photos)&&(r._playerPhotos=function(t){if(Array.isArray(t))return su(t)}(e=n.photos)||function(t){if(\"undefined\"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t[\"@@iterator\"])return Array.from(t)}(e)||function(t,e){if(t){if(\"string\"==typeof t)return su(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return\"Object\"===r&&t.constructor&&(r=t.constructor.name),\"Map\"===r||\"Set\"===r?Array.from(t):\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?su(t,e):void 0}}(e)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()),r._playerExtra=n,r._defaultStorageType=u.PLATFORM_INTERNAL):r._playerApplyGuestData()})).catch((function(){r._playerApplyGuestData()})));case 1:case\"end\":return t.stop()}}),t,this)})),Uu=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){cu(i,n,o,a,s,\"next\",t)}function s(t){cu(i,n,o,a,s,\"throw\",t)}a(void 0)}))},Uu.apply(this,arguments)}function Vu(t){var e=t.action,r=t.payload;if(\"interstitial\"===e){if(!this.isInterstitialSupported)return;switch(r.status){case\"start\":this._setInterstitialState(i.LOADING);break;case\"open\":this._setInterstitialState(i.OPENED);break;case\"failed\":this._setInterstitialState(i.FAILED);break;case\"close\":this._setInterstitialState(i.CLOSED)}}else if(\"reward\"===e){if(!this.isRewardedSupported)return;switch(r.status){case\"start\":this._setRewardedState(a.LOADING);break;case\"open\":this._setRewardedState(a.OPENED);break;case\"rewarded\":this._setRewardedState(a.REWARDED);break;case\"close\":this._setRewardedState(a.CLOSED);break;case\"failed\":this._setRewardedState(a.FAILED)}}}ou=Gu;const Wu=Gu;function zu(t){return zu=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},zu(t)}function Zu(t,e){for(var r=0;r=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var c=n.call(a,\"catchLoc\"),u=n.call(a,\"finallyLoc\");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),m}},e}function tl(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function el(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){tl(i,n,o,a,s,\"next\",t)}function s(t){tl(i,n,o,a,s,\"throw\",t)}a(void 0)}))}}function rl(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function nl(t){for(var e=1;e1&&void 0!==n[1]&&n[1],this._platformStorageCachedData){t.next=5;break}return t.next=4,this.platformSdk.cloudSave.getDataAsync({gameId:this._options.gameId});case 4:this._platformStorageCachedData=t.sent;case 5:return t.abrupt(\"return\",Wt(e,this._platformStorageCachedData,r));case 6:case\"end\":return t.stop()}}),t,this)}))),Tl.apply(this,arguments)}const kl=function(e){!function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,\"prototype\",{writable:!1}),e&&sl(t,e)}(d,e);var r,n,o,c,l,f,p,h=(f=d,p=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ul(f);if(p){var r=ul(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&(\"object\"===Qu(e)||\"function\"==typeof e))return e;if(void 0!==e)throw new TypeError(\"Derived constructors may only return object or undefined\");return cl(t)}(this,t)});function d(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,d);for(var e=arguments.length,r=new Array(e),n=0;n=0&&this._paymentsPurchases.splice(e,1),this._resolvePromiseDecorator(v.CONSUME_PURCHASE,t)}else this._rejectPromiseDecorator(v.CONSUME_PURCHASE,new Error(t))}function lf(t){if(t.success){var e=this._paymentsGetProductsPlatformData();this._paymentsPurchases=t.data.map((function(t){var r=JSON.parse(t),n=Rl({id:e.find((function(t){return t.id===r.productId})).id},r);return delete n.productId,n})),this._resolvePromiseDecorator(v.GET_PURCHASES,this._paymentsPurchases)}else this._rejectPromiseDecorator(v.GET_PURCHASES,new Error(t))}function ff(t){t.success?this._resolvePromiseDecorator(v.GET_STORAGE_DATA,t.data):this._rejectPromiseDecorator(v.GET_STORAGE_DATA,new Error(t))}function pf(t){t.success?this._resolvePromiseDecorator(v.SET_STORAGE_DATA,t.data):this._rejectPromiseDecorator(v.SET_STORAGE_DATA,new Error(t))}function hf(t){t.success?this._resolvePromiseDecorator(v.DELETE_STORAGE_DATA,t.data):this._rejectPromiseDecorator(v.DELETE_STORAGE_DATA,new Error(t))}const df=function(e){!function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,\"prototype\",{writable:!1}),e&&Nl(t,e)}(s,e);var r,n,o,i,a=(o=s,i=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Gl(o);if(i){var r=Gl(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&(\"object\"===Dl(e)||\"function\"==typeof e))return e;if(void 0!==e)throw new TypeError(\"Derived constructors may only return object or undefined\");return Cl(t)}(this,t)});function s(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,s);for(var e=arguments.length,r=new Array(e),n=0;n=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var c=n.call(a,\"catchLoc\"),u=n.call(a,\"finallyLoc\");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),m}},e}function gf(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Sf(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){gf(i,n,o,a,s,\"next\",t)}function s(t){gf(i,n,o,a,s,\"throw\",t)}a(void 0)}))}}function bf(t,e){for(var r=0;rr.indexOf(\".\")?parseFloat(r.replace(/\\./g,\"\").replace(\",\",\".\")):r.includes(\",\")&&-1!==r.lastIndexOf(\",\")&&r.lastIndexOf(\",\")===r.length-4?parseInt(r.replace(/,/,\"\"),10):r.includes(\",\")&&-1!==r.lastIndexOf(\",\")&&r.lastIndexOf(\",\")!==r.length-3?parseFloat(r.replace(\",\",\".\")):r.includes(\".\")&&-1!==r.lastIndexOf(\".\")&&r.lastIndexOf(\".\")===r.length-4?parseInt(r.replace(/\\./,\"\"),10):r.includes(\".\")?parseFloat(r):parseInt(r,10),a=null===(e=o.price)||void 0===e||null===(e=e.currency)||void 0===e?void 0:e.toUpperCase(),s=\"\".concat(i,\" \").concat(a);return{id:t.id,title:o.name,price:s,priceValue:i,priceCurrencyCode:a}}));t._resolvePromiseDecorator(v.GET_CATALOG,o)})).catch((function(e){t._rejectPromiseDecorator(v.GET_CATALOG,e)}))),r.promise}},{key:\"paymentsGetPurchases\",value:function(){var t=this,e=this._getPromiseDecorator(v.GET_PURCHASES);return e||(e=this._createPromiseDecorator(v.GET_PURCHASES),this._platformSdk.commands.getEntitlements().then((function(e){var r=t._paymentsGetProductsPlatformData();t._paymentsPurchases=e.entitlements.map((function(t){return Yf({id:r.find((function(e){return e.id===t.id})).id},t)})),t._resolvePromiseDecorator(v.GET_PURCHASES,t._paymentsPurchases)})).catch((function(e){t._rejectPromiseDecorator(v.GET_PURCHASES,e)}))),e.promise}},{key:\"inviteFriends\",value:function(){var t=this,e=this._getPromiseDecorator(v.INVITE_FRIENDS);return e||(e=this._createPromiseDecorator(v.INVITE_FRIENDS),this._platformSdk.commands.openInviteDialog().then((function(){t._resolvePromiseDecorator(v.INVITE_FRIENDS)})).catch((function(e){t._rejectPromiseDecorator(v.INVITE_FRIENDS,e)}))),e.promise}},{key:\"share\",value:function(t){var e=this;if(!t.mediaUrl)return Promise.reject();var r=this._getPromiseDecorator(v.SHARE);return r||(r=this._createPromiseDecorator(v.SHARE),this._platformSdk.commands.openShareMomentDialog({mediaUrl:t.mediaUrl}).then((function(){e._resolvePromiseDecorator(v.SHARE)})).catch((function(t){e._rejectPromiseDecorator(v.SHARE,t)}))),r.promise}}])&&Jf(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),s}(lo);function rp(t){return rp=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},rp(t)}function np(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function op(t){for(var e=1;e2?e.slice(0,2):e,function(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError(\"attempted to set read only private field\");e.value=r}}(r,pp(r,n,\"set\"),o)}));t._platformStorageCachedData={};var r=t._platformSdk.game.loadData().then((function(e){\"string\"==typeof e&&\"\"!==e&&(t._platformStorageCachedData=JSON.parse(e))}));t._platformSdk.system.onAudioEnabledChange((function(e){t._setAudioState(e)})),t._platformSdk.system.onPause((function(){t._setPauseState(!0)})),t._platformSdk.system.onResume((function(){t._setPauseState(!1)})),Promise.all([e,r]).finally((function(){t._isInitialized=!0,t._resolvePromiseDecorator(v.INITIALIZE),t._platformSdk.game.firstFrameReady()}))}))),e.promise}},{key:\"isStorageSupported\",value:function(t){return t===u.PLATFORM_INTERNAL||sp(lp(l.prototype),\"isStorageSupported\",this).call(this,t)}},{key:\"isStorageAvailable\",value:function(t){return t===u.PLATFORM_INTERNAL||sp(lp(l.prototype),\"isStorageAvailable\",this).call(this,t)}},{key:\"getDataFromStorage\",value:function(t,e,r){var n=this;return e===u.PLATFORM_INTERNAL?new Promise((function(e,o){n._platformSdk.game.loadData().then((function(o){if(\"string\"==typeof o&&\"\"!==o&&(n._platformStorageCachedData=JSON.parse(o)),Array.isArray(t)){for(var i=[],a=0;a=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(e,mp);t.playerId=r||null,t.playerName=n||null,o&&t.playerPhotos.push(o),t.playerExtra=i,t._isPlayerAuthorized=!0}t._isInitialized=!0,t._resolvePromiseDecorator(v.INITIALIZE)},window.onBannerReady=function(){t._isBannerAvailable=!0},Bt(\"https://jiogames.akamaized.net/gameSDK/jiogames/stable/v2.0/jiogames_sdk.js\",this._options.adTestMode?{\"data-jg-test-environment\":\"on\"}:{}).catch((function(e){t._rejectPromiseDecorator(v.INITIALIZE,JSON.stringify(e))}))),e.promise}},{key:\"preloadInterstitial\",value:function(){wp(this,Ap,Tp).call(this)}},{key:\"showInterstitial\",value:function(){var t=this;wp(this,Ap,Tp).call(this).then((function(){var e;t._platformSdk.showAd(null===(e=window.AdType)||void 0===e?void 0:e.Interstitial,{onAdClosed:function(){t._setInterstitialState(i.CLOSED)},onAdFailedToLoad:function(e){console.error(e),t._setInterstitialState(i.FAILED)}}),t._setInterstitialState(i.OPENED),t._preloadInterstitialPromise=null}))}},{key:\"preloadRewarded\",value:function(){wp(this,Op,kp).call(this)}},{key:\"showRewarded\",value:function(){var t=this;wp(this,Op,kp).call(this).then((function(){var e;t._platformSdk.showAd(null===(e=window.AdType)||void 0===e?void 0:e.Rewarded,{onAdClosed:function(e){e&&t._setRewardedState(a.REWARDED),t._setRewardedState(a.CLOSED)},onAdFailedToLoad:function(e){console.error(e),t._setRewardedState(a.FAILED)}}),t._setRewardedState(a.OPENED),t._preloadRewardedPromise=null}))}},{key:\"showBanner\",value:function(t){var e,r=this;this._isBannerAvailable?null===(e=window.JGBanner)||void 0===e||e.loadBanner().then((function(){var e,n;r._setBannerState(s.SHOWN),null===(e=window.JGBanner)||void 0===e||e.showBanner(t||(null===(n=window.BannerPosition)||void 0===n?void 0:n.TOP))})).catch((function(t){console.error(t),r._setBannerState(s.FAILED)})):this._setBannerState(s.FAILED)}},{key:\"hideBanner\",value:function(){var t;null===(t=window.JGBanner)||void 0===t||t.hideBanner(),this._setBannerState(s.HIDDEN)}},{key:\"leaderboardsSetScore\",value:function(t,e,r){if(!r)return Promise.reject();var n=\"string\"==typeof e?parseInt(e,10):e;return this._platformSdk.postScore(n),Promise.resolve()}}])&&vp(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),l}(lo);function Ip(t){return Ip=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},Ip(t)}function Rp(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Lp(t){for(var e=1;e=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var c=n.call(a,\"catchLoc\"),u=n.call(a,\"finallyLoc\");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),m}},e}function Fp(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Up(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Fp(i,n,o,a,s,\"next\",t)}function s(t){Fp(i,n,o,a,s,\"throw\",t)}a(void 0)}))}}function Vp(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{}},\"*\")}function ch(t){this._isPlayerAuthorized=t.isPlayerAuthorized,this._isPlayerAuthorized&&(this._playerId=t.playerId,this._playerName=t.playerName,t.playerPhoto&&this._playerPhotos.push(t.playerPhoto)),this._isInitialized=!0,this._resolvePromiseDecorator(v.INITIALIZE)}function uh(t){var e,r;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(v.GET_STORAGE_DATA,null!==(r=t.data.data)&&void 0!==r?r:null):this._rejectPromiseDecorator(v.GET_STORAGE_DATA)}function lh(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(v.SET_STORAGE_DATA):this._rejectPromiseDecorator(v.SET_STORAGE_DATA)}function fh(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(v.DELETE_STORAGE_DATA):this._rejectPromiseDecorator(v.DELETE_STORAGE_DATA)}function ph(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(v.PURCHASE,t.data):this._rejectPromiseDecorator(v.PURCHASE,t.data)}function hh(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(v.GET_CATALOG,t.data):this._rejectPromiseDecorator(v.GET_CATALOG,t.data)}function dh(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(v.GET_PURCHASES,t.data):this._rejectPromiseDecorator(v.GET_PURCHASES,t.data)}function yh(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(v.CREATE_POST):this._rejectPromiseDecorator(v.CREATE_POST)}function mh(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(v.JOIN_COMMUNITY):this._rejectPromiseDecorator(v.JOIN_COMMUNITY)}const vh=function(e){!function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,\"prototype\",{writable:!1}),e&&Zp(t,e)}(l,e);var r,n,o,i,a,s,c=(a=l,s=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Jp(a);if(s){var r=Jp(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&(\"object\"===xp(e)||\"function\"==typeof e))return e;if(void 0!==e)throw new TypeError(\"Derived constructors may only return object or undefined\");return Yp(t)}(this,t)});function l(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,l);for(var e=arguments.length,r=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=this._getPromiseDecorator(v.CREATE_POST);return e||(e=this._createPromiseDecorator(v.CREATE_POST),qp(this,Xp,sh).call(this,v.CREATE_POST,{options:t})),e.promise}},{key:\"joinCommunity\",value:function(){var t=this._getPromiseDecorator(v.JOIN_COMMUNITY);return t||(t=this._createPromiseDecorator(v.JOIN_COMMUNITY),qp(this,Xp,sh).call(this,v.JOIN_COMMUNITY)),t.promise}}],n&&Vp(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),l}(lo);function _h(t){return _h=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},_h(t)}function gh(t,e){for(var r=0;r {", " const id = eventsFunctionContext.getArgument(\"Id\");", - " bridge.payments.purchase(id)", + " const options = gdjs._playgamaBridgeExtension.actionParametersContainer;", + " bridge.payments.purchase(id, options)", " .then(data => {", " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", - " gdjs._playgamaBridgeExtension.paymentsPurchase = data;", + " gdjs._playgamaBridgeExtension.paymentsPurchase = { ", + " ...data, ", + " options: options || {}", + " };", " })", " .catch(error => console.log(error))", " .finally(() => {", + " gdjs._playgamaBridgeExtension.actionParametersContainer = {};", " gdjs._playgamaBridgeExtension.nextIsPaymentsPurchaseCompleted = true;", " resolve();", " });", @@ -4788,9 +4804,21 @@ "if (!paymentsPurchase) {", " eventsFunctionContext.returnValue = \"\";", "} else {", - " eventsFunctionContext.returnValue = isNaN(+property)", - " ? paymentsPurchase[property]", - " : paymentsPurchase[Object.keys(paymentsPurchase)[property]];", + " if (property.includes('.')) {", + " const parts = property.split('.');", + " let value = paymentsPurchase;", + " for (const part of parts) {", + " value = value?.[part];", + " }", + " eventsFunctionContext.returnValue = value ?? '';", + " } else {", + " const value = isNaN(+property)", + " ? paymentsPurchase[property]", + " : paymentsPurchase[Object.keys(paymentsPurchase)[property]];", + " eventsFunctionContext.returnValue = typeof value === 'object' && value !== null", + " ? JSON.stringify(value)", + " : (value ?? '');", + " }", "}", "", ""