@bygd/gd-sdk-pes 1.27.21 → 1.28.0

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
- import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/newArrowCheck";import n from"@babel/runtime/helpers/typeof";import r from"@babel/runtime/regenerator";import{parseJSON as i,extendDefaults as a,dankLog as s,getScript as o,Ls as d,AdType as c,Layers as u,getKeyByValue as l,getQueryString as h,EventBus as p,getIMASampleTags as f,getQueryParams as m,MessageRouter as v,getIframeDepth as g,getMobilePlatform as b,SDKEvents as y,IMAEvents as _,Macros as w,setDankLog as A,ImplementationTest as k,getParentUrl as E,getParentDomain as x,getTopDomain as D}from"@bygd/gd-sdk-era/dist/default";import S from"@babel/runtime/helpers/classCallCheck";import R from"@babel/runtime/helpers/defineProperty";import T from"url-parse";import I from"validator";import P from"is-valid-domain";import O from"get-value";import C from"set-value";import L from"lodash.clonedeep";import U from"@babel/runtime/helpers/createClass";import M from"can-autoplay";import{isPlainObject as j}from"is-plain-object";import B from"querystringify";import G from"lodash.merge";import{Base64 as N}from"js-base64";import{EventEmitter as q}from"events";import{v4 as F}from"uuid";var V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},K=function(e){return e&&e.Math==Math&&e},W=K("object"==typeof globalThis&&globalThis)||K("object"==typeof window&&window)||K("object"==typeof self&&self)||K("object"==typeof V&&V)||function(){return this}()||Function("return this")(),H={},z=function(e){try{return!!e()}catch(e){return!0}},$=!z((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Q=Function.prototype.call,Y=Q.bind?Q.bind(Q):function(){return Q.apply(Q,arguments)},J={},X={}.propertyIsEnumerable,Z=Object.getOwnPropertyDescriptor,ee=Z&&!X.call({1:2},1);J.f=ee?function(e){var t=Z(this,e);return!!t&&t.enumerable}:X;var te,ne,re=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},ie=Function.prototype,ae=ie.bind,se=ie.call,oe=ae&&ae.bind(se),de=ae?function(e){return e&&oe(se,e)}:function(e){return e&&function(){return se.apply(e,arguments)}},ce=de,ue=ce({}.toString),le=ce("".slice),he=function(e){return le(ue(e),8,-1)},pe=de,fe=z,me=he,ve=W.Object,ge=pe("".split),be=fe((function(){return!ve("z").propertyIsEnumerable(0)}))?function(e){return"String"==me(e)?ge(e,""):ve(e)}:ve,ye=W.TypeError,_e=function(e){if(null==e)throw ye("Can't call method on "+e);return e},we=be,Ae=_e,ke=function(e){return we(Ae(e))},Ee=function(e){return"function"==typeof e},xe=Ee,De=function(e){return"object"==typeof e?null!==e:xe(e)},Se=W,Re=Ee,Te=function(e){return Re(e)?e:void 0},Ie=function(e,t){return arguments.length<2?Te(Se[e]):Se[e]&&Se[e][t]},Pe=de({}.isPrototypeOf),Oe=Ie("navigator","userAgent")||"",Ce=W,Le=Oe,Ue=Ce.process,Me=Ce.Deno,je=Ue&&Ue.versions||Me&&Me.version,Be=je&&je.v8;Be&&(ne=(te=Be.split("."))[0]>0&&te[0]<4?1:+(te[0]+te[1])),!ne&&Le&&(!(te=Le.match(/Edge\/(\d+)/))||te[1]>=74)&&(te=Le.match(/Chrome\/(\d+)/))&&(ne=+te[1]);var Ge=ne,Ne=Ge,qe=z,Fe=!!Object.getOwnPropertySymbols&&!qe((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ne&&Ne<41})),Ve=Fe&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ke=Ie,We=Ee,He=Pe,ze=Ve,$e=W.Object,Qe=ze?function(e){return"symbol"==typeof e}:function(e){var t=Ke("Symbol");return We(t)&&He(t.prototype,$e(e))},Ye=W.String,Je=function(e){try{return Ye(e)}catch(e){return"Object"}},Xe=Ee,Ze=Je,et=W.TypeError,tt=function(e){if(Xe(e))return e;throw et(Ze(e)+" is not a function")},nt=tt,rt=function(e,t){var n=e[t];return null==n?void 0:nt(n)},it=Y,at=Ee,st=De,ot=W.TypeError,dt={exports:{}},ct=W,ut=Object.defineProperty,lt=function(e,t){try{ut(ct,e,{value:t,configurable:!0,writable:!0})}catch(n){ct[e]=t}return t},ht=lt,pt=W["__core-js_shared__"]||ht("__core-js_shared__",{}),ft=pt;(dt.exports=function(e,t){return ft[e]||(ft[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.19.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var mt=_e,vt=W.Object,gt=function(e){return vt(mt(e))},bt=gt,yt=de({}.hasOwnProperty),_t=Object.hasOwn||function(e,t){return yt(bt(e),t)},wt=de,At=0,kt=Math.random(),Et=wt(1..toString),xt=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Et(++At+kt,36)},Dt=W,St=dt.exports,Rt=_t,Tt=xt,It=Fe,Pt=Ve,Ot=St("wks"),Ct=Dt.Symbol,Lt=Ct&&Ct.for,Ut=Pt?Ct:Ct&&Ct.withoutSetter||Tt,Mt=function(e){if(!Rt(Ot,e)||!It&&"string"!=typeof Ot[e]){var t="Symbol."+e;It&&Rt(Ct,e)?Ot[e]=Ct[e]:Ot[e]=Pt&&Lt?Lt(t):Ut(t)}return Ot[e]},jt=Y,Bt=De,Gt=Qe,Nt=rt,qt=function(e,t){var n,r;if("string"===t&&at(n=e.toString)&&!st(r=it(n,e)))return r;if(at(n=e.valueOf)&&!st(r=it(n,e)))return r;if("string"!==t&&at(n=e.toString)&&!st(r=it(n,e)))return r;throw ot("Can't convert object to primitive value")},Ft=Mt,Vt=W.TypeError,Kt=Ft("toPrimitive"),Wt=function(e,t){if(!Bt(e)||Gt(e))return e;var n,r=Nt(e,Kt);if(r){if(void 0===t&&(t="default"),n=jt(r,e,t),!Bt(n)||Gt(n))return n;throw Vt("Can't convert object to primitive value")}return void 0===t&&(t="number"),qt(e,t)},Ht=Qe,zt=function(e){var t=Wt(e,"string");return Ht(t)?t:t+""},$t=De,Qt=W.document,Yt=$t(Qt)&&$t(Qt.createElement),Jt=function(e){return Yt?Qt.createElement(e):{}},Xt=Jt,Zt=!$&&!z((function(){return 7!=Object.defineProperty(Xt("div"),"a",{get:function(){return 7}}).a})),en=$,tn=Y,nn=J,rn=re,an=ke,sn=zt,on=_t,dn=Zt,cn=Object.getOwnPropertyDescriptor;H.f=en?cn:function(e,t){if(e=an(e),t=sn(t),dn)try{return cn(e,t)}catch(e){}if(on(e,t))return rn(!tn(nn.f,e,t),e[t])};var un={},ln=W,hn=De,pn=ln.String,fn=ln.TypeError,mn=function(e){if(hn(e))return e;throw fn(pn(e)+" is not an object")},vn=$,gn=Zt,bn=mn,yn=zt,_n=W.TypeError,wn=Object.defineProperty;un.f=vn?wn:function(e,t,n){if(bn(e),t=yn(t),bn(n),gn)try{return wn(e,t,n)}catch(e){}if("get"in n||"set"in n)throw _n("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var An=un,kn=re,En=$?function(e,t,n){return An.f(e,t,kn(1,n))}:function(e,t,n){return e[t]=n,e},xn={exports:{}},Dn=Ee,Sn=pt,Rn=de(Function.toString);Dn(Sn.inspectSource)||(Sn.inspectSource=function(e){return Rn(e)});var Tn,In,Pn,On=Sn.inspectSource,Cn=Ee,Ln=On,Un=W.WeakMap,Mn=Cn(Un)&&/native code/.test(Ln(Un)),jn=dt.exports,Bn=xt,Gn=jn("keys"),Nn=function(e){return Gn[e]||(Gn[e]=Bn(e))},qn={},Fn=Mn,Vn=W,Kn=de,Wn=De,Hn=En,zn=_t,$n=pt,Qn=Nn,Yn=qn,Jn=Vn.TypeError,Xn=Vn.WeakMap;if(Fn||$n.state){var Zn=$n.state||($n.state=new Xn),er=Kn(Zn.get),tr=Kn(Zn.has),nr=Kn(Zn.set);Tn=function(e,t){if(tr(Zn,e))throw new Jn("Object already initialized");return t.facade=e,nr(Zn,e,t),t},In=function(e){return er(Zn,e)||{}},Pn=function(e){return tr(Zn,e)}}else{var rr=Qn("state");Yn[rr]=!0,Tn=function(e,t){if(zn(e,rr))throw new Jn("Object already initialized");return t.facade=e,Hn(e,rr,t),t},In=function(e){return zn(e,rr)?e[rr]:{}},Pn=function(e){return zn(e,rr)}}var ir={set:Tn,get:In,has:Pn,enforce:function(e){return Pn(e)?In(e):Tn(e,{})},getterFor:function(e){return function(t){var n;if(!Wn(t)||(n=In(t)).type!==e)throw Jn("Incompatible receiver, "+e+" required");return n}}},ar=$,sr=_t,or=Function.prototype,dr=ar&&Object.getOwnPropertyDescriptor,cr=sr(or,"name"),ur={EXISTS:cr,PROPER:cr&&"something"===function(){}.name,CONFIGURABLE:cr&&(!ar||ar&&dr(or,"name").configurable)},lr=W,hr=Ee,pr=_t,fr=En,mr=lt,vr=On,gr=ur.CONFIGURABLE,br=ir.get,yr=ir.enforce,_r=String(String).split("String");(xn.exports=function(e,t,n,r){var i,a=!!r&&!!r.unsafe,s=!!r&&!!r.enumerable,o=!!r&&!!r.noTargetGet,d=r&&void 0!==r.name?r.name:t;hr(n)&&("Symbol("===String(d).slice(0,7)&&(d="["+String(d).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!pr(n,"name")||gr&&n.name!==d)&&fr(n,"name",d),(i=yr(n)).source||(i.source=_r.join("string"==typeof d?d:""))),e!==lr?(a?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=n:fr(e,t,n)):s?e[t]=n:mr(t,n)})(Function.prototype,"toString",(function(){return hr(this)&&br(this).source||vr(this)}));var wr={},Ar=Math.ceil,kr=Math.floor,Er=function(e){var t=+e;return t!=t||0===t?0:(t>0?kr:Ar)(t)},xr=Er,Dr=Math.max,Sr=Math.min,Rr=function(e,t){var n=xr(e);return n<0?Dr(n+t,0):Sr(n,t)},Tr=Er,Ir=Math.min,Pr=function(e){return e>0?Ir(Tr(e),9007199254740991):0},Or=Pr,Cr=function(e){return Or(e.length)},Lr=ke,Ur=Rr,Mr=Cr,jr=function(e){return function(t,n,r){var i,a=Lr(t),s=Mr(a),o=Ur(r,s);if(e&&n!=n){for(;s>o;)if((i=a[o++])!=i)return!0}else for(;s>o;o++)if((e||o in a)&&a[o]===n)return e||o||0;return!e&&-1}},Br={includes:jr(!0),indexOf:jr(!1)},Gr=_t,Nr=ke,qr=Br.indexOf,Fr=qn,Vr=de([].push),Kr=function(e,t){var n,r=Nr(e),i=0,a=[];for(n in r)!Gr(Fr,n)&&Gr(r,n)&&Vr(a,n);for(;t.length>i;)Gr(r,n=t[i++])&&(~qr(a,n)||Vr(a,n));return a},Wr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Hr=Kr,zr=Wr.concat("length","prototype");wr.f=Object.getOwnPropertyNames||function(e){return Hr(e,zr)};var $r={};$r.f=Object.getOwnPropertySymbols;var Qr=Ie,Yr=wr,Jr=$r,Xr=mn,Zr=de([].concat),ei=Qr("Reflect","ownKeys")||function(e){var t=Yr.f(Xr(e)),n=Jr.f;return n?Zr(t,n(e)):t},ti=_t,ni=ei,ri=H,ii=un,ai=function(e,t){for(var n=ni(t),r=ii.f,i=ri.f,a=0;a<n.length;a++){var s=n[a];ti(e,s)||r(e,s,i(t,s))}},si=z,oi=Ee,di=/#|\.prototype\./,ci=function(e,t){var n=li[ui(e)];return n==pi||n!=hi&&(oi(t)?si(t):!!t)},ui=ci.normalize=function(e){return String(e).replace(di,".").toLowerCase()},li=ci.data={},hi=ci.NATIVE="N",pi=ci.POLYFILL="P",fi=ci,mi=W,vi=H.f,gi=En,bi=xn.exports,yi=lt,_i=ai,wi=fi,Ai=function(e,t){var n,r,i,a,s,o=e.target,d=e.global,c=e.stat;if(n=d?mi:c?mi[o]||yi(o,{}):(mi[o]||{}).prototype)for(r in t){if(a=t[r],i=e.noTargetGet?(s=vi(n,r))&&s.value:n[r],!wi(d?r:o+(c?".":"#")+r,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;_i(a,i)}(e.sham||i&&i.sham)&&gi(a,"sham",!0),bi(n,r,a,e)}},ki=Kr,Ei=Wr,xi=Object.keys||function(e){return ki(e,Ei)},Di=gt,Si=xi;Ai({target:"Object",stat:!0,forced:z((function(){Si(1)}))},{keys:function(e){return Si(Di(e))}});var Ri=Function.prototype,Ti=Ri.apply,Ii=Ri.bind,Pi=Ri.call,Oi="object"==typeof Reflect&&Reflect.apply||(Ii?Pi.bind(Ti):function(){return Pi.apply(Ti,arguments)}),Ci=he,Li=Array.isArray||function(e){return"Array"==Ci(e)},Ui={};Ui[Mt("toStringTag")]="z";var Mi,ji="[object z]"===String(Ui),Bi=W,Gi=ji,Ni=Ee,qi=he,Fi=Mt("toStringTag"),Vi=Bi.Object,Ki="Arguments"==qi(function(){return arguments}()),Wi=Gi?qi: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=Vi(e),Fi))?n:Ki?qi(t):"Object"==(r=qi(t))&&Ni(t.callee)?"Arguments":r},Hi=Wi,zi=W.String,$i=function(e){if("Symbol"===Hi(e))throw TypeError("Cannot convert a Symbol value to a string");return zi(e)},Qi=un,Yi=mn,Ji=ke,Xi=xi,Zi=$?Object.defineProperties:function(e,t){Yi(e);for(var n,r=Ji(t),i=Xi(t),a=i.length,s=0;a>s;)Qi.f(e,n=i[s++],r[n]);return e},ea=Ie("document","documentElement"),ta=mn,na=Zi,ra=Wr,ia=qn,aa=ea,sa=Jt,oa=Nn("IE_PROTO"),da=function(){},ca=function(e){return"<script>"+e+"<\/script>"},ua=function(e){e.write(ca("")),e.close();var t=e.parentWindow.Object;return e=null,t},la=function(){try{Mi=new ActiveXObject("htmlfile")}catch(e){}var e,t;la="undefined"!=typeof document?document.domain&&Mi?ua(Mi):((t=sa("iframe")).style.display="none",aa.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(ca("document.F=Object")),e.close(),e.F):ua(Mi);for(var n=ra.length;n--;)delete la.prototype[ra[n]];return la()};ia[oa]=!0;var ha=Object.create||function(e,t){var n;return null!==e?(da.prototype=ta(e),n=new da,da.prototype=null,n[oa]=e):n=la(),void 0===t?n:na(n,t)},pa={},fa=de([].slice),ma=he,va=ke,ga=wr.f,ba=fa,ya="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];pa.f=function(e){return ya&&"Window"==ma(e)?function(e){try{return ga(e)}catch(e){return ba(ya)}}(e):ga(va(e))};var _a={},wa=Mt;_a.f=wa;var Aa=W,ka=_t,Ea=_a,xa=un.f,Da=function(e){var t=Aa.Symbol||(Aa.Symbol={});ka(t,e)||xa(t,e,{value:Ea.f(e)})},Sa=un.f,Ra=_t,Ta=Mt("toStringTag"),Ia=function(e,t,n){e&&!Ra(e=n?e:e.prototype,Ta)&&Sa(e,Ta,{configurable:!0,value:t})},Pa=tt,Oa=de(de.bind),Ca=function(e,t){return Pa(e),void 0===t?e:Oa?Oa(e,t):function(){return e.apply(t,arguments)}},La=de,Ua=z,Ma=Ee,ja=Wi,Ba=On,Ga=function(){},Na=[],qa=Ie("Reflect","construct"),Fa=/^\s*(?:class|function)\b/,Va=La(Fa.exec),Ka=!Fa.exec(Ga),Wa=function(e){if(!Ma(e))return!1;try{return qa(Ga,Na,e),!0}catch(e){return!1}},Ha=!qa||Ua((function(){var e;return Wa(Wa.call)||!Wa(Object)||!Wa((function(){e=!0}))||e}))?function(e){if(!Ma(e))return!1;switch(ja(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Ka||!!Va(Fa,Ba(e))}:Wa,za=W,$a=Li,Qa=Ha,Ya=De,Ja=Mt("species"),Xa=za.Array,Za=function(e){var t;return $a(e)&&(t=e.constructor,(Qa(t)&&(t===Xa||$a(t.prototype))||Ya(t)&&null===(t=t[Ja]))&&(t=void 0)),void 0===t?Xa:t},es=function(e,t){return new(Za(e))(0===t?0:t)},ts=Ca,ns=be,rs=gt,is=Cr,as=es,ss=de([].push),os=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,a=6==e,s=7==e,o=5==e||a;return function(d,c,u,l){for(var h,p,f=rs(d),m=ns(f),v=ts(c,u),g=is(m),b=0,y=l||as,_=t?y(d,g):n||s?y(d,0):void 0;g>b;b++)if((o||b in m)&&(p=v(h=m[b],b,f),e))if(t)_[b]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return b;case 2:ss(_,h)}else switch(e){case 4:return!1;case 7:ss(_,h)}return a?-1:r||i?i:_}},ds={forEach:os(0),map:os(1),filter:os(2),some:os(3),every:os(4),find:os(5),findIndex:os(6),filterReject:os(7)},cs=Ai,us=W,ls=Ie,hs=Oi,ps=Y,fs=de,ms=$,vs=Fe,gs=z,bs=_t,ys=Li,_s=Ee,ws=De,As=Pe,ks=Qe,Es=mn,xs=gt,Ds=ke,Ss=zt,Rs=$i,Ts=re,Is=ha,Ps=xi,Os=wr,Cs=pa,Ls=$r,Us=H,Ms=un,js=J,Bs=fa,Gs=xn.exports,Ns=dt.exports,qs=qn,Fs=xt,Vs=Mt,Ks=_a,Ws=Da,Hs=Ia,zs=ir,$s=ds.forEach,Qs=Nn("hidden"),Ys=Vs("toPrimitive"),Js=zs.set,Xs=zs.getterFor("Symbol"),Zs=Object.prototype,eo=us.Symbol,to=eo&&eo.prototype,no=us.TypeError,ro=us.QObject,io=ls("JSON","stringify"),ao=Us.f,so=Ms.f,oo=Cs.f,co=js.f,uo=fs([].push),lo=Ns("symbols"),ho=Ns("op-symbols"),po=Ns("string-to-symbol-registry"),fo=Ns("symbol-to-string-registry"),mo=Ns("wks"),vo=!ro||!ro.prototype||!ro.prototype.findChild,go=ms&&gs((function(){return 7!=Is(so({},"a",{get:function(){return so(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=ao(Zs,t);r&&delete Zs[t],so(e,t,n),r&&e!==Zs&&so(Zs,t,r)}:so,bo=function(e,t){var n=lo[e]=Is(to);return Js(n,{type:"Symbol",tag:e,description:t}),ms||(n.description=t),n},yo=function(e,t,n){e===Zs&&yo(ho,t,n),Es(e);var r=Ss(t);return Es(n),bs(lo,r)?(n.enumerable?(bs(e,Qs)&&e[Qs][r]&&(e[Qs][r]=!1),n=Is(n,{enumerable:Ts(0,!1)})):(bs(e,Qs)||so(e,Qs,Ts(1,{})),e[Qs][r]=!0),go(e,r,n)):so(e,r,n)},_o=function(e,t){Es(e);var n=Ds(t),r=Ps(n).concat(Eo(n));return $s(r,(function(t){ms&&!ps(wo,n,t)||yo(e,t,n[t])})),e},wo=function(e){var t=Ss(e),n=ps(co,this,t);return!(this===Zs&&bs(lo,t)&&!bs(ho,t))&&(!(n||!bs(this,t)||!bs(lo,t)||bs(this,Qs)&&this[Qs][t])||n)},Ao=function(e,t){var n=Ds(e),r=Ss(t);if(n!==Zs||!bs(lo,r)||bs(ho,r)){var i=ao(n,r);return!i||!bs(lo,r)||bs(n,Qs)&&n[Qs][r]||(i.enumerable=!0),i}},ko=function(e){var t=oo(Ds(e)),n=[];return $s(t,(function(e){bs(lo,e)||bs(qs,e)||uo(n,e)})),n},Eo=function(e){var t=e===Zs,n=oo(t?ho:Ds(e)),r=[];return $s(n,(function(e){!bs(lo,e)||t&&!bs(Zs,e)||uo(r,lo[e])})),r};(vs||(Gs(to=(eo=function(){if(As(to,this))throw no("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?Rs(arguments[0]):void 0,t=Fs(e),n=function(e){this===Zs&&ps(n,ho,e),bs(this,Qs)&&bs(this[Qs],t)&&(this[Qs][t]=!1),go(this,t,Ts(1,e))};return ms&&vo&&go(Zs,t,{configurable:!0,set:n}),bo(t,e)}).prototype,"toString",(function(){return Xs(this).tag})),Gs(eo,"withoutSetter",(function(e){return bo(Fs(e),e)})),js.f=wo,Ms.f=yo,Us.f=Ao,Os.f=Cs.f=ko,Ls.f=Eo,Ks.f=function(e){return bo(Vs(e),e)},ms&&(so(to,"description",{configurable:!0,get:function(){return Xs(this).description}}),Gs(Zs,"propertyIsEnumerable",wo,{unsafe:!0}))),cs({global:!0,wrap:!0,forced:!vs,sham:!vs},{Symbol:eo}),$s(Ps(mo),(function(e){Ws(e)})),cs({target:"Symbol",stat:!0,forced:!vs},{for:function(e){var t=Rs(e);if(bs(po,t))return po[t];var n=eo(t);return po[t]=n,fo[n]=t,n},keyFor:function(e){if(!ks(e))throw no(e+" is not a symbol");if(bs(fo,e))return fo[e]},useSetter:function(){vo=!0},useSimple:function(){vo=!1}}),cs({target:"Object",stat:!0,forced:!vs,sham:!ms},{create:function(e,t){return void 0===t?Is(e):_o(Is(e),t)},defineProperty:yo,defineProperties:_o,getOwnPropertyDescriptor:Ao}),cs({target:"Object",stat:!0,forced:!vs},{getOwnPropertyNames:ko,getOwnPropertySymbols:Eo}),cs({target:"Object",stat:!0,forced:gs((function(){Ls.f(1)}))},{getOwnPropertySymbols:function(e){return Ls.f(xs(e))}}),io)&&cs({target:"JSON",stat:!0,forced:!vs||gs((function(){var e=eo();return"[null]"!=io([e])||"{}"!=io({a:e})||"{}"!=io(Object(e))}))},{stringify:function(e,t,n){var r=Bs(arguments),i=t;if((ws(t)||void 0!==e)&&!ks(e))return ys(t)||(t=function(e,t){if(_s(i)&&(t=ps(i,this,e,t)),!ks(t))return t}),r[1]=t,hs(io,null,r)}});if(!to[Ys]){var xo=to.valueOf;Gs(to,Ys,(function(e){return ps(xo,this)}))}Hs(eo,"Symbol"),qs[Qs]=!0;var Do=z,So=Ge,Ro=Mt("species"),To=function(e){return So>=51||!Do((function(){var t=[];return(t.constructor={})[Ro]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Io=ds.filter;Ai({target:"Array",proto:!0,forced:!To("filter")},{filter:function(e){return Io(this,e,arguments.length>1?arguments[1]:void 0)}});var Po=Ai,Oo=z,Co=ke,Lo=H.f,Uo=$,Mo=Oo((function(){Lo(1)}));Po({target:"Object",stat:!0,forced:!Uo||Mo,sham:!Uo},{getOwnPropertyDescriptor:function(e,t){return Lo(Co(e),t)}});var jo={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},Bo=Jt("span").classList,Go=Bo&&Bo.constructor&&Bo.constructor.prototype,No=Go===Object.prototype?void 0:Go,qo=z,Fo=ds.forEach,Vo=function(e,t){var n=[][e];return!!n&&qo((function(){n.call(null,t||function(){throw 1},1)}))},Ko=W,Wo=jo,Ho=No,zo=Vo("forEach")?[].forEach:function(e){return Fo(this,e,arguments.length>1?arguments[1]:void 0)},$o=En,Qo=function(e){if(e&&e.forEach!==zo)try{$o(e,"forEach",zo)}catch(t){e.forEach=zo}};for(var Yo in Wo)Wo[Yo]&&Qo(Ko[Yo]&&Ko[Yo].prototype);Qo(Ho);var Jo=zt,Xo=un,Zo=re,ed=function(e,t,n){var r=Jo(t);r in e?Xo.f(e,r,Zo(0,n)):e[r]=n},td=ei,nd=ke,rd=H,id=ed;Ai({target:"Object",stat:!0,sham:!$},{getOwnPropertyDescriptors:function(e){for(var t,n,r=nd(e),i=rd.f,a=td(r),s={},o=0;a.length>o;)void 0!==(n=i(r,t=a[o++]))&&id(s,t,n);return s}});var ad=Ai,sd=W,od=Li,dd=Ha,cd=De,ud=Rr,ld=Cr,hd=ke,pd=ed,fd=Mt,md=fa,vd=To("slice"),gd=fd("species"),bd=sd.Array,yd=Math.max;ad({target:"Array",proto:!0,forced:!vd},{slice:function(e,t){var n,r,i,a=hd(this),s=ld(a),o=ud(e,s),d=ud(void 0===t?s:t,s);if(od(a)&&(n=a.constructor,(dd(n)&&(n===bd||od(n.prototype))||cd(n)&&null===(n=n[gd]))&&(n=void 0),n===bd||void 0===n))return md(a,o,d);for(r=new(void 0===n?bd:n)(yd(d-o,0)),i=0;o<d;o++,i++)o in a&&pd(r,i,a[o]);return r.length=i,r}});var _d=Y,wd=mn,Ad=rt,kd=function(e,t,n){var r,i;wd(e);try{if(!(r=Ad(e,"return"))){if("throw"===t)throw n;return n}r=_d(r,e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return wd(r),n},Ed=mn,xd=kd,Dd={},Sd=Dd,Rd=Mt("iterator"),Td=Array.prototype,Id=function(e){return void 0!==e&&(Sd.Array===e||Td[Rd]===e)},Pd=Wi,Od=rt,Cd=Dd,Ld=Mt("iterator"),Ud=function(e){if(null!=e)return Od(e,Ld)||Od(e,"@@iterator")||Cd[Pd(e)]},Md=Y,jd=tt,Bd=mn,Gd=Je,Nd=Ud,qd=W.TypeError,Fd=function(e,t){var n=arguments.length<2?Nd(e):t;if(jd(n))return Bd(Md(n,e));throw qd(Gd(e)+" is not iterable")},Vd=Ca,Kd=Y,Wd=gt,Hd=function(e,t,n,r){try{return r?t(Ed(n)[0],n[1]):t(n)}catch(t){xd(e,"throw",t)}},zd=Id,$d=Ha,Qd=Cr,Yd=ed,Jd=Fd,Xd=Ud,Zd=W.Array,ec=Mt("iterator"),tc=!1;try{var nc=0,rc={next:function(){return{done:!!nc++}},return:function(){tc=!0}};rc[ec]=function(){return this},Array.from(rc,(function(){throw 2}))}catch(e){}var ic=function(e,t){if(!t&&!tc)return!1;var n=!1;try{var r={};r[ec]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},ac=function(e){var t=Wd(e),n=$d(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=void 0!==i;a&&(i=Vd(i,r>2?arguments[2]:void 0));var s,o,d,c,u,l,h=Xd(t),p=0;if(!h||this==Zd&&zd(h))for(s=Qd(t),o=n?new this(s):Zd(s);s>p;p++)l=a?i(t[p],p):t[p],Yd(o,p,l);else for(u=(c=Jd(t,h)).next,o=n?new this:[];!(d=Kd(u,c)).done;p++)l=a?Hd(c,i,[d.value,p],!0):d.value,Yd(o,p,l);return o.length=p,o};Ai({target:"Array",stat:!0,forced:!ic((function(e){Array.from(e)}))},{from:ac});var sc,oc,dc,cc=de,uc=Er,lc=$i,hc=_e,pc=cc("".charAt),fc=cc("".charCodeAt),mc=cc("".slice),vc=function(e){return function(t,n){var r,i,a=lc(hc(t)),s=uc(n),o=a.length;return s<0||s>=o?e?"":void 0:(r=fc(a,s))<55296||r>56319||s+1===o||(i=fc(a,s+1))<56320||i>57343?e?pc(a,s):r:e?mc(a,s,s+2):i-56320+(r-55296<<10)+65536}},gc={codeAt:vc(!1),charAt:vc(!0)},bc=!z((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),yc=W,_c=_t,wc=Ee,Ac=gt,kc=bc,Ec=Nn("IE_PROTO"),xc=yc.Object,Dc=xc.prototype,Sc=kc?xc.getPrototypeOf:function(e){var t=Ac(e);if(_c(t,Ec))return t[Ec];var n=t.constructor;return wc(n)&&t instanceof n?n.prototype:t instanceof xc?Dc:null},Rc=z,Tc=Ee,Ic=Sc,Pc=xn.exports,Oc=Mt("iterator"),Cc=!1;[].keys&&("next"in(dc=[].keys())?(oc=Ic(Ic(dc)))!==Object.prototype&&(sc=oc):Cc=!0);var Lc=null==sc||Rc((function(){var e={};return sc[Oc].call(e)!==e}));Lc&&(sc={}),Tc(sc[Oc])||Pc(sc,Oc,(function(){return this}));var Uc={IteratorPrototype:sc,BUGGY_SAFARI_ITERATORS:Cc},Mc=Uc.IteratorPrototype,jc=ha,Bc=re,Gc=Ia,Nc=Dd,qc=function(){return this},Fc=function(e,t,n){var r=t+" Iterator";return e.prototype=jc(Mc,{next:Bc(1,n)}),Gc(e,r,!1),Nc[r]=qc,e},Vc=W,Kc=Ee,Wc=Vc.String,Hc=Vc.TypeError,zc=de,$c=mn,Qc=function(e){if("object"==typeof e||Kc(e))return e;throw Hc("Can't set "+Wc(e)+" as a prototype")},Yc=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=zc(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return $c(n),Qc(r),t?e(n,r):n.__proto__=r,n}}():void 0),Jc=Ai,Xc=Y,Zc=ur,eu=Ee,tu=Fc,nu=Sc,ru=Yc,iu=Ia,au=En,su=xn.exports,ou=Dd,du=Zc.PROPER,cu=Zc.CONFIGURABLE,uu=Uc.IteratorPrototype,lu=Uc.BUGGY_SAFARI_ITERATORS,hu=Mt("iterator"),pu=function(){return this},fu=function(e,t,n,r,i,a,s){tu(n,t,r);var o,d,c,u=function(e){if(e===i&&m)return m;if(!lu&&e in p)return p[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,p=e.prototype,f=p[hu]||p["@@iterator"]||i&&p[i],m=!lu&&f||u(i),v="Array"==t&&p.entries||f;if(v&&(o=nu(v.call(new e)))!==Object.prototype&&o.next&&(nu(o)!==uu&&(ru?ru(o,uu):eu(o[hu])||su(o,hu,pu)),iu(o,l,!0)),du&&"values"==i&&f&&"values"!==f.name&&(cu?au(p,"name","values"):(h=!0,m=function(){return Xc(f,this)})),i)if(d={values:u("values"),keys:a?m:u("keys"),entries:u("entries")},s)for(c in d)(lu||h||!(c in p))&&su(p,c,d[c]);else Jc({target:t,proto:!0,forced:lu||h},d);return p[hu]!==m&&su(p,hu,m,{name:i}),ou[t]=m,d},mu=gc.charAt,vu=$i,gu=ir,bu=fu,yu=gu.set,_u=gu.getterFor("String Iterator");bu(String,"String",(function(e){yu(this,{type:"String Iterator",string:vu(e),index:0})}),(function(){var e,t=_u(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=mu(n,r),t.index+=e.length,{value:e,done:!1})}));var wu=mn,Au=function(){var e=wu(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},ku={},Eu=z,xu=W.RegExp;ku.UNSUPPORTED_Y=Eu((function(){var e=xu("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),ku.BROKEN_CARET=Eu((function(){var e=xu("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var Du=z,Su=W.RegExp,Ru=Du((function(){var e=Su(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Tu=z,Iu=W.RegExp,Pu=Tu((function(){var e=Iu("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Ou=Y,Cu=de,Lu=$i,Uu=Au,Mu=ku,ju=dt.exports,Bu=ha,Gu=ir.get,Nu=Ru,qu=Pu,Fu=ju("native-string-replace",String.prototype.replace),Vu=RegExp.prototype.exec,Ku=Vu,Wu=Cu("".charAt),Hu=Cu("".indexOf),zu=Cu("".replace),$u=Cu("".slice),Qu=function(){var e=/a/,t=/b*/g;return Ou(Vu,e,"a"),Ou(Vu,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Yu=Mu.UNSUPPORTED_Y||Mu.BROKEN_CARET,Ju=void 0!==/()??/.exec("")[1];(Qu||Ju||Yu||Nu||qu)&&(Ku=function(e){var t,n,r,i,a,s,o,d=this,c=Gu(d),u=Lu(e),l=c.raw;if(l)return l.lastIndex=d.lastIndex,t=Ou(Ku,l,u),d.lastIndex=l.lastIndex,t;var h=c.groups,p=Yu&&d.sticky,f=Ou(Uu,d),m=d.source,v=0,g=u;if(p&&(f=zu(f,"y",""),-1===Hu(f,"g")&&(f+="g"),g=$u(u,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==Wu(u,d.lastIndex-1))&&(m="(?: "+m+")",g=" "+g,v++),n=new RegExp("^(?:"+m+")",f)),Ju&&(n=new RegExp("^"+m+"$(?!\\s)",f)),Qu&&(r=d.lastIndex),i=Ou(Vu,p?n:d,g),p?i?(i.input=$u(i.input,v),i[0]=$u(i[0],v),i.index=d.lastIndex,d.lastIndex+=i[0].length):d.lastIndex=0:Qu&&i&&(d.lastIndex=d.global?i.index+i[0].length:r),Ju&&i&&i.length>1&&Ou(Fu,i[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&h)for(i.groups=s=Bu(null),a=0;a<h.length;a++)s[(o=h[a])[0]]=i[o[1]];return i});var Xu=Ku;Ai({target:"RegExp",proto:!0,forced:/./.exec!==Xu},{exec:Xu});var Zu=Ai,el=$,tl=W,nl=de,rl=_t,il=Ee,al=Pe,sl=$i,ol=un.f,dl=ai,cl=tl.Symbol,ul=cl&&cl.prototype;if(el&&il(cl)&&(!("description"in ul)||void 0!==cl().description)){var ll={},hl=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:sl(arguments[0]),t=al(ul,this)?new cl(e):void 0===e?cl():cl(e);return""===e&&(ll[t]=!0),t};dl(hl,cl),hl.prototype=ul,ul.constructor=hl;var pl="Symbol(test)"==String(cl("test")),fl=nl(ul.toString),ml=nl(ul.valueOf),vl=/^Symbol\((.*)\)[^)]+$/,gl=nl("".replace),bl=nl("".slice);ol(ul,"description",{configurable:!0,get:function(){var e=ml(this),t=fl(e);if(rl(ll,e))return"";var n=pl?bl(t,7,-1):gl(t,vl,"$1");return""===n?void 0:n}}),Zu({global:!0,forced:!0},{Symbol:hl})}Da("iterator");var yl=ha,_l=un,wl=Mt("unscopables"),Al=Array.prototype;null==Al[wl]&&_l.f(Al,wl,{configurable:!0,value:yl(null)});var kl=function(e){Al[wl][e]=!0},El=ke,xl=kl,Dl=Dd,Sl=ir,Rl=fu,Tl=Sl.set,Il=Sl.getterFor("Array Iterator"),Pl=Rl(Array,"Array",(function(e,t){Tl(this,{type:"Array Iterator",target:El(e),index:0,kind:t})}),(function(){var e=Il(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");Dl.Arguments=Dl.Array,xl("keys"),xl("values"),xl("entries");var Ol=W,Cl=jo,Ll=No,Ul=Pl,Ml=En,jl=Mt,Bl=jl("iterator"),Gl=jl("toStringTag"),Nl=Ul.values,ql=function(e,t){if(e){if(e[Bl]!==Nl)try{Ml(e,Bl,Nl)}catch(t){e[Bl]=Nl}if(e[Gl]||Ml(e,Gl,t),Cl[t])for(var n in Ul)if(e[n]!==Ul[n])try{Ml(e,n,Ul[n])}catch(t){e[n]=Ul[n]}}};for(var Fl in Cl)ql(Ol[Fl]&&Ol[Fl].prototype,Fl);ql(Ll,"DOMTokenList");var Vl=Wi,Kl=ji?{}.toString:function(){return"[object "+Vl(this)+"]"},Wl=ji,Hl=xn.exports,zl=Kl;Wl||Hl(Object.prototype,"toString",zl,{unsafe:!0});var $l,Ql,Yl,Jl,Xl=W.Promise,Zl=xn.exports,eh=function(e,t,n){for(var r in t)Zl(e,r,t[r],n);return e},th=Ie,nh=un,rh=$,ih=Mt("species"),ah=function(e){var t=th(e),n=nh.f;rh&&t&&!t[ih]&&n(t,ih,{configurable:!0,get:function(){return this}})},sh=Pe,oh=W.TypeError,dh=function(e,t){if(sh(t,e))return e;throw oh("Incorrect invocation")},ch=Ca,uh=Y,lh=mn,hh=Je,ph=Id,fh=Cr,mh=Pe,vh=Fd,gh=Ud,bh=kd,yh=W.TypeError,_h=function(e,t){this.stopped=e,this.result=t},wh=_h.prototype,Ah=Ha,kh=Je,Eh=W.TypeError,xh=mn,Dh=function(e){if(Ah(e))return e;throw Eh(kh(e)+" is not a constructor")},Sh=Mt("species"),Rh=function(e,t){var n,r=xh(e).constructor;return void 0===r||null==(n=xh(r)[Sh])?t:Dh(n)},Th=/(?:ipad|iphone|ipod).*applewebkit/i.test(Oe),Ih="process"==he(W.process),Ph=W,Oh=Oi,Ch=Ca,Lh=Ee,Uh=_t,Mh=z,jh=ea,Bh=fa,Gh=Jt,Nh=Th,qh=Ih,Fh=Ph.setImmediate,Vh=Ph.clearImmediate,Kh=Ph.process,Wh=Ph.Dispatch,Hh=Ph.Function,zh=Ph.MessageChannel,$h=Ph.String,Qh=0,Yh={};try{$l=Ph.location}catch(e){}var Jh=function(e){if(Uh(Yh,e)){var t=Yh[e];delete Yh[e],t()}},Xh=function(e){return function(){Jh(e)}},Zh=function(e){Jh(e.data)},ep=function(e){Ph.postMessage($h(e),$l.protocol+"//"+$l.host)};Fh&&Vh||(Fh=function(e){var t=Bh(arguments,1);return Yh[++Qh]=function(){Oh(Lh(e)?e:Hh(e),void 0,t)},Ql(Qh),Qh},Vh=function(e){delete Yh[e]},qh?Ql=function(e){Kh.nextTick(Xh(e))}:Wh&&Wh.now?Ql=function(e){Wh.now(Xh(e))}:zh&&!Nh?(Jl=(Yl=new zh).port2,Yl.port1.onmessage=Zh,Ql=Ch(Jl.postMessage,Jl)):Ph.addEventListener&&Lh(Ph.postMessage)&&!Ph.importScripts&&$l&&"file:"!==$l.protocol&&!Mh(ep)?(Ql=ep,Ph.addEventListener("message",Zh,!1)):Ql="onreadystatechange"in Gh("script")?function(e){jh.appendChild(Gh("script")).onreadystatechange=function(){jh.removeChild(this),Jh(e)}}:function(e){setTimeout(Xh(e),0)});var tp,np,rp,ip,ap,sp,op,dp,cp={set:Fh,clear:Vh},up=W,lp=/ipad|iphone|ipod/i.test(Oe)&&void 0!==up.Pebble,hp=/web0s(?!.*chrome)/i.test(Oe),pp=W,fp=Ca,mp=H.f,vp=cp.set,gp=Th,bp=lp,yp=hp,_p=Ih,wp=pp.MutationObserver||pp.WebKitMutationObserver,Ap=pp.document,kp=pp.process,Ep=pp.Promise,xp=mp(pp,"queueMicrotask"),Dp=xp&&xp.value;Dp||(tp=function(){var e,t;for(_p&&(e=kp.domain)&&e.exit();np;){t=np.fn,np=np.next;try{t()}catch(e){throw np?ip():rp=void 0,e}}rp=void 0,e&&e.enter()},gp||_p||yp||!wp||!Ap?!bp&&Ep&&Ep.resolve?((op=Ep.resolve(void 0)).constructor=Ep,dp=fp(op.then,op),ip=function(){dp(tp)}):_p?ip=function(){kp.nextTick(tp)}:(vp=fp(vp,pp),ip=function(){vp(tp)}):(ap=!0,sp=Ap.createTextNode(""),new wp(tp).observe(sp,{characterData:!0}),ip=function(){sp.data=ap=!ap}));var Sp=Dp||function(e){var t={fn:e,next:void 0};rp&&(rp.next=t),np||(np=t,ip()),rp=t},Rp={},Tp=tt,Ip=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=Tp(t),this.reject=Tp(n)};Rp.f=function(e){return new Ip(e)};var Pp,Op,Cp,Lp,Up=mn,Mp=De,jp=Rp,Bp=function(e,t){if(Up(e),Mp(t)&&t.constructor===e)return t;var n=jp.f(e);return(0,n.resolve)(t),n.promise},Gp=W,Np="object"==typeof window,qp=Ai,Fp=W,Vp=Ie,Kp=Y,Wp=Xl,Hp=xn.exports,zp=eh,$p=Yc,Qp=Ia,Yp=ah,Jp=tt,Xp=Ee,Zp=De,ef=dh,tf=On,nf=function(e,t,n){var r,i,a,s,o,d,c,u=n&&n.that,l=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),f=ch(t,u),m=function(e){return r&&bh(r,"normal",e),new _h(!0,e)},v=function(e){return l?(lh(e),p?f(e[0],e[1],m):f(e[0],e[1])):p?f(e,m):f(e)};if(h)r=e;else{if(!(i=gh(e)))throw yh(hh(e)+" is not iterable");if(ph(i)){for(a=0,s=fh(e);s>a;a++)if((o=v(e[a]))&&mh(wh,o))return o;return new _h(!1)}r=vh(e,i)}for(d=r.next;!(c=uh(d,r)).done;){try{o=v(c.value)}catch(e){bh(r,"throw",e)}if("object"==typeof o&&o&&mh(wh,o))return o}return new _h(!1)},rf=ic,af=Rh,sf=cp.set,of=Sp,df=Bp,cf=function(e,t){var n=Gp.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))},uf=Rp,lf=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},hf=ir,pf=fi,ff=Np,mf=Ih,vf=Ge,gf=Mt("species"),bf=hf.get,yf=hf.set,_f=hf.getterFor("Promise"),wf=Wp&&Wp.prototype,Af=Wp,kf=wf,Ef=Fp.TypeError,xf=Fp.document,Df=Fp.process,Sf=uf.f,Rf=Sf,Tf=!!(xf&&xf.createEvent&&Fp.dispatchEvent),If=Xp(Fp.PromiseRejectionEvent),Pf=!1,Of=pf("Promise",(function(){var e=tf(Af),t=e!==String(Af);if(!t&&66===vf)return!0;if(vf>=51&&/native code/.test(e))return!1;var n=new Af((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[gf]=r,!(Pf=n.then((function(){}))instanceof r)||!t&&ff&&!If})),Cf=Of||!rf((function(e){Af.all(e).catch((function(){}))})),Lf=function(e){var t;return!(!Zp(e)||!Xp(t=e.then))&&t},Uf=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;of((function(){for(var r=e.value,i=1==e.state,a=0;n.length>a;){var s,o,d,c=n[a++],u=i?c.ok:c.fail,l=c.resolve,h=c.reject,p=c.domain;try{u?(i||(2===e.rejection&&Gf(e),e.rejection=1),!0===u?s=r:(p&&p.enter(),s=u(r),p&&(p.exit(),d=!0)),s===c.promise?h(Ef("Promise-chain cycle")):(o=Lf(s))?Kp(o,s,l,h):l(s)):h(r)}catch(e){p&&!d&&p.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&jf(e)}))}},Mf=function(e,t,n){var r,i;Tf?((r=xf.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Fp.dispatchEvent(r)):r={promise:t,reason:n},!If&&(i=Fp["on"+e])?i(r):"unhandledrejection"===e&&cf("Unhandled promise rejection",n)},jf=function(e){Kp(sf,Fp,(function(){var t,n=e.facade,r=e.value;if(Bf(e)&&(t=lf((function(){mf?Df.emit("unhandledRejection",r,n):Mf("unhandledrejection",n,r)})),e.rejection=mf||Bf(e)?2:1,t.error))throw t.value}))},Bf=function(e){return 1!==e.rejection&&!e.parent},Gf=function(e){Kp(sf,Fp,(function(){var t=e.facade;mf?Df.emit("rejectionHandled",t):Mf("rejectionhandled",t,e.value)}))},Nf=function(e,t,n){return function(r){e(t,r,n)}},qf=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Uf(e,!0))},Ff=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Ef("Promise can't be resolved itself");var r=Lf(t);r?of((function(){var n={done:!1};try{Kp(r,t,Nf(Ff,n,e),Nf(qf,n,e))}catch(t){qf(n,t,e)}})):(e.value=t,e.state=1,Uf(e,!1))}catch(t){qf({done:!1},t,e)}}};if(Of&&(kf=(Af=function(e){ef(this,kf),Jp(e),Kp(Pp,this);var t=bf(this);try{e(Nf(Ff,t),Nf(qf,t))}catch(e){qf(t,e)}}).prototype,(Pp=function(e){yf(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=zp(kf,{then:function(e,t){var n=_f(this),r=n.reactions,i=Sf(af(this,Af));return i.ok=!Xp(e)||e,i.fail=Xp(t)&&t,i.domain=mf?Df.domain:void 0,n.parent=!0,r[r.length]=i,0!=n.state&&Uf(n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),Op=function(){var e=new Pp,t=bf(e);this.promise=e,this.resolve=Nf(Ff,t),this.reject=Nf(qf,t)},uf.f=Sf=function(e){return e===Af||e===Cp?new Op(e):Rf(e)},Xp(Wp)&&wf!==Object.prototype)){Lp=wf.then,Pf||(Hp(wf,"then",(function(e,t){var n=this;return new Af((function(e,t){Kp(Lp,n,e,t)})).then(e,t)}),{unsafe:!0}),Hp(wf,"catch",kf.catch,{unsafe:!0}));try{delete wf.constructor}catch(e){}$p&&$p(wf,kf)}qp({global:!0,wrap:!0,forced:Of},{Promise:Af}),Qp(Af,"Promise",!1),Yp("Promise"),Cp=Vp("Promise"),qp({target:"Promise",stat:!0,forced:Of},{reject:function(e){var t=Sf(this);return Kp(t.reject,void 0,e),t.promise}}),qp({target:"Promise",stat:!0,forced:Of},{resolve:function(e){return df(this,e)}}),qp({target:"Promise",stat:!0,forced:Cf},{all:function(e){var t=this,n=Sf(t),r=n.resolve,i=n.reject,a=lf((function(){var n=Jp(t.resolve),a=[],s=0,o=1;nf(e,(function(e){var d=s++,c=!1;o++,Kp(n,t,e).then((function(e){c||(c=!0,a[d]=e,--o||r(a))}),i)})),--o||r(a)}));return a.error&&i(a.value),n.promise},race:function(e){var t=this,n=Sf(t),r=n.reject,i=lf((function(){var i=Jp(t.resolve);nf(e,(function(e){Kp(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Vf=Ai,Kf=W,Wf=z,Hf=Li,zf=De,$f=gt,Qf=Cr,Yf=ed,Jf=es,Xf=To,Zf=Ge,em=Mt("isConcatSpreadable"),tm=Kf.TypeError,nm=Zf>=51||!Wf((function(){var e=[];return e[em]=!1,e.concat()[0]!==e})),rm=Xf("concat"),im=function(e){if(!zf(e))return!1;var t=e[em];return void 0!==t?!!t:Hf(e)};Vf({target:"Array",proto:!0,forced:!nm||!rm},{concat:function(e){var t,n,r,i,a,s=$f(this),o=Jf(s,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(im(a=-1===t?s:arguments[t])){if(d+(i=Qf(a))>9007199254740991)throw tm("Maximum allowed index exceeded");for(n=0;n<i;n++,d++)n in a&&Yf(o,d,a[n])}else{if(d>=9007199254740991)throw tm("Maximum allowed index exceeded");Yf(o,d++,a)}return o.length=d,o}});var am=$,sm=ur.EXISTS,om=de,dm=un.f,cm=Function.prototype,um=om(cm.toString),lm=/^\s*function ([^ (]*)/,hm=om(lm.exec);function pm(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 fm(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 fm(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,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,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function fm(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 mm(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 vm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mm(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}am&&!sm&&dm(cm,"name",{configurable:!0,get:function(){try{return hm(lm,um(this))[1]}catch(e){return""}}});var gm={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"}},bm={},ym=function(e,t){bm[e]=vm(vm({},t),{},{isLoading:!1})},_m=function(e){var n=this,r=e.id,i=e.src;return new Promise(function(e,a){if(t(this,n),document.getElementById(r))e();else{var s=document.createElement("script");s.onload=function(){e()},s.id=r,s.setAttribute("crossorigin",!0),s.src=i,document.head.appendChild(s)}}.bind(this))},wm=function(){var t=e(r.mark((function e(t){var n,i,a,s,o,d,c,u;return r.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(!(i=bm[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:i.isLoading=!0,a=pm(i.dependencies),e.prev=8,a.s();case 10:if((s=a.n()).done){e.next=26;break}if(o=s.value,e.prev=12,d=gm[o].name,!window[d]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,_m({id:o,src:gm[o].src});case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),c=o.id,u=o.src,console.log("Could not load external script ".concat(c," ").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,_m({id:t,src:i.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(i.source,"."),e.t2);case 43:return i.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(e){return t.apply(this,arguments)}}(),Am=new function t(){var n=this;S(this,t),R(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wm("Leaderboard");case 2:n.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),R(this,"showLeaderboard",function(){var t=e(r.mark((function e(t){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=window.GD_OPTIONS.gameId,n.leaderboard){e.next=4;break}return e.next=4,n.load();case 4:n.leaderboard.showLeaderBoard(i,t);case 5:case"end":return e.stop()}}),e)})));return function(e){return t.apply(this,arguments)}}()),R(this,"addScore",function(){var t=e(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.leaderboard){e.next=3;break}return e.next=3,n.load();case 3:n.leaderboard.addScore(t);case 4:case"end":return e.stop()}}),e)})));return function(e){return t.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"]},ym(this.moduleName,this.moduleConfig)},km=de,Em=xn.exports,xm=Xu,Dm=z,Sm=Mt,Rm=En,Tm=Sm("species"),Im=RegExp.prototype,Pm=function(e,t,n,r){var i=Sm(e),a=!Dm((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),s=a&&!Dm((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Tm]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!a||!s||n){var o=km(/./[i]),d=t(i,""[e],(function(e,t,n,r,i){var s=km(e),d=t.exec;return d===xm||d===Im.exec?a&&!i?{done:!0,value:o(t,n,r)}:{done:!0,value:s(n,t,r)}:{done:!1}}));Em(String.prototype,e,d[0]),Em(Im,i,d[1])}r&&Rm(Im[i],"sham",!0)},Om=gc.charAt,Cm=function(e,t,n){return t+(n?Om(e,t).length:1)},Lm=de,Um=gt,Mm=Math.floor,jm=Lm("".charAt),Bm=Lm("".replace),Gm=Lm("".slice),Nm=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,qm=/\$([$&'`]|\d{1,2})/g,Fm=Y,Vm=mn,Km=Ee,Wm=he,Hm=Xu,zm=W.TypeError,$m=function(e,t){var n=e.exec;if(Km(n)){var r=Fm(n,e,t);return null!==r&&Vm(r),r}if("RegExp"===Wm(e))return Fm(Hm,e,t);throw zm("RegExp#exec called on incompatible receiver")},Qm=Oi,Ym=Y,Jm=de,Xm=Pm,Zm=z,ev=mn,tv=Ee,nv=Er,rv=Pr,iv=$i,av=_e,sv=Cm,ov=rt,dv=function(e,t,n,r,i,a){var s=n+e.length,o=r.length,d=qm;return void 0!==i&&(i=Um(i),d=Nm),Bm(a,d,(function(a,d){var c;switch(jm(d,0)){case"$":return"$";case"&":return e;case"`":return Gm(t,0,n);case"'":return Gm(t,s);case"<":c=i[Gm(d,1,-1)];break;default:var u=+d;if(0===u)return a;if(u>o){var l=Mm(u/10);return 0===l?a:l<=o?void 0===r[l-1]?jm(d,1):r[l-1]+jm(d,1):a}c=r[u-1]}return void 0===c?"":c}))},cv=$m,uv=Mt("replace"),lv=Math.max,hv=Math.min,pv=Jm([].concat),fv=Jm([].push),mv=Jm("".indexOf),vv=Jm("".slice),gv="$0"==="a".replace(/./,"$0"),bv=!!/./[uv]&&""===/./[uv]("a","$0");Xm("replace",(function(e,t,n){var r=bv?"$":"$0";return[function(e,n){var r=av(this),i=null==e?void 0:ov(e,uv);return i?Ym(i,e,r,n):Ym(t,iv(r),e,n)},function(e,i){var a=ev(this),s=iv(e);if("string"==typeof i&&-1===mv(i,r)&&-1===mv(i,"$<")){var o=n(t,a,s,i);if(o.done)return o.value}var d=tv(i);d||(i=iv(i));var c=a.global;if(c){var u=a.unicode;a.lastIndex=0}for(var l=[];;){var h=cv(a,s);if(null===h)break;if(fv(l,h),!c)break;""===iv(h[0])&&(a.lastIndex=sv(s,rv(a.lastIndex),u))}for(var p,f="",m=0,v=0;v<l.length;v++){for(var g=iv((h=l[v])[0]),b=lv(hv(nv(h.index),s.length),0),y=[],_=1;_<h.length;_++)fv(y,void 0===(p=h[_])?p:String(p));var w=h.groups;if(d){var A=pv([g],y,b,s);void 0!==w&&fv(A,w);var k=iv(Qm(i,void 0,A))}else k=dv(g,s,b,y,w,i);b>=m&&(f+=vv(s,m,b)+k,m=b+g.length)}return f+vv(s,m)}]}),!!Zm((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!gv||bv);var yv=z,_v=Mt("iterator"),wv=!yv((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=fa,kv=Math.floor,Ev=function(e,t){var n=e.length,r=kv(n/2);return n<8?xv(e,t):Dv(e,Ev(Av(e,0,r),t),Ev(Av(e,r),t),t)},xv=function(e,t){for(var n,r,i=e.length,a=1;a<i;){for(r=a,n=e[a];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==a++&&(e[r]=n)}return e},Dv=function(e,t,n,r){for(var i=t.length,a=n.length,s=0,o=0;s<i||o<a;)e[s+o]=s<i&&o<a?r(t[s],n[o])<=0?t[s++]:n[o++]:s<i?t[s++]:n[o++];return e},Sv=Ev,Rv=Ai,Tv=W,Iv=Ie,Pv=Y,Ov=de,Cv=wv,Lv=xn.exports,Uv=eh,Mv=Ia,jv=Fc,Bv=ir,Gv=dh,Nv=Ee,qv=_t,Fv=Ca,Vv=Wi,Kv=mn,Wv=De,Hv=$i,zv=ha,$v=re,Qv=Fd,Yv=Ud,Jv=Sv,Xv=Mt("iterator"),Zv=Bv.set,eg=Bv.getterFor("URLSearchParams"),tg=Bv.getterFor("URLSearchParamsIterator"),ng=Iv("fetch"),rg=Iv("Request"),ig=Iv("Headers"),ag=rg&&rg.prototype,sg=ig&&ig.prototype,og=Tv.RegExp,dg=Tv.TypeError,cg=Tv.decodeURIComponent,ug=Tv.encodeURIComponent,lg=Ov("".charAt),hg=Ov([].join),pg=Ov([].push),fg=Ov("".replace),mg=Ov([].shift),vg=Ov([].splice),gg=Ov("".split),bg=Ov("".slice),yg=/\+/g,_g=Array(4),wg=function(e){return _g[e-1]||(_g[e-1]=og("((?:%[\\da-f]{2}){"+e+"})","gi"))},Ag=function(e){try{return cg(e)}catch(t){return e}},kg=function(e){var t=fg(e,yg," "),n=4;try{return cg(t)}catch(e){for(;n;)t=fg(t,wg(n--),Ag);return t}},Eg=/[!'()~]|%20/g,xg={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Dg=function(e){return xg[e]},Sg=function(e){return fg(ug(e),Eg,Dg)},Rg=function(e,t){if(t)for(var n,r,i=gg(t,"&"),a=0;a<i.length;)(n=i[a++]).length&&(r=gg(n,"="),pg(e,{key:kg(mg(r)),value:kg(hg(r,"="))}))},Tg=function(e){this.entries.length=0,Rg(this.entries,e)},Ig=function(e,t){if(e<t)throw dg("Not enough arguments")},Pg=jv((function(e,t){Zv(this,{type:"URLSearchParamsIterator",iterator:Qv(eg(e).entries),kind:t})}),"Iterator",(function(){var e=tg(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})),Og=function(){Gv(this,Cg);var e,t,n,r,i,a,s,o,d,c=arguments.length>0?arguments[0]:void 0,u=this,l=[];if(Zv(u,{type:"URLSearchParams",entries:l,updateURL:function(){},updateSearchParams:Tg}),void 0!==c)if(Wv(c))if(e=Yv(c))for(n=(t=Qv(c,e)).next;!(r=Pv(n,t)).done;){if(a=(i=Qv(Kv(r.value))).next,(s=Pv(a,i)).done||(o=Pv(a,i)).done||!Pv(a,i).done)throw dg("Expected sequence with length 2");pg(l,{key:Hv(s.value),value:Hv(o.value)})}else for(d in c)qv(c,d)&&pg(l,{key:d,value:Hv(c[d])});else Rg(l,"string"==typeof c?"?"===lg(c,0)?bg(c,1):c:Hv(c))},Cg=Og.prototype;if(Uv(Cg,{append:function(e,t){Ig(arguments.length,2);var n=eg(this);pg(n.entries,{key:Hv(e),value:Hv(t)}),n.updateURL()},delete:function(e){Ig(arguments.length,1);for(var t=eg(this),n=t.entries,r=Hv(e),i=0;i<n.length;)n[i].key===r?vg(n,i,1):i++;t.updateURL()},get:function(e){Ig(arguments.length,1);for(var t=eg(this).entries,n=Hv(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){Ig(arguments.length,1);for(var t=eg(this).entries,n=Hv(e),r=[],i=0;i<t.length;i++)t[i].key===n&&pg(r,t[i].value);return r},has:function(e){Ig(arguments.length,1);for(var t=eg(this).entries,n=Hv(e),r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){Ig(arguments.length,1);for(var n,r=eg(this),i=r.entries,a=!1,s=Hv(e),o=Hv(t),d=0;d<i.length;d++)(n=i[d]).key===s&&(a?vg(i,d--,1):(a=!0,n.value=o));a||pg(i,{key:s,value:o}),r.updateURL()},sort:function(){var e=eg(this);Jv(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=eg(this).entries,r=Fv(e,arguments.length>1?arguments[1]:void 0),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new Pg(this,"keys")},values:function(){return new Pg(this,"values")},entries:function(){return new Pg(this,"entries")}},{enumerable:!0}),Lv(Cg,Xv,Cg.entries,{name:"entries"}),Lv(Cg,"toString",(function(){for(var e,t=eg(this).entries,n=[],r=0;r<t.length;)e=t[r++],pg(n,Sg(e.key)+"="+Sg(e.value));return hg(n,"&")}),{enumerable:!0}),Mv(Og,"URLSearchParams"),Rv({global:!0,forced:!Cv},{URLSearchParams:Og}),!Cv&&Nv(ig)){var Lg=Ov(sg.has),Ug=Ov(sg.set),Mg=function(e){if(Wv(e)){var t,n=e.body;if("URLSearchParams"===Vv(n))return t=e.headers?new ig(e.headers):new ig,Lg(t,"content-type")||Ug(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),zv(e,{body:$v(0,Hv(n)),headers:$v(0,t)})}return e};if(Nv(ng)&&Rv({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return ng(e,arguments.length>1?Mg(arguments[1]):{})}}),Nv(rg)){var jg=function(e){return Gv(this,ag),new rg(e,arguments.length>1?Mg(arguments[1]):{})};ag.constructor=jg,jg.prototype=ag,Rv({global:!0,forced:!0},{Request:jg})}}var Bg=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},Gg=Y,Ng=mn,qg=_e,Fg=Bg,Vg=$i,Kg=rt,Wg=$m;Pm("search",(function(e,t,n){return[function(t){var n=qg(this),r=null==t?void 0:Kg(t,e);return r?Gg(r,t,n):new RegExp(t)[e](Vg(n))},function(e){var r=Ng(this),i=Vg(e),a=n(t,r,i);if(a.done)return a.value;var s=r.lastIndex;Fg(s,0)||(r.lastIndex=0);var o=Wg(r,i);return Fg(r.lastIndex,s)||(r.lastIndex=s),null===o?-1:o.index}]}));var Hg=Br.includes,zg=kl;Ai({target:"Array",proto:!0},{includes:function(e){return Hg(this,e,arguments.length>1?arguments[1]:void 0)}}),zg("includes");var $g=De,Qg=he,Yg=Mt("match"),Jg=function(e){var t;return $g(e)&&(void 0!==(t=e[Yg])?!!t:"RegExp"==Qg(e))},Xg=Jg,Zg=W.TypeError,eb=function(e){if(Xg(e))throw Zg("The method doesn't accept regular expressions");return e},tb=Mt("match"),nb=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[tb]=!1,"/./"[e](t)}catch(e){}}return!1},rb=Ai,ib=eb,ab=_e,sb=$i,ob=nb,db=de("".indexOf);rb({target:"String",proto:!0,forced:!ob("includes")},{includes:function(e){return!!~db(sb(ab(this)),sb(ib(e)),arguments.length>1?arguments[1]:void 0)}});var cb=Oi,ub=Y,lb=de,hb=Pm,pb=Jg,fb=mn,mb=_e,vb=Rh,gb=Cm,bb=Pr,yb=$i,_b=rt,wb=fa,Ab=$m,kb=Xu,Eb=z,xb=ku.UNSUPPORTED_Y,Db=Math.min,Sb=[].push,Rb=lb(/./.exec),Tb=lb(Sb),Ib=lb("".slice);function Pb(e){var n=this,r={},i=(null==e?void 0:e._ancestor_origins)||window.location.ancestorOrigins,a=(null==e?void 0:e.self_url)||window.location.href,s=(null==e?void 0:e.self_origin)||window.location.origin,o=(null==e?void 0:e.referrer_url)||document.referrer;function d(e){return O(r,e)}function c(e,t){return C(r,e,t)}function u(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new T(e,t)}catch(e){console.log(e)}}function l(){for(var t=(null==e?void 0:e.urls)||[a,o],n=0;n<t.length;n++){var r,i=u(t[n]);if(i){var s=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(s&&(s=decodeURIComponent(s),I.isURL(s)))return s}}}return function(){var e;t(this,n),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){c("depth.error",e.message)}c("depth.value",e)}(),function(){var e=i,t=r.depth.value,n=s;if(c("top.domain.from","fallback"),e&&e.length>0)n=e[e.length-1],c("top.domain.from","origins");else if(0===t)n=s,c("top.domain.from","self-top");else if(1===t){var a=u(o);a&&(n=a.origin,c("top.domain.from","referrer"))}c("top.domain.value",n.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=l();if(e)if(P(e))c("partner.domain.value",e),c("partner.domain.from","partner-domain");else{var t=u(e,!1);if(t)c("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),c("partner.domain.from","partner-url");else c("partner.domain.value",r.top.domain.value),c("partner.domain.from","partner-fallback")}else c("partner.domain.value",r.top.domain.value),c("partner.domain.from","fallback")}(),e=l(),0===r.depth.value?(c("partner.url.value",a),c("partner.url.from","self-top")):e?P(e)?(c("partner.url.value",a),c("partner.url.from","partner-domain")):(c("partner.url.value",e),c("partner.url.from","partner-url")):(c("partner.url.value",o),c("partner.url.from","fallback"))}.bind(this)(),{get:d,print:function(e){console.log(d(e))}}}hb("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=yb(mb(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!pb(e))return ub(t,r,e,i);for(var a,s,o,d=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,l=new RegExp(e.source,c+"g");(a=ub(kb,l,r))&&!((s=l.lastIndex)>u&&(Tb(d,Ib(r,u,a.index)),a.length>1&&a.index<r.length&&cb(Sb,d,wb(a,1)),o=a[0].length,u=s,d.length>=i));)l.lastIndex===a.index&&l.lastIndex++;return u===r.length?!o&&Rb(l,"")||Tb(d,""):Tb(d,Ib(r,u)),d.length>i?wb(d,0,i):d}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:ub(t,this,e,n)}:t,[function(t,n){var i=mb(this),a=null==t?void 0:_b(t,e);return a?ub(a,t,i,n):ub(r,yb(i),t,n)},function(e,i){var a=fb(this),s=yb(e),o=n(r,a,s,i,r!==t);if(o.done)return o.value;var d=vb(a,RegExp),c=a.unicode,u=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(xb?"g":"y"),l=new d(xb?"^(?:"+a.source+")":a,u),h=void 0===i?4294967295:i>>>0;if(0===h)return[];if(0===s.length)return null===Ab(l,s)?[s]:[];for(var p=0,f=0,m=[];f<s.length;){l.lastIndex=xb?0:f;var v,g=Ab(l,xb?Ib(s,f):s);if(null===g||(v=Db(bb(l.lastIndex+(xb?f:0)),s.length))===p)f=gb(s,f,c);else{if(Tb(m,Ib(s,p,f)),m.length===h)return m;for(var b=1;b<=g.length-1;b++)if(Tb(m,g[b]),m.length===h)return m;f=p=v}}return Tb(m,Ib(s,p)),m}]}),!!Eb((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]})),xb);var Ob={name:"@bygd/gd-sdk-pes",version:"1.27.21",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.4","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"}},Cb="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==Cb&&Cb,Lb="URLSearchParams"in Cb,Ub="Symbol"in Cb&&"iterator"in Symbol,Mb="FileReader"in Cb&&"Blob"in Cb&&function(){try{return new Blob,!0}catch(e){return!1}}(),jb="FormData"in Cb,Bb="ArrayBuffer"in Cb;if(Bb)var Gb=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Nb=ArrayBuffer.isView||function(e){return e&&Gb.indexOf(Object.prototype.toString.call(e))>-1};function qb(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 Fb(e){return"string"!=typeof e&&(e=String(e)),e}function Vb(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return Ub&&(t[Symbol.iterator]=function(){return t}),t}function Kb(e){this.map={},e instanceof Kb?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 Wb(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Hb(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function zb(e){var t=new FileReader,n=Hb(t);return t.readAsArrayBuffer(e),n}function $b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Qb(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:Mb&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:jb&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Lb&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Bb&&Mb&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=$b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Bb&&(ArrayBuffer.prototype.isPrototypeOf(e)||Nb(e))?this._bodyArrayBuffer=$b(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):Lb&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Mb&&(this.blob=function(){var e=Wb(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=Wb(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(zb)}),this.text=function(){var e=Wb(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=Hb(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)},jb&&(this.formData=function(){return this.text().then(Xb)}),this.json=function(){return this.text().then(JSON.parse)},this}Kb.prototype.append=function(e,t){e=qb(e),t=Fb(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},Kb.prototype.delete=function(e){delete this.map[qb(e)]},Kb.prototype.get=function(e){return e=qb(e),this.has(e)?this.map[e]:null},Kb.prototype.has=function(e){return this.map.hasOwnProperty(qb(e))},Kb.prototype.set=function(e,t){this.map[qb(e)]=Fb(t)},Kb.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},Kb.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),Vb(e)},Kb.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Vb(e)},Kb.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),Vb(e)},Ub&&(Kb.prototype[Symbol.iterator]=Kb.prototype.entries);var Yb=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Jb(e,t){if(!(this instanceof Jb))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 Jb){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Kb(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 Kb(t.headers)),this.method=function(e){var t=e.toUpperCase();return Yb.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 Xb(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function Zb(e,t){if(!(this instanceof Zb))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 Kb(t.headers),this.url=t.url||"",this._initBody(e)}Jb.prototype.clone=function(){return new Jb(this,{body:this._bodyInit})},Qb.call(Jb.prototype),Qb.call(Zb.prototype),Zb.prototype.clone=function(){return new Zb(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Kb(this.headers),url:this.url})},Zb.error=function(){var e=new Zb(null,{status:0,statusText:""});return e.type="error",e};var ey=[301,302,303,307,308];Zb.redirect=function(e,t){if(-1===ey.indexOf(t))throw new RangeError("Invalid status code");return new Zb(null,{status:t,headers:{location:e}})};var ty=Cb.DOMException;try{new ty}catch(e){ty=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},ty.prototype=Object.create(Error.prototype),ty.prototype.constructor=ty}function ny(e,t){return new Promise((function(n,r){var i=new Jb(e,t);if(i.signal&&i.signal.aborted)return r(new ty("Aborted","AbortError"));var a=new XMLHttpRequest;function s(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new Kb,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 i=n.join(":").trim();t.append(r,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;setTimeout((function(){n(new Zb(i,r))}),0)},a.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.onabort=function(){setTimeout((function(){r(new ty("Aborted","AbortError"))}),0)},a.open(i.method,function(e){try{return""===e&&Cb.location.href?Cb.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?a.withCredentials=!0:"omit"===i.credentials&&(a.withCredentials=!1),"responseType"in a&&(Mb?a.responseType="blob":Bb&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(a.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof Kb?i.headers.forEach((function(e,t){a.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){a.setRequestHeader(e,Fb(t.headers[e]))})),i.signal&&(i.signal.addEventListener("abort",s),a.onreadystatechange=function(){4===a.readyState&&i.signal.removeEventListener("abort",s)}),a.send(void 0===i._bodyInit?null:i._bodyInit)}))}ny.polyfill=!0,Cb.fetch||(Cb.fetch=ny,Cb.Headers=Kb,Cb.Request=Jb,Cb.Response=Zb);var ry,iy=Array.isArray,ay=Object.prototype.toString,sy=iy||function(e){return!!e&&"[object Array]"==ay.call(e)},oy=function(e){var t=dy("object"===n(e)?e:i(e));return t&&t.version?Ob.version>=t.version?t:void 0:t},dy=function(e){var n=this;if(!sy(e)||0===e.length)return e;if(1===e.length)return e[0];var r=0;e.forEach(function(e){t(this,n),e.weight=e.weight||1,r+=e.weight}.bind(this));var i=Math.floor(Math.random()*Math.floor(r));r=0;for(var a=0;a<e.length;a++){var s=e[a];if(i<(r+=s.weight))return s}},cy=function(){return ry},uy=function(e){var n=this,r=new Pb;r.get();var i=r.get("partner.domain.value"),s=function(){return t(this,n),{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),o=function(){t(this,n);var r=d(),a=r?"&mode=".concat(r):"";return"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(i).concat(a,"&v=").concat(Ob.version,"&localTime=").concat((new Date).getHours())}.bind(this),d=function(){var e=this;t(this,n);var r=new Proxy(new URLSearchParams(window.location.search),{get:function(n,r){return t(this,e),n.get(r)}.bind(this)});return!r.gd_mode&&window.location.search.includes("gd_mode")?window.location.search.split("gd_mode=")[1]:r.gd_mode}.bind(this);return new Promise(function(e){var r=this;if(t(this,n),ry)e(ry);else{var i=s(),d=o();fetch(d).then(function(e){return t(this,r),e.json()}.bind(this)).then(function(n){if(t(this,r),n.success){var s,o,d,c,u=n.result.game,l={gameId:u.gameMd5,slug:u.slug,pname:u.pname,dname:u.dname,status:u.status,description:u.description,enableAds:!0===u.enableAds||!0===(null===(s=u.enableAds)||void 0===s?void 0:s.enabled),preroll:u.preRoll,midroll:6e4*u.timeAds,rewardedAds:u.rewardedAds,title:u.title,tags:u.tags,category:u.category,assets:u.assets,disp_2nd_prer:u.disp_2nd_prer,ctry_vst:u.ctry_vst,ctry:u.ctry,crtv:u.crtv,dmain:u.dmain,__t4r:u.__t4r||{},block_exts:oy(u.push_cuda),bloc_gard:oy(u.bloc_gard),cookie:oy(u.cookie),gdpr:oy(u.gdpr),diagnostic:oy(u.diagnostic),cmp:oy(u.cmp),gft:oy(u.gft)||{},sdk:oy(u.sdk)||{},sdkfw:oy(u.sdkfw)||{},loader:oy(u.loader)||{},splash:oy(u.splash)||{},promo:oy(u.promo)||{},dAds:oy(u.dads)||{},pAds:oy(u.pads)||{},mAds:oy(u.mads)||{},rAds:oy(u.rads)||{},lp:oy(u.lp)||{},extsc:oy(u.extsc)||{},evnts:oy(u.evnts)||{}},h=a(L(i),l);h.afg_disabled=!1===(null===(o=h.sdk)||void 0===o||null===(d=o.afg)||void 0===d?void 0:d.enabled),null!==(c=h.pAds)&&void 0!==c&&c.enabled&&(h.preroll=!0),ry=h,e(h)}else i.failed=!0,e(i)}.bind(this)).catch(function(n){t(this,r),console.log("gd:adp failed game data",n),i.failed=!0,e(i)}.bind(this))}}.bind(this))},ly=function(){var e,t=cy();return!(null==t||null===(e=t.sdkfw)||void 0===e||!e.enabled)},hy=function(){var e,t,n,r,i,a,s=cy(),o=!(null==s||null===(e=s.extsc)||void 0===e||!e.enabled);return{enabled:o,path:o?null==s||null===(t=s.extsc)||void 0===t?void 0:t.path:"",name:o?null==s||null===(n=s.extsc)||void 0===n?void 0:n.name:"",ref:o?null==s||null===(r=s.extsc)||void 0===r?void 0:r.ref:"",loadedFlag:o?null==s||null===(i=s.extsc)||void 0===i?void 0:i.loadedFlag:void 0,loadedFlagCheck:!!o&&!(null==s||null===(a=s.extsc)||void 0===a||!a.loadedFlagCheck)}},py=function(){var n=e(r.mark((function e(){var n,i,a,d,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=hy()).enabled){e.next=3;break}return e.abrupt("return");case 3:return i=n.path,a=n.name,d=n.ref,e.prev=4,c={},e.next=8,o(i,a,{error_prefix:"Blocked:",exists:function(){return t(this,u),!!d&&!!window[d]}.bind(this),attrs:c});case 8:console.log("extsc: after external partner script load",a,i),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(4),console.log("extsc: error on external partner script load",a,e.t0),s("DEVELOPER_ERROR",e.t0,"warning");case 15:case"end":return e.stop()}}),e,this,[[4,11]])})));return function(){return n.apply(this,arguments)}}(),fy=!1,my=!1,vy=function(){var e=this;return new Promise(function(n,r){var i=this;if(t(this,e),fy)return n(my);fy=!0;var a=hy();if(!a.enabled)return n(!1);var s=a.loadedFlag,o=a.loadedFlagCheck;if(o&&!s)return n(!1);if(!o)return my=!0,n(!0);var d=!0;setTimeout(function(){t(this,i),d&&(console.log("extsc: clearing on wait after timeout"),d=!1,fy=!0,n(!1))}.bind(this),5e3);var c=setInterval(function(){t(this,i),d&&o&&window[s]?(console.log("extsc: loaderflag for external script is set!"),d=!1,fy=!0,my=!0,clearInterval(c),n(!0)):d||(console.log("extsc: clearing interval after timeout"),clearInterval(c))}.bind(this),100)}.bind(this))},gy=function(e){var n=function(e){var n=this,r=function(e){return t(this,n),l("showAd",{adType:e})}.bind(this),i=function(e){return t(this,n),l("preloadAd",{adType:e})}.bind(this),a=function(e){return t(this,n),l("showDisplayAd",{options:e})}.bind(this),s=function(){return t(this,n),l("cancelAd")}.bind(this),o=function(){return t(this,n),l("openConsole")}.bind(this),d=function(){return t(this,n),l("showBanner")}.bind(this),c=function(){return t(this,n),l("session")}.bind(this),u=function(){t(this,n),console.log("_sendSDKReady")}.bind(this),l=function(e,r){var i=this;return t(this,n),r||(r={}),new Promise(function(n,a){t(this,i);try{var s={type:"gd-sdk",method:e,options:r};window.parent.postMessage(s,"https://html5.gamedistribution.com"),n()}catch(e){console.log("gd:adp:m:s:error",e),n()}}.bind(this))}.bind(this),h=function(){t(this,n),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&&(console.log("gd:adp received on-event",r),r&&f(r))}),!1)}.bind(this),p=function(){t(this,n),h(),l("init")}.bind(this),f=function(r){t(this,n),e.onEvent&&e.onEvent(r)}.bind(this);return{showBanner:d,showAd:r,preloadAd:i,showDisplayAd:a,cancelAd:s,openConsole:o,getSession:c,onEvent:f,init:p,_sendSDKReady:u}}(e);return n.init(),n},by=function(){var e=this;return{isMasterGameURL:function(){t(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)}.bind(this),isTokenGameURL:function(){t(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i.test(location.href)}.bind(this),isExtHostedGameURL:function(){t(this,e);return/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i.test(location.href)}.bind(this)}},yy=function(e){var n=this;return new Promise(function(r,i){var a=this;t(this,n);var s={type:"gd-sdk-frame-handshake-request"},o=!1;window.addEventListener("message",(function(e){var t=e.data,n=e.origin,i=e.source,a=t.type;if("gd-sdk-frame-handshake-request"===a){var s={type:"gd-sdk-frame-handshake-response"};i.postMessage(s,n)}else"gd-sdk-frame-handshake-response"===a&&(o=!0,r({origin:n,source:i}))})),e?r():(setTimeout(function(){t(this,a),o||r()}.bind(this),200),window.parent!==window?window.parent.postMessage(s,"*"):r())}.bind(this))},_y=function(){var t=e(r.mark((function e(t){var n,i,a,s,o,d,c,u,l,h;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,uy(t);case 2:return e.next=5,ly();case 5:return n=e.sent,console.log("gd:adp ,isSDKForwardEnable",n),i=!n,e.next=10,yy(i);case 10:if(a=e.sent,n){e.next=13;break}return e.abrupt("return",!1);case 13:return s=by(),o=s.isMasterGameURL,d=s.isTokenGameURL,c=o(),u=d(),r=void 0,p=void 0,p=cy(),l=ly()&&!(null==p||null===(r=p.sdkfw)||void 0===r||!r.handshake),h=!1,h=l?!c&&!!a:!c,console.log("gd:adp: frameCheck result",{_isMasterGameURL:c,_isTokenGameURL:u,isHandshakeEnabled:l,hsResult:a,result:h}),e.abrupt("return",h);case 21:case"end":return e.stop()}var r,p}),e)})));return function(e){return t.apply(this,arguments)}}(),wy=$,Ay=de,ky=xi,Ey=ke,xy=Ay(J.f),Dy=Ay([].push),Sy=function(e){return function(t){for(var n,r=Ey(t),i=ky(r),a=i.length,s=0,o=[];a>s;)n=i[s++],wy&&!xy(r,n)||Dy(o,e?[n,r[n]]:r[n]);return o}},Ry={entries:Sy(!0),values:Sy(!1)}.values;Ai({target:"Object",stat:!0},{values:function(e){return Ry(e)}});var Ty=Ai,Iy=Xl,Py=z,Oy=Ie,Cy=Ee,Ly=Rh,Uy=Bp,My=xn.exports;if(Ty({target:"Promise",proto:!0,real:!0,forced:!!Iy&&Py((function(){Iy.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=Ly(this,Oy("Promise")),n=Cy(e);return this.then(n?function(n){return Uy(t,e()).then((function(){return n}))}:e,n?function(n){return Uy(t,e()).then((function(){throw n}))}:e)}}),Cy(Iy)){var jy=Oy("Promise").prototype.finally;Iy.prototype.finally!==jy&&My(Iy.prototype,"finally",jy,{unsafe:!0})}var By=_e,Gy=$i,Ny=de("".replace),qy="[\t\n\v\f\r                 \u2028\u2029\ufeff]",Fy=RegExp("^"+qy+qy+"*"),Vy=RegExp(qy+qy+"*$"),Ky=function(e){return function(t){var n=Gy(By(t));return 1&e&&(n=Ny(n,Fy,"")),2&e&&(n=Ny(n,Vy,"")),n}},Wy={start:Ky(1),end:Ky(2),trim:Ky(3)},Hy=ur.PROPER,zy=z,$y="\t\n\v\f\r                 \u2028\u2029\ufeff",Qy=Wy.trim;Ai({target:"String",proto:!0,forced:function(e){return zy((function(){return!!$y[e]()||"​…᠎"!=="​…᠎"[e]()||Hy&&$y[e].name!==e}))}("trim")},{trim:function(){return Qy(this)}});var Yy=Ee,Jy=De,Xy=Yc,Zy=$,e_=W,t_=de,n_=fi,r_=function(e,t,n){var r,i;return Xy&&Yy(r=t.constructor)&&r!==n&&Jy(i=r.prototype)&&i!==n.prototype&&Xy(e,i),e},i_=En,a_=un.f,s_=wr.f,o_=Pe,d_=Jg,c_=$i,u_=Au,l_=ku,h_=xn.exports,p_=z,f_=_t,m_=ir.enforce,v_=ah,g_=Ru,b_=Pu,y_=Mt("match"),__=e_.RegExp,w_=__.prototype,A_=e_.SyntaxError,k_=t_(u_),E_=t_(w_.exec),x_=t_("".charAt),D_=t_("".replace),S_=t_("".indexOf),R_=t_("".slice),T_=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,I_=/a/g,P_=/a/g,O_=new __(I_)!==I_,C_=l_.UNSUPPORTED_Y,L_=Zy&&(!O_||C_||g_||b_||p_((function(){return P_[y_]=!1,__(I_)!=I_||__(P_)==P_||"/a/i"!=__(I_,"i")})));if(n_("RegExp",L_)){for(var U_=function(e,t){var n,r,i,a,s,o,d=o_(w_,this),c=d_(e),u=void 0===t,l=[],h=e;if(!d&&c&&u&&e.constructor===U_)return e;if((c||o_(w_,e))&&(e=e.source,u&&(t="flags"in h?h.flags:k_(h))),e=void 0===e?"":c_(e),t=void 0===t?"":c_(t),h=e,g_&&"dotAll"in I_&&(r=!!t&&S_(t,"s")>-1)&&(t=D_(t,/s/g,"")),n=t,C_&&"sticky"in I_&&(i=!!t&&S_(t,"y")>-1)&&(t=D_(t,/y/g,"")),b_&&(a=function(e){for(var t,n=e.length,r=0,i="",a=[],s={},o=!1,d=!1,c=0,u="";r<=n;r++){if("\\"===(t=x_(e,r)))t+=x_(e,++r);else if("]"===t)o=!1;else if(!o)switch(!0){case"["===t:o=!0;break;case"("===t:E_(T_,R_(e,r+1))&&(r+=2,d=!0),i+=t,c++;continue;case">"===t&&d:if(""===u||f_(s,u))throw new A_("Invalid capture group name");s[u]=!0,a[a.length]=[u,c],d=!1,u="";continue}d?u+=t:i+=t}return[i,a]}(e),e=a[0],l=a[1]),s=r_(__(e,t),d?this:w_,U_),(r||i||l.length)&&(o=m_(s),r&&(o.dotAll=!0,o.raw=U_(function(e){for(var t,n=e.length,r=0,i="",a=!1;r<=n;r++)"\\"!==(t=x_(e,r))?a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),i+=t):i+="[\\s\\S]":i+=t+x_(e,++r);return i}(e),n)),i&&(o.sticky=!0),l.length&&(o.groups=l)),e!==h)try{i_(s,"source",""===h?"(?:)":h)}catch(e){}return s},M_=function(e){e in U_||a_(U_,e,{configurable:!0,get:function(){return __[e]},set:function(t){__[e]=t}})},j_=s_(__),B_=0;j_.length>B_;)M_(j_[B_++]);w_.constructor=U_,U_.prototype=w_,h_(e_,"RegExp",U_)}v_("RegExp");var G_=de,N_=ur.PROPER,q_=xn.exports,F_=mn,V_=Pe,K_=$i,W_=z,H_=Au,z_=RegExp.prototype,$_=z_.toString,Q_=G_(H_),Y_=W_((function(){return"/a/b"!=$_.call({source:"a",flags:"b"})})),J_=N_&&"toString"!=$_.name;(Y_||J_)&&q_(RegExp.prototype,"toString",(function(){var e=F_(this),t=K_(e.source),n=e.flags;return"/"+t+"/"+K_(void 0===n&&V_(z_,e)&&!("flags"in z_)?Q_(e):n)}),{unsafe:!0});var X_,Z_=Ai,ew=de,tw=H.f,nw=Pr,rw=$i,iw=eb,aw=_e,sw=nb,ow=ew("".startsWith),dw=ew("".slice),cw=Math.min,uw=sw("startsWith");Z_({target:"String",proto:!0,forced:!!(uw||(X_=tw(String.prototype,"startsWith"),!X_||X_.writable))&&!uw},{startsWith:function(e){var t=rw(aw(this));iw(e);var n=nw(cw(arguments.length>1?arguments[1]:void 0,t.length)),r=rw(e);return ow?ow(t,r,n):dw(t,n,n+r.length)===r}});var lw=Ai,hw=ds.find,pw=kl,fw=!0;"find"in[]&&Array(1).find((function(){fw=!1})),lw({target:"Array",proto:!0,forced:fw},{find:function(e){return hw(this,e,arguments.length>1?arguments[1]:void 0)}}),pw("find");var mw=$,vw=de,gw=Y,bw=z,yw=xi,_w=$r,ww=J,Aw=gt,kw=be,Ew=Object.assign,xw=Object.defineProperty,Dw=vw([].concat),Sw=!Ew||bw((function(){if(mw&&1!==Ew({b:1},Ew(xw({},"a",{enumerable:!0,get:function(){xw(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!=Ew({},e)[n]||yw(Ew({},t)).join("")!=r}))?function(e,t){for(var n=Aw(e),r=arguments.length,i=1,a=_w.f,s=ww.f;r>i;)for(var o,d=kw(arguments[i++]),c=a?Dw(yw(d),a(d)):yw(d),u=c.length,l=0;u>l;)o=c[l++],mw&&!gw(s,d,o)||(n[o]=d[o]);return n}:Ew,Rw=Sw;Ai({target:"Object",stat:!0,forced:Object.assign!==Rw},{assign:Rw});var Tw=function(){function e(t){S(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return U(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 n={},r=this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled,i=new T(location.href,!0);for(var a in i.query)n[a]=i.query[a];return Object.keys(n).filter(function(n){var r=this;return t(this,e),this.customParamKeys.some(function(e){return t(this,r),e===n}.bind(this))}.bind(this)).length>0||r?(console.log("custom-params",n,r),n):void console.log("custom-params, none")}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),Iw=function(){function e(t,n){S(this,e),this.adContainer=t,this.onResume=n}return U(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 n=document.createElement("div");this.adResumeButton=n,n.id="gd__resume__button",n.setAttribute("title","Resume"),this.addStyles(),n.classList.add("gd__resume__button"),n.addEventListener("click",function(){t(this,e),this.onResume()}.bind(this)),this.adContainer.appendChild(n);var r=document.createElement("div");this.adResumeButtonOverlay=r,r.id="gd__resume__button__overlay",r.classList.add("gd__resume__button__overlay"),this.adContainer.appendChild(r)}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}(),Pw=function(e){if(!e)return!1;var t=Ow.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)},Ow=Object.prototype.toString;function Cw(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 Lw(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cw(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cw(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Uw(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 Mw(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 jw(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mw(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mw(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Bw=null,Gw=function(){function n(e,r,i){var s=this;if(S(this,n),Bw)return Bw;Bw=this;var o={debug:!1,width:640,height:360,locale:"en"};this.options=r?a(o,r):o,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new p,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=i.parentDomain,this.topDomain=i.topDomain,this.parentURL=i.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=f(),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=""!==e?document.getElementById(e):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 d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:d,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:c,this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){t(this,s),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){t(this,s),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var i,s,m,v,g,b,y,_,w,A,k,E,x,D,I,P,O,C,q;return U(n,[{key:"start",value:(q=e(r.mark((function e(){return r.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(),e.next=14;break;case 11:throw e.prev=11,e.t0=e.catch(0),new Error(e.t0);case 14:case"end":return e.stop()}}),e,this,[[0,11]])}))),function(){return q.apply(this,arguments)})},{key:"_getAdVast",value:function(n,i){var a=this;return new Promise(function(){var s=e(r.mark((function e(s){var o,c,u,l,h,p,f,m,v=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(d.available&&d.getBoolean("gd_debug_ex")&&d.getBoolean("gd_tag"))){e.next=6;break}return o=a.IMASampleTags[n],c=Math.floor(Math.random()*o.length),u=o[c],s({url:u}),e.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){e.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return e.prev=8,l=a.nextAdPosition(n),a.eventBus.broadcast("AD_REQUEST",{message:l}),h=a.options,"preroll"===l&&j(h.preroll)?h=h.preroll:"midroll"===l&&j(h.midroll)?h=h.midroll:"rewarded"===l&&j(h.rewarded)&&(h=h.rewarded),p="rewarded"===l?"rewardedVideo":"gdbanner"===l?"gd__banner":"midroll"===l?"midroll":"video1",e.next=16,window.idhb.isLoaded();case 16:if(f={tnl_keys:jw(jw({},window.idhb.getAdserverTargetingForAdSlot(p)),{},{tnl_ad_pos:l,tnl_asset_id:a.gameData.gameId})},!(i&&i.retry_on_success&&j(h.retry_on_success)&&j(h.retry_on_success.vast))){e.next=21;break}return e.abrupt("return",s(a._createCustomAdVastUrl(h.retry_on_success.vast,f)));case 21:if(!(i&&i.retry_on_failure&&a.options.retry_on_failure&&j(h.retry_on_failure.vast))){e.next=25;break}return e.abrupt("return",s(a._createCustomAdVastUrl(h.retry_on_failure.vast,f)));case 25:if(!j(h.vast)){e.next=27;break}return e.abrupt("return",s(a._createCustomAdVastUrl(h.vast,f)));case 27:return e.next=29,a._create_dp_context(l,i);case 29:m=e.sent,window.idhb.requestAds({slots:R({},p,{bidFloor:null!=m&&m.floor_price?m.floor_price:void 0}),callback:function(e,n){var r=this;t(this,v),!m||null!=n&&n.bidFloorApplied||fetch(m.skip_url).catch(function(e){t(this,r)}.bind(this)),s({tnl_keys:jw(jw({},window.idhb.getAdserverTargetingForAdSlot(p)),{},{tnl_ad_pos:l,tnl_asset_id:a.gameData.gameId}),url:e,dp:m,hl:n})}.bind(this)}),e.next=36;break;case 33:throw e.prev=33,e.t0=e.catch(8),new Error(e.t0);case 36:case"end":return e.stop()}}),e,this,[[8,33]])})));return function(e){return s.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===c.Rewarded)return this.adRewardedCount++,"rewarded";if(e===c.Interstitial){var t=!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount;return t?this.adMidrollCount++:this.adPrerollCount++,t||this.adMidrollCount>0?"midroll":"preroll"}return"midroll"}},{key:"getAdPosition",value:function(e){return e===c.Rewarded?"rewarded":e===c.Interstitial?!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_requestAd",value:function(e,n){var r=this;return n=n||{},new Promise(function(i){if(t(this,r),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var a,s=null==e||null===(a=e.tnl_keys)||void 0===a?void 0:a.tnl_ad_pos;this.adSuccess=!1;var o=new google.ima.AdsRequest,d=this._transformVast(e,n),c=jw(jw({},n),{},{adTag:d,tnl_ad_pos:s});this.adCounter[s]=this.adCounter[s]||0,this.adCounter[s]++;var u=e.dp,l=e.hl;if(u&&(u.adtag_url=d.url,this._extend_dp_with_adsense(u,l,null==e?void 0:e.tnl_keys)),this._isVMAP(s)){var h=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,i=Date.now(),a=new T(e.adtag_url_1,!0);a.query=Lw(Lw({},a.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:i,output:"xml_vast3"});var s=a.toString(),o=new T(e.adtag_url_2,!0);o.query=Lw(Lw({},o.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++i,output:"xml_vast3"});var d=o.toString(),c=Date.now();return'<?xml version="1.0" encoding="UTF-8"?>\n<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-1">\n <vmap:AdSource id="'.concat(c++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(Uw({id:c++,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(c++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(Uw({id:c++,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:u,adtag:d,position:"preroll"===c.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(s)}));o.adsResponse=h}else if(u&&l.bidFloorApplied){var p=function(e){return e.promo_url?e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="2" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(u);o.adsResponse=p}else if(u&&u.fallback_url){var f=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()}(u);o.adsResponse=f}else 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(n.autoplayAllowed),o.setAdWillPlayMuted(n.autoplayRequiresMute),this.adsLoader.requestAds(o,c);try{this.eventBus.broadcast("AD_SDK_REQUEST",{message:c})}catch(e){}i(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.eventBus.broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameData.gameId}})}}},{key:"_checkAutoPlay",value:(C=e(r.mark((function e(){var n=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,r){var i=this;t(this,n);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):M.video({inline:!0,muted:!1}).then(function(n){t(this,i);var r=n.result;n.error,e(!0===r?{autoplayAllowed:!0,autoplayRequiresMute:!1}:{autoplayAllowed:!0,autoplayRequiresMute:!0})}.bind(this))}.bind(this)));case 1:case"end":return e.stop()}}),e,this)}))),function(){return C.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(O=e(r.mark((function e(){var t;return r.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 O.apply(this,arguments)})},{key:"startAd",value:(P=e(r.mark((function e(t){var n,i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.gameData.afg_disabled,i=t.adType,a=t.params,this.adType_=i,console.log("gd:adp startAd afgDisabled",n),i!==c.Interstitial){e.next=24;break}if(!n){e.next=9;break}return e.abrupt("return",this._startInterstitialAd(a));case 9:if("preroll"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=13;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 13:if("start"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=17;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 17:if("next"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=21;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 21:return e.abrupt("return",this._startInterstitialAd(a));case 22:case 30:e.next=33;break;case 24:if(i!==c.Rewarded){e.next=32;break}if(!n){e.next=29;break}return e.abrupt("return",this._startRewardedAd(a));case 29:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 32:throw new Error("Unsupported ad type");case 33:case"end":return e.stop()}}),e,this)}))),function(e){return P.apply(this,arguments)})},{key:"preloadAd",value:(I=e(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==c.Interstitial){e.next=4;break}return e.abrupt("return","gdsdk://preloaded");case 4:if(t!==c.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 I.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,n=function(){t(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new Iw(this.adContainer,n),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(D=e(r.mark((function n(i){var a=this;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise(function(){var n=e(r.mark((function e(n,s){var o,d,c,l,h,p,f,m,v,g=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(d=i?i.containerId:null)||s("Container id is not specified"),c=document.getElementById(d),document.getElementById(d)||s("No container is found with this id - ".concat(d)),void 0===window.idhb.requestAds&&s("Prebid.js wrapper script hit an error or didn't exist!"),l=i.slotId?i.slotId:"gd__banner@".concat(d),document.getElementById(l)||(h="\n .gd__banner{\n z-index: ".concat(u.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((p=document.createElement("style")).type="text/css",p.id="gd__banner__style",p.styleSheet?p.styleSheet.cssText=h:p.appendChild(document.createTextNode(h)),c.appendChild(p)),(f=document.createElement("div")).id=l,f.classList.add("gd__banner"),c.appendChild(f)),e.next=10,a._create_dp_display_context();case 10:a.atom_display=e.sent,null!==(o=a.atom_display)&&void 0!==o&&o.params&&window.idhb.setAdserverTargeting(null===(m=a.atom_display)||void 0===m?void 0:m.params),(v={})[l]={maxSize:[c.offsetWidth,c.offsetHeight]},window.idhb.requestAds({slots:v,callback:function(e){t(this,g)}.bind(this)}),n(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),s(e.t0.message||e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(e,t){return n.apply(this,arguments)}}()));case 1:case"end":return n.stop()}}),n)}))),function(e){return D.apply(this,arguments)})},{key:"_startInterstitialAd",value:(x=e(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,e.next=7,this._initDisplayContainerWithAutoPlay();case 7:return n=e.sent,e.next=10,this._loadInterstitialAd(jw(jw({},n),t));case 10:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return x.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(E=e(r.mark((function e(n){var i,a,s=this;return r.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(c.Interstitial,n);case 6:e.t0=e.sent;case 7:return i=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(i,jw({adType:c.Interstitial},n));case 11:return a=e.sent,e.next=14,new Promise(function(e,n){var r=this;t(this,s);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var a=function(n){t(this,r),this.eventBus.unsubscribeScope(i),e(n.message)}.bind(this),o=function(e){t(this,r),this.eventBus.unsubscribeScope(i),n(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,i),this.eventBus.subscribe("AD_SDK_CANCELED",o,i),this.eventBus.subscribe("AD_ERROR",o,i)}.bind(this));case 14:return e.abrupt("return",a);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 E.apply(this,arguments)})},{key:"_startRewardedAd",value:(k=e(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,e.next=7,this._initDisplayContainerWithAutoPlay();case 7:return n=e.sent,e.next=10,this._loadRewardedAd(jw(jw({},n),t));case 10:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return k.apply(this,arguments)})},{key:"_loadRewardedAd",value:(A=e(r.mark((function e(n){var i,a,s=this;return r.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(c.Rewarded,n);case 6:e.t0=e.sent;case 7:return i=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(i,jw({adType:c.Rewarded},n));case 11:return a=e.sent,e.next=14,new Promise(function(e,n){var r=this;t(this,s);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var a=function(n){t(this,r),this.eventBus.unsubscribeScope(i),e(n.message)}.bind(this),o=function(e){t(this,r),this.eventBus.unsubscribeScope(i),n(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,i),this.eventBus.subscribe("AD_SDK_CANCELED",o,i),this.eventBus.subscribe("AD_ERROR",o,i)}.bind(this));case 14:return e.abrupt("return",a);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 A.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(w=e(r.mark((function e(){return r.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(c.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 w.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(_=e(r.mark((function e(){return r.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(c.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 _.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 n=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var r=null==e?void 0:e.mode;e.t4r=oy(this.gameData.__t4r)||{};var i=this._isT4R(e),a=this._getT4ROptions(e);if("loaded"===r)this.activeAdContainer.style.opacity=i?.001:1,i&&this.adsManager.setVolume(0),i&&this.eventBus.broadcast("AD_T4R"),i&&setTimeout(function(){t(this,n),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"===r||"first_quartile"===r){if(i&&"click"===r){var s,o=null===(s=this._adrequest_user_context)||void 0===s?void 0:s.tnl_ad_pos;this.clickCount[o]++}this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}}}},{key:"_createPlayer",value:function(){var e=this,n=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=u.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 r=document.createElement("video");r.setAttribute("playsinline",!0),r.setAttribute("webkit-playsinline",!0),r.id="".concat(this.prefix,"advertisement_video"),r.style.position="absolute",r.style.backgroundColor="#000000",r.style.top="0",r.style.left="0",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",this.video_ad_player=r,this.adContainer.appendChild(r);var i=document.createElement("div");i.id="".concat(this.prefix,"advertisement_slot"),i.style.position="absolute",i.style.top="0",i.style.left="0",i.style.width=this.options.width+"px",i.style.height=this.options.height+"px",this.adContainerInner=i,this.activeAdContainer=this.adContainer,this.thirdPartyContainer?(this.adContainer.appendChild(i),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(i),n.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var a=function(){t(this,e);var n=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:n,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:a,i.style.width=this.options.width+"px",i.style.height=this.options.height+"px",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px"}.bind(this);window.addEventListener("resize",a),window.document.addEventListener("DOMContentLoaded",a)}},{key:"_setUpIMA",value:function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.adContainerInner,this.video_ad_player),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setDisableCustomPlaybackForIOS10Plus(!0),this.adsLoader.getSettings().setLocale(this.options.locale),this.adsLoader.getSettings().setVpaidMode(this._getVPAIDMode()),this.adsLoader.getSettings().setAutoPlayAdBreaks(!0);var e=this.adsLoader.getSettings().getNumRedirects();this.adsLoader.getSettings().setNumRedirects(2*e),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1,this),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError,!1,this)}},{key:"_onAdsManagerLoaded",value:function(e){var n=this,r=new google.ima.AdsRenderingSettings;r.autoAlign=!1,r.enablePreloading=!1,r.restoreCustomPlaybackStateOnAdBreakComplete=!0,r.useStyledNonLinearAds=!0,r.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(this.video_ad_player,r),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(){t(this,n),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 i=new Date,a=i.getHours(),s=i.getDate(),o=i.getMonth(),d=i.getFullYear(),c="AD_SDK_MANAGER_READY";this.eventBus.broadcast(c,{name:c,message:"AD SDK is ready",status:"success",analytics:{category:c,action:this.parentDomain,label:"h".concat(a," d").concat(s," m").concat(o," y").concat(d)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var t,n=new Date,r=n.getHours(),i=n.getDate(),a=n.getMonth(),s=n.getFullYear(),o=l(google.ima.AdEvent.Type,e.type),d=!1,u=(null==e||null===(t=e.getAd())||void 0===t?void 0:t.getContentType())||"",h=!u.startsWith("image")&&!u.startsWith("text");this._sendIMAEventsToHB(e);var p="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:p="Fired when an ad rule or a VMAP ad break would have played if autoPlayAdBreaks is false.";break;case google.ima.AdEvent.Type.AD_METADATA:p="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:d=!0,p="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:p="Fired when the ad is clicked.";var f=e.getAd().getContentType();this._show({mode:"click",contentType:f});break;case google.ima.AdEvent.Type.COMPLETE:d=this._is_completed(e.getAd()),p="Fired when the ad completes playing.",this.adType_===c.Rewarded&&this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:p="Fired when content should be paused. This usually happens right before an ad is about to cover the content.";break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:p="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",d=!0,this._hideAddResume();break;case google.ima.AdEvent.Type.DURATION_CHANGE:p="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:p="Fired when the ad playhead crosses first quartile.";var m=e.getAd().getContentType();this._show({mode:"first_quartile",contentType:m});break;case google.ima.AdEvent.Type.IMPRESSION:p="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:p="Fired when an ad triggers the interaction callback. Ad interactions contain an interaction ID string in the ad data.";break;case google.ima.AdEvent.Type.LINEAR_CHANGED:p="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var v=e.getAd().getContentType();p=v,this._show({mode:"loaded",contentType:v});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(p=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:p="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:h&&this.adResume.show(),p="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:p="Fired when the ad is resumed.",h&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:p="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:d=this._is_completed(e.getAd()),p="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:this._hideAddResume(),p="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:p="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:d=this._is_completed(e.getAd()),p="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:p="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:p="Fired when the ad volume has been muted."}""!==o&&""!==p&&this.eventBus.broadcast(o,{name:o,message:p,status:"success",analytics:{category:o,action:this.parentDomain,label:"h".concat(r," d").concat(i," m").concat(a," y").concat(s)}}),d&&!this.adSuccess&&(this.adSuccess=!0,this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.resetForNext(e))}},{key:"_onAdError",value:function(e){this.requestRunning=!1,this._resetAdsLoader(),this._clearSafetyTimer("ERROR"),this._hide("_onAdError"),this._sendIMAEventsToHB(e);try{var t="AD_ERROR",n=e.getError(),r=n.getErrorCode().toString()||n.getVastErrorCode().toString(),i=this._getInnerErrorCode(n);this.eventBus.broadcast(t,{message:r,details:i,status:"warning",analytics:{category:t,action:i,label:r}}),this._hideAddResume()}catch(e){}}},{key:"_hideAddResume",value:function(){try{console.log("gd:adp will hide adresume"),this.adResume&&this.adResume.hide(),console.log("gd:adp hiding adresume")}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,n){var r=this;this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=window.setTimeout(function(){t(this,r),this.cancel(),this._clearSafetyTimer(n)}.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(Pw(e.getInnerError)){var t=e.getInnerError();if(t)return Pw(t.getErrorCode)&&Pw(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,n){var r=this;if(e){var i=this.macros.transform(e,{get:function(e){if(t(this,r),n&&n.tnl_keys)return n.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in i.query||{}){var s=i.query[a];j(s)&&(i.query[a]=B.stringify(s))}var o=new T(i.url,!0);return G(o.query,i.query||{}),jw({url:o.toString()},n)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new T(e.url,!0),i=this._transformQuery(e,t,r);i&&(n.url=r.toString());var a=i?r:new T(e.url,!0);if(a.query.cust_params){var s=B.parse(a.query.cust_params);n.bidder=s.hb_bidder,n.cust_params=s}n.url_parsed=a}catch(e){n.hasError=!0,n.message=e.message,n.bidder="error",console.log(e.message)}return n}},{key:"_transformQuery",value:function(e,n,r){var i=this;if(e&&n&&e.tnl_keys){var a=this.options.vast_query;if(n.retry_on_success&&this.options.retry_on_success&&j(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:n.retry_on_failure&&this.options.retry_on_failure&&j(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=L(a),j(a)){var s=r.query;if(a.$$remove){for(var o in s){new RegExp(a.$$remove,"i").test(o)&&delete s[o]}delete a.$$remove}var d=B.parse(s.cust_params);if(a.cust_params&&a.cust_params.$$remove){for(var c in d){new RegExp(a.cust_params.$$remove,"i").test(c)&&delete d[c]}delete a.cust_params.$$remove}var u=this.macros.transform(a,{get:function(n){return t(this,i),e.tnl_keys[n.toLowerCase()]}.bind(this)});return s.cust_params=d,G(s,u),s.cust_params=B.stringify(s.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,i,a=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(this.clickCount[a]>=(null===(n=e.t4r[a])||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 a&&(null===(i=e.t4r[a])||void 0===i?void 0:i.enabled);if(null!=e&&e.contentType.startsWith("video/")){var s,o=(null===(s=e.t4r[a])||void 0===s?void 0:s.viper)||0;if(o>0){var d,c=Math.random()<o;return a&&c&&(null===(d=e.t4r[a])||void 0===d?void 0:d.enabled)}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,n,r,i,a,s,o,d,c,u,l,h,p,f,m;if(!e)return!1;var v="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===(i=r.pAds)||void 0===i||null===(a=i.vmap)||void 0===a?void 0:a.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===(c=d.mAds)||void 0===c||null===(u=c.vmap)||void 0===u?void 0:u.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.vmap)||!0===(null===(p=this.gameData)||void 0===p||null===(f=p.rAds)||void 0===f||null===(m=f.vmap)||void 0===m?void 0:m.enabled));if(!v)return!1;var g=this._get_vmap_config(e),b=this.adCounter[e];return void 0!==(null==g?void 0:g.start)?b>=(null==g?void 0:g.start):v}},{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,i=e.dp,a=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:i,d=null!=r&&r.vast_2?void 0:i;return{adtag_url_1:null==a?void 0:a.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,i,a,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===(i=r.mAds)||void 0===i?void 0:i.vmap;case"rewarded":return null===(a=this.gameData)||void 0===a||null===(s=a.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,i,a,s,o,d,c,u,l,h,p,f,m;return!!e&&("preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.dp)||!0===(null===(r=this.gameData)||void 0===r||null===(i=r.pAds)||void 0===i||null===(a=i.dp)||void 0===a?void 0:a.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.dp)||!0===(null===(d=this.gameData)||void 0===d||null===(c=d.mAds)||void 0===c||null===(u=c.dp)||void 0===u?void 0:u.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.dp)||!0===(null===(p=this.gameData)||void 0===p||null===(f=p.rAds)||void 0===f||null===(m=f.dp)||void 0===m?void 0:m.enabled)))}},{key:"_create_dp_display_context",value:function(){var e=this;return new Promise(function(n){var r=this;t(this,e);try{var i={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new Tw(this.gameData).checkCustomParams();a&&(i.cp=a);var s=encodeURIComponent(N.encode(JSON.stringify(i)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(s)).then(function(e){return t(this,r),e.json()}.bind(this)).then(function(e){if(t(this,r),!e||!e.p)return this.msgrt.send("dp.na",{message:"atom"}),n();this.msgrt.send("dp.fp",{message:e.p/100}),n({params:{fp:e.p/100},error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(s),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(s)})}.bind(this)).catch(function(e){t(this,r),this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),n()}.bind(this))}catch(e){this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),n()}}.bind(this))}},{key:"_create_dp_context",value:function(n,i){var a=this;return new Promise(function(){var s=e(r.mark((function e(s){var o,d,c,u,l,h,p=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,a._isDP(n)){e.next=5;break}return a.msgrt.send("dp.na",{message:"rule"}),e.abrupt("return",s());case 5:d={id:a.topDomain||a.parentDomain,au:n||"unknown",ty:"video",aid:a.gameData.gameId,pgu:a.parentURL},(c=new Tw(a.gameData).checkCustomParams())&&(d.cp=c),u=encodeURIComponent(N.encode(JSON.stringify(d))),l=null===(o=a.gameData.promo)||void 0===o?void 0:o.rainbow,h=(null==l?void 0:l.enabled)&&!0!==(null==i?void 0:i.fallback_adsense),fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(u)).then(function(e){return t(this,p),e.json()}.bind(this)).then(function(e){if(t(this,p),!e||!e.p)return a.msgrt.send("dp.na",{message:"atom"}),s();var n=e.p/100;s({id:Date.now(),floor_price:n,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:h?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(u):void 0,promo_imp_blue_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){t(this,p),a.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),s()}.bind(this)),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(0),a.msgrt.send("dp.err",{message:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0}),s();case 18:case"end":return e.stop()}}),e,this,[[0,14]])})));return function(e){return s.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t){if(e&&t)try{var n,r=new T(t.vastUrl,!0);if(null===(n=r.query)||void 0===n||!n.cust_params)return;var i=B.parse(r.query.cust_params);if(!i.tnl_asset_id)return;i.adsense=1,r.query.cust_params=B.stringify(i,!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:(y=e(r.mark((function e(n){var i,a,s,d,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._getPrebidScripts(),a=i[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,o(a,"gdsdk_prebid",{alternates:i,error_prefix:"Blocked:",exists:function(){return t(this,u),window.idhb.requestAds}.bind(this)});case 8:s=h("ch",window.location.href),d=h("ch_date",window.location.href),c={tnl_content_category:this.category.toLowerCase()},s&&(c.channel=s),d&&(c.ch_date=d),window.idhb.setAdserverTargeting(c),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var n=this;t(this,u);try{var r,i=e.slotId.split("@");i=1===i.length?i[0]:i[1],e.isEmpty?(null!==(r=this.atom_display)&&void 0!==r&&r.error_url&&(fetch(this.atom_display.error_url).catch(function(e){t(this,n)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_ERROR",{message:i,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){t(this,n)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:i,status:"success"}))}catch(e){}}.bind(this));case 16:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"_init_ima_script",value:(b=e(r.mark((function e(n){var i,a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=["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"],a=this.options.debug?i[0]:i[1],e.next=4,o(a,"gdsdk_ima",{alternates:i,error_prefix:"Blocked:",exists:function(){return t(this,s),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"_init_afg_script",value:(g=e(r.mark((function e(n){var i,a,s,d,c=this;return r.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(d={}).crossorigin="anonymous",d["data-ad-client"]=(null==n||null===(i=n.adsense_client)||void 0===i?void 0:i.length)>0?n.adsense_client:"ca-pub-2316275586951220",d["data-ad-frequency-hint"]="30s",d.allow="autoplay",(null==n||null===(a=n.adsense_channel)||void 0===a?void 0:a.length)>0&&(d["data-ad-channel"]=n.adsense_channel),(null==n||null===(s=n.adsense_host)||void 0===s?void 0:s.length)>0&&(d["data-ad-host"]=n.adsense_host),!0===(null==n?void 0:n.adsense_adbreak_test)&&(d["data-adbreak-test"]="on"),e.next=14,o("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return t(this,c),!!window.adsbygoogle}.bind(this),attrs:d});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 g.apply(this,arguments)})},{key:"clearSession",value:function(){this.requestRunning=!1}},{key:"_startAdsensePlacementRewardedAd",value:(v=e(r.mark((function e(n){var i,a,s,o,d,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log("gd:adp _startAdsensePlacementRewardedAd"),e.prev=2,!this.requestRunning){e.next=6;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 6:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),i=function(){t(this,u),console.log("gd:adp rw beforeAd"),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,u),console.log("gd:adp rw afterAd"),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(){t(this,u),console.log("gd:adp rw adDismmissed"),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),o=function(){t(this,u),console.log("gd:adp rw adViewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"}),this._send_atom_event("sg.ad.rw.viewed")}.bind(this),d=function(e){t(this,u),console.log("gd:adp rw beforeReward"),e()}.bind(this),c=function(e){t(this,u),console.log("gd:adp rw adBreakDone"),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===e.breakStatus?this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),"dismissed"!==e.breakStatus&&this._send_atom_event("sg.dbg.rw",e))}.bind(this),n={type:"reward",name:"reward-in-game",beforeAd:i,afterAd:a,adDismissed:s,adViewed:o,beforeReward:d,adBreakDone:c},window.adsbygoogle.push(n),console.log("gd:adp rw window.adsbygoogle.push(o). tm",window.adsbygoogle),e.next=22;break;case 18:throw e.prev=18,e.t0=e.catch(2),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}var n}),e,this,[[2,18]])}))),function(e){return v.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(m=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),i=function(e){t(this,a),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"}),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),n={type:"preroll",adBreakDone:i},window.adsbygoogle.push(n),e.next=16;break;case 12:throw e.prev=12,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 16:case"end":return e.stop()}var n}),e,this,[[1,12]])}))),function(e){return m.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(s=e(r.mark((function e(n){var i,a,s,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),i=function(){t(this,o),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,o),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(e){t(this,o),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),n={type:"start",name:"start-in-game",beforeAd:i,afterAd:a,adBreakDone:s},window.adsbygoogle.push(n),e.next=18;break;case 14:throw e.prev=14,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 18:case"end":return e.stop()}var n}),e,this,[[1,14]])}))),function(e){return s.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(i=e(r.mark((function e(n){var i,a,s,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),i=function(){t(this,o),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,o),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(e){t(this,o),this.resetForNext(),this.adCounter.midroll=this.adCounter.midroll||0,this.adCounter.midroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.mr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",e))}.bind(this),n={type:"next",name:"next-in-game",beforeAd:i,afterAd:a,adBreakDone:s},window.adsbygoogle.push(n),e.next=18;break;case 14:throw e.prev=14,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 18:case"end":return e.stop()}var n}),e,this,[[1,14]])}))),function(e){return i.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var n=this.msgrt,r=n._layout,i=n._ua,a={tp:e,ct:0,vrs:this.PackageJSON.version,url:this.parentURL,rfr:document.referrer,tdmn:this.topDomain||this.parentDomain,dpth:0,args:t,ua:{brnm:i.browser.name,brvs:i.browser.version,osnm:i.os.name,osvs:i.os.version,dvmd:i.device.model,w:r.w,h:r.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(N.encode(JSON.stringify(a)))))}catch(e){}}},{key:"_send_atom_event",value:function(e,t){this._send(e,{gid:this.gameData.slug,md5:this.gameData.gameId,pid:0,pnm:this.gameData.pname,ctry:this.gameData.ctry,lcl:"en",hle:1,ads:1,args:t,href:window.location.href})}},{key:"_isAfgPositionNext",value:function(e){return void 0!==e.adTimestamp}},{key:"_isAfgPositionStart",value:function(e){if(void 0!==e.adTimestamp)return!1;return this.adCounter.preroll=this.adCounter.preroll||0,0===this.adCounter.preroll}},{key:"attachAfgPosition",value:function(e){var t=e.params.position;switch(t){case"preroll":case"start":case"pause":case"next":case"browse":case"reward":return}var n=e.adType;if(n===c.Rewarded)t="reward";else if(n===c.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}}]),n}(),Nw=function t(n){var i=this;S(this,t),R(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wm(i.moduleName);case 2:i.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),R(this,"promo",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.module){e.next=3;break}return e.next=3,i.load();case 3:return e.abrupt("return",i.module[i.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var a=n.package||"gd-sdk-stone-dynamic",s=n.package_version||"1.1.1",o=n.template||"puzzle",d=n.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=o.charAt(0).toUpperCase()+o.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(a,"/").concat(s,"/dist/").concat(o.toLowerCase(),"/iife/index.js"),dependencies:d},ym(this.moduleName,this.moduleConfig)},qw=function t(n){var i=this;S(this,t),R(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wm(i.moduleName);case 2:i.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),R(this,"splash",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.module){e.next=3;break}return e.next=3,i.load();case 3:return e.abrupt("return",i.module[i.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var a=n.package||"gd-sdk-air-dynamic",s=n.package_version||"1.2.0",o=n.template||"pluto",d=n.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=o.charAt(0).toUpperCase()+o.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(a,"/").concat(s,"/dist/").concat(o.toLowerCase(),"/iife/index.js"),dependencies:d},ym(this.moduleName,this.moduleConfig)},Fw=function(e,t){console.log(e,t)},Vw={},Kw={},Ww=null;function Hw(){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 Vw.version=r,Vw.frame=e,Vw.function=n,Vw.version}function zw(e){var n=this;return Ww||(Ww=new Promise(function(r){function i(t,n){if(Fw("Received a response from CMP",t),n){var i,a;if(!1!==t.gdprApplies)return"tcloaded"===t.eventStatus||"useractioncomplete"===t.eventStatus?(("boolean"!=typeof(a=(i=t)&&"boolean"==typeof i.gdprApplies?i.gdprApplies:e.defaultGdprScope)||!0===a&&"string"!=typeof i.tcString)&&r({result:"cmpUnexpectedResponse",cmp:Vw,consentData:i}),void r({result:"ok",consentData:t})):void 0;r({result:"ok",consentData:t})}else r({result:"cmpCallFailed"})}t(this,n),Hw(),Vw.frame?2===Vw.version?(Fw("TCF v2 CMP found. Fetching the consent."),Vw.function?(Fw("CMP API is directly accessible, calling it now..."),Vw.function("addEventListener",Vw.version,i)):(Fw("CMP API is outside the current iframe, calling it now..."),function(e,n,r){var i=this,a="__tcfapi";function s(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!==Kw[r.callId]&&Kw[r.callId](r.returnValue,r.success)}}window[a]=function(e,r,s,o){t(this,i);var d=Math.random()+"",c="".concat(a,"Call"),u=R({},c,{command:e,parameter:o,callId:d,version:r});Kw[d]=s,n.postMessage(u,"*")}.bind(this),window.addEventListener("message",s,!1),window[a](e,Vw.version,r)}("addEventListener",Vw.frame,i))):r({result:"cmpVersionNotV2",cmp:Vw}):r({result:"cmpNotFound"})}.bind(this)),Ww)}var $w=new(function(){function t(){S(this,t),this.productName="Game Distribution"}var n;return U(t,[{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:(n=e(r.mark((function e(t,n){var i,a,s,o,d,c;return r.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===(i=t.visitor)||void 0===i?void 0:i.visitorId){e.next=6;break}return e.abrupt("return");case 6:return s=encodeURIComponent(this.productName),o=encodeURIComponent(a),e.prev=8,d="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(s,"/user_id/").concat(o),e.next=12,fetch(d,{method:"POST"});case 12:e.next=28;break;case 15:return e.prev=15,e.t0=e.catch(8),console.log("GAME_DOCK. fail v4",e.t0),e.prev=18,c="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(s,"/user_id/").concat(o),e.next=22,fetch(c,{method:"POST"});case 22:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(18),console.log("GAME_DOCK. fail v6",e.t1);case 28:case"end":return e.stop()}}),e,this,[[8,15],[18,25]])}))),function(e,t){return n.apply(this,arguments)})}]),t}());function Qw(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 Yw(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 Yw(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,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,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function Yw(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 Jw=function(e){var n=this,r=e.src,i=e.attributes,a=e.target,s=e.isAsync;return new Promise(function(e,o){var d=this;t(this,n);try{var c=document.createElement("script");if(c.async=null==s||s,c.type="text/javascript",c.onload=function(){t(this,d),e()}.bind(this),c.onerror=function(){t(this,d);var e="Error on script load, Error: ".concat(r);console.log(e),o(e)}.bind(this),c.src=r,i){var u,l=Qw(i);try{for(l.s();!(u=l.n()).done;){var h=u.value,p=h.key,f=h.value;c.setAttribute(p,f)}}catch(e){l.e(e)}finally{l.f()}}a||(a=document.head),a.appendChild(c)}catch(e){var m="Error on script load catch, Error: ".concat(r);console.log(m,e),o(m)}}.bind(this))},Xw=function(){var t=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Jw({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,Jw({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,Jw({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,i=void 0,n=(t={inlineScript:"function OptanonWrapper() { }"}).inlineScript,r=t.target,(i=document.createElement("script")).text=n,r||(r=document.head),r.appendChild(i),console.log("GD: CMP cookie pro loaded successfully."),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),console.log("GD: CMP error on load",e.t0);case 14:case"end":return e.stop()}var t,n,r,i}),e,null,[[0,11]])})));return function(){return t.apply(this,arguments)}}(),Zw=new q,eA={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};function tA(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 n=this,r=e.data,i=e.origin,a=r.type;if(Object.keys(eA).some(function(e){return t(this,n),e===i}.bind(this))&&(null==r||!r.__tcfapiCall)&&(window.parent&&!r.type.startsWith("gd-sdk")&&(window.parent.postMessage(r,"*"),console.log("GD-SDK:pst fw sg event to parent complete",window.parent.location.href,r)),a)){var s=eA[i][a];s&&Zw.emit(s,r)}}),!1);var nA=F(),rA=function(e){var n=this;if(!window.__msgr){var r=document.createElement("iframe");if(r.src="https://static.gamedistribution.com/message/index.html",r.style.display="none",r.name="__msgr",document.body.appendChild(r),window!==window.top){var i={gameId:e.gameId,target:e.evnts.domain,token:nA,event_name:"TokenGenerated",timestamp:Date.now()};r.onload=function(){sA(i)},setInterval(function(){t(this,n),i.timestamp=Date.now(),i.event_name="Heartbeat",sA(i)}.bind(this),1e3*e.evnts.heartbeatDuration)}}window.addEventListener("message",function(e){t(this,n);try{var r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tA(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.data);if(!r.event_name)return;r.token=nA,sA(r)}catch(e){console.error("GD Messager Error",e.message)}}.bind(this),!1)},iA=function(e){try{var t={gameId:e.game.gameId,target:e.game.evnts.domain,event_name:e.event,timestamp:Date.now()},n=aA(window);n!==window.top&&(null==n||n.postMessage(t,"https://html5.gamedistribution.com"))}catch(e){}},aA=function e(t){try{var n,r,i=null==t?void 0:t.parent;if("game"===(null===(n=i.document)||void 0===n||null===(r=n.activeElement)||void 0===r?void 0:r.id))return i;e(i)}catch(e){return t}},sA=function(e){window.__msgr.postMessage(e,"https://static.gamedistribution.com")};function oA(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?oA(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var cA,uA=null,lA=null,hA=function(){function n(e){var r=this;if(S(this,n),uA)return uA;uA=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,e),this._version=e.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new Pb,this._location.print(),this._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){t(this,r),this._sdk_ready=!0}.bind(this)).catch(function(e){t(this,r),this._sdk_ready=!1}.bind(this)).finally(function(){var e,n;t(this,r),!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!==(n=this._gameData.evnts)&&void 0!==n&&n.enabled&&this._isLoaderGameURL()&&rA(this._gameData)}.bind(this)),this._registerSGBridge()}var i,u,l,h,f,R,I,P,O,C,M;return U(n,[{key:"_initUnityHandler",value:function(){var e=this;window.addEventListener("DOMNodeInserted",function(){if(t(this,e),this._gameData.block_exts&&this._removeExternalsInHtml({enabled:!1}),document.getElementsByClassName("webgl-content")[0]){var n=document.getElementsByClassName("webgl-content")[0].getElementsByClassName("footer")[0];n&&n.setAttribute("style","display:none")}}.bind(this))}},{key:"_loadCMP",value:(M=e(r.mark((function e(){var t,n,i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=8;break}if(i=new Pb,a=i.get("depth"),console.log("CMP location.depth",a),0!==(null==a?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=8;break}return e.next=7,Xw();case 7:console.log("CMP loaded");case 8:case"end":return e.stop()}}),e,this)}))),function(){return M.apply(this,arguments)})},{key:"testConsent",value:function(){console.log("test-consent. Finding CMP");try{var t=Hw();console.log("CMP found",t),e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,zw({});case 2:t=e.sent,console.log("After lookup IAB consent",t);case 4: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;Zw.on("splash-hidden",function(n){t(this,e),console.log("GD-SDK:pst on splash-hidden",n),this._hideCMPButton()}.bind(this))}},{key:"_hideCMPButton",value:function(){console.log(":pst hide cmp button");var e=document.getElementById("ot-sdk-btn-floating");e&&(e.style.display="none")}},{key:"isLoaded",value:function(){if(void 0===this._isLoaded){var e=this._isTokenGameURL(),t=this._isExtHostedGameURL(),n=this._isMasterGameURL();this._isLoaded=(e||t&&!n)&&this._gameData.loader.enabled}return this._isLoaded}},{key:"setIsLoaded",value:function(e){this._isLoaded=e}},{key:"_sendLoadedEvent",value:function(){if(!this.isLoaded()){this.setIsLoaded(!0);try{this._sendTunnlEvent(1),this.msgrt.send("loaded",{message:this._hasBlocker?"Has Blocker":"No Blocker"})}catch(e){}}}},{key:"_sendGamedockGamePlay",value:function(){var e=this._isTokenGameURL();if(console.log("in gamedock gameplay",this._gameData.loader.enabled,e),!(this._gameData.loader.enabled&&e||this._gameDockGamePlaySent))try{this._sendGamedockEvent("gameplay"),console.log("gamedock 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:(C=e(r.mark((function e(n,i){var a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this._gameData=this._getGameData(),e.next=4,this._loadCMP();case 4:this._bridge.isCoreSDKMode=!(!0===this._gameData.enableAds||!0===(null===(a=this._gameData.enableAds)||void 0===a?void 0:a.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 t(this,s),console.error(e.message||e)}.bind(this))),n(this._gameData),e.next=19;break;case 14:e.prev=14,e.t0=e.catch(0),this._sendSDKError(e.t0),this.onResumeGame(e.t0.message,"warning"),i(e.t0);case 19:case"end":return e.stop()}}),e,this,[[0,14]])}))),function(e,t){return C.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(e);this.options=t?a(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=Ob.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 n=this;void 0===this._topDomain&&(this._topDomain=void 0);var r={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(B.stringify(r))).catch(function(e){t(this,n)}.bind(this))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=m("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,s("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!d.available)return;"developer.gamedistribution.com"===this._parentDomain?(d.set("gd_debug_ex",!0),d.set("gd_disable_midroll_timer",!0),d.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(d.set("gd_debug_ex",!0),d.set("gd_disable_midroll_timer",!0)),d.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 v({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:g(),version:Ob.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:b(),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 n=["https://cdn.gamedock.io/gamedock-web-tracker/4.4.0/script/gamedock-sdk.min.js"];o(n[0],"GamedockSDK",{alternates:n}).then(function(){var n,r;t(this,e),lA=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(r=n.gameDock)&&void 0!==r&&r.adViewEvent&&lA.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),$w.track(lA,this._gameData)}.bind(this)).catch(function(n){t(this,e),this._sendSDKError(n)}.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=lA)||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 n=["https://ext.minijuegosgratis.com/external-host/main.js"];o(n[0],"MinijuegosSDK",{alternates:n}).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,n=["https://www.google-analytics.com/analytics.js"];o(n[0],"gdsdk_google_analytics",{alternates:n,error_prefix:"Blocked:",exists:function(){return t(this,e),window.ga}.bind(this)}).then(function(){t(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(n){t(this,e),this._sendSDKError(n)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new p,y.forEach(function(n){var r=this;return t(this,e),this.eventBus.subscribe(n,function(e){return t(this,r),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),_.forEach(function(n){var r=this;return t(this,e),this.eventBus.subscribe(n,function(e){return t(this,r),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(t(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 n=JSON.stringify({type:"GD_SDK_IMPLEMENTED",gameID:this.options.gameId});window.location!==window.top.location?window.top.postMessage(n,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(n,"*")}catch(e){}}}.bind(this),"ima"),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){return t(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(n){var r,i;t(this,e),this.msgrt.send("ad.impression"),null!==(r=this._gameData.diagnostic)&&void 0!==r&&null!==(i=r.gameDock)&&void 0!==i&&i.adViewEvent&&$w.track(lA,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(n){t(this,e),this.msgrt.send("ad.error",{message:n.message,details:n.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(n){t(this,e),this._sendAdRequestContext(n.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(n){t(this,e),n.message.startsWith("Blocked:")?this._bridge.noBlockerEvent||(this.msgrt.send("error",{message:n.message}),this._hasBlocker||(this._hasBlocker=!0,this._sendTunnlEvent(3))):this.msgrt.send("error",{message:n.message})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_EMPTY",function(n){t(this,e),this.msgrt.send("tunnl.keys.empty",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_FALLBACK",function(n){t(this,e),this.msgrt.send("tunnl.keys.fallback",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_T4R",function(n){return t(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(Ob.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(O=e(r.mark((function e(){var n,i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this._gameData,n=void 0===this._gameData.dmain||this._gameData.dmain,(i.bloc_gard&&!0===i.bloc_gard.enabled||!n)&&(this.msgrt.send("blocked"),setTimeout(function(){t(this,a),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(B.stringify({domain:this._parentDomain,id:i.gameId,img:this._get_game_thumbnail_url(),title:i.title}))}.bind(this),100));case 5:case"end":return e.stop()}}),e,this)}))),function(){return O.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(){t(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;d.available&&d.getBoolean("gd_debug_ex")&&(d.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,i=this._gameData,a=i.gdpr&&!0===i.gdpr.consent,s=i.loader,o=null===(e=i.promo)||void 0===e?void 0:e[null===(t=i.promo)||void 0===t||null===(n=t.template)||void 0===n?void 0:n.preroll];(i.preroll||(this.adRequestTimer=Date.now()),this.options.loader.enabled)?null!=o&&o.enabled?this._createPromoBeforeSplash(i,a):s.enabled&&!0!==(null===(r=s.splash)||void 0===r?void 0:r.skip)?this._createSplash(i,a):this.onResumeGame("Skipped splash.","success"):s.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||a?null!=o&&o.enabled?this._createPromoBeforeSplash(i,a):!1!==s.enabled&&this._createSplash(i,a):null!=o&&o.enabled&&this._createPromo(i,a))}},{key:"_initializeVideoAd",value:(P=e(r.mark((function e(){var t;return r.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(this.options.advertisementSettings,t.sdk)),this.macros=new w({game:t,bridge:this._bridge}),this.adInstance=new Gw(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=Ob,this.adInstance._send("gd.location",this._location.get()),e.next=17,this.adInstance.start();case 17:case"end":return e.stop()}}),e,this)}))),function(){return P.apply(this,arguments)})},{key:"_sendSDKReady",value:function(){var e="Everything is ready.";this.eventBus.broadcast("SDK_READY",{message:e,status:"success"});try{this.options.onInit(e)}catch(e){s("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){s("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){s(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status})}catch(e){s("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:function(){var e=cy();return this._bridge.noPreroll=(!this._getisMobile()||!1!==e.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(e),A(e.diagnostic),e}},{key:"_createSplash",value:(I=e(r.mark((function e(n,i){var a,s,o,d,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(n);case 2:a=e.sent,s=new a(dA(dA({},this.options),{},{isConsentDomain:i,version:Ob.version}),n,this._parentDomain),o=hy(),d=o.enabled,s.on("playClick",function(){var e=this;if(t(this,u),i){var n=new Date;n.setDate(n.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(n.toUTCString(),"; path=/")}this._hideCMPButton(),d?window.gdsdk.showAd(c.Interstitial,{position:"preroll"}).catch(function(n){t(this,e),console.log("extsc: splash error",n),s.hide()}.bind(this)):this.showAd(c.Interstitial,{position:"preroll"}).catch(function(n){t(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(){t(this,u),s.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){t(this,u),s.hide()}.bind(this));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(R=e(r.mark((function e(n,i){var a,s,o,d,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(n);case 3:o=e.sent,(d=new o(dA(dA({},this.options),{},{isConsentDomain:i,version:Ob.version,template:null===(a=n.promo)||void 0===a||null===(s=a.template)||void 0===s?void 0:s.preroll}),n)).on("done",function(){t(this,c),d.hide(),this._createSplash(n,i)}.bind(this)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),this._createSplash(n,i);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t){return R.apply(this,arguments)})},{key:"_createPromo",value:(f=e(r.mark((function e(n,i){var a,s,o,d,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(n);case 3:o=e.sent,(d=new o(dA(dA({},this.options),{},{isConsentDomain:i,version:Ob.version,template:null===(a=n.promo)||void 0===a||null===(s=a.template)||void 0===s?void 0:s.preroll}),n)).on("done",function(){t(this,c),d.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 f.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(c.Interstitial).catch(function(){t(this,e)}.bind(this))}},{key:"showAd",value:(h=e(r.mark((function n(i){var a,s=this,o=arguments;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=o.length>1&&void 0!==o[1]?o[1]:{},console.log("gd:adp, showAd izMaster,izToken",this._isMasterGameURL(),this._isTokenGameURL()),n.abrupt("return",new Promise(function(){var n=e(r.mark((function e(n,o){var d,c,u,l,h,p,f,m,v,g,b,y=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p={adType:i,params:a,adTimestamp:s.adRequestTimer},e.next=4,s.sdkReady;case 4:return f=e.sent,e.next=7,s.videoAdReady;case 7:return null!==(d=s._gameData.lp)&&void 0!==d&&d.load||s._sendLoadedEvent(),s._sendGamedockGamePlay(),s._rejectAdIfGameBlocked({gameData:f,adRequest:p}),s._rejectAdIfAdDisabled({gameData:f,adRequest:p}),s._rejectAdIfUnsupportedType({adRequest:p}),s._rejectAdIfRewardedDisabled({gameData:f,adRequest:p}),(null===(c=f.gft)||void 0===c||!c.enabled||null!==(u=f.gft)&&void 0!==u&&u.enabled&&(null==f||null===(l=f.gft)||void 0===l||null===(h=l.durations[s._giftCount])||void 0===h?void 0:h.after)!==s.adInstance.adMidrollCount)&&s._rejectAdIfAdRateHits({gameData:f,adRequest:p}),s.adInstance.attachAfgPosition(p),s._attachAfgFallback({gameData:f,adRequest:p}),m="main.showad",v=function(e){var n,r,i;t(this,y),s.eventBus.unsubscribeScope(m),s.onResumeGame(e.message,"warning"),null!=f&&null!==(n=f.gft)&&void 0!==n&&n.enabled&&(null==f||null===(r=f.gft)||void 0===r||null===(i=r.durations[s._giftCount])||void 0===i?void 0:i.after)===s.adInstance.adMidrollCount&&s.decideToGiveAGift(),o(e.message)}.bind(this),g=function(e){var r,i,a;t(this,y),s.eventBus.unsubscribeScope(m),s.adRequestTimer=Date.now(),s.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),null!=f&&null!==(r=f.gft)&&void 0!==r&&r.enabled&&(null==f||null===(i=f.gft)||void 0===i||null===(a=i.durations[s._giftCount])||void 0===a?void 0:a.after)===s.adInstance.adMidrollCount&&s.decideToGiveAGift(),n(e.message)}.bind(this),b=function(e){var r=this;t(this,y),s.eventBus.unsubscribeScope(m),a.fallback_adsense=!1,s.showAd(i,dA(dA({},a),{},{adapter:"adsense"})).then(function(e){t(this,r),n(e)}.bind(this)).catch(function(e){t(this,r),o(e)}.bind(this))}.bind(this),s.eventBus.subscribe("AD_ERROR",null!=a&&a.fallback_adsense?b:v,m),s.eventBus.subscribe("AD_SDK_CANCELED",null!=a&&a.fallback_adsense?b:v,m),s.eventBus.subscribe("AD_SUCCESS",g,m),e.next=25,s.adInstance.startAd(p);case 25:s._post_message({topic:"adrequest.instream"}),e.next=32;break;case 28:e.prev=28,e.t0=e.catch(0),s.onResumeGame(e.t0.message,"warning"),o(e.t0.message);case 32:case"end":return e.stop()}}),e,this,[[0,28]])})));return function(e,t){return n.apply(this,arguments)}}()));case 3:case"end":return n.stop()}}),n,this)}))),function(e){return h.apply(this,arguments)})},{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!==c.Interstitial&&t.adType!==c.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=c.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===c.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"_rejectAdIfAdRateHits",value:function(e){var t,n,r,i,a,s,o=e.gameData,d=e.adRequest,u=null;d.adType===c.Interstitial&&null!==(t=o.diagnostic)&&void 0!==t&&null!==(n=t.useMidrollIndex)&&void 0!==n&&n.enabled&&this.adInstance.noPreroll?this.adInstance.adMidrollCount>(null===(r=o.diagnostic)||void 0===r||null===(i=r.useMidrollIndex)||void 0===i?void 0:i.indexes.length)-1||(u=6e4*(null===(a=o.diagnostic)||void 0===a||null===(s=a.useMidrollIndex)||void 0===s?void 0:s.indexes[this.adInstance.adMidrollCount])):u=o.midroll;if(d.adType===c.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<u)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(l=e(r.mark((function t(n){var i=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,a){var s,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.sdkReady;case 3:return s=e.sent,e.next=6,i.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&&!i._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(n){e.next=14;break}n=c.Rewarded,e.next=16;break;case 14:if(n===c.Interstitial||n===c.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+n);case 16:if(n!==c.Rewarded||s.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,i.adInstance.preloadAd(n);case 20:o=e.sent,t(o),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),a(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(e){return l.apply(this,arguments)})},{key:"cancelAd",value:(u=e(r.mark((function t(){var n=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,i){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{n.adInstance.cancel(),n.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),i()}catch(e){n.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),t(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(){return u.apply(this,arguments)})},{key:"showDisplayAd",value:function(t){var n=this;return new Promise(function(){var i=e(r.mark((function e(i,a){var s;return r.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.dAds.enabled){e.next=13;break}return e.next=9,n.adInstance.loadDisplayAd(t);case 9:n._post_message({topic:"adrequest.display"}),i(),e.next=14;break;case 13:a("Display-Ads are disabled.");case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(0),a(e.t0.message||e.t0);case 19:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(e,t){return i.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){var n;this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){s("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()||iA({event:"GameStarted",game:this._gameData})}},{key:"onPauseGame",value:function(e,t){var n;this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){s("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()||iA({event:"GamePaused",game:this._gameData})}},{key:"openConsole",value:function(){try{new k(this).start(),d.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 n=this._gameData;n.sdk.fullscreen&&"auto"===n.sdk.fullscreen&&document.addEventListener("click",function(){if(t(this,e),!this._isFullScreen){var n=document.body,r=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullscreen;if(r)r.call(n);else if(void 0!==window.ActiveXObject){var i=new ActiveXObject("WScript.Shell");null!==i&&i.SendKeys("{F11}")}this._isFullScreen=!0}}.bind(this))}catch(e){console.log("Fullscreen error handled...",e)}}},{key:"_allowExternals",value:function(e){var n=this;void 0!==this.window_open&&(!1===e.enabled?window.open=function(e){t(this,n),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 n=this;!1===e.enabled&&window.document.querySelectorAll("a").forEach(function(e){var r=this;t(this,n);var i=!!(e.innerText.toLowerCase().includes("start")||e.innerText.toLowerCase().includes("play")||e.innerText.toLowerCase().includes("continue")),a=e.getAttribute("href");e.removeAttribute("href"),i||(e.onclick=function(e){return t(this,r),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:E()),a=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:x()),s=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===g()?a:D()),o=(e||n)&&r.loaderEnabled,d=(e||n)&&r.loaderEnabled,c=(e||n)&&r.loaderEnabled,u=(e||n)&&r.loaderEnabled,l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:o,noLoadedEvent:d,noBlockerEvent:c,noPreroll:f,parentURL:i,parentDomain:a,topDomain:s&&s.length?s:a,noGAPageView:u,noLotamePageView:l,noGamedockSDK:h,noMinijuegosSDK:p,version:r.version,pauseGameOnStartup:m,depth:g(),domainMatched:a===s,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 T(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 T(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var i=new T(location.href,!0);if(!i.query.gd_zone_config)return;e=i.query.gd_zone_config}return JSON.parse(N.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new qw(t).splash()}},{key:"_createPrerollPromoTemplate",value:(i=e(r.mark((function e(t){var n,i,a,s,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=null===(n=t.promo)||void 0===n?void 0:n[null===(i=t.promo)||void 0===i||null===(a=i.template)||void 0===a?void 0:a.preroll],o=new Nw(s),e.abrupt("return",o.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(N.encode(JSON.stringify(e)))}catch(e){}try{var n=new T(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(B.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new T(e,!0);return n.query=dA(dA({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return N.encode(JSON.stringify(e))}},{key:"session",value:function(){var t=this;return new Promise(function(){var n=e(r.mark((function e(n,i){var a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.sdkReady;case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:a=t._gameData,n({ads:{display:{enabled:a.dAds.enabled},rewarded:{enabled:a.rewardedAds}},location:{parentDomain:t._bridge.parentDomain,topDomain:t._bridge.topDomain,parentURL:t._bridge.parentURL,depth:t._bridge.depth,loadedByGameZone:t._bridge.isTokenGameURL}});case 9:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"_getisMobile",value:function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),!1===t&&window.orientation>-1&&(t=!0),t}},{key:"_get_game_thumbnail_url",value:function(){var e=this,n=this._gameData,r=n.assets.find(function(n){return t(this,e),n.hasOwnProperty("name")&&512===n.width&&512===n.height}.bind(this));return r||(r=n.assets.length>0?n.assets[0]:{name:"logo.svg"}),"https://img.gamedistribution.com/".concat(r.name)}},{key:"_post_message",value:function(e){var t,n=e.topic,r=e.data,i=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var a=window.top||window.parent;a&&a.postMessage({source:"gdsdk",topic:n,data:r},i)}catch(e){console.error((null==e?void 0:e.message)||e)}}},{key:"decideToGiveAGift",value:function(){var n=this;try{var i,a=null===(i=this._gameData)||void 0===i?void 0:i.gft,s=setInterval(e(r.mark((function e(){var i=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.adInstance.requestRunning?console.log("Advertisement already running..."):(n.showAd(c.Interstitial,{position:"midroll"}).catch(function(e){t(this,i)}.bind(this)),clearInterval(s),n._giftCount++);case 1:case"end":return e.stop()}}),e,this)}))),1e3*a.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}}]),n}(),pA={},fA=function(e){try{if(pA.source){var t={type:"gd-sdk-on-event",event:e};pA.source.postMessage(t,pA.origin)}}catch(e){console.log("gd-sdk forwardEvent err",e)}},mA=function(){fA({name:"SDK_READY",status:"success",message:"Everything is ready."}),fA({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),fA({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},vA=function(t){console.log("gd:adp registerForForwarderPosts");window.addEventListener("message",(function(n){var i=n.data,a=n.origin,s=n.source,o=i.type,d=i.method,c=i.options;if("gd-sdk-self"===o){var u={type:"gd-sdk",method:d,options:c};return window.postMessage(u,"https://html5.gamedistribution.com"),void console.log("gd:adp after self post")}if("gd-sdk"===o){if(!pA.source&&"init"===d)return function(e){var t=e.source,n=e.origin;pA={source:t,origin:n}}({source:s,origin:a}),void mA();var l=t[d];l&&e(r.mark((function e(){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!(n=l.apply(t,Object.values(c)))||!n.then){e.next=5;break}return e.next=5,n;case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log("gd:adp:m:r onFrameMessage error",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))()}}),!1)},gA=function(e){!function(e){var t=e.onEvent;e.onEvent=function(e){fA(e),t.apply(this,arguments)}}(e);var t=new hA(e);return vA(t),t},bA={create:function(){var t=e(r.mark((function e(t){var n,i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,_y(t);case 3:return n=e.sent,i=n?gy(t):gA(t),py(),e.abrupt("return",i);case 9:return e.prev=9,e.t0=e.catch(0),console.log("gd:adp: sdk adaptor create failed, fallback to default adapter",e.t0),e.abrupt("return",gA(t));case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(e){return t.apply(this,arguments)}}()};function yA(){return(yA=e(r.mark((function e(t,n){var i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,vy();case 2:if(i=e.sent,console.log("extsc: should wrapper be called?",i),!i){e.next=8;break}e.t0=window.gdsdk,e.next=11;break;case 8:return e.next=10,wA(t);case 10:e.t0=e.sent;case 11:return a=e.t0,e.abrupt("return",n(a));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _A=!1;function wA(e){var n=this;return new Promise(function(r,i){var a=this;if(t(this,n),cA)return r(cA);if(_A)var s=setInterval(function(){t(this,a),cA&&(_A=!1,clearInterval(s),r(cA))}.bind(this),100);else _A=!0,bA.create(e).then(function(e){t(this,a),console.log("sdk created!"),cA=e,e._sendSDKReady(),_A=!1,r(cA)}.bind(this))}.bind(this))}var AA,kA=(wA(AA=function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":n(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===n(window.gdApi.q[0][0])&&window.gdApi.q[0][0]&&((e=window.gdApi.q[0][0]).hasOwnProperty("advertisementSettings")||(e.advertisementSettings={autoplay:!0}))}catch(e){console.log("_get_developer_sets failed",e)}return e}()),{invoke:function(e){return function(e,t){return yA.apply(this,arguments)}(AA,e)}});function EA(){var n=this;this.AdType=c,this.preloadAd=function(e){var n=this;return kA.invoke(function(r){return t(this,n),r.preloadAd(e)}.bind(this))},this.showAd=function(){var n=e(r.mark((function e(n,i){var a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",kA.invoke(function(e){return t(this,a),n===c.Display?e.showDisplayAd(i):e.showAd(n)}.bind(this)));case 1:case"end":return e.stop()}}),e,this)})));return function(e,t){return n.apply(this,arguments)}}(),this.cancelAd=function(){var e=this;return kA.invoke(function(n){return t(this,e),n.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return kA.invoke(function(n){return t(this,e),n.openConsole()}.bind(this))},this.getSession=function(){var e=this;return kA.invoke(function(n){return t(this,e),n.session()}.bind(this))},this.leaderboard={show:function(){t(this,n),Am.showLeaderboard()}.bind(this),addScore:function(e){t(this,n),Am.addScore(e)}.bind(this)}}EA.prototype=new function(){this.showBanner=function(){var e=this;return kA.invoke(function(n){return t(this,e),n.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new EA,window.gdApi=window.gdsdk;
1
+ import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/newArrowCheck";import n from"@babel/runtime/helpers/typeof";import r from"@babel/runtime/regenerator";import{parseJSON as i,extendDefaults as a,dankLog as s,getScript as o,Ls as d,AdType as c,Layers as u,getKeyByValue as l,getQueryString as h,EventBus as p,getIMASampleTags as f,getQueryParams as m,MessageRouter as v,getIframeDepth as g,getMobilePlatform as b,SDKEvents as y,IMAEvents as _,Macros as w,setDankLog as A,ImplementationTest as k,getParentUrl as E,getParentDomain as x,getTopDomain as S}from"@bygd/gd-sdk-era/dist/default";import D from"@babel/runtime/helpers/createClass";import T from"@babel/runtime/helpers/classCallCheck";import R from"@babel/runtime/helpers/defineProperty";import I from"url-parse";import O from"validator";import C from"is-valid-domain";import P from"get-value";import L from"set-value";import M from"lodash.clonedeep";import U from"can-autoplay";import{isPlainObject as j}from"is-plain-object";import B from"querystringify";import G from"lodash.merge";import{Base64 as N}from"js-base64";import{EventEmitter as q}from"events";import{v4 as F}from"uuid";var V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},K=function(e){return e&&e.Math==Math&&e},W=K("object"==typeof globalThis&&globalThis)||K("object"==typeof window&&window)||K("object"==typeof self&&self)||K("object"==typeof V&&V)||function(){return this}()||Function("return this")(),z={},H=function(e){try{return!!e()}catch(e){return!0}},$=!H((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Q=!H((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),Y=Q,J=Function.prototype.call,X=Y?J.bind(J):function(){return J.apply(J,arguments)},Z={},ee={}.propertyIsEnumerable,te=Object.getOwnPropertyDescriptor,ne=te&&!ee.call({1:2},1);Z.f=ne?function(e){var t=te(this,e);return!!t&&t.enumerable}:ee;var re,ie,ae=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},se=Q,oe=Function.prototype,de=oe.bind,ce=oe.call,ue=se&&de.bind(ce,ce),le=se?function(e){return e&&ue(e)}:function(e){return e&&function(){return ce.apply(e,arguments)}},he=le,pe=he({}.toString),fe=he("".slice),me=function(e){return fe(pe(e),8,-1)},ve=le,ge=H,be=me,ye=W.Object,_e=ve("".split),we=ge((function(){return!ye("z").propertyIsEnumerable(0)}))?function(e){return"String"==be(e)?_e(e,""):ye(e)}:ye,Ae=W.TypeError,ke=function(e){if(null==e)throw Ae("Can't call method on "+e);return e},Ee=we,xe=ke,Se=function(e){return Ee(xe(e))},De=function(e){return"function"==typeof e},Te=De,Re=function(e){return"object"==typeof e?null!==e:Te(e)},Ie=W,Oe=De,Ce=function(e){return Oe(e)?e:void 0},Pe=function(e,t){return arguments.length<2?Ce(Ie[e]):Ie[e]&&Ie[e][t]},Le=le({}.isPrototypeOf),Me=Pe("navigator","userAgent")||"",Ue=W,je=Me,Be=Ue.process,Ge=Ue.Deno,Ne=Be&&Be.versions||Ge&&Ge.version,qe=Ne&&Ne.v8;qe&&(ie=(re=qe.split("."))[0]>0&&re[0]<4?1:+(re[0]+re[1])),!ie&&je&&(!(re=je.match(/Edge\/(\d+)/))||re[1]>=74)&&(re=je.match(/Chrome\/(\d+)/))&&(ie=+re[1]);var Fe=ie,Ve=Fe,Ke=H,We=!!Object.getOwnPropertySymbols&&!Ke((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ve&&Ve<41})),ze=We&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,He=Pe,$e=De,Qe=Le,Ye=ze,Je=W.Object,Xe=Ye?function(e){return"symbol"==typeof e}:function(e){var t=He("Symbol");return $e(t)&&Qe(t.prototype,Je(e))},Ze=W.String,et=function(e){try{return Ze(e)}catch(e){return"Object"}},tt=De,nt=et,rt=W.TypeError,it=function(e){if(tt(e))return e;throw rt(nt(e)+" is not a function")},at=it,st=function(e,t){var n=e[t];return null==n?void 0:at(n)},ot=X,dt=De,ct=Re,ut=W.TypeError,lt={exports:{}},ht=W,pt=Object.defineProperty,ft=function(e,t){try{pt(ht,e,{value:t,configurable:!0,writable:!0})}catch(n){ht[e]=t}return t},mt=ft,vt=W["__core-js_shared__"]||mt("__core-js_shared__",{}),gt=vt;(lt.exports=function(e,t){return gt[e]||(gt[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.21.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE",source:"https://github.com/zloirock/core-js"});var bt=ke,yt=W.Object,_t=function(e){return yt(bt(e))},wt=_t,At=le({}.hasOwnProperty),kt=Object.hasOwn||function(e,t){return At(wt(e),t)},Et=le,xt=0,St=Math.random(),Dt=Et(1..toString),Tt=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Dt(++xt+St,36)},Rt=W,It=lt.exports,Ot=kt,Ct=Tt,Pt=We,Lt=ze,Mt=It("wks"),Ut=Rt.Symbol,jt=Ut&&Ut.for,Bt=Lt?Ut:Ut&&Ut.withoutSetter||Ct,Gt=function(e){if(!Ot(Mt,e)||!Pt&&"string"!=typeof Mt[e]){var t="Symbol."+e;Pt&&Ot(Ut,e)?Mt[e]=Ut[e]:Mt[e]=Lt&&jt?jt(t):Bt(t)}return Mt[e]},Nt=X,qt=Re,Ft=Xe,Vt=st,Kt=function(e,t){var n,r;if("string"===t&&dt(n=e.toString)&&!ct(r=ot(n,e)))return r;if(dt(n=e.valueOf)&&!ct(r=ot(n,e)))return r;if("string"!==t&&dt(n=e.toString)&&!ct(r=ot(n,e)))return r;throw ut("Can't convert object to primitive value")},Wt=Gt,zt=W.TypeError,Ht=Wt("toPrimitive"),$t=function(e,t){if(!qt(e)||Ft(e))return e;var n,r=Vt(e,Ht);if(r){if(void 0===t&&(t="default"),n=Nt(r,e,t),!qt(n)||Ft(n))return n;throw zt("Can't convert object to primitive value")}return void 0===t&&(t="number"),Kt(e,t)},Qt=Xe,Yt=function(e){var t=$t(e,"string");return Qt(t)?t:t+""},Jt=Re,Xt=W.document,Zt=Jt(Xt)&&Jt(Xt.createElement),en=function(e){return Zt?Xt.createElement(e):{}},tn=en,nn=!$&&!H((function(){return 7!=Object.defineProperty(tn("div"),"a",{get:function(){return 7}}).a})),rn=$,an=X,sn=Z,on=ae,dn=Se,cn=Yt,un=kt,ln=nn,hn=Object.getOwnPropertyDescriptor;z.f=rn?hn:function(e,t){if(e=dn(e),t=cn(t),ln)try{return hn(e,t)}catch(e){}if(un(e,t))return on(!an(sn.f,e,t),e[t])};var pn={},fn=$&&H((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),mn=W,vn=Re,gn=mn.String,bn=mn.TypeError,yn=function(e){if(vn(e))return e;throw bn(gn(e)+" is not an object")},_n=$,wn=nn,An=fn,kn=yn,En=Yt,xn=W.TypeError,Sn=Object.defineProperty,Dn=Object.getOwnPropertyDescriptor;pn.f=_n?An?function(e,t,n){if(kn(e),t=En(t),kn(n),"function"==typeof e&&"prototype"===t&&"value"in n&&"writable"in n&&!n.writable){var r=Dn(e,t);r&&r.writable&&(e[t]=n.value,n={configurable:"configurable"in n?n.configurable:r.configurable,enumerable:"enumerable"in n?n.enumerable:r.enumerable,writable:!1})}return Sn(e,t,n)}:Sn:function(e,t,n){if(kn(e),t=En(t),kn(n),wn)try{return Sn(e,t,n)}catch(e){}if("get"in n||"set"in n)throw xn("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Tn=pn,Rn=ae,In=$?function(e,t,n){return Tn.f(e,t,Rn(1,n))}:function(e,t,n){return e[t]=n,e},On={exports:{}},Cn=De,Pn=vt,Ln=le(Function.toString);Cn(Pn.inspectSource)||(Pn.inspectSource=function(e){return Ln(e)});var Mn,Un,jn,Bn=Pn.inspectSource,Gn=De,Nn=Bn,qn=W.WeakMap,Fn=Gn(qn)&&/native code/.test(Nn(qn)),Vn=lt.exports,Kn=Tt,Wn=Vn("keys"),zn=function(e){return Wn[e]||(Wn[e]=Kn(e))},Hn={},$n=Fn,Qn=W,Yn=le,Jn=Re,Xn=In,Zn=kt,er=vt,tr=zn,nr=Hn,rr=Qn.TypeError,ir=Qn.WeakMap;if($n||er.state){var ar=er.state||(er.state=new ir),sr=Yn(ar.get),or=Yn(ar.has),dr=Yn(ar.set);Mn=function(e,t){if(or(ar,e))throw new rr("Object already initialized");return t.facade=e,dr(ar,e,t),t},Un=function(e){return sr(ar,e)||{}},jn=function(e){return or(ar,e)}}else{var cr=tr("state");nr[cr]=!0,Mn=function(e,t){if(Zn(e,cr))throw new rr("Object already initialized");return t.facade=e,Xn(e,cr,t),t},Un=function(e){return Zn(e,cr)?e[cr]:{}},jn=function(e){return Zn(e,cr)}}var ur={set:Mn,get:Un,has:jn,enforce:function(e){return jn(e)?Un(e):Mn(e,{})},getterFor:function(e){return function(t){var n;if(!Jn(t)||(n=Un(t)).type!==e)throw rr("Incompatible receiver, "+e+" required");return n}}},lr=$,hr=kt,pr=Function.prototype,fr=lr&&Object.getOwnPropertyDescriptor,mr=hr(pr,"name"),vr={EXISTS:mr,PROPER:mr&&"something"===function(){}.name,CONFIGURABLE:mr&&(!lr||lr&&fr(pr,"name").configurable)},gr=W,br=De,yr=kt,_r=In,wr=ft,Ar=Bn,kr=vr.CONFIGURABLE,Er=ur.get,xr=ur.enforce,Sr=String(String).split("String");(On.exports=function(e,t,n,r){var i,a=!!r&&!!r.unsafe,s=!!r&&!!r.enumerable,o=!!r&&!!r.noTargetGet,d=r&&void 0!==r.name?r.name:t;br(n)&&("Symbol("===String(d).slice(0,7)&&(d="["+String(d).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!yr(n,"name")||kr&&n.name!==d)&&_r(n,"name",d),(i=xr(n)).source||(i.source=Sr.join("string"==typeof d?d:""))),e!==gr?(a?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=n:_r(e,t,n)):s?e[t]=n:wr(t,n)})(Function.prototype,"toString",(function(){return br(this)&&Er(this).source||Ar(this)}));var Dr={},Tr=Math.ceil,Rr=Math.floor,Ir=function(e){var t=+e;return t!=t||0===t?0:(t>0?Rr:Tr)(t)},Or=Ir,Cr=Math.max,Pr=Math.min,Lr=function(e,t){var n=Or(e);return n<0?Cr(n+t,0):Pr(n,t)},Mr=Ir,Ur=Math.min,jr=function(e){return e>0?Ur(Mr(e),9007199254740991):0},Br=jr,Gr=function(e){return Br(e.length)},Nr=Se,qr=Lr,Fr=Gr,Vr=function(e){return function(t,n,r){var i,a=Nr(t),s=Fr(a),o=qr(r,s);if(e&&n!=n){for(;s>o;)if((i=a[o++])!=i)return!0}else for(;s>o;o++)if((e||o in a)&&a[o]===n)return e||o||0;return!e&&-1}},Kr={includes:Vr(!0),indexOf:Vr(!1)},Wr=kt,zr=Se,Hr=Kr.indexOf,$r=Hn,Qr=le([].push),Yr=function(e,t){var n,r=zr(e),i=0,a=[];for(n in r)!Wr($r,n)&&Wr(r,n)&&Qr(a,n);for(;t.length>i;)Wr(r,n=t[i++])&&(~Hr(a,n)||Qr(a,n));return a},Jr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Xr=Yr,Zr=Jr.concat("length","prototype");Dr.f=Object.getOwnPropertyNames||function(e){return Xr(e,Zr)};var ei={};ei.f=Object.getOwnPropertySymbols;var ti=Pe,ni=Dr,ri=ei,ii=yn,ai=le([].concat),si=ti("Reflect","ownKeys")||function(e){var t=ni.f(ii(e)),n=ri.f;return n?ai(t,n(e)):t},oi=kt,di=si,ci=z,ui=pn,li=function(e,t,n){for(var r=di(t),i=ui.f,a=ci.f,s=0;s<r.length;s++){var o=r[s];oi(e,o)||n&&oi(n,o)||i(e,o,a(t,o))}},hi=H,pi=De,fi=/#|\.prototype\./,mi=function(e,t){var n=gi[vi(e)];return n==yi||n!=bi&&(pi(t)?hi(t):!!t)},vi=mi.normalize=function(e){return String(e).replace(fi,".").toLowerCase()},gi=mi.data={},bi=mi.NATIVE="N",yi=mi.POLYFILL="P",_i=mi,wi=W,Ai=z.f,ki=In,Ei=On.exports,xi=ft,Si=li,Di=_i,Ti=function(e,t){var n,r,i,a,s,o=e.target,d=e.global,c=e.stat;if(n=d?wi:c?wi[o]||xi(o,{}):(wi[o]||{}).prototype)for(r in t){if(a=t[r],i=e.noTargetGet?(s=Ai(n,r))&&s.value:n[r],!Di(d?r:o+(c?".":"#")+r,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;Si(a,i)}(e.sham||i&&i.sham)&&ki(a,"sham",!0),Ei(n,r,a,e)}},Ri=Yr,Ii=Jr,Oi=Object.keys||function(e){return Ri(e,Ii)},Ci=_t,Pi=Oi;Ti({target:"Object",stat:!0,forced:H((function(){Pi(1)}))},{keys:function(e){return Pi(Ci(e))}});var Li=Q,Mi=Function.prototype,Ui=Mi.apply,ji=Mi.call,Bi="object"==typeof Reflect&&Reflect.apply||(Li?ji.bind(Ui):function(){return ji.apply(Ui,arguments)}),Gi=me,Ni=Array.isArray||function(e){return"Array"==Gi(e)},qi={};qi[Gt("toStringTag")]="z";var Fi="[object z]"===String(qi),Vi=W,Ki=Fi,Wi=De,zi=me,Hi=Gt("toStringTag"),$i=Vi.Object,Qi="Arguments"==zi(function(){return arguments}()),Yi=Ki?zi: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=$i(e),Hi))?n:Qi?zi(t):"Object"==(r=zi(t))&&Wi(t.callee)?"Arguments":r},Ji=Yi,Xi=W.String,Zi=function(e){if("Symbol"===Ji(e))throw TypeError("Cannot convert a Symbol value to a string");return Xi(e)},ea={},ta=$,na=fn,ra=pn,ia=yn,aa=Se,sa=Oi;ea.f=ta&&!na?Object.defineProperties:function(e,t){ia(e);for(var n,r=aa(t),i=sa(t),a=i.length,s=0;a>s;)ra.f(e,n=i[s++],r[n]);return e};var oa,da=Pe("document","documentElement"),ca=yn,ua=ea,la=Jr,ha=Hn,pa=da,fa=en,ma=zn("IE_PROTO"),va=function(){},ga=function(e){return"<script>"+e+"<\/script>"},ba=function(e){e.write(ga("")),e.close();var t=e.parentWindow.Object;return e=null,t},ya=function(){try{oa=new ActiveXObject("htmlfile")}catch(e){}var e,t;ya="undefined"!=typeof document?document.domain&&oa?ba(oa):((t=fa("iframe")).style.display="none",pa.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(ga("document.F=Object")),e.close(),e.F):ba(oa);for(var n=la.length;n--;)delete ya.prototype[la[n]];return ya()};ha[ma]=!0;var _a=Object.create||function(e,t){var n;return null!==e?(va.prototype=ca(e),n=new va,va.prototype=null,n[ma]=e):n=ya(),void 0===t?n:ua.f(n,t)},wa={},Aa=Yt,ka=pn,Ea=ae,xa=function(e,t,n){var r=Aa(t);r in e?ka.f(e,r,Ea(0,n)):e[r]=n},Sa=Lr,Da=Gr,Ta=xa,Ra=W.Array,Ia=Math.max,Oa=function(e,t,n){for(var r=Da(e),i=Sa(t,r),a=Sa(void 0===n?r:n,r),s=Ra(Ia(a-i,0)),o=0;i<a;i++,o++)Ta(s,o,e[i]);return s.length=o,s},Ca=me,Pa=Se,La=Dr.f,Ma=Oa,Ua="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];wa.f=function(e){return Ua&&"Window"==Ca(e)?function(e){try{return La(e)}catch(e){return Ma(Ua)}}(e):La(Pa(e))};var ja=le([].slice),Ba={},Ga=Gt;Ba.f=Ga;var Na=W,qa=kt,Fa=Ba,Va=pn.f,Ka=function(e){var t=Na.Symbol||(Na.Symbol={});qa(t,e)||Va(t,e,{value:Fa.f(e)})},Wa=pn.f,za=kt,Ha=Gt("toStringTag"),$a=function(e,t,n){e&&!n&&(e=e.prototype),e&&!za(e,Ha)&&Wa(e,Ha,{configurable:!0,value:t})},Qa=it,Ya=Q,Ja=le(le.bind),Xa=function(e,t){return Qa(e),void 0===t?e:Ya?Ja(e,t):function(){return e.apply(t,arguments)}},Za=le,es=H,ts=De,ns=Yi,rs=Bn,is=function(){},as=[],ss=Pe("Reflect","construct"),os=/^\s*(?:class|function)\b/,ds=Za(os.exec),cs=!os.exec(is),us=function(e){if(!ts(e))return!1;try{return ss(is,as,e),!0}catch(e){return!1}},ls=function(e){if(!ts(e))return!1;switch(ns(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return cs||!!ds(os,rs(e))}catch(e){return!0}};ls.sham=!0;var hs=!ss||es((function(){var e;return us(us.call)||!us(Object)||!us((function(){e=!0}))||e}))?ls:us,ps=W,fs=Ni,ms=hs,vs=Re,gs=Gt("species"),bs=ps.Array,ys=function(e){var t;return fs(e)&&(t=e.constructor,(ms(t)&&(t===bs||fs(t.prototype))||vs(t)&&null===(t=t[gs]))&&(t=void 0)),void 0===t?bs:t},_s=function(e,t){return new(ys(e))(0===t?0:t)},ws=Xa,As=we,ks=_t,Es=Gr,xs=_s,Ss=le([].push),Ds=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,a=6==e,s=7==e,o=5==e||a;return function(d,c,u,l){for(var h,p,f=ks(d),m=As(f),v=ws(c,u),g=Es(m),b=0,y=l||xs,_=t?y(d,g):n||s?y(d,0):void 0;g>b;b++)if((o||b in m)&&(p=v(h=m[b],b,f),e))if(t)_[b]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return b;case 2:Ss(_,h)}else switch(e){case 4:return!1;case 7:Ss(_,h)}return a?-1:r||i?i:_}},Ts={forEach:Ds(0),map:Ds(1),filter:Ds(2),some:Ds(3),every:Ds(4),find:Ds(5),findIndex:Ds(6),filterReject:Ds(7)},Rs=Ti,Is=W,Os=Pe,Cs=Bi,Ps=X,Ls=le,Ms=$,Us=We,js=H,Bs=kt,Gs=Ni,Ns=De,qs=Re,Fs=Le,Vs=Xe,Ks=yn,Ws=_t,zs=Se,Hs=Yt,$s=Zi,Qs=ae,Ys=_a,Js=Oi,Xs=Dr,Zs=wa,eo=ei,to=z,no=pn,ro=ea,io=Z,ao=ja,so=On.exports,oo=lt.exports,co=Hn,uo=Tt,lo=Gt,ho=Ba,po=Ka,fo=$a,mo=ur,vo=Ts.forEach,go=zn("hidden"),bo=lo("toPrimitive"),yo=mo.set,_o=mo.getterFor("Symbol"),wo=Object.prototype,Ao=Is.Symbol,ko=Ao&&Ao.prototype,Eo=Is.TypeError,xo=Is.QObject,So=Os("JSON","stringify"),Do=to.f,To=no.f,Ro=Zs.f,Io=io.f,Oo=Ls([].push),Co=oo("symbols"),Po=oo("op-symbols"),Lo=oo("string-to-symbol-registry"),Mo=oo("symbol-to-string-registry"),Uo=oo("wks"),jo=!xo||!xo.prototype||!xo.prototype.findChild,Bo=Ms&&js((function(){return 7!=Ys(To({},"a",{get:function(){return To(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Do(wo,t);r&&delete wo[t],To(e,t,n),r&&e!==wo&&To(wo,t,r)}:To,Go=function(e,t){var n=Co[e]=Ys(ko);return yo(n,{type:"Symbol",tag:e,description:t}),Ms||(n.description=t),n},No=function(e,t,n){e===wo&&No(Po,t,n),Ks(e);var r=Hs(t);return Ks(n),Bs(Co,r)?(n.enumerable?(Bs(e,go)&&e[go][r]&&(e[go][r]=!1),n=Ys(n,{enumerable:Qs(0,!1)})):(Bs(e,go)||To(e,go,Qs(1,{})),e[go][r]=!0),Bo(e,r,n)):To(e,r,n)},qo=function(e,t){Ks(e);var n=zs(t),r=Js(n).concat(Wo(n));return vo(r,(function(t){Ms&&!Ps(Fo,n,t)||No(e,t,n[t])})),e},Fo=function(e){var t=Hs(e),n=Ps(Io,this,t);return!(this===wo&&Bs(Co,t)&&!Bs(Po,t))&&(!(n||!Bs(this,t)||!Bs(Co,t)||Bs(this,go)&&this[go][t])||n)},Vo=function(e,t){var n=zs(e),r=Hs(t);if(n!==wo||!Bs(Co,r)||Bs(Po,r)){var i=Do(n,r);return!i||!Bs(Co,r)||Bs(n,go)&&n[go][r]||(i.enumerable=!0),i}},Ko=function(e){var t=Ro(zs(e)),n=[];return vo(t,(function(e){Bs(Co,e)||Bs(co,e)||Oo(n,e)})),n},Wo=function(e){var t=e===wo,n=Ro(t?Po:zs(e)),r=[];return vo(n,(function(e){!Bs(Co,e)||t&&!Bs(wo,e)||Oo(r,Co[e])})),r};(Us||(so(ko=(Ao=function(){if(Fs(ko,this))throw Eo("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?$s(arguments[0]):void 0,t=uo(e),n=function(e){this===wo&&Ps(n,Po,e),Bs(this,go)&&Bs(this[go],t)&&(this[go][t]=!1),Bo(this,t,Qs(1,e))};return Ms&&jo&&Bo(wo,t,{configurable:!0,set:n}),Go(t,e)}).prototype,"toString",(function(){return _o(this).tag})),so(Ao,"withoutSetter",(function(e){return Go(uo(e),e)})),io.f=Fo,no.f=No,ro.f=qo,to.f=Vo,Xs.f=Zs.f=Ko,eo.f=Wo,ho.f=function(e){return Go(lo(e),e)},Ms&&(To(ko,"description",{configurable:!0,get:function(){return _o(this).description}}),so(wo,"propertyIsEnumerable",Fo,{unsafe:!0}))),Rs({global:!0,wrap:!0,forced:!Us,sham:!Us},{Symbol:Ao}),vo(Js(Uo),(function(e){po(e)})),Rs({target:"Symbol",stat:!0,forced:!Us},{for:function(e){var t=$s(e);if(Bs(Lo,t))return Lo[t];var n=Ao(t);return Lo[t]=n,Mo[n]=t,n},keyFor:function(e){if(!Vs(e))throw Eo(e+" is not a symbol");if(Bs(Mo,e))return Mo[e]},useSetter:function(){jo=!0},useSimple:function(){jo=!1}}),Rs({target:"Object",stat:!0,forced:!Us,sham:!Ms},{create:function(e,t){return void 0===t?Ys(e):qo(Ys(e),t)},defineProperty:No,defineProperties:qo,getOwnPropertyDescriptor:Vo}),Rs({target:"Object",stat:!0,forced:!Us},{getOwnPropertyNames:Ko,getOwnPropertySymbols:Wo}),Rs({target:"Object",stat:!0,forced:js((function(){eo.f(1)}))},{getOwnPropertySymbols:function(e){return eo.f(Ws(e))}}),So)&&Rs({target:"JSON",stat:!0,forced:!Us||js((function(){var e=Ao();return"[null]"!=So([e])||"{}"!=So({a:e})||"{}"!=So(Object(e))}))},{stringify:function(e,t,n){var r=ao(arguments),i=t;if((qs(t)||void 0!==e)&&!Vs(e))return Gs(t)||(t=function(e,t){if(Ns(i)&&(t=Ps(i,this,e,t)),!Vs(t))return t}),r[1]=t,Cs(So,null,r)}});if(!ko[bo]){var zo=ko.valueOf;so(ko,bo,(function(e){return Ps(zo,this)}))}fo(Ao,"Symbol"),co[go]=!0;var Ho=H,$o=Fe,Qo=Gt("species"),Yo=function(e){return $o>=51||!Ho((function(){var t=[];return(t.constructor={})[Qo]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Jo=Ts.filter;Ti({target:"Array",proto:!0,forced:!Yo("filter")},{filter:function(e){return Jo(this,e,arguments.length>1?arguments[1]:void 0)}});var Xo=Ti,Zo=H,ed=Se,td=z.f,nd=$,rd=Zo((function(){td(1)}));Xo({target:"Object",stat:!0,forced:!nd||rd,sham:!nd},{getOwnPropertyDescriptor:function(e,t){return td(ed(e),t)}});var id={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},ad=en("span").classList,sd=ad&&ad.constructor&&ad.constructor.prototype,od=sd===Object.prototype?void 0:sd,dd=H,cd=Ts.forEach,ud=function(e,t){var n=[][e];return!!n&&dd((function(){n.call(null,t||function(){return 1},1)}))},ld=W,hd=id,pd=od,fd=ud("forEach")?[].forEach:function(e){return cd(this,e,arguments.length>1?arguments[1]:void 0)},md=In,vd=function(e){if(e&&e.forEach!==fd)try{md(e,"forEach",fd)}catch(t){e.forEach=fd}};for(var gd in hd)hd[gd]&&vd(ld[gd]&&ld[gd].prototype);vd(pd);var bd=si,yd=Se,_d=z,wd=xa;Ti({target:"Object",stat:!0,sham:!$},{getOwnPropertyDescriptors:function(e){for(var t,n,r=yd(e),i=_d.f,a=bd(r),s={},o=0;a.length>o;)void 0!==(n=i(r,t=a[o++]))&&wd(s,t,n);return s}});var Ad=Ti,kd=W,Ed=Ni,xd=hs,Sd=Re,Dd=Lr,Td=Gr,Rd=Se,Id=xa,Od=Gt,Cd=ja,Pd=Yo("slice"),Ld=Od("species"),Md=kd.Array,Ud=Math.max;Ad({target:"Array",proto:!0,forced:!Pd},{slice:function(e,t){var n,r,i,a=Rd(this),s=Td(a),o=Dd(e,s),d=Dd(void 0===t?s:t,s);if(Ed(a)&&(n=a.constructor,(xd(n)&&(n===Md||Ed(n.prototype))||Sd(n)&&null===(n=n[Ld]))&&(n=void 0),n===Md||void 0===n))return Cd(a,o,d);for(r=new(void 0===n?Md:n)(Ud(d-o,0)),i=0;o<d;o++,i++)o in a&&Id(r,i,a[o]);return r.length=i,r}});var jd=X,Bd=yn,Gd=st,Nd=function(e,t,n){var r,i;Bd(e);try{if(!(r=Gd(e,"return"))){if("throw"===t)throw n;return n}r=jd(r,e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return Bd(r),n},qd=yn,Fd=Nd,Vd={},Kd=Vd,Wd=Gt("iterator"),zd=Array.prototype,Hd=function(e){return void 0!==e&&(Kd.Array===e||zd[Wd]===e)},$d=Yi,Qd=st,Yd=Vd,Jd=Gt("iterator"),Xd=function(e){if(null!=e)return Qd(e,Jd)||Qd(e,"@@iterator")||Yd[$d(e)]},Zd=X,ec=it,tc=yn,nc=et,rc=Xd,ic=W.TypeError,ac=function(e,t){var n=arguments.length<2?rc(e):t;if(ec(n))return tc(Zd(n,e));throw ic(nc(e)+" is not iterable")},sc=Xa,oc=X,dc=_t,cc=function(e,t,n,r){try{return r?t(qd(n)[0],n[1]):t(n)}catch(t){Fd(e,"throw",t)}},uc=Hd,lc=hs,hc=Gr,pc=xa,fc=ac,mc=Xd,vc=W.Array,gc=Gt("iterator"),bc=!1;try{var yc=0,_c={next:function(){return{done:!!yc++}},return:function(){bc=!0}};_c[gc]=function(){return this},Array.from(_c,(function(){throw 2}))}catch(e){}var wc=function(e,t){if(!t&&!bc)return!1;var n=!1;try{var r={};r[gc]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Ac=function(e){var t=dc(e),n=lc(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=void 0!==i;a&&(i=sc(i,r>2?arguments[2]:void 0));var s,o,d,c,u,l,h=mc(t),p=0;if(!h||this==vc&&uc(h))for(s=hc(t),o=n?new this(s):vc(s);s>p;p++)l=a?i(t[p],p):t[p],pc(o,p,l);else for(u=(c=fc(t,h)).next,o=n?new this:[];!(d=oc(u,c)).done;p++)l=a?cc(c,i,[d.value,p],!0):d.value,pc(o,p,l);return o.length=p,o};Ti({target:"Array",stat:!0,forced:!wc((function(e){Array.from(e)}))},{from:Ac});var kc,Ec,xc,Sc=le,Dc=Ir,Tc=Zi,Rc=ke,Ic=Sc("".charAt),Oc=Sc("".charCodeAt),Cc=Sc("".slice),Pc=function(e){return function(t,n){var r,i,a=Tc(Rc(t)),s=Dc(n),o=a.length;return s<0||s>=o?e?"":void 0:(r=Oc(a,s))<55296||r>56319||s+1===o||(i=Oc(a,s+1))<56320||i>57343?e?Ic(a,s):r:e?Cc(a,s,s+2):i-56320+(r-55296<<10)+65536}},Lc={codeAt:Pc(!1),charAt:Pc(!0)},Mc=!H((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Uc=W,jc=kt,Bc=De,Gc=_t,Nc=Mc,qc=zn("IE_PROTO"),Fc=Uc.Object,Vc=Fc.prototype,Kc=Nc?Fc.getPrototypeOf:function(e){var t=Gc(e);if(jc(t,qc))return t[qc];var n=t.constructor;return Bc(n)&&t instanceof n?n.prototype:t instanceof Fc?Vc:null},Wc=H,zc=De,Hc=Kc,$c=On.exports,Qc=Gt("iterator"),Yc=!1;[].keys&&("next"in(xc=[].keys())?(Ec=Hc(Hc(xc)))!==Object.prototype&&(kc=Ec):Yc=!0);var Jc=null==kc||Wc((function(){var e={};return kc[Qc].call(e)!==e}));Jc&&(kc={}),zc(kc[Qc])||$c(kc,Qc,(function(){return this}));var Xc={IteratorPrototype:kc,BUGGY_SAFARI_ITERATORS:Yc},Zc=Xc.IteratorPrototype,eu=_a,tu=ae,nu=$a,ru=Vd,iu=function(){return this},au=function(e,t,n,r){var i=t+" Iterator";return e.prototype=eu(Zc,{next:tu(+!r,n)}),nu(e,i,!1),ru[i]=iu,e},su=W,ou=De,du=su.String,cu=su.TypeError,uu=le,lu=yn,hu=function(e){if("object"==typeof e||ou(e))return e;throw cu("Can't set "+du(e)+" as a prototype")},pu=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=uu(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return lu(n),hu(r),t?e(n,r):n.__proto__=r,n}}():void 0),fu=Ti,mu=X,vu=vr,gu=De,bu=au,yu=Kc,_u=pu,wu=$a,Au=In,ku=On.exports,Eu=Vd,xu=vu.PROPER,Su=vu.CONFIGURABLE,Du=Xc.IteratorPrototype,Tu=Xc.BUGGY_SAFARI_ITERATORS,Ru=Gt("iterator"),Iu=function(){return this},Ou=function(e,t,n,r,i,a,s){bu(n,t,r);var o,d,c,u=function(e){if(e===i&&m)return m;if(!Tu&&e in p)return p[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,p=e.prototype,f=p[Ru]||p["@@iterator"]||i&&p[i],m=!Tu&&f||u(i),v="Array"==t&&p.entries||f;if(v&&(o=yu(v.call(new e)))!==Object.prototype&&o.next&&(yu(o)!==Du&&(_u?_u(o,Du):gu(o[Ru])||ku(o,Ru,Iu)),wu(o,l,!0)),xu&&"values"==i&&f&&"values"!==f.name&&(Su?Au(p,"name","values"):(h=!0,m=function(){return mu(f,this)})),i)if(d={values:u("values"),keys:a?m:u("keys"),entries:u("entries")},s)for(c in d)(Tu||h||!(c in p))&&ku(p,c,d[c]);else fu({target:t,proto:!0,forced:Tu||h},d);return p[Ru]!==m&&ku(p,Ru,m,{name:i}),Eu[t]=m,d},Cu=Lc.charAt,Pu=Zi,Lu=ur,Mu=Ou,Uu=Lu.set,ju=Lu.getterFor("String Iterator");Mu(String,"String",(function(e){Uu(this,{type:"String Iterator",string:Pu(e),index:0})}),(function(){var e,t=ju(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Cu(n,r),t.index+=e.length,{value:e,done:!1})}));var Bu=yn,Gu=function(){var e=Bu(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},Nu=H,qu=W.RegExp,Fu=Nu((function(){var e=qu("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Vu=Fu||Nu((function(){return!qu("a","y").sticky})),Ku={BROKEN_CARET:Fu||Nu((function(){var e=qu("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:Vu,UNSUPPORTED_Y:Fu},Wu=H,zu=W.RegExp,Hu=Wu((function(){var e=zu(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),$u=H,Qu=W.RegExp,Yu=$u((function(){var e=Qu("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Ju=X,Xu=le,Zu=Zi,el=Gu,tl=Ku,nl=lt.exports,rl=_a,il=ur.get,al=Hu,sl=Yu,ol=nl("native-string-replace",String.prototype.replace),dl=RegExp.prototype.exec,cl=dl,ul=Xu("".charAt),ll=Xu("".indexOf),hl=Xu("".replace),pl=Xu("".slice),fl=function(){var e=/a/,t=/b*/g;return Ju(dl,e,"a"),Ju(dl,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),ml=tl.BROKEN_CARET,vl=void 0!==/()??/.exec("")[1];(fl||vl||ml||al||sl)&&(cl=function(e){var t,n,r,i,a,s,o,d=this,c=il(d),u=Zu(e),l=c.raw;if(l)return l.lastIndex=d.lastIndex,t=Ju(cl,l,u),d.lastIndex=l.lastIndex,t;var h=c.groups,p=ml&&d.sticky,f=Ju(el,d),m=d.source,v=0,g=u;if(p&&(f=hl(f,"y",""),-1===ll(f,"g")&&(f+="g"),g=pl(u,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==ul(u,d.lastIndex-1))&&(m="(?: "+m+")",g=" "+g,v++),n=new RegExp("^(?:"+m+")",f)),vl&&(n=new RegExp("^"+m+"$(?!\\s)",f)),fl&&(r=d.lastIndex),i=Ju(dl,p?n:d,g),p?i?(i.input=pl(i.input,v),i[0]=pl(i[0],v),i.index=d.lastIndex,d.lastIndex+=i[0].length):d.lastIndex=0:fl&&i&&(d.lastIndex=d.global?i.index+i[0].length:r),vl&&i&&i.length>1&&Ju(ol,i[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&h)for(i.groups=s=rl(null),a=0;a<h.length;a++)s[(o=h[a])[0]]=i[o[1]];return i});var gl=cl;Ti({target:"RegExp",proto:!0,forced:/./.exec!==gl},{exec:gl});var bl=Ti,yl=$,_l=W,wl=le,Al=kt,kl=De,El=Le,xl=Zi,Sl=pn.f,Dl=li,Tl=_l.Symbol,Rl=Tl&&Tl.prototype;if(yl&&kl(Tl)&&(!("description"in Rl)||void 0!==Tl().description)){var Il={},Ol=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:xl(arguments[0]),t=El(Rl,this)?new Tl(e):void 0===e?Tl():Tl(e);return""===e&&(Il[t]=!0),t};Dl(Ol,Tl),Ol.prototype=Rl,Rl.constructor=Ol;var Cl="Symbol(test)"==String(Tl("test")),Pl=wl(Rl.toString),Ll=wl(Rl.valueOf),Ml=/^Symbol\((.*)\)[^)]+$/,Ul=wl("".replace),jl=wl("".slice);Sl(Rl,"description",{configurable:!0,get:function(){var e=Ll(this),t=Pl(e);if(Al(Il,e))return"";var n=Cl?jl(t,7,-1):Ul(t,Ml,"$1");return""===n?void 0:n}}),bl({global:!0,forced:!0},{Symbol:Ol})}Ka("iterator");var Bl=_a,Gl=pn,Nl=Gt("unscopables"),ql=Array.prototype;null==ql[Nl]&&Gl.f(ql,Nl,{configurable:!0,value:Bl(null)});var Fl=function(e){ql[Nl][e]=!0},Vl=Se,Kl=Fl,Wl=Vd,zl=ur,Hl=pn.f,$l=Ou,Ql=$,Yl=zl.set,Jl=zl.getterFor("Array Iterator"),Xl=$l(Array,"Array",(function(e,t){Yl(this,{type:"Array Iterator",target:Vl(e),index:0,kind:t})}),(function(){var e=Jl(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"),Zl=Wl.Arguments=Wl.Array;if(Kl("keys"),Kl("values"),Kl("entries"),Ql&&"values"!==Zl.name)try{Hl(Zl,"name",{value:"values"})}catch(e){}var eh=W,th=id,nh=od,rh=Xl,ih=In,ah=Gt,sh=ah("iterator"),oh=ah("toStringTag"),dh=rh.values,ch=function(e,t){if(e){if(e[sh]!==dh)try{ih(e,sh,dh)}catch(t){e[sh]=dh}if(e[oh]||ih(e,oh,t),th[t])for(var n in rh)if(e[n]!==rh[n])try{ih(e,n,rh[n])}catch(t){e[n]=rh[n]}}};for(var uh in th)ch(eh[uh]&&eh[uh].prototype,uh);ch(nh,"DOMTokenList");var lh=Yi,hh=Fi?{}.toString:function(){return"[object "+lh(this)+"]"},ph=Fi,fh=On.exports,mh=hh;ph||fh(Object.prototype,"toString",mh,{unsafe:!0});var vh,gh,bh,yh,_h=W.Promise,wh=On.exports,Ah=function(e,t,n){for(var r in t)wh(e,r,t[r],n);return e},kh=Pe,Eh=pn,xh=$,Sh=Gt("species"),Dh=function(e){var t=kh(e),n=Eh.f;xh&&t&&!t[Sh]&&n(t,Sh,{configurable:!0,get:function(){return this}})},Th=Le,Rh=W.TypeError,Ih=function(e,t){if(Th(t,e))return e;throw Rh("Incorrect invocation")},Oh=Xa,Ch=X,Ph=yn,Lh=et,Mh=Hd,Uh=Gr,jh=Le,Bh=ac,Gh=Xd,Nh=Nd,qh=W.TypeError,Fh=function(e,t){this.stopped=e,this.result=t},Vh=Fh.prototype,Kh=hs,Wh=et,zh=W.TypeError,Hh=yn,$h=function(e){if(Kh(e))return e;throw zh(Wh(e)+" is not a constructor")},Qh=Gt("species"),Yh=function(e,t){var n,r=Hh(e).constructor;return void 0===r||null==(n=Hh(r)[Qh])?t:$h(n)},Jh=W.TypeError,Xh=function(e,t){if(e<t)throw Jh("Not enough arguments");return e},Zh=/(?:ipad|iphone|ipod).*applewebkit/i.test(Me),ep="process"==me(W.process),tp=W,np=Bi,rp=Xa,ip=De,ap=kt,sp=H,op=da,dp=ja,cp=en,up=Xh,lp=Zh,hp=ep,pp=tp.setImmediate,fp=tp.clearImmediate,mp=tp.process,vp=tp.Dispatch,gp=tp.Function,bp=tp.MessageChannel,yp=tp.String,_p=0,wp={};try{vh=tp.location}catch(e){}var Ap=function(e){if(ap(wp,e)){var t=wp[e];delete wp[e],t()}},kp=function(e){return function(){Ap(e)}},Ep=function(e){Ap(e.data)},xp=function(e){tp.postMessage(yp(e),vh.protocol+"//"+vh.host)};pp&&fp||(pp=function(e){up(arguments.length,1);var t=ip(e)?e:gp(e),n=dp(arguments,1);return wp[++_p]=function(){np(t,void 0,n)},gh(_p),_p},fp=function(e){delete wp[e]},hp?gh=function(e){mp.nextTick(kp(e))}:vp&&vp.now?gh=function(e){vp.now(kp(e))}:bp&&!lp?(yh=(bh=new bp).port2,bh.port1.onmessage=Ep,gh=rp(yh.postMessage,yh)):tp.addEventListener&&ip(tp.postMessage)&&!tp.importScripts&&vh&&"file:"!==vh.protocol&&!sp(xp)?(gh=xp,tp.addEventListener("message",Ep,!1)):gh="onreadystatechange"in cp("script")?function(e){op.appendChild(cp("script")).onreadystatechange=function(){op.removeChild(this),Ap(e)}}:function(e){setTimeout(kp(e),0)});var Sp,Dp,Tp,Rp,Ip,Op,Cp,Pp,Lp={set:pp,clear:fp},Mp=W,Up=/ipad|iphone|ipod/i.test(Me)&&void 0!==Mp.Pebble,jp=/web0s(?!.*chrome)/i.test(Me),Bp=W,Gp=Xa,Np=z.f,qp=Lp.set,Fp=Zh,Vp=Up,Kp=jp,Wp=ep,zp=Bp.MutationObserver||Bp.WebKitMutationObserver,Hp=Bp.document,$p=Bp.process,Qp=Bp.Promise,Yp=Np(Bp,"queueMicrotask"),Jp=Yp&&Yp.value;Jp||(Sp=function(){var e,t;for(Wp&&(e=$p.domain)&&e.exit();Dp;){t=Dp.fn,Dp=Dp.next;try{t()}catch(e){throw Dp?Rp():Tp=void 0,e}}Tp=void 0,e&&e.enter()},Fp||Wp||Kp||!zp||!Hp?!Vp&&Qp&&Qp.resolve?((Cp=Qp.resolve(void 0)).constructor=Qp,Pp=Gp(Cp.then,Cp),Rp=function(){Pp(Sp)}):Wp?Rp=function(){$p.nextTick(Sp)}:(qp=Gp(qp,Bp),Rp=function(){qp(Sp)}):(Ip=!0,Op=Hp.createTextNode(""),new zp(Sp).observe(Op,{characterData:!0}),Rp=function(){Op.data=Ip=!Ip}));var Xp=Jp||function(e){var t={fn:e,next:void 0};Tp&&(Tp.next=t),Dp||(Dp=t,Rp()),Tp=t},Zp={},ef=it,tf=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=ef(t),this.reject=ef(n)};Zp.f=function(e){return new tf(e)};var nf=yn,rf=Re,af=Zp,sf=function(e,t){if(nf(e),rf(t)&&t.constructor===e)return t;var n=af.f(e);return(0,n.resolve)(t),n.promise},of=W,df=function(){this.head=null,this.tail=null};df.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var cf,uf,lf,hf,pf=df,ff="object"==typeof window,mf=Ti,vf=W,gf=Pe,bf=X,yf=_h,_f=On.exports,wf=Ah,Af=pu,kf=$a,Ef=Dh,xf=it,Sf=De,Df=Re,Tf=Ih,Rf=Bn,If=function(e,t,n){var r,i,a,s,o,d,c,u=n&&n.that,l=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),f=Oh(t,u),m=function(e){return r&&Nh(r,"normal",e),new Fh(!0,e)},v=function(e){return l?(Ph(e),p?f(e[0],e[1],m):f(e[0],e[1])):p?f(e,m):f(e)};if(h)r=e;else{if(!(i=Gh(e)))throw qh(Lh(e)+" is not iterable");if(Mh(i)){for(a=0,s=Uh(e);s>a;a++)if((o=v(e[a]))&&jh(Vh,o))return o;return new Fh(!1)}r=Bh(e,i)}for(d=r.next;!(c=Ch(d,r)).done;){try{o=v(c.value)}catch(e){Nh(r,"throw",e)}if("object"==typeof o&&o&&jh(Vh,o))return o}return new Fh(!1)},Of=wc,Cf=Yh,Pf=Lp.set,Lf=Xp,Mf=sf,Uf=function(e,t){var n=of.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))},jf=Zp,Bf=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Gf=pf,Nf=ur,qf=_i,Ff=ff,Vf=ep,Kf=Fe,Wf=Gt("species"),zf="Promise",Hf=Nf.getterFor(zf),$f=Nf.set,Qf=Nf.getterFor(zf),Yf=yf&&yf.prototype,Jf=yf,Xf=Yf,Zf=vf.TypeError,em=vf.document,tm=vf.process,nm=jf.f,rm=nm,im=!!(em&&em.createEvent&&vf.dispatchEvent),am=Sf(vf.PromiseRejectionEvent),sm=!1,om=qf(zf,(function(){var e=Rf(Jf),t=e!==String(Jf);if(!t&&66===Kf)return!0;if(Kf>=51&&/native code/.test(e))return!1;var n=new Jf((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[Wf]=r,!(sm=n.then((function(){}))instanceof r)||!t&&Ff&&!am})),dm=om||!Of((function(e){Jf.all(e).catch((function(){}))})),cm=function(e){var t;return!(!Df(e)||!Sf(t=e.then))&&t},um=function(e,t){var n,r,i,a=t.value,s=1==t.state,o=s?e.ok:e.fail,d=e.resolve,c=e.reject,u=e.domain;try{o?(s||(2===t.rejection&&mm(t),t.rejection=1),!0===o?n=a:(u&&u.enter(),n=o(a),u&&(u.exit(),i=!0)),n===e.promise?c(Zf("Promise-chain cycle")):(r=cm(n))?bf(r,n,d,c):d(n)):c(a)}catch(e){u&&!i&&u.exit(),c(e)}},lm=function(e,t){e.notified||(e.notified=!0,Lf((function(){for(var n,r=e.reactions;n=r.get();)um(n,e);e.notified=!1,t&&!e.rejection&&pm(e)})))},hm=function(e,t,n){var r,i;im?((r=em.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),vf.dispatchEvent(r)):r={promise:t,reason:n},!am&&(i=vf["on"+e])?i(r):"unhandledrejection"===e&&Uf("Unhandled promise rejection",n)},pm=function(e){bf(Pf,vf,(function(){var t,n=e.facade,r=e.value;if(fm(e)&&(t=Bf((function(){Vf?tm.emit("unhandledRejection",r,n):hm("unhandledrejection",n,r)})),e.rejection=Vf||fm(e)?2:1,t.error))throw t.value}))},fm=function(e){return 1!==e.rejection&&!e.parent},mm=function(e){bf(Pf,vf,(function(){var t=e.facade;Vf?tm.emit("rejectionHandled",t):hm("rejectionhandled",t,e.value)}))},vm=function(e,t,n){return function(r){e(t,r,n)}},gm=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,lm(e,!0))},bm=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Zf("Promise can't be resolved itself");var r=cm(t);r?Lf((function(){var n={done:!1};try{bf(r,t,vm(bm,n,e),vm(gm,n,e))}catch(t){gm(n,t,e)}})):(e.value=t,e.state=1,lm(e,!1))}catch(t){gm({done:!1},t,e)}}};if(om&&(Xf=(Jf=function(e){Tf(this,Xf),xf(e),bf(cf,this);var t=Hf(this);try{e(vm(bm,t),vm(gm,t))}catch(e){gm(t,e)}}).prototype,(cf=function(e){$f(this,{type:zf,done:!1,notified:!1,parent:!1,reactions:new Gf,rejection:!1,state:0,value:void 0})}).prototype=wf(Xf,{then:function(e,t){var n=Qf(this),r=nm(Cf(this,Jf));return n.parent=!0,r.ok=!Sf(e)||e,r.fail=Sf(t)&&t,r.domain=Vf?tm.domain:void 0,0==n.state?n.reactions.add(r):Lf((function(){um(r,n)})),r.promise},catch:function(e){return this.then(void 0,e)}}),uf=function(){var e=new cf,t=Hf(e);this.promise=e,this.resolve=vm(bm,t),this.reject=vm(gm,t)},jf.f=nm=function(e){return e===Jf||e===lf?new uf(e):rm(e)},Sf(yf)&&Yf!==Object.prototype)){hf=Yf.then,sm||(_f(Yf,"then",(function(e,t){var n=this;return new Jf((function(e,t){bf(hf,n,e,t)})).then(e,t)}),{unsafe:!0}),_f(Yf,"catch",Xf.catch,{unsafe:!0}));try{delete Yf.constructor}catch(e){}Af&&Af(Yf,Xf)}mf({global:!0,wrap:!0,forced:om},{Promise:Jf}),kf(Jf,zf,!1),Ef(zf),lf=gf(zf),mf({target:zf,stat:!0,forced:om},{reject:function(e){var t=nm(this);return bf(t.reject,void 0,e),t.promise}}),mf({target:zf,stat:!0,forced:om},{resolve:function(e){return Mf(this,e)}}),mf({target:zf,stat:!0,forced:dm},{all:function(e){var t=this,n=nm(t),r=n.resolve,i=n.reject,a=Bf((function(){var n=xf(t.resolve),a=[],s=0,o=1;If(e,(function(e){var d=s++,c=!1;o++,bf(n,t,e).then((function(e){c||(c=!0,a[d]=e,--o||r(a))}),i)})),--o||r(a)}));return a.error&&i(a.value),n.promise},race:function(e){var t=this,n=nm(t),r=n.reject,i=Bf((function(){var i=xf(t.resolve);If(e,(function(e){bf(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var ym=Ti,_m=W,wm=H,Am=Ni,km=Re,Em=_t,xm=Gr,Sm=xa,Dm=_s,Tm=Yo,Rm=Fe,Im=Gt("isConcatSpreadable"),Om=_m.TypeError,Cm=Rm>=51||!wm((function(){var e=[];return e[Im]=!1,e.concat()[0]!==e})),Pm=Tm("concat"),Lm=function(e){if(!km(e))return!1;var t=e[Im];return void 0!==t?!!t:Am(e)};ym({target:"Array",proto:!0,forced:!Cm||!Pm},{concat:function(e){var t,n,r,i,a,s=Em(this),o=Dm(s,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(Lm(a=-1===t?s:arguments[t])){if(d+(i=xm(a))>9007199254740991)throw Om("Maximum allowed index exceeded");for(n=0;n<i;n++,d++)n in a&&Sm(o,d,a[n])}else{if(d>=9007199254740991)throw Om("Maximum allowed index exceeded");Sm(o,d++,a)}return o.length=d,o}});var Mm=$,Um=vr.EXISTS,jm=le,Bm=pn.f,Gm=Function.prototype,Nm=jm(Gm.toString),qm=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Fm=jm(qm.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 Km(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 Km(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,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,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function Km(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 Wm(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 zm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wm(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Mm&&!Um&&Bm(Gm,"name",{configurable:!0,get:function(){try{return Fm(qm,Nm(this))[1]}catch(e){return""}}});var Hm={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"}},$m={},Qm=function(e,t){$m[e]=zm(zm({},t),{},{isLoading:!1})},Ym=function(e){var n=this,r=e.id,i=e.src;return new Promise(function(e,a){if(t(this,n),document.getElementById(r))e();else{var s=document.createElement("script");s.onload=function(){e()},s.id=r,s.setAttribute("crossorigin",!0),s.src=i,document.head.appendChild(s)}}.bind(this))},Jm=function(){var t=e(r.mark((function e(t){var n,i,a,s,o,d,c,u;return r.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(!(i=$m[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:i.isLoading=!0,a=Vm(i.dependencies),e.prev=8,a.s();case 10:if((s=a.n()).done){e.next=26;break}if(o=s.value,e.prev=12,d=Hm[o].name,!window[d]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,Ym({id:o,src:Hm[o].src});case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),c=o.id,u=o.src,console.log("Could not load external script ".concat(c," ").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,Ym({id:t,src:i.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(i.source,"."),e.t2);case 43:return i.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(e){return t.apply(this,arguments)}}(),Xm=new(D((function t(){var n=this;T(this,t),R(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Jm("Leaderboard");case 2:n.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),R(this,"showLeaderboard",function(){var t=e(r.mark((function e(t){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=window.GD_OPTIONS.gameId,n.leaderboard){e.next=4;break}return e.next=4,n.load();case 4:n.leaderboard.showLeaderBoard(i,t);case 5:case"end":return e.stop()}}),e)})));return function(e){return t.apply(this,arguments)}}()),R(this,"addScore",function(){var t=e(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.leaderboard){e.next=3;break}return e.next=3,n.load();case 3:n.leaderboard.addScore(t);case 4:case"end":return e.stop()}}),e)})));return function(e){return t.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"]},Qm(this.moduleName,this.moduleConfig)}))),Zm=le,ev=On.exports,tv=gl,nv=H,rv=Gt,iv=In,av=rv("species"),sv=RegExp.prototype,ov=function(e,t,n,r){var i=rv(e),a=!nv((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),s=a&&!nv((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[av]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!a||!s||n){var o=Zm(/./[i]),d=t(i,""[e],(function(e,t,n,r,i){var s=Zm(e),d=t.exec;return d===tv||d===sv.exec?a&&!i?{done:!0,value:o(t,n,r)}:{done:!0,value:s(n,t,r)}:{done:!1}}));ev(String.prototype,e,d[0]),ev(sv,i,d[1])}r&&iv(sv[i],"sham",!0)},dv=Lc.charAt,cv=function(e,t,n){return t+(n?dv(e,t).length:1)},uv=le,lv=_t,hv=Math.floor,pv=uv("".charAt),fv=uv("".replace),mv=uv("".slice),vv=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,gv=/\$([$&'`]|\d{1,2})/g,bv=X,yv=yn,_v=De,wv=me,Av=gl,kv=W.TypeError,Ev=function(e,t){var n=e.exec;if(_v(n)){var r=bv(n,e,t);return null!==r&&yv(r),r}if("RegExp"===wv(e))return bv(Av,e,t);throw kv("RegExp#exec called on incompatible receiver")},xv=Bi,Sv=X,Dv=le,Tv=ov,Rv=H,Iv=yn,Ov=De,Cv=Ir,Pv=jr,Lv=Zi,Mv=ke,Uv=cv,jv=st,Bv=function(e,t,n,r,i,a){var s=n+e.length,o=r.length,d=gv;return void 0!==i&&(i=lv(i),d=vv),fv(a,d,(function(a,d){var c;switch(pv(d,0)){case"$":return"$";case"&":return e;case"`":return mv(t,0,n);case"'":return mv(t,s);case"<":c=i[mv(d,1,-1)];break;default:var u=+d;if(0===u)return a;if(u>o){var l=hv(u/10);return 0===l?a:l<=o?void 0===r[l-1]?pv(d,1):r[l-1]+pv(d,1):a}c=r[u-1]}return void 0===c?"":c}))},Gv=Ev,Nv=Gt("replace"),qv=Math.max,Fv=Math.min,Vv=Dv([].concat),Kv=Dv([].push),Wv=Dv("".indexOf),zv=Dv("".slice),Hv="$0"==="a".replace(/./,"$0"),$v=!!/./[Nv]&&""===/./[Nv]("a","$0");Tv("replace",(function(e,t,n){var r=$v?"$":"$0";return[function(e,n){var r=Mv(this),i=null==e?void 0:jv(e,Nv);return i?Sv(i,e,r,n):Sv(t,Lv(r),e,n)},function(e,i){var a=Iv(this),s=Lv(e);if("string"==typeof i&&-1===Wv(i,r)&&-1===Wv(i,"$<")){var o=n(t,a,s,i);if(o.done)return o.value}var d=Ov(i);d||(i=Lv(i));var c=a.global;if(c){var u=a.unicode;a.lastIndex=0}for(var l=[];;){var h=Gv(a,s);if(null===h)break;if(Kv(l,h),!c)break;""===Lv(h[0])&&(a.lastIndex=Uv(s,Pv(a.lastIndex),u))}for(var p,f="",m=0,v=0;v<l.length;v++){for(var g=Lv((h=l[v])[0]),b=qv(Fv(Cv(h.index),s.length),0),y=[],_=1;_<h.length;_++)Kv(y,void 0===(p=h[_])?p:String(p));var w=h.groups;if(d){var A=Vv([g],y,b,s);void 0!==w&&Kv(A,w);var k=Lv(xv(i,void 0,A))}else k=Bv(g,s,b,y,w,i);b>=m&&(f+=zv(s,m,b)+k,m=b+g.length)}return f+zv(s,m)}]}),!!Rv((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!Hv||$v);var Qv=H,Yv=Gt("iterator"),Jv=!Qv((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[Yv]||"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})),Xv=Oa,Zv=Math.floor,eg=function(e,t){var n=e.length,r=Zv(n/2);return n<8?tg(e,t):ng(e,eg(Xv(e,0,r),t),eg(Xv(e,r),t),t)},tg=function(e,t){for(var n,r,i=e.length,a=1;a<i;){for(r=a,n=e[a];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==a++&&(e[r]=n)}return e},ng=function(e,t,n,r){for(var i=t.length,a=n.length,s=0,o=0;s<i||o<a;)e[s+o]=s<i&&o<a?r(t[s],n[o])<=0?t[s++]:n[o++]:s<i?t[s++]:n[o++];return e},rg=eg,ig=Ti,ag=W,sg=Pe,og=X,dg=le,cg=Jv,ug=On.exports,lg=Ah,hg=$a,pg=au,fg=ur,mg=Ih,vg=De,gg=kt,bg=Xa,yg=Yi,_g=yn,wg=Re,Ag=Zi,kg=_a,Eg=ae,xg=ac,Sg=Xd,Dg=Xh,Tg=rg,Rg=Gt("iterator"),Ig=fg.set,Og=fg.getterFor("URLSearchParams"),Cg=fg.getterFor("URLSearchParamsIterator"),Pg=sg("fetch"),Lg=sg("Request"),Mg=sg("Headers"),Ug=Lg&&Lg.prototype,jg=Mg&&Mg.prototype,Bg=ag.RegExp,Gg=ag.TypeError,Ng=ag.decodeURIComponent,qg=ag.encodeURIComponent,Fg=dg("".charAt),Vg=dg([].join),Kg=dg([].push),Wg=dg("".replace),zg=dg([].shift),Hg=dg([].splice),$g=dg("".split),Qg=dg("".slice),Yg=/\+/g,Jg=Array(4),Xg=function(e){return Jg[e-1]||(Jg[e-1]=Bg("((?:%[\\da-f]{2}){"+e+"})","gi"))},Zg=function(e){try{return Ng(e)}catch(t){return e}},eb=function(e){var t=Wg(e,Yg," "),n=4;try{return Ng(t)}catch(e){for(;n;)t=Wg(t,Xg(n--),Zg);return t}},tb=/[!'()~]|%20/g,nb={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},rb=function(e){return nb[e]},ib=function(e){return Wg(qg(e),tb,rb)},ab=pg((function(e,t){Ig(this,{type:"URLSearchParamsIterator",iterator:xg(Og(e).entries),kind:t})}),"Iterator",(function(){var e=Cg(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}),!0),sb=function(e){this.entries=[],this.url=null,void 0!==e&&(wg(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===Fg(e,0)?Qg(e,1):e:Ag(e)))};sb.prototype={type:"URLSearchParams",bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,r,i,a,s,o,d=Sg(e);if(d)for(n=(t=xg(e,d)).next;!(r=og(n,t)).done;){if(a=(i=xg(_g(r.value))).next,(s=og(a,i)).done||(o=og(a,i)).done||!og(a,i).done)throw Gg("Expected sequence with length 2");Kg(this.entries,{key:Ag(s.value),value:Ag(o.value)})}else for(var c in e)gg(e,c)&&Kg(this.entries,{key:c,value:Ag(e[c])})},parseQuery:function(e){if(e)for(var t,n,r=$g(e,"&"),i=0;i<r.length;)(t=r[i++]).length&&(n=$g(t,"="),Kg(this.entries,{key:eb(zg(n)),value:eb(Vg(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],r=0;r<t.length;)e=t[r++],Kg(n,ib(e.key)+"="+ib(e.value));return Vg(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ob=function(){mg(this,db);var e=arguments.length>0?arguments[0]:void 0;Ig(this,new sb(e))},db=ob.prototype;if(lg(db,{append:function(e,t){Dg(arguments.length,2);var n=Og(this);Kg(n.entries,{key:Ag(e),value:Ag(t)}),n.updateURL()},delete:function(e){Dg(arguments.length,1);for(var t=Og(this),n=t.entries,r=Ag(e),i=0;i<n.length;)n[i].key===r?Hg(n,i,1):i++;t.updateURL()},get:function(e){Dg(arguments.length,1);for(var t=Og(this).entries,n=Ag(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){Dg(arguments.length,1);for(var t=Og(this).entries,n=Ag(e),r=[],i=0;i<t.length;i++)t[i].key===n&&Kg(r,t[i].value);return r},has:function(e){Dg(arguments.length,1);for(var t=Og(this).entries,n=Ag(e),r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){Dg(arguments.length,1);for(var n,r=Og(this),i=r.entries,a=!1,s=Ag(e),o=Ag(t),d=0;d<i.length;d++)(n=i[d]).key===s&&(a?Hg(i,d--,1):(a=!0,n.value=o));a||Kg(i,{key:s,value:o}),r.updateURL()},sort:function(){var e=Og(this);Tg(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=Og(this).entries,r=bg(e,arguments.length>1?arguments[1]:void 0),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new ab(this,"keys")},values:function(){return new ab(this,"values")},entries:function(){return new ab(this,"entries")}},{enumerable:!0}),ug(db,Rg,db.entries,{name:"entries"}),ug(db,"toString",(function(){return Og(this).serialize()}),{enumerable:!0}),hg(ob,"URLSearchParams"),ig({global:!0,forced:!cg},{URLSearchParams:ob}),!cg&&vg(Mg)){var cb=dg(jg.has),ub=dg(jg.set),lb=function(e){if(wg(e)){var t,n=e.body;if("URLSearchParams"===yg(n))return t=e.headers?new Mg(e.headers):new Mg,cb(t,"content-type")||ub(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),kg(e,{body:Eg(0,Ag(n)),headers:Eg(0,t)})}return e};if(vg(Pg)&&ig({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return Pg(e,arguments.length>1?lb(arguments[1]):{})}}),vg(Lg)){var hb=function(e){return mg(this,Ug),new Lg(e,arguments.length>1?lb(arguments[1]):{})};Ug.constructor=hb,hb.prototype=Ug,ig({global:!0,forced:!0},{Request:hb})}}var pb=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},fb=X,mb=yn,vb=ke,gb=pb,bb=Zi,yb=st,_b=Ev;ov("search",(function(e,t,n){return[function(t){var n=vb(this),r=null==t?void 0:yb(t,e);return r?fb(r,t,n):new RegExp(t)[e](bb(n))},function(e){var r=mb(this),i=bb(e),a=n(t,r,i);if(a.done)return a.value;var s=r.lastIndex;gb(s,0)||(r.lastIndex=0);var o=_b(r,i);return gb(r.lastIndex,s)||(r.lastIndex=s),null===o?-1:o.index}]}));var wb=Kr.includes,Ab=Fl;Ti({target:"Array",proto:!0},{includes:function(e){return wb(this,e,arguments.length>1?arguments[1]:void 0)}}),Ab("includes");var kb=Re,Eb=me,xb=Gt("match"),Sb=function(e){var t;return kb(e)&&(void 0!==(t=e[xb])?!!t:"RegExp"==Eb(e))},Db=Sb,Tb=W.TypeError,Rb=function(e){if(Db(e))throw Tb("The method doesn't accept regular expressions");return e},Ib=Gt("match"),Ob=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Ib]=!1,"/./"[e](t)}catch(e){}}return!1},Cb=Ti,Pb=Rb,Lb=ke,Mb=Zi,Ub=Ob,jb=le("".indexOf);Cb({target:"String",proto:!0,forced:!Ub("includes")},{includes:function(e){return!!~jb(Mb(Lb(this)),Mb(Pb(e)),arguments.length>1?arguments[1]:void 0)}});var Bb=Bi,Gb=X,Nb=le,qb=ov,Fb=Sb,Vb=yn,Kb=ke,Wb=Yh,zb=cv,Hb=jr,$b=Zi,Qb=st,Yb=Oa,Jb=Ev,Xb=gl,Zb=H,ey=Ku.UNSUPPORTED_Y,ty=Math.min,ny=[].push,ry=Nb(/./.exec),iy=Nb(ny),ay=Nb("".slice);function sy(e){var n=this,r={},i=(null==e?void 0:e._ancestor_origins)||window.location.ancestorOrigins,a=(null==e?void 0:e.self_url)||window.location.href,s=(null==e?void 0:e.self_origin)||window.location.origin,o=(null==e?void 0:e.referrer_url)||document.referrer;function d(e){return P(r,e)}function c(e,t){return L(r,e,t)}function u(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new I(e,t)}catch(e){console.log(e)}}function l(){for(var t=(null==e?void 0:e.urls)||[a,o],n=0;n<t.length;n++){var r,i=u(t[n]);if(i){var s=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(s&&(s=decodeURIComponent(s),O.isURL(s)))return s}}}return function(){var e;t(this,n),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){c("depth.error",e.message)}c("depth.value",e)}(),function(){var e=i,t=r.depth.value,n=s;if(c("top.domain.from","fallback"),e&&e.length>0)n=e[e.length-1],c("top.domain.from","origins");else if(0===t)n=s,c("top.domain.from","self-top");else if(1===t){var a=u(o);a&&(n=a.origin,c("top.domain.from","referrer"))}c("top.domain.value",n.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=l();if(e)if(C(e))c("partner.domain.value",e),c("partner.domain.from","partner-domain");else{var t=u(e,!1);if(t)c("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),c("partner.domain.from","partner-url");else c("partner.domain.value",r.top.domain.value),c("partner.domain.from","partner-fallback")}else c("partner.domain.value",r.top.domain.value),c("partner.domain.from","fallback")}(),e=l(),0===r.depth.value?(c("partner.url.value",a),c("partner.url.from","self-top")):e?C(e)?(c("partner.url.value",a),c("partner.url.from","partner-domain")):(c("partner.url.value",e),c("partner.url.from","partner-url")):(c("partner.url.value",o),c("partner.url.from","fallback"))}.bind(this)(),{get:d,print:function(e){console.log(d(e))}}}qb("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=$b(Kb(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!Fb(e))return Gb(t,r,e,i);for(var a,s,o,d=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,l=new RegExp(e.source,c+"g");(a=Gb(Xb,l,r))&&!((s=l.lastIndex)>u&&(iy(d,ay(r,u,a.index)),a.length>1&&a.index<r.length&&Bb(ny,d,Yb(a,1)),o=a[0].length,u=s,d.length>=i));)l.lastIndex===a.index&&l.lastIndex++;return u===r.length?!o&&ry(l,"")||iy(d,""):iy(d,ay(r,u)),d.length>i?Yb(d,0,i):d}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:Gb(t,this,e,n)}:t,[function(t,n){var i=Kb(this),a=null==t?void 0:Qb(t,e);return a?Gb(a,t,i,n):Gb(r,$b(i),t,n)},function(e,i){var a=Vb(this),s=$b(e),o=n(r,a,s,i,r!==t);if(o.done)return o.value;var d=Wb(a,RegExp),c=a.unicode,u=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(ey?"g":"y"),l=new d(ey?"^(?:"+a.source+")":a,u),h=void 0===i?4294967295:i>>>0;if(0===h)return[];if(0===s.length)return null===Jb(l,s)?[s]:[];for(var p=0,f=0,m=[];f<s.length;){l.lastIndex=ey?0:f;var v,g=Jb(l,ey?ay(s,f):s);if(null===g||(v=ty(Hb(l.lastIndex+(ey?f:0)),s.length))===p)f=zb(s,f,c);else{if(iy(m,ay(s,p,f)),m.length===h)return m;for(var b=1;b<=g.length-1;b++)if(iy(m,g[b]),m.length===h)return m;f=p=v}}return iy(m,ay(s,p)),m}]}),!!Zb((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]})),ey);var oy={name:"@bygd/gd-sdk-pes",version:"1.28.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.4","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"}},dy="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==dy&&dy,cy="URLSearchParams"in dy,uy="Symbol"in dy&&"iterator"in Symbol,ly="FileReader"in dy&&"Blob"in dy&&function(){try{return new Blob,!0}catch(e){return!1}}(),hy="FormData"in dy,py="ArrayBuffer"in dy;if(py)var fy=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],my=ArrayBuffer.isView||function(e){return e&&fy.indexOf(Object.prototype.toString.call(e))>-1};function vy(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 gy(e){return"string"!=typeof e&&(e=String(e)),e}function by(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return uy&&(t[Symbol.iterator]=function(){return t}),t}function yy(e){this.map={},e instanceof yy?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 _y(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function wy(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function Ay(e){var t=new FileReader,n=wy(t);return t.readAsArrayBuffer(e),n}function ky(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Ey(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:ly&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:hy&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:cy&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():py&&ly&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=ky(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):py&&(ArrayBuffer.prototype.isPrototypeOf(e)||my(e))?this._bodyArrayBuffer=ky(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):cy&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},ly&&(this.blob=function(){var e=_y(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=_y(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(Ay)}),this.text=function(){var e=_y(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=wy(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)},hy&&(this.formData=function(){return this.text().then(Dy)}),this.json=function(){return this.text().then(JSON.parse)},this}yy.prototype.append=function(e,t){e=vy(e),t=gy(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},yy.prototype.delete=function(e){delete this.map[vy(e)]},yy.prototype.get=function(e){return e=vy(e),this.has(e)?this.map[e]:null},yy.prototype.has=function(e){return this.map.hasOwnProperty(vy(e))},yy.prototype.set=function(e,t){this.map[vy(e)]=gy(t)},yy.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},yy.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),by(e)},yy.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),by(e)},yy.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),by(e)},uy&&(yy.prototype[Symbol.iterator]=yy.prototype.entries);var xy=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Sy(e,t){if(!(this instanceof Sy))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 Sy){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new yy(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 yy(t.headers)),this.method=function(e){var t=e.toUpperCase();return xy.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 Dy(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function Ty(e,t){if(!(this instanceof Ty))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 yy(t.headers),this.url=t.url||"",this._initBody(e)}Sy.prototype.clone=function(){return new Sy(this,{body:this._bodyInit})},Ey.call(Sy.prototype),Ey.call(Ty.prototype),Ty.prototype.clone=function(){return new Ty(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new yy(this.headers),url:this.url})},Ty.error=function(){var e=new Ty(null,{status:0,statusText:""});return e.type="error",e};var Ry=[301,302,303,307,308];Ty.redirect=function(e,t){if(-1===Ry.indexOf(t))throw new RangeError("Invalid status code");return new Ty(null,{status:t,headers:{location:e}})};var Iy=dy.DOMException;try{new Iy}catch(e){Iy=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},Iy.prototype=Object.create(Error.prototype),Iy.prototype.constructor=Iy}function Oy(e,t){return new Promise((function(n,r){var i=new Sy(e,t);if(i.signal&&i.signal.aborted)return r(new Iy("Aborted","AbortError"));var a=new XMLHttpRequest;function s(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new yy,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 i=n.join(":").trim();t.append(r,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;setTimeout((function(){n(new Ty(i,r))}),0)},a.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.onabort=function(){setTimeout((function(){r(new Iy("Aborted","AbortError"))}),0)},a.open(i.method,function(e){try{return""===e&&dy.location.href?dy.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?a.withCredentials=!0:"omit"===i.credentials&&(a.withCredentials=!1),"responseType"in a&&(ly?a.responseType="blob":py&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(a.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof yy?i.headers.forEach((function(e,t){a.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){a.setRequestHeader(e,gy(t.headers[e]))})),i.signal&&(i.signal.addEventListener("abort",s),a.onreadystatechange=function(){4===a.readyState&&i.signal.removeEventListener("abort",s)}),a.send(void 0===i._bodyInit?null:i._bodyInit)}))}Oy.polyfill=!0,dy.fetch||(dy.fetch=Oy,dy.Headers=yy,dy.Request=Sy,dy.Response=Ty);var Cy,Py=Array.isArray,Ly=Object.prototype.toString,My=Py||function(e){return!!e&&"[object Array]"==Ly.call(e)},Uy=function(e){var t=jy("object"===n(e)?e:i(e));return t&&t.version?oy.version>=t.version?t:void 0:t},jy=function(e){var n=this;if(!My(e)||0===e.length)return e;if(1===e.length)return e[0];var r=0;e.forEach(function(e){t(this,n),e.weight=e.weight||1,r+=e.weight}.bind(this));var i=Math.floor(Math.random()*Math.floor(r));r=0;for(var a=0;a<e.length;a++){var s=e[a];if(i<(r+=s.weight))return s}},By=function(){return Cy},Gy=function(e){var n=this,r=new sy;r.get();var i=r.get("partner.domain.value"),s=function(){return t(this,n),{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),o=function(){t(this,n);var r=d(),a=r?"&mode=".concat(r):"";return"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(i).concat(a,"&v=").concat(oy.version,"&localTime=").concat((new Date).getHours())}.bind(this),d=function(){var e=this;t(this,n);var r=new Proxy(new URLSearchParams(window.location.search),{get:function(n,r){return t(this,e),n.get(r)}.bind(this)});return!r.gd_mode&&window.location.search.includes("gd_mode")?window.location.search.split("gd_mode=")[1]:r.gd_mode}.bind(this);return new Promise(function(e){var r=this;if(t(this,n),Cy)e(Cy);else{var i=s(),d=o();fetch(d).then(function(e){return t(this,r),e.json()}.bind(this)).then(function(n){if(t(this,r),n.success){var s,o,d,c,u=n.result.game,l={gameId:u.gameMd5,slug:u.slug,pname:u.pname,dname:u.dname,status:u.status,description:u.description,enableAds:!0===u.enableAds||!0===(null===(s=u.enableAds)||void 0===s?void 0:s.enabled),preroll:u.preRoll,midroll:6e4*u.timeAds,rewardedAds:u.rewardedAds,title:u.title,tags:u.tags,category:u.category,assets:u.assets,disp_2nd_prer:u.disp_2nd_prer,ctry_vst:u.ctry_vst,ctry:u.ctry,crtv:u.crtv,dmain:u.dmain,__t4r:u.__t4r||{},block_exts:Uy(u.push_cuda),bloc_gard:Uy(u.bloc_gard),cookie:Uy(u.cookie),gdpr:Uy(u.gdpr),diagnostic:Uy(u.diagnostic),cmp:Uy(u.cmp),gft:Uy(u.gft)||{},sdk:Uy(u.sdk)||{},sdkfw:Uy(u.sdkfw)||{},loader:Uy(u.loader)||{},splash:Uy(u.splash)||{},promo:Uy(u.promo)||{},dAds:Uy(u.dads)||{},pAds:Uy(u.pads)||{},mAds:Uy(u.mads)||{},rAds:Uy(u.rads)||{},lp:Uy(u.lp)||{},extsc:Uy(u.extsc)||{},evnts:Uy(u.evnts)||{},dp:Uy(u.dp)||{}},h=a(M(i),l);h.afg_disabled=!1===(null===(o=h.sdk)||void 0===o||null===(d=o.afg)||void 0===d?void 0:d.enabled),null!==(c=h.pAds)&&void 0!==c&&c.enabled&&(h.preroll=!0),Cy=h,e(h)}else i.failed=!0,e(i)}.bind(this)).catch(function(n){t(this,r),console.log("gd:adp failed game data",n),i.failed=!0,e(i)}.bind(this))}}.bind(this))},Ny=function(){var e,t=By();return!(null==t||null===(e=t.sdkfw)||void 0===e||!e.enabled)},qy=function(){var e,t,n,r,i,a,s=By(),o=!(null==s||null===(e=s.extsc)||void 0===e||!e.enabled);return{enabled:o,path:o?null==s||null===(t=s.extsc)||void 0===t?void 0:t.path:"",name:o?null==s||null===(n=s.extsc)||void 0===n?void 0:n.name:"",ref:o?null==s||null===(r=s.extsc)||void 0===r?void 0:r.ref:"",loadedFlag:o?null==s||null===(i=s.extsc)||void 0===i?void 0:i.loadedFlag:void 0,loadedFlagCheck:!!o&&!(null==s||null===(a=s.extsc)||void 0===a||!a.loadedFlagCheck)}},Fy=function(){var n=e(r.mark((function e(){var n,i,a,d,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=qy()).enabled){e.next=3;break}return e.abrupt("return");case 3:return i=n.path,a=n.name,d=n.ref,e.prev=4,c={},e.next=8,o(i,a,{error_prefix:"Blocked:",exists:function(){return t(this,u),!!d&&!!window[d]}.bind(this),attrs:c});case 8:console.log("extsc: after external partner script load",a,i),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(4),console.log("extsc: error on external partner script load",a,e.t0),s("DEVELOPER_ERROR",e.t0,"warning");case 15:case"end":return e.stop()}}),e,this,[[4,11]])})));return function(){return n.apply(this,arguments)}}(),Vy=!1,Ky=!1,Wy=function(){var e=this;return new Promise(function(n,r){var i=this;if(t(this,e),Vy)return n(Ky);Vy=!0;var a=qy();if(!a.enabled)return n(!1);var s=a.loadedFlag,o=a.loadedFlagCheck;if(o&&!s)return n(!1);if(!o)return Ky=!0,n(!0);var d=!0;setTimeout(function(){t(this,i),d&&(console.log("extsc: clearing on wait after timeout"),d=!1,Vy=!0,n(!1))}.bind(this),5e3);var c=setInterval(function(){t(this,i),d&&o&&window[s]?(console.log("extsc: loaderflag for external script is set!"),d=!1,Vy=!0,Ky=!0,clearInterval(c),n(!0)):d||(console.log("extsc: clearing interval after timeout"),clearInterval(c))}.bind(this),100)}.bind(this))},zy=function(e){var n=function(e){var n=this,r=function(e){return t(this,n),l("showAd",{adType:e})}.bind(this),i=function(e){return t(this,n),l("preloadAd",{adType:e})}.bind(this),a=function(e){return t(this,n),l("showDisplayAd",{options:e})}.bind(this),s=function(){return t(this,n),l("cancelAd")}.bind(this),o=function(){return t(this,n),l("openConsole")}.bind(this),d=function(){return t(this,n),l("showBanner")}.bind(this),c=function(){return t(this,n),l("session")}.bind(this),u=function(){t(this,n),console.log("_sendSDKReady")}.bind(this),l=function(e,r){var i=this;return t(this,n),r||(r={}),new Promise(function(n,a){t(this,i);try{var s={type:"gd-sdk",method:e,options:r};window.parent.postMessage(s,"https://html5.gamedistribution.com"),n()}catch(e){console.log("gd:adp:m:s:error",e),n()}}.bind(this))}.bind(this),h=function(){t(this,n),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&&(console.log("gd:adp received on-event",r),r&&f(r))}),!1)}.bind(this),p=function(){t(this,n),h(),l("init")}.bind(this),f=function(r){t(this,n),e.onEvent&&e.onEvent(r)}.bind(this);return{showBanner:d,showAd:r,preloadAd:i,showDisplayAd:a,cancelAd:s,openConsole:o,getSession:c,onEvent:f,init:p,_sendSDKReady:u}}(e);return n.init(),n},Hy=function(){var e=this;return{isMasterGameURL:function(){t(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)}.bind(this),isTokenGameURL:function(){t(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i.test(location.href)}.bind(this),isExtHostedGameURL:function(){t(this,e);return/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i.test(location.href)}.bind(this)}},$y=function(e){var n=this;return new Promise(function(r,i){var a=this;t(this,n);var s={type:"gd-sdk-frame-handshake-request"},o=!1;window.addEventListener("message",(function(e){var t=e.data,n=e.origin,i=e.source,a=t.type;if("gd-sdk-frame-handshake-request"===a){var s={type:"gd-sdk-frame-handshake-response"};i.postMessage(s,n)}else"gd-sdk-frame-handshake-response"===a&&(o=!0,r({origin:n,source:i}))})),e?r():(setTimeout(function(){t(this,a),o||r()}.bind(this),200),window.parent!==window?window.parent.postMessage(s,"*"):r())}.bind(this))},Qy=function(){var t=e(r.mark((function e(t){var n,i,a,s,o,d,c,u,l,h;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Gy(t);case 2:return e.next=5,Ny();case 5:return n=e.sent,console.log("gd:adp ,isSDKForwardEnable",n),i=!n,e.next=10,$y(i);case 10:if(a=e.sent,n){e.next=13;break}return e.abrupt("return",!1);case 13:return s=Hy(),o=s.isMasterGameURL,d=s.isTokenGameURL,c=o(),u=d(),r=void 0,p=void 0,p=By(),l=Ny()&&!(null==p||null===(r=p.sdkfw)||void 0===r||!r.handshake),h=!1,h=l?!c&&!!a:!c,console.log("gd:adp: frameCheck result",{_isMasterGameURL:c,_isTokenGameURL:u,isHandshakeEnabled:l,hsResult:a,result:h}),e.abrupt("return",h);case 21:case"end":return e.stop()}var r,p}),e)})));return function(e){return t.apply(this,arguments)}}(),Yy=$,Jy=le,Xy=Oi,Zy=Se,e_=Jy(Z.f),t_=Jy([].push),n_=function(e){return function(t){for(var n,r=Zy(t),i=Xy(r),a=i.length,s=0,o=[];a>s;)n=i[s++],Yy&&!e_(r,n)||t_(o,e?[n,r[n]]:r[n]);return o}},r_={entries:n_(!0),values:n_(!1)}.values;Ti({target:"Object",stat:!0},{values:function(e){return r_(e)}});var i_=Ti,a_=_h,s_=H,o_=Pe,d_=De,c_=Yh,u_=sf,l_=On.exports;if(i_({target:"Promise",proto:!0,real:!0,forced:!!a_&&s_((function(){a_.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=c_(this,o_("Promise")),n=d_(e);return this.then(n?function(n){return u_(t,e()).then((function(){return n}))}:e,n?function(n){return u_(t,e()).then((function(){throw n}))}:e)}}),d_(a_)){var h_=o_("Promise").prototype.finally;a_.prototype.finally!==h_&&l_(a_.prototype,"finally",h_,{unsafe:!0})}var p_=ke,f_=Zi,m_=le("".replace),v_="[\t\n\v\f\r                 \u2028\u2029\ufeff]",g_=RegExp("^"+v_+v_+"*"),b_=RegExp(v_+v_+"*$"),y_=function(e){return function(t){var n=f_(p_(t));return 1&e&&(n=m_(n,g_,"")),2&e&&(n=m_(n,b_,"")),n}},__={start:y_(1),end:y_(2),trim:y_(3)},w_=vr.PROPER,A_=H,k_="\t\n\v\f\r                 \u2028\u2029\ufeff",E_=__.trim;Ti({target:"String",proto:!0,forced:function(e){return A_((function(){return!!k_[e]()||"​…᠎"!=="​…᠎"[e]()||w_&&k_[e].name!==e}))}("trim")},{trim:function(){return E_(this)}});var x_=De,S_=Re,D_=pu,T_=$,R_=W,I_=le,O_=_i,C_=function(e,t,n){var r,i;return D_&&x_(r=t.constructor)&&r!==n&&S_(i=r.prototype)&&i!==n.prototype&&D_(e,i),e},P_=In,L_=pn.f,M_=Dr.f,U_=Le,j_=Sb,B_=Zi,G_=Gu,N_=Ku,q_=On.exports,F_=H,V_=kt,K_=ur.enforce,W_=Dh,z_=Hu,H_=Yu,$_=Gt("match"),Q_=R_.RegExp,Y_=Q_.prototype,J_=R_.SyntaxError,X_=I_(G_),Z_=I_(Y_.exec),ew=I_("".charAt),tw=I_("".replace),nw=I_("".indexOf),rw=I_("".slice),iw=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,aw=/a/g,sw=/a/g,ow=new Q_(aw)!==aw,dw=N_.MISSED_STICKY,cw=N_.UNSUPPORTED_Y,uw=T_&&(!ow||dw||z_||H_||F_((function(){return sw[$_]=!1,Q_(aw)!=aw||Q_(sw)==sw||"/a/i"!=Q_(aw,"i")})));if(O_("RegExp",uw)){for(var lw=function(e,t){var n,r,i,a,s,o,d=U_(Y_,this),c=j_(e),u=void 0===t,l=[],h=e;if(!d&&c&&u&&e.constructor===lw)return e;if((c||U_(Y_,e))&&(e=e.source,u&&(t="flags"in h?h.flags:X_(h))),e=void 0===e?"":B_(e),t=void 0===t?"":B_(t),h=e,z_&&"dotAll"in aw&&(r=!!t&&nw(t,"s")>-1)&&(t=tw(t,/s/g,"")),n=t,dw&&"sticky"in aw&&(i=!!t&&nw(t,"y")>-1)&&cw&&(t=tw(t,/y/g,"")),H_&&(a=function(e){for(var t,n=e.length,r=0,i="",a=[],s={},o=!1,d=!1,c=0,u="";r<=n;r++){if("\\"===(t=ew(e,r)))t+=ew(e,++r);else if("]"===t)o=!1;else if(!o)switch(!0){case"["===t:o=!0;break;case"("===t:Z_(iw,rw(e,r+1))&&(r+=2,d=!0),i+=t,c++;continue;case">"===t&&d:if(""===u||V_(s,u))throw new J_("Invalid capture group name");s[u]=!0,a[a.length]=[u,c],d=!1,u="";continue}d?u+=t:i+=t}return[i,a]}(e),e=a[0],l=a[1]),s=C_(Q_(e,t),d?this:Y_,lw),(r||i||l.length)&&(o=K_(s),r&&(o.dotAll=!0,o.raw=lw(function(e){for(var t,n=e.length,r=0,i="",a=!1;r<=n;r++)"\\"!==(t=ew(e,r))?a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),i+=t):i+="[\\s\\S]":i+=t+ew(e,++r);return i}(e),n)),i&&(o.sticky=!0),l.length&&(o.groups=l)),e!==h)try{P_(s,"source",""===h?"(?:)":h)}catch(e){}return s},hw=function(e){e in lw||L_(lw,e,{configurable:!0,get:function(){return Q_[e]},set:function(t){Q_[e]=t}})},pw=M_(Q_),fw=0;pw.length>fw;)hw(pw[fw++]);Y_.constructor=lw,lw.prototype=Y_,q_(R_,"RegExp",lw)}W_("RegExp");var mw=le,vw=vr.PROPER,gw=On.exports,bw=yn,yw=Le,_w=Zi,ww=H,Aw=Gu,kw=RegExp.prototype,Ew=kw.toString,xw=mw(Aw),Sw=ww((function(){return"/a/b"!=Ew.call({source:"a",flags:"b"})})),Dw=vw&&"toString"!=Ew.name;(Sw||Dw)&&gw(RegExp.prototype,"toString",(function(){var e=bw(this),t=_w(e.source),n=e.flags;return"/"+t+"/"+_w(void 0===n&&yw(kw,e)&&!("flags"in kw)?xw(e):n)}),{unsafe:!0});var Tw,Rw=Ti,Iw=le,Ow=z.f,Cw=jr,Pw=Zi,Lw=Rb,Mw=ke,Uw=Ob,jw=Iw("".startsWith),Bw=Iw("".slice),Gw=Math.min,Nw=Uw("startsWith");Rw({target:"String",proto:!0,forced:!!(Nw||(Tw=Ow(String.prototype,"startsWith"),!Tw||Tw.writable))&&!Nw},{startsWith:function(e){var t=Pw(Mw(this));Lw(e);var n=Cw(Gw(arguments.length>1?arguments[1]:void 0,t.length)),r=Pw(e);return jw?jw(t,r,n):Bw(t,n,n+r.length)===r}});var qw=Ti,Fw=Ts.find,Vw=Fl,Kw=!0;"find"in[]&&Array(1).find((function(){Kw=!1})),qw({target:"Array",proto:!0,forced:Kw},{find:function(e){return Fw(this,e,arguments.length>1?arguments[1]:void 0)}}),Vw("find");var Ww=$,zw=le,Hw=X,$w=H,Qw=Oi,Yw=ei,Jw=Z,Xw=_t,Zw=we,eA=Object.assign,tA=Object.defineProperty,nA=zw([].concat),rA=!eA||$w((function(){if(Ww&&1!==eA({b:1},eA(tA({},"a",{enumerable:!0,get:function(){tA(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!=eA({},e)[n]||Qw(eA({},t)).join("")!=r}))?function(e,t){for(var n=Xw(e),r=arguments.length,i=1,a=Yw.f,s=Jw.f;r>i;)for(var o,d=Zw(arguments[i++]),c=a?nA(Qw(d),a(d)):Qw(d),u=c.length,l=0;u>l;)o=c[l++],Ww&&!Hw(s,d,o)||(n[o]=d[o]);return n}:eA,iA=rA;Ti({target:"Object",stat:!0,forced:Object.assign!==iA},{assign:iA});var aA=function(){function e(t){T(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return D(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 n={},r=this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled,i=new I(location.href,!0);for(var a in i.query)n[a]=i.query[a];return Object.keys(n).filter(function(n){var r=this;return t(this,e),this.customParamKeys.some(function(e){return t(this,r),e===n}.bind(this))}.bind(this)).length>0||r?(console.log("custom-params",n,r),n):void console.log("custom-params, none")}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),sA=function(){function e(t,n){T(this,e),this.adContainer=t,this.onResume=n}return D(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 n=document.createElement("div");this.adResumeButton=n,n.id="gd__resume__button",n.setAttribute("title","Resume"),this.addStyles(),n.classList.add("gd__resume__button"),n.addEventListener("click",function(){t(this,e),this.onResume()}.bind(this)),this.adContainer.appendChild(n);var r=document.createElement("div");this.adResumeButtonOverlay=r,r.id="gd__resume__button__overlay",r.classList.add("gd__resume__button__overlay"),this.adContainer.appendChild(r)}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}(),oA=function(e){if(!e)return!1;var t=dA.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)},dA=Object.prototype.toString;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 uA(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){R(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}function lA(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 hA(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 pA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hA(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var fA=null,mA=function(){function n(e,r,i){var s=this;if(T(this,n),fA)return fA;fA=this;var o={debug:!1,width:640,height:360,locale:"en"};this.options=r?a(o,r):o,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new p,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=i.parentDomain,this.topDomain=i.topDomain,this.parentURL=i.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=f(),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=""!==e?document.getElementById(e):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 d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:d,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:c,this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){t(this,s),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){t(this,s),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var i,s,m,v,g,b,y,_,w,A,k,E,x,S,O,C,P,L,q;return D(n,[{key:"start",value:(q=e(r.mark((function e(){return r.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(),e.next=14;break;case 11:throw e.prev=11,e.t0=e.catch(0),new Error(e.t0);case 14:case"end":return e.stop()}}),e,this,[[0,11]])}))),function(){return q.apply(this,arguments)})},{key:"_getAdVast",value:function(n,i){var a=this;return new Promise(function(){var s=e(r.mark((function e(s){var o,c,u,l,h,p,f,m,v=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(d.available&&d.getBoolean("gd_debug_ex")&&d.getBoolean("gd_tag"))){e.next=6;break}return o=a.IMASampleTags[n],c=Math.floor(Math.random()*o.length),u=o[c],s({url:u}),e.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){e.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return e.prev=8,l=a.nextAdPosition(n),a.eventBus.broadcast("AD_REQUEST",{message:l}),h=a.options,"preroll"===l&&j(h.preroll)?h=h.preroll:"midroll"===l&&j(h.midroll)?h=h.midroll:"rewarded"===l&&j(h.rewarded)&&(h=h.rewarded),p="rewarded"===l?"rewardedVideo":"gdbanner"===l?"gd__banner":"midroll"===l?"midroll":"video1",e.next=16,window.idhb.isLoaded();case 16:if(f={tnl_keys:pA(pA({},window.idhb.getAdserverTargetingForAdSlot(p)),{},{tnl_ad_pos:l,tnl_asset_id:a.gameData.gameId})},!(i&&i.retry_on_success&&j(h.retry_on_success)&&j(h.retry_on_success.vast))){e.next=21;break}return e.abrupt("return",s(a._createCustomAdVastUrl(h.retry_on_success.vast,f)));case 21:if(!(i&&i.retry_on_failure&&a.options.retry_on_failure&&j(h.retry_on_failure.vast))){e.next=25;break}return e.abrupt("return",s(a._createCustomAdVastUrl(h.retry_on_failure.vast,f)));case 25:if(!j(h.vast)){e.next=27;break}return e.abrupt("return",s(a._createCustomAdVastUrl(h.vast,f)));case 27:return e.next=29,a._create_dp_context(l,i);case 29:m=e.sent,window.idhb.requestAds({slots:R({},p,{bidFloor:null!=m&&m.floor_price?m.floor_price:void 0}),callback:function(e,n){var r=this;t(this,v),!m||null!=n&&n.bidFloorApplied||fetch(m.skip_url).catch(function(e){t(this,r)}.bind(this)),s({tnl_keys:pA(pA({},window.idhb.getAdserverTargetingForAdSlot(p)),{},{tnl_ad_pos:l,tnl_asset_id:a.gameData.gameId}),url:e,dp:m,hl:n})}.bind(this)}),e.next=36;break;case 33:throw e.prev=33,e.t0=e.catch(8),new Error(e.t0);case 36:case"end":return e.stop()}}),e,this,[[8,33]])})));return function(e){return s.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===c.Rewarded)return this.adRewardedCount++,"rewarded";if(e===c.Interstitial){var t=!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount;return t?this.adMidrollCount++:this.adPrerollCount++,t||this.adMidrollCount>0?"midroll":"preroll"}return"midroll"}},{key:"getAdPosition",value:function(e){return e===c.Rewarded?"rewarded":e===c.Interstitial?!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_requestAd",value:function(e,n){var r=this;return n=n||{},new Promise(function(i){if(t(this,r),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var a,s=null==e||null===(a=e.tnl_keys)||void 0===a?void 0:a.tnl_ad_pos;this.adSuccess=!1;var o=new google.ima.AdsRequest,d=this._transformVast(e,n),c=pA(pA({},n),{},{adTag:d,tnl_ad_pos:s});this.adCounter[s]=this.adCounter[s]||0,this.adCounter[s]++;var u=e.dp,l=e.hl;if(u&&(u.adtag_url=d.url,this._extend_dp_with_adsense(u,l,null==e?void 0:e.tnl_keys)),this._isVMAP(s)){var h=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,i=Date.now(),a=new I(e.adtag_url_1,!0);a.query=uA(uA({},a.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:i,output:"xml_vast3"});var s=a.toString(),o=new I(e.adtag_url_2,!0);o.query=uA(uA({},o.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++i,output:"xml_vast3"});var d=o.toString(),c=Date.now();return'<?xml version="1.0" encoding="UTF-8"?>\n<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-1">\n <vmap:AdSource id="'.concat(c++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(lA({id:c++,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(c++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(lA({id:c++,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:u,adtag:d,position:"preroll"===c.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(s)}));o.adsResponse=h}else if(u&&l.bidFloorApplied){var p=function(e){return e.promo_url?e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="2" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(u);o.adsResponse=p}else if(u&&u.fallback_url){var f=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()}(u);o.adsResponse=f}else 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(n.autoplayAllowed),o.setAdWillPlayMuted(n.autoplayRequiresMute),this.adsLoader.requestAds(o,c);try{this.eventBus.broadcast("AD_SDK_REQUEST",{message:c})}catch(e){}i(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.eventBus.broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameData.gameId}})}}},{key:"_checkAutoPlay",value:(L=e(r.mark((function e(){var n=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,r){var i=this;t(this,n);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):U.video({inline:!0,muted:!1}).then(function(n){t(this,i);var r=n.result;n.error,e(!0===r?{autoplayAllowed:!0,autoplayRequiresMute:!1}:{autoplayAllowed:!0,autoplayRequiresMute:!0})}.bind(this))}.bind(this)));case 1:case"end":return e.stop()}}),e,this)}))),function(){return L.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(P=e(r.mark((function e(){var t;return r.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 P.apply(this,arguments)})},{key:"startAd",value:(C=e(r.mark((function e(t){var n,i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.gameData.afg_disabled,i=t.adType,a=t.params,this.adType_=i,console.log("gd:adp startAd afgDisabled",n),i!==c.Interstitial){e.next=24;break}if(!n){e.next=9;break}return e.abrupt("return",this._startInterstitialAd(a));case 9:if("preroll"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=13;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 13:if("start"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=17;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 17:if("next"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=21;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 21:return e.abrupt("return",this._startInterstitialAd(a));case 22:case 30:e.next=33;break;case 24:if(i!==c.Rewarded){e.next=32;break}if(!n){e.next=29;break}return e.abrupt("return",this._startRewardedAd(a));case 29:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 32:throw new Error("Unsupported ad type");case 33:case"end":return e.stop()}}),e,this)}))),function(e){return C.apply(this,arguments)})},{key:"preloadAd",value:(O=e(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==c.Interstitial){e.next=4;break}return e.abrupt("return","gdsdk://preloaded");case 4:if(t!==c.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 O.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,n=function(){t(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new sA(this.adContainer,n),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(S=e(r.mark((function n(i){var a=this;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise(function(){var n=e(r.mark((function e(n,s){var o,d,c,l,h,p,f,m,v,g=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(d=i?i.containerId:null)||s("Container id is not specified"),c=document.getElementById(d),document.getElementById(d)||s("No container is found with this id - ".concat(d)),void 0===window.idhb.requestAds&&s("Prebid.js wrapper script hit an error or didn't exist!"),l=i.slotId?i.slotId:"gd__banner@".concat(d),document.getElementById(l)||(h="\n .gd__banner{\n z-index: ".concat(u.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((p=document.createElement("style")).type="text/css",p.id="gd__banner__style",p.styleSheet?p.styleSheet.cssText=h:p.appendChild(document.createTextNode(h)),c.appendChild(p)),(f=document.createElement("div")).id=l,f.classList.add("gd__banner"),c.appendChild(f)),e.next=10,a._create_dp_display_context();case 10:a.atom_display=e.sent,null!==(o=a.atom_display)&&void 0!==o&&o.params&&window.idhb.setAdserverTargeting(null===(m=a.atom_display)||void 0===m?void 0:m.params),(v={})[l]={maxSize:[c.offsetWidth,c.offsetHeight]},window.idhb.requestAds({slots:v,callback:function(e){t(this,g)}.bind(this)}),n(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),s(e.t0.message||e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(e,t){return n.apply(this,arguments)}}()));case 1:case"end":return n.stop()}}),n)}))),function(e){return S.apply(this,arguments)})},{key:"_startInterstitialAd",value:(x=e(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,e.next=7,this._initDisplayContainerWithAutoPlay();case 7:return n=e.sent,e.next=10,this._loadInterstitialAd(pA(pA({},n),t));case 10:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return x.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(E=e(r.mark((function e(n){var i,a,s=this;return r.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(c.Interstitial,n);case 6:e.t0=e.sent;case 7:return i=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(i,pA({adType:c.Interstitial},n));case 11:return a=e.sent,e.next=14,new Promise(function(e,n){var r=this;t(this,s);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var a=function(n){t(this,r),this.eventBus.unsubscribeScope(i),e(n.message)}.bind(this),o=function(e){t(this,r),this.eventBus.unsubscribeScope(i),n(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,i),this.eventBus.subscribe("AD_SDK_CANCELED",o,i),this.eventBus.subscribe("AD_ERROR",o,i)}.bind(this));case 14:return e.abrupt("return",a);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 E.apply(this,arguments)})},{key:"_startRewardedAd",value:(k=e(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,e.next=7,this._initDisplayContainerWithAutoPlay();case 7:return n=e.sent,e.next=10,this._loadRewardedAd(pA(pA({},n),t));case 10:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return k.apply(this,arguments)})},{key:"_loadRewardedAd",value:(A=e(r.mark((function e(n){var i,a,s=this;return r.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(c.Rewarded,n);case 6:e.t0=e.sent;case 7:return i=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(i,pA({adType:c.Rewarded},n));case 11:return a=e.sent,e.next=14,new Promise(function(e,n){var r=this;t(this,s);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var a=function(n){t(this,r),this.eventBus.unsubscribeScope(i),e(n.message)}.bind(this),o=function(e){t(this,r),this.eventBus.unsubscribeScope(i),n(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,i),this.eventBus.subscribe("AD_SDK_CANCELED",o,i),this.eventBus.subscribe("AD_ERROR",o,i)}.bind(this));case 14:return e.abrupt("return",a);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 A.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(w=e(r.mark((function e(){return r.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(c.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 w.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(_=e(r.mark((function e(){return r.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(c.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 _.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 n=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var r=null==e?void 0:e.mode;e.t4r=Uy(this.gameData.__t4r)||{};var i=this._isT4R(e),a=this._getT4ROptions(e);if("loaded"===r)this.activeAdContainer.style.opacity=i?.001:1,i&&this.adsManager.setVolume(0),i&&this.eventBus.broadcast("AD_T4R"),i&&setTimeout(function(){t(this,n),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"===r||"first_quartile"===r){if(i&&"click"===r){var s,o=null===(s=this._adrequest_user_context)||void 0===s?void 0:s.tnl_ad_pos;this.clickCount[o]++}this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}}}},{key:"_createPlayer",value:function(){var e=this,n=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=u.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 r=document.createElement("video");r.setAttribute("playsinline",!0),r.setAttribute("webkit-playsinline",!0),r.id="".concat(this.prefix,"advertisement_video"),r.style.position="absolute",r.style.backgroundColor="#000000",r.style.top="0",r.style.left="0",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",this.video_ad_player=r,this.adContainer.appendChild(r);var i=document.createElement("div");i.id="".concat(this.prefix,"advertisement_slot"),i.style.position="absolute",i.style.top="0",i.style.left="0",i.style.width=this.options.width+"px",i.style.height=this.options.height+"px",this.adContainerInner=i,this.activeAdContainer=this.adContainer,this.thirdPartyContainer?(this.adContainer.appendChild(i),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(i),n.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var a=function(){t(this,e);var n=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:n,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:a,i.style.width=this.options.width+"px",i.style.height=this.options.height+"px",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px"}.bind(this);window.addEventListener("resize",a),window.document.addEventListener("DOMContentLoaded",a)}},{key:"_setUpIMA",value:function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.adContainerInner,this.video_ad_player),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setDisableCustomPlaybackForIOS10Plus(!0),this.adsLoader.getSettings().setLocale(this.options.locale),this.adsLoader.getSettings().setVpaidMode(this._getVPAIDMode()),this.adsLoader.getSettings().setAutoPlayAdBreaks(!0);var e=this.adsLoader.getSettings().getNumRedirects();this.adsLoader.getSettings().setNumRedirects(2*e),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1,this),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError,!1,this)}},{key:"_onAdsManagerLoaded",value:function(e){var n=this,r=new google.ima.AdsRenderingSettings;r.autoAlign=!1,r.enablePreloading=!1,r.restoreCustomPlaybackStateOnAdBreakComplete=!0,r.useStyledNonLinearAds=!0,r.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(this.video_ad_player,r),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(){t(this,n),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 i=new Date,a=i.getHours(),s=i.getDate(),o=i.getMonth(),d=i.getFullYear(),c="AD_SDK_MANAGER_READY";this.eventBus.broadcast(c,{name:c,message:"AD SDK is ready",status:"success",analytics:{category:c,action:this.parentDomain,label:"h".concat(a," d").concat(s," m").concat(o," y").concat(d)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var t,n=new Date,r=n.getHours(),i=n.getDate(),a=n.getMonth(),s=n.getFullYear(),o=l(google.ima.AdEvent.Type,e.type),d=!1,u=(null==e||null===(t=e.getAd())||void 0===t?void 0:t.getContentType())||"",h=!u.startsWith("image")&&!u.startsWith("text");this._sendIMAEventsToHB(e);var p="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:p="Fired when an ad rule or a VMAP ad break would have played if autoPlayAdBreaks is false.";break;case google.ima.AdEvent.Type.AD_METADATA:p="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:d=!0,p="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:p="Fired when the ad is clicked.";var f=e.getAd().getContentType();this._show({mode:"click",contentType:f});break;case google.ima.AdEvent.Type.COMPLETE:d=this._is_completed(e.getAd()),p="Fired when the ad completes playing.",this.adType_===c.Rewarded&&this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:p="Fired when content should be paused. This usually happens right before an ad is about to cover the content.";break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:p="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",d=!0,this._hideAddResume();break;case google.ima.AdEvent.Type.DURATION_CHANGE:p="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:p="Fired when the ad playhead crosses first quartile.";var m=e.getAd().getContentType();this._show({mode:"first_quartile",contentType:m});break;case google.ima.AdEvent.Type.IMPRESSION:p="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:p="Fired when an ad triggers the interaction callback. Ad interactions contain an interaction ID string in the ad data.";break;case google.ima.AdEvent.Type.LINEAR_CHANGED:p="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var v=e.getAd().getContentType();p=v,this._show({mode:"loaded",contentType:v});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(p=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:p="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:h&&this.adResume.show(),p="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:p="Fired when the ad is resumed.",h&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:p="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:d=this._is_completed(e.getAd()),p="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:this._hideAddResume(),p="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:p="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:d=this._is_completed(e.getAd()),p="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:p="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:p="Fired when the ad volume has been muted."}""!==o&&""!==p&&this.eventBus.broadcast(o,{name:o,message:p,status:"success",analytics:{category:o,action:this.parentDomain,label:"h".concat(r," d").concat(i," m").concat(a," y").concat(s)}}),d&&!this.adSuccess&&(this.adSuccess=!0,this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.resetForNext(e))}},{key:"_onAdError",value:function(e){this.requestRunning=!1,this._resetAdsLoader(),this._clearSafetyTimer("ERROR"),this._hide("_onAdError"),this._sendIMAEventsToHB(e);try{var t="AD_ERROR",n=e.getError(),r=n.getErrorCode().toString()||n.getVastErrorCode().toString(),i=this._getInnerErrorCode(n);this.eventBus.broadcast(t,{message:r,details:i,status:"warning",analytics:{category:t,action:i,label:r}}),this._hideAddResume()}catch(e){}}},{key:"_hideAddResume",value:function(){try{console.log("gd:adp will hide adresume"),this.adResume&&this.adResume.hide(),console.log("gd:adp hiding adresume")}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,n){var r=this;this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=window.setTimeout(function(){t(this,r),this.cancel(),this._clearSafetyTimer(n)}.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(oA(e.getInnerError)){var t=e.getInnerError();if(t)return oA(t.getErrorCode)&&oA(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,n){var r=this;if(e){var i=this.macros.transform(e,{get:function(e){if(t(this,r),n&&n.tnl_keys)return n.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in i.query||{}){var s=i.query[a];j(s)&&(i.query[a]=B.stringify(s))}var o=new I(i.url,!0);return G(o.query,i.query||{}),pA({url:o.toString()},n)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new I(e.url,!0),i=this._transformQuery(e,t,r);i&&(n.url=r.toString());var a=i?r:new I(e.url,!0);if(a.query.cust_params){var s=B.parse(a.query.cust_params);n.bidder=s.hb_bidder,n.cust_params=s}n.url_parsed=a}catch(e){n.hasError=!0,n.message=e.message,n.bidder="error",console.log(e.message)}return n}},{key:"_transformQuery",value:function(e,n,r){var i=this;if(e&&n&&e.tnl_keys){var a=this.options.vast_query;if(n.retry_on_success&&this.options.retry_on_success&&j(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:n.retry_on_failure&&this.options.retry_on_failure&&j(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=M(a),j(a)){var s=r.query;if(a.$$remove){for(var o in s){new RegExp(a.$$remove,"i").test(o)&&delete s[o]}delete a.$$remove}var d=B.parse(s.cust_params);if(a.cust_params&&a.cust_params.$$remove){for(var c in d){new RegExp(a.cust_params.$$remove,"i").test(c)&&delete d[c]}delete a.cust_params.$$remove}var u=this.macros.transform(a,{get:function(n){return t(this,i),e.tnl_keys[n.toLowerCase()]}.bind(this)});return s.cust_params=d,G(s,u),s.cust_params=B.stringify(s.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,i,a=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(this.clickCount[a]>=(null===(n=e.t4r[a])||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 a&&(null===(i=e.t4r[a])||void 0===i?void 0:i.enabled);if(null!=e&&e.contentType.startsWith("video/")){var s,o=(null===(s=e.t4r[a])||void 0===s?void 0:s.viper)||0;if(o>0){var d,c=Math.random()<o;return a&&c&&(null===(d=e.t4r[a])||void 0===d?void 0:d.enabled)}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,n,r,i,a,s,o,d,c,u,l,h,p,f,m;if(!e)return!1;var v="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===(i=r.pAds)||void 0===i||null===(a=i.vmap)||void 0===a?void 0:a.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===(c=d.mAds)||void 0===c||null===(u=c.vmap)||void 0===u?void 0:u.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.vmap)||!0===(null===(p=this.gameData)||void 0===p||null===(f=p.rAds)||void 0===f||null===(m=f.vmap)||void 0===m?void 0:m.enabled));if(!v)return!1;var g=this._get_vmap_config(e),b=this.adCounter[e];return void 0!==(null==g?void 0:g.start)?b>=(null==g?void 0:g.start):v}},{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,i=e.dp,a=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:i,d=null!=r&&r.vast_2?void 0:i;return{adtag_url_1:null==a?void 0:a.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,i,a,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===(i=r.mAds)||void 0===i?void 0:i.vmap;case"rewarded":return null===(a=this.gameData)||void 0===a||null===(s=a.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(n){var r=this;t(this,e);try{var i={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new aA(this.gameData).checkCustomParams();a&&(i.cp=a);var s=encodeURIComponent(N.encode(JSON.stringify(i)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(s)).then(function(e){return t(this,r),e.json()}.bind(this)).then(function(e){if(t(this,r),!e||!e.p)return this.msgrt.send("dp.na",{message:"atom"}),n();this.msgrt.send("dp.fp",{message:e.p/100}),n({params:{fp:e.p/100},error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(s),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(s)})}.bind(this)).catch(function(e){t(this,r),this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),n()}.bind(this))}catch(e){this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),n()}}.bind(this))}},{key:"_create_dp_context",value:function(n,i){var a=this;return new Promise(function(){var s=e(r.mark((function e(s){var o,d,c,u,l,h,p=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,a._isDP(n)){e.next=5;break}return a.msgrt.send("dp.na",{message:"rule"}),e.abrupt("return",s());case 5:d={id:a.topDomain||a.parentDomain,au:n||"unknown",ty:"video",aid:a.gameData.gameId,pgu:a.parentURL},(c=new aA(a.gameData).checkCustomParams())&&(d.cp=c),u=encodeURIComponent(N.encode(JSON.stringify(d))),l=null===(o=a.gameData.promo)||void 0===o?void 0:o.rainbow,h=(null==l?void 0:l.enabled)&&!0!==(null==i?void 0:i.fallback_adsense),fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(u)).then(function(e){return t(this,p),e.json()}.bind(this)).then(function(e){if(t(this,p),!e||!e.p)return a.msgrt.send("dp.na",{message:"atom"}),s();var n=e.p/100;s({id:Date.now(),floor_price:n,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:h?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(u):void 0,promo_imp_blue_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){t(this,p),a.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),s()}.bind(this)),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(0),a.msgrt.send("dp.err",{message:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0}),s();case 18:case"end":return e.stop()}}),e,this,[[0,14]])})));return function(e){return s.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t){if(e&&t)try{var n,r=new I(t.vastUrl,!0);if(null===(n=r.query)||void 0===n||!n.cust_params)return;var i=B.parse(r.query.cust_params);if(!i.tnl_asset_id)return;i.adsense=1,r.query.cust_params=B.stringify(i,!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:(y=e(r.mark((function e(n){var i,a,s,d,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._getPrebidScripts(),a=i[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,o(a,"gdsdk_prebid",{alternates:i,error_prefix:"Blocked:",exists:function(){return t(this,u),window.idhb.requestAds}.bind(this)});case 8:s=h("ch",window.location.href),d=h("ch_date",window.location.href),c={tnl_content_category:this.category.toLowerCase()},s&&(c.channel=s),d&&(c.ch_date=d),window.idhb.setAdserverTargeting(c),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var n=this;t(this,u);try{var r,i=e.slotId.split("@");i=1===i.length?i[0]:i[1],e.isEmpty?(null!==(r=this.atom_display)&&void 0!==r&&r.error_url&&(fetch(this.atom_display.error_url).catch(function(e){t(this,n)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_ERROR",{message:i,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){t(this,n)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:i,status:"success"}))}catch(e){}}.bind(this));case 16:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"_init_ima_script",value:(b=e(r.mark((function e(n){var i,a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=["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"],a=this.options.debug?i[0]:i[1],e.next=4,o(a,"gdsdk_ima",{alternates:i,error_prefix:"Blocked:",exists:function(){return t(this,s),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"_init_afg_script",value:(g=e(r.mark((function e(n){var i,a,s,d,c=this;return r.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(d={}).crossorigin="anonymous",d["data-ad-client"]=(null==n||null===(i=n.adsense_client)||void 0===i?void 0:i.length)>0?n.adsense_client:"ca-pub-2316275586951220",d["data-ad-frequency-hint"]="30s",d.allow="autoplay",(null==n||null===(a=n.adsense_channel)||void 0===a?void 0:a.length)>0&&(d["data-ad-channel"]=n.adsense_channel),(null==n||null===(s=n.adsense_host)||void 0===s?void 0:s.length)>0&&(d["data-ad-host"]=n.adsense_host),!0===(null==n?void 0:n.adsense_adbreak_test)&&(d["data-adbreak-test"]="on"),e.next=14,o("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return t(this,c),!!window.adsbygoogle}.bind(this),attrs:d});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 g.apply(this,arguments)})},{key:"clearSession",value:function(){this.requestRunning=!1}},{key:"_startAdsensePlacementRewardedAd",value:(v=e(r.mark((function e(n){var i,a,s,o,d,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log("gd:adp _startAdsensePlacementRewardedAd"),e.prev=2,!this.requestRunning){e.next=6;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 6:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),i=function(){t(this,u),console.log("gd:adp rw beforeAd"),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,u),console.log("gd:adp rw afterAd"),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(){t(this,u),console.log("gd:adp rw adDismmissed"),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),o=function(){t(this,u),console.log("gd:adp rw adViewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"}),this._send_atom_event("sg.ad.rw.viewed")}.bind(this),d=function(e){t(this,u),console.log("gd:adp rw beforeReward"),e()}.bind(this),c=function(e){t(this,u),console.log("gd:adp rw adBreakDone"),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===e.breakStatus?this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),"dismissed"!==e.breakStatus&&this._send_atom_event("sg.dbg.rw",e))}.bind(this),n={type:"reward",name:"reward-in-game",beforeAd:i,afterAd:a,adDismissed:s,adViewed:o,beforeReward:d,adBreakDone:c},window.adsbygoogle.push(n),console.log("gd:adp rw window.adsbygoogle.push(o). tm",window.adsbygoogle),e.next=22;break;case 18:throw e.prev=18,e.t0=e.catch(2),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}var n}),e,this,[[2,18]])}))),function(e){return v.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(m=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),i=function(e){t(this,a),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"}),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),n={type:"preroll",adBreakDone:i},window.adsbygoogle.push(n),e.next=16;break;case 12:throw e.prev=12,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 16:case"end":return e.stop()}var n}),e,this,[[1,12]])}))),function(e){return m.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(s=e(r.mark((function e(n){var i,a,s,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),i=function(){t(this,o),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,o),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(e){t(this,o),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),n={type:"start",name:"start-in-game",beforeAd:i,afterAd:a,adBreakDone:s},window.adsbygoogle.push(n),e.next=18;break;case 14:throw e.prev=14,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 18:case"end":return e.stop()}var n}),e,this,[[1,14]])}))),function(e){return s.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(i=e(r.mark((function e(n){var i,a,s,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),i=function(){t(this,o),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,o),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(e){t(this,o),this.resetForNext(),this.adCounter.midroll=this.adCounter.midroll||0,this.adCounter.midroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.mr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",e))}.bind(this),n={type:"next",name:"next-in-game",beforeAd:i,afterAd:a,adBreakDone:s},window.adsbygoogle.push(n),e.next=18;break;case 14:throw e.prev=14,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 18:case"end":return e.stop()}var n}),e,this,[[1,14]])}))),function(e){return i.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var n=this.msgrt,r=n._layout,i=n._ua,a={tp:e,ct:0,vrs:this.PackageJSON.version,url:this.parentURL,rfr:document.referrer,tdmn:this.topDomain||this.parentDomain,dpth:0,args:t,ua:{brnm:i.browser.name,brvs:i.browser.version,osnm:i.os.name,osvs:i.os.version,dvmd:i.device.model,w:r.w,h:r.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(N.encode(JSON.stringify(a)))))}catch(e){}}},{key:"_send_atom_event",value:function(e,t){this._send(e,{gid:this.gameData.slug,md5:this.gameData.gameId,pid:0,pnm:this.gameData.pname,ctry:this.gameData.ctry,lcl:"en",hle:1,ads:1,args:t,href:window.location.href})}},{key:"_isAfgPositionNext",value:function(e){return void 0!==e.adTimestamp}},{key:"_isAfgPositionStart",value:function(e){if(void 0!==e.adTimestamp)return!1;return this.adCounter.preroll=this.adCounter.preroll||0,0===this.adCounter.preroll}},{key:"attachAfgPosition",value:function(e){var t=e.params.position;switch(t){case"preroll":case"start":case"pause":case"next":case"browse":case"reward":return}var n=e.adType;if(n===c.Rewarded)t="reward";else if(n===c.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}}]),n}(),vA=D((function t(n){var i=this;T(this,t),R(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Jm(i.moduleName);case 2:i.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),R(this,"promo",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.module){e.next=3;break}return e.next=3,i.load();case 3:return e.abrupt("return",i.module[i.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var a=n.package||"gd-sdk-stone-dynamic",s=n.package_version||"1.1.1",o=n.template||"puzzle",d=n.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=o.charAt(0).toUpperCase()+o.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(a,"/").concat(s,"/dist/").concat(o.toLowerCase(),"/iife/index.js"),dependencies:d},Qm(this.moduleName,this.moduleConfig)})),gA=D((function t(n){var i=this;T(this,t),R(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Jm(i.moduleName);case 2:i.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),R(this,"splash",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.module){e.next=3;break}return e.next=3,i.load();case 3:return e.abrupt("return",i.module[i.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var a=n.package||"gd-sdk-air-dynamic",s=n.package_version||"1.2.0",o=n.template||"pluto",d=n.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=o.charAt(0).toUpperCase()+o.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(a,"/").concat(s,"/dist/").concat(o.toLowerCase(),"/iife/index.js"),dependencies:d},Qm(this.moduleName,this.moduleConfig)})),bA=function(e,t){console.log(e,t)},yA={},_A={},wA=null;function AA(){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 yA.version=r,yA.frame=e,yA.function=n,yA.version}function kA(e){var n=this;return wA||(wA=new Promise(function(r){function i(t,n){if(bA("Received a response from CMP",t),n){var i,a;if(!1!==t.gdprApplies)return"tcloaded"===t.eventStatus||"useractioncomplete"===t.eventStatus?(("boolean"!=typeof(a=(i=t)&&"boolean"==typeof i.gdprApplies?i.gdprApplies:e.defaultGdprScope)||!0===a&&"string"!=typeof i.tcString)&&r({result:"cmpUnexpectedResponse",cmp:yA,consentData:i}),void r({result:"ok",consentData:t})):void 0;r({result:"ok",consentData:t})}else r({result:"cmpCallFailed"})}t(this,n),AA(),yA.frame?2===yA.version?(bA("TCF v2 CMP found. Fetching the consent."),yA.function?(bA("CMP API is directly accessible, calling it now..."),yA.function("addEventListener",yA.version,i)):(bA("CMP API is outside the current iframe, calling it now..."),function(e,n,r){var i=this,a="__tcfapi";function s(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!==_A[r.callId]&&_A[r.callId](r.returnValue,r.success)}}window[a]=function(e,r,s,o){t(this,i);var d=Math.random()+"",c="".concat(a,"Call"),u=R({},c,{command:e,parameter:o,callId:d,version:r});_A[d]=s,n.postMessage(u,"*")}.bind(this),window.addEventListener("message",s,!1),window[a](e,yA.version,r)}("addEventListener",yA.frame,i))):r({result:"cmpVersionNotV2",cmp:yA}):r({result:"cmpNotFound"})}.bind(this)),wA)}var EA=new(function(){function t(){T(this,t),this.productName="Game Distribution"}var n;return D(t,[{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:(n=e(r.mark((function e(t,n){var i,a,s,o,d,c;return r.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===(i=t.visitor)||void 0===i?void 0:i.visitorId){e.next=6;break}return e.abrupt("return");case 6:return s=encodeURIComponent(this.productName),o=encodeURIComponent(a),e.prev=8,d="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(s,"/user_id/").concat(o),e.next=12,fetch(d,{method:"POST"});case 12:e.next=28;break;case 15:return e.prev=15,e.t0=e.catch(8),console.log("GAME_DOCK. fail v4",e.t0),e.prev=18,c="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(s,"/user_id/").concat(o),e.next=22,fetch(c,{method:"POST"});case 22:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(18),console.log("GAME_DOCK. fail v6",e.t1);case 28:case"end":return e.stop()}}),e,this,[[8,15],[18,25]])}))),function(e,t){return n.apply(this,arguments)})}]),t}());function xA(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 SA(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 SA(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,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,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function SA(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 DA=function(e){var n=this,r=e.src,i=e.attributes,a=e.target,s=e.isAsync;return new Promise(function(e,o){var d=this;t(this,n);try{var c=document.createElement("script");if(c.async=null==s||s,c.type="text/javascript",c.onload=function(){t(this,d),e()}.bind(this),c.onerror=function(){t(this,d);var e="Error on script load, Error: ".concat(r);console.log(e),o(e)}.bind(this),c.src=r,i){var u,l=xA(i);try{for(l.s();!(u=l.n()).done;){var h=u.value,p=h.key,f=h.value;c.setAttribute(p,f)}}catch(e){l.e(e)}finally{l.f()}}a||(a=document.head),a.appendChild(c)}catch(e){var m="Error on script load catch, Error: ".concat(r);console.log(m,e),o(m)}}.bind(this))},TA=function(){var t=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,DA({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,DA({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,DA({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,i=void 0,n=(t={inlineScript:"function OptanonWrapper() { }"}).inlineScript,r=t.target,(i=document.createElement("script")).text=n,r||(r=document.head),r.appendChild(i),console.log("GD: CMP cookie pro loaded successfully."),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),console.log("GD: CMP error on load",e.t0);case 14:case"end":return e.stop()}var t,n,r,i}),e,null,[[0,11]])})));return function(){return t.apply(this,arguments)}}(),RA=new q,IA={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};function OA(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 n=this,r=e.data,i=e.origin,a=r.type;if(Object.keys(IA).some(function(e){return t(this,n),e===i}.bind(this))&&(null==r||!r.__tcfapiCall)&&(window.parent&&!r.type.startsWith("gd-sdk")&&(window.parent.postMessage(r,"*"),console.log("GD-SDK:pst fw sg event to parent complete",window.parent.location.href,r)),a)){var s=IA[i][a];s&&RA.emit(s,r)}}),!1);var CA=F(),PA=function(e){var n=this;if(!window.__msgr){var r=document.createElement("iframe");if(r.src="https://static.gamedistribution.com/message/index.html",r.style.display="none",r.name="__msgr",document.body.appendChild(r),window!==window.top){var i={gameId:e.gameId,target:e.evnts.domain,token:CA,event_name:"TokenGenerated",timestamp:Date.now()};r.onload=function(){UA(i)},setInterval(function(){t(this,n),i.timestamp=Date.now(),i.event_name="Heartbeat",UA(i)}.bind(this),1e3*e.evnts.heartbeatDuration)}}window.addEventListener("message",function(e){t(this,n);try{var r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?OA(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.data);if(!r.event_name)return;r.token=CA,UA(r)}catch(e){console.error("GD Messager Error",e.message)}}.bind(this),!1)},LA=function(e){try{var t={gameId:e.game.gameId,target:e.game.evnts.domain,event_name:e.event,timestamp:Date.now()},n=MA(window);n!==window.top&&(null==n||n.postMessage(t,"https://html5.gamedistribution.com"))}catch(e){}},MA=function e(t){try{var n,r,i=null==t?void 0:t.parent;if("game"===(null===(n=i.document)||void 0===n||null===(r=n.activeElement)||void 0===r?void 0:r.id))return i;e(i)}catch(e){return t}},UA=function(e){window.__msgr.postMessage(e,"https://static.gamedistribution.com")};function jA(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 BA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jA(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var GA,NA=null,qA=null,FA=function(){function n(e){var r=this;if(T(this,n),NA)return NA;NA=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,e),this._version=e.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new sy,this._location.print(),this._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){t(this,r),this._sdk_ready=!0}.bind(this)).catch(function(e){t(this,r),this._sdk_ready=!1}.bind(this)).finally(function(){var e,n;t(this,r),!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!==(n=this._gameData.evnts)&&void 0!==n&&n.enabled&&this._isLoaderGameURL()&&PA(this._gameData)}.bind(this)),this._registerSGBridge()}var i,u,l,h,f,R,O,C,P,L,U;return D(n,[{key:"_initUnityHandler",value:function(){var e=this;window.addEventListener("DOMNodeInserted",function(){if(t(this,e),this._gameData.block_exts&&this._removeExternalsInHtml({enabled:!1}),document.getElementsByClassName("webgl-content")[0]){var n=document.getElementsByClassName("webgl-content")[0].getElementsByClassName("footer")[0];n&&n.setAttribute("style","display:none")}}.bind(this))}},{key:"_loadCMP",value:(U=e(r.mark((function e(){var t,n,i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=8;break}if(i=new sy,a=i.get("depth"),console.log("CMP location.depth",a),0!==(null==a?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=8;break}return e.next=7,TA();case 7:console.log("CMP loaded");case 8:case"end":return e.stop()}}),e,this)}))),function(){return U.apply(this,arguments)})},{key:"testConsent",value:function(){console.log("test-consent. Finding CMP");try{var t=AA();console.log("CMP found",t),e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,kA({});case 2:t=e.sent,console.log("After lookup IAB consent",t);case 4: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;RA.on("splash-hidden",function(n){t(this,e),console.log("GD-SDK:pst on splash-hidden",n),this._hideCMPButton()}.bind(this))}},{key:"_hideCMPButton",value:function(){console.log(":pst hide cmp button");var e=document.getElementById("ot-sdk-btn-floating");e&&(e.style.display="none")}},{key:"isLoaded",value:function(){if(void 0===this._isLoaded){var e=this._isTokenGameURL(),t=this._isExtHostedGameURL(),n=this._isMasterGameURL();this._isLoaded=(e||t&&!n)&&this._gameData.loader.enabled}return this._isLoaded}},{key:"setIsLoaded",value:function(e){this._isLoaded=e}},{key:"_sendLoadedEvent",value:function(){if(!this.isLoaded()){this.setIsLoaded(!0);try{this._sendTunnlEvent(1),this.msgrt.send("loaded",{message:this._hasBlocker?"Has Blocker":"No Blocker"})}catch(e){}}}},{key:"_sendGamedockGamePlay",value:function(){var e=this._isTokenGameURL();if(console.log("in gamedock gameplay",this._gameData.loader.enabled,e),!(this._gameData.loader.enabled&&e||this._gameDockGamePlaySent))try{this._sendGamedockEvent("gameplay"),console.log("gamedock 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:(L=e(r.mark((function e(n,i){var a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this._gameData=this._getGameData(),e.next=4,this._loadCMP();case 4:this._bridge.isCoreSDKMode=!(!0===this._gameData.enableAds||!0===(null===(a=this._gameData.enableAds)||void 0===a?void 0:a.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 t(this,s),console.error(e.message||e)}.bind(this))),n(this._gameData),e.next=19;break;case 14:e.prev=14,e.t0=e.catch(0),this._sendSDKError(e.t0),this.onResumeGame(e.t0.message,"warning"),i(e.t0);case 19:case"end":return e.stop()}}),e,this,[[0,14]])}))),function(e,t){return L.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=M(e);this.options=t?a(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=oy.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 n=this;void 0===this._topDomain&&(this._topDomain=void 0);var r={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(B.stringify(r))).catch(function(e){t(this,n)}.bind(this))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=m("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,s("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!d.available)return;"developer.gamedistribution.com"===this._parentDomain?(d.set("gd_debug_ex",!0),d.set("gd_disable_midroll_timer",!0),d.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(d.set("gd_debug_ex",!0),d.set("gd_disable_midroll_timer",!0)),d.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 v({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:g(),version:oy.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:b(),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 n=["https://cdn.gamedock.io/gamedock-web-tracker/4.4.0/script/gamedock-sdk.min.js"];o(n[0],"GamedockSDK",{alternates:n}).then(function(){var n,r;t(this,e),qA=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(r=n.gameDock)&&void 0!==r&&r.adViewEvent&&qA.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),EA.track(qA,this._gameData)}.bind(this)).catch(function(n){t(this,e),this._sendSDKError(n)}.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=qA)||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 n=["https://ext.minijuegosgratis.com/external-host/main.js"];o(n[0],"MinijuegosSDK",{alternates:n}).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,n=["https://www.google-analytics.com/analytics.js"];o(n[0],"gdsdk_google_analytics",{alternates:n,error_prefix:"Blocked:",exists:function(){return t(this,e),window.ga}.bind(this)}).then(function(){t(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(n){t(this,e),this._sendSDKError(n)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new p,y.forEach(function(n){var r=this;return t(this,e),this.eventBus.subscribe(n,function(e){return t(this,r),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),_.forEach(function(n){var r=this;return t(this,e),this.eventBus.subscribe(n,function(e){return t(this,r),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(t(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 n=JSON.stringify({type:"GD_SDK_IMPLEMENTED",gameID:this.options.gameId});window.location!==window.top.location?window.top.postMessage(n,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(n,"*")}catch(e){}}}.bind(this),"ima"),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){return t(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(n){var r,i;t(this,e),this.msgrt.send("ad.impression"),null!==(r=this._gameData.diagnostic)&&void 0!==r&&null!==(i=r.gameDock)&&void 0!==i&&i.adViewEvent&&EA.track(qA,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(n){t(this,e),this.msgrt.send("ad.error",{message:n.message,details:n.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(n){t(this,e),this._sendAdRequestContext(n.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(n){t(this,e),n.message.startsWith("Blocked:")?this._bridge.noBlockerEvent||(this.msgrt.send("error",{message:n.message}),this._hasBlocker||(this._hasBlocker=!0,this._sendTunnlEvent(3))):this.msgrt.send("error",{message:n.message})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_EMPTY",function(n){t(this,e),this.msgrt.send("tunnl.keys.empty",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_FALLBACK",function(n){t(this,e),this.msgrt.send("tunnl.keys.fallback",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_T4R",function(n){return t(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(oy.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(P=e(r.mark((function e(){var n,i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this._gameData,n=void 0===this._gameData.dmain||this._gameData.dmain,(i.bloc_gard&&!0===i.bloc_gard.enabled||!n)&&(this.msgrt.send("blocked"),setTimeout(function(){t(this,a),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(B.stringify({domain:this._parentDomain,id:i.gameId,img:this._get_game_thumbnail_url(),title:i.title}))}.bind(this),100));case 5:case"end":return e.stop()}}),e,this)}))),function(){return P.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(){t(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;d.available&&d.getBoolean("gd_debug_ex")&&(d.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,i=this._gameData,a=i.gdpr&&!0===i.gdpr.consent,s=i.loader,o=null===(e=i.promo)||void 0===e?void 0:e[null===(t=i.promo)||void 0===t||null===(n=t.template)||void 0===n?void 0:n.preroll];(i.preroll||(this.adRequestTimer=Date.now()),this.options.loader.enabled)?null!=o&&o.enabled?this._createPromoBeforeSplash(i,a):s.enabled&&!0!==(null===(r=s.splash)||void 0===r?void 0:r.skip)?this._createSplash(i,a):this.onResumeGame("Skipped splash.","success"):s.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||a?null!=o&&o.enabled?this._createPromoBeforeSplash(i,a):!1!==s.enabled&&this._createSplash(i,a):null!=o&&o.enabled&&this._createPromo(i,a))}},{key:"_initializeVideoAd",value:(C=e(r.mark((function e(){var t;return r.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(this.options.advertisementSettings,t.sdk)),this.macros=new w({game:t,bridge:this._bridge}),this.adInstance=new mA(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=oy,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 C.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){s("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){s("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){s(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status})}catch(e){s("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:function(){var e=By();return this._bridge.noPreroll=(!this._getisMobile()||!1!==e.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(e),A(e.diagnostic),e}},{key:"_createSplash",value:(O=e(r.mark((function e(n,i){var a,s,o,d,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(n);case 2:a=e.sent,s=new a(BA(BA({},this.options),{},{isConsentDomain:i,version:oy.version}),n,this._parentDomain),o=qy(),d=o.enabled,s.on("playClick",function(){var e=this;if(t(this,u),i){var n=new Date;n.setDate(n.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(n.toUTCString(),"; path=/")}this._hideCMPButton(),d?window.gdsdk.showAd(c.Interstitial,{position:"preroll"}).catch(function(n){t(this,e),console.log("extsc: splash error",n),s.hide()}.bind(this)):this.showAd(c.Interstitial,{position:"preroll"}).catch(function(n){t(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(){t(this,u),s.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){t(this,u),s.hide()}.bind(this));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(R=e(r.mark((function e(n,i){var a,s,o,d,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(n);case 3:o=e.sent,(d=new o(BA(BA({},this.options),{},{isConsentDomain:i,version:oy.version,template:null===(a=n.promo)||void 0===a||null===(s=a.template)||void 0===s?void 0:s.preroll}),n)).on("done",function(){t(this,c),d.hide(),this._createSplash(n,i)}.bind(this)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),this._createSplash(n,i);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t){return R.apply(this,arguments)})},{key:"_createPromo",value:(f=e(r.mark((function e(n,i){var a,s,o,d,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(n);case 3:o=e.sent,(d=new o(BA(BA({},this.options),{},{isConsentDomain:i,version:oy.version,template:null===(a=n.promo)||void 0===a||null===(s=a.template)||void 0===s?void 0:s.preroll}),n)).on("done",function(){t(this,c),d.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 f.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(c.Interstitial).catch(function(){t(this,e)}.bind(this))}},{key:"showAd",value:(h=e(r.mark((function n(i){var a,s=this,o=arguments;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=o.length>1&&void 0!==o[1]?o[1]:{},console.log("gd:adp, showAd izMaster,izToken",this._isMasterGameURL(),this._isTokenGameURL()),n.abrupt("return",new Promise(function(){var n=e(r.mark((function e(n,o){var d,c,u,l,h,p,f,m,v,g,b,y=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p={adType:i,params:a,adTimestamp:s.adRequestTimer},e.next=4,s.sdkReady;case 4:return f=e.sent,e.next=7,s.videoAdReady;case 7:return null!==(d=s._gameData.lp)&&void 0!==d&&d.load||s._sendLoadedEvent(),s._sendGamedockGamePlay(),s._rejectAdIfGameBlocked({gameData:f,adRequest:p}),s._rejectAdIfAdDisabled({gameData:f,adRequest:p}),s._rejectAdIfUnsupportedType({adRequest:p}),s._rejectAdIfRewardedDisabled({gameData:f,adRequest:p}),(null===(c=f.gft)||void 0===c||!c.enabled||null!==(u=f.gft)&&void 0!==u&&u.enabled&&(null==f||null===(l=f.gft)||void 0===l||null===(h=l.durations[s._giftCount])||void 0===h?void 0:h.after)!==s.adInstance.adMidrollCount)&&s._rejectAdIfAdRateHits({gameData:f,adRequest:p}),s.adInstance.attachAfgPosition(p),s._attachAfgFallback({gameData:f,adRequest:p}),m="main.showad",v=function(e){var n,r,i;t(this,y),s.eventBus.unsubscribeScope(m),s.onResumeGame(e.message,"warning"),null!=f&&null!==(n=f.gft)&&void 0!==n&&n.enabled&&(null==f||null===(r=f.gft)||void 0===r||null===(i=r.durations[s._giftCount])||void 0===i?void 0:i.after)===s.adInstance.adMidrollCount&&s.decideToGiveAGift(),o(e.message)}.bind(this),g=function(e){var r,i,a;t(this,y),s.eventBus.unsubscribeScope(m),s.adRequestTimer=Date.now(),s.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),null!=f&&null!==(r=f.gft)&&void 0!==r&&r.enabled&&(null==f||null===(i=f.gft)||void 0===i||null===(a=i.durations[s._giftCount])||void 0===a?void 0:a.after)===s.adInstance.adMidrollCount&&s.decideToGiveAGift(),n(e.message)}.bind(this),b=function(e){var r=this;t(this,y),s.eventBus.unsubscribeScope(m),a.fallback_adsense=!1,s.showAd(i,BA(BA({},a),{},{adapter:"adsense"})).then(function(e){t(this,r),n(e)}.bind(this)).catch(function(e){t(this,r),o(e)}.bind(this))}.bind(this),s.eventBus.subscribe("AD_ERROR",null!=a&&a.fallback_adsense?b:v,m),s.eventBus.subscribe("AD_SDK_CANCELED",null!=a&&a.fallback_adsense?b:v,m),s.eventBus.subscribe("AD_SUCCESS",g,m),e.next=25,s.adInstance.startAd(p);case 25:s._post_message({topic:"adrequest.instream"}),e.next=32;break;case 28:e.prev=28,e.t0=e.catch(0),s.onResumeGame(e.t0.message,"warning"),o(e.t0.message);case 32:case"end":return e.stop()}}),e,this,[[0,28]])})));return function(e,t){return n.apply(this,arguments)}}()));case 3:case"end":return n.stop()}}),n,this)}))),function(e){return h.apply(this,arguments)})},{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!==c.Interstitial&&t.adType!==c.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=c.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===c.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"_rejectAdIfAdRateHits",value:function(e){var t,n,r,i,a,s,o=e.gameData,d=e.adRequest,u=null;d.adType===c.Interstitial&&null!==(t=o.diagnostic)&&void 0!==t&&null!==(n=t.useMidrollIndex)&&void 0!==n&&n.enabled&&this.adInstance.noPreroll?this.adInstance.adMidrollCount>(null===(r=o.diagnostic)||void 0===r||null===(i=r.useMidrollIndex)||void 0===i?void 0:i.indexes.length)-1||(u=6e4*(null===(a=o.diagnostic)||void 0===a||null===(s=a.useMidrollIndex)||void 0===s?void 0:s.indexes[this.adInstance.adMidrollCount])):u=o.midroll;if(d.adType===c.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<u)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(l=e(r.mark((function t(n){var i=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,a){var s,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.sdkReady;case 3:return s=e.sent,e.next=6,i.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&&!i._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(n){e.next=14;break}n=c.Rewarded,e.next=16;break;case 14:if(n===c.Interstitial||n===c.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+n);case 16:if(n!==c.Rewarded||s.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,i.adInstance.preloadAd(n);case 20:o=e.sent,t(o),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),a(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(e){return l.apply(this,arguments)})},{key:"cancelAd",value:(u=e(r.mark((function t(){var n=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,i){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{n.adInstance.cancel(),n.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),i()}catch(e){n.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),t(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(){return u.apply(this,arguments)})},{key:"showDisplayAd",value:function(t){var n=this;return new Promise(function(){var i=e(r.mark((function e(i,a){var s;return r.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.dAds.enabled){e.next=13;break}return e.next=9,n.adInstance.loadDisplayAd(t);case 9:n._post_message({topic:"adrequest.display"}),i(),e.next=14;break;case 13:a("Display-Ads are disabled.");case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(0),a(e.t0.message||e.t0);case 19:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(e,t){return i.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){var n;this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){s("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()||LA({event:"GameStarted",game:this._gameData})}},{key:"onPauseGame",value:function(e,t){var n;this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){s("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()||LA({event:"GamePaused",game:this._gameData})}},{key:"openConsole",value:function(){try{new k(this).start(),d.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 n=this._gameData;n.sdk.fullscreen&&"auto"===n.sdk.fullscreen&&document.addEventListener("click",function(){if(t(this,e),!this._isFullScreen){var n=document.body,r=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullscreen;if(r)r.call(n);else if(void 0!==window.ActiveXObject){var i=new ActiveXObject("WScript.Shell");null!==i&&i.SendKeys("{F11}")}this._isFullScreen=!0}}.bind(this))}catch(e){console.log("Fullscreen error handled...",e)}}},{key:"_allowExternals",value:function(e){var n=this;void 0!==this.window_open&&(!1===e.enabled?window.open=function(e){t(this,n),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 n=this;!1===e.enabled&&window.document.querySelectorAll("a").forEach(function(e){var r=this;t(this,n);var i=!!(e.innerText.toLowerCase().includes("start")||e.innerText.toLowerCase().includes("play")||e.innerText.toLowerCase().includes("continue")),a=e.getAttribute("href");e.removeAttribute("href"),i||(e.onclick=function(e){return t(this,r),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:E()),a=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:x()),s=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===g()?a:S()),o=(e||n)&&r.loaderEnabled,d=(e||n)&&r.loaderEnabled,c=(e||n)&&r.loaderEnabled,u=(e||n)&&r.loaderEnabled,l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:o,noLoadedEvent:d,noBlockerEvent:c,noPreroll:f,parentURL:i,parentDomain:a,topDomain:s&&s.length?s:a,noGAPageView:u,noLotamePageView:l,noGamedockSDK:h,noMinijuegosSDK:p,version:r.version,pauseGameOnStartup:m,depth:g(),domainMatched:a===s,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 I(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 I(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var i=new I(location.href,!0);if(!i.query.gd_zone_config)return;e=i.query.gd_zone_config}return JSON.parse(N.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new gA(t).splash()}},{key:"_createPrerollPromoTemplate",value:(i=e(r.mark((function e(t){var n,i,a,s,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=null===(n=t.promo)||void 0===n?void 0:n[null===(i=t.promo)||void 0===i||null===(a=i.template)||void 0===a?void 0:a.preroll],o=new vA(s),e.abrupt("return",o.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(N.encode(JSON.stringify(e)))}catch(e){}try{var n=new I(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(B.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new I(e,!0);return n.query=BA(BA({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return N.encode(JSON.stringify(e))}},{key:"session",value:function(){var t=this;return new Promise(function(){var n=e(r.mark((function e(n,i){var a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.sdkReady;case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:a=t._gameData,n({ads:{display:{enabled:a.dAds.enabled},rewarded:{enabled:a.rewardedAds}},location:{parentDomain:t._bridge.parentDomain,topDomain:t._bridge.topDomain,parentURL:t._bridge.parentURL,depth:t._bridge.depth,loadedByGameZone:t._bridge.isTokenGameURL}});case 9:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"_getisMobile",value:function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),!1===t&&window.orientation>-1&&(t=!0),t}},{key:"_get_game_thumbnail_url",value:function(){var e=this,n=this._gameData,r=n.assets.find(function(n){return t(this,e),n.hasOwnProperty("name")&&512===n.width&&512===n.height}.bind(this));return r||(r=n.assets.length>0?n.assets[0]:{name:"logo.svg"}),"https://img.gamedistribution.com/".concat(r.name)}},{key:"_post_message",value:function(e){var t,n=e.topic,r=e.data,i=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var a=window.top||window.parent;a&&a.postMessage({source:"gdsdk",topic:n,data:r},i)}catch(e){console.error((null==e?void 0:e.message)||e)}}},{key:"decideToGiveAGift",value:function(){var n=this;try{var i,a=null===(i=this._gameData)||void 0===i?void 0:i.gft,s=setInterval(e(r.mark((function e(){var i=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.adInstance.requestRunning?console.log("Advertisement already running..."):(n.showAd(c.Interstitial,{position:"midroll"}).catch(function(e){t(this,i)}.bind(this)),clearInterval(s),n._giftCount++);case 1:case"end":return e.stop()}}),e,this)}))),1e3*a.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}}]),n}(),VA={},KA=function(e){try{if(VA.source){var t={type:"gd-sdk-on-event",event:e};VA.source.postMessage(t,VA.origin)}}catch(e){console.log("gd-sdk forwardEvent err",e)}},WA=function(){KA({name:"SDK_READY",status:"success",message:"Everything is ready."}),KA({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),KA({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},zA=function(t){console.log("gd:adp registerForForwarderPosts");window.addEventListener("message",(function(n){var i=n.data,a=n.origin,s=n.source,o=i.type,d=i.method,c=i.options;if("gd-sdk-self"===o){var u={type:"gd-sdk",method:d,options:c};return window.postMessage(u,"https://html5.gamedistribution.com"),void console.log("gd:adp after self post")}if("gd-sdk"===o){if(!VA.source&&"init"===d)return function(e){var t=e.source,n=e.origin;VA={source:t,origin:n}}({source:s,origin:a}),void WA();var l=t[d];l&&e(r.mark((function e(){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!(n=l.apply(t,Object.values(c)))||!n.then){e.next=5;break}return e.next=5,n;case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log("gd:adp:m:r onFrameMessage error",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))()}}),!1)},HA=function(e){!function(e){var t=e.onEvent;e.onEvent=function(e){KA(e),t.apply(this,arguments)}}(e);var t=new FA(e);return zA(t),t},$A={create:function(){var t=e(r.mark((function e(t){var n,i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Qy(t);case 3:return n=e.sent,i=n?zy(t):HA(t),Fy(),e.abrupt("return",i);case 9:return e.prev=9,e.t0=e.catch(0),console.log("gd:adp: sdk adaptor create failed, fallback to default adapter",e.t0),e.abrupt("return",HA(t));case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(e){return t.apply(this,arguments)}}()};function QA(){return(QA=e(r.mark((function e(t,n){var i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Wy();case 2:if(i=e.sent,console.log("extsc: should wrapper be called?",i),!i){e.next=8;break}e.t0=window.gdsdk,e.next=11;break;case 8:return e.next=10,JA(t);case 10:e.t0=e.sent;case 11:return a=e.t0,e.abrupt("return",n(a));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var YA=!1;function JA(e){var n=this;return new Promise(function(r,i){var a=this;if(t(this,n),GA)return r(GA);if(YA)var s=setInterval(function(){t(this,a),GA&&(YA=!1,clearInterval(s),r(GA))}.bind(this),100);else YA=!0,$A.create(e).then(function(e){t(this,a),console.log("sdk created!"),GA=e,e._sendSDKReady(),YA=!1,r(GA)}.bind(this))}.bind(this))}var XA,ZA=(JA(XA=function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":n(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===n(window.gdApi.q[0][0])&&window.gdApi.q[0][0]&&((e=window.gdApi.q[0][0]).hasOwnProperty("advertisementSettings")||(e.advertisementSettings={autoplay:!0}))}catch(e){console.log("_get_developer_sets failed",e)}return e}()),{invoke:function(e){return function(e,t){return QA.apply(this,arguments)}(XA,e)}});function ek(){var n=this;this.AdType=c,this.preloadAd=function(e){var n=this;return ZA.invoke(function(r){return t(this,n),r.preloadAd(e)}.bind(this))},this.showAd=function(){var n=e(r.mark((function e(n,i){var a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ZA.invoke(function(e){return t(this,a),n===c.Display?e.showDisplayAd(i):e.showAd(n)}.bind(this)));case 1:case"end":return e.stop()}}),e,this)})));return function(e,t){return n.apply(this,arguments)}}(),this.cancelAd=function(){var e=this;return ZA.invoke(function(n){return t(this,e),n.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return ZA.invoke(function(n){return t(this,e),n.openConsole()}.bind(this))},this.getSession=function(){var e=this;return ZA.invoke(function(n){return t(this,e),n.session()}.bind(this))},this.leaderboard={show:function(){t(this,n),Xm.showLeaderboard()}.bind(this),addScore:function(e){t(this,n),Xm.addScore(e)}.bind(this)}}ek.prototype=new function(){this.showBanner=function(){var e=this;return ZA.invoke(function(n){return t(this,e),n.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new ek,window.gdApi=window.gdsdk;