diff --git a/extensions/reviewed/PlaygamaBridge.json b/extensions/reviewed/PlaygamaBridge.json index 57acf9173..380920835 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.27.0", + "version": "1.27.1", "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,63 +43,7 @@ "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ "window.bridgeOptions = {", - " \"device\": {", - " \"useBuiltInOrientationPopup\": true,", - " \"supportedOrientations\": [\"landscape\", \"portrait\"]", - " },", - " \"platforms\": {", - " \"game_distribution\": {", - " \"gameId\": \"\"", - " },", - " \"telegram\": {", - " \"adsgramBlockId\": \"\"", - " },", - " \"y8\": {", - " \"gameId\": \"\",", - " \"adsenseId\": \"\",", - " \"channelId\": \"\"", - " },", - " \"lagged\": {", - " \"devId\": \"\",", - " \"publisherId\": \"\"", - " },", - " \"huawei\": {", - " \"appId\": \"\"", - " },", - " \"msn\": {", - " \"gameId\": \"\"", - " },", - " \"discord\": {", - " \"appId\": \"\"", - " },", - " \"gamepush\": {", - " \"projectId\": \"\",", - " \"publicToken\": \"\"", - " },", - " \"crazy_games\": {", - " \"xsollaProjectId\": \"\",", - " \"isSandbox\": false,", - " \"useUserToken\": false", - " },", - " \"facebook\": {", - " \"subscribeForNotificationsOnStart\": true,", - " \"sendAnalyticsEvents\": false", - " },", - " \"yandex\": {", - " \"useSignedData\": false,", - " \"sendAnalyticsEvents\": false", - " },", - " \"youtube\": {", - " \"sendAnalyticsEvents\": false", - " },", - " \"xiaomi\": {", - " \"adSenseId\": \"\",", - " \"hostId\": \"\"", - " }", - " },", " \"advertisement\": {", - " \"banner\": {", - " },", " \"interstitial\": {", " \"preloadOnStart\": true", " },", @@ -572,11 +516,9 @@ " if (gdjs._playgamaBridgeExtension.nextIsRemoteConfigGotCompleted) {", " gdjs._playgamaBridgeExtension.nextIsRemoteConfigGotCompleted = false;", " }", - "", - " requestAnimationFrame(updateState);", " }", "", - " requestAnimationFrame(updateState);", + " gdjs.registerRuntimeScenePostEventsCallback(updateState)", " });", "}", "", @@ -608,7 +550,8 @@ "document.head.appendChild(bridgeScript)", "", "function evalLocalScript() {", - " (()=>{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{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=\"native_popup\",_={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\"},g={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 S(t){return S=\"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},S(t)}function b(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:B,platform_id:this._platformBridge.platformId,game_id:K(this,rt),timestamp:(new Date).toISOString(),data:o};K(this,$).push(a),K(this,tt)&&clearTimeout(K(this,tt)),X(this,tt,setTimeout((function(){q(n,ot,ut).call(n)}),3e3))}}}}],n&&F(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),s}(M));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 mt(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(Mt({preloadAdBreaks:\"on\",sound:\"on\",onReady:function(){}},l)),t((function(t){return window.adsbygoogle.push(t)}))})),document.head.appendChild(a)}))};function Ft(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 Ut=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]=Wt(e,n),r)try{t[o]=JSON.parse(t[o])}catch(t){}return t}),new Array(t.length));var n=Wt(e,t);if(r&&\"string\"==typeof n)try{n=JSON.parse(n)}catch(t){}return n}function Zt(t,e){for(var r=Mt({},t),n=Object.keys(e),o=0;o1&&void 0!==arguments[1]?arguments[1]:\"*\";window.parent&&window.parent[Bt](t,e)}function Jt(t){return Jt=\"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},Jt(t)}function Kt(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&&Kt(r.prototype,o),Object.defineProperty(r,\"prototype\",{writable:!1}),c}(M);L().mixin(ee.prototype);const re=ee;function ne(t){return ne=\"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},ne(t)}function oe(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&&oe(e.prototype,r),Object.defineProperty(e,\"prototype\",{writable:!1}),a}(M);function ue(t){return ue=\"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},ue(t)}function le(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){xe(this,We,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),xe(this,ze,o),He(this,or,yr).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=He(this,sr,_r).call(this,o,i);this._platformBridge.showBanner(e,a)}else He(this,or,yr).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=He(this,sr,_r).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(!He(this,nr,dr).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),xe(this,Ye,n),He(this,ir,mr).call(this,i.LOADING),this.isInterstitialSupported)if(this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&Fe(this,Je)&&Fe(this,Je).state===ge)He(this,ir,mr).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=He(this,sr,_r).call(this,n,o);this._platformBridge.showInterstitial(a)}else He(this,ir,mr).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=He(this,sr,_r).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(!He(this,nr,dr).call(this)){var r;xe(this,Xe,e),Fe(this,Xe)||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.rewarded)&&void 0!==r&&r.placementFallback&&xe(this,Xe,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=He(this,sr,_r).call(this,Fe(this,Xe),n);He(this,ar,vr).call(this,a.LOADING),this.isRewardedSupported?this._platformBridge.showRewarded(o):He(this,ar,vr).call(this,a.FAILED)}}},{key:\"checkAdBlock\",value:function(){return this._platformBridge.checkAdBlock()}}],r&&Re(e.prototype,r),Object.defineProperty(e,\"prototype\",{writable:!1}),l}(M);function ur(t){xe(this,Ke,t),Fe(this,Je)&&(Fe(this,Je).stop(),He(this,rr,hr).call(this))}function lr(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 fr(){var t=He(this,er,pr).call(this);if(void 0!==t){var e=He(this,$e,lr).call(this,t);null!==e&&He(this,Qe,ur).call(this,e)}}function pr(){var t;return null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t?void 0:t.minimumDelayBetweenInterstitial}function hr(){Fe(this,Ke)>0&&this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&(xe(this,Je,new De(Fe(this,Ke))),Fe(this,Je).start())}function dr(){var t=[i.LOADING,i.OPENED].includes(Fe(this,Ze)),e=[a.LOADING,a.OPENED,a.REWARDED].includes(Fe(this,qe));return t||e}function yr(t){Fe(this,Ve)!==t&&(xe(this,Ve,t),dt.send(\"\".concat(e.ADVERTISEMENT,\"_banner_\").concat(t),e.ADVERTISEMENT,{position:Fe(this,We),placement:Fe(this,ze)}),this.emit(n.BANNER_STATE_CHANGED,Fe(this,Ve)))}function mr(t){Fe(this,Ze)!==t&&(xe(this,Ze,t),dt.send(\"\".concat(e.ADVERTISEMENT,\"_interstitial_\").concat(t),e.ADVERTISEMENT,{placement:Fe(this,Ye)}),this.emit(n.INTERSTITIAL_STATE_CHANGED,Fe(this,Ze)))}function vr(t){Fe(this,qe)!==t&&(xe(this,qe,t),dt.send(\"\".concat(e.ADVERTISEMENT,\"_rewarded_\").concat(t),e.ADVERTISEMENT,{placement:Fe(this,Xe)}),this.emit(n.REWARDED_STATE_CHANGED,Fe(this,qe)))}function _r(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}L().mixin(cr.prototype);const gr=cr;function Sr(t){return Sr=\"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},Sr(t)}function br(t,e){for(var r=0;rwindow.innerWidth?f.PORTRAIT:f.LANDSCAPE}function Qr(){var t=Gr(this,Wr,Xr).call(this);t!==Mr(this,xr)&&(Cr(this,xr,t),this.emit(n.ORIENTATION_STATE_CHANGED,Mr(this,xr)),Gr(this,Zr,$r).call(this))}function $r(){if(Mr(this,Ur))if(1===Mr(this,Fr).length){var t=Mr(this,Fr)[0];Mr(this,xr)!==t?Gr(this,Yr,tn).call(this):Gr(this,Jr,en).call(this)}else Gr(this,Jr,en).call(this)}function tn(){Mr(this,Hr)||(Cr(this,Hr,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(Mr(this,Hr)))}function en(){Mr(this,Hr)&&(Mr(this,Hr).remove(),Cr(this,Hr,null))}L().mixin(Kr.prototype);const rn=Kr;function nn(t){return nn=\"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},nn(t)}function on(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 To=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&&mo(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=_o(o);if(c){var r=_o(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&(\"object\"===po(e)||\"function\"==typeof e))return e;if(void 0!==e)throw new TypeError(\"Derived constructors may only return object or undefined\");return vo(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(_.LEADERBOARDS_GET_ENTRIES,r)})).catch((function(t){e._rejectPromiseDecorator(_.LEADERBOARDS_GET_ENTRIES,t)}))}return r.promise}},{key:\"paymentsPurchase\",value:function(t){var e=this;if(!Fo(this,zo))return Promise.reject();var r=this._paymentsGetProductPlatformData(t);r||(r={id:t});var n=this._getPromiseDecorator(_.PURCHASE);return n||(n=this._createPromiseDecorator(_.PURCHASE),Fo(this,zo).purchase(r).then((function(r){var n=Io({id:t},r.purchaseData);delete n.productID,e._paymentsPurchases.push(n),e._resolvePromiseDecorator(_.PURCHASE,n)})).catch((function(t){e._rejectPromiseDecorator(_.PURCHASE,t)}))),n.promise}},{key:\"paymentsConsumePurchase\",value:function(t){var e=this;if(!Fo(this,zo))return Promise.reject();var r=this._paymentsPurchases.findIndex((function(e){return e.id===t}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(_.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(_.CONSUME_PURCHASE),Fo(this,zo).consumePurchase(this._paymentsPurchases[r].purchaseToken).then((function(){e._paymentsPurchases.splice(r,1),e._resolvePromiseDecorator(_.CONSUME_PURCHASE,{id:t})})).catch((function(t){e._rejectPromiseDecorator(_.CONSUME_PURCHASE,t)}))),n.promise}},{key:\"paymentsGetCatalog\",value:function(){var t=this;if(!Fo(this,zo))return Promise.reject();var e=this._paymentsGetProductsPlatformData(),r=this._getPromiseDecorator(_.GET_CATALOG);return r||(r=this._createPromiseDecorator(_.GET_CATALOG),Fo(this,zo).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(_.GET_CATALOG,n)})).catch((function(e){t._rejectPromiseDecorator(_.GET_CATALOG,e)}))),r.promise}},{key:\"paymentsGetPurchases\",value:function(){var t=this;if(!Fo(this,zo))return Promise.reject();var e=this._getPromiseDecorator(_.GET_PURCHASES);return e||(e=this._createPromiseDecorator(_.GET_PURCHASES),Fo(this,zo).getPurchases().then((function(e){var r=t._paymentsGetProductsPlatformData();t._paymentsPurchases=e.map((function(t){var e=Io({id:r.find((function(e){return e.id===t.productID})).id},t.purchaseData);return delete e.productID,e})),t._resolvePromiseDecorator(_.GET_PURCHASES,t._paymentsPurchases)})).catch((function(e){t._rejectPromiseDecorator(_.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(_.GET_REMOTE_CONFIG);return n||(n=this._createPromiseDecorator(_.GET_REMOTE_CONFIG),this._platformSdk.getFlags(r).then((function(t){e._resolvePromiseDecorator(_.GET_REMOTE_CONFIG,t)})).catch((function(t){e._rejectPromiseDecorator(_.GET_REMOTE_CONFIG,t)}))),n.promise}},{key:\"clipboardWrite\",value:function(t){var e=this,r=this._getPromiseDecorator(_.CLIPBOARD_WRITE);return r||(r=this._createPromiseDecorator(_.CLIPBOARD_WRITE),this._platformSdk.clipboard.writeText(t).then((function(){e._resolvePromiseDecorator(_.CLIPBOARD_WRITE,!0)})).catch((function(t){e._rejectPromiseDecorator(_.CLIPBOARD_WRITE,t)}))),r.promise}}])&&Ro(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),p}(fo);function qo(t){return qo=\"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},qo(t)}function Xo(){Xo=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\"==qo(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 Qo(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 $o(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Qo(i,n,o,a,s,\"next\",t)}function s(t){Qo(i,n,o,a,s,\"throw\",t)}a(void 0)}))}}function ti(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 ei(t){for(var e=1;e120?this._rejectPromiseDecorator(_.INVITE_FRIENDS,g.INVITE_FRIENDS_MESSAGE_LENGTH_ERROR):this._platformSdk.UI.showInvite(e)),r.promise}},{key:\"rate\",value:function(){var t=this._getPromiseDecorator(_.RATE);return t||(t=this._createPromiseDecorator(_.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(_.CREATE_POST);return r||(r=this._createPromiseDecorator(_.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(_.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(_.JOIN_COMMUNITY),this._platformSdk.UI.joinGroup(t.groupId,null!==(e=t.enableMessages)&&void 0!==e&&e)),r.promise}}])&&ra(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),l}(fo);function ns(t){return ns=\"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},ns(t)}function os(){os=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\"==ns(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 is(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 as(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 ss(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\",zt(e,this._platformStorageCachedData,r));case 6:case\"end\":return t.stop()}}),t,this)})),Ss=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){is(i,n,o,a,s,\"next\",t)}function s(t){is(i,n,o,a,s,\"throw\",t)}a(void 0)}))},Ss.apply(this,arguments)}const bs=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&&fs(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=hs(o);if(s){var r=hs(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&(\"object\"===ns(e)||\"function\"==typeof e))return e;if(void 0!==e)throw new TypeError(\"Derived constructors may only return object or undefined\");return ps(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,ec)),{},{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()}}])&&ic(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),l}(fo);function Sc(t){return Sc=\"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},Sc(t)}function bc(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(_.INITIALIZE)}))}))})):this._rejectPromiseDecorator(_.INITIALIZE,g.GAME_PARAMS_NOT_FOUND)),e.promise}},{key:\"isStorageSupported\",value:function(t){return t!==u.PLATFORM_INTERNAL&&Pc(Ac(l.prototype),\"isStorageSupported\",this).call(this,t)}},{key:\"isStorageAvailable\",value:function(t){return t!==u.PLATFORM_INTERNAL&&Pc(Ac(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(_.LEADERBOARDS_SET_SCORE);if(!n){n=this._createPromiseDecorator(_.LEADERBOARDS_SET_SCORE);var o={score:e,board:t};this._platformSdk.Scores.save(o,(function(t){t.success?r._resolvePromiseDecorator(_.LEADERBOARDS_SET_SCORE):r._rejectPromiseDecorator(_.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()}}])&&bc(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),l}(fo);function Tc(){Tc=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\"==Rc(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 kc(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 Dc(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 Ic(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 Qc(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 $c(){return tu.apply(this,arguments)}function tu(){var t;return t=Tc().mark((function t(){return Tc().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]])})),tu=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){kc(i,n,o,a,s,\"next\",t)}function s(t){kc(i,n,o,a,s,\"throw\",t)}a(void 0)}))},tu.apply(this,arguments)}const eu=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&&Cc(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=Mc(o);if(c){var r=Mc(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&(\"object\"===Rc(e)||\"function\"==typeof e))return e;if(void 0!==e)throw new TypeError(\"Derived constructors may only return object or undefined\");return Gc(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(_.LEADERBOARDS_SHOW_NATIVE_POPUP)}),(function(t,r){n.remove(),e._rejectPromiseDecorator(_.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(_.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(_.PURCHASE);return n||(n=this._createPromiseDecorator(_.PURCHASE),this._platformSdk.payments.purchaseAsync({productID:r.platformProductId}).then((function(r){var n=Ic({id:t},r);delete n.productID,e._paymentsPurchases.push(n),e._resolvePromiseDecorator(_.PURCHASE,n)})).catch((function(t){e._rejectPromiseDecorator(_.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(_.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(_.CONSUME_PURCHASE),this._platformSdk.payments.consumePurchaseAsync(this._paymentsPurchases[r].purchaseToken).then((function(){e._paymentsPurchases.splice(r,1),e._resolvePromiseDecorator(_.CONSUME_PURCHASE,{id:t})})).catch((function(t){e._rejectPromiseDecorator(_.CONSUME_PURCHASE,t)}))),n.promise}},{key:\"paymentsGetCatalog\",value:function(){var t=this,e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();var r=this._getPromiseDecorator(_.GET_CATALOG);return r||(r=this._createPromiseDecorator(_.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(_.GET_CATALOG,n)})).catch((function(e){t._rejectPromiseDecorator(_.GET_CATALOG,e)}))),r.promise}},{key:\"paymentsGetPurchases\",value:function(){var t=this,e=this._getPromiseDecorator(_.GET_PURCHASES);return e||(e=this._createPromiseDecorator(_.GET_PURCHASES),this._platformSdk.payments.getPurchasesAsync().then((function(e){var r=t._paymentsGetProductsPlatformData();t._paymentsPurchases=e.map((function(t){var e=Ic({id:r.find((function(e){return e.id===t.productID})).id},t);return delete e.productID,e})),t._resolvePromiseDecorator(_.GET_PURCHASES,t._paymentsPurchases)})).catch((function(e){t._rejectPromiseDecorator(_.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(!Vt(e.image))return Promise.reject(new Error(\"Image is not base64\"));var r=this._getPromiseDecorator(_.INVITE_FRIENDS);return r||(r=this._createPromiseDecorator(_.INVITE_FRIENDS),this._platformSdk.inviteAsync(e).then((function(){t._resolvePromiseDecorator(_.INVITE_FRIENDS)})).catch((function(e){t._rejectPromiseDecorator(_.INVITE_FRIENDS,e)}))),r.promise}},{key:\"joinCommunity\",value:function(t){var e=this,r=this._getPromiseDecorator(_.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(_.JOIN_COMMUNITY),t&&!0===t.isPage?this._platformSdk.community.followOfficialPageAsync().then((function(t){return e._resolvePromiseDecorator(_.JOIN_COMMUNITY,t)})).catch((function(t){return e._rejectPromiseDecorator(_.JOIN_COMMUNITY,t)})):this._platformSdk.community.joinOfficialGroupAsync().then((function(t){return e._resolvePromiseDecorator(_.JOIN_COMMUNITY,t)})).catch((function(t){return e._rejectPromiseDecorator(_.JOIN_COMMUNITY,t)}))),r.promise}},{key:\"share\",value:function(t){var e=this;if(!t.image||!t.text)return Promise.reject();if(!Vt(t.image))return Promise.reject(new Error(\"Image is not base64\"));var r=this._getPromiseDecorator(_.SHARE);return r||(r=this._createPromiseDecorator(_.SHARE),this._platformSdk.shareAsync(Ic({intent:\"REQUEST\"},t)).then((function(){e._resolvePromiseDecorator(_.SHARE)})).catch((function(t){e._rejectPromiseDecorator(_.SHARE,t)}))),r.promise}}],n&&jc(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),p}(fo);function ru(t){return ru=\"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},ru(t)}function nu(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&&nu(e.prototype,r),Object.defineProperty(e,\"prototype\",{writable:!1}),t}();function su(){su=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\"==pu(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 cu(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 Pu(this,ju,Hu).call(this,{type:e.PLATFORM,action:Ou.GET_PERFORMANCE_RESOURCES,id:t,options:{resources:a}}),Promise.resolve(o)}function Hu(t){Eu(this,Iu).send(fu({source:Au},t))}function Fu(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=Eu(this,Iu).generateMessageId(),a=fu({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)!==Au&&(Eu(r,Iu).removeListener(n),s(a))};Eu(r,Iu).addListener(u),Pu(r,ju,Hu).call(r,fu({type:t,action:e,id:i,options:o},n)),a.timeout>0&&setTimeout((function(){c(new Error(\"Request timeout\")),Eu(r,Iu).removeListener(u)}),a.timeout)}))}function Uu(){return Vu.apply(this,arguments)}function Vu(){var t;return t=su().mark((function t(){var r=this;return su().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt(\"return\",Pu(this,Nu,Fu).call(this,e.PLAYER,Ou.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 cu(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 cu(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)?cu(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)})),Vu=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){uu(i,n,o,a,s,\"next\",t)}function s(t){uu(i,n,o,a,s,\"throw\",t)}a(void 0)}))},Vu.apply(this,arguments)}function Wu(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)}}}iu=Mu;const zu=Mu;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 Yu(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 el(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 rl(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){el(i,n,o,a,s,\"next\",t)}function s(t){el(i,n,o,a,s,\"throw\",t)}a(void 0)}))}}function nl(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 ol(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\",zt(e,this._platformStorageCachedData,r));case 6:case\"end\":return t.stop()}}),t,this)}))),kl.apply(this,arguments)}const Dl=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&&cl(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=ll(f);if(p){var r=ll(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&(\"object\"===$u(e)||\"function\"==typeof e))return e;if(void 0!==e)throw new TypeError(\"Derived constructors may only return object or undefined\");return ul(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(_.CONSUME_PURCHASE,t)}else this._rejectPromiseDecorator(_.CONSUME_PURCHASE,new Error(t))}function ff(t){if(t.success){var e=this._paymentsGetProductsPlatformData();this._paymentsPurchases=t.data.map((function(t){var r=JSON.parse(t),n=Ll({id:e.find((function(t){return t.id===r.productId})).id},r);return delete n.productId,n})),this._resolvePromiseDecorator(_.GET_PURCHASES,this._paymentsPurchases)}else this._rejectPromiseDecorator(_.GET_PURCHASES,new Error(t))}function pf(t){t.success?this._resolvePromiseDecorator(_.GET_STORAGE_DATA,t.data):this._rejectPromiseDecorator(_.GET_STORAGE_DATA,new Error(t))}function hf(t){t.success?this._resolvePromiseDecorator(_.SET_STORAGE_DATA,t.data):this._rejectPromiseDecorator(_.SET_STORAGE_DATA,new Error(t))}function df(t){t.success?this._resolvePromiseDecorator(_.DELETE_STORAGE_DATA,t.data):this._rejectPromiseDecorator(_.DELETE_STORAGE_DATA,new Error(t))}const yf=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&&Cl(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=Ml(o);if(i){var r=Ml(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&(\"object\"===Il(e)||\"function\"==typeof e))return e;if(void 0!==e)throw new TypeError(\"Derived constructors may only return object or undefined\");return Gl(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 Sf(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 bf(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Sf(i,n,o,a,s,\"next\",t)}function s(t){Sf(i,n,o,a,s,\"throw\",t)}a(void 0)}))}}function Ef(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(_.GET_CATALOG,o)})).catch((function(e){t._rejectPromiseDecorator(_.GET_CATALOG,e)}))),r.promise}},{key:\"paymentsGetPurchases\",value:function(){var t=this,e=this._getPromiseDecorator(_.GET_PURCHASES);return e||(e=this._createPromiseDecorator(_.GET_PURCHASES),this._platformSdk.commands.getEntitlements().then((function(e){var r=t._paymentsGetProductsPlatformData();t._paymentsPurchases=e.entitlements.map((function(t){return Jf({id:r.find((function(e){return e.id===t.id})).id},t)})),t._resolvePromiseDecorator(_.GET_PURCHASES,t._paymentsPurchases)})).catch((function(e){t._rejectPromiseDecorator(_.GET_PURCHASES,e)}))),e.promise}},{key:\"inviteFriends\",value:function(){var t=this,e=this._getPromiseDecorator(_.INVITE_FRIENDS);return e||(e=this._createPromiseDecorator(_.INVITE_FRIENDS),this._platformSdk.commands.openInviteDialog().then((function(){t._resolvePromiseDecorator(_.INVITE_FRIENDS)})).catch((function(e){t._rejectPromiseDecorator(_.INVITE_FRIENDS,e)}))),e.promise}},{key:\"share\",value:function(t){var e=this;if(!t.mediaUrl)return Promise.reject();var r=this._getPromiseDecorator(_.SHARE);return r||(r=this._createPromiseDecorator(_.SHARE),this._platformSdk.commands.openShareMomentDialog({mediaUrl:t.mediaUrl}).then((function(){e._resolvePromiseDecorator(_.SHARE)})).catch((function(t){e._rejectPromiseDecorator(_.SHARE,t)}))),r.promise}}])&&Kf(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),s}(fo);function np(t){return np=\"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},np(t)}function op(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 ip(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,hp(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(_.INITIALIZE),t._platformSdk.game.firstFrameReady()}))}))),e.promise}},{key:\"isStorageSupported\",value:function(t){return t===u.PLATFORM_INTERNAL||cp(fp(l.prototype),\"isStorageSupported\",this).call(this,t)}},{key:\"isStorageAvailable\",value:function(t){return t===u.PLATFORM_INTERNAL||cp(fp(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,vp);t.playerId=r||null,t.playerName=n||null,o&&t.playerPhotos.push(o),t.playerExtra=i,t._isPlayerAuthorized=!0}t._isInitialized=!0,t._resolvePromiseDecorator(_.INITIALIZE)},window.onBannerReady=function(){t._isBannerAvailable=!0},xt(\"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(_.INITIALIZE,JSON.stringify(e))}))),e.promise}},{key:\"preloadInterstitial\",value:function(){Ap(this,Op,kp).call(this)}},{key:\"showInterstitial\",value:function(){var t=this;Ap(this,Op,kp).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(){Ap(this,Tp,Dp).call(this)}},{key:\"showRewarded\",value:function(){var t=this;Ap(this,Tp,Dp).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()}}])&&_p(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),l}(fo);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 Lp(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 jp(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 Up(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 Vp(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Up(i,n,o,a,s,\"next\",t)}function s(t){Up(i,n,o,a,s,\"throw\",t)}a(void 0)}))}}function Wp(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{}},\"*\")}function uh(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(_.INITIALIZE)}function lh(t){var e,r;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(_.GET_STORAGE_DATA,null!==(r=t.data.data)&&void 0!==r?r:null):this._rejectPromiseDecorator(_.GET_STORAGE_DATA)}function fh(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(_.SET_STORAGE_DATA):this._rejectPromiseDecorator(_.SET_STORAGE_DATA)}function ph(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(_.DELETE_STORAGE_DATA):this._rejectPromiseDecorator(_.DELETE_STORAGE_DATA)}function hh(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(_.PURCHASE,t.data):this._rejectPromiseDecorator(_.PURCHASE,t.data)}function dh(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(_.GET_CATALOG,t.data):this._rejectPromiseDecorator(_.GET_CATALOG,t.data)}function yh(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(_.GET_PURCHASES,t.data):this._rejectPromiseDecorator(_.GET_PURCHASES,t.data)}function mh(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(_.CREATE_POST):this._rejectPromiseDecorator(_.CREATE_POST)}function vh(t){var e;null!==(e=t.data)&&void 0!==e&&e.success?this._resolvePromiseDecorator(_.JOIN_COMMUNITY):this._rejectPromiseDecorator(_.JOIN_COMMUNITY)}const _h=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&&Yp(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=Kp(a);if(s){var r=Kp(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&(\"object\"===Hp(e)||\"function\"==typeof e))return e;if(void 0!==e)throw new TypeError(\"Derived constructors may only return object or undefined\");return Jp(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(_.CREATE_POST);return e||(e=this._createPromiseDecorator(_.CREATE_POST),Xp(this,Qp,ch).call(this,_.CREATE_POST,{options:t})),e.promise}},{key:\"joinCommunity\",value:function(){var t=this._getPromiseDecorator(_.JOIN_COMMUNITY);return t||(t=this._createPromiseDecorator(_.JOIN_COMMUNITY),Xp(this,Qp,ch).call(this,_.JOIN_COMMUNITY)),t.promise}}],n&&Wp(r.prototype,n),Object.defineProperty(r,\"prototype\",{writable:!1}),l}(fo);function gh(t){return gh=\"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},gh(t)}function Sh(t,e){for(var r=0;r