@bygd/gd-sdk-pes 1.29.0 → 1.29.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/newArrowCheck"),n=require("@babel/runtime/helpers/typeof"),r=require("@babel/runtime/regenerator"),a=require("@bygd/gd-sdk-era/dist/default"),i=require("@babel/runtime/helpers/classCallCheck"),s=require("@babel/runtime/helpers/defineProperty"),o=require("@babel/runtime/helpers/createClass"),d=require("url-parse"),u=require("js-base64"),c=require("validator"),l=require("is-valid-domain"),h=require("get-value"),f=require("set-value"),p=require("lodash.clonedeep"),m=require("can-autoplay"),g=require("is-plain-object"),v=require("querystringify"),y=require("lodash.merge"),b=require("events"),_=require("uuid");function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var A=w(e),k=w(t),E=w(n),x=w(r),R=w(i),T=w(s),S=w(o),D=w(d),O=w(c),I=w(l),P=w(h),C=w(f),L=w(p),U=w(m),j=w(v),M=w(y),G="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},N=function(e){return e&&e.Math==Math&&e},B=N("object"==typeof globalThis&&globalThis)||N("object"==typeof window&&window)||N("object"==typeof self&&self)||N("object"==typeof G&&G)||function(){return this}()||Function("return this")(),q={exports:{}},F=B,V=Object.defineProperty,W=function(e,t){try{V(F,e,{value:t,configurable:!0,writable:!0})}catch(n){F[e]=t}return t},H=W,z=B["__core-js_shared__"]||H("__core-js_shared__",{}),K=z;(q.exports=function(e,t){return K[e]||(K[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.19.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var $,Q,Y=Function.prototype,J=Y.bind,X=Y.call,Z=J&&J.bind(X),ee=J?function(e){return e&&Z(X,e)}:function(e){return e&&function(){return X.apply(e,arguments)}},te=B.TypeError,ne=function(e){if(null==e)throw te("Can't call method on "+e);return e},re=ne,ae=B.Object,ie=function(e){return ae(re(e))},se=ie,oe=ee({}.hasOwnProperty),de=Object.hasOwn||function(e,t){return oe(se(e),t)},ue=ee,ce=0,le=Math.random(),he=ue(1..toString),fe=function(e){return"Symbol("+(void 0===e?"":e)+")_"+he(++ce+le,36)},pe=function(e){return"function"==typeof e},me=B,ge=pe,ve=function(e){return ge(e)?e:void 0},ye=function(e,t){return arguments.length<2?ve(me[e]):me[e]&&me[e][t]},be=ye("navigator","userAgent")||"",_e=B,we=be,Ae=_e.process,ke=_e.Deno,Ee=Ae&&Ae.versions||ke&&ke.version,xe=Ee&&Ee.v8;xe&&(Q=($=xe.split("."))[0]>0&&$[0]<4?1:+($[0]+$[1])),!Q&&we&&(!($=we.match(/Edge\/(\d+)/))||$[1]>=74)&&($=we.match(/Chrome\/(\d+)/))&&(Q=+$[1]);var Re=Q,Te=function(e){try{return!!e()}catch(e){return!0}},Se=Re,De=Te,Oe=!!Object.getOwnPropertySymbols&&!De((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Se&&Se<41})),Ie=Oe&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Pe=B,Ce=q.exports,Le=de,Ue=fe,je=Oe,Me=Ie,Ge=Ce("wks"),Ne=Pe.Symbol,Be=Ne&&Ne.for,qe=Me?Ne:Ne&&Ne.withoutSetter||Ue,Fe=function(e){if(!Le(Ge,e)||!je&&"string"!=typeof Ge[e]){var t="Symbol."+e;je&&Le(Ne,e)?Ge[e]=Ne[e]:Ge[e]=Me&&Be?Be(t):qe(t)}return Ge[e]},Ve={};Ve[Fe("toStringTag")]="z";var We="[object z]"===String(Ve),He={exports:{}},ze=!Te((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Ke={},$e=pe,Qe=function(e){return"object"==typeof e?null!==e:$e(e)},Ye=Qe,Je=B.document,Xe=Ye(Je)&&Ye(Je.createElement),Ze=function(e){return Xe?Je.createElement(e):{}},et=Ze,tt=!ze&&!Te((function(){return 7!=Object.defineProperty(et("div"),"a",{get:function(){return 7}}).a})),nt=B,rt=Qe,at=nt.String,it=nt.TypeError,st=function(e){if(rt(e))return e;throw it(at(e)+" is not an object")},ot=Function.prototype.call,dt=ot.bind?ot.bind(ot):function(){return ot.apply(ot,arguments)},ut=ee({}.isPrototypeOf),ct=ye,lt=pe,ht=ut,ft=Ie,pt=B.Object,mt=ft?function(e){return"symbol"==typeof e}:function(e){var t=ct("Symbol");return lt(t)&&ht(t.prototype,pt(e))},gt=B.String,vt=function(e){try{return gt(e)}catch(e){return"Object"}},yt=pe,bt=vt,_t=B.TypeError,wt=function(e){if(yt(e))return e;throw _t(bt(e)+" is not a function")},At=wt,kt=function(e,t){var n=e[t];return null==n?void 0:At(n)},Et=dt,xt=pe,Rt=Qe,Tt=B.TypeError,St=dt,Dt=Qe,Ot=mt,It=kt,Pt=function(e,t){var n,r;if("string"===t&&xt(n=e.toString)&&!Rt(r=Et(n,e)))return r;if(xt(n=e.valueOf)&&!Rt(r=Et(n,e)))return r;if("string"!==t&&xt(n=e.toString)&&!Rt(r=Et(n,e)))return r;throw Tt("Can't convert object to primitive value")},Ct=Fe,Lt=B.TypeError,Ut=Ct("toPrimitive"),jt=function(e,t){if(!Dt(e)||Ot(e))return e;var n,r=It(e,Ut);if(r){if(void 0===t&&(t="default"),n=St(r,e,t),!Dt(n)||Ot(n))return n;throw Lt("Can't convert object to primitive value")}return void 0===t&&(t="number"),Pt(e,t)},Mt=mt,Gt=function(e){var t=jt(e,"string");return Mt(t)?t:t+""},Nt=ze,Bt=tt,qt=st,Ft=Gt,Vt=B.TypeError,Wt=Object.defineProperty;Ke.f=Nt?Wt:function(e,t,n){if(qt(e),t=Ft(t),qt(n),Bt)try{return Wt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw Vt("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Ht=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},zt=Ke,Kt=Ht,$t=ze?function(e,t,n){return zt.f(e,t,Kt(1,n))}:function(e,t,n){return e[t]=n,e},Qt=pe,Yt=z,Jt=ee(Function.toString);Qt(Yt.inspectSource)||(Yt.inspectSource=function(e){return Jt(e)});var Xt,Zt,en,tn=Yt.inspectSource,nn=pe,rn=tn,an=B.WeakMap,sn=nn(an)&&/native code/.test(rn(an)),on=q.exports,dn=fe,un=on("keys"),cn=function(e){return un[e]||(un[e]=dn(e))},ln={},hn=sn,fn=B,pn=ee,mn=Qe,gn=$t,vn=de,yn=z,bn=cn,_n=ln,wn=fn.TypeError,An=fn.WeakMap;if(hn||yn.state){var kn=yn.state||(yn.state=new An),En=pn(kn.get),xn=pn(kn.has),Rn=pn(kn.set);Xt=function(e,t){if(xn(kn,e))throw new wn("Object already initialized");return t.facade=e,Rn(kn,e,t),t},Zt=function(e){return En(kn,e)||{}},en=function(e){return xn(kn,e)}}else{var Tn=bn("state");_n[Tn]=!0,Xt=function(e,t){if(vn(e,Tn))throw new wn("Object already initialized");return t.facade=e,gn(e,Tn,t),t},Zt=function(e){return vn(e,Tn)?e[Tn]:{}},en=function(e){return vn(e,Tn)}}var Sn={set:Xt,get:Zt,has:en,enforce:function(e){return en(e)?Zt(e):Xt(e,{})},getterFor:function(e){return function(t){var n;if(!mn(t)||(n=Zt(t)).type!==e)throw wn("Incompatible receiver, "+e+" required");return n}}},Dn=ze,On=de,In=Function.prototype,Pn=Dn&&Object.getOwnPropertyDescriptor,Cn=On(In,"name"),Ln={EXISTS:Cn,PROPER:Cn&&"something"===function(){}.name,CONFIGURABLE:Cn&&(!Dn||Dn&&Pn(In,"name").configurable)},Un=B,jn=pe,Mn=de,Gn=$t,Nn=W,Bn=tn,qn=Ln.CONFIGURABLE,Fn=Sn.get,Vn=Sn.enforce,Wn=String(String).split("String");(He.exports=function(e,t,n,r){var a,i=!!r&&!!r.unsafe,s=!!r&&!!r.enumerable,o=!!r&&!!r.noTargetGet,d=r&&void 0!==r.name?r.name:t;jn(n)&&("Symbol("===String(d).slice(0,7)&&(d="["+String(d).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!Mn(n,"name")||qn&&n.name!==d)&&Gn(n,"name",d),(a=Vn(n)).source||(a.source=Wn.join("string"==typeof d?d:""))),e!==Un?(i?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=n:Gn(e,t,n)):s?e[t]=n:Nn(t,n)})(Function.prototype,"toString",(function(){return jn(this)&&Fn(this).source||Bn(this)}));var Hn=ee,zn=Hn({}.toString),Kn=Hn("".slice),$n=function(e){return Kn(zn(e),8,-1)},Qn=B,Yn=We,Jn=pe,Xn=$n,Zn=Fe("toStringTag"),er=Qn.Object,tr="Arguments"==Xn(function(){return arguments}()),nr=Yn?Xn:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=er(e),Zn))?n:tr?Xn(t):"Object"==(r=Xn(t))&&Jn(t.callee)?"Arguments":r},rr=nr,ar=We?{}.toString:function(){return"[object "+rr(this)+"]"},ir=We,sr=He.exports,or=ar;ir||sr(Object.prototype,"toString",or,{unsafe:!0});var dr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},ur=Ze("span").classList,cr=ur&&ur.constructor&&ur.constructor.prototype,lr=cr===Object.prototype?void 0:cr,hr=wt,fr=ee(ee.bind),pr=function(e,t){return hr(e),void 0===t?e:fr?fr(e,t):function(){return e.apply(t,arguments)}},mr=ee,gr=Te,vr=$n,yr=B.Object,br=mr("".split),_r=gr((function(){return!yr("z").propertyIsEnumerable(0)}))?function(e){return"String"==vr(e)?br(e,""):yr(e)}:yr,wr=Math.ceil,Ar=Math.floor,kr=function(e){var t=+e;return t!=t||0===t?0:(t>0?Ar:wr)(t)},Er=kr,xr=Math.min,Rr=function(e){return e>0?xr(Er(e),9007199254740991):0},Tr=Rr,Sr=function(e){return Tr(e.length)},Dr=$n,Or=Array.isArray||function(e){return"Array"==Dr(e)},Ir=ee,Pr=Te,Cr=pe,Lr=nr,Ur=tn,jr=function(){},Mr=[],Gr=ye("Reflect","construct"),Nr=/^\s*(?:class|function)\b/,Br=Ir(Nr.exec),qr=!Nr.exec(jr),Fr=function(e){if(!Cr(e))return!1;try{return Gr(jr,Mr,e),!0}catch(e){return!1}},Vr=!Gr||Pr((function(){var e;return Fr(Fr.call)||!Fr(Object)||!Fr((function(){e=!0}))||e}))?function(e){if(!Cr(e))return!1;switch(Lr(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return qr||!!Br(Nr,Ur(e))}:Fr,Wr=B,Hr=Or,zr=Vr,Kr=Qe,$r=Fe("species"),Qr=Wr.Array,Yr=function(e){var t;return Hr(e)&&(t=e.constructor,(zr(t)&&(t===Qr||Hr(t.prototype))||Kr(t)&&null===(t=t[$r]))&&(t=void 0)),void 0===t?Qr:t},Jr=function(e,t){return new(Yr(e))(0===t?0:t)},Xr=pr,Zr=_r,ea=ie,ta=Sr,na=Jr,ra=ee([].push),aa=function(e){var t=1==e,n=2==e,r=3==e,a=4==e,i=6==e,s=7==e,o=5==e||i;return function(d,u,c,l){for(var h,f,p=ea(d),m=Zr(p),g=Xr(u,c),v=ta(m),y=0,b=l||na,_=t?b(d,v):n||s?b(d,0):void 0;v>y;y++)if((o||y in m)&&(f=g(h=m[y],y,p),e))if(t)_[y]=f;else if(f)switch(e){case 3:return!0;case 5:return h;case 6:return y;case 2:ra(_,h)}else switch(e){case 4:return!1;case 7:ra(_,h)}return i?-1:r||a?a:_}},ia={forEach:aa(0),map:aa(1),filter:aa(2),some:aa(3),every:aa(4),find:aa(5),findIndex:aa(6),filterReject:aa(7)},sa=Te,oa=function(e,t){var n=[][e];return!!n&&sa((function(){n.call(null,t||function(){throw 1},1)}))},da=ia.forEach,ua=B,ca=dr,la=lr,ha=oa("forEach")?[].forEach:function(e){return da(this,e,arguments.length>1?arguments[1]:void 0)},fa=$t,pa=function(e){if(e&&e.forEach!==ha)try{fa(e,"forEach",ha)}catch(t){e.forEach=ha}};for(var ma in ca)ca[ma]&&pa(ua[ma]&&ua[ma].prototype);pa(la);var ga={},va={},ya={}.propertyIsEnumerable,ba=Object.getOwnPropertyDescriptor,_a=ba&&!ya.call({1:2},1);va.f=_a?function(e){var t=ba(this,e);return!!t&&t.enumerable}:ya;var wa=_r,Aa=ne,ka=function(e){return wa(Aa(e))},Ea=ze,xa=dt,Ra=va,Ta=Ht,Sa=ka,Da=Gt,Oa=de,Ia=tt,Pa=Object.getOwnPropertyDescriptor;ga.f=Ea?Pa:function(e,t){if(e=Sa(e),t=Da(t),Ia)try{return Pa(e,t)}catch(e){}if(Oa(e,t))return Ta(!xa(Ra.f,e,t),e[t])};var Ca={},La=kr,Ua=Math.max,ja=Math.min,Ma=function(e,t){var n=La(e);return n<0?Ua(n+t,0):ja(n,t)},Ga=ka,Na=Ma,Ba=Sr,qa=function(e){return function(t,n,r){var a,i=Ga(t),s=Ba(i),o=Na(r,s);if(e&&n!=n){for(;s>o;)if((a=i[o++])!=a)return!0}else for(;s>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},Fa={includes:qa(!0),indexOf:qa(!1)},Va=de,Wa=ka,Ha=Fa.indexOf,za=ln,Ka=ee([].push),$a=function(e,t){var n,r=Wa(e),a=0,i=[];for(n in r)!Va(za,n)&&Va(r,n)&&Ka(i,n);for(;t.length>a;)Va(r,n=t[a++])&&(~Ha(i,n)||Ka(i,n));return i},Qa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ya=$a,Ja=Qa.concat("length","prototype");Ca.f=Object.getOwnPropertyNames||function(e){return Ya(e,Ja)};var Xa={};Xa.f=Object.getOwnPropertySymbols;var Za=ye,ei=Ca,ti=Xa,ni=st,ri=ee([].concat),ai=Za("Reflect","ownKeys")||function(e){var t=ei.f(ni(e)),n=ti.f;return n?ri(t,n(e)):t},ii=de,si=ai,oi=ga,di=Ke,ui=function(e,t){for(var n=si(t),r=di.f,a=oi.f,i=0;i<n.length;i++){var s=n[i];ii(e,s)||r(e,s,a(t,s))}},ci=Te,li=pe,hi=/#|\.prototype\./,fi=function(e,t){var n=mi[pi(e)];return n==vi||n!=gi&&(li(t)?ci(t):!!t)},pi=fi.normalize=function(e){return String(e).replace(hi,".").toLowerCase()},mi=fi.data={},gi=fi.NATIVE="N",vi=fi.POLYFILL="P",yi=fi,bi=B,_i=ga.f,wi=$t,Ai=He.exports,ki=W,Ei=ui,xi=yi,Ri=function(e,t){var n,r,a,i,s,o=e.target,d=e.global,u=e.stat;if(n=d?bi:u?bi[o]||ki(o,{}):(bi[o]||{}).prototype)for(r in t){if(i=t[r],a=e.noTargetGet?(s=_i(n,r))&&s.value:n[r],!xi(d?r:o+(u?".":"#")+r,e.forced)&&void 0!==a){if(typeof i==typeof a)continue;Ei(i,a)}(e.sham||a&&a.sham)&&wi(i,"sham",!0),Ai(n,r,i,e)}},Ti=$a,Si=Qa,Di=Object.keys||function(e){return Ti(e,Si)},Oi=ie,Ii=Di;Ri({target:"Object",stat:!0,forced:Te((function(){Ii(1)}))},{keys:function(e){return Ii(Oi(e))}});var Pi=Array.isArray,Ci=Object.prototype.toString,Li=Pi||function(e){return!!e&&"[object Array]"==Ci.call(e)},Ui={name:"@bygd/gd-sdk-pes",version:"1.29.0",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"}},ji=function(e){var t=Mi("object"===E.default(e)?e:a.parseJSON(e));return t&&t.version?Ui.version>=t.version?t:void 0:t},Mi=function(e){var t=this;if(!Li(e)||0===e.length)return e;if(1===e.length)return e[0];var n=0;e.forEach(function(e){k.default(this,t),e.weight=e.weight||1,n+=e.weight}.bind(this));var r=Math.floor(Math.random()*Math.floor(n));n=0;for(var a=0;a<e.length;a++){var i=e[a];if(r<(n+=i.weight))return i}},Gi=function(){var e;(e=console).log.apply(e,arguments)};JSON.stringify({adapters:{default:["ima","adsense","ima","adsense"],preroll:["ima","adsense","ima","adsense"],midroll:["ima","adsense","ima","adsense"],rewarded:["ima","adsense","ima","adsense"]}}),JSON.stringify({adapters:{default:["ima","adsense","ima","adsense"],preroll:["ima","adsense","ima"],midroll:["ima","adsense","ima"],rewarded:["ima","adsense","ima","adsense"]}});var Ni,Bi={},qi=Function.prototype,Fi=qi.apply,Vi=qi.bind,Wi=qi.call,Hi="object"==typeof Reflect&&Reflect.apply||(Vi?Wi.bind(Fi):function(){return Wi.apply(Fi,arguments)}),zi=nr,Ki=B.String,$i=function(e){if("Symbol"===zi(e))throw TypeError("Cannot convert a Symbol value to a string");return Ki(e)},Qi=Ke,Yi=st,Ji=ka,Xi=Di,Zi=ze?Object.defineProperties:function(e,t){Yi(e);for(var n,r=Ji(t),a=Xi(t),i=a.length,s=0;i>s;)Qi.f(e,n=a[s++],r[n]);return e},es=ye("document","documentElement"),ts=st,ns=Zi,rs=Qa,as=ln,is=es,ss=Ze,os=cn("IE_PROTO"),ds=function(){},us=function(e){return"<script>"+e+"<\/script>"},cs=function(e){e.write(us("")),e.close();var t=e.parentWindow.Object;return e=null,t},ls=function(){try{Ni=new ActiveXObject("htmlfile")}catch(e){}var e,t;ls="undefined"!=typeof document?document.domain&&Ni?cs(Ni):((t=ss("iframe")).style.display="none",is.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(us("document.F=Object")),e.close(),e.F):cs(Ni);for(var n=rs.length;n--;)delete ls.prototype[rs[n]];return ls()};as[os]=!0;var hs=Object.create||function(e,t){var n;return null!==e?(ds.prototype=ts(e),n=new ds,ds.prototype=null,n[os]=e):n=ls(),void 0===t?n:ns(n,t)},fs={},ps=ee([].slice),ms=$n,gs=ka,vs=Ca.f,ys=ps,bs="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];fs.f=function(e){return bs&&"Window"==ms(e)?function(e){try{return vs(e)}catch(e){return ys(bs)}}(e):vs(gs(e))};var _s={},ws=Fe;_s.f=ws;var As=B,ks=de,Es=_s,xs=Ke.f,Rs=function(e){var t=As.Symbol||(As.Symbol={});ks(t,e)||xs(t,e,{value:Es.f(e)})},Ts=Ke.f,Ss=de,Ds=Fe("toStringTag"),Os=function(e,t,n){e&&!Ss(e=n?e:e.prototype,Ds)&&Ts(e,Ds,{configurable:!0,value:t})},Is=Ri,Ps=B,Cs=ye,Ls=Hi,Us=dt,js=ee,Ms=ze,Gs=Oe,Ns=Te,Bs=de,Fs=Or,Vs=pe,Ws=Qe,Hs=ut,zs=mt,Ks=st,$s=ie,Qs=ka,Ys=Gt,Js=$i,Xs=Ht,Zs=hs,eo=Di,to=Ca,no=fs,ro=Xa,ao=ga,io=Ke,so=va,oo=ps,uo=He.exports,co=q.exports,lo=ln,ho=fe,fo=Fe,po=_s,mo=Rs,go=Os,vo=Sn,yo=ia.forEach,bo=cn("hidden"),_o=fo("toPrimitive"),wo=vo.set,Ao=vo.getterFor("Symbol"),ko=Object.prototype,Eo=Ps.Symbol,xo=Eo&&Eo.prototype,Ro=Ps.TypeError,To=Ps.QObject,So=Cs("JSON","stringify"),Do=ao.f,Oo=io.f,Io=no.f,Po=so.f,Co=js([].push),Lo=co("symbols"),Uo=co("op-symbols"),jo=co("string-to-symbol-registry"),Mo=co("symbol-to-string-registry"),Go=co("wks"),No=!To||!To.prototype||!To.prototype.findChild,Bo=Ms&&Ns((function(){return 7!=Zs(Oo({},"a",{get:function(){return Oo(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Do(ko,t);r&&delete ko[t],Oo(e,t,n),r&&e!==ko&&Oo(ko,t,r)}:Oo,qo=function(e,t){var n=Lo[e]=Zs(xo);return wo(n,{type:"Symbol",tag:e,description:t}),Ms||(n.description=t),n},Fo=function(e,t,n){e===ko&&Fo(Uo,t,n),Ks(e);var r=Ys(t);return Ks(n),Bs(Lo,r)?(n.enumerable?(Bs(e,bo)&&e[bo][r]&&(e[bo][r]=!1),n=Zs(n,{enumerable:Xs(0,!1)})):(Bs(e,bo)||Oo(e,bo,Xs(1,{})),e[bo][r]=!0),Bo(e,r,n)):Oo(e,r,n)},Vo=function(e,t){Ks(e);var n=Qs(t),r=eo(n).concat(Ko(n));return yo(r,(function(t){Ms&&!Us(Wo,n,t)||Fo(e,t,n[t])})),e},Wo=function(e){var t=Ys(e),n=Us(Po,this,t);return!(this===ko&&Bs(Lo,t)&&!Bs(Uo,t))&&(!(n||!Bs(this,t)||!Bs(Lo,t)||Bs(this,bo)&&this[bo][t])||n)},Ho=function(e,t){var n=Qs(e),r=Ys(t);if(n!==ko||!Bs(Lo,r)||Bs(Uo,r)){var a=Do(n,r);return!a||!Bs(Lo,r)||Bs(n,bo)&&n[bo][r]||(a.enumerable=!0),a}},zo=function(e){var t=Io(Qs(e)),n=[];return yo(t,(function(e){Bs(Lo,e)||Bs(lo,e)||Co(n,e)})),n},Ko=function(e){var t=e===ko,n=Io(t?Uo:Qs(e)),r=[];return yo(n,(function(e){!Bs(Lo,e)||t&&!Bs(ko,e)||Co(r,Lo[e])})),r};(Gs||(uo(xo=(Eo=function(){if(Hs(xo,this))throw Ro("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?Js(arguments[0]):void 0,t=ho(e),n=function(e){this===ko&&Us(n,Uo,e),Bs(this,bo)&&Bs(this[bo],t)&&(this[bo][t]=!1),Bo(this,t,Xs(1,e))};return Ms&&No&&Bo(ko,t,{configurable:!0,set:n}),qo(t,e)}).prototype,"toString",(function(){return Ao(this).tag})),uo(Eo,"withoutSetter",(function(e){return qo(ho(e),e)})),so.f=Wo,io.f=Fo,ao.f=Ho,to.f=no.f=zo,ro.f=Ko,po.f=function(e){return qo(fo(e),e)},Ms&&(Oo(xo,"description",{configurable:!0,get:function(){return Ao(this).description}}),uo(ko,"propertyIsEnumerable",Wo,{unsafe:!0}))),Is({global:!0,wrap:!0,forced:!Gs,sham:!Gs},{Symbol:Eo}),yo(eo(Go),(function(e){mo(e)})),Is({target:"Symbol",stat:!0,forced:!Gs},{for:function(e){var t=Js(e);if(Bs(jo,t))return jo[t];var n=Eo(t);return jo[t]=n,Mo[n]=t,n},keyFor:function(e){if(!zs(e))throw Ro(e+" is not a symbol");if(Bs(Mo,e))return Mo[e]},useSetter:function(){No=!0},useSimple:function(){No=!1}}),Is({target:"Object",stat:!0,forced:!Gs,sham:!Ms},{create:function(e,t){return void 0===t?Zs(e):Vo(Zs(e),t)},defineProperty:Fo,defineProperties:Vo,getOwnPropertyDescriptor:Ho}),Is({target:"Object",stat:!0,forced:!Gs},{getOwnPropertyNames:zo,getOwnPropertySymbols:Ko}),Is({target:"Object",stat:!0,forced:Ns((function(){ro.f(1)}))},{getOwnPropertySymbols:function(e){return ro.f($s(e))}}),So)&&Is({target:"JSON",stat:!0,forced:!Gs||Ns((function(){var e=Eo();return"[null]"!=So([e])||"{}"!=So({a:e})||"{}"!=So(Object(e))}))},{stringify:function(e,t,n){var r=oo(arguments),a=t;if((Ws(t)||void 0!==e)&&!zs(e))return Fs(t)||(t=function(e,t){if(Vs(a)&&(t=Us(a,this,e,t)),!zs(t))return t}),r[1]=t,Ls(So,null,r)}});if(!xo[_o]){var $o=xo.valueOf;uo(xo,_o,(function(e){return Us($o,this)}))}go(Eo,"Symbol"),lo[bo]=!0;var Qo=Te,Yo=Re,Jo=Fe("species"),Xo=function(e){return Yo>=51||!Qo((function(){var t=[];return(t.constructor={})[Jo]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Zo=ia.filter;Ri({target:"Array",proto:!0,forced:!Xo("filter")},{filter:function(e){return Zo(this,e,arguments.length>1?arguments[1]:void 0)}});var ed=Ri,td=Te,nd=ka,rd=ga.f,ad=ze,id=td((function(){rd(1)}));ed({target:"Object",stat:!0,forced:!ad||id,sham:!ad},{getOwnPropertyDescriptor:function(e,t){return rd(nd(e),t)}});var sd=Gt,od=Ke,dd=Ht,ud=function(e,t,n){var r=sd(t);r in e?od.f(e,r,dd(0,n)):e[r]=n},cd=ai,ld=ka,hd=ga,fd=ud;Ri({target:"Object",stat:!0,sham:!ze},{getOwnPropertyDescriptors:function(e){for(var t,n,r=ld(e),a=hd.f,i=cd(r),s={},o=0;i.length>o;)void 0!==(n=a(r,t=i[o++]))&&fd(s,t,n);return s}});var pd=Ri,md=B,gd=Or,vd=Vr,yd=Qe,bd=Ma,_d=Sr,wd=ka,Ad=ud,kd=Fe,Ed=ps,xd=Xo("slice"),Rd=kd("species"),Td=md.Array,Sd=Math.max;pd({target:"Array",proto:!0,forced:!xd},{slice:function(e,t){var n,r,a,i=wd(this),s=_d(i),o=bd(e,s),d=bd(void 0===t?s:t,s);if(gd(i)&&(n=i.constructor,(vd(n)&&(n===Td||gd(n.prototype))||yd(n)&&null===(n=n[Rd]))&&(n=void 0),n===Td||void 0===n))return Ed(i,o,d);for(r=new(void 0===n?Td:n)(Sd(d-o,0)),a=0;o<d;o++,a++)o in i&&Ad(r,a,i[o]);return r.length=a,r}});var Dd=dt,Od=st,Id=kt,Pd=function(e,t,n){var r,a;Od(e);try{if(!(r=Id(e,"return"))){if("throw"===t)throw n;return n}r=Dd(r,e)}catch(e){a=!0,r=e}if("throw"===t)throw n;if(a)throw r;return Od(r),n},Cd=st,Ld=Pd,Ud={},jd=Ud,Md=Fe("iterator"),Gd=Array.prototype,Nd=function(e){return void 0!==e&&(jd.Array===e||Gd[Md]===e)},Bd=nr,qd=kt,Fd=Ud,Vd=Fe("iterator"),Wd=function(e){if(null!=e)return qd(e,Vd)||qd(e,"@@iterator")||Fd[Bd(e)]},Hd=dt,zd=wt,Kd=st,$d=vt,Qd=Wd,Yd=B.TypeError,Jd=function(e,t){var n=arguments.length<2?Qd(e):t;if(zd(n))return Kd(Hd(n,e));throw Yd($d(e)+" is not iterable")},Xd=pr,Zd=dt,eu=ie,tu=function(e,t,n,r){try{return r?t(Cd(n)[0],n[1]):t(n)}catch(t){Ld(e,"throw",t)}},nu=Nd,ru=Vr,au=Sr,iu=ud,su=Jd,ou=Wd,du=B.Array,uu=Fe("iterator"),cu=!1;try{var lu=0,hu={next:function(){return{done:!!lu++}},return:function(){cu=!0}};hu[uu]=function(){return this},Array.from(hu,(function(){throw 2}))}catch(e){}var fu=function(e,t){if(!t&&!cu)return!1;var n=!1;try{var r={};r[uu]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},pu=function(e){var t=eu(e),n=ru(this),r=arguments.length,a=r>1?arguments[1]:void 0,i=void 0!==a;i&&(a=Xd(a,r>2?arguments[2]:void 0));var s,o,d,u,c,l,h=ou(t),f=0;if(!h||this==du&&nu(h))for(s=au(t),o=n?new this(s):du(s);s>f;f++)l=i?a(t[f],f):t[f],iu(o,f,l);else for(c=(u=su(t,h)).next,o=n?new this:[];!(d=Zd(c,u)).done;f++)l=i?tu(u,a,[d.value,f],!0):d.value,iu(o,f,l);return o.length=f,o};Ri({target:"Array",stat:!0,forced:!fu((function(e){Array.from(e)}))},{from:pu});var mu,gu,vu,yu=ee,bu=kr,_u=$i,wu=ne,Au=yu("".charAt),ku=yu("".charCodeAt),Eu=yu("".slice),xu=function(e){return function(t,n){var r,a,i=_u(wu(t)),s=bu(n),o=i.length;return s<0||s>=o?e?"":void 0:(r=ku(i,s))<55296||r>56319||s+1===o||(a=ku(i,s+1))<56320||a>57343?e?Au(i,s):r:e?Eu(i,s,s+2):a-56320+(r-55296<<10)+65536}},Ru={codeAt:xu(!1),charAt:xu(!0)},Tu=!Te((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Su=B,Du=de,Ou=pe,Iu=ie,Pu=Tu,Cu=cn("IE_PROTO"),Lu=Su.Object,Uu=Lu.prototype,ju=Pu?Lu.getPrototypeOf:function(e){var t=Iu(e);if(Du(t,Cu))return t[Cu];var n=t.constructor;return Ou(n)&&t instanceof n?n.prototype:t instanceof Lu?Uu:null},Mu=Te,Gu=pe,Nu=ju,Bu=He.exports,qu=Fe("iterator"),Fu=!1;[].keys&&("next"in(vu=[].keys())?(gu=Nu(Nu(vu)))!==Object.prototype&&(mu=gu):Fu=!0);var Vu=null==mu||Mu((function(){var e={};return mu[qu].call(e)!==e}));Vu&&(mu={}),Gu(mu[qu])||Bu(mu,qu,(function(){return this}));var Wu={IteratorPrototype:mu,BUGGY_SAFARI_ITERATORS:Fu},Hu=Wu.IteratorPrototype,zu=hs,Ku=Ht,$u=Os,Qu=Ud,Yu=function(){return this},Ju=function(e,t,n){var r=t+" Iterator";return e.prototype=zu(Hu,{next:Ku(1,n)}),$u(e,r,!1),Qu[r]=Yu,e},Xu=B,Zu=pe,ec=Xu.String,tc=Xu.TypeError,nc=ee,rc=st,ac=function(e){if("object"==typeof e||Zu(e))return e;throw tc("Can't set "+ec(e)+" as a prototype")},ic=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=nc(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return rc(n),ac(r),t?e(n,r):n.__proto__=r,n}}():void 0),sc=Ri,oc=dt,dc=Ln,uc=pe,cc=Ju,lc=ju,hc=ic,fc=Os,pc=$t,mc=He.exports,gc=Ud,vc=dc.PROPER,yc=dc.CONFIGURABLE,bc=Wu.IteratorPrototype,_c=Wu.BUGGY_SAFARI_ITERATORS,wc=Fe("iterator"),Ac=function(){return this},kc=function(e,t,n,r,a,i,s){cc(n,t,r);var o,d,u,c=function(e){if(e===a&&m)return m;if(!_c&&e in f)return f[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",h=!1,f=e.prototype,p=f[wc]||f["@@iterator"]||a&&f[a],m=!_c&&p||c(a),g="Array"==t&&f.entries||p;if(g&&(o=lc(g.call(new e)))!==Object.prototype&&o.next&&(lc(o)!==bc&&(hc?hc(o,bc):uc(o[wc])||mc(o,wc,Ac)),fc(o,l,!0)),vc&&"values"==a&&p&&"values"!==p.name&&(yc?pc(f,"name","values"):(h=!0,m=function(){return oc(p,this)})),a)if(d={values:c("values"),keys:i?m:c("keys"),entries:c("entries")},s)for(u in d)(_c||h||!(u in f))&&mc(f,u,d[u]);else sc({target:t,proto:!0,forced:_c||h},d);return f[wc]!==m&&mc(f,wc,m,{name:a}),gc[t]=m,d},Ec=Ru.charAt,xc=$i,Rc=Sn,Tc=kc,Sc=Rc.set,Dc=Rc.getterFor("String Iterator");Tc(String,"String",(function(e){Sc(this,{type:"String Iterator",string:xc(e),index:0})}),(function(){var e,t=Dc(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Ec(n,r),t.index+=e.length,{value:e,done:!1})}));var Oc=st,Ic=function(){var e=Oc(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},Pc={},Cc=Te,Lc=B.RegExp;Pc.UNSUPPORTED_Y=Cc((function(){var e=Lc("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Pc.BROKEN_CARET=Cc((function(){var e=Lc("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var Uc=Te,jc=B.RegExp,Mc=Uc((function(){var e=jc(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Gc=Te,Nc=B.RegExp,Bc=Gc((function(){var e=Nc("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),qc=dt,Fc=ee,Vc=$i,Wc=Ic,Hc=Pc,zc=q.exports,Kc=hs,$c=Sn.get,Qc=Mc,Yc=Bc,Jc=zc("native-string-replace",String.prototype.replace),Xc=RegExp.prototype.exec,Zc=Xc,el=Fc("".charAt),tl=Fc("".indexOf),nl=Fc("".replace),rl=Fc("".slice),al=function(){var e=/a/,t=/b*/g;return qc(Xc,e,"a"),qc(Xc,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),il=Hc.UNSUPPORTED_Y||Hc.BROKEN_CARET,sl=void 0!==/()??/.exec("")[1];(al||sl||il||Qc||Yc)&&(Zc=function(e){var t,n,r,a,i,s,o,d=this,u=$c(d),c=Vc(e),l=u.raw;if(l)return l.lastIndex=d.lastIndex,t=qc(Zc,l,c),d.lastIndex=l.lastIndex,t;var h=u.groups,f=il&&d.sticky,p=qc(Wc,d),m=d.source,g=0,v=c;if(f&&(p=nl(p,"y",""),-1===tl(p,"g")&&(p+="g"),v=rl(c,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==el(c,d.lastIndex-1))&&(m="(?: "+m+")",v=" "+v,g++),n=new RegExp("^(?:"+m+")",p)),sl&&(n=new RegExp("^"+m+"$(?!\\s)",p)),al&&(r=d.lastIndex),a=qc(Xc,f?n:d,v),f?a?(a.input=rl(a.input,g),a[0]=rl(a[0],g),a.index=d.lastIndex,d.lastIndex+=a[0].length):d.lastIndex=0:al&&a&&(d.lastIndex=d.global?a.index+a[0].length:r),sl&&a&&a.length>1&&qc(Jc,a[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(a[i]=void 0)})),a&&h)for(a.groups=s=Kc(null),i=0;i<h.length;i++)s[(o=h[i])[0]]=a[o[1]];return a});var ol=Zc;Ri({target:"RegExp",proto:!0,forced:/./.exec!==ol},{exec:ol});var dl=Ri,ul=ze,cl=B,ll=ee,hl=de,fl=pe,pl=ut,ml=$i,gl=Ke.f,vl=ui,yl=cl.Symbol,bl=yl&&yl.prototype;if(ul&&fl(yl)&&(!("description"in bl)||void 0!==yl().description)){var _l={},wl=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:ml(arguments[0]),t=pl(bl,this)?new yl(e):void 0===e?yl():yl(e);return""===e&&(_l[t]=!0),t};vl(wl,yl),wl.prototype=bl,bl.constructor=wl;var Al="Symbol(test)"==String(yl("test")),kl=ll(bl.toString),El=ll(bl.valueOf),xl=/^Symbol\((.*)\)[^)]+$/,Rl=ll("".replace),Tl=ll("".slice);gl(bl,"description",{configurable:!0,get:function(){var e=El(this),t=kl(e);if(hl(_l,e))return"";var n=Al?Tl(t,7,-1):Rl(t,xl,"$1");return""===n?void 0:n}}),dl({global:!0,forced:!0},{Symbol:wl})}Rs("iterator");var Sl=hs,Dl=Ke,Ol=Fe("unscopables"),Il=Array.prototype;null==Il[Ol]&&Dl.f(Il,Ol,{configurable:!0,value:Sl(null)});var Pl=function(e){Il[Ol][e]=!0},Cl=ka,Ll=Pl,Ul=Ud,jl=Sn,Ml=kc,Gl=jl.set,Nl=jl.getterFor("Array Iterator"),Bl=Ml(Array,"Array",(function(e,t){Gl(this,{type:"Array Iterator",target:Cl(e),index:0,kind:t})}),(function(){var e=Nl(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values");Ul.Arguments=Ul.Array,Ll("keys"),Ll("values"),Ll("entries");var ql=B,Fl=dr,Vl=lr,Wl=Bl,Hl=$t,zl=Fe,Kl=zl("iterator"),$l=zl("toStringTag"),Ql=Wl.values,Yl=function(e,t){if(e){if(e[Kl]!==Ql)try{Hl(e,Kl,Ql)}catch(t){e[Kl]=Ql}if(e[$l]||Hl(e,$l,t),Fl[t])for(var n in Wl)if(e[n]!==Wl[n])try{Hl(e,n,Wl[n])}catch(t){e[n]=Wl[n]}}};for(var Jl in Fl)Yl(ql[Jl]&&ql[Jl].prototype,Jl);Yl(Vl,"DOMTokenList");var Xl,Zl,eh,th,nh=B.Promise,rh=He.exports,ah=function(e,t,n){for(var r in t)rh(e,r,t[r],n);return e},ih=ye,sh=Ke,oh=ze,dh=Fe("species"),uh=function(e){var t=ih(e),n=sh.f;oh&&t&&!t[dh]&&n(t,dh,{configurable:!0,get:function(){return this}})},ch=ut,lh=B.TypeError,hh=function(e,t){if(ch(t,e))return e;throw lh("Incorrect invocation")},fh=pr,ph=dt,mh=st,gh=vt,vh=Nd,yh=Sr,bh=ut,_h=Jd,wh=Wd,Ah=Pd,kh=B.TypeError,Eh=function(e,t){this.stopped=e,this.result=t},xh=Eh.prototype,Rh=Vr,Th=vt,Sh=B.TypeError,Dh=st,Oh=function(e){if(Rh(e))return e;throw Sh(Th(e)+" is not a constructor")},Ih=Fe("species"),Ph=function(e,t){var n,r=Dh(e).constructor;return void 0===r||null==(n=Dh(r)[Ih])?t:Oh(n)},Ch=/(?:ipad|iphone|ipod).*applewebkit/i.test(be),Lh="process"==$n(B.process),Uh=B,jh=Hi,Mh=pr,Gh=pe,Nh=de,Bh=Te,qh=es,Fh=ps,Vh=Ze,Wh=Ch,Hh=Lh,zh=Uh.setImmediate,Kh=Uh.clearImmediate,$h=Uh.process,Qh=Uh.Dispatch,Yh=Uh.Function,Jh=Uh.MessageChannel,Xh=Uh.String,Zh=0,ef={};try{Xl=Uh.location}catch(e){}var tf=function(e){if(Nh(ef,e)){var t=ef[e];delete ef[e],t()}},nf=function(e){return function(){tf(e)}},rf=function(e){tf(e.data)},af=function(e){Uh.postMessage(Xh(e),Xl.protocol+"//"+Xl.host)};zh&&Kh||(zh=function(e){var t=Fh(arguments,1);return ef[++Zh]=function(){jh(Gh(e)?e:Yh(e),void 0,t)},Zl(Zh),Zh},Kh=function(e){delete ef[e]},Hh?Zl=function(e){$h.nextTick(nf(e))}:Qh&&Qh.now?Zl=function(e){Qh.now(nf(e))}:Jh&&!Wh?(th=(eh=new Jh).port2,eh.port1.onmessage=rf,Zl=Mh(th.postMessage,th)):Uh.addEventListener&&Gh(Uh.postMessage)&&!Uh.importScripts&&Xl&&"file:"!==Xl.protocol&&!Bh(af)?(Zl=af,Uh.addEventListener("message",rf,!1)):Zl="onreadystatechange"in Vh("script")?function(e){qh.appendChild(Vh("script")).onreadystatechange=function(){qh.removeChild(this),tf(e)}}:function(e){setTimeout(nf(e),0)});var sf,of,df,uf,cf,lf,hf,ff,pf={set:zh,clear:Kh},mf=B,gf=/ipad|iphone|ipod/i.test(be)&&void 0!==mf.Pebble,vf=/web0s(?!.*chrome)/i.test(be),yf=B,bf=pr,_f=ga.f,wf=pf.set,Af=Ch,kf=gf,Ef=vf,xf=Lh,Rf=yf.MutationObserver||yf.WebKitMutationObserver,Tf=yf.document,Sf=yf.process,Df=yf.Promise,Of=_f(yf,"queueMicrotask"),If=Of&&Of.value;If||(sf=function(){var e,t;for(xf&&(e=Sf.domain)&&e.exit();of;){t=of.fn,of=of.next;try{t()}catch(e){throw of?uf():df=void 0,e}}df=void 0,e&&e.enter()},Af||xf||Ef||!Rf||!Tf?!kf&&Df&&Df.resolve?((hf=Df.resolve(void 0)).constructor=Df,ff=bf(hf.then,hf),uf=function(){ff(sf)}):xf?uf=function(){Sf.nextTick(sf)}:(wf=bf(wf,yf),uf=function(){wf(sf)}):(cf=!0,lf=Tf.createTextNode(""),new Rf(sf).observe(lf,{characterData:!0}),uf=function(){lf.data=cf=!cf}));var Pf=If||function(e){var t={fn:e,next:void 0};df&&(df.next=t),of||(of=t,uf()),df=t},Cf={},Lf=wt,Uf=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=Lf(t),this.reject=Lf(n)};Cf.f=function(e){return new Uf(e)};var jf,Mf,Gf,Nf,Bf=st,qf=Qe,Ff=Cf,Vf=function(e,t){if(Bf(e),qf(t)&&t.constructor===e)return t;var n=Ff.f(e);return(0,n.resolve)(t),n.promise},Wf=B,Hf="object"==typeof window,zf=Ri,Kf=B,$f=ye,Qf=dt,Yf=nh,Jf=He.exports,Xf=ah,Zf=ic,ep=Os,tp=uh,np=wt,rp=pe,ap=Qe,ip=hh,sp=tn,op=function(e,t,n){var r,a,i,s,o,d,u,c=n&&n.that,l=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),f=!(!n||!n.INTERRUPTED),p=fh(t,c),m=function(e){return r&&Ah(r,"normal",e),new Eh(!0,e)},g=function(e){return l?(mh(e),f?p(e[0],e[1],m):p(e[0],e[1])):f?p(e,m):p(e)};if(h)r=e;else{if(!(a=wh(e)))throw kh(gh(e)+" is not iterable");if(vh(a)){for(i=0,s=yh(e);s>i;i++)if((o=g(e[i]))&&bh(xh,o))return o;return new Eh(!1)}r=_h(e,a)}for(d=r.next;!(u=ph(d,r)).done;){try{o=g(u.value)}catch(e){Ah(r,"throw",e)}if("object"==typeof o&&o&&bh(xh,o))return o}return new Eh(!1)},dp=fu,up=Ph,cp=pf.set,lp=Pf,hp=Vf,fp=function(e,t){var n=Wf.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))},pp=Cf,mp=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},gp=Sn,vp=yi,yp=Hf,bp=Lh,_p=Re,wp=Fe("species"),Ap=gp.get,kp=gp.set,Ep=gp.getterFor("Promise"),xp=Yf&&Yf.prototype,Rp=Yf,Tp=xp,Sp=Kf.TypeError,Dp=Kf.document,Op=Kf.process,Ip=pp.f,Pp=Ip,Cp=!!(Dp&&Dp.createEvent&&Kf.dispatchEvent),Lp=rp(Kf.PromiseRejectionEvent),Up=!1,jp=vp("Promise",(function(){var e=sp(Rp),t=e!==String(Rp);if(!t&&66===_p)return!0;if(_p>=51&&/native code/.test(e))return!1;var n=new Rp((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[wp]=r,!(Up=n.then((function(){}))instanceof r)||!t&&yp&&!Lp})),Mp=jp||!dp((function(e){Rp.all(e).catch((function(){}))})),Gp=function(e){var t;return!(!ap(e)||!rp(t=e.then))&&t},Np=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;lp((function(){for(var r=e.value,a=1==e.state,i=0;n.length>i;){var s,o,d,u=n[i++],c=a?u.ok:u.fail,l=u.resolve,h=u.reject,f=u.domain;try{c?(a||(2===e.rejection&&Vp(e),e.rejection=1),!0===c?s=r:(f&&f.enter(),s=c(r),f&&(f.exit(),d=!0)),s===u.promise?h(Sp("Promise-chain cycle")):(o=Gp(s))?Qf(o,s,l,h):l(s)):h(r)}catch(e){f&&!d&&f.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&qp(e)}))}},Bp=function(e,t,n){var r,a;Cp?((r=Dp.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Kf.dispatchEvent(r)):r={promise:t,reason:n},!Lp&&(a=Kf["on"+e])?a(r):"unhandledrejection"===e&&fp("Unhandled promise rejection",n)},qp=function(e){Qf(cp,Kf,(function(){var t,n=e.facade,r=e.value;if(Fp(e)&&(t=mp((function(){bp?Op.emit("unhandledRejection",r,n):Bp("unhandledrejection",n,r)})),e.rejection=bp||Fp(e)?2:1,t.error))throw t.value}))},Fp=function(e){return 1!==e.rejection&&!e.parent},Vp=function(e){Qf(cp,Kf,(function(){var t=e.facade;bp?Op.emit("rejectionHandled",t):Bp("rejectionhandled",t,e.value)}))},Wp=function(e,t,n){return function(r){e(t,r,n)}},Hp=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Np(e,!0))},zp=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Sp("Promise can't be resolved itself");var r=Gp(t);r?lp((function(){var n={done:!1};try{Qf(r,t,Wp(zp,n,e),Wp(Hp,n,e))}catch(t){Hp(n,t,e)}})):(e.value=t,e.state=1,Np(e,!1))}catch(t){Hp({done:!1},t,e)}}};if(jp&&(Tp=(Rp=function(e){ip(this,Tp),np(e),Qf(jf,this);var t=Ap(this);try{e(Wp(zp,t),Wp(Hp,t))}catch(e){Hp(t,e)}}).prototype,(jf=function(e){kp(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Xf(Tp,{then:function(e,t){var n=Ep(this),r=n.reactions,a=Ip(up(this,Rp));return a.ok=!rp(e)||e,a.fail=rp(t)&&t,a.domain=bp?Op.domain:void 0,n.parent=!0,r[r.length]=a,0!=n.state&&Np(n,!1),a.promise},catch:function(e){return this.then(void 0,e)}}),Mf=function(){var e=new jf,t=Ap(e);this.promise=e,this.resolve=Wp(zp,t),this.reject=Wp(Hp,t)},pp.f=Ip=function(e){return e===Rp||e===Gf?new Mf(e):Pp(e)},rp(Yf)&&xp!==Object.prototype)){Nf=xp.then,Up||(Jf(xp,"then",(function(e,t){var n=this;return new Rp((function(e,t){Qf(Nf,n,e,t)})).then(e,t)}),{unsafe:!0}),Jf(xp,"catch",Tp.catch,{unsafe:!0}));try{delete xp.constructor}catch(e){}Zf&&Zf(xp,Tp)}zf({global:!0,wrap:!0,forced:jp},{Promise:Rp}),ep(Rp,"Promise",!1),tp("Promise"),Gf=$f("Promise"),zf({target:"Promise",stat:!0,forced:jp},{reject:function(e){var t=Ip(this);return Qf(t.reject,void 0,e),t.promise}}),zf({target:"Promise",stat:!0,forced:jp},{resolve:function(e){return hp(this,e)}}),zf({target:"Promise",stat:!0,forced:Mp},{all:function(e){var t=this,n=Ip(t),r=n.resolve,a=n.reject,i=mp((function(){var n=np(t.resolve),i=[],s=0,o=1;op(e,(function(e){var d=s++,u=!1;o++,Qf(n,t,e).then((function(e){u||(u=!0,i[d]=e,--o||r(i))}),a)})),--o||r(i)}));return i.error&&a(i.value),n.promise},race:function(e){var t=this,n=Ip(t),r=n.reject,a=mp((function(){var a=np(t.resolve);op(e,(function(e){Qf(a,t,e).then(n.resolve,r)}))}));return a.error&&r(a.value),n.promise}});var Kp=Ri,$p=B,Qp=Te,Yp=Or,Jp=Qe,Xp=ie,Zp=Sr,em=ud,tm=Jr,nm=Xo,rm=Re,am=Fe("isConcatSpreadable"),im=$p.TypeError,sm=rm>=51||!Qp((function(){var e=[];return e[am]=!1,e.concat()[0]!==e})),om=nm("concat"),dm=function(e){if(!Jp(e))return!1;var t=e[am];return void 0!==t?!!t:Yp(e)};Kp({target:"Array",proto:!0,forced:!sm||!om},{concat:function(e){var t,n,r,a,i,s=Xp(this),o=tm(s,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(dm(i=-1===t?s:arguments[t])){if(d+(a=Zp(i))>9007199254740991)throw im("Maximum allowed index exceeded");for(n=0;n<a;n++,d++)n in i&&em(o,d,i[n])}else{if(d>=9007199254740991)throw im("Maximum allowed index exceeded");em(o,d++,i)}return o.length=d,o}});var um=ze,cm=Ln.EXISTS,lm=ee,hm=Ke.f,fm=Function.prototype,pm=lm(fm.toString),mm=/^\s*function ([^ (]*)/,gm=lm(mm.exec);function vm(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ym(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ym(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}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 i,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function ym(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bm(Object(n),!0).forEach((function(t){T.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}um&&!cm&&hm(fm,"name",{configurable:!0,get:function(){try{return gm(mm,pm(this))[1]}catch(e){return""}}});var wm,Am={react:{src:"https://pm.gamedistribution.com/react/16.14.0/umd/react.production.min.js",name:"React"},"react-dom":{src:"https://pm.gamedistribution.com/react-dom/16.14.0/umd/react-dom.production.min.js",name:"ReactDOM"},redux:{src:"https://pm.gamedistribution.com/redux/4.0.5/dist/redux.min.js",name:"Redux"},"react-redux":{src:"https://pm.gamedistribution.com/react-redux/7.2.1/dist/react-redux.min.js",name:"ReactRedux"},"material-ui-core":{src:"https://pm.gamedistribution.com/@material-ui/core/4.11.3/umd/material-ui.production.min.js",name:"MaterialUI"}},km={},Em=function(e,t){km[e]=_m(_m({},t),{},{isLoading:!1})},xm=function(e){var t=this,n=e.id,r=e.src;return new Promise(function(e,a){if(k.default(this,t),document.getElementById(n))e();else{var i=document.createElement("script");i.onload=function(){e()},i.id=n,i.setAttribute("crossorigin",!0),i.src=r,document.head.appendChild(i)}}.bind(this))},Rm=function(){var e=A.default(x.default.mark((function e(t){var n,r,a,i,s,o,d,u;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=window[t])){e.next=3;break}return e.abrupt("return",n);case 3:if(!(r=km[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:r.isLoading=!0,a=vm(r.dependencies),e.prev=8,a.s();case 10:if((i=a.n()).done){e.next=26;break}if(s=i.value,e.prev=12,o=Am[s].name,!window[o]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,xm({id:s,src:Am[s].src});case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),d=s.id,u=s.src,console.log("Could not load external script ".concat(d," ").concat(u),e.t0);case 24:e.next=10;break;case 26:e.next=31;break;case 28:e.prev=28,e.t1=e.catch(8),a.e(e.t1);case 31:return e.prev=31,a.f(),e.finish(31);case 34:return e.prev=34,e.next=37,xm({id:t,src:r.source});case 37:n=window[t],e.next=43;break;case 40:e.prev=40,e.t2=e.catch(34),console.log("Could not load module ".concat(t," ").concat(r.source,"."),e.t2);case 43:return r.isLoading=!1,e.abrupt("return",n);case 45:case"end":return e.stop()}}),e,null,[[8,28,31,34],[12,20],[34,40]])})));return function(t){return e.apply(this,arguments)}}(),Tm=new function e(){var t=this;R.default(this,e),T.default(this,"load",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rm("Leaderboard");case 2:t.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),T.default(this,"showLeaderboard",function(){var e=A.default(x.default.mark((function e(n){var r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=window.GD_OPTIONS.gameId,t.leaderboard){e.next=4;break}return e.next=4,t.load();case 4:t.leaderboard.showLeaderBoard(r,n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),T.default(this,"addScore",function(){var e=A.default(x.default.mark((function e(n){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.leaderboard){e.next=3;break}return e.next=3,t.load();case 3:t.leaderboard.addScore(n);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.moduleName="Leaderboard",this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/gd-sdk-leaderboard/0.1.43/dist/default/iife/index.js",dependencies:["react","react-dom","redux","react-redux","material-ui-core"]},Em(this.moduleName,this.moduleConfig)},Sm=Qe,Dm=$n,Om=Fe("match"),Im=function(e){var t;return Sm(e)&&(void 0!==(t=e[Om])?!!t:"RegExp"==Dm(e))},Pm=Im,Cm=B.TypeError,Lm=function(e){if(Pm(e))throw Cm("The method doesn't accept regular expressions");return e},Um=Fe("match"),jm=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Um]=!1,"/./"[e](t)}catch(e){}}return!1},Mm=Ri,Gm=ee,Nm=ga.f,Bm=Rr,qm=$i,Fm=Lm,Vm=ne,Wm=jm,Hm=Gm("".startsWith),zm=Gm("".slice),Km=Math.min,$m=Wm("startsWith");Mm({target:"String",proto:!0,forced:!!($m||(wm=Nm(String.prototype,"startsWith"),!wm||wm.writable))&&!$m},{startsWith:function(e){var t=qm(Vm(this));Fm(e);var n=Bm(Km(arguments.length>1?arguments[1]:void 0,t.length)),r=qm(e);return Hm?Hm(t,r,n):zm(t,n,n+r.length)===r}});var Qm=ee,Ym=Ln.PROPER,Jm=He.exports,Xm=st,Zm=ut,eg=$i,tg=Te,ng=Ic,rg=RegExp.prototype,ag=rg.toString,ig=Qm(ng),sg=tg((function(){return"/a/b"!=ag.call({source:"a",flags:"b"})})),og=Ym&&"toString"!=ag.name;(sg||og)&&Jm(RegExp.prototype,"toString",(function(){var e=Xm(this),t=eg(e.source),n=e.flags;return"/"+t+"/"+eg(void 0===n&&Zm(rg,e)&&!("flags"in rg)?ig(e):n)}),{unsafe:!0});var dg=ee,ug=He.exports,cg=ol,lg=Te,hg=Fe,fg=$t,pg=hg("species"),mg=RegExp.prototype,gg=function(e,t,n,r){var a=hg(e),i=!lg((function(){var t={};return t[a]=function(){return 7},7!=""[e](t)})),s=i&&!lg((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[pg]=function(){return n},n.flags="",n[a]=/./[a]),n.exec=function(){return t=!0,null},n[a](""),!t}));if(!i||!s||n){var o=dg(/./[a]),d=t(a,""[e],(function(e,t,n,r,a){var s=dg(e),d=t.exec;return d===cg||d===mg.exec?i&&!a?{done:!0,value:o(t,n,r)}:{done:!0,value:s(n,t,r)}:{done:!1}}));ug(String.prototype,e,d[0]),ug(mg,a,d[1])}r&&fg(mg[a],"sham",!0)},vg=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},yg=dt,bg=st,_g=pe,wg=$n,Ag=ol,kg=B.TypeError,Eg=function(e,t){var n=e.exec;if(_g(n)){var r=yg(n,e,t);return null!==r&&bg(r),r}if("RegExp"===wg(e))return yg(Ag,e,t);throw kg("RegExp#exec called on incompatible receiver")},xg=dt,Rg=st,Tg=ne,Sg=vg,Dg=$i,Og=kt,Ig=Eg;function Pg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pg(Object(n),!0).forEach((function(t){T.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}gg("search",(function(e,t,n){return[function(t){var n=Tg(this),r=null==t?void 0:Og(t,e);return r?xg(r,t,n):new RegExp(t)[e](Dg(n))},function(e){var r=Rg(this),a=Dg(e),i=n(t,r,a);if(i.done)return i.value;var s=r.lastIndex;Sg(s,0)||(r.lastIndex=0);var o=Ig(r,a);return Sg(r.lastIndex,s)||(r.lastIndex=s),null===o?-1:o.index}]}));var Lg,Ug,jg=function(){function e(){R.default(this,e)}return S.default(e,[{key:"getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var i=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:a.getParentUrl()),s=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:a.getParentDomain()),o=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===a.getIframeDepth()?s:a.getTopDomain()),d=(e||n)&&r.loaderEnabled,u=(e||n)&&r.loaderEnabled,c=(e||n)&&r.loaderEnabled,l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:d,noLoadedEvent:u,noBlockerEvent:c,noPreroll:m,parentURL:i,parentDomain:s,topDomain:o&&o.length?o:s,noGAPageView:l,noLotamePageView:h,noGamedockSDK:f,noMinijuegosSDK:p,version:r.version,pauseGameOnStartup:g,depth:a.getIframeDepth(),domainMatched:s===o,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 n=new D.default(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new D.default(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var a=new D.default(location.href,!0);if(!a.query.gd_zone_config)return;e=a.query.gd_zone_config}return JSON.parse(u.Base64.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(u.Base64.encode(JSON.stringify(e)))}catch(e){}try{var n=new D.default(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(qs.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new D.default(e,!0);return n.query=Cg(Cg({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return u.Base64.encode(JSON.stringify(e))}}]),e}(),Mg=function(){try{return(new jg).getBridgeContext()}catch(e){return{}}}(),Gg={userDeclinedTracking:document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0,whitelabelPartner:(Lg=!1,(Ug=a.getQueryParams("xanthophyll")).hasOwnProperty("xanthophyll")&&"true"===Ug.xanthophyll&&(Lg=!0),Lg)},Ng=Ru.charAt,Bg=function(e,t,n){return t+(n?Ng(e,t).length:1)},qg=ee,Fg=ie,Vg=Math.floor,Wg=qg("".charAt),Hg=qg("".replace),zg=qg("".slice),Kg=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,$g=/\$([$&'`]|\d{1,2})/g,Qg=Hi,Yg=dt,Jg=ee,Xg=gg,Zg=Te,ev=st,tv=pe,nv=kr,rv=Rr,av=$i,iv=ne,sv=Bg,ov=kt,dv=function(e,t,n,r,a,i){var s=n+e.length,o=r.length,d=$g;return void 0!==a&&(a=Fg(a),d=Kg),Hg(i,d,(function(i,d){var u;switch(Wg(d,0)){case"$":return"$";case"&":return e;case"`":return zg(t,0,n);case"'":return zg(t,s);case"<":u=a[zg(d,1,-1)];break;default:var c=+d;if(0===c)return i;if(c>o){var l=Vg(c/10);return 0===l?i:l<=o?void 0===r[l-1]?Wg(d,1):r[l-1]+Wg(d,1):i}u=r[c-1]}return void 0===u?"":u}))},uv=Eg,cv=Fe("replace"),lv=Math.max,hv=Math.min,fv=Jg([].concat),pv=Jg([].push),mv=Jg("".indexOf),gv=Jg("".slice),vv="$0"==="a".replace(/./,"$0"),yv=!!/./[cv]&&""===/./[cv]("a","$0");Xg("replace",(function(e,t,n){var r=yv?"$":"$0";return[function(e,n){var r=iv(this),a=null==e?void 0:ov(e,cv);return a?Yg(a,e,r,n):Yg(t,av(r),e,n)},function(e,a){var i=ev(this),s=av(e);if("string"==typeof a&&-1===mv(a,r)&&-1===mv(a,"$<")){var o=n(t,i,s,a);if(o.done)return o.value}var d=tv(a);d||(a=av(a));var u=i.global;if(u){var c=i.unicode;i.lastIndex=0}for(var l=[];;){var h=uv(i,s);if(null===h)break;if(pv(l,h),!u)break;""===av(h[0])&&(i.lastIndex=sv(s,rv(i.lastIndex),c))}for(var f,p="",m=0,g=0;g<l.length;g++){for(var v=av((h=l[g])[0]),y=lv(hv(nv(h.index),s.length),0),b=[],_=1;_<h.length;_++)pv(b,void 0===(f=h[_])?f:String(f));var w=h.groups;if(d){var A=fv([v],b,y,s);void 0!==w&&pv(A,w);var k=av(Qg(a,void 0,A))}else k=dv(v,s,y,b,w,a);y>=m&&(p+=gv(s,m,y)+k,m=y+v.length)}return p+gv(s,m)}]}),!!Zg((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!vv||yv);var bv=Te,_v=Fe("iterator"),wv=!bv((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[_v]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),Av=ps,kv=Math.floor,Ev=function(e,t){var n=e.length,r=kv(n/2);return n<8?xv(e,t):Rv(e,Ev(Av(e,0,r),t),Ev(Av(e,r),t),t)},xv=function(e,t){for(var n,r,a=e.length,i=1;i<a;){for(r=i,n=e[i];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==i++&&(e[r]=n)}return e},Rv=function(e,t,n,r){for(var a=t.length,i=n.length,s=0,o=0;s<a||o<i;)e[s+o]=s<a&&o<i?r(t[s],n[o])<=0?t[s++]:n[o++]:s<a?t[s++]:n[o++];return e},Tv=Ev,Sv=Ri,Dv=B,Ov=ye,Iv=dt,Pv=ee,Cv=wv,Lv=He.exports,Uv=ah,jv=Os,Mv=Ju,Gv=Sn,Nv=hh,Bv=pe,qv=de,Fv=pr,Vv=nr,Wv=st,Hv=Qe,zv=$i,Kv=hs,$v=Ht,Qv=Jd,Yv=Wd,Jv=Tv,Xv=Fe("iterator"),Zv=Gv.set,ey=Gv.getterFor("URLSearchParams"),ty=Gv.getterFor("URLSearchParamsIterator"),ny=Ov("fetch"),ry=Ov("Request"),ay=Ov("Headers"),iy=ry&&ry.prototype,sy=ay&&ay.prototype,oy=Dv.RegExp,dy=Dv.TypeError,uy=Dv.decodeURIComponent,cy=Dv.encodeURIComponent,ly=Pv("".charAt),hy=Pv([].join),fy=Pv([].push),py=Pv("".replace),my=Pv([].shift),gy=Pv([].splice),vy=Pv("".split),yy=Pv("".slice),by=/\+/g,_y=Array(4),wy=function(e){return _y[e-1]||(_y[e-1]=oy("((?:%[\\da-f]{2}){"+e+"})","gi"))},Ay=function(e){try{return uy(e)}catch(t){return e}},ky=function(e){var t=py(e,by," "),n=4;try{return uy(t)}catch(e){for(;n;)t=py(t,wy(n--),Ay);return t}},Ey=/[!'()~]|%20/g,xy={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Ry=function(e){return xy[e]},Ty=function(e){return py(cy(e),Ey,Ry)},Sy=function(e,t){if(t)for(var n,r,a=vy(t,"&"),i=0;i<a.length;)(n=a[i++]).length&&(r=vy(n,"="),fy(e,{key:ky(my(r)),value:ky(hy(r,"="))}))},Dy=function(e){this.entries.length=0,Sy(this.entries,e)},Oy=function(e,t){if(e<t)throw dy("Not enough arguments")},Iy=Mv((function(e,t){Zv(this,{type:"URLSearchParamsIterator",iterator:Qv(ey(e).entries),kind:t})}),"Iterator",(function(){var e=ty(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),Py=function(){Nv(this,Cy);var e,t,n,r,a,i,s,o,d,u=arguments.length>0?arguments[0]:void 0,c=this,l=[];if(Zv(c,{type:"URLSearchParams",entries:l,updateURL:function(){},updateSearchParams:Dy}),void 0!==u)if(Hv(u))if(e=Yv(u))for(n=(t=Qv(u,e)).next;!(r=Iv(n,t)).done;){if(i=(a=Qv(Wv(r.value))).next,(s=Iv(i,a)).done||(o=Iv(i,a)).done||!Iv(i,a).done)throw dy("Expected sequence with length 2");fy(l,{key:zv(s.value),value:zv(o.value)})}else for(d in u)qv(u,d)&&fy(l,{key:d,value:zv(u[d])});else Sy(l,"string"==typeof u?"?"===ly(u,0)?yy(u,1):u:zv(u))},Cy=Py.prototype;if(Uv(Cy,{append:function(e,t){Oy(arguments.length,2);var n=ey(this);fy(n.entries,{key:zv(e),value:zv(t)}),n.updateURL()},delete:function(e){Oy(arguments.length,1);for(var t=ey(this),n=t.entries,r=zv(e),a=0;a<n.length;)n[a].key===r?gy(n,a,1):a++;t.updateURL()},get:function(e){Oy(arguments.length,1);for(var t=ey(this).entries,n=zv(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){Oy(arguments.length,1);for(var t=ey(this).entries,n=zv(e),r=[],a=0;a<t.length;a++)t[a].key===n&&fy(r,t[a].value);return r},has:function(e){Oy(arguments.length,1);for(var t=ey(this).entries,n=zv(e),r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){Oy(arguments.length,1);for(var n,r=ey(this),a=r.entries,i=!1,s=zv(e),o=zv(t),d=0;d<a.length;d++)(n=a[d]).key===s&&(i?gy(a,d--,1):(i=!0,n.value=o));i||fy(a,{key:s,value:o}),r.updateURL()},sort:function(){var e=ey(this);Jv(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=ey(this).entries,r=Fv(e,arguments.length>1?arguments[1]:void 0),a=0;a<n.length;)r((t=n[a++]).value,t.key,this)},keys:function(){return new Iy(this,"keys")},values:function(){return new Iy(this,"values")},entries:function(){return new Iy(this,"entries")}},{enumerable:!0}),Lv(Cy,Xv,Cy.entries,{name:"entries"}),Lv(Cy,"toString",(function(){for(var e,t=ey(this).entries,n=[],r=0;r<t.length;)e=t[r++],fy(n,Ty(e.key)+"="+Ty(e.value));return hy(n,"&")}),{enumerable:!0}),jv(Py,"URLSearchParams"),Sv({global:!0,forced:!Cv},{URLSearchParams:Py}),!Cv&&Bv(ay)){var Ly=Pv(sy.has),Uy=Pv(sy.set),jy=function(e){if(Hv(e)){var t,n=e.body;if("URLSearchParams"===Vv(n))return t=e.headers?new ay(e.headers):new ay,Ly(t,"content-type")||Uy(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Kv(e,{body:$v(0,zv(n)),headers:$v(0,t)})}return e};if(Bv(ny)&&Sv({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return ny(e,arguments.length>1?jy(arguments[1]):{})}}),Bv(ry)){var My=function(e){return Nv(this,iy),new ry(e,arguments.length>1?jy(arguments[1]):{})};iy.constructor=My,My.prototype=iy,Sv({global:!0,forced:!0},{Request:My})}}var Gy=Fa.includes,Ny=Pl;Ri({target:"Array",proto:!0},{includes:function(e){return Gy(this,e,arguments.length>1?arguments[1]:void 0)}}),Ny("includes");var By=Ri,qy=Lm,Fy=ne,Vy=$i,Wy=jm,Hy=ee("".indexOf);By({target:"String",proto:!0,forced:!Wy("includes")},{includes:function(e){return!!~Hy(Vy(Fy(this)),Vy(qy(e)),arguments.length>1?arguments[1]:void 0)}});var zy=Hi,Ky=dt,$y=ee,Qy=gg,Yy=Im,Jy=st,Xy=ne,Zy=Ph,eb=Bg,tb=Rr,nb=$i,rb=kt,ab=ps,ib=Eg,sb=ol,ob=Te,db=Pc.UNSUPPORTED_Y,ub=Math.min,cb=[].push,lb=$y(/./.exec),hb=$y(cb),fb=$y("".slice);function pb(e){var t=this,n={},r=(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 o(e){return P.default(n,e)}function d(e,t){return C.default(n,e,t)}function u(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new D.default(e,t)}catch(e){console.log(e)}}function c(){for(var t=(null==e?void 0:e.urls)||[a,s],n=0;n<t.length;n++){var r,i=u(t[n]);if(i){var o=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(o&&(o=decodeURIComponent(o),O.default.isURL(o)))return o}}}return function(){var e;k.default(this,t),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){d("depth.error",e.message)}d("depth.value",e)}(),function(){var e=r,t=n.depth.value,a=i;if(d("top.domain.from","fallback"),e&&e.length>0)a=e[e.length-1],d("top.domain.from","origins");else if(0===t)a=i,d("top.domain.from","self-top");else if(1===t){var o=u(s);o&&(a=o.origin,d("top.domain.from","referrer"))}d("top.domain.value",a.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=c();if(e)if(I.default(e))d("partner.domain.value",e),d("partner.domain.from","partner-domain");else{var t=u(e,!1);if(t)d("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),d("partner.domain.from","partner-url");else d("partner.domain.value",n.top.domain.value),d("partner.domain.from","partner-fallback")}else d("partner.domain.value",n.top.domain.value),d("partner.domain.from","fallback")}(),e=c(),0===n.depth.value?(d("partner.url.value",a),d("partner.url.from","self-top")):e?I.default(e)?(d("partner.url.value",a),d("partner.url.from","partner-domain")):(d("partner.url.value",e),d("partner.url.from","partner-url")):(d("partner.url.value",s),d("partner.url.from","fallback"))}.bind(this)(),{get:o,print:function(e){console.log(o(e))}}}Qy("split",(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=nb(Xy(this)),a=void 0===n?4294967295:n>>>0;if(0===a)return[];if(void 0===e)return[r];if(!Yy(e))return Ky(t,r,e,a);for(var i,s,o,d=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),c=0,l=new RegExp(e.source,u+"g");(i=Ky(sb,l,r))&&!((s=l.lastIndex)>c&&(hb(d,fb(r,c,i.index)),i.length>1&&i.index<r.length&&zy(cb,d,ab(i,1)),o=i[0].length,c=s,d.length>=a));)l.lastIndex===i.index&&l.lastIndex++;return c===r.length?!o&&lb(l,"")||hb(d,""):hb(d,fb(r,c)),d.length>a?ab(d,0,a):d}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:Ky(t,this,e,n)}:t,[function(t,n){var a=Xy(this),i=null==t?void 0:rb(t,e);return i?Ky(i,t,a,n):Ky(r,nb(a),t,n)},function(e,a){var i=Jy(this),s=nb(e),o=n(r,i,s,a,r!==t);if(o.done)return o.value;var d=Zy(i,RegExp),u=i.unicode,c=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(db?"g":"y"),l=new d(db?"^(?:"+i.source+")":i,c),h=void 0===a?4294967295:a>>>0;if(0===h)return[];if(0===s.length)return null===ib(l,s)?[s]:[];for(var f=0,p=0,m=[];p<s.length;){l.lastIndex=db?0:p;var g,v=ib(l,db?fb(s,p):s);if(null===v||(g=ub(tb(l.lastIndex+(db?p:0)),s.length))===f)p=eb(s,p,u);else{if(hb(m,fb(s,f,p)),m.length===h)return m;for(var y=1;y<=v.length-1;y++)if(hb(m,v[y]),m.length===h)return m;p=f=g}}return hb(m,fb(s,f)),m}]}),!!ob((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),db);var mb="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==mb&&mb,gb="URLSearchParams"in mb,vb="Symbol"in mb&&"iterator"in Symbol,yb="FileReader"in mb&&"Blob"in mb&&function(){try{return new Blob,!0}catch(e){return!1}}(),bb="FormData"in mb,_b="ArrayBuffer"in mb;if(_b)var wb=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Ab=ArrayBuffer.isView||function(e){return e&&wb.indexOf(Object.prototype.toString.call(e))>-1};function kb(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Eb(e){return"string"!=typeof e&&(e=String(e)),e}function xb(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return vb&&(t[Symbol.iterator]=function(){return t}),t}function Rb(e){this.map={},e instanceof Rb?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function Tb(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Sb(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function Db(e){var t=new FileReader,n=Sb(t);return t.readAsArrayBuffer(e),n}function Ob(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Ib(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:yb&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:bb&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:gb&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():_b&&yb&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=Ob(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):_b&&(ArrayBuffer.prototype.isPrototypeOf(e)||Ab(e))?this._bodyArrayBuffer=Ob(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):gb&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},yb&&(this.blob=function(){var e=Tb(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=Tb(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(Db)}),this.text=function(){var e=Tb(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=Sb(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},bb&&(this.formData=function(){return this.text().then(Lb)}),this.json=function(){return this.text().then(JSON.parse)},this}Rb.prototype.append=function(e,t){e=kb(e),t=Eb(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},Rb.prototype.delete=function(e){delete this.map[kb(e)]},Rb.prototype.get=function(e){return e=kb(e),this.has(e)?this.map[e]:null},Rb.prototype.has=function(e){return this.map.hasOwnProperty(kb(e))},Rb.prototype.set=function(e,t){this.map[kb(e)]=Eb(t)},Rb.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},Rb.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),xb(e)},Rb.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),xb(e)},Rb.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),xb(e)},vb&&(Rb.prototype[Symbol.iterator]=Rb.prototype.entries);var Pb=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Cb(e,t){if(!(this instanceof Cb))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(t=t||{}).body;if(e instanceof Cb){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Rb(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new Rb(t.headers)),this.method=function(e){var t=e.toUpperCase();return Pb.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Lb(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(a))}})),t}function Ub(e,t){if(!(this instanceof Ub))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new Rb(t.headers),this.url=t.url||"",this._initBody(e)}Cb.prototype.clone=function(){return new Cb(this,{body:this._bodyInit})},Ib.call(Cb.prototype),Ib.call(Ub.prototype),Ub.prototype.clone=function(){return new Ub(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Rb(this.headers),url:this.url})},Ub.error=function(){var e=new Ub(null,{status:0,statusText:""});return e.type="error",e};var jb=[301,302,303,307,308];Ub.redirect=function(e,t){if(-1===jb.indexOf(t))throw new RangeError("Invalid status code");return new Ub(null,{status:t,headers:{location:e}})};var Mb,Gb=mb.DOMException;try{new Gb}catch(e){Gb=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},Gb.prototype=Object.create(Error.prototype),Gb.prototype.constructor=Gb}function Nb(e,t){return new Promise((function(n,r){var a=new Cb(e,t);if(a.signal&&a.signal.aborted)return r(new Gb("Aborted","AbortError"));var i=new XMLHttpRequest;function s(){i.abort()}i.onload=function(){var e,t,r={status:i.status,statusText:i.statusText,headers:(e=i.getAllResponseHeaders()||"",t=new Rb,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var a=n.join(":").trim();t.append(r,a)}})),t)};r.url="responseURL"in i?i.responseURL:r.headers.get("X-Request-URL");var a="response"in i?i.response:i.responseText;setTimeout((function(){n(new Ub(a,r))}),0)},i.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},i.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},i.onabort=function(){setTimeout((function(){r(new Gb("Aborted","AbortError"))}),0)},i.open(a.method,function(e){try{return""===e&&mb.location.href?mb.location.href:e}catch(t){return e}}(a.url),!0),"include"===a.credentials?i.withCredentials=!0:"omit"===a.credentials&&(i.withCredentials=!1),"responseType"in i&&(yb?i.responseType="blob":_b&&a.headers.get("Content-Type")&&-1!==a.headers.get("Content-Type").indexOf("application/octet-stream")&&(i.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof Rb?a.headers.forEach((function(e,t){i.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){i.setRequestHeader(e,Eb(t.headers[e]))})),a.signal&&(a.signal.addEventListener("abort",s),i.onreadystatechange=function(){4===i.readyState&&a.signal.removeEventListener("abort",s)}),i.send(void 0===a._bodyInit?null:a._bodyInit)}))}Nb.polyfill=!0,mb.fetch||(mb.fetch=Nb,mb.Headers=Rb,mb.Request=Cb,mb.Response=Ub);var Bb,qb=function(e){var t=this;if(!Mb){var n={gameId:e.gameId,hours:(new Date).getHours(),topDomain:Mg.topDomain,domain:Mg.parentDomain,referrer:Mg.parentURL,depth:a.getIframeDepth(),version:Ui.version,byloader:Mg.isTokenGameURL,isTokenGameURL:Mg.isTokenGameURL,isMasterGameURL:Mg.isMasterGameURL,isExtHostedGameURL:Mg.isExtHostedGameURL,byloaderVersion:Mg.version,tracking:Gg.userDeclinedTracking,whitelabel:Gg.whitelabelPartner,platform:a.getMobilePlatform()};Mb=new a.MessageRouter(n)}return Mb||{send:function(){k.default(this,t)}.bind(this)}};var Fb,Vb,Wb=[],Hb=function(e){Wb.push(e)},zb=function(){var e=A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Fb){e.next=4;break}return e.next=3,Kb(Vb);case 3:Fb=e.sent;case 4:return e.abrupt("return",Fb);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Kb=function(e){var t=this;Bb.send("gdfw.loading",{message:"loading"}),Wb=[],Hb("1"),Hb("2");var n=new pb;Hb("3");var r=n.get("partner.domain.value");Hb("4");var i=function(){return k.default(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);Hb("5");var s=function(){k.default(this,t);var n=o(),a=n?"&mode=".concat(n):"";return"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(r).concat(a,"&v=").concat(Ui.version,"&localTime=").concat((new Date).getHours())}.bind(this);Hb("6");var o=function(){var e=this;k.default(this,t);var n=new Proxy(new URLSearchParams(window.location.search),{get:function(t,n){return k.default(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 Hb("7"),new Promise(function(e){var n=this;if(k.default(this,t),Fb)e(Fb);else{Hb("7.1");var r=i();try{Hb("7.2");var o=s();Hb("7.3"),fetch(o).then(function(e){return k.default(this,n),Hb("7.4"),e.json()}.bind(this)).then(function(t){var i=this;if(k.default(this,n),Hb("7.5"),t.success){var s,o,d,u,c=t.result.game;Hb("7.6");var l={gameId:c.gameMd5,slug:c.slug,pname:c.pname,dname:c.dname,status:c.status,description:c.description,enableAds:!0===c.enableAds||!0===(null===(s=c.enableAds)||void 0===s?void 0:s.enabled),preroll:c.preRoll,midroll:6e4*c.timeAds,rewardedAds:c.rewardedAds,title:c.title,tags:c.tags,category:c.category,assets:c.assets,disp_2nd_prer:c.disp_2nd_prer,ctry_vst:c.ctry_vst,ctry:c.ctry,crtv:c.crtv,dmain:c.dmain,__t4r:ji(c.__t4r)||{},block_exts:ji(c.push_cuda),bloc_gard:ji(c.bloc_gard),cookie:ji(c.cookie),gdpr:ji(c.gdpr),diagnostic:ji(c.diagnostic),cmp:ji(c.cmp),gft:ji(c.gft)||{},sdk:ji(c.sdk)||{},sdkfw:ji(c.sdkfw)||{},loader:ji(c.loader)||{},splash:ji(c.splash)||{},promo:ji(c.promo)||{},dAds:ji(c.dads)||{},pAds:ji(c.pads)||{},mAds:ji(c.mads)||{},rAds:ji(c.rads)||{},lp:ji(c.lp)||{},extsc:ji(c.extsc)||{},evnts:ji(c.evnts)||{},dp:ji(c.dp)||{},adflw:ji(c.adflw)||{}};Hb("7.7");var h=a.extendDefaults(L.default(r),l);Hb("7.8"),h.afg_disabled=!1===(null===(o=h.sdk)||void 0===o||null===(d=o.afg)||void 0===d?void 0:d.enabled),function(){k.default(this,i)}.bind(this),Hb("7.9"),null!==(u=h.pAds)&&void 0!==u&&u.enabled&&(h.preroll=!0),Hb("7.10"),Bb.send("gdfw.success",{message:"success"}),e(h)}else{r.failed=!0;var f=Wb[Wb.length-1];Bb.send("gdfw.err",{message:"".concat(f,": json error")}),e(r)}}.bind(this)).catch(function(t){k.default(this,n);var a=Wb[Wb.length-1];Bb.send("gdfw.err",{message:"".concat(a,": ").concat(t.message?t.message:t)}),r.failed=!0,e(r)}.bind(this))}catch(t){var d=Wb[Wb.length-1];Bb.send("gdfw.err",{message:"".concat(d,": global ").concat(t.message?t.message:t)}),r.failed=!0,e(r)}}}.bind(this))},$b=function(){var e=A.default(x.default.mark((function e(){var t,n;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,zb();case 2:return n=e.sent,e.abrupt("return",!(null==n||null===(t=n.sdkfw)||void 0===t||!t.enabled));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Qb=function(){var e=A.default(x.default.mark((function e(){var t,n;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,zb();case 2:return n=e.sent,e.next=5,$b();case 5:if(e.t0=e.sent,!e.t0){e.next=8;break}e.t0=!(null==n||null===(t=n.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)}}(),Yb=function(){var e=A.default(x.default.mark((function e(){var t,n,r,a,i,s,o,d;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,zb();case 2:return o=e.sent,d=!(null==o||null===(t=o.extsc)||void 0===t||!t.enabled),e.abrupt("return",{enabled:d,path:d?null==o||null===(n=o.extsc)||void 0===n?void 0:n.path:"",name:d?null==o||null===(r=o.extsc)||void 0===r?void 0:r.name:"",ref:d?null==o||null===(a=o.extsc)||void 0===a?void 0:a.ref:"",loadedFlag:d?null==o||null===(i=o.extsc)||void 0===i?void 0:i.loadedFlag:void 0,loadedFlagCheck:!!d&&!(null==o||null===(s=o.extsc)||void 0===s||!s.loadedFlagCheck)});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Jb=function(){var e=A.default(x.default.mark((function e(){var t,n,r,i,s,o=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Yb();case 2:if((t=e.sent).enabled){e.next=5;break}return e.abrupt("return");case 5:return n=t.path,r=t.name,i=t.ref,e.prev=6,s={},e.next=10,a.getScript(n,r,{error_prefix:"Blocked:",exists:function(){return k.default(this,o),!!i&&!!window[i]}.bind(this),attrs:s});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",r,e.t0),a.dankLog("DEVELOPER_ERROR",e.t0,"warning");case 16:case"end":return e.stop()}}),e,this,[[6,12]])})));return function(){return e.apply(this,arguments)}}(),Xb=!1,Zb=!1,e_=function(){return new Promise(function(){var e=A.default(x.default.mark((function e(t,n){var r,a,i,s,o,d=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Xb){e.next=4;break}return e.abrupt("return",t(Zb));case 4:Xb=!0;case 5:return e.next=7,Yb();case 7:if((r=e.sent).enabled){e.next=10;break}return e.abrupt("return",t(!1));case 10:if(a=r.loadedFlag,!(i=r.loadedFlagCheck)||a){e.next=13;break}return e.abrupt("return",t(!1));case 13:if(i){e.next=16;break}return Zb=!0,e.abrupt("return",t(!0));case 16:s=!0,setTimeout(function(){k.default(this,d),s&&(s=!1,Xb=!0,t(!1))}.bind(this),5e3),o=setInterval(function(){k.default(this,d),s&&i&&window[a]?(s=!1,Xb=!0,Zb=!0,clearInterval(o),t(!0)):s||clearInterval(o)}.bind(this),100);case 19:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}())},t_=function(e){var t=function(e){var t=this,n=function(e){return k.default(this,t),l("showAd",{adType:e})}.bind(this),r=function(e){return k.default(this,t),l("preloadAd",{adType:e})}.bind(this),a=function(e){return k.default(this,t),l("showDisplayAd",{options:e})}.bind(this),i=function(){return k.default(this,t),l("cancelAd")}.bind(this),s=function(){return k.default(this,t),l("openConsole")}.bind(this),o=function(){return k.default(this,t),l("showBanner")}.bind(this),d=function(){return k.default(this,t),l("session")}.bind(this),u=function(e){return k.default(this,t),l("sendGenericEvent",{options:e})}.bind(this),c=function(){k.default(this,t),console.log("_sendSDKReady")}.bind(this),l=function(e,n){var r=this;return k.default(this,t),n||(n={}),new Promise(function(t,a){k.default(this,r);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),h=function(){k.default(this,t),window.addEventListener("message",(function(e){var t=e.data;e.origin,e.source;var n=t.type,r=t.event;"gd-sdk-on-event"===n&&r&&p(r)}),!1)}.bind(this),f=function(){k.default(this,t),h(),l("init")}.bind(this),p=function(n){k.default(this,t),e.onEvent&&e.onEvent(n)}.bind(this);return{showBanner:o,showAd:n,preloadAd:r,showDisplayAd:a,cancelAd:i,openConsole:s,getSession:d,onEvent:p,init:f,_sendSDKReady:c,sendGenericEvent:u}}(e);return t.init(),t},n_=function(){var e=this;return{isMasterGameURL:function(){k.default(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)}.bind(this),isTokenGameURL:function(){k.default(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i.test(location.href)}.bind(this),isExtHostedGameURL:function(){k.default(this,e);return/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i.test(location.href)}.bind(this)}},r_=function(e){var t=this;return new Promise(function(n,r){var a=this;k.default(this,t);var i={type:"gd-sdk-frame-handshake-request"},s=!1;window.addEventListener("message",(function(e){var t=e.data,r=e.origin,a=e.source,i=t.type;if("gd-sdk-frame-handshake-request"===i){var o={type:"gd-sdk-frame-handshake-response"};a.postMessage(o,r)}else"gd-sdk-frame-handshake-response"===i&&(s=!0,n({origin:r,source:a}))})),e?n():(setTimeout(function(){k.default(this,a),s||n()}.bind(this),200),window.parent!==window?window.parent.postMessage(i,"*"):n())}.bind(this))},a_=function(){var e=A.default(x.default.mark((function e(){var t,n,r,a,i,s,o,d;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$b();case 2:return t=e.sent,n=!t,e.next=6,r_(n);case 6:if(r=e.sent,t){e.next=9;break}return e.abrupt("return",!1);case 9:return a=n_(),i=a.isMasterGameURL,s=i(),e.next=13,Qb();case 13:return o=e.sent,d=!1,d=o?!s&&!!r:!s,e.abrupt("return",d);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),i_=ze,s_=ee,o_=Di,d_=ka,u_=s_(va.f),c_=s_([].push),l_=function(e){return function(t){for(var n,r=d_(t),a=o_(r),i=a.length,s=0,o=[];i>s;)n=a[s++],i_&&!u_(r,n)||c_(o,e?[n,r[n]]:r[n]);return o}},h_={entries:l_(!0),values:l_(!1)}.values;Ri({target:"Object",stat:!0},{values:function(e){return h_(e)}});var f_=Ri,p_=nh,m_=Te,g_=ye,v_=pe,y_=Ph,b_=Vf,__=He.exports;if(f_({target:"Promise",proto:!0,real:!0,forced:!!p_&&m_((function(){p_.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=y_(this,g_("Promise")),n=v_(e);return this.then(n?function(n){return b_(t,e()).then((function(){return n}))}:e,n?function(n){return b_(t,e()).then((function(){throw n}))}:e)}}),v_(p_)){var w_=g_("Promise").prototype.finally;p_.prototype.finally!==w_&&__(p_.prototype,"finally",w_,{unsafe:!0})}var A_=ne,k_=$i,E_=ee("".replace),x_="[\t\n\v\f\r \u2028\u2029\ufeff]",R_=RegExp("^"+x_+x_+"*"),T_=RegExp(x_+x_+"*$"),S_=function(e){return function(t){var n=k_(A_(t));return 1&e&&(n=E_(n,R_,"")),2&e&&(n=E_(n,T_,"")),n}},D_={start:S_(1),end:S_(2),trim:S_(3)},O_=Ln.PROPER,I_=Te,P_="\t\n\v\f\r \u2028\u2029\ufeff",C_=D_.trim;Ri({target:"String",proto:!0,forced:function(e){return I_((function(){return!!P_[e]()||"
"!=="
"[e]()||O_&&P_[e].name!==e}))}("trim")},{trim:function(){return C_(this)}});var L_=pe,U_=Qe,j_=ic,M_=ze,G_=B,N_=ee,B_=yi,q_=function(e,t,n){var r,a;return j_&&L_(r=t.constructor)&&r!==n&&U_(a=r.prototype)&&a!==n.prototype&&j_(e,a),e},F_=$t,V_=Ke.f,W_=Ca.f,H_=ut,z_=Im,K_=$i,$_=Ic,Q_=Pc,Y_=He.exports,J_=Te,X_=de,Z_=Sn.enforce,ew=uh,tw=Mc,nw=Bc,rw=Fe("match"),aw=G_.RegExp,iw=aw.prototype,sw=G_.SyntaxError,ow=N_($_),dw=N_(iw.exec),uw=N_("".charAt),cw=N_("".replace),lw=N_("".indexOf),hw=N_("".slice),fw=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,pw=/a/g,mw=/a/g,gw=new aw(pw)!==pw,vw=Q_.UNSUPPORTED_Y,yw=M_&&(!gw||vw||tw||nw||J_((function(){return mw[rw]=!1,aw(pw)!=pw||aw(mw)==mw||"/a/i"!=aw(pw,"i")})));if(B_("RegExp",yw)){for(var bw=function(e,t){var n,r,a,i,s,o,d=H_(iw,this),u=z_(e),c=void 0===t,l=[],h=e;if(!d&&u&&c&&e.constructor===bw)return e;if((u||H_(iw,e))&&(e=e.source,c&&(t="flags"in h?h.flags:ow(h))),e=void 0===e?"":K_(e),t=void 0===t?"":K_(t),h=e,tw&&"dotAll"in pw&&(r=!!t&&lw(t,"s")>-1)&&(t=cw(t,/s/g,"")),n=t,vw&&"sticky"in pw&&(a=!!t&&lw(t,"y")>-1)&&(t=cw(t,/y/g,"")),nw&&(i=function(e){for(var t,n=e.length,r=0,a="",i=[],s={},o=!1,d=!1,u=0,c="";r<=n;r++){if("\\"===(t=uw(e,r)))t+=uw(e,++r);else if("]"===t)o=!1;else if(!o)switch(!0){case"["===t:o=!0;break;case"("===t:dw(fw,hw(e,r+1))&&(r+=2,d=!0),a+=t,u++;continue;case">"===t&&d:if(""===c||X_(s,c))throw new sw("Invalid capture group name");s[c]=!0,i[i.length]=[c,u],d=!1,c="";continue}d?c+=t:a+=t}return[a,i]}(e),e=i[0],l=i[1]),s=q_(aw(e,t),d?this:iw,bw),(r||a||l.length)&&(o=Z_(s),r&&(o.dotAll=!0,o.raw=bw(function(e){for(var t,n=e.length,r=0,a="",i=!1;r<=n;r++)"\\"!==(t=uw(e,r))?i||"."!==t?("["===t?i=!0:"]"===t&&(i=!1),a+=t):a+="[\\s\\S]":a+=t+uw(e,++r);return a}(e),n)),a&&(o.sticky=!0),l.length&&(o.groups=l)),e!==h)try{F_(s,"source",""===h?"(?:)":h)}catch(e){}return s},_w=function(e){e in bw||V_(bw,e,{configurable:!0,get:function(){return aw[e]},set:function(t){aw[e]=t}})},ww=W_(aw),Aw=0;ww.length>Aw;)_w(ww[Aw++]);iw.constructor=bw,bw.prototype=iw,Y_(G_,"RegExp",bw)}ew("RegExp");var kw=Ri,Ew=ia.find,xw=Pl,Rw=!0;"find"in[]&&Array(1).find((function(){Rw=!1})),kw({target:"Array",proto:!0,forced:Rw},{find:function(e){return Ew(this,e,arguments.length>1?arguments[1]:void 0)}}),xw("find");var Tw=Ri,Sw=_r,Dw=ka,Ow=oa,Iw=ee([].join),Pw=Sw!=Object,Cw=Ow("join",",");Tw({target:"Array",proto:!0,forced:Pw||!Cw},{join:function(e){return Iw(Dw(this),void 0===e?",":e)}});var Lw=ia.map;Ri({target:"Array",proto:!0,forced:!Xo("map")},{map:function(e){return Lw(this,e,arguments.length>1?arguments[1]:void 0)}});var Uw=ze,jw=ee,Mw=dt,Gw=Te,Nw=Di,Bw=Xa,qw=va,Fw=ie,Vw=_r,Ww=Object.assign,Hw=Object.defineProperty,zw=jw([].concat),Kw=!Ww||Gw((function(){if(Uw&&1!==Ww({b:1},Ww(Hw({},"a",{enumerable:!0,get:function(){Hw(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=Ww({},e)[n]||Nw(Ww({},t)).join("")!=r}))?function(e,t){for(var n=Fw(e),r=arguments.length,a=1,i=Bw.f,s=qw.f;r>a;)for(var o,d=Vw(arguments[a++]),u=i?zw(Nw(d),i(d)):Nw(d),c=u.length,l=0;c>l;)o=u[l++],Uw&&!Mw(s,d,o)||(n[o]=d[o]);return n}:Ww,$w=Kw;Ri({target:"Object",stat:!0,forced:Object.assign!==$w},{assign:$w});var Qw=function(){function e(t){R.default(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return S.default(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 n in e){var r=e[n];t[n]=r[Math.floor(Math.random()*r.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,r=new D.default(location.href,!0);for(var a in r.query)t[a]=r.query[a];return Object.keys(t).filter(function(t){var n=this;return k.default(this,e),this.customParamKeys.some(function(e){return k.default(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}(),Yw=function(){function e(t,n){R.default(this,e),this.adContainer=t,this.onResume=n}return S.default(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(){k.default(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,n){if(!document.getElementById(e)){var r=document.createElement("style");r.type="text/css",r.id=e,r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),t.appendChild(r)}}}]),e}(),Jw=function(e){if(!e)return!1;var t=Xw.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},Xw=Object.prototype.toString;function Zw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function eA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zw(Object(n),!0).forEach((function(t){T.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zw(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function tA(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()}function nA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nA(Object(n),!0).forEach((function(t){T.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var aA=new b.EventEmitter,iA=null,sA=function(){function e(t,n,r){var i=this;if(R.default(this,e),iA)return iA;iA=this;var s={debug:!1,width:640,height:360,locale:"en"};this.options=n?a.extendDefaults(s,n):s,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new a.EventBus,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=r.parentDomain,this.topDomain=r.topDomain,this.parentURL=r.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=a.getIMASampleTags(),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 o=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,d=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:o,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:d,this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){k.default(this,i),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){k.default(this,i),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var t,n,r,i,s,o,d,c,l,h,f,p,m,v,y,b,_,w,E,O,I;return S.default(e,[{key:"start",value:(I=A.default(x.default.mark((function e(){var t=this;return x.default.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){k.default(this,t),this._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 I.apply(this,arguments)})},{key:"_getAdVast",value:function(e,t){var n=this;return new Promise(function(){var r=A.default(x.default.mark((function r(i){var s,o,d,u,c,l,h,f,p=this;return x.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(a.Ls.available&&a.Ls.getBoolean("gd_debug_ex")&&a.Ls.getBoolean("gd_tag"))){r.next=6;break}return s=n.IMASampleTags[e],o=Math.floor(Math.random()*s.length),d=s[o],i({url:d}),r.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){r.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return r.prev=8,u=n.nextAdPosition(e),n._broadcast("AD_REQUEST",{message:u}),c=n.options,"preroll"===u&&g.isPlainObject(c.preroll)?c=c.preroll:"midroll"===u&&g.isPlainObject(c.midroll)?c=c.midroll:"rewarded"===u&&g.isPlainObject(c.rewarded)&&(c=c.rewarded),l="rewarded"===u?"rewardedVideo":"gdbanner"===u?"gd__banner":"midroll"===u?"midroll":"video1",r.next=16,window.idhb.isLoaded();case 16:if(h={tnl_keys:rA(rA({},window.idhb.getAdserverTargetingForAdSlot(l)),{},{tnl_ad_pos:u,tnl_asset_id:n.gameData.gameId})},!(t&&t.retry_on_success&&g.isPlainObject(c.retry_on_success)&&g.isPlainObject(c.retry_on_success.vast))){r.next=21;break}return r.abrupt("return",i(n._createCustomAdVastUrl(c.retry_on_success.vast,h)));case 21:if(!(t&&t.retry_on_failure&&n.options.retry_on_failure&&g.isPlainObject(c.retry_on_failure.vast))){r.next=25;break}return r.abrupt("return",i(n._createCustomAdVastUrl(c.retry_on_failure.vast,h)));case 25:if(!g.isPlainObject(c.vast)){r.next=27;break}return r.abrupt("return",i(n._createCustomAdVastUrl(c.vast,h)));case 27:return r.next=29,n._create_dp_context(u,t);case 29:f=r.sent,Gi("gd-adflow, before idhb",u,l),window.idhb.requestAds({slots:T.default({},l,{bidFloor:null!=f&&f.floor_price?f.floor_price:void 0}),callback:function(e,t){var r=this;k.default(this,p),!f||null!=t&&t.bidFloorApplied||fetch(f.skip_url).catch(function(e){k.default(this,r)}.bind(this)),i({tnl_keys:rA(rA({},window.idhb.getAdserverTargetingForAdSlot(l)),{},{tnl_ad_pos:u,tnl_asset_id:n.gameData.gameId}),url:e,dp:f,hl:t})}.bind(this)}),r.next=37;break;case 34:throw r.prev=34,r.t0=r.catch(8),new Error(r.t0);case 37:case"end":return r.stop()}}),r,this,[[8,34]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===a.AdType.Rewarded)return this.adRewardedCount++,"rewarded";if(e===a.AdType.Interstitial){var t=!1===this.gameData.preroll||1===this.adPrerollCount;return t?this.adMidrollCount++:this.adPrerollCount++,t||this.adMidrollCount>0?"midroll":"preroll"}return"midroll"}},{key:"getAdPosition",value:function(e){return e===a.AdType.Rewarded?"rewarded":e===a.AdType.Interstitial?!1===this.gameData.preroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_requestPromo",value:function(e,t){var n=new google.ima.AdsRequest;return n.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),n.linearAdSlotWidth=this.options.width,n.linearAdSlotHeight=this.options.height,n.nonLinearAdSlotWidth=this.options.width,n.nonLinearAdSlotHeight=this.options.height,n.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(n.vastLoadTimeout=this.options.vast_load_timeout),n.setAdWillAutoPlay(t.autoplayAllowed),n.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(n),n}},{key:"_requestAd",value:function(e,t){var n=this;return t=t||{},new Promise(function(r){var a=this;if(k.default(this,n),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var i,s=null==e||null===(i=e.tnl_keys)||void 0===i?void 0:i.tnl_ad_pos;this.adSuccess=!1;var o=new google.ima.AdsRequest,d=this._transformVast(e,t),u=rA(rA({},t),{},{adTag:d,tnl_ad_pos:s});this.adCounter[s]=this.adCounter[s]||0,this.adCounter[s]++;var c=e.dp,l=e.hl;c&&(c.adtag_url=d.url,this._extend_dp_with_adsense(c,l,null==e?void 0:e.tnl_keys));var h=this._isVMAP(s);if(function(){k.default(this,a),t.shouldFail&&(c?(c.adtag_url="dp_original_broken",c.fallback_url="dp_fallback_broken"):d.url="original_broken",Gi("gd-adflow, _requestAd, dp.adtag_url",null==c?void 0:c.adtag_url),Gi("gd-adflow, _requestAd, dp.fallback_url",null==c?void 0:c.fallback_url),Gi("gd-adflow, _requestAd, adTag.url",d.url)),h=!1}.bind(this),h){Gi("gd-adflow, _isVMAP");var f=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,a=Date.now(),i=new D.default(e.adtag_url_1,!0);i.query=eA(eA({},i.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:a,output:"xml_vast3"});var s=i.toString(),o=new D.default(e.adtag_url_2,!0);o.query=eA(eA({},o.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++a,output:"xml_vast3"});var d=o.toString(),u=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(u++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(tA({id:u++,adtag_url:s,error_url:null==n?void 0:n.error_url,impression_url:null==n?void 0:n.impression_url}),'\n </vmap:AdSource>\n</vmap:AdBreak>\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-2">\n <vmap:AdSource id="').concat(u++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(tA({id:u++,adtag_url:d,error_url:null==r?void 0:r.error_url,impression_url:null==r?void 0:r.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:c,adtag:d,position:"preroll"===u.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(s)}));o.adsResponse=f}else if(c&&l.bidFloorApplied){Gi("gd-adflow, vast wrapper");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()}(c);o.adsResponse=p}else if(c&&c.fallback_url){Gi("gd-adflow, vast wrapper 2");var m=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()}(c);o.adsResponse=m}else Gi("gd-adflow, without dp"),o.adTagUrl=d.url;o.linearAdSlotWidth=this.options.width,o.linearAdSlotHeight=this.options.height,o.nonLinearAdSlotWidth=this.options.width,o.nonLinearAdSlotHeight=this.options.height,o.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(o.vastLoadTimeout=this.options.vast_load_timeout),o.setAdWillAutoPlay(t.autoplayAllowed),o.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(o,u);try{this._broadcast("AD_SDK_REQUEST",{message:u})}catch(e){}r(o)}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._broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameData.gameId}})}}},{key:"_checkAutoPlay",value:(O=A.default(x.default.mark((function e(){var t=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=this;k.default(this,t);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):U.default.video({inline:!0,muted:!1}).then(function(t){k.default(this,r);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 O.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(E=A.default(x.default.mark((function e(){var t;return x.default.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 E.apply(this,arguments)})},{key:"startAd",value:(w=A.default(x.default.mark((function e(t){var n,r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.adType,r=t.params,this.adType_=n,this.adContext=rA({},r),"promo"!==(null==r?void 0:r.adapter)){e.next=5;break}return e.abrupt("return",this._startPromo(r,n));case 5:if("adsense"!==(null==r?void 0:r.adapter)){e.next=26;break}if(n!==a.AdType.Interstitial){e.next=19;break}if("preroll"!==(null==r?void 0:r.position)){e.next=11;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 11:if("start"!==(null==r?void 0:r.position)){e.next=15;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 15:if("next"!==(null==r?void 0:r.position)){e.next=17;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 17:e.next=24;break;case 19:if(n!==a.AdType.Rewarded){e.next=23;break}return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 23:case 34:throw new Error("Unsupported ad type");case 24:e.next=35;break;case 26:if(n!==a.AdType.Interstitial){e.next=30;break}return e.abrupt("return",this._startInterstitialAd(r));case 30:if(n!==a.AdType.Rewarded){e.next=34;break}return e.abrupt("return",this._startRewardedAd(r));case 35:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"preloadAd",value:(_=A.default(x.default.mark((function e(t){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==a.AdType.Interstitial){e.next=4;break}return e.abrupt("return","gdsdk://preloaded");case 4:if(t!==a.AdType.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 _.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,t=function(){k.default(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new Yw(this.adContainer,t),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(b=A.default(x.default.mark((function e(t){var n=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(r,i){var s,o,d,u,c,l,h,f,p,m=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(o=t?t.containerId:null)||i("Container id is not specified"),d=document.getElementById(o),document.getElementById(o)||i("No container is found with this id - ".concat(o)),void 0===window.idhb.requestAds&&i("Prebid.js wrapper script hit an error or didn't exist!"),u=t.slotId?t.slotId:"gd__banner@".concat(o),document.getElementById(u)||(c="\n .gd__banner{\n z-index: ".concat(a.Layers.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((l=document.createElement("style")).type="text/css",l.id="gd__banner__style",l.styleSheet?l.styleSheet.cssText=c:l.appendChild(document.createTextNode(c)),d.appendChild(l)),(h=document.createElement("div")).id=u,h.classList.add("gd__banner"),d.appendChild(h)),e.next=10,n._create_dp_display_context();case 10:n.atom_display=e.sent,null!==(s=n.atom_display)&&void 0!==s&&s.params&&window.idhb.setAdserverTargeting(null===(f=n.atom_display)||void 0===f?void 0:f.params),(p={})[u]={maxSize:[d.offsetWidth,d.offsetHeight]},window.idhb.requestAds({slots:p,callback:function(e){k.default(this,m)}.bind(this)}),r(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),i(e.t0.message||e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return b.apply(this,arguments)})},{key:"_startInterstitialAd",value:(y=A.default(x.default.mark((function e(t){var n,r=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){k.default(this,r)}.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(rA(rA({},n),t));case 13:if(e.sent.success){e.next=18;break}return e.abrupt("return");case 18:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=27;break;case 23:throw e.prev=23,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 27:case"end":return e.stop()}}),e,this,[[0,23]])}))),function(e){return y.apply(this,arguments)})},{key:"_startPromo",value:(v=A.default(x.default.mark((function e(t,n){var r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this._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 r=e.sent,e.next=11,this._loadPromo(rA(rA({},r),t),n);case 11:if(e.sent.success){e.next=16;break}return e.abrupt("return");case 16:r.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=27;break;case 22:throw e.prev=22,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 27:case"end":return e.stop()}}),e,this,[[0,22]])}))),function(e,t){return v.apply(this,arguments)})},{key:"_loadPromo",value:(m=A.default(x.default.mark((function e(t,n){var r,i;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._resetAdsLoader(),e.prev=1,r=this.nextAdPosition(n),i=this._create_promo_context(r),this._requestPromo(i,rA({adType:a.AdType.Interstitial},t)),e.next=7,this._waitOnAdLoad();case 7:return e.abrupt("return",e.sent);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 m.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(p=A.default(x.default.mark((function e(t){var n;return x.default.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(a.AdType.Interstitial,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(n,rA({adType:a.AdType.Interstitial},t));case 11:return e.next=14,this._waitOnAdLoad();case 14:return e.abrupt("return",e.sent);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 p.apply(this,arguments)})},{key:"_waitOnAdLoad",value:function(){var e=this;return new Promise(function(t,n){var r=this;k.default(this,e);var a="videoad.preloadad";this.eventBus.unsubscribeScope(a);var i=function(e){var n=this;k.default(this,r),setTimeout(function(){k.default(this,n),this.eventBus.unsubscribeScope(a),t({success:!0,args:e})}.bind(this),1)}.bind(this),s=function(e){var n=this;k.default(this,r),setTimeout(function(){k.default(this,n),this.eventBus.unsubscribeScope(a),t({success:!1,args:e})}.bind(this),1)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",i,a),this.eventBus.subscribe("AD_SDK_CANCELED",s,a),this.eventBus.subscribe("AD_ERROR",s,a)}.bind(this))}},{key:"_startRewardedAd",value:(f=A.default(x.default.mark((function e(t){var n,r=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){k.default(this,r)}.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(rA(rA({},n),t));case 13:if(e.sent.success){e.next=18;break}return e.abrupt("return");case 18:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=27;break;case 23:throw e.prev=23,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 27:case"end":return e.stop()}}),e,this,[[0,23]])}))),function(e){return f.apply(this,arguments)})},{key:"_loadRewardedAd",value:(h=A.default(x.default.mark((function e(t){var n;return x.default.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(a.AdType.Rewarded,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(n,rA({adType:a.AdType.Rewarded},t));case 11:return e.next=14,this._waitOnAdLoad();case 14:return e.abrupt("return",e.sent);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:(l=A.default(x.default.mark((function e(){return x.default.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(a.AdType.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 l.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(c=A.default(x.default.mark((function e(){return x.default.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(a.AdType.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 c.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=this.gameData.__t4r;var r=this._isT4R(e),a=this._getT4ROptions(e);if("loaded"===n)this.activeAdContainer.style.opacity=r?.001:1,r&&this.adsManager.setVolume(0),r&&this._broadcast("AD_T4R"),r&&setTimeout(function(){k.default(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(r&&"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=a.Layers.AdsContainer.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 r=document.createElement("div");r.id="".concat(this.prefix,"advertisement_slot"),r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",this.adContainerInner=r,this.activeAdContainer=this.adContainer,window.activeAdContainer=this.activeAdContainer,this.thirdPartyContainer?(this.adContainer.appendChild(r),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(r),t.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var i=function(){k.default(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,r.style.width=this.options.width+"px",r.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",i),window.document.addEventListener("DOMContentLoaded",i)}},{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(){k.default(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 r=new Date,a=r.getHours(),i=r.getDate(),s=r.getMonth(),o=r.getFullYear(),d="AD_SDK_MANAGER_READY";this._broadcast(d,{name:d,message:"AD SDK is ready",status:"success",analytics:{category:d,action:this.parentDomain,label:"h".concat(a," d").concat(i," m").concat(s," y").concat(o)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var t,n=this,r=new Date,i=r.getHours(),s=r.getDate(),o=r.getMonth(),d=r.getFullYear(),u=a.getKeyByValue(google.ima.AdEvent.Type,e.type),c=!1,l=(null==e||null===(t=e.getAd())||void 0===t?void 0:t.getContentType())||"",h=!l.startsWith("image")&&!l.startsWith("text");this._sendIMAEventsToHB(e);var f="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:f="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:f="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:c=!0,f="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:f="Fired when the ad is clicked.";var p=e.getAd().getContentType();this._show({mode:"click",contentType:p});break;case google.ima.AdEvent.Type.COMPLETE:Gi("gd-adflow ON COMPLETE!",e.getAd()),c=this._is_completed(e.getAd()),f="Fired when the ad completes playing.",this.adType_===a.AdType.Rewarded&&this._broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:f="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:f="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",c=!0,this._hideAddResume();break;case google.ima.AdEvent.Type.DURATION_CHANGE:f="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:f="Fired when the ad playhead crosses first quartile.";var m=e.getAd().getContentType();this._show({mode:"first_quartile",contentType:m});break;case google.ima.AdEvent.Type.IMPRESSION:f="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:f="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:f="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var g=e.getAd().getContentType();f=g,this._show({mode:"loaded",contentType:g});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(f=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:f="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:h&&this.adResume.show(),f="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:f="Fired when the ad is resumed.",h&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:f="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:c=this._is_completed(e.getAd()),f="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:this._hideAddResume(),f="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:f="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:c=this._is_completed(e.getAd()),f="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:f="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:f="Fired when the ad volume has been muted."}if(""!==u&&""!==f&&this._broadcast(u,{name:u,message:f,status:"success",analytics:{category:u,action:this.parentDomain,label:"h".concat(i," d").concat(s," m").concat(o," y").concat(d)}}),c&&!this.adSuccess){this.adSuccess=!0;var v=e.getAd(),y="Rainbow"===(null==v?void 0:v.getAdSystem())&&(null==v?void 0:v.getWrapperAdIds().some(function(e){return k.default(this,n),"promo"===e}.bind(this)));Gi("gd-adflow isPromoSuccess",y,null==v?void 0:v.getAdSystem(),null==v?void 0:v.getWrapperAdIds()),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success",isPromoSuccess:y}),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",n=e.getError(),r=n.getErrorCode().toString()||n.getVastErrorCode().toString(),a=this._getInnerErrorCode(n);aA.emit("AD_ERROR",r),this._broadcast(t,{message:r,details:a,status:"warning",analytics:{category:t,action:a,label:r}}),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(){k.default(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(Jw(e.getInnerError)){var t=e.getInnerError();if(t)return Jw(t.getErrorCode)&&Jw(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 r=this.macros.transform(e,{get:function(e){if(k.default(this,n),t&&t.tnl_keys)return t.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in r.query||{}){var i=r.query[a];g.isPlainObject(i)&&(r.query[a]=j.default.stringify(i))}var s=new D.default(r.url,!0);return M.default(s.query,r.query||{}),rA({url:s.toString()},t)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new D.default(e.url,!0),a=this._transformQuery(e,t,r);a&&(n.url=r.toString());var i=a?r:new D.default(e.url,!0);if(i.query.cust_params){var s=j.default.parse(i.query.cust_params);n.bidder=s.hb_bidder,n.cust_params=s}n.url_parsed=i}catch(e){n.hasError=!0,n.message=e.message,n.bidder="error",console.log(e.message)}return n}},{key:"_transformQuery",value:function(e,t,n){var r=this;if(e&&t&&e.tnl_keys){var a=this.options.vast_query;if(t.retry_on_success&&this.options.retry_on_success&&g.isPlainObject(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:t.retry_on_failure&&this.options.retry_on_failure&&g.isPlainObject(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=L.default(a),g.isPlainObject(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 o=j.default.parse(i.cust_params);if(a.cust_params&&a.cust_params.$$remove){for(var d in o){new RegExp(a.cust_params.$$remove,"i").test(d)&&delete o[d]}delete a.cust_params.$$remove}var u=this.macros.transform(a,{get:function(t){return k.default(this,r),e.tnl_keys[t.toLowerCase()]}.bind(this)});return i.cust_params=o,M.default(i,u),i.cust_params=j.default.stringify(i.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,a,i=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(this.clickCount[i]>=(null===(n=e.t4r[i])||void 0===n?void 0:n.count))return!1;if(null!=e&&null!==(r=e.contentType)&&void 0!==r&&r.startsWith("image/")||"text"===(null==e?void 0:e.contentType))return i&&(null===(a=e.t4r[i])||void 0===a?void 0:a.enabled);if(null!=e&&e.contentType.startsWith("video/")){var s,o=(null===(s=e.t4r[i])||void 0===s?void 0:s.viper)||0;if(o>0){var d,u=Math.random()<o;return i&&u&&(null===(d=e.t4r[i])||void 0===d?void 0:d.enabled)}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,n,r,a,i,s,o,d,u,c,l,h,f,p,m;if(!e)return!1;var g="preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap)||!0===(null===(r=this.gameData)||void 0===r||null===(a=r.pAds)||void 0===a||null===(i=a.vmap)||void 0===i?void 0:i.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.vmap)||!0===(null===(d=this.gameData)||void 0===d||null===(u=d.mAds)||void 0===u||null===(c=u.vmap)||void 0===c?void 0:c.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.vmap)||!0===(null===(f=this.gameData)||void 0===f||null===(p=f.rAds)||void 0===p||null===(m=p.vmap)||void 0===m?void 0:m.enabled));if(!g)return!1;var v=this._get_vmap_config(e),y=this.adCounter[e];return void 0!==(null==v?void 0:v.start)?y>=(null==v?void 0:v.start):g}},{key:"_getT4ROptions",value:function(e){var t,n=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;switch(n){case"preroll":case"midroll":case"rewarded":return e.t4r[n]}}},{key:"_is_completed",value:function(e){var t=e.getContentType(),n=e.getAdPodInfo();return!(!t.startsWith("image/")&&"text"!==t&&1!==n.getTotalAds())}},{key:"_get_vmap_context",value:function(e){var t=e.adtag,n=e.position,r=e.config,a=e.dp,i=this._createCustomAdVastUrl(null==r?void 0:r.vast_1)||t,s=this._createCustomAdVastUrl(null==r?void 0:r.vast_2)||t,o=null!=r&&r.vast_1?void 0:a,d=null!=r&&r.vast_2?void 0:a;return{adtag_url_1:null==i?void 0:i.url,adtag_url_2:null==s?void 0:s.url,position:n,dp_1:o,dp_2:d}}},{key:"_get_vmap_config",value:function(e){var t,n,r,a,i,s,o,d;switch(e){case"preroll":return null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap;case"midroll":return null===(r=this.gameData)||void 0===r||null===(a=r.mAds)||void 0===a?void 0:a.vmap;case"rewarded":return null===(i=this.gameData)||void 0===i||null===(s=i.rAds)||void 0===s?void 0:s.vmap;default:return null===(o=this.gameData)||void 0===o||null===(d=o.pAds)||void 0===d?void 0:d.vmap}}},{key:"_isDP",value:function(e){var t,n,r;return!!e&&!0===(null===(t=this.gameData)||void 0===t||null===(n=t.dp)||void 0===n||null===(r=n[e])||void 0===r?void 0:r.enabled)}},{key:"_create_dp_display_context",value:function(){var e=this;return new Promise(function(t){var n=this;k.default(this,e);try{var r={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new Qw(this.gameData).checkCustomParams();a&&(r.cp=a);var i=encodeURIComponent(u.Base64.encode(JSON.stringify(r)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(i)).then(function(e){return k.default(this,n),e.json()}.bind(this)).then(function(e){if(k.default(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){k.default(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,r={id:this.topDomain||this.parentDomain,au:e||"unknown",ty:"video",aid:this.gameData.gameId,pgu:this.parentURL},a=Object.keys(r).map(function(e){return k.default(this,n),"".concat(e,"=").concat(encodeURIComponent(r[e]))}.bind(this)).join("&");encodeURIComponent(u.Base64.encode(JSON.stringify(r)));var i=null===(t=this.gameData.promo)||void 0===t?void 0:t.rainbow,s=null==i?void 0:i.enabled,o="https://tag.atom.gamedistribution.com/v1/rainbow/?".concat(a);console.log("gd-adflow openPromoUrl",o);var d=s?o:void 0;return function(){k.default(this,n)}.bind(this),{promo_url:d,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,t){var n=this;return new Promise(function(){var r=A.default(x.default.mark((function r(a){var i,s,o,d,c,l,h=this;return x.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,n._isDP(e)){r.next=5;break}return n.msgrt.send("dp.na",{message:"rule"}),r.abrupt("return",a());case 5:s={id:n.topDomain||n.parentDomain,au:e||"unknown",ty:"video",aid:n.gameData.gameId,pgu:n.parentURL},(o=new Qw(n.gameData).checkCustomParams())&&(s.cp=o),d=encodeURIComponent(u.Base64.encode(JSON.stringify(s))),Gi("gd-adflow isLastAdapter",null==t?void 0:t.adapterIndex,null==t?void 0:t.isLastAdapter),c=null===(i=n.gameData.promo)||void 0===i?void 0:i.rainbow,l=(null==c?void 0:c.enabled)&&(null==t?void 0:t.isLastAdapter),Gi("gd-adflow promo_enabled",l,null==c?void 0:c.enabled,null==t?void 0:t.isLastAdapter),fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(d)).then(function(e){return k.default(this,h),e.json()}.bind(this)).then(function(e){if(k.default(this,h),!e||!e.p)return n.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(d,"&ec=[ERRORCODE]"),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(d),skip_url:"https://tag.atom.gamedistribution.com/v1/skp?ar=".concat(d),promo_url:l?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(d):void 0,promo_imp_blue_url:l?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:l?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){k.default(this,h),n.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),a()}.bind(this)),r.next=20;break;case 16:r.prev=16,r.t0=r.catch(0),n.msgrt.send("dp.err",{message:(null===r.t0||void 0===r.t0?void 0:r.t0.message)||r.t0}),a();case 20:case"end":return r.stop()}}),r,this,[[0,16]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t){if(e&&t)try{var n,r=new D.default(t.vastUrl,!0);if(null===(n=r.query)||void 0===n||!n.cust_params)return;var a=j.default.parse(r.query.cust_params);if(!a.tnl_asset_id)return;a.adsense=1,r.query.cust_params=j.default.stringify(a,!1),e.fallback_url=r.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(d=A.default(x.default.mark((function e(t){var n,r,i,s,o,d=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getPrebidScripts(),r=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,a.getScript(r,"gdsdk_prebid",{alternates:n,error_prefix:"Blocked:",exists:function(){return k.default(this,d),window.idhb.requestAds}.bind(this)});case 8:i=a.getQueryString("ch",window.location.href),s=a.getQueryString("ch_date",window.location.href),o={tnl_content_category:this.category.toLowerCase()},i&&(o.channel=i),s&&(o.ch_date=s),window.idhb.setAdserverTargeting(o),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var t=this;k.default(this,d);try{var n,r=e.slotId.split("@");r=1===r.length?r[0]:r[1],e.isEmpty?(null!==(n=this.atom_display)&&void 0!==n&&n.error_url&&(fetch(this.atom_display.error_url).catch(function(e){k.default(this,t)}.bind(this)),delete this.atom_display),this._broadcast("DISPLAYAD_ERROR",{message:r,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){k.default(this,t)}.bind(this)),delete this.atom_display),this._broadcast("DISPLAYAD_IMPRESSION",{message:r,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:(o=A.default(x.default.mark((function e(t){var n,r,i=this;return x.default.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"],r=this.options.debug?n[0]:n[1],e.next=4,a.getScript(r,"gdsdk_ima",{alternates:n,error_prefix:"Blocked:",exists:function(){return k.default(this,i),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_init_afg_script",value:(s=A.default(x.default.mark((function e(t){var n,r,i,s,o=this;return x.default.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(s={}).crossorigin="anonymous",s["data-ad-client"]=(null==t||null===(n=t.adsense_client)||void 0===n?void 0:n.length)>0?t.adsense_client:"ca-pub-2316275586951220",s["data-ad-frequency-hint"]="30s",s.allow="autoplay",(null==t||null===(r=t.adsense_channel)||void 0===r?void 0:r.length)>0&&(s["data-ad-channel"]=t.adsense_channel),(null==t||null===(i=t.adsense_host)||void 0===i?void 0:i.length)>0&&(s["data-ad-host"]=t.adsense_host),!0===(null==t?void 0:t.adsense_adbreak_test)&&(s["data-adbreak-test"]="on"),e.next=14,a.getScript("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return k.default(this,o),!!window.adsbygoogle}.bind(this),attrs:s});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=A.default(x.default.mark((function e(t){var n,r,a,i,s,o,d=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(k.default(this,d),t.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense rewarded error",status:"error",skipForward:!0}),!0}.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(){k.default(this,d),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){k.default(this,d),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(){k.default(this,d),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),i=function(){k.default(this,d),this._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"}),this._send_atom_event("sg.ad.rw.viewed")}.bind(this),s=function(e){k.default(this,d),e()}.bind(this),o=function(e){k.default(this,d),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===e.breakStatus?this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error",skipForward:!0}),"dismissed"!==e.breakStatus&&this._send_atom_event("sg.dbg.rw",e))}.bind(this),u={type:"reward",name:"reward-in-game",beforeAd:n,afterAd:r,adDismissed:a,adViewed:i,beforeReward:s,adBreakDone:o},window.adsbygoogle.push(u),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 u}),e,this,[[1,20]])}))),function(e){return i.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(r=A.default(x.default.mark((function e(t){var n,r=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(k.default(this,r),t.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense preroll error",status:"error"}),!0}.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){k.default(this,r),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"}),this._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),a={type:"preroll",adBreakDone:n},window.adsbygoogle.push(a),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 a}),e,this,[[1,15]])}))),function(e){return r.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(n=A.default(x.default.mark((function e(t){var n,r,a,i=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(k.default(this,i),t.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense preroll error 2",status:"error"}),!0}.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(){k.default(this,i),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){k.default(this,i),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){k.default(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._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),s={type:"start",name:"start-in-game",beforeAd:n,afterAd:r,adBreakDone:a},window.adsbygoogle.push(s),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 s}),e,this,[[1,17]])}))),function(e){return n.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(t=A.default(x.default.mark((function e(t){var n,r,a,i=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(k.default(this,i),t.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense midroll error",status:"error"}),!0}.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(){k.default(this,i),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){k.default(this,i),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){k.default(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._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",e))}.bind(this),s={type:"next",name:"next-in-game",beforeAd:n,afterAd:r,adBreakDone:a},window.adsbygoogle.push(s),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 s}),e,this,[[1,17]])}))),function(e){return t.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var n=this.msgrt,r=n._layout,a=n._ua,i={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:a.browser.name,brvs:a.browser.version,osnm:a.os.name,osvs:a.os.version,dvmd:a.device.model,w:r.w,h:r.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(u.Base64.encode(JSON.stringify(i)))))}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 n=e.adType;if(n===a.AdType.Rewarded)t="reward";else if(n===a.AdType.Interstitial){var r,i;if(this._isAfgPositionStart(e))t=null===(r=this.gameData.pAds)||void 0===r||!r.enabled||null!==(i=this.gameData.loader)&&void 0!==i&&i.enabled?"start":"next";else this._isAfgPositionNext(e)&&(t="next")}e.params.position=t}},{key:"_broadcast",value:function(e,t){var n=this,r=!1;["AD_ERROR"].some(function(t){return k.default(this,n),t===e}.bind(this))&&(r=!this.adContext.isLastAdapter||this.adContext.extraPromoRunOnFail,console.log("gd-adflow skipForward",e,r,this.adContext.adapterIndex,this.adContext.isLastAdapter,this.adContext.extraPromoRunOnFail)),this.eventBus.broadcast(e,rA(rA({},t),{},{skipForward:r}))}}]),e}(),oA=function e(t){var n=this;R.default(this,e),T.default(this,"load",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rm(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),T.default(this,"promo",A.default(x.default.mark((function e(){return x.default.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 r=t.package||"gd-sdk-stone-dynamic",a=t.package_version||"1.1.1",i=t.template||"puzzle",s=t.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(r,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},Em(this.moduleName,this.moduleConfig)},dA=function e(t){var n=this;R.default(this,e),T.default(this,"load",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rm(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),T.default(this,"splash",A.default(x.default.mark((function e(){return x.default.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 r=t.package||"gd-sdk-air-dynamic",a=t.package_version||"1.2.0",i=t.template||"pluto",s=t.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(r,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},Em(this.moduleName,this.moduleConfig)},uA=function(e,t){console.log(e,t)},cA={},lA={},hA=null;function fA(){for(var e,t=window,n=null,r=null;!e;){try{if("function"==typeof t.__tcfapi||"function"==typeof t.__cmp){"function"==typeof t.__tcfapi?(r=2,n=t.__tcfapi):(r=1,n=t.__cmp),e=t;break}}catch(e){}try{if(t.frames.__tcfapiLocator){r=2,e=t;break}}catch(e){}try{if(t.frames.__cmpLocator){r=1,e=t;break}}catch(e){}if(t===window.top)break;t=t.parent}return cA.version=r,cA.frame=e,cA.function=n,cA.version}function pA(e){var t=this;return hA||(hA=new Promise(function(n){function r(t,r){if(uA("Received a response from CMP",t),r){var a,i;if(!1!==t.gdprApplies)return"tcloaded"===t.eventStatus||"useractioncomplete"===t.eventStatus?(("boolean"!=typeof(i=(a=t)&&"boolean"==typeof a.gdprApplies?a.gdprApplies:e.defaultGdprScope)||!0===i&&"string"!=typeof a.tcString)&&n({result:"cmpUnexpectedResponse",cmp:cA,consentData:a}),void n({result:"ok",consentData:t})):void 0;n({result:"ok",consentData:t})}else n({result:"cmpCallFailed"})}k.default(this,t),fA(),cA.frame?2===cA.version?(uA("TCF v2 CMP found. Fetching the consent."),cA.function?(uA("CMP API is directly accessible, calling it now..."),cA.function("addEventListener",cA.version,r)):(uA("CMP API is outside the current iframe, calling it now..."),function(e,t,n){var r=this,a="__tcfapi";function i(e){var t="".concat(a,"Return"),n="string"==typeof e.data&&e.data.indexOf(t)>=0?JSON.parse(e.data):e.data;if(n[t]&&n[t].callId){var r=n[t];void 0!==lA[r.callId]&&lA[r.callId](r.returnValue,r.success)}}window[a]=function(e,n,i,s){k.default(this,r);var o=Math.random()+"",d="".concat(a,"Call"),u=T.default({},d,{command:e,parameter:s,callId:o,version:n});lA[o]=i,t.postMessage(u,"*")}.bind(this),window.addEventListener("message",i,!1),window[a](e,cA.version,n)}("addEventListener",cA.frame,r))):n({result:"cmpVersionNotV2",cmp:cA}):n({result:"cmpNotFound"})}.bind(this)),hA)}var mA=new(function(){function e(){R.default(this,e),this.productName="Game Distribution"}var t;return S.default(e,[{key:"checkIfExcluded",value:function(e){try{var t,n;return!(null===(t=e.diagnostic)||void 0===t||null===(n=t.gameDock)||void 0===n||!n.excluded)}catch(e){return console.log("Error on checkIfExclude check",e),!1}}},{key:"track",value:(t=A.default(x.default.mark((function e(t,n){var r,a,i,s,o,d;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.checkIfExcluded(n)){e.next=3;break}return e.abrupt("return");case 3:if(a=null==t||null===(r=t.visitor)||void 0===r?void 0:r.visitorId){e.next=6;break}return e.abrupt("return");case 6:return i=encodeURIComponent(this.productName),s=encodeURIComponent(a),e.prev=8,o="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(i,"/user_id/").concat(s),e.next=12,fetch(o,{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,d="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(i,"/user_id/").concat(s),e.next=22,fetch(d,{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,n){return t.apply(this,arguments)})}]),e}());function gA(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return vA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vA(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}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 i,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function vA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var yA=function(e){var t=this,n=e.src,r=e.attributes,a=e.target,i=e.isAsync;return new Promise(function(e,s){var o=this;k.default(this,t);try{var d=document.createElement("script");if(d.async=null==i||i,d.type="text/javascript",d.onload=function(){k.default(this,o),e()}.bind(this),d.onerror=function(){k.default(this,o);var e="Error on script load, Error: ".concat(n);console.log(e),s(e)}.bind(this),d.src=n,r){var u,c=gA(r);try{for(c.s();!(u=c.n()).done;){var l=u.value,h=l.key,f=l.value;d.setAttribute(h,f)}}catch(e){c.e(e)}finally{c.f()}}a||(a=document.head),a.appendChild(d)}catch(e){var p="Error on script load catch, Error: ".concat(n);console.log(p,e),s(p)}}.bind(this))},bA=function(){var e=A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,yA({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,yA({src:"https://cookie-cdn.cookiepro.com/consent/".concat("140feb72-7952-4420-8ae5-e8978d87bc17","/OtAutoBlock.js"),attributes:[{key:"id",value:"gd-cookie-pro-autoblock"}],isAsync:!1});case 5:return e.next=7,yA({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:"140feb72-7952-4420-8ae5-e8978d87bc17"}],isAsync:!1});case 7:n=void 0,r=void 0,a=void 0,n=(t={inlineScript:"function OptanonWrapper() { }"}).inlineScript,r=t.target,(a=document.createElement("script")).text=n,r||(r=document.head),r.appendChild(a),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,n,r,a}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),_A=new b.EventEmitter,wA={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};function AA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}window.addEventListener("message",(function(e){var t=this,n=e.data,r=e.origin,a=n.type;if(Object.keys(wA).some(function(e){return k.default(this,t),e===r}.bind(this))&&(null==n||!n.__tcfapiCall)&&(window.parent&&!n.type.startsWith("gd-sdk")&&window.parent.postMessage(n,"*"),a)){var i=wA[r][a];i&&_A.emit(i,n)}}),!1);var kA=_.v4(),EA=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="__msgr",document.body.appendChild(n),window!==window.top){var r={gameId:e.gameId,target:e.evnts.domain,token:kA,event_name:"TokenGenerated",timestamp:Date.now()};n.onload=function(){TA(r)},setInterval(function(){k.default(this,t),r.timestamp=Date.now(),r.event_name="Heartbeat",TA(r)}.bind(this),1e3*e.evnts.heartbeatDuration)}}window.addEventListener("message",function(e){k.default(this,t);try{var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AA(Object(n),!0).forEach((function(t){T.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.data);if(!n.event_name)return;n.token=kA,TA(n)}catch(e){console.error("GD Messager Error",e.message)}}.bind(this),!1)},xA=function(e){try{var t={gameId:e.game.gameId,target:e.game.evnts.domain,event_name:e.event,timestamp:Date.now()},n=RA(window);n!==window.top&&(null==n||n.postMessage(t,"https://html5.gamedistribution.com"))}catch(e){}},RA=function e(t){try{var n,r,a=null==t?void 0:t.parent;if("game"===(null===(n=a.document)||void 0===n||null===(r=n.activeElement)||void 0===r?void 0:r.id))return a;e(a)}catch(e){return t}},TA=function(e){window.__msgr.postMessage(e,"https://static.gamedistribution.com")};function SA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function DA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?SA(Object(n),!0).forEach((function(t){T.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function OA(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return IA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IA(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}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 i,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function IA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var PA=function(){function e(t){var n=this;R.default(this,e),T.default(this,"_getAdTypeByAfgPosition",function(e){var t=this;k.default(this,n);var r={preroll:["preroll","start"],midroll:["next"],rewarded:["reward"]},a=Object.keys(r).find(function(n){var a=this;return k.default(this,t),r[n].some(function(t){return k.default(this,a),t===e.params.position}.bind(this))}.bind(this));return a||"midroll"}.bind(this)),this._gameData=t._gameData,this._msgrt=t.msgrt,this._adInstance=t.adInstance,this._eventBus=t.eventBus,this._onResumeGame=t.onResumeGame.bind(t),this._setAdRequestTimer=t._setAdRequestTimer.bind(t),this._giveGift=t._giveGift.bind(t)}var t,n;return S.default(e,[{key:"runAdFlow",value:(n=A.default(x.default.mark((function e(t){var n,r,a,i,s,o,d,u,c,l,h,f,p,m,g,v,y,b,_,w,A,E,R,T,S,D,O,I,P=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=this._getAdTypeByAfgPosition(t),Gi("gd-adflow, adTypeFound",s),o=this._getAdFlow(s),Gi("gd-adflow config read",o),d=this._gameData,u=d.afg_disabled,c=null===(n=d.promo)||void 0===n||null===(r=n.rainbow)||void 0===r?void 0:r.enabled,l=null===(a=d.promo)||void 0===a?void 0:a.onadsense,h="reward"===(null===(i=t.params)||void 0===i?void 0:i.position),f=u?o.filter(function(e){return k.default(this,P),"adsense"!==e}.bind(this)):o,p=!1,m=!1,g=[],v=0,y=!1,Gi("gd-adflow, enabled adapters",f),b=OA(f),e.prev=17,b.s();case 19:if((_=b.n()).done){e.next=46;break}return w=_.value,t.params.adapter=w,A=v===f.length-1,c&&A&&"ima"===w&&(t.params.runPromoAsImaFallback=!0),E=A&&"adsense"===w&&c&&l&&h,t.params=DA(DA({},t.params),{},{adapterIndex:v,isLastAdapter:A,shouldFail:!1,extraPromoRunOnFail:E}),function(){k.default(this,P)}.bind(this),Gi("gd-adflow, before adInvoke",v,w,t.params.shouldFail),e.next=30,this.adInvoke(t);case 30:if(R=e.sent,T=R.success,S=R.args,!T){e.next=40;break}return console.log("gd-adflow, adapter-result-success",v,w,S),p=!0,m=!(null==S||!S.isPromoSuccess),e.abrupt("break",46);case 40:Gi("gd-adflow, adapter-result-failure",v,w,S.message),v++,g.push(S.message),A&&"adsense"===w&&c&&l&&h&&(y=!0);case 44:e.next=19;break;case 46:e.next=51;break;case 48:e.prev=48,e.t0=e.catch(17),b.e(e.t0);case 51:return e.prev=51,b.f(),e.finish(51);case 54:if(!y){e.next=63;break}return Gi("gd-adflow should run promo after adsense"),t.params.adapter="promo",e.next=59,this.adInvoke(t);case 59:e.sent.success&&(m=!0);case 63:(function(){k.default(this,P)}).bind(this),D=g.join(" /n"),p?(this._setAdRequestTimer(),Gi("gd-adflow, END, IsPromoSuccess",m),this._onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),this._giveGift()):(this._onResumeGame(D,"warning"),this._giveGift()),Gi("gd-adflow msgrt_1"),O="-1",I="none",p&&m?O="promo_ima":p?(O="index_".concat(v),I=f[v]):m&&(O="promo_adsense"),Gi("gd-adflow msgrt_2"),this._msgrt.send("adflow.all.index",{message:"".concat(O)}),this._msgrt.send("adflow.all.success_adapter",{message:"".concat(I)}),this._msgrt.send("adflow.".concat(s,".index"),{message:"".concat(O)}),this._msgrt.send("adflow.".concat(s,".success_adapter"),{message:"".concat(I)});case 75:case"end":return e.stop()}}),e,this,[[17,48,51,54]])}))),function(e){return n.apply(this,arguments)})},{key:"adInvoke",value:(t=A.default(x.default.mark((function e(t){var n=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(r,a){var i,s,o,d=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i="main.showad.".concat(t.params.adapter,".").concat(t.params.adapterIndex),s=function(e){k.default(this,d),n._eventBus.unsubscribeScope(i),r({success:!1,args:e})}.bind(this),o=function(e){k.default(this,d),n._eventBus.unsubscribeScope(i),r({success:!0,args:e})}.bind(this),n._eventBus.subscribe("AD_ERROR",s,i),n._eventBus.subscribe("AD_SDK_CANCELED",s,i),n._eventBus.subscribe("AD_SUCCESS",o,i);try{n._adInstance.startAd(t)}catch(e){console.log("gd-adflow startAd error",e)}case 7:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"_getAdFlow",value:function(e){var t,n,r,a,i,s,o,d,u=this,c=void function(){k.default(this,u)}.bind(this),l=this._gameData.adflw;c&&(Gi("gd-adflow custom adflow",c),l=c);var h=null!==(t=l)&&void 0!==t&&null!==(n=t.adapters)&&void 0!==n&&n.default?null===(r=l)||void 0===r||null===(a=r.adapters)||void 0===a?void 0:a.default:["ima","adsense"];return h=null!==(i=l)&&void 0!==i&&null!==(s=i.adapters)&&void 0!==s&&s[e]?null===(o=l)||void 0===o||null===(d=o.adapters)||void 0===d?void 0:d[e]:h}}]),e}();function CA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function LA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?CA(Object(n),!0).forEach((function(t){T.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var UA,jA=null,MA=null,GA=function(){function e(t){var n=this;if(R.default(this,e),jA)return jA;jA=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,t),this._version=t.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new pb,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){k.default(this,n),this._sdk_ready=!0}.bind(this)).catch(function(e){k.default(this,n),this._sdk_ready=!1}.bind(this)).finally(function(){var e,t;k.default(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()&&EA(this._gameData)}.bind(this)),this._registerSGBridge(),Gi("which-frame",this._whichFrame())}var t,n,r,i,s,o,d,c,l,h,f,p;return S.default(e,[{key:"_initUnityHandler",value:function(){var e=this;window.addEventListener("DOMNodeInserted",function(){if(k.default(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:(p=A.default(x.default.mark((function e(){var t,n,r,a;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=6;break}if(r=new pb,0!==(null==(a=r.get("depth"))?void 0:a.value)||null===(t=this._gameData)||void 0===t||null===(n=t.cmp)||void 0===n||!n.enabled||"html5.gamedistribution.com"!==this._topDomain){e.next=6;break}return e.next=6,bA();case 6:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"testConsent",value:function(){try{fA();A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,pA({});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;_A.on("splash-hidden",function(t){k.default(this,e),this._hideCMPButton()}.bind(this))}},{key:"_hideCMPButton",value:function(){var e=document.getElementById("ot-sdk-btn-floating");e&&(e.style.display="none")}},{key:"_sendLoadedEvent",value:function(){if(!this._isLoaded&&(this._isLoaded=!0,"loader-frame"===this._whichFrame()))try{Gi("which-frame, sending tunnel event",this._whichFrame()),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:(f=A.default(x.default.mark((function e(t,n){var r,a=this;return x.default.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===(r=this._gameData.enableAds)||void 0===r?void 0:r.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 k.default(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 f.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 n=L.default(e);this.options=t?a.extendDefaults(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=Ui.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(j.default.stringify(n))).catch(function(e){k.default(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=a.getQueryParams("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,a.dankLog("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!a.Ls.available)return;"developer.gamedistribution.com"===this._parentDomain?(a.Ls.set("gd_debug_ex",!0),a.Ls.set("gd_disable_midroll_timer",!0),a.Ls.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(a.Ls.set("gd_debug_ex",!0),a.Ls.set("gd_disable_midroll_timer",!0)),a.Ls.getBoolean("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 a.MessageRouter({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:a.getIframeDepth(),version:Ui.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:a.getMobilePlatform(),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"];a.getScript(t[0],"GamedockSDK",{alternates:t}).then(function(){var t,n;k.default(this,e),MA=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(t=this._gameData.diagnostic)&&void 0!==t&&null!==(n=t.gameDock)&&void 0!==n&&n.adViewEvent&&MA.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),mA.track(MA,this._gameData)}.bind(this)).catch(function(t){k.default(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,n;null===(t=MA)||void 0===t||null===(n=t.tracking)||void 0===n||n.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"];a.getScript(t[0],"MinijuegosSDK",{alternates:t}).catch(function(t){k.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,t=["https://www.google-analytics.com/analytics.js"];a.getScript(t[0],"gdsdk_google_analytics",{alternates:t,error_prefix:"Blocked:",exists:function(){return k.default(this,e),window.ga}.bind(this)}).then(function(){k.default(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){k.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new a.EventBus,a.SDKEvents.forEach(function(t){var n=this;return k.default(this,e),this.eventBus.subscribe(t,function(e){return k.default(this,n),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),a.IMAEvents.forEach(function(t){var n=this;return k.default(this,e),this.eventBus.subscribe(t,function(e){return k.default(this,n),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(k.default(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 k.default(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(t){var n,r;k.default(this,e),this.msgrt.send("ad.impression"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(r=n.gameDock)&&void 0!==r&&r.adViewEvent&&mA.track(MA,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(t){k.default(this,e),this.msgrt.send("ad.error",{message:t.message,details:t.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(t){k.default(this,e),this._sendAdRequestContext(t.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(t){k.default(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){k.default(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){k.default(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 k.default(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(Ui.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(h=A.default(x.default.mark((function e(){var t,n,r=this;return x.default.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(){k.default(this,r),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(j.default.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(){k.default(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;a.Ls.available&&a.Ls.getBoolean("gd_debug_ex")&&(a.Ls.getBoolean("gd_disable_midroll_timer")?e.midroll=0:e.midroll=this._getDefaultGameData().midroll)}},{key:"_checkSplashAndPromoScreens",value:function(){var e,t,n;this._gameData.loader&&!1===this._gameData.loader.mobile&&this._getisMobile()&&(this._gameData.loader.enabled=!1);var r,a=this._gameData,i=a.gdpr&&!0===a.gdpr.consent,s=a.loader,o=null===(e=a.promo)||void 0===e?void 0:e[null===(t=a.promo)||void 0===t||null===(n=t.template)||void 0===n?void 0:n.preroll];(a.preroll||(this.adRequestTimer=Date.now()),this.options.loader.enabled)?null!=o&&o.enabled?this._createPromoBeforeSplash(a,i):s.enabled&&!0!==(null===(r=s.splash)||void 0===r?void 0:r.skip)?this._createSplash(a,i):this.onResumeGame("Skipped splash.","success"):s.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||i?null!=o&&o.enabled?this._createPromoBeforeSplash(a,i):!1!==s.enabled&&this._createSplash(a,i):null!=o&&o.enabled&&this._createPromo(a,i))}},{key:"_initializeVideoAd",value:(l=A.default(x.default.mark((function e(){var t;return x.default.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=a.extendDefaults(this.options.advertisementSettings,t.sdk)),this.macros=new a.Macros({game:t,bridge:this._bridge}),this.adInstance=new sA(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=Ui,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 l.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){a.dankLog("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){a.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){a.dankLog(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status,skipForward:e.skipForward})}catch(e){a.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:(c=A.default(x.default.mark((function e(){var t;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,zb();case 2:return t=e.sent,this.msgrt.setGameData(t),a.setDankLog(t.diagnostic),e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"_createSplash",value:(d=A.default(x.default.mark((function e(t,n){var r,i,s,o,d=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(t);case 2:return r=e.sent,i=new r(LA(LA({},this.options),{},{isConsentDomain:n,version:Ui.version}),t,this._parentDomain),e.next=6,Yb();case 6:s=e.sent,o=s.enabled,i.on("playClick",function(){var e=this;if(k.default(this,d),n){var t=new Date;t.setDate(t.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(t.toUTCString(),"; path=/")}this._hideCMPButton(),o?window.gdsdk.showAd(a.AdType.Interstitial,{position:"preroll"}).catch(function(t){k.default(this,e),i.hide()}.bind(this)):(function(){k.default(this,e)}.bind(this),this.showAd(a.AdType.Interstitial,{position:"preroll"}).catch(function(t){k.default(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(){k.default(this,d),i.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){k.default(this,d),i.hide()}.bind(this));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(o=A.default(x.default.mark((function e(t,n){var r,a,i,s,o=this;return x.default.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(LA(LA({},this.options),{},{isConsentDomain:n,version:Ui.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){k.default(this,o),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 o.apply(this,arguments)})},{key:"_createPromo",value:(s=A.default(x.default.mark((function e(t,n){var r,a,i,s,o=this;return x.default.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(LA(LA({},this.options),{},{isConsentDomain:n,version:Ui.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){k.default(this,o),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(a.AdType.Interstitial).catch(function(){k.default(this,e)}.bind(this))}},{key:"showAd",value:(i=A.default(x.default.mark((function e(t){var n,r=this,a=arguments;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(a,i){var s,o,d,u;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o={adType:t,params:n,adTimestamp:r.adRequestTimer},Gi("gd-adflow adRequest on Start",o),e.next=5,r.sdkReady;case 5:return d=e.sent,e.next=8,r.videoAdReady;case 8:if(null!==(s=r._gameData.lp)&&void 0!==s&&s.load||r._sendLoadedEvent(),r._sendGamedockGamePlay(),r._rejectAdIfGameBlocked({gameData:d,adRequest:o}),r._rejectAdIfAdDisabled({gameData:d,adRequest:o}),r._rejectAdIfUnsupportedType({adRequest:o}),r._rejectAdIfRewardedDisabled({gameData:d,adRequest:o}),null!=n&&n.isGift||r._rejectAdIfAdRateHits({gameData:d,adRequest:o}),r.adInstance.attachAfgPosition(o),!r.adFlowRunning){e.next=18;break}return e.abrupt("return",a());case 18:return r.adFlowRunning=!0,u=new PA(r),e.next=22,u.runAdFlow(o);case 22:r.adFlowRunning=!1,a(),r._post_message({topic:"adrequest.instream"}),e.next=32;break;case 27:e.prev=27,e.t0=e.catch(0),r.adFlowRunning=!1,r.onResumeGame(e.t0.message,"warning"),i(e.t0.message);case 32:case"end":return e.stop()}}),e,null,[[0,27]])})));return function(t,n){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"_giveGift",value:function(){var e,t,n,r,a;null!==(e=this._gameData)&&void 0!==e&&null!==(t=e.gft)&&void 0!==t&&t.enabled&&(null===(n=this._gameData)||void 0===n||null===(r=n.gft)||void 0===r||null===(a=r.durations[this._giftCount])||void 0===a?void 0:a.after)===this.adInstance.adMidrollCount&&this.decideToGiveAGift()}},{key:"_setAdRequestTimer",value:function(){this.adRequestTimer=Date.now()}},{key:"clearSession",value:function(){this.adInstance.clearSession()}},{key:"_attachAfgFallback",value:function(e){var t=e.gameData,n=e.adRequest;if(!t.afg_disabled&&!n.params.hasOwnProperty("fallback_adsense"))switch(n.params.position){case"preroll":case"start":case"next":n.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!==a.AdType.Interstitial&&t.adType!==a.AdType.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=a.AdType.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===a.AdType.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"_rejectAdIfAdRateHits",value:function(e){var t,n,r,i,s,o,d=e.gameData,u=e.adRequest,c=null;u.adType===a.AdType.Interstitial&&null!==(t=d.diagnostic)&&void 0!==t&&null!==(n=t.useMidrollIndex)&&void 0!==n&&n.enabled&&this.adInstance.noPreroll?this.adInstance.adMidrollCount>(null===(r=d.diagnostic)||void 0===r||null===(i=r.useMidrollIndex)||void 0===i?void 0:i.indexes.length)-1||(c=6e4*(null===(s=d.diagnostic)||void 0===s||null===(o=s.useMidrollIndex)||void 0===o?void 0:o.indexes[this.adInstance.adMidrollCount])):c=d.midroll;if(u.adType===a.AdType.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<c)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(r=A.default(x.default.mark((function e(t){var n=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(r,i){var s,o;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return s=e.sent,e.next=6,n.videoAdReady;case 6:if(!s.bloc_gard||!0!==s.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(s.enableAds&&!n._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(t){e.next=14;break}t=a.AdType.Rewarded,e.next=16;break;case 14:if(t===a.AdType.Interstitial||t===a.AdType.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+t);case 16:if(t!==a.AdType.Rewarded||s.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,n.adInstance.preloadAd(t);case 20:o=e.sent,r(o),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),i(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"cancelAd",value:(n=A.default(x.default.mark((function e(){var t=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(n,r){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{t.adInstance.cancel(),t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),r()}catch(e){t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),n(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"showDisplayAd",value:function(e){var t=this;return new Promise(function(){var n=A.default(x.default.mark((function n(r,a){var i;return x.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,t.sdkReady;case 3:return i=n.sent,n.next=6,t.videoAdReady;case 6:if(!i.dAds.enabled){n.next=13;break}return n.next=9,t.adInstance.loadDisplayAd(e);case 9:t._post_message({topic:"adrequest.display"}),r(),n.next=14;break;case 13:a("Display-Ads are disabled.");case 14:n.next=19;break;case 16:n.prev=16,n.t0=n.catch(0),a(n.t0.message||n.t0);case 19:case"end":return n.stop()}}),n,null,[[0,16]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){var n;this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){console.log("gd-adflow error onResumeGame",e),a.dankLog("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_START";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),this.adInstance&&this.adInstance._hideAddResume(),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||xA({event:"GameStarted",game:this._gameData})}},{key:"onPauseGame",value:function(e,t){var n;this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){a.dankLog("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_PAUSE";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||xA({event:"GamePaused",game:this._gameData})}},{key:"openConsole",value:function(){try{new a.ImplementationTest(this).start(),a.Ls.set("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(k.default(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 r=new ActiveXObject("WScript.Shell");null!==r&&r.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){k.default(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;k.default(this,t);var r=!!(e.innerText.toLowerCase().includes("start")||e.innerText.toLowerCase().includes("play")||e.innerText.toLowerCase().includes("continue")),a=e.getAttribute("href");e.removeAttribute("href"),r||(e.onclick=function(e){return k.default(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(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var i=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:a.getParentUrl()),s=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:a.getParentDomain()),o=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===a.getIframeDepth()?s:a.getTopDomain()),d=(e||n)&&r.loaderEnabled,u=(e||n)&&r.loaderEnabled,c=(e||n)&&r.loaderEnabled,l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:d,noLoadedEvent:u,noBlockerEvent:c,noPreroll:m,parentURL:i,parentDomain:s,topDomain:o&&o.length?o:s,noGAPageView:l,noLotamePageView:h,noGamedockSDK:f,noMinijuegosSDK:p,version:r.version,pauseGameOnStartup:g,depth:a.getIframeDepth(),domainMatched:s===o,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_whichFrame",value:function(){return(this._isMasterGameURL()||this._isExtHostedGameURL())&&!this._isTokenGameURL()?"loader-frame":"game-frame"}},{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 n=new D.default(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new D.default(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var a=new D.default(location.href,!0);if(!a.query.gd_zone_config)return;e=a.query.gd_zone_config}return JSON.parse(u.Base64.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new dA(t).splash()}},{key:"_createPrerollPromoTemplate",value:(t=A.default(x.default.mark((function e(t){var n,r,a,i,s;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null===(n=t.promo)||void 0===n?void 0:n[null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll],s=new oA(i),e.abrupt("return",s.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(u.Base64.encode(JSON.stringify(e)))}catch(e){}try{var n=new D.default(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(j.default.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new D.default(e,!0);return n.query=LA(LA({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return u.Base64.encode(JSON.stringify(e))}},{key:"session",value:function(){var e=this;return new Promise(function(){var t=A.default(x.default.mark((function t(n,r){var a;return x.default.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:a=e._gameData,n({ads:{display:{enabled:a.dAds.enabled},rewarded:{enabled:a.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,n){return t.apply(this,arguments)}}())}},{key:"sendGenericEvent",value:function(e){console.log("Received generic event",e,this._isMasterGameURL());try{var t,n;if("track-milestone"==e.eventName)MA.tracking.trackEvent("milestoneAchieved",{pageId:this.options.gameId,pageType:"game",isAuthorized:null===(t=e.data)||void 0===t?void 0:t.isAuthorized,milestoneDescription:null===(n=e.data)||void 0===n?void 0:n.milestoneDescription})}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 k.default(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,n=e.topic,r=e.data,a=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var i=window.top||window.parent;i&&i.postMessage({source:"gdsdk",topic:n,data:r},a)}catch(e){console.error((null==e?void 0:e.message)||e)}}},{key:"decideToGiveAGift",value:function(){var e=this;try{var t,n=null===(t=this._gameData)||void 0===t?void 0:t.gft,r=setInterval(A.default(x.default.mark((function t(){var n=this;return x.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.adInstance.requestRunning||e.adFlowRunning?console.log("Advertisement already running..."):(Gi("gd-adflow WILL GIVE GIFT!!!"),e.showAd(a.AdType.Interstitial,{position:"midroll",isGift:!0}).catch(function(e){k.default(this,n)}.bind(this)),clearInterval(r),e._giftCount++);case 1:case"end":return t.stop()}}),t,this)}))),1e3*n.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}}]),e}(),NA={},BA=function(e){try{if(e.skipForward)return void Gi("gd-adflow fw-skip-forward",e);if(Gi("gd-adflow fw-forwarding",e),NA.source){var t={type:"gd-sdk-on-event",event:e};NA.source.postMessage(t,NA.origin)}}catch(e){console.log("gd-sdk forwardEvent err",e)}},qA=function(){BA({name:"SDK_READY",status:"success",message:"Everything is ready."}),BA({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),BA({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},FA=function(e){window.addEventListener("message",(function(t){var n=t.data,r=t.origin,a=t.source,i=n.type,s=n.method,o=n.options;if("gd-sdk-self"!==i){if("gd-sdk"===i){if(!NA.source&&"init"===s)return function(e){var t=e.source,n=e.origin;NA={source:t,origin:n}}({source:a,origin:r}),void qA();var d=e[s];d&&A.default(x.default.mark((function t(){var n,r=this;return x.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,function(){k.default(this,r),"showAd"===s&&Bi.firstAdapterModeAdsense&&"rewarded"!==o.adType&&(console.log("promo-test, set first adapter to adssense 3"),o.params=o.params?o.params:{},o.params.adapter="adsense")}.bind(this),!(n=d.apply(e,Object.values(o)))||!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 u={type:"gd-sdk",method:s,options:o};window.postMessage(u,"https://html5.gamedistribution.com")}}),!1)},VA=function(e){!function(e){var t=e.onEvent;e.onEvent=function(e){BA(e),t.apply(this,arguments)}}(e);var t=new GA(e);return FA(t),t},WA=function(e){try{var t=qb(e);e.gameId||t.send("nogameid",{message:"".concat(Mg.parentURL)})}catch(e){}},HA={create:function(){var e=A.default(x.default.mark((function e(t){var n,r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,WA(t),Bb=qb(Vb=t),e.next=5,a_();case 5:return n=e.sent,r=n?t_(t):VA(t),Jb(),e.abrupt("return",r);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",VA(t));case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(t){return e.apply(this,arguments)}}()};function zA(){return(zA=A.default(x.default.mark((function e(t,n){var r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,e_();case 2:if(!e.sent){e.next=7;break}e.t0=window.gdsdk,e.next=10;break;case 7:return e.next=9,$A(t);case 9:e.t0=e.sent;case 10:return r=e.t0,e.abrupt("return",n(r));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var KA=!1;function $A(e){var t=this;return new Promise(function(n,r){var a=this;if(k.default(this,t),UA)return n(UA);if(KA)var i=setInterval(function(){k.default(this,a),UA&&(KA=!1,clearInterval(i),n(UA))}.bind(this),100);else KA=!0,HA.create(e).then(function(e){k.default(this,a),UA=e,e._sendSDKReady(),KA=!1,n(UA)}.bind(this))}.bind(this))}var QA,YA=($A(QA=function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":E.default(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===E.default(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 zA.apply(this,arguments)}(QA,e)}});function JA(){var e=this;this.AdType=a.AdType,this.preloadAd=function(e){var t=this;return YA.invoke(function(n){return k.default(this,t),n.preloadAd(e)}.bind(this))},this.showAd=function(){var e=A.default(x.default.mark((function e(t,n){var r=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",YA.invoke(function(e){var i=this;if(k.default(this,r),t===a.AdType.Display)return e.showDisplayAd(n);return function(){k.default(this,i)}.bind(this),e.showAd(t,{})}.bind(this)));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),this.cancelAd=function(){var e=this;return YA.invoke(function(t){return k.default(this,e),t.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return YA.invoke(function(t){return k.default(this,e),t.openConsole()}.bind(this))},this.getSession=function(){var e=this;return YA.invoke(function(t){return k.default(this,e),t.session()}.bind(this))},this.sendEvent=function(e){var t=this;return YA.invoke(function(n){return k.default(this,t),n.sendGenericEvent(e)}.bind(this))},this.leaderboard={show:function(){k.default(this,e),Tm.showLeaderboard()}.bind(this),addScore:function(t){k.default(this,e),Tm.addScore(t)}.bind(this)}}JA.prototype=new function(){this.showBanner=function(){var e=this;return YA.invoke(function(t){return k.default(this,e),t.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new JA,window.gdApi=window.gdsdk;
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/newArrowCheck"),n=require("@babel/runtime/helpers/typeof"),r=require("@babel/runtime/regenerator"),a=require("@bygd/gd-sdk-era/dist/default"),i=require("@babel/runtime/helpers/classCallCheck"),s=require("@babel/runtime/helpers/defineProperty"),o=require("@babel/runtime/helpers/createClass"),u=require("url-parse"),d=require("js-base64"),c=require("validator"),l=require("is-valid-domain"),h=require("get-value"),f=require("set-value"),p=require("lodash.clonedeep"),m=require("can-autoplay"),g=require("is-plain-object"),v=require("querystringify"),y=require("lodash.merge"),b=require("events"),_=require("uuid");function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var A=w(e),k=w(t),E=w(n),x=w(r),S=w(i),R=w(s),T=w(o),D=w(u),O=w(c),I=w(l),P=w(h),C=w(f),L=w(p),U=w(m),j=w(v),M=w(y),q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},B=function(e){return e&&e.Math==Math&&e},G=B("object"==typeof globalThis&&globalThis)||B("object"==typeof window&&window)||B("object"==typeof self&&self)||B("object"==typeof q&&q)||Function("return this")(),N={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},F=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},V=F,W=function(e,t,n){if(V(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,a){return e.call(t,n,r,a)}}return function(){return e.apply(t,arguments)}},K=function(e){try{return!!e()}catch(e){return!0}},H={}.toString,z=function(e){return H.call(e).slice(8,-1)},$=z,Q="".split,Y=K((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==$(e)?Q.call(e,""):Object(e)}:Object,J=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},X=J,Z=function(e){return Object(X(e))},ee=Math.ceil,te=Math.floor,ne=function(e){return isNaN(e=+e)?0:(e>0?te:ee)(e)},re=ne,ae=Math.min,ie=function(e){return e>0?ae(re(e),9007199254740991):0},se=function(e){return"object"==typeof e?null!==e:"function"==typeof e},oe=z,ue=Array.isArray||function(e){return"Array"==oe(e)},de={exports:{}},ce=!K((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),le={},he=se,fe=G.document,pe=he(fe)&&he(fe.createElement),me=function(e){return pe?fe.createElement(e):{}},ge=me,ve=!ce&&!K((function(){return 7!=Object.defineProperty(ge("div"),"a",{get:function(){return 7}}).a})),ye=se,be=function(e){if(!ye(e))throw TypeError(String(e)+" is not an object");return e},_e=se,we=function(e,t){if(!_e(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!_e(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!_e(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!_e(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},Ae=ce,ke=ve,Ee=be,xe=we,Se=Object.defineProperty;le.f=Ae?Se:function(e,t,n){if(Ee(e),t=xe(t,!0),Ee(n),ke)try{return Se(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Re=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Te=le,De=Re,Oe=ce?function(e,t,n){return Te.f(e,t,De(1,n))}:function(e,t,n){return e[t]=n,e},Ie=G,Pe=Oe,Ce=function(e,t){try{Pe(Ie,e,t)}catch(n){Ie[e]=t}return t},Le=Ce,Ue=G["__core-js_shared__"]||Le("__core-js_shared__",{}),je=Ue;(de.exports=function(e,t){return je[e]||(je[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var Me={}.hasOwnProperty,qe=function(e,t){return Me.call(e,t)},Be=0,Ge=Math.random(),Ne=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++Be+Ge).toString(36)},Fe=K,Ve=!!Object.getOwnPropertySymbols&&!Fe((function(){return!String(Symbol())})),We=Ve&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ke=G,He=de.exports,ze=qe,$e=Ne,Qe=Ve,Ye=We,Je=He("wks"),Xe=Ke.Symbol,Ze=Ye?Xe:Xe&&Xe.withoutSetter||$e,et=function(e){return ze(Je,e)||(Qe&&ze(Xe,e)?Je[e]=Xe[e]:Je[e]=Ze("Symbol."+e)),Je[e]},tt=se,nt=ue,rt=et("species"),at=function(e,t){var n;return nt(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!nt(n.prototype)?tt(n)&&null===(n=n[rt])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},it=W,st=Y,ot=Z,ut=ie,dt=at,ct=[].push,lt=function(e){var t=1==e,n=2==e,r=3==e,a=4==e,i=6==e,s=5==e||i;return function(o,u,d,c){for(var l,h,f=ot(o),p=st(f),m=it(u,d,3),g=ut(p.length),v=0,y=c||dt,b=t?y(o,g):n?y(o,0):void 0;g>v;v++)if((s||v in p)&&(h=m(l=p[v],v,f),e))if(t)b[v]=h;else if(h)switch(e){case 3:return!0;case 5:return l;case 6:return v;case 2:ct.call(b,l)}else if(a)return!1;return i?-1:r||a?a:b}},ht={forEach:lt(0),map:lt(1),filter:lt(2),some:lt(3),every:lt(4),find:lt(5),findIndex:lt(6)},ft=K,pt=function(e,t){var n=[][e];return!!n&&ft((function(){n.call(null,t||function(){throw 1},1)}))},mt=ce,gt=K,vt=qe,yt=Object.defineProperty,bt={},_t=function(e){throw e},wt=function(e,t){if(vt(bt,e))return bt[e];t||(t={});var n=[][e],r=!!vt(t,"ACCESSORS")&&t.ACCESSORS,a=vt(t,0)?t[0]:_t,i=vt(t,1)?t[1]:void 0;return bt[e]=!!n&&!gt((function(){if(r&&!mt)return!0;var e={length:-1};r?yt(e,1,{enumerable:!0,get:_t}):e[1]=1,n.call(e,a,i)}))},At=ht.forEach,kt=wt,Et=pt("forEach"),xt=kt("forEach"),St=G,Rt=N,Tt=Et&&xt?[].forEach:function(e){return At(this,e,arguments.length>1?arguments[1]:void 0)},Dt=Oe;for(var Ot in Rt){var It=St[Ot],Pt=It&&It.prototype;if(Pt&&Pt.forEach!==Tt)try{Dt(Pt,"forEach",Tt)}catch(e){Pt.forEach=Tt}}var Ct={},Lt={},Ut={}.propertyIsEnumerable,jt=Object.getOwnPropertyDescriptor,Mt=jt&&!Ut.call({1:2},1);Lt.f=Mt?function(e){var t=jt(this,e);return!!t&&t.enumerable}:Ut;var qt=Y,Bt=J,Gt=function(e){return qt(Bt(e))},Nt=ce,Ft=Lt,Vt=Re,Wt=Gt,Kt=we,Ht=qe,zt=ve,$t=Object.getOwnPropertyDescriptor;Ct.f=Nt?$t:function(e,t){if(e=Wt(e),t=Kt(t,!0),zt)try{return $t(e,t)}catch(e){}if(Ht(e,t))return Vt(!Ft.f.call(e,t),e[t])};var Qt={exports:{}},Yt=Ue,Jt=Function.toString;"function"!=typeof Yt.inspectSource&&(Yt.inspectSource=function(e){return Jt.call(e)});var Xt,Zt,en,tn=Yt.inspectSource,nn=tn,rn=G.WeakMap,an="function"==typeof rn&&/native code/.test(nn(rn)),sn=de.exports,on=Ne,un=sn("keys"),dn=function(e){return un[e]||(un[e]=on(e))},cn={},ln=an,hn=se,fn=Oe,pn=qe,mn=dn,gn=cn,vn=G.WeakMap;if(ln){var yn=new vn,bn=yn.get,_n=yn.has,wn=yn.set;Xt=function(e,t){return wn.call(yn,e,t),t},Zt=function(e){return bn.call(yn,e)||{}},en=function(e){return _n.call(yn,e)}}else{var An=mn("state");gn[An]=!0,Xt=function(e,t){return fn(e,An,t),t},Zt=function(e){return pn(e,An)?e[An]:{}},en=function(e){return pn(e,An)}}var kn={set:Xt,get:Zt,has:en,enforce:function(e){return en(e)?Zt(e):Xt(e,{})},getterFor:function(e){return function(t){var n;if(!hn(t)||(n=Zt(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},En=G,xn=Oe,Sn=qe,Rn=Ce,Tn=tn,Dn=kn.get,On=kn.enforce,In=String(String).split("String");(Qt.exports=function(e,t,n,r){var a=!!r&&!!r.unsafe,i=!!r&&!!r.enumerable,s=!!r&&!!r.noTargetGet;"function"==typeof n&&("string"!=typeof t||Sn(n,"name")||xn(n,"name",t),On(n).source=In.join("string"==typeof t?t:"")),e!==En?(a?!s&&e[t]&&(i=!0):delete e[t],i?e[t]=n:xn(e,t,n)):i?e[t]=n:Rn(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&Dn(this).source||Tn(this)}));var Pn=G,Cn=Pn,Ln=G,Un=function(e){return"function"==typeof e?e:void 0},jn=function(e,t){return arguments.length<2?Un(Cn[e])||Un(Ln[e]):Cn[e]&&Cn[e][t]||Ln[e]&&Ln[e][t]},Mn={},qn=ne,Bn=Math.max,Gn=Math.min,Nn=function(e,t){var n=qn(e);return n<0?Bn(n+t,0):Gn(n,t)},Fn=Gt,Vn=ie,Wn=Nn,Kn=function(e){return function(t,n,r){var a,i=Fn(t),s=Vn(i.length),o=Wn(r,s);if(e&&n!=n){for(;s>o;)if((a=i[o++])!=a)return!0}else for(;s>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},Hn={includes:Kn(!0),indexOf:Kn(!1)},zn=qe,$n=Gt,Qn=Hn.indexOf,Yn=cn,Jn=function(e,t){var n,r=$n(e),a=0,i=[];for(n in r)!zn(Yn,n)&&zn(r,n)&&i.push(n);for(;t.length>a;)zn(r,n=t[a++])&&(~Qn(i,n)||i.push(n));return i},Xn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Zn=Jn,er=Xn.concat("length","prototype");Mn.f=Object.getOwnPropertyNames||function(e){return Zn(e,er)};var tr={};tr.f=Object.getOwnPropertySymbols;var nr=Mn,rr=tr,ar=be,ir=jn("Reflect","ownKeys")||function(e){var t=nr.f(ar(e)),n=rr.f;return n?t.concat(n(e)):t},sr=qe,or=ir,ur=Ct,dr=le,cr=function(e,t){for(var n=or(t),r=dr.f,a=ur.f,i=0;i<n.length;i++){var s=n[i];sr(e,s)||r(e,s,a(t,s))}},lr=K,hr=/#|\.prototype\./,fr=function(e,t){var n=mr[pr(e)];return n==vr||n!=gr&&("function"==typeof t?lr(t):!!t)},pr=fr.normalize=function(e){return String(e).replace(hr,".").toLowerCase()},mr=fr.data={},gr=fr.NATIVE="N",vr=fr.POLYFILL="P",yr=fr,br=G,_r=Ct.f,wr=Oe,Ar=Qt.exports,kr=Ce,Er=cr,xr=yr,Sr=function(e,t){var n,r,a,i,s,o=e.target,u=e.global,d=e.stat;if(n=u?br:d?br[o]||kr(o,{}):(br[o]||{}).prototype)for(r in t){if(i=t[r],a=e.noTargetGet?(s=_r(n,r))&&s.value:n[r],!xr(u?r:o+(d?".":"#")+r,e.forced)&&void 0!==a){if(typeof i==typeof a)continue;Er(i,a)}(e.sham||a&&a.sham)&&wr(i,"sham",!0),Ar(n,r,i,e)}},Rr=Jn,Tr=Xn,Dr=Object.keys||function(e){return Rr(e,Tr)},Or=Z,Ir=Dr;Sr({target:"Object",stat:!0,forced:K((function(){Ir(1)}))},{keys:function(e){return Ir(Or(e))}});var Pr=Array.isArray,Cr=Object.prototype.toString,Lr=Pr||function(e){return!!e&&"[object Array]"==Cr.call(e)},Ur={name:"@bygd/gd-sdk-pes",version:"1.29.3",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"}},jr=function(e){var t=Mr("object"===E.default(e)?e:a.parseJSON(e));return t&&t.version?Ur.version>=t.version?t:void 0:t},Mr=function(e){var t=this;if(!Lr(e)||0===e.length)return e;if(1===e.length)return e[0];var n=0;e.forEach(function(e){k.default(this,t),e.weight=e.weight||1,n+=e.weight}.bind(this));var r=Math.floor(Math.random()*Math.floor(n));n=0;for(var a=0;a<e.length;a++){var i=e[a];if(r<(n+=i.weight))return i}},qr=function(){var e;(e=console).log.apply(e,arguments)};JSON.stringify({adapters:{default:["ima","adsense","ima","adsense"],preroll:["ima","adsense","ima","adsense"],midroll:["ima","adsense","ima","adsense"],rewarded:["ima","adsense","ima","adsense"]}}),JSON.stringify({adapters:{default:["ima","adsense","ima","adsense"],preroll:["ima","adsense","ima"],midroll:["ima","adsense","ima"],rewarded:["ima","adsense","ima","adsense"]}});var Br,Gr={},Nr=le,Fr=be,Vr=Dr,Wr=ce?Object.defineProperties:function(e,t){Fr(e);for(var n,r=Vr(t),a=r.length,i=0;a>i;)Nr.f(e,n=r[i++],t[n]);return e},Kr=jn("document","documentElement"),Hr=be,zr=Wr,$r=Xn,Qr=cn,Yr=Kr,Jr=me,Xr=dn("IE_PROTO"),Zr=function(){},ea=function(e){return"<script>"+e+"<\/script>"},ta=function(){try{Br=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;ta=Br?function(e){e.write(ea("")),e.close();var t=e.parentWindow.Object;return e=null,t}(Br):((t=Jr("iframe")).style.display="none",Yr.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(ea("document.F=Object")),e.close(),e.F);for(var n=$r.length;n--;)delete ta.prototype[$r[n]];return ta()};Qr[Xr]=!0;var na=Object.create||function(e,t){var n;return null!==e?(Zr.prototype=Hr(e),n=new Zr,Zr.prototype=null,n[Xr]=e):n=ta(),void 0===t?n:zr(n,t)},ra={},aa=Gt,ia=Mn.f,sa={}.toString,oa="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];ra.f=function(e){return oa&&"[object Window]"==sa.call(e)?function(e){try{return ia(e)}catch(e){return oa.slice()}}(e):ia(aa(e))};var ua={},da=et;ua.f=da;var ca=Pn,la=qe,ha=ua,fa=le.f,pa=function(e){var t=ca.Symbol||(ca.Symbol={});la(t,e)||fa(t,e,{value:ha.f(e)})},ma=le.f,ga=qe,va=et("toStringTag"),ya=function(e,t,n){e&&!ga(e=n?e:e.prototype,va)&&ma(e,va,{configurable:!0,value:t})},ba=Sr,_a=G,wa=jn,Aa=ce,ka=Ve,Ea=We,xa=K,Sa=qe,Ra=ue,Ta=se,Da=be,Oa=Z,Ia=Gt,Pa=we,Ca=Re,La=na,Ua=Dr,ja=Mn,Ma=ra,qa=tr,Ba=Ct,Ga=le,Na=Lt,Fa=Oe,Va=Qt.exports,Wa=de.exports,Ka=cn,Ha=Ne,za=et,$a=ua,Qa=pa,Ya=ya,Ja=kn,Xa=ht.forEach,Za=dn("hidden"),ei=za("toPrimitive"),ti=Ja.set,ni=Ja.getterFor("Symbol"),ri=Object.prototype,ai=_a.Symbol,ii=wa("JSON","stringify"),si=Ba.f,oi=Ga.f,ui=Ma.f,di=Na.f,ci=Wa("symbols"),li=Wa("op-symbols"),hi=Wa("string-to-symbol-registry"),fi=Wa("symbol-to-string-registry"),pi=Wa("wks"),mi=_a.QObject,gi=!mi||!mi.prototype||!mi.prototype.findChild,vi=Aa&&xa((function(){return 7!=La(oi({},"a",{get:function(){return oi(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=si(ri,t);r&&delete ri[t],oi(e,t,n),r&&e!==ri&&oi(ri,t,r)}:oi,yi=function(e,t){var n=ci[e]=La(ai.prototype);return ti(n,{type:"Symbol",tag:e,description:t}),Aa||(n.description=t),n},bi=Ea?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof ai},_i=function(e,t,n){e===ri&&_i(li,t,n),Da(e);var r=Pa(t,!0);return Da(n),Sa(ci,r)?(n.enumerable?(Sa(e,Za)&&e[Za][r]&&(e[Za][r]=!1),n=La(n,{enumerable:Ca(0,!1)})):(Sa(e,Za)||oi(e,Za,Ca(1,{})),e[Za][r]=!0),vi(e,r,n)):oi(e,r,n)},wi=function(e,t){Da(e);var n=Ia(t),r=Ua(n).concat(xi(n));return Xa(r,(function(t){Aa&&!Ai.call(n,t)||_i(e,t,n[t])})),e},Ai=function(e){var t=Pa(e,!0),n=di.call(this,t);return!(this===ri&&Sa(ci,t)&&!Sa(li,t))&&(!(n||!Sa(this,t)||!Sa(ci,t)||Sa(this,Za)&&this[Za][t])||n)},ki=function(e,t){var n=Ia(e),r=Pa(t,!0);if(n!==ri||!Sa(ci,r)||Sa(li,r)){var a=si(n,r);return!a||!Sa(ci,r)||Sa(n,Za)&&n[Za][r]||(a.enumerable=!0),a}},Ei=function(e){var t=ui(Ia(e)),n=[];return Xa(t,(function(e){Sa(ci,e)||Sa(Ka,e)||n.push(e)})),n},xi=function(e){var t=e===ri,n=ui(t?li:Ia(e)),r=[];return Xa(n,(function(e){!Sa(ci,e)||t&&!Sa(ri,e)||r.push(ci[e])})),r};(ka||(Va((ai=function(){if(this instanceof ai)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=Ha(e),n=function(e){this===ri&&n.call(li,e),Sa(this,Za)&&Sa(this[Za],t)&&(this[Za][t]=!1),vi(this,t,Ca(1,e))};return Aa&&gi&&vi(ri,t,{configurable:!0,set:n}),yi(t,e)}).prototype,"toString",(function(){return ni(this).tag})),Va(ai,"withoutSetter",(function(e){return yi(Ha(e),e)})),Na.f=Ai,Ga.f=_i,Ba.f=ki,ja.f=Ma.f=Ei,qa.f=xi,$a.f=function(e){return yi(za(e),e)},Aa&&(oi(ai.prototype,"description",{configurable:!0,get:function(){return ni(this).description}}),Va(ri,"propertyIsEnumerable",Ai,{unsafe:!0}))),ba({global:!0,wrap:!0,forced:!ka,sham:!ka},{Symbol:ai}),Xa(Ua(pi),(function(e){Qa(e)})),ba({target:"Symbol",stat:!0,forced:!ka},{for:function(e){var t=String(e);if(Sa(hi,t))return hi[t];var n=ai(t);return hi[t]=n,fi[n]=t,n},keyFor:function(e){if(!bi(e))throw TypeError(e+" is not a symbol");if(Sa(fi,e))return fi[e]},useSetter:function(){gi=!0},useSimple:function(){gi=!1}}),ba({target:"Object",stat:!0,forced:!ka,sham:!Aa},{create:function(e,t){return void 0===t?La(e):wi(La(e),t)},defineProperty:_i,defineProperties:wi,getOwnPropertyDescriptor:ki}),ba({target:"Object",stat:!0,forced:!ka},{getOwnPropertyNames:Ei,getOwnPropertySymbols:xi}),ba({target:"Object",stat:!0,forced:xa((function(){qa.f(1)}))},{getOwnPropertySymbols:function(e){return qa.f(Oa(e))}}),ii)&&ba({target:"JSON",stat:!0,forced:!ka||xa((function(){var e=ai();return"[null]"!=ii([e])||"{}"!=ii({a:e})||"{}"!=ii(Object(e))}))},{stringify:function(e,t,n){for(var r,a=[e],i=1;arguments.length>i;)a.push(arguments[i++]);if(r=t,(Ta(t)||void 0!==e)&&!bi(e))return Ra(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!bi(t))return t}),a[1]=t,ii.apply(null,a)}});ai.prototype[ei]||Fa(ai.prototype,ei,ai.prototype.valueOf),Ya(ai,"Symbol"),Ka[Za]=!0;var Si,Ri,Ti=jn("navigator","userAgent")||"",Di=Ti,Oi=G.process,Ii=Oi&&Oi.versions,Pi=Ii&&Ii.v8;Pi?Ri=(Si=Pi.split("."))[0]+Si[1]:Di&&(!(Si=Di.match(/Edge\/(\d+)/))||Si[1]>=74)&&(Si=Di.match(/Chrome\/(\d+)/))&&(Ri=Si[1]);var Ci=Ri&&+Ri,Li=K,Ui=Ci,ji=et("species"),Mi=function(e){return Ui>=51||!Li((function(){var t=[];return(t.constructor={})[ji]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},qi=Sr,Bi=ht.filter,Gi=wt,Ni=Mi("filter"),Fi=Gi("filter");qi({target:"Array",proto:!0,forced:!Ni||!Fi},{filter:function(e){return Bi(this,e,arguments.length>1?arguments[1]:void 0)}});var Vi=Sr,Wi=K,Ki=Gt,Hi=Ct.f,zi=ce,$i=Wi((function(){Hi(1)}));Vi({target:"Object",stat:!0,forced:!zi||$i,sham:!zi},{getOwnPropertyDescriptor:function(e,t){return Hi(Ki(e),t)}});var Qi=we,Yi=le,Ji=Re,Xi=function(e,t,n){var r=Qi(t);r in e?Yi.f(e,r,Ji(0,n)):e[r]=n},Zi=ir,es=Gt,ts=Ct,ns=Xi;Sr({target:"Object",stat:!0,sham:!ce},{getOwnPropertyDescriptors:function(e){for(var t,n,r=es(e),a=ts.f,i=Zi(r),s={},o=0;i.length>o;)void 0!==(n=a(r,t=i[o++]))&&ns(s,t,n);return s}});var rs=Sr,as=se,is=ue,ss=Nn,os=ie,us=Gt,ds=Xi,cs=et,ls=wt,hs=Mi("slice"),fs=ls("slice",{ACCESSORS:!0,0:0,1:2}),ps=cs("species"),ms=[].slice,gs=Math.max;rs({target:"Array",proto:!0,forced:!hs||!fs},{slice:function(e,t){var n,r,a,i=us(this),s=os(i.length),o=ss(e,s),u=ss(void 0===t?s:t,s);if(is(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!is(n.prototype)?as(n)&&null===(n=n[ps])&&(n=void 0):n=void 0,n===Array||void 0===n))return ms.call(i,o,u);for(r=new(void 0===n?Array:n)(gs(u-o,0)),a=0;o<u;o++,a++)o in i&&ds(r,a,i[o]);return r.length=a,r}});var vs=be,ys=function(e,t,n,r){try{return r?t(vs(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&vs(a.call(e)),t}},bs={},_s=bs,ws=et("iterator"),As=Array.prototype,ks=function(e){return void 0!==e&&(_s.Array===e||As[ws]===e)},Es={};Es[et("toStringTag")]="z";var xs="[object z]"===String(Es),Ss=xs,Rs=z,Ts=et("toStringTag"),Ds="Arguments"==Rs(function(){return arguments}()),Os=Ss?Rs:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Ts))?n:Ds?Rs(t):"Object"==(r=Rs(t))&&"function"==typeof t.callee?"Arguments":r},Is=Os,Ps=bs,Cs=et("iterator"),Ls=function(e){if(null!=e)return e[Cs]||e["@@iterator"]||Ps[Is(e)]},Us=W,js=Z,Ms=ys,Bs=ks,Gs=ie,Ns=Xi,Fs=Ls,Vs=function(e){var t,n,r,a,i,s,o=js(e),u="function"==typeof this?this:Array,d=arguments.length,c=d>1?arguments[1]:void 0,l=void 0!==c,h=Fs(o),f=0;if(l&&(c=Us(c,d>2?arguments[2]:void 0,2)),null==h||u==Array&&Bs(h))for(n=new u(t=Gs(o.length));t>f;f++)s=l?c(o[f],f):o[f],Ns(n,f,s);else for(i=(a=h.call(o)).next,n=new u;!(r=i.call(a)).done;f++)s=l?Ms(a,c,[r.value,f],!0):r.value,Ns(n,f,s);return n.length=f,n},Ws=et("iterator"),Ks=!1;try{var Hs=0,zs={next:function(){return{done:!!Hs++}},return:function(){Ks=!0}};zs[Ws]=function(){return this},Array.from(zs,(function(){throw 2}))}catch(e){}var $s=function(e,t){if(!t&&!Ks)return!1;var n=!1;try{var r={};r[Ws]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Qs=Vs;Sr({target:"Array",stat:!0,forced:!$s((function(e){Array.from(e)}))},{from:Qs});var Ys,Js,Xs,Zs=ne,eo=J,to=function(e){return function(t,n){var r,a,i=String(eo(t)),s=Zs(n),o=i.length;return s<0||s>=o?e?"":void 0:(r=i.charCodeAt(s))<55296||r>56319||s+1===o||(a=i.charCodeAt(s+1))<56320||a>57343?e?i.charAt(s):r:e?i.slice(s,s+2):a-56320+(r-55296<<10)+65536}},no={codeAt:to(!1),charAt:to(!0)},ro=!K((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),ao=qe,io=Z,so=ro,oo=dn("IE_PROTO"),uo=Object.prototype,co=so?Object.getPrototypeOf:function(e){return e=io(e),ao(e,oo)?e[oo]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?uo:null},lo=co,ho=Oe,fo=qe,po=et("iterator"),mo=!1;[].keys&&("next"in(Xs=[].keys())?(Js=lo(lo(Xs)))!==Object.prototype&&(Ys=Js):mo=!0),null==Ys&&(Ys={}),fo(Ys,po)||ho(Ys,po,(function(){return this}));var go={IteratorPrototype:Ys,BUGGY_SAFARI_ITERATORS:mo},vo=go.IteratorPrototype,yo=na,bo=Re,_o=ya,wo=bs,Ao=function(){return this},ko=function(e,t,n){var r=t+" Iterator";return e.prototype=yo(vo,{next:bo(1,n)}),_o(e,r,!1),wo[r]=Ao,e},Eo=se,xo=be,So=function(e){if(!Eo(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},Ro=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return xo(n),So(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),To=Sr,Do=ko,Oo=co,Io=Ro,Po=ya,Co=Oe,Lo=Qt.exports,Uo=bs,jo=go.IteratorPrototype,Mo=go.BUGGY_SAFARI_ITERATORS,qo=et("iterator"),Bo=function(){return this},Go=function(e,t,n,r,a,i,s){Do(n,t,r);var o,u,d,c=function(e){if(e===a&&m)return m;if(!Mo&&e in f)return f[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",h=!1,f=e.prototype,p=f[qo]||f["@@iterator"]||a&&f[a],m=!Mo&&p||c(a),g="Array"==t&&f.entries||p;if(g&&(o=Oo(g.call(new e)),jo!==Object.prototype&&o.next&&(Oo(o)!==jo&&(Io?Io(o,jo):"function"!=typeof o[qo]&&Co(o,qo,Bo)),Po(o,l,!0))),"values"==a&&p&&"values"!==p.name&&(h=!0,m=function(){return p.call(this)}),f[qo]!==m&&Co(f,qo,m),Uo[t]=m,a)if(u={values:c("values"),keys:i?m:c("keys"),entries:c("entries")},s)for(d in u)(Mo||h||!(d in f))&&Lo(f,d,u[d]);else To({target:t,proto:!0,forced:Mo||h},u);return u},No=no.charAt,Fo=kn,Vo=Go,Wo=Fo.set,Ko=Fo.getterFor("String Iterator");Vo(String,"String",(function(e){Wo(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=Ko(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=No(n,r),t.index+=e.length,{value:e,done:!1})}));var Ho=Sr,zo=ce,$o=G,Qo=qe,Yo=se,Jo=le.f,Xo=cr,Zo=$o.Symbol;if(zo&&"function"==typeof Zo&&(!("description"in Zo.prototype)||void 0!==Zo().description)){var eu={},tu=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof tu?new Zo(e):void 0===e?Zo():Zo(e);return""===e&&(eu[t]=!0),t};Xo(tu,Zo);var nu=tu.prototype=Zo.prototype;nu.constructor=tu;var ru=nu.toString,au="Symbol(test)"==String(Zo("test")),iu=/^Symbol\((.*)\)[^)]+$/;Jo(nu,"description",{configurable:!0,get:function(){var e=Yo(this)?this.valueOf():this,t=ru.call(e);if(Qo(eu,e))return"";var n=au?t.slice(7,-1):t.replace(iu,"$1");return""===n?void 0:n}}),Ho({global:!0,forced:!0},{Symbol:tu})}pa("iterator");var su=na,ou=le,uu=et("unscopables"),du=Array.prototype;null==du[uu]&&ou.f(du,uu,{configurable:!0,value:su(null)});var cu=function(e){du[uu][e]=!0},lu=Gt,hu=cu,fu=bs,pu=kn,mu=Go,gu=pu.set,vu=pu.getterFor("Array Iterator"),yu=mu(Array,"Array",(function(e,t){gu(this,{type:"Array Iterator",target:lu(e),index:0,kind:t})}),(function(){var e=vu(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values");fu.Arguments=fu.Array,hu("keys"),hu("values"),hu("entries");var bu=G,_u=N,wu=yu,Au=Oe,ku=et,Eu=ku("iterator"),xu=ku("toStringTag"),Su=wu.values;for(var Ru in _u){var Tu=bu[Ru],Du=Tu&&Tu.prototype;if(Du){if(Du[Eu]!==Su)try{Au(Du,Eu,Su)}catch(e){Du[Eu]=Su}if(Du[xu]||Au(Du,xu,Ru),_u[Ru])for(var Ou in wu)if(Du[Ou]!==wu[Ou])try{Au(Du,Ou,wu[Ou])}catch(e){Du[Ou]=wu[Ou]}}}var Iu=Os,Pu=xs?{}.toString:function(){return"[object "+Iu(this)+"]"},Cu=xs,Lu=Qt.exports,Uu=Pu;Cu||Lu(Object.prototype,"toString",Uu,{unsafe:!0});var ju=G.Promise,Mu=Qt.exports,qu=function(e,t,n){for(var r in t)Mu(e,r,t[r],n);return e},Bu=jn,Gu=le,Nu=ce,Fu=et("species"),Vu=function(e){var t=Bu(e),n=Gu.f;Nu&&t&&!t[Fu]&&n(t,Fu,{configurable:!0,get:function(){return this}})},Wu=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},Ku={exports:{}},Hu=be,zu=ks,$u=ie,Qu=W,Yu=Ls,Ju=ys,Xu=function(e,t){this.stopped=e,this.result=t};(Ku.exports=function(e,t,n,r,a){var i,s,o,u,d,c,l,h=Qu(t,n,r?2:1);if(a)i=e;else{if("function"!=typeof(s=Yu(e)))throw TypeError("Target is not iterable");if(zu(s)){for(o=0,u=$u(e.length);u>o;o++)if((d=r?h(Hu(l=e[o])[0],l[1]):h(e[o]))&&d instanceof Xu)return d;return new Xu(!1)}i=s.call(e)}for(c=i.next;!(l=c.call(i)).done;)if("object"==typeof(d=Ju(i,h,l.value,r))&&d&&d instanceof Xu)return d;return new Xu(!1)}).stop=function(e){return new Xu(!0,e)};var Zu,ed,td,nd=be,rd=F,ad=et("species"),id=function(e,t){var n,r=nd(e).constructor;return void 0===r||null==(n=nd(r)[ad])?t:rd(n)},sd=/(iphone|ipod|ipad).*applewebkit/i.test(Ti),od=G,ud=K,dd=z,cd=W,ld=Kr,hd=me,fd=sd,pd=od.location,md=od.setImmediate,gd=od.clearImmediate,vd=od.process,yd=od.MessageChannel,bd=od.Dispatch,_d=0,wd={},Ad=function(e){if(wd.hasOwnProperty(e)){var t=wd[e];delete wd[e],t()}},kd=function(e){return function(){Ad(e)}},Ed=function(e){Ad(e.data)},xd=function(e){od.postMessage(e+"",pd.protocol+"//"+pd.host)};md&&gd||(md=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return wd[++_d]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Zu(_d),_d},gd=function(e){delete wd[e]},"process"==dd(vd)?Zu=function(e){vd.nextTick(kd(e))}:bd&&bd.now?Zu=function(e){bd.now(kd(e))}:yd&&!fd?(td=(ed=new yd).port2,ed.port1.onmessage=Ed,Zu=cd(td.postMessage,td,1)):!od.addEventListener||"function"!=typeof postMessage||od.importScripts||ud(xd)||"file:"===pd.protocol?Zu="onreadystatechange"in hd("script")?function(e){ld.appendChild(hd("script")).onreadystatechange=function(){ld.removeChild(this),Ad(e)}}:function(e){setTimeout(kd(e),0)}:(Zu=xd,od.addEventListener("message",Ed,!1)));var Sd,Rd,Td,Dd,Od,Id,Pd,Cd,Ld={set:md,clear:gd},Ud=G,jd=Ct.f,Md=z,qd=Ld.set,Bd=sd,Gd=Ud.MutationObserver||Ud.WebKitMutationObserver,Nd=Ud.process,Fd=Ud.Promise,Vd="process"==Md(Nd),Wd=jd(Ud,"queueMicrotask"),Kd=Wd&&Wd.value;Kd||(Sd=function(){var e,t;for(Vd&&(e=Nd.domain)&&e.exit();Rd;){t=Rd.fn,Rd=Rd.next;try{t()}catch(e){throw Rd?Dd():Td=void 0,e}}Td=void 0,e&&e.enter()},Vd?Dd=function(){Nd.nextTick(Sd)}:Gd&&!Bd?(Od=!0,Id=document.createTextNode(""),new Gd(Sd).observe(Id,{characterData:!0}),Dd=function(){Id.data=Od=!Od}):Fd&&Fd.resolve?(Pd=Fd.resolve(void 0),Cd=Pd.then,Dd=function(){Cd.call(Pd,Sd)}):Dd=function(){qd.call(Ud,Sd)});var Hd=Kd||function(e){var t={fn:e,next:void 0};Td&&(Td.next=t),Rd||(Rd=t,Dd()),Td=t},zd={},$d=F,Qd=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=$d(t),this.reject=$d(n)};zd.f=function(e){return new Qd(e)};var Yd,Jd,Xd,Zd,ec=be,tc=se,nc=zd,rc=function(e,t){if(ec(e),tc(t)&&t.constructor===e)return t;var n=nc.f(e);return(0,n.resolve)(t),n.promise},ac=G,ic=Sr,sc=G,oc=jn,uc=ju,dc=Qt.exports,cc=qu,lc=ya,hc=Vu,fc=se,pc=F,mc=Wu,gc=z,vc=tn,yc=Ku.exports,bc=$s,_c=id,wc=Ld.set,Ac=Hd,kc=rc,Ec=function(e,t){var n=ac.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))},xc=zd,Sc=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Rc=kn,Tc=yr,Dc=Ci,Oc=et("species"),Ic="Promise",Pc=Rc.get,Cc=Rc.set,Lc=Rc.getterFor(Ic),Uc=uc,jc=sc.TypeError,Mc=sc.document,qc=sc.process,Bc=oc("fetch"),Gc=xc.f,Nc=Gc,Fc="process"==gc(qc),Vc=!!(Mc&&Mc.createEvent&&sc.dispatchEvent),Wc=Tc(Ic,(function(){if(!(vc(Uc)!==String(Uc))){if(66===Dc)return!0;if(!Fc&&"function"!=typeof PromiseRejectionEvent)return!0}if(Dc>=51&&/native code/.test(Uc))return!1;var e=Uc.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[Oc]=t,!(e.then((function(){}))instanceof t)})),Kc=Wc||!bc((function(e){Uc.all(e).catch((function(){}))})),Hc=function(e){var t;return!(!fc(e)||"function"!=typeof(t=e.then))&&t},zc=function(e,t,n){if(!t.notified){t.notified=!0;var r=t.reactions;Ac((function(){for(var a=t.value,i=1==t.state,s=0;r.length>s;){var o,u,d,c=r[s++],l=i?c.ok:c.fail,h=c.resolve,f=c.reject,p=c.domain;try{l?(i||(2===t.rejection&&Jc(e,t),t.rejection=1),!0===l?o=a:(p&&p.enter(),o=l(a),p&&(p.exit(),d=!0)),o===c.promise?f(jc("Promise-chain cycle")):(u=Hc(o))?u.call(o,h,f):h(o)):f(a)}catch(e){p&&!d&&p.exit(),f(e)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&Qc(e,t)}))}},$c=function(e,t,n){var r,a;Vc?((r=Mc.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),sc.dispatchEvent(r)):r={promise:t,reason:n},(a=sc["on"+e])?a(r):"unhandledrejection"===e&&Ec("Unhandled promise rejection",n)},Qc=function(e,t){wc.call(sc,(function(){var n,r=t.value;if(Yc(t)&&(n=Sc((function(){Fc?qc.emit("unhandledRejection",r,e):$c("unhandledrejection",e,r)})),t.rejection=Fc||Yc(t)?2:1,n.error))throw n.value}))},Yc=function(e){return 1!==e.rejection&&!e.parent},Jc=function(e,t){wc.call(sc,(function(){Fc?qc.emit("rejectionHandled",e):$c("rejectionhandled",e,t.value)}))},Xc=function(e,t,n,r){return function(a){e(t,n,a,r)}},Zc=function(e,t,n,r){t.done||(t.done=!0,r&&(t=r),t.value=n,t.state=2,zc(e,t,!0))},el=function(e,t,n,r){if(!t.done){t.done=!0,r&&(t=r);try{if(e===n)throw jc("Promise can't be resolved itself");var a=Hc(n);a?Ac((function(){var r={done:!1};try{a.call(n,Xc(el,e,r,t),Xc(Zc,e,r,t))}catch(n){Zc(e,r,n,t)}})):(t.value=n,t.state=1,zc(e,t,!1))}catch(n){Zc(e,{done:!1},n,t)}}};Wc&&(Uc=function(e){mc(this,Uc,Ic),pc(e),Yd.call(this);var t=Pc(this);try{e(Xc(el,this,t),Xc(Zc,this,t))}catch(e){Zc(this,t,e)}},(Yd=function(e){Cc(this,{type:Ic,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=cc(Uc.prototype,{then:function(e,t){var n=Lc(this),r=Gc(_c(this,Uc));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Fc?qc.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&zc(this,n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),Jd=function(){var e=new Yd,t=Pc(e);this.promise=e,this.resolve=Xc(el,e,t),this.reject=Xc(Zc,e,t)},xc.f=Gc=function(e){return e===Uc||e===Xd?new Jd(e):Nc(e)},"function"==typeof uc&&(Zd=uc.prototype.then,dc(uc.prototype,"then",(function(e,t){var n=this;return new Uc((function(e,t){Zd.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof Bc&&ic({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return kc(Uc,Bc.apply(sc,arguments))}}))),ic({global:!0,wrap:!0,forced:Wc},{Promise:Uc}),lc(Uc,Ic,!1),hc(Ic),Xd=oc(Ic),ic({target:Ic,stat:!0,forced:Wc},{reject:function(e){var t=Gc(this);return t.reject.call(void 0,e),t.promise}}),ic({target:Ic,stat:!0,forced:Wc},{resolve:function(e){return kc(this,e)}}),ic({target:Ic,stat:!0,forced:Kc},{all:function(e){var t=this,n=Gc(t),r=n.resolve,a=n.reject,i=Sc((function(){var n=pc(t.resolve),i=[],s=0,o=1;yc(e,(function(e){var u=s++,d=!1;i.push(void 0),o++,n.call(t,e).then((function(e){d||(d=!0,i[u]=e,--o||r(i))}),a)})),--o||r(i)}));return i.error&&a(i.value),n.promise},race:function(e){var t=this,n=Gc(t),r=n.reject,a=Sc((function(){var a=pc(t.resolve);yc(e,(function(e){a.call(t,e).then(n.resolve,r)}))}));return a.error&&r(a.value),n.promise}});var tl=Sr,nl=K,rl=ue,al=se,il=Z,sl=ie,ol=Xi,ul=at,dl=Mi,cl=Ci,ll=et("isConcatSpreadable"),hl=cl>=51||!nl((function(){var e=[];return e[ll]=!1,e.concat()[0]!==e})),fl=dl("concat"),pl=function(e){if(!al(e))return!1;var t=e[ll];return void 0!==t?!!t:rl(e)};tl({target:"Array",proto:!0,forced:!hl||!fl},{concat:function(e){var t,n,r,a,i,s=il(this),o=ul(s,0),u=0;for(t=-1,r=arguments.length;t<r;t++)if(pl(i=-1===t?s:arguments[t])){if(u+(a=sl(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<a;n++,u++)n in i&&ol(o,u,i[n])}else{if(u>=9007199254740991)throw TypeError("Maximum allowed index exceeded");ol(o,u++,i)}return o.length=u,o}});var ml=ce,gl=le.f,vl=Function.prototype,yl=vl.toString,bl=/^\s*function ([^ (]*)/;function _l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return wl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wl(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}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 i,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function wl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Al(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Al(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Al(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}ml&&!("name"in vl)&&gl(vl,"name",{configurable:!0,get:function(){try{return yl.call(this).match(bl)[1]}catch(e){return""}}});var El,xl={react:{src:"https://pm.gamedistribution.com/react/16.14.0/umd/react.production.min.js",name:"React"},"react-dom":{src:"https://pm.gamedistribution.com/react-dom/16.14.0/umd/react-dom.production.min.js",name:"ReactDOM"},redux:{src:"https://pm.gamedistribution.com/redux/4.0.5/dist/redux.min.js",name:"Redux"},"react-redux":{src:"https://pm.gamedistribution.com/react-redux/7.2.1/dist/react-redux.min.js",name:"ReactRedux"},"material-ui-core":{src:"https://pm.gamedistribution.com/@material-ui/core/4.11.3/umd/material-ui.production.min.js",name:"MaterialUI"}},Sl={},Rl=function(e,t){Sl[e]=kl(kl({},t),{},{isLoading:!1})},Tl=function(e){var t=this,n=e.id,r=e.src;return new Promise(function(e,a){if(k.default(this,t),document.getElementById(n))e();else{var i=document.createElement("script");i.onload=function(){e()},i.id=n,i.setAttribute("crossorigin",!0),i.src=r,document.head.appendChild(i)}}.bind(this))},Dl=function(){var e=A.default(x.default.mark((function e(t){var n,r,a,i,s,o,u,d;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=window[t])){e.next=3;break}return e.abrupt("return",n);case 3:if(!(r=Sl[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:r.isLoading=!0,a=_l(r.dependencies),e.prev=8,a.s();case 10:if((i=a.n()).done){e.next=26;break}if(s=i.value,e.prev=12,o=xl[s].name,!window[o]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,Tl({id:s,src:xl[s].src});case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),u=s.id,d=s.src,console.log("Could not load external script ".concat(u," ").concat(d),e.t0);case 24:e.next=10;break;case 26:e.next=31;break;case 28:e.prev=28,e.t1=e.catch(8),a.e(e.t1);case 31:return e.prev=31,a.f(),e.finish(31);case 34:return e.prev=34,e.next=37,Tl({id:t,src:r.source});case 37:n=window[t],e.next=43;break;case 40:e.prev=40,e.t2=e.catch(34),console.log("Could not load module ".concat(t," ").concat(r.source,"."),e.t2);case 43:return r.isLoading=!1,e.abrupt("return",n);case 45:case"end":return e.stop()}}),e,null,[[8,28,31,34],[12,20],[34,40]])})));return function(t){return e.apply(this,arguments)}}(),Ol=new function e(){var t=this;S.default(this,e),R.default(this,"load",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Dl("Leaderboard");case 2:t.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),R.default(this,"showLeaderboard",function(){var e=A.default(x.default.mark((function e(n){var r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=window.GD_OPTIONS.gameId,t.leaderboard){e.next=4;break}return e.next=4,t.load();case 4:t.leaderboard.showLeaderBoard(r,n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),R.default(this,"addScore",function(){var e=A.default(x.default.mark((function e(n){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.leaderboard){e.next=3;break}return e.next=3,t.load();case 3:t.leaderboard.addScore(n);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.moduleName="Leaderboard",this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/gd-sdk-leaderboard/0.1.43/dist/default/iife/index.js",dependencies:["react","react-dom","redux","react-redux","material-ui-core"]},Rl(this.moduleName,this.moduleConfig)},Il=se,Pl=z,Cl=et("match"),Ll=function(e){var t;return Il(e)&&(void 0!==(t=e[Cl])?!!t:"RegExp"==Pl(e))},Ul=Ll,jl=function(e){if(Ul(e))throw TypeError("The method doesn't accept regular expressions");return e},Ml=et("match"),ql=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Ml]=!1,"/./"[e](t)}catch(e){}}return!1},Bl=Sr,Gl=Ct.f,Nl=ie,Fl=jl,Vl=J,Wl=ql,Kl="".startsWith,Hl=Math.min,zl=Wl("startsWith");Bl({target:"String",proto:!0,forced:!!(zl||(El=Gl(String.prototype,"startsWith"),!El||El.writable))&&!zl},{startsWith:function(e){var t=String(Vl(this));Fl(e);var n=Nl(Hl(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return Kl?Kl.call(t,r,n):t.slice(n,n+r.length)===r}});var $l=be,Ql=function(){var e=$l(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},Yl=Qt.exports,Jl=be,Xl=K,Zl=Ql,eh=RegExp.prototype,th=eh.toString,nh=Xl((function(){return"/a/b"!=th.call({source:"a",flags:"b"})})),rh="toString"!=th.name;(nh||rh)&&Yl(RegExp.prototype,"toString",(function(){var e=Jl(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in eh)?Zl.call(e):n)}),{unsafe:!0});var ah={},ih=K;function sh(e,t){return RegExp(e,t)}ah.UNSUPPORTED_Y=ih((function(){var e=sh("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),ah.BROKEN_CARET=ih((function(){var e=sh("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var oh=Ql,uh=ah,dh=RegExp.prototype.exec,ch=String.prototype.replace,lh=dh,hh=function(){var e=/a/,t=/b*/g;return dh.call(e,"a"),dh.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),fh=uh.UNSUPPORTED_Y||uh.BROKEN_CARET,ph=void 0!==/()??/.exec("")[1];(hh||ph||fh)&&(lh=function(e){var t,n,r,a,i=this,s=fh&&i.sticky,o=oh.call(i),u=i.source,d=0,c=e;return s&&(-1===(o=o.replace("y","")).indexOf("g")&&(o+="g"),c=String(e).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==e[i.lastIndex-1])&&(u="(?: "+u+")",c=" "+c,d++),n=new RegExp("^(?:"+u+")",o)),ph&&(n=new RegExp("^"+u+"$(?!\\s)",o)),hh&&(t=i.lastIndex),r=dh.call(s?n:i,c),s?r?(r.input=r.input.slice(d),r[0]=r[0].slice(d),r.index=i.lastIndex,i.lastIndex+=r[0].length):i.lastIndex=0:hh&&r&&(i.lastIndex=i.global?r.index+r[0].length:t),ph&&r&&r.length>1&&ch.call(r[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)})),r});var mh=lh;Sr({target:"RegExp",proto:!0,forced:/./.exec!==mh},{exec:mh});var gh=Qt.exports,vh=K,yh=et,bh=mh,_h=Oe,wh=yh("species"),Ah=!vh((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),kh="$0"==="a".replace(/./,"$0"),Eh=yh("replace"),xh=!!/./[Eh]&&""===/./[Eh]("a","$0"),Sh=!vh((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),Rh=function(e,t,n,r){var a=yh(e),i=!vh((function(){var t={};return t[a]=function(){return 7},7!=""[e](t)})),s=i&&!vh((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[wh]=function(){return n},n.flags="",n[a]=/./[a]),n.exec=function(){return t=!0,null},n[a](""),!t}));if(!i||!s||"replace"===e&&(!Ah||!kh||xh)||"split"===e&&!Sh){var o=/./[a],u=n(a,""[e],(function(e,t,n,r,a){return t.exec===bh?i&&!a?{done:!0,value:o.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:kh,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:xh}),d=u[0],c=u[1];gh(String.prototype,e,d),gh(RegExp.prototype,a,2==t?function(e,t){return c.call(e,this,t)}:function(e){return c.call(e,this)})}r&&_h(RegExp.prototype[a],"sham",!0)},Th=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},Dh=z,Oh=mh,Ih=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==Dh(e))throw TypeError("RegExp#exec called on incompatible receiver");return Oh.call(e,t)},Ph=be,Ch=J,Lh=Th,Uh=Ih;function jh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jh(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Rh("search",1,(function(e,t,n){return[function(t){var n=Ch(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var a=Ph(e),i=String(this),s=a.lastIndex;Lh(s,0)||(a.lastIndex=0);var o=Uh(a,i);return Lh(a.lastIndex,s)||(a.lastIndex=s),null===o?-1:o.index}]}));var qh,Bh,Gh=function(){function e(){S.default(this,e)}return T.default(e,[{key:"getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var i=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:a.getParentUrl()),s=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:a.getParentDomain()),o=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===a.getIframeDepth()?s:a.getTopDomain()),u=(e||n)&&r.loaderEnabled,d=(e||n)&&r.loaderEnabled,c=(e||n)&&r.loaderEnabled,l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:u,noLoadedEvent:d,noBlockerEvent:c,noPreroll:m,parentURL:i,parentDomain:s,topDomain:o&&o.length?o:s,noGAPageView:l,noLotamePageView:h,noGamedockSDK:f,noMinijuegosSDK:p,version:r.version,pauseGameOnStartup:g,depth:a.getIframeDepth(),domainMatched:s===o,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 n=new D.default(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new D.default(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var a=new D.default(location.href,!0);if(!a.query.gd_zone_config)return;e=a.query.gd_zone_config}return JSON.parse(d.Base64.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(d.Base64.encode(JSON.stringify(e)))}catch(e){}try{var n=new D.default(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(qs.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new D.default(e,!0);return n.query=Mh(Mh({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return d.Base64.encode(JSON.stringify(e))}}]),e}(),Nh=function(){try{return(new Gh).getBridgeContext()}catch(e){return{}}}(),Fh={userDeclinedTracking:document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0,whitelabelPartner:(qh=!1,(Bh=a.getQueryParams("xanthophyll")).hasOwnProperty("xanthophyll")&&"true"===Bh.xanthophyll&&(qh=!0),qh)},Vh=no.charAt,Wh=function(e,t,n){return t+(n?Vh(e,t).length:1)},Kh=Rh,Hh=be,zh=Z,$h=ie,Qh=ne,Yh=J,Jh=Wh,Xh=Ih,Zh=Math.max,ef=Math.min,tf=Math.floor,nf=/\$([$&'`]|\d\d?|<[^>]*>)/g,rf=/\$([$&'`]|\d\d?)/g;Kh("replace",2,(function(e,t,n,r){var a=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,i=r.REPLACE_KEEPS_$0,s=a?"$":"$0";return[function(n,r){var a=Yh(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,a,r):t.call(String(a),n,r)},function(e,r){if(!a&&i||"string"==typeof r&&-1===r.indexOf(s)){var u=n(t,e,this,r);if(u.done)return u.value}var d=Hh(e),c=String(this),l="function"==typeof r;l||(r=String(r));var h=d.global;if(h){var f=d.unicode;d.lastIndex=0}for(var p=[];;){var m=Xh(d,c);if(null===m)break;if(p.push(m),!h)break;""===String(m[0])&&(d.lastIndex=Jh(c,$h(d.lastIndex),f))}for(var g,v="",y=0,b=0;b<p.length;b++){m=p[b];for(var _=String(m[0]),w=Zh(ef(Qh(m.index),c.length),0),A=[],k=1;k<m.length;k++)A.push(void 0===(g=m[k])?g:String(g));var E=m.groups;if(l){var x=[_].concat(A,w,c);void 0!==E&&x.push(E);var S=String(r.apply(void 0,x))}else S=o(_,c,w,A,E,r);w>=y&&(v+=c.slice(y,w)+S,y=w+_.length)}return v+c.slice(y)}];function o(e,n,r,a,i,s){var o=r+e.length,u=a.length,d=rf;return void 0!==i&&(i=zh(i),d=nf),t.call(s,d,(function(t,s){var d;switch(s.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,r);case"'":return n.slice(o);case"<":d=i[s.slice(1,-1)];break;default:var c=+s;if(0===c)return t;if(c>u){var l=tf(c/10);return 0===l?t:l<=u?void 0===a[l-1]?s.charAt(1):a[l-1]+s.charAt(1):t}d=a[c-1]}return void 0===d?"":d}))}}));var af=K,sf=et("iterator"),of=!af((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[sf]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),uf=ce,df=K,cf=Dr,lf=tr,hf=Lt,ff=Z,pf=Y,mf=Object.assign,gf=Object.defineProperty,vf=!mf||df((function(){if(uf&&1!==mf({b:1},mf(gf({},"a",{enumerable:!0,get:function(){gf(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=mf({},e)[n]||cf(mf({},t)).join("")!=r}))?function(e,t){for(var n=ff(e),r=arguments.length,a=1,i=lf.f,s=hf.f;r>a;)for(var o,u=pf(arguments[a++]),d=i?cf(u).concat(i(u)):cf(u),c=d.length,l=0;c>l;)o=d[l++],uf&&!s.call(u,o)||(n[o]=u[o]);return n}:mf,yf=/[^\0-\u007E]/,bf=/[.\u3002\uFF0E\uFF61]/g,_f="Overflow: input needs wider integers to process",wf=Math.floor,Af=String.fromCharCode,kf=function(e){return e+22+75*(e<26)},Ef=function(e,t,n){var r=0;for(e=n?wf(e/700):e>>1,e+=wf(e/t);e>455;r+=36)e=wf(e/35);return wf(r+36*e/(e+38))},xf=function(e){var t,n,r=[],a=(e=function(e){for(var t=[],n=0,r=e.length;n<r;){var a=e.charCodeAt(n++);if(a>=55296&&a<=56319&&n<r){var i=e.charCodeAt(n++);56320==(64512&i)?t.push(((1023&a)<<10)+(1023&i)+65536):(t.push(a),n--)}else t.push(a)}return t}(e)).length,i=128,s=0,o=72;for(t=0;t<e.length;t++)(n=e[t])<128&&r.push(Af(n));var u=r.length,d=u;for(u&&r.push("-");d<a;){var c=2147483647;for(t=0;t<e.length;t++)(n=e[t])>=i&&n<c&&(c=n);var l=d+1;if(c-i>wf((2147483647-s)/l))throw RangeError(_f);for(s+=(c-i)*l,i=c,t=0;t<e.length;t++){if((n=e[t])<i&&++s>2147483647)throw RangeError(_f);if(n==i){for(var h=s,f=36;;f+=36){var p=f<=o?1:f>=o+26?26:f-o;if(h<p)break;var m=h-p,g=36-p;r.push(Af(kf(p+m%g))),h=wf(m/g)}r.push(Af(kf(h))),o=Ef(s,l,d==u),s=0,++d}}++s,++i}return r.join("")},Sf=be,Rf=Ls,Tf=Sr,Df=jn,Of=of,If=Qt.exports,Pf=qu,Cf=ya,Lf=ko,Uf=kn,jf=Wu,Mf=qe,qf=W,Bf=Os,Gf=be,Nf=se,Ff=na,Vf=Re,Wf=function(e){var t=Rf(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return Sf(t.call(e))},Kf=Ls,Hf=et,zf=Df("fetch"),$f=Df("Headers"),Qf=Hf("iterator"),Yf=Uf.set,Jf=Uf.getterFor("URLSearchParams"),Xf=Uf.getterFor("URLSearchParamsIterator"),Zf=/\+/g,ep=Array(4),tp=function(e){return ep[e-1]||(ep[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},np=function(e){try{return decodeURIComponent(e)}catch(t){return e}},rp=function(e){var t=e.replace(Zf," "),n=4;try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace(tp(n--),np);return t}},ap=/[!'()~]|%20/g,ip={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},sp=function(e){return ip[e]},op=function(e){return encodeURIComponent(e).replace(ap,sp)},up=function(e,t){if(t)for(var n,r,a=t.split("&"),i=0;i<a.length;)(n=a[i++]).length&&(r=n.split("="),e.push({key:rp(r.shift()),value:rp(r.join("="))}))},dp=function(e){this.entries.length=0,up(this.entries,e)},cp=function(e,t){if(e<t)throw TypeError("Not enough arguments")},lp=Lf((function(e,t){Yf(this,{type:"URLSearchParamsIterator",iterator:Wf(Jf(e).entries),kind:t})}),"Iterator",(function(){var e=Xf(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),hp=function(){jf(this,hp,"URLSearchParams");var e,t,n,r,a,i,s,o,u,d=arguments.length>0?arguments[0]:void 0,c=this,l=[];if(Yf(c,{type:"URLSearchParams",entries:l,updateURL:function(){},updateSearchParams:dp}),void 0!==d)if(Nf(d))if("function"==typeof(e=Kf(d)))for(n=(t=e.call(d)).next;!(r=n.call(t)).done;){if((s=(i=(a=Wf(Gf(r.value))).next).call(a)).done||(o=i.call(a)).done||!i.call(a).done)throw TypeError("Expected sequence with length 2");l.push({key:s.value+"",value:o.value+""})}else for(u in d)Mf(d,u)&&l.push({key:u,value:d[u]+""});else up(l,"string"==typeof d?"?"===d.charAt(0)?d.slice(1):d:d+"")},fp=hp.prototype;Pf(fp,{append:function(e,t){cp(arguments.length,2);var n=Jf(this);n.entries.push({key:e+"",value:t+""}),n.updateURL()},delete:function(e){cp(arguments.length,1);for(var t=Jf(this),n=t.entries,r=e+"",a=0;a<n.length;)n[a].key===r?n.splice(a,1):a++;t.updateURL()},get:function(e){cp(arguments.length,1);for(var t=Jf(this).entries,n=e+"",r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){cp(arguments.length,1);for(var t=Jf(this).entries,n=e+"",r=[],a=0;a<t.length;a++)t[a].key===n&&r.push(t[a].value);return r},has:function(e){cp(arguments.length,1);for(var t=Jf(this).entries,n=e+"",r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){cp(arguments.length,1);for(var n,r=Jf(this),a=r.entries,i=!1,s=e+"",o=t+"",u=0;u<a.length;u++)(n=a[u]).key===s&&(i?a.splice(u--,1):(i=!0,n.value=o));i||a.push({key:s,value:o}),r.updateURL()},sort:function(){var e,t,n,r=Jf(this),a=r.entries,i=a.slice();for(a.length=0,n=0;n<i.length;n++){for(e=i[n],t=0;t<n;t++)if(a[t].key>e.key){a.splice(t,0,e);break}t===n&&a.push(e)}r.updateURL()},forEach:function(e){for(var t,n=Jf(this).entries,r=qf(e,arguments.length>1?arguments[1]:void 0,3),a=0;a<n.length;)r((t=n[a++]).value,t.key,this)},keys:function(){return new lp(this,"keys")},values:function(){return new lp(this,"values")},entries:function(){return new lp(this,"entries")}},{enumerable:!0}),If(fp,Qf,fp.entries),If(fp,"toString",(function(){for(var e,t=Jf(this).entries,n=[],r=0;r<t.length;)e=t[r++],n.push(op(e.key)+"="+op(e.value));return n.join("&")}),{enumerable:!0}),Cf(hp,"URLSearchParams"),Tf({global:!0,forced:!Of},{URLSearchParams:hp}),Of||"function"!=typeof zf||"function"!=typeof $f||Tf({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,n,r,a=[e];return arguments.length>1&&(Nf(t=arguments[1])&&(n=t.body,"URLSearchParams"===Bf(n)&&((r=t.headers?new $f(t.headers):new $f).has("content-type")||r.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=Ff(t,{body:Vf(0,String(n)),headers:Vf(0,r)}))),a.push(t)),zf.apply(this,a)}});var pp,mp={URLSearchParams:hp,getState:Jf},gp=Sr,vp=ce,yp=of,bp=G,_p=Wr,wp=Qt.exports,Ap=Wu,kp=qe,Ep=vf,xp=Vs,Sp=no.codeAt,Rp=function(e){var t,n,r=[],a=e.toLowerCase().replace(bf,".").split(".");for(t=0;t<a.length;t++)n=a[t],r.push(yf.test(n)?"xn--"+xf(n):n);return r.join(".")},Tp=ya,Dp=mp,Op=kn,Ip=bp.URL,Pp=Dp.URLSearchParams,Cp=Dp.getState,Lp=Op.set,Up=Op.getterFor("URL"),jp=Math.floor,Mp=Math.pow,qp=/[A-Za-z]/,Bp=/[\d+-.A-Za-z]/,Gp=/\d/,Np=/^(0x|0X)/,Fp=/^[0-7]+$/,Vp=/^\d+$/,Wp=/^[\dA-Fa-f]+$/,Kp=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,Hp=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,zp=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,$p=/[\u0009\u000A\u000D]/g,Qp=function(e,t){var n,r,a;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return"Invalid host";if(!(n=Jp(t.slice(1,-1))))return"Invalid host";e.host=n}else if(im(e)){if(t=Rp(t),Kp.test(t))return"Invalid host";if(null===(n=Yp(t)))return"Invalid host";e.host=n}else{if(Hp.test(t))return"Invalid host";for(n="",r=xp(t),a=0;a<r.length;a++)n+=rm(r[a],Zp);e.host=n}},Yp=function(e){var t,n,r,a,i,s,o,u=e.split(".");if(u.length&&""==u[u.length-1]&&u.pop(),(t=u.length)>4)return e;for(n=[],r=0;r<t;r++){if(""==(a=u[r]))return e;if(i=10,a.length>1&&"0"==a.charAt(0)&&(i=Np.test(a)?16:8,a=a.slice(8==i?1:2)),""===a)s=0;else{if(!(10==i?Vp:8==i?Fp:Wp).test(a))return e;s=parseInt(a,i)}n.push(s)}for(r=0;r<t;r++)if(s=n[r],r==t-1){if(s>=Mp(256,5-t))return null}else if(s>255)return null;for(o=n.pop(),r=0;r<n.length;r++)o+=n[r]*Mp(256,3-r);return o},Jp=function(e){var t,n,r,a,i,s,o,u=[0,0,0,0,0,0,0,0],d=0,c=null,l=0,h=function(){return e.charAt(l)};if(":"==h()){if(":"!=e.charAt(1))return;l+=2,c=++d}for(;h();){if(8==d)return;if(":"!=h()){for(t=n=0;n<4&&Wp.test(h());)t=16*t+parseInt(h(),16),l++,n++;if("."==h()){if(0==n)return;if(l-=n,d>6)return;for(r=0;h();){if(a=null,r>0){if(!("."==h()&&r<4))return;l++}if(!Gp.test(h()))return;for(;Gp.test(h());){if(i=parseInt(h(),10),null===a)a=i;else{if(0==a)return;a=10*a+i}if(a>255)return;l++}u[d]=256*u[d]+a,2!=++r&&4!=r||d++}if(4!=r)return;break}if(":"==h()){if(l++,!h())return}else if(h())return;u[d++]=t}else{if(null!==c)return;l++,c=++d}}if(null!==c)for(s=d-c,d=7;0!=d&&s>0;)o=u[d],u[d--]=u[c+s-1],u[c+--s]=o;else if(8!=d)return;return u},Xp=function(e){var t,n,r,a;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=jp(e/256);return t.join(".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,a=0,i=0;i<8;i++)0!==e[i]?(a>n&&(t=r,n=a),r=null,a=0):(null===r&&(r=i),++a);return a>n&&(t=r,n=a),t}(e),n=0;n<8;n++)a&&0===e[n]||(a&&(a=!1),r===n?(t+=n?":":"::",a=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},Zp={},em=Ep({},Zp,{" ":1,'"':1,"<":1,">":1,"`":1}),tm=Ep({},em,{"#":1,"?":1,"{":1,"}":1}),nm=Ep({},tm,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),rm=function(e,t){var n=Sp(e,0);return n>32&&n<127&&!kp(t,e)?e:encodeURIComponent(e)},am={ftp:21,file:null,http:80,https:443,ws:80,wss:443},im=function(e){return kp(am,e.scheme)},sm=function(e){return""!=e.username||""!=e.password},om=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},um=function(e,t){var n;return 2==e.length&&qp.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},dm=function(e){var t;return e.length>1&&um(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},cm=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&um(t[0],!0)||t.pop()},lm=function(e){return"."===e||"%2e"===e.toLowerCase()},hm={},fm={},pm={},mm={},gm={},vm={},ym={},bm={},_m={},wm={},Am={},km={},Em={},xm={},Sm={},Rm={},Tm={},Dm={},Om={},Im={},Pm={},Cm=function(e,t,n,r){var a,i,s,o,u,d=n||hm,c=0,l="",h=!1,f=!1,p=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(zp,"")),t=t.replace($p,""),a=xp(t);c<=a.length;){switch(i=a[c],d){case hm:if(!i||!qp.test(i)){if(n)return"Invalid scheme";d=pm;continue}l+=i.toLowerCase(),d=fm;break;case fm:if(i&&(Bp.test(i)||"+"==i||"-"==i||"."==i))l+=i.toLowerCase();else{if(":"!=i){if(n)return"Invalid scheme";l="",d=pm,c=0;continue}if(n&&(im(e)!=kp(am,l)||"file"==l&&(sm(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=l,n)return void(im(e)&&am[e.scheme]==e.port&&(e.port=null));l="","file"==e.scheme?d=xm:im(e)&&r&&r.scheme==e.scheme?d=mm:im(e)?d=bm:"/"==a[c+1]?(d=gm,c++):(e.cannotBeABaseURL=!0,e.path.push(""),d=Om)}break;case pm:if(!r||r.cannotBeABaseURL&&"#"!=i)return"Invalid scheme";if(r.cannotBeABaseURL&&"#"==i){e.scheme=r.scheme,e.path=r.path.slice(),e.query=r.query,e.fragment="",e.cannotBeABaseURL=!0,d=Pm;break}d="file"==r.scheme?xm:vm;continue;case mm:if("/"!=i||"/"!=a[c+1]){d=vm;continue}d=_m,c++;break;case gm:if("/"==i){d=wm;break}d=Dm;continue;case vm:if(e.scheme=r.scheme,i==pp)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query;else if("/"==i||"\\"==i&&im(e))d=ym;else if("?"==i)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query="",d=Im;else{if("#"!=i){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.path.pop(),d=Dm;continue}e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query,e.fragment="",d=Pm}break;case ym:if(!im(e)||"/"!=i&&"\\"!=i){if("/"!=i){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,d=Dm;continue}d=wm}else d=_m;break;case bm:if(d=_m,"/"!=i||"/"!=l.charAt(c+1))continue;c++;break;case _m:if("/"!=i&&"\\"!=i){d=wm;continue}break;case wm:if("@"==i){h&&(l="%40"+l),h=!0,s=xp(l);for(var m=0;m<s.length;m++){var g=s[m];if(":"!=g||p){var v=rm(g,nm);p?e.password+=v:e.username+=v}else p=!0}l=""}else if(i==pp||"/"==i||"?"==i||"#"==i||"\\"==i&&im(e)){if(h&&""==l)return"Invalid authority";c-=xp(l).length+1,l="",d=Am}else l+=i;break;case Am:case km:if(n&&"file"==e.scheme){d=Rm;continue}if(":"!=i||f){if(i==pp||"/"==i||"?"==i||"#"==i||"\\"==i&&im(e)){if(im(e)&&""==l)return"Invalid host";if(n&&""==l&&(sm(e)||null!==e.port))return;if(o=Qp(e,l))return o;if(l="",d=Tm,n)return;continue}"["==i?f=!0:"]"==i&&(f=!1),l+=i}else{if(""==l)return"Invalid host";if(o=Qp(e,l))return o;if(l="",d=Em,n==km)return}break;case Em:if(!Gp.test(i)){if(i==pp||"/"==i||"?"==i||"#"==i||"\\"==i&&im(e)||n){if(""!=l){var y=parseInt(l,10);if(y>65535)return"Invalid port";e.port=im(e)&&y===am[e.scheme]?null:y,l=""}if(n)return;d=Tm;continue}return"Invalid port"}l+=i;break;case xm:if(e.scheme="file","/"==i||"\\"==i)d=Sm;else{if(!r||"file"!=r.scheme){d=Dm;continue}if(i==pp)e.host=r.host,e.path=r.path.slice(),e.query=r.query;else if("?"==i)e.host=r.host,e.path=r.path.slice(),e.query="",d=Im;else{if("#"!=i){dm(a.slice(c).join(""))||(e.host=r.host,e.path=r.path.slice(),cm(e)),d=Dm;continue}e.host=r.host,e.path=r.path.slice(),e.query=r.query,e.fragment="",d=Pm}}break;case Sm:if("/"==i||"\\"==i){d=Rm;break}r&&"file"==r.scheme&&!dm(a.slice(c).join(""))&&(um(r.path[0],!0)?e.path.push(r.path[0]):e.host=r.host),d=Dm;continue;case Rm:if(i==pp||"/"==i||"\\"==i||"?"==i||"#"==i){if(!n&&um(l))d=Dm;else if(""==l){if(e.host="",n)return;d=Tm}else{if(o=Qp(e,l))return o;if("localhost"==e.host&&(e.host=""),n)return;l="",d=Tm}continue}l+=i;break;case Tm:if(im(e)){if(d=Dm,"/"!=i&&"\\"!=i)continue}else if(n||"?"!=i)if(n||"#"!=i){if(i!=pp&&(d=Dm,"/"!=i))continue}else e.fragment="",d=Pm;else e.query="",d=Im;break;case Dm:if(i==pp||"/"==i||"\\"==i&&im(e)||!n&&("?"==i||"#"==i)){if(".."===(u=(u=l).toLowerCase())||"%2e."===u||".%2e"===u||"%2e%2e"===u?(cm(e),"/"==i||"\\"==i&&im(e)||e.path.push("")):lm(l)?"/"==i||"\\"==i&&im(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&um(l)&&(e.host&&(e.host=""),l=l.charAt(0)+":"),e.path.push(l)),l="","file"==e.scheme&&(i==pp||"?"==i||"#"==i))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==i?(e.query="",d=Im):"#"==i&&(e.fragment="",d=Pm)}else l+=rm(i,tm);break;case Om:"?"==i?(e.query="",d=Im):"#"==i?(e.fragment="",d=Pm):i!=pp&&(e.path[0]+=rm(i,Zp));break;case Im:n||"#"!=i?i!=pp&&("'"==i&&im(e)?e.query+="%27":e.query+="#"==i?"%23":rm(i,Zp)):(e.fragment="",d=Pm);break;case Pm:i!=pp&&(e.fragment+=rm(i,em))}c++}},Lm=function(e){var t,n,r=Ap(this,Lm,"URL"),a=arguments.length>1?arguments[1]:void 0,i=String(e),s=Lp(r,{type:"URL"});if(void 0!==a)if(a instanceof Lm)t=Up(a);else if(n=Cm(t={},String(a)))throw TypeError(n);if(n=Cm(s,i,null,t))throw TypeError(n);var o=s.searchParams=new Pp,u=Cp(o);u.updateSearchParams(s.query),u.updateURL=function(){s.query=String(o)||null},vp||(r.href=jm.call(r),r.origin=Mm.call(r),r.protocol=qm.call(r),r.username=Bm.call(r),r.password=Gm.call(r),r.host=Nm.call(r),r.hostname=Fm.call(r),r.port=Vm.call(r),r.pathname=Wm.call(r),r.search=Km.call(r),r.searchParams=Hm.call(r),r.hash=zm.call(r))},Um=Lm.prototype,jm=function(){var e=Up(this),t=e.scheme,n=e.username,r=e.password,a=e.host,i=e.port,s=e.path,o=e.query,u=e.fragment,d=t+":";return null!==a?(d+="//",sm(e)&&(d+=n+(r?":"+r:"")+"@"),d+=Xp(a),null!==i&&(d+=":"+i)):"file"==t&&(d+="//"),d+=e.cannotBeABaseURL?s[0]:s.length?"/"+s.join("/"):"",null!==o&&(d+="?"+o),null!==u&&(d+="#"+u),d},Mm=function(){var e=Up(this),t=e.scheme,n=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&im(e)?t+"://"+Xp(e.host)+(null!==n?":"+n:""):"null"},qm=function(){return Up(this).scheme+":"},Bm=function(){return Up(this).username},Gm=function(){return Up(this).password},Nm=function(){var e=Up(this),t=e.host,n=e.port;return null===t?"":null===n?Xp(t):Xp(t)+":"+n},Fm=function(){var e=Up(this).host;return null===e?"":Xp(e)},Vm=function(){var e=Up(this).port;return null===e?"":String(e)},Wm=function(){var e=Up(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Km=function(){var e=Up(this).query;return e?"?"+e:""},Hm=function(){return Up(this).searchParams},zm=function(){var e=Up(this).fragment;return e?"#"+e:""},$m=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(vp&&_p(Um,{href:$m(jm,(function(e){var t=Up(this),n=String(e),r=Cm(t,n);if(r)throw TypeError(r);Cp(t.searchParams).updateSearchParams(t.query)})),origin:$m(Mm),protocol:$m(qm,(function(e){var t=Up(this);Cm(t,String(e)+":",hm)})),username:$m(Bm,(function(e){var t=Up(this),n=xp(String(e));if(!om(t)){t.username="";for(var r=0;r<n.length;r++)t.username+=rm(n[r],nm)}})),password:$m(Gm,(function(e){var t=Up(this),n=xp(String(e));if(!om(t)){t.password="";for(var r=0;r<n.length;r++)t.password+=rm(n[r],nm)}})),host:$m(Nm,(function(e){var t=Up(this);t.cannotBeABaseURL||Cm(t,String(e),Am)})),hostname:$m(Fm,(function(e){var t=Up(this);t.cannotBeABaseURL||Cm(t,String(e),km)})),port:$m(Vm,(function(e){var t=Up(this);om(t)||(""==(e=String(e))?t.port=null:Cm(t,e,Em))})),pathname:$m(Wm,(function(e){var t=Up(this);t.cannotBeABaseURL||(t.path=[],Cm(t,e+"",Tm))})),search:$m(Km,(function(e){var t=Up(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",Cm(t,e,Im)),Cp(t.searchParams).updateSearchParams(t.query)})),searchParams:$m(Hm),hash:$m(zm,(function(e){var t=Up(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",Cm(t,e,Pm)):t.fragment=null}))}),wp(Um,"toJSON",(function(){return jm.call(this)}),{enumerable:!0}),wp(Um,"toString",(function(){return jm.call(this)}),{enumerable:!0}),Ip){var Qm=Ip.createObjectURL,Ym=Ip.revokeObjectURL;Qm&&wp(Lm,"createObjectURL",(function(e){return Qm.apply(Ip,arguments)})),Ym&&wp(Lm,"revokeObjectURL",(function(e){return Ym.apply(Ip,arguments)}))}Tp(Lm,"URL"),gp({global:!0,forced:!yp,sham:!vp},{URL:Lm});var Jm=Hn.includes,Xm=cu;Sr({target:"Array",proto:!0,forced:!wt("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return Jm(this,e,arguments.length>1?arguments[1]:void 0)}}),Xm("includes");var Zm=jl,eg=J;Sr({target:"String",proto:!0,forced:!ql("includes")},{includes:function(e){return!!~String(eg(this)).indexOf(Zm(e),arguments.length>1?arguments[1]:void 0)}});var tg=Rh,ng=Ll,rg=be,ag=J,ig=id,sg=Wh,og=ie,ug=Ih,dg=mh,cg=K,lg=[].push,hg=Math.min,fg=!cg((function(){return!RegExp(4294967295,"y")}));function pg(e){var t=this,n={},r=(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 o(e){return P.default(n,e)}function u(e,t){return C.default(n,e,t)}function d(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new D.default(e,t)}catch(e){console.log(e)}}function c(){for(var t=(null==e?void 0:e.urls)||[a,s],n=0;n<t.length;n++){var r,i=d(t[n]);if(i){var o=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(o&&(o=decodeURIComponent(o),O.default.isURL(o)))return o}}}return function(){var e;k.default(this,t),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){u("depth.error",e.message)}u("depth.value",e)}(),function(){var e=r,t=n.depth.value,a=i;if(u("top.domain.from","fallback"),e&&e.length>0)a=e[e.length-1],u("top.domain.from","origins");else if(0===t)a=i,u("top.domain.from","self-top");else if(1===t){var o=d(s);o&&(a=o.origin,u("top.domain.from","referrer"))}u("top.domain.value",a.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=c();if(e)if(I.default(e))u("partner.domain.value",e),u("partner.domain.from","partner-domain");else{var t=d(e,!1);if(t)u("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),u("partner.domain.from","partner-url");else u("partner.domain.value",n.top.domain.value),u("partner.domain.from","partner-fallback")}else u("partner.domain.value",n.top.domain.value),u("partner.domain.from","fallback")}(),e=c(),0===n.depth.value?(u("partner.url.value",a),u("partner.url.from","self-top")):e?I.default(e)?(u("partner.url.value",a),u("partner.url.from","partner-domain")):(u("partner.url.value",e),u("partner.url.from","partner-url")):(u("partner.url.value",s),u("partner.url.from","fallback"))}.bind(this)(),{get:o,print:function(e){console.log(o(e))}}}tg("split",2,(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=String(ag(this)),a=void 0===n?4294967295:n>>>0;if(0===a)return[];if(void 0===e)return[r];if(!ng(e))return t.call(r,e,a);for(var i,s,o,u=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),c=0,l=new RegExp(e.source,d+"g");(i=dg.call(l,r))&&!((s=l.lastIndex)>c&&(u.push(r.slice(c,i.index)),i.length>1&&i.index<r.length&&lg.apply(u,i.slice(1)),o=i[0].length,c=s,u.length>=a));)l.lastIndex===i.index&&l.lastIndex++;return c===r.length?!o&&l.test("")||u.push(""):u.push(r.slice(c)),u.length>a?u.slice(0,a):u}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var a=ag(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,a,n):r.call(String(a),t,n)},function(e,a){var i=n(r,e,this,a,r!==t);if(i.done)return i.value;var s=rg(e),o=String(this),u=ig(s,RegExp),d=s.unicode,c=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(fg?"y":"g"),l=new u(fg?s:"^(?:"+s.source+")",c),h=void 0===a?4294967295:a>>>0;if(0===h)return[];if(0===o.length)return null===ug(l,o)?[o]:[];for(var f=0,p=0,m=[];p<o.length;){l.lastIndex=fg?p:0;var g,v=ug(l,fg?o:o.slice(p));if(null===v||(g=hg(og(l.lastIndex+(fg?0:p)),o.length))===f)p=sg(o,p,d);else{if(m.push(o.slice(f,p)),m.length===h)return m;for(var y=1;y<=v.length-1;y++)if(m.push(v[y]),m.length===h)return m;p=f=g}}return m.push(o.slice(f)),m}]}),!fg);var mg="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==mg&&mg,gg="URLSearchParams"in mg,vg="Symbol"in mg&&"iterator"in Symbol,yg="FileReader"in mg&&"Blob"in mg&&function(){try{return new Blob,!0}catch(e){return!1}}(),bg="FormData"in mg,_g="ArrayBuffer"in mg;if(_g)var wg=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Ag=ArrayBuffer.isView||function(e){return e&&wg.indexOf(Object.prototype.toString.call(e))>-1};function kg(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function Eg(e){return"string"!=typeof e&&(e=String(e)),e}function xg(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return vg&&(t[Symbol.iterator]=function(){return t}),t}function Sg(e){this.map={},e instanceof Sg?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function Rg(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Tg(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function Dg(e){var t=new FileReader,n=Tg(t);return t.readAsArrayBuffer(e),n}function Og(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Ig(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:yg&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:bg&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:gg&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():_g&&yg&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=Og(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):_g&&(ArrayBuffer.prototype.isPrototypeOf(e)||Ag(e))?this._bodyArrayBuffer=Og(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):gg&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},yg&&(this.blob=function(){var e=Rg(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=Rg(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(Dg)}),this.text=function(){var e=Rg(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=Tg(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},bg&&(this.formData=function(){return this.text().then(Lg)}),this.json=function(){return this.text().then(JSON.parse)},this}Sg.prototype.append=function(e,t){e=kg(e),t=Eg(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},Sg.prototype.delete=function(e){delete this.map[kg(e)]},Sg.prototype.get=function(e){return e=kg(e),this.has(e)?this.map[e]:null},Sg.prototype.has=function(e){return this.map.hasOwnProperty(kg(e))},Sg.prototype.set=function(e,t){this.map[kg(e)]=Eg(t)},Sg.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},Sg.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),xg(e)},Sg.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),xg(e)},Sg.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),xg(e)},vg&&(Sg.prototype[Symbol.iterator]=Sg.prototype.entries);var Pg=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Cg(e,t){if(!(this instanceof Cg))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,a=(t=t||{}).body;if(e instanceof Cg){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Sg(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,a||null==e._bodyInit||(a=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new Sg(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),Pg.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(a),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Lg(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(a))}})),t}function Ug(e,t){if(!(this instanceof Ug))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"",this.headers=new Sg(t.headers),this.url=t.url||"",this._initBody(e)}Cg.prototype.clone=function(){return new Cg(this,{body:this._bodyInit})},Ig.call(Cg.prototype),Ig.call(Ug.prototype),Ug.prototype.clone=function(){return new Ug(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Sg(this.headers),url:this.url})},Ug.error=function(){var e=new Ug(null,{status:0,statusText:""});return e.type="error",e};var jg=[301,302,303,307,308];Ug.redirect=function(e,t){if(-1===jg.indexOf(t))throw new RangeError("Invalid status code");return new Ug(null,{status:t,headers:{location:e}})};var Mg,qg=mg.DOMException;try{new qg}catch(e){(qg=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),qg.prototype.constructor=qg}function Bg(e,t){return new Promise((function(n,r){var a=new Cg(e,t);if(a.signal&&a.signal.aborted)return r(new qg("Aborted","AbortError"));var i=new XMLHttpRequest;function s(){i.abort()}i.onload=function(){var e,t,r={status:i.status,statusText:i.statusText,headers:(e=i.getAllResponseHeaders()||"",t=new Sg,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var a=n.join(":").trim();t.append(r,a)}})),t)};r.url="responseURL"in i?i.responseURL:r.headers.get("X-Request-URL");var a="response"in i?i.response:i.responseText;setTimeout((function(){n(new Ug(a,r))}),0)},i.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},i.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},i.onabort=function(){setTimeout((function(){r(new qg("Aborted","AbortError"))}),0)},i.open(a.method,function(e){try{return""===e&&mg.location.href?mg.location.href:e}catch(t){return e}}(a.url),!0),"include"===a.credentials?i.withCredentials=!0:"omit"===a.credentials&&(i.withCredentials=!1),"responseType"in i&&(yg?i.responseType="blob":_g&&a.headers.get("Content-Type")&&-1!==a.headers.get("Content-Type").indexOf("application/octet-stream")&&(i.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof Sg?a.headers.forEach((function(e,t){i.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){i.setRequestHeader(e,Eg(t.headers[e]))})),a.signal&&(a.signal.addEventListener("abort",s),i.onreadystatechange=function(){4===i.readyState&&a.signal.removeEventListener("abort",s)}),i.send(void 0===a._bodyInit?null:a._bodyInit)}))}Bg.polyfill=!0,mg.fetch||(mg.fetch=Bg,mg.Headers=Sg,mg.Request=Cg,mg.Response=Ug);var Gg,Ng=function(e){var t=this;if(!Mg){var n={gameId:e.gameId,hours:(new Date).getHours(),topDomain:Nh.topDomain,domain:Nh.parentDomain,referrer:Nh.parentURL,depth:a.getIframeDepth(),version:Ur.version,byloader:Nh.isTokenGameURL,isTokenGameURL:Nh.isTokenGameURL,isMasterGameURL:Nh.isMasterGameURL,isExtHostedGameURL:Nh.isExtHostedGameURL,byloaderVersion:Nh.version,tracking:Fh.userDeclinedTracking,whitelabel:Fh.whitelabelPartner,platform:a.getMobilePlatform()};Mg=new a.MessageRouter(n)}return Mg||{send:function(){k.default(this,t)}.bind(this)}};var Fg,Vg,Wg=[],Kg=function(e){Wg.push(e)},Hg=function(){var e=A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Fg){e.next=4;break}return e.next=3,zg(Vg);case 3:Fg=e.sent;case 4:return e.abrupt("return",Fg);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),zg=function(e){var t=this;Gg.send("gdfw.loading",{message:"loading"}),Wg=[],Kg("1"),Kg("2");var n=new pg;Kg("3");var r=n.get("partner.domain.value");Kg("4");var i=function(){return k.default(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);Kg("5");var s=function(){k.default(this,t);var n=o(),a=n?"&mode=".concat(n):"";return"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(r).concat(a,"&v=").concat(Ur.version,"&localTime=").concat((new Date).getHours())}.bind(this);Kg("6");var o=function(){var e=this;k.default(this,t);var n=new Proxy(new URLSearchParams(window.location.search),{get:function(t,n){return k.default(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 Kg("7"),new Promise(function(e){var n=this;if(k.default(this,t),Fg)e(Fg);else{Kg("7.1");var r=i();try{Kg("7.2");var o=s();Kg("7.3"),fetch(o).then(function(e){return k.default(this,n),Kg("7.4"),e.json()}.bind(this)).then(function(t){var i=this;if(k.default(this,n),Kg("7.5"),t.success){var s,o,u,d,c=t.result.game;Kg("7.6");var l={gameId:c.gameMd5,slug:c.slug,pname:c.pname,dname:c.dname,status:c.status,description:c.description,enableAds:!0===c.enableAds||!0===(null===(s=c.enableAds)||void 0===s?void 0:s.enabled),preroll:c.preRoll,midroll:6e4*c.timeAds,rewardedAds:c.rewardedAds,title:c.title,tags:c.tags,category:c.category,assets:c.assets,disp_2nd_prer:c.disp_2nd_prer,ctry_vst:c.ctry_vst,ctry:c.ctry,crtv:c.crtv,dmain:c.dmain,__t4r:jr(c.__t4r)||{},block_exts:jr(c.push_cuda),bloc_gard:jr(c.bloc_gard),cookie:jr(c.cookie),gdpr:jr(c.gdpr),diagnostic:jr(c.diagnostic),cmp:jr(c.cmp),gft:jr(c.gft)||{},sdk:jr(c.sdk)||{},sdkfw:jr(c.sdkfw)||{},loader:jr(c.loader)||{},splash:jr(c.splash)||{},promo:jr(c.promo)||{},dAds:jr(c.dads)||{},pAds:jr(c.pads)||{},mAds:jr(c.mads)||{},rAds:jr(c.rads)||{},lp:jr(c.lp)||{},extsc:jr(c.extsc)||{},evnts:jr(c.evnts)||{},dp:jr(c.dp)||{},adflw:jr(c.adflw)||{}};Kg("7.7");var h=a.extendDefaults(L.default(r),l);Kg("7.8"),h.afg_disabled=!1===(null===(o=h.sdk)||void 0===o||null===(u=o.afg)||void 0===u?void 0:u.enabled),function(){k.default(this,i)}.bind(this),Kg("7.9"),null!==(d=h.pAds)&&void 0!==d&&d.enabled&&(h.preroll=!0),Kg("7.10"),Gg.send("gdfw.success",{message:"success"}),e(h)}else{r.failed=!0;var f=Wg[Wg.length-1];Gg.send("gdfw.err",{message:"".concat(f,": json error")}),e(r)}}.bind(this)).catch(function(t){k.default(this,n);var a=Wg[Wg.length-1];Gg.send("gdfw.err",{message:"".concat(a,": ").concat(t.message?t.message:t)}),r.failed=!0,e(r)}.bind(this))}catch(t){var u=Wg[Wg.length-1];Gg.send("gdfw.err",{message:"".concat(u,": global ").concat(t.message?t.message:t)}),r.failed=!0,e(r)}}}.bind(this))},$g=function(){var e=A.default(x.default.mark((function e(){var t,n;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Hg();case 2:return n=e.sent,e.abrupt("return",!(null==n||null===(t=n.sdkfw)||void 0===t||!t.enabled));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Qg=function(){var e=A.default(x.default.mark((function e(){var t,n;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Hg();case 2:return n=e.sent,e.next=5,$g();case 5:if(e.t0=e.sent,!e.t0){e.next=8;break}e.t0=!(null==n||null===(t=n.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)}}(),Yg=function(){var e=A.default(x.default.mark((function e(){var t,n,r,a,i,s,o,u;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Hg();case 2:return o=e.sent,u=!(null==o||null===(t=o.extsc)||void 0===t||!t.enabled),e.abrupt("return",{enabled:u,path:u?null==o||null===(n=o.extsc)||void 0===n?void 0:n.path:"",name:u?null==o||null===(r=o.extsc)||void 0===r?void 0:r.name:"",ref:u?null==o||null===(a=o.extsc)||void 0===a?void 0:a.ref:"",loadedFlag:u?null==o||null===(i=o.extsc)||void 0===i?void 0:i.loadedFlag:void 0,loadedFlagCheck:!!u&&!(null==o||null===(s=o.extsc)||void 0===s||!s.loadedFlagCheck)});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Jg=function(){var e=A.default(x.default.mark((function e(){var t,n,r,i,s,o=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Yg();case 2:if((t=e.sent).enabled){e.next=5;break}return e.abrupt("return");case 5:return n=t.path,r=t.name,i=t.ref,e.prev=6,s={},e.next=10,a.getScript(n,r,{error_prefix:"Blocked:",exists:function(){return k.default(this,o),!!i&&!!window[i]}.bind(this),attrs:s});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",r,e.t0),a.dankLog("DEVELOPER_ERROR",e.t0,"warning");case 16:case"end":return e.stop()}}),e,this,[[6,12]])})));return function(){return e.apply(this,arguments)}}(),Xg=!1,Zg=!1,ev=function(){return new Promise(function(){var e=A.default(x.default.mark((function e(t,n){var r,a,i,s,o,u=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Xg){e.next=4;break}return e.abrupt("return",t(Zg));case 4:Xg=!0;case 5:return e.next=7,Yg();case 7:if((r=e.sent).enabled){e.next=10;break}return e.abrupt("return",t(!1));case 10:if(a=r.loadedFlag,!(i=r.loadedFlagCheck)||a){e.next=13;break}return e.abrupt("return",t(!1));case 13:if(i){e.next=16;break}return Zg=!0,e.abrupt("return",t(!0));case 16:s=!0,setTimeout(function(){k.default(this,u),s&&(s=!1,Xg=!0,t(!1))}.bind(this),5e3),o=setInterval(function(){k.default(this,u),s&&i&&window[a]?(s=!1,Xg=!0,Zg=!0,clearInterval(o),t(!0)):s||clearInterval(o)}.bind(this),100);case 19:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}())},tv=function(e){var t=function(e){var t=this,n=function(e){return k.default(this,t),l("showAd",{adType:e})}.bind(this),r=function(e){return k.default(this,t),l("preloadAd",{adType:e})}.bind(this),a=function(e){return k.default(this,t),l("showDisplayAd",{options:e})}.bind(this),i=function(){return k.default(this,t),l("cancelAd")}.bind(this),s=function(){return k.default(this,t),l("openConsole")}.bind(this),o=function(){return k.default(this,t),l("showBanner")}.bind(this),u=function(){return k.default(this,t),l("session")}.bind(this),d=function(e){return k.default(this,t),l("sendGenericEvent",{options:e})}.bind(this),c=function(){k.default(this,t),console.log("_sendSDKReady")}.bind(this),l=function(e,n){var r=this;return k.default(this,t),n||(n={}),new Promise(function(t,a){k.default(this,r);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),h=function(){k.default(this,t),window.addEventListener("message",(function(e){var t=e.data;e.origin,e.source;var n=t.type,r=t.event;"gd-sdk-on-event"===n&&r&&p(r)}),!1)}.bind(this),f=function(){k.default(this,t),h(),l("init")}.bind(this),p=function(n){k.default(this,t),e.onEvent&&e.onEvent(n)}.bind(this);return{showBanner:o,showAd:n,preloadAd:r,showDisplayAd:a,cancelAd:i,openConsole:s,getSession:u,onEvent:p,init:f,_sendSDKReady:c,sendGenericEvent:d}}(e);return t.init(),t},nv=function(){var e=this;return{isMasterGameURL:function(){k.default(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)}.bind(this),isTokenGameURL:function(){k.default(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i.test(location.href)}.bind(this),isExtHostedGameURL:function(){k.default(this,e);return/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i.test(location.href)}.bind(this)}},rv=function(e){var t=this;return new Promise(function(n,r){var a=this;k.default(this,t);var i={type:"gd-sdk-frame-handshake-request"},s=!1;window.addEventListener("message",(function(e){var t=e.data,r=e.origin,a=e.source,i=t.type;if("gd-sdk-frame-handshake-request"===i){var o={type:"gd-sdk-frame-handshake-response"};a.postMessage(o,r)}else"gd-sdk-frame-handshake-response"===i&&(s=!0,n({origin:r,source:a}))})),e?n():(setTimeout(function(){k.default(this,a),s||n()}.bind(this),200),window.parent!==window?window.parent.postMessage(i,"*"):n())}.bind(this))},av=function(){var e=A.default(x.default.mark((function e(){var t,n,r,a,i,s,o,u;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$g();case 2:return t=e.sent,n=!t,e.next=6,rv(n);case 6:if(r=e.sent,t){e.next=9;break}return e.abrupt("return",!1);case 9:return a=nv(),i=a.isMasterGameURL,s=i(),e.next=13,Qg();case 13:return o=e.sent,u=!1,u=o?!s&&!!r:!s,e.abrupt("return",u);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),iv=ce,sv=Dr,ov=Gt,uv=Lt.f,dv=function(e){return function(t){for(var n,r=ov(t),a=sv(r),i=a.length,s=0,o=[];i>s;)n=a[s++],iv&&!uv.call(r,n)||o.push(e?[n,r[n]]:r[n]);return o}},cv={entries:dv(!0),values:dv(!1)}.values;Sr({target:"Object",stat:!0},{values:function(e){return cv(e)}});var lv=Sr,hv=ju,fv=K,pv=jn,mv=id,gv=rc,vv=Qt.exports;lv({target:"Promise",proto:!0,real:!0,forced:!!hv&&fv((function(){hv.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=mv(this,pv("Promise")),n="function"==typeof e;return this.then(n?function(n){return gv(t,e()).then((function(){return n}))}:e,n?function(n){return gv(t,e()).then((function(){throw n}))}:e)}}),"function"!=typeof hv||hv.prototype.finally||vv(hv.prototype,"finally",pv("Promise").prototype.finally);var yv=J,bv="[\t\n\v\f\r \u2028\u2029\ufeff]",_v=RegExp("^"+bv+bv+"*"),wv=RegExp(bv+bv+"*$"),Av=function(e){return function(t){var n=String(yv(t));return 1&e&&(n=n.replace(_v,"")),2&e&&(n=n.replace(wv,"")),n}},kv={start:Av(1),end:Av(2),trim:Av(3)},Ev=K,xv="\t\n\v\f\r \u2028\u2029\ufeff",Sv=kv.trim;Sr({target:"String",proto:!0,forced:function(e){return Ev((function(){return!!xv[e]()||"
"!="
"[e]()||xv[e].name!==e}))}("trim")},{trim:function(){return Sv(this)}});var Rv=se,Tv=Ro,Dv=ce,Ov=G,Iv=yr,Pv=function(e,t,n){var r,a;return Tv&&"function"==typeof(r=t.constructor)&&r!==n&&Rv(a=r.prototype)&&a!==n.prototype&&Tv(e,a),e},Cv=le.f,Lv=Mn.f,Uv=Ll,jv=Ql,Mv=ah,qv=Qt.exports,Bv=K,Gv=kn.set,Nv=Vu,Fv=et("match"),Vv=Ov.RegExp,Wv=Vv.prototype,Kv=/a/g,Hv=/a/g,zv=new Vv(Kv)!==Kv,$v=Mv.UNSUPPORTED_Y;if(Dv&&Iv("RegExp",!zv||$v||Bv((function(){return Hv[Fv]=!1,Vv(Kv)!=Kv||Vv(Hv)==Hv||"/a/i"!=Vv(Kv,"i")})))){for(var Qv=function(e,t){var n,r=this instanceof Qv,a=Uv(e),i=void 0===t;if(!r&&a&&e.constructor===Qv&&i)return e;zv?a&&!i&&(e=e.source):e instanceof Qv&&(i&&(t=jv.call(e)),e=e.source),$v&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var s=Pv(zv?new Vv(e,t):Vv(e,t),r?this:Wv,Qv);return $v&&n&&Gv(s,{sticky:n}),s},Yv=function(e){e in Qv||Cv(Qv,e,{configurable:!0,get:function(){return Vv[e]},set:function(t){Vv[e]=t}})},Jv=Lv(Vv),Xv=0;Jv.length>Xv;)Yv(Jv[Xv++]);Wv.constructor=Qv,Qv.prototype=Wv,qv(Ov,"RegExp",Qv)}Nv("RegExp");var Zv=Sr,ey=ht.find,ty=cu,ny=!0,ry=wt("find");"find"in[]&&Array(1).find((function(){ny=!1})),Zv({target:"Array",proto:!0,forced:ny||!ry},{find:function(e){return ey(this,e,arguments.length>1?arguments[1]:void 0)}}),ty("find");var ay=Sr,iy=Gt,sy=[].join,oy=Y!=Object,uy=pt("join",",");ay({target:"Array",proto:!0,forced:oy||!uy},{join:function(e){return sy.call(iy(this),void 0===e?",":e)}});var dy=Sr,cy=ht.map,ly=wt,hy=Mi("map"),fy=ly("map");dy({target:"Array",proto:!0,forced:!hy||!fy},{map:function(e){return cy(this,e,arguments.length>1?arguments[1]:void 0)}});var py=vf;Sr({target:"Object",stat:!0,forced:Object.assign!==py},{assign:py});var my=function(){function e(t){S.default(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return T.default(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 n in e){var r=e[n];t[n]=r[Math.floor(Math.random()*r.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,r=new D.default(location.href,!0);for(var a in r.query)t[a]=r.query[a];return Object.keys(t).filter(function(t){var n=this;return k.default(this,e),this.customParamKeys.some(function(e){return k.default(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}(),gy=function(){function e(t,n){S.default(this,e),this.adContainer=t,this.onResume=n}return T.default(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(){k.default(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,n){if(!document.getElementById(e)){var r=document.createElement("style");r.type="text/css",r.id=e,r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),t.appendChild(r)}}}]),e}(),vy=function(e){if(!e)return!1;var t=yy.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},yy=Object.prototype.toString;function by(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?by(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):by(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wy(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()}function Ay(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ky(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ay(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ay(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ey=new b.EventEmitter,xy=null,Sy=function(){function e(t,n,r){var i=this;if(S.default(this,e),xy)return xy;xy=this;var s={debug:!1,width:640,height:360,locale:"en"};this.options=n?a.extendDefaults(s,n):s,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new a.EventBus,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=r.parentDomain,this.topDomain=r.topDomain,this.parentURL=r.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=a.getIMASampleTags(),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 o=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:o,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:u,this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){k.default(this,i),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){k.default(this,i),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var t,n,r,i,s,o,u,c,l,h,f,p,m,v,y,b,_,w,E,O,I;return T.default(e,[{key:"start",value:(I=A.default(x.default.mark((function e(){var t=this;return x.default.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){k.default(this,t),this._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 I.apply(this,arguments)})},{key:"_getAdVast",value:function(e,t){var n=this;return new Promise(function(){var r=A.default(x.default.mark((function r(i){var s,o,u,d,c,l,h,f,p=this;return x.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(a.Ls.available&&a.Ls.getBoolean("gd_debug_ex")&&a.Ls.getBoolean("gd_tag"))){r.next=6;break}return s=n.IMASampleTags[e],o=Math.floor(Math.random()*s.length),u=s[o],i({url:u}),r.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){r.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return r.prev=8,d=n.nextAdPosition(e),n._broadcast("AD_REQUEST",{message:d}),c=n.options,"preroll"===d&&g.isPlainObject(c.preroll)?c=c.preroll:"midroll"===d&&g.isPlainObject(c.midroll)?c=c.midroll:"rewarded"===d&&g.isPlainObject(c.rewarded)&&(c=c.rewarded),l="rewarded"===d?"rewardedVideo":"gdbanner"===d?"gd__banner":"midroll"===d?"midroll":"video1",r.next=16,window.idhb.isLoaded();case 16:if(h={tnl_keys:ky(ky({},window.idhb.getAdserverTargetingForAdSlot(l)),{},{tnl_ad_pos:d,tnl_asset_id:n.gameData.gameId})},!(t&&t.retry_on_success&&g.isPlainObject(c.retry_on_success)&&g.isPlainObject(c.retry_on_success.vast))){r.next=21;break}return r.abrupt("return",i(n._createCustomAdVastUrl(c.retry_on_success.vast,h)));case 21:if(!(t&&t.retry_on_failure&&n.options.retry_on_failure&&g.isPlainObject(c.retry_on_failure.vast))){r.next=25;break}return r.abrupt("return",i(n._createCustomAdVastUrl(c.retry_on_failure.vast,h)));case 25:if(!g.isPlainObject(c.vast)){r.next=27;break}return r.abrupt("return",i(n._createCustomAdVastUrl(c.vast,h)));case 27:return r.next=29,n._create_dp_context(d,t);case 29:f=r.sent,qr("gd-adflow, before idhb",d,l),window.idhb.requestAds({slots:R.default({},l,{bidFloor:null!=f&&f.floor_price?f.floor_price:void 0}),callback:function(e,t){var r=this;k.default(this,p),!f||null!=t&&t.bidFloorApplied||fetch(f.skip_url).catch(function(e){k.default(this,r)}.bind(this)),i({tnl_keys:ky(ky({},window.idhb.getAdserverTargetingForAdSlot(l)),{},{tnl_ad_pos:d,tnl_asset_id:n.gameData.gameId}),url:e,dp:f,hl:t})}.bind(this)}),r.next=37;break;case 34:throw r.prev=34,r.t0=r.catch(8),new Error(r.t0);case 37:case"end":return r.stop()}}),r,this,[[8,34]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===a.AdType.Rewarded)return this.adRewardedCount++,"rewarded";if(e===a.AdType.Interstitial){var t=!1===this.gameData.preroll||1===this.adPrerollCount;return t?this.adMidrollCount++:this.adPrerollCount++,t||this.adMidrollCount>0?"midroll":"preroll"}return"midroll"}},{key:"getAdPosition",value:function(e){return e===a.AdType.Rewarded?"rewarded":e===a.AdType.Interstitial?!1===this.gameData.preroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_requestPromo",value:function(e,t){var n=new google.ima.AdsRequest;return n.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),n.linearAdSlotWidth=this.options.width,n.linearAdSlotHeight=this.options.height,n.nonLinearAdSlotWidth=this.options.width,n.nonLinearAdSlotHeight=this.options.height,n.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(n.vastLoadTimeout=this.options.vast_load_timeout),n.setAdWillAutoPlay(t.autoplayAllowed),n.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(n),n}},{key:"_requestAd",value:function(e,t){var n=this;return t=t||{},new Promise(function(r){var a=this;if(k.default(this,n),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var i,s=null==e||null===(i=e.tnl_keys)||void 0===i?void 0:i.tnl_ad_pos;this.adSuccess=!1;var o=new google.ima.AdsRequest,u=this._transformVast(e,t),d=ky(ky({},t),{},{adTag:u,tnl_ad_pos:s});this.adCounter[s]=this.adCounter[s]||0,this.adCounter[s]++;var c=e.dp,l=e.hl;c&&(c.adtag_url=u.url,this._extend_dp_with_adsense(c,l,null==e?void 0:e.tnl_keys));var h=this._isVMAP(s);if(function(){k.default(this,a),t.shouldFail&&(c?(c.adtag_url="dp_original_broken",c.fallback_url="dp_fallback_broken"):u.url="original_broken",qr("gd-adflow, _requestAd, dp.adtag_url",null==c?void 0:c.adtag_url),qr("gd-adflow, _requestAd, dp.fallback_url",null==c?void 0:c.fallback_url),qr("gd-adflow, _requestAd, adTag.url",u.url)),h=!1}.bind(this),h){qr("gd-adflow, _isVMAP");var f=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,a=Date.now(),i=new D.default(e.adtag_url_1,!0);i.query=_y(_y({},i.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:a,output:"xml_vast3"});var s=i.toString(),o=new D.default(e.adtag_url_2,!0);o.query=_y(_y({},o.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++a,output:"xml_vast3"});var u=o.toString(),d=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(d++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(wy({id:d++,adtag_url:s,error_url:null==n?void 0:n.error_url,impression_url:null==n?void 0:n.impression_url}),'\n </vmap:AdSource>\n</vmap:AdBreak>\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-2">\n <vmap:AdSource id="').concat(d++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(wy({id:d++,adtag_url:u,error_url:null==r?void 0:r.error_url,impression_url:null==r?void 0:r.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:c,adtag:u,position:"preroll"===d.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(s)}));o.adsResponse=f}else if(c&&l.bidFloorApplied){qr("gd-adflow, vast wrapper");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()}(c);o.adsResponse=p}else if(c&&c.fallback_url){qr("gd-adflow, vast wrapper 2");var m=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()}(c);o.adsResponse=m}else qr("gd-adflow, without dp"),o.adTagUrl=u.url;o.linearAdSlotWidth=this.options.width,o.linearAdSlotHeight=this.options.height,o.nonLinearAdSlotWidth=this.options.width,o.nonLinearAdSlotHeight=this.options.height,o.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(o.vastLoadTimeout=this.options.vast_load_timeout),o.setAdWillAutoPlay(t.autoplayAllowed),o.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(o,d);try{this._broadcast("AD_SDK_REQUEST",{message:d})}catch(e){}r(o)}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._broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameData.gameId}})}}},{key:"_checkAutoPlay",value:(O=A.default(x.default.mark((function e(){var t=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=this;k.default(this,t);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):U.default.video({inline:!0,muted:!1}).then(function(t){k.default(this,r);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 O.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(E=A.default(x.default.mark((function e(){var t;return x.default.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 E.apply(this,arguments)})},{key:"startAd",value:(w=A.default(x.default.mark((function e(t){var n,r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.adType,r=t.params,this.adType_=n,this.adContext=ky({},r),"promo"!==(null==r?void 0:r.adapter)){e.next=5;break}return e.abrupt("return",this._startPromo(r,n));case 5:if("adsense"!==(null==r?void 0:r.adapter)){e.next=26;break}if(n!==a.AdType.Interstitial){e.next=19;break}if("preroll"!==(null==r?void 0:r.position)){e.next=11;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 11:if("start"!==(null==r?void 0:r.position)){e.next=15;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 15:if("next"!==(null==r?void 0:r.position)){e.next=17;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 17:e.next=24;break;case 19:if(n!==a.AdType.Rewarded){e.next=23;break}return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 23:throw new Error("Unsupported ad type");case 24:e.next=35;break;case 26:if(n!==a.AdType.Interstitial){e.next=30;break}return e.abrupt("return",this._startInterstitialAd(r));case 30:if(n!==a.AdType.Rewarded){e.next=34;break}return e.abrupt("return",this._startRewardedAd(r));case 34:throw new Error("Unsupported ad type");case 35:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"preloadAd",value:(_=A.default(x.default.mark((function e(t){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==a.AdType.Interstitial){e.next=4;break}return e.abrupt("return","gdsdk://preloaded");case 4:if(t!==a.AdType.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 _.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,t=function(){k.default(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new gy(this.adContainer,t),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(b=A.default(x.default.mark((function e(t){var n=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(r,i){var s,o,u,d,c,l,h,f,p,m=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(o=t?t.containerId:null)||i("Container id is not specified"),u=document.getElementById(o),document.getElementById(o)||i("No container is found with this id - ".concat(o)),void 0===window.idhb.requestAds&&i("Prebid.js wrapper script hit an error or didn't exist!"),d=t.slotId?t.slotId:"gd__banner@".concat(o),document.getElementById(d)||(c="\n .gd__banner{\n z-index: ".concat(a.Layers.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((l=document.createElement("style")).type="text/css",l.id="gd__banner__style",l.styleSheet?l.styleSheet.cssText=c:l.appendChild(document.createTextNode(c)),u.appendChild(l)),(h=document.createElement("div")).id=d,h.classList.add("gd__banner"),u.appendChild(h)),e.next=10,n._create_dp_display_context();case 10:n.atom_display=e.sent,null!==(s=n.atom_display)&&void 0!==s&&s.params&&window.idhb.setAdserverTargeting(null===(f=n.atom_display)||void 0===f?void 0:f.params),(p={})[d]={maxSize:[u.offsetWidth,u.offsetHeight]},window.idhb.requestAds({slots:p,callback:function(e){k.default(this,m)}.bind(this)}),r(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),i(e.t0.message||e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return b.apply(this,arguments)})},{key:"_startInterstitialAd",value:(y=A.default(x.default.mark((function e(t){var n,r=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){k.default(this,r)}.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(ky(ky({},n),t));case 13:if(e.sent.success){e.next=18;break}return e.abrupt("return");case 18:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=27;break;case 23:throw e.prev=23,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 27:case"end":return e.stop()}}),e,this,[[0,23]])}))),function(e){return y.apply(this,arguments)})},{key:"_startPromo",value:(v=A.default(x.default.mark((function e(t,n){var r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this._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 r=e.sent,e.next=11,this._loadPromo(ky(ky({},r),t),n);case 11:if(e.sent.success){e.next=16;break}return e.abrupt("return");case 16:r.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=27;break;case 22:throw e.prev=22,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 27:case"end":return e.stop()}}),e,this,[[0,22]])}))),function(e,t){return v.apply(this,arguments)})},{key:"_loadPromo",value:(m=A.default(x.default.mark((function e(t,n){var r,i;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._resetAdsLoader(),e.prev=1,r=this.nextAdPosition(n),i=this._create_promo_context(r),this._requestPromo(i,ky({adType:a.AdType.Interstitial},t)),e.next=7,this._waitOnAdLoad();case 7:return e.abrupt("return",e.sent);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 m.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(p=A.default(x.default.mark((function e(t){var n;return x.default.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(a.AdType.Interstitial,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(n,ky({adType:a.AdType.Interstitial},t));case 11:return e.next=14,this._waitOnAdLoad();case 14:return e.abrupt("return",e.sent);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 p.apply(this,arguments)})},{key:"_waitOnAdLoad",value:function(){var e=this;return new Promise(function(t,n){var r=this;k.default(this,e);var a="videoad.preloadad";this.eventBus.unsubscribeScope(a);var i=function(e){var n=this;k.default(this,r),setTimeout(function(){k.default(this,n),this.eventBus.unsubscribeScope(a),t({success:!0,args:e})}.bind(this),1)}.bind(this),s=function(e){var n=this;k.default(this,r),setTimeout(function(){k.default(this,n),this.eventBus.unsubscribeScope(a),t({success:!1,args:e})}.bind(this),1)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",i,a),this.eventBus.subscribe("AD_SDK_CANCELED",s,a),this.eventBus.subscribe("AD_ERROR",s,a)}.bind(this))}},{key:"_startRewardedAd",value:(f=A.default(x.default.mark((function e(t){var n,r=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){k.default(this,r)}.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(ky(ky({},n),t));case 13:if(e.sent.success){e.next=18;break}return e.abrupt("return");case 18:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=27;break;case 23:throw e.prev=23,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 27:case"end":return e.stop()}}),e,this,[[0,23]])}))),function(e){return f.apply(this,arguments)})},{key:"_loadRewardedAd",value:(h=A.default(x.default.mark((function e(t){var n;return x.default.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(a.AdType.Rewarded,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(n,ky({adType:a.AdType.Rewarded},t));case 11:return e.next=14,this._waitOnAdLoad();case 14:return e.abrupt("return",e.sent);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:(l=A.default(x.default.mark((function e(){return x.default.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(a.AdType.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 l.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(c=A.default(x.default.mark((function e(){return x.default.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(a.AdType.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 c.apply(this,arguments)})},{key:"_onError",value:function(e){this.cancel(),this._clearSafetyTimer("ERROR")}},{key:"_hide",value:function(e){this.video_ad_player&&(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=this.gameData.__t4r;var r=this._isT4R(e),a=this._getT4ROptions(e);if("loaded"===n)this.activeAdContainer.style.opacity=r?.001:1,r&&this.adsManager.setVolume(0),r&&this._broadcast("AD_T4R"),r&&setTimeout(function(){k.default(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(r&&"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=a.Layers.AdsContainer.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 r=document.createElement("div");r.id="".concat(this.prefix,"advertisement_slot"),r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",this.adContainerInner=r,this.activeAdContainer=this.adContainer,window.activeAdContainer=this.activeAdContainer,this.thirdPartyContainer?(this.adContainer.appendChild(r),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(r),t.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var i=function(){k.default(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,r.style.width=this.options.width+"px",r.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",i),window.document.addEventListener("DOMContentLoaded",i)}},{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(){k.default(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 r=new Date,a=r.getHours(),i=r.getDate(),s=r.getMonth(),o=r.getFullYear(),u="AD_SDK_MANAGER_READY";this._broadcast(u,{name:u,message:"AD SDK is ready",status:"success",analytics:{category:u,action:this.parentDomain,label:"h".concat(a," d").concat(i," m").concat(s," y").concat(o)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var t,n=this,r=new Date,i=r.getHours(),s=r.getDate(),o=r.getMonth(),u=r.getFullYear(),d=a.getKeyByValue(google.ima.AdEvent.Type,e.type),c=!1,l=(null==e||null===(t=e.getAd())||void 0===t?void 0:t.getContentType())||"",h=!l.startsWith("image")&&!l.startsWith("text");this._sendIMAEventsToHB(e);var f="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:f="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:f="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:c=!0,f="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:f="Fired when the ad is clicked.";var p=e.getAd().getContentType();this._show({mode:"click",contentType:p});break;case google.ima.AdEvent.Type.COMPLETE:qr("gd-adflow ON COMPLETE!",e.getAd()),c=this._is_completed(e.getAd()),f="Fired when the ad completes playing.",this.adType_===a.AdType.Rewarded&&this._broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:f="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:f="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",c=!0,this._hideAddResume();break;case google.ima.AdEvent.Type.DURATION_CHANGE:f="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:f="Fired when the ad playhead crosses first quartile.";var m=e.getAd().getContentType();this._show({mode:"first_quartile",contentType:m});break;case google.ima.AdEvent.Type.IMPRESSION:f="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:f="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:f="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var g=e.getAd().getContentType();f=g,this._show({mode:"loaded",contentType:g});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(f=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:f="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:h&&this.adResume.show(),f="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:f="Fired when the ad is resumed.",h&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:f="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:c=this._is_completed(e.getAd()),f="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:this._hideAddResume(),f="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:f="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:c=this._is_completed(e.getAd()),f="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:f="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:f="Fired when the ad volume has been muted."}if(""!==d&&""!==f&&this._broadcast(d,{name:d,message:f,status:"success",analytics:{category:d,action:this.parentDomain,label:"h".concat(i," d").concat(s," m").concat(o," y").concat(u)}}),c&&!this.adSuccess){this.adSuccess=!0;var v=e.getAd(),y="Rainbow"===(null==v?void 0:v.getAdSystem())&&(null==v?void 0:v.getWrapperAdIds().some(function(e){return k.default(this,n),"promo"===e}.bind(this)));qr("gd-adflow isPromoSuccess",y,null==v?void 0:v.getAdSystem(),null==v?void 0:v.getWrapperAdIds()),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success",isPromoSuccess:y}),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",n=e.getError(),r=n.getErrorCode().toString()||n.getVastErrorCode().toString(),a=this._getInnerErrorCode(n);Ey.emit("AD_ERROR",r),this._broadcast(t,{message:r,details:a,status:"warning",analytics:{category:t,action:a,label:r}}),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(){k.default(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(vy(e.getInnerError)){var t=e.getInnerError();if(t)return vy(t.getErrorCode)&&vy(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 r=this.macros.transform(e,{get:function(e){if(k.default(this,n),t&&t.tnl_keys)return t.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in r.query||{}){var i=r.query[a];g.isPlainObject(i)&&(r.query[a]=j.default.stringify(i))}var s=new D.default(r.url,!0);return M.default(s.query,r.query||{}),ky({url:s.toString()},t)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new D.default(e.url,!0),a=this._transformQuery(e,t,r);a&&(n.url=r.toString());var i=a?r:new D.default(e.url,!0);if(i.query.cust_params){var s=j.default.parse(i.query.cust_params);n.bidder=s.hb_bidder,n.cust_params=s}n.url_parsed=i}catch(e){n.hasError=!0,n.message=e.message,n.bidder="error",console.log(e.message)}return n}},{key:"_transformQuery",value:function(e,t,n){var r=this;if(e&&t&&e.tnl_keys){var a=this.options.vast_query;if(t.retry_on_success&&this.options.retry_on_success&&g.isPlainObject(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:t.retry_on_failure&&this.options.retry_on_failure&&g.isPlainObject(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=L.default(a),g.isPlainObject(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 o=j.default.parse(i.cust_params);if(a.cust_params&&a.cust_params.$$remove){for(var u in o){new RegExp(a.cust_params.$$remove,"i").test(u)&&delete o[u]}delete a.cust_params.$$remove}var d=this.macros.transform(a,{get:function(t){return k.default(this,r),e.tnl_keys[t.toLowerCase()]}.bind(this)});return i.cust_params=o,M.default(i,d),i.cust_params=j.default.stringify(i.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,a,i=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(this.clickCount[i]>=(null===(n=e.t4r[i])||void 0===n?void 0:n.count))return!1;if(null!=e&&null!==(r=e.contentType)&&void 0!==r&&r.startsWith("image/")||"text"===(null==e?void 0:e.contentType))return i&&(null===(a=e.t4r[i])||void 0===a?void 0:a.enabled);if(null!=e&&e.contentType.startsWith("video/")){var s,o=(null===(s=e.t4r[i])||void 0===s?void 0:s.viper)||0;if(o>0){var u,d=Math.random()<o;return i&&d&&(null===(u=e.t4r[i])||void 0===u?void 0:u.enabled)}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,n,r,a,i,s,o,u,d,c,l,h,f,p,m;if(!e)return!1;var g="preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap)||!0===(null===(r=this.gameData)||void 0===r||null===(a=r.pAds)||void 0===a||null===(i=a.vmap)||void 0===i?void 0:i.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.vmap)||!0===(null===(u=this.gameData)||void 0===u||null===(d=u.mAds)||void 0===d||null===(c=d.vmap)||void 0===c?void 0:c.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.vmap)||!0===(null===(f=this.gameData)||void 0===f||null===(p=f.rAds)||void 0===p||null===(m=p.vmap)||void 0===m?void 0:m.enabled));if(!g)return!1;var v=this._get_vmap_config(e),y=this.adCounter[e];return void 0!==(null==v?void 0:v.start)?y>=(null==v?void 0:v.start):g}},{key:"_getT4ROptions",value:function(e){var t,n=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;switch(n){case"preroll":case"midroll":case"rewarded":return e.t4r[n]}}},{key:"_is_completed",value:function(e){var t=e.getContentType(),n=e.getAdPodInfo();return!(!t.startsWith("image/")&&"text"!==t&&1!==n.getTotalAds())}},{key:"_get_vmap_context",value:function(e){var t=e.adtag,n=e.position,r=e.config,a=e.dp,i=this._createCustomAdVastUrl(null==r?void 0:r.vast_1)||t,s=this._createCustomAdVastUrl(null==r?void 0:r.vast_2)||t,o=null!=r&&r.vast_1?void 0:a,u=null!=r&&r.vast_2?void 0:a;return{adtag_url_1:null==i?void 0:i.url,adtag_url_2:null==s?void 0:s.url,position:n,dp_1:o,dp_2:u}}},{key:"_get_vmap_config",value:function(e){var t,n,r,a,i,s,o,u;switch(e){case"preroll":return null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap;case"midroll":return null===(r=this.gameData)||void 0===r||null===(a=r.mAds)||void 0===a?void 0:a.vmap;case"rewarded":return null===(i=this.gameData)||void 0===i||null===(s=i.rAds)||void 0===s?void 0:s.vmap;default:return null===(o=this.gameData)||void 0===o||null===(u=o.pAds)||void 0===u?void 0:u.vmap}}},{key:"_isDP",value:function(e){var t,n,r;return!!e&&!0===(null===(t=this.gameData)||void 0===t||null===(n=t.dp)||void 0===n||null===(r=n[e])||void 0===r?void 0:r.enabled)}},{key:"_create_dp_display_context",value:function(){var e=this;return new Promise(function(t){var n=this;k.default(this,e);try{var r={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new my(this.gameData).checkCustomParams();a&&(r.cp=a);var i=encodeURIComponent(d.Base64.encode(JSON.stringify(r)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(i)).then(function(e){return k.default(this,n),e.json()}.bind(this)).then(function(e){if(k.default(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){k.default(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,r={id:this.topDomain||this.parentDomain,au:e||"unknown",ty:"video",aid:this.gameData.gameId,pgu:this.parentURL},a=Object.keys(r).map(function(e){return k.default(this,n),"".concat(e,"=").concat(encodeURIComponent(r[e]))}.bind(this)).join("&");encodeURIComponent(d.Base64.encode(JSON.stringify(r)));var i=null===(t=this.gameData.promo)||void 0===t?void 0:t.rainbow,s=null==i?void 0:i.enabled,o="https://tag.atom.gamedistribution.com/v1/rainbow/?".concat(a);console.log("gd-adflow openPromoUrl",o);var u=s?o:void 0;return function(){k.default(this,n)}.bind(this),{promo_url:u,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,t){var n=this;return new Promise(function(){var r=A.default(x.default.mark((function r(a){var i,s,o,u,c,l,h=this;return x.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,n._isDP(e)){r.next=5;break}return n.msgrt.send("dp.na",{message:"rule"}),r.abrupt("return",a());case 5:s={id:n.topDomain||n.parentDomain,au:e||"unknown",ty:"video",aid:n.gameData.gameId,pgu:n.parentURL},(o=new my(n.gameData).checkCustomParams())&&(s.cp=o),u=encodeURIComponent(d.Base64.encode(JSON.stringify(s))),qr("gd-adflow isLastAdapter",null==t?void 0:t.adapterIndex,null==t?void 0:t.isLastAdapter),c=null===(i=n.gameData.promo)||void 0===i?void 0:i.rainbow,l=(null==c?void 0:c.enabled)&&(null==t?void 0:t.isLastAdapter),qr("gd-adflow promo_enabled",l,null==c?void 0:c.enabled,null==t?void 0:t.isLastAdapter),fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(u)).then(function(e){return k.default(this,h),e.json()}.bind(this)).then(function(e){if(k.default(this,h),!e||!e.p)return n.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(u,"&ec=[ERRORCODE]"),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(u),skip_url:"https://tag.atom.gamedistribution.com/v1/skp?ar=".concat(u),promo_url:l?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(u):void 0,promo_imp_blue_url:l?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:l?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){k.default(this,h),n.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),a()}.bind(this)),r.next=20;break;case 16:r.prev=16,r.t0=r.catch(0),n.msgrt.send("dp.err",{message:(null===r.t0||void 0===r.t0?void 0:r.t0.message)||r.t0}),a();case 20:case"end":return r.stop()}}),r,this,[[0,16]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t){if(e&&t)try{var n,r=new D.default(t.vastUrl,!0);if(null===(n=r.query)||void 0===n||!n.cust_params)return;var a=j.default.parse(r.query.cust_params);if(!a.tnl_asset_id)return;a.adsense=1,r.query.cust_params=j.default.stringify(a,!1),e.fallback_url=r.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(u=A.default(x.default.mark((function e(t){var n,r,i,s,o,u=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getPrebidScripts(),r=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,a.getScript(r,"gdsdk_prebid",{alternates:n,error_prefix:"Blocked:",exists:function(){return k.default(this,u),window.idhb.requestAds}.bind(this)});case 8:i=a.getQueryString("ch",window.location.href),s=a.getQueryString("ch_date",window.location.href),o={tnl_content_category:this.category.toLowerCase()},i&&(o.channel=i),s&&(o.ch_date=s),window.idhb.setAdserverTargeting(o),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var t=this;k.default(this,u);try{var n,r=e.slotId.split("@");r=1===r.length?r[0]:r[1],e.isEmpty?(null!==(n=this.atom_display)&&void 0!==n&&n.error_url&&(fetch(this.atom_display.error_url).catch(function(e){k.default(this,t)}.bind(this)),delete this.atom_display),this._broadcast("DISPLAYAD_ERROR",{message:r,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){k.default(this,t)}.bind(this)),delete this.atom_display),this._broadcast("DISPLAYAD_IMPRESSION",{message:r,status:"success"}))}catch(e){}}.bind(this));case 16:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"_init_ima_script",value:(o=A.default(x.default.mark((function e(t){var n,r,i=this;return x.default.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"],r=this.options.debug?n[0]:n[1],e.next=4,a.getScript(r,"gdsdk_ima",{alternates:n,error_prefix:"Blocked:",exists:function(){return k.default(this,i),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_init_afg_script",value:(s=A.default(x.default.mark((function e(t){var n,r,i,s,o=this;return x.default.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(s={}).crossorigin="anonymous",s["data-ad-client"]=(null==t||null===(n=t.adsense_client)||void 0===n?void 0:n.length)>0?t.adsense_client:"ca-pub-2316275586951220",s["data-ad-frequency-hint"]="30s",s.allow="autoplay",(null==t||null===(r=t.adsense_channel)||void 0===r?void 0:r.length)>0&&(s["data-ad-channel"]=t.adsense_channel),(null==t||null===(i=t.adsense_host)||void 0===i?void 0:i.length)>0&&(s["data-ad-host"]=t.adsense_host),!0===(null==t?void 0:t.adsense_adbreak_test)&&(s["data-adbreak-test"]="on"),e.next=14,a.getScript("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return k.default(this,o),!!window.adsbygoogle}.bind(this),attrs:s});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=A.default(x.default.mark((function e(t){var n,r,a,i,s,o,u=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(k.default(this,u),t.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense rewarded error",status:"error",skipForward:!0}),!0}.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(){k.default(this,u),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){k.default(this,u),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(){k.default(this,u),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),i=function(){k.default(this,u),this._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"}),this._send_atom_event("sg.ad.rw.viewed")}.bind(this),s=function(e){k.default(this,u),e()}.bind(this),o=function(e){k.default(this,u),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===e.breakStatus?this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error",skipForward:!0}),"dismissed"!==e.breakStatus&&this._send_atom_event("sg.dbg.rw",e))}.bind(this),d={type:"reward",name:"reward-in-game",beforeAd:n,afterAd:r,adDismissed:a,adViewed:i,beforeReward:s,adBreakDone:o},window.adsbygoogle.push(d),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 d}),e,this,[[1,20]])}))),function(e){return i.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(r=A.default(x.default.mark((function e(t){var n,r=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(k.default(this,r),t.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense preroll error",status:"error"}),!0}.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){k.default(this,r),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"}),this._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),a={type:"preroll",adBreakDone:n},window.adsbygoogle.push(a),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 a}),e,this,[[1,15]])}))),function(e){return r.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(n=A.default(x.default.mark((function e(t){var n,r,a,i=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(k.default(this,i),t.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense preroll error 2",status:"error"}),!0}.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(){k.default(this,i),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){k.default(this,i),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){k.default(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._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),s={type:"start",name:"start-in-game",beforeAd:n,afterAd:r,adBreakDone:a},window.adsbygoogle.push(s),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 s}),e,this,[[1,17]])}))),function(e){return n.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(t=A.default(x.default.mark((function e(t){var n,r,a,i=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(k.default(this,i),t.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense midroll error",status:"error"}),!0}.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(){k.default(this,i),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){k.default(this,i),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){k.default(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._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",e))}.bind(this),s={type:"next",name:"next-in-game",beforeAd:n,afterAd:r,adBreakDone:a},window.adsbygoogle.push(s),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 s}),e,this,[[1,17]])}))),function(e){return t.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var n=this.msgrt,r=n._layout,a=n._ua,i={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:a.browser.name,brvs:a.browser.version,osnm:a.os.name,osvs:a.os.version,dvmd:a.device.model,w:r.w,h:r.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(d.Base64.encode(JSON.stringify(i)))))}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 n=e.adType;if(n===a.AdType.Rewarded)t="reward";else if(n===a.AdType.Interstitial){var r,i;if(this._isAfgPositionStart(e))t=null===(r=this.gameData.pAds)||void 0===r||!r.enabled||null!==(i=this.gameData.loader)&&void 0!==i&&i.enabled?"start":"next";else this._isAfgPositionNext(e)&&(t="next")}e.params.position=t}},{key:"_broadcast",value:function(e,t){var n=this,r=!1;["AD_ERROR"].some(function(t){return k.default(this,n),t===e}.bind(this))&&(r=!this.adContext.isLastAdapter||this.adContext.extraPromoRunOnFail,console.log("gd-adflow skipForward",e,r,this.adContext.adapterIndex,this.adContext.isLastAdapter,this.adContext.extraPromoRunOnFail)),this.eventBus.broadcast(e,ky(ky({},t),{},{skipForward:r}))}}]),e}(),Ry=function e(t){var n=this;S.default(this,e),R.default(this,"load",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Dl(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),R.default(this,"promo",A.default(x.default.mark((function e(){return x.default.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 r=t.package||"gd-sdk-stone-dynamic",a=t.package_version||"1.1.1",i=t.template||"puzzle",s=t.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(r,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},Rl(this.moduleName,this.moduleConfig)},Ty=function e(t){var n=this;S.default(this,e),R.default(this,"load",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Dl(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),R.default(this,"splash",A.default(x.default.mark((function e(){return x.default.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 r=t.package||"gd-sdk-air-dynamic",a=t.package_version||"1.2.0",i=t.template||"pluto",s=t.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(r,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},Rl(this.moduleName,this.moduleConfig)},Dy=function(e,t){console.log(e,t)},Oy={},Iy={},Py=null;function Cy(){for(var e,t=window,n=null,r=null;!e;){try{if("function"==typeof t.__tcfapi||"function"==typeof t.__cmp){"function"==typeof t.__tcfapi?(r=2,n=t.__tcfapi):(r=1,n=t.__cmp),e=t;break}}catch(e){}try{if(t.frames.__tcfapiLocator){r=2,e=t;break}}catch(e){}try{if(t.frames.__cmpLocator){r=1,e=t;break}}catch(e){}if(t===window.top)break;t=t.parent}return Oy.version=r,Oy.frame=e,Oy.function=n,Oy.version}function Ly(e){var t=this;return Py||(Py=new Promise(function(n){function r(t,r){if(Dy("Received a response from CMP",t),r){var a,i;if(!1!==t.gdprApplies)return"tcloaded"===t.eventStatus||"useractioncomplete"===t.eventStatus?(("boolean"!=typeof(i=(a=t)&&"boolean"==typeof a.gdprApplies?a.gdprApplies:e.defaultGdprScope)||!0===i&&"string"!=typeof a.tcString)&&n({result:"cmpUnexpectedResponse",cmp:Oy,consentData:a}),void n({result:"ok",consentData:t})):void 0;n({result:"ok",consentData:t})}else n({result:"cmpCallFailed"})}k.default(this,t),Cy(),Oy.frame?2===Oy.version?(Dy("TCF v2 CMP found. Fetching the consent."),Oy.function?(Dy("CMP API is directly accessible, calling it now..."),Oy.function("addEventListener",Oy.version,r)):(Dy("CMP API is outside the current iframe, calling it now..."),function(e,t,n){var r=this,a="__tcfapi";function i(e){var t="".concat(a,"Return"),n="string"==typeof e.data&&e.data.indexOf(t)>=0?JSON.parse(e.data):e.data;if(n[t]&&n[t].callId){var r=n[t];void 0!==Iy[r.callId]&&Iy[r.callId](r.returnValue,r.success)}}window[a]=function(e,n,i,s){k.default(this,r);var o=Math.random()+"",u="".concat(a,"Call"),d=R.default({},u,{command:e,parameter:s,callId:o,version:n});Iy[o]=i,t.postMessage(d,"*")}.bind(this),window.addEventListener("message",i,!1),window[a](e,Oy.version,n)}("addEventListener",Oy.frame,r))):n({result:"cmpVersionNotV2",cmp:Oy}):n({result:"cmpNotFound"})}.bind(this)))}var Uy=new(function(){function e(){S.default(this,e),this.productName="Game Distribution"}var t;return T.default(e,[{key:"checkIfExcluded",value:function(e){try{var t,n;return!(null===(t=e.diagnostic)||void 0===t||null===(n=t.gameDock)||void 0===n||!n.excluded)}catch(e){return console.log("Error on checkIfExclude check",e),!1}}},{key:"track",value:(t=A.default(x.default.mark((function e(t,n){var r,a,i,s,o,u;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.checkIfExcluded(n)){e.next=3;break}return e.abrupt("return");case 3:if(a=null==t||null===(r=t.visitor)||void 0===r?void 0:r.visitorId){e.next=6;break}return e.abrupt("return");case 6:return i=encodeURIComponent(this.productName),s=encodeURIComponent(a),e.prev=8,o="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(i,"/user_id/").concat(s),e.next=12,fetch(o,{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,u="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(i,"/user_id/").concat(s),e.next=22,fetch(u,{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,n){return t.apply(this,arguments)})}]),e}());function jy(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return My(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return My(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}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 i,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function My(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var qy=function(e){var t=this,n=e.src,r=e.attributes,a=e.target,i=e.isAsync;return new Promise(function(e,s){var o=this;k.default(this,t);try{var u=document.createElement("script");if(u.async=null==i||i,u.type="text/javascript",u.onload=function(){k.default(this,o),e()}.bind(this),u.onerror=function(){k.default(this,o);var e="Error on script load, Error: ".concat(n);console.log(e),s(e)}.bind(this),u.src=n,r){var d,c=jy(r);try{for(c.s();!(d=c.n()).done;){var l=d.value,h=l.key,f=l.value;u.setAttribute(h,f)}}catch(e){c.e(e)}finally{c.f()}}a||(a=document.head),a.appendChild(u)}catch(e){var p="Error on script load catch, Error: ".concat(n);console.log(p,e),s(p)}}.bind(this))},By=function(){var e=A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,qy({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,qy({src:"https://cookie-cdn.cookiepro.com/consent/".concat("140feb72-7952-4420-8ae5-e8978d87bc17","/OtAutoBlock.js"),attributes:[{key:"id",value:"gd-cookie-pro-autoblock"}],isAsync:!1});case 5:return e.next=7,qy({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:"140feb72-7952-4420-8ae5-e8978d87bc17"}],isAsync:!1});case 7:n=void 0,r=void 0,a=void 0,n=(t={inlineScript:"function OptanonWrapper() { }"}).inlineScript,r=t.target,(a=document.createElement("script")).text=n,r||(r=document.head),r.appendChild(a),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,n,r,a}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),Gy=new b.EventEmitter,Ny={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};function Fy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}window.addEventListener("message",(function(e){var t=this,n=e.data,r=e.origin,a=n.type;if(Object.keys(Ny).some(function(e){return k.default(this,t),e===r}.bind(this))&&(null==n||!n.__tcfapiCall)&&(window.parent&&!n.type.startsWith("gd-sdk")&&window.parent.postMessage(n,"*"),a)){var i=Ny[r][a];i&&Gy.emit(i,n)}}),!1);var Vy=_.v4(),Wy=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="__msgr",document.body.appendChild(n),window!==window.top){var r={gameId:e.gameId,target:e.evnts.domain,token:Vy,event_name:"TokenGenerated",timestamp:Date.now()};n.onload=function(){zy(r)},setInterval(function(){k.default(this,t),r.timestamp=Date.now(),r.event_name="Heartbeat",zy(r)}.bind(this),1e3*e.evnts.heartbeatDuration)}}window.addEventListener("message",function(e){k.default(this,t);try{var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fy(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.data);if(!n.event_name)return;n.token=Vy,zy(n)}catch(e){console.error("GD Messager Error",e.message)}}.bind(this),!1)},Ky=function(e){try{var t={gameId:e.game.gameId,target:e.game.evnts.domain,event_name:e.event,timestamp:Date.now()},n=Hy(window);n!==window.top&&(null==n||n.postMessage(t,"https://html5.gamedistribution.com"))}catch(e){}},Hy=function e(t){try{var n,r,a=null==t?void 0:t.parent;if("game"===(null===(n=a.document)||void 0===n||null===(r=n.activeElement)||void 0===r?void 0:r.id))return a;e(a)}catch(e){return t}},zy=function(e){window.__msgr.postMessage(e,"https://static.gamedistribution.com")};function $y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$y(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Yy(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Jy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jy(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}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 i,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function Jy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Xy=function(){function e(t){var n=this;S.default(this,e),R.default(this,"_getAdTypeByAfgPosition",function(e){var t=this;k.default(this,n);var r={preroll:["preroll","start"],midroll:["next"],rewarded:["reward"]},a=Object.keys(r).find(function(n){var a=this;return k.default(this,t),r[n].some(function(t){return k.default(this,a),t===e.params.position}.bind(this))}.bind(this));return a||"midroll"}.bind(this)),this._gameData=t._gameData,this._msgrt=t.msgrt,this._adInstance=t.adInstance,this._eventBus=t.eventBus,this._onResumeGame=t.onResumeGame.bind(t),this._setAdRequestTimer=t._setAdRequestTimer.bind(t),this._giveGift=t._giveGift.bind(t)}var t,n;return T.default(e,[{key:"runAdFlow",value:(n=A.default(x.default.mark((function e(t){var n,r,a,i,s,o,u,d,c,l,h,f,p,m,g,v,y,b,_,w,A,E,S,R,T,D,O,I,P=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=this._getAdTypeByAfgPosition(t),qr("gd-adflow, adTypeFound",s),o=this._getAdFlow(s),qr("gd-adflow config read",o),u=this._gameData,d=u.afg_disabled,c=null===(n=u.promo)||void 0===n||null===(r=n.rainbow)||void 0===r?void 0:r.enabled,l=null===(a=u.promo)||void 0===a?void 0:a.onadsense,h="reward"===(null===(i=t.params)||void 0===i?void 0:i.position),f=d?o.filter(function(e){return k.default(this,P),"adsense"!==e}.bind(this)):o,p=!1,m=!1,g=[],v=0,y=!1,qr("gd-adflow, enabled adapters",f),b=Yy(f),e.prev=17,b.s();case 19:if((_=b.n()).done){e.next=46;break}return w=_.value,t.params.adapter=w,A=v===f.length-1,c&&A&&"ima"===w&&(t.params.runPromoAsImaFallback=!0),E=A&&"adsense"===w&&c&&l&&h,t.params=Qy(Qy({},t.params),{},{adapterIndex:v,isLastAdapter:A,shouldFail:!1,extraPromoRunOnFail:E}),function(){k.default(this,P)}.bind(this),qr("gd-adflow, before adInvoke",v,w,t.params.shouldFail),e.next=30,this.adInvoke(t);case 30:if(S=e.sent,R=S.success,T=S.args,!R){e.next=40;break}return console.log("gd-adflow, adapter-result-success",v,w,T),p=!0,m=!(null==T||!T.isPromoSuccess),e.abrupt("break",46);case 40:qr("gd-adflow, adapter-result-failure",v,w,T.message),v++,g.push(T.message),A&&"adsense"===w&&c&&l&&h&&(y=!0);case 44:e.next=19;break;case 46:e.next=51;break;case 48:e.prev=48,e.t0=e.catch(17),b.e(e.t0);case 51:return e.prev=51,b.f(),e.finish(51);case 54:if(!y){e.next=63;break}return qr("gd-adflow should run promo after adsense"),t.params.adapter="promo",e.next=59,this.adInvoke(t);case 59:e.sent.success&&(m=!0);case 63:(function(){k.default(this,P)}).bind(this),D=g.join(" /n"),p?(this._setAdRequestTimer(),qr("gd-adflow, END, IsPromoSuccess",m),this._onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),this._giveGift()):(this._onResumeGame(D,"warning"),this._giveGift()),qr("gd-adflow msgrt_1"),O="-1",I="none",p&&m?O="promo_ima":p?(O="index_".concat(v),I=f[v]):m&&(O="promo_adsense"),qr("gd-adflow msgrt_2"),this._msgrt.send("adflow.all.index",{message:"".concat(O)}),this._msgrt.send("adflow.all.success_adapter",{message:"".concat(I)}),this._msgrt.send("adflow.".concat(s,".index"),{message:"".concat(O)}),this._msgrt.send("adflow.".concat(s,".success_adapter"),{message:"".concat(I)});case 75:case"end":return e.stop()}}),e,this,[[17,48,51,54]])}))),function(e){return n.apply(this,arguments)})},{key:"adInvoke",value:(t=A.default(x.default.mark((function e(t){var n=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(r,a){var i,s,o,u=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i="main.showad.".concat(t.params.adapter,".").concat(t.params.adapterIndex),s=function(e){k.default(this,u),n._eventBus.unsubscribeScope(i),r({success:!1,args:e})}.bind(this),o=function(e){k.default(this,u),n._eventBus.unsubscribeScope(i),r({success:!0,args:e})}.bind(this),n._eventBus.subscribe("AD_ERROR",s,i),n._eventBus.subscribe("AD_SDK_CANCELED",s,i),n._eventBus.subscribe("AD_SUCCESS",o,i),n._adInstance.startAd(t).catch(function(e){k.default(this,u),console.log("gd-adflow startAd error",e)}.bind(this));case 7:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"_getAdFlow",value:function(e){var t,n,r,a,i,s,o,u,d=this,c=void function(){k.default(this,d)}.bind(this),l=this._gameData.adflw;c&&(qr("gd-adflow custom adflow",c),l=c);var h=null!==(t=l)&&void 0!==t&&null!==(n=t.adapters)&&void 0!==n&&n.default?null===(r=l)||void 0===r||null===(a=r.adapters)||void 0===a?void 0:a.default:["ima","adsense"];return h=null!==(i=l)&&void 0!==i&&null!==(s=i.adapters)&&void 0!==s&&s[e]?null===(o=l)||void 0===o||null===(u=o.adapters)||void 0===u?void 0:u[e]:h}}]),e}();function Zy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function eb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zy(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var tb,nb=null,rb=null,ab=function(){function e(t){var n=this;if(S.default(this,e),nb)return nb;nb=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,t),this._version=t.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new pg,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){k.default(this,n),this._sdk_ready=!0}.bind(this)).catch(function(e){k.default(this,n),this._sdk_ready=!1}.bind(this)).finally(function(){var e,t;k.default(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()&&Wy(this._gameData)}.bind(this)),this._registerSGBridge(),qr("which-frame",this._whichFrame())}var t,n,r,i,s,o,u,c,l,h,f,p;return T.default(e,[{key:"_initUnityHandler",value:function(){var e=this;window.addEventListener("DOMNodeInserted",function(){if(k.default(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:(p=A.default(x.default.mark((function e(){var t,n,r,a;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=6;break}if(r=new pg,0!==(null==(a=r.get("depth"))?void 0:a.value)||null===(t=this._gameData)||void 0===t||null===(n=t.cmp)||void 0===n||!n.enabled||"html5.gamedistribution.com"!==this._topDomain){e.next=6;break}return e.next=6,By();case 6:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"testConsent",value:function(){try{Cy();A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ly({});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;Gy.on("splash-hidden",function(t){k.default(this,e),this._hideCMPButton()}.bind(this))}},{key:"_hideCMPButton",value:function(){var e=document.getElementById("ot-sdk-btn-floating");e&&(e.style.display="none")}},{key:"_sendLoadedEvent",value:function(){if(!this._isLoaded&&(this._isLoaded=!0,"loader-frame"===this._whichFrame()))try{qr("which-frame, sending tunnel event",this._whichFrame()),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:(f=A.default(x.default.mark((function e(t,n){var r,a=this;return x.default.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===(r=this._gameData.enableAds)||void 0===r?void 0:r.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 k.default(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 f.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 n=L.default(e);this.options=t?a.extendDefaults(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=Ur.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(j.default.stringify(n))).catch(function(e){k.default(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=a.getQueryParams("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,a.dankLog("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!a.Ls.available)return;"developer.gamedistribution.com"===this._parentDomain?(a.Ls.set("gd_debug_ex",!0),a.Ls.set("gd_disable_midroll_timer",!0),a.Ls.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(a.Ls.set("gd_debug_ex",!0),a.Ls.set("gd_disable_midroll_timer",!0)),a.Ls.getBoolean("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 a.MessageRouter({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:a.getIframeDepth(),version:Ur.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:a.getMobilePlatform(),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"];a.getScript(t[0],"GamedockSDK",{alternates:t}).then(function(){var t,n;k.default(this,e),rb=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(t=this._gameData.diagnostic)&&void 0!==t&&null!==(n=t.gameDock)&&void 0!==n&&n.adViewEvent&&rb.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),Uy.track(rb,this._gameData)}.bind(this)).catch(function(t){k.default(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,n;null===(t=rb)||void 0===t||null===(n=t.tracking)||void 0===n||n.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"];a.getScript(t[0],"MinijuegosSDK",{alternates:t}).catch(function(t){k.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,t=["https://www.google-analytics.com/analytics.js"];a.getScript(t[0],"gdsdk_google_analytics",{alternates:t,error_prefix:"Blocked:",exists:function(){return k.default(this,e),window.ga}.bind(this)}).then(function(){k.default(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){k.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new a.EventBus,a.SDKEvents.forEach(function(t){var n=this;return k.default(this,e),this.eventBus.subscribe(t,function(e){return k.default(this,n),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),a.IMAEvents.forEach(function(t){var n=this;return k.default(this,e),this.eventBus.subscribe(t,function(e){return k.default(this,n),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(k.default(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 k.default(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(t){var n,r;k.default(this,e),this.msgrt.send("ad.impression"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(r=n.gameDock)&&void 0!==r&&r.adViewEvent&&Uy.track(rb,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(t){k.default(this,e),this.msgrt.send("ad.error",{message:t.message,details:t.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(t){k.default(this,e),this._sendAdRequestContext(t.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(t){k.default(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){k.default(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){k.default(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 k.default(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(Ur.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(h=A.default(x.default.mark((function e(){var t,n,r=this;return x.default.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(){k.default(this,r),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(j.default.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(){k.default(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;a.Ls.available&&a.Ls.getBoolean("gd_debug_ex")&&(a.Ls.getBoolean("gd_disable_midroll_timer")?e.midroll=0:e.midroll=this._getDefaultGameData().midroll)}},{key:"_checkSplashAndPromoScreens",value:function(){var e,t,n;this._gameData.loader&&!1===this._gameData.loader.mobile&&this._getisMobile()&&(this._gameData.loader.enabled=!1);var r,a=this._gameData,i=a.gdpr&&!0===a.gdpr.consent,s=a.loader,o=null===(e=a.promo)||void 0===e?void 0:e[null===(t=a.promo)||void 0===t||null===(n=t.template)||void 0===n?void 0:n.preroll];(a.preroll||(this.adRequestTimer=Date.now()),this.options.loader.enabled)?null!=o&&o.enabled?this._createPromoBeforeSplash(a,i):s.enabled&&!0!==(null===(r=s.splash)||void 0===r?void 0:r.skip)?this._createSplash(a,i):this.onResumeGame("Skipped splash.","success"):s.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||i?null!=o&&o.enabled?this._createPromoBeforeSplash(a,i):!1!==s.enabled&&this._createSplash(a,i):null!=o&&o.enabled&&this._createPromo(a,i))}},{key:"_initializeVideoAd",value:(l=A.default(x.default.mark((function e(){var t;return x.default.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=a.extendDefaults(this.options.advertisementSettings,t.sdk)),this.macros=new a.Macros({game:t,bridge:this._bridge}),this.adInstance=new Sy(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=Ur,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 l.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){a.dankLog("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){a.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){a.dankLog(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status,skipForward:e.skipForward})}catch(e){a.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:(c=A.default(x.default.mark((function e(){var t;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Hg();case 2:return t=e.sent,this.msgrt.setGameData(t),a.setDankLog(t.diagnostic),e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"_createSplash",value:(u=A.default(x.default.mark((function e(t,n){var r,i,s,o,u=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(t);case 2:return r=e.sent,i=new r(eb(eb({},this.options),{},{isConsentDomain:n,version:Ur.version}),t,this._parentDomain),e.next=6,Yg();case 6:s=e.sent,o=s.enabled,i.on("playClick",function(){var e=this;if(k.default(this,u),n){var t=new Date;t.setDate(t.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(t.toUTCString(),"; path=/")}this._hideCMPButton(),o?window.gdsdk.showAd(a.AdType.Interstitial,{position:"preroll"}).catch(function(t){k.default(this,e),i.hide()}.bind(this)):(function(){k.default(this,e)}.bind(this),this.showAd(a.AdType.Interstitial,{position:"preroll"}).catch(function(t){k.default(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(){k.default(this,u),i.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){k.default(this,u),i.hide()}.bind(this));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(o=A.default(x.default.mark((function e(t,n){var r,a,i,s,o=this;return x.default.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(eb(eb({},this.options),{},{isConsentDomain:n,version:Ur.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){k.default(this,o),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 o.apply(this,arguments)})},{key:"_createPromo",value:(s=A.default(x.default.mark((function e(t,n){var r,a,i,s,o=this;return x.default.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(eb(eb({},this.options),{},{isConsentDomain:n,version:Ur.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){k.default(this,o),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(a.AdType.Interstitial).catch(function(){k.default(this,e)}.bind(this))}},{key:"showAd",value:(i=A.default(x.default.mark((function e(t){var n,r=this,a=arguments;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(a,i){var s,o,u,d;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o={adType:t,params:n,adTimestamp:r.adRequestTimer},qr("gd-adflow adRequest on Start",o),e.next=5,r.sdkReady;case 5:return u=e.sent,e.next=8,r.videoAdReady;case 8:if(null!==(s=r._gameData.lp)&&void 0!==s&&s.load||r._sendLoadedEvent(),r._sendGamedockGamePlay(),r._rejectAdIfGameBlocked({gameData:u,adRequest:o}),r._rejectAdIfAdDisabled({gameData:u,adRequest:o}),r._rejectAdIfUnsupportedType({adRequest:o}),r._rejectAdIfRewardedDisabled({gameData:u,adRequest:o}),null!=n&&n.isGift||r._rejectAdIfAdRateHits({gameData:u,adRequest:o}),r.adInstance.attachAfgPosition(o),!r.adFlowRunning){e.next=18;break}return e.abrupt("return",a());case 18:return r.adFlowRunning=!0,d=new Xy(r),e.next=22,d.runAdFlow(o);case 22:r.adFlowRunning=!1,a(),r._post_message({topic:"adrequest.instream"}),e.next=32;break;case 27:e.prev=27,e.t0=e.catch(0),r.adFlowRunning=!1,r.onResumeGame(e.t0.message,"warning"),i(e.t0.message);case 32:case"end":return e.stop()}}),e,null,[[0,27]])})));return function(t,n){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"_giveGift",value:function(){var e,t,n,r,a;null!==(e=this._gameData)&&void 0!==e&&null!==(t=e.gft)&&void 0!==t&&t.enabled&&(null===(n=this._gameData)||void 0===n||null===(r=n.gft)||void 0===r||null===(a=r.durations[this._giftCount])||void 0===a?void 0:a.after)===this.adInstance.adMidrollCount&&this.decideToGiveAGift()}},{key:"_setAdRequestTimer",value:function(){this.adRequestTimer=Date.now()}},{key:"clearSession",value:function(){this.adInstance.clearSession()}},{key:"_attachAfgFallback",value:function(e){var t=e.gameData,n=e.adRequest;if(!t.afg_disabled&&!n.params.hasOwnProperty("fallback_adsense"))switch(n.params.position){case"preroll":case"start":case"next":n.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!==a.AdType.Interstitial&&t.adType!==a.AdType.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=a.AdType.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===a.AdType.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"_rejectAdIfAdRateHits",value:function(e){var t,n,r,i,s,o,u=e.gameData,d=e.adRequest,c=null;d.adType===a.AdType.Interstitial&&null!==(t=u.diagnostic)&&void 0!==t&&null!==(n=t.useMidrollIndex)&&void 0!==n&&n.enabled&&this.adInstance.noPreroll?this.adInstance.adMidrollCount>(null===(r=u.diagnostic)||void 0===r||null===(i=r.useMidrollIndex)||void 0===i?void 0:i.indexes.length)-1||(c=6e4*(null===(s=u.diagnostic)||void 0===s||null===(o=s.useMidrollIndex)||void 0===o?void 0:o.indexes[this.adInstance.adMidrollCount])):c=u.midroll;if(d.adType===a.AdType.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<c)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(r=A.default(x.default.mark((function e(t){var n=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(r,i){var s,o;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return s=e.sent,e.next=6,n.videoAdReady;case 6:if(!s.bloc_gard||!0!==s.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(s.enableAds&&!n._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(t){e.next=14;break}t=a.AdType.Rewarded,e.next=16;break;case 14:if(t===a.AdType.Interstitial||t===a.AdType.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+t);case 16:if(t!==a.AdType.Rewarded||s.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,n.adInstance.preloadAd(t);case 20:o=e.sent,r(o),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),i(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"cancelAd",value:(n=A.default(x.default.mark((function e(){var t=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(n,r){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{t.adInstance.cancel(),t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),r()}catch(e){t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),n(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"showDisplayAd",value:function(e){var t=this;return new Promise(function(){var n=A.default(x.default.mark((function n(r,a){var i;return x.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,t.sdkReady;case 3:return i=n.sent,n.next=6,t.videoAdReady;case 6:if(!i.dAds.enabled){n.next=13;break}return n.next=9,t.adInstance.loadDisplayAd(e);case 9:t._post_message({topic:"adrequest.display"}),r(),n.next=14;break;case 13:a("Display-Ads are disabled.");case 14:n.next=19;break;case 16:n.prev=16,n.t0=n.catch(0),a(n.t0.message||n.t0);case 19:case"end":return n.stop()}}),n,null,[[0,16]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){var n;this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){console.log("gd-adflow error onResumeGame",e),a.dankLog("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_START";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),this.adInstance&&this.adInstance._hideAddResume(),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||Ky({event:"GameStarted",game:this._gameData})}},{key:"onPauseGame",value:function(e,t){var n;this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){a.dankLog("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_PAUSE";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||Ky({event:"GamePaused",game:this._gameData})}},{key:"openConsole",value:function(){try{new a.ImplementationTest(this).start(),a.Ls.set("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(k.default(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 r=new ActiveXObject("WScript.Shell");null!==r&&r.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){k.default(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;k.default(this,t);var r=!!(e.innerText.toLowerCase().includes("start")||e.innerText.toLowerCase().includes("play")||e.innerText.toLowerCase().includes("continue")),a=e.getAttribute("href");e.removeAttribute("href"),r||(e.onclick=function(e){return k.default(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(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var i=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:a.getParentUrl()),s=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:a.getParentDomain()),o=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===a.getIframeDepth()?s:a.getTopDomain()),u=(e||n)&&r.loaderEnabled,d=(e||n)&&r.loaderEnabled,c=(e||n)&&r.loaderEnabled,l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:u,noLoadedEvent:d,noBlockerEvent:c,noPreroll:m,parentURL:i,parentDomain:s,topDomain:o&&o.length?o:s,noGAPageView:l,noLotamePageView:h,noGamedockSDK:f,noMinijuegosSDK:p,version:r.version,pauseGameOnStartup:g,depth:a.getIframeDepth(),domainMatched:s===o,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_whichFrame",value:function(){return(this._isMasterGameURL()||this._isExtHostedGameURL())&&!this._isTokenGameURL()?"loader-frame":"game-frame"}},{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 n=new D.default(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new D.default(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var a=new D.default(location.href,!0);if(!a.query.gd_zone_config)return;e=a.query.gd_zone_config}return JSON.parse(d.Base64.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new Ty(t).splash()}},{key:"_createPrerollPromoTemplate",value:(t=A.default(x.default.mark((function e(t){var n,r,a,i,s;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null===(n=t.promo)||void 0===n?void 0:n[null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll],s=new Ry(i),e.abrupt("return",s.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(d.Base64.encode(JSON.stringify(e)))}catch(e){}try{var n=new D.default(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(j.default.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new D.default(e,!0);return n.query=eb(eb({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return d.Base64.encode(JSON.stringify(e))}},{key:"session",value:function(){var e=this;return new Promise(function(){var t=A.default(x.default.mark((function t(n,r){var a;return x.default.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:a=e._gameData,n({ads:{display:{enabled:a.dAds.enabled},rewarded:{enabled:a.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,n){return t.apply(this,arguments)}}())}},{key:"sendGenericEvent",value:function(e){console.log("Received generic event",e,this._isMasterGameURL());try{var t,n;if("track-milestone"==e.eventName)rb.tracking.trackEvent("milestoneAchieved",{pageId:this.options.gameId,pageType:"game",isAuthorized:null===(t=e.data)||void 0===t?void 0:t.isAuthorized,milestoneDescription:null===(n=e.data)||void 0===n?void 0:n.milestoneDescription})}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 k.default(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,n=e.topic,r=e.data,a=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var i=window.top||window.parent;i&&i.postMessage({source:"gdsdk",topic:n,data:r},a)}catch(e){console.error((null==e?void 0:e.message)||e)}}},{key:"decideToGiveAGift",value:function(){var e=this;try{var t,n=null===(t=this._gameData)||void 0===t?void 0:t.gft,r=setInterval(A.default(x.default.mark((function t(){var n=this;return x.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.adInstance.requestRunning||e.adFlowRunning?console.log("Advertisement already running..."):(qr("gd-adflow WILL GIVE GIFT!!!"),e.showAd(a.AdType.Interstitial,{position:"midroll",isGift:!0}).catch(function(e){k.default(this,n)}.bind(this)),clearInterval(r),e._giftCount++);case 1:case"end":return t.stop()}}),t,this)}))),1e3*n.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}}]),e}(),ib={},sb=function(e){try{if(e.skipForward)return void qr("gd-adflow fw-skip-forward",e);if(qr("gd-adflow fw-forwarding",e),ib.source){var t={type:"gd-sdk-on-event",event:e};ib.source.postMessage(t,ib.origin)}}catch(e){console.log("gd-sdk forwardEvent err",e)}},ob=function(){sb({name:"SDK_READY",status:"success",message:"Everything is ready."}),sb({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),sb({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},ub=function(e){window.addEventListener("message",(function(t){var n=t.data,r=t.origin,a=t.source,i=n.type,s=n.method,o=n.options;if("gd-sdk-self"!==i){if("gd-sdk"===i){if(!ib.source&&"init"===s)return function(e){var t=e.source,n=e.origin;ib={source:t,origin:n}}({source:a,origin:r}),void ob();var u=e[s];u&&A.default(x.default.mark((function t(){var n,r=this;return x.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,function(){k.default(this,r),"showAd"===s&&Gr.firstAdapterModeAdsense&&"rewarded"!==o.adType&&(console.log("promo-test, set first adapter to adssense 3"),o.params=o.params?o.params:{},o.params.adapter="adsense")}.bind(this),!(n=u.apply(e,Object.values(o)))||!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 d={type:"gd-sdk",method:s,options:o};window.postMessage(d,"https://html5.gamedistribution.com")}}),!1)},db=function(e){!function(e){var t=e.onEvent;e.onEvent=function(e){sb(e),t.apply(this,arguments)}}(e);var t=new ab(e);return ub(t),t},cb=function(e){try{var t=Ng(e);e.gameId||t.send("nogameid",{message:"".concat(Nh.parentURL)})}catch(e){}},lb={create:function(){var e=A.default(x.default.mark((function e(t){var n,r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,cb(t),Gg=Ng(Vg=t),e.next=5,av();case 5:return n=e.sent,r=n?tv(t):db(t),Jg(),e.abrupt("return",r);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",db(t));case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(t){return e.apply(this,arguments)}}()};function hb(){return(hb=A.default(x.default.mark((function e(t,n){var r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ev();case 2:if(!e.sent){e.next=7;break}e.t0=window.gdsdk,e.next=10;break;case 7:return e.next=9,pb(t);case 9:e.t0=e.sent;case 10:return r=e.t0,e.abrupt("return",n(r));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var fb=!1;function pb(e){var t=this;return new Promise(function(n,r){var a=this;if(k.default(this,t),tb)return n(tb);if(fb)var i=setInterval(function(){k.default(this,a),tb&&(fb=!1,clearInterval(i),n(tb))}.bind(this),100);else fb=!0,lb.create(e).then(function(e){k.default(this,a),tb=e,e._sendSDKReady(),fb=!1,n(tb)}.bind(this))}.bind(this))}var mb,gb=(pb(mb=function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":E.default(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===E.default(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 hb.apply(this,arguments)}(mb,e)}});function vb(){var e=this;this.AdType=a.AdType,this.preloadAd=function(e){var t=this;return gb.invoke(function(n){return k.default(this,t),n.preloadAd(e)}.bind(this))},this.showAd=function(){var e=A.default(x.default.mark((function e(t,n){var r=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",gb.invoke(function(e){var i=this;if(k.default(this,r),t===a.AdType.Display)return e.showDisplayAd(n);return function(){k.default(this,i)}.bind(this),e.showAd(t,{})}.bind(this)));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),this.cancelAd=function(){var e=this;return gb.invoke(function(t){return k.default(this,e),t.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return gb.invoke(function(t){return k.default(this,e),t.openConsole()}.bind(this))},this.getSession=function(){var e=this;return gb.invoke(function(t){return k.default(this,e),t.session()}.bind(this))},this.sendEvent=function(e){var t=this;return gb.invoke(function(n){return k.default(this,t),n.sendGenericEvent(e)}.bind(this))},this.leaderboard={show:function(){k.default(this,e),Ol.showLeaderboard()}.bind(this),addScore:function(t){k.default(this,e),Ol.addScore(t)}.bind(this)}}vb.prototype=new function(){this.showBanner=function(){var e=this;return gb.invoke(function(t){return k.default(this,e),t.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new vb,window.gdApi=window.gdsdk;
|