diff --git a/extensions/reviewed/PlaygamaBridge.json b/extensions/reviewed/PlaygamaBridge.json index aab477b07..e1643d07c 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": "2.1.0", + "version": "2.2.0", "description": [ "One SDK for cross-platform publishing HTML5 games. ", "Please refer to [Playgama documentation](https://wiki.playgama.com/playgama/sdk/engines/gdevelop) for detailed guidance." @@ -128,6 +128,9 @@ " nextIsAddToHomeScreenCompleted: false,", " nextIsAddToFavoritesCompleted: false,", " nextIsRateCompleted: false,", + " isGetPostRewardCompleted: false,", + " nextIsGetPostRewardCompleted: false,", + " postRewards: [],", "", " // leaderboards", " isLeaderboardsSetScoreCompleted: false,", @@ -444,6 +447,14 @@ " gdjs._playgamaBridgeExtension.nextIsRateCompleted = false;", " }", "", + " if (gdjs._playgamaBridgeExtension.isGetPostRewardCompleted !== gdjs._playgamaBridgeExtension.nextIsGetPostRewardCompleted) {", + " gdjs._playgamaBridgeExtension.isGetPostRewardCompleted = gdjs._playgamaBridgeExtension.nextIsGetPostRewardCompleted", + " }", + "", + " if (gdjs._playgamaBridgeExtension.nextIsGetPostRewardCompleted) {", + " gdjs._playgamaBridgeExtension.nextIsGetPostRewardCompleted = false;", + " }", + "", " // leaderboards", " if (gdjs._playgamaBridgeExtension.isLeaderboardsSetScoreCompleted !== gdjs._playgamaBridgeExtension.nextIsLeaderboardsSetScoreCompleted) {", " gdjs._playgamaBridgeExtension.isLeaderboardsSetScoreCompleted = gdjs._playgamaBridgeExtension.nextIsLeaderboardsSetScoreCompleted", @@ -646,7 +657,7 @@ "document.head.appendChild(bridgeScript)", "", "function evalLocalScript() {", - "(()=>{\"use strict\";var e={8902:(e,t,r)=>{r.d(t,{Mn:()=>a,Hd:()=>d,pn:()=>l,Bq:()=>o,W1:()=>i,LS:()=>h,oF:()=>s});const s={CORE:\"core\",PLATFORM:\"platform\",PLAYER:\"player\",STORAGE:\"storage\",ADVERTISEMENT:\"advertisement\",SOCIAL:\"social\",DEVICE:\"device\",LEADERBOARDS:\"leaderboards\",PAYMENTS:\"payments\",REMOTE_CONFIG:\"remote_config\",CLIPBOARD:\"clipboard\",ACHIEVEMENTS:\"achievements\",ANALYTICS:\"analytics\",NOTIFICATIONS:\"notifications\",DAILY_REWARDS:\"daily_rewards\",TASKS:\"tasks\",CROSS_PROMO:\"cross_promo\"},i={INTERSTITIAL_STATE_CHANGED:\"interstitial_state_changed\",REWARDED_STATE_CHANGED:\"rewarded_state_changed\",BANNER_STATE_CHANGED:\"banner_state_changed\",ADVANCED_BANNERS_STATE_CHANGED:\"advanced_banners_state_changed\",AUDIO_STATE_CHANGED:\"audio_state_changed\",PAUSE_STATE_CHANGED:\"pause_state_changed\",ORIENTATION_STATE_CHANGED:\"orientation_state_changed\",SCREEN_SIZE_CHANGED:\"screen_size_changed\",PLATFORM_MESSAGE_SENT:\"platform_message_sent\",PLATFORM_STORAGE_AVAILABILITY_CHANGED:\"platform_storage_availability_changed\",VISIBILITY_STATE_CHANGED:\"visibility_state_changed\",STORAGE_SET:\"storage_set\",CROSS_PROMO_SHOWN:\"cross_promo_shown\",DAILY_REWARDS_CLAIMED:\"daily_rewards_claimed\",DAILY_REWARDS_STREAK_RESET:\"daily_rewards_streak_reset\",TASKS_REWARD_CLAIMED:\"tasks_reward_claimed\",TASKS_PERIOD_ROLLED_OVER:\"tasks_period_rolled_over\"},a={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\"},o={SDK_NOT_INITIALIZED:\"SDK_NOT_INITIALIZED\",INITIALIZATION_FAILED:\"INITIALIZATION_FAILED\",CONFIG_LOAD_FAILED:\"CONFIG_LOAD_FAILED\",CONFIG_PARSE_FAILED:\"CONFIG_PARSE_FAILED\",STORAGE_NOT_SUPPORTED:\"STORAGE_NOT_SUPPORTED\",STORAGE_NOT_AVAILABLE:\"STORAGE_NOT_AVAILABLE\",STORAGE_QUOTA_EXCEEDED:\"STORAGE_QUOTA_EXCEEDED\",GAME_PARAMS_NOT_FOUND:\"GAME_PARAMS_NOT_FOUND\",INVITE_FRIENDS_MESSAGE_LENGTH_ERROR:\"INVITE_FRIENDS_MESSAGE_LENGTH_ERROR\",NOTIFICATIONS_NOT_SUPPORTED:\"NOTIFICATIONS_NOT_SUPPORTED\",NOTIFICATION_INVALID_PARAMETERS:\"NOTIFICATION_INVALID_PARAMETERS\"},n={SDK_NOT_INITIALIZED:\"Before using the SDK you must initialize it\",INITIALIZATION_FAILED:\"SDK initialization failed\",CONFIG_LOAD_FAILED:\"Failed to load the bridge config file\",CONFIG_PARSE_FAILED:\"Failed to parse the bridge config file\",STORAGE_NOT_SUPPORTED:\"Storage not supported\",STORAGE_NOT_AVAILABLE:\"Storage not available\",STORAGE_QUOTA_EXCEEDED:\"Storage quota exceeded\",GAME_PARAMS_NOT_FOUND:\"Game params are not found\",INVITE_FRIENDS_MESSAGE_LENGTH_ERROR:\"Message is too long\",NOTIFICATIONS_NOT_SUPPORTED:\"Notifications not supported\",NOTIFICATION_INVALID_PARAMETERS:\"Invalid notification parameters\"};class d extends Error{code;originalError;constructor(e,t){super(n[e]),this.name=\"BridgeError\",this.code=e,this.originalError=t}}const l=Object.fromEntries(Object.keys(o).map((e=>[e,{code:e,message:n[e]}]))),h={NOTIFICATION:\"notification\"}},6039:(e,t,r)=>{r.d(t,{Z:()=>s});const s=class{get promise(){return this.#e}#e;#t;#r;constructor(){this.#e=new Promise(((e,t)=>{this.#t=e,this.#r=t}))}resolve(e){this.#t(e)}reject(e){this.#r(e)}}},1558:(e,t,r)=>{r.d(t,{ZP:()=>d,aA:()=>i,iL:()=>n});var s=r(1302);function i(e){const t=e;t.on=function(e,t){this._eventListeners||(this._eventListeners={}),this._eventListeners[e]||(this._eventListeners[e]=[]),this._eventListeners[e].push(t)},t.off=function(e,t){this._eventListeners?.[e]&&(t?this._eventListeners[e]=this._eventListeners[e].filter((e=>e!==t&&e._original!==t)):delete this._eventListeners[e])},t.once=function(e,t){const r=(...s)=>{this.off(e,r),t(...s)};r._original=t,this.on(e,r)},t.emit=function(e,...t){if(!this._eventListeners?.[e])return;[...this._eventListeners[e]].forEach((r=>{try{r(...t)}catch(t){s.ZP.error(`[EventBus] Listener error on \"${e}\":`,t)}}))}}const a={};i(a);const o=a.emit.bind(a);function n(e){const t=e;t.on=function(e,t){a.on(e,t)},t.off=function(e,t){a.off(e,t)},t.once=function(e,t){a.once(e,t)}}a.emit=function(e,...t){s.ZP.info(`[event] ${e}`,...t),o(e,...t)};const d=a},6873:(e,t,r)=>{r.d(t,{Z:()=>s});const s=new class{get isAvailable(){return null!==this.#s}#s=null;constructor(){try{this.#s=window.localStorage}catch{this.#s=null}}getItem(e){if(!this.#s)return null;try{return this.#s.getItem(e)}catch{return null}}setItem(e,t){this.#s&&this.#s.setItem(e,t)}removeItem(e){if(this.#s)try{this.#s.removeItem(e)}catch{}}}},5095:(e,t,r)=>{r.d(t,{Z:()=>s});const s=class{#i=null;#a=null;#o;constructor(e){this.#o=e}getServerTime(){return null!==this.#i?Promise.resolve(Date.now()+this.#i):(this.#a||(this.#a=Promise.resolve().then((()=>this.#o())).then((e=>(this.#i=e-Date.now(),this.#a=null,e))).catch((e=>{throw this.#a=null,e}))),this.#a)}}},5819:(e,t,r)=>{r.d(t,{ao:()=>d,as:()=>n});var s=r(3806);const i=\"https://api.playgama.com\",a=\"/playgama\";let o=i;function n(e){o=e===s.Lb.DISCORD?a:i}function d(){return o}},5230:(e,t,r)=>{r.d(t,{ZP:()=>w});var s=r(8960),i=r(8902),a=r(1302);const o=\"bridge-remote-config-cache\",n=[\"forciblySetPlatformId\",\"remoteConfigUrl\"];var d=r(6873);const l=\"pending\",h=\"loading\",c=\"success\",u=\"failed\",p=\"timeout\",m=\"skipped\",_=\"network\",g=\"fresh-cache\",S=\"stale-cache\";const A=class{get loadStatus(){return this.#n}get loadError(){return this.#d}get appliedSource(){return this.#l}#h;#c;#u;#n=l;#d=\"\";#l=null;constructor({url:e,timeoutMs:t,ttlMs:r}){this.#h=e,this.#c=\"number\"==typeof t?t:2e3,this.#u=\"number\"==typeof r?r:36e5}async load(){if(!this.#h)return this.#n=m,{source:null,options:null};const e=this.#p();if(e&&!this.#m(e))return this.#l=g,this.#n=c,this.refreshInBackground(),{source:g,options:e.options};try{this.#n=h;const e=await this.#_(this.#c);return this.#g(e),this.#l=_,this.#n=c,{source:_,options:e}}catch(t){const r=\"AbortError\"===t?.name;return this.#n=r?p:u,this.#d=t?.message||String(t),a.ZP.error(\"Remote config load failed:\",t),e?(this.#l=S,{source:S,options:e.options,error:this.#d}):{source:null,options:null,error:this.#d}}}refreshInBackground(){this.#h&&this.#_(this.#c).then((e=>{this.#g(e)})).catch((e=>{a.ZP.error(\"Remote config background refresh failed:\",e)}))}async#_(e){const t=new AbortController,r=setTimeout((()=>t.abort()),e);try{const e=await fetch(this.#h,{signal:t.signal});if(!e.ok)throw new Error(`Failed to load remote bridge config: ${this.#h} ${e.status} (${e.statusText})`);const r=await e.text(),s=JSON.parse(r);if(!s||\"object\"!=typeof s||Array.isArray(s))throw new Error(\"Remote bridge config must be a JSON object\");return s}finally{clearTimeout(r)}}#p(){const e=d.Z.getItem(o);if(!e)return null;try{const t=JSON.parse(e);return t&&t.url===this.#h&&\"number\"==typeof t.savedAt&&t.options&&\"object\"==typeof t.options?t:null}catch{return null}}#g(e){try{const t={url:this.#h,savedAt:Date.now(),options:e};d.Z.setItem(o,JSON.stringify(t))}catch{}}#m(e){return e.savedAt+this.#u{e in this.#I&&(s[e]=this.#I[e])})),this.#v({...r.options,...s})}}},1302:(e,t,r)=>{r.d(t,{zY:()=>l,dw:()=>u,ZP:()=>p});const s=\"info\",i=\"warn\",a=\"error\",o=\"#9747FF\",n=`background: ${o}; color: #fff; padding: 1px 6px; border-radius: 4px`,d=`background: ${o}; color: white; padding: 1px 6px; border-radius: 4px`,l=\"debug\",h=[\"on\",\"off\",\"once\",\"emit\"];const c=new class{get enabled(){return this.#R}set enabled(e){this.#R=e}#R=!1;info(e,...t){this.#b(s,e,t)}warn(e,...t){this.#b(i,e,t)}error(e,...t){this.#b(a,e,t)}banner(e){console.info(`%c ${e} `,d)}#b(e,t,r){if(e!==a&&!this.#R)return;const s=[`%c PlaygamaBridge %c ${t}`,n,\"\",...r];switch(e){case a:console.error(...s);break;case i:console.warn(...s);break;default:console.info(...s)}}};function u(e,t){const r=new Map;return new Proxy(t,{get(t,s){const i=Reflect.get(t,s,t);if(\"function\"!=typeof i)return i;let a=r.get(s);if(!a){const o=String(s),n=i,d=!h.includes(o);a=(...r)=>{if(!d)return n.apply(t,r);c.info(`[${e}] ${o}()`,...r);const s=n.apply(t,r);return function(e){return null!=e&&(\"object\"==typeof e||\"function\"==typeof e)&&\"function\"==typeof e.then}(s)&&s.then((t=>c.info(`[${e}] ${o} → resolved`,t)),(t=>c.warn(`[${e}] ${o} → rejected`,t))),s},r.set(s,a)}return a}})}const p=c},9541:(e,t,r)=>{r.d(t,{k:()=>a});var s=r(5095),i=r(5819);const a=new s.Z((async function(){const e=await fetch(`${(0,i.ao)()}/api/bridge/v1/timestamp/now`);if(!e.ok)throw new Error(\"Network response was not ok\");return 1e3*(await e.json()).timestamp}))},9778:(e,t,r)=>{r.d(t,{Z:()=>o});var s=r(1558),i=r(5230),a=r(3806);const o=class{_platformBridge;initialize(e){return this._platformBridge=e,this}_forwardEvent(e){this._platformBridge.on(e,((...t)=>s.ZP.emit(e,...t)))}_isSaas(e){const t=this._platformBridge.platformId,{saas:r}=i.ZP.getValues(),s=r?.[e];return!!s&&(!(t!==a.Lb.PLAYGAMA||!r?.publicToken)||Boolean(Array.isArray(s.platforms)&&null!=t&&s.platforms.includes(t)))}}},5334:(e,t,r)=>{r.d(t,{ZP:()=>h,dk:()=>a});var s=r(9778),i=r(5230);function a(e,t,r){if(!e)return null;const s=e.find((e=>{const s=e[t];return Boolean(s&&\"object\"==typeof s&&r(s))}));return s?s.id:null}var o=r(9979);const n=\"bridge-achievements-state\";const d=class{#C;#L=null;#O=null;constructor(e){this.#C=e}async unlock(e){if(!e)return;const t=await this.#M();t.unlocked.includes(e)||(t.unlocked.push(e),await this.#N())}async getList(){const e=await this.#M();return this.#C.map((t=>({id:t.id,name:\"string\"==typeof t.name?t.name:void 0,description:\"string\"==typeof t.description?t.description:void 0,unlocked:e.unlocked.includes(t.id)})))}#M(){return this.#L?Promise.resolve(this.#L):(this.#O||(this.#O=o.Z.get(n,!0).then((e=>(this.#L=this.#k(e),this.#O=null,this.#L))).catch((()=>(this.#L=this.#H(),this.#O=null,this.#L)))),this.#O)}#N(){return this.#L?o.Z.set(n,this.#L):Promise.resolve()}#H(){return{unlocked:[]}}#k(e){if(!e||\"object\"!=typeof e)return this.#H();const t=e;return{unlocked:Array.isArray(t.unlocked)?t.unlocked.filter((e=>\"string\"==typeof e)):[]}}};class l extends s.Z{#B;initialize(e){return super.initialize(e),this.#B=new d(this.#G()??[]),this}unlock(e){if(this._platformBridge.isAchievementsSupported){const t=function(e,t,r){if(!r||!e)return r;const s=e.find((e=>e.id===r));if(!s)return r;const i=s[t];return i&&\"object\"==typeof i?i:r}(this.#G(),this._platformBridge.platformId,e);return this._platformBridge.achievementsUnlock(t)}return this.#B.unlock(e)}getAchievements(){return this._platformBridge.isAchievementsSupported?this._platformBridge.achievementsGetList():this.#B.getList()}#G(){const e=i.ZP.getValues();return e?.achievements}}const h=new l},9221:(e,t,r)=>{r.d(t,{Cb:()=>i,Kk:()=>a,My:()=>p,Qh:()=>h,WA:()=>o,_g:()=>l,az:()=>m,b3:()=>n,lY:()=>u,m1:()=>_,qJ:()=>c,qV:()=>d});var s=r(66);const i={TOP:\"top\",BOTTOM:\"bottom\"},a={LOADING:\"loading\",SHOWN:\"shown\",HIDDEN:\"hidden\",FAILED:\"failed\"},o={LOADING:\"loading\",OPENED:\"opened\",CLOSED:\"closed\",FAILED:\"failed\"},n={LOADING:\"loading\",OPENED:\"opened\",CLOSED:\"closed\",FAILED:\"failed\",REWARDED:\"rewarded\"},d={SHOW:\"show\",HIDE:\"hide\"},l=\"banner-container\",h=\"advanced-banner-\",c=60,u=200,p={DEVICE_TYPE:4,ORIENTATION:2,DIMENSION:1,CANVAS:1},m=new Set(Object.values(s.me)),_=new Set(Object.values(s.AR))},8467:(e,t,r)=>{r.d(t,{f_:()=>T,kM:()=>D,ZP:()=>L,XA:()=>w,DQ:()=>R,QG:()=>v});var s=r(1558),i=r(5230),a=r(9778),o=r(6170),n=r(8902),d=r(3806),l=r(9221);function h(e){if(\"number\"==typeof e)return e;if(\"string\"==typeof e){const t=parseInt(e,10);return Number.isNaN(t)?null:t}return null}function c(e,t,r){if(!e)return e??null;if(!t)return e;const s=t.find((t=>t.id===e));return s&&s[r]?s[r]:e}const u=class{get isSupported(){const e=i.ZP.getValues().advertisement?.banner?.disable;return!0!==e&&this.#F.isBannerSupported}get state(){return this.#L}#F;#x;#L=l.Kk.HIDDEN;#U=null;#V=null;constructor(e,t){this.#F=e,this.#x=t,this.#F.on(n.W1.BANNER_STATE_CHANGED,(e=>this.#Z(e)))}show(e=l.Cb.BOTTOM,t=null){if(this.#L===l.Kk.LOADING||this.#L===l.Kk.SHOWN)return;const r=Object.values(l.Cb).includes(e)?e:l.Cb.BOTTOM;this.#U=r;let s=t;if(!s){const e=i.ZP.getValues().advertisement?.banner?.placementFallback;e&&(s=e)}if(this.#V=s,this.#Z(l.Kk.LOADING),!this.isSupported)return void this.#Z(l.Kk.FAILED);const a=i.ZP.getValues().advertisement?.banner?.placements,o=c(s,a,this.#F.platformId);this.#F.showBanner(r,o)}hide(){this.#L!==l.Kk.LOADING&&this.#L!==l.Kk.HIDDEN&&this.isSupported&&this.#F.hideBanner()}#Z(e){this.#L!==e&&(this.#L=e,e!==l.Kk.LOADING&&this.#x.send(`${n.oF.ADVERTISEMENT}_banner_${e}`,{position:this.#U,placement:this.#V}),s.ZP.emit(n.W1.BANNER_STATE_CHANGED,this.#L))}},p=\"state_changed\",m=\"time_left_changed\",_=\"created\",g=\"started\",S=\"stopped\",A=\"completed\";class E{get state(){return this.#L}#j=0;#z=0;#L=_;#W=0;constructor(e){this.#j=e}start(){this.#L!==g&&(this.#z=this.#j,this.#Z(g),this.#W=setInterval((()=>{this.#z-=1,this.emit(m,this.#z),this.#z<=0&&(this.#K(),this.#Z(A))}),1e3))}stop(){this.#K(),this.#L===g&&this.#Z(S)}#Z(e){this.#L=e,this.emit(p,this.#L)}#K(){this.#W&&clearInterval(this.#W),this.#z=0}}(0,s.aA)(E.prototype);const f=E;const P=class{get isSupported(){const e=i.ZP.getValues().advertisement?.interstitial?.disable;return!0!==e&&this.#F.isInterstitialSupported}get state(){return this.#L}get minimumDelayBetweenInterstitial(){return this.#Y}get isInProgress(){return[l.WA.LOADING,l.WA.OPENED].includes(this.#L)}#F;#x;#L=l.WA.CLOSED;#V=null;#$;#Y=l.qJ;#q=null;#J;constructor(e,t,r){this.#F=e,this.#x=t,this.#J=r,this.#F.on(n.W1.INTERSTITIAL_STATE_CHANGED,(e=>{const t=e;this.#Z(t),t===l.WA.CLOSED&&this.#X()})),s.ZP.on(n.W1.PLATFORM_MESSAGE_SENT,(e=>{e===d.Dt.GAME_READY&&(this.#q=Date.now())})),this.#Q()}preload(e=null){if(!this.isSupported)return;let t=e;if(!t||\"string\"!=typeof t){const e=i.ZP.getValues().advertisement?.interstitial?.placementFallback;e&&(t=e)}const r=i.ZP.getValues().advertisement?.interstitial?.placements,s=c(t,r,this.#F.platformId);this.#F.preloadInterstitial(s)}show(e=null){let t=e;if(!t){const e=i.ZP.getValues().advertisement?.interstitial?.placementFallback;e&&(t=e)}if(this.#V=t,this.#Z(l.WA.LOADING),!this.isSupported)return void this.#Z(l.WA.FAILED);const r=this.#ee();if(r>0&&(null===this.#q||(Date.now()-this.#q)/1e30&&this.#F.isMinimumDelayBetweenInterstitialEnabled&&(this.#$=new f(this.#Y),this.#$.start())}};const I=class{get isSupported(){const e=i.ZP.getValues().advertisement?.rewarded?.disable;return!0!==e&&this.#F.isRewardedSupported}get state(){return this.#L}get placement(){return this.#V}get isInProgress(){return[l.b3.LOADING,l.b3.OPENED,l.b3.REWARDED].includes(this.#L)}#F;#x;#L=l.b3.CLOSED;#V=null;#J;constructor(e,t,r){this.#F=e,this.#x=t,this.#J=r,this.#F.on(n.W1.REWARDED_STATE_CHANGED,(e=>this.#Z(e)))}preload(e=null){if(!this.isSupported)return;let t=e;if(!t||\"string\"!=typeof t){const e=i.ZP.getValues().advertisement?.rewarded?.placementFallback;e&&(t=e)}const r=i.ZP.getValues().advertisement?.rewarded?.placements,s=c(t,r,this.#F.platformId);this.#F.preloadRewarded(s)}show(e=null){if(this.#V=e,!this.#V){const e=i.ZP.getValues().advertisement?.rewarded?.placementFallback;e&&(this.#V=e)}const t=i.ZP.getValues().advertisement?.rewarded?.placements,r=c(this.#V,t,this.#F.platformId);this.#Z(l.b3.LOADING),this.isSupported?this.#F.showRewarded(r):this.#Z(l.b3.FAILED)}#Z(e){this.#L!==e&&(this.#L=e,e!==l.b3.LOADING&&this.#x.send(`${n.oF.ADVERTISEMENT}_rewarded_${e}`,{placement:this.#V}),s.ZP.emit(n.W1.REWARDED_STATE_CHANGED,this.#L),this.#J(this.#L))}};var y=r(3117);function D(e){const t=document.createElement(\"div\");switch(t.id=l._g,t.style.position=\"absolute\",document.body.appendChild(t),e){case l.Cb.TOP:t.style.top=\"0px\",t.style.height=\"90px\",t.style.width=\"100%\";break;case l.Cb.BOTTOM:default:t.style.bottom=\"0px\",t.style.height=\"90px\",t.style.width=\"100%\"}return t}function T(e){const t=[];return e.forEach(((e,r)=>{const s=document.createElement(\"div\"),i=`${l.Qh}${r}`;s.id=i,s.style.position=\"absolute\",s.style.zIndex=\"9999\",e.width&&(s.style.width=e.width),e.height&&(s.style.height=e.height),e.top&&(s.style.top=e.top),e.bottom&&(s.style.bottom=e.bottom),e.left&&(s.style.left=e.left),e.right&&(s.style.right=e.right),document.body.appendChild(s),t.push(i)})),t}function w(){document.querySelectorAll(`[id^=\"${l.Qh}\"]`).forEach((e=>e.remove()))}function v(e){if(!document.getElementById(\"bridge-info-popup-styles\")){const e=document.createElement(\"style\");e.id=\"bridge-info-popup-styles\",e.textContent=\"\\n #bridge-info-popup-overlay {\\n position: fixed;\\n inset: 0;\\n display: none;\\n align-items: center;\\n justify-content: center;\\n padding: 18px;\\n background: rgba(0, 0, 0, 0.24);\\n z-index: 9999;\\n }\\n\\n #bridge-info-popup {\\n width: min(92vw, 320px);\\n padding: 24px 20px 20px;\\n border-radius: 26px;\\n background: #ffffff;\\n color: #24304d;\\n text-align: center;\\n box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);\\n font-family: Inter, Arial, sans-serif;\\n }\\n\\n #bridge-info-popup-emoji {\\n font-size: 42px;\\n margin-bottom: 10px;\\n line-height: 1;\\n }\\n\\n #bridge-info-popup-title {\\n margin: 0 0 10px;\\n font-size: 24px;\\n line-height: 1.1;\\n }\\n\\n #bridge-info-popup-message {\\n margin: 0 0 18px;\\n font-size: 15px;\\n line-height: 1.45;\\n color: #66708b;\\n }\\n\\n #bridge-info-popup-button {\\n min-width: 140px;\\n height: 46px;\\n padding: 0 24px;\\n border: 0;\\n border-radius: 999px;\\n font-weight: 700;\\n font-size: 15px;\\n color: #ffffff;\\n background: linear-gradient(180deg, #5f8cff, #4c71e6);\\n box-shadow: 0 8px 20px rgba(76, 113, 230, 0.32);\\n cursor: pointer;\\n font-family: Inter, Arial, sans-serif;\\n }\\n\\n #bridge-info-popup-button:active {\\n transform: translateY(1px);\\n }\",document.head.appendChild(e)}let t=document.getElementById(\"bridge-info-popup-overlay\");t||(t=document.createElement(\"div\"),t.id=\"bridge-info-popup-overlay\",document.body.appendChild(t));let r=document.getElementById(\"bridge-info-popup\");r||(r=document.createElement(\"div\"),r.id=\"bridge-info-popup\",t.appendChild(r)),r.innerHTML=\"\";const s=document.createElement(\"div\");s.id=\"bridge-info-popup-emoji\",s.textContent=\"🎬\",r.appendChild(s);const i=document.createElement(\"h3\");i.id=\"bridge-info-popup-title\",i.textContent=e,r.appendChild(i);const a=document.createElement(\"button\");a.id=\"bridge-info-popup-button\",a.textContent=\"Continue\",r.appendChild(a);const o=t;return new Promise((e=>{a.onclick=()=>{o.style.display=\"none\",e()},o.style.display=\"flex\"}))}function R(){if(!document.getElementById(\"bridge-ad-failure-popup-fonts\")){const e=document.createElement(\"link\");e.rel=\"preconnect\",e.href=\"https://fonts.googleapis.com\",document.head.appendChild(e);const t=document.createElement(\"link\");t.rel=\"preconnect\",t.href=\"https://fonts.gstatic.com\",t.crossOrigin=\"anonymous\",document.head.appendChild(t);const r=document.createElement(\"link\");r.id=\"bridge-ad-failure-popup-fonts\",r.rel=\"stylesheet\",r.href=\"https://fonts.googleapis.com/css2?family=Cal+Sans&display=swap\",document.head.appendChild(r)}if(!document.getElementById(\"bridge-ad-failure-popup-styles\")){const e=document.createElement(\"style\");e.id=\"bridge-ad-failure-popup-styles\",e.textContent=\"\\n #bridge-ad-failure-popup {\\n position: fixed;\\n top: 0;\\n left: 0;\\n height: 100%;\\n width: 100%;\\n box-sizing: border-box;\\n padding: 24px 16px;\\n background: #682eb2;\\n display: none;\\n grid-template-columns: 1fr 1fr;\\n grid-template-rows: 32px 1fr;\\n z-index: 9999999;\\n font-family: 'Cal Sans', -apple-system, BlinkMacSystemFont, sans-serif;\\n color: #fff;\\n cursor: pointer;\\n }\\n\\n #bridge-ad-failure-popup-logo {\\n height: 32px;\\n }\\n\\n #bridge-ad-failure-popup-close {\\n all: unset;\\n cursor: pointer;\\n display: inline-flex;\\n align-items: center;\\n justify-content: center;\\n width: 32px;\\n height: 32px;\\n background: #fff;\\n border-radius: 50%;\\n justify-self: end;\\n }\\n\\n #bridge-ad-failure-popup-text {\\n grid-column: span 2;\\n font-size: 21px;\\n font-style: normal;\\n font-weight: 400;\\n line-height: 110%;\\n align-self: end;\\n margin: 0;\\n }\\n\\n @media (min-width: 320px) {\\n #bridge-ad-failure-popup {\\n padding: 24px;\\n grid-template-rows: 40px 1fr;\\n }\\n\\n #bridge-ad-failure-popup-logo {\\n height: 40px;\\n }\\n\\n #bridge-ad-failure-popup-close {\\n width: 40px;\\n height: 40px;\\n }\\n\\n #bridge-ad-failure-popup-text {\\n font-size: 25px;\\n align-self: center;\\n }\\n }\\n\\n @media (orientation: landscape) {\\n #bridge-ad-failure-popup {\\n gap: 40px;\\n }\\n\\n #bridge-ad-failure-popup-text {\\n width: 60%;\\n align-self: start;\\n }\\n }\\n\\n @media (orientation: landscape) and (min-width: 800px) {\\n #bridge-ad-failure-popup {\\n gap: 80px;\\n }\\n\\n #bridge-ad-failure-popup-text {\\n width: 50%;\\n font-size: 33px;\\n }\\n }\\n \",document.head.appendChild(e)}let e=document.getElementById(\"bridge-ad-failure-popup\");if(!e){e=document.createElement(\"div\"),e.id=\"bridge-ad-failure-popup\";const t=document.createElement(\"div\");t.innerHTML='\\n \\n \\n \\n \\n ',e.appendChild(t);const r=document.createElement(\"button\");r.id=\"bridge-ad-failure-popup-close\",r.innerHTML='\\n \\n \\n \\n ',e.appendChild(r);const s=document.createElement(\"p\");s.id=\"bridge-ad-failure-popup-text\",e.appendChild(s),document.body.appendChild(e)}const t=document.getElementById(\"bridge-ad-failure-popup-close\"),r=e;return new Promise((e=>{const s=()=>{r.style.display=\"none\",e()};t&&(t.onclick=s),r.onclick=s;const i=[\"If you see this message, no Ad was returned for the Ad request.

Please ask the developer to check the Ad setup.\",\"This is placeholder for the Ad. Playgama helps games reach players worldwide.\"],a=document.getElementById(\"bridge-ad-failure-popup-text\");a&&(a.innerHTML=i[Math.floor(Math.random()*i.length)]),r.style.display=\"grid\"}))}const b=class{get isSupported(){return!0!==this.#se?.disable&&this.#F.isAdvancedBannersSupported}get state(){return this.#L}get options(){return this.#se}#F;#x;#L=l.Kk.HIDDEN;#V=null;#ie=null;#ae=!1;#oe=null;#ne;constructor(e,t,r){this.#F=e,this.#x=t,this.#ne=r,this.#F.on(n.W1.ADVANCED_BANNERS_STATE_CHANGED,(e=>this.#Z(e))),s.ZP.on(n.W1.ORIENTATION_STATE_CHANGED,(()=>this.#de())),s.ZP.on(n.W1.SCREEN_SIZE_CHANGED,(()=>this.#de()))}show(e){let t=e;if(!t){const e=this.#se?.placementFallback;\"string\"==typeof e&&(t=e)}this.tryShow(t)}hide(){this.isSupported&&(this.#le(),this.#he(),this.#Z(l.Kk.HIDDEN))}tryShow(e){if(!this.isSupported)return;if(null===e)return;const t=this.#se?.[e];if(!t)return;if((t.action??l.qV.SHOW)===l.qV.HIDE)return this.#le(),void this.#he();this.#Z(l.Kk.LOADING);const r=this.#t(t);this.#V=e,this.#ie&&!r&&this.#F.hideAdvancedBanners(),this.#ie=r,r?this.#ne()?this.#ae=!0:this.#F.showAdvancedBanners(r):this.#Z(l.Kk.FAILED)}hideByAd(){this.#ie&&!this.#ae&&(this.#ae=!0,this.#F.hideAdvancedBanners())}restoreAfterAd(){this.#ae&&(this.#ne()||(this.#ae=!1,this.#ie&&this.#F.showAdvancedBanners(this.#ie)))}get#se(){return i.ZP.getValues().advertisement?.advancedBanners}#Z(e){this.#L!==e&&(this.#L=e,e!==l.Kk.LOADING&&this.#x.send(`${n.oF.ADVERTISEMENT}_advanced_banners_${e}`,{placement:this.#V}),s.ZP.emit(n.W1.ADVANCED_BANNERS_STATE_CHANGED,this.#L))}#he(){this.#V=null,this.#ie=null,this.#ae=!1}#le(){this.#ie&&!this.#ae&&this.#F.hideAdvancedBanners()}#de(){this.#oe&&clearTimeout(this.#oe),this.#oe=setTimeout((()=>{this.#oe=null,this.#ce()}),l.lY)}#ce(){if(!this.#V)return;const e=this.#se?.[this.#V];if(!e)return;const t=this.#t(e);if(t===this.#ie)return;const r=this.#ie;this.#ie=t,this.#ae||(r&&this.#F.hideAdvancedBanners(),t?this.#F.showAdvancedBanners(t):r&&this.#Z(l.Kk.HIDDEN))}#t(e){const{deviceType:t}=this.#F,r={deviceType:t,orientation:(0,y.f)(),canvas:document.querySelector(\"canvas\")};let s=\"default\",i=e.default??null,a=-1;return Object.keys(e).filter((e=>\"action\"!==e&&\"default\"!==e)).forEach((t=>{const o=this.#ue(t,r);if(!o.matched)return;(o.score>a||o.score===a&&t.split(\":\").length>s.split(\":\").length)&&(a=o.score,s=t,i=e[t])})),i}#ue(e,t){const{deviceType:r,orientation:s,canvas:i}=t,a=e.split(\":\"),o=a.includes(\"canvas\");let n=0;if(o&&!i)return{matched:!1,score:n};o&&(n+=l.My.CANVAS);return{matched:a.every((e=>{if(\"canvas\"===e)return!0;if(l.az.has(e)){if(e!==r)return!1;n+=l.My.DEVICE_TYPE}else if(l.m1.has(e)){if(e!==s||window.innerWidth===window.innerHeight)return!1;n+=l.My.ORIENTATION}else{const t=/^([wh])([><]=?)(\\d+)$/.exec(e),r=/^ar([><]=?)(\\d+(?:\\.\\d+)?)$/.exec(e);if(t){const e=o&&i?i.width:window.innerWidth,r=o&&i?i.height:window.innerHeight,s=\"w\"===t[1]?e:r,a=t[2],d=parseInt(t[3],10);if(!this.#pe(s,a,d))return!1;n+=l.My.DIMENSION+this.#me(s,d)}else{if(!r)return!1;{const e=(o&&i?i.width:window.innerWidth)/(o&&i?i.height:window.innerHeight),t=r[1],s=parseFloat(r[2]);if(!this.#pe(e,t,s))return!1;n+=l.My.DIMENSION+this.#me(e,s,1e3)}}}return!0})),score:n}}#pe(e,t,r){switch(t){case\">\":return e>r;case\"<\":return e=\":return e>=r;case\"<=\":return e<=r;default:return!1}}#me(e,t,r=1){return.9/(1+Math.abs(e-t)*r)}};class C extends a.Z{get isBannerSupported(){return this.#_e.isSupported}get bannerState(){return this.#_e.state}get isInterstitialSupported(){return this.#ge.isSupported}get interstitialState(){return this.#ge.state}get isRewardedSupported(){return this.#Se.isSupported}get rewardedPlacement(){return this.#Se.placement}get rewardedState(){return this.#Se.state}get minimumDelayBetweenInterstitial(){return this.#ge.minimumDelayBetweenInterstitial}get isAdvancedBannersSupported(){return this.#Ae.isSupported}get advancedBannersState(){return this.#Ae.state}#_e;#ge;#Se;#Ae;initialize(e){return super.initialize(e),this.#_e=new u(e,o.rh),this.#ge=new P(e,o.rh,(e=>this.#Ee(e))),this.#Se=new I(e,o.rh,(e=>this.#fe(e))),this.#Ae=new b(e,o.rh,(()=>this.#Pe())),s.ZP.on(n.W1.PLATFORM_MESSAGE_SENT,(e=>{this.#Ae.tryShow(e),this.#Ie(e)})),s.ZP.on(n.W1.STORAGE_SET,(()=>{this.#Ie(n.W1.STORAGE_SET)})),e.on(n.W1.VISIBILITY_STATE_CHANGED,(e=>{e===d.YU.VISIBLE&&this.#Ie(`visibility_state_${d.YU.VISIBLE}`)})),this}setMinimumDelayBetweenInterstitial(e){this.#ge.setMinimumDelay(e)}showBanner(e=l.Cb.BOTTOM,t=null){this.#_e.show(e,t)}hideBanner(){this.#_e.hide()}preloadInterstitial(e=null){this.#ge.preload(e)}showInterstitial(e=null){this.#Pe()||this.#ge.show(e)}preloadRewarded(e=null){this.#Se.preload(e)}showRewarded(e=null){this.#Pe()||this.#Se.show(e)}showAdvancedBanners(e){this.#Ae.show(e)}hideAdvancedBanners(){this.#Ae.hide()}checkAdBlock(){return this._platformBridge.checkAdBlock()}#Ie(e){const t=i.ZP.getValues().advertisement?.interstitial?.autoShow;Array.isArray(t)&&t.includes(e)&&this.showInterstitial(e)}#Pe(){return this.#ge.isInProgress||this.#Se.isInProgress}#Ee(e){e===l.WA.LOADING||e===l.WA.OPENED?this.#Ae.hideByAd():e!==l.WA.CLOSED&&e!==l.WA.FAILED||this.#Ae.restoreAfterAd()}#fe(e){e===l.b3.LOADING||e===l.b3.OPENED?this.#Ae.hideByAd():e!==l.b3.CLOSED&&e!==l.b3.FAILED||this.#Ae.restoreAfterAd()}}(0,s.iL)(C.prototype);const L=new C},6170:(e,t,r)=>{r.d(t,{ZP:()=>_,rh:()=>m});var s=r(8902),i=r(9541),a=r(3806);const o=\"2.1.0\";var n=r(8960),d=r(3941),l=r(9778),h=r(5230),c=r(5819);class u extends l.Z{set gameVersion(e){this.#ye=e}#De=[];#Te=null;#we=null;#ve=null;#ye=null;#Re;#be=!1;#Ce=null;#Le=null;#Oe=!1;#i=0;#Me=\"undefined\"!=typeof CompressionStream;constructor(){super(),this.#Re=this.#Ne()}initialize(e){super.initialize(e);this._platformBridge.platformId===a.Lb.PLAYGAMA||!1!==h.ZP.getValues().sendAnalyticsEvents||(this.#be=!0);const{href:t}=window.location;return(t.startsWith(\"file://\")||t.includes(\"localhost\")||t.includes(\"127.0.0.1\"))&&(this.#be=!0),this._platformBridge.isPlatformExternalCallsSupported||(this.#be=!0),this.#we=this.#ke(),this.#ve=(0,d.m)().id,this.#be||(this.#He(),this.send(`${s.oF.CORE}_initialization_started`),this.#Be(),this.#Ge()),this}send(e,t={}){if(this.#be)return;const r=this.#Fe(e,t);this.#De.push(r)}#Ne(){return\"undefined\"!=typeof crypto&&\"function\"==typeof crypto.randomUUID?crypto.randomUUID():(0,n.D1)()}async#He(){try{const e=await i.k.getServerTime();this.#i=e-Date.now();for(let e=0;e{this.#Ke(),e.persisted&&this.#Ye()},this.#Ce=()=>{\"hidden\"===document.visibilityState?(this.#$e(),this.#Ke()):this.#Ye()},document.addEventListener(\"visibilitychange\",this.#Ce),window.addEventListener(\"pagehide\",this.#Le)}#Ye(){this.#be||(this.#Oe=!1,this.#Be())}#Ke(){this.#Oe||this.#be||(this.#Oe=!0,this.send(`${s.oF.CORE}_session_end`),this.#We())}#ke(){const{platformId:e}=this._platformBridge,t=h.ZP.getValues(),r={[a.Lb.GAME_DISTRIBUTION]:\"gameId\",[a.Lb.Y8]:\"gameId\",[a.Lb.MSN]:\"gameId\",[a.Lb.HUAWEI]:\"appId\",[a.Lb.DISCORD]:\"appId\",[a.Lb.GAMEPUSH]:\"projectId\",[a.Lb.MICROSOFT_STORE]:\"gameId\"}[e],s=r?t?.[r]:null;return\"string\"==typeof s&&s?s:this.#qe(window.location.href)}#qe(e){try{const t=new URL(e),r=t.pathname.split(\"/\").filter(Boolean),{platformId:s}=this._platformBridge,i={[a.Lb.YANDEX]:{pathKey:\"app\"},[a.Lb.LAGGED]:{pathKey:\"g\"},[a.Lb.CRAZY_GAMES]:{pathKey:\"game\"}}[s];if(i){const e=r.indexOf(i.pathKey),t=-1!==e?r[e+1]:null;if(t)return t}if(s===a.Lb.XIAOMI){if(\"index.html\"===r[r.length-1]&&r.length>=2)return r[r.length-2]}if(s===a.Lb.PLAYGAMA||s===a.Lb.STANDALONE){const e=t.searchParams.get(\"game_id\");if(e)return e;const r=t.hostname.match(/^([a-z0-9-]+)\\.games\\.playgama\\.net$/i);if(r)return r[1]}}catch{return null}return null}#Be(){this.#Te||(this.#Te=setInterval((()=>{this.send(`${s.oF.CORE}_ping`),this.#je()}),3e4))}#$e(){this.#Te&&(clearInterval(this.#Te),this.#Te=null)}}const p=new u,m=p,_=p},5555:(e,t,r)=>{r.d(t,{Z:()=>S});var s=r(9778),i=r(1558),a=r(5230),o=r(8902),n=r(9221);const d=\"bridge-cross-promo-styles\",l=\"bridge-cross-promo\",h=\"config\",c=\"platform\",u=`\\n #${l} {\\n position: fixed;\\n inset: 0;\\n z-index: 9999998;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n background: rgba(0, 0, 0, 0.72);\\n font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;\\n animation: bridge-cp-fade-in 180ms ease-out;\\n padding: 16px;\\n box-sizing: border-box;\\n }\\n\\n #${l} .bridge-cp-modal {\\n position: relative;\\n width: 100%;\\n max-width: 640px;\\n max-height: 100%;\\n background: #212121;\\n border-radius: 12px;\\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);\\n padding: 24px;\\n box-sizing: border-box;\\n display: flex;\\n flex-direction: column;\\n overflow: hidden;\\n color: #ffffff;\\n }\\n\\n #${l} .bridge-cp-header {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n gap: 12px;\\n margin-bottom: 20px;\\n }\\n\\n #${l} .bridge-cp-title {\\n margin: 0;\\n color: #ffffff;\\n font-size: 20px;\\n font-weight: 700;\\n line-height: 1.2;\\n letter-spacing: -0.2px;\\n }\\n\\n #${l} .bridge-cp-close {\\n flex-shrink: 0;\\n width: 36px;\\n height: 36px;\\n border: 0;\\n border-radius: 50%;\\n background: transparent;\\n color: #aaaaaa;\\n font-size: 24px;\\n line-height: 1;\\n cursor: pointer;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n padding: 0;\\n transition: background 200ms ease, color 200ms ease;\\n }\\n\\n #${l} .bridge-cp-close:hover {\\n background: rgba(255, 255, 255, 0.1);\\n color: #ffffff;\\n }\\n\\n #${l} .bridge-cp-grid {\\n display: grid;\\n grid-template-columns: repeat(2, minmax(0, 1fr));\\n gap: 16px;\\n overflow-y: auto;\\n padding: 4px;\\n margin: -4px;\\n -webkit-overflow-scrolling: touch;\\n }\\n\\n #${l} .bridge-cp-tile {\\n display: flex;\\n flex-direction: column;\\n text-decoration: none;\\n color: inherit;\\n cursor: pointer;\\n }\\n\\n #${l} .bridge-cp-thumb {\\n position: relative;\\n width: 100%;\\n aspect-ratio: 183 / 256;\\n border-radius: 12px;\\n overflow: hidden;\\n background: #333333 center/cover no-repeat;\\n transition: transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 250ms ease;\\n }\\n\\n #${l} .bridge-cp-tile:hover .bridge-cp-thumb {\\n transform: translateY(-4px);\\n box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);\\n }\\n\\n #${l} .bridge-cp-name {\\n margin-top: 8px;\\n font-size: 14px;\\n font-weight: 500;\\n text-align: center;\\n color: #f1f1f1;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n transition: color 200ms ease;\\n }\\n\\n #${l} .bridge-cp-tile:hover .bridge-cp-name {\\n color: #3ea6ff;\\n }\\n\\n @keyframes bridge-cp-fade-in {\\n from { opacity: 0; }\\n to { opacity: 1; }\\n }\\n\\n @media (min-width: 600px) {\\n #${l} .bridge-cp-grid {\\n grid-template-columns: repeat(4, minmax(0, 1fr));\\n }\\n }\\n`;function p(e){return\"string\"==typeof e&&e.length>0?e:void 0}function m(e){return{name:p(e.name),url:e.url,iconUrl:p(e.icon),payload:e}}function _(e){const t=e.appID??e.id;return{id:null==t?void 0:String(t),name:p(e.title)??p(e.name),url:p(e.url)??\"\",iconUrl:p(e.coverURL)??p(e.icon)??p(e.iconUrl),coverUrl:p(e.coverURL)??p(e.coverUrl),payload:e}}class g extends s.Z{get isVisible(){return null!==this.#Je}#Je=null;#Xe=h;initialize(e){return super.initialize(e),this.#Xe=this.#Qe(),this.#et(),this}getGames(){return this.#Xe===c?this.#tt():Promise.resolve(this.#rt())}async show(){if(this.#Je)return;const e=await this.getGames();if(this.#Je)return;const t=e.filter((e=>e&&e.url));if(0===t.length)return;const r=function(e,t){if(e.length<=t)return e.slice();const r=e.slice();for(let e=r.length-1;e>0;e-=1){const t=Math.floor(Math.random()*(e+1)),s=r[e];r[e]=r[t],r[t]=s}return r.slice(0,t)}(t,4);this.#st(),this.#Je=this.#it(r,this.#at().title),document.body.appendChild(this.#Je);const s={source:this.#Xe,games:r};i.ZP.emit(o.W1.CROSS_PROMO_SHOWN,s)}hide(){this.#Je&&(this.#Je.remove(),this.#Je=null)}#Qe(){const{source:e}=this.#at();return e===c||e===h?e:h}#et(){i.ZP.on(o.W1.INTERSTITIAL_STATE_CHANGED,(e=>{e!==n.WA.LOADING&&e!==n.WA.OPENED||this.hide()})),i.ZP.on(o.W1.REWARDED_STATE_CHANGED,(e=>{e!==n.b3.LOADING&&e!==n.b3.OPENED||this.hide()}))}#at(){return a.ZP.getValues().crossPromo??{}}#rt(){const{games:e}=this.#at();return Array.isArray(e)?e.filter((e=>e&&e.url)).map(m):[]}#tt(){return this._platformBridge.isPlatformGamesListSupported?this._platformBridge.getGamesList().then((e=>Array.isArray(e)?e.map(_):[])).catch((()=>[])):Promise.resolve([])}#st(){if(document.getElementById(d))return;const e=document.createElement(\"style\");e.id=d,e.textContent=u,document.head.appendChild(e)}#it(e,t){const r=document.createElement(\"div\");r.id=l;const s=document.createElement(\"div\");s.className=\"bridge-cp-modal\";const i=document.createElement(\"div\");i.className=\"bridge-cp-header\";const a=document.createElement(\"h2\");a.className=\"bridge-cp-title\",a.textContent=\"string\"==typeof t&&t.length>0?t:\"More games\",i.appendChild(a);const o=document.createElement(\"button\");o.className=\"bridge-cp-close\",o.type=\"button\",o.setAttribute(\"aria-label\",\"Close\"),o.textContent=\"×\",i.appendChild(o),s.appendChild(i);const n=document.createElement(\"div\");return n.className=\"bridge-cp-grid\",e.forEach((e=>{n.appendChild(this.#ot(e))})),s.appendChild(n),r.appendChild(s),r.addEventListener(\"click\",(e=>{e.target===r&&this.hide()})),s.addEventListener(\"click\",(e=>{const t=e.target,r=t.closest(\".bridge-cp-tile\");if(t.closest(\".bridge-cp-close\"))return e.preventDefault(),void this.hide();r||this.hide()})),r}#ot(e){const t=document.createElement(\"a\");t.className=\"bridge-cp-tile\",t.href=e.url,t.target=\"_blank\",t.rel=\"noopener noreferrer\";const r=document.createElement(\"div\");if(r.className=\"bridge-cp-thumb\",e.iconUrl&&(r.style.backgroundImage=`url('${e.iconUrl.replace(/'/g,\"\\\\'\")}')`),t.appendChild(r),e.name){const r=document.createElement(\"div\");r.className=\"bridge-cp-name\",r.textContent=e.name,t.appendChild(r)}return t}}const S=new g},66:(e,t,r)=>{r.d(t,{AR:()=>a,Lh:()=>i,Uw:()=>o,me:()=>s});const s={DESKTOP:\"desktop\",MOBILE:\"mobile\",TABLET:\"tablet\",TV:\"tv\"},i={WINDOWS:\"windows\",MACOS:\"macos\",LINUX:\"linux\",ANDROID:\"android\",IOS:\"ios\",OTHER:\"other\"},a={PORTRAIT:\"portrait\",LANDSCAPE:\"landscape\"},o=\"bridge-orientation-overlay\"},3117:(e,t,r)=>{r.d(t,{f:()=>i});var s=r(66);function i(){return window.innerHeight>window.innerWidth?s.AR.PORTRAIT:s.AR.LANDSCAPE}},7408:(e,t,r)=>{r.d(t,{Z:()=>s});const s={NOT_AVAILABLE:\"not_available\",IN_GAME:\"in_game\",NATIVE:\"native\",NATIVE_POPUP:\"native_popup\"}},1147:(e,t,r)=>{r.d(t,{ZP:()=>h,cE:()=>l,iv:()=>d,om:()=>n});var s=r(9778),i=r(6170),a=r(8902);class o extends s.Z{get isSupported(){return this._platformBridge.isPaymentsSupported}purchase(e,t){return this._platformBridge.isPaymentsSupported?(i.rh.send(`${a.oF.PAYMENTS}_purchase_started`,{id:e}),this._platformBridge.paymentsPurchase(e,t).then((t=>(i.rh.send(`${a.oF.PAYMENTS}_purchase_completed`,{id:e}),t))).catch((t=>{throw i.rh.send(`${a.oF.PAYMENTS}_purchase_failed`,{id:e}),t}))):Promise.reject()}getPurchases(){return this._platformBridge.isPaymentsSupported?this._platformBridge.paymentsGetPurchases():Promise.reject()}getCatalog(){return this._platformBridge.isPaymentsSupported?this._platformBridge.paymentsGetCatalog():Promise.reject()}consumePurchase(e){return this._platformBridge.isPaymentsSupported?(i.rh.send(`${a.oF.PAYMENTS}_consume_purchase_started`,{id:e}),this._platformBridge.paymentsConsumePurchase(e).then((t=>(i.rh.send(`${a.oF.PAYMENTS}_consume_purchase_completed`,{id:e}),t))).catch((t=>{throw i.rh.send(`${a.oF.PAYMENTS}_consume_purchase_failed`,{id:e}),t}))):Promise.reject()}}function n(e,t){return e?e.map((e=>{const r={...e[t]??{}};return r.platformProductId=r.id??e.id,r.id=e.id,r})):[]}function d(e,t,r){if(!e)return null;const s=e.find((e=>e.id===r));if(!s)return null;const i={...s[t]??{}};return i.platformProductId=i.id??s.id,i.id=s.id,i}function l(e){return`${e}_${Date.now()}_${Math.random().toString(36).substring(2,10)}`}const h=new o},3806:(e,t,r)=>{r.d(t,{Dt:()=>i,Lb:()=>s,YU:()=>a});const s={VK:\"vk\",OK:\"ok\",YANDEX:\"yandex\",CRAZY_GAMES:\"crazy_games\",GAME_DISTRIBUTION:\"game_distribution\",PLAYGAMA:\"playgama\",STANDALONE:\"standalone\",TELEGRAM:\"telegram\",Y8:\"y8\",LAGGED:\"lagged\",FACEBOOK:\"facebook\",POKI:\"poki\",MOCK:\"mock\",QA_TOOL:\"qa_tool\",MSN:\"msn\",MICROSOFT_STORE:\"microsoft_store\",HUAWEI:\"huawei\",GAMEPUSH:\"gamepush\",DISCORD:\"discord\",JIO_GAMES:\"jio_games\",YOUTUBE:\"youtube\",PORTAL:\"portal\",REDDIT:\"reddit\",XIAOMI:\"xiaomi\",TIKTOK:\"tiktok\",DLIGHTEK:\"dlightek\",GAMESNACKS:\"gamesnacks\",SAMSUNG:\"samsung\"},i={GAME_READY:\"game_ready\",LEVEL_STARTED:\"level_started\",LEVEL_COMPLETED:\"level_completed\",LEVEL_FAILED:\"level_failed\",LEVEL_PAUSED:\"level_paused\",LEVEL_RESUMED:\"level_resumed\",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\"},a={VISIBLE:\"visible\",HIDDEN:\"hidden\"}},3941:(e,t,r)=>{r.d(t,{Z:()=>u,m:()=>h});var s=r(9778),i=r(8960),a=r(6873),o=r(9146);const n=\"bridge-player-guest-id\",d=\"bridge_player_guest_id\";let l=null;function h(){if(l)return{id:l,name:`Guest ${l}`};let e=a.Z.getItem(n)||a.Z.getItem(d);e||(e=(0,o.D)());try{a.Z.setItem(n,e)}catch{}return l=e,{id:e,name:`Guest ${e}`}}class c extends s.Z{get isAuthorizationSupported(){return this._platformBridge.isPlayerAuthorizationSupported}get isAuthorized(){return this._platformBridge.isPlayerAuthorized}get isGuest(){if(!this._platformBridge.isPlayerAuthorized)return!0;const e=this._platformBridge.playerId;return!e||e===h().id}get id(){return this._platformBridge.playerId}get name(){return this._platformBridge.playerName}get photos(){return this._platformBridge.playerPhotos}get extra(){return this._platformBridge.playerExtra}authorize(e){const t=(0,i.ju)(e,this._platformBridge.platformId);return this.isAuthorizationSupported?this._platformBridge.authorizePlayer(t):Promise.reject()}}const u=new c},9979:(e,t,r)=>{r.d(t,{Z:()=>p});var s=r(1558),i=r(9778),a=r(8902),o=r(6873);function n(e){return null==e||\"\"===e}function d(e,t){if(n(e))return null;if(!t||\"string\"!=typeof e)return e;try{return JSON.parse(e)}catch{return e}}function l(e){return null==e||\"string\"==typeof e?e:JSON.stringify(e)}const h=class{#nt=new Map;#dt=new Set;#lt=new Set;has(e){return this.#nt.has(e)}get(e){return this.#nt.get(e)}isDirty(e){return this.#dt.has(e)}isDeleted(e){return this.#lt.has(e)}dirtyKeys(){return[...this.#dt]}deletedKeys(){return[...this.#lt]}set(e,t){n(t)?this.delete(e):(this.#nt.set(e,t),this.#dt.delete(e),this.#lt.delete(e))}setDirty(e,t){n(t)?this.delete(e):(this.#nt.set(e,t),this.#dt.add(e),this.#lt.delete(e))}delete(e){this.#nt.delete(e),this.#dt.delete(e),this.#lt.delete(e)}tombstone(e){this.#nt.delete(e),this.#dt.delete(e),this.#lt.add(e)}keys(){return[...this.#nt.keys()]}clear(){this.#nt.clear(),this.#dt.clear(),this.#lt.clear()}};const c=class{#ht=Promise.resolve();enqueue(e){const t=this.#ht.then(e,e);return this.#ht=t.then((()=>{}),(()=>{})),t}};class u extends i.Z{#ct=new h;#ut=new c;initialize(e){return super.initialize(e),this._platformBridge.on(a.W1.PLATFORM_STORAGE_AVAILABILITY_CHANGED,(e=>{this.#ut.enqueue((()=>this.#pt(Boolean(e)))).catch((()=>{}))})),this}get(e,t=!0){const r=Array.isArray(e);if(r&&0===e.length)return Promise.resolve([]);const s=r?e:[e],i=this.#ut.enqueue((()=>this.#mt(s,t)));return r?i:i.then((e=>e[0]))}set(e,t){return s.ZP.emit(a.W1.STORAGE_SET),Array.isArray(e)?Array.isArray(t)?e.length!==t.length?Promise.reject(new Error(\"Key and value arrays must have the same length\")):0===e.length?Promise.resolve():this.#ut.enqueue((()=>this.#_t(this.#gt(e,t)))):Promise.reject(new Error(\"Value must be an array when key is an array\")):this.#ut.enqueue((()=>this.#_t(this.#gt([e],[t]))))}delete(e){const t=Array.isArray(e)?e:[e];return 0===t.length?Promise.resolve():this.#ut.enqueue((()=>this.#St(t)))}#gt(e,t){const r={sets:[],deletes:[]};return e.forEach(((e,s)=>{n(t[s])?r.deletes.push(e):r.sets.push({key:e,value:l(t[s])})})),r}async#mt(e,t){if(e.every((e=>this.#ct.has(e))))return e.map((e=>d(this.#ct.get(e),t)));if(!this.#At())return this.#Et(e,t);try{const t=e.filter((e=>!this.#ct.has(e)&&!this.#ct.isDeleted(e)));if(t.length>0){const e=await this._platformBridge.getDataFromStorage(t);Object.keys(e).forEach((t=>{this.#ct.isDirty(t)||this.#ct.isDeleted(t)||this.#ct.set(t,e[t])}))}}catch{return this.#Et(e,t)}return(await this.#ft(e)).map((e=>d(e,t)))}async#ft(e){const t=[],r=[],s=e.map((e=>{if(this.#ct.has(e))return this.#ct.isDirty(e)?r.push({key:e,value:this.#ct.get(e)}):t.push(e),this.#ct.get(e);if(this.#ct.isDeleted(e))return null;const s=this.#Pt(e);return n(s)?null:(r.push({key:e,value:s}),s)}));return this.#It(t),r.length>0&&await this.#yt(r),s}async#yt(e){try{await this._platformBridge.setDataToStorage(this.#Dt(e)),e.forEach((e=>this.#ct.set(e.key,e.value))),this.#It(e.map((e=>e.key)))}catch{}}async#_t(e){if(this.#At())try{return e.sets.length>0&&await this._platformBridge.setDataToStorage(this.#Dt(e.sets)),e.deletes.length>0&&await this._platformBridge.deleteDataFromStorage(e.deletes),this.#Tt(e,!1),void this.#It([...e.sets.map((e=>e.key)),...e.deletes])}catch{}this.#wt(e)}#wt(e){if(!o.Z.isAvailable)throw new a.Hd(a.Bq.STORAGE_NOT_SUPPORTED);try{e.sets.forEach((e=>o.Z.setItem(e.key,e.value))),e.deletes.forEach((e=>o.Z.removeItem(e)))}catch(e){if(e&&\"QuotaExceededError\"===e.name)throw new a.Hd(a.Bq.STORAGE_QUOTA_EXCEEDED);throw e}this.#Tt(e,!0),this._platformBridge.notifyLocalDataChanged?.(e)}async#St(e){if(this.#It(e),this.#At())try{return await this._platformBridge.deleteDataFromStorage(e),void e.forEach((e=>this.#ct.delete(e)))}catch{}e.forEach((e=>this.#ct.tombstone(e))),this._platformBridge.notifyLocalDataChanged?.({sets:[],deletes:e})}async#pt(e){if(e&&this.#At()){const e=this.#ct.dirtyKeys(),t=this.#ct.deletedKeys();try{if(e.length>0){const t=e.map((e=>({key:e,value:this.#ct.get(e)})));await this._platformBridge.setDataToStorage(this.#Dt(t))}t.length>0&&await this._platformBridge.deleteDataFromStorage(t),this.#It([...this.#ct.keys(),...t]),this.#ct.clear()}catch{}}else o.Z.isAvailable&&this.#ct.keys().forEach((e=>{try{o.Z.setItem(e,l(this.#ct.get(e)))}catch{}}))}#Et(e,t){if(!o.Z.isAvailable)throw new a.Hd(a.Bq.STORAGE_NOT_SUPPORTED);return e.map((e=>{if(this.#ct.has(e))return d(this.#ct.get(e),t);if(this.#ct.isDeleted(e))return null;const r=o.Z.getItem(e);return this.#ct.setDirty(e,r),d(r,t)}))}#Pt(e){return o.Z.isAvailable?o.Z.getItem(e):null}#It(e){o.Z.isAvailable&&e.forEach((e=>o.Z.removeItem(e)))}#Tt(e,t){e.sets.forEach((e=>{t?this.#ct.setDirty(e.key,e.value):this.#ct.set(e.key,e.value)})),e.deletes.forEach((e=>{t?this.#ct.tombstone(e):this.#ct.delete(e)}))}#Dt(e){const t={};return e.forEach((e=>{t[e.key]=e.value})),t}#At(){return this._platformBridge.isPlatformStorageAvailable}}const p=new u},9163:(e,t,r)=>{r.r(t),r.d(t,{default:()=>u});var s=r(8166),i=r(8960),a=r(8467),o=r(8902),n=r(3806),d=r(66),l=r(9221);const h=\"https://store.xsolla.com/api/v2/project\";class c extends s.Z{get platformId(){return n.Lb.CRAZY_GAMES}get platformLanguage(){return this.#vt?this._platformSdk.user.systemInfo.countryCode.toLowerCase():super.platformLanguage}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlayerAuthorizationSupported(){return this.#vt}get isPaymentsSupported(){return!!this.options.xsollaProjectId}get deviceType(){if(this.#vt){const e=this._platformSdk.user.systemInfo.device.type.toLowerCase();if([d.me.DESKTOP,d.me.MOBILE,d.me.TABLET].includes(e))return e}return super.deviceType}#Rt=!1;#vt=!1;#bt={adStarted:()=>{this.#Rt?this._setRewardedState(l.b3.OPENED):this._setInterstitialState(l.WA.OPENED)},adFinished:()=>{this.#Rt?(this._setRewardedState(l.b3.REWARDED),this._setRewardedState(l.b3.CLOSED)):this._setInterstitialState(l.WA.CLOSED)},adError:()=>{this._showAdFailurePopup(this.#Rt)}};initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(o.Mn.INITIALIZE),(0,i.ZT)(\"https://sdk.crazygames.com/crazygames-sdk-v3.js\").then((()=>{(0,i.X_)(\"CrazyGames\",\"SDK\",\"init\").then((()=>{this._platformSdk=window.CrazyGames.SDK,this._setPlatformStorageAvailable(!0),this._isBannerSupported=!0,this._isAdvancedBannersSupported=!0,this._platformSdk.init().then((()=>{this.#vt=this._platformSdk.user.isUserAccountAvailable;const e=this.#Ct();this._platformSdk.game.addSettingsChangeListener((e=>{this._setAudioState(!e.muteAudio)})),this._setAudioState(!this._platformSdk.game.settings.muteAudio),this.options.xsollaProjectId&&this.#Lt(),Promise.all([e]).finally((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(o.Mn.INITIALIZE)}))}))}))}))),e.promise}authorizePlayer(){if(!this.#vt)return Promise.reject();if(this._isPlayerAuthorized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.AUTHORIZE_PLAYER);return e||(e=this._createPromiseDecorator(o.Mn.AUTHORIZE_PLAYER),this._platformSdk.user.showAuthPrompt().then((()=>{this.#Ct().then((()=>{this._resolvePromiseDecorator(o.Mn.AUTHORIZE_PLAYER)}))})).catch((e=>{this._rejectPromiseDecorator(o.Mn.AUTHORIZE_PLAYER,e)}))),e.promise}sendMessage(e){const t=this._platformSdk;switch(e){case n.Dt.IN_GAME_LOADING_STARTED:return t.game.loadingStart(),Promise.resolve();case n.Dt.IN_GAME_LOADING_STOPPED:return t.game.loadingStop(),Promise.resolve();case n.Dt.GAMEPLAY_STARTED:case n.Dt.LEVEL_STARTED:case n.Dt.LEVEL_RESUMED:return t.game.gameplayStart(),Promise.resolve();case n.Dt.GAMEPLAY_STOPPED:case n.Dt.LEVEL_PAUSED:case n.Dt.LEVEL_COMPLETED:case n.Dt.LEVEL_FAILED:return t.game.gameplayStop(),Promise.resolve();case n.Dt.PLAYER_GOT_ACHIEVEMENT:return t.game.happytime(),Promise.resolve();default:return super.sendMessage(e)}}getDataFromStorage(e){const{data:t}=this._platformSdk,r={};return e.forEach((e=>{const s=t.getItem(e);null!=s&&\"\"!==s&&(r[e]=s)})),Promise.resolve(r)}setDataToStorage(e){const t=this._platformSdk;return Object.keys(e).forEach((r=>t.data.setItem(r,e[r]))),Promise.resolve()}deleteDataFromStorage(e){const t=this._platformSdk;return e.forEach((e=>t.data.removeItem(e))),Promise.resolve()}showBanner(e){let t=document.getElementById(l._g);t||(t=(0,a.kM)(e)),t.style.display=\"block\",this._platformSdk.banner.requestResponsiveBanner([l._g]).then((()=>{this._setBannerState(l.Kk.SHOWN)})).catch((()=>{this._setBannerState(l.Kk.FAILED),t.style.display=\"none\"}))}hideBanner(){const e=document.getElementById(l._g);e&&(e.style.display=\"none\"),this._platformSdk.banner.clearAllBanners(),this._setBannerState(l.Kk.HIDDEN)}showAdvancedBanners(e){this._setAdvancedBannersState(l.Kk.LOADING),(0,a.XA)();const t=(0,a.f_)(e),r=this._platformSdk,s=t.map((e=>r.banner.requestResponsiveBanner(e)));Promise.all(s).then((()=>{this._setAdvancedBannersState(l.Kk.SHOWN)})).catch((()=>{this._setAdvancedBannersState(l.Kk.FAILED),(0,a.XA)()}))}hideAdvancedBanners(){(0,a.XA)(),this._platformSdk.banner.clearAllBanners(),this._setAdvancedBannersState(l.Kk.HIDDEN)}showInterstitial(){this.#Rt=!1,this._platformSdk.ad.requestAd(\"midgame\",this.#bt)}showRewarded(){this.#Rt=!0,this._platformSdk.ad.requestAd(\"rewarded\",this.#bt)}checkAdBlock(){return new Promise((e=>{this._platformSdk.ad.hasAdblock().then((t=>{e(t)}))}))}paymentsPurchase(e){let t=this._paymentsGetProductPlatformData(e);t||(t={id:e});const r=t.platformProductId||t.id;let s=this._getPromiseDecorator(o.Mn.PURCHASE);return s||(s=this._createPromiseDecorator(o.Mn.PURCHASE),this.#Lt().then((()=>this.#Ot())).then((async e=>{const s=await fetch(`${h}/${this.options.xsollaProjectId}/payment/item/${r}`,{method:\"POST\",headers:{Authorization:`Bearer ${e}`,\"Content-Type\":\"application/json\"}});if(!s.ok)throw new Error(`Xsolla create order HTTP ${s.status}`);const i=await s.json(),a=i.token,n=i.order_id,d=window.XPayStationWidget;if(!d)throw new Error(\"Xsolla Pay Station widget not loaded\");d.init({access_token:a,sandbox:this.options.isSandbox||!1,childWindow:{target:\"_blank\"}});let l,c=!1;const u=()=>{document.removeEventListener(\"visibilitychange\",l)};l=()=>{\"visible\"!==document.visibilityState||c||setTimeout((()=>{c||(c=!0,u(),this._rejectPromiseDecorator(o.Mn.PURCHASE,new Error(\"Purchase canceled/closed\")))}),1500)},d.on(d.eventTypes.STATUS,((s,i)=>{try{const s=i&&i.paymentInfo||{};s.status&&/done|charged|success/i.test(String(s.status))&&this.#Mt(this.options.xsollaProjectId,n,e).then((e=>{this._platformSdk.analytics.trackOrder(\"xsolla\",e);const s={id:t.id,sku:r,orderId:n,...e};this._paymentsPurchases.push(s),c||(c=!0,u(),this._resolvePromiseDecorator(o.Mn.PURCHASE,s))})).catch((e=>{c||(c=!0,u(),this._rejectPromiseDecorator(o.Mn.PURCHASE,e))}))}catch(e){c||(c=!0,u(),this._rejectPromiseDecorator(o.Mn.PURCHASE,e))}})),d.on(\"close\",(()=>{c||(c=!0,u(),this._rejectPromiseDecorator(o.Mn.PURCHASE,new Error(\"Purchase canceled/closed\")))})),d.open(),document.addEventListener(\"visibilitychange\",l)})).catch((e=>{this._rejectPromiseDecorator(o.Mn.PURCHASE,e)}))),s.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject(new Error(\"No platform products available\"));let t=this._getPromiseDecorator(o.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(o.Mn.GET_CATALOG),this.#Ot().then((e=>fetch(`${h}/${this.options.xsollaProjectId}/items?limit=50`,{headers:{Authorization:`Bearer ${e}`}}))).then((e=>{if(!e.ok)throw new Error(`Xsolla catalog HTTP ${e.status}`);return e.json()})).then((t=>{const r=t.items||[],s=new Map(r.map((e=>[e.sku,e]))),i=e.map((e=>{const t=s.get(e.platformProductId),r=t?.price;return{id:e.id,name:t?.name??e.name??e.id,description:t?.description??e.description??\"\",price:r?.amount??null,priceCurrencyCode:r?.currency??null,priceValue:r?.amount??null}}));this._resolvePromiseDecorator(o.Mn.GET_CATALOG,i)})).catch((e=>{this._rejectPromiseDecorator(o.Mn.GET_CATALOG,e)}))),t.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject(new Error(\"No such purchase to consume\"));let r=this._getPromiseDecorator(o.Mn.CONSUME_PURCHASE);if(!r){r=this._createPromiseDecorator(o.Mn.CONSUME_PURCHASE);const s=this._paymentsPurchases[t],i=s.sku||s.id;this.#Ot().then((e=>fetch(`${h}/${this.options.xsollaProjectId}/user/inventory/item/consume`,{method:\"POST\",headers:{Authorization:`Bearer ${e}`,\"Content-Type\":\"application/json\"},body:JSON.stringify({sku:i,quantity:1})}))).then((r=>{if(!r.ok)throw new Error(`Xsolla consume HTTP ${r.status}`);this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(o.Mn.CONSUME_PURCHASE,{id:e})})).catch((e=>{this._rejectPromiseDecorator(o.Mn.CONSUME_PURCHASE,e)}))}return r.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(o.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(o.Mn.GET_PURCHASES),this.#Ot().then((e=>fetch(`${h}/${this.options.xsollaProjectId}/user/inventory/items`,{headers:{Authorization:`Bearer ${e}`}}))).then((e=>{if(!e.ok)throw new Error(`Xsolla inventory HTTP ${e.status}`);return e.json()})).then((e=>{const t=this._paymentsGetProductsPlatformData()||[];this._paymentsPurchases=(e.items||[]).map((e=>{const r=t.find((t=>t.id===e.sku));if(!r)return null;return{id:r.id,...e}})).filter((e=>null!==e)),this._resolvePromiseDecorator(o.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((e=>{this._rejectPromiseDecorator(o.Mn.GET_PURCHASES,e)}))),e.promise}#Ct(){return this.#vt?new Promise(((e,t)=>{this._platformSdk.user.getUser().then((r=>{r?(this._isPlayerAuthorized=!0,r.username&&(this._playerName=r.username),r.profilePictureUrl&&(this._playerPhotos=[r.profilePictureUrl]),this._playerExtra=r,this._options.useUserToken?this._platformSdk.user.getUserToken().then((e=>{this._playerExtra.jwt=e})).finally((()=>{e()})):e()):t()})).catch((e=>{t(e)}))})):Promise.reject()}async#Lt(){window.XPayStationWidget||await(0,i.ZT)(\"https://cdn.xsolla.net/payments-bucket-prod/embed/1.5.0/widget.min.js\")}async#Ot(){return await this._platformSdk.user.getXsollaUserToken()}async#Mt(e,t,r){const s=await fetch(`${h}/${e}/order/${t}`,{headers:{Authorization:`Bearer ${r}`}});if(!s.ok)throw new Error(`Xsolla order HTTP ${s.status}`);return s.json()}}const u=c},1634:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(8166),i=r(8960),a=r(8902),o=r(3806);const n=\"https://discord.com/api/v10\";class d extends s.Z{get platformId(){return o.Lb.DISCORD}get isPlayerAuthorizationSupported(){return!0}get isPaymentsSupported(){return!0}get isInviteFriendsSupported(){return!0}get isShareSupported(){return!0}_appId=null;_accessToken=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options?.appId?(this._appId=this._options.appId,(0,i.ZT)(\"/cdn/discord/discord-v2.0.0.min.js\").then((()=>{(0,i.X_)(\"discord\",\"DiscordSDK\").then((()=>(this._platformSdk=new window.discord.DiscordSDK(this._appId),this._platformSdk.ready()))).then((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.DISCORD_GAME_PARAMS_NOT_FOUND)),e.promise}authorizePlayer(e){const t=e,r=t?.scope||[\"identify\"];let s=this._getPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);if(!s){s=this._createPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);const e=this._platformSdk;e.commands.authorize({client_id:this._appId,response_type:\"code\",state:\"\",prompt:\"none\",scope:r}).then((({code:e})=>fetch(\"/api/discord/auth-token\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({code:e,appId:this._appId})}))).then((e=>e.json())).then((t=>(this._accessToken=t.accessToken,this._playerExtra={token:t.token,accessToken:this._accessToken,channelId:e.channelId},e.commands.authenticate({access_token:this._accessToken})))).then((e=>{if(null===e)throw new Error(\"Authorization failed\");return fetch(`${n}/users/@me`,{method:\"GET\",headers:{Authorization:`Bearer ${this._accessToken}`,\"Content-Type\":\"application/json\"}})})).then((e=>e.json())).then((e=>{this._playerId=e.id,this._playerName=e.username,e.avatar&&this._playerPhotos.push(`https://cdn.discordapp.com/avatars/${e.id}/${e.avatar}.png`),this._playerExtra={...this._playerExtra,...e},this._isPlayerAuthorized=!0,this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)})).catch((e=>{this._accessToken=null,this._rejectPromiseDecorator(a.Mn.AUTHORIZE_PLAYER,e)}))}return s.promise}paymentsPurchase(e){const t=this._paymentsGetProductPlatformData(e);if(!t)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.PURCHASE);return r||(r=this._createPromiseDecorator(a.Mn.PURCHASE),this._platformSdk.commands.startPurchase({sku_id:t.platformProductId}).then((t=>{if(!t)throw new Error(\"Purchase failed\");const r={id:e,...t};this._paymentsPurchases.push(r),this._resolvePromiseDecorator(a.Mn.PURCHASE,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.PURCHASE,e)}))),r.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.CONSUME_PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE);const s=this._paymentsPurchases[t].purchaseToken;fetch(`${n}/applications/${this._appId}/entitlements/${s}/consume`,{method:\"POST\",headers:{Authorization:`Bearer ${this._accessToken}`,\"Content-Type\":\"application/json\"},body:JSON.stringify({})}).then((()=>{this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,{id:e})})).catch((e=>{this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,e)}))}return r.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(a.Mn.GET_CATALOG),this._platformSdk.commands.getSkus().then((({skus:t})=>{const r=e.map((e=>{const r=t.find((t=>t.id===e.platformProductId)),s=window.discord.PriceUtils.formatPrice(r.price),a=(0,i.ZP)(s),o=r.price?.currency?.toUpperCase(),n=`${a} ${o}`;return{id:e.id,title:r.name,price:n,priceValue:a,priceCurrencyCode:o}}));this._resolvePromiseDecorator(a.Mn.GET_CATALOG,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_CATALOG,e)}))),t.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(a.Mn.GET_PURCHASES),this._platformSdk.commands.getEntitlements().then((e=>{const t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.entitlements.map((e=>{const r={id:t.find((t=>t.id===e.id)).id};return Object.assign(r,e),r})),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,e)}))),e.promise}inviteFriends(){let e=this._getPromiseDecorator(a.Mn.INVITE_FRIENDS);return e||(e=this._createPromiseDecorator(a.Mn.INVITE_FRIENDS),this._platformSdk.commands.openInviteDialog().then((()=>{this._resolvePromiseDecorator(a.Mn.INVITE_FRIENDS)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.INVITE_FRIENDS,e)}))),e.promise}share(e){const{image:t,url:r,...s}=e??{},o=t&&!(0,i.dY)(t)?t:r;if(!o)return Promise.reject();let n=this._getPromiseDecorator(a.Mn.SHARE);return n||(n=this._createPromiseDecorator(a.Mn.SHARE),this._platformSdk.commands.openShareMomentDialog({...s,mediaUrl:o}).then((()=>{this._resolvePromiseDecorator(a.Mn.SHARE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.SHARE,e)}))),n.promise}}const l=d},7430:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(1302),a=r(8902),o=r(3806),n=r(9221),d=r(8960),l=r(8467);class h extends s.Z{get platformId(){return o.Lb.DLIGHTEK}get isBannerSupported(){return!0}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}_bannerContainer=null;_bannerPlacement=null;#Nt=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options?.appKey&&this._options?.adSenseId?(0,d.ZT)(\"https://www.hippoobox.com/static/sdk/adsdk_1.9.5.js\").then((()=>{if(!window.h5sdk)throw new Error(\"Dlightek SDK not found\");this._platformSdk=window.h5sdk;const e=this._platformSdk;this.#Nt=setTimeout((()=>{this._isInitialized||this.#kt()}),5e3);const t={client:this._options.adSenseId,\"data-ad-frequency-hint\":\"45s\",callback:()=>{e.adConfig({preloadAdBreaks:\"on\",sound:\"on\",onReady:()=>{this._isInitialized||(this.#Nt&&clearTimeout(this.#Nt),this.#kt())}})}};this._options.adChannel&&(t[\"data-ad-channel\"]=this._options.adChannel),this._options.testMode&&(t[\"data-adbreak-test\"]=\"on\"),e.init(this._options.appKey,\"\",\"\",\"\",\"\",{adsense:t})})).catch((()=>{this.#kt()})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)),e.promise}sendMessage(e,t){return e===o.Dt.GAME_READY?new Promise((e=>{try{const e=this._platformSdk;e&&e.gameLoadingCompleted&&e.gameLoadingCompleted()}catch(e){i.ZP.error(\"Dlightek error:\",e)}e(void 0)})):super.sendMessage(e)}showInterstitial(e){this._platformSdk?this._platformSdk.adBreak({type:\"start\",name:e,beforeAd:()=>{this._setInterstitialState(n.WA.OPENED)},afterAd:()=>{this._setInterstitialState(n.WA.CLOSED)},adBreakDone:e=>{\"viewed\"!==e.breakStatus&&this._showAdFailurePopup(!1)}}):this._showAdFailurePopup(!1)}showRewarded(e){this._platformSdk?this._platformSdk.adBreak({type:\"reward\",name:e,beforeAd:()=>{this._setRewardedState(n.b3.OPENED)},afterAd:()=>{this._setRewardedState(n.b3.CLOSED)},beforeReward:e=>{e(0)},adDismissed:()=>{},adViewed:()=>{this._setRewardedState(n.b3.REWARDED)},adBreakDone:e=>{\"frequencyCapped\"!==e.breakStatus&&\"other\"!==e.breakStatus||this._showAdFailurePopup(!0)}}):this._showAdFailurePopup(!0)}showBanner(e,t){if(this._bannerContainer)return;this._bannerPlacement=t,this._bannerContainer=(0,l.kM)(e);const r=this.#Ht(t);this._bannerContainer.appendChild(r),this._setBannerState(n.Kk.SHOWN)}hideBanner(){this._bannerContainer?.remove(),this._bannerContainer=null,this._setBannerState(n.Kk.HIDDEN)}#kt(){this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}#Ht(e){const t=document.createElement(\"ins\");return t.style.display=\"block\",t.classList.add(\"adsbygoogle\"),t.setAttribute(\"data-ad-client\",this._options.adSenseId),t.setAttribute(\"data-ad-slot\",String(e??\"\")),t.setAttribute(\"data-ad-format\",\"auto\"),t.setAttribute(\"data-container-id\",n._g),t.setAttribute(\"data-full-width-responsive\",\"true\"),this._options.testMode&&t.setAttribute(\"data-adtest\",\"on\"),t}}const c=h},2769:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(66),d=r(9221),l=r(7408);class h extends s.Z{get platformId(){return o.Lb.FACEBOOK}get platformLanguage(){return this._platformLanguage||super.platformLanguage}get isPlatformExternalCallsSupported(){return!1}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get deviceType(){switch(this._platformSdk&&this._platformSdk.getPlatform()){case\"IOS\":case\"ANDROID\":case\"MOBILE_WEB\":return n.me.MOBILE;case\"WEB\":return n.me.DESKTOP;default:return super.deviceType}}get isPlayerAuthorizationSupported(){return!0}get isBannerSupported(){return!0}get leaderboardsType(){return l.Z.NATIVE_POPUP}get isPaymentsSupported(){return!0}get isInviteFriendsSupported(){return this._supportedApis.includes(\"inviteAsync\")}get isJoinCommunitySupported(){return this._isJoinCommunitySupported}get isShareSupported(){return this._supportedApis.includes(\"shareAsync\")}_platformLanguage=null;_contextId=null;_supportedApis=[];_preloadedInterstitialPromises={};_preloadedRewardedPromises={};_isPlatformStorageAvailable=!0;_isJoinCommunitySupported=!1;_overlay=null;#Bt=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"https://connect.facebook.net/en_US/fbinstant.8.0.js\").then((()=>(0,i.X_)(\"FBInstant\"))).then((()=>(this._platformSdk=window.FBInstant,this._platformSdk.initializeAsync()))).then((()=>{const e=this._platformSdk;this._isPlayerAuthorized=!0,this._playerId=e.player.getID(),this._contextId=e.context.getID();let t=e.getLocale();return\"string\"==typeof t&&(t=t.substring(0,2).toLowerCase()),this._platformLanguage=t,this._supportedApis=e.getSupportedAPIs(),this.#Gt(),Promise.allSettled([e.community.canFollowOfficialPageAsync(),e.community.canJoinOfficialGroupAsync()]).then((([e,t])=>{const r=\"fulfilled\"===e.status&&e.value,s=\"fulfilled\"===t.status&&t.value;this._isJoinCommunitySupported=!0===r&&!0===s}))})).then((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)})).catch((e=>this._rejectPromiseDecorator(a.Mn.INITIALIZE,e)))),e.promise}sendMessage(e,t){if(e===o.Dt.GAME_READY){const e=this._platformSdk;return e.setLoadingProgress(100),this._options.subscribeForNotificationsOnStart&&setTimeout((()=>this.#Ft()),0),new Promise((t=>{e.startGameAsync().then(t)}))}return super.sendMessage(e,t)}authorizePlayer(e){return Promise.resolve()}async getDataFromStorage(e){await this.#xt();const t=await this._platformSdk.player.getDataAsync(e),r={};return e.forEach((e=>{const s=t[e];null!=s&&\"\"!==s&&(r[e]=\"string\"==typeof s?s:JSON.stringify(s))})),r}async setDataToStorage(e){return await this.#xt(),this._platformSdk.player.setDataAsync(e).then((()=>{}))}async deleteDataFromStorage(e){await this.#xt();const t={};return e.forEach((e=>{t[e]=null})),this._platformSdk.player.setDataAsync(t).then((()=>{}))}showBanner(e,t){this._platformSdk.loadBannerAdAsync(t,e).then((()=>{this._setBannerState(d.Kk.SHOWN)})).catch((()=>{this._setBannerState(d.Kk.FAILED)}))}hideBanner(){this._platformSdk.hideBannerAdAsync().then((()=>{this._setBannerState(d.Kk.HIDDEN)})).catch((()=>{this._setBannerState(d.Kk.FAILED)}))}preloadInterstitial(e){this.#Ut(e)}showInterstitial(e){this.#Ut(e).then((e=>(this._setInterstitialState(d.WA.OPENED),e.showAsync()))).then((()=>{this._setInterstitialState(d.WA.CLOSED),this.#Ut(e,!0)})).catch((()=>this._advertisementShowErrorPopup(!1)))}preloadRewarded(e){this.#Vt(e)}showRewarded(e){this.#Vt(e).then((e=>(this._setRewardedState(d.b3.OPENED),e.showAsync()))).then((()=>{this._setRewardedState(d.b3.REWARDED),this._setRewardedState(d.b3.CLOSED),this.#Vt(e,!0)})).catch((()=>this._advertisementShowErrorPopup(!0)))}leaderboardsSetScore(e,t){let r=this._getPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);if(!r){r=this._createPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);const s=\"number\"==typeof t?t:parseInt(t,10);this._platformSdk.globalLeaderboards.setScoreAsync(e,s).then((()=>{this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE,e)}))}return r.promise}leaderboardsShowNativePopup(e){let t=this._getPromiseDecorator(a.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP);if(!t){t=this._createPromiseDecorator(a.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP);const r=function(){const e=document.createElement(\"div\");e.style.position=\"fixed\",e.style.top=\"0\",e.style.left=\"0\",e.style.width=\"100vw\",e.style.height=\"100vh\",e.style.backgroundColor=\"rgba(0, 0, 0, 0.5)\",e.style.display=\"flex\",e.style.justifyContent=\"center\",e.style.alignItems=\"center\",e.style.zIndex=\"9999\",e.id=\"loading-overlay\";const t=document.createElement(\"div\");return t.style.fontSize=\"24px\",t.style.color=\"#fff\",t.innerText=\"Loading...\",e.appendChild(t),e}();document.body.appendChild(r);const s=this._platformSdk;s.globalLeaderboards.getTopEntriesAsync(e,20).then((e=>{const t=e.map((e=>({score:e.getScore(),sessionID:e.getPlayer().getSessionID()}))),i=s.overlayViews.createOverlayViewWithXMLString('\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n',\"\",{players:t},(e=>{e.showAsync(),this._overlay=e,r.remove(),this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP)}),((e,t)=>{r.remove(),this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP,t)})),{iframeElement:o}=i;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((e=>{r.remove(),this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP,e)}))}return t.promise}paymentsPurchase(e){let t=this._paymentsGetProductPlatformData(e);t||(t={id:e});let r=this._getPromiseDecorator(a.Mn.PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.PURCHASE);const s=t.platformProductId?t.platformProductId:t.id;this._platformSdk.payments.purchaseAsync({productID:s.toLowerCase()}).then((t=>{const r={id:e,...t};delete r.productID,this._paymentsPurchases.push(r),this._resolvePromiseDecorator(a.Mn.PURCHASE,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.PURCHASE,e)}))}return r.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.CONSUME_PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE);const s=this._paymentsPurchases[t].purchaseToken;this._platformSdk.payments.consumePurchaseAsync(s).then((()=>{this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,{id:e})})).catch((e=>{this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,e)}))}return r.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(a.Mn.GET_CATALOG),this._platformSdk.payments.getCatalogAsync().then((t=>{const r=e.map((e=>{const r=t.find((t=>t.productID===e.platformProductId));return{id:e.id,title:r.title,description:r.description,imageURI:r.imageURI,price:r.price,priceCurrencyCode:r.priceCurrencyCode,priceValue:r.priceAmount}}));this._resolvePromiseDecorator(a.Mn.GET_CATALOG,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_CATALOG,e)}))),t.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(a.Mn.GET_PURCHASES),this._platformSdk.payments.getPurchasesAsync().then((e=>{const t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.map((e=>{const r={id:t.find((t=>t.id===e.productID)).id,...e};return delete r.productID,r})),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,e)}))),e.promise}inviteFriends(e){const t=e??{};if(!t.image||!t.text)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.INVITE_FRIENDS);return r||(r=this._createPromiseDecorator(a.Mn.INVITE_FRIENDS),(0,i.kh)(t.image).then((e=>this._platformSdk.inviteAsync({...t,image:e}))).then((()=>{this._resolvePromiseDecorator(a.Mn.INVITE_FRIENDS)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.INVITE_FRIENDS,e)}))),r.promise}joinCommunity(e){let t=this._getPromiseDecorator(a.Mn.JOIN_COMMUNITY);if(!t){t=this._createPromiseDecorator(a.Mn.JOIN_COMMUNITY);const r=e,s=this._platformSdk;r&&!0===r.isPage?s.community.followOfficialPageAsync().then((e=>this._resolvePromiseDecorator(a.Mn.JOIN_COMMUNITY,e))).catch((e=>this._rejectPromiseDecorator(a.Mn.JOIN_COMMUNITY,e))):s.community.joinOfficialGroupAsync().then((e=>this._resolvePromiseDecorator(a.Mn.JOIN_COMMUNITY,e))).catch((e=>this._rejectPromiseDecorator(a.Mn.JOIN_COMMUNITY,e)))}return t.promise}share(e){const t=e??{};if(!t.image||!t.text)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.SHARE);return r||(r=this._createPromiseDecorator(a.Mn.SHARE),(0,i.kh)(t.image).then((e=>this._platformSdk.shareAsync({intent:\"REQUEST\",...t,image:e}))).then((()=>{this._resolvePromiseDecorator(a.Mn.SHARE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.SHARE,e)}))),r.promise}#Gt(){const e=this;e._platformSdk.overlayViews.setCustomEventHandler((t=>{if(\"leaderboard\"===t)e.#Bt=!0;else if(\"close\"===t){if(e.#Bt)return void(e.#Bt=!1);if(e._overlay){const t=e._overlay.iframeElement.id,r=document.getElementById(t);r&&document.body.removeChild(r),e._overlay.dismissAsync(),e._overlay=null}}}))}#Ut(e,t=!1){if(!t&&this._preloadedInterstitialPromises[e])return this._preloadedInterstitialPromises[e];let r=null;const s=this._platformSdk.getInterstitialAdAsync(e).then((e=>(r=e,e.loadAsync()))).then((()=>r)).catch((()=>(this._preloadedInterstitialPromises[e]=null,Promise.reject())));return this._preloadedInterstitialPromises[e]=s,s}#Vt(e,t=!1){if(!t&&this._preloadedRewardedPromises[e])return this._preloadedRewardedPromises[e];let r=null;const s=this._platformSdk.getRewardedVideoAsync(e).then((e=>(r=e,e.loadAsync()))).then((()=>r)).catch((()=>(this._preloadedRewardedPromises[e]=null,Promise.reject())));return this._preloadedRewardedPromises[e]=s,s}async#Ft(){const e=this._platformSdk;try{if(await e.player.isSubscribedBotAsync())return Promise.resolve()}catch(e){if(\"INVALID_OPERATION\"!==e?.code)throw new Error(e)}let t=!1;try{if(t=await e.player.canSubscribeBotAsync(),t)return e.player.subscribeBotAsync()}catch(e){if(\"INVALID_OPERATION\"===e?.code)return Promise.resolve();throw new Error(e)}return Promise.resolve()}#xt(){return this._isPlayerAuthorized?Promise.resolve():Promise.reject()}}const c=h},3777:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var s=r(8166),i=r(8960),a=r(8467),o=r(8902),n=r(3806),d=r(9221);class l extends s.Z{get platformId(){return n.Lb.GAME_DISTRIBUTION}get isPlatformExternalCallsSupported(){return!1}get isInterstitialSupported(){return!0}get isMinimumDelayBetweenInterstitialEnabled(){return!1}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}#Rt=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);if(!e)if(e=this._createPromiseDecorator(o.Mn.INITIALIZE),this._options&&\"string\"==typeof this._options.gameId){const e=this;window.GD_OPTIONS={gameId:this._options.gameId,onEvent(t){switch(t.name){case\"SDK_READY\":e._platformSdk=window.gdsdk,e._isInitialized=!0,e.showInterstitial(),e._resolvePromiseDecorator(o.Mn.INITIALIZE);break;case\"SDK_GAME_START\":e.#Rt?(e._setRewardedState(d.b3.CLOSED),e._platformSdk.preloadAd(\"rewarded\")):e._setInterstitialState(d.WA.CLOSED);break;case\"SDK_GAME_PAUSE\":e.#Rt?e._setRewardedState(d.b3.OPENED):e._setInterstitialState(d.WA.OPENED);break;case\"SDK_REWARDED_WATCH_COMPLETE\":e._setRewardedState(d.b3.REWARDED)}}},this._setPlatformStorageAvailable(!1),this._isBannerSupported=!0,(0,i.ZT)(\"https://html5.api.gamedistribution.com/main.min.js\")}else this._rejectPromiseDecorator(o.Mn.INITIALIZE,o.pn.GAME_PARAMS_NOT_FOUND);return e.promise}showBanner(e,t){let r=document.getElementById(d._g);r||(r=(0,a.kM)(e)),r.style.display=\"block\",this._platformSdk.showAd(\"display\",{containerId:d._g}).then((()=>{this._setBannerState(d.Kk.SHOWN)})).catch((()=>{this._setBannerState(d.Kk.FAILED),r&&(r.style.display=\"none\")}))}hideBanner(){const e=document.getElementById(d._g);e&&(e.style.display=\"none\"),this._setBannerState(d.Kk.HIDDEN)}showInterstitial(){this.#Rt=!1,this._platformSdk?this._platformSdk.showAd().catch((()=>{this._showAdFailurePopup(!1)})):this._showAdFailurePopup(!1)}preloadRewarded(){this._platformSdk.preloadAd(\"rewarded\")}showRewarded(){this.#Rt=!0,this._platformSdk?this._platformSdk.showAd(\"rewarded\").catch((()=>{this._showAdFailurePopup(!0)})):this._showAdFailurePopup(!0)}}const h=l},4499:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221);class d extends s.Z{get platformId(){return o.Lb.GAMEPUSH}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}_isBannerSupported=!0;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);if(!e)if(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options&&this._options.projectId&&this._options.publicToken){const e=`https://gamepush.com/sdk/game-score.js?projectId=${this._options.projectId}&publicToken=${this._options.publicToken}`;(0,i.ZT)(e).then((()=>{(0,i.X_)(\"GamePush\").then((()=>{this._platformSdk=window.GamePush;const e=this._platformSdk?.player;if(e){const{id:t=null,name:r=\"\",avatar:s=\"\"}=e;this._isPlayerAuthorized=!0,this._playerId=t??null,this._playerName=r,s&&this._playerPhotos.push(s)}this._isInitialized=!0,this.#Zt(),this.#jt(),this.#zt(),this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))}else this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND);return e.promise}showInterstitial(){this._platformSdk.ads.showFullscreen()}showRewarded(){this._platformSdk.ads.showRewardedVideo().catch((()=>{this._showAdFailurePopup(!0)}))}showBanner(){this._platformSdk.ads.showSticky()}hideBanner(){this._platformSdk.ads.closeSticky()}checkAdBlock(){return new Promise((e=>{this._platformSdk.ads.isAdblockEnabled().then((t=>{e(t)}))}))}#jt(){const e=this._platformSdk;e.ads.on(\"rewarded:start\",(()=>{this._setRewardedState(n.b3.OPENED)})),e.ads.on(\"rewarded:close\",(e=>{e||this._showAdFailurePopup(!0)})),e.ads.on(\"rewarded:reward\",(()=>{this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED)}))}#Zt(){const e=this._platformSdk;e.ads.on(\"fullscreen:start\",(()=>{this._setInterstitialState(n.WA.OPENED)})),e.ads.on(\"fullscreen:close\",(()=>{this._setInterstitialState(n.WA.CLOSED)}))}#zt(){const e=this._platformSdk;e.ads.on(\"sticky:render\",(()=>{this._setBannerState(n.Kk.SHOWN)})),e.ads.on(\"sticky:close\",(()=>{this._setBannerState(n.Kk.HIDDEN)}))}}const l=d},9819:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221),d=r(7408);class l extends s.Z{get platformId(){return o.Lb.GAMESNACKS}get isPlatformExternalCallsSupported(){return!1}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlatformPageVisibilityApiAllowed(){return!1}get leaderboardsType(){return d.Z.NATIVE}_isBannerSupported=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.X_)(\"GameSnacks\").then((()=>{this._platformSdk=window.GameSnacks,this._setPlatformStorageAvailable(!0);const e=this._platformSdk;e.game.onPause((()=>{this._setPauseState(!0)})),e.game.onResume((()=>{this._setPauseState(!1)})),e.audio.subscribe((e=>{this._setAudioState(e)})),e.game.firstFrameReady(),this._setAudioState(e.audio.isEnabled()),this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))),e.promise}sendMessage(e,t){const r=this._platformSdk,s=t??{};switch(e){case o.Dt.GAME_READY:return r.game.ready(),Promise.resolve();case o.Dt.LEVEL_FAILED:return r.game.gameOver(),Promise.resolve();case o.Dt.LEVEL_COMPLETED:{const e=Number(s.level);return r.game.levelComplete(Number.isFinite(e)?e:0),Promise.resolve()}default:return super.sendMessage(e,t)}}showInterstitial(e){this._platformSdk.ad.break({type:\"next\",name:e||\"interstitial\",beforeAd:()=>{this._setInterstitialState(n.WA.OPENED)},afterAd:()=>{const{interstitialState:e}=this;e!==n.WA.FAILED&&this._setInterstitialState(n.WA.CLOSED)},adBreakDone:e=>{\"viewed\"!==e?.breakStatus&&this._showAdFailurePopup(!1)}})}showRewarded(e){this._platformSdk.ad.break({type:\"reward\",name:e||\"rewarded\",beforeAd:()=>{this._setRewardedState(n.b3.OPENED)},afterAd:()=>{this.rewardedState!==n.b3.FAILED&&this._setRewardedState(n.b3.CLOSED)},beforeReward:e=>{e()},adDismissed:()=>{this._showAdFailurePopup(!0)},adViewed:()=>{this._setRewardedState(n.b3.REWARDED)},adBreakDone:e=>{\"frequencyCapped\"!==e?.breakStatus&&\"other\"!==e?.breakStatus||this._showAdFailurePopup(!0)}})}checkAdBlock(){return Promise.resolve(!1)}getDataFromStorage(e){const t={};return e.forEach((e=>{const r=this._platformSdk.storage.getItem(e);null!=r&&\"\"!==r&&(t[e]=r)})),Promise.resolve(t)}setDataToStorage(e){return Object.keys(e).forEach((t=>{this._platformSdk.storage.setItem(t,e[t])})),Promise.resolve()}deleteDataFromStorage(e){return e.forEach((e=>{this._platformSdk.storage.removeItem(e)})),Promise.resolve()}leaderboardsSetScore(e,t){return this._platformSdk.score.update(t)}}const h=l},7490:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var s=r(8166),i=r(1302),a=r(8902),o=r(3806),n=r(9221),d=r(8960);class l extends s.Z{get platformId(){return o.Lb.HUAWEI}get isPlayerAuthorizationSupported(){return!0}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPaymentsSupported(){return!0}get isPlatformExternalLinksAllowed(){return!0}_isPlatformStorageAvailable=!0;#Wt=null;#Kt=Promise.resolve();initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options&&this._options.appId?(this.#Wt=this._options.appId,this.#Yt(),this.#$t(a.Mn.INITIALIZE,this.#Wt)):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)),e.promise}authorizePlayer(){let e=this._getPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);return e||(e=this._createPromiseDecorator(a.Mn.AUTHORIZE_PLAYER),this.#$t(a.Mn.AUTHORIZE_PLAYER)),e.promise}async getDataFromStorage(e){const t={};return await Promise.all(e.map((async e=>{const r=await this.#qt((()=>{const t=this._createPromiseDecorator(a.Mn.GET_STORAGE_DATA);return this.#$t(a.Mn.GET_STORAGE_DATA,e),t.promise}));null!=r&&\"\"!==r&&(t[e]=r)}))),t}setDataToStorage(e){return Promise.all(Object.keys(e).map((t=>this.#qt((()=>{const r=this._createPromiseDecorator(a.Mn.SET_STORAGE_DATA);return this.#$t(a.Mn.SET_STORAGE_DATA,{key:t,value:e[t]}),r.promise}))))).then((()=>{}))}deleteDataFromStorage(e){return Promise.all(e.map((e=>this.#qt((()=>{const t=this._createPromiseDecorator(a.Mn.DELETE_STORAGE_DATA);return this.#$t(a.Mn.DELETE_STORAGE_DATA,e),t.promise}))))).then((()=>{}))}showInterstitial(e){this.#$t(a.Mn.SHOW_INTERSTITIAL,e)}showRewarded(e){this.#$t(a.Mn.SHOW_REWARDED,e)}paymentsPurchase(e){if(!this._paymentsGetProductPlatformData(e))return Promise.reject();let t=this._getPromiseDecorator(a.Mn.PURCHASE);return t||(t=this._createPromiseDecorator(a.Mn.PURCHASE),this.#$t(a.Mn.PURCHASE,e)),t.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.CONSUME_PURCHASE);return r||(r=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE),this.#$t(a.Mn.CONSUME_PURCHASE,this._paymentsPurchases[t].purchaseToken)),r.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(a.Mn.GET_CATALOG),this.#$t(a.Mn.GET_CATALOG,e.map((({id:e})=>e)))),t.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(a.Mn.GET_PURCHASES),this.#$t(a.Mn.GET_PURCHASES)),e.promise}#qt(e){const t=this.#Kt.catch((()=>{})).then((()=>e()));return this.#Kt=t.catch((()=>{})),t}#$t(e,t){(0,d.eE)(JSON.stringify({action:e,data:t}))}#Yt(){window.system&&(window.system.onmessage=e=>{try{const{action:t,data:r}=JSON.parse(e);t===a.Mn.INITIALIZE?this.#Jt(r):t===a.Mn.AUTHORIZE_PLAYER?this.#Xt(r):t===a.Mn.SET_INTERSTITIAL_STATE?this.#Qt(r):t===a.Mn.SET_REWARDED_STATE?this.#er(r):t===a.Mn.GET_CATALOG?this.#tr(r):t===a.Mn.PURCHASE?this.#rr(r):t===a.Mn.CONSUME_PURCHASE?this.#sr(r):t===a.Mn.GET_PURCHASES?this.#ir(r):t===a.Mn.GET_STORAGE_DATA?this.#ar(r):t===a.Mn.SET_STORAGE_DATA?this.#or(r):t===a.Mn.DELETE_STORAGE_DATA&&this.#nr(r)}catch(e){i.ZP.error(\"Error parsing Huawei message:\",e)}})}#Jt(e){e.success?(this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE,e)):this._rejectPromiseDecorator(a.Mn.INITIALIZE,new Error(String(e)))}#Xt(e){e.success?(this._playerId=e.playerId,this._playerName=e.playerName,this._isPlayerAuthorized=!0,this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)):this._rejectPromiseDecorator(a.Mn.AUTHORIZE_PLAYER,new Error(String(e)))}#Qt(e){const t=e.state;Object.values(n.WA).includes(t)&&(t===n.WA.FAILED?this._showAdFailurePopup(!1):this._setInterstitialState(t))}#er(e){const t=e.state;Object.values(n.b3).includes(t)&&(t===n.b3.FAILED?this._showAdFailurePopup(!0):this._setRewardedState(t))}#tr(e){if(!e.success)return void this._rejectPromiseDecorator(a.Mn.GET_CATALOG,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data??[],s=t.map((e=>{const t=r.find((t=>t.productId===e.id));return{id:e.id,title:t.productName,description:t.productDesc,price:t.price,priceCurrencyCode:t.currency,priceValue:1e-6*t.microsPrice,subSpecialPeriodCycles:t.subSpecialPeriodCycles,subProductLevel:t.subProductLevel,priceType:t.priceType}}));this._resolvePromiseDecorator(a.Mn.GET_CATALOG,s)}#rr(e){if(!e.success)return void this._rejectPromiseDecorator(a.Mn.PURCHASE,new Error(String(e)));const t=e.data,r={id:e.id,...t};delete r.productId,this._paymentsPurchases.push(r),this._resolvePromiseDecorator(a.Mn.PURCHASE,r)}#sr(e){if(!e.success)return void this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,new Error(String(e)));const t=this._paymentsPurchases.findIndex((t=>t.purchaseToken===e.purchaseToken));t>=0&&this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,e)}#ir(e){if(!e.success)return void this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data??[];this._paymentsPurchases=r.map((e=>{const r=JSON.parse(e),s=t.find((e=>e.id===r.productId)),i={id:s?.id,...r};return delete i.productId,i})),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)}#ar(e){e.success?this._resolvePromiseDecorator(a.Mn.GET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.GET_STORAGE_DATA,new Error(String(e)))}#or(e){e.success?this._resolvePromiseDecorator(a.Mn.SET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.SET_STORAGE_DATA,new Error(String(e)))}#nr(e){e.success?this._resolvePromiseDecorator(a.Mn.DELETE_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.DELETE_STORAGE_DATA,new Error(String(e)))}}const h=l},2974:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(1302),a=r(8960),o=r(8902),n=r(3806),d=r(9221),l=r(7408);class h extends s.Z{get platformId(){return n.Lb.JIO_GAMES}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isBannerSupported(){return!0}get leaderboardsType(){return l.Z.NATIVE}get isPlatformExternalLinksAllowed(){return!1}_preloadInterstitialPromise=null;_preloadRewardedPromise=null;_isBannerAvailable=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);if(!e){e=this._createPromiseDecorator(o.Mn.INITIALIZE),window.onSdkReady=()=>{this._platformSdk=window.JioGames;const e=this._platformSdk;if(e.playerInfo){const{gamer_id:t,gamer_name:r,gamer_avatar_url:s,...i}=e.playerInfo;this._playerId=t||null,this._playerName=r||null,s&&this._playerPhotos.push(s),this._playerExtra=i,this._isPlayerAuthorized=!0}this._isInitialized=!0,this._resolvePromiseDecorator(o.Mn.INITIALIZE)},window.onBannerReady=()=>{this._isBannerAvailable=!0};const t=this._options.adTestMode;(0,a.ZT)(\"https://jiogames.akamaized.net/gameSDK/jiogames/stable/v2.0/jiogames_sdk.js\",t?{\"data-jg-test-environment\":\"on\"}:{}).catch((e=>{this._rejectPromiseDecorator(o.Mn.INITIALIZE,JSON.stringify(e))}))}return e.promise}preloadInterstitial(){this.#Ut()}showInterstitial(){this.#Ut().then((()=>{this._platformSdk.showAd(window.AdType?.Interstitial??\"Interstitial\",{onAdClosed:()=>{this._setInterstitialState(d.WA.CLOSED)},onAdFailedToLoad:e=>{i.ZP.error(\"JioGames interstitial failed to load:\",e),this._showAdFailurePopup(!1)}}),this._setInterstitialState(d.WA.OPENED),this._preloadInterstitialPromise=null}))}preloadRewarded(){this.#Vt()}showRewarded(){this.#Vt().then((()=>{this._platformSdk.showAd(window.AdType?.Rewarded??\"Rewarded\",{onAdClosed:e=>{e&&this._setRewardedState(d.b3.REWARDED),this._setRewardedState(d.b3.CLOSED)},onAdFailedToLoad:e=>{i.ZP.error(\"JioGames rewarded failed to load:\",e),this._showAdFailurePopup(!0)}}),this._setRewardedState(d.b3.OPENED),this._preloadRewardedPromise=null}))}showBanner(e){this._isBannerAvailable?window.JGBanner?.loadBanner().then((()=>{this._setBannerState(d.Kk.SHOWN),window.JGBanner?.showBanner(e||(window.BannerPosition?.TOP??\"TOP\"))})).catch((e=>{i.ZP.error(\"JioGames banner failed to load:\",e),this._setBannerState(d.Kk.FAILED)})):this._setBannerState(d.Kk.FAILED)}hideBanner(){window.JGBanner?.hideBanner(),this._setBannerState(d.Kk.HIDDEN)}leaderboardsSetScore(e,t,r){if(!r)return Promise.reject();const s=\"string\"==typeof t?parseInt(t,10):t;return this._platformSdk.postScore(s),Promise.resolve()}#Ut(){return this._preloadInterstitialPromise||(this._preloadInterstitialPromise=new Promise(((e,t)=>{this._platformSdk.cacheAd(window?.AdType?.Interstitial??\"Interstitial\",{onAdPrepared:()=>e(void 0),onAdFailedToLoad:e=>{this._preloadInterstitialPromise=null,t(new Error(String(e)))}})}))),this._preloadInterstitialPromise}#Vt(){return this._preloadRewardedPromise||(this._preloadRewardedPromise=new Promise(((e,t)=>{this._platformSdk.cacheAd(window?.AdType?.Rewarded??\"Rewarded\",{onAdPrepared:()=>e(void 0),onAdFailedToLoad:e=>{this._preloadRewardedPromise=null,t(new Error(String(e)))}})}))),this._preloadRewardedPromise}}const c=h},4902:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221),d=r(7408);class l extends s.Z{get platformId(){return o.Lb.LAGGED}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get leaderboardsType(){return d.Z.NATIVE}get isAchievementsSupported(){return!0}initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options&&this._options.devId&&this._options.publisherId?(0,i.ZT)(\"https://lagged.com/api/rev-share/lagged.js\").then((()=>{(0,i.X_)(\"LaggedAPI\").then((()=>{this._platformSdk=window.LaggedAPI;const e=this._platformSdk;e.init(this._options.devId,this._options.publisherId),e.User.get((e=>{const{id:t,name:r,avatar:s}=e?.user??{};\"number\"==typeof t&&t>0&&(this._playerId=String(t),this._playerName=r??null,s&&this._playerPhotos.push(s),this._isPlayerAuthorized=!0),this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)),e.promise}showInterstitial(){this._setInterstitialState(n.WA.OPENED),this._platformSdk.APIAds.show((()=>{this._setInterstitialState(n.WA.CLOSED)}))}showRewarded(){this._setRewardedState(n.b3.OPENED);this._platformSdk.GEvents.reward(((e,t)=>{e?t():this._showAdFailurePopup(!0)}),(e=>{e?(this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED)):this._showAdFailurePopup(!0)}))}leaderboardsSetScore(e,t){let r=this._getPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);if(!r){r=this._createPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);const s={score:t,board:e};this._platformSdk.Scores.save(s,(e=>{e.success?this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE):this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE,e.errormsg)}))}return r.promise}achievementsUnlock(e){const t=\"string\"==typeof e?e:e?.id;return t&&\"string\"==typeof t?new Promise(((e,r)=>{this._platformSdk.Achievements.save([t],(t=>{t.success?e(t):r(t.errormsg)}))})):Promise.reject()}}const h=l},4951:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(1302),a=r(8902),o=r(3806),n=r(9221),d=r(8960);const l=\"playgama_ads_promise\";class h extends s.Z{get platformId(){return o.Lb.MICROSOFT_STORE}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlayerAuthorizationSupported(){return!0}get isPaymentsSupported(){return!0}get isRateSupported(){return!0}_isPlatformStorageAvailable=!0;#dr=null;#lr=this._createPromiseDecorator(l).promise;#hr=0;#Kt=Promise.resolve();initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);if(!e){if(e=this._createPromiseDecorator(a.Mn.INITIALIZE),!this._options||!this._options.gameId||!this._options.playgamaAdsId)return this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND),e.promise;try{this.#Yt(),this.#$t(a.Mn.INITIALIZE)}catch(e){this._rejectPromiseDecorator(a.Mn.INITIALIZE,e)}const t=this._options.playgamaAdsId;(0,d.ZT)(\"https://playgama.com/ads/msn.v0.1.js\").then((()=>(0,d.X_)(\"pgAds\"))).then((()=>window.pgAds.init(t))).then((()=>{this.#dr=window.pgAds;const e=this._options.gameId;this.#dr.updateTargeting({gameId:e}),this._resolvePromiseDecorator(l)})).catch((e=>{this._rejectPromiseDecorator(l,e)}))}return e.promise}authorizePlayer(){let e=this._getPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);if(!e){if(e=this._createPromiseDecorator(a.Mn.AUTHORIZE_PLAYER),this._isPlayerAuthorized)return this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER),e.promise;this.#$t(a.Mn.AUTHORIZE_PLAYER)}return e.promise}showInterstitial(){if(this.#hr+=1,3===this.#hr)return this._setInterstitialState(n.WA.CLOSED),void this.rate();this.#dr?new Promise((e=>{this.#dr.requestOutOfPageAd(\"interstitial\").then((t=>{switch(t.state){case\"empty\":return void this._advertisementShowErrorPopup(!1).then((()=>e()));case\"ready\":this._setInterstitialState(n.WA.OPENED),t.show()}t.addEventListener(\"ready\",(()=>{this._setInterstitialState(n.WA.OPENED),t.show()})),t.addEventListener(\"empty\",(()=>{this._advertisementShowErrorPopup(!1).then((()=>e()))})),t.addEventListener(\"closed\",(()=>{this._setInterstitialState(n.WA.CLOSED),e()}))}))})):this._advertisementShowErrorPopup(!1)}showRewarded(){this.#dr?new Promise((e=>{this.#dr.requestOutOfPageAd(\"rewarded\").then((t=>{switch(t.state){case\"empty\":return void this._advertisementShowErrorPopup(!0).then((()=>e()));case\"ready\":this._setRewardedState(n.b3.OPENED),t.show()}t.addEventListener(\"ready\",(()=>{this._setRewardedState(n.b3.OPENED),t.show()})),t.addEventListener(\"rewarded\",(()=>{this._setRewardedState(n.b3.REWARDED)})),t.addEventListener(\"empty\",(()=>{this._advertisementShowErrorPopup(!0).then((()=>e()))})),t.addEventListener(\"closed\",(()=>{this._setRewardedState(n.b3.CLOSED),e()}))}))})):this._advertisementShowErrorPopup(!0)}async getDataFromStorage(e){await this.#xt();const t={};return await Promise.all(e.map((async e=>{const r=this.#cr(e),s=await this.#qt((()=>{const e=this._createPromiseDecorator(a.Mn.GET_STORAGE_DATA);return this.#$t(a.Mn.GET_STORAGE_DATA,r),e.promise}));null!=s&&\"\"!==s&&(t[e]=s)}))),t}async setDataToStorage(e){return await this.#xt(),Promise.all(Object.keys(e).map((t=>{const r=this.#cr(t);return this.#qt((()=>{const s=this._createPromiseDecorator(a.Mn.SET_STORAGE_DATA);return this.#$t(a.Mn.SET_STORAGE_DATA,{key:r,value:e[t]}),s.promise}))}))).then((()=>{}))}async deleteDataFromStorage(e){return await this.#xt(),Promise.all(e.map((e=>{const t=this.#cr(e);return this.#qt((()=>{const e=this._createPromiseDecorator(a.Mn.DELETE_STORAGE_DATA);return this.#$t(a.Mn.DELETE_STORAGE_DATA,t),e.promise}))}))).then((()=>{}))}paymentsPurchase(e){const t=this._paymentsGetProductPlatformData(e);if(!t)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.PURCHASE);return r||(r=this._createPromiseDecorator(a.Mn.PURCHASE),this.#$t(a.Mn.PURCHASE,t.platformProductId)),r.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e)),r=this._paymentsGetProductPlatformData(e);if(t<0||!r)return Promise.reject();let s=this._getPromiseDecorator(a.Mn.CONSUME_PURCHASE);return s||(s=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE),this.#$t(a.Mn.CONSUME_PURCHASE,r.platformProductId)),s.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(a.Mn.GET_CATALOG),this.#$t(a.Mn.GET_CATALOG,e.map((e=>e.platformProductId)))),t.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(a.Mn.GET_PURCHASES),this.#$t(a.Mn.GET_PURCHASES)),e.promise}rate(){let e=this._getPromiseDecorator(a.Mn.RATE);return e||(e=this._createPromiseDecorator(a.Mn.RATE),this.#$t(a.Mn.RATE),this._pauseStateAggregator?.setState(\"rate\",!0)),e.promise}#xt(){return this._isInitialized?Promise.resolve():Promise.reject()}#qt(e){const t=this.#Kt.catch((()=>{})).then((()=>e()));return this.#Kt=t.catch((()=>{})),t}#ur(){const e=this._options?.gameId;return e?`pg_${e}_`:null}#cr(e){const t=this.#ur();return t?Array.isArray(e)?e.map((e=>`${t}${e}`)):`${t}${e}`:e}#$t(e,t){(0,d.Tg)(JSON.stringify({action:e,data:t}))}#Yt(){window.chrome?.webview?.addEventListener(\"message\",(e=>{try{let{data:t}=e;\"string\"==typeof t&&(t=JSON.parse(t));const r=t??{},{action:s}=r;s===a.Mn.INITIALIZE?this.#Jt(r):s===a.Mn.AUTHORIZE_PLAYER?this.#Xt(r):s===a.Mn.GET_CATALOG?this.#tr(r):s===a.Mn.PURCHASE?this.#rr(r):s===a.Mn.CONSUME_PURCHASE?this.#sr(r):s===a.Mn.GET_PURCHASES?this.#ir(r):s===a.Mn.RATE?this.#pr(r):s===a.Mn.GET_STORAGE_DATA?this.#ar(r):s===a.Mn.SET_STORAGE_DATA?this.#or(r):s===a.Mn.DELETE_STORAGE_DATA&&this.#nr(r)}catch(e){i.ZP.error(\"Error parsing Microsoft Store message:\",e)}}))}#Jt(e){e?.success?this.#lr.then((()=>{this.showInterstitial()})).finally((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE,e)})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,new Error(String(e)))}#Xt(e){e?.success?(this._playerExtra=e.data,this._isPlayerAuthorized=!0,this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)):this._rejectPromiseDecorator(a.Mn.AUTHORIZE_PLAYER,new Error(String(e)))}#tr(e){if(!e?.success)return void this._rejectPromiseDecorator(a.Mn.GET_CATALOG,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data??[],s=t.map((e=>{const t=r.find((t=>t.id===e.platformProductId)),s=t?.price??{},i=s.formattedPrice,a=i?(0,d.ZP)(i):null,o=s.currencyCode||null,n=i||null;return{id:e.id,title:t?.title||null,description:t?.description||null,price:n,priceValue:a,priceCurrencyCode:o}}));this._resolvePromiseDecorator(a.Mn.GET_CATALOG,s)}#rr(e){if(!e?.success||!e.data)return void this._rejectPromiseDecorator(a.Mn.PURCHASE,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data,s=t.find((e=>e.platformProductId===r.id)),i={...r,id:s?.id,platformProductId:r.id};this._paymentsPurchases.push(i),this._resolvePromiseDecorator(a.Mn.PURCHASE,i)}#sr(e){if(!e?.success)return void this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data??{},s=t.find((e=>e.platformProductId===r.id)),i={...r,id:s?.id,platformProductId:r.id},o=this._paymentsPurchases.findIndex((e=>e.id===s?.id));o>=0&&this._paymentsPurchases.splice(o,1),this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,i)}#ir(e){if(!e?.success)return void this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data??[];this._paymentsPurchases=r.map((e=>{const r=t.find((t=>t.platformProductId===e.id));return{...e,id:r?.id,platformProductId:e.id}})),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)}#pr(e){this._pauseStateAggregator?.setState(\"rate\",!1),e&&!1!==e.success?this._resolvePromiseDecorator(a.Mn.RATE):this._rejectPromiseDecorator(a.Mn.RATE,new Error(String(e)))}#ar(e){e?.success?this._resolvePromiseDecorator(a.Mn.GET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.GET_STORAGE_DATA,new Error(String(e)))}#or(e){e?.success?this._resolvePromiseDecorator(a.Mn.SET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.SET_STORAGE_DATA,new Error(String(e)))}#nr(e){e?.success?this._resolvePromiseDecorator(a.Mn.DELETE_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.DELETE_STORAGE_DATA,new Error(String(e)))}}const c=h},5244:(e,t,r)=>{r.r(t),r.d(t,{default:()=>p});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221),d=r(7408);const l=604800,h=[{title:\"Ready for another round?\",description:\"Jump back in right where you left off.\",type:8,minDelayInSeconds:86400,payload:\"msn_auto_24h\"},{title:\"Missing your moves\",description:\"It's perfect time to come back\",type:9,minDelayInSeconds:259200,payload:\"msn_auto_3d\"},{title:\"We miss you\",description:\"Seriously. Come play.\",type:10,minDelayInSeconds:604800,payload:\"msn_auto_7d\"}];const c={top:[[728,90],[970,250],[320,50]],bottom:[[320,50]],left:[[300,250],[300,600],[320,50],[160,600]],right:[[300,250],[300,600],[320,50],[160,600]],topleft:[[300,250]],topright:[[300,250]],bottomleft:[[300,250]],bottomright:[[300,250]]};class u extends s.Z{get platformId(){return o.Lb.MSN}get launchSource(){return new URLSearchParams(window.location.search).has(\"notificationPayload\")?a.LS.NOTIFICATION:super.launchSource}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlayerAuthorizationSupported(){return!0}get isShareSupported(){return!0}get isAddToHomeScreenSupported(){const e=this._platformSdk;return\"function\"==typeof e?.promptInstallAsync}get leaderboardsType(){return d.Z.NATIVE}get isBannerSupported(){return!0}get isPaymentsSupported(){return this.#mr}get isNotificationsSupported(){return!0}get platformPayload(){const e=this._platformSdk;if(\"function\"==typeof e?.getNotificationPayload){const t=e.getNotificationPayload();if(t)return t}return super.platformPayload}_isAdvancedBannersSupported=!0;#dr=null;#mr=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);if(!e){e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"https://assets.msn.com/staticsb/statics/latest/msstart-games-sdk/msstart-v1.0.0-rc.21.min.js\").then((()=>(0,i.X_)(\"$msstart\"))).then((()=>{this._platformSdk=window.$msstart,!0!==this._options?.disableAutoNotifications&&h.forEach((e=>{this._platformSdk.scheduleNotificationAsync(e).catch((()=>{}))})),this._platformSdk.getSignedInUserAsync().then((e=>{this.#_r(e)})).catch((()=>{this.#_r(null)})).finally((()=>{this._setPlatformStorageAvailable(this._isPlayerAuthorized),this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}));const t=this._options?.advertisement,r=t?.backfillId;r&&(0,i.ZT)(\"https://playgama.com/ads/msn.v0.1.js\").then((()=>(0,i.X_)(\"pgAds\"))).then((()=>{const{pgAds:e}=window;e&&e.init(r).then((()=>{this.#dr=e;const t=this._options.gameId;this.#dr.updateTargeting({gameId:t})}))}))}return e.promise}authorizePlayer(){return this._isPlayerAuthorized?Promise.resolve():new Promise(((e,t)=>{this._platformSdk.signInAsync().then((t=>{this.#_r(t),e(void 0)})).catch((e=>{this.#_r(null),t(e)}))}))}getDataFromStorage(){return this._platformSdk.cloudSave.getDataAsync({gameId:this._options.gameId})}async setDataToStorage(e){const t=await this._platformSdk.cloudSave.getDataAsync({gameId:this._options.gameId});Object.keys(e).forEach((r=>{t[r]=e[r]})),await this._platformSdk.cloudSave.saveDataAsync({data:t,gameId:this._options.gameId})}async deleteDataFromStorage(e){const t=await this._platformSdk.cloudSave.getDataAsync({gameId:this._options.gameId});e.forEach((e=>{t[e]=null})),await this._platformSdk.cloudSave.saveDataAsync({data:t,gameId:this._options.gameId})}share(e){return new Promise(((t,r)=>{this._platformSdk.shareAsync(e).then(t).catch(r)}))}addToHomeScreen(){let e=this._getPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN);return e||(e=this._createPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN),this._platformSdk.promptInstallAsync().then((e=>{\"accepted\"!==e?this._rejectPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN):this._resolvePromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN,e)}))),e.promise}leaderboardsSetScore(e,t){return new Promise(((e,r)=>{this._platformSdk.submitGameResultsAsync(t).then(e).catch(r)}))}notificationsSchedule(e,t){const r=\"number\"==typeof(s=t)?s:\"string\"==typeof s&&\"\"!==s.trim()?Number(s):void 0;var s;const i=this.#gr(e,r);if(i)return Promise.reject(new a.Hd(a.Bq.NOTIFICATION_INVALID_PARAMETERS,i));const o={title:e.title,description:e.description,type:r};return void 0!==e.image&&(o.imageData=e.image),void 0!==e.payload&&(o.payload=e.payload),void 0!==e.delaySeconds&&(o.minDelayInSeconds=e.delaySeconds),void 0!==e.callToAction&&(o.callToAction=e.callToAction),this._platformSdk.scheduleNotificationAsync(o)}showBanner(e){let t;switch(e){case n.Cb.TOP:t=\"top:728x90\";break;case n.Cb.BOTTOM:default:t=\"bottom:320x50\"}this._platformSdk.showDisplayAdsAsync([t]).then((()=>{this._setBannerState(n.Kk.SHOWN)})).catch((()=>{this._setBannerState(n.Kk.FAILED)}))}hideBanner(){this._platformSdk.hideDisplayAdsAsync().then((()=>{this._setBannerState(n.Kk.HIDDEN)}))}showAdvancedBanners(e){this._setAdvancedBannersState(n.Kk.LOADING);const t=[...new Set((e??[]).map((e=>this.#Sr(e))).filter((e=>Boolean(e))))].slice(0,2);0!==t.length?this._platformSdk.showDisplayAdsAsync(t).then((()=>{this._setAdvancedBannersState(n.Kk.SHOWN)})).catch((()=>{this._setAdvancedBannersState(n.Kk.FAILED)})):this._setAdvancedBannersState(n.Kk.FAILED)}hideAdvancedBanners(){this._platformSdk.hideDisplayAdsAsync().then((()=>{this._setAdvancedBannersState(n.Kk.HIDDEN)}))}showInterstitial(){const e=this._platformSdk;e.loadAdsAsync(!1).then((t=>e.showAdsAsync(t.instanceId))).then((e=>(this._setInterstitialState(n.WA.OPENED),e.showAdsCompletedAsync))).then((()=>this._setInterstitialState(n.WA.CLOSED))).catch((()=>this.#Ar()))}showRewarded(){const e=this._platformSdk;e.loadAdsAsync(!0).then((t=>e.showAdsAsync(t.instanceId))).then((e=>(this._setRewardedState(n.b3.OPENED),e.showAdsCompletedAsync))).then((()=>{this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED)})).catch((()=>this.#Er()))}async paymentsPurchase(e){const t=this._paymentsGetProductPlatformData(e);if(!t)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.PURCHASE);try{this._isPlayerAuthorized||await this.authorizePlayer();const r=await this._platformSdk.iap.purchaseAsync({productId:t.platformProductId});if(\"IAP_PURCHASE_FAILURE\"===r.code)throw new Error(r.description);const s={id:e,...r.receipt,receiptSignature:r.receiptSignature};this._paymentsPurchases.push(s),this._resolvePromiseDecorator(a.Mn.PURCHASE,s)}catch(e){this._rejectPromiseDecorator(a.Mn.PURCHASE,e)}}return r.promise}async paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.CONSUME_PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE);try{this._isPlayerAuthorized||await this.authorizePlayer();const r=await this._platformSdk.iap.consumeAsync({productId:this._paymentsPurchases[t].productId});if(\"IAP_CONSUME_FAILURE\"===r.code)throw new Error(r.description);this._paymentsPurchases.splice(t,1);const s={id:e,...r.consumptionReceipt,consumptionSignature:r.consumptionSignature};delete s.productId,this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,s)}catch(e){this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,e)}}return r.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(a.Mn.GET_CATALOG),this._platformSdk.iap.getAllAddOnsAsync({productId:this._options.gameId}).then((t=>{if(\"IAP_GET_ALL_ADD_ONS_FAILURE\"===t.code)return void this._rejectPromiseDecorator(a.Mn.GET_CATALOG,t.description);const r=t,s=e.map((e=>{const t=r.find((t=>t.productId===e.platformProductId)),s=t?.price??{},i=s.listPrice??null,a=s.currencyCode||null,o=null!==i&&a?`${i} ${a} `:null;return{id:e.id,title:t?.title||null,description:t?.description||null,publisherName:t?.publisherName||null,inAppOfferToken:t?.inAppOfferToken||null,isConsumable:t?.isConsumable??null,price:o,priceCurrencyCode:a,priceValue:i}}));this._resolvePromiseDecorator(a.Mn.GET_CATALOG,s)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_CATALOG,e)}))),t.promise}async paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);if(!e){e=this._createPromiseDecorator(a.Mn.GET_PURCHASES);try{this._isPlayerAuthorized||await this.authorizePlayer();const e=await this._platformSdk.iap.getAllPurchasesAsync({productId:this._options.gameId}),t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.receipts.map((r=>{const s=t.find((e=>e.platformProductId===r.productId));return{id:s?.id,...r,receiptSignature:e.receiptSignature}})),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)}catch(e){\"IAP_GET_ALL_PURCHASES_FAILURE\"===e?.code?this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,[]):this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,e)}}return e.promise}#Ar(){return this.#dr?new Promise((e=>{this.#dr.requestOutOfPageAd(\"interstitial\").then((t=>{switch(t.state){case\"empty\":return void this._advertisementShowErrorPopup(!1).then((()=>e()));case\"ready\":this._setInterstitialState(n.WA.OPENED),t.show()}t.addEventListener(\"ready\",(()=>{this._setInterstitialState(n.WA.OPENED),t.show()})),t.addEventListener(\"empty\",(()=>{this._advertisementShowErrorPopup(!1).then((()=>e()))})),t.addEventListener(\"closed\",(()=>{this._setInterstitialState(n.WA.CLOSED),e()}))}))})):this._advertisementShowErrorPopup(!1)}#Er(){return this.#dr?new Promise((e=>{this.#dr.requestOutOfPageAd(\"rewarded\").then((t=>{switch(t.state){case\"empty\":return void this._advertisementShowErrorPopup(!0).then((()=>e()));case\"ready\":this._setRewardedState(n.b3.OPENED),t.show()}t.addEventListener(\"ready\",(()=>{this._setRewardedState(n.b3.OPENED),t.show()})),t.addEventListener(\"rewarded\",(()=>{this._setRewardedState(n.b3.REWARDED)})),t.addEventListener(\"empty\",(()=>{this._advertisementShowErrorPopup(!0).then((()=>e()))})),t.addEventListener(\"closed\",(()=>{this._setRewardedState(n.b3.CLOSED),e()}))}))})):this._advertisementShowErrorPopup(!0)}#gr(e,t){if(void 0===t||Number.isNaN(t)||!Number.isInteger(t)||t<0||t>15)return`Notification \"${e.id}\" must be mapped to an integer MSN type (0-15) in the \"notifications\" config section`;if(!0!==this._options?.disableAutoNotifications&&h.some((e=>e.type===t))){return`MSN types ${h.map((e=>e.type)).join(\", \")} are reserved for built-in auto notifications; set \"disableAutoNotifications\": true to use them`}return e.title.length>60?'Notification \"title\" must be at most 60 characters':e.description.length>200?'Notification \"description\" must be at most 200 characters':void 0!==e.delaySeconds&&e.delaySeconds>l?'Notification \"delaySeconds\" must be at most 604800 (7 days)':null}#Sr(e){const t=this.#fr(e);if(!t)return null;const r=c[t];if(!r||0===r.length)return null;const s=this.#Pr(e.width,window.innerWidth),i=this.#Pr(e.height,window.innerHeight);if(null===s||null===i)return null;const a=r.filter((e=>e[0]<=s&&e[1]<=i));if(0===a.length)return null;let o=a[0],n=o[0]*o[1];return a.forEach((e=>{const t=e[0]*e[1];t>n&&(n=t,o=e)})),`${t}:${o[0]}x${o[1]}`}#Pr(e,t){if(\"string\"!=typeof e)return null;if(e.endsWith(\"%\")){const r=parseFloat(e);return Number.isNaN(r)?null:Math.floor(t*r/100)}const r=parseInt(e,10);return Number.isNaN(r)?null:r}#fr(e){const t=void 0!==e.top,r=void 0!==e.bottom,s=void 0!==e.left,i=void 0!==e.right;return t&&s?\"topleft\":t&&i?\"topright\":r&&s?\"bottomleft\":r&&i?\"bottomright\":t?\"top\":r?\"bottom\":s?\"left\":i?\"right\":null}#_r(e){e&&(this._isPlayerAuthorized=!0,this._playerId=e.playerId??e.publisherPlayerId,this._playerName=e.playerDisplayName,this._playerExtra=e,this.#mr=\"personal\"===e.userAccountType.toLowerCase(),this._setPlatformStorageAvailable(!0))}}const p=u},9623:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221);const d=\"AUTHORIZED\",l={VALUABLE_ACCESS:\"VALUABLE_ACCESS\",PHOTO_CONTENT:\"PHOTO_CONTENT\"};class h extends s.Z{get platformId(){return o.Lb.OK}get isPlayerAuthorizationSupported(){return!0}get isBannerSupported(){return!0}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isJoinCommunitySupported(){return!0}get isInviteFriendsSupported(){return!0}get isCreatePostSupported(){return!0}get isRateSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get isClipboardSupported(){return!1}_hasValuableAccessPermission=!1;_hasValuableAccessPermissionShowed=!1;_platformBannerOptions={};#Ir=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"//api.ok.ru/js/fapi5.js\").then((()=>{(0,i.X_)(\"FAPI\").then((()=>{this._platformSdk=window.FAPI,window.API_callback=(e,t,r)=>{const s=this.#yr;s[e]?.(t,r)};const e=this._platformSdk,t=e.Util.getRequestParameters()||{};t.api_server&&t.apiconnection?e.init(t.api_server,t.apiconnection,(()=>{const e=this._platformSdk?.saved_state;this._isPlayerAuthorized=!e||e===d,this._isPlayerAuthorized?this._platformSdk.Client.call(this.#Dr.userProfile,this.#Tr.userProfileCallback):(this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE))}),(()=>{this._rejectPromiseDecorator(a.Mn.INITIALIZE)})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)}))}))),e.promise}authorizePlayer(){if(this._isPlayerAuthorized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);return e||(e=this._createPromiseDecorator(a.Mn.AUTHORIZE_PLAYER),this._platformSdk.UI.showLoginSuggestion(d)),e.promise}async getDataFromStorage(e){const t={};return await Promise.all(e.map((async e=>{const r=await new Promise(((t,r)=>{const s={method:\"storage.get\",keys:[e],scope:\"CUSTOM\"};this._platformSdk.Client.call(s,((s,i,a)=>{if(!i)return void r(a);const o=(i.data||{})[e];t(\"\"===o||void 0===o?null:o)}))}));null!=r&&\"\"!==r&&(t[e]=\"string\"==typeof r?r:JSON.stringify(r))}))),t}setDataToStorage(e){return Promise.all(Object.keys(e).map((t=>new Promise(((r,s)=>{const i={method:\"storage.set\",key:t,value:e[t]};this._platformSdk.Client.call(i,((e,t)=>{t?r():s()}))}))))).then((()=>{}))}deleteDataFromStorage(e){return Promise.all(e.map((e=>new Promise(((t,r)=>{const s={method:\"storage.set\",key:e,value:\"\"};this._platformSdk.Client.call(s,((e,s)=>{s?t():r()}))}))))).then((()=>{}))}showInterstitial(){try{this._platformSdk.UI.showAd()}catch{this._showAdFailurePopup(!1)}}showRewarded(){try{this._platformSdk.UI.loadAd()}catch{this._showAdFailurePopup(!0)}}showBanner(e){this.#Ir=e,this._platformSdk.invokeUIMethod(\"requestBannerAds\")}hideBanner(){this._platformSdk.invokeUIMethod(\"hideBannerAds\")}checkAdBlock(){let e=this._getPromiseDecorator(a.Mn.ADBLOCK_DETECT);return e||(e=this._createPromiseDecorator(a.Mn.ADBLOCK_DETECT),this._platformSdk.invokeUIMethod(\"isAdBlockEnabled\")),e.promise}inviteFriends(e){const{text:t}=e||{};if(!e||\"string\"!=typeof t)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.INVITE_FRIENDS);return r||(r=this._createPromiseDecorator(a.Mn.INVITE_FRIENDS),t.length>120?this._rejectPromiseDecorator(a.Mn.INVITE_FRIENDS,a.pn.INVITE_FRIENDS_MESSAGE_LENGTH_ERROR):this._platformSdk.UI.showInvite(t)),r.promise}rate(){let e=this._getPromiseDecorator(a.Mn.RATE);return e||(e=this._createPromiseDecorator(a.Mn.RATE),this._platformSdk.UI.showRatingDialog()),e.promise}createPost(e){const{text:t,url:r,status:s,...i}=e??{};if(!t&&!r&&!i.media)return Promise.reject();const o=[];t&&o.push({type:\"text\",text:t}),r&&o.push({type:\"link\",url:r});let n=this._getPromiseDecorator(a.Mn.CREATE_POST);return n||(n=this._createPromiseDecorator(a.Mn.CREATE_POST),this._platformSdk.UI.postMediatopic({media:o,...i},s??!1)),n.promise}joinCommunity(e){if(!e||!e?.groupId)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.JOIN_COMMUNITY);return t||(t=this._createPromiseDecorator(a.Mn.JOIN_COMMUNITY),this._platformSdk.UI.joinGroup(e.groupId,e.enableMessages??!1)),t.promise}get#Dr(){return{userProfile:{fields:\"uid,name,pic50x50,pic128x128,pic_base\",method:\"users.getCurrentUser\"},hasAppPermission:e=>({method:\"users.hasAppPermission\",ext_perm:e})}}get#Tr(){return{userProfileCallback:(e,t,r)=>this.#wr(e,t,r),hasValueAccessCallback:(e,t,r)=>this.#vr(t,r)}}get#yr(){return{showPermissions:()=>this.#Rr(),loadAd:e=>this.#br(e),showLoadedAd:(e,t)=>this.#Cr(t),showAd:(e,t)=>this.#Lr(t),requestBannerAds:(e,t)=>this.#Or(e,t),showBannerAds:(e,t)=>this.#Mr(t),hideBannerAds:(e,t)=>this.#Nr(t),setBannerFormat:e=>this.#kr(e),showInvite:e=>this.#Hr(e),showRatingDialog:(e,t)=>this.#Br(e,t),joinGroup:(e,t)=>this.#Gr(e,t),showLoginSuggestion:(e,t)=>this.#Fr(e,t),postMediatopic:(e,t)=>this.#xr(e,t),isAdBlockEnabled:(e,t)=>this.#Ur(e,t)}}#wr(e,t,r){\"ok\"===e&&(this._playerId=t.uid,this._playerName=t.name,this._playerPhotos=[t.pic50x50,t.pic128x128,t.pic_base]),this._isInitialized=!0,this._platformSdk.Client.call(this.#Dr.hasAppPermission(l.VALUABLE_ACCESS),this.#Tr.hasValueAccessCallback)}#Fr(e,t){if(\"error\"===e)return this._isPlayerAuthorized=!1,void this._rejectPromiseDecorator(a.Mn.AUTHORIZE_PLAYER,t);this._isPlayerAuthorized=!0,this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)}#vr(e,t){if(this._hasValuableAccessPermission=!!e,this._setPlatformStorageAvailable(this._hasValuableAccessPermission),this._hasValuableAccessPermission||this._hasValuableAccessPermissionShowed)this._resolvePromiseDecorator(a.Mn.INITIALIZE);else{const e=Object.values(l).map((e=>`\"${e}\"`)).join(\",\");this._platformSdk.UI.showPermissions(`[${e}]`)}}#Rr(){this._hasValuableAccessPermissionShowed=!0,this._platformSdk.Client.call(this.#Dr.hasAppPermission(l.VALUABLE_ACCESS),this.#Tr.hasValueAccessCallback)}#br(e){\"error\"===e?this._showAdFailurePopup(!0):(this._setRewardedState(n.b3.OPENED),this._platformSdk.UI.showLoadedAd())}#Cr(e){switch(e){case\"complete\":this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED);break;case\"skip\":this._setRewardedState(n.b3.CLOSED);break;default:this._showAdFailurePopup(!0)}}#Lr(e){switch(e){case\"ready\":case\"ad_prepared\":break;case\"ad_shown\":this._setInterstitialState(n.WA.OPENED),this._setInterstitialState(n.WA.CLOSED);break;default:this._showAdFailurePopup(!1)}}#Or(e,t){if(\"error\"!==e)switch(t){case\"ad_loaded\":this._platformSdk.invokeUIMethod(\"showBannerAds\",this.#Ir);break;case\"banner_shown\":case\"ad_shown\":this._setBannerState(n.Kk.SHOWN);break;case\"hidden_by_user\":this._setBannerState(n.Kk.HIDDEN)}else this._setBannerState(n.Kk.FAILED)}#Nr(e){e?this._setBannerState(n.Kk.HIDDEN):this._setBannerState(n.Kk.FAILED)}#Mr(e){e||this._setBannerState(n.Kk.FAILED)}#kr(e){\"error\"===e?this._setBannerState(n.Kk.FAILED):this.showBanner(this._platformBannerOptions)}#Hr(e){\"error\"===e?this._rejectPromiseDecorator(a.Mn.INVITE_FRIENDS):this._resolvePromiseDecorator(a.Mn.INVITE_FRIENDS)}#Br(e,t){\"error\"===e?this._rejectPromiseDecorator(a.Mn.RATE,t):this._resolvePromiseDecorator(a.Mn.RATE)}#Gr(e,t){\"error\"===e?this._rejectPromiseDecorator(a.Mn.JOIN_COMMUNITY,t):this._resolvePromiseDecorator(a.Mn.JOIN_COMMUNITY)}#xr(e,t){\"error\"===e?this._rejectPromiseDecorator(a.Mn.CREATE_POST,t):this._resolvePromiseDecorator(a.Mn.CREATE_POST)}#Ur(e,t){\"ok\"===e?this._resolvePromiseDecorator(a.Mn.ADBLOCK_DETECT,\"true\"===t):this._rejectPromiseDecorator(a.Mn.ADBLOCK_DETECT)}}const c=h},8166:(e,t,r)=>{r.d(t,{Z:()=>A});var s=r(1558),i=r(8902),a=r(9541),o=r(3806),n=r(66),d=r(9221),l=r(7408),h=r(6170),c=r(1147),u=r(6039);const p=class{#Vr={};#Zr=!1;#jr;constructor(e,t){this.#jr=t,e.forEach((e=>{this.#Vr[e]=!1}))}setState(e,t){e in this.#Vr&&\"boolean\"==typeof t&&this.#Vr[e]!==t&&(this.#Vr[e]=t,this.#zr())}getState(e){return e in this.#Vr&&this.#Vr[e]}getAggregatedState(){return this.#Zr}resetAll(){Object.keys(this.#Vr).forEach((e=>{this.#Vr[e]=!1})),this.#zr()}#zr(){const e=Object.values(this.#Vr).some((e=>!0===e));this.#Zr!==e&&(this.#Zr=e,this.#jr(this.#Zr))}};var m=r(8467),_=r(3941),g=r(5230);class S{get options(){return this._options}get platformId(){return o.Lb.MOCK}get platformSdk(){return this._platformSdk}get additionalData(){return this._additionalData??{}}get platformLanguage(){const e=navigator.language;return\"string\"==typeof e?e.substring(0,2).toLowerCase():\"en\"}get platformPayload(){return new URL(window.location.href).searchParams.get(\"payload\")}get platformTld(){return null}get launchSource(){return null}get isPlatformGamesListSupported(){return!1}get isPlatformExternalCallsSupported(){return!0}get isPlatformAudioEnabled(){return!this._audioStateAggregator||!this._audioStateAggregator.getAggregatedState()}get isPlatformPaused(){return!!this._pauseStateAggregator&&this._pauseStateAggregator.getAggregatedState()}get isPlayerAuthorizationSupported(){return!1}get isPlayerAuthorized(){return this._isPlayerAuthorized}get playerId(){return this._playerId}get playerName(){return this._playerName}get playerPhotos(){return this._playerPhotos}get playerExtra(){return this._playerExtra}get isPlatformStorageAvailable(){return this._isPlatformStorageAvailable}get isBannerSupported(){return this._isBannerSupported}get isAdvancedBannersSupported(){return this._isAdvancedBannersSupported}get isInterstitialSupported(){return!1}get isMinimumDelayBetweenInterstitialEnabled(){return!0}get initialInterstitialDelay(){return 60}get isRewardedSupported(){return!1}get isInviteFriendsSupported(){return!1}get isJoinCommunitySupported(){return!1}get isShareSupported(){return!1}get isCreatePostSupported(){return!1}get isAddToHomeScreenSupported(){return!1}get isAddToHomeScreenRewardSupported(){return!1}get isAddToFavoritesSupported(){return!1}get isAddToFavoritesRewardSupported(){return!1}get isRateSupported(){return!1}get isPlatformExternalLinksAllowed(){return!0}get isPlatformPageVisibilityApiAllowed(){return!0}get deviceType(){if(navigator&&navigator.userAgent){const e=navigator.userAgent.toLowerCase();if(/android|webos|iphone|ipod|blackberry|iemobile|opera mini/i.test(e))return n.me.MOBILE;if(/ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP)))/.test(e))return n.me.TABLET}return n.me.DESKTOP}get deviceOs(){const e=navigator?.userAgent??\"\";return/android/i.test(e)?n.Lh.ANDROID:/iphone|ipod|ipad/i.test(e)||\"MacIntel\"===navigator?.platform&&navigator?.maxTouchPoints>1?n.Lh.IOS:/windows/i.test(e)?n.Lh.WINDOWS:/macintosh|mac os/i.test(e)?n.Lh.MACOS:/linux/i.test(e)?n.Lh.LINUX:n.Lh.OTHER}get isPaymentsSupported(){return!1}get leaderboardsType(){return l.Z.NOT_AVAILABLE}get isRemoteConfigSupported(){return!1}get isClipboardSupported(){return!0}get isAchievementsSupported(){return!1}get isNotificationsSupported(){return!1}_options;_additionalData=null;_isInitialized=!1;_platformSdk=null;_isPlayerAuthorized=!1;_playerId=null;_playerName=null;_playerPhotos=[];_playerExtra={};_visibilityState=null;_isPlatformStorageAvailable=!1;_isBannerSupported=!1;_isAdvancedBannersSupported=!1;_useAdvertisementErrorPopup=!1;_paymentsPurchases=[];_pauseStateAggregator=null;_audioStateAggregator=null;#Wr={};#Kr=0;constructor(){this._playerApplyGuestData();const e=[\"interstitial\",\"rewarded\",\"visibility\",\"platform\",\"rate\"];this._pauseStateAggregator=new p(e,(e=>this.emit(i.W1.PAUSE_STATE_CHANGED,e))),this._audioStateAggregator=new p(e,(e=>this.emit(i.W1.AUDIO_STATE_CHANGED,!e))),this.isPlatformPageVisibilityApiAllowed&&(this._visibilityState=document.visibilityState,document.addEventListener(\"visibilitychange\",(()=>{this._setVisibilityState(document.visibilityState)})),window.addEventListener(\"blur\",(()=>{this._setVisibilityState(o.YU.HIDDEN)})),window.addEventListener(\"focus\",(()=>{this._setVisibilityState(o.YU.VISIBLE)}))),this._options=g.ZP.getValues()}initialize(){return Promise.resolve()}sendMessage(e,t){return Promise.resolve()}sendCustomMessage(e,t){return Promise.resolve()}getServerTime(){return a.k.getServerTime()}getGamesList(){return Promise.resolve([])}getDataFromStorage(e){return Promise.reject(new i.Hd(i.Bq.STORAGE_NOT_SUPPORTED))}setDataToStorage(e){return Promise.reject(new i.Hd(i.Bq.STORAGE_NOT_SUPPORTED))}deleteDataFromStorage(e){return Promise.reject(new i.Hd(i.Bq.STORAGE_NOT_SUPPORTED))}showBanner(e,t){this._setBannerState(d.Kk.FAILED)}hideBanner(){this._setBannerState(d.Kk.HIDDEN)}showAdvancedBanners(e){this._setAdvancedBannersState(d.Kk.FAILED)}hideAdvancedBanners(){this._setAdvancedBannersState(d.Kk.HIDDEN)}preloadInterstitial(e){}showInterstitial(e){this._showAdFailurePopup(!1)}preloadRewarded(e){}showRewarded(e){this._showAdFailurePopup(!0)}checkAdBlock(){const e=document.createElement(\"div\");e.className=\"textads banner-ads banner_ads ad-unit ad-zone ad-space adsbox\",e.style.position=\"absolute\",e.style.left=\"-9999px\",e.style.width=\"1px\",e.style.height=\"1px\",document.body.appendChild(e);const t={method:\"HEAD\",mode:\"no-cors\"};return new Promise((r=>{fetch(\"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\",t).then((t=>{t.redirected?r(t.redirected):window.setTimeout((()=>{const t=0===e.offsetHeight||\"none\"===window.getComputedStyle(e)?.display;r(t),e.remove()}),100)})).catch((()=>{r(!0)}))}))}paymentsPurchase(e){const t={id:e};return this._paymentsPurchases.push(t),Promise.resolve(t)}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));return t<0?Promise.reject():(this._paymentsPurchases.splice(t,1),Promise.resolve({id:e}))}paymentsGetCatalog(){return Promise.resolve(this._paymentsGetProductsPlatformData())}paymentsGetPurchases(){return Promise.resolve(this._paymentsPurchases)}clipboardRead(){return window.navigator&&window.navigator.clipboard?window.navigator.clipboard.readText():Promise.reject()}clipboardWrite(e){return window.navigator&&window.navigator.clipboard?window.navigator.clipboard.writeText(e):Promise.reject()}achievementsUnlock(e){return Promise.reject()}achievementsGetList(){return Promise.reject()}notificationsSchedule(e,t){return Promise.reject(new i.Hd(i.Bq.NOTIFICATIONS_NOT_SUPPORTED))}notificationsCancel(e,t){return Promise.reject(new i.Hd(i.Bq.NOTIFICATIONS_NOT_SUPPORTED))}notificationsCancelAll(){return Promise.reject(new i.Hd(i.Bq.NOTIFICATIONS_NOT_SUPPORTED))}_setPlatformStorageAvailable(e){this._isPlatformStorageAvailable!==e&&(this._isPlatformStorageAvailable=e,this.emit(i.W1.PLATFORM_STORAGE_AVAILABILITY_CHANGED,e))}_setVisibilityState(e){if(this._visibilityState===e)return;this._visibilityState=e,this.emit(i.W1.VISIBILITY_STATE_CHANGED,e);const t=e===o.YU.HIDDEN;this._pauseStateAggregator&&this._pauseStateAggregator.setState(\"visibility\",t),this._audioStateAggregator&&this._audioStateAggregator.setState(\"visibility\",t)}_setBannerState(e){this.emit(i.W1.BANNER_STATE_CHANGED,e)}_setAdvancedBannersState(e){this.emit(i.W1.ADVANCED_BANNERS_STATE_CHANGED,e)}_setInterstitialState(e){this.emit(i.W1.INTERSTITIAL_STATE_CHANGED,e);const t=e===d.WA.OPENED;this._pauseStateAggregator&&this._pauseStateAggregator.setState(\"interstitial\",t),this._audioStateAggregator&&this._audioStateAggregator.setState(\"interstitial\",t)}_setRewardedState(e){this.emit(i.W1.REWARDED_STATE_CHANGED,e);const t=e===d.b3.OPENED||e===d.b3.REWARDED;this._pauseStateAggregator&&this._pauseStateAggregator.setState(\"rewarded\",t),this._audioStateAggregator&&this._audioStateAggregator.setState(\"rewarded\",t)}_setAudioState(e){this._audioStateAggregator?this._audioStateAggregator.setState(\"platform\",!e):this.emit(i.W1.AUDIO_STATE_CHANGED,e)}_setPauseState(e){this._pauseStateAggregator?this._pauseStateAggregator.setState(\"platform\",e):this.emit(i.W1.PAUSE_STATE_CHANGED,e)}_createPromiseDecorator(e){const t=new u.Z;return this.#Wr[e]=t,t}_getPromiseDecorator(e){return this.#Wr[e]}_resolvePromiseDecorator(e,t){this.#Wr[e]&&(this.#Wr[e].resolve(t),delete this.#Wr[e])}_rejectPromiseDecorator(e,t){this.#Wr[e]&&(this.#Wr[e].reject(t),delete this.#Wr[e])}_paymentsGetProductsPlatformData(){return(0,c.om)(this._options.payments,this.platformId)}_paymentsGetProductPlatformData(e){return(0,c.iv)(this._options.payments,this.platformId,e)}_paymentsGenerateTransactionId(e){return(0,c.cE)(e)}_advertisementShowErrorPopup(e){const t=this._options?.advertisement?.useBuiltInErrorPopup;return t?(0,m.QG)(\"Oops! It looks like you closed the ad too early, or it isn't available right now.\").then((()=>{e?this._setRewardedState(d.b3.FAILED):this._setInterstitialState(d.WA.FAILED)})):(e?this._setRewardedState(d.b3.FAILED):this._setInterstitialState(d.WA.FAILED),Promise.resolve())}_showAdFailurePopup(e){if(!(this._options?.advertisement?.useAdvertisementErrorPopup??this._useAdvertisementErrorPopup))return e?this._setRewardedState(d.b3.FAILED):this._setInterstitialState(d.WA.FAILED),Promise.resolve();if(!e){const e=this._options?.advertisement?.builtInErrorPopupCooldown??180,t=Date.now();if((t-this.#Kr)/1e3{e?(h.rh.send(`${i.oF.ADVERTISEMENT}_rewarded_fallback_closed`),this._setRewardedState(d.b3.FAILED)):(h.rh.send(`${i.oF.ADVERTISEMENT}_interstitial_fallback_closed`),this._setInterstitialState(d.WA.FAILED))}))}_playerApplyGuestData(){const e=(0,_.m)();this._playerId=e.id,this._playerName=e.name}}(0,s.aA)(S.prototype);const A=S},3153:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221);class d extends s.Z{get platformId(){return o.Lb.PLAYGAMA}get sdkUrl(){return\"https://playgama.com/platform-sdk/v1.js\"}get sdkGlobalName(){return\"PLAYGAMA_SDK\"}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get isShareSupported(){return this.#Yr}get isAddToHomeScreenSupported(){return this.#$r}get isPlayerAuthorizationSupported(){return this.#qr}get isPaymentsSupported(){return this.#mr}get platformLanguage(){return this._platformSdk?.platformService?.getLanguage?.()||super.platformLanguage}_isAdvancedBannersSupported=!0;#mr=!0;#Jr=!0;#qr=!0;#Yr=!1;#$r=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(this.sdkUrl).then((()=>{(0,i.X_)(this.sdkGlobalName).then((()=>{const e=window;this._platformSdk=e[this.sdkGlobalName],this._platformSdk.advService.subscribeToAdStateChanges(((e,t)=>{if(\"interstitial\"===e)switch(t){case\"open\":this._setInterstitialState(n.WA.OPENED);break;case\"empty\":case\"error\":this._showAdFailurePopup(!1);break;case\"close\":this._setInterstitialState(n.WA.CLOSED)}else if(\"rewarded\"===e)switch(t){case\"open\":this._setRewardedState(n.b3.OPENED);break;case\"empty\":case\"error\":this._showAdFailurePopup(!0);break;case\"rewarded\":this._setRewardedState(n.b3.REWARDED);break;case\"close\":this._setRewardedState(n.b3.CLOSED)}}));const t=this._platformSdk;(t.platformService?.isReady??Promise.resolve()).then((()=>(this.#Xr(),t.platformService?.getAdditionalParams&&(this._additionalData=t.platformService.getAdditionalParams()||{}),this.#Ct()))).then((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))}))),e.promise}sendMessage(e,t){return e===o.Dt.GAME_READY?(this._platformSdk.gameService?.gameReady?.(),Promise.resolve()):(this._platformSdk.gameService?.sendMessage?.(String(e),t??{}),super.sendMessage(e,t))}async getDataFromStorage(){return await this.#xt(),this._platformSdk.cloudSaveApi.getState()}async setDataToStorage(e){await this.#xt();const t=await this._platformSdk.cloudSaveApi.getState();Object.keys(e).forEach((r=>{t[r]=e[r]})),await this._platformSdk.cloudSaveApi.setItems(t)}async deleteDataFromStorage(e){await this.#xt();const t=await this._platformSdk.cloudSaveApi.getState();e.forEach((e=>{delete t[e]})),await this._platformSdk.cloudSaveApi.setItems(t)}notifyLocalDataChanged(e){const t=this._platformSdk?.storageApi;if(t){if(e.sets.length>0){const r={};e.sets.forEach((e=>{r[e.key]=e.value})),t.setItems?.(r)}e.deletes.length>0&&t.deleteItems?.(e.deletes)}}showInterstitial(){this._platformSdk.advService.showInterstitial()}showRewarded(){this._platformSdk.advService.showRewarded()}showAdvancedBanners(e){this._setAdvancedBannersState(n.Kk.LOADING),this._platformSdk.advService.showAdvancedBanners(e).then((()=>{this._setAdvancedBannersState(n.Kk.SHOWN)})).catch((()=>{this._setAdvancedBannersState(n.Kk.FAILED)}))}hideAdvancedBanners(){this._platformSdk.advService.hideAdvancedBanners(),this._setAdvancedBannersState(n.Kk.HIDDEN)}checkAdBlock(){return this._platformSdk.advService.checkAdBlock()}authorizePlayer(e){let t=this._getPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);return t||(t=this._createPromiseDecorator(a.Mn.AUTHORIZE_PLAYER),this._isPlayerAuthorized?this.#Ct(e).then((()=>{this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)})):this._platformSdk.userService.authorizeUser().then((()=>{this.#Ct(e).then((()=>{this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)}))})).catch((e=>{this._rejectPromiseDecorator(a.Mn.AUTHORIZE_PLAYER,e)}))),t.promise}paymentsPurchase(e,t){const r=this._paymentsGetProductPlatformData(e);if(!r)return Promise.reject();t&&t.externalId&&(r.externalId=t.externalId),r.externalId||(r.externalId=this._paymentsGenerateTransactionId(e)),r.bridgeId=e;let s=this._getPromiseDecorator(a.Mn.PURCHASE);if(!s){s=this._createPromiseDecorator(a.Mn.PURCHASE);const t=this._platformSdk;t.inGamePaymentsApi.purchase(r).then((r=>{if(\"PAID\"===r.status){const s={id:e,...r};this._paymentsPurchases.push(s),t.inGamePaymentsApi.confirmDelivery&&t.inGamePaymentsApi.confirmDelivery({orderId:r.orderId,externalId:s.externalId}).catch((()=>{})),this._resolvePromiseDecorator(a.Mn.PURCHASE,s)}else this._rejectPromiseDecorator(a.Mn.PURCHASE,r.error)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.PURCHASE,e)}))}return s.promise}paymentsGetPurchases(){const e=this._platformSdk;if(e.inGamePaymentsApi.getPurchases){const t=this._createPromiseDecorator(a.Mn.GET_PURCHASES);return e.inGamePaymentsApi.getPurchases().then((e=>{this._paymentsPurchases=e.map((({bridgeId:e,...t})=>e?{...t,id:e}:t)),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((()=>{this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)})),t.promise}return Promise.resolve(this._paymentsPurchases)}paymentsConsumePurchase(e){const t=this._paymentsPurchases.find((t=>t.id===e));if(!t)return Promise.reject();const r=this._platformSdk;if(r.inGamePaymentsApi.consumePurchase){const s=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE);return r.inGamePaymentsApi.consumePurchase(t.orderId,t.externalId).then((()=>{const t=this._paymentsPurchases.findIndex((t=>t.id===e));t>=0&&this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,{id:e})})).catch((e=>{this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,e)})),s.promise}return super.paymentsConsumePurchase(e)}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();const t=e.map((e=>({id:e.id,price:`${e.amount} Gam`,priceCurrencyCode:\"Gam\",priceCurrencyImage:\"https://games.playgama.com/assets/gold-fennec-coin-large.webp\",priceValue:e.amount})));return Promise.resolve(t)}share(e){const t=this._platformSdk?.socialService;if(\"function\"!=typeof t?.share)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.SHARE);return r||(r=this._createPromiseDecorator(a.Mn.SHARE),t.share(e).then((()=>{this._resolvePromiseDecorator(a.Mn.SHARE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.SHARE,e)}))),r.promise}addToHomeScreen(){const e=this._platformSdk?.socialService;if(\"function\"!=typeof e?.addToHomeScreen)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN);return t||(t=this._createPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN),e.addToHomeScreen().then((()=>{this._resolvePromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN,e)}))),t.promise}#Ct(e){const t=this._platformSdk;return\"function\"!=typeof t.userService?.getUser?(this._playerApplyGuestData(),Promise.resolve()):new Promise((e=>{t.userService.getUser().then((e=>{e.id&&(this._playerId=e.id),e.isAuthorized&&(this._isPlayerAuthorized=!0,this._playerName=e.name,this._playerPhotos=e.photos,this._playerExtra=e,this.#Jr&&this._setPlatformStorageAvailable(!0))})).catch((()=>{})).finally((()=>{e()}))}))}#Xr(){const e=this._platformSdk;e.platformService?.getIsPlayerAuthorizationSupported&&(this.#qr=e.platformService.getIsPlayerAuthorizationSupported()),e.platformService?.getIsCloudSaveSupported&&(this.#Jr=e.platformService.getIsCloudSaveSupported()),this.#Qr&&this._setPlatformStorageAvailable(this.#Jr),e.platformService?.getIsPaymentsSupported&&(this.#mr=e.platformService.getIsPaymentsSupported());const{socialService:t}=e;this.#Yr=t?.getIsShareSupported?.()??!1,this.#$r=t?.getIsAddToHomeScreenSupported?.()??!1}get#Qr(){return!0===this._options.storage?.allowAnonymousCloudSave}#xt(){return this.#Jr&&(this.#Qr||this._isPlayerAuthorized)?Promise.resolve():Promise.reject()}}const l=d},7789:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221);class d extends s.Z{get platformId(){return o.Lb.POKI}get isPlatformExternalCallsSupported(){return!1}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get isClipboardSupported(){return!1}initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"https://game-cdn.poki.com/scripts/v2/poki-sdk.js\").then((()=>{(0,i.X_)(\"PokiSDK\",\"init\").then((()=>{this._platformSdk=window.PokiSDK,this._platformSdk.init().then((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))}))),e.promise}sendMessage(e){const t=this._platformSdk;switch(e){case o.Dt.GAME_READY:return t.gameLoadingFinished(),Promise.resolve();case o.Dt.GAMEPLAY_STARTED:case o.Dt.LEVEL_STARTED:case o.Dt.LEVEL_RESUMED:return t.gameplayStart(),Promise.resolve();case o.Dt.GAMEPLAY_STOPPED:case o.Dt.LEVEL_PAUSED:case o.Dt.LEVEL_COMPLETED:case o.Dt.LEVEL_FAILED:return t.gameplayStop(),Promise.resolve();default:return super.sendMessage(e)}}showInterstitial(){let e=!1;this._platformSdk.commercialBreak((()=>{e=!0,this._setInterstitialState(n.WA.OPENED)})).then((()=>{e?this._setInterstitialState(n.WA.CLOSED):this._showAdFailurePopup(!1)})).catch((()=>{this._showAdFailurePopup(!1)}))}showRewarded(){let e=!1;this._platformSdk.rewardedBreak((()=>{e=!0,this._setRewardedState(n.b3.OPENED)})).then((t=>{e?(t&&this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED)):this._showAdFailurePopup(!0)})).catch((()=>{this._showAdFailurePopup(!0)}))}}const l=d},6328:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221);class d extends s.Z{get platformId(){return o.Lb.PORTAL}get isPaymentsSupported(){return!0}get platformLanguage(){return this._platformSdk.getLocale()||super.platformLanguage}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"https://storage.googleapis.com/social-networth/scripts/sdk.umd.js\").then((()=>{(0,i.X_)(\"PortalSDK\").then((()=>{this._platformSdk=window.PortalSDK;const e=this._platformSdk;e.initialize().then((()=>{e.initializeOverlay(),this._setPlatformStorageAvailable(!0),this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.INITIALIZE,e)}))}))}))),e.promise}async getDataFromStorage(e){const t=this._platformSdk,r={};return await Promise.all(e.map((async e=>{const s=await Promise.resolve(t.getValue(e));null!=s&&\"\"!==s&&(r[e]=s)}))),r}setDataToStorage(e){const t=this._platformSdk;return Promise.all(Object.keys(e).map((r=>Promise.resolve(t.setValue(r,e[r]))))).then((()=>{}))}deleteDataFromStorage(e){const t=this._platformSdk;return Promise.all(e.map((e=>Promise.resolve(t.removeValue(e))))).then((()=>{}))}showInterstitial(){this._platformSdk.requestAd().then((()=>{this._setInterstitialState(n.WA.OPENED),this._setInterstitialState(n.WA.CLOSED)})).catch((()=>{this._showAdFailurePopup(!1)}))}showRewarded(){this._platformSdk.requestRewardAd().then((e=>{e?(this._setRewardedState(n.b3.OPENED),this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED)):this._showAdFailurePopup(!0)})).catch((()=>{this._showAdFailurePopup(!0)}))}sendMessage(e,t){return e===o.Dt.GAME_READY?(this._platformSdk.gameReady(),Promise.resolve()):super.sendMessage(e,t)}paymentsPurchase(e){const t=this._paymentsGetProductPlatformData(e);let r=this._getPromiseDecorator(a.Mn.PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.PURCHASE);const s=t?.id,i=this._platformSdk;Promise.resolve(i.getShopItems()).then((e=>{const t=e.find((e=>e&&e.id===s));if(!t)throw new Error(\"Shop item not found in catalog\");return i.openPurchaseConfirmModal(t)})).then((t=>{if(!t||\"success\"!==t.status)throw new Error(\"Purchase failed\");{const r={id:e,...t};this._paymentsPurchases.push(r),this._resolvePromiseDecorator(a.Mn.PURCHASE,r)}})).catch((e=>{this._rejectPromiseDecorator(a.Mn.PURCHASE,e)}))}return r.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e||!Array.isArray(e)||0===e.length)return Promise.reject(new Error(\"No platform products available\"));let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);if(!t){t=this._createPromiseDecorator(a.Mn.GET_CATALOG);const r=this._platformSdk;Promise.resolve(r.getShopItems()).then((t=>{if(!Array.isArray(t))throw new Error(\"Catalog response is not an array\");const r=e.map((e=>{const r=e.id,s=t.find((e=>e&&e.id===r));return s?{id:e.id,name:s.name,price:`${s.price} Gems`,priceCurrencyCode:\"Gems\",priceValue:s.price}:null})).filter(Boolean);this._resolvePromiseDecorator(a.Mn.GET_CATALOG,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_CATALOG,e)}))}return t.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);if(!e){e=this._createPromiseDecorator(a.Mn.GET_PURCHASES);const t=this._platformSdk;Promise.resolve(t.getPurchasedShopItems()).then((e=>{const t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.map((e=>{const r=e.id,s=t.find((e=>e.id===r));if(!s)return null;return{id:s.id,...e}})).filter((e=>null!==e)),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,e)}))}return e.promise}}const l=d},1298:(e,t,r)=>{r.r(t),r.d(t,{ACTION_NAME_QA:()=>I,SUPPORTED_FEATURES:()=>U,default:()=>Z});var s=r(8166),i=r(1558),a=r(5095),o=r(8960);class n{send(e,t=\"*\"){(0,o.n_)(e,t)}addListener(e){window.addEventListener(\"message\",e)}removeListener(e){window.removeEventListener(\"message\",e)}generateMessageId(){return`${Date.now()}-${Math.random()}`}}var d=r(5230);const l=class{#es=0;#ts=null;#rs=[];#ss=null;#is=null;#as=null;#os=null;#ns=null;set onOffer(e){this.#is=e}set onIceCandidate(e){this.#as=e}set onStarted(e){this.#os=e}set onError(e){this.#ns=e}checkAvailability(){return this.#ds()?this.#ls()?this.#hs()?{available:!0,reason:null}:{available:!1,reason:\"Canvas not found\"}:{available:!1,reason:\"captureStream is not supported\"}:{available:!1,reason:\"RTCPeerConnection is not supported\"}}async startCapture(e={}){const{available:t,reason:r}=this.checkAvailability();if(!t)return void this.#ns?.(r);const s=this.#hs();if(!s)return;this.#es+=1;const i=this.#es;this.#cs();const a=s.captureStream(e.fps||30);let o,n;this.#ss=a;try{o=e.iceServers?.length?new RTCPeerConnection({iceServers:e.iceServers}):new RTCPeerConnection}catch(e){throw this.#cs(),e}if(this.#ts=o,e.contentHint){const t=a.getVideoTracks()[0];t&&(t.contentHint=e.contentHint)}a.getTracks().forEach((e=>o.addTrack(e,a))),o.onicecandidate=e=>{e.candidate&&this.#us(i,o)&&this.#as?.(e.candidate.toJSON())};try{if(n=await o.createOffer(),!this.#us(i,o))return;if(await o.setLocalDescription(n),!this.#us(i,o))return}catch(e){if(!this.#us(i,o))return;throw this.#cs(),e}this.#ps(o,e),this.#is?.(n.sdp),this.#os?.()}async handleAnswer({sdp:e}){const t=this.#ts;if(!t)return;if(await t.setRemoteDescription(new RTCSessionDescription({type:\"answer\",sdp:e})),t!==this.#ts)return;const r=this.#rs;this.#rs=[],await Promise.all(r.map((e=>t.addIceCandidate(new RTCIceCandidate(e)))))}async handleIce(e){const t=this.#ts;t&&e&&(t.remoteDescription?await t.addIceCandidate(new RTCIceCandidate(e)):this.#rs.push(e))}takeScreenshot(e={}){const t=this.#hs();return t?this.#ms(t,t.width,t.height,e,t):{success:!1,reason:\"Canvas not found\",data:null}}async takeScreenshotFromSurface(e={}){const t=this.#hs();if(!t)return{success:!1,reason:\"Canvas not found\",data:null};if(0===t.width||0===t.height)return{success:!1,reason:\"Canvas has no drawable area\",data:null};if(\"function\"!=typeof t.captureStream)return this.takeScreenshot(e);let r=null,s=null;try{r=t.captureStream(30);const i=r.getVideoTracks()[0];return i?(s=document.createElement(\"video\"),s.srcObject=r,s.muted=!0,s.playsInline=!0,await this.#_s(s,i),this.#ms(s,s.videoWidth,s.videoHeight,e)):{success:!1,reason:\"Canvas capture has no video track\",data:null}}catch(e){return{success:!1,reason:e&&\"object\"==typeof e&&\"message\"in e?String(e.message):\"Screenshot capture failed\",data:null}}finally{s?.pause(),s&&(s.srcObject=null),r?.getTracks().forEach((e=>e.stop()))}}stopCapture(){this.#es+=1,this.#cs()}#cs(){this.#ss?.getTracks().forEach((e=>e.stop())),this.#ts?.close(),this.#ts=null,this.#rs=[],this.#ss=null}#ms(e,t,r,{type:s=\"image/png\",quality:i=.92,maxWidth:a,maxHeight:o}={},n=null){if(0===t||0===r)return{success:!1,reason:\"Screenshot source has no drawable area\",data:null};try{const d=this.#gs(e,t,r,a,o,n);if(!d)return{success:!1,reason:\"Canvas context is not available\",data:null};const l=Number.isFinite(i)?Math.min(1,Math.max(0,i)):.92,h=d.toDataURL(s,l);return\"data:,\"===h?{success:!1,reason:\"Canvas produced an empty screenshot\",data:null}:{success:!0,reason:null,data:h}}catch(e){return{success:!1,reason:e&&\"object\"==typeof e&&\"message\"in e?String(e.message):\"Screenshot capture failed\",data:null}}}#gs(e,t,r,s,i,a){const o=\"number\"==typeof s&&Number.isFinite(s)&&s>0?s:t,n=\"number\"==typeof i&&Number.isFinite(i)&&i>0?i:r,d=Math.min(1,o/t,n/r);if(1===d&&a)return a;const l=document.createElement(\"canvas\");l.width=Math.max(1,Math.round(t*d)),l.height=Math.max(1,Math.round(r*d));const h=l.getContext(\"2d\");return h?(h.drawImage(e,0,0,l.width,l.height),l):null}#ps(e,{maxBitrate:t,minBitrate:r,maxFramerate:s,scaleResolutionDownBy:i,priority:a,networkPriority:o,scalabilityMode:n}){e.getSenders().forEach((e=>{if(\"video\"!==e.track?.kind)return;const d=e.getParameters();if(d.encodings?.length||(d.encodings=[{}]),void 0!==t&&(d.encodings[0].maxBitrate=t),void 0!==r&&(d.encodings[0].minBitrate=r),void 0!==s&&(d.encodings[0].maxFramerate=s),void 0!==i&&(d.encodings[0].scaleResolutionDownBy=i),void 0!==a&&(d.encodings[0].priority=a),void 0!==o&&(d.encodings[0].networkPriority=o),void 0!==n){d.encodings[0].scalabilityMode=n}e.setParameters(d)}))}#us(e,t){return e===this.#es&&t===this.#ts}#hs(){return document.querySelector(\"canvas\")}#ds(){return\"undefined\"!=typeof RTCPeerConnection}#ls(){return\"function\"==typeof HTMLCanvasElement.prototype.captureStream}#_s(e,t){return new Promise(((r,s)=>{const i=[];let a=null,o=!1;const n=e=>{o||(o=!0,i.forEach((e=>e())),e())},d=()=>n((()=>s(new Error(\"Canvas capture ended before its first frame\")))),l=()=>n(r),h=setTimeout((()=>n((()=>s(new Error(\"Canvas capture produced no video frames\"))))),1e3);i.push((()=>clearTimeout(h))),t.addEventListener(\"ended\",d,{once:!0}),i.push((()=>t.removeEventListener(\"ended\",d))),\"function\"==typeof e.requestVideoFrameCallback?(a=e.requestVideoFrameCallback((()=>n(r))),i.push((()=>{null!==a&&\"function\"==typeof e.cancelVideoFrameCallback&&e.cancelVideoFrameCallback(a)}))):(e.addEventListener(\"loadeddata\",l,{once:!0}),i.push((()=>e.removeEventListener(\"loadeddata\",l)))),Promise.resolve(e.play()).then((()=>{\"function\"!=typeof e.requestVideoFrameCallback&&e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&n(r)})).catch((e=>n((()=>s(e)))))}))}};var h=r(8902),c=r(3806),u=r(9221),p=r(7408);const m=\"interstitial\",_=\"reward\",g=\"banner\",S=\"advanced\",A=\"bridge\",E=\"platform_internal\",f=\"liveness\",P=\"recorder\",I={GET_DATA_FROM_STORAGE:\"get_data_from_storage\",SET_DATA_TO_STORAGE:\"set_data_to_storage\",DELETE_DATA_FROM_STORAGE:\"delete_data_from_storage\",GET_SERVER_TIME:\"get_server_time\",CHECK_ADBLOCK:\"check_adblock\",CLIPBOARD_READ:\"clipboard_read\",LIVENESS_PING:\"ping\",UNLOCK_ACHIEVEMENT:\"unlock_achievement\",GET_ACHIEVEMENTS:\"get_achievements\",GET_PERFORMANCE_RESOURCES:\"get_performance_resources\",GET_LANGUAGE:\"get_language\",GET_PLAYER:\"get_player\",AUDIO_STATE:\"audio_state\",PAUSE_STATE:\"pause_state\",CLEAN_CACHE:\"clean_cache\",SHOW_ADVANCED_BANNERS:\"show_advanced_banners\",HIDE_ADVANCED_BANNERS:\"hide_advanced_banners\",CROSS_PROMO_SHOWN:\"cross_promo_shown\",DAILY_REWARDS_CLAIMED:\"daily_rewards_claimed\",DAILY_REWARDS_STREAK_RESET:\"daily_rewards_streak_reset\",TASKS_REWARD_CLAIMED:\"tasks_reward_claimed\",TASKS_PERIOD_ROLLED_OVER:\"tasks_period_rolled_over\"},y=\"start_capture\",D=\"stop_capture\",T=\"rtc_offer\",w=\"rtc_answer\",v=\"rtc_ice\",R=\"capture_started\",b=\"capture_error\",C=\"take_screenshot\",L=\"screenshot_result\",O=\"start\",M=\"open\",N=\"close\",k=\"failed\",H=\"start\",B=\"open\",G=\"rewarded\",F=\"close\",x=\"failed\",U={PLAYER_AUTHORIZATION:\"isPlayerAuthorizationSupported\",PAYMENTS:\"isPaymentsSupported\",REMOTE_CONFIG:\"isRemoteConfigSupported\",SOCIAL_SHARE:\"isShareSupported\",SOCIAL_JOIN_COMMUNITY:\"isJoinCommunitySupported\",SOCIAL_INVITE_FRIENDS:\"isInviteFriendsSupported\",SOCIAL_CREATE_POST:\"isCreatePostSupported\",SOCIAL_ADD_TO_FAVORITES:\"isAddToFavoritesSupported\",SOCIAL_ADD_TO_HOME_SCREEN:\"isAddToHomeScreenSupported\",SOCIAL_RATE:\"isRateSupported\",BANNER:\"isBannerSupported\",INTERSTITIAL:\"isInterstitialSupported\",REWARDED:\"isRewardedSupported\",CLIPBOARD:\"isClipboardSupported\",ADVANCED_BANNERS:\"isAdvancedBannersSupported\",ACHIEVEMENTS:\"isAchievementsSupported\"};class V extends s.Z{get platformId(){return c.Lb.QA_TOOL}get platformLanguage(){return this.#Ss({type:h.oF.PLATFORM,action:I.GET_LANGUAGE,options:{language:this._platformLanguage}}),this._platformLanguage??super.platformLanguage}get platformTld(){return this._platformTld}get deviceType(){return this._deviceType??super.deviceType}get platformPayload(){return this._platformPayload}get isPlayerAuthorizationSupported(){return this._supportedFeatures.includes(U.PLAYER_AUTHORIZATION)}get isBannerSupported(){return this._supportedFeatures.includes(U.BANNER)}get isAdvancedBannersSupported(){return this._supportedFeatures.includes(U.ADVANCED_BANNERS)}get isInterstitialSupported(){return this._supportedFeatures.includes(U.INTERSTITIAL)}get isRewardedSupported(){return this._supportedFeatures.includes(U.REWARDED)}get isAchievementsSupported(){return this._supportedFeatures.includes(U.ACHIEVEMENTS)}get isInviteFriendsSupported(){return this._supportedFeatures.includes(U.SOCIAL_INVITE_FRIENDS)}get isJoinCommunitySupported(){return this._supportedFeatures.includes(U.SOCIAL_JOIN_COMMUNITY)}get isShareSupported(){return this._supportedFeatures.includes(U.SOCIAL_SHARE)}get isCreatePostSupported(){return this._supportedFeatures.includes(U.SOCIAL_CREATE_POST)}get isAddToHomeScreenSupported(){return this._supportedFeatures.includes(U.SOCIAL_ADD_TO_HOME_SCREEN)}get isAddToFavoritesSupported(){return this._supportedFeatures.includes(U.SOCIAL_ADD_TO_FAVORITES)}get isRateSupported(){return this._supportedFeatures.includes(U.SOCIAL_RATE)}get isPaymentsSupported(){return this._supportedFeatures.includes(U.PAYMENTS)}get isRemoteConfigSupported(){return this._supportedFeatures.includes(U.REMOTE_CONFIG)}get isClipboardSupported(){return this._supportedFeatures.includes(U.CLIPBOARD)}get leaderboardsType(){return this._leaderboardsType??p.Z.NOT_AVAILABLE}get safeArea(){return null}_supportedFeatures=[];_leaderboardsType=null;_platformLanguage;_platformTld=null;_platformPayload=null;_deviceType=null;_isPlatformStorageAvailable=!0;engine=\"javascript\";#As=new n;#Es=new l;#fs=new a.Z((()=>this.#Ps()));initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(h.Mn.INITIALIZE);if(!e){e=this._createPromiseDecorator(h.Mn.INITIALIZE),this.on(h.W1.AUDIO_STATE_CHANGED,(e=>{this.#Ss({type:h.oF.PLATFORM,action:I.AUDIO_STATE,options:{isEnabled:e}})})),this.on(h.W1.PAUSE_STATE_CHANGED,(e=>{this.#Ss({type:h.oF.PLATFORM,action:I.PAUSE_STATE,options:{isPaused:e}})})),i.ZP.on(h.W1.CROSS_PROMO_SHOWN,(e=>{this.#Ss({type:h.oF.CROSS_PROMO,action:I.CROSS_PROMO_SHOWN,options:{...e}})})),i.ZP.on(h.W1.DAILY_REWARDS_CLAIMED,(e=>{this.#Ss({type:h.oF.DAILY_REWARDS,action:I.DAILY_REWARDS_CLAIMED,options:{...e}})})),i.ZP.on(h.W1.DAILY_REWARDS_STREAK_RESET,(e=>{this.#Ss({type:h.oF.DAILY_REWARDS,action:I.DAILY_REWARDS_STREAK_RESET,options:{...e}})})),i.ZP.on(h.W1.TASKS_REWARD_CLAIMED,(e=>{this.#Ss({type:h.oF.TASKS,action:I.TASKS_REWARD_CLAIMED,options:{...e}})})),i.ZP.on(h.W1.TASKS_PERIOD_ROLLED_OVER,(e=>{this.#Ss({type:h.oF.TASKS,action:I.TASKS_PERIOD_ROLLED_OVER,options:{...e}})}));const t=e=>{const t=e.data;if(t?.type&&t?.source!==A)if(t.type===h.oF.PLATFORM)if(t.action===h.Mn.INITIALIZE)this.#Ct().then((()=>{this.#Is(t)}));else if(t.action===I.AUDIO_STATE)this.#ys(t);else if(t.action===I.PAUSE_STATE)this.#Ds(t);else if(t.action===I.GET_PERFORMANCE_RESOURCES){const e=this.#As.generateMessageId(),r=t?.options?.resources||[];this.#Ts(e,r)}else t.action===I.CLEAN_CACHE&&this.#ws();else t.type===h.oF.ADVERTISEMENT?this.#vs(t):t.type===P&&this.#Rs(t)};this.#As.addListener(t),this.#bs(),this.#Ss({type:h.oF.PLATFORM,action:h.Mn.INITIALIZE,payload:{engine:this.engine,version:\"2.1.0\",configFile:{loadingStatus:d.ZP.loadStatus,parsingStatus:d.ZP.parseStatus,loadError:d.ZP.loadError,parseError:d.ZP.parseError,options:d.ZP.getRawValues(),resolvedOptions:d.ZP.getValues(),path:d.ZP.path,remoteLoadStatus:d.ZP.remoteLoadStatus,remoteLoadError:d.ZP.remoteLoadError,remoteAppliedSource:d.ZP.remoteAppliedSource}}})}return e.promise}authorizePlayer(e){let t=this._getPromiseDecorator(h.Mn.AUTHORIZE_PLAYER);return t||(t=this._createPromiseDecorator(h.Mn.AUTHORIZE_PLAYER),this.#Cs(h.oF.PLAYER,h.Mn.AUTHORIZE_PLAYER,{options:e}).then((e=>{const{auth:t}=e;\"success\"===t.status?this.#Ct().then((()=>{this._resolvePromiseDecorator(h.Mn.AUTHORIZE_PLAYER)})):this._rejectPromiseDecorator(h.Mn.AUTHORIZE_PLAYER,t.error)}))),t.promise}sendMessage(e,t={}){const r=[c.Dt.GAME_READY,c.Dt.LEVEL_STARTED,c.Dt.LEVEL_COMPLETED,c.Dt.LEVEL_FAILED,c.Dt.LEVEL_PAUSED,c.Dt.LEVEL_RESUMED,c.Dt.IN_GAME_LOADING_STARTED,c.Dt.IN_GAME_LOADING_STOPPED,c.Dt.GAMEPLAY_STARTED,c.Dt.GAMEPLAY_STOPPED,c.Dt.PLAYER_GOT_ACHIEVEMENT];return\"string\"==typeof e&&r.includes(e)?(this.#Ss({type:h.oF.PLATFORM,action:e,options:t}),Promise.resolve()):super.sendMessage(e,t)}getServerTime(){return this.#fs.getServerTime()}async getDataFromStorage(e){const t={};return await Promise.all(e.map((async e=>{const r=await this.#Cs(h.oF.STORAGE,I.GET_DATA_FROM_STORAGE,{options:{key:e,storageType:E}}).then((t=>{const{storage:r}=t;return r&&r[e]}));null!=r&&\"\"!==r&&(t[e]=r)}))),t}setDataToStorage(e){return Promise.all(Object.keys(e).map((t=>(this.#Ss({type:h.oF.STORAGE,action:I.SET_DATA_TO_STORAGE,options:{key:t,value:e[t],storageType:E}}),Promise.resolve())))).then((()=>{}))}deleteDataFromStorage(e){return Promise.all(e.map((e=>(this.#Ss({type:h.oF.STORAGE,action:I.DELETE_DATA_FROM_STORAGE,options:{key:e,storageType:E}}),Promise.resolve())))).then((()=>{}))}showInterstitial(e){this.isInterstitialSupported&&this.#Ss({type:h.oF.ADVERTISEMENT,action:m,options:{placement:e}})}showRewarded(e){this.isRewardedSupported&&this.#Ss({type:h.oF.ADVERTISEMENT,action:_,options:{placement:e}})}showBanner(e,t){this.isBannerSupported&&(this._setBannerState(u.Kk.SHOWN),this.#Ss({type:h.oF.ADVERTISEMENT,action:u.Kk.SHOWN,options:{type:g,position:e,placement:t}}))}hideBanner(){this.isBannerSupported&&(this._setBannerState(u.Kk.HIDDEN),this.#Ss({type:h.oF.ADVERTISEMENT,action:u.Kk.HIDDEN,options:{type:g}}))}showAdvancedBanners(e){this.isAdvancedBannersSupported&&(this._setAdvancedBannersState(u.Kk.LOADING),this.#Ss({type:h.oF.ADVERTISEMENT,action:I.SHOW_ADVANCED_BANNERS,options:{banners:e}}))}hideAdvancedBanners(){this.isAdvancedBannersSupported&&(this._setAdvancedBannersState(u.Kk.HIDDEN),this.#Ss({type:h.oF.ADVERTISEMENT,action:I.HIDE_ADVANCED_BANNERS}))}checkAdBlock(){return this.#Ss({type:I.CHECK_ADBLOCK,action:h.Mn.ADBLOCK_DETECT}),super.checkAdBlock()}inviteFriends(){let e=this._getPromiseDecorator(h.Mn.INVITE_FRIENDS);return e||(e=this._createPromiseDecorator(h.Mn.INVITE_FRIENDS),this._resolvePromiseDecorator(h.Mn.INVITE_FRIENDS),this.#Ss({type:h.oF.SOCIAL,action:h.Mn.INVITE_FRIENDS})),e.promise}joinCommunity(){let e=this._getPromiseDecorator(h.Mn.JOIN_COMMUNITY);return e||(e=this._createPromiseDecorator(h.Mn.JOIN_COMMUNITY),this._resolvePromiseDecorator(h.Mn.JOIN_COMMUNITY),this.#Ss({type:h.oF.SOCIAL,action:h.Mn.JOIN_COMMUNITY})),e.promise}share(){let e=this._getPromiseDecorator(h.Mn.SHARE);return e||(e=this._createPromiseDecorator(h.Mn.SHARE),this._resolvePromiseDecorator(h.Mn.SHARE),this.#Ss({type:h.oF.SOCIAL,action:h.Mn.SHARE})),e.promise}createPost(){let e=this._getPromiseDecorator(h.Mn.CREATE_POST);return e||(e=this._createPromiseDecorator(h.Mn.CREATE_POST),this._resolvePromiseDecorator(h.Mn.CREATE_POST),this.#Ss({type:h.oF.SOCIAL,action:h.Mn.CREATE_POST})),e.promise}addToHomeScreen(){let e=this._getPromiseDecorator(h.Mn.ADD_TO_HOME_SCREEN);return e||(e=this._createPromiseDecorator(h.Mn.ADD_TO_HOME_SCREEN),this._resolvePromiseDecorator(h.Mn.ADD_TO_HOME_SCREEN),this.#Ss({type:h.oF.SOCIAL,action:h.Mn.ADD_TO_HOME_SCREEN})),e.promise}addToFavorites(){let e=this._getPromiseDecorator(h.Mn.ADD_TO_FAVORITES);return e||(e=this._createPromiseDecorator(h.Mn.ADD_TO_FAVORITES),this._resolvePromiseDecorator(h.Mn.ADD_TO_FAVORITES),this.#Ss({type:h.oF.SOCIAL,action:h.Mn.ADD_TO_FAVORITES})),e.promise}rate(){let e=this._getPromiseDecorator(h.Mn.RATE);return e||(e=this._createPromiseDecorator(h.Mn.RATE),this._resolvePromiseDecorator(h.Mn.RATE),this.#Ss({type:h.oF.SOCIAL,action:h.Mn.RATE})),e.promise}paymentsPurchase(e,t){let r=this._getPromiseDecorator(h.Mn.PURCHASE);if(!r){r=this._createPromiseDecorator(h.Mn.PURCHASE);const s=t?.externalId||this._paymentsGenerateTransactionId(e),i={id:e,externalId:s};this.#Cs(h.oF.PAYMENTS,h.Mn.PURCHASE,{options:{product:i}}).then((t=>{const{purchase:r}=t;if(r&&\"object\"==typeof r)if(r?.status){const t={id:e,...r.purchaseData};this._paymentsPurchases.push(t),this._resolvePromiseDecorator(h.Mn.PURCHASE,t)}else this._rejectPromiseDecorator(h.Mn.PURCHASE,r?.error||new Error(\"Unknown purchase error\"));else this._rejectPromiseDecorator(h.Mn.PURCHASE,new Error(\"Invalid purchase\"))}))}return r.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(h.Mn.CONSUME_PURCHASE);return r||(r=this._createPromiseDecorator(h.Mn.CONSUME_PURCHASE),this.#Cs(h.oF.PAYMENTS,h.Mn.CONSUME_PURCHASE,{options:{product:this._paymentsPurchases[t]}}).then((r=>{const{purchase:s}=r;if(s&&\"object\"==typeof s)if(s?.status){const r={id:e,...s};this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(h.Mn.CONSUME_PURCHASE,r)}else this._rejectPromiseDecorator(h.Mn.CONSUME_PURCHASE,s?.error||new Error(\"Unknown consume purchase error\"));else this._rejectPromiseDecorator(h.Mn.CONSUME_PURCHASE,new Error(\"Invalid purchase\"))}))),r.promise}paymentsGetCatalog(){let e=this._getPromiseDecorator(h.Mn.GET_CATALOG);return e||(e=this._createPromiseDecorator(h.Mn.GET_CATALOG),this.#Cs(h.oF.PAYMENTS,h.Mn.GET_CATALOG).then((e=>{const{payload:t}=e,r=t.products.map((e=>({id:e.id,price:`${e.price} ${e.currency}`,priceCurrencyCode:e.currency,priceCurrencyImage:e.priceCurrencyImage,priceValue:e.price})));this._resolvePromiseDecorator(h.Mn.GET_CATALOG,r)}))),e.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(h.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(h.Mn.GET_PURCHASES),this.#Cs(h.oF.PAYMENTS,h.Mn.GET_PURCHASES).then((e=>{const{purchases:t}=e;this._paymentsPurchases=t.map((e=>e.purchaseData)),this._resolvePromiseDecorator(h.Mn.GET_PURCHASES,this._paymentsPurchases)}))),e.promise}getRemoteConfig(){let e=this._getPromiseDecorator(h.Mn.GET_REMOTE_CONFIG);return e||(e=this._createPromiseDecorator(h.Mn.GET_REMOTE_CONFIG),this.#Cs(h.oF.REMOTE_CONFIG,h.Mn.GET_REMOTE_CONFIG).then((e=>{const{result:t}=e;this._resolvePromiseDecorator(h.Mn.GET_REMOTE_CONFIG,t)}))),e.promise}clipboardWrite(e){let t=this._getPromiseDecorator(h.Mn.CLIPBOARD_WRITE);return t||(t=this._createPromiseDecorator(h.Mn.CLIPBOARD_WRITE),this.#Cs(h.oF.CLIPBOARD,h.Mn.CLIPBOARD_WRITE,{options:{text:e}}).then((()=>{this._resolvePromiseDecorator(h.Mn.CLIPBOARD_WRITE,!0)}))),t.promise}clipboardRead(){let e=this._getPromiseDecorator(I.CLIPBOARD_READ);return e||(e=this._createPromiseDecorator(I.CLIPBOARD_READ),this.#Cs(h.oF.CLIPBOARD,I.CLIPBOARD_READ,{options:{}}).then((e=>{const{text:t}=e;this._resolvePromiseDecorator(I.CLIPBOARD_READ,t)}))),e.promise}leaderboardsSetScore(e,t,r){let s=this._getPromiseDecorator(h.Mn.LEADERBOARDS_SET_SCORE);if(!s){s=this._createPromiseDecorator(h.Mn.LEADERBOARDS_SET_SCORE);const r={id:e,score:t};this.#Ss({type:h.oF.LEADERBOARDS,action:h.Mn.LEADERBOARDS_SET_SCORE,options:r}),this._resolvePromiseDecorator(h.Mn.LEADERBOARDS_SET_SCORE)}return s.promise}leaderboardsGetEntries(e){let t=this._getPromiseDecorator(h.Mn.LEADERBOARDS_GET_ENTRIES);return t||(t=this._createPromiseDecorator(h.Mn.LEADERBOARDS_GET_ENTRIES),this.#Cs(h.oF.LEADERBOARDS,h.Mn.LEADERBOARDS_GET_ENTRIES,{options:{id:e}},{timeout:5e3}).then((e=>{const{entries:t}=e;this._resolvePromiseDecorator(h.Mn.LEADERBOARDS_GET_ENTRIES,t)})).catch((()=>{this._rejectPromiseDecorator(h.Mn.LEADERBOARDS_GET_ENTRIES)}))),t.promise}leaderboardsShowNativePopup(e){return this.#Ss({type:h.oF.LEADERBOARDS,action:h.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP,options:{id:e}}),Promise.resolve(h.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP)}achievementsUnlock(e){return this.isAchievementsSupported?this.#Cs(h.oF.ACHIEVEMENTS,I.UNLOCK_ACHIEVEMENT,{options:{achievement:e}}).then((e=>e.result)):Promise.reject()}achievementsGetList(){return this.isAchievementsSupported?this.#Cs(h.oF.ACHIEVEMENTS,I.GET_ACHIEVEMENTS,{options:{}}).then((e=>e.result??[])):Promise.reject()}#Is(e){this._supportedFeatures=e.supportedFeatures||[],this._isBannerSupported=this._supportedFeatures.includes(U.BANNER),this._isAdvancedBannersSupported=this._supportedFeatures.includes(U.ADVANCED_BANNERS);const t=e.config??{};this._deviceType=t.deviceType??super.deviceType,this._platformLanguage=t.platformLanguage?t.platformLanguage.toLowerCase():super.platformLanguage,this._platformTld=t.platformTld??super.platformTld,this._platformPayload=t.platformPayload??super.platformPayload,this._leaderboardsType=t.leaderboardsType??p.Z.NOT_AVAILABLE,this._paymentsPurchases=e.purchases||[],this._isInitialized=!0,this._resolvePromiseDecorator(h.Mn.INITIALIZE),this.#Ss({type:f,action:I.LIVENESS_PING,options:{version:\"2.1.0\"}})}#ys(e){this._setAudioState(e.options.isEnabled)}#Ds(e){this._setPauseState(e.options.isPaused)}#Ts(e,t=[]){const r=Array.isArray(t)?t:[],s=performance.getEntriesByType(\"resource\")||[],i=r.length>0?r:[\"name\",\"initiatorType\"],a=s.map((e=>{const t={};return i.forEach((r=>{r in e&&(t[r]=e[r])})),t}));return this.#Ss({type:h.oF.PLATFORM,action:I.GET_PERFORMANCE_RESOURCES,id:e,options:{resources:a}}),Promise.resolve(s)}#Ss(e){this.#As.send({source:A,...e})}#Ps(){return this.#Cs(h.oF.PLATFORM,I.GET_SERVER_TIME,{options:{}},{timeout:5e3}).then((e=>{const{time:t}=e;if(!t)throw new Error(\"Invalid server time\");return t})).catch((()=>{throw new Error(\"Server time request timeout\")}))}#Cs(e,t,r={},s={}){const i=this.#As.generateMessageId(),a={timeout:0,...s};return new Promise(((o,n)=>{const d=r=>{const s=r.data;s?.type===e&&s?.action===t&&s?.id===i&&s?.source!==A&&(this.#As.removeListener(d),o(s))};this.#As.addListener(d),this.#Ss({type:e,action:t,id:i,options:s,...r}),(a.timeout??0)>0&&setTimeout((()=>{n(new Error(\"Request timeout\")),this.#As.removeListener(d)}),a.timeout)}))}async#Ct(){return this.#Cs(h.oF.PLAYER,I.GET_PLAYER).then((e=>{const{player:t}=e;t?.isAuthorized&&(this._playerId=t.userId??null,this._isPlayerAuthorized=!!t.isAuthorized,this._playerName=t.name??null,Array.isArray(t.photos)&&(this._playerPhotos=[...t.photos]),this._playerExtra=t)})).catch((()=>{}))}#vs(e){const{action:t,payload:r}=e,s=r?.status;if(t===m){if(!this.isInterstitialSupported)return;switch(s){case O:this._setInterstitialState(u.WA.LOADING);break;case M:this._setInterstitialState(u.WA.OPENED);break;case k:this._showAdFailurePopup(!1);break;case N:this._setInterstitialState(u.WA.CLOSED)}}else if(t===_){if(!this.isRewardedSupported)return;switch(s){case H:this._setRewardedState(u.b3.LOADING);break;case B:this._setRewardedState(u.b3.OPENED);break;case G:this._setRewardedState(u.b3.REWARDED);break;case F:this._setRewardedState(u.b3.CLOSED);break;case x:this._showAdFailurePopup(!0)}}else if(t===S)switch(s){case u.Kk.SHOWN:this._setAdvancedBannersState(u.Kk.SHOWN);break;case u.Kk.HIDDEN:this._setAdvancedBannersState(u.Kk.HIDDEN);break;case u.Kk.FAILED:this._setAdvancedBannersState(u.Kk.FAILED);break;case u.Kk.LOADING:this._setAdvancedBannersState(u.Kk.LOADING)}}#Rs(e){switch(e.action){case y:this.#Es.startCapture(e.options||{});break;case D:this.#Es.stopCapture();break;case w:this.#Es.handleAnswer(e.options);break;case v:this.#Es.handleIce(e.options);break;case C:this.#Es.takeScreenshotFromSurface(e.options).then((t=>{this.#Ss({type:P,action:L,id:e.id,payload:t})}))}}#bs(){this.#Es.onOffer=e=>{this.#Ss({type:P,action:T,payload:{sdp:e}})},this.#Es.onIceCandidate=e=>{this.#Ss({type:P,action:v,payload:e})},this.#Es.onStarted=()=>{this.#Ss({type:P,action:R})},this.#Es.onError=e=>{this.#Ss({type:P,action:b,payload:{message:e}})}}#ws(){\"unity\"===this.engine&&indexedDB.deleteDatabase(\"UnityCache\")}}const Z=V},6539:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n});var s=r(8166),i=r(8902),a=r(3806);class o extends s.Z{get platformId(){return a.Lb.REDDIT}get isPlatformExternalCallsSupported(){return!1}get isJoinCommunitySupported(){return!0}get isCreatePostSupported(){return!0}get isPaymentsSupported(){return!0}initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(i.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(i.Mn.INITIALIZE),this.#Ls(\"/api/initialize\").then((e=>{const t=e||{};this._isPlayerAuthorized=!!t.isPlayerAuthorized,this._isPlayerAuthorized&&(this._playerId=t.playerId??null,this._playerName=t.playerName??null,t.playerPhoto&&this._playerPhotos.push(t.playerPhoto),this._setPlatformStorageAvailable(!0)),this._isInitialized=!0,this._resolvePromiseDecorator(i.Mn.INITIALIZE)})).catch((e=>{this._rejectPromiseDecorator(i.Mn.INITIALIZE,e)}))),e.promise}async getDataFromStorage(e){await this.#xt();const t={};return await Promise.all(e.map((async e=>{const r=await this.#Ls(\"/api/storage/get\",{method:\"POST\",body:{key:e}});null!=r&&\"\"!==r&&(t[e]=r)}))),t}async setDataToStorage(e){return await this.#xt(),Promise.all(Object.keys(e).map((t=>this.#Ls(\"/api/storage/set\",{method:\"POST\",body:{key:t,value:e[t]}})))).then((()=>{}))}async deleteDataFromStorage(e){return await this.#xt(),Promise.all(e.map((e=>this.#Ls(\"/api/storage/delete\",{method:\"POST\",body:{key:e}})))).then((()=>{}))}checkAdBlock(){return Promise.resolve(!1)}paymentsPurchase(e){const t=\"undefined\"!=typeof window&&window.__playgama_devvit?window.__playgama_devvit.purchase:null;if(\"function\"!=typeof t)return Promise.reject(new Error(\"window.__playgama_devvit.purchase is not registered. Set window.__playgama_devvit = { purchase } using purchase() from @devvit/web/client before calling bridge.initialize().\"));let r=this._getPromiseDecorator(i.Mn.PURCHASE);return r||(r=this._createPromiseDecorator(i.Mn.PURCHASE),Promise.resolve(t(e)).then((t=>{const r=t&&\"object\"==typeof t?{...t}:{};r.id||(r.id=e),this._paymentsPurchases.push(r),this._resolvePromiseDecorator(i.Mn.PURCHASE,r)})).catch((e=>{this._rejectPromiseDecorator(i.Mn.PURCHASE,e)}))),r.promise}paymentsGetCatalog(){if(!this._paymentsGetProductsPlatformData())return Promise.reject();let e=this._getPromiseDecorator(i.Mn.GET_CATALOG);return e||(e=this._createPromiseDecorator(i.Mn.GET_CATALOG),this.#Ls(\"/api/catalog\").then((e=>{this._resolvePromiseDecorator(i.Mn.GET_CATALOG,this.#Os(e))})).catch((e=>{this._rejectPromiseDecorator(i.Mn.GET_CATALOG,e)}))),e.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(i.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(i.Mn.GET_PURCHASES),this.#Ls(\"/api/purchases\").then((e=>{this._resolvePromiseDecorator(i.Mn.GET_PURCHASES,this.#Os(e))})).catch((e=>{this._rejectPromiseDecorator(i.Mn.GET_PURCHASES,e)}))),e.promise}createPost(e={}){let t=this._getPromiseDecorator(i.Mn.CREATE_POST);return t||(t=this._createPromiseDecorator(i.Mn.CREATE_POST),this.#Ls(\"/api/create-post\",{method:\"POST\",body:{options:e}}).then((()=>{this._resolvePromiseDecorator(i.Mn.CREATE_POST)})).catch((e=>{this._rejectPromiseDecorator(i.Mn.CREATE_POST,e)}))),t.promise}joinCommunity(){let e=this._getPromiseDecorator(i.Mn.JOIN_COMMUNITY);return e||(e=this._createPromiseDecorator(i.Mn.JOIN_COMMUNITY),this.#Ls(\"/api/join-community\",{method:\"POST\"}).then((()=>{this._resolvePromiseDecorator(i.Mn.JOIN_COMMUNITY)})).catch((e=>{this._rejectPromiseDecorator(i.Mn.JOIN_COMMUNITY,e)}))),e.promise}#xt(){return this._isPlayerAuthorized?Promise.resolve():Promise.reject()}#Os(e){if(Array.isArray(e))return e;const t=e?.data;return Array.isArray(t)?t:[]}#Ls(e,{method:t=\"GET\",body:r}={}){const s={},i={method:t,headers:s};return void 0!==r&&(s[\"Content-Type\"]=\"application/json\",i.body=JSON.stringify(r)),fetch(e,i).then((r=>r.ok?r.text().then((e=>{if(!e)return null;try{return JSON.parse(e)}catch{return null}})):r.text().then((s=>{const i=s?`: ${s}`:\"\";throw new Error(`${t} ${e} failed (${r.status})${i}`)}))))}}const n=o},9793:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(8960),a=r(1302),o=r(8902),n=r(3806),d=r(9221);function l(e){if(e&&\"object\"==typeof e)return e.err}class h extends s.Z{get platformId(){return n.Lb.SAMSUNG}get platformLanguage(){return this.#Ms||super.platformLanguage}get isPlayerAuthorizationSupported(){return!0}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isAddToHomeScreenSupported(){return this.#Ns}get isPlatformExternalLinksAllowed(){return!1}#Ms=null;#Ns=!1;#ks=!1;#Hs=!1;#Bs=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);if(!e){e=this._createPromiseDecorator(o.Mn.INITIALIZE);(void 0!==window.GSInstant?Promise.resolve():(0,i.ZT)(\"https://gtg.samsungapps.com/gsinstant-sdk/gsinstant.0.45.js\")).then((()=>(0,i.X_)(\"GSInstant\"))).then((()=>(this._platformSdk=window.GSInstant,this._platformSdk.initializeAsync()))).then((e=>{if(l(e))throw new Error(`Samsung initializeAsync failed: ${l(e)}`);const t=this._platformSdk,r=t.getLocale();\"string\"==typeof r&&r.length>=2&&(this.#Ms=r.substring(0,2).toLowerCase());const s=t.canCreateShortCut();return this.#Ns=Boolean(s)&&!l(s),t.setOnPauseCallback((()=>{this._setPauseState(!0)})),t.setOnResumeCallback((()=>{this._setPauseState(!1)})),this.#Gs()})).then((()=>(this.#Fs(),this._platformSdk.startGameAsync()))).then((e=>{if(l(e))throw new Error(`Samsung startGameAsync failed: ${l(e)}`);this._isInitialized=!0,this._resolvePromiseDecorator(o.Mn.INITIALIZE)})).catch((e=>{this._rejectPromiseDecorator(o.Mn.INITIALIZE,e)}))}return e.promise}authorizePlayer(){if(this._isPlayerAuthorized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.AUTHORIZE_PLAYER);if(!e){e=this._createPromiseDecorator(o.Mn.AUTHORIZE_PLAYER);const t=this._platformSdk;t.loginAsync().catch((e=>{if(!e||\"ALREADY_LOGGED_IN\"!==e.err)throw e})).then((()=>t.player.getPlayerIdAsync())).then((e=>{this._isPlayerAuthorized=!0,this._playerId=e,this._setPlatformStorageAvailable(!0),this._resolvePromiseDecorator(o.Mn.AUTHORIZE_PLAYER)})).catch((e=>{const t=e&&e.err||(\"string\"==typeof e?e:\"samsung_auth_failed\");this._rejectPromiseDecorator(o.Mn.AUTHORIZE_PLAYER,new Error(String(t)))}))}return e.promise}async getDataFromStorage(e){await this.#xt();const t={};return await Promise.all(e.map((async e=>{const r=await this._platformSdk.getDataAsync([e]),s=r&&void 0!==r[e]?r[e]:null;null!=s&&\"\"!==s&&(t[e]=\"string\"==typeof s?s:JSON.stringify(s))}))),t}async setDataToStorage(e){return await this.#xt(),Promise.all(Object.keys(e).map((t=>this._platformSdk.setDataAsync({[t]:e[t]})))).then((()=>{}))}async deleteDataFromStorage(e){return await this.#xt(),Promise.all(e.map((e=>this._platformSdk.setDataAsync({[e]:null})))).then((()=>{}))}preloadInterstitial(){if(!this.#ks)return;const e=this._platformSdk.advertisement2.loadAd({adFormat:\"INTERSTITIAL\"});l(e)&&a.ZP.warn(\"Samsung loadAd(INTERSTITIAL) error:\",l(e))}showInterstitial(){if(!this.#ks)return void this._showAdFailurePopup(!1);this.#Hs=!1,this.#Bs=!0;const e=this._platformSdk.advertisement2.showAd({adFormat:\"INTERSTITIAL\"});l(e)&&(a.ZP.warn(\"Samsung showAd(INTERSTITIAL) error:\",l(e)),this.#Bs=!1,this._showAdFailurePopup(!1))}preloadRewarded(){if(!this.#ks)return;const e=this._platformSdk.advertisement2.loadAd({adFormat:\"REWARD\"});l(e)&&a.ZP.warn(\"Samsung loadAd(REWARD) error:\",l(e))}showRewarded(){if(!this.#ks)return void this._showAdFailurePopup(!0);this.#Hs=!0,this.#Bs=!0;const e=this._platformSdk.advertisement2.showAd({adFormat:\"REWARD\"});l(e)&&(a.ZP.warn(\"Samsung showAd(REWARD) error:\",l(e)),this.#Bs=!1,this._showAdFailurePopup(!0))}addToHomeScreen(){const e=l(this._platformSdk.createShortCut());return e?Promise.reject(new Error(String(e))):Promise.resolve()}#xt(){return this._isPlayerAuthorized?Promise.resolve():Promise.reject()}#Gs(){const e=this._platformSdk,t=e.getLoginStatus();return t&&!t.err&&\"LOGIN\"===t.result?e.player.getPlayerIdAsync().then((e=>{this._isPlayerAuthorized=!0,this._playerId=e,this._setPlatformStorageAvailable(!0)})).catch((()=>{this._isPlayerAuthorized=!1,this._playerApplyGuestData()})):(this._isPlayerAuthorized=!1,this._playerApplyGuestData(),Promise.resolve())}#Fs(){const e=this._platformSdk.advertisement2;if(!e||\"function\"!=typeof e.initAd)return void a.ZP.warn(\"Samsung advertisement2 API not available on this Galaxy Store Client\");const t=this._options,r={},s=this.#xs(\"interstitial\");s&&(r.samsungInterstitialAdPlacementId=s);const i=this.#xs(\"rewarded\");if(i&&(r.samsungRewardedAdPlacementId=i),t.admobInterstitialAdUnitId&&(r.admobInterstitialAdUnitId=t.admobInterstitialAdUnitId),t.admobRewardedAdUnitId&&(r.admobRewardedAdUnitId=t.admobRewardedAdUnitId),t.gameTitle&&(r.gameTitle=t.gameTitle),0===Object.keys(r).length)return;const o=e.initAd(r);l(o)?a.ZP.warn(\"Samsung ad init error:\",l(o)):(this.#ks=!0,e.addEventListener(\"AD_START\",(()=>{this.#Bs&&(this.#Hs?this._setRewardedState(d.b3.OPENED):this._setInterstitialState(d.WA.OPENED))})),e.addEventListener(\"AD_COMPLETE\",(()=>{this.#Bs&&(this.#Hs?(this._setRewardedState(d.b3.REWARDED),this._setRewardedState(d.b3.CLOSED)):this._setInterstitialState(d.WA.CLOSED),this.#Bs=!1)})),e.addEventListener(\"AD_SKIP\",(()=>{this.#Bs&&(this.#Hs?this._setRewardedState(d.b3.CLOSED):this._setInterstitialState(d.WA.CLOSED),this.#Bs=!1)})),e.addEventListener(\"AD_CLOSE\",(()=>{this.#Bs&&(this.#Hs?this._setRewardedState(d.b3.CLOSED):this._setInterstitialState(d.WA.CLOSED),this.#Bs=!1)})),e.addEventListener(\"AD_LOAD_ERROR\",(()=>{this.#Bs&&(this._showAdFailurePopup(this.#Hs),this.#Bs=!1)})),e.addEventListener(\"AD_SHOW_ERROR\",(()=>{this.#Bs&&(this._showAdFailurePopup(this.#Hs),this.#Bs=!1)})),e.addEventListener(\"AD_VIDEO_ERROR\",(()=>{this.#Bs&&(this._showAdFailurePopup(this.#Hs),this.#Bs=!1)})))}#xs(e){const t=this._options.advertisement,r=t?.[e],s=r?.placements;if(!Array.isArray(s)||0===s.length)return null;const i=r?.placementFallback;if(i){const e=s.find((e=>e.id===i));if(e?.[n.Lb.SAMSUNG])return e[n.Lb.SAMSUNG]}const a=s.find((e=>e[n.Lb.SAMSUNG]));return a?.[n.Lb.SAMSUNG]??null}}const c=h},8200:(e,t,r)=>{r.r(t),r.d(t,{default:()=>d});var s=r(3153),i=r(3806),a=r(1147);const o=\"USD\";class n extends s.default{get platformId(){return i.Lb.STANDALONE}get sdkUrl(){return\"https://playgama.com/platform-sdk/wrap.v1.js\"}get sdkGlobalName(){return\"PLAYGAMA_WRAP\"}get isPlatformExternalLinksAllowed(){return!0}_isAdvancedBannersSupported=!0;paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();const t=e.map((e=>{const{price:t,currency:r}=this.#Us(e);return{id:e.id,price:null!==t?`${t} ${r}`:null,priceCurrencyCode:null!==t?r:null,priceValue:t}}));return Promise.resolve(t)}#Us(e){const t=this.#Vs(e.amount);if(null!==t){return{price:t,currency:\"string\"==typeof e.currency&&\"\"!==e.currency?e.currency:o}}const r=(0,a.iv)(this._options.payments,i.Lb.PLAYGAMA,e.id),s=this.#Vs(r?.amount);return null!==s?{price:s/10,currency:o}:{price:null,currency:o}}#Vs(e){if(\"number\"==typeof e&&Number.isFinite(e))return e;if(\"string\"==typeof e&&\"\"!==e){const t=Number(e);if(Number.isFinite(t))return t}return null}}const d=n},6465:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(66),d=r(9221);const l=\"clipboard_read\";class h extends s.Z{get platformId(){return o.Lb.TELEGRAM}get platformLanguage(){return this._platformSdk?this._platformSdk.initDataUnsafe.user.language_code:super.platformLanguage}get isInterstitialSupported(){return!!this.#Zs}get isRewardedSupported(){return!!this.#Zs}get deviceType(){switch(this.#js){case\"android\":case\"android_x\":case\"ios\":return n.me.MOBILE;case\"tdesktop\":case\"unigram\":case\"macos\":return n.me.DESKTOP;default:return super.deviceType}}get deviceOs(){switch(this.#js){case\"android\":case\"android_x\":return n.Lh.ANDROID;case\"ios\":return n.Lh.IOS;case\"macos\":return n.Lh.MACOS;default:return super.deviceOs}}get isPlayerAuthorizationSupported(){return!0}_isPlatformStorageAvailable=!0;_isPlayerAuthorized=!0;#js;#Zs;#zs={onStart:()=>this._setRewardedState(d.b3.OPENED),onSkip:()=>this._setRewardedState(d.b3.CLOSED),onReward:()=>this._setRewardedState(d.b3.REWARDED),onError:()=>this._showAdFailurePopup(!0)};#Ws={onStart:()=>this._setInterstitialState(d.WA.OPENED),onSkip:()=>this._setInterstitialState(d.WA.CLOSED),onError:()=>this._showAdFailurePopup(!1)};initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"https://telegram.org/js/telegram-web-app.js\").then((()=>{this._platformSdk=window.Telegram.WebApp;const e=this._platformSdk,{initDataUnsafe:t}=e,r=t.user;this._playerId=String(r.id),this._playerName=[r.first_name,r.last_name].filter(Boolean).join(\" \"),this._playerPhotos=r.photo_url?[r.photo_url]:[],this.#js=e.platform,this._isInitialized=!0,this._options&&this._options.adsgramBlockId?(0,i.ZT)(\"https://sad.adsgram.ai/js/sad.min.js\").then((()=>{this.#Zs=window.Adsgram.init({blockId:this._options.adsgramBlockId})})).finally((()=>{this._resolvePromiseDecorator(a.Mn.INITIALIZE)})):this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))),e.promise}sendMessage(e,t){return e===o.Dt.GAME_READY?(this._platformSdk.ready(),Promise.resolve()):super.sendMessage(e,t)}getDataFromStorage(e){return new Promise(((t,r)=>{if(!e||0===e.length)return void t({});this._platformSdk.CloudStorage.getItems(e,((s,i)=>{if(s)return void r(s);const a={};e.forEach((e=>{const t=i?i[e]:void 0;null!=t&&\"\"!==t&&(a[e]=t)})),t(a)}))}))}setDataToStorage(e){const t=this._platformSdk;return Promise.all(Object.keys(e).map((r=>new Promise(((s,i)=>{t.CloudStorage.setItem(r,e[r],(e=>{e?i(e):s()}))}))))).then((()=>{}))}deleteDataFromStorage(e){const t=this._platformSdk;return Promise.all(e.map((e=>new Promise(((r,s)=>{t.CloudStorage.removeItem(e,(e=>{e?s(e):r()}))}))))).then((()=>{}))}showInterstitial(){if(!this.#Zs)return void this._showAdFailurePopup(!1);const e=this.#Zs;e.addEventListener(\"onStart\",this.#Ws.onStart),e.addEventListener(\"onSkip\",this.#Ws.onSkip),e.addEventListener(\"onError\",this.#Ws.onError),e.addEventListener(\"onBannerNotFound\",this.#Ws.onError),e.show().finally((()=>{e.removeEventListener(\"onStart\",this.#Ws.onStart),e.removeEventListener(\"onSkip\",this.#Ws.onSkip),e.removeEventListener(\"onError\",this.#Ws.onError),e.removeEventListener(\"onBannerNotFound\",this.#Ws.onError)}))}showRewarded(){if(!this.#Zs)return void this._showAdFailurePopup(!0);const e=this.#Zs;e.addEventListener(\"onStart\",this.#zs.onStart),e.addEventListener(\"onSkip\",this.#zs.onSkip),e.addEventListener(\"onReward\",this.#zs.onReward),e.addEventListener(\"onError\",this.#zs.onError),e.addEventListener(\"onBannerNotFound\",this.#zs.onError),e.show().finally((()=>{e.removeEventListener(\"onStart\",this.#zs.onStart),e.removeEventListener(\"onSkip\",this.#zs.onSkip),e.removeEventListener(\"onReward\",this.#zs.onReward),e.removeEventListener(\"onError\",this.#zs.onError),e.removeEventListener(\"onBannerNotFound\",this.#zs.onError)}))}clipboardRead(){let e=this._getPromiseDecorator(l);return e||(e=this._createPromiseDecorator(l),this._platformSdk.readTextFromClipboard((e=>{e?this._resolvePromiseDecorator(l,e):this._rejectPromiseDecorator(l)}))),e.promise}}const c=h},755:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(8960),a=r(3941),o=r(8902),n=r(3806),d=r(66),l=r(9221);class h extends s.Z{get platformId(){return n.Lb.TIKTOK}get platformLanguage(){return this.#Ks?this.#Ks.language:super.platformLanguage}get isPlayerAuthorizationSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"login\"))}get isInterstitialSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"createInterstitialAd\"))}get isRewardedSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"createRewardedVideoAd\"))}get isAddToHomeScreenSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"addShortcut\"))}get isAddToHomeScreenRewardSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"getShortcutMissionReward\"))}get isAddToFavoritesSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"startEntranceMission\"))}get isAddToFavoritesRewardSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"getEntranceMissionReward\"))}get safeArea(){return this.#Ys?{top:this.#Ys.bottom,bottom:0,left:0,right:0}:null}get deviceType(){if(this.#Ks){const{platform:e}=this.#Ks;if(\"ios\"===e||\"android\"===e)return d.me.MOBILE}return super.deviceType}get deviceOs(){if(this.#Ks){const{platform:e}=this.#Ks;if(\"android\"===e)return d.Lh.ANDROID;if(\"ios\"===e)return d.Lh.IOS}return super.deviceOs}get isClipboardSupported(){return!1}#Ks=null;#Ys=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(o.Mn.INITIALIZE),(0,i.X_)(\"TTMinis\").then((()=>{this._platformSdk=window.TTMinis.game;const e=this._platformSdk;this._options&&this._options.clientKey?(e.init({clientKey:this._options.clientKey}),e.canIUse(\"getStorage\")&&this._setPlatformStorageAvailable(!0),e.canIUse(\"getSystemInfoSync\")&&(this.#Ks=e.getSystemInfoSync()),e.canIUse(\"getMenuButtonBoundingClientRect\")&&(this.#Ys=e.getMenuButtonBoundingClientRect()),e.canIUse(\"onShow\")&&e.onShow((()=>{this._setVisibilityState(n.YU.VISIBLE)})),e.canIUse(\"onHide\")&&e.onHide((()=>{this._setVisibilityState(n.YU.HIDDEN)})),this._isInitialized=!0,this._resolvePromiseDecorator(o.Mn.INITIALIZE)):this._rejectPromiseDecorator(o.Mn.INITIALIZE,o.pn.GAME_PARAMS_NOT_FOUND)}))),e.promise}sendMessage(e,t){if(e===n.Dt.GAME_READY){const e=this._platformSdk;return e.canIUse(\"setLoadingProgress\")&&e.setLoadingProgress({progress:1}),Promise.resolve()}return super.sendMessage(e)}authorizePlayer(){let e=this._getPromiseDecorator(o.Mn.AUTHORIZE_PLAYER);return e||(e=this._createPromiseDecorator(o.Mn.AUTHORIZE_PLAYER),this._platformSdk.login({success:()=>{const e=(0,a.m)();this._playerId=e.id,this._playerName=e.name,this._isPlayerAuthorized=!0,this._resolvePromiseDecorator(o.Mn.AUTHORIZE_PLAYER)},fail:e=>{this._rejectPromiseDecorator(o.Mn.AUTHORIZE_PLAYER,e)}})),e.promise}async getDataFromStorage(e){const t={};return await Promise.all(e.map((async e=>{const r=await this.#$s(e).catch((()=>{}));null!=r&&\"\"!==r&&(t[e]=r)}))),t}setDataToStorage(e){return Promise.all(Object.keys(e).map((t=>this.#qs(t,e[t])))).then((()=>{}))}deleteDataFromStorage(e){return Promise.all(e.map((e=>this.#Js(e)))).then((()=>{}))}showInterstitial(e){const t=this._platformSdk.createInterstitialAd({adUnitId:e});t.onClose((()=>{this._setInterstitialState(l.WA.CLOSED)})),t.onError((()=>{this._showAdFailurePopup(!1)})),t.show().then((()=>{this._setInterstitialState(l.WA.OPENED)})).catch((()=>{this._showAdFailurePopup(!1)}))}showRewarded(e){const t=this._platformSdk.createRewardedVideoAd({adUnitId:e});t.onClose((e=>{e&&e.isEnded&&this._setRewardedState(l.b3.REWARDED),this._setRewardedState(l.b3.CLOSED)})),t.onError((()=>{this._showAdFailurePopup(!0)})),t.show().then((()=>{this._setRewardedState(l.b3.OPENED)})).catch((()=>{this._showAdFailurePopup(!0)}))}addToHomeScreen(){let e=this._getPromiseDecorator(o.Mn.ADD_TO_HOME_SCREEN);return e||(e=this._createPromiseDecorator(o.Mn.ADD_TO_HOME_SCREEN),this._platformSdk.addShortcut({success:()=>{this._resolvePromiseDecorator(o.Mn.ADD_TO_HOME_SCREEN)},fail:e=>{this._rejectPromiseDecorator(o.Mn.ADD_TO_HOME_SCREEN,e)}})),e.promise}getAddToHomeScreenReward(){return new Promise(((e,t)=>{this._platformSdk.getShortcutMissionReward({success:r=>{r?.canReceiveReward?e(void 0):t()},fail:()=>{t()}})}))}addToFavorites(){let e=this._getPromiseDecorator(o.Mn.ADD_TO_FAVORITES);return e||(e=this._createPromiseDecorator(o.Mn.ADD_TO_FAVORITES),this._platformSdk.startEntranceMission({success:()=>{this._resolvePromiseDecorator(o.Mn.ADD_TO_FAVORITES)},fail:e=>{this._rejectPromiseDecorator(o.Mn.ADD_TO_FAVORITES,e)}})),e.promise}getAddToFavoritesReward(){return new Promise(((e,t)=>{this._platformSdk.getEntranceMissionReward({success:r=>{r?.canReceiveReward?e(void 0):t()},fail:()=>{t()}})}))}#$s(e){return new Promise(((t,r)=>{this._platformSdk.getStorage({key:e,success:e=>t(e.data),fail:e=>r(e)})}))}#qs(e,t){return new Promise(((r,s)=>{this._platformSdk.setStorage({key:e,data:\"object\"==typeof t?JSON.stringify(t):t,success:()=>{r()},fail:e=>{s(e)}})}))}#Js(e){return new Promise(((t,r)=>{this._platformSdk.removeStorage({key:e,success:()=>{t()},fail:e=>{r(e)}})}))}}const c=h},7226:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(66),d=r(9221);class l extends s.Z{get platformId(){return o.Lb.VK}get platformLanguage(){const e=new URL(window.location.href);if(e.searchParams.has(\"language\")){const t=e.searchParams.get(\"language\");let r=0;try{r=parseInt(t,10)}catch(e){r=0}switch(r){case 0:default:return\"ru\";case 1:return\"uk\";case 2:return\"be\";case 3:return\"en\"}}return super.platformLanguage}get platformPayload(){const e=new URL(window.location.href);return e.searchParams.has(\"hash\")?e.searchParams.get(\"hash\"):super.platformPayload}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get deviceType(){switch(this.#js){case\"html5_ios\":case\"html5_android\":case\"html5_mobile\":return n.me.MOBILE;case\"web\":return n.me.DESKTOP;default:return super.deviceType}}get isPlayerAuthorizationSupported(){return!0}get isPlayerAuthorized(){return!0}get isInviteFriendsSupported(){return!0}get isJoinCommunitySupported(){return!0}get isShareSupported(){return!0}get isAddToHomeScreenSupported(){return\"html5_android\"===this.#js}get isAddToFavoritesSupported(){return!0}_isBannerSupported=!0;#js=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);if(!e){e=this._createPromiseDecorator(a.Mn.INITIALIZE);const t=new URL(window.location.href);t.searchParams.has(\"platform\")&&(this.#js=t.searchParams.get(\"platform\")),(0,i.ZT)(\"https://unpkg.com/@vkontakte/vk-bridge/dist/browser.min.js\").then((()=>{(0,i.X_)(\"vkBridge\").then((()=>{this._platformSdk=window.vkBridge,this._platformSdk.send(\"VKWebAppInit\").then((()=>{this._platformSdk.send(\"VKWebAppGetUserInfo\").then((e=>{e&&(this._playerId=e.id,this._playerName=`${e.first_name} ${e.last_name}`,e.photo_100&&this._playerPhotos.push(e.photo_100),e.photo_200&&this._playerPhotos.push(e.photo_200),e.photo_max_orig&&this._playerPhotos.push(e.photo_max_orig))})).finally((()=>{this._isInitialized=!0,this._setPlatformStorageAvailable(!0),this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))}))}))}return e.promise}authorizePlayer(){return Promise.resolve()}async getDataFromStorage(e){const t=this._platformSdk,r=await t.send(\"VKWebAppStorageGet\",{keys:e}),s={};return r.keys.forEach((e=>{\"\"!==e.value&&(s[e.key]=e.value)})),s}setDataToStorage(e){const t=this._platformSdk;return Promise.all(Object.keys(e).map((r=>t.send(\"VKWebAppStorageSet\",{key:r,value:e[r]})))).then((()=>{}))}deleteDataFromStorage(e){const t=this._platformSdk;return Promise.all(e.map((e=>t.send(\"VKWebAppStorageSet\",{key:e,value:\"\"})))).then((()=>{}))}showBanner(e){this._platformSdk.send(\"VKWebAppShowBannerAd\",{banner_location:e}).then((e=>{e.result?this._setBannerState(d.Kk.SHOWN):this._setBannerState(d.Kk.FAILED)})).catch((()=>{this._setBannerState(d.Kk.FAILED)}))}hideBanner(){this._platformSdk.send(\"VKWebAppHideBannerAd\").then((e=>{e.result&&this._setBannerState(d.Kk.HIDDEN)}))}showInterstitial(){this._platformSdk.send(\"VKWebAppCheckNativeAds\",{ad_format:\"interstitial\"}).then((e=>{e.result&&this._setInterstitialState(d.WA.OPENED)})).finally((()=>{this._platformSdk.send(\"VKWebAppShowNativeAds\",{ad_format:\"interstitial\"}).then((e=>{e.result?this._setInterstitialState(d.WA.CLOSED):this._showAdFailurePopup(!1)})).catch((()=>{this._showAdFailurePopup(!1)}))}))}showRewarded(){this._platformSdk.send(\"VKWebAppCheckNativeAds\",{ad_format:\"reward\",use_waterfall:!0}).then((e=>{e.result&&this._setRewardedState(d.b3.OPENED)})).finally((()=>{this._platformSdk.send(\"VKWebAppShowNativeAds\",{ad_format:\"reward\",use_waterfall:!0}).then((e=>{e.result?(this._setRewardedState(d.b3.REWARDED),this._setRewardedState(d.b3.CLOSED)):this._showAdFailurePopup(!0)})).catch((()=>{this._showAdFailurePopup(!0)}))}))}inviteFriends(){return this.#Xs(a.Mn.INVITE_FRIENDS,\"VKWebAppShowInviteBox\",{},\"success\")}joinCommunity(e){if(!e||!e.groupId)return Promise.reject();const{groupId:t,...r}=e;let s=t;return\"string\"==typeof s&&(s=parseInt(s,10),Number.isNaN(s))?Promise.reject():this.#Xs(a.Mn.JOIN_COMMUNITY,\"VKWebAppJoinGroup\",{...r,group_id:s}).then((()=>{window.open(`https://vk.com/public${s}`)}))}share(e){const{url:t,...r}=e??{},s={...r};return t&&(s.link=t),this.#Xs(a.Mn.SHARE,\"VKWebAppShare\",s,\"type\")}addToHomeScreen(){return this.#Xs(a.Mn.ADD_TO_HOME_SCREEN,\"VKWebAppAddToHomeScreen\")}addToFavorites(){return this.#Xs(a.Mn.ADD_TO_FAVORITES,\"VKWebAppAddToFavorites\")}clipboardWrite(e){return this.#Xs(a.Mn.CLIPBOARD_WRITE,\"VKWebAppCopyText\",{text:e}).then((()=>{}))}#Xs(e,t,r={},s=\"result\"){let i=this._getPromiseDecorator(e);return i||(i=this._createPromiseDecorator(e),this._platformSdk.send(t,r).then((t=>{t[s]?this._resolvePromiseDecorator(e):this._rejectPromiseDecorator(e)})).catch((t=>{this._rejectPromiseDecorator(e,t)}))),i.promise}}const h=l},7121:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(1302),a=r(8902),o=r(3806),n=r(9221),d=r(8960),l=r(8467);class h extends s.Z{get platformId(){return o.Lb.XIAOMI}get isBannerSupported(){return!0}get isInterstitialSupported(){return!0}get initialInterstitialDelay(){return 30}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}#Qs=null;#ei=null;initialize(){if(this._isInitialized)return Promise.resolve();try{window.funmax&&window.funmax.loadStart&&window.funmax.loadStart()}catch(e){i.ZP.error(\"Xiaomi error:\",e)}let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options?.adSenseId?(0,d.pb)({adSenseId:this._options.adSenseId,testMode:!!this._options.testMode}).then((e=>{this.#Qs=e})).finally((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)),e.promise}sendMessage(e,t){return e===o.Dt.GAME_READY?new Promise((e=>{try{window.funmax&&window.funmax.loadReady&&window.funmax.loadReady()}catch(e){i.ZP.error(\"Xiaomi error:\",e)}e(void 0)})):super.sendMessage(e,t)}showBanner(e,t){if(this.#ei)return;this.#ei=(0,l.kM)(e);const r=this.#Ht(t);this.#ei.appendChild(r),this._setBannerState(n.Kk.SHOWN)}hideBanner(){this.#ei?.remove(),this.#ei=null,this._setBannerState(n.Kk.HIDDEN)}showInterstitial(e){this.#Qs?this.#Qs({type:\"start\",name:e,beforeAd:()=>{this._setInterstitialState(n.WA.OPENED)},afterAd:()=>{this.interstitialState!==n.WA.FAILED&&this._setInterstitialState(n.WA.CLOSED)},adBreakDone:e=>{\"viewed\"!==e.breakStatus&&this._showAdFailurePopup(!1)}}):this._showAdFailurePopup(!1)}showRewarded(e){this.#Qs?this.#Qs({type:\"reward\",name:e,beforeAd:()=>{this._setRewardedState(n.b3.OPENED)},afterAd:()=>{this.rewardedState!==n.b3.FAILED&&this._setRewardedState(n.b3.CLOSED)},beforeReward:e=>{e(0)},adDismissed:()=>{},adViewed:()=>{this._setRewardedState(n.b3.REWARDED)},adBreakDone:e=>{\"frequencyCapped\"!==e.breakStatus&&\"other\"!==e.breakStatus||this._showAdFailurePopup(!0)}}):this._showAdFailurePopup(!0)}#Ht(e){const t=document.createElement(\"ins\");return t.style.display=\"block\",t.classList.add(\"adsbygoogle\"),t.setAttribute(\"data-ad-client\",this._options.adSenseId),t.setAttribute(\"data-ad-slot\",e),t.setAttribute(\"data-ad-format\",\"auto\"),t.setAttribute(\"data-container-id\",n._g),t.setAttribute(\"data-full-width-responsive\",\"true\"),this._options.testMode&&t.setAttribute(\"data-adtest\",\"on\"),t}}const c=h},3369:(e,t,r)=>{r.r(t),r.d(t,{default:()=>p});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221),d=r(7408),l=r(5334);const h=\"userData\",c=\"6129580795478709\";class u extends s.Z{get platformId(){return o.Lb.Y8}get isInterstitialSupported(){return!0}get initialInterstitialDelay(){return 180}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get isPlayerAuthorizationSupported(){return!0}get leaderboardsType(){return d.Z.IN_GAME}get isAchievementsSupported(){return!0}#Qs=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options?.gameId?(0,i.ZT)(\"https://cdn.y8.com/api/sdk.js\").then((()=>{(0,i.X_)(\"ID\").then((()=>{this._platformSdk=window.ID,this._platformSdk.Event.subscribe(\"id.init\",(()=>{(0,i.pb)({adSenseId:this._options.channelId?`ca-pub-${c}`:this._options.adsenseId,channelId:this._options.channelId,hostId:`ca-host-pub-${c}`}).then((e=>{this.#Qs=e})),this._platformSdk.getLoginStatus((e=>{this.#_r(e),this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))})),this._platformSdk.init({appId:this._options.gameId})}))})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)),e.promise}authorizePlayer(){return this._isPlayerAuthorized?Promise.resolve():new Promise(((e,t)=>{this._platformSdk.login((r=>{this.#_r(r),\"ok\"===r.status?e(void 0):t()}))}))}async getDataFromStorage(){return await this.#xt(),new Promise(((e,t)=>{this._platformSdk.api(\"user_data/retrieve\",\"POST\",{key:h},(r=>{if(r.error&&\"Key not found\"!==r.error)return void t(r);let s={};try{r.jsondata&&(s=JSON.parse(r.jsondata))}catch{s={}}e(s)}))}))}async setDataToStorage(e){await this.#xt();const t=await this.getDataFromStorage();Object.keys(e).forEach((r=>{t[r]=e[r]})),await this.#ti(t)}async deleteDataFromStorage(e){await this.#xt();const t=await this.getDataFromStorage();e.forEach((e=>{delete t[e]})),await this.#ti(t)}showInterstitial(){this.#Qs?this.#Qs({type:\"start\",name:\"start-game\",beforeAd:()=>{this._setInterstitialState(n.WA.OPENED)},afterAd:()=>{const{interstitialState:e}=this;e!==n.WA.FAILED&&this._setInterstitialState(n.WA.CLOSED)},adBreakDone:e=>{\"viewed\"!==e.breakStatus&&this._showAdFailurePopup(!1)}}):this._showAdFailurePopup(!1)}showRewarded(){this.#Qs?this.#Qs({type:\"reward\",name:\"rewarded Ad\",beforeAd:()=>{this._setRewardedState(n.b3.OPENED)},afterAd:()=>{this.rewardedState!==n.b3.FAILED&&this._setRewardedState(n.b3.CLOSED)},beforeReward:e=>{e(0)},adDismissed:()=>{this._showAdFailurePopup(!0)},adViewed:()=>{this._setRewardedState(n.b3.REWARDED)},adBreakDone:e=>{\"frequencyCapped\"!==e.breakStatus&&\"other\"!==e.breakStatus||this._showAdFailurePopup(!0)}}):this._showAdFailurePopup(!0)}leaderboardsSetScore(e,t){if(!this._isPlayerAuthorized)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);if(!r){r=this._createPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);const s={table:e,points:t};this._platformSdk.GameAPI.Leaderboards.save(s,(({success:e,errormessage:t})=>{e?this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE):this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE,t)}))}return r.promise}leaderboardsGetEntries(e){if(!this._isPlayerAuthorized)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.LEADERBOARDS_GET_ENTRIES);if(!t){t=this._createPromiseDecorator(a.Mn.LEADERBOARDS_GET_ENTRIES);const r={table:e,mode:\"alltime\"};this._platformSdk.GameAPI.Leaderboards.listCustom(r,(({scores:e,success:t,errormessage:r})=>{if(t){const t=e.map((e=>({id:e.playerid,name:e.playername,score:e.points,rank:e.rank,photo:null})));this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_GET_ENTRIES,t)}else this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_GET_ENTRIES,r)}))}return t.promise}achievementsUnlock(e){if(!this._isPlayerAuthorized)return Promise.reject();const t=e;return t&&\"object\"==typeof t&&t.achievement&&t.achievementkey?new Promise((e=>{this._platformSdk.GameAPI.Achievements.save(t,(t=>{e(t)}))})):Promise.reject()}achievementsGetList(){return new Promise(((e,t)=>{this._platformSdk.GameAPI.Achievements.listCustom({},(r=>{if(r.success){const t=this._options.achievements;e(r.achievements.map((e=>({id:(0,l.dk)(t,o.Lb.Y8,(t=>t.achievementkey===e.achievementkey))??e.achievementkey,name:\"string\"==typeof e.achievement?e.achievement:void 0,description:\"string\"==typeof e.description?e.description:void 0,unlocked:!0===e.awarded}))))}else t(new Error(r.errorcode))}))}))}#xt(){return this._isPlayerAuthorized?Promise.resolve():Promise.reject()}#ti(e){return new Promise(((t,r)=>{this._platformSdk.api(\"user_data/submit\",\"POST\",{key:h,value:JSON.stringify(e)},(e=>{\"ok\"===e.status?t():r(e)}))}))}#_r(e){if(\"ok\"===e.status&&e.authResponse){this._isPlayerAuthorized=!0,this._setPlatformStorageAvailable(!0);const{pid:t,locale:r,nickname:s,first_name:i,last_name:a,avatars:o}=e.authResponse.details;t&&(this._playerId=t),this._platformLanguage=r,this._playerName=[i,a].filter((e=>!!e)).join(\" \")||s||null,this._playerPhotos=[];const{thumb_url:n,medium_url:d,large_url:l}=o;n&&this._playerPhotos.push(n),d&&this._playerPhotos.push(d),l&&this._playerPhotos.push(l)}}}const p=u},1323:(e,t,r)=>{r.r(t),r.d(t,{default:()=>p});var s=r(8166),i=r(5095),a=r(1302),o=r(8960),n=r(8902),d=r(3806),l=r(66),h=r(9221),c=r(7408);class u extends s.Z{get platformId(){return d.Lb.YANDEX}get platformLanguage(){return this._platformSdk?this._platformSdk.environment.i18n.lang.toLowerCase():super.platformLanguage}get platformTld(){return this._platformSdk?this._platformSdk.environment.i18n.tld.toLowerCase():super.platformTld}get isPlatformGamesListSupported(){return!0}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get deviceType(){switch(this._platformSdk&&this._platformSdk.deviceInfo.type){case l.me.DESKTOP:return l.me.DESKTOP;case l.me.MOBILE:return l.me.MOBILE;case l.me.TABLET:return l.me.TABLET;case l.me.TV:return l.me.TV;default:return super.deviceType}}get isPlayerAuthorizationSupported(){return!0}get isAddToHomeScreenSupported(){return this.#$r}get isRateSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get leaderboardsType(){return c.Z.IN_GAME}get isPaymentsSupported(){return!0}get isRemoteConfigSupported(){return!0}_isPlatformStorageAvailable=!0;#$r=!1;#ri=null;#si=null;#ii=null;#fs=new i.Z((()=>Promise.resolve(this._platformSdk.serverTime())));initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(n.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(n.Mn.INITIALIZE),(0,o.ZT)(\"/sdk.js\").then((()=>{(0,o.X_)(\"YaGames\",\"init\").then((()=>{window.YaGames.init().then((e=>{this._platformSdk=e,this.#ii=this.#Ct();const t=this._platformSdk.features.PluginEngineDataReporterAPI?.report({engineName:\"\",engineVersion:\"\",pluginName:\"playgama-bridge\",pluginVersion:\"2.1.0\"}),r=this._platformSdk.shortcut.canShowPrompt().then((e=>{this.#$r=e.canShow})),s=new Promise((e=>{setTimeout(e,1e3)})),i=Promise.race([r,s]),a=this._platformSdk.getPayments().then((e=>{this.#si=e}));this._isBannerSupported=!0;const o=this._platformSdk.adv.getBannerAdvStatus().then((e=>{e.stickyAdvIsShowing&&this._setBannerState(h.Kk.SHOWN)}));this._platformSdk.on(\"game_api_pause\",(()=>{this._setPauseState(!0),this._setAudioState(!1)})),this._platformSdk.on(\"game_api_resume\",(()=>{this._setPauseState(!1),this._setAudioState(!0)})),Promise.all([t,i,a,o]).finally((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(n.Mn.INITIALIZE)}))}))}))}))),e.promise}sendMessage(e){switch(e){case d.Dt.GAME_READY:return this._platformSdk.features.LoadingAPI?.ready(),Promise.resolve();case d.Dt.GAMEPLAY_STARTED:case d.Dt.LEVEL_STARTED:case d.Dt.LEVEL_RESUMED:return this._platformSdk.features.GameplayAPI?.start(),Promise.resolve();case d.Dt.GAMEPLAY_STOPPED:case d.Dt.LEVEL_PAUSED:case d.Dt.LEVEL_COMPLETED:case d.Dt.LEVEL_FAILED:return this._platformSdk.features.GameplayAPI?.stop(),Promise.resolve();default:return super.sendMessage(e)}}getServerTime(){return this.#fs.getServerTime()}getGamesList(){const{GamesAPI:e}=this._platformSdk.features;return e.getAllGames().then((({games:t})=>{const r=Array.isArray(t)?t:[];return Promise.all(r.map((t=>{const r=t.appID??t.id;return void 0===r?t:e.getGameByID(r).then((({game:e,isAvailable:r})=>({...t,...e,isAvailable:r}))).catch((()=>t))})))}))}authorizePlayer(){let e=this._getPromiseDecorator(n.Mn.AUTHORIZE_PLAYER);return e||(e=this._createPromiseDecorator(n.Mn.AUTHORIZE_PLAYER),this._isPlayerAuthorized?(this.#ii=this.#Ct(),this.#ii.then((()=>{this._resolvePromiseDecorator(n.Mn.AUTHORIZE_PLAYER)}))):this._platformSdk.auth.openAuthDialog().then((()=>{this.#ii=this.#Ct(),this.#ii.then((()=>{this._resolvePromiseDecorator(n.Mn.AUTHORIZE_PLAYER)}))})).catch((e=>{this._rejectPromiseDecorator(n.Mn.AUTHORIZE_PLAYER,e)}))),e.promise}async getDataFromStorage(){return await this.#xt(),this.#ri.getData()}async setDataToStorage(e){await this.#xt();const t=await this.#ri.getData();Object.keys(e).forEach((r=>{t[r]=e[r]})),await this.#ri.setData(t)}async deleteDataFromStorage(e){await this.#xt();const t=await this.#ri.getData();e.forEach((e=>{delete t[e]})),await this.#ri.setData(t)}showBanner(){this._platformSdk.adv.showBannerAdv().then((e=>{e.stickyAdvIsShowing?this._setBannerState(h.Kk.SHOWN):this._setBannerState(h.Kk.FAILED)})).catch((()=>{this._setBannerState(h.Kk.FAILED)}))}hideBanner(){this._platformSdk.adv.hideBannerAdv().then((e=>{e.stickyAdvIsShowing||this._setBannerState(h.Kk.HIDDEN)}))}showInterstitial(){this._platformSdk.adv.showFullscreenAdv({callbacks:{onOpen:()=>{this._setInterstitialState(h.WA.OPENED)},onClose:e=>{e?this._setInterstitialState(h.WA.CLOSED):this._showAdFailurePopup(!1)},onError:e=>{a.ZP.error(\"Yandex interstitial error:\",e)}}})}showRewarded(){this._platformSdk.adv.showRewardedVideo({callbacks:{onOpen:()=>{this._setRewardedState(h.b3.OPENED)},onRewarded:()=>{this._setRewardedState(h.b3.REWARDED)},onClose:()=>{this._setRewardedState(h.b3.CLOSED)},onError:()=>{this._showAdFailurePopup(!0)}}})}checkAdBlock(){return new Promise((e=>{e(!1)}))}addToHomeScreen(){let e=this._getPromiseDecorator(n.Mn.ADD_TO_HOME_SCREEN);return e||(e=this._createPromiseDecorator(n.Mn.ADD_TO_HOME_SCREEN),this._platformSdk.shortcut.showPrompt().then((e=>{\"accepted\"!==e.outcome?this._rejectPromiseDecorator(n.Mn.ADD_TO_HOME_SCREEN):this._resolvePromiseDecorator(n.Mn.ADD_TO_HOME_SCREEN)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.ADD_TO_HOME_SCREEN,e)}))),e.promise}rate(){let e=this._getPromiseDecorator(n.Mn.RATE);return e||(e=this._createPromiseDecorator(n.Mn.RATE),this._platformSdk.feedback.canReview().then((e=>{e.value?this._platformSdk.feedback.requestReview().then((({feedbackSent:e})=>{e?this._resolvePromiseDecorator(n.Mn.RATE):this._rejectPromiseDecorator(n.Mn.RATE)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.RATE,e)})):this._rejectPromiseDecorator(n.Mn.RATE,e.reason)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.RATE,e)}))),e.promise}leaderboardsSetScore(e,t){if(!this._isPlayerAuthorized)return Promise.reject();let r=this._getPromiseDecorator(n.Mn.LEADERBOARDS_SET_SCORE);return r||(r=this._createPromiseDecorator(n.Mn.LEADERBOARDS_SET_SCORE),this._platformSdk.leaderboards.setScore(e,t).then((()=>{this._resolvePromiseDecorator(n.Mn.LEADERBOARDS_SET_SCORE)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.LEADERBOARDS_SET_SCORE,e)}))),r.promise}leaderboardsGetEntries(e){let t=this._getPromiseDecorator(n.Mn.LEADERBOARDS_GET_ENTRIES);if(!t){t=this._createPromiseDecorator(n.Mn.LEADERBOARDS_GET_ENTRIES);const r={quantityTop:20};this._isPlayerAuthorized&&(r.includeUser=!0,r.quantityAround=3),this._platformSdk.leaderboards.getEntries(e,r).then((e=>{let t;t=e&&e.entries.length>0?e.entries.map((e=>({id:e.player.uniqueID,name:e.player.publicName,score:e.score,rank:e.rank,photo:e.player.getAvatarSrc(\"large\")}))):[],this._resolvePromiseDecorator(n.Mn.LEADERBOARDS_GET_ENTRIES,t)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.LEADERBOARDS_GET_ENTRIES,e)}))}return t.promise}paymentsPurchase(e){if(!this.#si)return Promise.reject();let t=this._paymentsGetProductPlatformData(e);t||(t={id:e});let r=this._getPromiseDecorator(n.Mn.PURCHASE);return r||(r=this._createPromiseDecorator(n.Mn.PURCHASE),this.#si.purchase(t).then((t=>{const r={id:e,...t.purchaseData};delete r.productID,this._paymentsPurchases.push(r),this._resolvePromiseDecorator(n.Mn.PURCHASE,r)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.PURCHASE,e)}))),r.promise}paymentsConsumePurchase(e){if(!this.#si)return Promise.reject();const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(n.Mn.CONSUME_PURCHASE);return r||(r=this._createPromiseDecorator(n.Mn.CONSUME_PURCHASE),this.#si.consumePurchase(this._paymentsPurchases[t].purchaseToken).then((()=>{this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(n.Mn.CONSUME_PURCHASE,{id:e})})).catch((e=>{this._rejectPromiseDecorator(n.Mn.CONSUME_PURCHASE,e)}))),r.promise}paymentsGetCatalog(){if(!this.#si)return Promise.reject();const e=this._paymentsGetProductsPlatformData();let t=this._getPromiseDecorator(n.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(n.Mn.GET_CATALOG),this.#si.getCatalog().then((t=>{const r=e.map((e=>{const r=t.find((t=>t.id===e.id));return{id:e.id,title:r.title,description:r.description,imageURI:r.imageURI,price:r.price,priceCurrencyCode:r.priceCurrencyCode,priceValue:r.priceValue,priceCurrencyImage:r.getPriceCurrencyImage?.(\"medium\")}}));this._resolvePromiseDecorator(n.Mn.GET_CATALOG,r)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.GET_CATALOG,e)}))),t.promise}paymentsGetPurchases(){if(!this.#si)return Promise.reject();let e=this._getPromiseDecorator(n.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(n.Mn.GET_PURCHASES),this.#si.getPurchases().then((e=>{const t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.map((e=>{const r={id:t.find((t=>t.id===e.productID)).id,...e.purchaseData};return delete r.productID,r})),this._resolvePromiseDecorator(n.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.GET_PURCHASES,e)}))),e.promise}getRemoteConfig(e){if(!this._platformSdk)return Promise.reject();const t={clientFeatures:[]};e&&Object.keys(e).length>0&&(t.clientFeatures=Object.entries(e).map((([e,t])=>({name:e,value:String(t)}))));let r=this._getPromiseDecorator(n.Mn.GET_REMOTE_CONFIG);return r||(r=this._createPromiseDecorator(n.Mn.GET_REMOTE_CONFIG),this._platformSdk.getFlags(t).then((e=>{this._resolvePromiseDecorator(n.Mn.GET_REMOTE_CONFIG,e)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.GET_REMOTE_CONFIG,e)}))),r.promise}clipboardWrite(e){let t=this._getPromiseDecorator(n.Mn.CLIPBOARD_WRITE);return t||(t=this._createPromiseDecorator(n.Mn.CLIPBOARD_WRITE),this._platformSdk.clipboard.writeText(e).then((()=>{this._resolvePromiseDecorator(n.Mn.CLIPBOARD_WRITE,!0)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.CLIPBOARD_WRITE,e)}))),t.promise.then((()=>{}))}#xt(){return this.#ii?this.#ii.then((()=>{if(!this._isPlayerAuthorized)return Promise.reject()})):Promise.reject()}#Ct(){return new Promise((e=>{let t=!1;this._options&&this._options.useSignedData&&(t=this._options.useSignedData),this._platformSdk.getPlayer({signed:t}).then((e=>{this._playerId=e.getUniqueID(),this._isPlayerAuthorized=e.isAuthorized(),this._setPlatformStorageAvailable(this._isPlayerAuthorized);const r=e.getName();\"\"!==r&&(this._playerName=r),this._playerPhotos=[];const s=e.getPhoto(\"small\"),i=e.getPhoto(\"medium\"),a=e.getPhoto(\"large\");s&&this._playerPhotos.push(s),i&&this._playerPhotos.push(i),a&&this._playerPhotos.push(a),this._playerExtra={payingStatus:e.getPayingStatus()},t&&(this._playerExtra.signature=e.signature),this.#ri=e})).finally((()=>{e()}))}))}}const p=u},8347:(e,t,r)=>{r.r(t),r.d(t,{default:()=>u});var s=r(8166),i=r(5555),a=r(8960),o=r(8902),n=r(3806),d=r(66),l=r(9221),h=r(7408);class c extends s.Z{get platformId(){return n.Lb.YOUTUBE}get isPlatformExternalCallsSupported(){return!1}get platformLanguage(){return this.#Ms?this.#Ms:super.platformLanguage}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get isClipboardSupported(){return!1}get leaderboardsType(){return h.Z.NATIVE}#Ms;#ai=null;#oi=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(o.Mn.INITIALIZE),this.deviceType===d.me.DESKTOP&&(this.#ai=this.#ni(),this.#oi=this.#di()),(0,a.X_)(\"ytgame\").then((()=>{this._platformSdk=window.ytgame;const e=this._platformSdk;this._setPlatformStorageAvailable(!0);const t=e.system.getLanguage().then((e=>{this.#Ms=e.length>2?e.slice(0,2):e}));e.system.onAudioEnabledChange((e=>{this._setAudioState(e)})),this.#li(),document.addEventListener(\"visibilitychange\",(()=>{document.visibilityState===n.YU.VISIBLE&&this.#li()})),window.addEventListener(\"pageshow\",(()=>{this.#li()})),e.system.onPause((()=>{this._setPauseState(!0),this.#hi()})),e.system.onResume((()=>{this._setPauseState(!1),i.Z.hide(),this.#li()})),Promise.all([t]).finally((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(o.Mn.INITIALIZE),e.game.firstFrameReady()}))}))),e.promise}getDataFromStorage(){return this._platformSdk.game.loadData().then((e=>{if(\"string\"==typeof e&&\"\"!==e)try{return JSON.parse(e)}catch{return{}}return{}}))}async setDataToStorage(e){const t=await this.getDataFromStorage();Object.keys(e).forEach((r=>{t[r]=e[r]})),await this._platformSdk.game.saveData(JSON.stringify(t))}async deleteDataFromStorage(e){const t=await this.getDataFromStorage();e.forEach((e=>{delete t[e]})),await this._platformSdk.game.saveData(JSON.stringify(t))}sendMessage(e,t){return e===n.Dt.GAME_READY?(this._platformSdk.game.gameReady(),this.#ai&&(this.#ai.remove(),this.#ai=null),this.#oi&&(this.#oi.remove(),this.#oi=null),Promise.resolve()):super.sendMessage(e)}showInterstitial(){this._setInterstitialState(l.WA.OPENED),this._platformSdk.ads.requestInterstitialAd().then((()=>{this._setInterstitialState(l.WA.CLOSED)})).catch((()=>{this._showAdFailurePopup(!1)}))}showRewarded(e){this._setRewardedState(l.b3.OPENED),this._platformSdk.ads.requestRewardedAd(e).then((e=>{e&&this._setRewardedState(l.b3.REWARDED),this._setRewardedState(l.b3.CLOSED)})).catch((()=>{this._showAdFailurePopup(!0)}))}leaderboardsSetScore(e,t,r){if(!r)return Promise.reject();let s=this._getPromiseDecorator(o.Mn.LEADERBOARDS_SET_SCORE);if(!s){s=this._createPromiseDecorator(o.Mn.LEADERBOARDS_SET_SCORE);const e=\"string\"==typeof t?parseInt(t,10):t;this._platformSdk.engagement.sendScore({value:e}).then((()=>{this._resolvePromiseDecorator(o.Mn.LEADERBOARDS_SET_SCORE)})).catch((e=>{this._rejectPromiseDecorator(o.Mn.LEADERBOARDS_SET_SCORE,e)}))}return s.promise}#li(){this._setAudioState(this._platformSdk.system.isAudioEnabled())}#hi(){const e=this._pauseStateAggregator?.getState(\"interstitial\"),t=this._pauseStateAggregator?.getState(\"rewarded\");e||t||i.Z.show()}#ni(){if(!document.getElementById(\"bridge-youtube-subscribe-styles\")){const e=document.createElement(\"style\");e.id=\"bridge-youtube-subscribe-styles\",e.textContent=\"\\n #bridge-youtube-subscribe {\\n position: fixed;\\n inset: 0;\\n pointer-events: none;\\n transform-origin: 168px calc(100% - 56px);\\n z-index: 9999999;\\n animation: bridge-yt-press 650ms ease-in-out 1270ms forwards;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-button {\\n position: fixed;\\n bottom: -24px;\\n left: 24px;\\n width: 220.8px;\\n height: 64px;\\n border-radius: 107.8px;\\n padding: 11.2px 25.6px 12.8px 25.6px;\\n background-color: #9747FF;\\n box-shadow: inset 0 0 17.06px 0 rgba(151, 71, 255, 0.7), inset 0 0 16px 0 rgba(255, 255, 255, 0.7);\\n box-sizing: border-box;\\n border: none;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n opacity: 0;\\n overflow: hidden;\\n white-space: nowrap;\\n pointer-events: none;\\n animation:\\n bridge-yt-rise-button 285ms ease-out 590ms forwards,\\n bridge-yt-button-shrink 295ms cubic-bezier(0.4, 0, 0.2, 1) 2100ms forwards;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-title {\\n width: 168.8px;\\n height: 28.8px;\\n display: block;\\n flex-shrink: 0;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-ball {\\n position: fixed;\\n bottom: -88px;\\n left: 248px;\\n width: 64px;\\n height: 64px;\\n border-radius: 50%;\\n background-color: #9747FF;\\n box-shadow: inset 0 0 17.06px 0 rgba(151, 71, 255, 0.7), inset 0 0 16px 0 rgba(255, 255, 255, 0.7);\\n box-sizing: border-box;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n opacity: 0;\\n animation:\\n bridge-yt-rise-ball 285ms ease-out 630ms forwards,\\n bridge-yt-ball-roll 470ms cubic-bezier(0.34, 1.2, 0.5, 1) 2100ms forwards;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-ball svg {\\n position: absolute;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-arrow {\\n width: 25.6px;\\n height: 25.6px;\\n opacity: 1;\\n animation: bridge-yt-arrow-fade-out 235ms ease 2220ms forwards;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-hand {\\n width: 28.8px;\\n height: 28.8px;\\n opacity: 0;\\n animation: bridge-yt-hand-fade-in 235ms ease 2335ms forwards;\\n }\\n\\n @keyframes bridge-yt-rise-button {\\n 0% { bottom: -24px; opacity: 0; }\\n 40% { bottom: 25.6px; opacity: 1; }\\n 48% { bottom: 33.6px; }\\n 60% { bottom: 32px; }\\n 70% { bottom: 30.4px; }\\n 79% { bottom: 28.8px; }\\n 88% { bottom: 27.2px; }\\n 95% { bottom: 25.6px; }\\n 100% { bottom: 24px; opacity: 1; }\\n }\\n @keyframes bridge-yt-rise-ball {\\n 0% { bottom: -88px; opacity: 0; }\\n 40% { bottom: 25.6px; opacity: 1; }\\n 48% { bottom: 33.6px; }\\n 60% { bottom: 32px; }\\n 70% { bottom: 30.4px; }\\n 79% { bottom: 28.8px; }\\n 88% { bottom: 27.2px; }\\n 95% { bottom: 25.6px; }\\n 100% { bottom: 24px; opacity: 1; }\\n }\\n @keyframes bridge-yt-press {\\n 0% { transform: scale(1); }\\n 25% { transform: scale(0.94); }\\n 40% { transform: scale(0.9); }\\n 65% { transform: scale(1.01); }\\n 82% { transform: scale(0.995); }\\n 100% { transform: scale(1); }\\n }\\n @keyframes bridge-yt-button-shrink {\\n 0% { width: 220.8px; opacity: 1; }\\n 100% { width: 64px; opacity: 0; }\\n }\\n @keyframes bridge-yt-ball-roll {\\n 0% { left: 248px; transform: rotate(0deg); }\\n 100% { left: 24px; transform: rotate(-360deg); }\\n }\\n @keyframes bridge-yt-arrow-fade-out {\\n to { opacity: 0; }\\n }\\n @keyframes bridge-yt-hand-fade-in {\\n to { opacity: 1; }\\n }\\n \",document.head.appendChild(e)}const e=document.createElement(\"div\");return e.id=\"bridge-youtube-subscribe\",e.innerHTML='\\n
\\n \\n \\n \\n
\\n
\\n \\n \\n \\n \\n \\n \\n
\\n ',document.body.appendChild(e),e}#di(){const e=(this._options.videoPreviews??[]).filter((e=>Boolean(e?.image&&e?.videoId)));if(0===e.length)return null;const{image:t,videoId:r}=e[Math.floor(Math.random()*e.length)];if(!document.getElementById(\"bridge-youtube-video-preview-styles\")){const e=document.createElement(\"style\");e.id=\"bridge-youtube-video-preview-styles\",e.textContent=\"\\n #bridge-youtube-video-preview {\\n position: fixed;\\n bottom: -24px;\\n right: 24px;\\n width: min(256px, 40vw);\\n border-radius: 16px;\\n overflow: hidden;\\n background-color: #000;\\n box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.4);\\n cursor: pointer;\\n opacity: 0;\\n z-index: 9999999;\\n animation: bridge-yt-preview-rise 285ms ease-out 590ms forwards;\\n }\\n\\n #bridge-youtube-video-preview .bridge-yt-preview-image {\\n display: block;\\n width: 100%;\\n aspect-ratio: 16 / 9;\\n object-fit: cover;\\n user-select: none;\\n -webkit-user-drag: none;\\n }\\n\\n #bridge-youtube-video-preview .bridge-yt-preview-play {\\n position: absolute;\\n top: 50%;\\n left: 50%;\\n width: 48px;\\n height: 34px;\\n transform: translate(-50%, -50%);\\n pointer-events: none;\\n }\\n\\n @keyframes bridge-yt-preview-rise {\\n 0% { bottom: -24px; opacity: 0; }\\n 40% { bottom: 25.6px; opacity: 1; }\\n 48% { bottom: 33.6px; }\\n 60% { bottom: 32px; }\\n 70% { bottom: 30.4px; }\\n 79% { bottom: 28.8px; }\\n 88% { bottom: 27.2px; }\\n 95% { bottom: 25.6px; }\\n 100% { bottom: 24px; opacity: 1; }\\n }\\n \",document.head.appendChild(e)}const s=document.createElement(\"div\");s.id=\"bridge-youtube-video-preview\";const i=document.createElement(\"img\");return i.className=\"bridge-yt-preview-image\",i.src=t,i.alt=\"\",i.draggable=!1,s.appendChild(i),s.insertAdjacentHTML(\"beforeend\",'\\n \\n \\n \\n \\n '),s.addEventListener(\"click\",(()=>{window.ytgame?.engagement.openYTContent({id:r}).catch((()=>{}))})),document.body.appendChild(s),s}}const u=c},8960:(e,t,r)=>{r.d(t,{pb:()=>i,ZT:()=>s,CS:()=>o,RH:()=>p,ZP:()=>_,D1:()=>S.D,dY:()=>m,n_:()=>d,eE:()=>l,Tg:()=>h,ju:()=>u,kh:()=>g,X_:()=>c});const s=function(e,t={}){return new Promise(((r,s)=>{const i=document.createElement(\"script\");i.src=e;for(let e=0;es(new Error(`Failed to load: ${e}`)))),document.head.appendChild(i)}))},i=({adSenseId:e,channelId:t,hostId:r,interstitialPlacementId:s,rewardedPlacementId:i,adFrequencyHint:a=\"180s\",testMode:o=!1},n={})=>new Promise(((d,l)=>{const h=document.createElement(\"script\");h.src=\"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\",h.setAttribute(\"data-ad-client\",e),t?h.setAttribute(\"data-ad-channel\",t):r&&h.setAttribute(\"data-ad-host\",r),s&&h.setAttribute(\"data-admob-interstitial-slot\",s),i&&h.setAttribute(\"data-admob-rewarded-slot\",i),o&&h.setAttribute(\"data-adbreak-test\",\"on\"),h.setAttribute(\"data-ad-frequency-hint\",a),h.setAttribute(\"crossorigin\",\"anonymous\"),h.addEventListener(\"load\",(()=>{const e=window.adsbygoogle??[];window.adsbygoogle=e,e.push({preloadAdBreaks:\"on\",sound:\"on\",onReady:()=>{},...n}),d((t=>e.push(t)))})),h.addEventListener(\"error\",(()=>{l(new Error(\"adsbygoogle script failed to load\"))})),document.head.appendChild(h)})),a=\"bridge-browser-defaults-protection\";function o(){if(document.getElementById(a))return;const e=document.createElement(\"style\");e.id=a,e.textContent=\"\\n html, body {\\n -webkit-user-select: none;\\n user-select: none;\\n -webkit-touch-callout: none;\\n overscroll-behavior: contain;\\n }\\n input, textarea, [contenteditable] {\\n -webkit-user-select: text;\\n user-select: text;\\n -webkit-touch-callout: default;\\n }\\n \",document.head.appendChild(e),document.addEventListener(\"contextmenu\",(e=>e.preventDefault()))}const n=[\"post\",\"Message\"].join(\"\");function d(e,t=\"*\"){window.parent&&window.parent[n](e,t)}function l(e){window.system&&window.system[n](e)}function h(e){window.chrome&&window.chrome.webview&&\"function\"==typeof window.chrome.webview.postMessage&&window.chrome.webview[n](e)}const c=function(...e){return e.length<=0?Promise.resolve():new Promise((t=>{const r=setInterval((()=>{let s=window;for(let t=0;tt.indexOf(\".\")?parseFloat(t.replace(/\\./g,\"\").replace(\",\",\".\")):t.includes(\",\")&&-1!==t.lastIndexOf(\",\")&&t.lastIndexOf(\",\")===t.length-4?parseInt(t.replace(/,/,\"\"),10):t.includes(\",\")&&-1!==t.lastIndexOf(\",\")&&t.lastIndexOf(\",\")!==t.length-3?parseFloat(t.replace(\",\",\".\")):t.includes(\".\")&&-1!==t.lastIndexOf(\".\")&&t.lastIndexOf(\".\")===t.length-4?parseInt(t.replace(/\\./,\"\"),10):t.includes(\".\")?parseFloat(t):parseInt(t,10)}function g(e){return m(e)?Promise.resolve(e):fetch(e).then((e=>e.blob())).then((e=>new Promise(((t,r)=>{const s=new FileReader;s.onloadend=()=>t(s.result),s.onerror=()=>r(s.error),s.readAsDataURL(e)}))))}var S=r(9146)},9146:(e,t,r)=>{function s(){const e=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";return`${Array.from({length:8},(()=>e.charAt(Math.floor(62*Math.random())))).join(\"\")}${Date.now().toString(36)}`}r.d(t,{D:()=>s})}},t={};function r(s){var i=t[s];if(void 0!==i)return i.exports;var a=t[s]={exports:{}};return e[s](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},(()=>{var e=r(8902),t=r(3806),s=r(66),i=r(9221),a=r(1558),o=r(6039);const n=\"loading-overlay\",d=\"logo\",l=\"fillRect\",h=\"gradientMover\",c=\"loading-hint\",u={viewBox:\"0 0 633 819\",paths:[\"M632 1V632H1V1H632ZM350 125.586V507.414L380.586 538H546V451H478.599L478.308 451.278L454.598 474H443.406L450.944 452.328L451 452.169V187.459L457.369 182H546V95H380.586L350 125.586ZM283 125.586L252.414 95H87V182H175.631L182 187.459V445.54L175.631 451H87V538H252.414L283 507.414V125.586Z\",\"M633 687V660H548V687H560V791H548V819H633V792H601L592 801H587L590 792V752H627V725H590V687H633Z\",\"M533 718V675L518 660H450L435 675V802L450 819H518L533 804V734H482V761H503V788L499 792H476L467 801H462L465 792V691L469 687H499L503 691V718H533Z\",\"M402 660H310V687H322V792H310V819H402L417 804V675L402 660ZM387 788L383 792H363L354 801H349L352 792V687H383L387 691V788Z\",\"M295 687V660H239V687H251V792H239V819H295V792H283V687H295Z\",\"M215 791L200 760H209L224 745V675L209 660H121V687H132V792H121V819H162V760H166L193 819H227V791H215ZM194 729L190 733H173L164 742H159L162 733V687H190L194 691V729Z\",\"M106 724V675L91 660H0V687H12V792H0V819H91L106 804V749L89 744V728L106 724ZM73 788L69 792H53L44 801H39L42 792V752H73V788ZM73 725H53L44 734H39L42 725V687H69L73 691V725Z\"],fillColor:\"#aa76ff\",strokeColor:\"#aa76ff\",gradientStops:[{offset:\"0.235577\",color:\"#aa76ff\"},{offset:\"0.240685\",color:\"white\"},{offset:\"0.659749\",color:\"#aa76ff\"}],gradientWidthMultiplier:4},p={viewBox:\"0 0 633 986\",paths:[\"M224.044 880.996V933.01H247.059V880.996H269.036V954.011C269.036 972.997 256.033 986 234.056 986H202.067V967.991H231.064C242.053 967.991 247.059 960.97 247.059 952.973V949.981H202.067V880.996H224.044Z\",{d:\"M355.051 880.996V952.912C355.051 971.959 340.094 985.939 320.071 985.939H289.059V966.953H319.033C328.007 966.953 333.013 960.97 333.013 952.973V949.981H317.019C297.972 949.981 281.001 935.024 281.001 915C281.001 896.014 298.033 880.996 317.019 880.996H355.051ZM320.01 897.968C310.975 897.968 304.992 904.927 304.992 914.939C304.992 925.928 311.036 932.949 320.01 932.949H333.013V897.968H320.01Z\",fillRule:\"evenodd\"},{d:\"M34.0643 880.996C53.05 880.996 71.0593 895.953 71.0593 915C71.0593 934.963 53.05 949.981 34.0643 949.981H22.0378V970.982H0.0608089V880.996H34.0643ZM22.0378 897.968V932.949H32.0498C41.0238 932.949 47.0672 925.989 47.0672 914.939C47.0672 904.989 41.0238 897.968 32.0498 897.968H22.0378Z\",fillRule:\"evenodd\"},\"M105.062 870.007V949.981H81.0707V870.007H105.062Z\",{d:\"M187.049 880.996V949.981H152.069C133.022 949.981 116.051 935.024 116.051 915C116.051 896.014 133.083 880.996 152.069 880.996H187.049ZM154.999 897.968C145.964 897.968 139.981 904.927 139.981 914.939C139.981 925.928 146.025 932.949 154.999 932.949H165.011V897.968H154.999Z\",fillRule:\"evenodd\"},{d:\"M436 880.996V949.981H401.02C381.973 949.981 365.002 935.024 365.002 915C365.002 896.014 382.034 880.996 401.02 880.996H436ZM404.011 897.968C394.976 897.968 388.994 904.927 388.994 914.939C388.994 925.928 395.037 932.949 404.011 932.949H414.023V897.968H404.011Z\",fillRule:\"evenodd\"},\"M521.039 880.996C538.987 880.996 551.99 894 551.99 912.009V949.981H530.013V908.957C530.013 903.951 525.984 897.968 520.001 897.968H512.004V949.981H490.027V897.968H472.018V949.981H450.041V880.996H521.039Z\",{d:\"M633 880.996V949.981H598.019C579.034 949.981 563.039 935.024 563.039 915C563.039 896.014 579.034 880.996 598.019 880.996H633ZM603.025 897.968C593.014 897.968 587.031 904.927 587.031 914.939C587.031 925.928 593.014 932.949 603.025 932.949H611.023V897.968H603.025Z\",fillRule:\"evenodd\"},\"M522.993 663.967L538.01 678.986V732.037H504.068V695.041L500.038 691.012H482.029L478.001 695.041V829.044L475.009 838.018H480.015L488.989 829.044H499.978L504.007 825.015V775.015H491.004V748.032H538.01V841.009L522.993 856.027H459.015L443.997 838.994V678.986L459.015 663.967H522.993Z\",\"M633 664.029V691.073H601.011V739.057H627.017V766.041H601.011V829.044L598.019 838.018H603.025L611.999 829.044H633V856.027H553.028V828.006H567.007V691.012H553.028V664.029H633Z\",{d:\"M89.0069 664.029L104.025 679.046V738.02L87.0533 741.927V757.922L104.025 762.928V840.948L89.0069 855.966H0V828.983H13.9801V691.012H0V664.029H89.0069ZM47.983 765.98V828.983L44.992 837.956H49.998L59.0329 828.983H65.9919L70.0214 824.953H69.96V765.98H47.983ZM47.983 691.012V738.997L44.992 747.971H49.998L59.0329 738.997H70.0214V695.041L65.9919 691.012H47.983Z\",fillRule:\"evenodd\"},{d:\"M210.003 664.029L225.02 679.046V759.02L210.003 774.039L217.023 828.006V827.945H227.951V855.966H184.973L176.976 773.977H166.964V855.966H118.981V828.983H132.961V691.012H118.981V664.029H210.003ZM167.025 691.012V746.994L164.034 755.968H169.04L178.014 746.994H186.988L191.017 742.965H191.078V695.041L187.049 691.012H167.025Z\",fillRule:\"evenodd\"},\"M302.001 664.029V691.012H288.021V828.983H302.001V855.966H239.977V828.983H253.957V691.012H239.977V664.029H302.001Z\",{d:\"M411.032 663.967L426.05 678.924V840.887L411.032 855.905H317.019V828.921H330.999V690.951H317.019V663.967H411.032ZM365.002 691.012V828.983L362.011 837.956H367.017L376.052 828.983H388.078L392.046 824.953H391.985V695.041L388.017 691.012H365.002Z\",fillRule:\"evenodd\"},{d:\"M633 0V635.946H0.0608089V0H633ZM88.0298 92.0008V177.042H176.06L183.02 183.024V446.023L176.06 452.006H88.0298V536.986H252.003L252.004 536.986H252.065L282.039 507.011V121.976L252.065 92.0008H88.0298ZM382.034 92.0008L351.999 122.037V507.011L382.034 536.986H546.007L546.008 452.006H480.015L456.024 475.021H443.021L451.018 452.006V183.024L458.038 177.042H546.008V92.0616L546.007 92.0008H382.034Z\",fillRule:\"evenodd\"}],fillColor:\"#aa76ff\",strokeColor:\"#aa76ff\",gradientStops:[{offset:\"0.235577\",color:\"#aa76ff\"},{offset:\"0.240685\",color:\"white\"},{offset:\"0.659749\",color:\"#aa76ff\"}],gradientWidthMultiplier:4},m=[\"Loading GPU\",\"Parsing AST\",\"Linking libs\",\"Baking mesh\",\"Warming JIT\",\"Tracing rays\",\"Packing data\",\"Flushing GPU\",\"Loading WASM\",\"Alloc memory\",\"Init shaders\",\"Optimize FPS\",\"Sync textures\",\"Build navmesh\",\"Compile code\",\"Load physics\",\"Stream assets\",\"Cache buffers\",\"Map controls\",\"Decode audio\",\"Init network\",\"Setup scene\"];const _=class{#ci=null;#ui=!1;#pi=null;setHideGate(e){this.#pi=e}show({showFullLogo:e=!1,showLoadingText:t=!1}={}){this.#st();const r=this.#mi(),s=e?p:u;r.appendChild(this.#_i(s)),t&&this.#gi(r)}setProgress(e,t=!1){if(this.#ui)return;if(t&&null!==this.#ci)return;const r=document.getElementById(l),s=document.getElementById(h),i=document.getElementById(d),a=document.getElementById(n);if(!(r&&s&&i&&a))return;this.#ci=e;const o=Math.max(0,Math.min(100,e)),c=100-o;if(r.style.transform=`translateY(${c}%)`,100===o){this.#ui=!0;const e=()=>{setTimeout((()=>{r.style.display=\"none\",s.style.display=\"block\",s.classList.add(\"gradient-mover\")}),400),setTimeout((()=>i.classList.add(\"logo-fade-out\")),900),setTimeout((()=>a.remove()),1400)};if(this.#pi){const t=new Promise((e=>{setTimeout(e,3e3)}));Promise.race([this.#pi.catch((()=>{})),t]).then(e)}else e()}else s.classList.remove(\"gradient-mover\")}#st(){const e=document.createElement(\"style\");e.textContent=`\\n .fullscreen {\\n background: #242424;\\n width: 100vw;\\n height: 100vh;\\n position: absolute;\\n top: 0px;\\n left: 0px;\\n }\\n\\n #${n} {\\n font-size: 20px;\\n z-index: 9999999;\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n }\\n\\n #${d} {\\n width: 10%;\\n max-width: 300px;\\n min-width: 120px;\\n overflow: visible;\\n }\\n\\n #${c} {\\n width: 8%;\\n max-width: 240px;\\n min-width: 96px;\\n margin-top: clamp(17px, 1.7vw, 33px);\\n text-align: center;\\n color: #aa76ff;\\n font-size: clamp(11px, 1.3vw, 16px);\\n font-family: -apple-system, BlinkMacSystemFont, sans-serif;\\n letter-spacing: 0.04em;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n transition: opacity 0.4s ease;\\n }\\n\\n .fill-rect {\\n transform: translateY(100%);\\n transition: transform 0.3s ease-out;\\n }\\n\\n #${h} {\\n display: none;\\n }\\n\\n .gradient-mover {\\n animation: moveGradient 0.4s linear;\\n }\\n\\n @keyframes moveGradient {\\n 0% { transform: translateX(0); }\\n 100% { transform: translateX(-250%); }\\n }\\n\\n .logo-fade-out {\\n animation: logoFadeOut 1s linear;\\n }\\n\\n .logo-fade-out path {\\n fill: white;\\n stroke: white;\\n }\\n\\n @keyframes logoFadeOut {\\n 0% { opacity: 1; }\\n 50% { opacity: 0; }\\n 100% { opacity: 0; }\\n }\\n `,document.head.appendChild(e)}#mi(){const e=document.createElement(\"div\");return e.id=n,e.className=\"fullscreen\",document.body.appendChild(e),e}#_i(e){const t=e.gradientWidthMultiplier??4,[,,r,s]=e.viewBox.split(/[ ,]+/),i=Number(r),a=Number(s),o=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");o.setAttribute(\"id\",d),o.setAttribute(\"viewBox\",e.viewBox),o.setAttribute(\"fill\",\"none\"),o.setAttribute(\"xmlns\",\"http://www.w3.org/2000/svg\");const n=document.createElementNS(o.namespaceURI,\"defs\"),c=document.createElementNS(o.namespaceURI,\"mask\");c.setAttribute(\"id\",\"logo-mask\");const u=document.createElementNS(o.namespaceURI,\"rect\");u.setAttribute(\"x\",\"0\"),u.setAttribute(\"y\",\"0\"),u.setAttribute(\"width\",\"100%\"),u.setAttribute(\"height\",\"100%\"),u.setAttribute(\"fill\",\"black\"),c.appendChild(u),e.paths.forEach((e=>{const t=document.createElementNS(o.namespaceURI,\"path\");t.setAttribute(\"d\",\"string\"==typeof e?e:e.d),t.setAttribute(\"fill\",\"object\"==typeof e&&e.maskFill?e.maskFill:\"white\"),\"object\"==typeof e&&e.fillRule&&t.setAttribute(\"fill-rule\",e.fillRule),c.appendChild(t)})),n.appendChild(c);const p=document.createElementNS(o.namespaceURI,\"linearGradient\");p.setAttribute(\"id\",\"shineGradient\"),p.setAttribute(\"x1\",String(2*i)),p.setAttribute(\"y1\",\"0\"),p.setAttribute(\"x2\",String(3*i)),p.setAttribute(\"y2\",String(a)),p.setAttribute(\"gradientUnits\",\"userSpaceOnUse\"),e.gradientStops.forEach((({offset:e,color:t})=>{const r=document.createElementNS(o.namespaceURI,\"stop\");r.setAttribute(\"offset\",e),r.setAttribute(\"stop-color\",t),p.appendChild(r)})),n.appendChild(p),o.appendChild(n);const m=document.createElementNS(o.namespaceURI,\"g\");m.setAttribute(\"mask\",\"url(#logo-mask)\");const _=document.createElementNS(o.namespaceURI,\"rect\");_.setAttribute(\"id\",h),_.setAttribute(\"x\",\"0\"),_.setAttribute(\"y\",\"0\"),_.setAttribute(\"width\",String(i*t)),_.setAttribute(\"height\",String(a)),_.setAttribute(\"fill\",\"url(#shineGradient)\"),_.style.transform=\"translateX(0)\",m.appendChild(_),o.appendChild(m);const g=document.createElementNS(o.namespaceURI,\"g\");g.setAttribute(\"mask\",\"url(#logo-mask)\");const S=document.createElementNS(o.namespaceURI,\"rect\");S.setAttribute(\"id\",l),S.setAttribute(\"class\",\"fill-rect\"),S.setAttribute(\"x\",\"0\"),S.setAttribute(\"y\",\"0\"),S.setAttribute(\"width\",\"100%\"),S.setAttribute(\"height\",String(a)),S.setAttribute(\"fill\",e.fillColor),g.appendChild(S),o.appendChild(g);const A=String(Math.round(3*i/633));return e.paths.forEach((t=>{if(\"object\"==typeof t&&\"black\"===t.maskFill)return;const r=document.createElementNS(o.namespaceURI,\"path\");r.setAttribute(\"d\",\"string\"==typeof t?t:t.d),r.setAttribute(\"stroke\",e.strokeColor),r.setAttribute(\"stroke-width\",A),\"object\"==typeof t&&t.fillRule&&r.setAttribute(\"fill-rule\",t.fillRule),o.appendChild(r)})),o}#gi(e){const t=document.createElement(\"div\");t.id=c,t.style.opacity=\"0\";let r=Math.floor(Math.random()*m.length);t.textContent=m[r],e.appendChild(t);const s=()=>1e3*(2+Math.random());let i=null;const a=()=>{i=setTimeout((()=>{t.style.opacity=\"0\",setTimeout((()=>{r=(r+1)%m.length,t.textContent=m[r],t.style.opacity=\"1\",a()}),400)}),s())};i=setTimeout((()=>{t.style.opacity=\"1\",a()}),s());const o=new MutationObserver((t=>{t.forEach((t=>{t.removedNodes.forEach((t=>{t===e&&(i&&clearTimeout(i),o.disconnect())}))}))}));o.observe(document.body,{childList:!0})}};var g=r(1302);const S=class{get finished(){return this.#Si.promise}#Ai;#Si=new o.Z;#Ei=!1;constructor({url:e}){this.#Ai=new Audio(e),this.#Ai.preload=\"auto\",this.#Ai.addEventListener(\"ended\",(()=>this.#fi())),this.#Ai.addEventListener(\"error\",(()=>this.#fi(`Loading sound failed to load: ${e}`))),this.#Ai.load()}play(){this.#Ei||this.#Ai.play().catch((e=>{this.#fi(`Loading sound playback rejected: ${e?.message||String(e)}`)}))}cancel(){this.#Ai.pause(),this.#fi()}#fi(e){this.#Ei||(this.#Ei=!0,e&&g.ZP.warn(e),this.#Si.resolve())}},A=\"bridge-safe-area-styles\";const E=class{static getInsets(){const e=document.createElement(\"div\");e.style.cssText=\"position:fixed;top:env(safe-area-inset-top);bottom:env(safe-area-inset-bottom);left:env(safe-area-inset-left);right:env(safe-area-inset-right);pointer-events:none;visibility:hidden;\",document.body.appendChild(e);const t=e.getBoundingClientRect(),r={top:t.top,bottom:window.innerHeight-t.bottom,left:t.left,right:window.innerWidth-t.right};return e.remove(),r}static applyStyles(){if(document.getElementById(A))return;const e=document.createElement(\"style\");e.id=A,e.textContent=\"\\n html, body {\\n height: calc(100% - env(safe-area-inset-top) - env(safe-area-inset-bottom));\\n padding-top: env(safe-area-inset-top);\\n padding-bottom: env(safe-area-inset-bottom);\\n box-sizing: border-box;\\n }\\n \",document.head.appendChild(e)}};var f=r(5230),P=r(5819),I=r(9778),y=r(6170);class D extends I.Z{get id(){return this._platformBridge.platformId}get sdk(){return this._platformBridge.platformSdk}get language(){return this._platformBridge.platformLanguage}get payload(){return this._platformBridge.platformPayload}get tld(){return this._platformBridge.platformTld}get launchSource(){return this._platformBridge.launchSource}get isExternalCallsSupported(){return this._platformBridge.isPlatformExternalCallsSupported}get isExternalLinksAllowed(){return this._platformBridge.isPlatformExternalLinksAllowed}get isAudioEnabled(){return this._platformBridge.isPlatformAudioEnabled}get isPaused(){return this._platformBridge.isPlatformPaused}#Pi=!1;#Ii=0;#yi=new Set([t.Dt.GAMEPLAY_STARTED,t.Dt.GAMEPLAY_STOPPED,t.Dt.IN_GAME_LOADING_STARTED,t.Dt.IN_GAME_LOADING_STOPPED]);initialize(t){return super.initialize(t),this.#Ii=performance.now(),this._forwardEvent(e.W1.AUDIO_STATE_CHANGED),this._forwardEvent(e.W1.PAUSE_STATE_CHANGED),this}sendMessage(r,s){const i=s??{},o={};if(r===t.Dt.GAME_READY){if(this.#Pi)return Promise.reject();this.#Pi=!0;const e=performance.now();o.time_s=((e-this.#Ii)/1e3).toFixed(2);const t=document.getElementById(\"loading-overlay\");t&&t.remove()}return void 0!==i.world&&(o.world=String(i.world)),void 0!==i.level&&(o.level=String(i.level)),this.#yi.has(r)||y.rh.send(`${e.oF.PLATFORM}_message_${r}`,o),a.ZP.emit(e.W1.PLATFORM_MESSAGE_SENT,r),this._platformBridge.sendMessage(r,i)}sendCustomMessage(t,r){return y.rh.send(`${e.oF.PLATFORM}_custom_message`,{id:t}),a.ZP.emit(e.W1.PLATFORM_MESSAGE_SENT,t),this._platformBridge.sendCustomMessage(t,r)}getServerTime(){return this._platformBridge.getServerTime()}}(0,a.iL)(D.prototype);const T=new D;var w=r(3941),v=r(9979),R=r(8467),b=r(8960);class C extends I.Z{get isInviteFriendsSupported(){return this._platformBridge.isInviteFriendsSupported}get isJoinCommunitySupported(){return this._platformBridge.isJoinCommunitySupported}get isShareSupported(){return this._platformBridge.isShareSupported}get isCreatePostSupported(){return this._platformBridge.isCreatePostSupported}get isAddToHomeScreenSupported(){return this._platformBridge.isAddToHomeScreenSupported}get isAddToHomeScreenRewardSupported(){return this._platformBridge.isAddToHomeScreenRewardSupported}get isAddToFavoritesSupported(){return this._platformBridge.isAddToFavoritesSupported}get isAddToFavoritesRewardSupported(){return this._platformBridge.isAddToFavoritesRewardSupported}get isRateSupported(){return this._platformBridge.isRateSupported}inviteFriends(e){return this._platformBridge.isInviteFriendsSupported?this._platformBridge.inviteFriends(this.#t(\"inviteFriends\",e)):Promise.reject()}joinCommunity(e){return this._platformBridge.isJoinCommunitySupported?this._platformBridge.joinCommunity(this.#t(\"joinCommunity\",e)):Promise.reject()}share(e){return this._platformBridge.isShareSupported?this._platformBridge.share(this.#t(\"share\",e)):Promise.reject()}createPost(e){return this._platformBridge.isCreatePostSupported?this._platformBridge.createPost(this.#t(\"createPost\",e)):Promise.reject()}addToHomeScreen(){return this._platformBridge.isAddToHomeScreenSupported?this._platformBridge.addToHomeScreen():Promise.reject()}getAddToHomeScreenReward(){return this._platformBridge.isAddToHomeScreenRewardSupported?this._platformBridge.getAddToHomeScreenReward():Promise.reject()}addToFavorites(){return this._platformBridge.isAddToFavoritesSupported?this._platformBridge.addToFavorites():Promise.reject()}getAddToFavoritesReward(){return this._platformBridge.isAddToFavoritesRewardSupported?this._platformBridge.getAddToFavoritesReward():Promise.reject()}rate(){return this._platformBridge.isRateSupported?this._platformBridge.rate():Promise.reject()}#t(e,t){return function(e,t,r){const s=e?.[t],i=s&&\"object\"==typeof s?s:{},a=r??{};return(0,b.RH)(i,a)}(this._platformBridge.options?.social,e,t)}}const L=new C;var O=r(3117);class M extends I.Z{get type(){return this._platformBridge.deviceType}get os(){return this._platformBridge.deviceOs}get orientation(){return this.#Di}get safeArea(){return this._platformBridge.safeArea??E.getInsets()}#Di=null;#Ti=null;#wi=null;#vi=!1;#Ri=0;#bi=0;#Ci=null;initialize(e){return super.initialize(e),this.#Li(),this.#Oi(),this}#Li(){this.#Di=(0,O.f)(),window.screen.orientation?window.screen.orientation.addEventListener(\"change\",(()=>this.#Mi())):window.addEventListener(\"orientationchange\",(()=>this.#Mi())),window.addEventListener(\"resize\",(()=>this.#Mi())),this.#Ni()}#Ni(){const{deviceType:e}=this._platformBridge;if(!(e===s.me.MOBILE||e===s.me.TABLET))return;const t=f.ZP.getValues().device;this.#vi=t?.useBuiltInOrientationPopup??!1,this.#wi=t?.supportedOrientations??[s.AR.PORTRAIT,s.AR.LANDSCAPE],this.#ki()}#Mi(){const t=(0,O.f)();t!==this.#Di&&(this.#Di=t,a.ZP.emit(e.W1.ORIENTATION_STATE_CHANGED,this.#Di),this.#ki())}#ki(){if(!this.#vi)return;if(!this.#wi||1!==this.#wi.length)return void this.#Hi();const e=this.#wi[0];this.#Di!==e?this.#Bi():this.#Hi()}#Bi(){this.#Ti||(this.#Ti=function(){if(!document.getElementById(\"bridge-orientation-overlay-styles\")){const e=document.createElement(\"style\");e.id=\"bridge-orientation-overlay-styles\",e.textContent=`\\n #${s.Uw} {\\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(e)}const e=document.createElement(\"div\");e.id=s.Uw;const t=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");t.setAttribute(\"id\",\"bridge-orientation-icon\"),t.setAttribute(\"viewBox\",\"0 0 24 24\"),t.setAttribute(\"fill\",\"none\"),t.setAttribute(\"xmlns\",\"http://www.w3.org/2000/svg\"),t.innerHTML='\\n \\n \\n ';const r=document.createElement(\"div\");return r.id=\"bridge-orientation-message\",r.innerText=\"Please rotate your device\",e.appendChild(t),e.appendChild(r),e}(),document.body.appendChild(this.#Ti))}#Hi(){this.#Ti&&(this.#Ti.remove(),this.#Ti=null)}#Oi(){this.#Ri=window.innerWidth,this.#bi=window.innerHeight,window.addEventListener(\"resize\",(()=>this.#Gi()))}#Gi(){this.#Ci&&clearTimeout(this.#Ci),this.#Ci=setTimeout((()=>{const t=window.innerWidth,r=window.innerHeight;t===this.#Ri&&r===this.#bi||(this.#Ri=t,this.#bi=r,a.ZP.emit(e.W1.SCREEN_SIZE_CHANGED,{width:t,height:r}))}),200)}}(0,a.iL)(M.prototype);const N=new M;var k=r(7408);class H{get baseUrl(){return f.ZP.getValues().saas?.baseUrl||`${(0,P.ao)()}/api/bridge/v1`}get xHeaders(){return{\"x-player-id\":this.#F.playerId||\"\",\"x-platform-id\":this.#F.platformId,\"x-public-token\":f.ZP.getValues().saas?.publicToken||\"\"}}#F;constructor(e){this.#F=e}get(e){return fetch(`${this.baseUrl}/${e}`,{method:\"GET\",credentials:\"include\",headers:{\"Content-Type\":\"application/json\",...this.xHeaders}}).then((e=>e.json()))}post(e,t){return fetch(`${this.baseUrl}/${e}`,{method:\"POST\",body:JSON.stringify(t),credentials:\"include\",headers:{\"Content-Type\":\"application/json\",...this.xHeaders}}).then((e=>e.json()))}}class B extends I.Z{get type(){return this.#Fi?k.Z.IN_GAME:this._platformBridge.leaderboardsType}#Fi=null;initialize(t){return super.initialize(t),this._isSaas(e.oF.LEADERBOARDS)&&(this.#Fi=new H(t)),this}setScore(e,t){if(this.type===k.Z.NOT_AVAILABLE)return Promise.reject();if(this.#Fi)return this._platformBridge.playerId?this.#Fi.post(`leaderboards/${e}`,{score:t}):Promise.reject();const r=this._getPlatformLeaderboardId(e),s=this.#xi(e);return this._platformBridge.leaderboardsSetScore(r,t,s)}getEntries(e){if(this.type!==k.Z.IN_GAME)return Promise.reject();if(this.#Fi)return this.#Fi.get(`leaderboards/${e}`);const t=this._getPlatformLeaderboardId(e);return this._platformBridge.leaderboardsGetEntries(t)}showNativePopup(e){if(this._platformBridge.leaderboardsType!==k.Z.NATIVE_POPUP)return Promise.reject();const t=this._getPlatformLeaderboardId(e);return this._platformBridge.leaderboardsShowNativePopup(t)}_getPlatformLeaderboardId(e){if(!e)return e;const{leaderboards:t}=f.ZP.getValues();if(!t)return e;const r=t.find((t=>t.id===e));if(!r)return e;const s=r[this._platformBridge.platformId];return\"string\"==typeof s&&s?s:e}#xi(e){const{leaderboards:t}=f.ZP.getValues();if(!t)return!1;const r=t.find((t=>t.id===e));return!!r&&!0===r.isMain}}const G=new B;var F=r(1147);class x extends I.Z{get isSupported(){return this._platformBridge.isRemoteConfigSupported}#Ui={};setContext(e){this.#Ui={...this.#Ui,...e}}get(){return this._platformBridge.isRemoteConfigSupported?this._platformBridge.getRemoteConfig(this.#Ui):Promise.reject()}}const U=new x;class V extends I.Z{get isSupported(){return this._platformBridge.isClipboardSupported}read(){return this._platformBridge.isClipboardSupported?this._platformBridge.clipboardRead():Promise.reject()}write(e){return this._platformBridge.isClipboardSupported?this._platformBridge.clipboardWrite(e):Promise.reject()}}const Z=new V;var j=r(5334);class z extends I.Z{get isSupported(){return this._platformBridge.isNotificationsSupported}schedule(t){const r=this.#Vi(t);if(r)return Promise.reject(new e.Hd(e.Bq.NOTIFICATION_INVALID_PARAMETERS,r));const s=this.#Zi(t.id);return this._platformBridge.notificationsSchedule(t,s)}cancel(t){return\"string\"!=typeof t||0===t.length?Promise.reject(new e.Hd(e.Bq.NOTIFICATION_INVALID_PARAMETERS,'Notification \"id\" must be a non-empty string')):this._platformBridge.notificationsCancel(t,this.#Zi(t))}cancelAll(){return this._platformBridge.notificationsCancelAll()}#Vi(e){if(!e||\"object\"!=typeof e)return\"Notification must be an object\";if(\"string\"!=typeof e.id||0===e.id.length)return'Notification \"id\" must be a non-empty string';if(\"string\"!=typeof e.title||0===e.title.length)return'Notification \"title\" must be a non-empty string';if(\"string\"!=typeof e.description||0===e.description.length)return'Notification \"description\" must be a non-empty string';if(void 0!==e.delaySeconds&&(!Number.isInteger(e.delaySeconds)||e.delaySeconds<0))return'Notification \"delaySeconds\" must be a non-negative integer';const t=[\"image\",\"callToAction\",\"payload\"].find((t=>{const r=e[t];return void 0!==r&&\"string\"!=typeof r}));return t?`Notification \"${t}\" must be a string`:null}#Zi(e){const{notifications:t}=f.ZP.getValues();if(!t)return;const r=t.find((t=>t.id===e));if(!r)return;const s=r[this._platformBridge.platformId];return\"string\"==typeof s||\"number\"==typeof s?s:void 0}}const W=new z,K=\"bridge-daily-rewards-state\";class Y extends I.Z{#ji=[];#zi=!0;#Wi=!0;#L=null;#O=null;initialize(e){super.initialize(e);const t=f.ZP.getValues().dailyRewards;return this.#ji=Array.isArray(t?.rewards)?t.rewards:[],this.#zi=\"boolean\"!=typeof t?.cycle||t.cycle,this.#Wi=\"boolean\"!=typeof t?.resetOnMiss||t.resetOnMiss,this}async getRewards(){return[...this.#ji]}async getCurrentDay(){const e=await this.#Ki();return(await this.#Yi(e)).day}async getCurrentReward(){const e=await this.#Ki(),t=await this.#Yi(e);return this.#$i(t,e)?this.#ji[t.day]:null}async claimCurrentReward(){const t=await this.#Ki(),r=await this.#Yi(t);if(!this.#$i(r,t))return!1;const s=r.day;r.lastClaimEpochDay=t,r.day=this.#zi?(r.day+1)%this.#ji.length:r.day+1,await this.#N();const i={day:s,reward:this.#ji[s]};return a.ZP.emit(e.W1.DAILY_REWARDS_CLAIMED,i),!0}async#Yi(t){const r=await this.#M();if(this.#Wi&&null!==r.lastClaimEpochDay&&r.day>0&&t-r.lastClaimEpochDay>=2){const t=r.day;r.day=0,await this.#N();const s={day:t};a.ZP.emit(e.W1.DAILY_REWARDS_STREAK_RESET,s)}return r}#$i(e,t){return!(e.day>=this.#ji.length)&&(null===e.lastClaimEpochDay||t>e.lastClaimEpochDay)}async#Ki(){let e;try{e=await this._platformBridge.getServerTime()}catch{e=Date.now()}return\"number\"==typeof e&&Number.isFinite(e)||(e=Date.now()),Math.floor(e/864e5)}#M(){return this.#L?Promise.resolve(this.#L):(this.#O||(this.#O=v.Z.get(K,!0).then((e=>(this.#L=this.#k(e),this.#O=null,this.#L))).catch((()=>(this.#L=this.#H(),this.#O=null,this.#L)))),this.#O)}#N(){return this.#L?v.Z.set(K,this.#L):Promise.resolve()}#H(){return{day:0,lastClaimEpochDay:null}}#k(e){if(!e||\"object\"!=typeof e)return this.#H();const t=e;return{day:\"number\"==typeof t.day&&t.day>=0?Math.floor(t.day):0,lastClaimEpochDay:\"number\"==typeof t.lastClaimEpochDay?Math.floor(t.lastClaimEpochDay):null}}}const $=new Y,q=\"bridge-tasks-state\",J={DAILY:\"daily\",WEEKLY:\"weekly\",PERMANENT:\"permanent\"};class X extends I.Z{#qi=[];#L=null;#O=null;initialize(e){super.initialize(e);const t=f.ZP.getValues().tasks;return this.#qi=Array.isArray(t)?t.filter((e=>this.#Ji(e))):[],this}async getTasks(){const{state:e,active:t}=await this.#Xi(),r=[];return t.forEach((({group:t,key:s})=>{e.groups[s].tasks.forEach((e=>{const s=this.#Qi(t,e.id);s&&r.push(this.#ea(t,e,s))}))})),r}async addProgress(e,t=1){const{state:r,active:s}=await this.#Xi();let i=!1;s.forEach((({group:s,key:a})=>{r.groups[a].tasks.forEach((r=>{const a=this.#Qi(s,r.id);a&&a.targets.forEach((s=>{if(s.id!==e)return;const a=this.#ta(r,s.id),o=a.progress;a.progress=Math.min(Math.max(0,o+t),s.amount),a.progress!==o&&(i=!0)}))}))})),i&&await this.#N()}async claimReward(t){const{state:r,active:s}=await this.#Xi(),i=this.#ra(s,r,t);if(!i||i.task.claimed)return!1;const o=this.#Qi(i.group,i.task.id);if(!o||!this.#sa(o,i.task))return!1;i.task.claimed=!0,await this.#N();const n={taskId:o.id,groupId:i.group.id,type:i.group.type,rewards:o.rewards.map((e=>({id:e.id,amount:e.amount})))};return a.ZP.emit(e.W1.TASKS_REWARD_CLAIMED,n),!0}async#Xi(){const t=await this.#M(),r=await this.#ia(),s=[],i=[];let o=!1;return this.#qi.forEach((e=>{const a=e.id,n=this.#aa(e,r),d=t.groups[a];d&&d.periodKey===n||(d&&i.push({groupId:a,type:e.type,periodKey:n,previousPeriodKey:d.periodKey}),t.groups[a]={periodKey:n,tasks:this.#oa(e)},o=!0),s.push({group:e,key:a})})),o&&await this.#N(),i.forEach((t=>{a.ZP.emit(e.W1.TASKS_PERIOD_ROLLED_OVER,t)})),{state:t,active:s}}#aa(e,t){switch(e.type){case J.DAILY:return Math.floor(t/864e5);case J.WEEKLY:return Math.floor(t/6048e5);default:return 0}}#oa(e){return e.items.map((e=>({id:e.id,targets:e.targets.map((e=>({id:e.id,progress:0}))),claimed:!1})))}#ta(e,t){let r=e.targets.find((e=>e.id===t));return r||(r={id:t,progress:0},e.targets.push(r)),r}#sa(e,t){return e.targets.every((e=>{const r=t.targets.find((t=>t.id===e.id));return null!=r&&r.progress>=e.amount}))}#ra(e,t,r){let s=null;return e.some((({group:e,key:i})=>{const a=t.groups[i].tasks.find((e=>e.id===r));return!!a&&(s={group:e,task:a},!0)})),s}#Qi(e,t){return e.items.find((e=>e.id===t))}#ea(e,t,r){const s=r.targets.map((e=>{const r=t.targets.find((t=>t.id===e.id)),s=Math.min(r?r.progress:0,e.amount);return{id:e.id,amount:e.amount,progress:s,completed:s>=e.amount}}));return{id:r.id,type:e.type,targets:s,rewards:r.rewards.map((e=>({id:e.id,amount:e.amount}))),completed:s.every((e=>e.completed)),claimed:t.claimed}}#Ji(e){if(!e||\"object\"!=typeof e)return!1;const t=e,r=Object.values(J);return\"string\"==typeof t.id&&\"string\"==typeof t.type&&r.includes(t.type)&&Array.isArray(t.items)}async#ia(){let e;try{e=await this._platformBridge.getServerTime()}catch{e=Date.now()}return\"number\"==typeof e&&Number.isFinite(e)||(e=Date.now()),e}#M(){return this.#L?Promise.resolve(this.#L):(this.#O||(this.#O=v.Z.get(q,!0).then((e=>(this.#L=this.#k(e),this.#O=null,this.#L))).catch((()=>(this.#L=this.#H(),this.#O=null,this.#L)))),this.#O)}#N(){return this.#L?v.Z.set(q,this.#L):Promise.resolve()}#H(){return{groups:{}}}#k(e){if(!e||\"object\"!=typeof e)return this.#H();const t=e.groups;if(!t||\"object\"!=typeof t)return this.#H();const r={};return Object.keys(t).forEach((e=>{const s=this.#na(t[e]);s&&(r[e]=s)})),{groups:r}}#na(e){if(!e||\"object\"!=typeof e)return null;const t=e;if(\"number\"!=typeof t.periodKey)return null;const r=Array.isArray(t.tasks)?t.tasks.map((e=>this.#da(e))).filter((e=>null!==e)):[];return{periodKey:Math.floor(t.periodKey),tasks:r}}#da(e){if(!e||\"object\"!=typeof e)return null;const t=e;if(\"string\"!=typeof t.id)return null;const r=Array.isArray(t.targets)?t.targets.map((e=>this.#la(e))).filter((e=>null!==e)):[];return{id:t.id,targets:r,claimed:!0===t.claimed}}#la(e){if(!e||\"object\"!=typeof e)return null;const t=e;if(\"string\"!=typeof t.id)return null;const r=\"number\"==typeof t.progress&&t.progress>=0?Math.floor(t.progress):0;return{id:t.id,progress:r}}}const Q=new X;var ee=r(5555),te=r(8166);const re={};re[t.Lb.VK]=()=>Promise.resolve().then(r.bind(r,7226)),re[t.Lb.OK]=()=>Promise.resolve().then(r.bind(r,9623)),re[t.Lb.YANDEX]=()=>Promise.resolve().then(r.bind(r,1323)),re[t.Lb.CRAZY_GAMES]=()=>Promise.resolve().then(r.bind(r,9163)),re[t.Lb.GAME_DISTRIBUTION]=()=>Promise.resolve().then(r.bind(r,3777)),re[t.Lb.PLAYGAMA]=()=>Promise.resolve().then(r.bind(r,3153)),re[t.Lb.STANDALONE]=()=>Promise.resolve().then(r.bind(r,8200)),re[t.Lb.TELEGRAM]=()=>Promise.resolve().then(r.bind(r,6465)),re[t.Lb.Y8]=()=>Promise.resolve().then(r.bind(r,3369)),re[t.Lb.LAGGED]=()=>Promise.resolve().then(r.bind(r,4902)),re[t.Lb.FACEBOOK]=()=>Promise.resolve().then(r.bind(r,2769)),re[t.Lb.POKI]=()=>Promise.resolve().then(r.bind(r,7789)),re[t.Lb.QA_TOOL]=()=>Promise.resolve().then(r.bind(r,1298)),re[t.Lb.MSN]=()=>Promise.resolve().then(r.bind(r,5244)),re[t.Lb.MICROSOFT_STORE]=()=>Promise.resolve().then(r.bind(r,4951)),re[t.Lb.HUAWEI]=()=>Promise.resolve().then(r.bind(r,7490)),re[t.Lb.GAMEPUSH]=()=>Promise.resolve().then(r.bind(r,4499)),re[t.Lb.DISCORD]=()=>Promise.resolve().then(r.bind(r,1634)),re[t.Lb.JIO_GAMES]=()=>Promise.resolve().then(r.bind(r,2974)),re[t.Lb.YOUTUBE]=()=>Promise.resolve().then(r.bind(r,8347)),re[t.Lb.PORTAL]=()=>Promise.resolve().then(r.bind(r,6328)),re[t.Lb.REDDIT]=()=>Promise.resolve().then(r.bind(r,6539)),re[t.Lb.XIAOMI]=()=>Promise.resolve().then(r.bind(r,7121)),re[t.Lb.TIKTOK]=()=>Promise.resolve().then(r.bind(r,755)),re[t.Lb.DLIGHTEK]=()=>Promise.resolve().then(r.bind(r,7430)),re[t.Lb.GAMESNACKS]=()=>Promise.resolve().then(r.bind(r,9819)),re[t.Lb.SAMSUNG]=()=>Promise.resolve().then(r.bind(r,9793));const se=[{platformId:t.Lb.YANDEX,predicate:({hostname:e,hash:t})=>e.includes([\"y\",\"a\",\"n\",\"d\",\"e\",\"x\",\".\",\"n\",\"e\",\"t\"].join(\"\"))||t.includes(\"yandex\")},{platformId:t.Lb.CRAZY_GAMES,predicate:({hostname:e})=>e.includes(\"crazygames.\")||e.includes(\"1001juegos.com\")},{platformId:t.Lb.GAME_DISTRIBUTION,predicate:({hostname:e})=>e.includes(\"gamedistribution.com\")},{platformId:t.Lb.LAGGED,predicate:({hostname:e})=>e.includes(\"lagged.\")},{platformId:t.Lb.VK,predicate:({searchParams:e})=>e.has(\"api_id\")&&e.has(\"viewer_id\")&&e.has(\"auth_key\")||e.has(\"vk_app_id\")},{platformId:t.Lb.TELEGRAM,predicate:({hash:e})=>e.includes(\"tgWebAppData\")},{platformId:t.Lb.Y8,predicate:({hostname:e})=>e.includes(\"y8\")},{platformId:t.Lb.FACEBOOK,predicate:({hostname:e})=>e.includes(\"fbsbx\")},{platformId:t.Lb.POKI,predicate:({hostname:e})=>e.includes(\"poki-gdn\")||e.includes(\"poki-user-content\")},{platformId:t.Lb.MSN,predicate:({hostname:e})=>e.includes(\"msn.\")||e.includes(\"msnfun.\")||e.includes(\"start.gg\")},{platformId:t.Lb.GAMEPUSH,predicate:({hostname:e})=>e.includes(\"eponesh.\")},{platformId:t.Lb.DISCORD,predicate:({hostname:e})=>e.includes(\"discordsays.com\")},{platformId:t.Lb.YOUTUBE,predicate:({hostname:e})=>e.includes(\"usercontent.goog\")},{platformId:t.Lb.PORTAL,predicate:({hostname:e})=>e.includes(\"portalapp.\")},{platformId:t.Lb.REDDIT,predicate:({hostname:e})=>e.includes(\"devvit.\")},{platformId:t.Lb.DLIGHTEK,predicate:({hostname:e})=>e.includes(\"hippoobox.com\")||e.includes(\"ahagamecenter.com\")},{platformId:t.Lb.TIKTOK,predicate:({win:e})=>void 0!==e.TTMinis},{platformId:t.Lb.GAMESNACKS,predicate:({win:e})=>void 0!==e.GameSnacks},{platformId:t.Lb.SAMSUNG,predicate:({win:e})=>void 0!==e.GSInstant}];function ie(e){return Object.values(t.Lb).includes(e)?e:t.Lb.MOCK}class ae{get version(){return\"2.1.0\"}get isInitialized(){return this.#ha}get options(){return this.#ca?.options}get platform(){return this.#ua(e.oF.PLATFORM)}get player(){return this.#ua(e.oF.PLAYER)}get storage(){return this.#ua(e.oF.STORAGE)}get advertisement(){return this.#ua(e.oF.ADVERTISEMENT)}get social(){return this.#ua(e.oF.SOCIAL)}get device(){return this.#ua(e.oF.DEVICE)}get leaderboards(){return this.#ua(e.oF.LEADERBOARDS)}get payments(){return this.#ua(e.oF.PAYMENTS)}get achievements(){return this.#ua(e.oF.ACHIEVEMENTS)}get remoteConfig(){return this.#ua(e.oF.REMOTE_CONFIG)}get clipboard(){return this.#ua(e.oF.CLIPBOARD)}get notifications(){return this.#ua(e.oF.NOTIFICATIONS)}get analytics(){return this.#ua(e.oF.ANALYTICS)}get dailyRewards(){return this.#ua(e.oF.DAILY_REWARDS)}get tasks(){return this.#ua(e.oF.TASKS)}get crossPromo(){return this.#ua(e.oF.CROSS_PROMO)}get engine(){return this.#pa}set engine(e){this.#pa=e}set gameVersion(e){y.ZP.gameVersion=e}#ha=!1;#ma=null;#ca=null;#_a={};#ga=null;#Sa=null;#pa=\"javascript\";async initialize(r){if(this.#ha)return Promise.resolve();if(!this.#ma){this.#ma=new o.Z;const s=new URL(window.location.href),i=s.searchParams.has(g.zY);i&&(g.ZP.enabled=\"false\"!==s.searchParams.get(g.zY)),g.ZP.info(\"Initialization started\");const a=performance.now(),n=r?.configFilePath;await f.ZP.load(n,r);const d=function(e){const r=new URL(window.location.href);if(e)return ie(String(e).toLowerCase());if(r.searchParams.has(\"platform_id\"))return ie((r.searchParams.get(\"platform_id\")??\"\").toLowerCase());const s={url:r,hostname:r.hostname,hash:r.hash,searchParams:r.searchParams,referrer:document.referrer,win:window},i=se.find((({predicate:e})=>e(s)));return i?i.platformId:t.Lb.MOCK}(f.ZP.getRawValues().forciblySetPlatformId);f.ZP.initialize(d),(0,P.as)(d),i||(g.ZP.enabled=!0===f.ZP.getValues().debug),g.ZP.info(\"Config loaded\"),(0,b.CS)(),await this.#Aa(d);const l=this.#ca;l.engine=this.engine,this.#Ea(l);[{name:e.oF.PLATFORM,module:T},{name:e.oF.PLAYER,module:w.Z},{name:e.oF.STORAGE,module:v.Z},{name:e.oF.ADVERTISEMENT,module:R.ZP},{name:e.oF.SOCIAL,module:L},{name:e.oF.DEVICE,module:N},{name:e.oF.LEADERBOARDS,module:G},{name:e.oF.PAYMENTS,module:F.ZP},{name:e.oF.REMOTE_CONFIG,module:U},{name:e.oF.CLIPBOARD,module:Z},{name:e.oF.ACHIEVEMENTS,module:j.ZP},{name:e.oF.NOTIFICATIONS,module:W},{name:e.oF.ANALYTICS,module:y.ZP},{name:e.oF.DAILY_REWARDS,module:$},{name:e.oF.TASKS,module:Q},{name:e.oF.CROSS_PROMO,module:ee.Z}].forEach((({name:e,module:t})=>{t.initialize(l),this.#_a[e]=(0,g.dw)(e,t)})),l.initialize().then((()=>{this.#ha=!0,this.#fa(l),g.ZP.banner(`PlaygamaBridge v${this.version} initialized.`),this.#ma&&(this.#ma.resolve(),this.#ma=null);const t=f.ZP.getValues().advertisement,r=this.#_a[e.oF.ADVERTISEMENT];t?.interstitial?.preloadOnStart&&r.preloadInterstitial(t.interstitial.preloadOnStart),t?.rewarded?.preloadOnStart&&r.preloadRewarded(t.rewarded.preloadOnStart)})).catch((t=>{this.#Sa?.cancel();const r=((performance.now()-a)/1e3).toFixed(2),s=t?.message||String(t);y.rh.send(`${e.oF.CORE}_initialization_failed`,{error:s,time_s:r});const i=new e.Hd(e.Bq.INITIALIZATION_FAILED,t);g.ZP.error(i.message,t),this.#ma&&(this.#ma.reject(i),this.#ma=null)})).finally((()=>{setTimeout((()=>this.#ga?.setProgress(100,!0)),700)}))}return this.#ma.promise}setGameLoadingProgress(e){this.#ga?.setProgress(e)}async#Aa(e){g.ZP.info(`Platform detected: ${e}`);const t=await async function(e){const t=re[e];if(t){const{default:e}=await t();return e}return te.Z}(e);this.#ca=new t}#Ea(e){const r=f.ZP.getValues();if(!r.disableLoadingLogo){const s=e.platformId!==t.Lb.YANDEX&&e.platformId!==t.Lb.Y8&&!1!==r.showFullLoadingLogo,i=e.platformId===t.Lb.XIAOMI||!0===r.showLoadingText;this.#ga=new _,this.#ga.show({showFullLogo:s,showLoadingText:i}),r.loadingSound?.url&&(this.#Sa=new S(r.loadingSound),this.#ga.setHideGate(this.#Sa.finished))}r.game?.adaptToSafeArea&&E.applyStyles()}#fa(e){this.#Sa&&(e.isPlatformAudioEnabled?this.#Sa.play():this.#Sa.cancel())}#ua(t){return this.#ha||g.ZP.error(e.pn.SDK_NOT_INITIALIZED.message),this.#_a[t]}}(0,a.iL)(ae.prototype),Object.assign(ae.prototype,{PLATFORM_ID:t.Lb,PLATFORM_MESSAGE:t.Dt,MODULE_NAME:e.oF,EVENT_NAME:e.W1,INTERSTITIAL_STATE:i.WA,REWARDED_STATE:i.b3,BANNER_STATE:i.Kk,DEVICE_TYPE:s.me,DEVICE_ORIENTATION:s.AR,LAUNCH_SOURCE:e.LS});const oe=ae;window.bridge||window.playgamaBridge||(window.bridge=new oe,window.playgamaBridge=window.bridge)})()})();", + "(()=>{\"use strict\";var e={8902:(e,t,r)=>{r.d(t,{Mn:()=>a,Hd:()=>d,pn:()=>l,Bq:()=>o,W1:()=>i,LS:()=>h,oF:()=>s});const s={CORE:\"core\",PLATFORM:\"platform\",PLAYER:\"player\",STORAGE:\"storage\",ADVERTISEMENT:\"advertisement\",SOCIAL:\"social\",DEVICE:\"device\",LEADERBOARDS:\"leaderboards\",PAYMENTS:\"payments\",REMOTE_CONFIG:\"remote_config\",CLIPBOARD:\"clipboard\",ACHIEVEMENTS:\"achievements\",ANALYTICS:\"analytics\",NOTIFICATIONS:\"notifications\",DAILY_REWARDS:\"daily_rewards\",TASKS:\"tasks\",CROSS_PROMO:\"cross_promo\"},i={INTERSTITIAL_STATE_CHANGED:\"interstitial_state_changed\",REWARDED_STATE_CHANGED:\"rewarded_state_changed\",BANNER_STATE_CHANGED:\"banner_state_changed\",ADVANCED_BANNERS_STATE_CHANGED:\"advanced_banners_state_changed\",AUDIO_STATE_CHANGED:\"audio_state_changed\",PAUSE_STATE_CHANGED:\"pause_state_changed\",ORIENTATION_STATE_CHANGED:\"orientation_state_changed\",SCREEN_SIZE_CHANGED:\"screen_size_changed\",PLATFORM_MESSAGE_SENT:\"platform_message_sent\",PLATFORM_STORAGE_AVAILABILITY_CHANGED:\"platform_storage_availability_changed\",VISIBILITY_STATE_CHANGED:\"visibility_state_changed\",STORAGE_SET:\"storage_set\",CROSS_PROMO_SHOWN:\"cross_promo_shown\",DAILY_REWARDS_CLAIMED:\"daily_rewards_claimed\",DAILY_REWARDS_STREAK_RESET:\"daily_rewards_streak_reset\",TASKS_REWARD_CLAIMED:\"tasks_reward_claimed\",TASKS_PERIOD_ROLLED_OVER:\"tasks_period_rolled_over\"},a={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\",GET_POST_VISIT_REWARD:\"get_post_visit_reward\",GET_POST_AUTHOR_REWARD:\"get_post_author_reward\",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\"},o={SDK_NOT_INITIALIZED:\"SDK_NOT_INITIALIZED\",INITIALIZATION_FAILED:\"INITIALIZATION_FAILED\",CONFIG_LOAD_FAILED:\"CONFIG_LOAD_FAILED\",CONFIG_PARSE_FAILED:\"CONFIG_PARSE_FAILED\",STORAGE_NOT_SUPPORTED:\"STORAGE_NOT_SUPPORTED\",STORAGE_NOT_AVAILABLE:\"STORAGE_NOT_AVAILABLE\",STORAGE_QUOTA_EXCEEDED:\"STORAGE_QUOTA_EXCEEDED\",GAME_PARAMS_NOT_FOUND:\"GAME_PARAMS_NOT_FOUND\",INVITE_FRIENDS_MESSAGE_LENGTH_ERROR:\"INVITE_FRIENDS_MESSAGE_LENGTH_ERROR\",NOTIFICATIONS_NOT_SUPPORTED:\"NOTIFICATIONS_NOT_SUPPORTED\",NOTIFICATION_INVALID_PARAMETERS:\"NOTIFICATION_INVALID_PARAMETERS\"},n={SDK_NOT_INITIALIZED:\"Before using the SDK you must initialize it\",INITIALIZATION_FAILED:\"SDK initialization failed\",CONFIG_LOAD_FAILED:\"Failed to load the bridge config file\",CONFIG_PARSE_FAILED:\"Failed to parse the bridge config file\",STORAGE_NOT_SUPPORTED:\"Storage not supported\",STORAGE_NOT_AVAILABLE:\"Storage not available\",STORAGE_QUOTA_EXCEEDED:\"Storage quota exceeded\",GAME_PARAMS_NOT_FOUND:\"Game params are not found\",INVITE_FRIENDS_MESSAGE_LENGTH_ERROR:\"Message is too long\",NOTIFICATIONS_NOT_SUPPORTED:\"Notifications not supported\",NOTIFICATION_INVALID_PARAMETERS:\"Invalid notification parameters\"};class d extends Error{code;originalError;constructor(e,t){super(n[e]),this.name=\"BridgeError\",this.code=e,this.originalError=t}}const l=Object.fromEntries(Object.keys(o).map((e=>[e,{code:e,message:n[e]}]))),h={NOTIFICATION:\"notification\",POST:\"post\"}},6039:(e,t,r)=>{r.d(t,{Z:()=>s});const s=class{get promise(){return this.#e}#e;#t;#r;constructor(){this.#e=new Promise(((e,t)=>{this.#t=e,this.#r=t}))}resolve(e){this.#t(e)}reject(e){this.#r(e)}}},1558:(e,t,r)=>{r.d(t,{ZP:()=>d,aA:()=>i,iL:()=>n});var s=r(1302);function i(e){const t=e;t.on=function(e,t){this._eventListeners||(this._eventListeners={}),this._eventListeners[e]||(this._eventListeners[e]=[]),this._eventListeners[e].push(t)},t.off=function(e,t){this._eventListeners?.[e]&&(t?this._eventListeners[e]=this._eventListeners[e].filter((e=>e!==t&&e._original!==t)):delete this._eventListeners[e])},t.once=function(e,t){const r=(...s)=>{this.off(e,r),t(...s)};r._original=t,this.on(e,r)},t.emit=function(e,...t){if(!this._eventListeners?.[e])return;[...this._eventListeners[e]].forEach((r=>{try{r(...t)}catch(t){s.ZP.error(`[EventBus] Listener error on \"${e}\":`,t)}}))}}const a={};i(a);const o=a.emit.bind(a);function n(e){const t=e;t.on=function(e,t){a.on(e,t)},t.off=function(e,t){a.off(e,t)},t.once=function(e,t){a.once(e,t)}}a.emit=function(e,...t){s.ZP.info(`[event] ${e}`,...t),o(e,...t)};const d=a},6873:(e,t,r)=>{r.d(t,{Z:()=>s});const s=new class{get isAvailable(){return null!==this.#s}#s=null;constructor(){try{this.#s=window.localStorage}catch{this.#s=null}}getItem(e){if(!this.#s)return null;try{return this.#s.getItem(e)}catch{return null}}setItem(e,t){this.#s&&this.#s.setItem(e,t)}removeItem(e){if(this.#s)try{this.#s.removeItem(e)}catch{}}}},5095:(e,t,r)=>{r.d(t,{Z:()=>s});const s=class{#i=null;#a=null;#o;constructor(e){this.#o=e}getServerTime(){return null!==this.#i?Promise.resolve(Date.now()+this.#i):(this.#a||(this.#a=Promise.resolve().then((()=>this.#o())).then((e=>(this.#i=e-Date.now(),this.#a=null,e))).catch((e=>{throw this.#a=null,e}))),this.#a)}}},5819:(e,t,r)=>{r.d(t,{ao:()=>d,as:()=>n});var s=r(3806);const i=\"https://api.playgama.com\",a=\"/playgama\";let o=i;function n(e){o=e===s.Lb.DISCORD?a:i}function d(){return o}},5230:(e,t,r)=>{r.d(t,{ZP:()=>v});var s=r(8960),i=r(8902),a=r(1302);const o=\"bridge-remote-config-cache\",n=[\"forciblySetPlatformId\",\"remoteConfigUrl\"];var d=r(6873);const l=\"pending\",h=\"loading\",c=\"success\",u=\"failed\",p=\"timeout\",m=\"skipped\",_=\"network\",g=\"fresh-cache\",S=\"stale-cache\";const A=class{get loadStatus(){return this.#n}get loadError(){return this.#d}get appliedSource(){return this.#l}#h;#c;#u;#n=l;#d=\"\";#l=null;constructor({url:e,timeoutMs:t,ttlMs:r}){this.#h=e,this.#c=\"number\"==typeof t?t:2e3,this.#u=\"number\"==typeof r?r:36e5}async load(){if(!this.#h)return this.#n=m,{source:null,options:null};const e=this.#p();if(e&&!this.#m(e))return this.#l=g,this.#n=c,this.refreshInBackground(),{source:g,options:e.options};try{this.#n=h;const e=await this.#_(this.#c);return this.#g(e),this.#l=_,this.#n=c,{source:_,options:e}}catch(t){const r=\"AbortError\"===t?.name;return this.#n=r?p:u,this.#d=t?.message||String(t),a.ZP.error(\"Remote config load failed:\",t),e?(this.#l=S,{source:S,options:e.options,error:this.#d}):{source:null,options:null,error:this.#d}}}refreshInBackground(){this.#h&&this.#_(this.#c).then((e=>{this.#g(e)})).catch((e=>{a.ZP.error(\"Remote config background refresh failed:\",e)}))}async#_(e){const t=new AbortController,r=setTimeout((()=>t.abort()),e);try{const e=await fetch(this.#h,{signal:t.signal});if(!e.ok)throw new Error(`Failed to load remote bridge config: ${this.#h} ${e.status} (${e.statusText})`);const r=await e.text(),s=JSON.parse(r);if(!s||\"object\"!=typeof s||Array.isArray(s))throw new Error(\"Remote bridge config must be a JSON object\");return s}finally{clearTimeout(r)}}#p(){const e=d.Z.getItem(o);if(!e)return null;try{const t=JSON.parse(e);return t&&t.url===this.#h&&\"number\"==typeof t.savedAt&&t.options&&\"object\"==typeof t.options?t:null}catch{return null}}#g(e){try{const t={url:this.#h,savedAt:Date.now(),options:e};d.Z.setItem(o,JSON.stringify(t))}catch{}}#m(e){return e.savedAt+this.#u{e in this.#I&&(s[e]=this.#I[e])})),this.#R({...r.options,...s})}}E=R;const v=new R},1302:(e,t,r)=>{r.d(t,{zY:()=>l,dw:()=>u,ZP:()=>p});const s=\"info\",i=\"warn\",a=\"error\",o=\"#9747FF\",n=`background: ${o}; color: #fff; padding: 1px 6px; border-radius: 4px`,d=`background: ${o}; color: white; padding: 1px 6px; border-radius: 4px`,l=\"debug\",h=[\"on\",\"off\",\"once\",\"emit\"];const c=new class{get enabled(){return this.#b}set enabled(e){this.#b=e}#b=!1;info(e,...t){this.#C(s,e,t)}warn(e,...t){this.#C(i,e,t)}error(e,...t){this.#C(a,e,t)}banner(e){console.info(`%c ${e} `,d)}#C(e,t,r){if(e!==a&&!this.#b)return;const s=[`%c PlaygamaBridge %c ${t}`,n,\"\",...r];switch(e){case a:console.error(...s);break;case i:console.warn(...s);break;default:console.info(...s)}}};function u(e,t){const r=new Map;return new Proxy(t,{get(t,s){const i=Reflect.get(t,s,t);if(\"function\"!=typeof i)return i;let a=r.get(s);if(!a){const o=String(s),n=i,d=!h.includes(o);a=(...r)=>{if(!d)return n.apply(t,r);c.info(`[${e}] ${o}()`,...r);const s=n.apply(t,r);return function(e){return null!=e&&(\"object\"==typeof e||\"function\"==typeof e)&&\"function\"==typeof e.then}(s)&&s.then((t=>c.info(`[${e}] ${o} → resolved`,t)),(t=>c.warn(`[${e}] ${o} → rejected`,t))),s},r.set(s,a)}return a}})}const p=c},9541:(e,t,r)=>{r.d(t,{k:()=>a});var s=r(5095),i=r(5819);const a=new s.Z((async function(){const e=await fetch(`${(0,i.ao)()}/api/bridge/v1/timestamp/now`);if(!e.ok)throw new Error(\"Network response was not ok\");return 1e3*(await e.json()).timestamp}))},9778:(e,t,r)=>{r.d(t,{Z:()=>o});var s=r(1558),i=r(5230),a=r(3806);const o=class{_platformBridge;initialize(e){return this._platformBridge=e,this}_forwardEvent(e){this._platformBridge.on(e,((...t)=>s.ZP.emit(e,...t)))}_isSaas(e){const t=this._platformBridge.platformId,{saas:r}=i.ZP.getValues(),s=r?.[e];return!!s&&(!(t!==a.Lb.PLAYGAMA||!r?.publicToken)||Boolean(Array.isArray(s.platforms)&&null!=t&&s.platforms.includes(t)))}}},5334:(e,t,r)=>{r.d(t,{ZP:()=>h,dk:()=>a});var s=r(9778),i=r(5230);function a(e,t,r){if(!e)return null;const s=e.find((e=>{const s=e[t];return Boolean(s&&\"object\"==typeof s&&r(s))}));return s?s.id:null}var o=r(9979);const n=\"bridge-achievements-state\";const d=class{#O;#L=null;#M=null;constructor(e){this.#O=e}async unlock(e){if(!e)return;const t=await this.#N();t.unlocked.includes(e)||(t.unlocked.push(e),await this.#k())}async getList(){const e=await this.#N();return this.#O.map((t=>({id:t.id,name:\"string\"==typeof t.name?t.name:void 0,description:\"string\"==typeof t.description?t.description:void 0,unlocked:e.unlocked.includes(t.id)})))}#N(){return this.#L?Promise.resolve(this.#L):(this.#M||(this.#M=o.Z.get(n,!0).then((e=>(this.#L=this.#H(e),this.#M=null,this.#L))).catch((()=>(this.#L=this.#G(),this.#M=null,this.#L)))),this.#M)}#k(){return this.#L?o.Z.set(n,this.#L):Promise.resolve()}#G(){return{unlocked:[]}}#H(e){if(!e||\"object\"!=typeof e)return this.#G();const t=e;return{unlocked:Array.isArray(t.unlocked)?t.unlocked.filter((e=>\"string\"==typeof e)):[]}}};class l extends s.Z{#B;initialize(e){return super.initialize(e),this.#B=new d(this.#F()??[]),this}unlock(e){if(this._platformBridge.isAchievementsSupported){const t=function(e,t,r){if(!r||!e)return r;const s=e.find((e=>e.id===r));if(!s)return r;const i=s[t];return i&&\"object\"==typeof i?i:r}(this.#F(),this._platformBridge.platformId,e);return this._platformBridge.achievementsUnlock(t)}return this.#B.unlock(e)}getAchievements(){return this._platformBridge.isAchievementsSupported?this._platformBridge.achievementsGetList():this.#B.getList()}#F(){const e=i.ZP.getValues();return e?.achievements}}const h=new l},9221:(e,t,r)=>{r.d(t,{$4:()=>_,Cb:()=>i,Kk:()=>a,My:()=>p,Qh:()=>h,SX:()=>g,WA:()=>o,Xn:()=>m,_g:()=>l,az:()=>S,b3:()=>n,lY:()=>u,m1:()=>A,qJ:()=>c,qV:()=>d});var s=r(66);const i={TOP:\"top\",BOTTOM:\"bottom\"},a={LOADING:\"loading\",SHOWN:\"shown\",HIDDEN:\"hidden\",FAILED:\"failed\"},o={LOADING:\"loading\",OPENED:\"opened\",CLOSED:\"closed\",FAILED:\"failed\"},n={LOADING:\"loading\",OPENED:\"opened\",CLOSED:\"closed\",FAILED:\"failed\",REWARDED:\"rewarded\"},d={SHOW:\"show\",HIDE:\"hide\"},l=\"banner-container\",h=\"advanced-banner-\",c=60,u=200,p={DEVICE_TYPE:4,ORIENTATION:2,DIMENSION:1,CANVAS:1},m=[\"width\",\"height\"],_=[\"top\",\"bottom\",\"left\",\"right\"],g=/^\\d+(?:\\.\\d+)?%$/,S=new Set(Object.values(s.me)),A=new Set(Object.values(s.AR))},1472:(e,t,r)=>{r.d(t,{f_:()=>T,kM:()=>D,ZP:()=>N,XA:()=>w,DQ:()=>v,QG:()=>R});var s=r(1558),i=r(5230),a=r(9778),o=r(6170),n=r(8902),d=r(3806),l=r(9221);function h(e){if(\"number\"==typeof e)return e;if(\"string\"==typeof e){const t=parseInt(e,10);return Number.isNaN(t)?null:t}return null}function c(e,t,r){if(!e)return e??null;if(!t)return e;const s=t.find((t=>t.id===e));return s&&s[r]?s[r]:e}const u=class{get isSupported(){const e=i.ZP.getValues().advertisement?.banner?.disable;return!0!==e&&this.#x.isBannerSupported}get state(){return this.#L}#x;#U;#L=l.Kk.HIDDEN;#V=null;#Z=null;constructor(e,t){this.#x=e,this.#U=t,this.#x.on(n.W1.BANNER_STATE_CHANGED,(e=>this.#j(e)))}show(e=l.Cb.BOTTOM,t=null){if(this.#L===l.Kk.LOADING||this.#L===l.Kk.SHOWN)return;const r=Object.values(l.Cb).includes(e)?e:l.Cb.BOTTOM;this.#V=r;let s=t;if(!s){const e=i.ZP.getValues().advertisement?.banner?.placementFallback;e&&(s=e)}if(this.#Z=s,this.#j(l.Kk.LOADING),!this.isSupported)return void this.#j(l.Kk.FAILED);const a=i.ZP.getValues().advertisement?.banner?.placements,o=c(s,a,this.#x.platformId);this.#x.showBanner(r,o)}hide(){this.#L!==l.Kk.LOADING&&this.#L!==l.Kk.HIDDEN&&this.isSupported&&this.#x.hideBanner()}#j(e){this.#L!==e&&(this.#L=e,e!==l.Kk.LOADING&&this.#U.send(`${n.oF.ADVERTISEMENT}_banner_${e}`,{position:this.#V,placement:this.#Z}),s.ZP.emit(n.W1.BANNER_STATE_CHANGED,this.#L))}},p=\"state_changed\",m=\"time_left_changed\",_=\"created\",g=\"started\",S=\"stopped\",A=\"completed\";class E{get state(){return this.#L}#z=0;#W=0;#L=_;#K=0;constructor(e){this.#z=e}start(){this.#L!==g&&(this.#W=this.#z,this.#j(g),this.#K=setInterval((()=>{this.#W-=1,this.emit(m,this.#W),this.#W<=0&&(this.#Y(),this.#j(A))}),1e3))}stop(){this.#Y(),this.#L===g&&this.#j(S)}#j(e){this.#L=e,this.emit(p,this.#L)}#Y(){this.#K&&clearInterval(this.#K),this.#W=0}}(0,s.aA)(E.prototype);const P=E;const f=class{get isSupported(){const e=i.ZP.getValues().advertisement?.interstitial?.disable;return!0!==e&&this.#x.isInterstitialSupported}get state(){return this.#L}get minimumDelayBetweenInterstitial(){return this.#$}get isInProgress(){return[l.WA.LOADING,l.WA.OPENED].includes(this.#L)}#x;#U;#L=l.WA.CLOSED;#Z=null;#q;#$=l.qJ;#J=null;#X;constructor(e,t,r){this.#x=e,this.#U=t,this.#X=r,this.#x.on(n.W1.INTERSTITIAL_STATE_CHANGED,(e=>{const t=e;this.#j(t),t===l.WA.CLOSED&&this.#Q()})),s.ZP.on(n.W1.PLATFORM_MESSAGE_SENT,(e=>{e===d.Dt.GAME_READY&&(this.#J=Date.now())})),this.#ee()}preload(e=null){if(!this.isSupported)return;let t=e;if(!t||\"string\"!=typeof t){const e=i.ZP.getValues().advertisement?.interstitial?.placementFallback;e&&(t=e)}const r=i.ZP.getValues().advertisement?.interstitial?.placements,s=c(t,r,this.#x.platformId);this.#x.preloadInterstitial(s)}show(e=null){let t=e;if(!t){const e=i.ZP.getValues().advertisement?.interstitial?.placementFallback;e&&(t=e)}if(this.#Z=t,this.#j(l.WA.LOADING),!this.isSupported)return void this.#j(l.WA.FAILED);const r=this.#te();if(r>0&&(null===this.#J||(Date.now()-this.#J)/1e30&&this.#x.isMinimumDelayBetweenInterstitialEnabled&&(this.#q=new P(this.#$),this.#q.start())}};const I=class{get isSupported(){const e=i.ZP.getValues().advertisement?.rewarded?.disable;return!0!==e&&this.#x.isRewardedSupported}get state(){return this.#L}get placement(){return this.#Z}get isInProgress(){return[l.b3.LOADING,l.b3.OPENED,l.b3.REWARDED].includes(this.#L)}#x;#U;#L=l.b3.CLOSED;#Z=null;#X;constructor(e,t,r){this.#x=e,this.#U=t,this.#X=r,this.#x.on(n.W1.REWARDED_STATE_CHANGED,(e=>this.#j(e)))}preload(e=null){if(!this.isSupported)return;let t=e;if(!t||\"string\"!=typeof t){const e=i.ZP.getValues().advertisement?.rewarded?.placementFallback;e&&(t=e)}const r=i.ZP.getValues().advertisement?.rewarded?.placements,s=c(t,r,this.#x.platformId);this.#x.preloadRewarded(s)}show(e=null){if(this.#Z=e,!this.#Z){const e=i.ZP.getValues().advertisement?.rewarded?.placementFallback;e&&(this.#Z=e)}const t=i.ZP.getValues().advertisement?.rewarded?.placements,r=c(this.#Z,t,this.#x.platformId);this.#j(l.b3.LOADING),this.isSupported?this.#x.showRewarded(r):this.#j(l.b3.FAILED)}#j(e){this.#L!==e&&(this.#L=e,e!==l.b3.LOADING&&this.#U.send(`${n.oF.ADVERTISEMENT}_rewarded_${e}`,{placement:this.#Z}),s.ZP.emit(n.W1.REWARDED_STATE_CHANGED,this.#L),this.#X(this.#L))}};var y=r(3117);function D(e){const t=document.createElement(\"div\");switch(t.id=l._g,t.style.position=\"absolute\",document.body.appendChild(t),e){case l.Cb.TOP:t.style.top=\"0px\",t.style.height=\"90px\",t.style.width=\"100%\";break;case l.Cb.BOTTOM:default:t.style.bottom=\"0px\",t.style.height=\"90px\",t.style.width=\"100%\"}return t}function T(e){const t=[];return e.forEach(((e,r)=>{const s=document.createElement(\"div\"),i=`${l.Qh}${r}`;s.id=i,s.style.position=\"absolute\",s.style.zIndex=\"9999\",e.width&&(s.style.width=e.width),e.height&&(s.style.height=e.height),e.top&&(s.style.top=e.top),e.bottom&&(s.style.bottom=e.bottom),e.left&&(s.style.left=e.left),e.right&&(s.style.right=e.right),document.body.appendChild(s),t.push(i)})),t}function w(){document.querySelectorAll(`[id^=\"${l.Qh}\"]`).forEach((e=>e.remove()))}function R(e){if(!document.getElementById(\"bridge-info-popup-styles\")){const e=document.createElement(\"style\");e.id=\"bridge-info-popup-styles\",e.textContent=\"\\n #bridge-info-popup-overlay {\\n position: fixed;\\n inset: 0;\\n display: none;\\n align-items: center;\\n justify-content: center;\\n padding: 18px;\\n background: rgba(0, 0, 0, 0.24);\\n z-index: 9999;\\n }\\n\\n #bridge-info-popup {\\n width: min(92vw, 320px);\\n padding: 24px 20px 20px;\\n border-radius: 26px;\\n background: #ffffff;\\n color: #24304d;\\n text-align: center;\\n box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);\\n font-family: Inter, Arial, sans-serif;\\n }\\n\\n #bridge-info-popup-emoji {\\n font-size: 42px;\\n margin-bottom: 10px;\\n line-height: 1;\\n }\\n\\n #bridge-info-popup-title {\\n margin: 0 0 10px;\\n font-size: 24px;\\n line-height: 1.1;\\n }\\n\\n #bridge-info-popup-message {\\n margin: 0 0 18px;\\n font-size: 15px;\\n line-height: 1.45;\\n color: #66708b;\\n }\\n\\n #bridge-info-popup-button {\\n min-width: 140px;\\n height: 46px;\\n padding: 0 24px;\\n border: 0;\\n border-radius: 999px;\\n font-weight: 700;\\n font-size: 15px;\\n color: #ffffff;\\n background: linear-gradient(180deg, #5f8cff, #4c71e6);\\n box-shadow: 0 8px 20px rgba(76, 113, 230, 0.32);\\n cursor: pointer;\\n font-family: Inter, Arial, sans-serif;\\n }\\n\\n #bridge-info-popup-button:active {\\n transform: translateY(1px);\\n }\",document.head.appendChild(e)}let t=document.getElementById(\"bridge-info-popup-overlay\");t||(t=document.createElement(\"div\"),t.id=\"bridge-info-popup-overlay\",document.body.appendChild(t));let r=document.getElementById(\"bridge-info-popup\");r||(r=document.createElement(\"div\"),r.id=\"bridge-info-popup\",t.appendChild(r)),r.innerHTML=\"\";const s=document.createElement(\"div\");s.id=\"bridge-info-popup-emoji\",s.textContent=\"🎬\",r.appendChild(s);const i=document.createElement(\"h3\");i.id=\"bridge-info-popup-title\",i.textContent=e,r.appendChild(i);const a=document.createElement(\"button\");a.id=\"bridge-info-popup-button\",a.textContent=\"Continue\",r.appendChild(a);const o=t;return new Promise((e=>{a.onclick=()=>{o.style.display=\"none\",e()},o.style.display=\"flex\"}))}function v(){if(!document.getElementById(\"bridge-ad-failure-popup-fonts\")){const e=document.createElement(\"link\");e.rel=\"preconnect\",e.href=\"https://fonts.googleapis.com\",document.head.appendChild(e);const t=document.createElement(\"link\");t.rel=\"preconnect\",t.href=\"https://fonts.gstatic.com\",t.crossOrigin=\"anonymous\",document.head.appendChild(t);const r=document.createElement(\"link\");r.id=\"bridge-ad-failure-popup-fonts\",r.rel=\"stylesheet\",r.href=\"https://fonts.googleapis.com/css2?family=Cal+Sans&display=swap\",document.head.appendChild(r)}if(!document.getElementById(\"bridge-ad-failure-popup-styles\")){const e=document.createElement(\"style\");e.id=\"bridge-ad-failure-popup-styles\",e.textContent=\"\\n #bridge-ad-failure-popup {\\n position: fixed;\\n top: 0;\\n left: 0;\\n height: 100%;\\n width: 100%;\\n box-sizing: border-box;\\n padding: 24px 16px;\\n background: #682eb2;\\n display: none;\\n grid-template-columns: 1fr 1fr;\\n grid-template-rows: 32px 1fr;\\n z-index: 9999999;\\n font-family: 'Cal Sans', -apple-system, BlinkMacSystemFont, sans-serif;\\n color: #fff;\\n cursor: pointer;\\n }\\n\\n #bridge-ad-failure-popup-logo {\\n height: 32px;\\n }\\n\\n #bridge-ad-failure-popup-close {\\n all: unset;\\n cursor: pointer;\\n display: inline-flex;\\n align-items: center;\\n justify-content: center;\\n width: 32px;\\n height: 32px;\\n background: #fff;\\n border-radius: 50%;\\n justify-self: end;\\n }\\n\\n #bridge-ad-failure-popup-text {\\n grid-column: span 2;\\n font-size: 21px;\\n font-style: normal;\\n font-weight: 400;\\n line-height: 110%;\\n align-self: end;\\n margin: 0;\\n }\\n\\n @media (min-width: 320px) {\\n #bridge-ad-failure-popup {\\n padding: 24px;\\n grid-template-rows: 40px 1fr;\\n }\\n\\n #bridge-ad-failure-popup-logo {\\n height: 40px;\\n }\\n\\n #bridge-ad-failure-popup-close {\\n width: 40px;\\n height: 40px;\\n }\\n\\n #bridge-ad-failure-popup-text {\\n font-size: 25px;\\n align-self: center;\\n }\\n }\\n\\n @media (orientation: landscape) {\\n #bridge-ad-failure-popup {\\n gap: 40px;\\n }\\n\\n #bridge-ad-failure-popup-text {\\n width: 60%;\\n align-self: start;\\n }\\n }\\n\\n @media (orientation: landscape) and (min-width: 800px) {\\n #bridge-ad-failure-popup {\\n gap: 80px;\\n }\\n\\n #bridge-ad-failure-popup-text {\\n width: 50%;\\n font-size: 33px;\\n }\\n }\\n \",document.head.appendChild(e)}let e=document.getElementById(\"bridge-ad-failure-popup\");if(!e){e=document.createElement(\"div\"),e.id=\"bridge-ad-failure-popup\";const t=document.createElement(\"div\");t.innerHTML='\\n \\n \\n \\n \\n ',e.appendChild(t);const r=document.createElement(\"button\");r.id=\"bridge-ad-failure-popup-close\",r.innerHTML='\\n \\n \\n \\n ',e.appendChild(r);const s=document.createElement(\"p\");s.id=\"bridge-ad-failure-popup-text\",e.appendChild(s),document.body.appendChild(e)}const t=document.getElementById(\"bridge-ad-failure-popup-close\"),r=e;return new Promise((e=>{const s=()=>{r.style.display=\"none\",e()};t&&(t.onclick=s),r.onclick=s;const i=[\"If you see this message, no Ad was returned for the Ad request.

Please ask the developer to check the Ad setup.\",\"This is placeholder for the Ad. Playgama helps games reach players worldwide.\"],a=document.getElementById(\"bridge-ad-failure-popup-text\");a&&(a.innerHTML=i[Math.floor(Math.random()*i.length)]),r.style.display=\"grid\"}))}const b=new WeakMap;function C(e){return\"string\"==typeof e&&l.SX.test(e)}function O(e){if(!e||\"object\"!=typeof e)return!1;const t=e;return!!l.Xn.every((e=>C(t[e])))&&(l.$4.some((e=>void 0!==t[e]))&&l.$4.every((e=>void 0===t[e]||C(t[e]))))}const L=class{get isSupported(){return!0!==this.#ie?.disable&&this.#x.isAdvancedBannersSupported}get state(){return this.#L}get options(){return this.#ie}#x;#U;#L=l.Kk.HIDDEN;#Z=null;#ae=null;#oe=!1;#ne=null;#de;constructor(e,t,r){this.#x=e,this.#U=t,this.#de=r,this.#x.on(n.W1.ADVANCED_BANNERS_STATE_CHANGED,(e=>this.#j(e))),s.ZP.on(n.W1.ORIENTATION_STATE_CHANGED,(()=>this.#le())),s.ZP.on(n.W1.SCREEN_SIZE_CHANGED,(()=>this.#le()))}show(e){let t=e;if(!t){const e=this.#ie?.placementFallback;\"string\"==typeof e&&(t=e)}this.tryShow(t)}hide(){this.isSupported&&(this.#he(),this.#ce(),this.#j(l.Kk.HIDDEN))}tryShow(e){if(!this.isSupported)return;if(null===e)return;const t=this.#ie?.[e];if(!t)return;if((t.action??l.qV.SHOW)===l.qV.HIDE)return this.#he(),void this.#ce();this.#j(l.Kk.LOADING);const r=this.#t(t);this.#Z=e,this.#ae&&!r&&this.#x.hideAdvancedBanners(),this.#ae=r,r?this.#de()?this.#oe=!0:this.#x.showAdvancedBanners(r):this.#j(l.Kk.FAILED)}hideByAd(){this.#ae&&!this.#oe&&(this.#oe=!0,this.#x.hideAdvancedBanners())}restoreAfterAd(){this.#oe&&(this.#de()||(this.#oe=!1,this.#ae&&this.#x.showAdvancedBanners(this.#ae)))}get#ie(){return i.ZP.getValues().advertisement?.advancedBanners}#j(e){this.#L!==e&&(this.#L=e,e!==l.Kk.LOADING&&this.#U.send(`${n.oF.ADVERTISEMENT}_advanced_banners_${e}`,{placement:this.#Z}),s.ZP.emit(n.W1.ADVANCED_BANNERS_STATE_CHANGED,this.#L))}#ce(){this.#Z=null,this.#ae=null,this.#oe=!1}#he(){this.#ae&&!this.#oe&&this.#x.hideAdvancedBanners()}#le(){this.#ne&&clearTimeout(this.#ne),this.#ne=setTimeout((()=>{this.#ne=null,this.#ue()}),l.lY)}#ue(){if(!this.#Z)return;const e=this.#ie?.[this.#Z];if(!e)return;const t=this.#t(e);if(t===this.#ae)return;const r=this.#ae;this.#ae=t,this.#oe||(r&&this.#x.hideAdvancedBanners(),t?this.#x.showAdvancedBanners(t):r&&this.#j(l.Kk.HIDDEN))}#t(e){const{deviceType:t}=this.#x,r={deviceType:t,orientation:(0,y.f)(),canvas:document.querySelector(\"canvas\")};let s=\"default\",i=e.default??null,a=-1;Object.keys(e).filter((e=>\"action\"!==e&&\"default\"!==e)).forEach((t=>{const o=this.#pe(t,r);if(!o.matched)return;(o.score>a||o.score===a&&t.split(\":\").length>s.split(\":\").length)&&(a=o.score,s=t,i=e[t])}));const o=function(e){if(!Array.isArray(e))return[];const t=b.get(e);if(t)return t;const r=e.filter(O);return b.set(e,r),r}(i);return o.length>0?o:null}#pe(e,t){const{deviceType:r,orientation:s,canvas:i}=t,a=e.split(\":\"),o=a.includes(\"canvas\");let n=0;if(o&&!i)return{matched:!1,score:n};o&&(n+=l.My.CANVAS);return{matched:a.every((e=>{if(\"canvas\"===e)return!0;if(l.az.has(e)){if(e!==r)return!1;n+=l.My.DEVICE_TYPE}else if(l.m1.has(e)){if(e!==s||window.innerWidth===window.innerHeight)return!1;n+=l.My.ORIENTATION}else{const t=/^([wh])([><]=?)(\\d+)$/.exec(e),r=/^ar([><]=?)(\\d+(?:\\.\\d+)?)$/.exec(e);if(t){const e=o&&i?i.width:window.innerWidth,r=o&&i?i.height:window.innerHeight,s=\"w\"===t[1]?e:r,a=t[2],d=parseInt(t[3],10);if(!this.#me(s,a,d))return!1;n+=l.My.DIMENSION+this.#_e(s,d)}else{if(!r)return!1;{const e=(o&&i?i.width:window.innerWidth)/(o&&i?i.height:window.innerHeight),t=r[1],s=parseFloat(r[2]);if(!this.#me(e,t,s))return!1;n+=l.My.DIMENSION+this.#_e(e,s,1e3)}}}return!0})),score:n}}#me(e,t,r){switch(t){case\">\":return e>r;case\"<\":return e=\":return e>=r;case\"<=\":return e<=r;default:return!1}}#_e(e,t,r=1){return.9/(1+Math.abs(e-t)*r)}};class M extends a.Z{get isBannerSupported(){return this.#ge.isSupported}get bannerState(){return this.#ge.state}get isInterstitialSupported(){return this.#Se.isSupported}get interstitialState(){return this.#Se.state}get isRewardedSupported(){return this.#Ae.isSupported}get rewardedPlacement(){return this.#Ae.placement}get rewardedState(){return this.#Ae.state}get minimumDelayBetweenInterstitial(){return this.#Se.minimumDelayBetweenInterstitial}get isAdvancedBannersSupported(){return this.#Ee.isSupported}get advancedBannersState(){return this.#Ee.state}#ge;#Se;#Ae;#Ee;initialize(e){return super.initialize(e),this.#ge=new u(e,o.rh),this.#Se=new f(e,o.rh,(e=>this.#Pe(e))),this.#Ae=new I(e,o.rh,(e=>this.#fe(e))),this.#Ee=new L(e,o.rh,(()=>this.#Ie())),s.ZP.on(n.W1.PLATFORM_MESSAGE_SENT,(e=>{this.#Ee.tryShow(e),this.#ye(e)})),s.ZP.on(n.W1.STORAGE_SET,(()=>{this.#ye(n.W1.STORAGE_SET)})),e.on(n.W1.VISIBILITY_STATE_CHANGED,(e=>{e===d.YU.VISIBLE&&this.#ye(`visibility_state_${d.YU.VISIBLE}`)})),this}setMinimumDelayBetweenInterstitial(e){this.#Se.setMinimumDelay(e)}showBanner(e=l.Cb.BOTTOM,t=null){this.#ge.show(e,t)}hideBanner(){this.#ge.hide()}preloadInterstitial(e=null){this.#Se.preload(e)}showInterstitial(e=null){this.#Ie()||this.#Se.show(e)}preloadRewarded(e=null){this.#Ae.preload(e)}showRewarded(e=null){this.#Ie()||this.#Ae.show(e)}showAdvancedBanners(e){this.#Ee.show(e)}hideAdvancedBanners(){this.#Ee.hide()}checkAdBlock(){return this._platformBridge.checkAdBlock()}#ye(e){const t=i.ZP.getValues().advertisement?.interstitial?.autoShow;Array.isArray(t)&&t.includes(e)&&this.showInterstitial(e)}#Ie(){return this.#Se.isInProgress||this.#Ae.isInProgress}#Pe(e){e===l.WA.LOADING||e===l.WA.OPENED?this.#Ee.hideByAd():e!==l.WA.CLOSED&&e!==l.WA.FAILED||this.#Ee.restoreAfterAd()}#fe(e){e===l.b3.LOADING||e===l.b3.OPENED?this.#Ee.hideByAd():e!==l.b3.CLOSED&&e!==l.b3.FAILED||this.#Ee.restoreAfterAd()}}(0,s.iL)(M.prototype);const N=new M},6170:(e,t,r)=>{r.d(t,{ZP:()=>_,rh:()=>m});var s=r(8902),i=r(9541),a=r(3806);const o=\"2.2.0\";var n=r(8960),d=r(3941),l=r(9778),h=r(5230),c=r(5819);class u extends l.Z{set gameVersion(e){this.#De=e}#Te=[];#we=null;#Re=null;#ve=null;#De=null;#be;#Ce=!1;#Oe=null;#Le=null;#Me=!1;#i=0;#Ne=\"undefined\"!=typeof CompressionStream;constructor(){super(),this.#be=this.#ke()}initialize(e){super.initialize(e);this._platformBridge.platformId===a.Lb.PLAYGAMA||!1!==h.ZP.getValues().sendAnalyticsEvents||(this.#Ce=!0);const{href:t}=window.location;return(t.startsWith(\"file://\")||t.includes(\"localhost\")||t.includes(\"127.0.0.1\"))&&(this.#Ce=!0),this._platformBridge.isPlatformExternalCallsSupported||(this.#Ce=!0),this.#Re=this.#He(),this.#ve=(0,d.m)().id,this.#Ce||(this.#Ge(),this.send(`${s.oF.CORE}_initialization_started`),this.#Be(),this.#Fe()),this}send(e,t={}){if(this.#Ce)return;const r=this.#xe(e,t);this.#Te.push(r)}#ke(){return\"undefined\"!=typeof crypto&&\"function\"==typeof crypto.randomUUID?crypto.randomUUID():(0,n.D1)()}async#Ge(){try{const e=await i.k.getServerTime();this.#i=e-Date.now();for(let e=0;e{this.#Ye(),e.persisted&&this.#$e()},this.#Oe=()=>{\"hidden\"===document.visibilityState?(this.#qe(),this.#Ye()):this.#$e()},document.addEventListener(\"visibilitychange\",this.#Oe),window.addEventListener(\"pagehide\",this.#Le)}#$e(){this.#Ce||(this.#Me=!1,this.#Be())}#Ye(){this.#Me||this.#Ce||(this.#Me=!0,this.send(`${s.oF.CORE}_session_end`),this.#Ke())}#He(){const{platformId:e}=this._platformBridge,t=h.ZP.getValues(),r={[a.Lb.GAME_DISTRIBUTION]:\"gameId\",[a.Lb.Y8]:\"gameId\",[a.Lb.MSN]:\"gameId\",[a.Lb.HUAWEI]:\"appId\",[a.Lb.DISCORD]:\"appId\",[a.Lb.GAMEPUSH]:\"projectId\",[a.Lb.MICROSOFT_STORE]:\"gameId\"}[e],s=r?t?.[r]:null;return\"string\"==typeof s&&s?s:this.#Je(window.location.href)}#Je(e){try{const t=new URL(e),r=t.pathname.split(\"/\").filter(Boolean),{platformId:s}=this._platformBridge,i={[a.Lb.YANDEX]:{pathKey:\"app\"},[a.Lb.LAGGED]:{pathKey:\"g\"},[a.Lb.CRAZY_GAMES]:{pathKey:\"game\"}}[s];if(i){const e=r.indexOf(i.pathKey),t=-1!==e?r[e+1]:null;if(t)return t}if(s===a.Lb.XIAOMI){if(\"index.html\"===r[r.length-1]&&r.length>=2)return r[r.length-2]}if(s===a.Lb.PLAYGAMA||s===a.Lb.STANDALONE||s===a.Lb.PLAYGAMA_SANDBOX){const e=t.searchParams.get(\"game_id\");if(e)return e;const r=t.hostname.match(/^([a-z0-9-]+)\\.games\\.playgama\\.net$/i);if(r)return r[1].replace(/^sb-/i,\"\")}}catch{return null}return null}#Be(){this.#we||(this.#we=setInterval((()=>{this.send(`${s.oF.CORE}_ping`),this.#ze()}),3e4))}#qe(){this.#we&&(clearInterval(this.#we),this.#we=null)}}const p=new u,m=p,_=p},5555:(e,t,r)=>{r.d(t,{Z:()=>S});var s=r(9778),i=r(1558),a=r(5230),o=r(8902),n=r(9221);const d=\"bridge-cross-promo-styles\",l=\"bridge-cross-promo\",h=\"config\",c=\"platform\",u=`\\n #${l} {\\n position: fixed;\\n inset: 0;\\n z-index: 9999998;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n background: rgba(0, 0, 0, 0.72);\\n font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;\\n animation: bridge-cp-fade-in 180ms ease-out;\\n padding: 16px;\\n box-sizing: border-box;\\n }\\n\\n #${l} .bridge-cp-modal {\\n position: relative;\\n width: 100%;\\n max-width: 640px;\\n max-height: 100%;\\n background: #212121;\\n border-radius: 12px;\\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);\\n padding: 24px;\\n box-sizing: border-box;\\n display: flex;\\n flex-direction: column;\\n overflow: hidden;\\n color: #ffffff;\\n }\\n\\n #${l} .bridge-cp-header {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n gap: 12px;\\n margin-bottom: 20px;\\n }\\n\\n #${l} .bridge-cp-title {\\n margin: 0;\\n color: #ffffff;\\n font-size: 20px;\\n font-weight: 700;\\n line-height: 1.2;\\n letter-spacing: -0.2px;\\n }\\n\\n #${l} .bridge-cp-close {\\n flex-shrink: 0;\\n width: 36px;\\n height: 36px;\\n border: 0;\\n border-radius: 50%;\\n background: transparent;\\n color: #aaaaaa;\\n font-size: 24px;\\n line-height: 1;\\n cursor: pointer;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n padding: 0;\\n transition: background 200ms ease, color 200ms ease;\\n }\\n\\n #${l} .bridge-cp-close:hover {\\n background: rgba(255, 255, 255, 0.1);\\n color: #ffffff;\\n }\\n\\n #${l} .bridge-cp-grid {\\n display: grid;\\n grid-template-columns: repeat(2, minmax(0, 1fr));\\n gap: 16px;\\n overflow-y: auto;\\n padding: 4px;\\n margin: -4px;\\n -webkit-overflow-scrolling: touch;\\n }\\n\\n #${l} .bridge-cp-tile {\\n display: flex;\\n flex-direction: column;\\n text-decoration: none;\\n color: inherit;\\n cursor: pointer;\\n }\\n\\n #${l} .bridge-cp-thumb {\\n position: relative;\\n width: 100%;\\n aspect-ratio: 183 / 256;\\n border-radius: 12px;\\n overflow: hidden;\\n background: #333333 center/cover no-repeat;\\n transition: transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 250ms ease;\\n }\\n\\n #${l} .bridge-cp-tile:hover .bridge-cp-thumb {\\n transform: translateY(-4px);\\n box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);\\n }\\n\\n #${l} .bridge-cp-name {\\n margin-top: 8px;\\n font-size: 14px;\\n font-weight: 500;\\n text-align: center;\\n color: #f1f1f1;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n transition: color 200ms ease;\\n }\\n\\n #${l} .bridge-cp-tile:hover .bridge-cp-name {\\n color: #3ea6ff;\\n }\\n\\n @keyframes bridge-cp-fade-in {\\n from { opacity: 0; }\\n to { opacity: 1; }\\n }\\n\\n @media (min-width: 600px) {\\n #${l} .bridge-cp-grid {\\n grid-template-columns: repeat(4, minmax(0, 1fr));\\n }\\n }\\n`;function p(e){return\"string\"==typeof e&&e.length>0?e:void 0}function m(e){return{name:p(e.name),url:e.url,iconUrl:p(e.icon),payload:e}}function _(e){const t=e.appID??e.id;return{id:null==t?void 0:String(t),name:p(e.title)??p(e.name),url:p(e.url)??\"\",iconUrl:p(e.coverURL)??p(e.icon)??p(e.iconUrl),coverUrl:p(e.coverURL)??p(e.coverUrl),payload:e}}class g extends s.Z{get isVisible(){return null!==this.#Xe}#Xe=null;#Qe=h;initialize(e){return super.initialize(e),this.#Qe=this.#et(),this.#tt(),this}getGames(){return this.#Qe===c?this.#rt():Promise.resolve(this.#st())}async show(){if(this.#Xe)return;const e=await this.getGames();if(this.#Xe)return;const t=e.filter((e=>e&&e.url));if(0===t.length)return;const r=function(e,t){if(e.length<=t)return e.slice();const r=e.slice();for(let e=r.length-1;e>0;e-=1){const t=Math.floor(Math.random()*(e+1)),s=r[e];r[e]=r[t],r[t]=s}return r.slice(0,t)}(t,4);this.#it(),this.#Xe=this.#at(r,this.#ot().title),document.body.appendChild(this.#Xe);const s={source:this.#Qe,games:r};i.ZP.emit(o.W1.CROSS_PROMO_SHOWN,s)}hide(){this.#Xe&&(this.#Xe.remove(),this.#Xe=null)}#et(){const{source:e}=this.#ot();return e===c||e===h?e:h}#tt(){i.ZP.on(o.W1.INTERSTITIAL_STATE_CHANGED,(e=>{e!==n.WA.LOADING&&e!==n.WA.OPENED||this.hide()})),i.ZP.on(o.W1.REWARDED_STATE_CHANGED,(e=>{e!==n.b3.LOADING&&e!==n.b3.OPENED||this.hide()}))}#ot(){return a.ZP.getValues().crossPromo??{}}#st(){const{games:e}=this.#ot();return Array.isArray(e)?e.filter((e=>e&&e.url)).map(m):[]}#rt(){return this._platformBridge.isPlatformGamesListSupported?this._platformBridge.getGamesList().then((e=>Array.isArray(e)?e.map(_):[])).catch((()=>[])):Promise.resolve([])}#it(){if(document.getElementById(d))return;const e=document.createElement(\"style\");e.id=d,e.textContent=u,document.head.appendChild(e)}#at(e,t){const r=document.createElement(\"div\");r.id=l;const s=document.createElement(\"div\");s.className=\"bridge-cp-modal\";const i=document.createElement(\"div\");i.className=\"bridge-cp-header\";const a=document.createElement(\"h2\");a.className=\"bridge-cp-title\",a.textContent=\"string\"==typeof t&&t.length>0?t:\"More games\",i.appendChild(a);const o=document.createElement(\"button\");o.className=\"bridge-cp-close\",o.type=\"button\",o.setAttribute(\"aria-label\",\"Close\"),o.textContent=\"×\",i.appendChild(o),s.appendChild(i);const n=document.createElement(\"div\");return n.className=\"bridge-cp-grid\",e.forEach((e=>{n.appendChild(this.#nt(e))})),s.appendChild(n),r.appendChild(s),r.addEventListener(\"click\",(e=>{e.target===r&&this.hide()})),s.addEventListener(\"click\",(e=>{const t=e.target,r=t.closest(\".bridge-cp-tile\");if(t.closest(\".bridge-cp-close\"))return e.preventDefault(),void this.hide();r||this.hide()})),r}#nt(e){const t=document.createElement(\"a\");t.className=\"bridge-cp-tile\",t.href=e.url,t.target=\"_blank\",t.rel=\"noopener noreferrer\";const r=document.createElement(\"div\");if(r.className=\"bridge-cp-thumb\",e.iconUrl&&(r.style.backgroundImage=`url('${e.iconUrl.replace(/'/g,\"\\\\'\")}')`),t.appendChild(r),e.name){const r=document.createElement(\"div\");r.className=\"bridge-cp-name\",r.textContent=e.name,t.appendChild(r)}return t}}const S=new g},66:(e,t,r)=>{r.d(t,{AR:()=>a,Lh:()=>i,Uw:()=>o,me:()=>s});const s={DESKTOP:\"desktop\",MOBILE:\"mobile\",TABLET:\"tablet\",TV:\"tv\"},i={WINDOWS:\"windows\",MACOS:\"macos\",LINUX:\"linux\",ANDROID:\"android\",IOS:\"ios\",OTHER:\"other\"},a={PORTRAIT:\"portrait\",LANDSCAPE:\"landscape\"},o=\"bridge-orientation-overlay\"},3117:(e,t,r)=>{r.d(t,{f:()=>i});var s=r(66);function i(){return window.innerHeight>window.innerWidth?s.AR.PORTRAIT:s.AR.LANDSCAPE}},7408:(e,t,r)=>{r.d(t,{Z:()=>s});const s={NOT_AVAILABLE:\"not_available\",IN_GAME:\"in_game\",NATIVE:\"native\",NATIVE_POPUP:\"native_popup\"}},1147:(e,t,r)=>{r.d(t,{ZP:()=>h,cE:()=>l,iv:()=>d,om:()=>n});var s=r(9778),i=r(6170),a=r(8902);class o extends s.Z{get isSupported(){return this._platformBridge.isPaymentsSupported}purchase(e,t){return this._platformBridge.isPaymentsSupported?(i.rh.send(`${a.oF.PAYMENTS}_purchase_started`,{id:e}),this._platformBridge.paymentsPurchase(e,t).then((t=>(i.rh.send(`${a.oF.PAYMENTS}_purchase_completed`,{id:e}),t))).catch((t=>{throw i.rh.send(`${a.oF.PAYMENTS}_purchase_failed`,{id:e}),t}))):Promise.reject()}getPurchases(){return this._platformBridge.isPaymentsSupported?this._platformBridge.paymentsGetPurchases():Promise.reject()}getCatalog(){return this._platformBridge.isPaymentsSupported?this._platformBridge.paymentsGetCatalog():Promise.reject()}consumePurchase(e){return this._platformBridge.isPaymentsSupported?(i.rh.send(`${a.oF.PAYMENTS}_consume_purchase_started`,{id:e}),this._platformBridge.paymentsConsumePurchase(e).then((t=>(i.rh.send(`${a.oF.PAYMENTS}_consume_purchase_completed`,{id:e}),t))).catch((t=>{throw i.rh.send(`${a.oF.PAYMENTS}_consume_purchase_failed`,{id:e}),t}))):Promise.reject()}}function n(e,t){return e?e.map((e=>{const r={...e[t]??{}};return r.platformProductId=r.id??e.id,r.id=e.id,r})):[]}function d(e,t,r){if(!e)return null;const s=e.find((e=>e.id===r));if(!s)return null;const i={...s[t]??{}};return i.platformProductId=i.id??s.id,i.id=s.id,i}function l(e){return`${e}_${Date.now()}_${Math.random().toString(36).substring(2,10)}`}const h=new o},3806:(e,t,r)=>{r.d(t,{Dt:()=>i,Lb:()=>s,YU:()=>a});const s={VK:\"vk\",OK:\"ok\",YANDEX:\"yandex\",CRAZY_GAMES:\"crazy_games\",GAME_DISTRIBUTION:\"game_distribution\",PLAYGAMA:\"playgama\",STANDALONE:\"standalone\",PLAYGAMA_SANDBOX:\"playgama_sandbox\",TELEGRAM:\"telegram\",Y8:\"y8\",LAGGED:\"lagged\",FACEBOOK:\"facebook\",POKI:\"poki\",MOCK:\"mock\",QA_TOOL:\"qa_tool\",MSN:\"msn\",MICROSOFT_STORE:\"microsoft_store\",HUAWEI:\"huawei\",GAMEPUSH:\"gamepush\",DISCORD:\"discord\",JIO_GAMES:\"jio_games\",YOUTUBE:\"youtube\",PORTAL:\"portal\",REDDIT:\"reddit\",XIAOMI:\"xiaomi\",TIKTOK:\"tiktok\",DLIGHTEK:\"dlightek\",GAMESNACKS:\"gamesnacks\",SAMSUNG:\"samsung\"},i={GAME_READY:\"game_ready\",LEVEL_STARTED:\"level_started\",LEVEL_COMPLETED:\"level_completed\",LEVEL_FAILED:\"level_failed\",LEVEL_PAUSED:\"level_paused\",LEVEL_RESUMED:\"level_resumed\",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\"},a={VISIBLE:\"visible\",HIDDEN:\"hidden\"}},3941:(e,t,r)=>{r.d(t,{Z:()=>u,m:()=>h});var s=r(9778),i=r(8960),a=r(6873),o=r(9146);const n=\"bridge-player-guest-id\",d=\"bridge_player_guest_id\";let l=null;function h(){if(l)return{id:l,name:`Guest ${l}`};let e=a.Z.getItem(n)||a.Z.getItem(d);e||(e=(0,o.D)());try{a.Z.setItem(n,e)}catch{}return l=e,{id:e,name:`Guest ${e}`}}class c extends s.Z{get isAuthorizationSupported(){return this._platformBridge.isPlayerAuthorizationSupported}get isAuthorized(){return this._platformBridge.isPlayerAuthorized}get isGuest(){if(!this._platformBridge.isPlayerAuthorized)return!0;const e=this._platformBridge.playerId;return!e||e===h().id}get id(){return this._platformBridge.playerId}get name(){return this._platformBridge.playerName}get photos(){return this._platformBridge.playerPhotos}get extra(){return this._platformBridge.playerExtra}authorize(e){const t=(0,i.ju)(e,this._platformBridge.platformId);return this.isAuthorizationSupported?this._platformBridge.authorizePlayer(t):Promise.reject()}}const u=new c},9979:(e,t,r)=>{r.d(t,{Z:()=>p});var s=r(1558),i=r(9778),a=r(8902),o=r(6873);function n(e){return null==e||\"\"===e}function d(e,t){if(n(e))return null;if(!t||\"string\"!=typeof e)return e;try{return JSON.parse(e)}catch{return e}}function l(e){return null==e||\"string\"==typeof e?e:JSON.stringify(e)}const h=class{#dt=new Map;#lt=new Set;#ht=new Set;has(e){return this.#dt.has(e)}get(e){return this.#dt.get(e)}isDirty(e){return this.#lt.has(e)}isDeleted(e){return this.#ht.has(e)}dirtyKeys(){return[...this.#lt]}deletedKeys(){return[...this.#ht]}set(e,t){n(t)?this.delete(e):(this.#dt.set(e,t),this.#lt.delete(e),this.#ht.delete(e))}setDirty(e,t){n(t)?this.delete(e):(this.#dt.set(e,t),this.#lt.add(e),this.#ht.delete(e))}delete(e){this.#dt.delete(e),this.#lt.delete(e),this.#ht.delete(e)}tombstone(e){this.#dt.delete(e),this.#lt.delete(e),this.#ht.add(e)}keys(){return[...this.#dt.keys()]}clear(){this.#dt.clear(),this.#lt.clear(),this.#ht.clear()}};const c=class{#ct=Promise.resolve();enqueue(e){const t=this.#ct.then(e,e);return this.#ct=t.then((()=>{}),(()=>{})),t}};class u extends i.Z{#ut=new h;#pt=new c;initialize(e){return super.initialize(e),this._platformBridge.on(a.W1.PLATFORM_STORAGE_AVAILABILITY_CHANGED,(e=>{this.#pt.enqueue((()=>this.#mt(Boolean(e)))).catch((()=>{}))})),this}get(e,t=!0){const r=Array.isArray(e);if(r&&0===e.length)return Promise.resolve([]);const s=r?e:[e],i=this.#pt.enqueue((()=>this.#_t(s,t)));return r?i:i.then((e=>e[0]))}set(e,t){return s.ZP.emit(a.W1.STORAGE_SET),Array.isArray(e)?Array.isArray(t)?e.length!==t.length?Promise.reject(new Error(\"Key and value arrays must have the same length\")):0===e.length?Promise.resolve():this.#pt.enqueue((()=>this.#gt(this.#St(e,t)))):Promise.reject(new Error(\"Value must be an array when key is an array\")):this.#pt.enqueue((()=>this.#gt(this.#St([e],[t]))))}delete(e){const t=Array.isArray(e)?e:[e];return 0===t.length?Promise.resolve():this.#pt.enqueue((()=>this.#At(t)))}#St(e,t){const r={sets:[],deletes:[]};return e.forEach(((e,s)=>{n(t[s])?r.deletes.push(e):r.sets.push({key:e,value:l(t[s])})})),r}async#_t(e,t){if(e.every((e=>this.#ut.has(e))))return e.map((e=>d(this.#ut.get(e),t)));if(!this.#Et())return this.#Pt(e,t);try{const t=e.filter((e=>!this.#ut.has(e)&&!this.#ut.isDeleted(e)));if(t.length>0){const e=await this._platformBridge.getDataFromStorage(t);Object.keys(e).forEach((t=>{this.#ut.isDirty(t)||this.#ut.isDeleted(t)||this.#ut.set(t,e[t])}))}}catch{return this.#Pt(e,t)}return(await this.#ft(e)).map((e=>d(e,t)))}async#ft(e){const t=[],r=[],s=e.map((e=>{if(this.#ut.has(e))return this.#ut.isDirty(e)?r.push({key:e,value:this.#ut.get(e)}):t.push(e),this.#ut.get(e);if(this.#ut.isDeleted(e))return null;const s=this.#It(e);return n(s)?null:(r.push({key:e,value:s}),s)}));return this.#yt(t),r.length>0&&await this.#Dt(r),s}async#Dt(e){try{await this._platformBridge.setDataToStorage(this.#Tt(e)),e.forEach((e=>this.#ut.set(e.key,e.value))),this.#yt(e.map((e=>e.key)))}catch{}}async#gt(e){if(this.#Et())try{return e.sets.length>0&&await this._platformBridge.setDataToStorage(this.#Tt(e.sets)),e.deletes.length>0&&await this._platformBridge.deleteDataFromStorage(e.deletes),this.#wt(e,!1),void this.#yt([...e.sets.map((e=>e.key)),...e.deletes])}catch{}this.#Rt(e)}#Rt(e){if(!o.Z.isAvailable)throw new a.Hd(a.Bq.STORAGE_NOT_SUPPORTED);try{e.sets.forEach((e=>o.Z.setItem(e.key,e.value))),e.deletes.forEach((e=>o.Z.removeItem(e)))}catch(e){if(e&&\"QuotaExceededError\"===e.name)throw new a.Hd(a.Bq.STORAGE_QUOTA_EXCEEDED);throw e}this.#wt(e,!0),this._platformBridge.notifyLocalDataChanged?.(e)}async#At(e){if(this.#yt(e),this.#Et())try{return await this._platformBridge.deleteDataFromStorage(e),void e.forEach((e=>this.#ut.delete(e)))}catch{}e.forEach((e=>this.#ut.tombstone(e))),this._platformBridge.notifyLocalDataChanged?.({sets:[],deletes:e})}async#mt(e){if(e&&this.#Et()){const e=this.#ut.dirtyKeys(),t=this.#ut.deletedKeys();try{if(e.length>0){const t=e.map((e=>({key:e,value:this.#ut.get(e)})));await this._platformBridge.setDataToStorage(this.#Tt(t))}t.length>0&&await this._platformBridge.deleteDataFromStorage(t),this.#yt([...this.#ut.keys(),...t]),this.#ut.clear()}catch{}}else o.Z.isAvailable&&this.#ut.keys().forEach((e=>{try{o.Z.setItem(e,l(this.#ut.get(e)))}catch{}}))}#Pt(e,t){if(!o.Z.isAvailable)throw new a.Hd(a.Bq.STORAGE_NOT_SUPPORTED);return e.map((e=>{if(this.#ut.has(e))return d(this.#ut.get(e),t);if(this.#ut.isDeleted(e))return null;const r=o.Z.getItem(e);return this.#ut.setDirty(e,r),d(r,t)}))}#It(e){return o.Z.isAvailable?o.Z.getItem(e):null}#yt(e){o.Z.isAvailable&&e.forEach((e=>o.Z.removeItem(e)))}#wt(e,t){e.sets.forEach((e=>{t?this.#ut.setDirty(e.key,e.value):this.#ut.set(e.key,e.value)})),e.deletes.forEach((e=>{t?this.#ut.tombstone(e):this.#ut.delete(e)}))}#Tt(e){const t={};return e.forEach((e=>{t[e.key]=e.value})),t}#Et(){return this._platformBridge.isPlatformStorageAvailable}}const p=new u},9163:(e,t,r)=>{r.r(t),r.d(t,{default:()=>u});var s=r(8166),i=r(8960),a=r(1472),o=r(8902),n=r(3806),d=r(66),l=r(9221);const h=\"https://store.xsolla.com/api/v2/project\";class c extends s.Z{get platformId(){return n.Lb.CRAZY_GAMES}get platformLanguage(){return this.#vt?this._platformSdk.user.systemInfo.countryCode.toLowerCase():super.platformLanguage}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlayerAuthorizationSupported(){return this.#vt}get isPaymentsSupported(){return!!this.options.xsollaProjectId}get deviceType(){if(this.#vt){const e=this._platformSdk.user.systemInfo.device.type.toLowerCase();if([d.me.DESKTOP,d.me.MOBILE,d.me.TABLET].includes(e))return e}return super.deviceType}#bt=!1;#vt=!1;#Ct={adStarted:()=>{this.#bt?this._setRewardedState(l.b3.OPENED):this._setInterstitialState(l.WA.OPENED)},adFinished:()=>{this.#bt?(this._setRewardedState(l.b3.REWARDED),this._setRewardedState(l.b3.CLOSED)):this._setInterstitialState(l.WA.CLOSED)},adError:()=>{this._showAdFailurePopup(this.#bt)}};initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(o.Mn.INITIALIZE),(0,i.ZT)(\"https://sdk.crazygames.com/crazygames-sdk-v3.js\").then((()=>{(0,i.X_)(\"CrazyGames\",\"SDK\",\"init\").then((()=>{this._platformSdk=window.CrazyGames.SDK,this._setPlatformStorageAvailable(!0),this._isBannerSupported=!0,this._isAdvancedBannersSupported=!0,this._platformSdk.init().then((()=>{this.#vt=this._platformSdk.user.isUserAccountAvailable;const e=this.#Ot();this._platformSdk.game.addSettingsChangeListener((e=>{this._setAudioState(!e.muteAudio)})),this._setAudioState(!this._platformSdk.game.settings.muteAudio),this.options.xsollaProjectId&&this.#Lt(),Promise.all([e]).finally((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(o.Mn.INITIALIZE)}))}))}))}))),e.promise}authorizePlayer(){if(!this.#vt)return Promise.reject();if(this._isPlayerAuthorized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.AUTHORIZE_PLAYER);return e||(e=this._createPromiseDecorator(o.Mn.AUTHORIZE_PLAYER),this._platformSdk.user.showAuthPrompt().then((()=>{this.#Ot().then((()=>{this._resolvePromiseDecorator(o.Mn.AUTHORIZE_PLAYER)}))})).catch((e=>{this._rejectPromiseDecorator(o.Mn.AUTHORIZE_PLAYER,e)}))),e.promise}sendMessage(e){const t=this._platformSdk;switch(e){case n.Dt.IN_GAME_LOADING_STARTED:return t.game.loadingStart(),Promise.resolve();case n.Dt.IN_GAME_LOADING_STOPPED:return t.game.loadingStop(),Promise.resolve();case n.Dt.GAMEPLAY_STARTED:case n.Dt.LEVEL_STARTED:case n.Dt.LEVEL_RESUMED:return t.game.gameplayStart(),Promise.resolve();case n.Dt.GAMEPLAY_STOPPED:case n.Dt.LEVEL_PAUSED:case n.Dt.LEVEL_COMPLETED:case n.Dt.LEVEL_FAILED:return t.game.gameplayStop(),Promise.resolve();case n.Dt.PLAYER_GOT_ACHIEVEMENT:return t.game.happytime(),Promise.resolve();default:return super.sendMessage(e)}}getDataFromStorage(e){const{data:t}=this._platformSdk,r={};return e.forEach((e=>{const s=t.getItem(e);null!=s&&\"\"!==s&&(r[e]=s)})),Promise.resolve(r)}setDataToStorage(e){const t=this._platformSdk;return Object.keys(e).forEach((r=>t.data.setItem(r,e[r]))),Promise.resolve()}deleteDataFromStorage(e){const t=this._platformSdk;return e.forEach((e=>t.data.removeItem(e))),Promise.resolve()}showBanner(e){let t=document.getElementById(l._g);t||(t=(0,a.kM)(e)),t.style.display=\"block\",this._platformSdk.banner.requestResponsiveBanner([l._g]).then((()=>{this._setBannerState(l.Kk.SHOWN)})).catch((()=>{this._setBannerState(l.Kk.FAILED),t.style.display=\"none\"}))}hideBanner(){const e=document.getElementById(l._g);e&&(e.style.display=\"none\"),this._platformSdk.banner.clearAllBanners(),this._setBannerState(l.Kk.HIDDEN)}showAdvancedBanners(e){this._setAdvancedBannersState(l.Kk.LOADING),(0,a.XA)();const t=(0,a.f_)(e),r=this._platformSdk,s=t.map((e=>r.banner.requestResponsiveBanner(e)));Promise.all(s).then((()=>{this._setAdvancedBannersState(l.Kk.SHOWN)})).catch((()=>{this._setAdvancedBannersState(l.Kk.FAILED),(0,a.XA)()}))}hideAdvancedBanners(){(0,a.XA)(),this._platformSdk.banner.clearAllBanners(),this._setAdvancedBannersState(l.Kk.HIDDEN)}showInterstitial(){this.#bt=!1,this._platformSdk.ad.requestAd(\"midgame\",this.#Ct)}showRewarded(){this.#bt=!0,this._platformSdk.ad.requestAd(\"rewarded\",this.#Ct)}checkAdBlock(){return new Promise((e=>{this._platformSdk.ad.hasAdblock().then((t=>{e(t)}))}))}paymentsPurchase(e){let t=this._paymentsGetProductPlatformData(e);t||(t={id:e});const r=t.platformProductId||t.id;let s=this._getPromiseDecorator(o.Mn.PURCHASE);return s||(s=this._createPromiseDecorator(o.Mn.PURCHASE),this.#Lt().then((()=>this.#Mt())).then((async e=>{const s=await fetch(`${h}/${this.options.xsollaProjectId}/payment/item/${r}`,{method:\"POST\",headers:{Authorization:`Bearer ${e}`,\"Content-Type\":\"application/json\"}});if(!s.ok)throw new Error(`Xsolla create order HTTP ${s.status}`);const i=await s.json(),a=i.token,n=i.order_id,d=window.XPayStationWidget;if(!d)throw new Error(\"Xsolla Pay Station widget not loaded\");d.init({access_token:a,sandbox:this.options.isSandbox||!1,childWindow:{target:\"_blank\"}});let l,c=!1;const u=()=>{document.removeEventListener(\"visibilitychange\",l)};l=()=>{\"visible\"!==document.visibilityState||c||setTimeout((()=>{c||(c=!0,u(),this._rejectPromiseDecorator(o.Mn.PURCHASE,new Error(\"Purchase canceled/closed\")))}),1500)},d.on(d.eventTypes.STATUS,((s,i)=>{try{const s=i&&i.paymentInfo||{};s.status&&/done|charged|success/i.test(String(s.status))&&this.#Nt(this.options.xsollaProjectId,n,e).then((e=>{this._platformSdk.analytics.trackOrder(\"xsolla\",e);const s={id:t.id,sku:r,orderId:n,...e};this._paymentsPurchases.push(s),c||(c=!0,u(),this._resolvePromiseDecorator(o.Mn.PURCHASE,s))})).catch((e=>{c||(c=!0,u(),this._rejectPromiseDecorator(o.Mn.PURCHASE,e))}))}catch(e){c||(c=!0,u(),this._rejectPromiseDecorator(o.Mn.PURCHASE,e))}})),d.on(\"close\",(()=>{c||(c=!0,u(),this._rejectPromiseDecorator(o.Mn.PURCHASE,new Error(\"Purchase canceled/closed\")))})),d.open(),document.addEventListener(\"visibilitychange\",l)})).catch((e=>{this._rejectPromiseDecorator(o.Mn.PURCHASE,e)}))),s.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject(new Error(\"No platform products available\"));let t=this._getPromiseDecorator(o.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(o.Mn.GET_CATALOG),this.#Mt().then((e=>fetch(`${h}/${this.options.xsollaProjectId}/items?limit=50`,{headers:{Authorization:`Bearer ${e}`}}))).then((e=>{if(!e.ok)throw new Error(`Xsolla catalog HTTP ${e.status}`);return e.json()})).then((t=>{const r=t.items||[],s=new Map(r.map((e=>[e.sku,e]))),i=e.map((e=>{const t=s.get(e.platformProductId),r=t?.price;return{id:e.id,name:t?.name??e.name??e.id,description:t?.description??e.description??\"\",price:r?.amount??null,priceCurrencyCode:r?.currency??null,priceValue:r?.amount??null}}));this._resolvePromiseDecorator(o.Mn.GET_CATALOG,i)})).catch((e=>{this._rejectPromiseDecorator(o.Mn.GET_CATALOG,e)}))),t.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject(new Error(\"No such purchase to consume\"));let r=this._getPromiseDecorator(o.Mn.CONSUME_PURCHASE);if(!r){r=this._createPromiseDecorator(o.Mn.CONSUME_PURCHASE);const s=this._paymentsPurchases[t],i=s.sku||s.id;this.#Mt().then((e=>fetch(`${h}/${this.options.xsollaProjectId}/user/inventory/item/consume`,{method:\"POST\",headers:{Authorization:`Bearer ${e}`,\"Content-Type\":\"application/json\"},body:JSON.stringify({sku:i,quantity:1})}))).then((r=>{if(!r.ok)throw new Error(`Xsolla consume HTTP ${r.status}`);this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(o.Mn.CONSUME_PURCHASE,{id:e})})).catch((e=>{this._rejectPromiseDecorator(o.Mn.CONSUME_PURCHASE,e)}))}return r.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(o.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(o.Mn.GET_PURCHASES),this.#Mt().then((e=>fetch(`${h}/${this.options.xsollaProjectId}/user/inventory/items`,{headers:{Authorization:`Bearer ${e}`}}))).then((e=>{if(!e.ok)throw new Error(`Xsolla inventory HTTP ${e.status}`);return e.json()})).then((e=>{const t=this._paymentsGetProductsPlatformData()||[];this._paymentsPurchases=(e.items||[]).map((e=>{const r=t.find((t=>t.id===e.sku));if(!r)return null;return{id:r.id,...e}})).filter((e=>null!==e)),this._resolvePromiseDecorator(o.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((e=>{this._rejectPromiseDecorator(o.Mn.GET_PURCHASES,e)}))),e.promise}#Ot(){return this.#vt?new Promise(((e,t)=>{this._platformSdk.user.getUser().then((r=>{r?(this._isPlayerAuthorized=!0,r.username&&(this._playerName=r.username),r.profilePictureUrl&&(this._playerPhotos=[r.profilePictureUrl]),this._playerExtra=r,this._options.useUserToken?this._platformSdk.user.getUserToken().then((e=>{this._playerExtra.jwt=e})).finally((()=>{e()})):e()):t()})).catch((e=>{t(e)}))})):Promise.reject()}async#Lt(){window.XPayStationWidget||await(0,i.ZT)(\"https://cdn.xsolla.net/payments-bucket-prod/embed/1.5.0/widget.min.js\")}async#Mt(){return await this._platformSdk.user.getXsollaUserToken()}async#Nt(e,t,r){const s=await fetch(`${h}/${e}/order/${t}`,{headers:{Authorization:`Bearer ${r}`}});if(!s.ok)throw new Error(`Xsolla order HTTP ${s.status}`);return s.json()}}const u=c},1634:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(8166),i=r(8960),a=r(8902),o=r(3806);const n=\"https://discord.com/api/v10\";class d extends s.Z{get platformId(){return o.Lb.DISCORD}get isPlayerAuthorizationSupported(){return!0}get isPaymentsSupported(){return!0}get isInviteFriendsSupported(){return!0}get isShareSupported(){return!0}_appId=null;_accessToken=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options?.appId?(this._appId=this._options.appId,(0,i.ZT)(\"/cdn/discord/discord-v2.0.0.min.js\").then((()=>{(0,i.X_)(\"discord\",\"DiscordSDK\").then((()=>(this._platformSdk=new window.discord.DiscordSDK(this._appId),this._platformSdk.ready()))).then((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.DISCORD_GAME_PARAMS_NOT_FOUND)),e.promise}authorizePlayer(e){const t=e,r=t?.scope||[\"identify\"];let s=this._getPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);if(!s){s=this._createPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);const e=this._platformSdk;e.commands.authorize({client_id:this._appId,response_type:\"code\",state:\"\",prompt:\"none\",scope:r}).then((({code:e})=>fetch(\"/api/discord/auth-token\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({code:e,appId:this._appId})}))).then((e=>e.json())).then((t=>(this._accessToken=t.accessToken,this._playerExtra={token:t.token,accessToken:this._accessToken,channelId:e.channelId},e.commands.authenticate({access_token:this._accessToken})))).then((e=>{if(null===e)throw new Error(\"Authorization failed\");return fetch(`${n}/users/@me`,{method:\"GET\",headers:{Authorization:`Bearer ${this._accessToken}`,\"Content-Type\":\"application/json\"}})})).then((e=>e.json())).then((e=>{this._playerId=e.id,this._playerName=e.username,e.avatar&&this._playerPhotos.push(`https://cdn.discordapp.com/avatars/${e.id}/${e.avatar}.png`),this._playerExtra={...this._playerExtra,...e},this._isPlayerAuthorized=!0,this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)})).catch((e=>{this._accessToken=null,this._rejectPromiseDecorator(a.Mn.AUTHORIZE_PLAYER,e)}))}return s.promise}paymentsPurchase(e){const t=this._paymentsGetProductPlatformData(e);if(!t)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.PURCHASE);return r||(r=this._createPromiseDecorator(a.Mn.PURCHASE),this._platformSdk.commands.startPurchase({sku_id:t.platformProductId}).then((t=>{if(!t)throw new Error(\"Purchase failed\");const r={id:e,...t};this._paymentsPurchases.push(r),this._resolvePromiseDecorator(a.Mn.PURCHASE,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.PURCHASE,e)}))),r.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.CONSUME_PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE);const s=this._paymentsPurchases[t].purchaseToken;fetch(`${n}/applications/${this._appId}/entitlements/${s}/consume`,{method:\"POST\",headers:{Authorization:`Bearer ${this._accessToken}`,\"Content-Type\":\"application/json\"},body:JSON.stringify({})}).then((()=>{this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,{id:e})})).catch((e=>{this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,e)}))}return r.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(a.Mn.GET_CATALOG),this._platformSdk.commands.getSkus().then((({skus:t})=>{const r=e.map((e=>{const r=t.find((t=>t.id===e.platformProductId)),s=window.discord.PriceUtils.formatPrice(r.price),a=(0,i.ZP)(s),o=r.price?.currency?.toUpperCase(),n=`${a} ${o}`;return{id:e.id,title:r.name,price:n,priceValue:a,priceCurrencyCode:o}}));this._resolvePromiseDecorator(a.Mn.GET_CATALOG,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_CATALOG,e)}))),t.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(a.Mn.GET_PURCHASES),this._platformSdk.commands.getEntitlements().then((e=>{const t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.entitlements.map((e=>{const r={id:t.find((t=>t.id===e.id)).id};return Object.assign(r,e),r})),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,e)}))),e.promise}inviteFriends(){let e=this._getPromiseDecorator(a.Mn.INVITE_FRIENDS);return e||(e=this._createPromiseDecorator(a.Mn.INVITE_FRIENDS),this._platformSdk.commands.openInviteDialog().then((()=>{this._resolvePromiseDecorator(a.Mn.INVITE_FRIENDS)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.INVITE_FRIENDS,e)}))),e.promise}share(e){const{image:t,url:r,...s}=e??{},o=t&&!(0,i.dY)(t)?t:r;if(!o)return Promise.reject();let n=this._getPromiseDecorator(a.Mn.SHARE);return n||(n=this._createPromiseDecorator(a.Mn.SHARE),this._platformSdk.commands.openShareMomentDialog({...s,mediaUrl:o}).then((()=>{this._resolvePromiseDecorator(a.Mn.SHARE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.SHARE,e)}))),n.promise}}const l=d},7430:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(1302),a=r(8902),o=r(3806),n=r(9221),d=r(8960),l=r(1472);class h extends s.Z{get platformId(){return o.Lb.DLIGHTEK}get isBannerSupported(){return!0}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}_bannerContainer=null;_bannerPlacement=null;#kt=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options?.appKey&&this._options?.adSenseId?(0,d.ZT)(\"https://www.hippoobox.com/static/sdk/adsdk_1.9.5.js\").then((()=>{if(!window.h5sdk)throw new Error(\"Dlightek SDK not found\");this._platformSdk=window.h5sdk;const e=this._platformSdk;this.#kt=setTimeout((()=>{this._isInitialized||this.#Ht()}),5e3);const t={client:this._options.adSenseId,\"data-ad-frequency-hint\":\"45s\",callback:()=>{e.adConfig({preloadAdBreaks:\"on\",sound:\"on\",onReady:()=>{this._isInitialized||(this.#kt&&clearTimeout(this.#kt),this.#Ht())}})}};this._options.adChannel&&(t[\"data-ad-channel\"]=this._options.adChannel),this._options.testMode&&(t[\"data-adbreak-test\"]=\"on\"),e.init(this._options.appKey,\"\",\"\",\"\",\"\",{adsense:t})})).catch((()=>{this.#Ht()})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)),e.promise}sendMessage(e,t){return e===o.Dt.GAME_READY?new Promise((e=>{try{const e=this._platformSdk;e&&e.gameLoadingCompleted&&e.gameLoadingCompleted()}catch(e){i.ZP.error(\"Dlightek error:\",e)}e(void 0)})):super.sendMessage(e)}showInterstitial(e){this._platformSdk?this._platformSdk.adBreak({type:\"start\",name:e,beforeAd:()=>{this._setInterstitialState(n.WA.OPENED)},afterAd:()=>{this._setInterstitialState(n.WA.CLOSED)},adBreakDone:e=>{\"viewed\"!==e.breakStatus&&this._showAdFailurePopup(!1)}}):this._showAdFailurePopup(!1)}showRewarded(e){this._platformSdk?this._platformSdk.adBreak({type:\"reward\",name:e,beforeAd:()=>{this._setRewardedState(n.b3.OPENED)},afterAd:()=>{this._setRewardedState(n.b3.CLOSED)},beforeReward:e=>{e(0)},adDismissed:()=>{},adViewed:()=>{this._setRewardedState(n.b3.REWARDED)},adBreakDone:e=>{\"frequencyCapped\"!==e.breakStatus&&\"other\"!==e.breakStatus||this._showAdFailurePopup(!0)}}):this._showAdFailurePopup(!0)}showBanner(e,t){if(this._bannerContainer)return;this._bannerPlacement=t,this._bannerContainer=(0,l.kM)(e);const r=this.#Gt(t);this._bannerContainer.appendChild(r),this._setBannerState(n.Kk.SHOWN)}hideBanner(){this._bannerContainer?.remove(),this._bannerContainer=null,this._setBannerState(n.Kk.HIDDEN)}#Ht(){this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}#Gt(e){const t=document.createElement(\"ins\");return t.style.display=\"block\",t.classList.add(\"adsbygoogle\"),t.setAttribute(\"data-ad-client\",this._options.adSenseId),t.setAttribute(\"data-ad-slot\",String(e??\"\")),t.setAttribute(\"data-ad-format\",\"auto\"),t.setAttribute(\"data-container-id\",n._g),t.setAttribute(\"data-full-width-responsive\",\"true\"),this._options.testMode&&t.setAttribute(\"data-adtest\",\"on\"),t}}const c=h},2769:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(66),d=r(9221),l=r(7408);class h extends s.Z{get platformId(){return o.Lb.FACEBOOK}get platformLanguage(){return this._platformLanguage||super.platformLanguage}get isPlatformExternalCallsSupported(){return!1}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get deviceType(){switch(this._platformSdk&&this._platformSdk.getPlatform()){case\"IOS\":case\"ANDROID\":case\"MOBILE_WEB\":return n.me.MOBILE;case\"WEB\":return n.me.DESKTOP;default:return super.deviceType}}get isPlayerAuthorizationSupported(){return!0}get isBannerSupported(){return!0}get leaderboardsType(){return l.Z.NATIVE_POPUP}get isPaymentsSupported(){return!0}get isInviteFriendsSupported(){return this._supportedApis.includes(\"inviteAsync\")}get isJoinCommunitySupported(){return this._isJoinCommunitySupported}get isShareSupported(){return this._supportedApis.includes(\"shareAsync\")}_platformLanguage=null;_contextId=null;_supportedApis=[];_preloadedInterstitialPromises={};_preloadedRewardedPromises={};_isPlatformStorageAvailable=!0;_isJoinCommunitySupported=!1;_overlay=null;#Bt=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"https://connect.facebook.net/en_US/fbinstant.8.0.js\").then((()=>(0,i.X_)(\"FBInstant\"))).then((()=>(this._platformSdk=window.FBInstant,this._platformSdk.initializeAsync()))).then((()=>{const e=this._platformSdk;this._isPlayerAuthorized=!0,this._playerId=e.player.getID(),this._contextId=e.context.getID();let t=e.getLocale();return\"string\"==typeof t&&(t=t.substring(0,2).toLowerCase()),this._platformLanguage=t,this._supportedApis=e.getSupportedAPIs(),this.#Ft(),Promise.allSettled([e.community.canFollowOfficialPageAsync(),e.community.canJoinOfficialGroupAsync()]).then((([e,t])=>{const r=\"fulfilled\"===e.status&&e.value,s=\"fulfilled\"===t.status&&t.value;this._isJoinCommunitySupported=!0===r&&!0===s}))})).then((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)})).catch((e=>this._rejectPromiseDecorator(a.Mn.INITIALIZE,e)))),e.promise}sendMessage(e,t){if(e===o.Dt.GAME_READY){const e=this._platformSdk;return e.setLoadingProgress(100),this._options.subscribeForNotificationsOnStart&&setTimeout((()=>this.#xt()),0),new Promise((t=>{e.startGameAsync().then(t)}))}return super.sendMessage(e,t)}authorizePlayer(e){return Promise.resolve()}async getDataFromStorage(e){await this.#Ut();const t=await this._platformSdk.player.getDataAsync(e),r={};return e.forEach((e=>{const s=t[e];null!=s&&\"\"!==s&&(r[e]=\"string\"==typeof s?s:JSON.stringify(s))})),r}async setDataToStorage(e){return await this.#Ut(),this._platformSdk.player.setDataAsync(e).then((()=>{}))}async deleteDataFromStorage(e){await this.#Ut();const t={};return e.forEach((e=>{t[e]=null})),this._platformSdk.player.setDataAsync(t).then((()=>{}))}showBanner(e,t){this._platformSdk.loadBannerAdAsync(t,e).then((()=>{this._setBannerState(d.Kk.SHOWN)})).catch((()=>{this._setBannerState(d.Kk.FAILED)}))}hideBanner(){this._platformSdk.hideBannerAdAsync().then((()=>{this._setBannerState(d.Kk.HIDDEN)})).catch((()=>{this._setBannerState(d.Kk.FAILED)}))}preloadInterstitial(e){this.#Vt(e)}showInterstitial(e){this.#Vt(e).then((e=>(this._setInterstitialState(d.WA.OPENED),e.showAsync()))).then((()=>{this._setInterstitialState(d.WA.CLOSED),this.#Vt(e,!0)})).catch((()=>this._advertisementShowErrorPopup(!1)))}preloadRewarded(e){this.#Zt(e)}showRewarded(e){this.#Zt(e).then((e=>(this._setRewardedState(d.b3.OPENED),e.showAsync()))).then((()=>{this._setRewardedState(d.b3.REWARDED),this._setRewardedState(d.b3.CLOSED),this.#Zt(e,!0)})).catch((()=>this._advertisementShowErrorPopup(!0)))}leaderboardsSetScore(e,t){let r=this._getPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);if(!r){r=this._createPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);const s=\"number\"==typeof t?t:parseInt(t,10);this._platformSdk.globalLeaderboards.setScoreAsync(e,s).then((()=>{this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE,e)}))}return r.promise}leaderboardsShowNativePopup(e){let t=this._getPromiseDecorator(a.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP);if(!t){t=this._createPromiseDecorator(a.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP);const r=function(){const e=document.createElement(\"div\");e.style.position=\"fixed\",e.style.top=\"0\",e.style.left=\"0\",e.style.width=\"100vw\",e.style.height=\"100vh\",e.style.backgroundColor=\"rgba(0, 0, 0, 0.5)\",e.style.display=\"flex\",e.style.justifyContent=\"center\",e.style.alignItems=\"center\",e.style.zIndex=\"9999\",e.id=\"loading-overlay\";const t=document.createElement(\"div\");return t.style.fontSize=\"24px\",t.style.color=\"#fff\",t.innerText=\"Loading...\",e.appendChild(t),e}();document.body.appendChild(r);const s=this._platformSdk;s.globalLeaderboards.getTopEntriesAsync(e,20).then((e=>{const t=e.map((e=>({score:e.getScore(),sessionID:e.getPlayer().getSessionID()}))),i=s.overlayViews.createOverlayViewWithXMLString('\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n',\"\",{players:t},(e=>{e.showAsync(),this._overlay=e,r.remove(),this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP)}),((e,t)=>{r.remove(),this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP,t)})),{iframeElement:o}=i;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((e=>{r.remove(),this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP,e)}))}return t.promise}paymentsPurchase(e){let t=this._paymentsGetProductPlatformData(e);t||(t={id:e});let r=this._getPromiseDecorator(a.Mn.PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.PURCHASE);const s=t.platformProductId?t.platformProductId:t.id;this._platformSdk.payments.purchaseAsync({productID:s.toLowerCase()}).then((t=>{const r={id:e,...t};delete r.productID,this._paymentsPurchases.push(r),this._resolvePromiseDecorator(a.Mn.PURCHASE,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.PURCHASE,e)}))}return r.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.CONSUME_PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE);const s=this._paymentsPurchases[t].purchaseToken;this._platformSdk.payments.consumePurchaseAsync(s).then((()=>{this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,{id:e})})).catch((e=>{this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,e)}))}return r.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(a.Mn.GET_CATALOG),this._platformSdk.payments.getCatalogAsync().then((t=>{const r=e.map((e=>{const r=t.find((t=>t.productID===e.platformProductId));return{id:e.id,title:r.title,description:r.description,imageURI:r.imageURI,price:r.price,priceCurrencyCode:r.priceCurrencyCode,priceValue:r.priceAmount}}));this._resolvePromiseDecorator(a.Mn.GET_CATALOG,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_CATALOG,e)}))),t.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(a.Mn.GET_PURCHASES),this._platformSdk.payments.getPurchasesAsync().then((e=>{const t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.map((e=>{const r={id:t.find((t=>t.id===e.productID)).id,...e};return delete r.productID,r})),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,e)}))),e.promise}inviteFriends(e){const t=e??{};if(!t.image||!t.text)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.INVITE_FRIENDS);return r||(r=this._createPromiseDecorator(a.Mn.INVITE_FRIENDS),(0,i.kh)(t.image).then((e=>this._platformSdk.inviteAsync({...t,image:e}))).then((()=>{this._resolvePromiseDecorator(a.Mn.INVITE_FRIENDS)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.INVITE_FRIENDS,e)}))),r.promise}joinCommunity(e){let t=this._getPromiseDecorator(a.Mn.JOIN_COMMUNITY);if(!t){t=this._createPromiseDecorator(a.Mn.JOIN_COMMUNITY);const r=e,s=this._platformSdk;r&&!0===r.isPage?s.community.followOfficialPageAsync().then((e=>this._resolvePromiseDecorator(a.Mn.JOIN_COMMUNITY,e))).catch((e=>this._rejectPromiseDecorator(a.Mn.JOIN_COMMUNITY,e))):s.community.joinOfficialGroupAsync().then((e=>this._resolvePromiseDecorator(a.Mn.JOIN_COMMUNITY,e))).catch((e=>this._rejectPromiseDecorator(a.Mn.JOIN_COMMUNITY,e)))}return t.promise}share(e){const t=e??{};if(!t.image||!t.text)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.SHARE);return r||(r=this._createPromiseDecorator(a.Mn.SHARE),(0,i.kh)(t.image).then((e=>this._platformSdk.shareAsync({intent:\"REQUEST\",...t,image:e}))).then((()=>{this._resolvePromiseDecorator(a.Mn.SHARE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.SHARE,e)}))),r.promise}#Ft(){const e=this;e._platformSdk.overlayViews.setCustomEventHandler((t=>{if(\"leaderboard\"===t)e.#Bt=!0;else if(\"close\"===t){if(e.#Bt)return void(e.#Bt=!1);if(e._overlay){const t=e._overlay.iframeElement.id,r=document.getElementById(t);r&&document.body.removeChild(r),e._overlay.dismissAsync(),e._overlay=null}}}))}#Vt(e,t=!1){if(!t&&this._preloadedInterstitialPromises[e])return this._preloadedInterstitialPromises[e];let r=null;const s=this._platformSdk.getInterstitialAdAsync(e).then((e=>(r=e,e.loadAsync()))).then((()=>r)).catch((()=>(this._preloadedInterstitialPromises[e]=null,Promise.reject())));return this._preloadedInterstitialPromises[e]=s,s}#Zt(e,t=!1){if(!t&&this._preloadedRewardedPromises[e])return this._preloadedRewardedPromises[e];let r=null;const s=this._platformSdk.getRewardedVideoAsync(e).then((e=>(r=e,e.loadAsync()))).then((()=>r)).catch((()=>(this._preloadedRewardedPromises[e]=null,Promise.reject())));return this._preloadedRewardedPromises[e]=s,s}async#xt(){const e=this._platformSdk;try{if(await e.player.isSubscribedBotAsync())return Promise.resolve()}catch(e){if(\"INVALID_OPERATION\"!==e?.code)throw new Error(e)}let t=!1;try{if(t=await e.player.canSubscribeBotAsync(),t)return e.player.subscribeBotAsync()}catch(e){if(\"INVALID_OPERATION\"===e?.code)return Promise.resolve();throw new Error(e)}return Promise.resolve()}#Ut(){return this._isPlayerAuthorized?Promise.resolve():Promise.reject()}}const c=h},3777:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var s=r(8166),i=r(8960),a=r(1472),o=r(8902),n=r(3806),d=r(9221);class l extends s.Z{get platformId(){return n.Lb.GAME_DISTRIBUTION}get isPlatformExternalCallsSupported(){return!1}get isInterstitialSupported(){return!0}get isMinimumDelayBetweenInterstitialEnabled(){return!1}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}#bt=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);if(!e)if(e=this._createPromiseDecorator(o.Mn.INITIALIZE),this._options&&\"string\"==typeof this._options.gameId){const e=this;window.GD_OPTIONS={gameId:this._options.gameId,onEvent(t){switch(t.name){case\"SDK_READY\":e._platformSdk=window.gdsdk,e._isInitialized=!0,e.showInterstitial(),e._resolvePromiseDecorator(o.Mn.INITIALIZE);break;case\"SDK_GAME_START\":e.#bt?(e._setRewardedState(d.b3.CLOSED),e._platformSdk.preloadAd(\"rewarded\")):e._setInterstitialState(d.WA.CLOSED);break;case\"SDK_GAME_PAUSE\":e.#bt?e._setRewardedState(d.b3.OPENED):e._setInterstitialState(d.WA.OPENED);break;case\"SDK_REWARDED_WATCH_COMPLETE\":e._setRewardedState(d.b3.REWARDED)}}},this._setPlatformStorageAvailable(!1),this._isBannerSupported=!0,(0,i.ZT)(\"https://html5.api.gamedistribution.com/main.min.js\")}else this._rejectPromiseDecorator(o.Mn.INITIALIZE,o.pn.GAME_PARAMS_NOT_FOUND);return e.promise}showBanner(e,t){let r=document.getElementById(d._g);r||(r=(0,a.kM)(e)),r.style.display=\"block\",this._platformSdk.showAd(\"display\",{containerId:d._g}).then((()=>{this._setBannerState(d.Kk.SHOWN)})).catch((()=>{this._setBannerState(d.Kk.FAILED),r&&(r.style.display=\"none\")}))}hideBanner(){const e=document.getElementById(d._g);e&&(e.style.display=\"none\"),this._setBannerState(d.Kk.HIDDEN)}showInterstitial(){this.#bt=!1,this._platformSdk?this._platformSdk.showAd().catch((()=>{this._showAdFailurePopup(!1)})):this._showAdFailurePopup(!1)}preloadRewarded(){this._platformSdk.preloadAd(\"rewarded\")}showRewarded(){this.#bt=!0,this._platformSdk?this._platformSdk.showAd(\"rewarded\").catch((()=>{this._showAdFailurePopup(!0)})):this._showAdFailurePopup(!0)}}const h=l},4499:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221);class d extends s.Z{get platformId(){return o.Lb.GAMEPUSH}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}_isBannerSupported=!0;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);if(!e)if(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options&&this._options.projectId&&this._options.publicToken){const e=`https://gamepush.com/sdk/game-score.js?projectId=${this._options.projectId}&publicToken=${this._options.publicToken}`;(0,i.ZT)(e).then((()=>{(0,i.X_)(\"GamePush\").then((()=>{this._platformSdk=window.GamePush;const e=this._platformSdk?.player;if(e){const{id:t=null,name:r=\"\",avatar:s=\"\"}=e;this._isPlayerAuthorized=!0,this._playerId=t??null,this._playerName=r,s&&this._playerPhotos.push(s)}this._isInitialized=!0,this.#jt(),this.#zt(),this.#Wt(),this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))}else this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND);return e.promise}showInterstitial(){this._platformSdk.ads.showFullscreen()}showRewarded(){this._platformSdk.ads.showRewardedVideo().catch((()=>{this._showAdFailurePopup(!0)}))}showBanner(){this._platformSdk.ads.showSticky()}hideBanner(){this._platformSdk.ads.closeSticky()}checkAdBlock(){return new Promise((e=>{this._platformSdk.ads.isAdblockEnabled().then((t=>{e(t)}))}))}#zt(){const e=this._platformSdk;e.ads.on(\"rewarded:start\",(()=>{this._setRewardedState(n.b3.OPENED)})),e.ads.on(\"rewarded:close\",(e=>{e||this._showAdFailurePopup(!0)})),e.ads.on(\"rewarded:reward\",(()=>{this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED)}))}#jt(){const e=this._platformSdk;e.ads.on(\"fullscreen:start\",(()=>{this._setInterstitialState(n.WA.OPENED)})),e.ads.on(\"fullscreen:close\",(()=>{this._setInterstitialState(n.WA.CLOSED)}))}#Wt(){const e=this._platformSdk;e.ads.on(\"sticky:render\",(()=>{this._setBannerState(n.Kk.SHOWN)})),e.ads.on(\"sticky:close\",(()=>{this._setBannerState(n.Kk.HIDDEN)}))}}const l=d},9819:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221),d=r(7408);class l extends s.Z{get platformId(){return o.Lb.GAMESNACKS}get isPlatformExternalCallsSupported(){return!1}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlatformPageVisibilityApiAllowed(){return!1}get leaderboardsType(){return d.Z.NATIVE}_isBannerSupported=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.X_)(\"GameSnacks\").then((()=>{this._platformSdk=window.GameSnacks,this._setPlatformStorageAvailable(!0);const e=this._platformSdk;e.game.onPause((()=>{this._setPauseState(!0)})),e.game.onResume((()=>{this._setPauseState(!1)})),e.audio.subscribe((e=>{this._setAudioState(e)})),e.game.firstFrameReady(),this._setAudioState(e.audio.isEnabled()),this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))),e.promise}sendMessage(e,t){const r=this._platformSdk,s=t??{};switch(e){case o.Dt.GAME_READY:return r.game.ready(),Promise.resolve();case o.Dt.LEVEL_FAILED:return r.game.gameOver(),Promise.resolve();case o.Dt.LEVEL_COMPLETED:{const e=Number(s.level);return r.game.levelComplete(Number.isFinite(e)?e:0),Promise.resolve()}default:return super.sendMessage(e,t)}}showInterstitial(e){this._platformSdk.ad.break({type:\"next\",name:e||\"interstitial\",beforeAd:()=>{this._setInterstitialState(n.WA.OPENED)},afterAd:()=>{const{interstitialState:e}=this;e!==n.WA.FAILED&&this._setInterstitialState(n.WA.CLOSED)},adBreakDone:e=>{\"viewed\"!==e?.breakStatus&&this._showAdFailurePopup(!1)}})}showRewarded(e){this._platformSdk.ad.break({type:\"reward\",name:e||\"rewarded\",beforeAd:()=>{this._setRewardedState(n.b3.OPENED)},afterAd:()=>{this.rewardedState!==n.b3.FAILED&&this._setRewardedState(n.b3.CLOSED)},beforeReward:e=>{e()},adDismissed:()=>{this._showAdFailurePopup(!0)},adViewed:()=>{this._setRewardedState(n.b3.REWARDED)},adBreakDone:e=>{\"frequencyCapped\"!==e?.breakStatus&&\"other\"!==e?.breakStatus||this._showAdFailurePopup(!0)}})}checkAdBlock(){return Promise.resolve(!1)}getDataFromStorage(e){const t={};return e.forEach((e=>{const r=this._platformSdk.storage.getItem(e);null!=r&&\"\"!==r&&(t[e]=r)})),Promise.resolve(t)}setDataToStorage(e){return Object.keys(e).forEach((t=>{this._platformSdk.storage.setItem(t,e[t])})),Promise.resolve()}deleteDataFromStorage(e){return e.forEach((e=>{this._platformSdk.storage.removeItem(e)})),Promise.resolve()}leaderboardsSetScore(e,t){return this._platformSdk.score.update(t)}}const h=l},7490:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var s=r(8166),i=r(1302),a=r(8902),o=r(3806),n=r(9221),d=r(8960);class l extends s.Z{get platformId(){return o.Lb.HUAWEI}get isPlayerAuthorizationSupported(){return!0}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPaymentsSupported(){return!0}get isPlatformExternalLinksAllowed(){return!0}_isPlatformStorageAvailable=!0;#Kt=null;#Yt=Promise.resolve();initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options&&this._options.appId?(this.#Kt=this._options.appId,this.#$t(),this.#qt(a.Mn.INITIALIZE,this.#Kt)):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)),e.promise}authorizePlayer(){let e=this._getPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);return e||(e=this._createPromiseDecorator(a.Mn.AUTHORIZE_PLAYER),this.#qt(a.Mn.AUTHORIZE_PLAYER)),e.promise}async getDataFromStorage(e){const t={};return await Promise.all(e.map((async e=>{const r=await this.#Jt((()=>{const t=this._createPromiseDecorator(a.Mn.GET_STORAGE_DATA);return this.#qt(a.Mn.GET_STORAGE_DATA,e),t.promise}));null!=r&&\"\"!==r&&(t[e]=r)}))),t}setDataToStorage(e){return Promise.all(Object.keys(e).map((t=>this.#Jt((()=>{const r=this._createPromiseDecorator(a.Mn.SET_STORAGE_DATA);return this.#qt(a.Mn.SET_STORAGE_DATA,{key:t,value:e[t]}),r.promise}))))).then((()=>{}))}deleteDataFromStorage(e){return Promise.all(e.map((e=>this.#Jt((()=>{const t=this._createPromiseDecorator(a.Mn.DELETE_STORAGE_DATA);return this.#qt(a.Mn.DELETE_STORAGE_DATA,e),t.promise}))))).then((()=>{}))}showInterstitial(e){this.#qt(a.Mn.SHOW_INTERSTITIAL,e)}showRewarded(e){this.#qt(a.Mn.SHOW_REWARDED,e)}paymentsPurchase(e){if(!this._paymentsGetProductPlatformData(e))return Promise.reject();let t=this._getPromiseDecorator(a.Mn.PURCHASE);return t||(t=this._createPromiseDecorator(a.Mn.PURCHASE),this.#qt(a.Mn.PURCHASE,e)),t.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.CONSUME_PURCHASE);return r||(r=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE),this.#qt(a.Mn.CONSUME_PURCHASE,this._paymentsPurchases[t].purchaseToken)),r.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(a.Mn.GET_CATALOG),this.#qt(a.Mn.GET_CATALOG,e.map((({id:e})=>e)))),t.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(a.Mn.GET_PURCHASES),this.#qt(a.Mn.GET_PURCHASES)),e.promise}#Jt(e){const t=this.#Yt.catch((()=>{})).then((()=>e()));return this.#Yt=t.catch((()=>{})),t}#qt(e,t){(0,d.eE)(JSON.stringify({action:e,data:t}))}#$t(){window.system&&(window.system.onmessage=e=>{try{const{action:t,data:r}=JSON.parse(e);t===a.Mn.INITIALIZE?this.#Xt(r):t===a.Mn.AUTHORIZE_PLAYER?this.#Qt(r):t===a.Mn.SET_INTERSTITIAL_STATE?this.#er(r):t===a.Mn.SET_REWARDED_STATE?this.#tr(r):t===a.Mn.GET_CATALOG?this.#rr(r):t===a.Mn.PURCHASE?this.#sr(r):t===a.Mn.CONSUME_PURCHASE?this.#ir(r):t===a.Mn.GET_PURCHASES?this.#ar(r):t===a.Mn.GET_STORAGE_DATA?this.#or(r):t===a.Mn.SET_STORAGE_DATA?this.#nr(r):t===a.Mn.DELETE_STORAGE_DATA&&this.#dr(r)}catch(e){i.ZP.error(\"Error parsing Huawei message:\",e)}})}#Xt(e){e.success?(this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE,e)):this._rejectPromiseDecorator(a.Mn.INITIALIZE,new Error(String(e)))}#Qt(e){e.success?(this._playerId=e.playerId,this._playerName=e.playerName,this._isPlayerAuthorized=!0,this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)):this._rejectPromiseDecorator(a.Mn.AUTHORIZE_PLAYER,new Error(String(e)))}#er(e){const t=e.state;Object.values(n.WA).includes(t)&&(t===n.WA.FAILED?this._showAdFailurePopup(!1):this._setInterstitialState(t))}#tr(e){const t=e.state;Object.values(n.b3).includes(t)&&(t===n.b3.FAILED?this._showAdFailurePopup(!0):this._setRewardedState(t))}#rr(e){if(!e.success)return void this._rejectPromiseDecorator(a.Mn.GET_CATALOG,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data??[],s=t.map((e=>{const t=r.find((t=>t.productId===e.id));return{id:e.id,title:t.productName,description:t.productDesc,price:t.price,priceCurrencyCode:t.currency,priceValue:1e-6*t.microsPrice,subSpecialPeriodCycles:t.subSpecialPeriodCycles,subProductLevel:t.subProductLevel,priceType:t.priceType}}));this._resolvePromiseDecorator(a.Mn.GET_CATALOG,s)}#sr(e){if(!e.success)return void this._rejectPromiseDecorator(a.Mn.PURCHASE,new Error(String(e)));const t=e.data,r={id:e.id,...t};delete r.productId,this._paymentsPurchases.push(r),this._resolvePromiseDecorator(a.Mn.PURCHASE,r)}#ir(e){if(!e.success)return void this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,new Error(String(e)));const t=this._paymentsPurchases.findIndex((t=>t.purchaseToken===e.purchaseToken));t>=0&&this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,e)}#ar(e){if(!e.success)return void this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data??[];this._paymentsPurchases=r.map((e=>{const r=JSON.parse(e),s=t.find((e=>e.id===r.productId)),i={id:s?.id,...r};return delete i.productId,i})),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)}#or(e){e.success?this._resolvePromiseDecorator(a.Mn.GET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.GET_STORAGE_DATA,new Error(String(e)))}#nr(e){e.success?this._resolvePromiseDecorator(a.Mn.SET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.SET_STORAGE_DATA,new Error(String(e)))}#dr(e){e.success?this._resolvePromiseDecorator(a.Mn.DELETE_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.DELETE_STORAGE_DATA,new Error(String(e)))}}const h=l},2974:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(1302),a=r(8960),o=r(8902),n=r(3806),d=r(9221),l=r(7408);class h extends s.Z{get platformId(){return n.Lb.JIO_GAMES}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isBannerSupported(){return!0}get leaderboardsType(){return l.Z.NATIVE}get isPlatformExternalLinksAllowed(){return!1}_preloadInterstitialPromise=null;_preloadRewardedPromise=null;_isBannerAvailable=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);if(!e){e=this._createPromiseDecorator(o.Mn.INITIALIZE),window.onSdkReady=()=>{this._platformSdk=window.JioGames;const e=this._platformSdk;if(e.playerInfo){const{gamer_id:t,gamer_name:r,gamer_avatar_url:s,...i}=e.playerInfo;this._playerId=t||null,this._playerName=r||null,s&&this._playerPhotos.push(s),this._playerExtra=i,this._isPlayerAuthorized=!0}this._isInitialized=!0,this._resolvePromiseDecorator(o.Mn.INITIALIZE)},window.onBannerReady=()=>{this._isBannerAvailable=!0};const t=this._options.adTestMode;(0,a.ZT)(\"https://jiogames.akamaized.net/gameSDK/jiogames/stable/v2.0/jiogames_sdk.js\",t?{\"data-jg-test-environment\":\"on\"}:{}).catch((e=>{this._rejectPromiseDecorator(o.Mn.INITIALIZE,JSON.stringify(e))}))}return e.promise}preloadInterstitial(){this.#Vt()}showInterstitial(){this.#Vt().then((()=>{this._platformSdk.showAd(window.AdType?.Interstitial??\"Interstitial\",{onAdClosed:()=>{this._setInterstitialState(d.WA.CLOSED)},onAdFailedToLoad:e=>{i.ZP.error(\"JioGames interstitial failed to load:\",e),this._showAdFailurePopup(!1)}}),this._setInterstitialState(d.WA.OPENED),this._preloadInterstitialPromise=null}))}preloadRewarded(){this.#Zt()}showRewarded(){this.#Zt().then((()=>{this._platformSdk.showAd(window.AdType?.Rewarded??\"Rewarded\",{onAdClosed:e=>{e&&this._setRewardedState(d.b3.REWARDED),this._setRewardedState(d.b3.CLOSED)},onAdFailedToLoad:e=>{i.ZP.error(\"JioGames rewarded failed to load:\",e),this._showAdFailurePopup(!0)}}),this._setRewardedState(d.b3.OPENED),this._preloadRewardedPromise=null}))}showBanner(e){this._isBannerAvailable?window.JGBanner?.loadBanner().then((()=>{this._setBannerState(d.Kk.SHOWN),window.JGBanner?.showBanner(e||(window.BannerPosition?.TOP??\"TOP\"))})).catch((e=>{i.ZP.error(\"JioGames banner failed to load:\",e),this._setBannerState(d.Kk.FAILED)})):this._setBannerState(d.Kk.FAILED)}hideBanner(){window.JGBanner?.hideBanner(),this._setBannerState(d.Kk.HIDDEN)}leaderboardsSetScore(e,t,r){if(!r)return Promise.reject();const s=\"string\"==typeof t?parseInt(t,10):t;return this._platformSdk.postScore(s),Promise.resolve()}#Vt(){return this._preloadInterstitialPromise||(this._preloadInterstitialPromise=new Promise(((e,t)=>{this._platformSdk.cacheAd(window?.AdType?.Interstitial??\"Interstitial\",{onAdPrepared:()=>e(void 0),onAdFailedToLoad:e=>{this._preloadInterstitialPromise=null,t(new Error(String(e)))}})}))),this._preloadInterstitialPromise}#Zt(){return this._preloadRewardedPromise||(this._preloadRewardedPromise=new Promise(((e,t)=>{this._platformSdk.cacheAd(window?.AdType?.Rewarded??\"Rewarded\",{onAdPrepared:()=>e(void 0),onAdFailedToLoad:e=>{this._preloadRewardedPromise=null,t(new Error(String(e)))}})}))),this._preloadRewardedPromise}}const c=h},4902:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221),d=r(7408);class l extends s.Z{get platformId(){return o.Lb.LAGGED}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get leaderboardsType(){return d.Z.NATIVE}get isAchievementsSupported(){return!0}initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options&&this._options.devId&&this._options.publisherId?(0,i.ZT)(\"https://lagged.com/api/rev-share/lagged.js\").then((()=>{(0,i.X_)(\"LaggedAPI\").then((()=>{this._platformSdk=window.LaggedAPI;const e=this._platformSdk;e.init(this._options.devId,this._options.publisherId),e.User.get((e=>{const{id:t,name:r,avatar:s}=e?.user??{};\"number\"==typeof t&&t>0&&(this._playerId=String(t),this._playerName=r??null,s&&this._playerPhotos.push(s),this._isPlayerAuthorized=!0),this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)),e.promise}showInterstitial(){this._setInterstitialState(n.WA.OPENED),this._platformSdk.APIAds.show((()=>{this._setInterstitialState(n.WA.CLOSED)}))}showRewarded(){this._setRewardedState(n.b3.OPENED);this._platformSdk.GEvents.reward(((e,t)=>{e?t():this._showAdFailurePopup(!0)}),(e=>{e?(this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED)):this._showAdFailurePopup(!0)}))}leaderboardsSetScore(e,t){let r=this._getPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);if(!r){r=this._createPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);const s={score:t,board:e};this._platformSdk.Scores.save(s,(e=>{e.success?this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE):this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE,e.errormsg)}))}return r.promise}achievementsUnlock(e){const t=\"string\"==typeof e?e:e?.id;return t&&\"string\"==typeof t?new Promise(((e,r)=>{this._platformSdk.Achievements.save([t],(t=>{t.success?e(t):r(t.errormsg)}))})):Promise.reject()}}const h=l},4951:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(1302),a=r(8902),o=r(3806),n=r(9221),d=r(8960);const l=\"playgama_ads_promise\";class h extends s.Z{get platformId(){return o.Lb.MICROSOFT_STORE}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlayerAuthorizationSupported(){return!0}get isPaymentsSupported(){return!0}get isRateSupported(){return!0}_isPlatformStorageAvailable=!0;#lr=null;#hr=this._createPromiseDecorator(l).promise;#cr=0;#Yt=Promise.resolve();initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);if(!e){if(e=this._createPromiseDecorator(a.Mn.INITIALIZE),!this._options||!this._options.gameId||!this._options.playgamaAdsId)return this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND),e.promise;try{this.#$t(),this.#qt(a.Mn.INITIALIZE)}catch(e){this._rejectPromiseDecorator(a.Mn.INITIALIZE,e)}const t=this._options.playgamaAdsId;(0,d.ZT)(\"https://playgama.com/ads/msn.v0.1.js\").then((()=>(0,d.X_)(\"pgAds\"))).then((()=>window.pgAds.init(t))).then((()=>{this.#lr=window.pgAds;const e=this._options.gameId;this.#lr.updateTargeting({gameId:e}),this._resolvePromiseDecorator(l)})).catch((e=>{this._rejectPromiseDecorator(l,e)}))}return e.promise}authorizePlayer(){let e=this._getPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);if(!e){if(e=this._createPromiseDecorator(a.Mn.AUTHORIZE_PLAYER),this._isPlayerAuthorized)return this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER),e.promise;this.#qt(a.Mn.AUTHORIZE_PLAYER)}return e.promise}showInterstitial(){if(this.#cr+=1,3===this.#cr)return this._setInterstitialState(n.WA.CLOSED),void this.rate();this.#lr?new Promise((e=>{this.#lr.requestOutOfPageAd(\"interstitial\").then((t=>{switch(t.state){case\"empty\":return void this._advertisementShowErrorPopup(!1).then((()=>e()));case\"ready\":this._setInterstitialState(n.WA.OPENED),t.show()}t.addEventListener(\"ready\",(()=>{this._setInterstitialState(n.WA.OPENED),t.show()})),t.addEventListener(\"empty\",(()=>{this._advertisementShowErrorPopup(!1).then((()=>e()))})),t.addEventListener(\"closed\",(()=>{this._setInterstitialState(n.WA.CLOSED),e()}))}))})):this._advertisementShowErrorPopup(!1)}showRewarded(){this.#lr?new Promise((e=>{this.#lr.requestOutOfPageAd(\"rewarded\").then((t=>{switch(t.state){case\"empty\":return void this._advertisementShowErrorPopup(!0).then((()=>e()));case\"ready\":this._setRewardedState(n.b3.OPENED),t.show()}t.addEventListener(\"ready\",(()=>{this._setRewardedState(n.b3.OPENED),t.show()})),t.addEventListener(\"rewarded\",(()=>{this._setRewardedState(n.b3.REWARDED)})),t.addEventListener(\"empty\",(()=>{this._advertisementShowErrorPopup(!0).then((()=>e()))})),t.addEventListener(\"closed\",(()=>{this._setRewardedState(n.b3.CLOSED),e()}))}))})):this._advertisementShowErrorPopup(!0)}async getDataFromStorage(e){await this.#Ut();const t={};return await Promise.all(e.map((async e=>{const r=this.#ur(e),s=await this.#Jt((()=>{const e=this._createPromiseDecorator(a.Mn.GET_STORAGE_DATA);return this.#qt(a.Mn.GET_STORAGE_DATA,r),e.promise}));null!=s&&\"\"!==s&&(t[e]=s)}))),t}async setDataToStorage(e){return await this.#Ut(),Promise.all(Object.keys(e).map((t=>{const r=this.#ur(t);return this.#Jt((()=>{const s=this._createPromiseDecorator(a.Mn.SET_STORAGE_DATA);return this.#qt(a.Mn.SET_STORAGE_DATA,{key:r,value:e[t]}),s.promise}))}))).then((()=>{}))}async deleteDataFromStorage(e){return await this.#Ut(),Promise.all(e.map((e=>{const t=this.#ur(e);return this.#Jt((()=>{const e=this._createPromiseDecorator(a.Mn.DELETE_STORAGE_DATA);return this.#qt(a.Mn.DELETE_STORAGE_DATA,t),e.promise}))}))).then((()=>{}))}paymentsPurchase(e){const t=this._paymentsGetProductPlatformData(e);if(!t)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.PURCHASE);return r||(r=this._createPromiseDecorator(a.Mn.PURCHASE),this.#qt(a.Mn.PURCHASE,t.platformProductId)),r.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e)),r=this._paymentsGetProductPlatformData(e);if(t<0||!r)return Promise.reject();let s=this._getPromiseDecorator(a.Mn.CONSUME_PURCHASE);return s||(s=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE),this.#qt(a.Mn.CONSUME_PURCHASE,r.platformProductId)),s.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(a.Mn.GET_CATALOG),this.#qt(a.Mn.GET_CATALOG,e.map((e=>e.platformProductId)))),t.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(a.Mn.GET_PURCHASES),this.#qt(a.Mn.GET_PURCHASES)),e.promise}rate(){let e=this._getPromiseDecorator(a.Mn.RATE);return e||(e=this._createPromiseDecorator(a.Mn.RATE),this.#qt(a.Mn.RATE),this._pauseStateAggregator?.setState(\"rate\",!0)),e.promise}#Ut(){return this._isInitialized?Promise.resolve():Promise.reject()}#Jt(e){const t=this.#Yt.catch((()=>{})).then((()=>e()));return this.#Yt=t.catch((()=>{})),t}#pr(){const e=this._options?.gameId;return e?`pg_${e}_`:null}#ur(e){const t=this.#pr();return t?Array.isArray(e)?e.map((e=>`${t}${e}`)):`${t}${e}`:e}#qt(e,t){(0,d.Tg)(JSON.stringify({action:e,data:t}))}#$t(){window.chrome?.webview?.addEventListener(\"message\",(e=>{try{let{data:t}=e;\"string\"==typeof t&&(t=JSON.parse(t));const r=t??{},{action:s}=r;s===a.Mn.INITIALIZE?this.#Xt(r):s===a.Mn.AUTHORIZE_PLAYER?this.#Qt(r):s===a.Mn.GET_CATALOG?this.#rr(r):s===a.Mn.PURCHASE?this.#sr(r):s===a.Mn.CONSUME_PURCHASE?this.#ir(r):s===a.Mn.GET_PURCHASES?this.#ar(r):s===a.Mn.RATE?this.#mr(r):s===a.Mn.GET_STORAGE_DATA?this.#or(r):s===a.Mn.SET_STORAGE_DATA?this.#nr(r):s===a.Mn.DELETE_STORAGE_DATA&&this.#dr(r)}catch(e){i.ZP.error(\"Error parsing Microsoft Store message:\",e)}}))}#Xt(e){e?.success?this.#hr.then((()=>{this.showInterstitial()})).finally((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE,e)})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,new Error(String(e)))}#Qt(e){e?.success?(this._playerExtra=e.data,this._isPlayerAuthorized=!0,this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)):this._rejectPromiseDecorator(a.Mn.AUTHORIZE_PLAYER,new Error(String(e)))}#rr(e){if(!e?.success)return void this._rejectPromiseDecorator(a.Mn.GET_CATALOG,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data??[],s=t.map((e=>{const t=r.find((t=>t.id===e.platformProductId)),s=t?.price??{},i=s.formattedPrice,a=i?(0,d.ZP)(i):null,o=s.currencyCode||null,n=i||null;return{id:e.id,title:t?.title||null,description:t?.description||null,price:n,priceValue:a,priceCurrencyCode:o}}));this._resolvePromiseDecorator(a.Mn.GET_CATALOG,s)}#sr(e){if(!e?.success||!e.data)return void this._rejectPromiseDecorator(a.Mn.PURCHASE,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data,s=t.find((e=>e.platformProductId===r.id)),i={...r,id:s?.id,platformProductId:r.id};this._paymentsPurchases.push(i),this._resolvePromiseDecorator(a.Mn.PURCHASE,i)}#ir(e){if(!e?.success)return void this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data??{},s=t.find((e=>e.platformProductId===r.id)),i={...r,id:s?.id,platformProductId:r.id},o=this._paymentsPurchases.findIndex((e=>e.id===s?.id));o>=0&&this._paymentsPurchases.splice(o,1),this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,i)}#ar(e){if(!e?.success)return void this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data??[];this._paymentsPurchases=r.map((e=>{const r=t.find((t=>t.platformProductId===e.id));return{...e,id:r?.id,platformProductId:e.id}})),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)}#mr(e){this._pauseStateAggregator?.setState(\"rate\",!1),e&&!1!==e.success?this._resolvePromiseDecorator(a.Mn.RATE):this._rejectPromiseDecorator(a.Mn.RATE,new Error(String(e)))}#or(e){e?.success?this._resolvePromiseDecorator(a.Mn.GET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.GET_STORAGE_DATA,new Error(String(e)))}#nr(e){e?.success?this._resolvePromiseDecorator(a.Mn.SET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.SET_STORAGE_DATA,new Error(String(e)))}#dr(e){e?.success?this._resolvePromiseDecorator(a.Mn.DELETE_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.DELETE_STORAGE_DATA,new Error(String(e)))}}const c=h},5244:(e,t,r)=>{r.r(t),r.d(t,{default:()=>p});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221),d=r(7408);const l=604800,h=[{title:\"Ready for another round?\",description:\"Jump back in right where you left off.\",type:8,minDelayInSeconds:86400,payload:\"msn_auto_24h\"},{title:\"Missing your moves\",description:\"It's perfect time to come back\",type:9,minDelayInSeconds:259200,payload:\"msn_auto_3d\"},{title:\"We miss you\",description:\"Seriously. Come play.\",type:10,minDelayInSeconds:604800,payload:\"msn_auto_7d\"}];const c={top:[[728,90],[970,250],[320,50]],bottom:[[320,50]],left:[[300,250],[300,600],[320,50],[160,600]],right:[[300,250],[300,600],[320,50],[160,600]],topleft:[[300,250]],topright:[[300,250]],bottomleft:[[300,250]],bottomright:[[300,250]]};class u extends s.Z{get platformId(){return o.Lb.MSN}get launchSource(){return new URLSearchParams(window.location.search).has(\"notificationPayload\")?a.LS.NOTIFICATION:super.launchSource}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlayerAuthorizationSupported(){return!0}get isShareSupported(){return!0}get isAddToHomeScreenSupported(){const e=this._platformSdk;return\"function\"==typeof e?.promptInstallAsync}get leaderboardsType(){return d.Z.NATIVE}get isBannerSupported(){return!0}get isPaymentsSupported(){return this.#_r}get isNotificationsSupported(){return!0}get platformPayload(){const e=this._platformSdk;if(\"function\"==typeof e?.getNotificationPayload){const t=e.getNotificationPayload();if(t)return t}return super.platformPayload}_isAdvancedBannersSupported=!0;#lr=null;#_r=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);if(!e){e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"https://assets.msn.com/staticsb/statics/latest/msstart-games-sdk/msstart-v1.0.0-rc.21.min.js\").then((()=>(0,i.X_)(\"$msstart\"))).then((()=>{this._platformSdk=window.$msstart,!0!==this._options?.disableAutoNotifications&&h.forEach((e=>{this._platformSdk.scheduleNotificationAsync(e).catch((()=>{}))})),this._platformSdk.getSignedInUserAsync().then((e=>{this.#gr(e)})).catch((()=>{this.#gr(null)})).finally((()=>{this._setPlatformStorageAvailable(this._isPlayerAuthorized),this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}));const t=this._options?.advertisement,r=t?.backfillId;r&&(0,i.ZT)(\"https://playgama.com/ads/msn.v0.1.js\").then((()=>(0,i.X_)(\"pgAds\"))).then((()=>{const{pgAds:e}=window;e&&e.init(r).then((()=>{this.#lr=e;const t=this._options.gameId;this.#lr.updateTargeting({gameId:t})}))}))}return e.promise}authorizePlayer(){return this._isPlayerAuthorized?Promise.resolve():new Promise(((e,t)=>{this._platformSdk.signInAsync().then((t=>{this.#gr(t),e(void 0)})).catch((e=>{this.#gr(null),t(e)}))}))}getDataFromStorage(){return this._platformSdk.cloudSave.getDataAsync({gameId:this._options.gameId})}async setDataToStorage(e){const t=await this._platformSdk.cloudSave.getDataAsync({gameId:this._options.gameId});Object.keys(e).forEach((r=>{t[r]=e[r]})),await this._platformSdk.cloudSave.saveDataAsync({data:t,gameId:this._options.gameId})}async deleteDataFromStorage(e){const t=await this._platformSdk.cloudSave.getDataAsync({gameId:this._options.gameId});e.forEach((e=>{t[e]=null})),await this._platformSdk.cloudSave.saveDataAsync({data:t,gameId:this._options.gameId})}share(e){return new Promise(((t,r)=>{this._platformSdk.shareAsync(e).then(t).catch(r)}))}addToHomeScreen(){let e=this._getPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN);return e||(e=this._createPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN),this._platformSdk.promptInstallAsync().then((e=>{\"accepted\"!==e?this._rejectPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN):this._resolvePromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN,e)}))),e.promise}leaderboardsSetScore(e,t){return new Promise(((e,r)=>{this._platformSdk.submitGameResultsAsync(t).then(e).catch(r)}))}notificationsSchedule(e,t){const r=\"number\"==typeof(s=t)?s:\"string\"==typeof s&&\"\"!==s.trim()?Number(s):void 0;var s;const i=this.#Sr(e,r);if(i)return Promise.reject(new a.Hd(a.Bq.NOTIFICATION_INVALID_PARAMETERS,i));const o={title:e.title,description:e.description,type:r};return void 0!==e.image&&(o.imageData=e.image),void 0!==e.payload&&(o.payload=e.payload),void 0!==e.delaySeconds&&(o.minDelayInSeconds=e.delaySeconds),void 0!==e.callToAction&&(o.callToAction=e.callToAction),this._platformSdk.scheduleNotificationAsync(o)}showBanner(e){let t;switch(e){case n.Cb.TOP:t=\"top:728x90\";break;case n.Cb.BOTTOM:default:t=\"bottom:320x50\"}this._platformSdk.showDisplayAdsAsync([t]).then((()=>{this._setBannerState(n.Kk.SHOWN)})).catch((()=>{this._setBannerState(n.Kk.FAILED)}))}hideBanner(){this._platformSdk.hideDisplayAdsAsync().then((()=>{this._setBannerState(n.Kk.HIDDEN)}))}showAdvancedBanners(e){this._setAdvancedBannersState(n.Kk.LOADING);const t=[...new Set((e??[]).map((e=>this.#Ar(e))).filter((e=>Boolean(e))))].slice(0,2);0!==t.length?this._platformSdk.showDisplayAdsAsync(t).then((()=>{this._setAdvancedBannersState(n.Kk.SHOWN)})).catch((()=>{this._setAdvancedBannersState(n.Kk.FAILED)})):this._setAdvancedBannersState(n.Kk.FAILED)}hideAdvancedBanners(){this._platformSdk.hideDisplayAdsAsync().then((()=>{this._setAdvancedBannersState(n.Kk.HIDDEN)}))}showInterstitial(){const e=this._platformSdk;e.loadAdsAsync(!1).then((t=>e.showAdsAsync(t.instanceId))).then((e=>(this._setInterstitialState(n.WA.OPENED),e.showAdsCompletedAsync))).then((()=>this._setInterstitialState(n.WA.CLOSED))).catch((()=>this.#Er()))}showRewarded(){const e=this._platformSdk;e.loadAdsAsync(!0).then((t=>e.showAdsAsync(t.instanceId))).then((e=>(this._setRewardedState(n.b3.OPENED),e.showAdsCompletedAsync))).then((()=>{this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED)})).catch((()=>this.#Pr()))}async paymentsPurchase(e){const t=this._paymentsGetProductPlatformData(e);if(!t)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.PURCHASE);try{this._isPlayerAuthorized||await this.authorizePlayer();const r=await this._platformSdk.iap.purchaseAsync({productId:t.platformProductId});if(\"IAP_PURCHASE_FAILURE\"===r.code)throw new Error(r.description);const s={id:e,...r.receipt,receiptSignature:r.receiptSignature};this._paymentsPurchases.push(s),this._resolvePromiseDecorator(a.Mn.PURCHASE,s)}catch(e){this._rejectPromiseDecorator(a.Mn.PURCHASE,e)}}return r.promise}async paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.CONSUME_PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE);try{this._isPlayerAuthorized||await this.authorizePlayer();const r=await this._platformSdk.iap.consumeAsync({productId:this._paymentsPurchases[t].productId});if(\"IAP_CONSUME_FAILURE\"===r.code)throw new Error(r.description);this._paymentsPurchases.splice(t,1);const s={id:e,...r.consumptionReceipt,consumptionSignature:r.consumptionSignature};delete s.productId,this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,s)}catch(e){this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,e)}}return r.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(a.Mn.GET_CATALOG),this._platformSdk.iap.getAllAddOnsAsync({productId:this._options.gameId}).then((t=>{if(\"IAP_GET_ALL_ADD_ONS_FAILURE\"===t.code)return void this._rejectPromiseDecorator(a.Mn.GET_CATALOG,t.description);const r=t,s=e.map((e=>{const t=r.find((t=>t.productId===e.platformProductId)),s=t?.price??{},i=s.listPrice??null,a=s.currencyCode||null,o=null!==i&&a?`${i} ${a} `:null;return{id:e.id,title:t?.title||null,description:t?.description||null,publisherName:t?.publisherName||null,inAppOfferToken:t?.inAppOfferToken||null,isConsumable:t?.isConsumable??null,price:o,priceCurrencyCode:a,priceValue:i}}));this._resolvePromiseDecorator(a.Mn.GET_CATALOG,s)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_CATALOG,e)}))),t.promise}async paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);if(!e){e=this._createPromiseDecorator(a.Mn.GET_PURCHASES);try{this._isPlayerAuthorized||await this.authorizePlayer();const e=await this._platformSdk.iap.getAllPurchasesAsync({productId:this._options.gameId}),t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.receipts.map((r=>{const s=t.find((e=>e.platformProductId===r.productId));return{id:s?.id,...r,receiptSignature:e.receiptSignature}})),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)}catch(e){\"IAP_GET_ALL_PURCHASES_FAILURE\"===e?.code?this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,[]):this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,e)}}return e.promise}#Er(){return this.#lr?new Promise((e=>{this.#lr.requestOutOfPageAd(\"interstitial\").then((t=>{switch(t.state){case\"empty\":return void this._advertisementShowErrorPopup(!1).then((()=>e()));case\"ready\":this._setInterstitialState(n.WA.OPENED),t.show()}t.addEventListener(\"ready\",(()=>{this._setInterstitialState(n.WA.OPENED),t.show()})),t.addEventListener(\"empty\",(()=>{this._advertisementShowErrorPopup(!1).then((()=>e()))})),t.addEventListener(\"closed\",(()=>{this._setInterstitialState(n.WA.CLOSED),e()}))}))})):this._advertisementShowErrorPopup(!1)}#Pr(){return this.#lr?new Promise((e=>{this.#lr.requestOutOfPageAd(\"rewarded\").then((t=>{switch(t.state){case\"empty\":return void this._advertisementShowErrorPopup(!0).then((()=>e()));case\"ready\":this._setRewardedState(n.b3.OPENED),t.show()}t.addEventListener(\"ready\",(()=>{this._setRewardedState(n.b3.OPENED),t.show()})),t.addEventListener(\"rewarded\",(()=>{this._setRewardedState(n.b3.REWARDED)})),t.addEventListener(\"empty\",(()=>{this._advertisementShowErrorPopup(!0).then((()=>e()))})),t.addEventListener(\"closed\",(()=>{this._setRewardedState(n.b3.CLOSED),e()}))}))})):this._advertisementShowErrorPopup(!0)}#Sr(e,t){if(void 0===t||Number.isNaN(t)||!Number.isInteger(t)||t<0||t>15)return`Notification \"${e.id}\" must be mapped to an integer MSN type (0-15) in the \"notifications\" config section`;if(!0!==this._options?.disableAutoNotifications&&h.some((e=>e.type===t))){return`MSN types ${h.map((e=>e.type)).join(\", \")} are reserved for built-in auto notifications; set \"disableAutoNotifications\": true to use them`}return e.title.length>60?'Notification \"title\" must be at most 60 characters':e.description.length>200?'Notification \"description\" must be at most 200 characters':void 0!==e.delaySeconds&&e.delaySeconds>l?'Notification \"delaySeconds\" must be at most 604800 (7 days)':null}#Ar(e){const t=this.#fr(e);if(!t)return null;const r=c[t];if(!r||0===r.length)return null;const s=this.#Ir(e.width,window.innerWidth),i=this.#Ir(e.height,window.innerHeight);if(null===s||null===i)return null;const a=r.filter((e=>e[0]<=s&&e[1]<=i));if(0===a.length)return null;let o=a[0],n=o[0]*o[1];return a.forEach((e=>{const t=e[0]*e[1];t>n&&(n=t,o=e)})),`${t}:${o[0]}x${o[1]}`}#Ir(e,t){if(\"string\"!=typeof e||!e.endsWith(\"%\"))return null;const r=parseFloat(e);return Number.isNaN(r)?null:Math.floor(t*r/100)}#fr(e){const t=void 0!==e.top,r=void 0!==e.bottom,s=void 0!==e.left,i=void 0!==e.right;return t&&s?\"topleft\":t&&i?\"topright\":r&&s?\"bottomleft\":r&&i?\"bottomright\":t?\"top\":r?\"bottom\":s?\"left\":i?\"right\":null}#gr(e){e&&(this._isPlayerAuthorized=!0,this._playerId=e.playerId??e.publisherPlayerId,this._playerName=e.playerDisplayName,this._playerExtra=e,this.#_r=\"personal\"===e.userAccountType.toLowerCase(),this._setPlatformStorageAvailable(!0))}}const p=u},9623:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221);const d=\"AUTHORIZED\",l={VALUABLE_ACCESS:\"VALUABLE_ACCESS\",PHOTO_CONTENT:\"PHOTO_CONTENT\"};class h extends s.Z{get platformId(){return o.Lb.OK}get isPlayerAuthorizationSupported(){return!0}get isBannerSupported(){return!0}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isJoinCommunitySupported(){return!0}get isInviteFriendsSupported(){return!0}get isCreatePostSupported(){return!0}get isRateSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get isClipboardSupported(){return!1}_hasValuableAccessPermission=!1;_hasValuableAccessPermissionShowed=!1;_platformBannerOptions={};#yr=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"//api.ok.ru/js/fapi5.js\").then((()=>{(0,i.X_)(\"FAPI\").then((()=>{this._platformSdk=window.FAPI,window.API_callback=(e,t,r)=>{const s=this.#Dr;s[e]?.(t,r)};const e=this._platformSdk,t=e.Util.getRequestParameters()||{};t.api_server&&t.apiconnection?e.init(t.api_server,t.apiconnection,(()=>{const e=this._platformSdk?.saved_state;this._isPlayerAuthorized=!e||e===d,this._isPlayerAuthorized?this._platformSdk.Client.call(this.#Tr.userProfile,this.#wr.userProfileCallback):(this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE))}),(()=>{this._rejectPromiseDecorator(a.Mn.INITIALIZE)})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)}))}))),e.promise}authorizePlayer(){if(this._isPlayerAuthorized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);return e||(e=this._createPromiseDecorator(a.Mn.AUTHORIZE_PLAYER),this._platformSdk.UI.showLoginSuggestion(d)),e.promise}async getDataFromStorage(e){const t={};return await Promise.all(e.map((async e=>{const r=await new Promise(((t,r)=>{const s={method:\"storage.get\",keys:[e],scope:\"CUSTOM\"};this._platformSdk.Client.call(s,((s,i,a)=>{if(!i)return void r(a);const o=(i.data||{})[e];t(\"\"===o||void 0===o?null:o)}))}));null!=r&&\"\"!==r&&(t[e]=\"string\"==typeof r?r:JSON.stringify(r))}))),t}setDataToStorage(e){return Promise.all(Object.keys(e).map((t=>new Promise(((r,s)=>{const i={method:\"storage.set\",key:t,value:e[t]};this._platformSdk.Client.call(i,((e,t)=>{t?r():s()}))}))))).then((()=>{}))}deleteDataFromStorage(e){return Promise.all(e.map((e=>new Promise(((t,r)=>{const s={method:\"storage.set\",key:e,value:\"\"};this._platformSdk.Client.call(s,((e,s)=>{s?t():r()}))}))))).then((()=>{}))}showInterstitial(){try{this._platformSdk.UI.showAd()}catch{this._showAdFailurePopup(!1)}}showRewarded(){try{this._platformSdk.UI.loadAd()}catch{this._showAdFailurePopup(!0)}}showBanner(e){this.#yr=e,this._platformSdk.invokeUIMethod(\"requestBannerAds\")}hideBanner(){this._platformSdk.invokeUIMethod(\"hideBannerAds\")}checkAdBlock(){let e=this._getPromiseDecorator(a.Mn.ADBLOCK_DETECT);return e||(e=this._createPromiseDecorator(a.Mn.ADBLOCK_DETECT),this._platformSdk.invokeUIMethod(\"isAdBlockEnabled\")),e.promise}inviteFriends(e){const{text:t}=e||{};if(!e||\"string\"!=typeof t)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.INVITE_FRIENDS);return r||(r=this._createPromiseDecorator(a.Mn.INVITE_FRIENDS),t.length>120?this._rejectPromiseDecorator(a.Mn.INVITE_FRIENDS,a.pn.INVITE_FRIENDS_MESSAGE_LENGTH_ERROR):this._platformSdk.UI.showInvite(t)),r.promise}rate(){let e=this._getPromiseDecorator(a.Mn.RATE);return e||(e=this._createPromiseDecorator(a.Mn.RATE),this._platformSdk.UI.showRatingDialog()),e.promise}createPost(e){const{text:t,url:r,status:s,...i}=e??{};if(!t&&!r&&!i.media)return Promise.reject();const o=[];t&&o.push({type:\"text\",text:t}),r&&o.push({type:\"link\",url:r});let n=this._getPromiseDecorator(a.Mn.CREATE_POST);return n||(n=this._createPromiseDecorator(a.Mn.CREATE_POST),this._platformSdk.UI.postMediatopic({media:o,...i},s??!1)),n.promise}joinCommunity(e){if(!e||!e?.groupId)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.JOIN_COMMUNITY);return t||(t=this._createPromiseDecorator(a.Mn.JOIN_COMMUNITY),this._platformSdk.UI.joinGroup(e.groupId,e.enableMessages??!1)),t.promise}get#Tr(){return{userProfile:{fields:\"uid,name,pic50x50,pic128x128,pic_base\",method:\"users.getCurrentUser\"},hasAppPermission:e=>({method:\"users.hasAppPermission\",ext_perm:e})}}get#wr(){return{userProfileCallback:(e,t,r)=>this.#Rr(e,t,r),hasValueAccessCallback:(e,t,r)=>this.#vr(t,r)}}get#Dr(){return{showPermissions:()=>this.#br(),loadAd:e=>this.#Cr(e),showLoadedAd:(e,t)=>this.#Or(t),showAd:(e,t)=>this.#Lr(t),requestBannerAds:(e,t)=>this.#Mr(e,t),showBannerAds:(e,t)=>this.#Nr(t),hideBannerAds:(e,t)=>this.#kr(t),setBannerFormat:e=>this.#Hr(e),showInvite:e=>this.#Gr(e),showRatingDialog:(e,t)=>this.#Br(e,t),joinGroup:(e,t)=>this.#Fr(e,t),showLoginSuggestion:(e,t)=>this.#xr(e,t),postMediatopic:(e,t)=>this.#Ur(e,t),isAdBlockEnabled:(e,t)=>this.#Vr(e,t)}}#Rr(e,t,r){\"ok\"===e&&(this._playerId=t.uid,this._playerName=t.name,this._playerPhotos=[t.pic50x50,t.pic128x128,t.pic_base]),this._isInitialized=!0,this._platformSdk.Client.call(this.#Tr.hasAppPermission(l.VALUABLE_ACCESS),this.#wr.hasValueAccessCallback)}#xr(e,t){if(\"error\"===e)return this._isPlayerAuthorized=!1,void this._rejectPromiseDecorator(a.Mn.AUTHORIZE_PLAYER,t);this._isPlayerAuthorized=!0,this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)}#vr(e,t){if(this._hasValuableAccessPermission=!!e,this._setPlatformStorageAvailable(this._hasValuableAccessPermission),this._hasValuableAccessPermission||this._hasValuableAccessPermissionShowed)this._resolvePromiseDecorator(a.Mn.INITIALIZE);else{const e=Object.values(l).map((e=>`\"${e}\"`)).join(\",\");this._platformSdk.UI.showPermissions(`[${e}]`)}}#br(){this._hasValuableAccessPermissionShowed=!0,this._platformSdk.Client.call(this.#Tr.hasAppPermission(l.VALUABLE_ACCESS),this.#wr.hasValueAccessCallback)}#Cr(e){\"error\"===e?this._showAdFailurePopup(!0):(this._setRewardedState(n.b3.OPENED),this._platformSdk.UI.showLoadedAd())}#Or(e){switch(e){case\"complete\":this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED);break;case\"skip\":this._setRewardedState(n.b3.CLOSED);break;default:this._showAdFailurePopup(!0)}}#Lr(e){switch(e){case\"ready\":case\"ad_prepared\":break;case\"ad_shown\":this._setInterstitialState(n.WA.OPENED),this._setInterstitialState(n.WA.CLOSED);break;default:this._showAdFailurePopup(!1)}}#Mr(e,t){if(\"error\"!==e)switch(t){case\"ad_loaded\":this._platformSdk.invokeUIMethod(\"showBannerAds\",this.#yr);break;case\"banner_shown\":case\"ad_shown\":this._setBannerState(n.Kk.SHOWN);break;case\"hidden_by_user\":this._setBannerState(n.Kk.HIDDEN)}else this._setBannerState(n.Kk.FAILED)}#kr(e){e?this._setBannerState(n.Kk.HIDDEN):this._setBannerState(n.Kk.FAILED)}#Nr(e){e||this._setBannerState(n.Kk.FAILED)}#Hr(e){\"error\"===e?this._setBannerState(n.Kk.FAILED):this.showBanner(this._platformBannerOptions)}#Gr(e){\"error\"===e?this._rejectPromiseDecorator(a.Mn.INVITE_FRIENDS):this._resolvePromiseDecorator(a.Mn.INVITE_FRIENDS)}#Br(e,t){\"error\"===e?this._rejectPromiseDecorator(a.Mn.RATE,t):this._resolvePromiseDecorator(a.Mn.RATE)}#Fr(e,t){\"error\"===e?this._rejectPromiseDecorator(a.Mn.JOIN_COMMUNITY,t):this._resolvePromiseDecorator(a.Mn.JOIN_COMMUNITY)}#Ur(e,t){\"error\"===e?this._rejectPromiseDecorator(a.Mn.CREATE_POST,t):this._resolvePromiseDecorator(a.Mn.CREATE_POST)}#Vr(e,t){\"ok\"===e?this._resolvePromiseDecorator(a.Mn.ADBLOCK_DETECT,\"true\"===t):this._rejectPromiseDecorator(a.Mn.ADBLOCK_DETECT)}}const c=h},8166:(e,t,r)=>{r.d(t,{Z:()=>A});var s=r(1558),i=r(8902),a=r(9541),o=r(3806),n=r(66),d=r(9221),l=r(7408),h=r(6170),c=r(1147),u=r(6039);const p=class{#Zr={};#jr=!1;#zr;constructor(e,t){this.#zr=t,e.forEach((e=>{this.#Zr[e]=!1}))}setState(e,t){e in this.#Zr&&\"boolean\"==typeof t&&this.#Zr[e]!==t&&(this.#Zr[e]=t,this.#Wr())}getState(e){return e in this.#Zr&&this.#Zr[e]}getAggregatedState(){return this.#jr}resetAll(){Object.keys(this.#Zr).forEach((e=>{this.#Zr[e]=!1})),this.#Wr()}#Wr(){const e=Object.values(this.#Zr).some((e=>!0===e));this.#jr!==e&&(this.#jr=e,this.#zr(this.#jr))}};var m=r(1472),_=r(3941),g=r(5230);class S{get options(){return this._options}get platformId(){return o.Lb.MOCK}get platformSdk(){return this._platformSdk}get data(){return this._data??{}}get platformLanguage(){const e=navigator.language;return\"string\"==typeof e?e.substring(0,2).toLowerCase():\"en\"}get platformPayload(){return new URL(window.location.href).searchParams.get(\"payload\")}get platformTld(){return null}get launchSource(){return null}get launchPostId(){return this._launchPostId}get isPlatformGamesListSupported(){return!1}get isPlatformExternalCallsSupported(){return!0}get isPlatformAudioEnabled(){return!this._audioStateAggregator||!this._audioStateAggregator.getAggregatedState()}get isPlatformPaused(){return!!this._pauseStateAggregator&&this._pauseStateAggregator.getAggregatedState()}get isPlayerAuthorizationSupported(){return!1}get isPlayerAuthorized(){return this._isPlayerAuthorized}get playerId(){return this._playerId}get playerName(){return this._playerName}get playerPhotos(){return this._playerPhotos}get playerExtra(){return this._playerExtra}get isPlatformStorageAvailable(){return this._isPlatformStorageAvailable}get isBannerSupported(){return this._isBannerSupported}get isAdvancedBannersSupported(){return this._isAdvancedBannersSupported}get isInterstitialSupported(){return!1}get isMinimumDelayBetweenInterstitialEnabled(){return!0}get initialInterstitialDelay(){return 60}get isRewardedSupported(){return!1}get isInviteFriendsSupported(){return!1}get isJoinCommunitySupported(){return!1}get isShareSupported(){return!1}get isCreatePostSupported(){return!1}get isAddToHomeScreenSupported(){return!1}get isAddToHomeScreenRewardSupported(){return!1}get isAddToFavoritesSupported(){return!1}get isAddToFavoritesRewardSupported(){return!1}get isRateSupported(){return!1}get isPostRewardSupported(){return!1}get isPlatformExternalLinksAllowed(){return!0}get isPlatformPageVisibilityApiAllowed(){return!0}get deviceType(){if(navigator&&navigator.userAgent){const e=navigator.userAgent.toLowerCase();if(/android|webos|iphone|ipod|blackberry|iemobile|opera mini/i.test(e))return n.me.MOBILE;if(/ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP)))/.test(e))return n.me.TABLET}return n.me.DESKTOP}get deviceOs(){const e=navigator?.userAgent??\"\";return/android/i.test(e)?n.Lh.ANDROID:/iphone|ipod|ipad/i.test(e)||\"MacIntel\"===navigator?.platform&&navigator?.maxTouchPoints>1?n.Lh.IOS:/windows/i.test(e)?n.Lh.WINDOWS:/macintosh|mac os/i.test(e)?n.Lh.MACOS:/linux/i.test(e)?n.Lh.LINUX:n.Lh.OTHER}get isPaymentsSupported(){return!1}get leaderboardsType(){return l.Z.NOT_AVAILABLE}get isRemoteConfigSupported(){return!1}get isClipboardSupported(){return!0}get isAchievementsSupported(){return!1}get isNotificationsSupported(){return!1}_options;_data=null;_launchPostId=null;_isInitialized=!1;_platformSdk=null;_isPlayerAuthorized=!1;_playerId=null;_playerName=null;_playerPhotos=[];_playerExtra={};_visibilityState=null;_isPlatformStorageAvailable=!1;_isBannerSupported=!1;_isAdvancedBannersSupported=!1;_useAdvertisementErrorPopup=!1;_paymentsPurchases=[];_pauseStateAggregator=null;_audioStateAggregator=null;#Kr={};#Yr=0;constructor(){this._playerApplyGuestData();const e=[\"interstitial\",\"rewarded\",\"visibility\",\"platform\",\"rate\"];this._pauseStateAggregator=new p(e,(e=>this.emit(i.W1.PAUSE_STATE_CHANGED,e))),this._audioStateAggregator=new p(e,(e=>this.emit(i.W1.AUDIO_STATE_CHANGED,!e))),this.isPlatformPageVisibilityApiAllowed&&(this._visibilityState=document.visibilityState,document.addEventListener(\"visibilitychange\",(()=>{this._setVisibilityState(document.visibilityState)})),window.addEventListener(\"blur\",(()=>{this._setVisibilityState(o.YU.HIDDEN)})),window.addEventListener(\"focus\",(()=>{this._setVisibilityState(o.YU.VISIBLE)}))),this._options=g.ZP.getValues()}initialize(){return Promise.resolve()}sendMessage(e,t){return Promise.resolve()}setLoadingProgress(e){}sendCustomMessage(e,t){return Promise.resolve()}getServerTime(){return a.k.getServerTime()}getGamesList(){return Promise.resolve([])}getDataFromStorage(e){return Promise.reject(new i.Hd(i.Bq.STORAGE_NOT_SUPPORTED))}setDataToStorage(e){return Promise.reject(new i.Hd(i.Bq.STORAGE_NOT_SUPPORTED))}deleteDataFromStorage(e){return Promise.reject(new i.Hd(i.Bq.STORAGE_NOT_SUPPORTED))}showBanner(e,t){this._setBannerState(d.Kk.FAILED)}hideBanner(){this._setBannerState(d.Kk.HIDDEN)}showAdvancedBanners(e){this._setAdvancedBannersState(d.Kk.FAILED)}hideAdvancedBanners(){this._setAdvancedBannersState(d.Kk.HIDDEN)}preloadInterstitial(e){}showInterstitial(e){this._showAdFailurePopup(!1)}preloadRewarded(e){}showRewarded(e){this._showAdFailurePopup(!0)}checkAdBlock(){const e=document.createElement(\"div\");e.className=\"textads banner-ads banner_ads ad-unit ad-zone ad-space adsbox\",e.style.position=\"absolute\",e.style.left=\"-9999px\",e.style.width=\"1px\",e.style.height=\"1px\",document.body.appendChild(e);const t={method:\"HEAD\",mode:\"no-cors\"};return new Promise((r=>{fetch(\"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\",t).then((t=>{t.redirected?r(t.redirected):window.setTimeout((()=>{const t=0===e.offsetHeight||\"none\"===window.getComputedStyle(e)?.display;r(t),e.remove()}),100)})).catch((()=>{r(!0)}))}))}paymentsPurchase(e){const t={id:e};return this._paymentsPurchases.push(t),Promise.resolve(t)}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));return t<0?Promise.reject():(this._paymentsPurchases.splice(t,1),Promise.resolve({id:e}))}paymentsGetCatalog(){return Promise.resolve(this._paymentsGetProductsPlatformData())}paymentsGetPurchases(){return Promise.resolve(this._paymentsPurchases)}clipboardRead(){return window.navigator&&window.navigator.clipboard?window.navigator.clipboard.readText():Promise.reject()}clipboardWrite(e){return window.navigator&&window.navigator.clipboard?window.navigator.clipboard.writeText(e):Promise.reject()}achievementsUnlock(e){return Promise.reject()}achievementsGetList(){return Promise.reject()}notificationsSchedule(e,t){return Promise.reject(new i.Hd(i.Bq.NOTIFICATIONS_NOT_SUPPORTED))}notificationsCancel(e,t){return Promise.reject(new i.Hd(i.Bq.NOTIFICATIONS_NOT_SUPPORTED))}notificationsCancelAll(){return Promise.reject(new i.Hd(i.Bq.NOTIFICATIONS_NOT_SUPPORTED))}_setPlatformStorageAvailable(e){this._isPlatformStorageAvailable!==e&&(this._isPlatformStorageAvailable=e,this.emit(i.W1.PLATFORM_STORAGE_AVAILABILITY_CHANGED,e))}_setVisibilityState(e){if(this._visibilityState===e)return;this._visibilityState=e,this.emit(i.W1.VISIBILITY_STATE_CHANGED,e);const t=e===o.YU.HIDDEN;this._pauseStateAggregator&&this._pauseStateAggregator.setState(\"visibility\",t),this._audioStateAggregator&&this._audioStateAggregator.setState(\"visibility\",t)}_setBannerState(e){this.emit(i.W1.BANNER_STATE_CHANGED,e)}_setAdvancedBannersState(e){this.emit(i.W1.ADVANCED_BANNERS_STATE_CHANGED,e)}_setInterstitialState(e){this.emit(i.W1.INTERSTITIAL_STATE_CHANGED,e);const t=e===d.WA.OPENED;this._pauseStateAggregator&&this._pauseStateAggregator.setState(\"interstitial\",t),this._audioStateAggregator&&this._audioStateAggregator.setState(\"interstitial\",t)}_setRewardedState(e){this.emit(i.W1.REWARDED_STATE_CHANGED,e);const t=e===d.b3.OPENED||e===d.b3.REWARDED;this._pauseStateAggregator&&this._pauseStateAggregator.setState(\"rewarded\",t),this._audioStateAggregator&&this._audioStateAggregator.setState(\"rewarded\",t)}_setAudioState(e){this._audioStateAggregator?this._audioStateAggregator.setState(\"platform\",!e):this.emit(i.W1.AUDIO_STATE_CHANGED,e)}_setPauseState(e){this._pauseStateAggregator?this._pauseStateAggregator.setState(\"platform\",e):this.emit(i.W1.PAUSE_STATE_CHANGED,e)}_createPromiseDecorator(e){const t=new u.Z;return this.#Kr[e]=t,t}_getPromiseDecorator(e){return this.#Kr[e]}_resolvePromiseDecorator(e,t){this.#Kr[e]&&(this.#Kr[e].resolve(t),delete this.#Kr[e])}_rejectPromiseDecorator(e,t){this.#Kr[e]&&(this.#Kr[e].reject(t),delete this.#Kr[e])}_paymentsGetProductsPlatformData(){return(0,c.om)(this._options.payments,this.platformId)}_paymentsGetProductPlatformData(e){return(0,c.iv)(this._options.payments,this.platformId,e)}_paymentsGenerateTransactionId(e){return(0,c.cE)(e)}_advertisementShowErrorPopup(e){const t=this._options?.advertisement?.useBuiltInErrorPopup;return t?(0,m.QG)(\"Oops! It looks like you closed the ad too early, or it isn't available right now.\").then((()=>{e?this._setRewardedState(d.b3.FAILED):this._setInterstitialState(d.WA.FAILED)})):(e?this._setRewardedState(d.b3.FAILED):this._setInterstitialState(d.WA.FAILED),Promise.resolve())}_showAdFailurePopup(e){if(!(this._options?.advertisement?.useAdvertisementErrorPopup??this._useAdvertisementErrorPopup))return e?this._setRewardedState(d.b3.FAILED):this._setInterstitialState(d.WA.FAILED),Promise.resolve();if(!e){const e=this._options?.advertisement?.builtInErrorPopupCooldown??180,t=Date.now();if((t-this.#Yr)/1e3{e?(h.rh.send(`${i.oF.ADVERTISEMENT}_rewarded_fallback_closed`),this._setRewardedState(d.b3.FAILED)):(h.rh.send(`${i.oF.ADVERTISEMENT}_interstitial_fallback_closed`),this._setInterstitialState(d.WA.FAILED))}))}_playerApplyGuestData(){const e=(0,_.m)();this._playerId=e.id,this._playerName=e.name}}(0,s.aA)(S.prototype);const A=S},3153:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221);class d extends s.Z{get platformId(){return o.Lb.PLAYGAMA}get sdkUrl(){return\"https://playgama.com/platform-sdk/v1.js\"}get sdkGlobalName(){return\"PLAYGAMA_SDK\"}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get isShareSupported(){return this.#$r}get isAddToHomeScreenSupported(){return this.#qr}get isPlayerAuthorizationSupported(){return this.#Jr}get isPaymentsSupported(){return this.#_r}get platformLanguage(){return this._platformSdk?.platformService?.getLanguage?.()||super.platformLanguage}_isAdvancedBannersSupported=!0;#_r=!0;#Xr=!0;#Jr=!0;#$r=!1;#qr=!1;#Qr=new Map;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(this.sdkUrl).then((()=>{(0,i.X_)(this.sdkGlobalName).then((()=>{const e=window;this._platformSdk=e[this.sdkGlobalName],this._platformSdk.advService.subscribeToAdStateChanges(((e,t)=>{if(\"interstitial\"===e)switch(t){case\"open\":this._setInterstitialState(n.WA.OPENED);break;case\"empty\":case\"error\":this._showAdFailurePopup(!1);break;case\"close\":this._setInterstitialState(n.WA.CLOSED)}else if(\"rewarded\"===e)switch(t){case\"open\":this._setRewardedState(n.b3.OPENED);break;case\"empty\":case\"error\":this._showAdFailurePopup(!0);break;case\"rewarded\":this._setRewardedState(n.b3.REWARDED);break;case\"close\":this._setRewardedState(n.b3.CLOSED)}}));const t=this._platformSdk;(t.platformService?.isReady??Promise.resolve()).then((()=>(this.#es(),t.platformService?.getAdditionalParams&&(this._data=t.platformService.getAdditionalParams()||{}),this.#Ot()))).then((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))}))),e.promise}sendMessage(e,t){return e===o.Dt.GAME_READY?(this._platformSdk.gameService?.gameReady?.(),Promise.resolve()):(this._platformSdk.gameService?.sendMessage?.(String(e),t??{}),super.sendMessage(e,t))}async getDataFromStorage(){return await this.#Ut(),this._platformSdk.cloudSaveApi.getState()}async setDataToStorage(e){await this.#Ut();const t=await this._platformSdk.cloudSaveApi.getState();Object.keys(e).forEach((r=>{t[r]=e[r]})),await this._platformSdk.cloudSaveApi.setItems(t)}async deleteDataFromStorage(e){await this.#Ut();const t=await this._platformSdk.cloudSaveApi.getState();e.forEach((e=>{delete t[e]})),await this._platformSdk.cloudSaveApi.setItems(t)}notifyLocalDataChanged(e){const t=this._platformSdk?.storageApi;if(t){if(e.sets.length>0){const r={};e.sets.forEach((e=>{r[e.key]=e.value})),t.setItems?.(r)}e.deletes.length>0&&t.deleteItems?.(e.deletes)}}showInterstitial(){this._platformSdk.advService.showInterstitial()}showRewarded(){this._platformSdk.advService.showRewarded()}showAdvancedBanners(e){this._setAdvancedBannersState(n.Kk.LOADING),this._platformSdk.advService.showAdvancedBanners(e).then((()=>{this._setAdvancedBannersState(n.Kk.SHOWN)})).catch((()=>{this._setAdvancedBannersState(n.Kk.FAILED)}))}hideAdvancedBanners(){this._platformSdk.advService.hideAdvancedBanners(),this._setAdvancedBannersState(n.Kk.HIDDEN)}checkAdBlock(){return this._platformSdk.advService.checkAdBlock()}authorizePlayer(e){let t=this._getPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);return t||(t=this._createPromiseDecorator(a.Mn.AUTHORIZE_PLAYER),this._isPlayerAuthorized?this.#Ot(e).then((()=>{this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)})):this._platformSdk.userService.authorizeUser().then((()=>{this.#Ot(e).then((()=>{this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)}))})).catch((e=>{this._rejectPromiseDecorator(a.Mn.AUTHORIZE_PLAYER,e)}))),t.promise}paymentsPurchase(e,t){const r=this._paymentsGetProductPlatformData(e);if(!r)return Promise.reject();t&&t.externalId&&(r.externalId=t.externalId),r.externalId||(r.externalId=this._paymentsGenerateTransactionId(e)),r.bridgeId=e;const s=this.#Qr.get(e),i=\"number\"==typeof s?.amount&&s.currency?{...r,amount:s.amount,currency:s.currency}:r;let o=this._getPromiseDecorator(a.Mn.PURCHASE);if(!o){o=this._createPromiseDecorator(a.Mn.PURCHASE);const t=this._platformSdk;t.inGamePaymentsApi.purchase(i).then((r=>{if(\"PAID\"===r.status){const s={id:e,...r};this._paymentsPurchases.push(s),t.inGamePaymentsApi.confirmDelivery&&t.inGamePaymentsApi.confirmDelivery({orderId:r.orderId,externalId:s.externalId}).catch((()=>{})),this._resolvePromiseDecorator(a.Mn.PURCHASE,s)}else this._rejectPromiseDecorator(a.Mn.PURCHASE,r.error)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.PURCHASE,e)}))}return o.promise}paymentsGetPurchases(){const e=this._platformSdk;if(e.inGamePaymentsApi.getPurchases){const t=this._createPromiseDecorator(a.Mn.GET_PURCHASES);return e.inGamePaymentsApi.getPurchases().then((e=>{this._paymentsPurchases=e.map((({bridgeId:e,...t})=>e?{...t,id:e}:t)),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((()=>{this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)})),t.promise}return Promise.resolve(this._paymentsPurchases)}paymentsConsumePurchase(e){const t=this._paymentsPurchases.find((t=>t.id===e));if(!t)return Promise.reject();const r=this._platformSdk;if(r.inGamePaymentsApi.consumePurchase){const s=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE);return r.inGamePaymentsApi.consumePurchase(t.orderId,t.externalId).then((()=>{const t=this._paymentsPurchases.findIndex((t=>t.id===e));t>=0&&this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,{id:e})})).catch((e=>{this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,e)})),s.promise}return super.paymentsConsumePurchase(e)}async paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();const t=await this.#ts(e);return null!==t&&(this.#Qr=new Map(t.map((e=>[e.id,e])))),e.map((e=>{const t=this.#Qr.get(e.id);return t?{id:e.id,price:t.price,priceValue:t.priceValue,priceCurrencyCode:t.priceCurrencyCode,...void 0===t.priceCurrencyImage?{}:{priceCurrencyImage:t.priceCurrencyImage}}:this.#rs(e)}))}share(e){const t=this._platformSdk?.socialService;if(\"function\"!=typeof t?.share)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.SHARE);return r||(r=this._createPromiseDecorator(a.Mn.SHARE),t.share(e).then((()=>{this._resolvePromiseDecorator(a.Mn.SHARE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.SHARE,e)}))),r.promise}addToHomeScreen(){const e=this._platformSdk?.socialService;if(\"function\"!=typeof e?.addToHomeScreen)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN);return t||(t=this._createPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN),e.addToHomeScreen().then((()=>{this._resolvePromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN,e)}))),t.promise}async#ts(e){const t=this._platformSdk?.inGamePaymentsApi;if(\"function\"!=typeof t?.getCatalog)return null;try{const r=await t.getCatalog(e);return Array.isArray(r)?r.filter((e=>\"string\"==typeof e?.id)):null}catch{return null}}#rs(e){const t=e.amount;return{id:e.id,price:`${t} Gam`,priceCurrencyCode:\"Gam\",priceCurrencyImage:\"https://games.playgama.com/assets/gold-fennec-coin-large.webp\",priceValue:t}}#Ot(e){const t=this._platformSdk;return\"function\"!=typeof t.userService?.getUser?(this._playerApplyGuestData(),Promise.resolve()):new Promise((e=>{t.userService.getUser().then((e=>{e.id&&(this._playerId=e.id),e.isAuthorized&&(this._isPlayerAuthorized=!0,this._playerName=e.name,this._playerPhotos=e.photos,this._playerExtra=e,this.#Xr&&this._setPlatformStorageAvailable(!0))})).catch((()=>{})).finally((()=>{e()}))}))}#es(){const e=this._platformSdk;e.platformService?.getIsPlayerAuthorizationSupported&&(this.#Jr=e.platformService.getIsPlayerAuthorizationSupported()),e.platformService?.getIsCloudSaveSupported&&(this.#Xr=e.platformService.getIsCloudSaveSupported()),this._setPlatformStorageAvailable(this.#Xr),e.platformService?.getIsPaymentsSupported&&(this.#_r=e.platformService.getIsPaymentsSupported());const{socialService:t}=e;this.#$r=t?.getIsShareSupported?.()??!1,this.#qr=t?.getIsAddToHomeScreenSupported?.()??!1}#Ut(){return this.#Xr?Promise.resolve():Promise.reject()}}const l=d},1856:(e,t,r)=>{r.r(t),r.d(t,{default:()=>o});var s=r(8200),i=r(3806);class a extends s.default{get platformId(){return i.Lb.PLAYGAMA_SANDBOX}}const o=a},7789:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221);class d extends s.Z{get platformId(){return o.Lb.POKI}get isPlatformExternalCallsSupported(){return!1}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get isClipboardSupported(){return!1}initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"https://game-cdn.poki.com/scripts/v2/poki-sdk.js\").then((()=>{(0,i.X_)(\"PokiSDK\",\"init\").then((()=>{this._platformSdk=window.PokiSDK,this._platformSdk.init().then((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))}))),e.promise}sendMessage(e){const t=this._platformSdk;switch(e){case o.Dt.GAME_READY:return t.gameLoadingFinished(),Promise.resolve();case o.Dt.GAMEPLAY_STARTED:case o.Dt.LEVEL_STARTED:case o.Dt.LEVEL_RESUMED:return t.gameplayStart(),Promise.resolve();case o.Dt.GAMEPLAY_STOPPED:case o.Dt.LEVEL_PAUSED:case o.Dt.LEVEL_COMPLETED:case o.Dt.LEVEL_FAILED:return t.gameplayStop(),Promise.resolve();default:return super.sendMessage(e)}}showInterstitial(){let e=!1;this._platformSdk.commercialBreak((()=>{e=!0,this._setInterstitialState(n.WA.OPENED)})).then((()=>{e?this._setInterstitialState(n.WA.CLOSED):this._showAdFailurePopup(!1)})).catch((()=>{this._showAdFailurePopup(!1)}))}showRewarded(){let e=!1;this._platformSdk.rewardedBreak((()=>{e=!0,this._setRewardedState(n.b3.OPENED)})).then((t=>{e?(t&&this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED)):this._showAdFailurePopup(!0)})).catch((()=>{this._showAdFailurePopup(!0)}))}}const l=d},6328:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221);class d extends s.Z{get platformId(){return o.Lb.PORTAL}get isPaymentsSupported(){return!0}get platformLanguage(){return this._platformSdk.getLocale()||super.platformLanguage}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"https://storage.googleapis.com/social-networth/scripts/sdk.umd.js\").then((()=>{(0,i.X_)(\"PortalSDK\").then((()=>{this._platformSdk=window.PortalSDK;const e=this._platformSdk;e.initialize().then((()=>{e.initializeOverlay(),this._setPlatformStorageAvailable(!0),this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.INITIALIZE,e)}))}))}))),e.promise}async getDataFromStorage(e){const t=this._platformSdk,r={};return await Promise.all(e.map((async e=>{const s=await Promise.resolve(t.getValue(e));null!=s&&\"\"!==s&&(r[e]=s)}))),r}setDataToStorage(e){const t=this._platformSdk;return Promise.all(Object.keys(e).map((r=>Promise.resolve(t.setValue(r,e[r]))))).then((()=>{}))}deleteDataFromStorage(e){const t=this._platformSdk;return Promise.all(e.map((e=>Promise.resolve(t.removeValue(e))))).then((()=>{}))}showInterstitial(){this._platformSdk.requestAd().then((()=>{this._setInterstitialState(n.WA.OPENED),this._setInterstitialState(n.WA.CLOSED)})).catch((()=>{this._showAdFailurePopup(!1)}))}showRewarded(){this._platformSdk.requestRewardAd().then((e=>{e?(this._setRewardedState(n.b3.OPENED),this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED)):this._showAdFailurePopup(!0)})).catch((()=>{this._showAdFailurePopup(!0)}))}sendMessage(e,t){return e===o.Dt.GAME_READY?(this._platformSdk.gameReady(),Promise.resolve()):super.sendMessage(e,t)}paymentsPurchase(e){const t=this._paymentsGetProductPlatformData(e);let r=this._getPromiseDecorator(a.Mn.PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.PURCHASE);const s=t?.id,i=this._platformSdk;Promise.resolve(i.getShopItems()).then((e=>{const t=e.find((e=>e&&e.id===s));if(!t)throw new Error(\"Shop item not found in catalog\");return i.openPurchaseConfirmModal(t)})).then((t=>{if(!t||\"success\"!==t.status)throw new Error(\"Purchase failed\");{const r={id:e,...t};this._paymentsPurchases.push(r),this._resolvePromiseDecorator(a.Mn.PURCHASE,r)}})).catch((e=>{this._rejectPromiseDecorator(a.Mn.PURCHASE,e)}))}return r.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e||!Array.isArray(e)||0===e.length)return Promise.reject(new Error(\"No platform products available\"));let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);if(!t){t=this._createPromiseDecorator(a.Mn.GET_CATALOG);const r=this._platformSdk;Promise.resolve(r.getShopItems()).then((t=>{if(!Array.isArray(t))throw new Error(\"Catalog response is not an array\");const r=e.map((e=>{const r=e.id,s=t.find((e=>e&&e.id===r));return s?{id:e.id,name:s.name,price:`${s.price} Gems`,priceCurrencyCode:\"Gems\",priceValue:s.price}:null})).filter(Boolean);this._resolvePromiseDecorator(a.Mn.GET_CATALOG,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_CATALOG,e)}))}return t.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);if(!e){e=this._createPromiseDecorator(a.Mn.GET_PURCHASES);const t=this._platformSdk;Promise.resolve(t.getPurchasedShopItems()).then((e=>{const t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.map((e=>{const r=e.id,s=t.find((e=>e.id===r));if(!s)return null;return{id:s.id,...e}})).filter((e=>null!==e)),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,e)}))}return e.promise}}const l=d},1298:(e,t,r)=>{r.r(t),r.d(t,{ACTION_NAME_QA:()=>I,SUPPORTED_FEATURES:()=>U,default:()=>Z});var s=r(8166),i=r(1558),a=r(5095),o=r(8960);class n{send(e,t=\"*\"){(0,o.n_)(e,t)}addListener(e){window.addEventListener(\"message\",e)}removeListener(e){window.removeEventListener(\"message\",e)}generateMessageId(){return`${Date.now()}-${Math.random()}`}}var d=r(5230);const l=class{#ss=0;#is=null;#as=[];#os=null;#ns=null;#ds=null;#ls=null;#hs=null;set onOffer(e){this.#ns=e}set onIceCandidate(e){this.#ds=e}set onStarted(e){this.#ls=e}set onError(e){this.#hs=e}checkAvailability(){return this.#cs()?this.#us()?this.#ps()?{available:!0,reason:null}:{available:!1,reason:\"Canvas not found\"}:{available:!1,reason:\"captureStream is not supported\"}:{available:!1,reason:\"RTCPeerConnection is not supported\"}}async startCapture(e={}){const{available:t,reason:r}=this.checkAvailability();if(!t)return void this.#hs?.(r);const s=this.#ps();if(!s)return;this.#ss+=1;const i=this.#ss;this.#ms();const a=s.captureStream(e.fps||30);let o,n;this.#os=a;try{o=e.iceServers?.length?new RTCPeerConnection({iceServers:e.iceServers}):new RTCPeerConnection}catch(e){throw this.#ms(),e}if(this.#is=o,e.contentHint){const t=a.getVideoTracks()[0];t&&(t.contentHint=e.contentHint)}a.getTracks().forEach((e=>o.addTrack(e,a))),o.onicecandidate=e=>{e.candidate&&this.#_s(i,o)&&this.#ds?.(e.candidate.toJSON())};try{if(n=await o.createOffer(),!this.#_s(i,o))return;if(await o.setLocalDescription(n),!this.#_s(i,o))return}catch(e){if(!this.#_s(i,o))return;throw this.#ms(),e}this.#gs(o,e),this.#ns?.(n.sdp),this.#ls?.()}async handleAnswer({sdp:e}){const t=this.#is;if(!t)return;if(await t.setRemoteDescription(new RTCSessionDescription({type:\"answer\",sdp:e})),t!==this.#is)return;const r=this.#as;this.#as=[],await Promise.all(r.map((e=>t.addIceCandidate(new RTCIceCandidate(e)))))}async handleIce(e){const t=this.#is;t&&e&&(t.remoteDescription?await t.addIceCandidate(new RTCIceCandidate(e)):this.#as.push(e))}takeScreenshot(e={}){const t=this.#ps();return t?this.#Ss(t,t.width,t.height,e,t):{success:!1,reason:\"Canvas not found\",data:null}}async takeScreenshotFromSurface(e={}){const t=this.#ps();if(!t)return{success:!1,reason:\"Canvas not found\",data:null};if(0===t.width||0===t.height)return{success:!1,reason:\"Canvas has no drawable area\",data:null};if(\"function\"!=typeof t.captureStream)return this.takeScreenshot(e);let r=null,s=null;try{r=t.captureStream(30);const i=r.getVideoTracks()[0];return i?(s=document.createElement(\"video\"),s.srcObject=r,s.muted=!0,s.playsInline=!0,await this.#As(s,i),this.#Ss(s,s.videoWidth,s.videoHeight,e)):{success:!1,reason:\"Canvas capture has no video track\",data:null}}catch(e){return{success:!1,reason:e&&\"object\"==typeof e&&\"message\"in e?String(e.message):\"Screenshot capture failed\",data:null}}finally{s?.pause(),s&&(s.srcObject=null),r?.getTracks().forEach((e=>e.stop()))}}stopCapture(){this.#ss+=1,this.#ms()}#ms(){this.#os?.getTracks().forEach((e=>e.stop())),this.#is?.close(),this.#is=null,this.#as=[],this.#os=null}#Ss(e,t,r,{type:s=\"image/png\",quality:i=.92,maxWidth:a,maxHeight:o}={},n=null){if(0===t||0===r)return{success:!1,reason:\"Screenshot source has no drawable area\",data:null};try{const d=this.#Es(e,t,r,a,o,n);if(!d)return{success:!1,reason:\"Canvas context is not available\",data:null};const l=Number.isFinite(i)?Math.min(1,Math.max(0,i)):.92,h=d.toDataURL(s,l);return\"data:,\"===h?{success:!1,reason:\"Canvas produced an empty screenshot\",data:null}:{success:!0,reason:null,data:h}}catch(e){return{success:!1,reason:e&&\"object\"==typeof e&&\"message\"in e?String(e.message):\"Screenshot capture failed\",data:null}}}#Es(e,t,r,s,i,a){const o=\"number\"==typeof s&&Number.isFinite(s)&&s>0?s:t,n=\"number\"==typeof i&&Number.isFinite(i)&&i>0?i:r,d=Math.min(1,o/t,n/r);if(1===d&&a)return a;const l=document.createElement(\"canvas\");l.width=Math.max(1,Math.round(t*d)),l.height=Math.max(1,Math.round(r*d));const h=l.getContext(\"2d\");return h?(h.drawImage(e,0,0,l.width,l.height),l):null}#gs(e,{maxBitrate:t,minBitrate:r,maxFramerate:s,scaleResolutionDownBy:i,priority:a,networkPriority:o,scalabilityMode:n}){e.getSenders().forEach((e=>{if(\"video\"!==e.track?.kind)return;const d=e.getParameters();if(d.encodings?.length||(d.encodings=[{}]),void 0!==t&&(d.encodings[0].maxBitrate=t),void 0!==r&&(d.encodings[0].minBitrate=r),void 0!==s&&(d.encodings[0].maxFramerate=s),void 0!==i&&(d.encodings[0].scaleResolutionDownBy=i),void 0!==a&&(d.encodings[0].priority=a),void 0!==o&&(d.encodings[0].networkPriority=o),void 0!==n){d.encodings[0].scalabilityMode=n}e.setParameters(d)}))}#_s(e,t){return e===this.#ss&&t===this.#is}#ps(){return document.querySelector(\"canvas\")}#cs(){return\"undefined\"!=typeof RTCPeerConnection}#us(){return\"function\"==typeof HTMLCanvasElement.prototype.captureStream}#As(e,t){return new Promise(((r,s)=>{const i=[];let a=null,o=!1;const n=e=>{o||(o=!0,i.forEach((e=>e())),e())},d=()=>n((()=>s(new Error(\"Canvas capture ended before its first frame\")))),l=()=>n(r),h=setTimeout((()=>n((()=>s(new Error(\"Canvas capture produced no video frames\"))))),1e3);i.push((()=>clearTimeout(h))),t.addEventListener(\"ended\",d,{once:!0}),i.push((()=>t.removeEventListener(\"ended\",d))),\"function\"==typeof e.requestVideoFrameCallback?(a=e.requestVideoFrameCallback((()=>n(r))),i.push((()=>{null!==a&&\"function\"==typeof e.cancelVideoFrameCallback&&e.cancelVideoFrameCallback(a)}))):(e.addEventListener(\"loadeddata\",l,{once:!0}),i.push((()=>e.removeEventListener(\"loadeddata\",l)))),Promise.resolve(e.play()).then((()=>{\"function\"!=typeof e.requestVideoFrameCallback&&e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&n(r)})).catch((e=>n((()=>s(e)))))}))}};var h=r(8902),c=r(3806),u=r(9221),p=r(7408);const m=\"interstitial\",_=\"reward\",g=\"banner\",S=\"advanced\",A=\"bridge\",E=\"platform_internal\",P=\"liveness\",f=\"recorder\",I={GET_DATA_FROM_STORAGE:\"get_data_from_storage\",SET_DATA_TO_STORAGE:\"set_data_to_storage\",DELETE_DATA_FROM_STORAGE:\"delete_data_from_storage\",GET_SERVER_TIME:\"get_server_time\",CHECK_ADBLOCK:\"check_adblock\",CLIPBOARD_READ:\"clipboard_read\",LIVENESS_PING:\"ping\",UNLOCK_ACHIEVEMENT:\"unlock_achievement\",GET_ACHIEVEMENTS:\"get_achievements\",GET_PERFORMANCE_RESOURCES:\"get_performance_resources\",GET_LANGUAGE:\"get_language\",GET_PLAYER:\"get_player\",AUDIO_STATE:\"audio_state\",PAUSE_STATE:\"pause_state\",CLEAN_CACHE:\"clean_cache\",SHOW_ADVANCED_BANNERS:\"show_advanced_banners\",HIDE_ADVANCED_BANNERS:\"hide_advanced_banners\",CROSS_PROMO_SHOWN:\"cross_promo_shown\",DAILY_REWARDS_CLAIMED:\"daily_rewards_claimed\",DAILY_REWARDS_STREAK_RESET:\"daily_rewards_streak_reset\",TASKS_REWARD_CLAIMED:\"tasks_reward_claimed\",TASKS_PERIOD_ROLLED_OVER:\"tasks_period_rolled_over\"},y=\"start_capture\",D=\"stop_capture\",T=\"rtc_offer\",w=\"rtc_answer\",R=\"rtc_ice\",v=\"capture_started\",b=\"capture_error\",C=\"take_screenshot\",O=\"screenshot_result\",L=\"start\",M=\"open\",N=\"close\",k=\"failed\",H=\"start\",G=\"open\",B=\"rewarded\",F=\"close\",x=\"failed\",U={PLAYER_AUTHORIZATION:\"isPlayerAuthorizationSupported\",PAYMENTS:\"isPaymentsSupported\",REMOTE_CONFIG:\"isRemoteConfigSupported\",SOCIAL_SHARE:\"isShareSupported\",SOCIAL_JOIN_COMMUNITY:\"isJoinCommunitySupported\",SOCIAL_INVITE_FRIENDS:\"isInviteFriendsSupported\",SOCIAL_CREATE_POST:\"isCreatePostSupported\",SOCIAL_ADD_TO_FAVORITES:\"isAddToFavoritesSupported\",SOCIAL_ADD_TO_HOME_SCREEN:\"isAddToHomeScreenSupported\",SOCIAL_RATE:\"isRateSupported\",BANNER:\"isBannerSupported\",INTERSTITIAL:\"isInterstitialSupported\",REWARDED:\"isRewardedSupported\",CLIPBOARD:\"isClipboardSupported\",ADVANCED_BANNERS:\"isAdvancedBannersSupported\",ACHIEVEMENTS:\"isAchievementsSupported\"};class V extends s.Z{get platformId(){return c.Lb.QA_TOOL}get platformLanguage(){return this.#Ps({type:h.oF.PLATFORM,action:I.GET_LANGUAGE,options:{language:this._platformLanguage}}),this._platformLanguage??super.platformLanguage}get platformTld(){return this._platformTld}get deviceType(){return this._deviceType??super.deviceType}get platformPayload(){return this._platformPayload}get isPlayerAuthorizationSupported(){return this._supportedFeatures.includes(U.PLAYER_AUTHORIZATION)}get isBannerSupported(){return this._supportedFeatures.includes(U.BANNER)}get isAdvancedBannersSupported(){return this._supportedFeatures.includes(U.ADVANCED_BANNERS)}get isInterstitialSupported(){return this._supportedFeatures.includes(U.INTERSTITIAL)}get isRewardedSupported(){return this._supportedFeatures.includes(U.REWARDED)}get isAchievementsSupported(){return this._supportedFeatures.includes(U.ACHIEVEMENTS)}get isInviteFriendsSupported(){return this._supportedFeatures.includes(U.SOCIAL_INVITE_FRIENDS)}get isJoinCommunitySupported(){return this._supportedFeatures.includes(U.SOCIAL_JOIN_COMMUNITY)}get isShareSupported(){return this._supportedFeatures.includes(U.SOCIAL_SHARE)}get isCreatePostSupported(){return this._supportedFeatures.includes(U.SOCIAL_CREATE_POST)}get isAddToHomeScreenSupported(){return this._supportedFeatures.includes(U.SOCIAL_ADD_TO_HOME_SCREEN)}get isAddToFavoritesSupported(){return this._supportedFeatures.includes(U.SOCIAL_ADD_TO_FAVORITES)}get isRateSupported(){return this._supportedFeatures.includes(U.SOCIAL_RATE)}get isPaymentsSupported(){return this._supportedFeatures.includes(U.PAYMENTS)}get isRemoteConfigSupported(){return this._supportedFeatures.includes(U.REMOTE_CONFIG)}get isClipboardSupported(){return this._supportedFeatures.includes(U.CLIPBOARD)}get leaderboardsType(){return this._leaderboardsType??p.Z.NOT_AVAILABLE}get safeArea(){return null}_supportedFeatures=[];_leaderboardsType=null;_platformLanguage;_platformTld=null;_platformPayload=null;_deviceType=null;_isPlatformStorageAvailable=!0;engine=\"javascript\";#fs=new n;#Is=new l;#ys=new a.Z((()=>this.#Ds()));initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(h.Mn.INITIALIZE);if(!e){e=this._createPromiseDecorator(h.Mn.INITIALIZE),this.on(h.W1.AUDIO_STATE_CHANGED,(e=>{this.#Ps({type:h.oF.PLATFORM,action:I.AUDIO_STATE,options:{isEnabled:e}})})),this.on(h.W1.PAUSE_STATE_CHANGED,(e=>{this.#Ps({type:h.oF.PLATFORM,action:I.PAUSE_STATE,options:{isPaused:e}})})),i.ZP.on(h.W1.CROSS_PROMO_SHOWN,(e=>{this.#Ps({type:h.oF.CROSS_PROMO,action:I.CROSS_PROMO_SHOWN,options:{...e}})})),i.ZP.on(h.W1.DAILY_REWARDS_CLAIMED,(e=>{this.#Ps({type:h.oF.DAILY_REWARDS,action:I.DAILY_REWARDS_CLAIMED,options:{...e}})})),i.ZP.on(h.W1.DAILY_REWARDS_STREAK_RESET,(e=>{this.#Ps({type:h.oF.DAILY_REWARDS,action:I.DAILY_REWARDS_STREAK_RESET,options:{...e}})})),i.ZP.on(h.W1.TASKS_REWARD_CLAIMED,(e=>{this.#Ps({type:h.oF.TASKS,action:I.TASKS_REWARD_CLAIMED,options:{...e}})})),i.ZP.on(h.W1.TASKS_PERIOD_ROLLED_OVER,(e=>{this.#Ps({type:h.oF.TASKS,action:I.TASKS_PERIOD_ROLLED_OVER,options:{...e}})}));const t=e=>{const t=e.data;if(t?.type&&t?.source!==A)if(t.type===h.oF.PLATFORM)if(t.action===h.Mn.INITIALIZE)this.#Ot().then((()=>{this.#Ts(t)}));else if(t.action===I.AUDIO_STATE)this.#ws(t);else if(t.action===I.PAUSE_STATE)this.#Rs(t);else if(t.action===I.GET_PERFORMANCE_RESOURCES){const e=this.#fs.generateMessageId(),r=t?.options?.resources||[];this.#vs(e,r)}else t.action===I.CLEAN_CACHE&&this.#bs();else t.type===h.oF.ADVERTISEMENT?this.#Cs(t):t.type===f&&this.#Os(t)};this.#fs.addListener(t),this.#Ls(),this.#Ps({type:h.oF.PLATFORM,action:h.Mn.INITIALIZE,payload:{engine:this.engine,version:\"2.2.0\",configFile:{loadingStatus:d.ZP.loadStatus,parsingStatus:d.ZP.parseStatus,loadError:d.ZP.loadError,parseError:d.ZP.parseError,options:d.ZP.getRawValues(),resolvedOptions:d.ZP.getValues(),path:d.ZP.path,remoteLoadStatus:d.ZP.remoteLoadStatus,remoteLoadError:d.ZP.remoteLoadError,remoteAppliedSource:d.ZP.remoteAppliedSource}}})}return e.promise}authorizePlayer(e){let t=this._getPromiseDecorator(h.Mn.AUTHORIZE_PLAYER);return t||(t=this._createPromiseDecorator(h.Mn.AUTHORIZE_PLAYER),this.#Ms(h.oF.PLAYER,h.Mn.AUTHORIZE_PLAYER,{options:e}).then((e=>{const{auth:t}=e;\"success\"===t.status?this.#Ot().then((()=>{this._resolvePromiseDecorator(h.Mn.AUTHORIZE_PLAYER)})):this._rejectPromiseDecorator(h.Mn.AUTHORIZE_PLAYER,t.error)}))),t.promise}sendMessage(e,t={}){const r=[c.Dt.GAME_READY,c.Dt.LEVEL_STARTED,c.Dt.LEVEL_COMPLETED,c.Dt.LEVEL_FAILED,c.Dt.LEVEL_PAUSED,c.Dt.LEVEL_RESUMED,c.Dt.IN_GAME_LOADING_STARTED,c.Dt.IN_GAME_LOADING_STOPPED,c.Dt.GAMEPLAY_STARTED,c.Dt.GAMEPLAY_STOPPED,c.Dt.PLAYER_GOT_ACHIEVEMENT];return\"string\"==typeof e&&r.includes(e)?(this.#Ps({type:h.oF.PLATFORM,action:e,options:t}),Promise.resolve()):super.sendMessage(e,t)}getServerTime(){return this.#ys.getServerTime()}async getDataFromStorage(e){const t={};return await Promise.all(e.map((async e=>{const r=await this.#Ms(h.oF.STORAGE,I.GET_DATA_FROM_STORAGE,{options:{key:e,storageType:E}}).then((t=>{const{storage:r}=t;return r&&r[e]}));null!=r&&\"\"!==r&&(t[e]=r)}))),t}setDataToStorage(e){return Promise.all(Object.keys(e).map((t=>(this.#Ps({type:h.oF.STORAGE,action:I.SET_DATA_TO_STORAGE,options:{key:t,value:e[t],storageType:E}}),Promise.resolve())))).then((()=>{}))}deleteDataFromStorage(e){return Promise.all(e.map((e=>(this.#Ps({type:h.oF.STORAGE,action:I.DELETE_DATA_FROM_STORAGE,options:{key:e,storageType:E}}),Promise.resolve())))).then((()=>{}))}showInterstitial(e){this.isInterstitialSupported&&this.#Ps({type:h.oF.ADVERTISEMENT,action:m,options:{placement:e}})}showRewarded(e){this.isRewardedSupported&&this.#Ps({type:h.oF.ADVERTISEMENT,action:_,options:{placement:e}})}showBanner(e,t){this.isBannerSupported&&(this._setBannerState(u.Kk.SHOWN),this.#Ps({type:h.oF.ADVERTISEMENT,action:u.Kk.SHOWN,options:{type:g,position:e,placement:t}}))}hideBanner(){this.isBannerSupported&&(this._setBannerState(u.Kk.HIDDEN),this.#Ps({type:h.oF.ADVERTISEMENT,action:u.Kk.HIDDEN,options:{type:g}}))}showAdvancedBanners(e){this.isAdvancedBannersSupported&&(this._setAdvancedBannersState(u.Kk.LOADING),this.#Ps({type:h.oF.ADVERTISEMENT,action:I.SHOW_ADVANCED_BANNERS,options:{banners:e}}))}hideAdvancedBanners(){this.isAdvancedBannersSupported&&(this._setAdvancedBannersState(u.Kk.HIDDEN),this.#Ps({type:h.oF.ADVERTISEMENT,action:I.HIDE_ADVANCED_BANNERS}))}checkAdBlock(){return this.#Ps({type:I.CHECK_ADBLOCK,action:h.Mn.ADBLOCK_DETECT}),super.checkAdBlock()}inviteFriends(){let e=this._getPromiseDecorator(h.Mn.INVITE_FRIENDS);return e||(e=this._createPromiseDecorator(h.Mn.INVITE_FRIENDS),this._resolvePromiseDecorator(h.Mn.INVITE_FRIENDS),this.#Ps({type:h.oF.SOCIAL,action:h.Mn.INVITE_FRIENDS})),e.promise}joinCommunity(){let e=this._getPromiseDecorator(h.Mn.JOIN_COMMUNITY);return e||(e=this._createPromiseDecorator(h.Mn.JOIN_COMMUNITY),this._resolvePromiseDecorator(h.Mn.JOIN_COMMUNITY),this.#Ps({type:h.oF.SOCIAL,action:h.Mn.JOIN_COMMUNITY})),e.promise}share(){let e=this._getPromiseDecorator(h.Mn.SHARE);return e||(e=this._createPromiseDecorator(h.Mn.SHARE),this._resolvePromiseDecorator(h.Mn.SHARE),this.#Ps({type:h.oF.SOCIAL,action:h.Mn.SHARE})),e.promise}createPost(){let e=this._getPromiseDecorator(h.Mn.CREATE_POST);return e||(e=this._createPromiseDecorator(h.Mn.CREATE_POST),this._resolvePromiseDecorator(h.Mn.CREATE_POST),this.#Ps({type:h.oF.SOCIAL,action:h.Mn.CREATE_POST})),e.promise}addToHomeScreen(){let e=this._getPromiseDecorator(h.Mn.ADD_TO_HOME_SCREEN);return e||(e=this._createPromiseDecorator(h.Mn.ADD_TO_HOME_SCREEN),this._resolvePromiseDecorator(h.Mn.ADD_TO_HOME_SCREEN),this.#Ps({type:h.oF.SOCIAL,action:h.Mn.ADD_TO_HOME_SCREEN})),e.promise}addToFavorites(){let e=this._getPromiseDecorator(h.Mn.ADD_TO_FAVORITES);return e||(e=this._createPromiseDecorator(h.Mn.ADD_TO_FAVORITES),this._resolvePromiseDecorator(h.Mn.ADD_TO_FAVORITES),this.#Ps({type:h.oF.SOCIAL,action:h.Mn.ADD_TO_FAVORITES})),e.promise}rate(){let e=this._getPromiseDecorator(h.Mn.RATE);return e||(e=this._createPromiseDecorator(h.Mn.RATE),this._resolvePromiseDecorator(h.Mn.RATE),this.#Ps({type:h.oF.SOCIAL,action:h.Mn.RATE})),e.promise}paymentsPurchase(e,t){let r=this._getPromiseDecorator(h.Mn.PURCHASE);if(!r){r=this._createPromiseDecorator(h.Mn.PURCHASE);const s=t?.externalId||this._paymentsGenerateTransactionId(e),i={id:e,externalId:s};this.#Ms(h.oF.PAYMENTS,h.Mn.PURCHASE,{options:{product:i}}).then((t=>{const{purchase:r}=t;if(r&&\"object\"==typeof r)if(r?.status){const t={id:e,...r.purchaseData};this._paymentsPurchases.push(t),this._resolvePromiseDecorator(h.Mn.PURCHASE,t)}else this._rejectPromiseDecorator(h.Mn.PURCHASE,r?.error||new Error(\"Unknown purchase error\"));else this._rejectPromiseDecorator(h.Mn.PURCHASE,new Error(\"Invalid purchase\"))}))}return r.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(h.Mn.CONSUME_PURCHASE);return r||(r=this._createPromiseDecorator(h.Mn.CONSUME_PURCHASE),this.#Ms(h.oF.PAYMENTS,h.Mn.CONSUME_PURCHASE,{options:{product:this._paymentsPurchases[t]}}).then((r=>{const{purchase:s}=r;if(s&&\"object\"==typeof s)if(s?.status){const r={id:e,...s};this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(h.Mn.CONSUME_PURCHASE,r)}else this._rejectPromiseDecorator(h.Mn.CONSUME_PURCHASE,s?.error||new Error(\"Unknown consume purchase error\"));else this._rejectPromiseDecorator(h.Mn.CONSUME_PURCHASE,new Error(\"Invalid purchase\"))}))),r.promise}paymentsGetCatalog(){let e=this._getPromiseDecorator(h.Mn.GET_CATALOG);return e||(e=this._createPromiseDecorator(h.Mn.GET_CATALOG),this.#Ms(h.oF.PAYMENTS,h.Mn.GET_CATALOG).then((e=>{const{payload:t}=e,r=t.products.map((e=>({id:e.id,price:`${e.price} ${e.currency}`,priceCurrencyCode:e.currency,priceCurrencyImage:e.priceCurrencyImage,priceValue:e.price})));this._resolvePromiseDecorator(h.Mn.GET_CATALOG,r)}))),e.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(h.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(h.Mn.GET_PURCHASES),this.#Ms(h.oF.PAYMENTS,h.Mn.GET_PURCHASES).then((e=>{const{purchases:t}=e;this._paymentsPurchases=t.map((e=>e.purchaseData)),this._resolvePromiseDecorator(h.Mn.GET_PURCHASES,this._paymentsPurchases)}))),e.promise}getRemoteConfig(){let e=this._getPromiseDecorator(h.Mn.GET_REMOTE_CONFIG);return e||(e=this._createPromiseDecorator(h.Mn.GET_REMOTE_CONFIG),this.#Ms(h.oF.REMOTE_CONFIG,h.Mn.GET_REMOTE_CONFIG).then((e=>{const{result:t}=e;this._resolvePromiseDecorator(h.Mn.GET_REMOTE_CONFIG,t)}))),e.promise}clipboardWrite(e){let t=this._getPromiseDecorator(h.Mn.CLIPBOARD_WRITE);return t||(t=this._createPromiseDecorator(h.Mn.CLIPBOARD_WRITE),this.#Ms(h.oF.CLIPBOARD,h.Mn.CLIPBOARD_WRITE,{options:{text:e}}).then((()=>{this._resolvePromiseDecorator(h.Mn.CLIPBOARD_WRITE,!0)}))),t.promise}clipboardRead(){let e=this._getPromiseDecorator(I.CLIPBOARD_READ);return e||(e=this._createPromiseDecorator(I.CLIPBOARD_READ),this.#Ms(h.oF.CLIPBOARD,I.CLIPBOARD_READ,{options:{}}).then((e=>{const{text:t}=e;this._resolvePromiseDecorator(I.CLIPBOARD_READ,t)}))),e.promise}leaderboardsSetScore(e,t,r){let s=this._getPromiseDecorator(h.Mn.LEADERBOARDS_SET_SCORE);if(!s){s=this._createPromiseDecorator(h.Mn.LEADERBOARDS_SET_SCORE);const r={id:e,score:t};this.#Ps({type:h.oF.LEADERBOARDS,action:h.Mn.LEADERBOARDS_SET_SCORE,options:r}),this._resolvePromiseDecorator(h.Mn.LEADERBOARDS_SET_SCORE)}return s.promise}leaderboardsGetEntries(e){let t=this._getPromiseDecorator(h.Mn.LEADERBOARDS_GET_ENTRIES);return t||(t=this._createPromiseDecorator(h.Mn.LEADERBOARDS_GET_ENTRIES),this.#Ms(h.oF.LEADERBOARDS,h.Mn.LEADERBOARDS_GET_ENTRIES,{options:{id:e}},{timeout:5e3}).then((e=>{const{entries:t}=e;this._resolvePromiseDecorator(h.Mn.LEADERBOARDS_GET_ENTRIES,t)})).catch((()=>{this._rejectPromiseDecorator(h.Mn.LEADERBOARDS_GET_ENTRIES)}))),t.promise}leaderboardsShowNativePopup(e){return this.#Ps({type:h.oF.LEADERBOARDS,action:h.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP,options:{id:e}}),Promise.resolve(h.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP)}achievementsUnlock(e){return this.isAchievementsSupported?this.#Ms(h.oF.ACHIEVEMENTS,I.UNLOCK_ACHIEVEMENT,{options:{achievement:e}}).then((e=>e.result)):Promise.reject()}achievementsGetList(){return this.isAchievementsSupported?this.#Ms(h.oF.ACHIEVEMENTS,I.GET_ACHIEVEMENTS,{options:{}}).then((e=>e.result??[])):Promise.reject()}#Ts(e){this._supportedFeatures=e.supportedFeatures||[],this._isBannerSupported=this._supportedFeatures.includes(U.BANNER),this._isAdvancedBannersSupported=this._supportedFeatures.includes(U.ADVANCED_BANNERS);const t=e.config??{};this._deviceType=t.deviceType??super.deviceType,this._platformLanguage=t.platformLanguage?t.platformLanguage.toLowerCase():super.platformLanguage,this._platformTld=t.platformTld??super.platformTld,this._platformPayload=t.platformPayload??super.platformPayload,this._leaderboardsType=t.leaderboardsType??p.Z.NOT_AVAILABLE,this._paymentsPurchases=e.purchases||[],this._isInitialized=!0,this._resolvePromiseDecorator(h.Mn.INITIALIZE),this.#Ps({type:P,action:I.LIVENESS_PING,options:{version:\"2.2.0\"}})}#ws(e){this._setAudioState(e.options.isEnabled)}#Rs(e){this._setPauseState(e.options.isPaused)}#vs(e,t=[]){const r=Array.isArray(t)?t:[],s=performance.getEntriesByType(\"resource\")||[],i=r.length>0?r:[\"name\",\"initiatorType\"],a=s.map((e=>{const t={};return i.forEach((r=>{r in e&&(t[r]=e[r])})),t}));return this.#Ps({type:h.oF.PLATFORM,action:I.GET_PERFORMANCE_RESOURCES,id:e,options:{resources:a}}),Promise.resolve(s)}#Ps(e){this.#fs.send({source:A,...e})}#Ds(){return this.#Ms(h.oF.PLATFORM,I.GET_SERVER_TIME,{options:{}},{timeout:5e3}).then((e=>{const{time:t}=e;if(!t)throw new Error(\"Invalid server time\");return t})).catch((()=>{throw new Error(\"Server time request timeout\")}))}#Ms(e,t,r={},s={}){const i=this.#fs.generateMessageId(),a={timeout:0,...s};return new Promise(((o,n)=>{const d=r=>{const s=r.data;s?.type===e&&s?.action===t&&s?.id===i&&s?.source!==A&&(this.#fs.removeListener(d),o(s))};this.#fs.addListener(d),this.#Ps({type:e,action:t,id:i,options:s,...r}),(a.timeout??0)>0&&setTimeout((()=>{n(new Error(\"Request timeout\")),this.#fs.removeListener(d)}),a.timeout)}))}async#Ot(){return this.#Ms(h.oF.PLAYER,I.GET_PLAYER).then((e=>{const{player:t}=e;t?.isAuthorized&&(this._playerId=t.userId??null,this._isPlayerAuthorized=!!t.isAuthorized,this._playerName=t.name??null,Array.isArray(t.photos)&&(this._playerPhotos=[...t.photos]),this._playerExtra=t)})).catch((()=>{}))}#Cs(e){const{action:t,payload:r}=e,s=r?.status;if(t===m){if(!this.isInterstitialSupported)return;switch(s){case L:this._setInterstitialState(u.WA.LOADING);break;case M:this._setInterstitialState(u.WA.OPENED);break;case k:this._showAdFailurePopup(!1);break;case N:this._setInterstitialState(u.WA.CLOSED)}}else if(t===_){if(!this.isRewardedSupported)return;switch(s){case H:this._setRewardedState(u.b3.LOADING);break;case G:this._setRewardedState(u.b3.OPENED);break;case B:this._setRewardedState(u.b3.REWARDED);break;case F:this._setRewardedState(u.b3.CLOSED);break;case x:this._showAdFailurePopup(!0)}}else if(t===S)switch(s){case u.Kk.SHOWN:this._setAdvancedBannersState(u.Kk.SHOWN);break;case u.Kk.HIDDEN:this._setAdvancedBannersState(u.Kk.HIDDEN);break;case u.Kk.FAILED:this._setAdvancedBannersState(u.Kk.FAILED);break;case u.Kk.LOADING:this._setAdvancedBannersState(u.Kk.LOADING)}}#Os(e){switch(e.action){case y:this.#Is.startCapture(e.options||{});break;case D:this.#Is.stopCapture();break;case w:this.#Is.handleAnswer(e.options);break;case R:this.#Is.handleIce(e.options);break;case C:this.#Is.takeScreenshotFromSurface(e.options).then((t=>{this.#Ps({type:f,action:O,id:e.id,payload:t})}))}}#Ls(){this.#Is.onOffer=e=>{this.#Ps({type:f,action:T,payload:{sdp:e}})},this.#Is.onIceCandidate=e=>{this.#Ps({type:f,action:R,payload:e})},this.#Is.onStarted=()=>{this.#Ps({type:f,action:v})},this.#Is.onError=e=>{this.#Ps({type:f,action:b,payload:{message:e}})}}#bs(){\"unity\"===this.engine&&indexedDB.deleteDatabase(\"UnityCache\")}}const Z=V},6539:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(8166),i=r(5095),a=r(8902),o=r(3806),n=r(7408);class d extends s.Z{get platformId(){return o.Lb.REDDIT}get launchSource(){return this._launchPostId?a.LS.POST:super.launchSource}get platformPayload(){return this.#Ns??super.platformPayload}get isPlatformExternalCallsSupported(){return!1}get isJoinCommunitySupported(){return!0}get isShareSupported(){return!0}get isCreatePostSupported(){return!0}get isPostRewardSupported(){return!0}get leaderboardsType(){return n.Z.IN_GAME}get isPaymentsSupported(){return!0}#Ns=null;#ys=new i.Z((()=>this.#ks()));initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this.#Hs(\"/api/initialize\").then((e=>{const t=e||{};this._isPlayerAuthorized=!!t.isPlayerAuthorized,this._isPlayerAuthorized&&(this._playerId=t.playerId??null,this._playerName=t.playerName??null,t.playerPhoto&&this._playerPhotos.push(t.playerPhoto),this._setPlatformStorageAvailable(!0)),this._launchPostId=t.post?.id??null,this.#Ns=t.post?.payload??null,this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.INITIALIZE,e)}))),e.promise}getServerTime(){return this.#ys.getServerTime()}async getDataFromStorage(e){await this.#Ut();const t={};return await Promise.all(e.map((async e=>{const r=await this.#Hs(\"/api/storage/get\",{method:\"POST\",body:{key:e}});null!=r&&\"\"!==r&&(t[e]=r)}))),t}async setDataToStorage(e){return await this.#Ut(),Promise.all(Object.keys(e).map((t=>this.#Hs(\"/api/storage/set\",{method:\"POST\",body:{key:t,value:e[t]}})))).then((()=>{}))}async deleteDataFromStorage(e){return await this.#Ut(),Promise.all(e.map((e=>this.#Hs(\"/api/storage/delete\",{method:\"POST\",body:{key:e}})))).then((()=>{}))}checkAdBlock(){return Promise.resolve(!1)}paymentsPurchase(e){const t=\"undefined\"!=typeof window&&window.__playgama_devvit?window.__playgama_devvit.purchase:null;if(\"function\"!=typeof t)return Promise.reject(new Error(\"window.__playgama_devvit.purchase is not registered. Set window.__playgama_devvit = { purchase } using purchase() from @devvit/web/client before calling bridge.initialize().\"));let r=this._getPromiseDecorator(a.Mn.PURCHASE);return r||(r=this._createPromiseDecorator(a.Mn.PURCHASE),Promise.resolve(t(e)).then((t=>{const r=t&&\"object\"==typeof t?{...t}:{};r.id||(r.id=e),this._paymentsPurchases.push(r),this._resolvePromiseDecorator(a.Mn.PURCHASE,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.PURCHASE,e)}))),r.promise}paymentsGetCatalog(){if(!this._paymentsGetProductsPlatformData())return Promise.reject();let e=this._getPromiseDecorator(a.Mn.GET_CATALOG);return e||(e=this._createPromiseDecorator(a.Mn.GET_CATALOG),this.#Hs(\"/api/catalog\").then((e=>{this._resolvePromiseDecorator(a.Mn.GET_CATALOG,this.#Gs(e))})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_CATALOG,e)}))),e.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(a.Mn.GET_PURCHASES),this.#Hs(\"/api/purchases\").then((e=>{this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this.#Gs(e))})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,e)}))),e.promise}share(e){const{text:t,...r}=e??{};if(!t)return Promise.reject();let s=this._getPromiseDecorator(a.Mn.SHARE);return s||(s=this._createPromiseDecorator(a.Mn.SHARE),this.#Hs(\"/api/share\",{method:\"POST\",body:{options:{...r,text:t}}}).then((()=>{this._resolvePromiseDecorator(a.Mn.SHARE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.SHARE,e)}))),s.promise}createPost(e,t){const r={...e??{}},s=r.title??r.text;delete r.text,delete r.image,delete r.url;let i=this._getPromiseDecorator(a.Mn.CREATE_POST);return i||(i=this._createPromiseDecorator(a.Mn.CREATE_POST),this.#Hs(\"/api/create-post\",{method:\"POST\",body:{options:{...r,title:s},...t?.id?{id:t.id}:{},...void 0===t?.payload?{}:{payload:t.payload}}}).then((e=>{const t=e??{};this._resolvePromiseDecorator(a.Mn.CREATE_POST,{url:\"string\"==typeof t.postUrl?t.postUrl:null})})).catch((e=>{this._rejectPromiseDecorator(a.Mn.CREATE_POST,e)}))),i.promise}joinCommunity(){let e=this._getPromiseDecorator(a.Mn.JOIN_COMMUNITY);return e||(e=this._createPromiseDecorator(a.Mn.JOIN_COMMUNITY),this.#Hs(\"/api/join-community\",{method:\"POST\"}).then((()=>{this._resolvePromiseDecorator(a.Mn.JOIN_COMMUNITY)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.JOIN_COMMUNITY,e)}))),e.promise}getPostVisitReward(e){if(!this._isPlayerAuthorized||!this._launchPostId)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.GET_POST_VISIT_REWARD);return t||(t=this._createPromiseDecorator(a.Mn.GET_POST_VISIT_REWARD),this.#Hs(\"/api/post-visit-reward\",{method:\"POST\",body:{cooldown:e??0}}).then((e=>{e?.granted?this._resolvePromiseDecorator(a.Mn.GET_POST_VISIT_REWARD):this._rejectPromiseDecorator(a.Mn.GET_POST_VISIT_REWARD)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_POST_VISIT_REWARD,e)}))),t.promise}getPostAuthorReward(){if(!this._isPlayerAuthorized)return Promise.reject();let e=this._getPromiseDecorator(a.Mn.GET_POST_AUTHOR_REWARD);return e||(e=this._createPromiseDecorator(a.Mn.GET_POST_AUTHOR_REWARD),this.#Hs(\"/api/post-author-reward\",{method:\"POST\"}).then((e=>{const t=e?.counts??{},r={};Object.keys(t).forEach((e=>{const s=Number(t[e])||0;s>0&&(r[e]=s)})),this._resolvePromiseDecorator(a.Mn.GET_POST_AUTHOR_REWARD,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_POST_AUTHOR_REWARD,e)}))),e.promise}leaderboardsSetScore(e,t,r){if(!this._isPlayerAuthorized)return Promise.reject();let s=this._getPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);return s||(s=this._createPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE),this.#Hs(\"/api/leaderboards/set-score\",{method:\"POST\",body:{id:e,score:t,isMain:r}}).then((()=>{this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE,e)}))),s.promise}leaderboardsGetEntries(e){let t=this._getPromiseDecorator(a.Mn.LEADERBOARDS_GET_ENTRIES);return t||(t=this._createPromiseDecorator(a.Mn.LEADERBOARDS_GET_ENTRIES),this.#Hs(`/api/leaderboards/entries?id=${encodeURIComponent(e)}`).then((e=>{const t=this.#Gs(e).map((e=>{const{id:t,name:r,score:s,rank:i,photo:a}=e??{};return{id:String(t??\"\"),name:r??\"\",score:Number(s??0),rank:Number(i??0),photo:a??null}}));this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_GET_ENTRIES,t)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_GET_ENTRIES,e)}))),t.promise}#ks(){return this.#Hs(\"/api/server-time\").then((e=>{const t=Number(e?.serverTime);if(!Number.isFinite(t))throw new Error(\"Invalid server time\");return t}))}#Ut(){return this._isPlayerAuthorized?Promise.resolve():Promise.reject()}#Gs(e){if(Array.isArray(e))return e;const t=e?.data;return Array.isArray(t)?t:[]}#Hs(e,{method:t=\"GET\",body:r}={}){const s={},i={method:t,headers:s};return void 0!==r&&(s[\"Content-Type\"]=\"application/json\",i.body=JSON.stringify(r)),fetch(e,i).then((r=>r.ok?r.text().then((e=>{if(!e)return null;try{return JSON.parse(e)}catch{return null}})):r.text().then((s=>{const i=s?`: ${s}`:\"\";throw new Error(`${t} ${e} failed (${r.status})${i}`)}))))}}const l=d},9793:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(8960),a=r(1302),o=r(8902),n=r(3806),d=r(9221);function l(e){if(e&&\"object\"==typeof e)return e.err}class h extends s.Z{get platformId(){return n.Lb.SAMSUNG}get platformLanguage(){return this.#Bs||super.platformLanguage}get isPlayerAuthorizationSupported(){return!0}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isAddToHomeScreenSupported(){return this.#Fs}get isPlatformExternalLinksAllowed(){return!1}get isPaymentsSupported(){return this.#xs}#Bs=null;#Fs=!1;#xs=!1;#Us=!1;#Vs=!1;#Zs=!1;#js=!1;#zs=!1;#Ws=null;initialize(){if(this._isInitialized)return Promise.resolve();this.#Ks(),this.#Ys();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);if(!e){e=this._createPromiseDecorator(o.Mn.INITIALIZE);(void 0!==window.GSInstant?Promise.resolve():(0,i.ZT)(\"https://gtg.samsungapps.com/gsinstant-sdk/gsinstant.0.45.js\")).then((()=>(0,i.X_)(\"GSInstant\"))).then((()=>(this._platformSdk=window.GSInstant,this._platformSdk.initializeAsync()))).then((e=>{if(l(e))throw new Error(`Samsung initializeAsync failed: ${l(e)}`);const t=this._platformSdk,r=t.getLocale();\"string\"==typeof r&&r.length>=2&&(this.#Bs=r.substring(0,2).toLowerCase());const s=t.canCreateShortCut();return this.#Fs=Boolean(s)&&!l(s),t.setOnPauseCallback((()=>{this._setPauseState(!0)})),t.setOnResumeCallback((()=>{this._setPauseState(!1)})),this.#$s()})).then((()=>(this.#qs(),this._platformSdk.startGameAsync()))).then((e=>{if(l(e))throw new Error(`Samsung startGameAsync failed: ${l(e)}`);this._isInitialized=!0,this._resolvePromiseDecorator(o.Mn.INITIALIZE)})).catch((e=>{this._rejectPromiseDecorator(o.Mn.INITIALIZE,e)}))}return e.promise}sendMessage(e,t){return e===n.Dt.GAME_READY?(this.setLoadingProgress(100),this.#Js(4e3),Promise.resolve()):super.sendMessage(e,t)}setLoadingProgress(e){if(this.#zs)return;const t=this._platformSdk;t&&\"function\"==typeof t.setLoadingProgress&&t.setLoadingProgress(e>=100?101:e),e>=100&&(this.#zs=!0)}authorizePlayer(){if(this._isPlayerAuthorized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.AUTHORIZE_PLAYER);if(!e){e=this._createPromiseDecorator(o.Mn.AUTHORIZE_PLAYER);const t=this._platformSdk;t.loginAsync().catch((e=>{if(!e||\"ALREADY_LOGGED_IN\"!==e.err)throw e})).then((()=>t.player.getPlayerIdAsync())).then((e=>{this._isPlayerAuthorized=!0,this._playerId=e,this._setPlatformStorageAvailable(!0),this._resolvePromiseDecorator(o.Mn.AUTHORIZE_PLAYER)})).catch((e=>{const t=e&&e.err||(\"string\"==typeof e?e:\"samsung_auth_failed\");this._rejectPromiseDecorator(o.Mn.AUTHORIZE_PLAYER,new Error(String(t)))}))}return e.promise}async getDataFromStorage(e){await this.#Ut();const t={};return await Promise.all(e.map((async e=>{const r=await this._platformSdk.getDataAsync([e]),s=r&&void 0!==r[e]?r[e]:null;null!=s&&\"\"!==s&&(t[e]=\"string\"==typeof s?s:JSON.stringify(s))}))),t}async setDataToStorage(e){return await this.#Ut(),Promise.all(Object.keys(e).map((t=>this._platformSdk.setDataAsync({[t]:e[t]})))).then((()=>{}))}async deleteDataFromStorage(e){return await this.#Ut(),Promise.all(e.map((e=>this._platformSdk.setDataAsync({[e]:null})))).then((()=>{}))}preloadInterstitial(){if(!this.#Vs)return;const e=this._platformSdk.advertisement2.loadAd({adFormat:\"INTERSTITIAL\"});l(e)&&a.ZP.warn(\"Samsung loadAd(INTERSTITIAL) error:\",l(e))}showInterstitial(){if(!this.#Vs)return void this._showAdFailurePopup(!1);this.#Zs=!1,this.#js=!0;const e=this._platformSdk.advertisement2.showAd({adFormat:\"INTERSTITIAL\"});l(e)&&(a.ZP.warn(\"Samsung showAd(INTERSTITIAL) error:\",l(e)),this.#js=!1,this._showAdFailurePopup(!1),this.#Xs())}preloadRewarded(){if(!this.#Vs)return;const e=this._platformSdk.advertisement2.loadAd({adFormat:\"REWARD\"});l(e)&&a.ZP.warn(\"Samsung loadAd(REWARD) error:\",l(e))}showRewarded(){if(!this.#Vs)return void this._showAdFailurePopup(!0);this.#Zs=!0,this.#js=!0;const e=this._platformSdk.advertisement2.showAd({adFormat:\"REWARD\"});l(e)&&(a.ZP.warn(\"Samsung showAd(REWARD) error:\",l(e)),this.#js=!1,this._showAdFailurePopup(!0),this.#Xs())}addToHomeScreen(){const e=l(this._platformSdk.createShortCut());return e?Promise.reject(new Error(String(e))):Promise.resolve()}async paymentsPurchase(e){const t=this._paymentsGetProductPlatformData(e);if(!t)return Promise.reject(new Error(`samsung_product_not_found: ${e}`));let r=this._getPromiseDecorator(o.Mn.PURCHASE);if(!r){r=this._createPromiseDecorator(o.Mn.PURCHASE);try{const r=window.GSInstantIAP,s={id:e,...await r.purchaseItemAsync({itemID:t.platformProductId,passThroughParam:this._paymentsGenerateTransactionId(e)})};this._paymentsPurchases.push(s),this._resolvePromiseDecorator(o.Mn.PURCHASE,s)}catch(e){this._rejectPromiseDecorator(o.Mn.PURCHASE,e)}}return r.promise}async paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject(new Error(`samsung_purchase_not_found: ${e}`));let r=this._getPromiseDecorator(o.Mn.CONSUME_PURCHASE);if(!r){r=this._createPromiseDecorator(o.Mn.CONSUME_PURCHASE);try{const r=window.GSInstantIAP,s=this._paymentsPurchases[t].mPurchaseId,i=await r.consumeItemsAsync(s),a=Array.isArray(i)?i:[i].filter(Boolean),n=a.find((e=>e.mPurchaseId===s||e.mPurchaseID===s))??a[0],d=null!=n?.mStatusCode?String(n.mStatusCode):\"0\";if(\"0\"!==d&&\"4\"!==d)throw new Error(n?.mStatusString||\"samsung_consume_failed\");this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(o.Mn.CONSUME_PURCHASE,{id:e,...n})}catch(e){this._rejectPromiseDecorator(o.Mn.CONSUME_PURCHASE,e)}}return r.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject(new Error(\"samsung_no_products_configured\"));let t=this._getPromiseDecorator(o.Mn.GET_CATALOG);if(!t){t=this._createPromiseDecorator(o.Mn.GET_CATALOG);const r=e.map((e=>e.platformProductId)).join(\",\");Promise.resolve().then((()=>window.GSInstantIAP.getProductListAsync(r))).then((t=>{const r=Array.isArray(t)?t:[],s=e.map((e=>{const t=r.find((t=>t.mItemId===e.platformProductId)),s=null!=t?.mItemPrice&&t?.mCurrencyCode?`${t.mItemPrice} ${t.mCurrencyCode}`:t?.mItemPriceString??null;return{id:e.id,title:t?.mItemName??null,description:t?.mItemDesc??null,price:s,priceCurrencyCode:t?.mCurrencyCode??null,priceCurrencyImage:t?.mItemImageUrl??null,priceValue:null!=t?.mItemPrice?Number(t.mItemPrice):null}}));this._resolvePromiseDecorator(o.Mn.GET_CATALOG,s)})).catch((e=>{a.ZP.warn(\"Samsung getProductListAsync error:\",e),this._resolvePromiseDecorator(o.Mn.GET_CATALOG,[])}))}return t.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(o.Mn.GET_PURCHASES);if(!e){e=this._createPromiseDecorator(o.Mn.GET_PURCHASES);const t=this._paymentsGetProductsPlatformData();Promise.resolve().then((()=>window.GSInstantIAP.getOwnedListAsync())).then((e=>{const r=Array.isArray(e)?e:[];this._paymentsPurchases=r.map((e=>{const r=t.find((t=>t.platformProductId===e.mItemId));return{id:r?.id??e.mItemId,...e}})),this._resolvePromiseDecorator(o.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((e=>{a.ZP.warn(\"Samsung getOwnedListAsync error:\",e),this._paymentsPurchases=[],this._resolvePromiseDecorator(o.Mn.GET_PURCHASES,[])}))}return e.promise}#Qs(e){const t=this._platformSdk.advertisement2;if(!t)return;const r=t.loadAd({adFormat:e});l(r)&&a.ZP.warn(`Samsung loadAd(${e}) error:`,l(r))}#Xs(){this.#Qs(this.#Zs?\"REWARD\":\"INTERSTITIAL\")}#Ys(){if(this.#Ws||\"undefined\"==typeof document)return;const e=document.createElement(\"div\");e.id=\"bridge-samsung-grac-rating\",e.style.cssText=\"position:fixed;top:12px;right:12px;z-index:2147483647;pointer-events:none;transition:opacity .5s\";const t=document.createElement(\"img\");t.src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAApCAYAAABdnotGAAAFZUlEQVR4nM1Ya2xTZRh+Ttud057T07Vd23W9bCOETXAoeEEw4ZI4hjFBEMgiMdGf8sMLIP5RQwyJzgWm8UIg/nAI8ZLAHyRx6m+HMLnojAkbRbuNjvW2tV2vp5djzic7Y46etqMgT3JyvtP3/b7v+d73/b7v7UsFAgHs3b1HHDh3Dvl8Hv8HNBoNOp7ehPe6uihqZ2enOHB+APcDtjy3FdTipmZR+qC0FIxrjaipq7lnBEQREMYziJ6NAnmAZVloZoTmjWYYnqjFPcdyPSEW+zmKZDI5S4i2M4r92he1Y7XryYrmimWi+GTg45J6jHt2bplQKax2rsH6pvUVEZrOxND7Wy+mhZiiHqWi5LaqnIEpUHAaXKgUuhoWFtZSUZ+yCDFqBjzNV0xIo9KgTldXfUK6GhYGxoCFoIFvqD4hA8NDV6NbGCH9XSDkNrixUDh5V/UJOSsc9FY4eAfZFFUlZOWsCybEMzzYGra6hBoU4qAgFpAvFL+Upd1ZyYYoSUhFqWDWmYvKM7kMwqlQUTmtpmHSmqpHiFEzsLDFXZbOp+GZvKY4hrvWXT1CepqHUWssKo8Lcfwd+UtxDAfvrB6hes6mKJ9MTmIqNaWo49RXkZCNq1eUS/ETSgUVdawlFlUhIZuiPJQKI5QIK+qYdCYSi+VAc6endCgRRDQTgZAXyI4a/HMIY+MTsnxxsxvNixzgaA6bmzdjtWvNLX1D+OBsV2WE7Hq7onwicQPxbAIJIQFaRyMam8aEf9aFNosZWo0WNtYGl8GNh+tXyDJfzFeZy9SUGlbWpngoRtIRpLJJJHNJReL1JRZWFiEVpUIdWzyfyeVziGZiyIt5kh1W49ZXJGRlrSQuiiFbyCKajpB2IBG8I9eXFUMNJVYlZYTblm4va0In74Rv2nd3CTEaBi8+9BLKgXSeBZOhOyRkKP+ELYaRsXFMTyeg5WjQlrnuly7td9bux2XqIj7Dp6UJWRUu1XIhHQPSU2+zoNE1N2uQ0mLpr5UwlCkvqO1lBmK5KGc8RQs5KkzQJTS6HOC4+RminmNxPTaGH671zZNd8V6ZTygXzc1RMtAG8CUyvT7P9/jwXA9pt5hbcPiZI2hyO8hzO5wZHsSJwePzfp86PzWf0ORPYVA1lFz90PE6eIY9oKjiCfqN0RsQAgJpxzNxXB2+qriAjD8j6xOIQGY8g5hU/bgJuRxzv0ClJKRpGhzHkbZWp4NWqyU1HOk36S1BsqCe52UdhplNMySd2triJR6pn1qtLh7UUmltR2cnXnntVZw5fRoqlQocp8dHPT3oPnQQhUKBlP3CoTAEQUB3VxcOHz0Cj8eDfC5H6jtSifDM6e/w7amT+KW/H6lkCu0dHdi3dy8S8Tg2burAU+3tOHH8OLbv2IGeg4cwPDR0ewtJk/G8ngzsdjdCd9MK4XAYly9dQiwWg7uxUdZ3OBzEip8fOYrHHl9F2jOWuT46ii1bt2LzlmchiiJZgM/nw7Evesk7K2SJ7tp164q7jOU4mE1mvPD8Tpw6eRL+Cb8sa2ltJRb79ZZ6pERcct+/bhXloinNMPB6R+D3B5BOp/HH4O+yK+12O1pbW3HxwgXyPfO+LSHJpLVGI17etQtOlwuRSIS4btmDy+C56kEwGMSSliWyvuQeqWD67oED+LL3mEwoEPBj2/Zt+LGvD9989TXWbdiAbDaLB5YuxRtv7sOe13cTa88sSiajUoFa9cijouSSGRhNJlgss0WmWDRKJp5BU3MzVBRFkrMR78ic1TmcTmQFgRCXLLFi5UoStENDV8iC/ouW1haMjY4hlUqR77a2NlD9/f3Y/9bbotfrndfhXqJteRve7+6m/gFGMd6iOtJxUAAAAABJRU5ErkJggg==\",t.alt=\"ALL\",t.style.cssText=\"width:54px;height:auto;display:block;border-radius:3px\",e.appendChild(t),document.body.appendChild(e),this.#Ws=e,setTimeout((()=>this.#Js(0)),3e4)}#Js(e){const t=this.#Ws;t&&(this.#Ws=null,setTimeout((()=>{t.style.opacity=\"0\",setTimeout((()=>t.remove()),600)}),e))}#Ks(){if(!this.#Us&&void 0!==window.GSInstantIAP){this.#Us=!0,window.addEventListener(\"iapReady\",(()=>{this.#xs=!0}));try{const e=window.GSInstantIAP.getSupportedAPIs?.();Array.isArray(e)&&e.length>0&&(this.#xs=!0)}catch{this.#xs=!1}}}#Ut(){return this._isPlayerAuthorized?Promise.resolve():Promise.reject()}#$s(){const e=this._platformSdk,t=e.getLoginStatus();return t&&!t.err&&\"LOGIN\"===t.result?e.player.getPlayerIdAsync().then((e=>{this._isPlayerAuthorized=!0,this._playerId=e,this._setPlatformStorageAvailable(!0)})).catch((()=>{this._isPlayerAuthorized=!1,this._playerApplyGuestData()})):(this._isPlayerAuthorized=!1,this._playerApplyGuestData(),Promise.resolve())}#qs(){const e=this._platformSdk.advertisement2;if(!e||\"function\"!=typeof e.initAd)return void a.ZP.warn(\"Samsung advertisement2 API not available on this Galaxy Store Client\");const t=this._options,r={},s=this.#ei(\"interstitial\");s&&(r.samsungInterstitialAdPlacementId=s);const i=this.#ei(\"rewarded\");if(i&&(r.samsungRewardedAdPlacementId=i),t.admobInterstitialAdUnitId&&(r.admobInterstitialAdUnitId=t.admobInterstitialAdUnitId),t.admobRewardedAdUnitId&&(r.admobRewardedAdUnitId=t.admobRewardedAdUnitId),t.gameTitle&&(r.gameTitle=t.gameTitle),0===Object.keys(r).length)return;const o=e.initAd(r);l(o)?a.ZP.warn(\"Samsung ad init error:\",l(o)):(this.#Vs=!0,e.addEventListener(\"AD_START\",(()=>{this.#js&&(this.#Zs?this._setRewardedState(d.b3.OPENED):this._setInterstitialState(d.WA.OPENED))})),e.addEventListener(\"AD_COMPLETE\",(()=>{this.#js&&(this.#Zs?(this._setRewardedState(d.b3.REWARDED),this._setRewardedState(d.b3.CLOSED)):this._setInterstitialState(d.WA.CLOSED),this.#js=!1,this.#Xs())})),e.addEventListener(\"AD_SKIP\",(()=>{this.#js&&(this.#Zs?this._setRewardedState(d.b3.CLOSED):this._setInterstitialState(d.WA.CLOSED),this.#js=!1,this.#Xs())})),e.addEventListener(\"AD_CLOSE\",(()=>{this.#js&&(this.#Zs?this._setRewardedState(d.b3.CLOSED):this._setInterstitialState(d.WA.CLOSED),this.#js=!1,this.#Xs())})),e.addEventListener(\"AD_LOAD_ERROR\",(()=>{this.#js&&(this._showAdFailurePopup(this.#Zs),this.#js=!1)})),e.addEventListener(\"AD_SHOW_ERROR\",(()=>{this.#js&&(this._showAdFailurePopup(this.#Zs),this.#js=!1,this.#Xs())})),e.addEventListener(\"AD_VIDEO_ERROR\",(()=>{this.#js&&(this._showAdFailurePopup(this.#Zs),this.#js=!1,this.#Xs())})))}#ei(e){const t=this._options.advertisement,r=t?.[e],s=r?.placements;if(!Array.isArray(s)||0===s.length)return null;const i=r?.placementFallback;if(i){const e=s.find((e=>e.id===i));if(e?.[n.Lb.SAMSUNG])return e[n.Lb.SAMSUNG]}const a=s.find((e=>e[n.Lb.SAMSUNG]));return a?.[n.Lb.SAMSUNG]??null}}const c=h},8200:(e,t,r)=>{r.r(t),r.d(t,{default:()=>d});var s=r(3153),i=r(3806),a=r(1147);const o=\"USD\";class n extends s.default{get platformId(){return i.Lb.STANDALONE}get sdkUrl(){return\"https://playgama.com/platform-sdk/wrap.v1.js\"}get sdkGlobalName(){return\"PLAYGAMA_WRAP\"}get isPlatformExternalLinksAllowed(){return!0}_isAdvancedBannersSupported=!0;paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();const t=e.map((e=>{const{price:t,currency:r}=this.#ti(e);return{id:e.id,price:null!==t?`${t} ${r}`:null,priceCurrencyCode:null!==t?r:null,priceValue:t}}));return Promise.resolve(t)}#ti(e){const t=this.#ri(e.amount);if(null!==t){return{price:t,currency:\"string\"==typeof e.currency&&\"\"!==e.currency?e.currency:o}}const r=(0,a.iv)(this._options.payments,i.Lb.PLAYGAMA,e.id),s=this.#ri(r?.amount);return null!==s?{price:s/10,currency:o}:{price:null,currency:o}}#ri(e){if(\"number\"==typeof e&&Number.isFinite(e))return e;if(\"string\"==typeof e&&\"\"!==e){const t=Number(e);if(Number.isFinite(t))return t}return null}}const d=n},6465:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(66),d=r(9221);const l=\"clipboard_read\";class h extends s.Z{get platformId(){return o.Lb.TELEGRAM}get platformLanguage(){return this._platformSdk?this._platformSdk.initDataUnsafe.user.language_code:super.platformLanguage}get isInterstitialSupported(){return!!this.#si}get isRewardedSupported(){return!!this.#si}get deviceType(){switch(this.#ii){case\"android\":case\"android_x\":case\"ios\":return n.me.MOBILE;case\"tdesktop\":case\"unigram\":case\"macos\":return n.me.DESKTOP;default:return super.deviceType}}get deviceOs(){switch(this.#ii){case\"android\":case\"android_x\":return n.Lh.ANDROID;case\"ios\":return n.Lh.IOS;case\"macos\":return n.Lh.MACOS;default:return super.deviceOs}}get isPlayerAuthorizationSupported(){return!0}_isPlatformStorageAvailable=!0;_isPlayerAuthorized=!0;#ii;#si;#ai={onStart:()=>this._setRewardedState(d.b3.OPENED),onSkip:()=>this._setRewardedState(d.b3.CLOSED),onReward:()=>this._setRewardedState(d.b3.REWARDED),onError:()=>this._showAdFailurePopup(!0)};#oi={onStart:()=>this._setInterstitialState(d.WA.OPENED),onSkip:()=>this._setInterstitialState(d.WA.CLOSED),onError:()=>this._showAdFailurePopup(!1)};initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"https://telegram.org/js/telegram-web-app.js\").then((()=>{this._platformSdk=window.Telegram.WebApp;const e=this._platformSdk,{initDataUnsafe:t}=e,r=t.user;this._playerId=String(r.id),this._playerName=[r.first_name,r.last_name].filter(Boolean).join(\" \"),this._playerPhotos=r.photo_url?[r.photo_url]:[],this.#ii=e.platform,this._isInitialized=!0,this._options&&this._options.adsgramBlockId?(0,i.ZT)(\"https://sad.adsgram.ai/js/sad.min.js\").then((()=>{this.#si=window.Adsgram.init({blockId:this._options.adsgramBlockId})})).finally((()=>{this._resolvePromiseDecorator(a.Mn.INITIALIZE)})):this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))),e.promise}sendMessage(e,t){return e===o.Dt.GAME_READY?(this._platformSdk.ready(),Promise.resolve()):super.sendMessage(e,t)}getDataFromStorage(e){return new Promise(((t,r)=>{if(!e||0===e.length)return void t({});this._platformSdk.CloudStorage.getItems(e,((s,i)=>{if(s)return void r(s);const a={};e.forEach((e=>{const t=i?i[e]:void 0;null!=t&&\"\"!==t&&(a[e]=t)})),t(a)}))}))}setDataToStorage(e){const t=this._platformSdk;return Promise.all(Object.keys(e).map((r=>new Promise(((s,i)=>{t.CloudStorage.setItem(r,e[r],(e=>{e?i(e):s()}))}))))).then((()=>{}))}deleteDataFromStorage(e){const t=this._platformSdk;return Promise.all(e.map((e=>new Promise(((r,s)=>{t.CloudStorage.removeItem(e,(e=>{e?s(e):r()}))}))))).then((()=>{}))}showInterstitial(){if(!this.#si)return void this._showAdFailurePopup(!1);const e=this.#si;e.addEventListener(\"onStart\",this.#oi.onStart),e.addEventListener(\"onSkip\",this.#oi.onSkip),e.addEventListener(\"onError\",this.#oi.onError),e.addEventListener(\"onBannerNotFound\",this.#oi.onError),e.show().finally((()=>{e.removeEventListener(\"onStart\",this.#oi.onStart),e.removeEventListener(\"onSkip\",this.#oi.onSkip),e.removeEventListener(\"onError\",this.#oi.onError),e.removeEventListener(\"onBannerNotFound\",this.#oi.onError)}))}showRewarded(){if(!this.#si)return void this._showAdFailurePopup(!0);const e=this.#si;e.addEventListener(\"onStart\",this.#ai.onStart),e.addEventListener(\"onSkip\",this.#ai.onSkip),e.addEventListener(\"onReward\",this.#ai.onReward),e.addEventListener(\"onError\",this.#ai.onError),e.addEventListener(\"onBannerNotFound\",this.#ai.onError),e.show().finally((()=>{e.removeEventListener(\"onStart\",this.#ai.onStart),e.removeEventListener(\"onSkip\",this.#ai.onSkip),e.removeEventListener(\"onReward\",this.#ai.onReward),e.removeEventListener(\"onError\",this.#ai.onError),e.removeEventListener(\"onBannerNotFound\",this.#ai.onError)}))}clipboardRead(){let e=this._getPromiseDecorator(l);return e||(e=this._createPromiseDecorator(l),this._platformSdk.readTextFromClipboard((e=>{e?this._resolvePromiseDecorator(l,e):this._rejectPromiseDecorator(l)}))),e.promise}}const c=h},755:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(8960),a=r(3941),o=r(8902),n=r(3806),d=r(66),l=r(9221);class h extends s.Z{get platformId(){return n.Lb.TIKTOK}get platformLanguage(){return this.#ni?this.#ni.language:super.platformLanguage}get isPlayerAuthorizationSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"login\"))}get isInterstitialSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"createInterstitialAd\"))}get isRewardedSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"createRewardedVideoAd\"))}get isAddToHomeScreenSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"addShortcut\"))}get isAddToHomeScreenRewardSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"getShortcutMissionReward\"))}get isAddToFavoritesSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"startEntranceMission\"))}get isAddToFavoritesRewardSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"getEntranceMissionReward\"))}get safeArea(){return this.#di?{top:this.#di.bottom,bottom:0,left:0,right:0}:null}get deviceType(){if(this.#ni){const{platform:e}=this.#ni;if(\"ios\"===e||\"android\"===e)return d.me.MOBILE}return super.deviceType}get deviceOs(){if(this.#ni){const{platform:e}=this.#ni;if(\"android\"===e)return d.Lh.ANDROID;if(\"ios\"===e)return d.Lh.IOS}return super.deviceOs}get isClipboardSupported(){return!1}#ni=null;#di=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(o.Mn.INITIALIZE),(0,i.X_)(\"TTMinis\").then((()=>{this._platformSdk=window.TTMinis.game;const e=this._platformSdk;this._options&&this._options.clientKey?(e.init({clientKey:this._options.clientKey}),e.canIUse(\"getStorage\")&&this._setPlatformStorageAvailable(!0),e.canIUse(\"getSystemInfoSync\")&&(this.#ni=e.getSystemInfoSync()),e.canIUse(\"getMenuButtonBoundingClientRect\")&&(this.#di=e.getMenuButtonBoundingClientRect()),e.canIUse(\"onShow\")&&e.onShow((()=>{this._setVisibilityState(n.YU.VISIBLE)})),e.canIUse(\"onHide\")&&e.onHide((()=>{this._setVisibilityState(n.YU.HIDDEN)})),this._isInitialized=!0,this._resolvePromiseDecorator(o.Mn.INITIALIZE)):this._rejectPromiseDecorator(o.Mn.INITIALIZE,o.pn.GAME_PARAMS_NOT_FOUND)}))),e.promise}sendMessage(e,t){if(e===n.Dt.GAME_READY){const e=this._platformSdk;return e.canIUse(\"setLoadingProgress\")&&e.setLoadingProgress({progress:1}),Promise.resolve()}return super.sendMessage(e)}authorizePlayer(){let e=this._getPromiseDecorator(o.Mn.AUTHORIZE_PLAYER);return e||(e=this._createPromiseDecorator(o.Mn.AUTHORIZE_PLAYER),this._platformSdk.login({success:()=>{const e=(0,a.m)();this._playerId=e.id,this._playerName=e.name,this._isPlayerAuthorized=!0,this._resolvePromiseDecorator(o.Mn.AUTHORIZE_PLAYER)},fail:e=>{this._rejectPromiseDecorator(o.Mn.AUTHORIZE_PLAYER,e)}})),e.promise}async getDataFromStorage(e){const t={};return await Promise.all(e.map((async e=>{const r=await this.#li(e).catch((()=>{}));null!=r&&\"\"!==r&&(t[e]=r)}))),t}setDataToStorage(e){return Promise.all(Object.keys(e).map((t=>this.#hi(t,e[t])))).then((()=>{}))}deleteDataFromStorage(e){return Promise.all(e.map((e=>this.#ci(e)))).then((()=>{}))}showInterstitial(e){const t=this._platformSdk.createInterstitialAd({adUnitId:e});t.onClose((()=>{this._setInterstitialState(l.WA.CLOSED)})),t.onError((()=>{this._showAdFailurePopup(!1)})),t.show().then((()=>{this._setInterstitialState(l.WA.OPENED)})).catch((()=>{this._showAdFailurePopup(!1)}))}showRewarded(e){const t=this._platformSdk.createRewardedVideoAd({adUnitId:e});t.onClose((e=>{e&&e.isEnded&&this._setRewardedState(l.b3.REWARDED),this._setRewardedState(l.b3.CLOSED)})),t.onError((()=>{this._showAdFailurePopup(!0)})),t.show().then((()=>{this._setRewardedState(l.b3.OPENED)})).catch((()=>{this._showAdFailurePopup(!0)}))}addToHomeScreen(){let e=this._getPromiseDecorator(o.Mn.ADD_TO_HOME_SCREEN);return e||(e=this._createPromiseDecorator(o.Mn.ADD_TO_HOME_SCREEN),this._platformSdk.addShortcut({success:()=>{this._resolvePromiseDecorator(o.Mn.ADD_TO_HOME_SCREEN)},fail:e=>{this._rejectPromiseDecorator(o.Mn.ADD_TO_HOME_SCREEN,e)}})),e.promise}getAddToHomeScreenReward(){return new Promise(((e,t)=>{this._platformSdk.getShortcutMissionReward({success:r=>{r?.canReceiveReward?e(void 0):t()},fail:()=>{t()}})}))}addToFavorites(){let e=this._getPromiseDecorator(o.Mn.ADD_TO_FAVORITES);return e||(e=this._createPromiseDecorator(o.Mn.ADD_TO_FAVORITES),this._platformSdk.startEntranceMission({success:()=>{this._resolvePromiseDecorator(o.Mn.ADD_TO_FAVORITES)},fail:e=>{this._rejectPromiseDecorator(o.Mn.ADD_TO_FAVORITES,e)}})),e.promise}getAddToFavoritesReward(){return new Promise(((e,t)=>{this._platformSdk.getEntranceMissionReward({success:r=>{r?.canReceiveReward?e(void 0):t()},fail:()=>{t()}})}))}#li(e){return new Promise(((t,r)=>{this._platformSdk.getStorage({key:e,success:e=>t(e.data),fail:e=>r(e)})}))}#hi(e,t){return new Promise(((r,s)=>{this._platformSdk.setStorage({key:e,data:\"object\"==typeof t?JSON.stringify(t):t,success:()=>{r()},fail:e=>{s(e)}})}))}#ci(e){return new Promise(((t,r)=>{this._platformSdk.removeStorage({key:e,success:()=>{t()},fail:e=>{r(e)}})}))}}const c=h},7226:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(66),d=r(9221);class l extends s.Z{get platformId(){return o.Lb.VK}get platformLanguage(){const e=new URL(window.location.href);if(e.searchParams.has(\"language\")){const t=e.searchParams.get(\"language\");let r=0;try{r=parseInt(t,10)}catch(e){r=0}switch(r){case 0:default:return\"ru\";case 1:return\"uk\";case 2:return\"be\";case 3:return\"en\"}}return super.platformLanguage}get platformPayload(){const e=new URL(window.location.href);return e.searchParams.has(\"hash\")?e.searchParams.get(\"hash\"):super.platformPayload}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get deviceType(){switch(this.#ii){case\"html5_ios\":case\"html5_android\":case\"html5_mobile\":return n.me.MOBILE;case\"web\":return n.me.DESKTOP;default:return super.deviceType}}get isPlayerAuthorizationSupported(){return!0}get isPlayerAuthorized(){return!0}get isInviteFriendsSupported(){return!0}get isJoinCommunitySupported(){return!0}get isShareSupported(){return!0}get isAddToHomeScreenSupported(){return\"html5_android\"===this.#ii}get isAddToFavoritesSupported(){return!0}_isBannerSupported=!0;#ii=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);if(!e){e=this._createPromiseDecorator(a.Mn.INITIALIZE);const t=new URL(window.location.href);t.searchParams.has(\"platform\")&&(this.#ii=t.searchParams.get(\"platform\")),(0,i.ZT)(\"https://unpkg.com/@vkontakte/vk-bridge/dist/browser.min.js\").then((()=>{(0,i.X_)(\"vkBridge\").then((()=>{this._platformSdk=window.vkBridge,this._platformSdk.send(\"VKWebAppInit\").then((()=>{this._platformSdk.send(\"VKWebAppGetUserInfo\").then((e=>{e&&(this._playerId=e.id,this._playerName=`${e.first_name} ${e.last_name}`,e.photo_100&&this._playerPhotos.push(e.photo_100),e.photo_200&&this._playerPhotos.push(e.photo_200),e.photo_max_orig&&this._playerPhotos.push(e.photo_max_orig))})).finally((()=>{this._isInitialized=!0,this._setPlatformStorageAvailable(!0),this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))}))}))}return e.promise}authorizePlayer(){return Promise.resolve()}async getDataFromStorage(e){const t=this._platformSdk,r=await t.send(\"VKWebAppStorageGet\",{keys:e}),s={};return r.keys.forEach((e=>{\"\"!==e.value&&(s[e.key]=e.value)})),s}setDataToStorage(e){const t=this._platformSdk;return Promise.all(Object.keys(e).map((r=>t.send(\"VKWebAppStorageSet\",{key:r,value:e[r]})))).then((()=>{}))}deleteDataFromStorage(e){const t=this._platformSdk;return Promise.all(e.map((e=>t.send(\"VKWebAppStorageSet\",{key:e,value:\"\"})))).then((()=>{}))}showBanner(e){this._platformSdk.send(\"VKWebAppShowBannerAd\",{banner_location:e}).then((e=>{e.result?this._setBannerState(d.Kk.SHOWN):this._setBannerState(d.Kk.FAILED)})).catch((()=>{this._setBannerState(d.Kk.FAILED)}))}hideBanner(){this._platformSdk.send(\"VKWebAppHideBannerAd\").then((e=>{e.result&&this._setBannerState(d.Kk.HIDDEN)}))}showInterstitial(){this._platformSdk.send(\"VKWebAppCheckNativeAds\",{ad_format:\"interstitial\"}).then((e=>{e.result&&this._setInterstitialState(d.WA.OPENED)})).finally((()=>{this._platformSdk.send(\"VKWebAppShowNativeAds\",{ad_format:\"interstitial\"}).then((e=>{e.result?this._setInterstitialState(d.WA.CLOSED):this._showAdFailurePopup(!1)})).catch((()=>{this._showAdFailurePopup(!1)}))}))}showRewarded(){this._platformSdk.send(\"VKWebAppCheckNativeAds\",{ad_format:\"reward\",use_waterfall:!0}).then((e=>{e.result&&this._setRewardedState(d.b3.OPENED)})).finally((()=>{this._platformSdk.send(\"VKWebAppShowNativeAds\",{ad_format:\"reward\",use_waterfall:!0}).then((e=>{e.result?(this._setRewardedState(d.b3.REWARDED),this._setRewardedState(d.b3.CLOSED)):this._showAdFailurePopup(!0)})).catch((()=>{this._showAdFailurePopup(!0)}))}))}inviteFriends(){return this.#ui(a.Mn.INVITE_FRIENDS,\"VKWebAppShowInviteBox\",{},\"success\")}joinCommunity(e){if(!e||!e.groupId)return Promise.reject();const{groupId:t,...r}=e;let s=t;return\"string\"==typeof s&&(s=parseInt(s,10),Number.isNaN(s))?Promise.reject():this.#ui(a.Mn.JOIN_COMMUNITY,\"VKWebAppJoinGroup\",{...r,group_id:s}).then((()=>{window.open(`https://vk.com/public${s}`)}))}share(e){const{url:t,...r}=e??{},s={...r};return t&&(s.link=t),this.#ui(a.Mn.SHARE,\"VKWebAppShare\",s,\"type\")}addToHomeScreen(){return this.#ui(a.Mn.ADD_TO_HOME_SCREEN,\"VKWebAppAddToHomeScreen\")}addToFavorites(){return this.#ui(a.Mn.ADD_TO_FAVORITES,\"VKWebAppAddToFavorites\")}clipboardWrite(e){return this.#ui(a.Mn.CLIPBOARD_WRITE,\"VKWebAppCopyText\",{text:e}).then((()=>{}))}#ui(e,t,r={},s=\"result\"){let i=this._getPromiseDecorator(e);return i||(i=this._createPromiseDecorator(e),this._platformSdk.send(t,r).then((t=>{t[s]?this._resolvePromiseDecorator(e):this._rejectPromiseDecorator(e)})).catch((t=>{this._rejectPromiseDecorator(e,t)}))),i.promise}}const h=l},7121:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(1302),a=r(8902),o=r(3806),n=r(9221),d=r(8960),l=r(1472);class h extends s.Z{get platformId(){return o.Lb.XIAOMI}get isBannerSupported(){return!0}get isInterstitialSupported(){return!0}get initialInterstitialDelay(){return 30}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}#pi=null;#mi=null;initialize(){if(this._isInitialized)return Promise.resolve();try{window.funmax&&window.funmax.loadStart&&window.funmax.loadStart()}catch(e){i.ZP.error(\"Xiaomi error:\",e)}let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options?.adSenseId?(0,d.pb)({adSenseId:this._options.adSenseId,testMode:!!this._options.testMode}).then((e=>{this.#pi=e})).finally((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)),e.promise}sendMessage(e,t){return e===o.Dt.GAME_READY?new Promise((e=>{try{window.funmax&&window.funmax.loadReady&&window.funmax.loadReady()}catch(e){i.ZP.error(\"Xiaomi error:\",e)}e(void 0)})):super.sendMessage(e,t)}showBanner(e,t){if(this.#mi)return;this.#mi=(0,l.kM)(e);const r=this.#Gt(t);this.#mi.appendChild(r),this._setBannerState(n.Kk.SHOWN)}hideBanner(){this.#mi?.remove(),this.#mi=null,this._setBannerState(n.Kk.HIDDEN)}showInterstitial(e){this.#pi?this.#pi({type:\"start\",name:e,beforeAd:()=>{this._setInterstitialState(n.WA.OPENED)},afterAd:()=>{this.interstitialState!==n.WA.FAILED&&this._setInterstitialState(n.WA.CLOSED)},adBreakDone:e=>{\"viewed\"!==e.breakStatus&&this._showAdFailurePopup(!1)}}):this._showAdFailurePopup(!1)}showRewarded(e){this.#pi?this.#pi({type:\"reward\",name:e,beforeAd:()=>{this._setRewardedState(n.b3.OPENED)},afterAd:()=>{this.rewardedState!==n.b3.FAILED&&this._setRewardedState(n.b3.CLOSED)},beforeReward:e=>{e(0)},adDismissed:()=>{},adViewed:()=>{this._setRewardedState(n.b3.REWARDED)},adBreakDone:e=>{\"frequencyCapped\"!==e.breakStatus&&\"other\"!==e.breakStatus||this._showAdFailurePopup(!0)}}):this._showAdFailurePopup(!0)}#Gt(e){const t=document.createElement(\"ins\");return t.style.display=\"block\",t.classList.add(\"adsbygoogle\"),t.setAttribute(\"data-ad-client\",this._options.adSenseId),t.setAttribute(\"data-ad-slot\",e),t.setAttribute(\"data-ad-format\",\"auto\"),t.setAttribute(\"data-container-id\",n._g),t.setAttribute(\"data-full-width-responsive\",\"true\"),this._options.testMode&&t.setAttribute(\"data-adtest\",\"on\"),t}}const c=h},3369:(e,t,r)=>{r.r(t),r.d(t,{default:()=>p});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221),d=r(7408),l=r(5334);const h=\"userData\",c=\"6129580795478709\";class u extends s.Z{get platformId(){return o.Lb.Y8}get isInterstitialSupported(){return!0}get initialInterstitialDelay(){return 180}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get isPlayerAuthorizationSupported(){return!0}get leaderboardsType(){return d.Z.IN_GAME}get isAchievementsSupported(){return!0}#pi=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options?.gameId?(0,i.ZT)(\"https://cdn.y8.com/api/sdk.js\").then((()=>{(0,i.X_)(\"ID\").then((()=>{this._platformSdk=window.ID,this._platformSdk.Event.subscribe(\"id.init\",(()=>{(0,i.pb)({adSenseId:this._options.channelId?`ca-pub-${c}`:this._options.adsenseId,channelId:this._options.channelId,hostId:`ca-host-pub-${c}`}).then((e=>{this.#pi=e})),this._platformSdk.getLoginStatus((e=>{this.#gr(e),this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))})),this._platformSdk.init({appId:this._options.gameId})}))})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)),e.promise}authorizePlayer(){return this._isPlayerAuthorized?Promise.resolve():new Promise(((e,t)=>{this._platformSdk.login((r=>{this.#gr(r),\"ok\"===r.status?e(void 0):t()}))}))}async getDataFromStorage(){return await this.#Ut(),new Promise(((e,t)=>{this._platformSdk.api(\"user_data/retrieve\",\"POST\",{key:h},(r=>{if(r.error&&\"Key not found\"!==r.error)return void t(r);let s={};try{r.jsondata&&(s=JSON.parse(r.jsondata))}catch{s={}}e(s)}))}))}async setDataToStorage(e){await this.#Ut();const t=await this.getDataFromStorage();Object.keys(e).forEach((r=>{t[r]=e[r]})),await this.#_i(t)}async deleteDataFromStorage(e){await this.#Ut();const t=await this.getDataFromStorage();e.forEach((e=>{delete t[e]})),await this.#_i(t)}showInterstitial(){this.#pi?this.#pi({type:\"start\",name:\"start-game\",beforeAd:()=>{this._setInterstitialState(n.WA.OPENED)},afterAd:()=>{const{interstitialState:e}=this;e!==n.WA.FAILED&&this._setInterstitialState(n.WA.CLOSED)},adBreakDone:e=>{\"viewed\"!==e.breakStatus&&this._showAdFailurePopup(!1)}}):this._showAdFailurePopup(!1)}showRewarded(){this.#pi?this.#pi({type:\"reward\",name:\"rewarded Ad\",beforeAd:()=>{this._setRewardedState(n.b3.OPENED)},afterAd:()=>{this.rewardedState!==n.b3.FAILED&&this._setRewardedState(n.b3.CLOSED)},beforeReward:e=>{e(0)},adDismissed:()=>{this._showAdFailurePopup(!0)},adViewed:()=>{this._setRewardedState(n.b3.REWARDED)},adBreakDone:e=>{\"frequencyCapped\"!==e.breakStatus&&\"other\"!==e.breakStatus||this._showAdFailurePopup(!0)}}):this._showAdFailurePopup(!0)}leaderboardsSetScore(e,t){if(!this._isPlayerAuthorized)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);if(!r){r=this._createPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);const s={table:e,points:t};this._platformSdk.GameAPI.Leaderboards.save(s,(({success:e,errormessage:t})=>{e?this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE):this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE,t)}))}return r.promise}leaderboardsGetEntries(e){if(!this._isPlayerAuthorized)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.LEADERBOARDS_GET_ENTRIES);if(!t){t=this._createPromiseDecorator(a.Mn.LEADERBOARDS_GET_ENTRIES);const r={table:e,mode:\"alltime\"};this._platformSdk.GameAPI.Leaderboards.listCustom(r,(({scores:e,success:t,errormessage:r})=>{if(t){const t=e.map((e=>({id:e.playerid,name:e.playername,score:e.points,rank:e.rank,photo:null})));this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_GET_ENTRIES,t)}else this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_GET_ENTRIES,r)}))}return t.promise}achievementsUnlock(e){if(!this._isPlayerAuthorized)return Promise.reject();const t=e;return t&&\"object\"==typeof t&&t.achievement&&t.achievementkey?new Promise((e=>{this._platformSdk.GameAPI.Achievements.save(t,(t=>{e(t)}))})):Promise.reject()}achievementsGetList(){return new Promise(((e,t)=>{this._platformSdk.GameAPI.Achievements.listCustom({},(r=>{if(r.success){const t=this._options.achievements;e(r.achievements.map((e=>({id:(0,l.dk)(t,o.Lb.Y8,(t=>t.achievementkey===e.achievementkey))??e.achievementkey,name:\"string\"==typeof e.achievement?e.achievement:void 0,description:\"string\"==typeof e.description?e.description:void 0,unlocked:!0===e.awarded}))))}else t(new Error(r.errorcode))}))}))}#Ut(){return this._isPlayerAuthorized?Promise.resolve():Promise.reject()}#_i(e){return new Promise(((t,r)=>{this._platformSdk.api(\"user_data/submit\",\"POST\",{key:h,value:JSON.stringify(e)},(e=>{\"ok\"===e.status?t():r(e)}))}))}#gr(e){if(\"ok\"===e.status&&e.authResponse){this._isPlayerAuthorized=!0,this._setPlatformStorageAvailable(!0);const{pid:t,locale:r,nickname:s,first_name:i,last_name:a,avatars:o}=e.authResponse.details;t&&(this._playerId=t),this._platformLanguage=r,this._playerName=[i,a].filter((e=>!!e)).join(\" \")||s||null,this._playerPhotos=[];const{thumb_url:n,medium_url:d,large_url:l}=o;n&&this._playerPhotos.push(n),d&&this._playerPhotos.push(d),l&&this._playerPhotos.push(l)}}}const p=u},1323:(e,t,r)=>{r.r(t),r.d(t,{default:()=>p});var s=r(8166),i=r(5095),a=r(1302),o=r(8960),n=r(8902),d=r(3806),l=r(66),h=r(9221),c=r(7408);class u extends s.Z{get platformId(){return d.Lb.YANDEX}get platformLanguage(){return this._platformSdk?this._platformSdk.environment.i18n.lang.toLowerCase():super.platformLanguage}get platformTld(){return this._platformSdk?this._platformSdk.environment.i18n.tld.toLowerCase():super.platformTld}get isPlatformGamesListSupported(){return!0}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get deviceType(){switch(this._platformSdk&&this._platformSdk.deviceInfo.type){case l.me.DESKTOP:return l.me.DESKTOP;case l.me.MOBILE:return l.me.MOBILE;case l.me.TABLET:return l.me.TABLET;case l.me.TV:return l.me.TV;default:return super.deviceType}}get isPlayerAuthorizationSupported(){return!0}get isAddToHomeScreenSupported(){return this.#qr}get isRateSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get leaderboardsType(){return c.Z.IN_GAME}get isPaymentsSupported(){return!0}get isRemoteConfigSupported(){return!0}_isPlatformStorageAvailable=!0;#qr=!1;#gi=null;#Si=null;#Ai=null;#ys=new i.Z((()=>Promise.resolve(this._platformSdk.serverTime())));initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(n.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(n.Mn.INITIALIZE),(0,o.ZT)(\"/sdk.js\").then((()=>{(0,o.X_)(\"YaGames\",\"init\").then((()=>{window.YaGames.init().then((e=>{this._platformSdk=e,this.#Ai=this.#Ot();const t=this._platformSdk.features.PluginEngineDataReporterAPI?.report({engineName:\"\",engineVersion:\"\",pluginName:\"playgama-bridge\",pluginVersion:\"2.2.0\"}),r=this._platformSdk.shortcut.canShowPrompt().then((e=>{this.#qr=e.canShow})),s=new Promise((e=>{setTimeout(e,1e3)})),i=Promise.race([r,s]),a=this._platformSdk.getPayments().then((e=>{this.#Si=e}));this._isBannerSupported=!0;const o=this._platformSdk.adv.getBannerAdvStatus().then((e=>{e.stickyAdvIsShowing&&this._setBannerState(h.Kk.SHOWN)}));this._platformSdk.on(\"game_api_pause\",(()=>{this._setPauseState(!0),this._setAudioState(!1)})),this._platformSdk.on(\"game_api_resume\",(()=>{this._setPauseState(!1),this._setAudioState(!0)})),Promise.all([t,i,a,o]).finally((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(n.Mn.INITIALIZE)}))}))}))}))),e.promise}sendMessage(e){switch(e){case d.Dt.GAME_READY:return this._platformSdk.features.LoadingAPI?.ready(),Promise.resolve();case d.Dt.GAMEPLAY_STARTED:case d.Dt.LEVEL_STARTED:case d.Dt.LEVEL_RESUMED:return this._platformSdk.features.GameplayAPI?.start(),Promise.resolve();case d.Dt.GAMEPLAY_STOPPED:case d.Dt.LEVEL_PAUSED:case d.Dt.LEVEL_COMPLETED:case d.Dt.LEVEL_FAILED:return this._platformSdk.features.GameplayAPI?.stop(),Promise.resolve();default:return super.sendMessage(e)}}getServerTime(){return this.#ys.getServerTime()}getGamesList(){const{GamesAPI:e}=this._platformSdk.features;return e.getAllGames().then((({games:t})=>{const r=Array.isArray(t)?t:[];return Promise.all(r.map((t=>{const r=t.appID??t.id;return void 0===r?t:e.getGameByID(r).then((({game:e,isAvailable:r})=>({...t,...e,isAvailable:r}))).catch((()=>t))})))}))}authorizePlayer(){let e=this._getPromiseDecorator(n.Mn.AUTHORIZE_PLAYER);return e||(e=this._createPromiseDecorator(n.Mn.AUTHORIZE_PLAYER),this._isPlayerAuthorized?(this.#Ai=this.#Ot(),this.#Ai.then((()=>{this._resolvePromiseDecorator(n.Mn.AUTHORIZE_PLAYER)}))):this._platformSdk.auth.openAuthDialog().then((()=>{this.#Ai=this.#Ot(),this.#Ai.then((()=>{this._resolvePromiseDecorator(n.Mn.AUTHORIZE_PLAYER)}))})).catch((e=>{this._rejectPromiseDecorator(n.Mn.AUTHORIZE_PLAYER,e)}))),e.promise}async getDataFromStorage(){return await this.#Ut(),this.#gi.getData()}async setDataToStorage(e){await this.#Ut();const t=await this.#gi.getData();Object.keys(e).forEach((r=>{t[r]=e[r]})),await this.#gi.setData(t)}async deleteDataFromStorage(e){await this.#Ut();const t=await this.#gi.getData();e.forEach((e=>{delete t[e]})),await this.#gi.setData(t)}showBanner(){this._platformSdk.adv.showBannerAdv().then((e=>{e.stickyAdvIsShowing?this._setBannerState(h.Kk.SHOWN):this._setBannerState(h.Kk.FAILED)})).catch((()=>{this._setBannerState(h.Kk.FAILED)}))}hideBanner(){this._platformSdk.adv.hideBannerAdv().then((e=>{e.stickyAdvIsShowing||this._setBannerState(h.Kk.HIDDEN)}))}showInterstitial(){this._platformSdk.adv.showFullscreenAdv({callbacks:{onOpen:()=>{this._setInterstitialState(h.WA.OPENED)},onClose:e=>{e?this._setInterstitialState(h.WA.CLOSED):this._showAdFailurePopup(!1)},onError:e=>{a.ZP.error(\"Yandex interstitial error:\",e)}}})}showRewarded(){this._platformSdk.adv.showRewardedVideo({callbacks:{onOpen:()=>{this._setRewardedState(h.b3.OPENED)},onRewarded:()=>{this._setRewardedState(h.b3.REWARDED)},onClose:()=>{this._setRewardedState(h.b3.CLOSED)},onError:()=>{this._showAdFailurePopup(!0)}}})}checkAdBlock(){return new Promise((e=>{e(!1)}))}addToHomeScreen(){let e=this._getPromiseDecorator(n.Mn.ADD_TO_HOME_SCREEN);return e||(e=this._createPromiseDecorator(n.Mn.ADD_TO_HOME_SCREEN),this._platformSdk.shortcut.showPrompt().then((e=>{\"accepted\"!==e.outcome?this._rejectPromiseDecorator(n.Mn.ADD_TO_HOME_SCREEN):this._resolvePromiseDecorator(n.Mn.ADD_TO_HOME_SCREEN)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.ADD_TO_HOME_SCREEN,e)}))),e.promise}rate(){let e=this._getPromiseDecorator(n.Mn.RATE);return e||(e=this._createPromiseDecorator(n.Mn.RATE),this._platformSdk.feedback.canReview().then((e=>{e.value?this._platformSdk.feedback.requestReview().then((({feedbackSent:e})=>{e?this._resolvePromiseDecorator(n.Mn.RATE):this._rejectPromiseDecorator(n.Mn.RATE)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.RATE,e)})):this._rejectPromiseDecorator(n.Mn.RATE,e.reason)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.RATE,e)}))),e.promise}leaderboardsSetScore(e,t){if(!this._isPlayerAuthorized)return Promise.reject();let r=this._getPromiseDecorator(n.Mn.LEADERBOARDS_SET_SCORE);return r||(r=this._createPromiseDecorator(n.Mn.LEADERBOARDS_SET_SCORE),this._platformSdk.leaderboards.setScore(e,t).then((()=>{this._resolvePromiseDecorator(n.Mn.LEADERBOARDS_SET_SCORE)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.LEADERBOARDS_SET_SCORE,e)}))),r.promise}leaderboardsGetEntries(e){let t=this._getPromiseDecorator(n.Mn.LEADERBOARDS_GET_ENTRIES);if(!t){t=this._createPromiseDecorator(n.Mn.LEADERBOARDS_GET_ENTRIES);const r={quantityTop:20};this._isPlayerAuthorized&&(r.includeUser=!0,r.quantityAround=3),this._platformSdk.leaderboards.getEntries(e,r).then((e=>{let t;t=e&&e.entries.length>0?e.entries.map((e=>({id:e.player.uniqueID,name:e.player.publicName,score:e.score,rank:e.rank,photo:e.player.getAvatarSrc(\"large\")}))):[],this._resolvePromiseDecorator(n.Mn.LEADERBOARDS_GET_ENTRIES,t)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.LEADERBOARDS_GET_ENTRIES,e)}))}return t.promise}paymentsPurchase(e){if(!this.#Si)return Promise.reject();let t=this._paymentsGetProductPlatformData(e);t||(t={id:e});let r=this._getPromiseDecorator(n.Mn.PURCHASE);return r||(r=this._createPromiseDecorator(n.Mn.PURCHASE),this.#Si.purchase(t).then((t=>{const r={id:e,...t.purchaseData};delete r.productID,this._paymentsPurchases.push(r),this._resolvePromiseDecorator(n.Mn.PURCHASE,r)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.PURCHASE,e)}))),r.promise}paymentsConsumePurchase(e){if(!this.#Si)return Promise.reject();const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(n.Mn.CONSUME_PURCHASE);return r||(r=this._createPromiseDecorator(n.Mn.CONSUME_PURCHASE),this.#Si.consumePurchase(this._paymentsPurchases[t].purchaseToken).then((()=>{this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(n.Mn.CONSUME_PURCHASE,{id:e})})).catch((e=>{this._rejectPromiseDecorator(n.Mn.CONSUME_PURCHASE,e)}))),r.promise}paymentsGetCatalog(){if(!this.#Si)return Promise.reject();const e=this._paymentsGetProductsPlatformData();let t=this._getPromiseDecorator(n.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(n.Mn.GET_CATALOG),this.#Si.getCatalog().then((t=>{const r=e.map((e=>{const r=t.find((t=>t.id===e.id));return{id:e.id,title:r.title,description:r.description,imageURI:r.imageURI,price:r.price,priceCurrencyCode:r.priceCurrencyCode,priceValue:r.priceValue,priceCurrencyImage:r.getPriceCurrencyImage?.(\"medium\")}}));this._resolvePromiseDecorator(n.Mn.GET_CATALOG,r)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.GET_CATALOG,e)}))),t.promise}paymentsGetPurchases(){if(!this.#Si)return Promise.reject();let e=this._getPromiseDecorator(n.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(n.Mn.GET_PURCHASES),this.#Si.getPurchases().then((e=>{const t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.map((e=>{const r={id:t.find((t=>t.id===e.productID)).id,...e.purchaseData};return delete r.productID,r})),this._resolvePromiseDecorator(n.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.GET_PURCHASES,e)}))),e.promise}getRemoteConfig(e){if(!this._platformSdk)return Promise.reject();const t={clientFeatures:[]};e&&Object.keys(e).length>0&&(t.clientFeatures=Object.entries(e).map((([e,t])=>({name:e,value:String(t)}))));let r=this._getPromiseDecorator(n.Mn.GET_REMOTE_CONFIG);return r||(r=this._createPromiseDecorator(n.Mn.GET_REMOTE_CONFIG),this._platformSdk.getFlags(t).then((e=>{this._resolvePromiseDecorator(n.Mn.GET_REMOTE_CONFIG,e)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.GET_REMOTE_CONFIG,e)}))),r.promise}clipboardWrite(e){let t=this._getPromiseDecorator(n.Mn.CLIPBOARD_WRITE);return t||(t=this._createPromiseDecorator(n.Mn.CLIPBOARD_WRITE),this._platformSdk.clipboard.writeText(e).then((()=>{this._resolvePromiseDecorator(n.Mn.CLIPBOARD_WRITE,!0)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.CLIPBOARD_WRITE,e)}))),t.promise.then((()=>{}))}#Ut(){return this.#Ai?this.#Ai.then((()=>{if(!this._isPlayerAuthorized)return Promise.reject()})):Promise.reject()}#Ot(){return new Promise((e=>{let t=!1;this._options&&this._options.useSignedData&&(t=this._options.useSignedData),this._platformSdk.getPlayer({signed:t}).then((e=>{this._playerId=e.getUniqueID(),this._isPlayerAuthorized=e.isAuthorized(),this._setPlatformStorageAvailable(this._isPlayerAuthorized);const r=e.getName();\"\"!==r&&(this._playerName=r),this._playerPhotos=[];const s=e.getPhoto(\"small\"),i=e.getPhoto(\"medium\"),a=e.getPhoto(\"large\");s&&this._playerPhotos.push(s),i&&this._playerPhotos.push(i),a&&this._playerPhotos.push(a),this._playerExtra={payingStatus:e.getPayingStatus()},t&&(this._playerExtra.signature=e.signature),this.#gi=e})).finally((()=>{e()}))}))}}const p=u},8347:(e,t,r)=>{r.r(t),r.d(t,{default:()=>u});var s=r(8166),i=r(5555),a=r(8960),o=r(8902),n=r(3806),d=r(66),l=r(9221),h=r(7408);class c extends s.Z{get platformId(){return n.Lb.YOUTUBE}get isPlatformExternalCallsSupported(){return!1}get platformLanguage(){return this.#Bs?this.#Bs:super.platformLanguage}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get isClipboardSupported(){return!1}get leaderboardsType(){return h.Z.NATIVE}#Bs;#Ei=null;#Pi=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(o.Mn.INITIALIZE),this.deviceType===d.me.DESKTOP&&(this.#Ei=this.#fi(),this.#Pi=this.#Ii()),(0,a.X_)(\"ytgame\").then((()=>{this._platformSdk=window.ytgame;const e=this._platformSdk;this._setPlatformStorageAvailable(!0);const t=e.system.getLanguage().then((e=>{this.#Bs=e.length>2?e.slice(0,2):e}));e.system.onAudioEnabledChange((e=>{this._setAudioState(e)})),this.#yi(),document.addEventListener(\"visibilitychange\",(()=>{document.visibilityState===n.YU.VISIBLE&&this.#yi()})),window.addEventListener(\"pageshow\",(()=>{this.#yi()})),e.system.onPause((()=>{this._setPauseState(!0),this.#Di()})),e.system.onResume((()=>{this._setPauseState(!1),i.Z.hide(),this.#yi()})),Promise.all([t]).finally((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(o.Mn.INITIALIZE),e.game.firstFrameReady()}))}))),e.promise}getDataFromStorage(){return this._platformSdk.game.loadData().then((e=>{if(\"string\"==typeof e&&\"\"!==e)try{return JSON.parse(e)}catch{return{}}return{}}))}async setDataToStorage(e){const t=await this.getDataFromStorage();Object.keys(e).forEach((r=>{t[r]=e[r]})),await this._platformSdk.game.saveData(JSON.stringify(t))}async deleteDataFromStorage(e){const t=await this.getDataFromStorage();e.forEach((e=>{delete t[e]})),await this._platformSdk.game.saveData(JSON.stringify(t))}sendMessage(e,t){return e===n.Dt.GAME_READY?(this._platformSdk.game.gameReady(),this.#Ei&&(this.#Ei.remove(),this.#Ei=null),this.#Pi&&(this.#Pi.remove(),this.#Pi=null),Promise.resolve()):super.sendMessage(e)}showInterstitial(){this._setInterstitialState(l.WA.OPENED),this._platformSdk.ads.requestInterstitialAd().then((()=>{this._setInterstitialState(l.WA.CLOSED)})).catch((()=>{this._showAdFailurePopup(!1)}))}showRewarded(e){this._setRewardedState(l.b3.OPENED),this._platformSdk.ads.requestRewardedAd(e).then((e=>{e&&this._setRewardedState(l.b3.REWARDED),this._setRewardedState(l.b3.CLOSED)})).catch((()=>{this._showAdFailurePopup(!0)}))}leaderboardsSetScore(e,t,r){if(!r)return Promise.reject();let s=this._getPromiseDecorator(o.Mn.LEADERBOARDS_SET_SCORE);if(!s){s=this._createPromiseDecorator(o.Mn.LEADERBOARDS_SET_SCORE);const e=\"string\"==typeof t?parseInt(t,10):t;this._platformSdk.engagement.sendScore({value:e}).then((()=>{this._resolvePromiseDecorator(o.Mn.LEADERBOARDS_SET_SCORE)})).catch((e=>{this._rejectPromiseDecorator(o.Mn.LEADERBOARDS_SET_SCORE,e)}))}return s.promise}#yi(){this._setAudioState(this._platformSdk.system.isAudioEnabled())}#Di(){const e=this._pauseStateAggregator?.getState(\"interstitial\"),t=this._pauseStateAggregator?.getState(\"rewarded\");e||t||i.Z.show()}#fi(){if(!document.getElementById(\"bridge-youtube-subscribe-styles\")){const e=document.createElement(\"style\");e.id=\"bridge-youtube-subscribe-styles\",e.textContent=\"\\n #bridge-youtube-subscribe {\\n position: fixed;\\n inset: 0;\\n pointer-events: none;\\n transform-origin: 168px calc(100% - 56px);\\n z-index: 9999999;\\n animation: bridge-yt-press 650ms ease-in-out 1270ms forwards;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-button {\\n position: fixed;\\n bottom: -24px;\\n left: 24px;\\n width: 220.8px;\\n height: 64px;\\n border-radius: 107.8px;\\n padding: 11.2px 25.6px 12.8px 25.6px;\\n background-color: #9747FF;\\n box-shadow: inset 0 0 17.06px 0 rgba(151, 71, 255, 0.7), inset 0 0 16px 0 rgba(255, 255, 255, 0.7);\\n box-sizing: border-box;\\n border: none;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n opacity: 0;\\n overflow: hidden;\\n white-space: nowrap;\\n pointer-events: none;\\n animation:\\n bridge-yt-rise-button 285ms ease-out 590ms forwards,\\n bridge-yt-button-shrink 295ms cubic-bezier(0.4, 0, 0.2, 1) 2100ms forwards;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-title {\\n width: 168.8px;\\n height: 28.8px;\\n display: block;\\n flex-shrink: 0;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-ball {\\n position: fixed;\\n bottom: -88px;\\n left: 248px;\\n width: 64px;\\n height: 64px;\\n border-radius: 50%;\\n background-color: #9747FF;\\n box-shadow: inset 0 0 17.06px 0 rgba(151, 71, 255, 0.7), inset 0 0 16px 0 rgba(255, 255, 255, 0.7);\\n box-sizing: border-box;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n opacity: 0;\\n animation:\\n bridge-yt-rise-ball 285ms ease-out 630ms forwards,\\n bridge-yt-ball-roll 470ms cubic-bezier(0.34, 1.2, 0.5, 1) 2100ms forwards;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-ball svg {\\n position: absolute;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-arrow {\\n width: 25.6px;\\n height: 25.6px;\\n opacity: 1;\\n animation: bridge-yt-arrow-fade-out 235ms ease 2220ms forwards;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-hand {\\n width: 28.8px;\\n height: 28.8px;\\n opacity: 0;\\n animation: bridge-yt-hand-fade-in 235ms ease 2335ms forwards;\\n }\\n\\n @keyframes bridge-yt-rise-button {\\n 0% { bottom: -24px; opacity: 0; }\\n 40% { bottom: 25.6px; opacity: 1; }\\n 48% { bottom: 33.6px; }\\n 60% { bottom: 32px; }\\n 70% { bottom: 30.4px; }\\n 79% { bottom: 28.8px; }\\n 88% { bottom: 27.2px; }\\n 95% { bottom: 25.6px; }\\n 100% { bottom: 24px; opacity: 1; }\\n }\\n @keyframes bridge-yt-rise-ball {\\n 0% { bottom: -88px; opacity: 0; }\\n 40% { bottom: 25.6px; opacity: 1; }\\n 48% { bottom: 33.6px; }\\n 60% { bottom: 32px; }\\n 70% { bottom: 30.4px; }\\n 79% { bottom: 28.8px; }\\n 88% { bottom: 27.2px; }\\n 95% { bottom: 25.6px; }\\n 100% { bottom: 24px; opacity: 1; }\\n }\\n @keyframes bridge-yt-press {\\n 0% { transform: scale(1); }\\n 25% { transform: scale(0.94); }\\n 40% { transform: scale(0.9); }\\n 65% { transform: scale(1.01); }\\n 82% { transform: scale(0.995); }\\n 100% { transform: scale(1); }\\n }\\n @keyframes bridge-yt-button-shrink {\\n 0% { width: 220.8px; opacity: 1; }\\n 100% { width: 64px; opacity: 0; }\\n }\\n @keyframes bridge-yt-ball-roll {\\n 0% { left: 248px; transform: rotate(0deg); }\\n 100% { left: 24px; transform: rotate(-360deg); }\\n }\\n @keyframes bridge-yt-arrow-fade-out {\\n to { opacity: 0; }\\n }\\n @keyframes bridge-yt-hand-fade-in {\\n to { opacity: 1; }\\n }\\n \",document.head.appendChild(e)}const e=document.createElement(\"div\");return e.id=\"bridge-youtube-subscribe\",e.innerHTML='\\n
\\n \\n \\n \\n
\\n
\\n \\n \\n \\n \\n \\n \\n
\\n ',document.body.appendChild(e),e}#Ii(){const e=(this._options.videoPreviews??[]).filter((e=>Boolean(e?.image&&e?.videoId)));if(0===e.length)return null;const{image:t,videoId:r}=e[Math.floor(Math.random()*e.length)];if(!document.getElementById(\"bridge-youtube-video-preview-styles\")){const e=document.createElement(\"style\");e.id=\"bridge-youtube-video-preview-styles\",e.textContent=\"\\n #bridge-youtube-video-preview {\\n position: fixed;\\n bottom: -24px;\\n right: 24px;\\n width: min(256px, 40vw);\\n border-radius: 16px;\\n overflow: hidden;\\n background-color: #000;\\n box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.4);\\n cursor: pointer;\\n opacity: 0;\\n z-index: 9999999;\\n animation: bridge-yt-preview-rise 285ms ease-out 590ms forwards;\\n }\\n\\n #bridge-youtube-video-preview .bridge-yt-preview-image {\\n display: block;\\n width: 100%;\\n aspect-ratio: 16 / 9;\\n object-fit: cover;\\n user-select: none;\\n -webkit-user-drag: none;\\n }\\n\\n #bridge-youtube-video-preview .bridge-yt-preview-play {\\n position: absolute;\\n top: 50%;\\n left: 50%;\\n width: 48px;\\n height: 34px;\\n transform: translate(-50%, -50%);\\n pointer-events: none;\\n }\\n\\n @keyframes bridge-yt-preview-rise {\\n 0% { bottom: -24px; opacity: 0; }\\n 40% { bottom: 25.6px; opacity: 1; }\\n 48% { bottom: 33.6px; }\\n 60% { bottom: 32px; }\\n 70% { bottom: 30.4px; }\\n 79% { bottom: 28.8px; }\\n 88% { bottom: 27.2px; }\\n 95% { bottom: 25.6px; }\\n 100% { bottom: 24px; opacity: 1; }\\n }\\n \",document.head.appendChild(e)}const s=document.createElement(\"div\");s.id=\"bridge-youtube-video-preview\";const i=document.createElement(\"img\");return i.className=\"bridge-yt-preview-image\",i.src=t,i.alt=\"\",i.draggable=!1,s.appendChild(i),s.insertAdjacentHTML(\"beforeend\",'\\n \\n \\n \\n \\n '),s.addEventListener(\"click\",(()=>{window.ytgame?.engagement.openYTContent({id:r}).catch((()=>{}))})),document.body.appendChild(s),s}}const u=c},8960:(e,t,r)=>{r.d(t,{pb:()=>i,ZT:()=>s,CS:()=>o,RH:()=>p,ZP:()=>_,D1:()=>S.D,dY:()=>m,n_:()=>d,eE:()=>l,Tg:()=>h,ju:()=>u,kh:()=>g,X_:()=>c});const s=function(e,t={}){return new Promise(((r,s)=>{const i=document.createElement(\"script\");i.src=e;for(let e=0;es(new Error(`Failed to load: ${e}`)))),document.head.appendChild(i)}))},i=({adSenseId:e,channelId:t,hostId:r,interstitialPlacementId:s,rewardedPlacementId:i,adFrequencyHint:a=\"180s\",testMode:o=!1},n={})=>new Promise(((d,l)=>{const h=document.createElement(\"script\");h.src=\"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\",h.setAttribute(\"data-ad-client\",e),t?h.setAttribute(\"data-ad-channel\",t):r&&h.setAttribute(\"data-ad-host\",r),s&&h.setAttribute(\"data-admob-interstitial-slot\",s),i&&h.setAttribute(\"data-admob-rewarded-slot\",i),o&&h.setAttribute(\"data-adbreak-test\",\"on\"),h.setAttribute(\"data-ad-frequency-hint\",a),h.setAttribute(\"crossorigin\",\"anonymous\"),h.addEventListener(\"load\",(()=>{const e=window.adsbygoogle??[];window.adsbygoogle=e,e.push({preloadAdBreaks:\"on\",sound:\"on\",onReady:()=>{},...n}),d((t=>e.push(t)))})),h.addEventListener(\"error\",(()=>{l(new Error(\"adsbygoogle script failed to load\"))})),document.head.appendChild(h)})),a=\"bridge-browser-defaults-protection\";function o(){if(document.getElementById(a))return;const e=document.createElement(\"style\");e.id=a,e.textContent=\"\\n html, body {\\n -webkit-user-select: none;\\n user-select: none;\\n -webkit-touch-callout: none;\\n overscroll-behavior: contain;\\n }\\n input, textarea, [contenteditable] {\\n -webkit-user-select: text;\\n user-select: text;\\n -webkit-touch-callout: default;\\n }\\n \",document.head.appendChild(e),document.addEventListener(\"contextmenu\",(e=>e.preventDefault()))}const n=[\"post\",\"Message\"].join(\"\");function d(e,t=\"*\"){window.parent&&window.parent[n](e,t)}function l(e){window.system&&window.system[n](e)}function h(e){window.chrome&&window.chrome.webview&&\"function\"==typeof window.chrome.webview.postMessage&&window.chrome.webview[n](e)}const c=function(...e){return e.length<=0?Promise.resolve():new Promise((t=>{const r=setInterval((()=>{let s=window;for(let t=0;tt.indexOf(\".\")?parseFloat(t.replace(/\\./g,\"\").replace(\",\",\".\")):t.includes(\",\")&&-1!==t.lastIndexOf(\",\")&&t.lastIndexOf(\",\")===t.length-4?parseInt(t.replace(/,/,\"\"),10):t.includes(\",\")&&-1!==t.lastIndexOf(\",\")&&t.lastIndexOf(\",\")!==t.length-3?parseFloat(t.replace(\",\",\".\")):t.includes(\".\")&&-1!==t.lastIndexOf(\".\")&&t.lastIndexOf(\".\")===t.length-4?parseInt(t.replace(/\\./,\"\"),10):t.includes(\".\")?parseFloat(t):parseInt(t,10)}function g(e){return m(e)?Promise.resolve(e):fetch(e).then((e=>e.blob())).then((e=>new Promise(((t,r)=>{const s=new FileReader;s.onloadend=()=>t(s.result),s.onerror=()=>r(s.error),s.readAsDataURL(e)}))))}var S=r(9146)},9146:(e,t,r)=>{function s(){const e=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";return`${Array.from({length:8},(()=>e.charAt(Math.floor(62*Math.random())))).join(\"\")}${Date.now().toString(36)}`}r.d(t,{D:()=>s})}},t={};function r(s){var i=t[s];if(void 0!==i)return i.exports;var a=t[s]={exports:{}};return e[s](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},(()=>{var e=r(8902),t=r(3806),s=r(66),i=r(9221),a=r(1558),o=r(6039);const n=\"loading-overlay\",d=\"logo\",l=\"fillRect\",h=\"gradientMover\",c=\"loading-hint\",u={viewBox:\"0 0 633 819\",paths:[\"M632 1V632H1V1H632ZM350 125.586V507.414L380.586 538H546V451H478.599L478.308 451.278L454.598 474H443.406L450.944 452.328L451 452.169V187.459L457.369 182H546V95H380.586L350 125.586ZM283 125.586L252.414 95H87V182H175.631L182 187.459V445.54L175.631 451H87V538H252.414L283 507.414V125.586Z\",\"M633 687V660H548V687H560V791H548V819H633V792H601L592 801H587L590 792V752H627V725H590V687H633Z\",\"M533 718V675L518 660H450L435 675V802L450 819H518L533 804V734H482V761H503V788L499 792H476L467 801H462L465 792V691L469 687H499L503 691V718H533Z\",\"M402 660H310V687H322V792H310V819H402L417 804V675L402 660ZM387 788L383 792H363L354 801H349L352 792V687H383L387 691V788Z\",\"M295 687V660H239V687H251V792H239V819H295V792H283V687H295Z\",\"M215 791L200 760H209L224 745V675L209 660H121V687H132V792H121V819H162V760H166L193 819H227V791H215ZM194 729L190 733H173L164 742H159L162 733V687H190L194 691V729Z\",\"M106 724V675L91 660H0V687H12V792H0V819H91L106 804V749L89 744V728L106 724ZM73 788L69 792H53L44 801H39L42 792V752H73V788ZM73 725H53L44 734H39L42 725V687H69L73 691V725Z\"],fillColor:\"#aa76ff\",strokeColor:\"#aa76ff\",gradientStops:[{offset:\"0.235577\",color:\"#aa76ff\"},{offset:\"0.240685\",color:\"white\"},{offset:\"0.659749\",color:\"#aa76ff\"}],gradientWidthMultiplier:4},p={viewBox:\"0 0 633 986\",paths:[\"M224.044 880.996V933.01H247.059V880.996H269.036V954.011C269.036 972.997 256.033 986 234.056 986H202.067V967.991H231.064C242.053 967.991 247.059 960.97 247.059 952.973V949.981H202.067V880.996H224.044Z\",{d:\"M355.051 880.996V952.912C355.051 971.959 340.094 985.939 320.071 985.939H289.059V966.953H319.033C328.007 966.953 333.013 960.97 333.013 952.973V949.981H317.019C297.972 949.981 281.001 935.024 281.001 915C281.001 896.014 298.033 880.996 317.019 880.996H355.051ZM320.01 897.968C310.975 897.968 304.992 904.927 304.992 914.939C304.992 925.928 311.036 932.949 320.01 932.949H333.013V897.968H320.01Z\",fillRule:\"evenodd\"},{d:\"M34.0643 880.996C53.05 880.996 71.0593 895.953 71.0593 915C71.0593 934.963 53.05 949.981 34.0643 949.981H22.0378V970.982H0.0608089V880.996H34.0643ZM22.0378 897.968V932.949H32.0498C41.0238 932.949 47.0672 925.989 47.0672 914.939C47.0672 904.989 41.0238 897.968 32.0498 897.968H22.0378Z\",fillRule:\"evenodd\"},\"M105.062 870.007V949.981H81.0707V870.007H105.062Z\",{d:\"M187.049 880.996V949.981H152.069C133.022 949.981 116.051 935.024 116.051 915C116.051 896.014 133.083 880.996 152.069 880.996H187.049ZM154.999 897.968C145.964 897.968 139.981 904.927 139.981 914.939C139.981 925.928 146.025 932.949 154.999 932.949H165.011V897.968H154.999Z\",fillRule:\"evenodd\"},{d:\"M436 880.996V949.981H401.02C381.973 949.981 365.002 935.024 365.002 915C365.002 896.014 382.034 880.996 401.02 880.996H436ZM404.011 897.968C394.976 897.968 388.994 904.927 388.994 914.939C388.994 925.928 395.037 932.949 404.011 932.949H414.023V897.968H404.011Z\",fillRule:\"evenodd\"},\"M521.039 880.996C538.987 880.996 551.99 894 551.99 912.009V949.981H530.013V908.957C530.013 903.951 525.984 897.968 520.001 897.968H512.004V949.981H490.027V897.968H472.018V949.981H450.041V880.996H521.039Z\",{d:\"M633 880.996V949.981H598.019C579.034 949.981 563.039 935.024 563.039 915C563.039 896.014 579.034 880.996 598.019 880.996H633ZM603.025 897.968C593.014 897.968 587.031 904.927 587.031 914.939C587.031 925.928 593.014 932.949 603.025 932.949H611.023V897.968H603.025Z\",fillRule:\"evenodd\"},\"M522.993 663.967L538.01 678.986V732.037H504.068V695.041L500.038 691.012H482.029L478.001 695.041V829.044L475.009 838.018H480.015L488.989 829.044H499.978L504.007 825.015V775.015H491.004V748.032H538.01V841.009L522.993 856.027H459.015L443.997 838.994V678.986L459.015 663.967H522.993Z\",\"M633 664.029V691.073H601.011V739.057H627.017V766.041H601.011V829.044L598.019 838.018H603.025L611.999 829.044H633V856.027H553.028V828.006H567.007V691.012H553.028V664.029H633Z\",{d:\"M89.0069 664.029L104.025 679.046V738.02L87.0533 741.927V757.922L104.025 762.928V840.948L89.0069 855.966H0V828.983H13.9801V691.012H0V664.029H89.0069ZM47.983 765.98V828.983L44.992 837.956H49.998L59.0329 828.983H65.9919L70.0214 824.953H69.96V765.98H47.983ZM47.983 691.012V738.997L44.992 747.971H49.998L59.0329 738.997H70.0214V695.041L65.9919 691.012H47.983Z\",fillRule:\"evenodd\"},{d:\"M210.003 664.029L225.02 679.046V759.02L210.003 774.039L217.023 828.006V827.945H227.951V855.966H184.973L176.976 773.977H166.964V855.966H118.981V828.983H132.961V691.012H118.981V664.029H210.003ZM167.025 691.012V746.994L164.034 755.968H169.04L178.014 746.994H186.988L191.017 742.965H191.078V695.041L187.049 691.012H167.025Z\",fillRule:\"evenodd\"},\"M302.001 664.029V691.012H288.021V828.983H302.001V855.966H239.977V828.983H253.957V691.012H239.977V664.029H302.001Z\",{d:\"M411.032 663.967L426.05 678.924V840.887L411.032 855.905H317.019V828.921H330.999V690.951H317.019V663.967H411.032ZM365.002 691.012V828.983L362.011 837.956H367.017L376.052 828.983H388.078L392.046 824.953H391.985V695.041L388.017 691.012H365.002Z\",fillRule:\"evenodd\"},{d:\"M633 0V635.946H0.0608089V0H633ZM88.0298 92.0008V177.042H176.06L183.02 183.024V446.023L176.06 452.006H88.0298V536.986H252.003L252.004 536.986H252.065L282.039 507.011V121.976L252.065 92.0008H88.0298ZM382.034 92.0008L351.999 122.037V507.011L382.034 536.986H546.007L546.008 452.006H480.015L456.024 475.021H443.021L451.018 452.006V183.024L458.038 177.042H546.008V92.0616L546.007 92.0008H382.034Z\",fillRule:\"evenodd\"}],fillColor:\"#aa76ff\",strokeColor:\"#aa76ff\",gradientStops:[{offset:\"0.235577\",color:\"#aa76ff\"},{offset:\"0.240685\",color:\"white\"},{offset:\"0.659749\",color:\"#aa76ff\"}],gradientWidthMultiplier:4},m=[\"Loading GPU\",\"Parsing AST\",\"Linking libs\",\"Baking mesh\",\"Warming JIT\",\"Tracing rays\",\"Packing data\",\"Flushing GPU\",\"Loading WASM\",\"Alloc memory\",\"Init shaders\",\"Optimize FPS\",\"Sync textures\",\"Build navmesh\",\"Compile code\",\"Load physics\",\"Stream assets\",\"Cache buffers\",\"Map controls\",\"Decode audio\",\"Init network\",\"Setup scene\"];const _=class{#Ti=null;#wi=!1;#Ri=null;setHideGate(e){this.#Ri=e}show({showFullLogo:e=!1,showLoadingText:t=!1}={}){this.#it();const r=this.#vi(),s=e?p:u;r.appendChild(this.#bi(s)),t&&this.#Ci(r)}setProgress(e,t=!1){if(this.#wi)return;if(t&&null!==this.#Ti)return;const r=document.getElementById(l),s=document.getElementById(h),i=document.getElementById(d),a=document.getElementById(n);if(!(r&&s&&i&&a))return;this.#Ti=e;const o=Math.max(0,Math.min(100,e)),c=100-o;if(r.style.transform=`translateY(${c}%)`,100===o){this.#wi=!0;const e=()=>{setTimeout((()=>{r.style.display=\"none\",s.style.display=\"block\",s.classList.add(\"gradient-mover\")}),400),setTimeout((()=>i.classList.add(\"logo-fade-out\")),900),setTimeout((()=>a.remove()),1400)};if(this.#Ri){const t=new Promise((e=>{setTimeout(e,3e3)}));Promise.race([this.#Ri.catch((()=>{})),t]).then(e)}else e()}else s.classList.remove(\"gradient-mover\")}#it(){const e=document.createElement(\"style\");e.textContent=`\\n .fullscreen {\\n background: #242424;\\n width: 100vw;\\n height: 100vh;\\n position: absolute;\\n top: 0px;\\n left: 0px;\\n }\\n\\n #${n} {\\n font-size: 20px;\\n z-index: 9999999;\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n }\\n\\n #${d} {\\n width: 10%;\\n max-width: 300px;\\n min-width: 120px;\\n overflow: visible;\\n }\\n\\n #${c} {\\n width: 8%;\\n max-width: 240px;\\n min-width: 96px;\\n margin-top: clamp(17px, 1.7vw, 33px);\\n text-align: center;\\n color: #aa76ff;\\n font-size: clamp(11px, 1.3vw, 16px);\\n font-family: -apple-system, BlinkMacSystemFont, sans-serif;\\n letter-spacing: 0.04em;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n transition: opacity 0.4s ease;\\n }\\n\\n .fill-rect {\\n transform: translateY(100%);\\n transition: transform 0.3s ease-out;\\n }\\n\\n #${h} {\\n display: none;\\n }\\n\\n .gradient-mover {\\n animation: moveGradient 0.4s linear;\\n }\\n\\n @keyframes moveGradient {\\n 0% { transform: translateX(0); }\\n 100% { transform: translateX(-250%); }\\n }\\n\\n .logo-fade-out {\\n animation: logoFadeOut 1s linear;\\n }\\n\\n .logo-fade-out path {\\n fill: white;\\n stroke: white;\\n }\\n\\n @keyframes logoFadeOut {\\n 0% { opacity: 1; }\\n 50% { opacity: 0; }\\n 100% { opacity: 0; }\\n }\\n `,document.head.appendChild(e)}#vi(){const e=document.createElement(\"div\");return e.id=n,e.className=\"fullscreen\",document.body.appendChild(e),e}#bi(e){const t=e.gradientWidthMultiplier??4,[,,r,s]=e.viewBox.split(/[ ,]+/),i=Number(r),a=Number(s),o=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");o.setAttribute(\"id\",d),o.setAttribute(\"viewBox\",e.viewBox),o.setAttribute(\"fill\",\"none\"),o.setAttribute(\"xmlns\",\"http://www.w3.org/2000/svg\");const n=document.createElementNS(o.namespaceURI,\"defs\"),c=document.createElementNS(o.namespaceURI,\"mask\");c.setAttribute(\"id\",\"logo-mask\");const u=document.createElementNS(o.namespaceURI,\"rect\");u.setAttribute(\"x\",\"0\"),u.setAttribute(\"y\",\"0\"),u.setAttribute(\"width\",\"100%\"),u.setAttribute(\"height\",\"100%\"),u.setAttribute(\"fill\",\"black\"),c.appendChild(u),e.paths.forEach((e=>{const t=document.createElementNS(o.namespaceURI,\"path\");t.setAttribute(\"d\",\"string\"==typeof e?e:e.d),t.setAttribute(\"fill\",\"object\"==typeof e&&e.maskFill?e.maskFill:\"white\"),\"object\"==typeof e&&e.fillRule&&t.setAttribute(\"fill-rule\",e.fillRule),c.appendChild(t)})),n.appendChild(c);const p=document.createElementNS(o.namespaceURI,\"linearGradient\");p.setAttribute(\"id\",\"shineGradient\"),p.setAttribute(\"x1\",String(2*i)),p.setAttribute(\"y1\",\"0\"),p.setAttribute(\"x2\",String(3*i)),p.setAttribute(\"y2\",String(a)),p.setAttribute(\"gradientUnits\",\"userSpaceOnUse\"),e.gradientStops.forEach((({offset:e,color:t})=>{const r=document.createElementNS(o.namespaceURI,\"stop\");r.setAttribute(\"offset\",e),r.setAttribute(\"stop-color\",t),p.appendChild(r)})),n.appendChild(p),o.appendChild(n);const m=document.createElementNS(o.namespaceURI,\"g\");m.setAttribute(\"mask\",\"url(#logo-mask)\");const _=document.createElementNS(o.namespaceURI,\"rect\");_.setAttribute(\"id\",h),_.setAttribute(\"x\",\"0\"),_.setAttribute(\"y\",\"0\"),_.setAttribute(\"width\",String(i*t)),_.setAttribute(\"height\",String(a)),_.setAttribute(\"fill\",\"url(#shineGradient)\"),_.style.transform=\"translateX(0)\",m.appendChild(_),o.appendChild(m);const g=document.createElementNS(o.namespaceURI,\"g\");g.setAttribute(\"mask\",\"url(#logo-mask)\");const S=document.createElementNS(o.namespaceURI,\"rect\");S.setAttribute(\"id\",l),S.setAttribute(\"class\",\"fill-rect\"),S.setAttribute(\"x\",\"0\"),S.setAttribute(\"y\",\"0\"),S.setAttribute(\"width\",\"100%\"),S.setAttribute(\"height\",String(a)),S.setAttribute(\"fill\",e.fillColor),g.appendChild(S),o.appendChild(g);const A=String(Math.round(3*i/633));return e.paths.forEach((t=>{if(\"object\"==typeof t&&\"black\"===t.maskFill)return;const r=document.createElementNS(o.namespaceURI,\"path\");r.setAttribute(\"d\",\"string\"==typeof t?t:t.d),r.setAttribute(\"stroke\",e.strokeColor),r.setAttribute(\"stroke-width\",A),\"object\"==typeof t&&t.fillRule&&r.setAttribute(\"fill-rule\",t.fillRule),o.appendChild(r)})),o}#Ci(e){const t=document.createElement(\"div\");t.id=c,t.style.opacity=\"0\";let r=Math.floor(Math.random()*m.length);t.textContent=m[r],e.appendChild(t);const s=()=>1e3*(2+Math.random());let i=null;const a=()=>{i=setTimeout((()=>{t.style.opacity=\"0\",setTimeout((()=>{r=(r+1)%m.length,t.textContent=m[r],t.style.opacity=\"1\",a()}),400)}),s())};i=setTimeout((()=>{t.style.opacity=\"1\",a()}),s());const o=new MutationObserver((t=>{t.forEach((t=>{t.removedNodes.forEach((t=>{t===e&&(i&&clearTimeout(i),o.disconnect())}))}))}));o.observe(document.body,{childList:!0})}};var g=r(1302);const S=class{get finished(){return this.#Oi.promise}#Li;#Oi=new o.Z;#Mi=!1;constructor({url:e}){this.#Li=new Audio(e),this.#Li.preload=\"auto\",this.#Li.addEventListener(\"ended\",(()=>this.#Ni())),this.#Li.addEventListener(\"error\",(()=>this.#Ni(`Loading sound failed to load: ${e}`))),this.#Li.load()}play(){this.#Mi||this.#Li.play().catch((e=>{this.#Ni(`Loading sound playback rejected: ${e?.message||String(e)}`)}))}cancel(){this.#Li.pause(),this.#Ni()}#Ni(e){this.#Mi||(this.#Mi=!0,e&&g.ZP.warn(e),this.#Oi.resolve())}},A=\"bridge-safe-area-styles\";const E=class{static getInsets(){const e=document.createElement(\"div\");e.style.cssText=\"position:fixed;top:env(safe-area-inset-top);bottom:env(safe-area-inset-bottom);left:env(safe-area-inset-left);right:env(safe-area-inset-right);pointer-events:none;visibility:hidden;\",document.body.appendChild(e);const t=e.getBoundingClientRect(),r={top:t.top,bottom:window.innerHeight-t.bottom,left:t.left,right:window.innerWidth-t.right};return e.remove(),r}static applyStyles(){if(document.getElementById(A))return;const e=document.createElement(\"style\");e.id=A,e.textContent=\"\\n html, body {\\n height: calc(100% - env(safe-area-inset-top) - env(safe-area-inset-bottom));\\n padding-top: env(safe-area-inset-top);\\n padding-bottom: env(safe-area-inset-bottom);\\n box-sizing: border-box;\\n }\\n \",document.head.appendChild(e)}};var P=r(5230),f=r(5819),I=r(9778),y=r(6170);class D extends I.Z{get id(){return this._platformBridge.platformId}get sdk(){return this._platformBridge.platformSdk}get language(){return this._platformBridge.platformLanguage}get payload(){return this._platformBridge.platformPayload}get data(){const{data:e,launchPostId:t}=this._platformBridge;return t?{...e,postId:t}:e}get tld(){return this._platformBridge.platformTld}get launchSource(){return this._platformBridge.launchSource}get isExternalCallsSupported(){return this._platformBridge.isPlatformExternalCallsSupported}get isExternalLinksAllowed(){return this._platformBridge.isPlatformExternalLinksAllowed}get isAudioEnabled(){return this._platformBridge.isPlatformAudioEnabled}get isPaused(){return this._platformBridge.isPlatformPaused}#ki=!1;#Hi=0;#Gi=new Set([t.Dt.GAMEPLAY_STARTED,t.Dt.GAMEPLAY_STOPPED,t.Dt.IN_GAME_LOADING_STARTED,t.Dt.IN_GAME_LOADING_STOPPED]);initialize(t){return super.initialize(t),this.#Hi=performance.now(),this._forwardEvent(e.W1.AUDIO_STATE_CHANGED),this._forwardEvent(e.W1.PAUSE_STATE_CHANGED),this}sendMessage(r,s){const i=s??{},o={};if(r===t.Dt.GAME_READY){if(this.#ki)return Promise.reject();this.#ki=!0;const e=performance.now();o.time_s=((e-this.#Hi)/1e3).toFixed(2);const t=document.getElementById(\"loading-overlay\");t&&t.remove()}return void 0!==i.world&&(o.world=String(i.world)),void 0!==i.level&&(o.level=String(i.level)),this.#Gi.has(r)||y.rh.send(`${e.oF.PLATFORM}_message_${r}`,o),a.ZP.emit(e.W1.PLATFORM_MESSAGE_SENT,r),this._platformBridge.sendMessage(r,i)}sendCustomMessage(t,r){return y.rh.send(`${e.oF.PLATFORM}_custom_message`,{id:t}),a.ZP.emit(e.W1.PLATFORM_MESSAGE_SENT,t),this._platformBridge.sendCustomMessage(t,r)}getServerTime(){return this._platformBridge.getServerTime()}}(0,a.iL)(D.prototype);const T=new D;var w=r(3941),R=r(9979),v=r(1472),b=r(8960);const C=\"visit\",O=\"author\",L=[\"text\",\"image\",\"url\"];function M(e,t,r){return(e?.rewards??[]).filter((e=>(e.type??C)===t)).map((({id:e,amount:s})=>({id:e,amount:s*r,type:t})))}class N extends I.Z{get isInviteFriendsSupported(){return this._platformBridge.isInviteFriendsSupported}get isJoinCommunitySupported(){return this._platformBridge.isJoinCommunitySupported}get isShareSupported(){return this._platformBridge.isShareSupported}get isCreatePostSupported(){return this._platformBridge.isCreatePostSupported}get isAddToHomeScreenSupported(){return this._platformBridge.isAddToHomeScreenSupported}get isAddToHomeScreenRewardSupported(){return this._platformBridge.isAddToHomeScreenRewardSupported}get isAddToFavoritesSupported(){return this._platformBridge.isAddToFavoritesSupported}get isAddToFavoritesRewardSupported(){return this._platformBridge.isAddToFavoritesRewardSupported}get isRateSupported(){return this._platformBridge.isRateSupported}get isPostRewardSupported(){return this._platformBridge.isPostRewardSupported}inviteFriends(e){if(!this._platformBridge.isInviteFriendsSupported)return Promise.reject();if(\"string\"!=typeof e)return this._platformBridge.inviteFriends(this.#t(\"inviteFriends\",e));const t=this.#Bi(this._platformBridge.options.social?.invites,e);return t?this._platformBridge.inviteFriends(t):Promise.reject()}joinCommunity(e){return this._platformBridge.isJoinCommunitySupported?this._platformBridge.joinCommunity(this.#t(\"joinCommunity\",e)):Promise.reject()}share(e){if(!this._platformBridge.isShareSupported)return Promise.reject();if(\"string\"!=typeof e)return this._platformBridge.share(this.#t(\"share\",e));const t=this.#Bi(this._platformBridge.options.social?.shares,e);return t?this._platformBridge.share(t):Promise.reject()}createPost(e,t){if(!this._platformBridge.isCreatePostSupported)return Promise.reject();if(\"string\"!=typeof e)return this._platformBridge.createPost(this.#t(\"createPost\",e));const r=this.#Bi(this._platformBridge.options.social?.posts,e);return r?this._platformBridge.createPost(r,{id:e,...void 0===t?{}:{payload:t}}):Promise.reject()}addToHomeScreen(){return this._platformBridge.isAddToHomeScreenSupported?this._platformBridge.addToHomeScreen():Promise.reject()}getAddToHomeScreenReward(){return this._platformBridge.isAddToHomeScreenRewardSupported?this._platformBridge.getAddToHomeScreenReward():Promise.reject()}addToFavorites(){return this._platformBridge.isAddToFavoritesSupported?this._platformBridge.addToFavorites():Promise.reject()}getAddToFavoritesReward(){return this._platformBridge.isAddToFavoritesRewardSupported?this._platformBridge.getAddToFavoritesReward():Promise.reject()}rate(){return this._platformBridge.isRateSupported?this._platformBridge.rate():Promise.reject()}getPostReward(){return this._platformBridge.isPostRewardSupported?Promise.all([this.#Fi(),this.#xi()]).then((([e,t])=>[...e,...t])):Promise.reject()}#Fi(){const{launchPostId:e}=this._platformBridge,t=e?this.#Ui(e):null,r=M(t,C,1);return t&&0!==r.length?this._platformBridge.getPostVisitReward(t.rewardCooldown).then((()=>r)).catch((()=>[])):Promise.resolve([])}#xi(){return this._platformBridge.getPostAuthorReward().then((e=>Object.keys(e).flatMap((t=>M(this.#Ui(t),O,e[t]))))).catch((()=>[]))}#Bi(e,t){return function(e,t,r){const s=e?.find((e=>e?.id===r));if(!s)return null;const i={};L.forEach((e=>{void 0!==s[e]&&(i[e]=s[e])}));const a=s[t];return a&&\"object\"==typeof a?(0,b.RH)(i,a):i}(e,this._platformBridge.platformId,t)}#Ui(e){const t=this._platformBridge.options.social?.posts;return function(e,t,r){const s=e?.find((e=>e?.id===r));if(!s)return null;const i=s[t];return i&&\"object\"==typeof i?(0,b.RH)(s,i):s}(t,this._platformBridge.platformId,e)}#t(e,t){return function(e,t,r){const s=e?.[t],i=s&&\"object\"==typeof s?s:{},a=r??{};return(0,b.RH)(i,a)}(this._platformBridge.options?.social,e,t)}}const k=new N;var H=r(3117);class G extends I.Z{get type(){return this._platformBridge.deviceType}get os(){return this._platformBridge.deviceOs}get orientation(){return this.#Vi}get safeArea(){return this._platformBridge.safeArea??E.getInsets()}#Vi=null;#Zi=null;#ji=null;#zi=!1;#Wi=0;#Ki=0;#Yi=null;initialize(e){return super.initialize(e),this.#$i(),this.#qi(),this}#$i(){this.#Vi=(0,H.f)(),window.screen.orientation?window.screen.orientation.addEventListener(\"change\",(()=>this.#Ji())):window.addEventListener(\"orientationchange\",(()=>this.#Ji())),window.addEventListener(\"resize\",(()=>this.#Ji())),this.#Xi()}#Xi(){const{deviceType:e}=this._platformBridge;if(!(e===s.me.MOBILE||e===s.me.TABLET))return;const t=P.ZP.getValues().device;this.#zi=t?.useBuiltInOrientationPopup??!1,this.#ji=t?.supportedOrientations??[s.AR.PORTRAIT,s.AR.LANDSCAPE],this.#Qi()}#Ji(){const t=(0,H.f)();t!==this.#Vi&&(this.#Vi=t,a.ZP.emit(e.W1.ORIENTATION_STATE_CHANGED,this.#Vi),this.#Qi())}#Qi(){if(!this.#zi)return;if(!this.#ji||1!==this.#ji.length)return void this.#ea();const e=this.#ji[0];this.#Vi!==e?this.#ta():this.#ea()}#ta(){this.#Zi||(this.#Zi=function(){if(!document.getElementById(\"bridge-orientation-overlay-styles\")){const e=document.createElement(\"style\");e.id=\"bridge-orientation-overlay-styles\",e.textContent=`\\n #${s.Uw} {\\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(e)}const e=document.createElement(\"div\");e.id=s.Uw;const t=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");t.setAttribute(\"id\",\"bridge-orientation-icon\"),t.setAttribute(\"viewBox\",\"0 0 24 24\"),t.setAttribute(\"fill\",\"none\"),t.setAttribute(\"xmlns\",\"http://www.w3.org/2000/svg\"),t.innerHTML='\\n \\n \\n ';const r=document.createElement(\"div\");return r.id=\"bridge-orientation-message\",r.innerText=\"Please rotate your device\",e.appendChild(t),e.appendChild(r),e}(),document.body.appendChild(this.#Zi))}#ea(){this.#Zi&&(this.#Zi.remove(),this.#Zi=null)}#qi(){this.#Wi=window.innerWidth,this.#Ki=window.innerHeight,window.addEventListener(\"resize\",(()=>this.#ra()))}#ra(){this.#Yi&&clearTimeout(this.#Yi),this.#Yi=setTimeout((()=>{const t=window.innerWidth,r=window.innerHeight;t===this.#Wi&&r===this.#Ki||(this.#Wi=t,this.#Ki=r,a.ZP.emit(e.W1.SCREEN_SIZE_CHANGED,{width:t,height:r}))}),200)}}(0,a.iL)(G.prototype);const B=new G;var F=r(7408);class x{get baseUrl(){return P.ZP.getValues().saas?.baseUrl||`${(0,f.ao)()}/api/bridge/v1`}get xHeaders(){return{\"x-player-id\":this.#x.playerId||\"\",\"x-platform-id\":this.#x.platformId,\"x-public-token\":P.ZP.getValues().saas?.publicToken||\"\"}}#x;constructor(e){this.#x=e}get(e){return fetch(`${this.baseUrl}/${e}`,{method:\"GET\",credentials:\"include\",headers:{\"Content-Type\":\"application/json\",...this.xHeaders}}).then((e=>e.json()))}post(e,t){return fetch(`${this.baseUrl}/${e}`,{method:\"POST\",body:JSON.stringify(t),credentials:\"include\",headers:{\"Content-Type\":\"application/json\",...this.xHeaders}}).then((e=>e.json()))}}class U extends I.Z{get type(){return this.#sa?F.Z.IN_GAME:this._platformBridge.leaderboardsType}#sa=null;initialize(t){return super.initialize(t),this._isSaas(e.oF.LEADERBOARDS)&&(this.#sa=new x(t)),this}setScore(e,t){if(this.type===F.Z.NOT_AVAILABLE)return Promise.reject();if(this.#sa)return this._platformBridge.playerId?this.#sa.post(`leaderboards/${e}`,{score:t}):Promise.reject();const r=this._getPlatformLeaderboardId(e),s=this.#ia(e);return this._platformBridge.leaderboardsSetScore(r,t,s)}getEntries(e){if(this.type!==F.Z.IN_GAME)return Promise.reject();if(this.#sa)return this.#sa.get(`leaderboards/${e}`);const t=this._getPlatformLeaderboardId(e);return this._platformBridge.leaderboardsGetEntries(t)}showNativePopup(e){if(this._platformBridge.leaderboardsType!==F.Z.NATIVE_POPUP)return Promise.reject();const t=this._getPlatformLeaderboardId(e);return this._platformBridge.leaderboardsShowNativePopup(t)}_getPlatformLeaderboardId(e){if(!e)return e;const{leaderboards:t}=P.ZP.getValues();if(!t)return e;const r=t.find((t=>t.id===e));if(!r)return e;const s=r[this._platformBridge.platformId];return\"string\"==typeof s&&s?s:e}#ia(e){const{leaderboards:t}=P.ZP.getValues();if(!t)return!1;const r=t.find((t=>t.id===e));return!!r&&!0===r.isMain}}const V=new U;var Z=r(1147);class j extends I.Z{get isSupported(){return this._platformBridge.isRemoteConfigSupported}#aa={};setContext(e){this.#aa={...this.#aa,...e}}get(){return this._platformBridge.isRemoteConfigSupported?this._platformBridge.getRemoteConfig(this.#aa):Promise.reject()}}const z=new j;class W extends I.Z{get isSupported(){return this._platformBridge.isClipboardSupported}read(){return this._platformBridge.isClipboardSupported?this._platformBridge.clipboardRead():Promise.reject()}write(e){return this._platformBridge.isClipboardSupported?this._platformBridge.clipboardWrite(e):Promise.reject()}}const K=new W;var Y=r(5334);class $ extends I.Z{get isSupported(){return this._platformBridge.isNotificationsSupported}schedule(t){const r=this.#oa(t);if(r)return Promise.reject(new e.Hd(e.Bq.NOTIFICATION_INVALID_PARAMETERS,r));const s=this.#na(t.id);return this._platformBridge.notificationsSchedule(t,s)}cancel(t){return\"string\"!=typeof t||0===t.length?Promise.reject(new e.Hd(e.Bq.NOTIFICATION_INVALID_PARAMETERS,'Notification \"id\" must be a non-empty string')):this._platformBridge.notificationsCancel(t,this.#na(t))}cancelAll(){return this._platformBridge.notificationsCancelAll()}#oa(e){if(!e||\"object\"!=typeof e)return\"Notification must be an object\";if(\"string\"!=typeof e.id||0===e.id.length)return'Notification \"id\" must be a non-empty string';if(\"string\"!=typeof e.title||0===e.title.length)return'Notification \"title\" must be a non-empty string';if(\"string\"!=typeof e.description||0===e.description.length)return'Notification \"description\" must be a non-empty string';if(void 0!==e.delaySeconds&&(!Number.isInteger(e.delaySeconds)||e.delaySeconds<0))return'Notification \"delaySeconds\" must be a non-negative integer';const t=[\"image\",\"callToAction\",\"payload\"].find((t=>{const r=e[t];return void 0!==r&&\"string\"!=typeof r}));return t?`Notification \"${t}\" must be a string`:null}#na(e){const{notifications:t}=P.ZP.getValues();if(!t)return;const r=t.find((t=>t.id===e));if(!r)return;const s=r[this._platformBridge.platformId];return\"string\"==typeof s||\"number\"==typeof s?s:void 0}}const q=new $,J=\"bridge-daily-rewards-state\";class X extends I.Z{#da=[];#la=!0;#ha=!0;#L=null;#M=null;initialize(e){super.initialize(e);const t=P.ZP.getValues().dailyRewards;return this.#da=Array.isArray(t?.rewards)?t.rewards:[],this.#la=\"boolean\"!=typeof t?.cycle||t.cycle,this.#ha=\"boolean\"!=typeof t?.resetOnMiss||t.resetOnMiss,this}async getRewards(){return[...this.#da]}async getCurrentDay(){const e=await this.#ca();return(await this.#ua(e)).day}async getCurrentReward(){const e=await this.#ca(),t=await this.#ua(e);return this.#pa(t,e)?this.#da[t.day]:null}async claimCurrentReward(){const t=await this.#ca(),r=await this.#ua(t);if(!this.#pa(r,t))return!1;const s=r.day;r.lastClaimEpochDay=t,r.day=this.#la?(r.day+1)%this.#da.length:r.day+1,await this.#k();const i={day:s,reward:this.#da[s]};return a.ZP.emit(e.W1.DAILY_REWARDS_CLAIMED,i),!0}async#ua(t){const r=await this.#N();if(this.#ha&&null!==r.lastClaimEpochDay&&r.day>0&&t-r.lastClaimEpochDay>=2){const t=r.day;r.day=0,await this.#k();const s={day:t};a.ZP.emit(e.W1.DAILY_REWARDS_STREAK_RESET,s)}return r}#pa(e,t){return!(e.day>=this.#da.length)&&(null===e.lastClaimEpochDay||t>e.lastClaimEpochDay)}async#ca(){let e;try{e=await this._platformBridge.getServerTime()}catch{e=Date.now()}return\"number\"==typeof e&&Number.isFinite(e)||(e=Date.now()),Math.floor(e/864e5)}#N(){return this.#L?Promise.resolve(this.#L):(this.#M||(this.#M=R.Z.get(J,!0).then((e=>(this.#L=this.#H(e),this.#M=null,this.#L))).catch((()=>(this.#L=this.#G(),this.#M=null,this.#L)))),this.#M)}#k(){return this.#L?R.Z.set(J,this.#L):Promise.resolve()}#G(){return{day:0,lastClaimEpochDay:null}}#H(e){if(!e||\"object\"!=typeof e)return this.#G();const t=e;return{day:\"number\"==typeof t.day&&t.day>=0?Math.floor(t.day):0,lastClaimEpochDay:\"number\"==typeof t.lastClaimEpochDay?Math.floor(t.lastClaimEpochDay):null}}}const Q=new X,ee=\"bridge-tasks-state\",te={DAILY:\"daily\",WEEKLY:\"weekly\",PERMANENT:\"permanent\"};class re extends I.Z{#ma=[];#L=null;#M=null;initialize(e){super.initialize(e);const t=P.ZP.getValues().tasks;return this.#ma=Array.isArray(t)?t.filter((e=>this.#_a(e))):[],this}async getTasks(){const{state:e,active:t}=await this.#ga(),r=[];return t.forEach((({group:t,key:s})=>{e.groups[s].tasks.forEach((e=>{const s=this.#Sa(t,e.id);s&&r.push(this.#Aa(t,e,s))}))})),r}async addProgress(e,t=1){const{state:r,active:s}=await this.#ga();let i=!1;s.forEach((({group:s,key:a})=>{r.groups[a].tasks.forEach((r=>{const a=this.#Sa(s,r.id);a&&a.targets.forEach((s=>{if(s.id!==e)return;const a=this.#Ea(r,s.id),o=a.progress;a.progress=Math.min(Math.max(0,o+t),s.amount),a.progress!==o&&(i=!0)}))}))})),i&&await this.#k()}async claimReward(t){const{state:r,active:s}=await this.#ga(),i=this.#Pa(s,r,t);if(!i||i.task.claimed)return!1;const o=this.#Sa(i.group,i.task.id);if(!o||!this.#fa(o,i.task))return!1;i.task.claimed=!0,await this.#k();const n={taskId:o.id,groupId:i.group.id,type:i.group.type,rewards:o.rewards.map((e=>({id:e.id,amount:e.amount})))};return a.ZP.emit(e.W1.TASKS_REWARD_CLAIMED,n),!0}async#ga(){const t=await this.#N(),r=await this.#Ia(),s=[],i=[];let o=!1;return this.#ma.forEach((e=>{const a=e.id,n=this.#ya(e,r),d=t.groups[a];d&&d.periodKey===n||(d&&i.push({groupId:a,type:e.type,periodKey:n,previousPeriodKey:d.periodKey}),t.groups[a]={periodKey:n,tasks:this.#Da(e)},o=!0),s.push({group:e,key:a})})),o&&await this.#k(),i.forEach((t=>{a.ZP.emit(e.W1.TASKS_PERIOD_ROLLED_OVER,t)})),{state:t,active:s}}#ya(e,t){switch(e.type){case te.DAILY:return Math.floor(t/864e5);case te.WEEKLY:return Math.floor(t/6048e5);default:return 0}}#Da(e){return e.items.map((e=>({id:e.id,targets:e.targets.map((e=>({id:e.id,progress:0}))),claimed:!1})))}#Ea(e,t){let r=e.targets.find((e=>e.id===t));return r||(r={id:t,progress:0},e.targets.push(r)),r}#fa(e,t){return e.targets.every((e=>{const r=t.targets.find((t=>t.id===e.id));return null!=r&&r.progress>=e.amount}))}#Pa(e,t,r){let s=null;return e.some((({group:e,key:i})=>{const a=t.groups[i].tasks.find((e=>e.id===r));return!!a&&(s={group:e,task:a},!0)})),s}#Sa(e,t){return e.items.find((e=>e.id===t))}#Aa(e,t,r){const s=r.targets.map((e=>{const r=t.targets.find((t=>t.id===e.id)),s=Math.min(r?r.progress:0,e.amount);return{id:e.id,amount:e.amount,progress:s,completed:s>=e.amount}}));return{id:r.id,type:e.type,targets:s,rewards:r.rewards.map((e=>({id:e.id,amount:e.amount}))),completed:s.every((e=>e.completed)),claimed:t.claimed}}#_a(e){if(!e||\"object\"!=typeof e)return!1;const t=e,r=Object.values(te);return\"string\"==typeof t.id&&\"string\"==typeof t.type&&r.includes(t.type)&&Array.isArray(t.items)}async#Ia(){let e;try{e=await this._platformBridge.getServerTime()}catch{e=Date.now()}return\"number\"==typeof e&&Number.isFinite(e)||(e=Date.now()),e}#N(){return this.#L?Promise.resolve(this.#L):(this.#M||(this.#M=R.Z.get(ee,!0).then((e=>(this.#L=this.#H(e),this.#M=null,this.#L))).catch((()=>(this.#L=this.#G(),this.#M=null,this.#L)))),this.#M)}#k(){return this.#L?R.Z.set(ee,this.#L):Promise.resolve()}#G(){return{groups:{}}}#H(e){if(!e||\"object\"!=typeof e)return this.#G();const t=e.groups;if(!t||\"object\"!=typeof t)return this.#G();const r={};return Object.keys(t).forEach((e=>{const s=this.#Ta(t[e]);s&&(r[e]=s)})),{groups:r}}#Ta(e){if(!e||\"object\"!=typeof e)return null;const t=e;if(\"number\"!=typeof t.periodKey)return null;const r=Array.isArray(t.tasks)?t.tasks.map((e=>this.#wa(e))).filter((e=>null!==e)):[];return{periodKey:Math.floor(t.periodKey),tasks:r}}#wa(e){if(!e||\"object\"!=typeof e)return null;const t=e;if(\"string\"!=typeof t.id)return null;const r=Array.isArray(t.targets)?t.targets.map((e=>this.#Ra(e))).filter((e=>null!==e)):[];return{id:t.id,targets:r,claimed:!0===t.claimed}}#Ra(e){if(!e||\"object\"!=typeof e)return null;const t=e;if(\"string\"!=typeof t.id)return null;const r=\"number\"==typeof t.progress&&t.progress>=0?Math.floor(t.progress):0;return{id:t.id,progress:r}}}const se=new re;var ie=r(5555),ae=r(8166);const oe={};oe[t.Lb.VK]=()=>Promise.resolve().then(r.bind(r,7226)),oe[t.Lb.OK]=()=>Promise.resolve().then(r.bind(r,9623)),oe[t.Lb.YANDEX]=()=>Promise.resolve().then(r.bind(r,1323)),oe[t.Lb.CRAZY_GAMES]=()=>Promise.resolve().then(r.bind(r,9163)),oe[t.Lb.GAME_DISTRIBUTION]=()=>Promise.resolve().then(r.bind(r,3777)),oe[t.Lb.PLAYGAMA]=()=>Promise.resolve().then(r.bind(r,3153)),oe[t.Lb.STANDALONE]=()=>Promise.resolve().then(r.bind(r,8200)),oe[t.Lb.PLAYGAMA_SANDBOX]=()=>Promise.resolve().then(r.bind(r,1856)),oe[t.Lb.TELEGRAM]=()=>Promise.resolve().then(r.bind(r,6465)),oe[t.Lb.Y8]=()=>Promise.resolve().then(r.bind(r,3369)),oe[t.Lb.LAGGED]=()=>Promise.resolve().then(r.bind(r,4902)),oe[t.Lb.FACEBOOK]=()=>Promise.resolve().then(r.bind(r,2769)),oe[t.Lb.POKI]=()=>Promise.resolve().then(r.bind(r,7789)),oe[t.Lb.QA_TOOL]=()=>Promise.resolve().then(r.bind(r,1298)),oe[t.Lb.MSN]=()=>Promise.resolve().then(r.bind(r,5244)),oe[t.Lb.MICROSOFT_STORE]=()=>Promise.resolve().then(r.bind(r,4951)),oe[t.Lb.HUAWEI]=()=>Promise.resolve().then(r.bind(r,7490)),oe[t.Lb.GAMEPUSH]=()=>Promise.resolve().then(r.bind(r,4499)),oe[t.Lb.DISCORD]=()=>Promise.resolve().then(r.bind(r,1634)),oe[t.Lb.JIO_GAMES]=()=>Promise.resolve().then(r.bind(r,2974)),oe[t.Lb.YOUTUBE]=()=>Promise.resolve().then(r.bind(r,8347)),oe[t.Lb.PORTAL]=()=>Promise.resolve().then(r.bind(r,6328)),oe[t.Lb.REDDIT]=()=>Promise.resolve().then(r.bind(r,6539)),oe[t.Lb.XIAOMI]=()=>Promise.resolve().then(r.bind(r,7121)),oe[t.Lb.TIKTOK]=()=>Promise.resolve().then(r.bind(r,755)),oe[t.Lb.DLIGHTEK]=()=>Promise.resolve().then(r.bind(r,7430)),oe[t.Lb.GAMESNACKS]=()=>Promise.resolve().then(r.bind(r,9819)),oe[t.Lb.SAMSUNG]=()=>Promise.resolve().then(r.bind(r,9793));const ne=[{platformId:t.Lb.YANDEX,predicate:({hostname:e,hash:t})=>e.includes([\"y\",\"a\",\"n\",\"d\",\"e\",\"x\",\".\",\"n\",\"e\",\"t\"].join(\"\"))||t.includes(\"yandex\")},{platformId:t.Lb.CRAZY_GAMES,predicate:({hostname:e})=>e.includes(\"crazygames.\")||e.includes(\"1001juegos.com\")},{platformId:t.Lb.GAME_DISTRIBUTION,predicate:({hostname:e})=>e.includes(\"gamedistribution.com\")},{platformId:t.Lb.LAGGED,predicate:({hostname:e})=>e.includes(\"lagged.\")},{platformId:t.Lb.VK,predicate:({searchParams:e})=>e.has(\"api_id\")&&e.has(\"viewer_id\")&&e.has(\"auth_key\")||e.has(\"vk_app_id\")},{platformId:t.Lb.TELEGRAM,predicate:({hash:e})=>e.includes(\"tgWebAppData\")},{platformId:t.Lb.Y8,predicate:({hostname:e})=>e.includes(\"y8\")},{platformId:t.Lb.FACEBOOK,predicate:({hostname:e})=>e.includes(\"fbsbx\")},{platformId:t.Lb.POKI,predicate:({hostname:e})=>e.includes(\"poki-gdn\")||e.includes(\"poki-user-content\")},{platformId:t.Lb.MSN,predicate:({hostname:e})=>e.includes(\"msn.\")||e.includes(\"msnfun.\")||e.includes(\"start.gg\")},{platformId:t.Lb.GAMEPUSH,predicate:({hostname:e})=>e.includes(\"eponesh.\")},{platformId:t.Lb.DISCORD,predicate:({hostname:e})=>e.includes(\"discordsays.com\")},{platformId:t.Lb.YOUTUBE,predicate:({hostname:e})=>e.includes(\"usercontent.goog\")},{platformId:t.Lb.PORTAL,predicate:({hostname:e})=>e.includes(\"portalapp.\")},{platformId:t.Lb.REDDIT,predicate:({hostname:e})=>e.includes(\"devvit.\")},{platformId:t.Lb.DLIGHTEK,predicate:({hostname:e})=>e.includes(\"hippoobox.com\")||e.includes(\"ahagamecenter.com\")},{platformId:t.Lb.TIKTOK,predicate:({win:e})=>void 0!==e.TTMinis},{platformId:t.Lb.GAMESNACKS,predicate:({win:e})=>void 0!==e.GameSnacks},{platformId:t.Lb.SAMSUNG,predicate:({win:e})=>void 0!==e.GSInstant}];function de(e){return Object.values(t.Lb).includes(e)?e:t.Lb.MOCK}class le{get version(){return\"2.2.0\"}get isInitialized(){return this.#va}get options(){return this.#ba?.options}get platform(){return this.#Ca(e.oF.PLATFORM)}get player(){return this.#Ca(e.oF.PLAYER)}get storage(){return this.#Ca(e.oF.STORAGE)}get advertisement(){return this.#Ca(e.oF.ADVERTISEMENT)}get social(){return this.#Ca(e.oF.SOCIAL)}get device(){return this.#Ca(e.oF.DEVICE)}get leaderboards(){return this.#Ca(e.oF.LEADERBOARDS)}get payments(){return this.#Ca(e.oF.PAYMENTS)}get achievements(){return this.#Ca(e.oF.ACHIEVEMENTS)}get remoteConfig(){return this.#Ca(e.oF.REMOTE_CONFIG)}get clipboard(){return this.#Ca(e.oF.CLIPBOARD)}get notifications(){return this.#Ca(e.oF.NOTIFICATIONS)}get analytics(){return this.#Ca(e.oF.ANALYTICS)}get dailyRewards(){return this.#Ca(e.oF.DAILY_REWARDS)}get tasks(){return this.#Ca(e.oF.TASKS)}get crossPromo(){return this.#Ca(e.oF.CROSS_PROMO)}get engine(){return this.#Oa}set engine(e){this.#Oa=e}set gameVersion(e){y.ZP.gameVersion=e}#va=!1;#La=null;#ba=null;#Ma={};#Na=null;#ka=null;#Oa=\"javascript\";async initialize(r){if(this.#va)return Promise.resolve();if(!this.#La){this.#La=new o.Z;const s=new URL(window.location.href),i=s.searchParams.has(g.zY);i&&(g.ZP.enabled=\"false\"!==s.searchParams.get(g.zY)),g.ZP.info(\"Initialization started\");const a=performance.now(),n=r?.configFilePath;await P.ZP.load(n,r);const d=function(e){const r=new URL(window.location.href);if(e)return de(String(e).toLowerCase());if(r.searchParams.has(\"platform_id\"))return de((r.searchParams.get(\"platform_id\")??\"\").toLowerCase());const s={url:r,hostname:r.hostname,hash:r.hash,searchParams:r.searchParams,referrer:document.referrer,win:window},i=ne.find((({predicate:e})=>e(s)));return i?i.platformId:t.Lb.MOCK}(P.ZP.getRawValues().forciblySetPlatformId);P.ZP.initialize(d),(0,f.as)(d),i||(g.ZP.enabled=!0===P.ZP.getValues().debug),g.ZP.info(\"Config loaded\"),(0,b.CS)(),await this.#Ha(d);const l=this.#ba;l.engine=this.engine,this.#Ga(l);[{name:e.oF.PLATFORM,module:T},{name:e.oF.PLAYER,module:w.Z},{name:e.oF.STORAGE,module:R.Z},{name:e.oF.ADVERTISEMENT,module:v.ZP},{name:e.oF.SOCIAL,module:k},{name:e.oF.DEVICE,module:B},{name:e.oF.LEADERBOARDS,module:V},{name:e.oF.PAYMENTS,module:Z.ZP},{name:e.oF.REMOTE_CONFIG,module:z},{name:e.oF.CLIPBOARD,module:K},{name:e.oF.ACHIEVEMENTS,module:Y.ZP},{name:e.oF.NOTIFICATIONS,module:q},{name:e.oF.ANALYTICS,module:y.ZP},{name:e.oF.DAILY_REWARDS,module:Q},{name:e.oF.TASKS,module:se},{name:e.oF.CROSS_PROMO,module:ie.Z}].forEach((({name:e,module:t})=>{t.initialize(l),this.#Ma[e]=(0,g.dw)(e,t)})),l.initialize().then((()=>{this.#va=!0,this.#Ba(l),g.ZP.banner(`PlaygamaBridge v${this.version} initialized.`),this.#La&&(this.#La.resolve(),this.#La=null);const t=P.ZP.getValues().advertisement,r=this.#Ma[e.oF.ADVERTISEMENT];t?.interstitial?.preloadOnStart&&r.preloadInterstitial(t.interstitial.preloadOnStart),t?.rewarded?.preloadOnStart&&r.preloadRewarded(t.rewarded.preloadOnStart)})).catch((t=>{this.#ka?.cancel();const r=((performance.now()-a)/1e3).toFixed(2),s=t?.message||String(t);y.rh.send(`${e.oF.CORE}_initialization_failed`,{error:s,time_s:r});const i=new e.Hd(e.Bq.INITIALIZATION_FAILED,t);g.ZP.error(i.message,t),this.#La&&(this.#La.reject(i),this.#La=null)})).finally((()=>{setTimeout((()=>{this.#Na?.setProgress(100,!0),this.#ba?.setLoadingProgress(100)}),700)}))}return this.#La.promise}setGameLoadingProgress(e){this.#Na?.setProgress(e),this.#ba?.setLoadingProgress(e)}async#Ha(e){g.ZP.info(`Platform detected: ${e}`);const t=await async function(e){const t=oe[e];if(t){const{default:e}=await t();return e}return ae.Z}(e);this.#ba=new t}#Ga(e){const r=P.ZP.getValues();if(!r.disableLoadingLogo){const s=e.platformId!==t.Lb.YANDEX&&e.platformId!==t.Lb.Y8&&!1!==r.showFullLoadingLogo,i=e.platformId===t.Lb.XIAOMI||!0===r.showLoadingText;this.#Na=new _,this.#Na.show({showFullLogo:s,showLoadingText:i}),r.loadingSound?.url&&(this.#ka=new S(r.loadingSound),this.#Na.setHideGate(this.#ka.finished))}r.game?.adaptToSafeArea&&E.applyStyles()}#Ba(e){this.#ka&&(e.isPlatformAudioEnabled?this.#ka.play():this.#ka.cancel())}#Ca(t){return this.#va||g.ZP.error(e.pn.SDK_NOT_INITIALIZED.message),this.#Ma[t]}}(0,a.iL)(le.prototype),Object.assign(le.prototype,{PLATFORM_ID:t.Lb,PLATFORM_MESSAGE:t.Dt,MODULE_NAME:e.oF,EVENT_NAME:e.W1,INTERSTITIAL_STATE:i.WA,REWARDED_STATE:i.b3,BANNER_STATE:i.Kk,DEVICE_TYPE:s.me,DEVICE_ORIENTATION:s.AR,LAUNCH_SOURCE:e.LS});const he=le;window.bridge||window.playgamaBridge||(window.bridge=new he,window.playgamaBridge=window.bridge)})()})();", "", " initializeBridge()", "}" @@ -850,6 +861,90 @@ "parameters": [], "objectGroups": [] }, + { + "description": "Platform Launch Source.", + "fullName": "Platform Launch Source", + "functionType": "StringExpression", + "group": "Platform", + "name": "PlatformLaunchSource", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = bridge.platform.launchSource || \"\";", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "expressionType": { + "type": "string" + }, + "objectGroups": [] + }, + { + "description": "Platform Data Value.", + "fullName": "Platform Data Value", + "functionType": "StringExpression", + "group": "Platform", + "name": "PlatformDataValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const key = eventsFunctionContext.getArgument(\"Key\");", + "const data = bridge.platform.data || {};", + "", + "eventsFunctionContext.returnValue = data[key] === undefined ? \"\" : String(data[key]);", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Key", + "name": "Key", + "type": "string" + } + ], + "expressionType": { + "type": "string" + }, + "objectGroups": [] + }, + { + "description": "Platform Data As JSON.", + "fullName": "Platform Data As JSON", + "functionType": "StringExpression", + "group": "Platform", + "name": "PlatformDataAsJSON", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = JSON.stringify(bridge.platform.data || {});", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "expressionType": { + "type": "string" + }, + "objectGroups": [] + }, { "description": "Platform Is Audio Enabled.", "fullName": "Platform Is Audio Enabled", @@ -3545,12 +3640,12 @@ "objectGroups": [] }, { - "description": "Share.", + "description": "Share. Pass the id of a social.shares entry from playgama-bridge-config.json, or leave it empty to use the action parameters.", "fullName": "Share", "functionType": "Action", "group": "Social", "name": "Share", - "sentence": "Share", + "sentence": "Share - Id: _PARAM1_", "events": [ { "type": "BuiltinCommonInstructions::JsCode", @@ -3558,7 +3653,8 @@ "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", "", "return new Promise(resolve => {", - " bridge.social.share(gdjs._playgamaBridgeExtension.actionParametersContainer)", + " const id = eventsFunctionContext.getArgument(\"Id\");", + " bridge.social.share(id || gdjs._playgamaBridgeExtension.actionParametersContainer)", " .then(() => {", " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", " })", @@ -3576,16 +3672,22 @@ "eventsSheetExpanded": true } ], - "parameters": [], + "parameters": [ + { + "description": "Id", + "name": "Id", + "type": "string" + } + ], "objectGroups": [] }, { - "description": "Invite Friends.", + "description": "Invite Friends. Pass the id of a social.invites entry from playgama-bridge-config.json, or leave it empty to use the action parameters.", "fullName": "Invite Friends", "functionType": "Action", "group": "Social", "name": "InviteFriends", - "sentence": "Invite Friends", + "sentence": "Invite Friends - Id: _PARAM1_", "events": [ { "type": "BuiltinCommonInstructions::JsCode", @@ -3593,7 +3695,8 @@ "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", "", "return new Promise(resolve => {", - " bridge.social.inviteFriends(gdjs._playgamaBridgeExtension.actionParametersContainer)", + " const id = eventsFunctionContext.getArgument(\"Id\");", + " bridge.social.inviteFriends(id || gdjs._playgamaBridgeExtension.actionParametersContainer)", " .then(() => {", " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", " })", @@ -3611,7 +3714,13 @@ "eventsSheetExpanded": true } ], - "parameters": [], + "parameters": [ + { + "description": "Id", + "name": "Id", + "type": "string" + } + ], "objectGroups": [] }, { @@ -3649,12 +3758,12 @@ "objectGroups": [] }, { - "description": "Create Post.", + "description": "Create Post. Pass the id of a social.posts entry from playgama-bridge-config.json, or leave it empty to use the action parameters. The payload is the game's own string for this one post, handed back as Platform Payload when someone opens it.", "fullName": "Create Post", "functionType": "Action", "group": "Social", "name": "CreatePost", - "sentence": "Create Post", + "sentence": "Create Post - Id: _PARAM1_, Payload: _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::JsCode", @@ -3662,7 +3771,9 @@ "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", "", "return new Promise(resolve => {", - " bridge.social.createPost(gdjs._playgamaBridgeExtension.actionParametersContainer)", + " const id = eventsFunctionContext.getArgument(\"Id\");", + " const payload = eventsFunctionContext.getArgument(\"Payload\");", + " bridge.social.createPost(id || gdjs._playgamaBridgeExtension.actionParametersContainer, payload || undefined)", " .then(() => {", " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", " })", @@ -3679,7 +3790,18 @@ "eventsSheetExpanded": true } ], - "parameters": [], + "parameters": [ + { + "description": "Id", + "name": "Id", + "type": "string" + }, + { + "description": "Payload", + "name": "Payload", + "type": "string" + } + ], "objectGroups": [] }, { @@ -4089,6 +4211,230 @@ "parameters": [], "objectGroups": [] }, + { + "description": "Get Post Reward. Everything the player has coming from posts right now: the reward for the post the game was launched from and what the author earned from the players who came through their posts. The list is empty when there is nothing, read it with the Post Reward expressions.", + "fullName": "Get Post Reward", + "functionType": "Action", + "group": "Social", + "name": "GetPostReward", + "sentence": "Get Post Reward", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", + "", + "return new Promise(resolve => {", + " bridge.social.getPostReward()", + " .then(rewards => {", + " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", + " gdjs._playgamaBridgeExtension.postRewards = rewards || [];", + " })", + " .catch(error => console.log(error))", + " .finally(() => {", + " gdjs._playgamaBridgeExtension.nextIsGetPostRewardCompleted = true;", + " resolve();", + " });", + "});" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Is Post Reward Supported.", + "fullName": "Is Post Reward Supported", + "functionType": "Condition", + "group": "Social", + "name": "IsPostRewardSupported", + "sentence": "Is Post Reward Supported", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = bridge.social.isPostRewardSupported;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "On Get Post Reward Completed.", + "fullName": "On Get Post Reward Completed", + "functionType": "Condition", + "group": "Social", + "name": "OnGetPostRewardCompleted", + "sentence": "On Get Post Reward Completed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.isGetPostRewardCompleted;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Post Rewards Count.", + "fullName": "Post Rewards Count", + "functionType": "Expression", + "group": "Social", + "name": "PostRewardsCount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.postRewards.length;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Post Reward Id.", + "fullName": "Post Reward Id", + "functionType": "StringExpression", + "group": "Social", + "name": "PostRewardId", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const r = gdjs._playgamaBridgeExtension.postRewards[eventsFunctionContext.getArgument(\"RewardIndex\")];", + "eventsFunctionContext.returnValue = r ? r.id : \"\";", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Reward Index", + "name": "RewardIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Post Reward Amount.", + "fullName": "Post Reward Amount", + "functionType": "Expression", + "group": "Social", + "name": "PostRewardAmount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const r = gdjs._playgamaBridgeExtension.postRewards[eventsFunctionContext.getArgument(\"RewardIndex\")];", + "eventsFunctionContext.returnValue = r ? r.amount : 0;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Reward Index", + "name": "RewardIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Post Reward Type.", + "fullName": "Post Reward Type", + "functionType": "StringExpression", + "group": "Social", + "name": "PostRewardType", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const r = gdjs._playgamaBridgeExtension.postRewards[eventsFunctionContext.getArgument(\"RewardIndex\")];", + "eventsFunctionContext.returnValue = r ? r.type : \"\";", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Reward Index", + "name": "RewardIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Post Rewards As JSON.", + "fullName": "Post Rewards As JSON", + "functionType": "StringExpression", + "group": "Social", + "name": "PostRewardsAsJSON", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = JSON.stringify(gdjs._playgamaBridgeExtension.postRewards);", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + }, { "description": "Is External Links Allowed.", "fullName": "Is External Links Allowed",