@bygd/gd-sdk-pes 1.28.13 → 1.28.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,4 +36,4 @@ const $w=Bw;function Nw(e,t,r){return"function"==typeof r.join?r.join(e):e[0]+t+
36
36
  * Copyright (c) Jon Schlinkert (https://github.com/jonschlinkert).
37
37
  * Released under the MIT License.
38
38
  */
39
- const{deleteProperty:Hw}=Reflect,qw=function(e){return"object"==typeof e?null===e:"function"!=typeof e},Kw=function(e){var t,r;return!1!==Zw(e)&&("function"==typeof(t=e.constructor)&&(!1!==Zw(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf")))},Ww=e=>"object"==typeof e&&null!==e||"function"==typeof e,Vw=e=>{if(!qw(e))throw new TypeError("Object keys must be strings or symbols");if((e=>"__proto__"===e||"constructor"===e||"prototype"===e)(e))throw new Error(`Cannot set unsafe key: "${e}"`)},Yw=(e,t,r)=>{const n=(e=>Array.isArray(e)?e.flat().map(String).join(","):e)(t?((e,t)=>{if("string"!=typeof e||!t)return e;let r=e+";";return void 0!==t.arrays&&(r+=`arrays=${t.arrays};`),void 0!==t.separator&&(r+=`separator=${t.separator};`),void 0!==t.split&&(r+=`split=${t.split};`),void 0!==t.merge&&(r+=`merge=${t.merge};`),void 0!==t.preservePaths&&(r+=`preservePaths=${t.preservePaths};`),r})(e,t):e);Vw(n);const o=Xw.cache.get(n)||r();return Xw.cache.set(n,o),o},Qw=(e,t)=>t&&"function"==typeof t.split?t.split(e):"symbol"==typeof e?[e]:Array.isArray(e)?e:Yw(e,t,(()=>((e,t={})=>{const r=t.separator||".",n="/"!==r&&t.preservePaths;if("string"==typeof e&&!1!==n&&/\//.test(e))return[e];const o=[];let a="";const i=e=>{let t;""!==e.trim()&&Number.isInteger(t=Number(e))?o.push(t):o.push(e)};for(let t=0;t<e.length;t++){const n=e[t];"\\"!==n?n!==r?a+=n:(i(a),a=""):a+=e[++t]}return a&&i(a),o})(e,t))),Jw=(e,t,r,n)=>{if(Vw(t),void 0===r)Hw(e,t);else if(n&&n.merge){const o="function"===n.merge?n.merge:Object.assign;o&&Kw(e[t])&&Kw(r)?e[t]=o(e[t],r):e[t]=r}else e[t]=r;return e},Xw=(e,t,r,n)=>{if(!t||!Ww(e))return e;const o=Qw(t,n);let a=e;for(let e=0;e<o.length;e++){const t=o[e],i=o[e+1];if(Vw(t),void 0===i){Jw(a,t,r,n);break}"number"!=typeof i||Array.isArray(a[t])?(Ww(a[t])||(a[t]={}),a=a[t]):a=a[t]=[]}return e};Xw.split=Qw,Xw.cache=new Map,Xw.clear=()=>{Xw.cache=new Map};var eA=Xw;function tA(e){var t=this,n={},o=(null==e?void 0:e._ancestor_origins)||window.location.ancestorOrigins,a=(null==e?void 0:e.self_url)||window.location.href,i=(null==e?void 0:e.self_origin)||window.location.origin,s=(null==e?void 0:e.referrer_url)||document.referrer;function u(e){return function(e,t,r){if($w(r)||(r={default:r}),!Fw(e))return void 0!==r.default?r.default:e;"number"==typeof t&&(t=String(t));const n=Array.isArray(t),o="string"==typeof t,a=r.separator||".",i=r.joinChar||("string"==typeof a?a:".");if(!o&&!n)return e;if(o&&t in e)return Gw(t,e,r)?e[t]:r.default;let s=n?t:function(e,t,r){return"function"==typeof r.split?r.split(e):e.split(t)}(t,a,r),u=s.length,c=0;do{let t=s[c];for("number"==typeof t&&(t=String(t));t&&"\\"===t.slice(-1);)t=Nw([t.slice(0,-1),s[++c]||""],i,r);if(t in e){if(!Gw(t,e,r))return r.default;e=e[t]}else{let n=!1,o=c+1;for(;o<u;)if(t=Nw([t,s[o++]],i,r),n=t in e){if(!Gw(t,e,r))return r.default;e=e[t],c=o-1;break}if(!n)return r.default}}while(++c<u&&Fw(e));return c===u?e:r.default}(n,e)}function c(e,t){return eA(n,e,t)}function l(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new k(e,t)}catch(e){console.log(e)}}function d(){for(var t=(null==e?void 0:e.urls)||[a,s],r=0;r<t.length;r++){var n,o=l(t[r]);if(o){var i=null===(n=o.query)||void 0===n?void 0:n.gd_sdk_referrer_url;if(i&&(i=decodeURIComponent(i),dw.isURL(i)))return i}}}return function(){var e;r(this,t),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){c("depth.error",e.message)}c("depth.value",e)}(),function(){var e=o,t=n.depth.value,r=i;if(c("top.domain.from","fallback"),e&&e.length>0)r=e[e.length-1],c("top.domain.from","origins");else if(0===t)r=i,c("top.domain.from","self-top");else if(1===t){var a=l(s);a&&(r=a.origin,c("top.domain.from","referrer"))}c("top.domain.value",r.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=d();if(e)if(Uw(e))c("partner.domain.value",e),c("partner.domain.from","partner-domain");else{var t=l(e,!1);if(t)c("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),c("partner.domain.from","partner-url");else c("partner.domain.value",n.top.domain.value),c("partner.domain.from","partner-fallback")}else c("partner.domain.value",n.top.domain.value),c("partner.domain.from","fallback")}(),e=d(),0===n.depth.value?(c("partner.url.value",a),c("partner.url.from","self-top")):e?Uw(e)?(c("partner.url.value",a),c("partner.url.from","partner-domain")):(c("partner.url.value",e),c("partner.url.from","partner-url")):(c("partner.url.value",s),c("partner.url.from","fallback"))}.bind(this)(),{get:u,print:function(e){console.log(u(e))}}}var rA,nA,oA,aA,iA={name:"@bygd/gd-sdk-pes",version:"1.28.13",files:["dist/*"],scripts:{build:"NODE_ENV=production rollup --config",watch:"rollup --config --watch --sourcemap --environment DEVELOPMENT","deploy-base":"npm install && npm run build && npm publish --access public",deploy:"npm run deploy-base && gdtool pm-upload"},repository:{type:"git",url:"git@gitlab.azerdev.com:gamedistribution/gd-sdk-pes.git"},author:"",license:"ISC",devDependencies:{"@babel/core":"^7.14.6","@babel/plugin-transform-runtime":"^7.14.5","@babel/preset-env":"^7.14.7","@rollup/plugin-babel":"^5.2.3","@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-replace":"^3.0.0",postcss:"^8.3.5",rollup:"^2.52.8","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-browsersync":"^1.3.3","rollup-plugin-delete":"^2.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-postcss":"^4.0.0","rollup-plugin-terser":"^7.0.2"},dependencies:{"@babel/runtime":"^7.14.6","@bygd/gd-sdk-era":"^0.3.6",axios:"^0.26.1","can-autoplay":"^3.0.2",events:"^3.3.0","get-value":"^3.0.1","is-plain-object":"^5.0.0","is-valid-domain":"^0.1.2","js-base64":"^3.6.1","leaderboard-lib":"0.1.11","lodash.clonedeep":"^4.5.0","lodash.merge":"^4.6.2",querystringify:"^2.2.0","set-value":"^4.1.0","url-parse":"^1.4.7",uuid:"^8.3.2",validator:"^13.6.0"}},sA=function(e){var t=uA("object"===n(e)?e:function(e){if(e)try{return JSON.parse(e)}catch(e){}}(e));return t&&t.version?iA.version>=t.version?t:void 0:t},uA=function(e){var t=this;if(!B(e)||0===e.length)return e;if(1===e.length)return e[0];var n=0;e.forEach(function(e){r(this,t),e.weight=e.weight||1,n+=e.weight}.bind(this));var o=Math.floor(Math.random()*Math.floor(n));n=0;for(var a=0;a<e.length;a++){var i=e[a];if(o<(n+=i.weight))return i}},cA=function(e){var t=this;if(!rA){var n={gameId:e.gameId,hours:(new Date).getHours(),topDomain:Vh.topDomain,domain:Vh.parentDomain,referrer:Vh.parentURL,depth:Ne(),version:iA.version,byloader:Vh.isTokenGameURL,isTokenGameURL:Vh.isTokenGameURL,isMasterGameURL:Vh.isMasterGameURL,isExtHostedGameURL:Vh.isExtHostedGameURL,byloaderVersion:Vh.version,tracking:Yh.userDeclinedTracking,whitelabel:Yh.whitelabelPartner,platform:Be()};console.log("MESSAGE ROUTER ARGS",n),rA=new at(n)}return rA||{send:function(){r(this,t)}.bind(this)}},lA=[],dA=function(e){lA.push(e)},fA=function(){var e=t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(oA){e.next=4;break}return e.next=3,pA(aA);case 3:oA=e.sent;case 4:return e.abrupt("return",oA);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),pA=function(e){var t=this;nA.send("gdfw.loading",{message:"loading"}),lA=[],dA("1"),dA("2");var n=new tA;dA("3");var o=n.get("partner.domain.value");dA("4");var a=function(){return r(this,t),{gameId:e.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}.bind(this);dA("5");var i=function(){r(this,t);var n=s(),a=n?"&mode=".concat(n):"";return"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(o).concat(a,"&v=").concat(iA.version,"&localTime=").concat((new Date).getHours())}.bind(this);dA("6");var s=function(){var e=this;r(this,t);var n=new Proxy(new URLSearchParams(window.location.search),{get:function(t,n){return r(this,e),t.get(n)}.bind(this)});return!n.gd_mode&&window.location.search.includes("gd_mode")?window.location.search.split("gd_mode=")[1]:n.gd_mode}.bind(this);return dA("7"),new Promise(function(e){var n=this;if(r(this,t),oA)e(oA);else{dA("7.1");var o=a();try{dA("7.2");var s=i();dA("7.3"),fetch(s).then(function(e){return r(this,n),dA("7.4"),e.json()}.bind(this)).then(function(t){var a=this;if(r(this,n),dA("7.5"),t.success){var i,s,u,c,l=t.result.game;dA("7.6");var d={gameId:l.gameMd5,slug:l.slug,pname:l.pname,dname:l.dname,status:l.status,description:l.description,enableAds:!0===l.enableAds||!0===(null===(i=l.enableAds)||void 0===i?void 0:i.enabled),preroll:l.preRoll,midroll:6e4*l.timeAds,rewardedAds:l.rewardedAds,title:l.title,tags:l.tags,category:l.category,assets:l.assets,disp_2nd_prer:l.disp_2nd_prer,ctry_vst:l.ctry_vst,ctry:l.ctry,crtv:l.crtv,dmain:l.dmain,__t4r:l.__t4r||{},block_exts:sA(l.push_cuda),bloc_gard:sA(l.bloc_gard),cookie:sA(l.cookie),gdpr:sA(l.gdpr),diagnostic:sA(l.diagnostic),cmp:sA(l.cmp),gft:sA(l.gft)||{},sdk:sA(l.sdk)||{},sdkfw:sA(l.sdkfw)||{},loader:sA(l.loader)||{},splash:sA(l.splash)||{},promo:sA(l.promo)||{},dAds:sA(l.dads)||{},pAds:sA(l.pads)||{},mAds:sA(l.mads)||{},rAds:sA(l.rads)||{},lp:sA(l.lp)||{},extsc:sA(l.extsc)||{},evnts:sA(l.evnts)||{},dp:sA(l.dp)||{}};dA("7.7");var f=Ie(O(o),d);dA("7.8"),f.afg_disabled=!1===(null===(s=f.sdk)||void 0===s||null===(u=s.afg)||void 0===u?void 0:u.enabled),function(){r(this,a)}.bind(this),dA("7.9"),null!==(c=f.pAds)&&void 0!==c&&c.enabled&&(f.preroll=!0),dA("7.10"),nA.send("gdfw.success",{message:"success"}),e(f)}else{o.failed=!0;var p=lA[lA.length-1];nA.send("gdfw.err",{message:"".concat(p,": json error")}),e(o)}}.bind(this)).catch(function(t){r(this,n);var a=lA[lA.length-1];nA.send("gdfw.err",{message:"".concat(a,": ").concat(t.message?t.message:t)}),o.failed=!0,e(o)}.bind(this))}catch(t){var u=lA[lA.length-1];nA.send("gdfw.err",{message:"".concat(u,": global ").concat(t.message?t.message:t)}),o.failed=!0,e(o)}}}.bind(this))},hA=function(){var e=t(u.mark((function e(){var t,r;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fA();case 2:return r=e.sent,e.abrupt("return",!(null==r||null===(t=r.sdkfw)||void 0===t||!t.enabled));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),vA=function(){var e=t(u.mark((function e(){var t,r;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fA();case 2:return r=e.sent,e.next=5,hA();case 5:if(e.t0=e.sent,!e.t0){e.next=8;break}e.t0=!(null==r||null===(t=r.sdkfw)||void 0===t||!t.handshake);case 8:return e.abrupt("return",e.t0);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),mA=function(){var e=t(u.mark((function e(){var t,r,n,o,a,i,s,c;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fA();case 2:return s=e.sent,c=!(null==s||null===(t=s.extsc)||void 0===t||!t.enabled),e.abrupt("return",{enabled:c,path:c?null==s||null===(r=s.extsc)||void 0===r?void 0:r.path:"",name:c?null==s||null===(n=s.extsc)||void 0===n?void 0:n.name:"",ref:c?null==s||null===(o=s.extsc)||void 0===o?void 0:o.ref:"",loadedFlag:c?null==s||null===(a=s.extsc)||void 0===a?void 0:a.loadedFlag:void 0,loadedFlagCheck:!!c&&!(null==s||null===(i=s.extsc)||void 0===i||!i.loadedFlagCheck)});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),gA=function(){var e=t(u.mark((function e(){var t,n,o,a,i,s=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mA();case 2:if((t=e.sent).enabled){e.next=5;break}return e.abrupt("return");case 5:return n=t.path,o=t.name,a=t.ref,e.prev=6,i={},e.next=10,$e(n,o,{error_prefix:"Blocked:",exists:function(){return r(this,s),!!a&&!!window[a]}.bind(this),attrs:i});case 10:e.next=16;break;case 12:e.prev=12,e.t0=e.catch(6),console.log("extsc: error on external partner script load",o,e.t0),Ye("DEVELOPER_ERROR",e.t0,"warning");case 16:case"end":return e.stop()}}),e,this,[[6,12]])})));return function(){return e.apply(this,arguments)}}(),bA=!1,yA=!1,_A=function(){return new Promise(function(){var e=t(u.mark((function e(t,n){var o,a,i,s,c,l=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!bA){e.next=4;break}return e.abrupt("return",t(yA));case 4:bA=!0;case 5:return e.next=7,mA();case 7:if((o=e.sent).enabled){e.next=10;break}return e.abrupt("return",t(!1));case 10:if(a=o.loadedFlag,!(i=o.loadedFlagCheck)||a){e.next=13;break}return e.abrupt("return",t(!1));case 13:if(i){e.next=16;break}return yA=!0,e.abrupt("return",t(!0));case 16:s=!0,setTimeout(function(){r(this,l),s&&(s=!1,bA=!0,t(!1))}.bind(this),5e3),c=setInterval(function(){r(this,l),s&&i&&window[a]?(s=!1,bA=!0,yA=!0,clearInterval(c),t(!0)):s||clearInterval(c)}.bind(this),100);case 19:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}())},wA=function(e){var t=function(e){var t=this,n=function(e){return r(this,t),d("showAd",{adType:e})}.bind(this),o=function(e){return r(this,t),d("preloadAd",{adType:e})}.bind(this),a=function(e){return r(this,t),d("showDisplayAd",{options:e})}.bind(this),i=function(){return r(this,t),d("cancelAd")}.bind(this),s=function(){return r(this,t),d("openConsole")}.bind(this),u=function(){return r(this,t),d("showBanner")}.bind(this),c=function(){return r(this,t),d("session")}.bind(this),l=function(){r(this,t),console.log("_sendSDKReady")}.bind(this),d=function(e,n){var o=this;return r(this,t),n||(n={}),new Promise(function(t,a){r(this,o);try{var i={type:"gd-sdk",method:e,options:n};window.parent.postMessage(i,"https://html5.gamedistribution.com"),t()}catch(e){console.log("gd:adp:m:s:error",e),t()}}.bind(this))}.bind(this),f=function(){r(this,t),window.addEventListener("message",(function(e){var t=e.data;e.origin,e.source;var r=t.type,n=t.event;"gd-sdk-on-event"===r&&n&&h(n)}),!1)}.bind(this),p=function(){r(this,t),f(),d("init")}.bind(this),h=function(n){r(this,t),e.onEvent&&e.onEvent(n)}.bind(this);return{showBanner:u,showAd:n,preloadAd:o,showDisplayAd:a,cancelAd:i,openConsole:s,getSession:c,onEvent:h,init:p,_sendSDKReady:l}}(e);return t.init(),t},AA=function(){var e=this;return{isMasterGameURL:function(){r(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)}.bind(this),isTokenGameURL:function(){r(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i.test(location.href)}.bind(this),isExtHostedGameURL:function(){r(this,e);return/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i.test(location.href)}.bind(this)}},xA="gd-sdk-frame-handshake-request",kA="gd-sdk-frame-handshake-response",EA=function(e){var t=this;return new Promise(function(n,o){var a=this;r(this,t);var i={type:xA},s=!1;window.addEventListener("message",(function(e){var t=e.data,r=e.origin,o=e.source,a=t.type;if(a===xA){var i={type:kA};o.postMessage(i,r)}else a===kA&&(s=!0,n({origin:r,source:o}))})),e?n():(setTimeout(function(){r(this,a),s||n()}.bind(this),200),window.parent!==window?window.parent.postMessage(i,"*"):n())}.bind(this))},SA=function(){var e=t(u.mark((function e(){var t,r,n,o,a,i,s,c;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,hA();case 2:return t=e.sent,r=!t,e.next=6,EA(r);case 6:if(n=e.sent,t){e.next=9;break}return e.abrupt("return",!1);case 9:return o=AA(),a=o.isMasterGameURL,i=a(),e.next=13,vA();case 13:return s=e.sent,c=!1,c=s?!i&&!!n:!i,e.abrupt("return",c);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),RA=Lt,DA=ea,OA=dn,TA=on.f,IA=function(e){return function(t){for(var r,n=OA(t),o=DA(n),a=o.length,i=0,s=[];a>i;)r=o[i++],RA&&!TA.call(n,r)||s.push(e?[r,n[r]]:n[r]);return s}},MA={entries:IA(!0),values:IA(!1)}.values;Qo({target:"Object",stat:!0},{values:function(e){return MA(e)}});var LA=Qo,CA=il,PA=ht,jA=io,UA=Ol,BA=Dd,$A=_n.exports;LA({target:"Promise",proto:!0,real:!0,forced:!!CA&&PA((function(){CA.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=UA(this,jA("Promise")),r="function"==typeof e;return this.then(r?function(r){return BA(t,e()).then((function(){return r}))}:e,r?function(r){return BA(t,e()).then((function(){throw r}))}:e)}}),"function"!=typeof CA||CA.prototype.finally||$A(CA.prototype,"finally",jA("Promise").prototype.finally);var NA="\t\n\v\f\r                 \u2028\u2029\ufeff",GA=_t,FA="[\t\n\v\f\r                 \u2028\u2029\ufeff]",zA=RegExp("^"+FA+FA+"*"),ZA=RegExp(FA+FA+"*$"),HA=function(e){return function(t){var r=String(GA(t));return 1&e&&(r=r.replace(zA,"")),2&e&&(r=r.replace(ZA,"")),r}},qA={start:HA(1),end:HA(2),trim:HA(3)},KA=ht,WA=NA,VA=qA.trim;Qo({target:"String",proto:!0,forced:function(e){return KA((function(){return!!WA[e]()||"​…᠎"!="​…᠎"[e]()||WA[e].name!==e}))}("trim")},{trim:function(){return VA(this)}});var YA=Ot,QA=qu,JA=Lt,XA=ct,ex=zo,tx=function(e,t,r){var n,o;return QA&&"function"==typeof(n=t.constructor)&&n!==r&&YA(o=n.prototype)&&o!==r.prototype&&QA(e,o),e},rx=Ct.f,nx=so.f,ox=lp,ax=Ep,ix=Pp,sx=_n.exports,ux=ht,cx=Kn.set,lx=pl,dx=kr("match"),fx=XA.RegExp,px=fx.prototype,hx=/a/g,vx=/a/g,mx=new fx(hx)!==hx,gx=ix.UNSUPPORTED_Y;if(JA&&ex("RegExp",!mx||gx||ux((function(){return vx[dx]=!1,fx(hx)!=hx||fx(vx)==vx||"/a/i"!=fx(hx,"i")})))){for(var bx=function(e,t){var r,n=this instanceof bx,o=ox(e),a=void 0===t;if(!n&&o&&e.constructor===bx&&a)return e;mx?o&&!a&&(e=e.source):e instanceof bx&&(a&&(t=ax.call(e)),e=e.source),gx&&(r=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var i=tx(mx?new fx(e,t):fx(e,t),n?this:px,bx);return gx&&r&&cx(i,{sticky:r}),i},yx=function(e){e in bx||rx(bx,e,{configurable:!0,get:function(){return fx[e]},set:function(t){fx[e]=t}})},_x=nx(fx),wx=0;_x.length>wx;)yx(_x[wx++]);px.constructor=bx,bx.prototype=px,sx(XA,"RegExp",bx)}lx("RegExp");var Ax=Qo,xx=jr.find,kx=Lc,Ex="find",Sx=!0,Rx=Hr(Ex);Ex in[]&&Array(1).find((function(){Sx=!1})),Ax({target:"Array",proto:!0,forced:Sx||!Rx},{find:function(e){return xx(this,e,arguments.length>1?arguments[1]:void 0)}}),kx(Ex);var Dx=Qo,Ox=dn,Tx=[].join,Ix=yt!=Object,Mx=Br("join",",");Dx({target:"Array",proto:!0,forced:Ix||!Mx},{join:function(e){return Tx.call(Ox(this),void 0===e?",":e)}});var Lx=Qo,Cx=jr.map,Px=Hr,jx=ns("map"),Ux=Px("map");Lx({target:"Array",proto:!0,forced:!jx||!Ux},{map:function(e){return Cx(this,e,arguments.length>1?arguments[1]:void 0)}});var Bx=Ev;Qo({target:"Object",stat:!0,forced:Object.assign!==Bx},{assign:Bx});var $x=function(){function e(t){E(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return R(e,[{key:"_getFakeCustomParams",value:function(){var e={_vid:["bla_bla1","bla_bla2","bla_bla3"],_1ld:["1ld_1","1ld_2","1ld_3","1ld_4"],_1lp:["1lp_1","1lp_2"]},t={};for(var r in e){var n=e[r];t[r]=n[Math.floor(Math.random()*n.length)]}return t}},{key:"checkCustomParams",value:function(){var e=this;try{var t={},n=this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled,o=new k(location.href,!0);for(var a in o.query)t[a]=o.query[a];return Object.keys(t).filter(function(t){var n=this;return r(this,e),this.customParamKeys.some(function(e){return r(this,n),e===t}.bind(this))}.bind(this)).length>0||n?(console.log("custom-params",t,n),t):void console.log("custom-params, none")}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),Nx=function(){function e(t,r){E(this,e),this.adContainer=t,this.onResume=r}return R(e,[{key:"show",value:function(){this.adResumeButton.style.display="block",this.adResumeButtonOverlay.style.display="block"}},{key:"hide",value:function(){this.adResumeButton.style.display="none",this.adResumeButtonOverlay.style.display="none"}},{key:"add",value:function(){var e=this;try{var t=document.createElement("div");this.adResumeButton=t,t.id="gd__resume__button",t.setAttribute("title","Resume"),this.addStyles(),t.classList.add("gd__resume__button"),t.addEventListener("click",function(){r(this,e),this.onResume()}.bind(this)),this.adContainer.appendChild(t);var n=document.createElement("div");this.adResumeButtonOverlay=n,n.id="gd__resume__button__overlay",n.classList.add("gd__resume__button__overlay"),this.adContainer.appendChild(n)}catch(e){console.log("Resume button add error",e)}}},{key:"addStyles",value:function(){var e=document.body||document.getElementsByTagName("body")[0];this.addStylesheet("gd__resume__button__style",e,'\n .gd__resume__button{\n background-image: url("https://img.gamedistribution.com/play-black.svg");\n background-color:white; \n width: 120px;\n height: 120px;\n position: absolute;\n display: none;\n z-index: 2000;\n cursor: pointer;\n top: calc(50% - 60px);\n left: calc(50% - 60px);\n margin: 0;\n border-radius: 50%;\n border: 2px solid white;\n animation: play-button 1s ease-in-out infinite alternate;\n -webkit-animation: play-button 1s ease-in-out infinite alternate;\n }\n \n .gd__resume__button__overlay {\n position: fixed;\n display: none;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0,0,0,0.5);\n z-index: 1999;\n cursor: pointer;\n }\n @keyframes play-button {\n 0% {\n transform: scale(1.0);\n -webkit-transform: scale(1.0);\n }\n 100% {\n transform: scale(1.1);\n -webkit-transform: scale(1.1);\n }\n }\n .gd__resume__button:hover{\n filter: invert(100%) sepia(51%) saturate(0%) hue-rotate(346deg) brightness(104%) contrast(100%); \n }\n ')}},{key:"addStylesheet",value:function(e,t,r){if(!document.getElementById(e)){var n=document.createElement("style");n.type="text/css",n.id=e,n.styleSheet?n.styleSheet.cssText=r:n.appendChild(document.createTextNode(r)),t.appendChild(n)}}}]),e}(),Gx=new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"}),Fx=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});function zx(e){return Object.assign({muted:!1,timeout:250,inline:!1},e)}function Zx(e,t){var r=e.muted,n=e.timeout,o=e.inline,a=t(),i=a.element,s=a.source,u=void 0,c=void 0,l=void 0;return i.muted=r,!0===r&&i.setAttribute("muted","muted"),!0===o&&i.setAttribute("playsinline","playsinline"),i.src=s,new Promise((function(e){u=i.play(),c=setTimeout((function(){l(!1,new Error("Timeout "+n+" ms has been reached"))}),n),l=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;i.remove(),i.srcObject=null,clearTimeout(c),e({result:t,error:r})},void 0!==u?u.then((function(){return l(!0)})).catch((function(e){return l(!1,e)})):l(!0)}))}var Hx={audio:function(e){return Zx(e=zx(e),(function(){return{element:document.createElement("audio"),source:URL.createObjectURL(Gx)}}))},video:function(e){return Zx(e=zx(e),(function(){return{element:document.createElement("video"),source:URL.createObjectURL(Fx)}}))}},qx={exports:{}};!function(e,t){var r="__lodash_hash_undefined__",n=9007199254740991,a="[object Arguments]",i="[object Function]",s="[object Object]",u=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[a]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[i]=l["[object Map]"]=l["[object Number]"]=l[s]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var d="object"==typeof o&&o&&o.Object===Object&&o,f="object"==typeof self&&self&&self.Object===Object&&self,p=d||f||Function("return this")(),h=t&&!t.nodeType&&t,v=h&&e&&!e.nodeType&&e,m=v&&v.exports===h,g=m&&d.process,b=function(){try{var e=v&&v.require&&v.require("util").types;return e||g&&g.binding&&g.binding("util")}catch(e){}}(),y=b&&b.isTypedArray;function _(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var w,A,x=Array.prototype,k=Function.prototype,E=Object.prototype,S=p["__core-js_shared__"],R=k.toString,D=E.hasOwnProperty,O=function(){var e=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),T=E.toString,I=R.call(Object),M=RegExp("^"+R.call(D).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=m?p.Buffer:void 0,C=p.Symbol,P=p.Uint8Array,j=L?L.allocUnsafe:void 0,U=(w=Object.getPrototypeOf,A=Object,function(e){return w(A(e))}),B=Object.create,$=E.propertyIsEnumerable,N=x.splice,G=C?C.toStringTag:void 0,F=function(){try{var e=pe(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),z=L?L.isBuffer:void 0,Z=Math.max,H=Date.now,q=pe(p,"Map"),K=pe(Object,"create"),W=function(){function e(){}return function(t){if(!Ee(t))return{};if(B)return B(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function V(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Y(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Q(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function J(e){var t=this.__data__=new Y(e);this.size=t.size}function X(e,t){var r=_e(e),n=!r&&ye(e),o=!r&&!n&&Ae(e),a=!r&&!n&&!o&&Re(e),i=r||n||o||a,s=i?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],u=s.length;for(var c in e)!t&&!D.call(e,c)||i&&("length"==c||o&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||he(c,u))||s.push(c);return s}function ee(e,t,r){(void 0!==r&&!be(e[t],r)||void 0===r&&!(t in e))&&ne(e,t,r)}function te(e,t,r){var n=e[t];D.call(e,t)&&be(n,r)&&(void 0!==r||t in e)||ne(e,t,r)}function re(e,t){for(var r=e.length;r--;)if(be(e[r][0],t))return r;return-1}function ne(e,t,r){"__proto__"==t&&F?F(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}V.prototype.clear=function(){this.__data__=K?K(null):{},this.size=0},V.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},V.prototype.get=function(e){var t=this.__data__;if(K){var n=t[e];return n===r?void 0:n}return D.call(t,e)?t[e]:void 0},V.prototype.has=function(e){var t=this.__data__;return K?void 0!==t[e]:D.call(t,e)},V.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=K&&void 0===t?r:t,this},Y.prototype.clear=function(){this.__data__=[],this.size=0},Y.prototype.delete=function(e){var t=this.__data__,r=re(t,e);return!(r<0)&&(r==t.length-1?t.pop():N.call(t,r,1),--this.size,!0)},Y.prototype.get=function(e){var t=this.__data__,r=re(t,e);return r<0?void 0:t[r][1]},Y.prototype.has=function(e){return re(this.__data__,e)>-1},Y.prototype.set=function(e,t){var r=this.__data__,n=re(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Q.prototype.clear=function(){this.size=0,this.__data__={hash:new V,map:new(q||Y),string:new V}},Q.prototype.delete=function(e){var t=fe(this,e).delete(e);return this.size-=t?1:0,t},Q.prototype.get=function(e){return fe(this,e).get(e)},Q.prototype.has=function(e){return fe(this,e).has(e)},Q.prototype.set=function(e,t){var r=fe(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},J.prototype.clear=function(){this.__data__=new Y,this.size=0},J.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},J.prototype.get=function(e){return this.__data__.get(e)},J.prototype.has=function(e){return this.__data__.has(e)},J.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Y){var n=r.__data__;if(!q||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Q(n)}return r.set(e,t),this.size=r.size,this};var oe,ae=function(e,t,r){for(var n=-1,o=Object(e),a=r(e),i=a.length;i--;){var s=a[oe?i:++n];if(!1===t(o[s],s,o))break}return e};function ie(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":G&&G in Object(e)?function(e){var t=D.call(e,G),r=e[G];try{e[G]=void 0;var n=!0}catch(e){}var o=T.call(e);n&&(t?e[G]=r:delete e[G]);return o}(e):function(e){return T.call(e)}(e)}function se(e){return Se(e)&&ie(e)==a}function ue(e){return!(!Ee(e)||function(e){return!!O&&O in e}(e))&&(xe(e)?M:u).test(function(e){if(null!=e){try{return R.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ce(e){if(!Ee(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=ve(e),r=[];for(var n in e)("constructor"!=n||!t&&D.call(e,n))&&r.push(n);return r}function le(e,t,r,n,o){e!==t&&ae(t,(function(a,i){if(o||(o=new J),Ee(a))!function(e,t,r,n,o,a,i){var u=me(e,r),c=me(t,r),l=i.get(c);if(l)return void ee(e,r,l);var d=a?a(u,c,r+"",e,t,i):void 0,f=void 0===d;if(f){var p=_e(c),h=!p&&Ae(c),v=!p&&!h&&Re(c);d=c,p||h||v?_e(u)?d=u:Se(_=u)&&we(_)?d=function(e,t){var r=-1,n=e.length;t||(t=Array(n));for(;++r<n;)t[r]=e[r];return t}(u):h?(f=!1,d=function(e,t){if(t)return e.slice();var r=e.length,n=j?j(r):new e.constructor(r);return e.copy(n),n}(c,!0)):v?(f=!1,m=c,g=!0?(b=m.buffer,y=new b.constructor(b.byteLength),new P(y).set(new P(b)),y):m.buffer,d=new m.constructor(g,m.byteOffset,m.length)):d=[]:function(e){if(!Se(e)||ie(e)!=s)return!1;var t=U(e);if(null===t)return!0;var r=D.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&R.call(r)==I}(c)||ye(c)?(d=u,ye(u)?d=function(e){return function(e,t,r,n){var o=!r;r||(r={});var a=-1,i=t.length;for(;++a<i;){var s=t[a],u=n?n(r[s],e[s],s,r,e):void 0;void 0===u&&(u=e[s]),o?ne(r,s,u):te(r,s,u)}return r}(e,De(e))}(u):Ee(u)&&!xe(u)||(d=function(e){return"function"!=typeof e.constructor||ve(e)?{}:W(U(e))}(c))):f=!1}var m,g,b,y;var _;f&&(i.set(c,d),o(d,c,n,a,i),i.delete(c));ee(e,r,d)}(e,t,i,r,le,n,o);else{var u=n?n(me(e,i),a,i+"",e,t,o):void 0;void 0===u&&(u=a),ee(e,i,u)}}),De)}function de(e,t){return ge(function(e,t,r){return t=Z(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=Z(n.length-t,0),i=Array(a);++o<a;)i[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(i),_(e,this,s)}}(e,t,Ie),e+"")}function fe(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function pe(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return ue(r)?r:void 0}function he(e,t){var r=typeof e;return!!(t=null==t?n:t)&&("number"==r||"symbol"!=r&&c.test(e))&&e>-1&&e%1==0&&e<t}function ve(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||E)}function me(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ge=function(e){var t=0,r=0;return function(){var n=H(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(F?function(e,t){return F(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:Ie);function be(e,t){return e===t||e!=e&&t!=t}var ye=se(function(){return arguments}())?se:function(e){return Se(e)&&D.call(e,"callee")&&!$.call(e,"callee")},_e=Array.isArray;function we(e){return null!=e&&ke(e.length)&&!xe(e)}var Ae=z||function(){return!1};function xe(e){if(!Ee(e))return!1;var t=ie(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}function Ee(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Se(e){return null!=e&&"object"==typeof e}var Re=y?function(e){return function(t){return e(t)}}(y):function(e){return Se(e)&&ke(e.length)&&!!l[ie(e)]};function De(e){return we(e)?X(e,!0):ce(e)}var Oe,Te=(Oe=function(e,t,r){le(e,t,r)},de((function(e,t){var r=-1,n=t.length,o=n>1?t[n-1]:void 0,a=n>2?t[2]:void 0;for(o=Oe.length>3&&"function"==typeof o?(n--,o):void 0,a&&function(e,t,r){if(!Ee(r))return!1;var n=typeof t;return!!("number"==n?we(r)&&he(t,r.length):"string"==n&&t in r)&&be(r[t],e)}(t[0],t[1],a)&&(o=n<3?void 0:o,n=1),e=Object(e);++r<n;){var i=t[r];i&&Oe(e,i,r,o)}return e})));function Ie(e){return e}e.exports=Te}(qx,qx.exports);var Kx=qx.exports;function Wx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vx(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wx(Object(r),!0).forEach((function(t){oa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wx(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yx(e){return null!=e&&e.error_url?"<vmap:VASTAdData>".concat(function(e){return e.promo_url?'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),"</vmap:VASTAdData>").trim():'<vmap:AdTagURI templateType="vast3"><![CDATA['.concat(null==e?void 0:e.adtag_url,"]]></vmap:AdTagURI>").trim()}var Qx,Jx={exports:{}},Xx="object"==typeof Reflect?Reflect:null,ek=Xx&&"function"==typeof Xx.apply?Xx.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};Qx=Xx&&"function"==typeof Xx.ownKeys?Xx.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var tk=Number.isNaN||function(e){return e!=e};function rk(){rk.init.call(this)}Jx.exports=rk,Jx.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}fk(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&fk(e,"error",t,r)}(e,o,{once:!0})}))},rk.EventEmitter=rk,rk.prototype._events=void 0,rk.prototype._eventsCount=0,rk.prototype._maxListeners=void 0;var nk=10;function ok(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function ak(e){return void 0===e._maxListeners?rk.defaultMaxListeners:e._maxListeners}function ik(e,t,r,n){var o,a,i,s;if(ok(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),i=a[t]),void 0===i)i=a[t]=r,++e._eventsCount;else if("function"==typeof i?i=a[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),(o=ak(e))>0&&i.length>o&&!i.warned){i.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=i.length,s=u,console&&console.warn&&console.warn(s)}return e}function sk(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function uk(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=sk.bind(n);return o.listener=r,n.wrapFn=o,o}function ck(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):dk(o,o.length)}function lk(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function dk(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function fk(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(a){n.once&&e.removeEventListener(t,o),r(a)}))}}function pk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function hk(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pk(Object(r),!0).forEach((function(t){oa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pk(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object.defineProperty(rk,"defaultMaxListeners",{enumerable:!0,get:function(){return nk},set:function(e){if("number"!=typeof e||e<0||tk(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");nk=e}}),rk.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},rk.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||tk(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},rk.prototype.getMaxListeners=function(){return ak(this)},rk.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var i=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw i.context=a,i}var s=o[e];if(void 0===s)return!1;if("function"==typeof s)ek(s,this,t);else{var u=s.length,c=dk(s,u);for(r=0;r<u;++r)ek(c[r],this,t)}return!0},rk.prototype.addListener=function(e,t){return ik(this,e,t,!1)},rk.prototype.on=rk.prototype.addListener,rk.prototype.prependListener=function(e,t){return ik(this,e,t,!0)},rk.prototype.once=function(e,t){return ok(t),this.on(e,uk(this,e,t)),this},rk.prototype.prependOnceListener=function(e,t){return ok(t),this.prependListener(e,uk(this,e,t)),this},rk.prototype.removeListener=function(e,t){var r,n,o,a,i;if(ok(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){i=r[a].listener,o=a;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,i||t)}return this},rk.prototype.off=rk.prototype.removeListener,rk.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(o=a[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},rk.prototype.listeners=function(e){return ck(this,e,!0)},rk.prototype.rawListeners=function(e){return ck(this,e,!1)},rk.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):lk.call(e,t)},rk.prototype.listenerCount=lk,rk.prototype.eventNames=function(){return this._eventsCount>0?Qx(this._events):[]};var vk=new Jx.exports.EventEmitter,mk=null,gk=function(){function e(t,n,o){var a=this;if(E(this,e),mk)return mk;mk=this;var i={debug:!1,width:640,height:360,locale:"en"};this.options=n?Ie(i,n):i,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new nt,this.safetyTimer=null,this.containerTransitionSpeed=0,this.adCounter={},this.adPrerollCount=0,this.adMidrollCount=0,this.adRewardedCount=0,this.preloadedAdType=null,this.requestRunning=!1,this.parentDomain=o.parentDomain,this.topDomain=o.topDomain,this.parentURL=o.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags={interstitial:["https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=","https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dredirectlinear&correlator=","https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dredirecterror&correlator="],rewarded:["https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator="]},this.atom_display,this.adType_="",this.clickCount={midroll:0,preroll:0,rewarded:0},this.userAllowedPersonalizedAds=document.location.search.indexOf("gdpr-targeting=0")>=0||document.cookie.indexOf("ogdpr_advertisement=0")>=0?"0":"1",this.parentDomain.includes("girlsgogames")&&(this.userAllowedPersonalizedAds=!1),this.thirdPartyContainer=""!==t?document.getElementById(t):null,this.options.width="number"==typeof this.options.width?this.options.width:"100%"===this.options.width?640:this.options.width.replace(/[^0-9]/g,""),this.options.height="number"==typeof this.options.height?this.options.height:"100%"===this.options.height?360:this.options.height.replace(/[^0-9]/g,"");var s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,u=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:s,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:u,this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){r(this,a),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){r(this,a),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var n,o,a,i,s,l,d,f,p,h,v,m,g,b,y,_,w,A,x,S,D;return R(e,[{key:"start",value:(D=t(u.mark((function e(){var t=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._init_afg_script({adsense_channel:"4089988593"});case 3:return e.next=5,this._init_hl_script();case 5:return e.next=7,this._init_ima_script();case 7:this._createPlayer(),this._setUpIMA(),window.eventTest=function(e){r(this,t),this.eventBus.broadcast(e,{message:"",status:"success"})}.bind(this),e.next=15;break;case 12:throw e.prev=12,e.t0=e.catch(0),new Error(e.t0);case 15:case"end":return e.stop()}}),e,this,[[0,12]])}))),function(){return D.apply(this,arguments)})},{key:"_getAdVast",value:function(e,n){var o=this;return new Promise(function(){var a=t(u.mark((function t(a){var i,s,c,l,d,f,p,h,v=this;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(He&&Ze("gd_debug_ex")&&Ze("gd_tag"))){t.next=6;break}return i=o.IMASampleTags[e],s=Math.floor(Math.random()*i.length),c=i[s],a({url:c}),t.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){t.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return t.prev=8,l=o.nextAdPosition(e),o.eventBus.broadcast("AD_REQUEST",{message:l}),d=o.options,"preroll"===l&&I(d.preroll)?d=d.preroll:"midroll"===l&&I(d.midroll)?d=d.midroll:"rewarded"===l&&I(d.rewarded)&&(d=d.rewarded),f="rewarded"===l?"rewardedVideo":"gdbanner"===l?"gd__banner":"midroll"===l?"midroll":"video1",t.next=16,window.idhb.isLoaded();case 16:if(p={tnl_keys:hk(hk({},window.idhb.getAdserverTargetingForAdSlot(f)),{},{tnl_ad_pos:l,tnl_asset_id:o.gameData.gameId})},!(n&&n.retry_on_success&&I(d.retry_on_success)&&I(d.retry_on_success.vast))){t.next=21;break}return t.abrupt("return",a(o._createCustomAdVastUrl(d.retry_on_success.vast,p)));case 21:if(!(n&&n.retry_on_failure&&o.options.retry_on_failure&&I(d.retry_on_failure.vast))){t.next=25;break}return t.abrupt("return",a(o._createCustomAdVastUrl(d.retry_on_failure.vast,p)));case 25:if(!I(d.vast)){t.next=27;break}return t.abrupt("return",a(o._createCustomAdVastUrl(d.vast,p)));case 27:return t.next=29,o._create_dp_context(l,n);case 29:h=t.sent,window.idhb.requestAds({slots:oa({},f,{bidFloor:null!=h&&h.floor_price?h.floor_price:void 0}),callback:function(e,t){var n=this;r(this,v),!h||null!=t&&t.bidFloorApplied||fetch(h.skip_url).catch(function(e){r(this,n)}.bind(this)),a({tnl_keys:hk(hk({},window.idhb.getAdserverTargetingForAdSlot(f)),{},{tnl_ad_pos:l,tnl_asset_id:o.gameData.gameId}),url:e,dp:h,hl:t})}.bind(this)}),t.next=36;break;case 33:throw t.prev=33,t.t0=t.catch(8),new Error(t.t0);case 36:case"end":return t.stop()}}),t,this,[[8,33]])})));return function(e){return a.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===Te.Rewarded)return this.adRewardedCount++,"rewarded";if(e===Te.Interstitial){var t=!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount;return t?this.adMidrollCount++:this.adPrerollCount++,t||this.adMidrollCount>0?"midroll":"preroll"}return"midroll"}},{key:"getAdPosition",value:function(e){return e===Te.Rewarded?"rewarded":e===Te.Interstitial?!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_requestPromo",value:function(e,t){var r=new google.ima.AdsRequest;return r.adsResponse=function(e){return'<VAST version="3.0"> \n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA['.concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,"]]></VASTAdTagURI> \n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),r.linearAdSlotWidth=this.options.width,r.linearAdSlotHeight=this.options.height,r.nonLinearAdSlotWidth=this.options.width,r.nonLinearAdSlotHeight=this.options.height,r.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(r.vastLoadTimeout=this.options.vast_load_timeout),r.setAdWillAutoPlay(t.autoplayAllowed),r.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(r),r}},{key:"_requestAd",value:function(e,t){var n=this;return t=t||{},new Promise(function(o){if(r(this,n),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var a,i=null==e||null===(a=e.tnl_keys)||void 0===a?void 0:a.tnl_ad_pos;this.adSuccess=!1;var s=new google.ima.AdsRequest,u=this._transformVast(e,t),c=hk(hk({},t),{},{adTag:u,tnl_ad_pos:i});this.adCounter[i]=this.adCounter[i]||0,this.adCounter[i]++;var l=e.dp,d=e.hl;if(l&&(l.adtag_url=u.url,this._extend_dp_with_adsense(l,d,null==e?void 0:e.tnl_keys)),this._isVMAP(i)){var f=function(e){var t=e.position||"midroll",r=e.dp_1,n=e.dp_2,o=Date.now(),a=new k(e.adtag_url_1,!0);a.query=Vx(Vx({},a.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:o,output:"xml_vast3"});var i=a.toString(),s=new k(e.adtag_url_2,!0);s.query=Vx(Vx({},s.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++o,output:"xml_vast3"});var u=s.toString(),c=Date.now();return'<?xml version="1.0" encoding="UTF-8"?>\n<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-1">\n <vmap:AdSource id="'.concat(c++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(Yx({id:c++,adtag_url:i,error_url:null==r?void 0:r.error_url,impression_url:null==r?void 0:r.impression_url}),'\n </vmap:AdSource>\n</vmap:AdBreak>\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-2">\n <vmap:AdSource id="').concat(c++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(Yx({id:c++,adtag_url:u,error_url:null==n?void 0:n.error_url,impression_url:null==n?void 0:n.impression_url}),'\n </vmap:AdSource>\n <vmap:Extensions>\n <vmap:Extension type="bumper" suppress_bumper="true"></vmap:Extension>\n </vmap:Extensions>\n</vmap:AdBreak>\n</vmap:VMAP>').trim()}(this._get_vmap_context({dp:l,adtag:u,position:"preroll"===c.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(i)}));s.adsResponse=f}else if(l&&d.bidFloorApplied){var p=function(e){return e.promo_url?e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="2" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(l);s.adsResponse=p}else if(l&&l.fallback_url){var h=function(e){return'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim()}(l);s.adsResponse=h}else s.adTagUrl=u.url;s.linearAdSlotWidth=this.options.width,s.linearAdSlotHeight=this.options.height,s.nonLinearAdSlotWidth=this.options.width,s.nonLinearAdSlotHeight=this.options.height,s.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(s.vastLoadTimeout=this.options.vast_load_timeout),s.setAdWillAutoPlay(t.autoplayAllowed),s.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(s,c);try{this.eventBus.broadcast("AD_SDK_REQUEST",{message:c})}catch(e){}o(s)}catch(e){throw new Error(e)}}.bind(this))}},{key:"cancel",value:function(){if(!1!==this.requestRunning){this.requestRunning=!1,this._resetAdsLoader(),this._hide("cancel");var e="AD_SDK_CANCELED";this.eventBus.broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameData.gameId}})}}},{key:"_checkAutoPlay",value:(S=t(u.mark((function e(){var t=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var o=this;r(this,t);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):Hx.video({inline:!0,muted:!1}).then(function(t){r(this,o);var n=t.result;t.error,e(!0===n?{autoplayAllowed:!0,autoplayRequiresMute:!1}:{autoplayAllowed:!0,autoplayRequiresMute:!0})}.bind(this))}.bind(this)));case 1:case"end":return e.stop()}}),e,this)}))),function(){return S.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(x=t(u.mark((function e(){var t;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._checkAutoPlay(!1);case 2:return t=e.sent,this._autoplay=t,this.video_ad_player.autoplay=t.autoplayAllowed,this.video_ad_player.volume=t.autoplayRequiresMute?0:1,this.video_ad_player.muted=!!t.autoplayRequiresMute,t.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0),e.abrupt("return",t);case 9:case"end":return e.stop()}}),e,this)}))),function(){return x.apply(this,arguments)})},{key:"startAd",value:(A=t(u.mark((function e(t){var r,n,o;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.gameData.afg_disabled,n=t.adType,o=t.params,this.adType_=n,"promo"!==(null==o?void 0:o.adapter)){e.next=5;break}return e.abrupt("return",this._startPromo(o,n));case 5:if(n!==Te.Interstitial){e.next=25;break}if(!r){e.next=10;break}return e.abrupt("return",this._startInterstitialAd(o));case 10:if("preroll"!==(null==o?void 0:o.position)||"adsense"!==(null==o?void 0:o.adapter)){e.next=14;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 14:if("start"!==(null==o?void 0:o.position)||"adsense"!==(null==o?void 0:o.adapter)){e.next=18;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 18:if("next"!==(null==o?void 0:o.position)||"adsense"!==(null==o?void 0:o.adapter)){e.next=22;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 22:return e.abrupt("return",this._startInterstitialAd(o));case 23:e.next=34;break;case 25:if(n!==Te.Rewarded){e.next=33;break}if(!r){e.next=30;break}return e.abrupt("return",this._startRewardedAd(o));case 30:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 31:e.next=34;break;case 33:throw new Error("Unsupported ad type");case 34:case"end":return e.stop()}}),e,this)}))),function(e){return A.apply(this,arguments)})},{key:"preloadAd",value:(w=t(u.mark((function e(t){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==Te.Interstitial){e.next=4;break}return e.abrupt("return","gdsdk://preloaded");case 4:if(t!==Te.Rewarded){e.next=8;break}return e.abrupt("return","gdsdk://preloaded");case 8:throw new Error("Unsupported ad type");case 9:case"end":return e.stop()}}),e)}))),function(e){return w.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,t=function(){r(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new Nx(this.adContainer,t),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(_=t(u.mark((function e(n){var o=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=t(u.mark((function e(t,a){var i,s,c,l,d,f,p,h,v,m=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(s=n?n.containerId:null)||a("Container id is not specified"),c=document.getElementById(s),document.getElementById(s)||a("No container is found with this id - ".concat(s)),void 0===window.idhb.requestAds&&a("Prebid.js wrapper script hit an error or didn't exist!"),l=n.slotId?n.slotId:"gd__banner@".concat(s),document.getElementById(l)||(d="\n .gd__banner{\n z-index: ".concat(et.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((f=document.createElement("style")).type="text/css",f.id="gd__banner__style",f.styleSheet?f.styleSheet.cssText=d:f.appendChild(document.createTextNode(d)),c.appendChild(f)),(p=document.createElement("div")).id=l,p.classList.add("gd__banner"),c.appendChild(p)),e.next=10,o._create_dp_display_context();case 10:o.atom_display=e.sent,null!==(i=o.atom_display)&&void 0!==i&&i.params&&window.idhb.setAdserverTargeting(null===(h=o.atom_display)||void 0===h?void 0:h.params),(v={})[l]={maxSize:[c.offsetWidth,c.offsetHeight]},window.idhb.requestAds({slots:v,callback:function(e){r(this,m)}.bind(this)}),t(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),a(e.t0.message||e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(t,r){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return _.apply(this,arguments)})},{key:"_startInterstitialAd",value:(y=t(u.mark((function e(t){var n,o=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){r(this,o)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return n=e.sent,e.next=13,this._loadInterstitialAd(hk(hk({},n),t));case 13:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=22;break;case 18:throw e.prev=18,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(e){return y.apply(this,arguments)})},{key:"_startPromo",value:(b=t(u.mark((function e(t,r){var n;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,this.adSuccess=!1,e.next=8,this._initDisplayContainerWithAutoPlay();case 8:return n=e.sent,e.next=11,this._loadPromo(hk(hk({},n),t),r);case 11:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),this.msgrt.send("promo.adsense",{message:"".concat(t.position," success")}),e.next=22;break;case 17:throw e.prev=17,e.t0=e.catch(0),this.msgrt.send("promo.adsense",{message:"".concat(t.position," failure,").concat(e.t0.message?e.t0.message:e.t0)}),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,17]])}))),function(e,t){return b.apply(this,arguments)})},{key:"_loadPromo",value:(g=t(u.mark((function e(t,n){var o,a,i,s=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._resetAdsLoader(),e.prev=1,o=this.nextAdPosition(n),a=this._create_promo_context(o),i=this._requestPromo(a,hk({adType:Te.Interstitial},t)),e.next=7,new Promise(function(e,t){var n=this;r(this,s);var o="videoad.preloadad";this.eventBus.unsubscribeScope(o);var a=function(t){r(this,n),this.eventBus.unsubscribeScope(o),e(t.message)}.bind(this),i=function(e){r(this,n),this.eventBus.unsubscribeScope(o),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,o),this.eventBus.subscribe("AD_SDK_CANCELED",i,o),this.eventBus.subscribe("AD_ERROR",i,o),vk.once("AD_ERROR",function(e){r(this,n),i(e)}.bind(this))}.bind(this));case 7:return e.abrupt("return",i);case 10:throw e.prev=10,e.t0=e.catch(1),new Error(e.t0);case 13:case"end":return e.stop()}}),e,this,[[1,10]])}))),function(e,t){return g.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(m=t(u.mark((function e(t){var n,o,a=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(Te.Interstitial,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(n,hk({adType:Te.Interstitial},t));case 11:return o=e.sent,e.next=14,new Promise(function(e,t){var n=this;r(this,a);var o="videoad.preloadad";this.eventBus.unsubscribeScope(o);var i=function(t){r(this,n),this.eventBus.unsubscribeScope(o),e(t.message)}.bind(this),s=function(e){r(this,n),this.eventBus.unsubscribeScope(o),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",i,o),this.eventBus.subscribe("AD_SDK_CANCELED",s,o),this.eventBus.subscribe("AD_ERROR",s,o)}.bind(this));case 14:return e.abrupt("return",o);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return m.apply(this,arguments)})},{key:"_startRewardedAd",value:(v=t(u.mark((function e(t){var n,o=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){r(this,o)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return n=e.sent,e.next=13,this._loadRewardedAd(hk(hk({},n),t));case 13:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=22;break;case 18:throw e.prev=18,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(e){return v.apply(this,arguments)})},{key:"_loadRewardedAd",value:(h=t(u.mark((function e(t){var n,o,a=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(Te.Rewarded,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(n,hk({adType:Te.Rewarded},t));case 11:return o=e.sent,e.next=14,new Promise(function(e,t){var n=this;r(this,a);var o="videoad.preloadad";this.eventBus.unsubscribeScope(o);var i=function(t){r(this,n),this.eventBus.unsubscribeScope(o),e(t.message)}.bind(this),s=function(e){r(this,n),this.eventBus.unsubscribeScope(o),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",i,o),this.eventBus.subscribe("AD_SDK_CANCELED",s,o),this.eventBus.subscribe("AD_ERROR",s,o)}.bind(this));case 14:return e.abrupt("return",o);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return h.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(p=t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(Te.Interstitial);case 5:e.t0=e.sent;case 6:return this.preloadedInterstitialAdVast=e.t0,e.abrupt("return",this.preloadedInterstitialAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return p.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(f=t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(Te.Rewarded);case 5:e.t0=e.sent;case 6:return this.preloadedRewardedAdVast=e.t0,e.abrupt("return",this.preloadedRewardedAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return f.apply(this,arguments)})},{key:"_onError",value:function(e){this.cancel(),this._clearSafetyTimer("ERROR")}},{key:"_hide",value:function(e){this.video_ad_player.src="",this.activeAdContainer&&(this.activeAdContainer.style.visibility="hidden")}},{key:"_show",value:function(e){var t=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var n=null==e?void 0:e.mode;e.t4r=sA(this.gameData.__t4r)||{};var o=this._isT4R(e),a=this._getT4ROptions(e);if("loaded"===n)this.activeAdContainer.style.opacity=o?.001:1,o&&this.adsManager.setVolume(0),o&&this.eventBus.broadcast("AD_T4R"),o&&setTimeout(function(){r(this,t),this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}.bind(this),((null==a?void 0:a.min)||1234)+Math.random()*((null==a?void 0:a.max)||3210));else if("click"===n||"first_quartile"===n){if(o&&"click"===n){var i,s=null===(i=this._adrequest_user_context)||void 0===i?void 0:i.tnl_ad_pos;this.clickCount[s]++}this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}}}},{key:"_createPlayer",value:function(){var e=this,t=document.body||document.getElementsByTagName("body")[0];this.adContainer=document.createElement("div"),this.adContainer.id="".concat(this.prefix,"advertisement"),this.adContainer.style.position=this.thirdPartyContainer?"absolute":"fixed",this.adContainer.style.zIndex=Xe.zIndex,this.adContainer.style.top="0",this.adContainer.style.left="0",this.adContainer.style.width="100%",this.adContainer.style.height="100%",this.thirdPartyContainer&&(this.thirdPartyContainer.style.transform=null);var n=document.createElement("video");n.setAttribute("playsinline",!0),n.setAttribute("webkit-playsinline",!0),n.id="".concat(this.prefix,"advertisement_video"),n.style.position="absolute",n.style.backgroundColor="#000000",n.style.top="0",n.style.left="0",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px",this.video_ad_player=n,this.adContainer.appendChild(n);var o=document.createElement("div");o.id="".concat(this.prefix,"advertisement_slot"),o.style.position="absolute",o.style.top="0",o.style.left="0",o.style.width=this.options.width+"px",o.style.height=this.options.height+"px",this.adContainerInner=o,this.activeAdContainer=this.adContainer,window.activeAdContainer=this.activeAdContainer,this.thirdPartyContainer?(this.adContainer.appendChild(o),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(o),t.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var a=function(){r(this,e);var t=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:t,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:a,o.style.width=this.options.width+"px",o.style.height=this.options.height+"px",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px"}.bind(this);window.addEventListener("resize",a),window.document.addEventListener("DOMContentLoaded",a)}},{key:"_setUpIMA",value:function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.adContainerInner,this.video_ad_player),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setDisableCustomPlaybackForIOS10Plus(!0),this.adsLoader.getSettings().setLocale(this.options.locale),this.adsLoader.getSettings().setVpaidMode(this._getVPAIDMode()),this.adsLoader.getSettings().setAutoPlayAdBreaks(!0);var e=this.adsLoader.getSettings().getNumRedirects();this.adsLoader.getSettings().setNumRedirects(2*e),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1,this),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError,!1,this)}},{key:"_onAdsManagerLoaded",value:function(e){var t=this,n=new google.ima.AdsRenderingSettings;n.autoAlign=!1,n.enablePreloading=!1,n.restoreCustomPlaybackStateOnAdBreakComplete=!0,n.useStyledNonLinearAds=!0,n.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(this.video_ad_player,n),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError.bind(this),!1,this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_METADATA,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CLICK,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.DURATION_CHANGE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.FIRST_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.IMPRESSION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.INTERACTION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LINEAR_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.MIDPOINT,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.THIRD_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.USER_CLOSE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_MUTED,this._onAdEvent.bind(this),this),window.addEventListener("resize",function(){r(this,t),this.adsManager&&this.adsManager.resize(this.options.width,this.options.height,google.ima.ViewMode.NORMAL)}.bind(this)),this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0);var o=new Date,a=o.getHours(),i=o.getDate(),s=o.getMonth(),u=o.getFullYear(),c="AD_SDK_MANAGER_READY";this.eventBus.broadcast(c,{name:c,message:"AD SDK is ready",status:"success",analytics:{category:c,action:this.parentDomain,label:"h".concat(a," d").concat(i," m").concat(s," y").concat(u)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var t,r,n,o=new Date,a=o.getHours(),i=o.getDate(),s=o.getMonth(),u=o.getFullYear(),c=(r=google.ima.AdEvent.Type,n=e.type,Object.keys(r).find((function(e){return r[e]===n}))),l=!1,d=(null==e||null===(t=e.getAd())||void 0===t?void 0:t.getContentType())||"",f=!d.startsWith("image")&&!d.startsWith("text");this._sendIMAEventsToHB(e);var p="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:p="Fired when an ad rule or a VMAP ad break would have played if autoPlayAdBreaks is false.";break;case google.ima.AdEvent.Type.AD_METADATA:p="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:l=!0,p="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:p="Fired when the ad is clicked.";var h=e.getAd().getContentType();this._show({mode:"click",contentType:h});break;case google.ima.AdEvent.Type.COMPLETE:l=this._is_completed(e.getAd()),p="Fired when the ad completes playing.",this.adType_===Te.Rewarded&&this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:p="Fired when content should be paused. This usually happens right before an ad is about to cover the content.";break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:p="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",l=!0,this._hideAddResume();break;case google.ima.AdEvent.Type.DURATION_CHANGE:p="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:p="Fired when the ad playhead crosses first quartile.";var v=e.getAd().getContentType();this._show({mode:"first_quartile",contentType:v});break;case google.ima.AdEvent.Type.IMPRESSION:p="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:p="Fired when an ad triggers the interaction callback. Ad interactions contain an interaction ID string in the ad data.";break;case google.ima.AdEvent.Type.LINEAR_CHANGED:p="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var m=e.getAd().getContentType();p=m,this._show({mode:"loaded",contentType:m});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(p=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:p="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:f&&this.adResume.show(),p="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:p="Fired when the ad is resumed.",f&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:p="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:l=this._is_completed(e.getAd()),p="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:this._hideAddResume(),p="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:p="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:l=this._is_completed(e.getAd()),p="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:p="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:p="Fired when the ad volume has been muted."}""!==c&&""!==p&&this.eventBus.broadcast(c,{name:c,message:p,status:"success",analytics:{category:c,action:this.parentDomain,label:"h".concat(a," d").concat(i," m").concat(s," y").concat(u)}}),l&&!this.adSuccess&&(this.adSuccess=!0,this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.resetForNext(e))}},{key:"_onAdError",value:function(e){this.requestRunning=!1,this._resetAdsLoader(),this._clearSafetyTimer("ERROR"),this._hide("_onAdError"),this._sendIMAEventsToHB(e);try{var t="AD_ERROR",r=e.getError(),n=r.getErrorCode().toString()||r.getVastErrorCode().toString(),o=this._getInnerErrorCode(r);vk.emit("AD_ERROR",n),this.eventBus.broadcast(t,{message:n,details:o,status:"warning",analytics:{category:t,action:o,label:n}}),this._hideAddResume()}catch(e){}}},{key:"_hideAddResume",value:function(){try{this.adResume&&this.adResume.hide()}catch(e){console.log("Error on hide adResume",e)}}},{key:"_sendIMAEventsToHB",value:function(e){if(window.idhb&&"function"==typeof window.idhb.onImaEvent)try{window.idhb.onImaEvent({event:e})}catch(e){}}},{key:"_resetAdsLoader",value:function(){this.adsManager&&(this.adsManager.destroy(),this.adsManager=null,this._adrequest_user_context=null),this.adsLoader&&this.adsLoader.contentComplete()}},{key:"_startSafetyTimer",value:function(e,t){var n=this;this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=window.setTimeout(function(){r(this,n),this.cancel(),this._clearSafetyTimer(t)}.bind(this),e)}},{key:"_clearSafetyTimer",value:function(e){void 0!==this.safetyTimer&&null!==this.safetyTimer&&(clearTimeout(this.safetyTimer),this.safetyTimer=void 0)}},{key:"_getVPAIDMode",value:function(){return google.ima.ImaSdkSettings.VpaidMode.ENABLED}},{key:"_getPrebidScripts",value:function(){var e=["https://hb.improvedigital.com/pbw/headerlift.min.js","http://hb.improvedigital.com/pbw/headerlift.min.js"];return this.options.hb_script?[this.options.hb_script].concat(e):e}},{key:"_getInnerErrorCode",value:function(e){if($(e.getInnerError)){var t=e.getInnerError();if(t)return $(t.getErrorCode)&&$(t.getVastErrorCode)?t.getErrorCode().toString()||t.getVastErrorCode().toString():t.message}}},{key:"resetForNext",value:function(){this.requestRunning=!1,this._hide("resetForNext")}},{key:"_createCustomAdVastUrl",value:function(e,t){var n=this;if(e){var o=this.macros.transform(e,{get:function(e){if(r(this,n),t&&t.tnl_keys)return t.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in o.query||{}){var i=o.query[a];I(i)&&(o.query[a]=c.stringify(i))}var s=new k(o.url,!0);return Kx(s.query,o.query||{}),hk({url:s.toString()},t)}}},{key:"_transformVast",value:function(e,t){var r={url:e.url};try{var n=new k(e.url,!0),o=this._transformQuery(e,t,n);o&&(r.url=n.toString());var a=o?n:new k(e.url,!0);if(a.query.cust_params){var i=c.parse(a.query.cust_params);r.bidder=i.hb_bidder,r.cust_params=i}r.url_parsed=a}catch(e){r.hasError=!0,r.message=e.message,r.bidder="error",console.log(e.message)}return r}},{key:"_transformQuery",value:function(e,t,n){var o=this;if(e&&t&&e.tnl_keys){var a=this.options.vast_query;if(t.retry_on_success&&this.options.retry_on_success&&I(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:t.retry_on_failure&&this.options.retry_on_failure&&I(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),I(a=O(a))){var i=n.query;if(a.$$remove){for(var s in i){new RegExp(a.$$remove,"i").test(s)&&delete i[s]}delete a.$$remove}var u=c.parse(i.cust_params);if(a.cust_params&&a.cust_params.$$remove){for(var l in u){new RegExp(a.cust_params.$$remove,"i").test(l)&&delete u[l]}delete a.cust_params.$$remove}var d=this.macros.transform(a,{get:function(t){return r(this,o),e.tnl_keys[t.toLowerCase()]}.bind(this)});return i.cust_params=u,Kx(i,d),i.cust_params=c.stringify(i.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,r,n,o,a=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(this.clickCount[a]>=(null===(r=e.t4r[a])||void 0===r?void 0:r.count))return!1;if(console.log("t4r options.contentType",null==e?void 0:e.contentType,a),null!=e&&null!==(n=e.contentType)&&void 0!==n&&n.startsWith("image/")||"text"===(null==e?void 0:e.contentType))return a&&(null===(o=e.t4r[a])||void 0===o?void 0:o.enabled);if(null!=e&&e.contentType.startsWith("video/")){var i,s=(null===(i=e.t4r[a])||void 0===i?void 0:i.viper)||0;if(s>0){var u,c=Math.random()<s;return a&&c&&(null===(u=e.t4r[a])||void 0===u?void 0:u.enabled)}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,r,n,o,a,i,s,u,c,l,d,f,p,h,v;if(!e)return!1;var m="preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(r=t.pAds)||void 0===r?void 0:r.vmap)||!0===(null===(n=this.gameData)||void 0===n||null===(o=n.pAds)||void 0===o||null===(a=o.vmap)||void 0===a?void 0:a.enabled))||"midroll"===e&&(!0===(null===(i=this.gameData)||void 0===i||null===(s=i.mAds)||void 0===s?void 0:s.vmap)||!0===(null===(u=this.gameData)||void 0===u||null===(c=u.mAds)||void 0===c||null===(l=c.vmap)||void 0===l?void 0:l.enabled))||"rewarded"===e&&(!0===(null===(d=this.gameData)||void 0===d||null===(f=d.rAds)||void 0===f?void 0:f.vmap)||!0===(null===(p=this.gameData)||void 0===p||null===(h=p.rAds)||void 0===h||null===(v=h.vmap)||void 0===v?void 0:v.enabled));if(!m)return!1;var g=this._get_vmap_config(e),b=this.adCounter[e];return void 0!==(null==g?void 0:g.start)?b>=(null==g?void 0:g.start):m}},{key:"_getT4ROptions",value:function(e){var t,r=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;switch(r){case"preroll":case"midroll":case"rewarded":return e.t4r[r]}}},{key:"_is_completed",value:function(e){var t=e.getContentType(),r=e.getAdPodInfo();return!(!t.startsWith("image/")&&"text"!==t&&1!==r.getTotalAds())}},{key:"_get_vmap_context",value:function(e){var t=e.adtag,r=e.position,n=e.config,o=e.dp,a=this._createCustomAdVastUrl(null==n?void 0:n.vast_1)||t,i=this._createCustomAdVastUrl(null==n?void 0:n.vast_2)||t,s=null!=n&&n.vast_1?void 0:o,u=null!=n&&n.vast_2?void 0:o;return{adtag_url_1:null==a?void 0:a.url,adtag_url_2:null==i?void 0:i.url,position:r,dp_1:s,dp_2:u}}},{key:"_get_vmap_config",value:function(e){var t,r,n,o,a,i,s,u;switch(e){case"preroll":return null===(t=this.gameData)||void 0===t||null===(r=t.pAds)||void 0===r?void 0:r.vmap;case"midroll":return null===(n=this.gameData)||void 0===n||null===(o=n.mAds)||void 0===o?void 0:o.vmap;case"rewarded":return null===(a=this.gameData)||void 0===a||null===(i=a.rAds)||void 0===i?void 0:i.vmap;default:return null===(s=this.gameData)||void 0===s||null===(u=s.pAds)||void 0===u?void 0:u.vmap}}},{key:"_isDP",value:function(e){var t,r,n;return!!e&&!0===(null===(t=this.gameData)||void 0===t||null===(r=t.dp)||void 0===r||null===(n=r[e])||void 0===n?void 0:n.enabled)}},{key:"_create_dp_display_context",value:function(){var e=this;return new Promise(function(t){var n=this;r(this,e);try{var o={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new $x(this.gameData).checkCustomParams();a&&(o.cp=a);var i=encodeURIComponent(Fh(JSON.stringify(o)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(i)).then(function(e){return r(this,n),e.json()}.bind(this)).then(function(e){if(r(this,n),!e||!e.p)return this.msgrt.send("dp.na",{message:"atom"}),t();this.msgrt.send("dp.fp",{message:e.p/100}),t({params:{fp:e.p/100},error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(i),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(i)})}.bind(this)).catch(function(e){r(this,n),this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),t()}.bind(this))}catch(e){this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),t()}}.bind(this))}},{key:"_create_promo_context",value:function(e){var t,n=this,o={id:this.topDomain||this.parentDomain,au:e||"unknown",ty:"video",aid:this.gameData.gameId,pgu:this.parentURL},a=Object.keys(o).map(function(e){return r(this,n),"".concat(e,"=").concat(encodeURIComponent(o[e]))}.bind(this)).join("&");encodeURIComponent(Fh(JSON.stringify(o)));var i=null===(t=this.gameData.promo)||void 0===t?void 0:t.rainbow,s=null==i?void 0:i.enabled,u="https://tag.atom.gamedistribution.com/v1/rainbow/?".concat(a),c=s?u:void 0;return function(){r(this,n)}.bind(this),{promo_url:c,promo_imp_blue_url:s?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:s?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0}}},{key:"_create_dp_context",value:function(e,n){var o=this;return new Promise(function(){var a=t(u.mark((function t(a){var i,s,c,l,d,f,p=this;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,o._isDP(e)){t.next=5;break}return o.msgrt.send("dp.na",{message:"rule"}),t.abrupt("return",a());case 5:s={id:o.topDomain||o.parentDomain,au:e||"unknown",ty:"video",aid:o.gameData.gameId,pgu:o.parentURL},(c=new $x(o.gameData).checkCustomParams())&&(s.cp=c),l=encodeURIComponent(Fh(JSON.stringify(s))),d=null===(i=o.gameData.promo)||void 0===i?void 0:i.rainbow,f=(null==d?void 0:d.enabled)&&!0!==(null==n?void 0:n.fallback_adsense),fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(l)).then(function(e){return r(this,p),e.json()}.bind(this)).then(function(e){if(r(this,p),!e||!e.p)return o.msgrt.send("dp.na",{message:"atom"}),a();var t=e.p/100;a({id:Date.now(),floor_price:t,error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(l,"&ec=[ERRORCODE]"),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(l),skip_url:"https://tag.atom.gamedistribution.com/v1/skp?ar=".concat(l),promo_url:f?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(l):void 0,promo_imp_blue_url:f?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:f?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){r(this,p),o.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),a()}.bind(this)),t.next=18;break;case 14:t.prev=14,t.t0=t.catch(0),o.msgrt.send("dp.err",{message:(null===t.t0||void 0===t.t0?void 0:t.t0.message)||t.t0}),a();case 18:case"end":return t.stop()}}),t,this,[[0,14]])})));return function(e){return a.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t){if(e&&t)try{var r,n=new k(t.vastUrl,!0);if(null===(r=n.query)||void 0===r||!r.cust_params)return;var o=c.parse(n.query.cust_params);if(!o.tnl_asset_id)return;o.adsense=1,n.query.cust_params=c.stringify(o,!1),e.fallback_url=n.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(d=t(u.mark((function e(t){var n,o,a,i,s,c=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getPrebidScripts(),o=n[0],window.idhb=window.idhb||{},window.idhb.options=window.idhb.options||{},Object.assign(window.idhb.options,{assetId:this.gameData.gameId,configUrl:this.topDomain||this.parentDomain,parentUrl:this.parentURL,pageType:"gd"}),window.idhb.que=window.idhb.que||[],e.next=8,$e(o,"gdsdk_prebid",{alternates:n,error_prefix:"Blocked:",exists:function(){return r(this,c),window.idhb.requestAds}.bind(this)});case 8:a=Ce("ch",window.location.href),i=Ce("ch_date",window.location.href),s={tnl_content_category:this.category.toLowerCase()},a&&(s.channel=a),i&&(s.ch_date=i),window.idhb.setAdserverTargeting(s),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var t=this;r(this,c);try{var n,o=e.slotId.split("@");o=1===o.length?o[0]:o[1],e.isEmpty?(null!==(n=this.atom_display)&&void 0!==n&&n.error_url&&(fetch(this.atom_display.error_url).catch(function(e){r(this,t)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_ERROR",{message:o,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){r(this,t)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:o,status:"success"}))}catch(e){}}.bind(this));case 16:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"_init_ima_script",value:(l=t(u.mark((function e(t){var n,o,a=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=["https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","https://imasdk.googleapis.com/js/sdkloader/ima3.js","http://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","http://imasdk.googleapis.com/js/sdkloader/ima3.js"],o=this.options.debug?n[0]:n[1],e.next=4,$e(o,"gdsdk_ima",{alternates:n,error_prefix:"Blocked:",exists:function(){return r(this,a),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"_init_afg_script",value:(s=t(u.mark((function e(t){var n,o,a,i,s=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.gameData.afg_disabled){e.next=3;break}return e.abrupt("return");case 3:return(i={}).crossorigin="anonymous",i["data-ad-client"]=(null==t||null===(n=t.adsense_client)||void 0===n?void 0:n.length)>0?t.adsense_client:"ca-pub-2316275586951220",i["data-ad-frequency-hint"]="30s",i.allow="autoplay",(null==t||null===(o=t.adsense_channel)||void 0===o?void 0:o.length)>0&&(i["data-ad-channel"]=t.adsense_channel),(null==t||null===(a=t.adsense_host)||void 0===a?void 0:a.length)>0&&(i["data-ad-host"]=t.adsense_host),!0===(null==t?void 0:t.adsense_adbreak_test)&&(i["data-adbreak-test"]="on"),e.next=14,$e("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return r(this,s),!!window.adsbygoogle}.bind(this),attrs:i});case 14:window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({sound:"on",preloadAdBreaks:"on"});case 16:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"clearSession",value:function(){this.requestRunning=!1}},{key:"_startAdsensePlacementRewardedAd",value:(i=t(u.mark((function e(t){var n,o,a,i,s,c,l=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){r(this,l)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),n=function(){r(this,l),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),o=function(){r(this,l),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(){r(this,l),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),i=function(){r(this,l),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"}),this._send_atom_event("sg.ad.rw.viewed")}.bind(this),s=function(e){r(this,l),e()}.bind(this),c=function(e){r(this,l),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===e.breakStatus?this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error",skipForward:!0}),"dismissed"!==e.breakStatus&&this._send_atom_event("sg.dbg.rw",e))}.bind(this),t={type:"reward",name:"reward-in-game",beforeAd:n,afterAd:o,adDismissed:a,adViewed:i,beforeReward:s,adBreakDone:c},window.adsbygoogle.push(t),e.next=24;break;case 20:throw e.prev=20,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 24:case"end":return e.stop()}var t}),e,this,[[1,20]])}))),function(e){return i.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(a=t(u.mark((function e(t){var n,o=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){r(this,o)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),n=function(e){r(this,o),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"}),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),t={type:"preroll",adBreakDone:n},window.adsbygoogle.push(t),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}var t}),e,this,[[1,15]])}))),function(e){return a.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(o=t(u.mark((function e(t){var n,o,a,i=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){r(this,i)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),n=function(){r(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),o=function(){r(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){r(this,i),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),t={type:"start",name:"start-in-game",beforeAd:n,afterAd:o,adBreakDone:a},window.adsbygoogle.push(t),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var t}),e,this,[[1,17]])}))),function(e){return o.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(n=t(u.mark((function e(t){var n,o,a,i=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){r(this,i)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),n=function(){r(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),o=function(){r(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){r(this,i),this.resetForNext(),this.adCounter.midroll=this.adCounter.midroll||0,this.adCounter.midroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.mr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",e))}.bind(this),t={type:"next",name:"next-in-game",beforeAd:n,afterAd:o,adBreakDone:a},window.adsbygoogle.push(t),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var t}),e,this,[[1,17]])}))),function(e){return n.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var r=this.msgrt,n=r._layout,o=r._ua,a={tp:e,ct:0,vrs:this.PackageJSON.version,url:this.parentURL,rfr:document.referrer,tdmn:this.topDomain||this.parentDomain,dpth:0,args:t,ua:{brnm:o.browser.name,brvs:o.browser.version,osnm:o.os.name,osvs:o.os.version,dvmd:o.device.model,w:n.w,h:n.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(Fh(JSON.stringify(a)))))}catch(e){}}},{key:"_send_atom_event",value:function(e,t){this._send(e,{gid:this.gameData.slug,md5:this.gameData.gameId,pid:0,pnm:this.gameData.pname,ctry:this.gameData.ctry,lcl:"en",hle:1,ads:1,args:t,href:window.location.href})}},{key:"_isAfgPositionNext",value:function(e){return void 0!==e.adTimestamp}},{key:"_isAfgPositionStart",value:function(e){if(void 0!==e.adTimestamp)return!1;return this.adCounter.preroll=this.adCounter.preroll||0,0===this.adCounter.preroll}},{key:"attachAfgPosition",value:function(e){var t=e.params.position;switch(t){case"preroll":case"start":case"pause":case"next":case"browse":case"reward":return}var r=e.adType;if(r===Te.Rewarded)t="reward";else if(r===Te.Interstitial){var n,o;if(this._isAfgPositionStart(e))t=null===(n=this.gameData.pAds)||void 0===n||!n.enabled||null!==(o=this.gameData.loader)&&void 0!==o&&o.enabled?"start":"next";else this._isAfgPositionNext(e)&&(t="next")}e.params.position=t}}]),e}(),bk=function e(r){var n=this;E(this,e),oa(this,"load",t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ap(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),oa(this,"promo",t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.module){e.next=3;break}return e.next=3,n.load();case 3:return e.abrupt("return",n.module[n.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var o=r.package||"gd-sdk-stone-dynamic",a=r.package_version||"1.1.1",i=r.template||"puzzle",s=r.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(o,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},np(this.moduleName,this.moduleConfig)},yk=function e(r){var n=this;E(this,e),oa(this,"load",t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ap(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),oa(this,"splash",t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.module){e.next=3;break}return e.next=3,n.load();case 3:return e.abrupt("return",n.module[n.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var o=r.package||"gd-sdk-air-dynamic",a=r.package_version||"1.2.0",i=r.template||"pluto",s=r.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(o,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},np(this.moduleName,this.moduleConfig)},_k=function(e,t){console.log(e,t)},wk={},Ak={},xk=null;function kk(){for(var e,t=window,r=null,n=null;!e;){try{if("function"==typeof t.__tcfapi||"function"==typeof t.__cmp){"function"==typeof t.__tcfapi?(n=2,r=t.__tcfapi):(n=1,r=t.__cmp),e=t;break}}catch(e){}try{if(t.frames.__tcfapiLocator){n=2,e=t;break}}catch(e){}try{if(t.frames.__cmpLocator){n=1,e=t;break}}catch(e){}if(t===window.top)break;t=t.parent}return wk.version=n,wk.frame=e,wk.function=r,wk.version}function Ek(e){var t=this;return xk||(xk=new Promise(function(n){function o(t,r){if(_k("Received a response from CMP",t),r){var o,a;if(!1!==t.gdprApplies)return"tcloaded"===t.eventStatus||"useractioncomplete"===t.eventStatus?(("boolean"!=typeof(a=(o=t)&&"boolean"==typeof o.gdprApplies?o.gdprApplies:e.defaultGdprScope)||!0===a&&"string"!=typeof o.tcString)&&n({result:"cmpUnexpectedResponse",cmp:wk,consentData:o}),void n({result:"ok",consentData:t})):void 0;n({result:"ok",consentData:t})}else n({result:"cmpCallFailed"})}r(this,t),kk(),wk.frame?2===wk.version?(_k("TCF v2 CMP found. Fetching the consent."),wk.function?(_k("CMP API is directly accessible, calling it now..."),wk.function("addEventListener",wk.version,o)):(_k("CMP API is outside the current iframe, calling it now..."),function(e,t,n){var o=this,a="__tcfapi";function i(e){var t="".concat(a,"Return"),r="string"==typeof e.data&&e.data.indexOf(t)>=0?JSON.parse(e.data):e.data;if(r[t]&&r[t].callId){var n=r[t];void 0!==Ak[n.callId]&&Ak[n.callId](n.returnValue,n.success)}}window[a]=function(e,n,i,s){r(this,o);var u=Math.random()+"",c=oa({},"".concat(a,"Call"),{command:e,parameter:s,callId:u,version:n});Ak[u]=i,t.postMessage(c,"*")}.bind(this),window.addEventListener("message",i,!1),window[a](e,wk.version,n)}("addEventListener",wk.frame,o))):n({result:"cmpVersionNotV2",cmp:wk}):n({result:"cmpNotFound"})}.bind(this)))}var Sk=new(function(){function e(){E(this,e),this.productName="Game Distribution"}var r;return R(e,[{key:"checkIfExcluded",value:function(e){try{var t,r;return!(null===(t=e.diagnostic)||void 0===t||null===(r=t.gameDock)||void 0===r||!r.excluded)}catch(e){return console.log("Error on checkIfExclude check",e),!1}}},{key:"track",value:(r=t(u.mark((function e(t,r){var n,o,a,i,s,c;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.checkIfExcluded(r)){e.next=3;break}return e.abrupt("return");case 3:if(o=null==t||null===(n=t.visitor)||void 0===n?void 0:n.visitorId){e.next=6;break}return e.abrupt("return");case 6:return a=encodeURIComponent(this.productName),i=encodeURIComponent(o),e.prev=8,s="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(a,"/user_id/").concat(i),e.next=12,fetch(s,{method:"POST"});case 12:e.next=28;break;case 15:return e.prev=15,e.t0=e.catch(8),console.log("GAME_DOCK. fail v4",e.t0),e.prev=18,c="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(a,"/user_id/").concat(i),e.next=22,fetch(c,{method:"POST"});case 22:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(18),console.log("GAME_DOCK. fail v6",e.t1);case 28:case"end":return e.stop()}}),e,this,[[8,15],[18,25]])}))),function(e,t){return r.apply(this,arguments)})}]),e}());function Rk(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Dk(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dk(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}function Dk(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ok,Tk=function(e){var t=this,n=e.src,o=e.attributes,a=e.target,i=e.isAsync;return new Promise(function(e,s){var u=this;r(this,t);try{var c=document.createElement("script");if(c.async=null==i||i,c.type="text/javascript",c.onload=function(){r(this,u),e()}.bind(this),c.onerror=function(){r(this,u);var e="Error on script load, Error: ".concat(n);console.log(e),s(e)}.bind(this),c.src=n,o){var l,d=Rk(o);try{for(d.s();!(l=d.n()).done;){var f=l.value,p=f.key,h=f.value;c.setAttribute(p,h)}}catch(e){d.e(e)}finally{d.f()}}a||(a=document.head),a.appendChild(c)}catch(e){var v="Error on script load catch, Error: ".concat(n);console.log(v,e),s(v)}}.bind(this))},Ik="140feb72-7952-4420-8ae5-e8978d87bc17",Mk=function(){var e=t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Tk({src:"https://cdn.cookielaw.org/consent/tcf.stub.js",attributes:[{key:"id",value:"gd-cookie-pro-tcf-stub"},{key:"charset",value:"UTF-8"}],isAsync:!1});case 3:return e.next=5,Tk({src:"https://cookie-cdn.cookiepro.com/consent/".concat(Ik,"/OtAutoBlock.js"),attributes:[{key:"id",value:"gd-cookie-pro-autoblock"}],isAsync:!1});case 5:return e.next=7,Tk({src:"https://cookie-cdn.cookiepro.com/scripttemplates/otSDKStub.js",attributes:[{key:"id",value:"gd-cookie-pro-stub"},{key:"charset",value:"UTF-8"},{key:"data-domain-script",value:Ik}],isAsync:!1});case 7:r=void 0,n=void 0,o=void 0,r=(t={inlineScript:"function OptanonWrapper() { }"}).inlineScript,n=t.target,(o=document.createElement("script")).text=r,n||(n=document.head),n.appendChild(o),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("GD: CMP error on load",e.t0);case 13:case"end":return e.stop()}var t,r,n,o}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),Lk=new Jx.exports.EventEmitter,Ck={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};window.addEventListener("message",(function(e){var t=this,n=e.data,o=e.origin,a=n.type;if(Object.keys(Ck).some(function(e){return r(this,t),e===o}.bind(this))&&(null==n||!n.__tcfapiCall)&&(window.parent&&!n.type.startsWith("gd-sdk")&&window.parent.postMessage(n,"*"),a)){var i=Ck[o][a];i&&Lk.emit(i,n)}}),!1);var Pk=new Uint8Array(16);function jk(){if(!Ok&&!(Ok="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ok(Pk)}var Uk=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Bk(e){return"string"==typeof e&&Uk.test(e)}for(var $k=[],Nk=0;Nk<256;++Nk)$k.push((Nk+256).toString(16).substr(1));function Gk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Fk="__msgr",zk=function(e,t,r){var n=(e=e||{}).random||(e.rng||jk)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=n[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=($k[e[t+0]]+$k[e[t+1]]+$k[e[t+2]]+$k[e[t+3]]+"-"+$k[e[t+4]]+$k[e[t+5]]+"-"+$k[e[t+6]]+$k[e[t+7]]+"-"+$k[e[t+8]]+$k[e[t+9]]+"-"+$k[e[t+10]]+$k[e[t+11]]+$k[e[t+12]]+$k[e[t+13]]+$k[e[t+14]]+$k[e[t+15]]).toLowerCase();if(!Bk(r))throw TypeError("Stringified UUID is invalid");return r}(n)}(),Zk=function(e){var t=this;if(!window.__msgr){var n=document.createElement("iframe");if(n.src="https://static.gamedistribution.com/message/index.html",n.style.display="none",n.name=Fk,document.body.appendChild(n),window!==window.top){var o={gameId:e.gameId,target:e.evnts.domain,token:zk,event_name:"TokenGenerated",timestamp:Date.now()};n.onload=function(){Kk(o)},setInterval(function(){r(this,t),o.timestamp=Date.now(),o.event_name="Heartbeat",Kk(o)}.bind(this),1e3*e.evnts.heartbeatDuration)}}window.addEventListener("message",function(e){r(this,t);try{var n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gk(Object(r),!0).forEach((function(t){oa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gk(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e.data);if(!n.event_name)return;n.token=zk,Kk(n)}catch(e){console.error("GD Messager Error",e.message)}}.bind(this),!1)},Hk=function(e){try{var t={gameId:e.game.gameId,target:e.game.evnts.domain,event_name:e.event,timestamp:Date.now()},r=qk(window);r!==window.top&&(null==r||r.postMessage(t,"https://html5.gamedistribution.com"))}catch(e){}},qk=function e(t){try{var r,n,o=null==t?void 0:t.parent;if("game"===(null===(r=o.document)||void 0===r||null===(n=r.activeElement)||void 0===n?void 0:n.id))return o;e(o)}catch(e){return t}},Kk=function(e){window.__msgr.postMessage(e,"https://static.gamedistribution.com")};function Wk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vk(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wk(Object(r),!0).forEach((function(t){oa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wk(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Yk,Qk=null,Jk=null,Xk=function(){function e(t){var n=this;if(E(this,e),Qk)return Qk;Qk=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,t),this._version=t.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new tA,this._location.print(),this._parentURL=0===this._bridge.depth?encodeURIComponent(this._bridge.parentURL):this._bridge.parentURL,this._parentDomain=this._bridge.parentDomain,this._topDomain=this._bridge.topDomain,this._isFullScreen=!1,this._giftCount=0,this._setConsoleBanner(),this._initializeMessageRouter(),this._checkConsole(),this._subscribeToEvents(),this.sdkReady=new Promise(this._initializeSDKWithGameData.bind(this)),this.sdkReady.then(function(e){r(this,n),this._sdk_ready=!0}.bind(this)).catch(function(e){r(this,n),this._sdk_ready=!1}.bind(this)).finally(function(){var e,t;r(this,n),!0===(null===(e=this._gameData.lp)||void 0===e?void 0:e.load)&&this._sendLoadedEvent(1),this._sendLoaderDataEvent(),this._checkSplashAndPromoScreens(),this._initBlockingExternals(),this._initUnityHandler(),this._checkFullscreen(),null!==(t=this._gameData.evnts)&&void 0!==t&&t.enabled&&this._isLoaderGameURL()&&Zk(this._gameData)}.bind(this)),this._registerSGBridge()}var n,o,a,i,s,l,d,f,p,h,v,m;return R(e,[{key:"_initUnityHandler",value:function(){var e=this;window.addEventListener("DOMNodeInserted",function(){if(r(this,e),this._gameData.block_exts&&this._removeExternalsInHtml({enabled:!1}),document.getElementsByClassName("webgl-content")[0]){var t=document.getElementsByClassName("webgl-content")[0].getElementsByClassName("footer")[0];t&&t.setAttribute("style","display:none")}}.bind(this))}},{key:"_loadCMP",value:(m=t(u.mark((function e(){var t,r,n,o;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=6;break}if(n=new tA,0!==(null==(o=n.get("depth"))?void 0:o.value)||null===(t=this._gameData)||void 0===t||null===(r=t.cmp)||void 0===r||!r.enabled||"html5.gamedistribution.com"!==this._topDomain){e.next=6;break}return e.next=6,Mk();case 6:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"testConsent",value:function(){try{kk();t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ek({});case 2:e.sent;case 3:case"end":return e.stop()}}),e)})))()}catch(e){console.log("find CMP error",e)}}},{key:"_sendLoaderDataEvent",value:function(){try{this.options.onLoaderEvent&&this.options.onLoaderEvent({name:"LOADER_DATA",message:{game:this._gameData,bridge:this._bridge},status:this._sdk_ready?"success":"error"})}catch(e){}}},{key:"_registerSGBridge",value:function(){var e=this;Lk.on("splash-hidden",function(t){r(this,e),this._hideCMPButton()}.bind(this))}},{key:"_hideCMPButton",value:function(){var e=document.getElementById("ot-sdk-btn-floating");e&&(e.style.display="none")}},{key:"isLoaded",value:function(){if(void 0===this._isLoaded){var e=this._isTokenGameURL(),t=this._isExtHostedGameURL(),r=this._isMasterGameURL();this._isLoaded=(e||t&&!r)&&this._gameData.loader.enabled}return this._isLoaded}},{key:"setIsLoaded",value:function(e){this._isLoaded=e}},{key:"_sendLoadedEvent",value:function(){if(!this.isLoaded()){this.setIsLoaded(!0);try{this._sendTunnlEvent(1),this.msgrt.send("loaded",{message:this._hasBlocker?"Has Blocker":"No Blocker"})}catch(e){}}}},{key:"_sendGamedockGamePlay",value:function(){var e=this._isTokenGameURL();if(!(this._gameData.loader.enabled&&e||this._gameDockGamePlaySent))try{this._sendGamedockEvent("gameplay"),this._gameDockGamePlaySent=!0}catch(e){}}},{key:"_safeInit",value:function(){this._checkUserDeclinedTracking(),this._checkWhitelabelPartner();var e=this._gameData.diagnostic;void 0!==e&&void 0!==e.close_ga&&!1!==e.close_ga||!this._bridge.isCoreSDKMode&&this._loadGoogleAnalytics(),void 0!==e&&void 0!==e.close_gamedock&&!1!==e.close_gamedock||!this._bridge.isCoreSDKMode&&!this._bridge.noGamedockSDK&&this._loadGamedockTracker(),void 0!==e&&void 0!==e.close_minijuegos&&!1!==e.close_minijuegos||!this._bridge.isCoreSDKMode&&!this._bridge.noMinijuegosSDK&&document.location.search.indexOf("mp_game_id")>=0&&this._loadMiniJuegosGratisTracker()}},{key:"_initializeSDKWithGameData",value:(v=t(u.mark((function e(t,n){var o,a=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getGameData();case 3:return this._gameData=e.sent,e.next=6,this._loadCMP();case 6:this._bridge.isCoreSDKMode=!(!0===this._gameData.enableAds||!0===(null===(o=this._gameData.enableAds)||void 0===o?void 0:o.enabled)),this._safeInit(),this._checkGameId(),this._checkGameDeleted(),this._checkBlocking(),this._changeMidrollInDebugMode(),void 0!==this._gameData.diagnostic&&void 0!==this._gameData.diagnostic.close_ads&&!1!==this._gameData.diagnostic.close_ads||(this.videoAdReady=this._initializeVideoAd().catch(function(e){return r(this,a),console.error(e.message||e)}.bind(this))),t(this._gameData),e.next=21;break;case 16:e.prev=16,e.t0=e.catch(0),this._sendSDKError(e.t0),this.onResumeGame(e.t0.message,"warning"),n(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e,t){return v.apply(this,arguments)})},{key:"_getDefaultOptions",value:function(){return{debug:!1,testing:!1,gameId:"4f3d7d38d24b740c95da2b03dc3a2333",prefix:"gdsdk__",onEvent:function(e){},onLoaderEvent:function(e){},flashSettings:{adContainerId:"",splashContainerId:""},advertisementSettings:{},resumeGame:function(){},pauseGame:function(){},onInit:function(e){},onError:function(e){},loader:{}}}},{key:"_extendDefaultOptions",value:function(e,t){var r=O(e);this.options=t?Ie(r,t):r,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=iA.version,t=console.log("%c %c %c GameDistribution.com HTML5 SDK | Version: "+e+" %c %c %c","background: #9854d8","background: #6c2ca7","color: #fff; background: #450f78;","background: #6c2ca7","background: #9854d8","background: #ffffff");console.log.apply(console,t)}}},{key:"_sendTunnlEvent",value:function(e){var t=this;void 0===this._topDomain&&(this._topDomain=void 0);var n={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(c.stringify(n))).catch(function(e){r(this,t)}.bind(this))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=Pe();e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,Ye("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!He)return;"developer.gamedistribution.com"===this._parentDomain?(Ke("gd_debug_ex",!0),Ke("gd_disable_midroll_timer",!0),Ke("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(Ke("gd_debug_ex",!0),Ke("gd_disable_midroll_timer",!0)),Ze("gd_debug_ex")&&(this.openConsole(),this.msgrt.send("dev.console",{message:this._parentDomain}))}catch(e){}}},{key:"_checkUserDeclinedTracking",value:function(){this._userDeclinedTracking=this._bridge.isCoreSDKMode||document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0}},{key:"_initializeMessageRouter",value:function(){this.msgrt=new at({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:Ne(),version:iA.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:Be(),byloader:this._bridge.isTokenGameURL,isTokenGameURL:this._bridge.isTokenGameURL,isMasterGameURL:this._bridge.isMasterGameURL,isExtHostedGameURL:this._bridge.isExtHostedGameURL,byloaderVersion:this._bridge.version})}},{key:"_loadGamedockTracker",value:function(){var e=this;try{var t=["https://cdn.gamedock.io/gamedock-web-tracker/4.4.0/script/gamedock-sdk.min.js"];$e(t[0],"GamedockSDK",{alternates:t}).then(function(){var t,n;r(this,e),Jk=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(t=this._gameData.diagnostic)&&void 0!==t&&null!==(n=t.gameDock)&&void 0!==n&&n.adViewEvent&&Jk.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),Sk.track(Jk,this._gameData)}.bind(this)).catch(function(t){r(this,e),this._sendSDKError(t)}.bind(this))}catch(e){}}},{key:"_initGamedockTracker",value:function(e){if(!this._bridge.isCoreSDKMode)return e.initialize("gd",this._parentDomain)}},{key:"_sendGamedockEvent",value:function(e){var t,r;null===(t=Jk)||void 0===t||null===(r=t.tracking)||void 0===r||r.trackEvent(e,{pageId:this.options.gameId,pageType:"game"})}},{key:"_loadMiniJuegosGratisTracker",value:function(){var e=this;window.mpConfig={game:this.options.gameId,partner:"game-distribution"};var t=["https://ext.minijuegosgratis.com/external-host/main.js"];$e(t[0],"MinijuegosSDK",{alternates:t}).catch(function(t){r(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,t=["https://www.google-analytics.com/analytics.js"];$e(t[0],"gdsdk_google_analytics",{alternates:t,error_prefix:"Blocked:",exists:function(){return r(this,e),window.ga}.bind(this)}).then(function(){r(this,e),window.ga("create","UA-60359297-49",{name:"gd",cookieExpires:7776e3,sampleRate:5},"auto"),this._bridge.noGAPageView||window.ga("gd.send","pageview"),this._userDeclinedTracking||window.ga("gd.set","anonymizeIp",!0)}.bind(this)).catch(function(t){r(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new nt,Qe.forEach(function(t){var n=this;return r(this,e),this.eventBus.subscribe(t,function(e){return r(this,n),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),Je.forEach(function(t){var n=this;return r(this,e),this.eventBus.subscribe(t,function(e){return r(this,n),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(r(this,e),"developer.gamedistribution.com"===this._parentDomain||!0===new RegExp("^localhost").test(this._parentDomain)){fetch("https://game.api.gamedistribution.com/game/v2/hasapi/".concat(this.options.gameId,"?timestamp=").concat((new Date).valueOf()));try{var t=JSON.stringify({type:"GD_SDK_IMPLEMENTED",gameID:this.options.gameId});window.location!==window.top.location?window.top.postMessage(t,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(t,"*")}catch(e){}}}.bind(this),"ima"),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){return r(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(t){var n,o;r(this,e),this.msgrt.send("ad.impression"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(o=n.gameDock)&&void 0!==o&&o.adViewEvent&&Sk.track(Jk,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(t){r(this,e),this.msgrt.send("ad.error",{message:t.message,details:t.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(t){r(this,e),this._sendAdRequestContext(t.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(t){r(this,e),t.message.startsWith("Blocked:")?this._bridge.noBlockerEvent||(this.msgrt.send("error",{message:t.message}),this._hasBlocker||(this._hasBlocker=!0,this._sendTunnlEvent(3))):this.msgrt.send("error",{message:t.message})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_EMPTY",function(t){r(this,e),this.msgrt.send("tunnl.keys.empty",{message:t.message,details:t.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_FALLBACK",function(t){r(this,e),this.msgrt.send("tunnl.keys.fallback",{message:t.message,details:t.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_T4R",function(t){return r(this,e),this.msgrt.send("adt4r")}.bind(this),"sdk")}},{key:"_checkGameId",value:function(){this.options.gameId===this._defaults.gameId&&this._sendSDKError("Check correctness of your GAME ID. Otherwise, no revenue will be recorded.")}},{key:"_getDefaultGameData",value:function(){return{gameId:this.options.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}},{key:"_getGameDataUrl",value:function(){var e=void 0!==this._topDomain&&"undefined"!==this._topDomain?this._topDomain:this._parentDomain;return"https://game.api.gamedistribution.com/game/v4/get/".concat(this.options.gameId.replace(/-/g,""),"/?domain=").concat(e,"&v=").concat(iA.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(h=t(u.mark((function e(){var t,n,o=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this._gameData,t=void 0===this._gameData.dmain||this._gameData.dmain,(n.bloc_gard&&!0===n.bloc_gard.enabled||!t)&&(this.msgrt.send("blocked"),setTimeout(function(){r(this,o),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(c.stringify({domain:this._parentDomain,id:n.gameId,img:this._get_game_thumbnail_url(),title:n.title}))}.bind(this),100));case 5:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"_checkGameDeleted",value:function(){var e=this;6===this._gameData.status&&(console.log("%c %c %c This game was deleted, please remove it in your website... ","background: #F2181A","background: #F23818","color: #fff; background: #F23818;","background: #F55E60","background: #F55E60","background: #c4161e; color: #fff;"),setTimeout(function(){r(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;He&&Ze("gd_debug_ex")&&(Ze("gd_disable_midroll_timer")?e.midroll=0:e.midroll=this._getDefaultGameData().midroll)}},{key:"_checkSplashAndPromoScreens",value:function(){var e,t,r;this._gameData.loader&&!1===this._gameData.loader.mobile&&this._getisMobile()&&(this._gameData.loader.enabled=!1);var n,o=this._gameData,a=o.gdpr&&!0===o.gdpr.consent,i=o.loader,s=null===(e=o.promo)||void 0===e?void 0:e[null===(t=o.promo)||void 0===t||null===(r=t.template)||void 0===r?void 0:r.preroll];(o.preroll||(this.adRequestTimer=Date.now()),this.options.loader.enabled)?null!=s&&s.enabled?this._createPromoBeforeSplash(o,a):i.enabled&&!0!==(null===(n=i.splash)||void 0===n?void 0:n.skip)?this._createSplash(o,a):this.onResumeGame("Skipped splash.","success"):i.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||a?null!=s&&s.enabled?this._createPromoBeforeSplash(o,a):!1!==i.enabled&&this._createSplash(o,a):null!=s&&s.enabled&&this._createPromo(o,a))}},{key:"_initializeVideoAd",value:(p=t(u.mark((function e(){var t;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._bridge.isCoreSDKMode){e.next=2;break}return e.abrupt("return");case 2:return(t=this._gameData).sdk.enabled&&(this.options.advertisementSettings=Ie(this.options.advertisementSettings,t.sdk)),this.macros=new ot({game:t,bridge:this._bridge}),this.adInstance=new gk(this.options.flashSettings.adContainerId,this.options.advertisementSettings,{parentURL:this._parentURL,parentDomain:this._parentDomain,topDomain:this._topDomain}),this.adInstance.gameId=t.gameId,this.adInstance.category=t.category,this.adInstance.tags=t.tags,this.adInstance.noPreroll=this._bridge.noPreroll,this.adInstance.macros=this.macros,this.adInstance.gameData=t,this.adInstance.msgrt=this.msgrt,this.adInstance.PackageJSON=iA,this.adInstance._send("gd.location",this._location.get()),e.next=17,this.adInstance.start();case 17:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"_sendSDKReady",value:function(){var e="Everything is ready.";this.eventBus.broadcast("SDK_READY",{message:e,status:"success"});try{this.options.onInit(e)}catch(e){Ye("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_sendSDKError",value:function(e){e=e.message?e:{message:e};this.eventBus.broadcast("SDK_ERROR",{message:e.message,status:"error"});try{this.options.onError(e)}catch(e){Ye("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){Ye(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status,skipForward:e.skipForward})}catch(e){Ye("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:(f=t(u.mark((function e(){var t;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fA();case 2:return t=e.sent,this._bridge.noPreroll=(!this._getisMobile()||!1!==t.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(t),r=t.diagnostic,Ve=r,e.abrupt("return",t);case 8:case"end":return e.stop()}var r}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"_createSplash",value:(d=t(u.mark((function e(t,n){var o,a,i,s,c=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(t);case 2:return o=e.sent,a=new o(Vk(Vk({},this.options),{},{isConsentDomain:n,version:iA.version}),t,this._parentDomain),e.next=6,mA();case 6:i=e.sent,s=i.enabled,a.on("playClick",function(){var e=this;if(r(this,c),n){var t=new Date;t.setDate(t.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(t.toUTCString(),"; path=/")}this._hideCMPButton(),s?window.gdsdk.showAd(Te.Interstitial,{position:"preroll"}).catch(function(t){r(this,e),a.hide()}.bind(this)):(function(){r(this,e)}.bind(this),this.showAd(Te.Interstitial,{position:"preroll"}).catch(function(t){r(this,e)}.bind(this)))}.bind(this)),this.onPauseGame("Pause the game and wait for a user gesture","success"),this.eventBus.subscribe("SDK_GAME_PAUSE",function(){r(this,c),a.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){r(this,c),a.hide()}.bind(this));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(l=t(u.mark((function e(t,n){var o,a,i,s,c=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(t);case 3:i=e.sent,(s=new i(Vk(Vk({},this.options),{},{isConsentDomain:n,version:iA.version,template:null===(o=t.promo)||void 0===o||null===(a=o.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){r(this,c),s.hide(),this._createSplash(t,n)}.bind(this)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),this._createSplash(t,n);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t){return l.apply(this,arguments)})},{key:"_createPromo",value:(s=t(u.mark((function e(t,n){var o,a,i,s,c=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(t);case 3:i=e.sent,(s=new i(Vk(Vk({},this.options),{},{isConsentDomain:n,version:iA.version,template:null===(o=t.promo)||void 0===o||null===(a=o.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){r(this,c),s.hide(),this.onResumeGame("Resumed after the promo","warning")}.bind(this)),this.onPauseGame("Pause the game for the promo","success"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),this.onResumeGame("Resumed after the promo","warning");case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(e,t){return s.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(Te.Interstitial).catch(function(){r(this,e)}.bind(this))}},{key:"showAd",value:(i=t(u.mark((function e(n){var o,a=this,i=arguments;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.length>1&&void 0!==i[1]?i[1]:{},e.abrupt("return",new Promise(function(){var e=t(u.mark((function e(t,i){var s,c,l,d,f,p,h,v,m,g,b,y,_,w,A=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p={adType:n,params:o,adTimestamp:a.adRequestTimer},e.next=4,a.sdkReady;case 4:return h=e.sent,e.next=7,a.videoAdReady;case 7:return null!==(s=a._gameData.lp)&&void 0!==s&&s.load||a._sendLoadedEvent(),a._sendGamedockGamePlay(),a._rejectAdIfGameBlocked({gameData:h,adRequest:p}),a._rejectAdIfAdDisabled({gameData:h,adRequest:p}),a._rejectAdIfUnsupportedType({adRequest:p}),a._rejectAdIfRewardedDisabled({gameData:h,adRequest:p}),(null===(c=h.gft)||void 0===c||!c.enabled||null!==(l=h.gft)&&void 0!==l&&l.enabled&&(null==h||null===(d=h.gft)||void 0===d||null===(f=d.durations[a._giftCount])||void 0===f?void 0:f.after)!==a.adInstance.adMidrollCount)&&a._rejectAdIfAdRateHits({gameData:h,adRequest:p}),a.adInstance.attachAfgPosition(p),a._attachAfgFallback({gameData:h,adRequest:p}),v="main.showad",m=function(e){var t,n,o;r(this,A),a.eventBus.unsubscribeScope(v),a.onResumeGame(e.message,"warning"),null!=h&&null!==(t=h.gft)&&void 0!==t&&t.enabled&&(null==h||null===(n=h.gft)||void 0===n||null===(o=n.durations[a._giftCount])||void 0===o?void 0:o.after)===a.adInstance.adMidrollCount&&a.decideToGiveAGift(),i(e.message)}.bind(this),g=function(e){var n,o,i;r(this,A),a.eventBus.unsubscribeScope(v),a.adRequestTimer=Date.now(),a.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),null!=h&&null!==(n=h.gft)&&void 0!==n&&n.enabled&&(null==h||null===(o=h.gft)||void 0===o||null===(i=o.durations[a._giftCount])||void 0===i?void 0:i.after)===a.adInstance.adMidrollCount&&a.decideToGiveAGift(),t(e.message)}.bind(this),b=function(e){var s=this;r(this,A),a.eventBus.unsubscribeScope(v),o.fallback_adsense=!1,a.showAd(n,Vk(Vk({},o),{},{adapter:"adsense"})).then(function(e){r(this,s),t(e)}.bind(this)).catch(function(e){r(this,s),i(e)}.bind(this))}.bind(this),y=function(e){var s=this;r(this,A),a.eventBus.unsubscribeScope(v),o.fallback_adsense=!1,a.showAd(n,Vk(Vk({},o),{},{adapter:"promo"})).then(function(e){r(this,s),t(e)}.bind(this)).catch(function(e){r(this,s),i(e)}.bind(this))}.bind(this),_=function(){var e,t,n;r(this,A);var a=!("promo"===(null==o?void 0:o.adapter)||("reward"!==(null==o?void 0:o.position)||h.afg_disabled)&&"adsense"!==(null==o?void 0:o.adapter)),i=null===(e=h.promo)||void 0===e||null===(t=e.rainbow)||void 0===t?void 0:t.enabled,s=null===(n=h.promo)||void 0===n?void 0:n.onadsense;return a&&i&&s?y:null!=o&&o.fallback_adsense?b:m}.bind(this),w=_(),a.eventBus.subscribe("AD_ERROR",function(e){r(this,A),w(e)}.bind(this),v),a.eventBus.subscribe("AD_SDK_CANCELED",w,v),a.eventBus.subscribe("AD_SUCCESS",g,v),e.next=28,a.adInstance.startAd(p);case 28:a._post_message({topic:"adrequest.instream"}),e.next=35;break;case 31:e.prev=31,e.t0=e.catch(0),a.onResumeGame(e.t0.message,"warning"),i(e.t0.message);case 35:case"end":return e.stop()}}),e,this,[[0,31]])})));return function(t,r){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"clearSession",value:function(){this.adInstance.clearSession()}},{key:"_attachAfgFallback",value:function(e){var t=e.gameData,r=e.adRequest;if(!t.afg_disabled&&!r.params.hasOwnProperty("fallback_adsense"))switch(r.params.position){case"preroll":case"start":case"next":r.params.fallback_adsense=!0}}},{key:"_rejectAdIfGameBlocked",value:function(e){var t=e.gameData;if(t.bloc_gard&&!0===t.bloc_gard.enabled)throw new Error("Game or domain is blocked.")}},{key:"_rejectAdIfAdDisabled",value:function(e){if(!e.gameData.enableAds||this._whitelabelPartner)throw new Error("Advertisements are disabled.")}},{key:"_rejectAdIfUnsupportedType",value:function(e){var t=e.adRequest;if(t.adType){if(t.adType!==Te.Interstitial&&t.adType!==Te.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=Te.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===Te.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"_rejectAdIfAdRateHits",value:function(e){var t,r,n,o,a,i,s=e.gameData,u=e.adRequest,c=null;u.adType===Te.Interstitial&&null!==(t=s.diagnostic)&&void 0!==t&&null!==(r=t.useMidrollIndex)&&void 0!==r&&r.enabled&&this.adInstance.noPreroll?this.adInstance.adMidrollCount>(null===(n=s.diagnostic)||void 0===n||null===(o=n.useMidrollIndex)||void 0===o?void 0:o.indexes.length)-1||(c=6e4*(null===(a=s.diagnostic)||void 0===a||null===(i=a.useMidrollIndex)||void 0===i?void 0:i.indexes[this.adInstance.adMidrollCount])):c=s.midroll;if(u.adType===Te.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<c)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(a=t(u.mark((function e(r){var n=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=t(u.mark((function e(t,o){var a,i;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return a=e.sent,e.next=6,n.videoAdReady;case 6:if(!a.bloc_gard||!0!==a.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(a.enableAds&&!n._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(r){e.next=14;break}r=Te.Rewarded,e.next=16;break;case 14:if(r===Te.Interstitial||r===Te.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+r);case 16:if(r!==Te.Rewarded||a.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,n.adInstance.preloadAd(r);case 20:i=e.sent,t(i),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),o(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(t,r){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{key:"cancelAd",value:(o=t(u.mark((function e(){var r=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=t(u.mark((function e(t,n){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{r.adInstance.cancel(),r.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),n()}catch(e){r.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),t(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(){return o.apply(this,arguments)})},{key:"showDisplayAd",value:function(e){var r=this;return new Promise(function(){var n=t(u.mark((function t(n,o){var a;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r.sdkReady;case 3:return a=t.sent,t.next=6,r.videoAdReady;case 6:if(!a.dAds.enabled){t.next=13;break}return t.next=9,r.adInstance.loadDisplayAd(e);case 9:r._post_message({topic:"adrequest.display"}),n(),t.next=14;break;case 13:o("Display-Ads are disabled.");case 14:t.next=19;break;case 16:t.prev=16,t.t0=t.catch(0),o(t.t0.message||t.t0);case 19:case"end":return t.stop()}}),t,null,[[0,16]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){var r;this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){Ye("DEVELOPER_ERROR",e.message,"warning")}var n="SDK_GAME_START";this.eventBus.broadcast(n,{name:n,message:e,status:t,analytics:{category:"SDK",action:n,label:this.options.gameId+""}}),this.adInstance&&this.adInstance._hideAddResume(),null===(r=this._gameData.evnts)||void 0===r||!r.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||Hk({event:"GameStarted",game:this._gameData})}},{key:"onPauseGame",value:function(e,t){var r;this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){Ye("DEVELOPER_ERROR",e.message,"warning")}var n="SDK_GAME_PAUSE";this.eventBus.broadcast(n,{name:n,message:e,status:t,analytics:{category:"SDK",action:n,label:this.options.gameId+""}}),null===(r=this._gameData.evnts)||void 0===r||!r.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||Hk({event:"GamePaused",game:this._gameData})}},{key:"openConsole",value:function(){try{new st(this).start(),Ke("gd_debug_ex",!0)}catch(e){console.log(e)}}},{key:"_initBlockingExternals",value:function(){var e=this._gameData;(e.failed||e.block_exts&&e.block_exts.enabled)&&(this.window_open=window.open,this._allowExternals({enabled:!1}),this._removeExternalsInHtml({enabled:!1}))}},{key:"_checkFullscreen",value:function(){var e=this;try{var t=this._gameData;t.sdk.fullscreen&&"auto"===t.sdk.fullscreen&&document.addEventListener("click",function(){if(r(this,e),!this._isFullScreen){var t=document.body,n=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullscreen;if(n)n.call(t);else if(void 0!==window.ActiveXObject){var o=new ActiveXObject("WScript.Shell");null!==o&&o.SendKeys("{F11}")}this._isFullScreen=!0}}.bind(this))}catch(e){console.log("Fullscreen error handled...",e)}}},{key:"_allowExternals",value:function(e){var t=this;void 0!==this.window_open&&(!1===e.enabled?window.open=function(e){r(this,t),this.msgrt.send("external",{message:"C> ".concat(e)}),(e.startsWith("https://play.google.com")||e.startsWith("https://itunes.apple.com"))&&this.window_open.call(null,e)}.bind(this):window.open=this.window_open)}},{key:"_removeExternalsInHtml",value:function(e){var t=this;!1===e.enabled&&window.document.querySelectorAll("a").forEach(function(e){var n=this;r(this,t);var o=!!(e.innerText.toLowerCase().includes("start")||e.innerText.toLowerCase().includes("play")||e.innerText.toLowerCase().includes("continue")),a=e.getAttribute("href");e.removeAttribute("href"),o||(e.onclick=function(e){return r(this,n),e.preventDefault(),this.msgrt.send("external",{message:"H> ".concat(a)}),!1}.bind(this))}.bind(this))}},{key:"_getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),r=this._isExtHostedGameURL(),n=e||r?this._getTokenGameURLConfig():{};n=n||{};var o=decodeURIComponent((e||r)&&n.parentURL?n.parentURL:Le()),a=decodeURIComponent((e||r)&&n.parentDomain?n.parentDomain:Me()),i=decodeURIComponent((e||r)&&n.topDomain?n.topDomain:r&&0===Ne()?a:ze()),s=(e||r)&&n.loaderEnabled,u=(e||r)&&n.loaderEnabled,c=(e||r)&&n.loaderEnabled,l=(e||r)&&n.loaderEnabled,d=(e||r)&&n.loaderEnabled,f=(e||r)&&n.loaderEnabled,p=(e||r)&&n.loaderEnabled,h=(e||r)&&n.loaderEnabled,v=(e||r)&&n.loaderEnabled&&n.hasImpression&&n.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:r,noConsoleBanner:s,noLoadedEvent:u,noBlockerEvent:c,noPreroll:h,parentURL:o,parentDomain:a,topDomain:i&&i.length?i:a,noGAPageView:l,noLotamePageView:d,noGamedockSDK:f,noMinijuegosSDK:p,version:n.version,pauseGameOnStartup:v,depth:Ne(),domainMatched:a===i,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isLoaderGameURL",value:function(){return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)&&location.href.startsWith("https://html5.gamedistribution.com")}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var r=new k(location.href,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else if(t.test(document.referrer)){var n=new k(document.referrer,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else{var o=new k(location.href,!0);if(!o.query.gd_zone_config)return;e=o.query.gd_zone_config}return JSON.parse(zh(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new yk(t).splash()}},{key:"_createPrerollPromoTemplate",value:(n=t(u.mark((function e(t){var r,n,o,a,i;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=null===(r=t.promo)||void 0===r?void 0:r[null===(n=t.promo)||void 0===n||null===(o=n.template)||void 0===o?void 0:o.preroll],i=new bk(a),e.abrupt("return",i.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(Fh(JSON.stringify(e)))}catch(e){}try{var r=new k(location.href,!0);return r.query=r.query||{},r.query.gd_zone_config=t,"?".concat(c.stringify(r.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var r=new k(e,!0);return r.query=Vk(Vk({},r.query),t),r.toString()}},{key:"_base64_encode",value:function(e){return Fh(JSON.stringify(e))}},{key:"session",value:function(){var e=this;return new Promise(function(){var r=t(u.mark((function t(r,n){var o;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.sdkReady;case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:o=e._gameData,r({ads:{display:{enabled:o.dAds.enabled},rewarded:{enabled:o.rewardedAds}},location:{parentDomain:e._bridge.parentDomain,topDomain:e._bridge.topDomain,parentURL:e._bridge.parentURL,depth:e._bridge.depth,loadedByGameZone:e._bridge.isTokenGameURL}});case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e,t){return r.apply(this,arguments)}}())}},{key:"_getisMobile",value:function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),!1===t&&window.orientation>-1&&(t=!0),t}},{key:"_get_game_thumbnail_url",value:function(){var e=this,t=this._gameData,n=t.assets.find(function(t){return r(this,e),t.hasOwnProperty("name")&&512===t.width&&512===t.height}.bind(this));return n||(n=t.assets.length>0?t.assets[0]:{name:"logo.svg"}),"https://img.gamedistribution.com/".concat(n.name)}},{key:"_post_message",value:function(e){var t,r=e.topic,n=e.data,o=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var a=window.top||window.parent;a&&a.postMessage({source:"gdsdk",topic:r,data:n},o)}catch(e){console.error((null==e?void 0:e.message)||e)}}},{key:"decideToGiveAGift",value:function(){var e=this;try{var n,o=null===(n=this._gameData)||void 0===n?void 0:n.gft,a=setInterval(t(u.mark((function t(){var n=this;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.adInstance.requestRunning?console.log("Advertisement already running..."):(e.showAd(Te.Interstitial,{position:"midroll"}).catch(function(e){r(this,n)}.bind(this)),clearInterval(a),e._giftCount++);case 1:case"end":return t.stop()}}),t,this)}))),1e3*o.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}}]),e}(),eE={},tE=function(e){try{if(e.skipForward)return;if(eE.source){var t={type:"gd-sdk-on-event",event:e};eE.source.postMessage(t,eE.origin)}}catch(e){console.log("gd-sdk forwardEvent err",e)}},rE=function(){tE({name:"SDK_READY",status:"success",message:"Everything is ready."}),tE({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),tE({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},nE=function(e){window.addEventListener("message",(function(n){var o=n.data,a=n.origin,i=n.source,s=o.type,c=o.method,l=o.options;if("gd-sdk-self"!==s){if("gd-sdk"===s){if(!eE.source&&"init"===c)return function(e){var t=e.source,r=e.origin;eE={source:t,origin:r}}({source:i,origin:a}),void rE();var d=e[c];d&&t(u.mark((function t(){var n,o=this;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,function(){r(this,o),"showAd"===c&&na.firstAdapterModeAdsense&&"rewarded"!==l.adType&&(console.log("promo-test, set first adapter to adssense 3"),l.params=l.params?l.params:{},l.params.adapter="adsense")}.bind(this),!(n=d.apply(e,Object.values(l)))||!n.then){t.next=6;break}return t.next=6,n;case 6:t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),console.log("gd:adp:m:r onFrameMessage error",t.t0);case 11:case"end":return t.stop()}}),t,this,[[0,8]])})))()}}else{var f={type:"gd-sdk",method:c,options:l};window.postMessage(f,"https://html5.gamedistribution.com")}}),!1)},oE=function(e){!function(e){var t=e.onEvent;e.onEvent=function(e){tE(e),t.apply(this,arguments)}}(e);var t=new Xk(e);return nE(t),t},aE=function(e){try{var t=cA(e);e.gameId||t.send("nogameid",{message:"".concat(Vh.parentURL)})}catch(e){}},iE={create:function(){var e=t(u.mark((function e(t){var r,n;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,aE(t),nA=cA(aA=t),e.next=5,SA();case 5:return r=e.sent,n=r?wA(t):oE(t),gA(),e.abrupt("return",n);case 11:return e.prev=11,e.t0=e.catch(0),console.log("gd:adp: sdk adaptor create failed, fallback to default adapter",e.t0),e.abrupt("return",oE(t));case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(t){return e.apply(this,arguments)}}()};function sE(){return(sE=t(u.mark((function e(t,r){var n;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_A();case 2:if(!e.sent){e.next=7;break}e.t0=window.gdsdk,e.next=10;break;case 7:return e.next=9,cE(t);case 9:e.t0=e.sent;case 10:return n=e.t0,e.abrupt("return",r(n));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var uE=!1;function cE(e){var t=this;return new Promise(function(n,o){var a=this;if(r(this,t),Yk)return n(Yk);if(uE)var i=setInterval(function(){r(this,a),Yk&&(uE=!1,clearInterval(i),n(Yk))}.bind(this),100);else uE=!0,iE.create(e).then(function(e){r(this,a),Yk=e,e._sendSDKReady(),uE=!1,n(Yk)}.bind(this))}.bind(this))}var lE,dE=(cE(lE=function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":n(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===n(window.gdApi.q[0][0])&&window.gdApi.q[0][0]&&((e=window.gdApi.q[0][0]).hasOwnProperty("advertisementSettings")||(e.advertisementSettings={autoplay:!0}))}catch(e){console.log("_get_developer_sets failed",e)}return e}()),{invoke:function(e){return function(e,t){return sE.apply(this,arguments)}(lE,e)}});function fE(){var e=this;this.AdType=Te,this.preloadAd=function(e){var t=this;return dE.invoke(function(n){return r(this,t),n.preloadAd(e)}.bind(this))},this.showAd=function(){var e=t(u.mark((function e(t,n){var o=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",dE.invoke(function(e){var a=this;if(r(this,o),t===Te.Display)return e.showDisplayAd(n);return function(){r(this,a)}.bind(this),e.showAd(t,{})}.bind(this)));case 1:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}(),this.cancelAd=function(){var e=this;return dE.invoke(function(t){return r(this,e),t.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return dE.invoke(function(t){return r(this,e),t.openConsole()}.bind(this))},this.getSession=function(){var e=this;return dE.invoke(function(t){return r(this,e),t.session()}.bind(this))},this.leaderboard={show:function(){r(this,e),ip.showLeaderboard()}.bind(this),addScore:function(t){r(this,e),ip.addScore(t)}.bind(this)}}fE.prototype=new function(){this.showBanner=function(){var e=this;return dE.invoke(function(t){return r(this,e),t.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new fE,window.gdApi=window.gdsdk}();
39
+ const{deleteProperty:Hw}=Reflect,qw=function(e){return"object"==typeof e?null===e:"function"!=typeof e},Kw=function(e){var t,r;return!1!==Zw(e)&&("function"==typeof(t=e.constructor)&&(!1!==Zw(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf")))},Ww=e=>"object"==typeof e&&null!==e||"function"==typeof e,Vw=e=>{if(!qw(e))throw new TypeError("Object keys must be strings or symbols");if((e=>"__proto__"===e||"constructor"===e||"prototype"===e)(e))throw new Error(`Cannot set unsafe key: "${e}"`)},Yw=(e,t,r)=>{const n=(e=>Array.isArray(e)?e.flat().map(String).join(","):e)(t?((e,t)=>{if("string"!=typeof e||!t)return e;let r=e+";";return void 0!==t.arrays&&(r+=`arrays=${t.arrays};`),void 0!==t.separator&&(r+=`separator=${t.separator};`),void 0!==t.split&&(r+=`split=${t.split};`),void 0!==t.merge&&(r+=`merge=${t.merge};`),void 0!==t.preservePaths&&(r+=`preservePaths=${t.preservePaths};`),r})(e,t):e);Vw(n);const o=Xw.cache.get(n)||r();return Xw.cache.set(n,o),o},Qw=(e,t)=>t&&"function"==typeof t.split?t.split(e):"symbol"==typeof e?[e]:Array.isArray(e)?e:Yw(e,t,(()=>((e,t={})=>{const r=t.separator||".",n="/"!==r&&t.preservePaths;if("string"==typeof e&&!1!==n&&/\//.test(e))return[e];const o=[];let a="";const i=e=>{let t;""!==e.trim()&&Number.isInteger(t=Number(e))?o.push(t):o.push(e)};for(let t=0;t<e.length;t++){const n=e[t];"\\"!==n?n!==r?a+=n:(i(a),a=""):a+=e[++t]}return a&&i(a),o})(e,t))),Jw=(e,t,r,n)=>{if(Vw(t),void 0===r)Hw(e,t);else if(n&&n.merge){const o="function"===n.merge?n.merge:Object.assign;o&&Kw(e[t])&&Kw(r)?e[t]=o(e[t],r):e[t]=r}else e[t]=r;return e},Xw=(e,t,r,n)=>{if(!t||!Ww(e))return e;const o=Qw(t,n);let a=e;for(let e=0;e<o.length;e++){const t=o[e],i=o[e+1];if(Vw(t),void 0===i){Jw(a,t,r,n);break}"number"!=typeof i||Array.isArray(a[t])?(Ww(a[t])||(a[t]={}),a=a[t]):a=a[t]=[]}return e};Xw.split=Qw,Xw.cache=new Map,Xw.clear=()=>{Xw.cache=new Map};var eA=Xw;function tA(e){var t=this,n={},o=(null==e?void 0:e._ancestor_origins)||window.location.ancestorOrigins,a=(null==e?void 0:e.self_url)||window.location.href,i=(null==e?void 0:e.self_origin)||window.location.origin,s=(null==e?void 0:e.referrer_url)||document.referrer;function u(e){return function(e,t,r){if($w(r)||(r={default:r}),!Fw(e))return void 0!==r.default?r.default:e;"number"==typeof t&&(t=String(t));const n=Array.isArray(t),o="string"==typeof t,a=r.separator||".",i=r.joinChar||("string"==typeof a?a:".");if(!o&&!n)return e;if(o&&t in e)return Gw(t,e,r)?e[t]:r.default;let s=n?t:function(e,t,r){return"function"==typeof r.split?r.split(e):e.split(t)}(t,a,r),u=s.length,c=0;do{let t=s[c];for("number"==typeof t&&(t=String(t));t&&"\\"===t.slice(-1);)t=Nw([t.slice(0,-1),s[++c]||""],i,r);if(t in e){if(!Gw(t,e,r))return r.default;e=e[t]}else{let n=!1,o=c+1;for(;o<u;)if(t=Nw([t,s[o++]],i,r),n=t in e){if(!Gw(t,e,r))return r.default;e=e[t],c=o-1;break}if(!n)return r.default}}while(++c<u&&Fw(e));return c===u?e:r.default}(n,e)}function c(e,t){return eA(n,e,t)}function l(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new k(e,t)}catch(e){console.log(e)}}function d(){for(var t=(null==e?void 0:e.urls)||[a,s],r=0;r<t.length;r++){var n,o=l(t[r]);if(o){var i=null===(n=o.query)||void 0===n?void 0:n.gd_sdk_referrer_url;if(i&&(i=decodeURIComponent(i),dw.isURL(i)))return i}}}return function(){var e;r(this,t),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){c("depth.error",e.message)}c("depth.value",e)}(),function(){var e=o,t=n.depth.value,r=i;if(c("top.domain.from","fallback"),e&&e.length>0)r=e[e.length-1],c("top.domain.from","origins");else if(0===t)r=i,c("top.domain.from","self-top");else if(1===t){var a=l(s);a&&(r=a.origin,c("top.domain.from","referrer"))}c("top.domain.value",r.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=d();if(e)if(Uw(e))c("partner.domain.value",e),c("partner.domain.from","partner-domain");else{var t=l(e,!1);if(t)c("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),c("partner.domain.from","partner-url");else c("partner.domain.value",n.top.domain.value),c("partner.domain.from","partner-fallback")}else c("partner.domain.value",n.top.domain.value),c("partner.domain.from","fallback")}(),e=d(),0===n.depth.value?(c("partner.url.value",a),c("partner.url.from","self-top")):e?Uw(e)?(c("partner.url.value",a),c("partner.url.from","partner-domain")):(c("partner.url.value",e),c("partner.url.from","partner-url")):(c("partner.url.value",s),c("partner.url.from","fallback"))}.bind(this)(),{get:u,print:function(e){console.log(u(e))}}}var rA,nA,oA,aA,iA={name:"@bygd/gd-sdk-pes",version:"1.28.16",files:["dist/*"],scripts:{build:"NODE_ENV=production rollup --config",watch:"rollup --config --watch --sourcemap --environment DEVELOPMENT","deploy-base":"npm install && npm run build && npm publish --access public",deploy:"npm run deploy-base && gdtool pm-upload"},repository:{type:"git",url:"git@gitlab.azerdev.com:gamedistribution/gd-sdk-pes.git"},author:"",license:"ISC",devDependencies:{"@babel/core":"^7.14.6","@babel/plugin-transform-runtime":"^7.14.5","@babel/preset-env":"^7.14.7","@rollup/plugin-babel":"^5.2.3","@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-replace":"^3.0.0",postcss:"^8.3.5",rollup:"^2.52.8","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-browsersync":"^1.3.3","rollup-plugin-delete":"^2.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-postcss":"^4.0.0","rollup-plugin-terser":"^7.0.2"},dependencies:{"@babel/runtime":"^7.14.6","@bygd/gd-sdk-era":"^0.3.6",axios:"^0.26.1","can-autoplay":"^3.0.2",events:"^3.3.0","get-value":"^3.0.1","is-plain-object":"^5.0.0","is-valid-domain":"^0.1.2","js-base64":"^3.6.1","leaderboard-lib":"0.1.11","lodash.clonedeep":"^4.5.0","lodash.merge":"^4.6.2",querystringify:"^2.2.0","set-value":"^4.1.0","url-parse":"^1.4.7",uuid:"^8.3.2",validator:"^13.6.0"}},sA=function(e){var t=uA("object"===n(e)?e:function(e){if(e)try{return JSON.parse(e)}catch(e){}}(e));return t&&t.version?iA.version>=t.version?t:void 0:t},uA=function(e){var t=this;if(!B(e)||0===e.length)return e;if(1===e.length)return e[0];var n=0;e.forEach(function(e){r(this,t),e.weight=e.weight||1,n+=e.weight}.bind(this));var o=Math.floor(Math.random()*Math.floor(n));n=0;for(var a=0;a<e.length;a++){var i=e[a];if(o<(n+=i.weight))return i}},cA=function(e){var t=this;if(!rA){var n={gameId:e.gameId,hours:(new Date).getHours(),topDomain:Vh.topDomain,domain:Vh.parentDomain,referrer:Vh.parentURL,depth:Ne(),version:iA.version,byloader:Vh.isTokenGameURL,isTokenGameURL:Vh.isTokenGameURL,isMasterGameURL:Vh.isMasterGameURL,isExtHostedGameURL:Vh.isExtHostedGameURL,byloaderVersion:Vh.version,tracking:Yh.userDeclinedTracking,whitelabel:Yh.whitelabelPartner,platform:Be()};rA=new at(n)}return rA||{send:function(){r(this,t)}.bind(this)}},lA=[],dA=function(e){lA.push(e)},fA=function(){var e=t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(oA){e.next=4;break}return e.next=3,pA(aA);case 3:oA=e.sent;case 4:return e.abrupt("return",oA);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),pA=function(e){var t=this;nA.send("gdfw.loading",{message:"loading"}),lA=[],dA("1"),dA("2");var n=new tA;dA("3");var o=n.get("partner.domain.value");dA("4");var a=function(){return r(this,t),{gameId:e.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}.bind(this);dA("5");var i=function(){r(this,t);var n=s(),a=n?"&mode=".concat(n):"";return"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(o).concat(a,"&v=").concat(iA.version,"&localTime=").concat((new Date).getHours())}.bind(this);dA("6");var s=function(){var e=this;r(this,t);var n=new Proxy(new URLSearchParams(window.location.search),{get:function(t,n){return r(this,e),t.get(n)}.bind(this)});return!n.gd_mode&&window.location.search.includes("gd_mode")?window.location.search.split("gd_mode=")[1]:n.gd_mode}.bind(this);return dA("7"),new Promise(function(e){var n=this;if(r(this,t),oA)e(oA);else{dA("7.1");var o=a();try{dA("7.2");var s=i();dA("7.3"),fetch(s).then(function(e){return r(this,n),dA("7.4"),e.json()}.bind(this)).then(function(t){var a=this;if(r(this,n),dA("7.5"),t.success){var i,s,u,c,l=t.result.game;dA("7.6");var d={gameId:l.gameMd5,slug:l.slug,pname:l.pname,dname:l.dname,status:l.status,description:l.description,enableAds:!0===l.enableAds||!0===(null===(i=l.enableAds)||void 0===i?void 0:i.enabled),preroll:l.preRoll,midroll:6e4*l.timeAds,rewardedAds:l.rewardedAds,title:l.title,tags:l.tags,category:l.category,assets:l.assets,disp_2nd_prer:l.disp_2nd_prer,ctry_vst:l.ctry_vst,ctry:l.ctry,crtv:l.crtv,dmain:l.dmain,__t4r:l.__t4r||{},block_exts:sA(l.push_cuda),bloc_gard:sA(l.bloc_gard),cookie:sA(l.cookie),gdpr:sA(l.gdpr),diagnostic:sA(l.diagnostic),cmp:sA(l.cmp),gft:sA(l.gft)||{},sdk:sA(l.sdk)||{},sdkfw:sA(l.sdkfw)||{},loader:sA(l.loader)||{},splash:sA(l.splash)||{},promo:sA(l.promo)||{},dAds:sA(l.dads)||{},pAds:sA(l.pads)||{},mAds:sA(l.mads)||{},rAds:sA(l.rads)||{},lp:sA(l.lp)||{},extsc:sA(l.extsc)||{},evnts:sA(l.evnts)||{},dp:sA(l.dp)||{}};dA("7.7");var f=Ie(O(o),d);dA("7.8"),f.afg_disabled=!1===(null===(s=f.sdk)||void 0===s||null===(u=s.afg)||void 0===u?void 0:u.enabled),function(){r(this,a)}.bind(this),dA("7.9"),null!==(c=f.pAds)&&void 0!==c&&c.enabled&&(f.preroll=!0),dA("7.10"),nA.send("gdfw.success",{message:"success"}),e(f)}else{o.failed=!0;var p=lA[lA.length-1];nA.send("gdfw.err",{message:"".concat(p,": json error")}),e(o)}}.bind(this)).catch(function(t){r(this,n);var a=lA[lA.length-1];nA.send("gdfw.err",{message:"".concat(a,": ").concat(t.message?t.message:t)}),o.failed=!0,e(o)}.bind(this))}catch(t){var u=lA[lA.length-1];nA.send("gdfw.err",{message:"".concat(u,": global ").concat(t.message?t.message:t)}),o.failed=!0,e(o)}}}.bind(this))},hA=function(){var e=t(u.mark((function e(){var t,r;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fA();case 2:return r=e.sent,e.abrupt("return",!(null==r||null===(t=r.sdkfw)||void 0===t||!t.enabled));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),vA=function(){var e=t(u.mark((function e(){var t,r;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fA();case 2:return r=e.sent,e.next=5,hA();case 5:if(e.t0=e.sent,!e.t0){e.next=8;break}e.t0=!(null==r||null===(t=r.sdkfw)||void 0===t||!t.handshake);case 8:return e.abrupt("return",e.t0);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),mA=function(){var e=t(u.mark((function e(){var t,r,n,o,a,i,s,c;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fA();case 2:return s=e.sent,c=!(null==s||null===(t=s.extsc)||void 0===t||!t.enabled),e.abrupt("return",{enabled:c,path:c?null==s||null===(r=s.extsc)||void 0===r?void 0:r.path:"",name:c?null==s||null===(n=s.extsc)||void 0===n?void 0:n.name:"",ref:c?null==s||null===(o=s.extsc)||void 0===o?void 0:o.ref:"",loadedFlag:c?null==s||null===(a=s.extsc)||void 0===a?void 0:a.loadedFlag:void 0,loadedFlagCheck:!!c&&!(null==s||null===(i=s.extsc)||void 0===i||!i.loadedFlagCheck)});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),gA=function(){var e=t(u.mark((function e(){var t,n,o,a,i,s=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mA();case 2:if((t=e.sent).enabled){e.next=5;break}return e.abrupt("return");case 5:return n=t.path,o=t.name,a=t.ref,e.prev=6,i={},e.next=10,$e(n,o,{error_prefix:"Blocked:",exists:function(){return r(this,s),!!a&&!!window[a]}.bind(this),attrs:i});case 10:e.next=16;break;case 12:e.prev=12,e.t0=e.catch(6),console.log("extsc: error on external partner script load",o,e.t0),Ye("DEVELOPER_ERROR",e.t0,"warning");case 16:case"end":return e.stop()}}),e,this,[[6,12]])})));return function(){return e.apply(this,arguments)}}(),bA=!1,yA=!1,_A=function(){return new Promise(function(){var e=t(u.mark((function e(t,n){var o,a,i,s,c,l=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!bA){e.next=4;break}return e.abrupt("return",t(yA));case 4:bA=!0;case 5:return e.next=7,mA();case 7:if((o=e.sent).enabled){e.next=10;break}return e.abrupt("return",t(!1));case 10:if(a=o.loadedFlag,!(i=o.loadedFlagCheck)||a){e.next=13;break}return e.abrupt("return",t(!1));case 13:if(i){e.next=16;break}return yA=!0,e.abrupt("return",t(!0));case 16:s=!0,setTimeout(function(){r(this,l),s&&(s=!1,bA=!0,t(!1))}.bind(this),5e3),c=setInterval(function(){r(this,l),s&&i&&window[a]?(s=!1,bA=!0,yA=!0,clearInterval(c),t(!0)):s||clearInterval(c)}.bind(this),100);case 19:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}())},wA=function(e){var t=function(e){var t=this,n=function(e){return r(this,t),f("showAd",{adType:e})}.bind(this),o=function(e){return r(this,t),f("preloadAd",{adType:e})}.bind(this),a=function(e){return r(this,t),f("showDisplayAd",{options:e})}.bind(this),i=function(){return r(this,t),f("cancelAd")}.bind(this),s=function(){return r(this,t),f("openConsole")}.bind(this),u=function(){return r(this,t),f("showBanner")}.bind(this),c=function(){return r(this,t),f("session")}.bind(this),l=function(e){return r(this,t),f("sendGenericEvent",{options:e})}.bind(this),d=function(){r(this,t),console.log("_sendSDKReady")}.bind(this),f=function(e,n){var o=this;return r(this,t),n||(n={}),new Promise(function(t,a){r(this,o);try{var i={type:"gd-sdk",method:e,options:n};window.parent.postMessage(i,"https://html5.gamedistribution.com"),t()}catch(e){console.log("gd:adp:m:s:error",e),t()}}.bind(this))}.bind(this),p=function(){r(this,t),window.addEventListener("message",(function(e){var t=e.data;e.origin,e.source;var r=t.type,n=t.event;"gd-sdk-on-event"===r&&n&&v(n)}),!1)}.bind(this),h=function(){r(this,t),p(),f("init")}.bind(this),v=function(n){r(this,t),e.onEvent&&e.onEvent(n)}.bind(this);return{showBanner:u,showAd:n,preloadAd:o,showDisplayAd:a,cancelAd:i,openConsole:s,getSession:c,onEvent:v,init:h,_sendSDKReady:d,sendGenericEvent:l}}(e);return t.init(),t},AA=function(){var e=this;return{isMasterGameURL:function(){r(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)}.bind(this),isTokenGameURL:function(){r(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i.test(location.href)}.bind(this),isExtHostedGameURL:function(){r(this,e);return/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i.test(location.href)}.bind(this)}},xA="gd-sdk-frame-handshake-request",kA="gd-sdk-frame-handshake-response",EA=function(e){var t=this;return new Promise(function(n,o){var a=this;r(this,t);var i={type:xA},s=!1;window.addEventListener("message",(function(e){var t=e.data,r=e.origin,o=e.source,a=t.type;if(a===xA){var i={type:kA};o.postMessage(i,r)}else a===kA&&(s=!0,n({origin:r,source:o}))})),e?n():(setTimeout(function(){r(this,a),s||n()}.bind(this),200),window.parent!==window?window.parent.postMessage(i,"*"):n())}.bind(this))},SA=function(){var e=t(u.mark((function e(){var t,r,n,o,a,i,s,c;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,hA();case 2:return t=e.sent,r=!t,e.next=6,EA(r);case 6:if(n=e.sent,t){e.next=9;break}return e.abrupt("return",!1);case 9:return o=AA(),a=o.isMasterGameURL,i=a(),e.next=13,vA();case 13:return s=e.sent,c=!1,c=s?!i&&!!n:!i,e.abrupt("return",c);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),RA=Lt,DA=ea,OA=dn,TA=on.f,IA=function(e){return function(t){for(var r,n=OA(t),o=DA(n),a=o.length,i=0,s=[];a>i;)r=o[i++],RA&&!TA.call(n,r)||s.push(e?[r,n[r]]:n[r]);return s}},MA={entries:IA(!0),values:IA(!1)}.values;Qo({target:"Object",stat:!0},{values:function(e){return MA(e)}});var LA=Qo,CA=il,PA=ht,jA=io,UA=Ol,BA=Dd,$A=_n.exports;LA({target:"Promise",proto:!0,real:!0,forced:!!CA&&PA((function(){CA.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=UA(this,jA("Promise")),r="function"==typeof e;return this.then(r?function(r){return BA(t,e()).then((function(){return r}))}:e,r?function(r){return BA(t,e()).then((function(){throw r}))}:e)}}),"function"!=typeof CA||CA.prototype.finally||$A(CA.prototype,"finally",jA("Promise").prototype.finally);var NA="\t\n\v\f\r                 \u2028\u2029\ufeff",GA=_t,FA="[\t\n\v\f\r                 \u2028\u2029\ufeff]",zA=RegExp("^"+FA+FA+"*"),ZA=RegExp(FA+FA+"*$"),HA=function(e){return function(t){var r=String(GA(t));return 1&e&&(r=r.replace(zA,"")),2&e&&(r=r.replace(ZA,"")),r}},qA={start:HA(1),end:HA(2),trim:HA(3)},KA=ht,WA=NA,VA=qA.trim;Qo({target:"String",proto:!0,forced:function(e){return KA((function(){return!!WA[e]()||"​…᠎"!="​…᠎"[e]()||WA[e].name!==e}))}("trim")},{trim:function(){return VA(this)}});var YA=Ot,QA=qu,JA=Lt,XA=ct,ex=zo,tx=function(e,t,r){var n,o;return QA&&"function"==typeof(n=t.constructor)&&n!==r&&YA(o=n.prototype)&&o!==r.prototype&&QA(e,o),e},rx=Ct.f,nx=so.f,ox=lp,ax=Ep,ix=Pp,sx=_n.exports,ux=ht,cx=Kn.set,lx=pl,dx=kr("match"),fx=XA.RegExp,px=fx.prototype,hx=/a/g,vx=/a/g,mx=new fx(hx)!==hx,gx=ix.UNSUPPORTED_Y;if(JA&&ex("RegExp",!mx||gx||ux((function(){return vx[dx]=!1,fx(hx)!=hx||fx(vx)==vx||"/a/i"!=fx(hx,"i")})))){for(var bx=function(e,t){var r,n=this instanceof bx,o=ox(e),a=void 0===t;if(!n&&o&&e.constructor===bx&&a)return e;mx?o&&!a&&(e=e.source):e instanceof bx&&(a&&(t=ax.call(e)),e=e.source),gx&&(r=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var i=tx(mx?new fx(e,t):fx(e,t),n?this:px,bx);return gx&&r&&cx(i,{sticky:r}),i},yx=function(e){e in bx||rx(bx,e,{configurable:!0,get:function(){return fx[e]},set:function(t){fx[e]=t}})},_x=nx(fx),wx=0;_x.length>wx;)yx(_x[wx++]);px.constructor=bx,bx.prototype=px,sx(XA,"RegExp",bx)}lx("RegExp");var Ax=Qo,xx=jr.find,kx=Lc,Ex="find",Sx=!0,Rx=Hr(Ex);Ex in[]&&Array(1).find((function(){Sx=!1})),Ax({target:"Array",proto:!0,forced:Sx||!Rx},{find:function(e){return xx(this,e,arguments.length>1?arguments[1]:void 0)}}),kx(Ex);var Dx=Qo,Ox=dn,Tx=[].join,Ix=yt!=Object,Mx=Br("join",",");Dx({target:"Array",proto:!0,forced:Ix||!Mx},{join:function(e){return Tx.call(Ox(this),void 0===e?",":e)}});var Lx=Qo,Cx=jr.map,Px=Hr,jx=ns("map"),Ux=Px("map");Lx({target:"Array",proto:!0,forced:!jx||!Ux},{map:function(e){return Cx(this,e,arguments.length>1?arguments[1]:void 0)}});var Bx=Ev;Qo({target:"Object",stat:!0,forced:Object.assign!==Bx},{assign:Bx});var $x=function(){function e(t){E(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return R(e,[{key:"_getFakeCustomParams",value:function(){var e={_vid:["bla_bla1","bla_bla2","bla_bla3"],_1ld:["1ld_1","1ld_2","1ld_3","1ld_4"],_1lp:["1lp_1","1lp_2"]},t={};for(var r in e){var n=e[r];t[r]=n[Math.floor(Math.random()*n.length)]}return t}},{key:"checkCustomParams",value:function(){var e=this;try{var t={},n=this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled,o=new k(location.href,!0);for(var a in o.query)t[a]=o.query[a];return Object.keys(t).filter(function(t){var n=this;return r(this,e),this.customParamKeys.some(function(e){return r(this,n),e===t}.bind(this))}.bind(this)).length>0||n?(console.log("custom-params",t,n),t):void console.log("custom-params, none")}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),Nx=function(){function e(t,r){E(this,e),this.adContainer=t,this.onResume=r}return R(e,[{key:"show",value:function(){this.adResumeButton.style.display="block",this.adResumeButtonOverlay.style.display="block"}},{key:"hide",value:function(){this.adResumeButton.style.display="none",this.adResumeButtonOverlay.style.display="none"}},{key:"add",value:function(){var e=this;try{var t=document.createElement("div");this.adResumeButton=t,t.id="gd__resume__button",t.setAttribute("title","Resume"),this.addStyles(),t.classList.add("gd__resume__button"),t.addEventListener("click",function(){r(this,e),this.onResume()}.bind(this)),this.adContainer.appendChild(t);var n=document.createElement("div");this.adResumeButtonOverlay=n,n.id="gd__resume__button__overlay",n.classList.add("gd__resume__button__overlay"),this.adContainer.appendChild(n)}catch(e){console.log("Resume button add error",e)}}},{key:"addStyles",value:function(){var e=document.body||document.getElementsByTagName("body")[0];this.addStylesheet("gd__resume__button__style",e,'\n .gd__resume__button{\n background-image: url("https://img.gamedistribution.com/play-black.svg");\n background-color:white; \n width: 120px;\n height: 120px;\n position: absolute;\n display: none;\n z-index: 2000;\n cursor: pointer;\n top: calc(50% - 60px);\n left: calc(50% - 60px);\n margin: 0;\n border-radius: 50%;\n border: 2px solid white;\n animation: play-button 1s ease-in-out infinite alternate;\n -webkit-animation: play-button 1s ease-in-out infinite alternate;\n }\n \n .gd__resume__button__overlay {\n position: fixed;\n display: none;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0,0,0,0.5);\n z-index: 1999;\n cursor: pointer;\n }\n @keyframes play-button {\n 0% {\n transform: scale(1.0);\n -webkit-transform: scale(1.0);\n }\n 100% {\n transform: scale(1.1);\n -webkit-transform: scale(1.1);\n }\n }\n .gd__resume__button:hover{\n filter: invert(100%) sepia(51%) saturate(0%) hue-rotate(346deg) brightness(104%) contrast(100%); \n }\n ')}},{key:"addStylesheet",value:function(e,t,r){if(!document.getElementById(e)){var n=document.createElement("style");n.type="text/css",n.id=e,n.styleSheet?n.styleSheet.cssText=r:n.appendChild(document.createTextNode(r)),t.appendChild(n)}}}]),e}(),Gx=new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"}),Fx=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});function zx(e){return Object.assign({muted:!1,timeout:250,inline:!1},e)}function Zx(e,t){var r=e.muted,n=e.timeout,o=e.inline,a=t(),i=a.element,s=a.source,u=void 0,c=void 0,l=void 0;return i.muted=r,!0===r&&i.setAttribute("muted","muted"),!0===o&&i.setAttribute("playsinline","playsinline"),i.src=s,new Promise((function(e){u=i.play(),c=setTimeout((function(){l(!1,new Error("Timeout "+n+" ms has been reached"))}),n),l=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;i.remove(),i.srcObject=null,clearTimeout(c),e({result:t,error:r})},void 0!==u?u.then((function(){return l(!0)})).catch((function(e){return l(!1,e)})):l(!0)}))}var Hx={audio:function(e){return Zx(e=zx(e),(function(){return{element:document.createElement("audio"),source:URL.createObjectURL(Gx)}}))},video:function(e){return Zx(e=zx(e),(function(){return{element:document.createElement("video"),source:URL.createObjectURL(Fx)}}))}},qx={exports:{}};!function(e,t){var r="__lodash_hash_undefined__",n=9007199254740991,a="[object Arguments]",i="[object Function]",s="[object Object]",u=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[a]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[i]=l["[object Map]"]=l["[object Number]"]=l[s]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var d="object"==typeof o&&o&&o.Object===Object&&o,f="object"==typeof self&&self&&self.Object===Object&&self,p=d||f||Function("return this")(),h=t&&!t.nodeType&&t,v=h&&e&&!e.nodeType&&e,m=v&&v.exports===h,g=m&&d.process,b=function(){try{var e=v&&v.require&&v.require("util").types;return e||g&&g.binding&&g.binding("util")}catch(e){}}(),y=b&&b.isTypedArray;function _(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var w,A,x=Array.prototype,k=Function.prototype,E=Object.prototype,S=p["__core-js_shared__"],R=k.toString,D=E.hasOwnProperty,O=function(){var e=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),T=E.toString,I=R.call(Object),M=RegExp("^"+R.call(D).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=m?p.Buffer:void 0,C=p.Symbol,P=p.Uint8Array,j=L?L.allocUnsafe:void 0,U=(w=Object.getPrototypeOf,A=Object,function(e){return w(A(e))}),B=Object.create,$=E.propertyIsEnumerable,N=x.splice,G=C?C.toStringTag:void 0,F=function(){try{var e=pe(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),z=L?L.isBuffer:void 0,Z=Math.max,H=Date.now,q=pe(p,"Map"),K=pe(Object,"create"),W=function(){function e(){}return function(t){if(!Ee(t))return{};if(B)return B(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function V(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Y(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Q(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function J(e){var t=this.__data__=new Y(e);this.size=t.size}function X(e,t){var r=_e(e),n=!r&&ye(e),o=!r&&!n&&Ae(e),a=!r&&!n&&!o&&Re(e),i=r||n||o||a,s=i?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],u=s.length;for(var c in e)!t&&!D.call(e,c)||i&&("length"==c||o&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||he(c,u))||s.push(c);return s}function ee(e,t,r){(void 0!==r&&!be(e[t],r)||void 0===r&&!(t in e))&&ne(e,t,r)}function te(e,t,r){var n=e[t];D.call(e,t)&&be(n,r)&&(void 0!==r||t in e)||ne(e,t,r)}function re(e,t){for(var r=e.length;r--;)if(be(e[r][0],t))return r;return-1}function ne(e,t,r){"__proto__"==t&&F?F(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}V.prototype.clear=function(){this.__data__=K?K(null):{},this.size=0},V.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},V.prototype.get=function(e){var t=this.__data__;if(K){var n=t[e];return n===r?void 0:n}return D.call(t,e)?t[e]:void 0},V.prototype.has=function(e){var t=this.__data__;return K?void 0!==t[e]:D.call(t,e)},V.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=K&&void 0===t?r:t,this},Y.prototype.clear=function(){this.__data__=[],this.size=0},Y.prototype.delete=function(e){var t=this.__data__,r=re(t,e);return!(r<0)&&(r==t.length-1?t.pop():N.call(t,r,1),--this.size,!0)},Y.prototype.get=function(e){var t=this.__data__,r=re(t,e);return r<0?void 0:t[r][1]},Y.prototype.has=function(e){return re(this.__data__,e)>-1},Y.prototype.set=function(e,t){var r=this.__data__,n=re(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Q.prototype.clear=function(){this.size=0,this.__data__={hash:new V,map:new(q||Y),string:new V}},Q.prototype.delete=function(e){var t=fe(this,e).delete(e);return this.size-=t?1:0,t},Q.prototype.get=function(e){return fe(this,e).get(e)},Q.prototype.has=function(e){return fe(this,e).has(e)},Q.prototype.set=function(e,t){var r=fe(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},J.prototype.clear=function(){this.__data__=new Y,this.size=0},J.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},J.prototype.get=function(e){return this.__data__.get(e)},J.prototype.has=function(e){return this.__data__.has(e)},J.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Y){var n=r.__data__;if(!q||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Q(n)}return r.set(e,t),this.size=r.size,this};var oe,ae=function(e,t,r){for(var n=-1,o=Object(e),a=r(e),i=a.length;i--;){var s=a[oe?i:++n];if(!1===t(o[s],s,o))break}return e};function ie(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":G&&G in Object(e)?function(e){var t=D.call(e,G),r=e[G];try{e[G]=void 0;var n=!0}catch(e){}var o=T.call(e);n&&(t?e[G]=r:delete e[G]);return o}(e):function(e){return T.call(e)}(e)}function se(e){return Se(e)&&ie(e)==a}function ue(e){return!(!Ee(e)||function(e){return!!O&&O in e}(e))&&(xe(e)?M:u).test(function(e){if(null!=e){try{return R.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ce(e){if(!Ee(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=ve(e),r=[];for(var n in e)("constructor"!=n||!t&&D.call(e,n))&&r.push(n);return r}function le(e,t,r,n,o){e!==t&&ae(t,(function(a,i){if(o||(o=new J),Ee(a))!function(e,t,r,n,o,a,i){var u=me(e,r),c=me(t,r),l=i.get(c);if(l)return void ee(e,r,l);var d=a?a(u,c,r+"",e,t,i):void 0,f=void 0===d;if(f){var p=_e(c),h=!p&&Ae(c),v=!p&&!h&&Re(c);d=c,p||h||v?_e(u)?d=u:Se(_=u)&&we(_)?d=function(e,t){var r=-1,n=e.length;t||(t=Array(n));for(;++r<n;)t[r]=e[r];return t}(u):h?(f=!1,d=function(e,t){if(t)return e.slice();var r=e.length,n=j?j(r):new e.constructor(r);return e.copy(n),n}(c,!0)):v?(f=!1,m=c,g=!0?(b=m.buffer,y=new b.constructor(b.byteLength),new P(y).set(new P(b)),y):m.buffer,d=new m.constructor(g,m.byteOffset,m.length)):d=[]:function(e){if(!Se(e)||ie(e)!=s)return!1;var t=U(e);if(null===t)return!0;var r=D.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&R.call(r)==I}(c)||ye(c)?(d=u,ye(u)?d=function(e){return function(e,t,r,n){var o=!r;r||(r={});var a=-1,i=t.length;for(;++a<i;){var s=t[a],u=n?n(r[s],e[s],s,r,e):void 0;void 0===u&&(u=e[s]),o?ne(r,s,u):te(r,s,u)}return r}(e,De(e))}(u):Ee(u)&&!xe(u)||(d=function(e){return"function"!=typeof e.constructor||ve(e)?{}:W(U(e))}(c))):f=!1}var m,g,b,y;var _;f&&(i.set(c,d),o(d,c,n,a,i),i.delete(c));ee(e,r,d)}(e,t,i,r,le,n,o);else{var u=n?n(me(e,i),a,i+"",e,t,o):void 0;void 0===u&&(u=a),ee(e,i,u)}}),De)}function de(e,t){return ge(function(e,t,r){return t=Z(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=Z(n.length-t,0),i=Array(a);++o<a;)i[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(i),_(e,this,s)}}(e,t,Ie),e+"")}function fe(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function pe(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return ue(r)?r:void 0}function he(e,t){var r=typeof e;return!!(t=null==t?n:t)&&("number"==r||"symbol"!=r&&c.test(e))&&e>-1&&e%1==0&&e<t}function ve(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||E)}function me(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ge=function(e){var t=0,r=0;return function(){var n=H(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(F?function(e,t){return F(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:Ie);function be(e,t){return e===t||e!=e&&t!=t}var ye=se(function(){return arguments}())?se:function(e){return Se(e)&&D.call(e,"callee")&&!$.call(e,"callee")},_e=Array.isArray;function we(e){return null!=e&&ke(e.length)&&!xe(e)}var Ae=z||function(){return!1};function xe(e){if(!Ee(e))return!1;var t=ie(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}function Ee(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Se(e){return null!=e&&"object"==typeof e}var Re=y?function(e){return function(t){return e(t)}}(y):function(e){return Se(e)&&ke(e.length)&&!!l[ie(e)]};function De(e){return we(e)?X(e,!0):ce(e)}var Oe,Te=(Oe=function(e,t,r){le(e,t,r)},de((function(e,t){var r=-1,n=t.length,o=n>1?t[n-1]:void 0,a=n>2?t[2]:void 0;for(o=Oe.length>3&&"function"==typeof o?(n--,o):void 0,a&&function(e,t,r){if(!Ee(r))return!1;var n=typeof t;return!!("number"==n?we(r)&&he(t,r.length):"string"==n&&t in r)&&be(r[t],e)}(t[0],t[1],a)&&(o=n<3?void 0:o,n=1),e=Object(e);++r<n;){var i=t[r];i&&Oe(e,i,r,o)}return e})));function Ie(e){return e}e.exports=Te}(qx,qx.exports);var Kx=qx.exports;function Wx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vx(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wx(Object(r),!0).forEach((function(t){oa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wx(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yx(e){return null!=e&&e.error_url?"<vmap:VASTAdData>".concat(function(e){return e.promo_url?'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),"</vmap:VASTAdData>").trim():'<vmap:AdTagURI templateType="vast3"><![CDATA['.concat(null==e?void 0:e.adtag_url,"]]></vmap:AdTagURI>").trim()}var Qx,Jx={exports:{}},Xx="object"==typeof Reflect?Reflect:null,ek=Xx&&"function"==typeof Xx.apply?Xx.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};Qx=Xx&&"function"==typeof Xx.ownKeys?Xx.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var tk=Number.isNaN||function(e){return e!=e};function rk(){rk.init.call(this)}Jx.exports=rk,Jx.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}fk(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&fk(e,"error",t,r)}(e,o,{once:!0})}))},rk.EventEmitter=rk,rk.prototype._events=void 0,rk.prototype._eventsCount=0,rk.prototype._maxListeners=void 0;var nk=10;function ok(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function ak(e){return void 0===e._maxListeners?rk.defaultMaxListeners:e._maxListeners}function ik(e,t,r,n){var o,a,i,s;if(ok(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),i=a[t]),void 0===i)i=a[t]=r,++e._eventsCount;else if("function"==typeof i?i=a[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),(o=ak(e))>0&&i.length>o&&!i.warned){i.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=i.length,s=u,console&&console.warn&&console.warn(s)}return e}function sk(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function uk(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=sk.bind(n);return o.listener=r,n.wrapFn=o,o}function ck(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):dk(o,o.length)}function lk(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function dk(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function fk(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(a){n.once&&e.removeEventListener(t,o),r(a)}))}}function pk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function hk(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pk(Object(r),!0).forEach((function(t){oa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pk(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object.defineProperty(rk,"defaultMaxListeners",{enumerable:!0,get:function(){return nk},set:function(e){if("number"!=typeof e||e<0||tk(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");nk=e}}),rk.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},rk.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||tk(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},rk.prototype.getMaxListeners=function(){return ak(this)},rk.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var i=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw i.context=a,i}var s=o[e];if(void 0===s)return!1;if("function"==typeof s)ek(s,this,t);else{var u=s.length,c=dk(s,u);for(r=0;r<u;++r)ek(c[r],this,t)}return!0},rk.prototype.addListener=function(e,t){return ik(this,e,t,!1)},rk.prototype.on=rk.prototype.addListener,rk.prototype.prependListener=function(e,t){return ik(this,e,t,!0)},rk.prototype.once=function(e,t){return ok(t),this.on(e,uk(this,e,t)),this},rk.prototype.prependOnceListener=function(e,t){return ok(t),this.prependListener(e,uk(this,e,t)),this},rk.prototype.removeListener=function(e,t){var r,n,o,a,i;if(ok(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){i=r[a].listener,o=a;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,i||t)}return this},rk.prototype.off=rk.prototype.removeListener,rk.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(o=a[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},rk.prototype.listeners=function(e){return ck(this,e,!0)},rk.prototype.rawListeners=function(e){return ck(this,e,!1)},rk.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):lk.call(e,t)},rk.prototype.listenerCount=lk,rk.prototype.eventNames=function(){return this._eventsCount>0?Qx(this._events):[]};var vk=new Jx.exports.EventEmitter,mk=null,gk=function(){function e(t,n,o){var a=this;if(E(this,e),mk)return mk;mk=this;var i={debug:!1,width:640,height:360,locale:"en"};this.options=n?Ie(i,n):i,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new nt,this.safetyTimer=null,this.containerTransitionSpeed=0,this.adCounter={},this.adPrerollCount=0,this.adMidrollCount=0,this.adRewardedCount=0,this.preloadedAdType=null,this.requestRunning=!1,this.parentDomain=o.parentDomain,this.topDomain=o.topDomain,this.parentURL=o.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags={interstitial:["https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=","https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dredirectlinear&correlator=","https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dredirecterror&correlator="],rewarded:["https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator="]},this.atom_display,this.adType_="",this.clickCount={midroll:0,preroll:0,rewarded:0},this.userAllowedPersonalizedAds=document.location.search.indexOf("gdpr-targeting=0")>=0||document.cookie.indexOf("ogdpr_advertisement=0")>=0?"0":"1",this.parentDomain.includes("girlsgogames")&&(this.userAllowedPersonalizedAds=!1),this.thirdPartyContainer=""!==t?document.getElementById(t):null,this.options.width="number"==typeof this.options.width?this.options.width:"100%"===this.options.width?640:this.options.width.replace(/[^0-9]/g,""),this.options.height="number"==typeof this.options.height?this.options.height:"100%"===this.options.height?360:this.options.height.replace(/[^0-9]/g,"");var s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,u=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:s,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:u,this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){r(this,a),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){r(this,a),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var n,o,a,i,s,l,d,f,p,h,v,m,g,b,y,_,w,A,x,S,D;return R(e,[{key:"start",value:(D=t(u.mark((function e(){var t=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._init_afg_script({adsense_channel:"4089988593"});case 3:return e.next=5,this._init_hl_script();case 5:return e.next=7,this._init_ima_script();case 7:this._createPlayer(),this._setUpIMA(),window.eventTest=function(e){r(this,t),this.eventBus.broadcast(e,{message:"",status:"success"})}.bind(this),e.next=15;break;case 12:throw e.prev=12,e.t0=e.catch(0),new Error(e.t0);case 15:case"end":return e.stop()}}),e,this,[[0,12]])}))),function(){return D.apply(this,arguments)})},{key:"_getAdVast",value:function(e,n){var o=this;return new Promise(function(){var a=t(u.mark((function t(a){var i,s,c,l,d,f,p,h,v=this;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(He&&Ze("gd_debug_ex")&&Ze("gd_tag"))){t.next=6;break}return i=o.IMASampleTags[e],s=Math.floor(Math.random()*i.length),c=i[s],a({url:c}),t.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){t.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return t.prev=8,l=o.nextAdPosition(e),o.eventBus.broadcast("AD_REQUEST",{message:l}),d=o.options,"preroll"===l&&I(d.preroll)?d=d.preroll:"midroll"===l&&I(d.midroll)?d=d.midroll:"rewarded"===l&&I(d.rewarded)&&(d=d.rewarded),f="rewarded"===l?"rewardedVideo":"gdbanner"===l?"gd__banner":"midroll"===l?"midroll":"video1",t.next=16,window.idhb.isLoaded();case 16:if(p={tnl_keys:hk(hk({},window.idhb.getAdserverTargetingForAdSlot(f)),{},{tnl_ad_pos:l,tnl_asset_id:o.gameData.gameId})},!(n&&n.retry_on_success&&I(d.retry_on_success)&&I(d.retry_on_success.vast))){t.next=21;break}return t.abrupt("return",a(o._createCustomAdVastUrl(d.retry_on_success.vast,p)));case 21:if(!(n&&n.retry_on_failure&&o.options.retry_on_failure&&I(d.retry_on_failure.vast))){t.next=25;break}return t.abrupt("return",a(o._createCustomAdVastUrl(d.retry_on_failure.vast,p)));case 25:if(!I(d.vast)){t.next=27;break}return t.abrupt("return",a(o._createCustomAdVastUrl(d.vast,p)));case 27:return t.next=29,o._create_dp_context(l,n);case 29:h=t.sent,window.idhb.requestAds({slots:oa({},f,{bidFloor:null!=h&&h.floor_price?h.floor_price:void 0}),callback:function(e,t){var n=this;r(this,v),!h||null!=t&&t.bidFloorApplied||fetch(h.skip_url).catch(function(e){r(this,n)}.bind(this)),a({tnl_keys:hk(hk({},window.idhb.getAdserverTargetingForAdSlot(f)),{},{tnl_ad_pos:l,tnl_asset_id:o.gameData.gameId}),url:e,dp:h,hl:t})}.bind(this)}),t.next=36;break;case 33:throw t.prev=33,t.t0=t.catch(8),new Error(t.t0);case 36:case"end":return t.stop()}}),t,this,[[8,33]])})));return function(e){return a.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===Te.Rewarded)return this.adRewardedCount++,"rewarded";if(e===Te.Interstitial){var t=!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount;return t?this.adMidrollCount++:this.adPrerollCount++,t||this.adMidrollCount>0?"midroll":"preroll"}return"midroll"}},{key:"getAdPosition",value:function(e){return e===Te.Rewarded?"rewarded":e===Te.Interstitial?!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_requestPromo",value:function(e,t){var r=new google.ima.AdsRequest;return r.adsResponse=function(e){return'<VAST version="3.0"> \n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA['.concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,"]]></VASTAdTagURI> \n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),r.linearAdSlotWidth=this.options.width,r.linearAdSlotHeight=this.options.height,r.nonLinearAdSlotWidth=this.options.width,r.nonLinearAdSlotHeight=this.options.height,r.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(r.vastLoadTimeout=this.options.vast_load_timeout),r.setAdWillAutoPlay(t.autoplayAllowed),r.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(r),r}},{key:"_requestAd",value:function(e,t){var n=this;return t=t||{},new Promise(function(o){if(r(this,n),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var a,i=null==e||null===(a=e.tnl_keys)||void 0===a?void 0:a.tnl_ad_pos;this.adSuccess=!1;var s=new google.ima.AdsRequest,u=this._transformVast(e,t),c=hk(hk({},t),{},{adTag:u,tnl_ad_pos:i});this.adCounter[i]=this.adCounter[i]||0,this.adCounter[i]++;var l=e.dp,d=e.hl;if(l&&(l.adtag_url=u.url,this._extend_dp_with_adsense(l,d,null==e?void 0:e.tnl_keys)),this._isVMAP(i)){var f=function(e){var t=e.position||"midroll",r=e.dp_1,n=e.dp_2,o=Date.now(),a=new k(e.adtag_url_1,!0);a.query=Vx(Vx({},a.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:o,output:"xml_vast3"});var i=a.toString(),s=new k(e.adtag_url_2,!0);s.query=Vx(Vx({},s.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++o,output:"xml_vast3"});var u=s.toString(),c=Date.now();return'<?xml version="1.0" encoding="UTF-8"?>\n<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-1">\n <vmap:AdSource id="'.concat(c++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(Yx({id:c++,adtag_url:i,error_url:null==r?void 0:r.error_url,impression_url:null==r?void 0:r.impression_url}),'\n </vmap:AdSource>\n</vmap:AdBreak>\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-2">\n <vmap:AdSource id="').concat(c++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(Yx({id:c++,adtag_url:u,error_url:null==n?void 0:n.error_url,impression_url:null==n?void 0:n.impression_url}),'\n </vmap:AdSource>\n <vmap:Extensions>\n <vmap:Extension type="bumper" suppress_bumper="true"></vmap:Extension>\n </vmap:Extensions>\n</vmap:AdBreak>\n</vmap:VMAP>').trim()}(this._get_vmap_context({dp:l,adtag:u,position:"preroll"===c.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(i)}));s.adsResponse=f}else if(l&&d.bidFloorApplied){var p=function(e){return e.promo_url?e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="2" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(l);s.adsResponse=p}else if(l&&l.fallback_url){var h=function(e){return'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim()}(l);s.adsResponse=h}else s.adTagUrl=u.url;s.linearAdSlotWidth=this.options.width,s.linearAdSlotHeight=this.options.height,s.nonLinearAdSlotWidth=this.options.width,s.nonLinearAdSlotHeight=this.options.height,s.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(s.vastLoadTimeout=this.options.vast_load_timeout),s.setAdWillAutoPlay(t.autoplayAllowed),s.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(s,c);try{this.eventBus.broadcast("AD_SDK_REQUEST",{message:c})}catch(e){}o(s)}catch(e){throw new Error(e)}}.bind(this))}},{key:"cancel",value:function(){if(!1!==this.requestRunning){this.requestRunning=!1,this._resetAdsLoader(),this._hide("cancel");var e="AD_SDK_CANCELED";this.eventBus.broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameData.gameId}})}}},{key:"_checkAutoPlay",value:(S=t(u.mark((function e(){var t=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var o=this;r(this,t);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):Hx.video({inline:!0,muted:!1}).then(function(t){r(this,o);var n=t.result;t.error,e(!0===n?{autoplayAllowed:!0,autoplayRequiresMute:!1}:{autoplayAllowed:!0,autoplayRequiresMute:!0})}.bind(this))}.bind(this)));case 1:case"end":return e.stop()}}),e,this)}))),function(){return S.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(x=t(u.mark((function e(){var t;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._checkAutoPlay(!1);case 2:return t=e.sent,this._autoplay=t,this.video_ad_player.autoplay=t.autoplayAllowed,this.video_ad_player.volume=t.autoplayRequiresMute?0:1,this.video_ad_player.muted=!!t.autoplayRequiresMute,t.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0),e.abrupt("return",t);case 9:case"end":return e.stop()}}),e,this)}))),function(){return x.apply(this,arguments)})},{key:"startAd",value:(A=t(u.mark((function e(t){var r,n,o;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.gameData.afg_disabled,n=t.adType,o=t.params,this.adType_=n,"promo"!==(null==o?void 0:o.adapter)){e.next=5;break}return e.abrupt("return",this._startPromo(o,n));case 5:if(n!==Te.Interstitial){e.next=25;break}if(!r){e.next=10;break}return e.abrupt("return",this._startInterstitialAd(o));case 10:if("preroll"!==(null==o?void 0:o.position)||"adsense"!==(null==o?void 0:o.adapter)){e.next=14;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 14:if("start"!==(null==o?void 0:o.position)||"adsense"!==(null==o?void 0:o.adapter)){e.next=18;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 18:if("next"!==(null==o?void 0:o.position)||"adsense"!==(null==o?void 0:o.adapter)){e.next=22;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 22:return e.abrupt("return",this._startInterstitialAd(o));case 23:e.next=34;break;case 25:if(n!==Te.Rewarded){e.next=33;break}if(!r){e.next=30;break}return e.abrupt("return",this._startRewardedAd(o));case 30:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 31:e.next=34;break;case 33:throw new Error("Unsupported ad type");case 34:case"end":return e.stop()}}),e,this)}))),function(e){return A.apply(this,arguments)})},{key:"preloadAd",value:(w=t(u.mark((function e(t){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==Te.Interstitial){e.next=4;break}return e.abrupt("return","gdsdk://preloaded");case 4:if(t!==Te.Rewarded){e.next=8;break}return e.abrupt("return","gdsdk://preloaded");case 8:throw new Error("Unsupported ad type");case 9:case"end":return e.stop()}}),e)}))),function(e){return w.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,t=function(){r(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new Nx(this.adContainer,t),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(_=t(u.mark((function e(n){var o=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=t(u.mark((function e(t,a){var i,s,c,l,d,f,p,h,v,m=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(s=n?n.containerId:null)||a("Container id is not specified"),c=document.getElementById(s),document.getElementById(s)||a("No container is found with this id - ".concat(s)),void 0===window.idhb.requestAds&&a("Prebid.js wrapper script hit an error or didn't exist!"),l=n.slotId?n.slotId:"gd__banner@".concat(s),document.getElementById(l)||(d="\n .gd__banner{\n z-index: ".concat(et.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((f=document.createElement("style")).type="text/css",f.id="gd__banner__style",f.styleSheet?f.styleSheet.cssText=d:f.appendChild(document.createTextNode(d)),c.appendChild(f)),(p=document.createElement("div")).id=l,p.classList.add("gd__banner"),c.appendChild(p)),e.next=10,o._create_dp_display_context();case 10:o.atom_display=e.sent,null!==(i=o.atom_display)&&void 0!==i&&i.params&&window.idhb.setAdserverTargeting(null===(h=o.atom_display)||void 0===h?void 0:h.params),(v={})[l]={maxSize:[c.offsetWidth,c.offsetHeight]},window.idhb.requestAds({slots:v,callback:function(e){r(this,m)}.bind(this)}),t(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),a(e.t0.message||e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(t,r){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return _.apply(this,arguments)})},{key:"_startInterstitialAd",value:(y=t(u.mark((function e(t){var n,o=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){r(this,o)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return n=e.sent,e.next=13,this._loadInterstitialAd(hk(hk({},n),t));case 13:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=22;break;case 18:throw e.prev=18,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(e){return y.apply(this,arguments)})},{key:"_startPromo",value:(b=t(u.mark((function e(t,r){var n;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,this.adSuccess=!1,e.next=8,this._initDisplayContainerWithAutoPlay();case 8:return n=e.sent,e.next=11,this._loadPromo(hk(hk({},n),t),r);case 11:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),this.msgrt.send("promo.adsense",{message:"".concat(t.position," success")}),e.next=22;break;case 17:throw e.prev=17,e.t0=e.catch(0),this.msgrt.send("promo.adsense.err",{message:"".concat(t.position," failure,").concat(e.t0.message?e.t0.message:e.t0,", [").concat(this.parentURL,"]")}),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,17]])}))),function(e,t){return b.apply(this,arguments)})},{key:"_loadPromo",value:(g=t(u.mark((function e(t,n){var o,a,i,s=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._resetAdsLoader(),e.prev=1,o=this.nextAdPosition(n),a=this._create_promo_context(o),i=this._requestPromo(a,hk({adType:Te.Interstitial},t)),e.next=7,new Promise(function(e,t){var n=this;r(this,s);var o="videoad.preloadad";this.eventBus.unsubscribeScope(o);var a=function(t){r(this,n),this.eventBus.unsubscribeScope(o),e(t.message)}.bind(this),i=function(e){r(this,n),this.eventBus.unsubscribeScope(o),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,o),this.eventBus.subscribe("AD_SDK_CANCELED",i,o),this.eventBus.subscribe("AD_ERROR",i,o),vk.once("AD_ERROR",function(e){r(this,n),i(e)}.bind(this))}.bind(this));case 7:return e.abrupt("return",i);case 10:throw e.prev=10,e.t0=e.catch(1),new Error(e.t0);case 13:case"end":return e.stop()}}),e,this,[[1,10]])}))),function(e,t){return g.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(m=t(u.mark((function e(t){var n,o,a=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(Te.Interstitial,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(n,hk({adType:Te.Interstitial},t));case 11:return o=e.sent,e.next=14,new Promise(function(e,t){var n=this;r(this,a);var o="videoad.preloadad";this.eventBus.unsubscribeScope(o);var i=function(t){r(this,n),this.eventBus.unsubscribeScope(o),e(t.message)}.bind(this),s=function(e){r(this,n),this.eventBus.unsubscribeScope(o),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",i,o),this.eventBus.subscribe("AD_SDK_CANCELED",s,o),this.eventBus.subscribe("AD_ERROR",s,o)}.bind(this));case 14:return e.abrupt("return",o);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return m.apply(this,arguments)})},{key:"_startRewardedAd",value:(v=t(u.mark((function e(t){var n,o=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){r(this,o)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return n=e.sent,e.next=13,this._loadRewardedAd(hk(hk({},n),t));case 13:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=22;break;case 18:throw e.prev=18,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(e){return v.apply(this,arguments)})},{key:"_loadRewardedAd",value:(h=t(u.mark((function e(t){var n,o,a=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(Te.Rewarded,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(n,hk({adType:Te.Rewarded},t));case 11:return o=e.sent,e.next=14,new Promise(function(e,t){var n=this;r(this,a);var o="videoad.preloadad";this.eventBus.unsubscribeScope(o);var i=function(t){r(this,n),this.eventBus.unsubscribeScope(o),e(t.message)}.bind(this),s=function(e){r(this,n),this.eventBus.unsubscribeScope(o),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",i,o),this.eventBus.subscribe("AD_SDK_CANCELED",s,o),this.eventBus.subscribe("AD_ERROR",s,o)}.bind(this));case 14:return e.abrupt("return",o);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return h.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(p=t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(Te.Interstitial);case 5:e.t0=e.sent;case 6:return this.preloadedInterstitialAdVast=e.t0,e.abrupt("return",this.preloadedInterstitialAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return p.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(f=t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(Te.Rewarded);case 5:e.t0=e.sent;case 6:return this.preloadedRewardedAdVast=e.t0,e.abrupt("return",this.preloadedRewardedAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return f.apply(this,arguments)})},{key:"_onError",value:function(e){this.cancel(),this._clearSafetyTimer("ERROR")}},{key:"_hide",value:function(e){this.video_ad_player.src="",this.activeAdContainer&&(this.activeAdContainer.style.visibility="hidden")}},{key:"_show",value:function(e){var t=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var n=null==e?void 0:e.mode;e.t4r=sA(this.gameData.__t4r)||{};var o=this._isT4R(e),a=this._getT4ROptions(e);if("loaded"===n)this.activeAdContainer.style.opacity=o?.001:1,o&&this.adsManager.setVolume(0),o&&this.eventBus.broadcast("AD_T4R"),o&&setTimeout(function(){r(this,t),this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}.bind(this),((null==a?void 0:a.min)||1234)+Math.random()*((null==a?void 0:a.max)||3210));else if("click"===n||"first_quartile"===n){if(o&&"click"===n){var i,s=null===(i=this._adrequest_user_context)||void 0===i?void 0:i.tnl_ad_pos;this.clickCount[s]++}this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}}}},{key:"_createPlayer",value:function(){var e=this,t=document.body||document.getElementsByTagName("body")[0];this.adContainer=document.createElement("div"),this.adContainer.id="".concat(this.prefix,"advertisement"),this.adContainer.style.position=this.thirdPartyContainer?"absolute":"fixed",this.adContainer.style.zIndex=Xe.zIndex,this.adContainer.style.top="0",this.adContainer.style.left="0",this.adContainer.style.width="100%",this.adContainer.style.height="100%",this.thirdPartyContainer&&(this.thirdPartyContainer.style.transform=null);var n=document.createElement("video");n.setAttribute("playsinline",!0),n.setAttribute("webkit-playsinline",!0),n.id="".concat(this.prefix,"advertisement_video"),n.style.position="absolute",n.style.backgroundColor="#000000",n.style.top="0",n.style.left="0",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px",this.video_ad_player=n,this.adContainer.appendChild(n);var o=document.createElement("div");o.id="".concat(this.prefix,"advertisement_slot"),o.style.position="absolute",o.style.top="0",o.style.left="0",o.style.width=this.options.width+"px",o.style.height=this.options.height+"px",this.adContainerInner=o,this.activeAdContainer=this.adContainer,window.activeAdContainer=this.activeAdContainer,this.thirdPartyContainer?(this.adContainer.appendChild(o),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(o),t.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var a=function(){r(this,e);var t=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:t,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:a,o.style.width=this.options.width+"px",o.style.height=this.options.height+"px",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px"}.bind(this);window.addEventListener("resize",a),window.document.addEventListener("DOMContentLoaded",a)}},{key:"_setUpIMA",value:function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.adContainerInner,this.video_ad_player),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setDisableCustomPlaybackForIOS10Plus(!0),this.adsLoader.getSettings().setLocale(this.options.locale),this.adsLoader.getSettings().setVpaidMode(this._getVPAIDMode()),this.adsLoader.getSettings().setAutoPlayAdBreaks(!0);var e=this.adsLoader.getSettings().getNumRedirects();this.adsLoader.getSettings().setNumRedirects(2*e),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1,this),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError,!1,this)}},{key:"_onAdsManagerLoaded",value:function(e){var t=this,n=new google.ima.AdsRenderingSettings;n.autoAlign=!1,n.enablePreloading=!1,n.restoreCustomPlaybackStateOnAdBreakComplete=!0,n.useStyledNonLinearAds=!0,n.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(this.video_ad_player,n),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError.bind(this),!1,this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_METADATA,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CLICK,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.DURATION_CHANGE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.FIRST_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.IMPRESSION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.INTERACTION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LINEAR_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.MIDPOINT,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.THIRD_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.USER_CLOSE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_MUTED,this._onAdEvent.bind(this),this),window.addEventListener("resize",function(){r(this,t),this.adsManager&&this.adsManager.resize(this.options.width,this.options.height,google.ima.ViewMode.NORMAL)}.bind(this)),this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0);var o=new Date,a=o.getHours(),i=o.getDate(),s=o.getMonth(),u=o.getFullYear(),c="AD_SDK_MANAGER_READY";this.eventBus.broadcast(c,{name:c,message:"AD SDK is ready",status:"success",analytics:{category:c,action:this.parentDomain,label:"h".concat(a," d").concat(i," m").concat(s," y").concat(u)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var t,r,n,o=new Date,a=o.getHours(),i=o.getDate(),s=o.getMonth(),u=o.getFullYear(),c=(r=google.ima.AdEvent.Type,n=e.type,Object.keys(r).find((function(e){return r[e]===n}))),l=!1,d=(null==e||null===(t=e.getAd())||void 0===t?void 0:t.getContentType())||"",f=!d.startsWith("image")&&!d.startsWith("text");this._sendIMAEventsToHB(e);var p="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:p="Fired when an ad rule or a VMAP ad break would have played if autoPlayAdBreaks is false.";break;case google.ima.AdEvent.Type.AD_METADATA:p="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:l=!0,p="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:p="Fired when the ad is clicked.";var h=e.getAd().getContentType();this._show({mode:"click",contentType:h});break;case google.ima.AdEvent.Type.COMPLETE:l=this._is_completed(e.getAd()),p="Fired when the ad completes playing.",this.adType_===Te.Rewarded&&this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:p="Fired when content should be paused. This usually happens right before an ad is about to cover the content.";break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:p="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",l=!0,this._hideAddResume();break;case google.ima.AdEvent.Type.DURATION_CHANGE:p="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:p="Fired when the ad playhead crosses first quartile.";var v=e.getAd().getContentType();this._show({mode:"first_quartile",contentType:v});break;case google.ima.AdEvent.Type.IMPRESSION:p="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:p="Fired when an ad triggers the interaction callback. Ad interactions contain an interaction ID string in the ad data.";break;case google.ima.AdEvent.Type.LINEAR_CHANGED:p="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var m=e.getAd().getContentType();p=m,this._show({mode:"loaded",contentType:m});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(p=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:p="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:f&&this.adResume.show(),p="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:p="Fired when the ad is resumed.",f&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:p="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:l=this._is_completed(e.getAd()),p="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:this._hideAddResume(),p="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:p="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:l=this._is_completed(e.getAd()),p="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:p="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:p="Fired when the ad volume has been muted."}""!==c&&""!==p&&this.eventBus.broadcast(c,{name:c,message:p,status:"success",analytics:{category:c,action:this.parentDomain,label:"h".concat(a," d").concat(i," m").concat(s," y").concat(u)}}),l&&!this.adSuccess&&(this.adSuccess=!0,this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.resetForNext(e))}},{key:"_onAdError",value:function(e){this.requestRunning=!1,this._resetAdsLoader(),this._clearSafetyTimer("ERROR"),this._hide("_onAdError"),this._sendIMAEventsToHB(e);try{var t="AD_ERROR",r=e.getError(),n=r.getErrorCode().toString()||r.getVastErrorCode().toString(),o=this._getInnerErrorCode(r);vk.emit("AD_ERROR",n),this.eventBus.broadcast(t,{message:n,details:o,status:"warning",analytics:{category:t,action:o,label:n}}),this._hideAddResume()}catch(e){}}},{key:"_hideAddResume",value:function(){try{this.adResume&&this.adResume.hide()}catch(e){console.log("Error on hide adResume",e)}}},{key:"_sendIMAEventsToHB",value:function(e){if(window.idhb&&"function"==typeof window.idhb.onImaEvent)try{window.idhb.onImaEvent({event:e})}catch(e){}}},{key:"_resetAdsLoader",value:function(){this.adsManager&&(this.adsManager.destroy(),this.adsManager=null,this._adrequest_user_context=null),this.adsLoader&&this.adsLoader.contentComplete()}},{key:"_startSafetyTimer",value:function(e,t){var n=this;this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=window.setTimeout(function(){r(this,n),this.cancel(),this._clearSafetyTimer(t)}.bind(this),e)}},{key:"_clearSafetyTimer",value:function(e){void 0!==this.safetyTimer&&null!==this.safetyTimer&&(clearTimeout(this.safetyTimer),this.safetyTimer=void 0)}},{key:"_getVPAIDMode",value:function(){return google.ima.ImaSdkSettings.VpaidMode.ENABLED}},{key:"_getPrebidScripts",value:function(){var e=["https://hb.improvedigital.com/pbw/headerlift.min.js","http://hb.improvedigital.com/pbw/headerlift.min.js"];return this.options.hb_script?[this.options.hb_script].concat(e):e}},{key:"_getInnerErrorCode",value:function(e){if($(e.getInnerError)){var t=e.getInnerError();if(t)return $(t.getErrorCode)&&$(t.getVastErrorCode)?t.getErrorCode().toString()||t.getVastErrorCode().toString():t.message}}},{key:"resetForNext",value:function(){this.requestRunning=!1,this._hide("resetForNext")}},{key:"_createCustomAdVastUrl",value:function(e,t){var n=this;if(e){var o=this.macros.transform(e,{get:function(e){if(r(this,n),t&&t.tnl_keys)return t.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in o.query||{}){var i=o.query[a];I(i)&&(o.query[a]=c.stringify(i))}var s=new k(o.url,!0);return Kx(s.query,o.query||{}),hk({url:s.toString()},t)}}},{key:"_transformVast",value:function(e,t){var r={url:e.url};try{var n=new k(e.url,!0),o=this._transformQuery(e,t,n);o&&(r.url=n.toString());var a=o?n:new k(e.url,!0);if(a.query.cust_params){var i=c.parse(a.query.cust_params);r.bidder=i.hb_bidder,r.cust_params=i}r.url_parsed=a}catch(e){r.hasError=!0,r.message=e.message,r.bidder="error",console.log(e.message)}return r}},{key:"_transformQuery",value:function(e,t,n){var o=this;if(e&&t&&e.tnl_keys){var a=this.options.vast_query;if(t.retry_on_success&&this.options.retry_on_success&&I(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:t.retry_on_failure&&this.options.retry_on_failure&&I(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),I(a=O(a))){var i=n.query;if(a.$$remove){for(var s in i){new RegExp(a.$$remove,"i").test(s)&&delete i[s]}delete a.$$remove}var u=c.parse(i.cust_params);if(a.cust_params&&a.cust_params.$$remove){for(var l in u){new RegExp(a.cust_params.$$remove,"i").test(l)&&delete u[l]}delete a.cust_params.$$remove}var d=this.macros.transform(a,{get:function(t){return r(this,o),e.tnl_keys[t.toLowerCase()]}.bind(this)});return i.cust_params=u,Kx(i,d),i.cust_params=c.stringify(i.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,r,n,o,a=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(this.clickCount[a]>=(null===(r=e.t4r[a])||void 0===r?void 0:r.count))return!1;if(null!=e&&null!==(n=e.contentType)&&void 0!==n&&n.startsWith("image/")||"text"===(null==e?void 0:e.contentType))return a&&(null===(o=e.t4r[a])||void 0===o?void 0:o.enabled);if(null!=e&&e.contentType.startsWith("video/")){var i,s=(null===(i=e.t4r[a])||void 0===i?void 0:i.viper)||0;if(s>0){var u,c=Math.random()<s;return a&&c&&(null===(u=e.t4r[a])||void 0===u?void 0:u.enabled)}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,r,n,o,a,i,s,u,c,l,d,f,p,h,v;if(!e)return!1;var m="preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(r=t.pAds)||void 0===r?void 0:r.vmap)||!0===(null===(n=this.gameData)||void 0===n||null===(o=n.pAds)||void 0===o||null===(a=o.vmap)||void 0===a?void 0:a.enabled))||"midroll"===e&&(!0===(null===(i=this.gameData)||void 0===i||null===(s=i.mAds)||void 0===s?void 0:s.vmap)||!0===(null===(u=this.gameData)||void 0===u||null===(c=u.mAds)||void 0===c||null===(l=c.vmap)||void 0===l?void 0:l.enabled))||"rewarded"===e&&(!0===(null===(d=this.gameData)||void 0===d||null===(f=d.rAds)||void 0===f?void 0:f.vmap)||!0===(null===(p=this.gameData)||void 0===p||null===(h=p.rAds)||void 0===h||null===(v=h.vmap)||void 0===v?void 0:v.enabled));if(!m)return!1;var g=this._get_vmap_config(e),b=this.adCounter[e];return void 0!==(null==g?void 0:g.start)?b>=(null==g?void 0:g.start):m}},{key:"_getT4ROptions",value:function(e){var t,r=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;switch(r){case"preroll":case"midroll":case"rewarded":return e.t4r[r]}}},{key:"_is_completed",value:function(e){var t=e.getContentType(),r=e.getAdPodInfo();return!(!t.startsWith("image/")&&"text"!==t&&1!==r.getTotalAds())}},{key:"_get_vmap_context",value:function(e){var t=e.adtag,r=e.position,n=e.config,o=e.dp,a=this._createCustomAdVastUrl(null==n?void 0:n.vast_1)||t,i=this._createCustomAdVastUrl(null==n?void 0:n.vast_2)||t,s=null!=n&&n.vast_1?void 0:o,u=null!=n&&n.vast_2?void 0:o;return{adtag_url_1:null==a?void 0:a.url,adtag_url_2:null==i?void 0:i.url,position:r,dp_1:s,dp_2:u}}},{key:"_get_vmap_config",value:function(e){var t,r,n,o,a,i,s,u;switch(e){case"preroll":return null===(t=this.gameData)||void 0===t||null===(r=t.pAds)||void 0===r?void 0:r.vmap;case"midroll":return null===(n=this.gameData)||void 0===n||null===(o=n.mAds)||void 0===o?void 0:o.vmap;case"rewarded":return null===(a=this.gameData)||void 0===a||null===(i=a.rAds)||void 0===i?void 0:i.vmap;default:return null===(s=this.gameData)||void 0===s||null===(u=s.pAds)||void 0===u?void 0:u.vmap}}},{key:"_isDP",value:function(e){var t,r,n;return!!e&&!0===(null===(t=this.gameData)||void 0===t||null===(r=t.dp)||void 0===r||null===(n=r[e])||void 0===n?void 0:n.enabled)}},{key:"_create_dp_display_context",value:function(){var e=this;return new Promise(function(t){var n=this;r(this,e);try{var o={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new $x(this.gameData).checkCustomParams();a&&(o.cp=a);var i=encodeURIComponent(Fh(JSON.stringify(o)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(i)).then(function(e){return r(this,n),e.json()}.bind(this)).then(function(e){if(r(this,n),!e||!e.p)return this.msgrt.send("dp.na",{message:"atom"}),t();this.msgrt.send("dp.fp",{message:e.p/100}),t({params:{fp:e.p/100},error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(i),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(i)})}.bind(this)).catch(function(e){r(this,n),this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),t()}.bind(this))}catch(e){this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),t()}}.bind(this))}},{key:"_create_promo_context",value:function(e){var t,n=this,o={id:this.topDomain||this.parentDomain,au:e||"unknown",ty:"video",aid:this.gameData.gameId,pgu:this.parentURL},a=Object.keys(o).map(function(e){return r(this,n),"".concat(e,"=").concat(encodeURIComponent(o[e]))}.bind(this)).join("&");encodeURIComponent(Fh(JSON.stringify(o)));var i=null===(t=this.gameData.promo)||void 0===t?void 0:t.rainbow,s=null==i?void 0:i.enabled,u="https://tag.atom.gamedistribution.com/v1/rainbow/?".concat(a),c=s?u:void 0;return function(){r(this,n)}.bind(this),{promo_url:c,promo_imp_blue_url:s?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:s?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0}}},{key:"_create_dp_context",value:function(e,n){var o=this;return new Promise(function(){var a=t(u.mark((function t(a){var i,s,c,l,d,f,p=this;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,o._isDP(e)){t.next=5;break}return o.msgrt.send("dp.na",{message:"rule"}),t.abrupt("return",a());case 5:s={id:o.topDomain||o.parentDomain,au:e||"unknown",ty:"video",aid:o.gameData.gameId,pgu:o.parentURL},(c=new $x(o.gameData).checkCustomParams())&&(s.cp=c),l=encodeURIComponent(Fh(JSON.stringify(s))),d=null===(i=o.gameData.promo)||void 0===i?void 0:i.rainbow,f=(null==d?void 0:d.enabled)&&!0!==(null==n?void 0:n.fallback_adsense),fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(l)).then(function(e){return r(this,p),e.json()}.bind(this)).then(function(e){if(r(this,p),!e||!e.p)return o.msgrt.send("dp.na",{message:"atom"}),a();var t=e.p/100;a({id:Date.now(),floor_price:t,error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(l,"&ec=[ERRORCODE]"),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(l),skip_url:"https://tag.atom.gamedistribution.com/v1/skp?ar=".concat(l),promo_url:f?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(l):void 0,promo_imp_blue_url:f?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:f?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){r(this,p),o.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),a()}.bind(this)),t.next=18;break;case 14:t.prev=14,t.t0=t.catch(0),o.msgrt.send("dp.err",{message:(null===t.t0||void 0===t.t0?void 0:t.t0.message)||t.t0}),a();case 18:case"end":return t.stop()}}),t,this,[[0,14]])})));return function(e){return a.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t){if(e&&t)try{var r,n=new k(t.vastUrl,!0);if(null===(r=n.query)||void 0===r||!r.cust_params)return;var o=c.parse(n.query.cust_params);if(!o.tnl_asset_id)return;o.adsense=1,n.query.cust_params=c.stringify(o,!1),e.fallback_url=n.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(d=t(u.mark((function e(t){var n,o,a,i,s,c=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getPrebidScripts(),o=n[0],window.idhb=window.idhb||{},window.idhb.options=window.idhb.options||{},Object.assign(window.idhb.options,{assetId:this.gameData.gameId,configUrl:this.topDomain||this.parentDomain,parentUrl:this.parentURL,pageType:"gd"}),window.idhb.que=window.idhb.que||[],e.next=8,$e(o,"gdsdk_prebid",{alternates:n,error_prefix:"Blocked:",exists:function(){return r(this,c),window.idhb.requestAds}.bind(this)});case 8:a=Ce("ch",window.location.href),i=Ce("ch_date",window.location.href),s={tnl_content_category:this.category.toLowerCase()},a&&(s.channel=a),i&&(s.ch_date=i),window.idhb.setAdserverTargeting(s),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var t=this;r(this,c);try{var n,o=e.slotId.split("@");o=1===o.length?o[0]:o[1],e.isEmpty?(null!==(n=this.atom_display)&&void 0!==n&&n.error_url&&(fetch(this.atom_display.error_url).catch(function(e){r(this,t)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_ERROR",{message:o,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){r(this,t)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:o,status:"success"}))}catch(e){}}.bind(this));case 16:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"_init_ima_script",value:(l=t(u.mark((function e(t){var n,o,a=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=["https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","https://imasdk.googleapis.com/js/sdkloader/ima3.js","http://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","http://imasdk.googleapis.com/js/sdkloader/ima3.js"],o=this.options.debug?n[0]:n[1],e.next=4,$e(o,"gdsdk_ima",{alternates:n,error_prefix:"Blocked:",exists:function(){return r(this,a),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"_init_afg_script",value:(s=t(u.mark((function e(t){var n,o,a,i,s=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.gameData.afg_disabled){e.next=3;break}return e.abrupt("return");case 3:return(i={}).crossorigin="anonymous",i["data-ad-client"]=(null==t||null===(n=t.adsense_client)||void 0===n?void 0:n.length)>0?t.adsense_client:"ca-pub-2316275586951220",i["data-ad-frequency-hint"]="30s",i.allow="autoplay",(null==t||null===(o=t.adsense_channel)||void 0===o?void 0:o.length)>0&&(i["data-ad-channel"]=t.adsense_channel),(null==t||null===(a=t.adsense_host)||void 0===a?void 0:a.length)>0&&(i["data-ad-host"]=t.adsense_host),!0===(null==t?void 0:t.adsense_adbreak_test)&&(i["data-adbreak-test"]="on"),e.next=14,$e("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return r(this,s),!!window.adsbygoogle}.bind(this),attrs:i});case 14:window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({sound:"on",preloadAdBreaks:"on"});case 16:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"clearSession",value:function(){this.requestRunning=!1}},{key:"_startAdsensePlacementRewardedAd",value:(i=t(u.mark((function e(t){var n,o,a,i,s,c,l=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){r(this,l)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),n=function(){r(this,l),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),o=function(){r(this,l),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(){r(this,l),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),i=function(){r(this,l),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"}),this._send_atom_event("sg.ad.rw.viewed")}.bind(this),s=function(e){r(this,l),e()}.bind(this),c=function(e){r(this,l),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===e.breakStatus?this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error",skipForward:!0}),"dismissed"!==e.breakStatus&&this._send_atom_event("sg.dbg.rw",e))}.bind(this),t={type:"reward",name:"reward-in-game",beforeAd:n,afterAd:o,adDismissed:a,adViewed:i,beforeReward:s,adBreakDone:c},window.adsbygoogle.push(t),e.next=24;break;case 20:throw e.prev=20,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 24:case"end":return e.stop()}var t}),e,this,[[1,20]])}))),function(e){return i.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(a=t(u.mark((function e(t){var n,o=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){r(this,o)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),n=function(e){r(this,o),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"}),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),t={type:"preroll",adBreakDone:n},window.adsbygoogle.push(t),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}var t}),e,this,[[1,15]])}))),function(e){return a.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(o=t(u.mark((function e(t){var n,o,a,i=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){r(this,i)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),n=function(){r(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),o=function(){r(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){r(this,i),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),t={type:"start",name:"start-in-game",beforeAd:n,afterAd:o,adBreakDone:a},window.adsbygoogle.push(t),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var t}),e,this,[[1,17]])}))),function(e){return o.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(n=t(u.mark((function e(t){var n,o,a,i=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){r(this,i)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),n=function(){r(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),o=function(){r(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){r(this,i),this.resetForNext(),this.adCounter.midroll=this.adCounter.midroll||0,this.adCounter.midroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.mr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",e))}.bind(this),t={type:"next",name:"next-in-game",beforeAd:n,afterAd:o,adBreakDone:a},window.adsbygoogle.push(t),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var t}),e,this,[[1,17]])}))),function(e){return n.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var r=this.msgrt,n=r._layout,o=r._ua,a={tp:e,ct:0,vrs:this.PackageJSON.version,url:this.parentURL,rfr:document.referrer,tdmn:this.topDomain||this.parentDomain,dpth:0,args:t,ua:{brnm:o.browser.name,brvs:o.browser.version,osnm:o.os.name,osvs:o.os.version,dvmd:o.device.model,w:n.w,h:n.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(Fh(JSON.stringify(a)))))}catch(e){}}},{key:"_send_atom_event",value:function(e,t){this._send(e,{gid:this.gameData.slug,md5:this.gameData.gameId,pid:0,pnm:this.gameData.pname,ctry:this.gameData.ctry,lcl:"en",hle:1,ads:1,args:t,href:window.location.href})}},{key:"_isAfgPositionNext",value:function(e){return void 0!==e.adTimestamp}},{key:"_isAfgPositionStart",value:function(e){if(void 0!==e.adTimestamp)return!1;return this.adCounter.preroll=this.adCounter.preroll||0,0===this.adCounter.preroll}},{key:"attachAfgPosition",value:function(e){var t=e.params.position;switch(t){case"preroll":case"start":case"pause":case"next":case"browse":case"reward":return}var r=e.adType;if(r===Te.Rewarded)t="reward";else if(r===Te.Interstitial){var n,o;if(this._isAfgPositionStart(e))t=null===(n=this.gameData.pAds)||void 0===n||!n.enabled||null!==(o=this.gameData.loader)&&void 0!==o&&o.enabled?"start":"next";else this._isAfgPositionNext(e)&&(t="next")}e.params.position=t}}]),e}(),bk=function e(r){var n=this;E(this,e),oa(this,"load",t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ap(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),oa(this,"promo",t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.module){e.next=3;break}return e.next=3,n.load();case 3:return e.abrupt("return",n.module[n.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var o=r.package||"gd-sdk-stone-dynamic",a=r.package_version||"1.1.1",i=r.template||"puzzle",s=r.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(o,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},np(this.moduleName,this.moduleConfig)},yk=function e(r){var n=this;E(this,e),oa(this,"load",t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ap(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),oa(this,"splash",t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.module){e.next=3;break}return e.next=3,n.load();case 3:return e.abrupt("return",n.module[n.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var o=r.package||"gd-sdk-air-dynamic",a=r.package_version||"1.2.0",i=r.template||"pluto",s=r.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(o,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},np(this.moduleName,this.moduleConfig)},_k=function(e,t){console.log(e,t)},wk={},Ak={},xk=null;function kk(){for(var e,t=window,r=null,n=null;!e;){try{if("function"==typeof t.__tcfapi||"function"==typeof t.__cmp){"function"==typeof t.__tcfapi?(n=2,r=t.__tcfapi):(n=1,r=t.__cmp),e=t;break}}catch(e){}try{if(t.frames.__tcfapiLocator){n=2,e=t;break}}catch(e){}try{if(t.frames.__cmpLocator){n=1,e=t;break}}catch(e){}if(t===window.top)break;t=t.parent}return wk.version=n,wk.frame=e,wk.function=r,wk.version}function Ek(e){var t=this;return xk||(xk=new Promise(function(n){function o(t,r){if(_k("Received a response from CMP",t),r){var o,a;if(!1!==t.gdprApplies)return"tcloaded"===t.eventStatus||"useractioncomplete"===t.eventStatus?(("boolean"!=typeof(a=(o=t)&&"boolean"==typeof o.gdprApplies?o.gdprApplies:e.defaultGdprScope)||!0===a&&"string"!=typeof o.tcString)&&n({result:"cmpUnexpectedResponse",cmp:wk,consentData:o}),void n({result:"ok",consentData:t})):void 0;n({result:"ok",consentData:t})}else n({result:"cmpCallFailed"})}r(this,t),kk(),wk.frame?2===wk.version?(_k("TCF v2 CMP found. Fetching the consent."),wk.function?(_k("CMP API is directly accessible, calling it now..."),wk.function("addEventListener",wk.version,o)):(_k("CMP API is outside the current iframe, calling it now..."),function(e,t,n){var o=this,a="__tcfapi";function i(e){var t="".concat(a,"Return"),r="string"==typeof e.data&&e.data.indexOf(t)>=0?JSON.parse(e.data):e.data;if(r[t]&&r[t].callId){var n=r[t];void 0!==Ak[n.callId]&&Ak[n.callId](n.returnValue,n.success)}}window[a]=function(e,n,i,s){r(this,o);var u=Math.random()+"",c=oa({},"".concat(a,"Call"),{command:e,parameter:s,callId:u,version:n});Ak[u]=i,t.postMessage(c,"*")}.bind(this),window.addEventListener("message",i,!1),window[a](e,wk.version,n)}("addEventListener",wk.frame,o))):n({result:"cmpVersionNotV2",cmp:wk}):n({result:"cmpNotFound"})}.bind(this)))}var Sk=new(function(){function e(){E(this,e),this.productName="Game Distribution"}var r;return R(e,[{key:"checkIfExcluded",value:function(e){try{var t,r;return!(null===(t=e.diagnostic)||void 0===t||null===(r=t.gameDock)||void 0===r||!r.excluded)}catch(e){return console.log("Error on checkIfExclude check",e),!1}}},{key:"track",value:(r=t(u.mark((function e(t,r){var n,o,a,i,s,c;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.checkIfExcluded(r)){e.next=3;break}return e.abrupt("return");case 3:if(o=null==t||null===(n=t.visitor)||void 0===n?void 0:n.visitorId){e.next=6;break}return e.abrupt("return");case 6:return a=encodeURIComponent(this.productName),i=encodeURIComponent(o),e.prev=8,s="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(a,"/user_id/").concat(i),e.next=12,fetch(s,{method:"POST"});case 12:e.next=28;break;case 15:return e.prev=15,e.t0=e.catch(8),console.log("GAME_DOCK. fail v4",e.t0),e.prev=18,c="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(a,"/user_id/").concat(i),e.next=22,fetch(c,{method:"POST"});case 22:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(18),console.log("GAME_DOCK. fail v6",e.t1);case 28:case"end":return e.stop()}}),e,this,[[8,15],[18,25]])}))),function(e,t){return r.apply(this,arguments)})}]),e}());function Rk(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Dk(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dk(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}function Dk(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ok,Tk=function(e){var t=this,n=e.src,o=e.attributes,a=e.target,i=e.isAsync;return new Promise(function(e,s){var u=this;r(this,t);try{var c=document.createElement("script");if(c.async=null==i||i,c.type="text/javascript",c.onload=function(){r(this,u),e()}.bind(this),c.onerror=function(){r(this,u);var e="Error on script load, Error: ".concat(n);console.log(e),s(e)}.bind(this),c.src=n,o){var l,d=Rk(o);try{for(d.s();!(l=d.n()).done;){var f=l.value,p=f.key,h=f.value;c.setAttribute(p,h)}}catch(e){d.e(e)}finally{d.f()}}a||(a=document.head),a.appendChild(c)}catch(e){var v="Error on script load catch, Error: ".concat(n);console.log(v,e),s(v)}}.bind(this))},Ik="140feb72-7952-4420-8ae5-e8978d87bc17",Mk=function(){var e=t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Tk({src:"https://cdn.cookielaw.org/consent/tcf.stub.js",attributes:[{key:"id",value:"gd-cookie-pro-tcf-stub"},{key:"charset",value:"UTF-8"}],isAsync:!1});case 3:return e.next=5,Tk({src:"https://cookie-cdn.cookiepro.com/consent/".concat(Ik,"/OtAutoBlock.js"),attributes:[{key:"id",value:"gd-cookie-pro-autoblock"}],isAsync:!1});case 5:return e.next=7,Tk({src:"https://cookie-cdn.cookiepro.com/scripttemplates/otSDKStub.js",attributes:[{key:"id",value:"gd-cookie-pro-stub"},{key:"charset",value:"UTF-8"},{key:"data-domain-script",value:Ik}],isAsync:!1});case 7:r=void 0,n=void 0,o=void 0,r=(t={inlineScript:"function OptanonWrapper() { }"}).inlineScript,n=t.target,(o=document.createElement("script")).text=r,n||(n=document.head),n.appendChild(o),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("GD: CMP error on load",e.t0);case 13:case"end":return e.stop()}var t,r,n,o}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),Lk=new Jx.exports.EventEmitter,Ck={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};window.addEventListener("message",(function(e){var t=this,n=e.data,o=e.origin,a=n.type;if(Object.keys(Ck).some(function(e){return r(this,t),e===o}.bind(this))&&(null==n||!n.__tcfapiCall)&&(window.parent&&!n.type.startsWith("gd-sdk")&&window.parent.postMessage(n,"*"),a)){var i=Ck[o][a];i&&Lk.emit(i,n)}}),!1);var Pk=new Uint8Array(16);function jk(){if(!Ok&&!(Ok="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ok(Pk)}var Uk=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Bk(e){return"string"==typeof e&&Uk.test(e)}for(var $k=[],Nk=0;Nk<256;++Nk)$k.push((Nk+256).toString(16).substr(1));function Gk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Fk="__msgr",zk=function(e,t,r){var n=(e=e||{}).random||(e.rng||jk)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=n[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=($k[e[t+0]]+$k[e[t+1]]+$k[e[t+2]]+$k[e[t+3]]+"-"+$k[e[t+4]]+$k[e[t+5]]+"-"+$k[e[t+6]]+$k[e[t+7]]+"-"+$k[e[t+8]]+$k[e[t+9]]+"-"+$k[e[t+10]]+$k[e[t+11]]+$k[e[t+12]]+$k[e[t+13]]+$k[e[t+14]]+$k[e[t+15]]).toLowerCase();if(!Bk(r))throw TypeError("Stringified UUID is invalid");return r}(n)}(),Zk=function(e){var t=this;if(!window.__msgr){var n=document.createElement("iframe");if(n.src="https://static.gamedistribution.com/message/index.html",n.style.display="none",n.name=Fk,document.body.appendChild(n),window!==window.top){var o={gameId:e.gameId,target:e.evnts.domain,token:zk,event_name:"TokenGenerated",timestamp:Date.now()};n.onload=function(){Kk(o)},setInterval(function(){r(this,t),o.timestamp=Date.now(),o.event_name="Heartbeat",Kk(o)}.bind(this),1e3*e.evnts.heartbeatDuration)}}window.addEventListener("message",function(e){r(this,t);try{var n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gk(Object(r),!0).forEach((function(t){oa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gk(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e.data);if(!n.event_name)return;n.token=zk,Kk(n)}catch(e){console.error("GD Messager Error",e.message)}}.bind(this),!1)},Hk=function(e){try{var t={gameId:e.game.gameId,target:e.game.evnts.domain,event_name:e.event,timestamp:Date.now()},r=qk(window);r!==window.top&&(null==r||r.postMessage(t,"https://html5.gamedistribution.com"))}catch(e){}},qk=function e(t){try{var r,n,o=null==t?void 0:t.parent;if("game"===(null===(r=o.document)||void 0===r||null===(n=r.activeElement)||void 0===n?void 0:n.id))return o;e(o)}catch(e){return t}},Kk=function(e){window.__msgr.postMessage(e,"https://static.gamedistribution.com")};function Wk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vk(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wk(Object(r),!0).forEach((function(t){oa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wk(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Yk,Qk=null,Jk=null,Xk=function(){function e(t){var n=this;if(E(this,e),Qk)return Qk;Qk=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,t),this._version=t.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new tA,this._location.print(),this._parentURL=0===this._bridge.depth?encodeURIComponent(this._bridge.parentURL):this._bridge.parentURL,this._parentDomain=this._bridge.parentDomain,this._topDomain=this._bridge.topDomain,this._isFullScreen=!1,this._giftCount=0,this._setConsoleBanner(),this._initializeMessageRouter(),this._checkConsole(),this._subscribeToEvents(),this.sdkReady=new Promise(this._initializeSDKWithGameData.bind(this)),this.sdkReady.then(function(e){r(this,n),this._sdk_ready=!0}.bind(this)).catch(function(e){r(this,n),this._sdk_ready=!1}.bind(this)).finally(function(){var e,t;r(this,n),!0===(null===(e=this._gameData.lp)||void 0===e?void 0:e.load)&&this._sendLoadedEvent(1),this._sendLoaderDataEvent(),this._checkSplashAndPromoScreens(),this._initBlockingExternals(),this._initUnityHandler(),this._checkFullscreen(),null!==(t=this._gameData.evnts)&&void 0!==t&&t.enabled&&this._isLoaderGameURL()&&Zk(this._gameData)}.bind(this)),this._registerSGBridge()}var n,o,a,i,s,l,d,f,p,h,v,m;return R(e,[{key:"_initUnityHandler",value:function(){var e=this;window.addEventListener("DOMNodeInserted",function(){if(r(this,e),this._gameData.block_exts&&this._removeExternalsInHtml({enabled:!1}),document.getElementsByClassName("webgl-content")[0]){var t=document.getElementsByClassName("webgl-content")[0].getElementsByClassName("footer")[0];t&&t.setAttribute("style","display:none")}}.bind(this))}},{key:"_loadCMP",value:(m=t(u.mark((function e(){var t,r,n,o;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=6;break}if(n=new tA,0!==(null==(o=n.get("depth"))?void 0:o.value)||null===(t=this._gameData)||void 0===t||null===(r=t.cmp)||void 0===r||!r.enabled||"html5.gamedistribution.com"!==this._topDomain){e.next=6;break}return e.next=6,Mk();case 6:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"testConsent",value:function(){try{kk();t(u.mark((function e(){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ek({});case 2:e.sent;case 3:case"end":return e.stop()}}),e)})))()}catch(e){console.log("find CMP error",e)}}},{key:"_sendLoaderDataEvent",value:function(){try{this.options.onLoaderEvent&&this.options.onLoaderEvent({name:"LOADER_DATA",message:{game:this._gameData,bridge:this._bridge},status:this._sdk_ready?"success":"error"})}catch(e){}}},{key:"_registerSGBridge",value:function(){var e=this;Lk.on("splash-hidden",function(t){r(this,e),this._hideCMPButton()}.bind(this))}},{key:"_hideCMPButton",value:function(){var e=document.getElementById("ot-sdk-btn-floating");e&&(e.style.display="none")}},{key:"isLoaded",value:function(){if(void 0===this._isLoaded){var e=this._isTokenGameURL(),t=this._isExtHostedGameURL(),r=this._isMasterGameURL();this._isLoaded=(e||t&&!r)&&this._gameData.loader.enabled}return this._isLoaded}},{key:"setIsLoaded",value:function(e){this._isLoaded=e}},{key:"_sendLoadedEvent",value:function(){if(!this.isLoaded()){this.setIsLoaded(!0);try{this._sendTunnlEvent(1),this.msgrt.send("loaded",{message:this._hasBlocker?"Has Blocker":"No Blocker"})}catch(e){}}}},{key:"_sendGamedockGamePlay",value:function(){var e=this._isTokenGameURL();if(!(this._gameData.loader.enabled&&e||this._gameDockGamePlaySent))try{this._sendGamedockEvent("gameplay"),this._gameDockGamePlaySent=!0}catch(e){}}},{key:"_safeInit",value:function(){this._checkUserDeclinedTracking(),this._checkWhitelabelPartner();var e=this._gameData.diagnostic;void 0!==e&&void 0!==e.close_ga&&!1!==e.close_ga||!this._bridge.isCoreSDKMode&&this._loadGoogleAnalytics(),void 0!==e&&void 0!==e.close_gamedock&&!1!==e.close_gamedock||!this._bridge.isCoreSDKMode&&!this._bridge.noGamedockSDK&&this._loadGamedockTracker(),void 0!==e&&void 0!==e.close_minijuegos&&!1!==e.close_minijuegos||!this._bridge.isCoreSDKMode&&!this._bridge.noMinijuegosSDK&&document.location.search.indexOf("mp_game_id")>=0&&this._loadMiniJuegosGratisTracker()}},{key:"_initializeSDKWithGameData",value:(v=t(u.mark((function e(t,n){var o,a=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getGameData();case 3:return this._gameData=e.sent,e.next=6,this._loadCMP();case 6:this._bridge.isCoreSDKMode=!(!0===this._gameData.enableAds||!0===(null===(o=this._gameData.enableAds)||void 0===o?void 0:o.enabled)),this._safeInit(),this._checkGameId(),this._checkGameDeleted(),this._checkBlocking(),this._changeMidrollInDebugMode(),void 0!==this._gameData.diagnostic&&void 0!==this._gameData.diagnostic.close_ads&&!1!==this._gameData.diagnostic.close_ads||(this.videoAdReady=this._initializeVideoAd().catch(function(e){return r(this,a),console.error(e.message||e)}.bind(this))),t(this._gameData),e.next=21;break;case 16:e.prev=16,e.t0=e.catch(0),this._sendSDKError(e.t0),this.onResumeGame(e.t0.message,"warning"),n(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e,t){return v.apply(this,arguments)})},{key:"_getDefaultOptions",value:function(){return{debug:!1,testing:!1,gameId:"4f3d7d38d24b740c95da2b03dc3a2333",prefix:"gdsdk__",onEvent:function(e){},onLoaderEvent:function(e){},flashSettings:{adContainerId:"",splashContainerId:""},advertisementSettings:{},resumeGame:function(){},pauseGame:function(){},onInit:function(e){},onError:function(e){},loader:{}}}},{key:"_extendDefaultOptions",value:function(e,t){var r=O(e);this.options=t?Ie(r,t):r,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=iA.version,t=console.log("%c %c %c GameDistribution.com HTML5 SDK | Version: "+e+" %c %c %c","background: #9854d8","background: #6c2ca7","color: #fff; background: #450f78;","background: #6c2ca7","background: #9854d8","background: #ffffff");console.log.apply(console,t)}}},{key:"_sendTunnlEvent",value:function(e){var t=this;void 0===this._topDomain&&(this._topDomain=void 0);var n={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(c.stringify(n))).catch(function(e){r(this,t)}.bind(this))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=Pe();e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,Ye("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!He)return;"developer.gamedistribution.com"===this._parentDomain?(Ke("gd_debug_ex",!0),Ke("gd_disable_midroll_timer",!0),Ke("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(Ke("gd_debug_ex",!0),Ke("gd_disable_midroll_timer",!0)),Ze("gd_debug_ex")&&(this.openConsole(),this.msgrt.send("dev.console",{message:this._parentDomain}))}catch(e){}}},{key:"_checkUserDeclinedTracking",value:function(){this._userDeclinedTracking=this._bridge.isCoreSDKMode||document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0}},{key:"_initializeMessageRouter",value:function(){this.msgrt=new at({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:Ne(),version:iA.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:Be(),byloader:this._bridge.isTokenGameURL,isTokenGameURL:this._bridge.isTokenGameURL,isMasterGameURL:this._bridge.isMasterGameURL,isExtHostedGameURL:this._bridge.isExtHostedGameURL,byloaderVersion:this._bridge.version})}},{key:"_loadGamedockTracker",value:function(){var e=this;try{var t=["https://cdn.gamedock.io/gamedock-web-tracker/4.4.0/script/gamedock-sdk.min.js"];$e(t[0],"GamedockSDK",{alternates:t}).then(function(){var t,n;r(this,e),Jk=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(t=this._gameData.diagnostic)&&void 0!==t&&null!==(n=t.gameDock)&&void 0!==n&&n.adViewEvent&&Jk.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),Sk.track(Jk,this._gameData)}.bind(this)).catch(function(t){r(this,e),this._sendSDKError(t)}.bind(this))}catch(e){}}},{key:"_initGamedockTracker",value:function(e){if(!this._bridge.isCoreSDKMode)return e.initialize("gd",this._parentDomain)}},{key:"_sendGamedockEvent",value:function(e){var t,r;null===(t=Jk)||void 0===t||null===(r=t.tracking)||void 0===r||r.trackEvent(e,{pageId:this.options.gameId,pageType:"game"})}},{key:"_loadMiniJuegosGratisTracker",value:function(){var e=this;window.mpConfig={game:this.options.gameId,partner:"game-distribution"};var t=["https://ext.minijuegosgratis.com/external-host/main.js"];$e(t[0],"MinijuegosSDK",{alternates:t}).catch(function(t){r(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,t=["https://www.google-analytics.com/analytics.js"];$e(t[0],"gdsdk_google_analytics",{alternates:t,error_prefix:"Blocked:",exists:function(){return r(this,e),window.ga}.bind(this)}).then(function(){r(this,e),window.ga("create","UA-60359297-49",{name:"gd",cookieExpires:7776e3,sampleRate:5},"auto"),this._bridge.noGAPageView||window.ga("gd.send","pageview"),this._userDeclinedTracking||window.ga("gd.set","anonymizeIp",!0)}.bind(this)).catch(function(t){r(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new nt,Qe.forEach(function(t){var n=this;return r(this,e),this.eventBus.subscribe(t,function(e){return r(this,n),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),Je.forEach(function(t){var n=this;return r(this,e),this.eventBus.subscribe(t,function(e){return r(this,n),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(r(this,e),"developer.gamedistribution.com"===this._parentDomain||!0===new RegExp("^localhost").test(this._parentDomain)){fetch("https://game.api.gamedistribution.com/game/v2/hasapi/".concat(this.options.gameId,"?timestamp=").concat((new Date).valueOf()));try{var t=JSON.stringify({type:"GD_SDK_IMPLEMENTED",gameID:this.options.gameId});window.location!==window.top.location?window.top.postMessage(t,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(t,"*")}catch(e){}}}.bind(this),"ima"),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){return r(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(t){var n,o;r(this,e),this.msgrt.send("ad.impression"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(o=n.gameDock)&&void 0!==o&&o.adViewEvent&&Sk.track(Jk,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(t){r(this,e),this.msgrt.send("ad.error",{message:t.message,details:t.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(t){r(this,e),this._sendAdRequestContext(t.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(t){r(this,e),t.message.startsWith("Blocked:")?this._bridge.noBlockerEvent||(this.msgrt.send("error",{message:t.message}),this._hasBlocker||(this._hasBlocker=!0,this._sendTunnlEvent(3))):this.msgrt.send("error",{message:t.message})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_EMPTY",function(t){r(this,e),this.msgrt.send("tunnl.keys.empty",{message:t.message,details:t.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_FALLBACK",function(t){r(this,e),this.msgrt.send("tunnl.keys.fallback",{message:t.message,details:t.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_T4R",function(t){return r(this,e),this.msgrt.send("adt4r")}.bind(this),"sdk")}},{key:"_checkGameId",value:function(){this.options.gameId===this._defaults.gameId&&this._sendSDKError("Check correctness of your GAME ID. Otherwise, no revenue will be recorded.")}},{key:"_getDefaultGameData",value:function(){return{gameId:this.options.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}},{key:"_getGameDataUrl",value:function(){var e=void 0!==this._topDomain&&"undefined"!==this._topDomain?this._topDomain:this._parentDomain;return"https://game.api.gamedistribution.com/game/v4/get/".concat(this.options.gameId.replace(/-/g,""),"/?domain=").concat(e,"&v=").concat(iA.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(h=t(u.mark((function e(){var t,n,o=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this._gameData,t=void 0===this._gameData.dmain||this._gameData.dmain,(n.bloc_gard&&!0===n.bloc_gard.enabled||!t)&&(this.msgrt.send("blocked"),setTimeout(function(){r(this,o),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(c.stringify({domain:this._parentDomain,id:n.gameId,img:this._get_game_thumbnail_url(),title:n.title}))}.bind(this),100));case 5:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"_checkGameDeleted",value:function(){var e=this;6===this._gameData.status&&(console.log("%c %c %c This game was deleted, please remove it in your website... ","background: #F2181A","background: #F23818","color: #fff; background: #F23818;","background: #F55E60","background: #F55E60","background: #c4161e; color: #fff;"),setTimeout(function(){r(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;He&&Ze("gd_debug_ex")&&(Ze("gd_disable_midroll_timer")?e.midroll=0:e.midroll=this._getDefaultGameData().midroll)}},{key:"_checkSplashAndPromoScreens",value:function(){var e,t,r;this._gameData.loader&&!1===this._gameData.loader.mobile&&this._getisMobile()&&(this._gameData.loader.enabled=!1);var n,o=this._gameData,a=o.gdpr&&!0===o.gdpr.consent,i=o.loader,s=null===(e=o.promo)||void 0===e?void 0:e[null===(t=o.promo)||void 0===t||null===(r=t.template)||void 0===r?void 0:r.preroll];(o.preroll||(this.adRequestTimer=Date.now()),this.options.loader.enabled)?null!=s&&s.enabled?this._createPromoBeforeSplash(o,a):i.enabled&&!0!==(null===(n=i.splash)||void 0===n?void 0:n.skip)?this._createSplash(o,a):this.onResumeGame("Skipped splash.","success"):i.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||a?null!=s&&s.enabled?this._createPromoBeforeSplash(o,a):!1!==i.enabled&&this._createSplash(o,a):null!=s&&s.enabled&&this._createPromo(o,a))}},{key:"_initializeVideoAd",value:(p=t(u.mark((function e(){var t;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._bridge.isCoreSDKMode){e.next=2;break}return e.abrupt("return");case 2:return(t=this._gameData).sdk.enabled&&(this.options.advertisementSettings=Ie(this.options.advertisementSettings,t.sdk)),this.macros=new ot({game:t,bridge:this._bridge}),this.adInstance=new gk(this.options.flashSettings.adContainerId,this.options.advertisementSettings,{parentURL:this._parentURL,parentDomain:this._parentDomain,topDomain:this._topDomain}),this.adInstance.gameId=t.gameId,this.adInstance.category=t.category,this.adInstance.tags=t.tags,this.adInstance.noPreroll=this._bridge.noPreroll,this.adInstance.macros=this.macros,this.adInstance.gameData=t,this.adInstance.msgrt=this.msgrt,this.adInstance.PackageJSON=iA,this.adInstance._send("gd.location",this._location.get()),e.next=17,this.adInstance.start();case 17:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"_sendSDKReady",value:function(){var e="Everything is ready.";this.eventBus.broadcast("SDK_READY",{message:e,status:"success"});try{this.options.onInit(e)}catch(e){Ye("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_sendSDKError",value:function(e){e=e.message?e:{message:e};this.eventBus.broadcast("SDK_ERROR",{message:e.message,status:"error"});try{this.options.onError(e)}catch(e){Ye("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){Ye(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status,skipForward:e.skipForward})}catch(e){Ye("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:(f=t(u.mark((function e(){var t;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fA();case 2:return t=e.sent,this._bridge.noPreroll=(!this._getisMobile()||!1!==t.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(t),r=t.diagnostic,Ve=r,e.abrupt("return",t);case 8:case"end":return e.stop()}var r}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"_createSplash",value:(d=t(u.mark((function e(t,n){var o,a,i,s,c=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(t);case 2:return o=e.sent,a=new o(Vk(Vk({},this.options),{},{isConsentDomain:n,version:iA.version}),t,this._parentDomain),e.next=6,mA();case 6:i=e.sent,s=i.enabled,a.on("playClick",function(){var e=this;if(r(this,c),n){var t=new Date;t.setDate(t.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(t.toUTCString(),"; path=/")}this._hideCMPButton(),s?window.gdsdk.showAd(Te.Interstitial,{position:"preroll"}).catch(function(t){r(this,e),a.hide()}.bind(this)):(function(){r(this,e)}.bind(this),this.showAd(Te.Interstitial,{position:"preroll"}).catch(function(t){r(this,e)}.bind(this)))}.bind(this)),this.onPauseGame("Pause the game and wait for a user gesture","success"),this.eventBus.subscribe("SDK_GAME_PAUSE",function(){r(this,c),a.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){r(this,c),a.hide()}.bind(this));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(l=t(u.mark((function e(t,n){var o,a,i,s,c=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(t);case 3:i=e.sent,(s=new i(Vk(Vk({},this.options),{},{isConsentDomain:n,version:iA.version,template:null===(o=t.promo)||void 0===o||null===(a=o.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){r(this,c),s.hide(),this._createSplash(t,n)}.bind(this)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),this._createSplash(t,n);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t){return l.apply(this,arguments)})},{key:"_createPromo",value:(s=t(u.mark((function e(t,n){var o,a,i,s,c=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(t);case 3:i=e.sent,(s=new i(Vk(Vk({},this.options),{},{isConsentDomain:n,version:iA.version,template:null===(o=t.promo)||void 0===o||null===(a=o.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){r(this,c),s.hide(),this.onResumeGame("Resumed after the promo","warning")}.bind(this)),this.onPauseGame("Pause the game for the promo","success"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),this.onResumeGame("Resumed after the promo","warning");case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(e,t){return s.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(Te.Interstitial).catch(function(){r(this,e)}.bind(this))}},{key:"showAd",value:(i=t(u.mark((function e(n){var o,a=this,i=arguments;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.length>1&&void 0!==i[1]?i[1]:{},e.abrupt("return",new Promise(function(){var e=t(u.mark((function e(t,i){var s,c,l,d,f,p,h,v,m,g,b,y,_,w,A=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p={adType:n,params:o,adTimestamp:a.adRequestTimer},e.next=4,a.sdkReady;case 4:return h=e.sent,e.next=7,a.videoAdReady;case 7:return null!==(s=a._gameData.lp)&&void 0!==s&&s.load||a._sendLoadedEvent(),a._sendGamedockGamePlay(),a._rejectAdIfGameBlocked({gameData:h,adRequest:p}),a._rejectAdIfAdDisabled({gameData:h,adRequest:p}),a._rejectAdIfUnsupportedType({adRequest:p}),a._rejectAdIfRewardedDisabled({gameData:h,adRequest:p}),(null===(c=h.gft)||void 0===c||!c.enabled||null!==(l=h.gft)&&void 0!==l&&l.enabled&&(null==h||null===(d=h.gft)||void 0===d||null===(f=d.durations[a._giftCount])||void 0===f?void 0:f.after)!==a.adInstance.adMidrollCount)&&a._rejectAdIfAdRateHits({gameData:h,adRequest:p}),a.adInstance.attachAfgPosition(p),a._attachAfgFallback({gameData:h,adRequest:p}),v="main.showad",m=function(e){var t,n,o;r(this,A),a.eventBus.unsubscribeScope(v),a.onResumeGame(e.message,"warning"),null!=h&&null!==(t=h.gft)&&void 0!==t&&t.enabled&&(null==h||null===(n=h.gft)||void 0===n||null===(o=n.durations[a._giftCount])||void 0===o?void 0:o.after)===a.adInstance.adMidrollCount&&a.decideToGiveAGift(),i(e.message)}.bind(this),g=function(e){var n,o,i;r(this,A),a.eventBus.unsubscribeScope(v),a.adRequestTimer=Date.now(),a.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),null!=h&&null!==(n=h.gft)&&void 0!==n&&n.enabled&&(null==h||null===(o=h.gft)||void 0===o||null===(i=o.durations[a._giftCount])||void 0===i?void 0:i.after)===a.adInstance.adMidrollCount&&a.decideToGiveAGift(),t(e.message)}.bind(this),b=function(e){var s=this;r(this,A),a.eventBus.unsubscribeScope(v),o.fallback_adsense=!1,a.showAd(n,Vk(Vk({},o),{},{adapter:"adsense"})).then(function(e){r(this,s),t(e)}.bind(this)).catch(function(e){r(this,s),i(e)}.bind(this))}.bind(this),y=function(e){var s=this;r(this,A),a.eventBus.unsubscribeScope(v),o.fallback_adsense=!1,a.showAd(n,Vk(Vk({},o),{},{adapter:"promo"})).then(function(e){r(this,s),t(e)}.bind(this)).catch(function(e){r(this,s),i(e)}.bind(this))}.bind(this),_=function(){var e,t,n;r(this,A);var a=!("promo"===(null==o?void 0:o.adapter)||("reward"!==(null==o?void 0:o.position)||h.afg_disabled)&&"adsense"!==(null==o?void 0:o.adapter)),i=null===(e=h.promo)||void 0===e||null===(t=e.rainbow)||void 0===t?void 0:t.enabled,s=null===(n=h.promo)||void 0===n?void 0:n.onadsense;return a&&i&&s?y:null!=o&&o.fallback_adsense?b:m}.bind(this),w=_(),a.eventBus.subscribe("AD_ERROR",function(e){r(this,A),w(e)}.bind(this),v),a.eventBus.subscribe("AD_SDK_CANCELED",w,v),a.eventBus.subscribe("AD_SUCCESS",g,v),e.next=28,a.adInstance.startAd(p);case 28:a._post_message({topic:"adrequest.instream"}),e.next=35;break;case 31:e.prev=31,e.t0=e.catch(0),a.onResumeGame(e.t0.message,"warning"),i(e.t0.message);case 35:case"end":return e.stop()}}),e,this,[[0,31]])})));return function(t,r){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"clearSession",value:function(){this.adInstance.clearSession()}},{key:"_attachAfgFallback",value:function(e){var t=e.gameData,r=e.adRequest;if(!t.afg_disabled&&!r.params.hasOwnProperty("fallback_adsense"))switch(r.params.position){case"preroll":case"start":case"next":r.params.fallback_adsense=!0}}},{key:"_rejectAdIfGameBlocked",value:function(e){var t=e.gameData;if(t.bloc_gard&&!0===t.bloc_gard.enabled)throw new Error("Game or domain is blocked.")}},{key:"_rejectAdIfAdDisabled",value:function(e){if(!e.gameData.enableAds||this._whitelabelPartner)throw new Error("Advertisements are disabled.")}},{key:"_rejectAdIfUnsupportedType",value:function(e){var t=e.adRequest;if(t.adType){if(t.adType!==Te.Interstitial&&t.adType!==Te.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=Te.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===Te.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"_rejectAdIfAdRateHits",value:function(e){var t,r,n,o,a,i,s=e.gameData,u=e.adRequest,c=null;u.adType===Te.Interstitial&&null!==(t=s.diagnostic)&&void 0!==t&&null!==(r=t.useMidrollIndex)&&void 0!==r&&r.enabled&&this.adInstance.noPreroll?this.adInstance.adMidrollCount>(null===(n=s.diagnostic)||void 0===n||null===(o=n.useMidrollIndex)||void 0===o?void 0:o.indexes.length)-1||(c=6e4*(null===(a=s.diagnostic)||void 0===a||null===(i=a.useMidrollIndex)||void 0===i?void 0:i.indexes[this.adInstance.adMidrollCount])):c=s.midroll;if(u.adType===Te.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<c)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(a=t(u.mark((function e(r){var n=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=t(u.mark((function e(t,o){var a,i;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return a=e.sent,e.next=6,n.videoAdReady;case 6:if(!a.bloc_gard||!0!==a.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(a.enableAds&&!n._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(r){e.next=14;break}r=Te.Rewarded,e.next=16;break;case 14:if(r===Te.Interstitial||r===Te.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+r);case 16:if(r!==Te.Rewarded||a.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,n.adInstance.preloadAd(r);case 20:i=e.sent,t(i),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),o(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(t,r){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{key:"cancelAd",value:(o=t(u.mark((function e(){var r=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=t(u.mark((function e(t,n){return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{r.adInstance.cancel(),r.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),n()}catch(e){r.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),t(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(){return o.apply(this,arguments)})},{key:"showDisplayAd",value:function(e){var r=this;return new Promise(function(){var n=t(u.mark((function t(n,o){var a;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r.sdkReady;case 3:return a=t.sent,t.next=6,r.videoAdReady;case 6:if(!a.dAds.enabled){t.next=13;break}return t.next=9,r.adInstance.loadDisplayAd(e);case 9:r._post_message({topic:"adrequest.display"}),n(),t.next=14;break;case 13:o("Display-Ads are disabled.");case 14:t.next=19;break;case 16:t.prev=16,t.t0=t.catch(0),o(t.t0.message||t.t0);case 19:case"end":return t.stop()}}),t,null,[[0,16]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){var r;this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){Ye("DEVELOPER_ERROR",e.message,"warning")}var n="SDK_GAME_START";this.eventBus.broadcast(n,{name:n,message:e,status:t,analytics:{category:"SDK",action:n,label:this.options.gameId+""}}),this.adInstance&&this.adInstance._hideAddResume(),null===(r=this._gameData.evnts)||void 0===r||!r.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||Hk({event:"GameStarted",game:this._gameData})}},{key:"onPauseGame",value:function(e,t){var r;this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){Ye("DEVELOPER_ERROR",e.message,"warning")}var n="SDK_GAME_PAUSE";this.eventBus.broadcast(n,{name:n,message:e,status:t,analytics:{category:"SDK",action:n,label:this.options.gameId+""}}),null===(r=this._gameData.evnts)||void 0===r||!r.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||Hk({event:"GamePaused",game:this._gameData})}},{key:"openConsole",value:function(){try{new st(this).start(),Ke("gd_debug_ex",!0)}catch(e){console.log(e)}}},{key:"_initBlockingExternals",value:function(){var e=this._gameData;(e.failed||e.block_exts&&e.block_exts.enabled)&&(this.window_open=window.open,this._allowExternals({enabled:!1}),this._removeExternalsInHtml({enabled:!1}))}},{key:"_checkFullscreen",value:function(){var e=this;try{var t=this._gameData;t.sdk.fullscreen&&"auto"===t.sdk.fullscreen&&document.addEventListener("click",function(){if(r(this,e),!this._isFullScreen){var t=document.body,n=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullscreen;if(n)n.call(t);else if(void 0!==window.ActiveXObject){var o=new ActiveXObject("WScript.Shell");null!==o&&o.SendKeys("{F11}")}this._isFullScreen=!0}}.bind(this))}catch(e){console.log("Fullscreen error handled...",e)}}},{key:"_allowExternals",value:function(e){var t=this;void 0!==this.window_open&&(!1===e.enabled?window.open=function(e){r(this,t),this.msgrt.send("external",{message:"C> ".concat(e)}),(e.startsWith("https://play.google.com")||e.startsWith("https://itunes.apple.com"))&&this.window_open.call(null,e)}.bind(this):window.open=this.window_open)}},{key:"_removeExternalsInHtml",value:function(e){var t=this;!1===e.enabled&&window.document.querySelectorAll("a").forEach(function(e){var n=this;r(this,t);var o=!!(e.innerText.toLowerCase().includes("start")||e.innerText.toLowerCase().includes("play")||e.innerText.toLowerCase().includes("continue")),a=e.getAttribute("href");e.removeAttribute("href"),o||(e.onclick=function(e){return r(this,n),e.preventDefault(),this.msgrt.send("external",{message:"H> ".concat(a)}),!1}.bind(this))}.bind(this))}},{key:"_getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),r=this._isExtHostedGameURL(),n=e||r?this._getTokenGameURLConfig():{};n=n||{};var o=decodeURIComponent((e||r)&&n.parentURL?n.parentURL:Le()),a=decodeURIComponent((e||r)&&n.parentDomain?n.parentDomain:Me()),i=decodeURIComponent((e||r)&&n.topDomain?n.topDomain:r&&0===Ne()?a:ze()),s=(e||r)&&n.loaderEnabled,u=(e||r)&&n.loaderEnabled,c=(e||r)&&n.loaderEnabled,l=(e||r)&&n.loaderEnabled,d=(e||r)&&n.loaderEnabled,f=(e||r)&&n.loaderEnabled,p=(e||r)&&n.loaderEnabled,h=(e||r)&&n.loaderEnabled,v=(e||r)&&n.loaderEnabled&&n.hasImpression&&n.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:r,noConsoleBanner:s,noLoadedEvent:u,noBlockerEvent:c,noPreroll:h,parentURL:o,parentDomain:a,topDomain:i&&i.length?i:a,noGAPageView:l,noLotamePageView:d,noGamedockSDK:f,noMinijuegosSDK:p,version:n.version,pauseGameOnStartup:v,depth:Ne(),domainMatched:a===i,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isLoaderGameURL",value:function(){return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)&&location.href.startsWith("https://html5.gamedistribution.com")}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var r=new k(location.href,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else if(t.test(document.referrer)){var n=new k(document.referrer,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else{var o=new k(location.href,!0);if(!o.query.gd_zone_config)return;e=o.query.gd_zone_config}return JSON.parse(zh(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new yk(t).splash()}},{key:"_createPrerollPromoTemplate",value:(n=t(u.mark((function e(t){var r,n,o,a,i;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=null===(r=t.promo)||void 0===r?void 0:r[null===(n=t.promo)||void 0===n||null===(o=n.template)||void 0===o?void 0:o.preroll],i=new bk(a),e.abrupt("return",i.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(Fh(JSON.stringify(e)))}catch(e){}try{var r=new k(location.href,!0);return r.query=r.query||{},r.query.gd_zone_config=t,"?".concat(c.stringify(r.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var r=new k(e,!0);return r.query=Vk(Vk({},r.query),t),r.toString()}},{key:"_base64_encode",value:function(e){return Fh(JSON.stringify(e))}},{key:"session",value:function(){var e=this;return new Promise(function(){var r=t(u.mark((function t(r,n){var o;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.sdkReady;case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:o=e._gameData,r({ads:{display:{enabled:o.dAds.enabled},rewarded:{enabled:o.rewardedAds}},location:{parentDomain:e._bridge.parentDomain,topDomain:e._bridge.topDomain,parentURL:e._bridge.parentURL,depth:e._bridge.depth,loadedByGameZone:e._bridge.isTokenGameURL}});case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e,t){return r.apply(this,arguments)}}())}},{key:"sendGenericEvent",value:function(e){console.log("Received generic event",e,this._isMasterGameURL());try{"trackMilestone"==e.eventName&&Jk.tracking.trackEvent("milestoneAchieved",{pageId:this.options.gameId,pageType:"game"})}catch(e){console.log(e.message)}}},{key:"_getisMobile",value:function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),!1===t&&window.orientation>-1&&(t=!0),t}},{key:"_get_game_thumbnail_url",value:function(){var e=this,t=this._gameData,n=t.assets.find(function(t){return r(this,e),t.hasOwnProperty("name")&&512===t.width&&512===t.height}.bind(this));return n||(n=t.assets.length>0?t.assets[0]:{name:"logo.svg"}),"https://img.gamedistribution.com/".concat(n.name)}},{key:"_post_message",value:function(e){var t,r=e.topic,n=e.data,o=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var a=window.top||window.parent;a&&a.postMessage({source:"gdsdk",topic:r,data:n},o)}catch(e){console.error((null==e?void 0:e.message)||e)}}},{key:"decideToGiveAGift",value:function(){var e=this;try{var n,o=null===(n=this._gameData)||void 0===n?void 0:n.gft,a=setInterval(t(u.mark((function t(){var n=this;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.adInstance.requestRunning?console.log("Advertisement already running..."):(e.showAd(Te.Interstitial,{position:"midroll"}).catch(function(e){r(this,n)}.bind(this)),clearInterval(a),e._giftCount++);case 1:case"end":return t.stop()}}),t,this)}))),1e3*o.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}}]),e}(),eE={},tE=function(e){try{if(e.skipForward)return;if(eE.source){var t={type:"gd-sdk-on-event",event:e};eE.source.postMessage(t,eE.origin)}}catch(e){console.log("gd-sdk forwardEvent err",e)}},rE=function(){tE({name:"SDK_READY",status:"success",message:"Everything is ready."}),tE({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),tE({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},nE=function(e){window.addEventListener("message",(function(n){var o=n.data,a=n.origin,i=n.source,s=o.type,c=o.method,l=o.options;if("gd-sdk-self"!==s){if("gd-sdk"===s){if(!eE.source&&"init"===c)return function(e){var t=e.source,r=e.origin;eE={source:t,origin:r}}({source:i,origin:a}),void rE();var d=e[c];d&&t(u.mark((function t(){var n,o=this;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,function(){r(this,o),"showAd"===c&&na.firstAdapterModeAdsense&&"rewarded"!==l.adType&&(console.log("promo-test, set first adapter to adssense 3"),l.params=l.params?l.params:{},l.params.adapter="adsense")}.bind(this),!(n=d.apply(e,Object.values(l)))||!n.then){t.next=6;break}return t.next=6,n;case 6:t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),console.log("gd:adp:m:r onFrameMessage error",t.t0);case 11:case"end":return t.stop()}}),t,this,[[0,8]])})))()}}else{var f={type:"gd-sdk",method:c,options:l};window.postMessage(f,"https://html5.gamedistribution.com")}}),!1)},oE=function(e){!function(e){var t=e.onEvent;e.onEvent=function(e){tE(e),t.apply(this,arguments)}}(e);var t=new Xk(e);return nE(t),t},aE=function(e){try{var t=cA(e);e.gameId||t.send("nogameid",{message:"".concat(Vh.parentURL)})}catch(e){}},iE={create:function(){var e=t(u.mark((function e(t){var r,n;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,aE(t),nA=cA(aA=t),e.next=5,SA();case 5:return r=e.sent,n=r?wA(t):oE(t),gA(),e.abrupt("return",n);case 11:return e.prev=11,e.t0=e.catch(0),console.log("gd:adp: sdk adaptor create failed, fallback to default adapter",e.t0),e.abrupt("return",oE(t));case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(t){return e.apply(this,arguments)}}()};function sE(){return(sE=t(u.mark((function e(t,r){var n;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_A();case 2:if(!e.sent){e.next=7;break}e.t0=window.gdsdk,e.next=10;break;case 7:return e.next=9,cE(t);case 9:e.t0=e.sent;case 10:return n=e.t0,e.abrupt("return",r(n));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var uE=!1;function cE(e){var t=this;return new Promise(function(n,o){var a=this;if(r(this,t),Yk)return n(Yk);if(uE)var i=setInterval(function(){r(this,a),Yk&&(uE=!1,clearInterval(i),n(Yk))}.bind(this),100);else uE=!0,iE.create(e).then(function(e){r(this,a),Yk=e,e._sendSDKReady(),uE=!1,n(Yk)}.bind(this))}.bind(this))}var lE,dE=(cE(lE=function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":n(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===n(window.gdApi.q[0][0])&&window.gdApi.q[0][0]&&((e=window.gdApi.q[0][0]).hasOwnProperty("advertisementSettings")||(e.advertisementSettings={autoplay:!0}))}catch(e){console.log("_get_developer_sets failed",e)}return e}()),{invoke:function(e){return function(e,t){return sE.apply(this,arguments)}(lE,e)}});function fE(){var e=this;this.AdType=Te,this.preloadAd=function(e){var t=this;return dE.invoke(function(n){return r(this,t),n.preloadAd(e)}.bind(this))},this.showAd=function(){var e=t(u.mark((function e(t,n){var o=this;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",dE.invoke(function(e){var a=this;if(r(this,o),t===Te.Display)return e.showDisplayAd(n);return function(){r(this,a)}.bind(this),e.showAd(t,{})}.bind(this)));case 1:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}(),this.cancelAd=function(){var e=this;return dE.invoke(function(t){return r(this,e),t.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return dE.invoke(function(t){return r(this,e),t.openConsole()}.bind(this))},this.getSession=function(){var e=this;return dE.invoke(function(t){return r(this,e),t.session()}.bind(this))},this.sendEvent=function(e){var t=this;return dE.invoke(function(n){return r(this,t),n.sendGenericEvent(e)}.bind(this))},this.leaderboard={show:function(){r(this,e),ip.showLeaderboard()}.bind(this),addScore:function(t){r(this,e),ip.addScore(t)}.bind(this)}}fE.prototype=new function(){this.showBanner=function(){var e=this;return dE.invoke(function(t){return r(this,e),t.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new fE,window.gdApi=window.gdsdk}();