@bygd/gd-sdk-pes 1.22.21 → 1.24.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/newArrowCheck";import t from"@babel/runtime/helpers/typeof";import n from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/asyncToGenerator";import i from"@babel/runtime/helpers/classCallCheck";import a from"@babel/runtime/helpers/createClass";import s from"@babel/runtime/regenerator";import o from"@babel/runtime/helpers/objectWithoutProperties";import{Ls as d,AdType as c,getQueryString as u,isObjectEmpty as l,Layers as h,getKeyByValue as p,getScript as f,extendDefaults as m,EventBus as v,getIMASampleTags as g,getQueryParams as y,dankLog as b,MessageRouter as _,getIframeDepth as w,getMobilePlatform as A,SDKEvents as E,IMAEvents as k,Macros as x,setDankLog as D,ImplementationTest as S,getParentUrl as T,getParentDomain as R,getTopDomain as I,parseJSON as O}from"@bygd/gd-sdk-era/dist/default";import C from"url-parse";import P from"can-autoplay";import{isPlainObject as L}from"is-plain-object";import M from"lodash.clonedeep";import U from"querystringify";import j from"lodash.merge";import{Base64 as B}from"js-base64";import N from"validator";import G from"is-valid-domain";import q from"get-value";import F from"set-value";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=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=H,me=he,ve=W.Object,ge=pe("".split),ye=fe((function(){return!ve("z").propertyIsEnumerable(0)}))?function(e){return"String"==me(e)?ge(e,""):ve(e)}:ve,be=W.TypeError,_e=function(e){if(null==e)throw be("Can't call method on "+e);return e},we=ye,Ae=_e,Ee=function(e){return we(Ae(e))},ke=function(e){return"function"==typeof e},xe=ke,De=function(e){return"object"==typeof e?null!==e:xe(e)},Se=W,Te=ke,Re=function(e){return Te(e)?e:void 0},Ie=function(e,t){return arguments.length<2?Re(Se[e]):Se[e]&&Se[e][t]},Oe=de({}.isPrototypeOf),Ce=Ie("navigator","userAgent")||"",Pe=W,Le=Ce,Me=Pe.process,Ue=Pe.Deno,je=Me&&Me.versions||Ue&&Ue.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 Ne=ne,Ge=Ne,qe=H,Fe=!!Object.getOwnPropertySymbols&&!qe((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ge&&Ge<41})),Ve=Fe&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ke=Ie,We=ke,ze=Oe,He=Ve,$e=W.Object,Qe=He?function(e){return"symbol"==typeof e}:function(e){var t=Ke("Symbol");return We(t)&&ze(t.prototype,$e(e))},Ye=W.String,Je=function(e){try{return Ye(e)}catch(e){return"Object"}},Xe=ke,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=ke,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))},yt=gt,bt=de({}.hasOwnProperty),_t=Object.hasOwn||function(e,t){return bt(yt(e),t)},wt=de,At=0,Et=Math.random(),kt=wt(1..toString),xt=function(e){return"Symbol("+(void 0===e?"":e)+")_"+kt(++At+Et,36)},Dt=W,St=dt.exports,Tt=_t,Rt=xt,It=Fe,Ot=Ve,Ct=St("wks"),Pt=Dt.Symbol,Lt=Pt&&Pt.for,Mt=Ot?Pt:Pt&&Pt.withoutSetter||Rt,Ut=function(e){if(!Tt(Ct,e)||!It&&"string"!=typeof Ct[e]){var t="Symbol."+e;It&&Tt(Pt,e)?Ct[e]=Pt[e]:Ct[e]=Ot&&Lt?Lt(t):Mt(t)}return Ct[e]},jt=Y,Bt=De,Nt=Qe,Gt=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=Ut,Vt=W.TypeError,Kt=Ft("toPrimitive"),Wt=function(e,t){if(!Bt(e)||Nt(e))return e;var n,r=Gt(e,Kt);if(r){if(void 0===t&&(t="default"),n=jt(r,e,t),!Bt(n)||Nt(n))return n;throw Vt("Can't convert object to primitive value")}return void 0===t&&(t="number"),qt(e,t)},zt=Qe,Ht=function(e){var t=Wt(e,"string");return zt(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=!$&&!H((function(){return 7!=Object.defineProperty(Xt("div"),"a",{get:function(){return 7}}).a})),en=$,tn=Y,nn=J,rn=re,an=Ee,sn=Ht,on=_t,dn=Zt,cn=Object.getOwnPropertyDescriptor;z.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,yn=mn,bn=Ht,_n=W.TypeError,wn=Object.defineProperty;un.f=vn?wn:function(e,t,n){if(yn(e),t=bn(t),yn(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,En=re,kn=$?function(e,t,n){return An.f(e,t,En(1,n))}:function(e,t,n){return e[t]=n,e},xn={exports:{}},Dn=ke,Sn=pt,Tn=de(Function.toString);Dn(Sn.inspectSource)||(Sn.inspectSource=function(e){return Tn(e)});var Rn,In,On,Cn=Sn.inspectSource,Pn=ke,Ln=Cn,Mn=W.WeakMap,Un=Pn(Mn)&&/native code/.test(Ln(Mn)),jn=dt.exports,Bn=xt,Nn=jn("keys"),Gn=function(e){return Nn[e]||(Nn[e]=Bn(e))},qn={},Fn=Un,Vn=W,Kn=de,Wn=De,zn=kn,Hn=_t,$n=pt,Qn=Gn,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);Rn=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)||{}},On=function(e){return tr(Zn,e)}}else{var rr=Qn("state");Yn[rr]=!0,Rn=function(e,t){if(Hn(e,rr))throw new Jn("Object already initialized");return t.facade=e,zn(e,rr,t),t},In=function(e){return Hn(e,rr)?e[rr]:{}},On=function(e){return Hn(e,rr)}}var ir={set:Rn,get:In,has:On,enforce:function(e){return On(e)?In(e):Rn(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=ke,pr=_t,fr=kn,mr=lt,vr=Cn,gr=ur.CONFIGURABLE,yr=ir.get,br=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=br(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)&&yr(this).source||vr(this)}));var wr={},Ar=Math.ceil,Er=Math.floor,kr=function(e){var t=+e;return t!=t||0===t?0:(t>0?Er:Ar)(t)},xr=kr,Dr=Math.max,Sr=Math.min,Tr=function(e,t){var n=xr(e);return n<0?Dr(n+t,0):Sr(n,t)},Rr=kr,Ir=Math.min,Or=function(e){return e>0?Ir(Rr(e),9007199254740991):0},Cr=Or,Pr=function(e){return Cr(e.length)},Lr=Ee,Mr=Tr,Ur=Pr,jr=function(e){return function(t,n,r){var i,a=Lr(t),s=Ur(a),o=Mr(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)},Nr=_t,Gr=Ee,qr=Br.indexOf,Fr=qn,Vr=de([].push),Kr=function(e,t){var n,r=Gr(e),i=0,a=[];for(n in r)!Nr(Fr,n)&&Nr(r,n)&&Vr(a,n);for(;t.length>i;)Nr(r,n=t[i++])&&(~qr(a,n)||Vr(a,n));return a},Wr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],zr=Kr,Hr=Wr.concat("length","prototype");wr.f=Object.getOwnPropertyNames||function(e){return zr(e,Hr)};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=z,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=H,oi=ke,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=z.f,gi=kn,yi=xn.exports,bi=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]||bi(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),yi(n,r,a,e)}},Ei=Kr,ki=Wr,xi=Object.keys||function(e){return Ei(e,ki)},Di=gt,Si=xi;Ai({target:"Object",stat:!0,forced:H((function(){Si(1)}))},{keys:function(e){return Si(Di(e))}});var Ti=tt,Ri=de(de.bind),Ii=function(e,t){return Ti(e),void 0===t?e:Ri?Ri(e,t):function(){return e.apply(t,arguments)}},Oi=he,Ci=Array.isArray||function(e){return"Array"==Oi(e)},Pi={};Pi[Ut("toStringTag")]="z";var Li="[object z]"===String(Pi),Mi=W,Ui=Li,ji=ke,Bi=he,Ni=Ut("toStringTag"),Gi=Mi.Object,qi="Arguments"==Bi(function(){return arguments}()),Fi=Ui?Bi: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=Gi(e),Ni))?n:qi?Bi(t):"Object"==(r=Bi(t))&&ji(t.callee)?"Arguments":r},Vi=de,Ki=H,Wi=ke,zi=Fi,Hi=Cn,$i=function(){},Qi=[],Yi=Ie("Reflect","construct"),Ji=/^\s*(?:class|function)\b/,Xi=Vi(Ji.exec),Zi=!Ji.exec($i),ea=function(e){if(!Wi(e))return!1;try{return Yi($i,Qi,e),!0}catch(e){return!1}},ta=!Yi||Ki((function(){var e;return ea(ea.call)||!ea(Object)||!ea((function(){e=!0}))||e}))?function(e){if(!Wi(e))return!1;switch(zi(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Zi||!!Xi(Ji,Hi(e))}:ea,na=W,ra=Ci,ia=ta,aa=De,sa=Ut("species"),oa=na.Array,da=function(e){var t;return ra(e)&&(t=e.constructor,(ia(t)&&(t===oa||ra(t.prototype))||aa(t)&&null===(t=t[sa]))&&(t=void 0)),void 0===t?oa:t},ca=function(e,t){return new(da(e))(0===t?0:t)},ua=Ii,la=ye,ha=gt,pa=Pr,fa=ca,ma=de([].push),va=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=ha(d),m=la(f),v=ua(c,u),g=pa(m),y=0,b=l||fa,_=t?b(d,g):n||s?b(d,0):void 0;g>y;y++)if((o||y in m)&&(p=v(h=m[y],y,f),e))if(t)_[y]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return y;case 2:ma(_,h)}else switch(e){case 4:return!1;case 7:ma(_,h)}return a?-1:r||i?i:_}},ga={forEach:va(0),map:va(1),filter:va(2),some:va(3),every:va(4),find:va(5),findIndex:va(6),filterReject:va(7)},ya=H,ba=Ne,_a=Ut("species"),wa=function(e){return ba>=51||!ya((function(){var t=[];return(t.constructor={})[_a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Aa=ga.filter;Ai({target:"Array",proto:!0,forced:!wa("filter")},{filter:function(e){return Aa(this,e,arguments.length>1?arguments[1]:void 0)}});var Ea=Ai,ka=H,xa=Ee,Da=z.f,Sa=$,Ta=ka((function(){Da(1)}));Ea({target:"Object",stat:!0,forced:!Sa||Ta,sham:!Sa},{getOwnPropertyDescriptor:function(e,t){return Da(xa(e),t)}});var Ra=Ht,Ia=un,Oa=re,Ca=function(e,t,n){var r=Ra(t);r in e?Ia.f(e,r,Oa(0,n)):e[r]=n},Pa=ei,La=Ee,Ma=z,Ua=Ca;Ai({target:"Object",stat:!0,sham:!$},{getOwnPropertyDescriptors:function(e){for(var t,n,r=La(e),i=Ma.f,a=Pa(r),s={},o=0;a.length>o;)void 0!==(n=i(r,t=a[o++]))&&Ua(s,t,n);return s}});var ja=Fi,Ba=Li?{}.toString:function(){return"[object "+ja(this)+"]"},Na=Li,Ga=xn.exports,qa=Ba;Na||Ga(Object.prototype,"toString",qa,{unsafe:!0});var Fa=W.Promise,Va=xn.exports,Ka=W,Wa=ke,za=Ka.String,Ha=Ka.TypeError,$a=de,Qa=mn,Ya=function(e){if("object"==typeof e||Wa(e))return e;throw Ha("Can't set "+za(e)+" as a prototype")},Ja=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=$a(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return Qa(n),Ya(r),t?e(n,r):n.__proto__=r,n}}():void 0),Xa=un.f,Za=_t,es=Ut("toStringTag"),ts=function(e,t,n){e&&!Za(e=n?e:e.prototype,es)&&Xa(e,es,{configurable:!0,value:t})},ns=Ie,rs=un,is=$,as=Ut("species"),ss=function(e){var t=ns(e),n=rs.f;is&&t&&!t[as]&&n(t,as,{configurable:!0,get:function(){return this}})},os=Oe,ds=W.TypeError,cs={},us=cs,ls=Ut("iterator"),hs=Array.prototype,ps=function(e){return void 0!==e&&(us.Array===e||hs[ls]===e)},fs=Fi,ms=rt,vs=cs,gs=Ut("iterator"),ys=function(e){if(null!=e)return ms(e,gs)||ms(e,"@@iterator")||vs[fs(e)]},bs=Y,_s=tt,ws=mn,As=Je,Es=ys,ks=W.TypeError,xs=function(e,t){var n=arguments.length<2?Es(e):t;if(_s(n))return ws(bs(n,e));throw ks(As(e)+" is not iterable")},Ds=Y,Ss=mn,Ts=rt,Rs=function(e,t,n){var r,i;Ss(e);try{if(!(r=Ts(e,"return"))){if("throw"===t)throw n;return n}r=Ds(r,e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return Ss(r),n},Is=Ii,Os=Y,Cs=mn,Ps=Je,Ls=ps,Ms=Pr,Us=Oe,js=xs,Bs=ys,Ns=Rs,Gs=W.TypeError,qs=function(e,t){this.stopped=e,this.result=t},Fs=qs.prototype,Vs=Ut("iterator"),Ks=!1;try{var Ws=0,zs={next:function(){return{done:!!Ws++}},return:function(){Ks=!0}};zs[Vs]=function(){return this},Array.from(zs,(function(){throw 2}))}catch(e){}var Hs,$s,Qs,Ys,Js=function(e,t){if(!t&&!Ks)return!1;var n=!1;try{var r={};r[Vs]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Xs=ta,Zs=Je,eo=W.TypeError,to=mn,no=function(e){if(Xs(e))return e;throw eo(Zs(e)+" is not a constructor")},ro=Ut("species"),io=function(e,t){var n,r=to(e).constructor;return void 0===r||null==(n=to(r)[ro])?t:no(n)},ao=Function.prototype,so=ao.apply,oo=ao.bind,co=ao.call,uo="object"==typeof Reflect&&Reflect.apply||(oo?co.bind(so):function(){return co.apply(so,arguments)}),lo=Ie("document","documentElement"),ho=de([].slice),po=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ce),fo="process"==he(W.process),mo=W,vo=uo,go=Ii,yo=ke,bo=_t,_o=H,wo=lo,Ao=ho,Eo=Jt,ko=po,xo=fo,Do=mo.setImmediate,So=mo.clearImmediate,To=mo.process,Ro=mo.Dispatch,Io=mo.Function,Oo=mo.MessageChannel,Co=mo.String,Po=0,Lo={};try{Hs=mo.location}catch(e){}var Mo=function(e){if(bo(Lo,e)){var t=Lo[e];delete Lo[e],t()}},Uo=function(e){return function(){Mo(e)}},jo=function(e){Mo(e.data)},Bo=function(e){mo.postMessage(Co(e),Hs.protocol+"//"+Hs.host)};Do&&So||(Do=function(e){var t=Ao(arguments,1);return Lo[++Po]=function(){vo(yo(e)?e:Io(e),void 0,t)},$s(Po),Po},So=function(e){delete Lo[e]},xo?$s=function(e){To.nextTick(Uo(e))}:Ro&&Ro.now?$s=function(e){Ro.now(Uo(e))}:Oo&&!ko?(Ys=(Qs=new Oo).port2,Qs.port1.onmessage=jo,$s=go(Ys.postMessage,Ys)):mo.addEventListener&&yo(mo.postMessage)&&!mo.importScripts&&Hs&&"file:"!==Hs.protocol&&!_o(Bo)?($s=Bo,mo.addEventListener("message",jo,!1)):$s="onreadystatechange"in Eo("script")?function(e){wo.appendChild(Eo("script")).onreadystatechange=function(){wo.removeChild(this),Mo(e)}}:function(e){setTimeout(Uo(e),0)});var No,Go,qo,Fo,Vo,Ko,Wo,zo,Ho={set:Do,clear:So},$o=W,Qo=/ipad|iphone|ipod/i.test(Ce)&&void 0!==$o.Pebble,Yo=/web0s(?!.*chrome)/i.test(Ce),Jo=W,Xo=Ii,Zo=z.f,ed=Ho.set,td=po,nd=Qo,rd=Yo,id=fo,ad=Jo.MutationObserver||Jo.WebKitMutationObserver,sd=Jo.document,od=Jo.process,dd=Jo.Promise,cd=Zo(Jo,"queueMicrotask"),ud=cd&&cd.value;ud||(No=function(){var e,t;for(id&&(e=od.domain)&&e.exit();Go;){t=Go.fn,Go=Go.next;try{t()}catch(e){throw Go?Fo():qo=void 0,e}}qo=void 0,e&&e.enter()},td||id||rd||!ad||!sd?!nd&&dd&&dd.resolve?((Wo=dd.resolve(void 0)).constructor=dd,zo=Xo(Wo.then,Wo),Fo=function(){zo(No)}):id?Fo=function(){od.nextTick(No)}:(ed=Xo(ed,Jo),Fo=function(){ed(No)}):(Vo=!0,Ko=sd.createTextNode(""),new ad(No).observe(Ko,{characterData:!0}),Fo=function(){Ko.data=Vo=!Vo}));var ld=ud||function(e){var t={fn:e,next:void 0};qo&&(qo.next=t),Go||(Go=t,Fo()),qo=t},hd={},pd=tt,fd=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=pd(t),this.reject=pd(n)};hd.f=function(e){return new fd(e)};var md,vd,gd,yd,bd=mn,_d=De,wd=hd,Ad=function(e,t){if(bd(e),_d(t)&&t.constructor===e)return t;var n=wd.f(e);return(0,n.resolve)(t),n.promise},Ed=W,kd="object"==typeof window,xd=Ai,Dd=W,Sd=Ie,Td=Y,Rd=Fa,Id=xn.exports,Od=function(e,t,n){for(var r in t)Va(e,r,t[r],n);return e},Cd=Ja,Pd=ts,Ld=ss,Md=tt,Ud=ke,jd=De,Bd=function(e,t){if(os(t,e))return e;throw ds("Incorrect invocation")},Nd=Cn,Gd=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=Is(t,u),m=function(e){return r&&Ns(r,"normal",e),new qs(!0,e)},v=function(e){return l?(Cs(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=Bs(e)))throw Gs(Ps(e)+" is not iterable");if(Ls(i)){for(a=0,s=Ms(e);s>a;a++)if((o=v(e[a]))&&Us(Fs,o))return o;return new qs(!1)}r=js(e,i)}for(d=r.next;!(c=Os(d,r)).done;){try{o=v(c.value)}catch(e){Ns(r,"throw",e)}if("object"==typeof o&&o&&Us(Fs,o))return o}return new qs(!1)},qd=Js,Fd=io,Vd=Ho.set,Kd=ld,Wd=Ad,zd=function(e,t){var n=Ed.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))},Hd=hd,$d=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Qd=ir,Yd=fi,Jd=kd,Xd=fo,Zd=Ne,ec=Ut("species"),tc=Qd.get,nc=Qd.set,rc=Qd.getterFor("Promise"),ic=Rd&&Rd.prototype,ac=Rd,sc=ic,oc=Dd.TypeError,dc=Dd.document,cc=Dd.process,uc=Hd.f,lc=uc,hc=!!(dc&&dc.createEvent&&Dd.dispatchEvent),pc=Ud(Dd.PromiseRejectionEvent),fc=!1,mc=Yd("Promise",(function(){var e=Nd(ac),t=e!==String(ac);if(!t&&66===Zd)return!0;if(Zd>=51&&/native code/.test(e))return!1;var n=new ac((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[ec]=r,!(fc=n.then((function(){}))instanceof r)||!t&&Jd&&!pc})),vc=mc||!qd((function(e){ac.all(e).catch((function(){}))})),gc=function(e){var t;return!(!jd(e)||!Ud(t=e.then))&&t},yc=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;Kd((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&&Ac(e),e.rejection=1),!0===u?s=r:(p&&p.enter(),s=u(r),p&&(p.exit(),d=!0)),s===c.promise?h(oc("Promise-chain cycle")):(o=gc(s))?Td(o,s,l,h):l(s)):h(r)}catch(e){p&&!d&&p.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&_c(e)}))}},bc=function(e,t,n){var r,i;hc?((r=dc.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Dd.dispatchEvent(r)):r={promise:t,reason:n},!pc&&(i=Dd["on"+e])?i(r):"unhandledrejection"===e&&zd("Unhandled promise rejection",n)},_c=function(e){Td(Vd,Dd,(function(){var t,n=e.facade,r=e.value;if(wc(e)&&(t=$d((function(){Xd?cc.emit("unhandledRejection",r,n):bc("unhandledrejection",n,r)})),e.rejection=Xd||wc(e)?2:1,t.error))throw t.value}))},wc=function(e){return 1!==e.rejection&&!e.parent},Ac=function(e){Td(Vd,Dd,(function(){var t=e.facade;Xd?cc.emit("rejectionHandled",t):bc("rejectionhandled",t,e.value)}))},Ec=function(e,t,n){return function(r){e(t,r,n)}},kc=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,yc(e,!0))},xc=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw oc("Promise can't be resolved itself");var r=gc(t);r?Kd((function(){var n={done:!1};try{Td(r,t,Ec(xc,n,e),Ec(kc,n,e))}catch(t){kc(n,t,e)}})):(e.value=t,e.state=1,yc(e,!1))}catch(t){kc({done:!1},t,e)}}};if(mc&&(sc=(ac=function(e){Bd(this,sc),Md(e),Td(md,this);var t=tc(this);try{e(Ec(xc,t),Ec(kc,t))}catch(e){kc(t,e)}}).prototype,(md=function(e){nc(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Od(sc,{then:function(e,t){var n=rc(this),r=n.reactions,i=uc(Fd(this,ac));return i.ok=!Ud(e)||e,i.fail=Ud(t)&&t,i.domain=Xd?cc.domain:void 0,n.parent=!0,r[r.length]=i,0!=n.state&&yc(n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),vd=function(){var e=new md,t=tc(e);this.promise=e,this.resolve=Ec(xc,t),this.reject=Ec(kc,t)},Hd.f=uc=function(e){return e===ac||e===gd?new vd(e):lc(e)},Ud(Rd)&&ic!==Object.prototype)){yd=ic.then,fc||(Id(ic,"then",(function(e,t){var n=this;return new ac((function(e,t){Td(yd,n,e,t)})).then(e,t)}),{unsafe:!0}),Id(ic,"catch",sc.catch,{unsafe:!0}));try{delete ic.constructor}catch(e){}Cd&&Cd(ic,sc)}xd({global:!0,wrap:!0,forced:mc},{Promise:ac}),Pd(ac,"Promise",!1),Ld("Promise"),gd=Sd("Promise"),xd({target:"Promise",stat:!0,forced:mc},{reject:function(e){var t=uc(this);return Td(t.reject,void 0,e),t.promise}}),xd({target:"Promise",stat:!0,forced:mc},{resolve:function(e){return Wd(this,e)}}),xd({target:"Promise",stat:!0,forced:vc},{all:function(e){var t=this,n=uc(t),r=n.resolve,i=n.reject,a=$d((function(){var n=Md(t.resolve),a=[],s=0,o=1;Gd(e,(function(e){var d=s++,c=!1;o++,Td(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=uc(t),r=n.reject,i=$d((function(){var i=Md(t.resolve);Gd(e,(function(e){Td(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Dc=Ai,Sc=Fa,Tc=H,Rc=Ie,Ic=ke,Oc=io,Cc=Ad,Pc=xn.exports;if(Dc({target:"Promise",proto:!0,real:!0,forced:!!Sc&&Tc((function(){Sc.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=Oc(this,Rc("Promise")),n=Ic(e);return this.then(n?function(n){return Cc(t,e()).then((function(){return n}))}:e,n?function(n){return Cc(t,e()).then((function(){throw n}))}:e)}}),Ic(Sc)){var Lc=Rc("Promise").prototype.finally;Sc.prototype.finally!==Lc&&Pc(Sc.prototype,"finally",Lc,{unsafe:!0})}var Mc=Fi,Uc=W.String,jc=function(e){if("Symbol"===Mc(e))throw TypeError("Cannot convert a Symbol value to a string");return Uc(e)},Bc=mn,Nc=function(){var e=Bc(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},Gc={},qc=H,Fc=W.RegExp;Gc.UNSUPPORTED_Y=qc((function(){var e=Fc("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Gc.BROKEN_CARET=qc((function(){var e=Fc("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var Vc,Kc=un,Wc=mn,zc=Ee,Hc=xi,$c=$?Object.defineProperties:function(e,t){Wc(e);for(var n,r=zc(t),i=Hc(t),a=i.length,s=0;a>s;)Kc.f(e,n=i[s++],r[n]);return e},Qc=mn,Yc=$c,Jc=Wr,Xc=qn,Zc=lo,eu=Jt,tu=Gn("IE_PROTO"),nu=function(){},ru=function(e){return"<script>"+e+"<\/script>"},iu=function(e){e.write(ru("")),e.close();var t=e.parentWindow.Object;return e=null,t},au=function(){try{Vc=new ActiveXObject("htmlfile")}catch(e){}var e,t;au="undefined"!=typeof document?document.domain&&Vc?iu(Vc):((t=eu("iframe")).style.display="none",Zc.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(ru("document.F=Object")),e.close(),e.F):iu(Vc);for(var n=Jc.length;n--;)delete au.prototype[Jc[n]];return au()};Xc[tu]=!0;var su=Object.create||function(e,t){var n;return null!==e?(nu.prototype=Qc(e),n=new nu,nu.prototype=null,n[tu]=e):n=au(),void 0===t?n:Yc(n,t)},ou=H,du=W.RegExp,cu=ou((function(){var e=du(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),uu=H,lu=W.RegExp,hu=uu((function(){var e=lu("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),pu=Y,fu=de,mu=jc,vu=Nc,gu=Gc,yu=dt.exports,bu=su,_u=ir.get,wu=cu,Au=hu,Eu=yu("native-string-replace",String.prototype.replace),ku=RegExp.prototype.exec,xu=ku,Du=fu("".charAt),Su=fu("".indexOf),Tu=fu("".replace),Ru=fu("".slice),Iu=function(){var e=/a/,t=/b*/g;return pu(ku,e,"a"),pu(ku,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Ou=gu.UNSUPPORTED_Y||gu.BROKEN_CARET,Cu=void 0!==/()??/.exec("")[1];(Iu||Cu||Ou||wu||Au)&&(xu=function(e){var t,n,r,i,a,s,o,d=this,c=_u(d),u=mu(e),l=c.raw;if(l)return l.lastIndex=d.lastIndex,t=pu(xu,l,u),d.lastIndex=l.lastIndex,t;var h=c.groups,p=Ou&&d.sticky,f=pu(vu,d),m=d.source,v=0,g=u;if(p&&(f=Tu(f,"y",""),-1===Su(f,"g")&&(f+="g"),g=Ru(u,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==Du(u,d.lastIndex-1))&&(m="(?: "+m+")",g=" "+g,v++),n=new RegExp("^(?:"+m+")",f)),Cu&&(n=new RegExp("^"+m+"$(?!\\s)",f)),Iu&&(r=d.lastIndex),i=pu(ku,p?n:d,g),p?i?(i.input=Ru(i.input,v),i[0]=Ru(i[0],v),i.index=d.lastIndex,d.lastIndex+=i[0].length):d.lastIndex=0:Iu&&i&&(d.lastIndex=d.global?i.index+i[0].length:r),Cu&&i&&i.length>1&&pu(Eu,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 Pu=xu;Ai({target:"RegExp",proto:!0,forced:/./.exec!==Pu},{exec:Pu});var Lu=de,Mu=xn.exports,Uu=Pu,ju=H,Bu=Ut,Nu=kn,Gu=Bu("species"),qu=RegExp.prototype,Fu=function(e,t,n,r){var i=Bu(e),a=!ju((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),s=a&&!ju((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Gu]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!a||!s||n){var o=Lu(/./[i]),d=t(i,""[e],(function(e,t,n,r,i){var s=Lu(e),d=t.exec;return d===Uu||d===qu.exec?a&&!i?{done:!0,value:o(t,n,r)}:{done:!0,value:s(n,t,r)}:{done:!1}}));Mu(String.prototype,e,d[0]),Mu(qu,i,d[1])}r&&Nu(qu[i],"sham",!0)},Vu=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},Ku=Y,Wu=mn,zu=ke,Hu=he,$u=Pu,Qu=W.TypeError,Yu=function(e,t){var n=e.exec;if(zu(n)){var r=Ku(n,e,t);return null!==r&&Wu(r),r}if("RegExp"===Hu(e))return Ku($u,e,t);throw Qu("RegExp#exec called on incompatible receiver")},Ju=Y,Xu=mn,Zu=_e,el=Vu,tl=jc,nl=rt,rl=Yu;Fu("search",(function(e,t,n){return[function(t){var n=Zu(this),r=null==t?void 0:nl(t,e);return r?Ju(r,t,n):new RegExp(t)[e](tl(n))},function(e){var r=Xu(this),i=tl(e),a=n(t,r,i);if(a.done)return a.value;var s=r.lastIndex;el(s,0)||(r.lastIndex=0);var o=rl(r,i);return el(r.lastIndex,s)||(r.lastIndex=s),null===o?-1:o.index}]}));var il=_e,al=jc,sl=de("".replace),ol="[\t\n\v\f\r                 \u2028\u2029\ufeff]",dl=RegExp("^"+ol+ol+"*"),cl=RegExp(ol+ol+"*$"),ul=function(e){return function(t){var n=al(il(t));return 1&e&&(n=sl(n,dl,"")),2&e&&(n=sl(n,cl,"")),n}},ll={start:ul(1),end:ul(2),trim:ul(3)},hl=ur.PROPER,pl=H,fl="\t\n\v\f\r                 \u2028\u2029\ufeff",ml=ll.trim;Ai({target:"String",proto:!0,forced:function(e){return pl((function(){return!!fl[e]()||"​…᠎"!=="​…᠎"[e]()||hl&&fl[e].name!==e}))}("trim")},{trim:function(){return ml(this)}});var vl={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},gl=Jt("span").classList,yl=gl&&gl.constructor&&gl.constructor.prototype,bl=yl===Object.prototype?void 0:yl,_l=H,wl=ga.forEach,Al=function(e,t){var n=[][e];return!!n&&_l((function(){n.call(null,t||function(){throw 1},1)}))},El=W,kl=vl,xl=bl,Dl=Al("forEach")?[].forEach:function(e){return wl(this,e,arguments.length>1?arguments[1]:void 0)},Sl=kn,Tl=function(e){if(e&&e.forEach!==Dl)try{Sl(e,"forEach",Dl)}catch(t){e.forEach=Dl}};for(var Rl in kl)kl[Rl]&&Tl(El[Rl]&&El[Rl].prototype);Tl(xl);var Il=ke,Ol=De,Cl=Ja,Pl=De,Ll=he,Ml=Ut("match"),Ul=function(e){var t;return Pl(e)&&(void 0!==(t=e[Ml])?!!t:"RegExp"==Ll(e))},jl=$,Bl=W,Nl=de,Gl=fi,ql=function(e,t,n){var r,i;return Cl&&Il(r=t.constructor)&&r!==n&&Ol(i=r.prototype)&&i!==n.prototype&&Cl(e,i),e},Fl=kn,Vl=un.f,Kl=wr.f,Wl=Oe,zl=Ul,Hl=jc,$l=Nc,Ql=Gc,Yl=xn.exports,Jl=H,Xl=_t,Zl=ir.enforce,eh=ss,th=cu,nh=hu,rh=Ut("match"),ih=Bl.RegExp,ah=ih.prototype,sh=Bl.SyntaxError,oh=Nl($l),dh=Nl(ah.exec),ch=Nl("".charAt),uh=Nl("".replace),lh=Nl("".indexOf),hh=Nl("".slice),ph=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,fh=/a/g,mh=/a/g,vh=new ih(fh)!==fh,gh=Ql.UNSUPPORTED_Y,yh=jl&&(!vh||gh||th||nh||Jl((function(){return mh[rh]=!1,ih(fh)!=fh||ih(mh)==mh||"/a/i"!=ih(fh,"i")})));if(Gl("RegExp",yh)){for(var bh=function(e,t){var n,r,i,a,s,o,d=Wl(ah,this),c=zl(e),u=void 0===t,l=[],h=e;if(!d&&c&&u&&e.constructor===bh)return e;if((c||Wl(ah,e))&&(e=e.source,u&&(t="flags"in h?h.flags:oh(h))),e=void 0===e?"":Hl(e),t=void 0===t?"":Hl(t),h=e,th&&"dotAll"in fh&&(r=!!t&&lh(t,"s")>-1)&&(t=uh(t,/s/g,"")),n=t,gh&&"sticky"in fh&&(i=!!t&&lh(t,"y")>-1)&&(t=uh(t,/y/g,"")),nh&&(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=ch(e,r)))t+=ch(e,++r);else if("]"===t)o=!1;else if(!o)switch(!0){case"["===t:o=!0;break;case"("===t:dh(ph,hh(e,r+1))&&(r+=2,d=!0),i+=t,c++;continue;case">"===t&&d:if(""===u||Xl(s,u))throw new sh("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=ql(ih(e,t),d?this:ah,bh),(r||i||l.length)&&(o=Zl(s),r&&(o.dotAll=!0,o.raw=bh(function(e){for(var t,n=e.length,r=0,i="",a=!1;r<=n;r++)"\\"!==(t=ch(e,r))?a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),i+=t):i+="[\\s\\S]":i+=t+ch(e,++r);return i}(e),n)),i&&(o.sticky=!0),l.length&&(o.groups=l)),e!==h)try{Fl(s,"source",""===h?"(?:)":h)}catch(e){}return s},_h=function(e){e in bh||Vl(bh,e,{configurable:!0,get:function(){return ih[e]},set:function(t){ih[e]=t}})},wh=Kl(ih),Ah=0;wh.length>Ah;)_h(wh[Ah++]);ah.constructor=bh,bh.prototype=ah,Yl(Bl,"RegExp",bh)}eh("RegExp");var Eh=de,kh=ur.PROPER,xh=xn.exports,Dh=mn,Sh=Oe,Th=jc,Rh=H,Ih=Nc,Oh=RegExp.prototype,Ch=Oh.toString,Ph=Eh(Ih),Lh=Rh((function(){return"/a/b"!=Ch.call({source:"a",flags:"b"})})),Mh=kh&&"toString"!=Ch.name;(Lh||Mh)&&xh(RegExp.prototype,"toString",(function(){var e=Dh(this),t=Th(e.source),n=e.flags;return"/"+t+"/"+Th(void 0===n&&Sh(Oh,e)&&!("flags"in Oh)?Ph(e):n)}),{unsafe:!0});var Uh=Ai,jh=W,Bh=H,Nh=Ci,Gh=De,qh=gt,Fh=Pr,Vh=Ca,Kh=ca,Wh=wa,zh=Ne,Hh=Ut("isConcatSpreadable"),$h=jh.TypeError,Qh=zh>=51||!Bh((function(){var e=[];return e[Hh]=!1,e.concat()[0]!==e})),Yh=Wh("concat"),Jh=function(e){if(!Gh(e))return!1;var t=e[Hh];return void 0!==t?!!t:Nh(e)};Uh({target:"Array",proto:!0,forced:!Qh||!Yh},{concat:function(e){var t,n,r,i,a,s=qh(this),o=Kh(s,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(Jh(a=-1===t?s:arguments[t])){if(d+(i=Fh(a))>9007199254740991)throw $h("Maximum allowed index exceeded");for(n=0;n<i;n++,d++)n in a&&Vh(o,d,a[n])}else{if(d>=9007199254740991)throw $h("Maximum allowed index exceeded");Vh(o,d++,a)}return o.length=d,o}});var Xh,Zh=Ul,ep=W.TypeError,tp=function(e){if(Zh(e))throw ep("The method doesn't accept regular expressions");return e},np=Ut("match"),rp=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[np]=!1,"/./"[e](t)}catch(e){}}return!1},ip=Ai,ap=de,sp=z.f,op=Or,dp=jc,cp=tp,up=_e,lp=rp,hp=ap("".startsWith),pp=ap("".slice),fp=Math.min,mp=lp("startsWith");ip({target:"String",proto:!0,forced:!!(mp||(Xh=sp(String.prototype,"startsWith"),!Xh||Xh.writable))&&!mp},{startsWith:function(e){var t=dp(up(this));cp(e);var n=op(fp(arguments.length>1?arguments[1]:void 0,t.length)),r=dp(e);return hp?hp(t,r,n):pp(t,n,n+r.length)===r}});var vp=de,gp=kr,yp=jc,bp=_e,_p=vp("".charAt),wp=vp("".charCodeAt),Ap=vp("".slice),Ep=function(e){return function(t,n){var r,i,a=yp(bp(t)),s=gp(n),o=a.length;return s<0||s>=o?e?"":void 0:(r=wp(a,s))<55296||r>56319||s+1===o||(i=wp(a,s+1))<56320||i>57343?e?_p(a,s):r:e?Ap(a,s,s+2):i-56320+(r-55296<<10)+65536}},kp={codeAt:Ep(!1),charAt:Ep(!0)},xp=kp.charAt,Dp=function(e,t,n){return t+(n?xp(e,t).length:1)},Sp=de,Tp=gt,Rp=Math.floor,Ip=Sp("".charAt),Op=Sp("".replace),Cp=Sp("".slice),Pp=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Lp=/\$([$&'`]|\d{1,2})/g,Mp=uo,Up=Y,jp=de,Bp=Fu,Np=H,Gp=mn,qp=ke,Fp=kr,Vp=Or,Kp=jc,Wp=_e,zp=Dp,Hp=rt,$p=function(e,t,n,r,i,a){var s=n+e.length,o=r.length,d=Lp;return void 0!==i&&(i=Tp(i),d=Pp),Op(a,d,(function(a,d){var c;switch(Ip(d,0)){case"$":return"$";case"&":return e;case"`":return Cp(t,0,n);case"'":return Cp(t,s);case"<":c=i[Cp(d,1,-1)];break;default:var u=+d;if(0===u)return a;if(u>o){var l=Rp(u/10);return 0===l?a:l<=o?void 0===r[l-1]?Ip(d,1):r[l-1]+Ip(d,1):a}c=r[u-1]}return void 0===c?"":c}))},Qp=Yu,Yp=Ut("replace"),Jp=Math.max,Xp=Math.min,Zp=jp([].concat),ef=jp([].push),tf=jp("".indexOf),nf=jp("".slice),rf="$0"==="a".replace(/./,"$0"),af=!!/./[Yp]&&""===/./[Yp]("a","$0");Bp("replace",(function(e,t,n){var r=af?"$":"$0";return[function(e,n){var r=Wp(this),i=null==e?void 0:Hp(e,Yp);return i?Up(i,e,r,n):Up(t,Kp(r),e,n)},function(e,i){var a=Gp(this),s=Kp(e);if("string"==typeof i&&-1===tf(i,r)&&-1===tf(i,"$<")){var o=n(t,a,s,i);if(o.done)return o.value}var d=qp(i);d||(i=Kp(i));var c=a.global;if(c){var u=a.unicode;a.lastIndex=0}for(var l=[];;){var h=Qp(a,s);if(null===h)break;if(ef(l,h),!c)break;""===Kp(h[0])&&(a.lastIndex=zp(s,Vp(a.lastIndex),u))}for(var p,f="",m=0,v=0;v<l.length;v++){for(var g=Kp((h=l[v])[0]),y=Jp(Xp(Fp(h.index),s.length),0),b=[],_=1;_<h.length;_++)ef(b,void 0===(p=h[_])?p:String(p));var w=h.groups;if(d){var A=Zp([g],b,y,s);void 0!==w&&ef(A,w);var E=Kp(Mp(i,void 0,A))}else E=$p(g,s,y,b,w,i);y>=m&&(f+=nf(s,m,y)+E,m=y+g.length)}return f+nf(s,m)}]}),!!Np((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!rf||af);var sf=$,of=ur.EXISTS,df=de,cf=un.f,uf=Function.prototype,lf=df(uf.toString),hf=/^\s*function ([^ (]*)/,pf=df(hf.exec);sf&&!of&&cf(uf,"name",{configurable:!0,get:function(){try{return pf(hf,lf(this))[1]}catch(e){return""}}});var ff={},mf=he,vf=Ee,gf=wr.f,yf=ho,bf="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];ff.f=function(e){return bf&&"Window"==mf(e)?function(e){try{return gf(e)}catch(e){return yf(bf)}}(e):gf(vf(e))};var _f={},wf=Ut;_f.f=wf;var Af=W,Ef=_t,kf=_f,xf=un.f,Df=function(e){var t=Af.Symbol||(Af.Symbol={});Ef(t,e)||xf(t,e,{value:kf.f(e)})},Sf=Ai,Tf=W,Rf=Ie,If=uo,Of=Y,Cf=de,Pf=$,Lf=Fe,Mf=H,Uf=_t,jf=Ci,Bf=ke,Nf=De,Gf=Oe,qf=Qe,Ff=mn,Vf=gt,Kf=Ee,Wf=Ht,zf=jc,Hf=re,$f=su,Qf=xi,Yf=wr,Jf=ff,Xf=$r,Zf=z,em=un,tm=J,nm=ho,rm=xn.exports,im=dt.exports,am=qn,sm=xt,om=Ut,dm=_f,cm=Df,um=ts,lm=ir,hm=ga.forEach,pm=Gn("hidden"),fm=om("toPrimitive"),mm=lm.set,vm=lm.getterFor("Symbol"),gm=Object.prototype,ym=Tf.Symbol,bm=ym&&ym.prototype,_m=Tf.TypeError,wm=Tf.QObject,Am=Rf("JSON","stringify"),Em=Zf.f,km=em.f,xm=Jf.f,Dm=tm.f,Sm=Cf([].push),Tm=im("symbols"),Rm=im("op-symbols"),Im=im("string-to-symbol-registry"),Om=im("symbol-to-string-registry"),Cm=im("wks"),Pm=!wm||!wm.prototype||!wm.prototype.findChild,Lm=Pf&&Mf((function(){return 7!=$f(km({},"a",{get:function(){return km(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Em(gm,t);r&&delete gm[t],km(e,t,n),r&&e!==gm&&km(gm,t,r)}:km,Mm=function(e,t){var n=Tm[e]=$f(bm);return mm(n,{type:"Symbol",tag:e,description:t}),Pf||(n.description=t),n},Um=function(e,t,n){e===gm&&Um(Rm,t,n),Ff(e);var r=Wf(t);return Ff(n),Uf(Tm,r)?(n.enumerable?(Uf(e,pm)&&e[pm][r]&&(e[pm][r]=!1),n=$f(n,{enumerable:Hf(0,!1)})):(Uf(e,pm)||km(e,pm,Hf(1,{})),e[pm][r]=!0),Lm(e,r,n)):km(e,r,n)},jm=function(e,t){Ff(e);var n=Kf(t),r=Qf(n).concat(qm(n));return hm(r,(function(t){Pf&&!Of(Bm,n,t)||Um(e,t,n[t])})),e},Bm=function(e){var t=Wf(e),n=Of(Dm,this,t);return!(this===gm&&Uf(Tm,t)&&!Uf(Rm,t))&&(!(n||!Uf(this,t)||!Uf(Tm,t)||Uf(this,pm)&&this[pm][t])||n)},Nm=function(e,t){var n=Kf(e),r=Wf(t);if(n!==gm||!Uf(Tm,r)||Uf(Rm,r)){var i=Em(n,r);return!i||!Uf(Tm,r)||Uf(n,pm)&&n[pm][r]||(i.enumerable=!0),i}},Gm=function(e){var t=xm(Kf(e)),n=[];return hm(t,(function(e){Uf(Tm,e)||Uf(am,e)||Sm(n,e)})),n},qm=function(e){var t=e===gm,n=xm(t?Rm:Kf(e)),r=[];return hm(n,(function(e){!Uf(Tm,e)||t&&!Uf(gm,e)||Sm(r,Tm[e])})),r};(Lf||(rm(bm=(ym=function(){if(Gf(bm,this))throw _m("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?zf(arguments[0]):void 0,t=sm(e),n=function(e){this===gm&&Of(n,Rm,e),Uf(this,pm)&&Uf(this[pm],t)&&(this[pm][t]=!1),Lm(this,t,Hf(1,e))};return Pf&&Pm&&Lm(gm,t,{configurable:!0,set:n}),Mm(t,e)}).prototype,"toString",(function(){return vm(this).tag})),rm(ym,"withoutSetter",(function(e){return Mm(sm(e),e)})),tm.f=Bm,em.f=Um,Zf.f=Nm,Yf.f=Jf.f=Gm,Xf.f=qm,dm.f=function(e){return Mm(om(e),e)},Pf&&(km(bm,"description",{configurable:!0,get:function(){return vm(this).description}}),rm(gm,"propertyIsEnumerable",Bm,{unsafe:!0}))),Sf({global:!0,wrap:!0,forced:!Lf,sham:!Lf},{Symbol:ym}),hm(Qf(Cm),(function(e){cm(e)})),Sf({target:"Symbol",stat:!0,forced:!Lf},{for:function(e){var t=zf(e);if(Uf(Im,t))return Im[t];var n=ym(t);return Im[t]=n,Om[n]=t,n},keyFor:function(e){if(!qf(e))throw _m(e+" is not a symbol");if(Uf(Om,e))return Om[e]},useSetter:function(){Pm=!0},useSimple:function(){Pm=!1}}),Sf({target:"Object",stat:!0,forced:!Lf,sham:!Pf},{create:function(e,t){return void 0===t?$f(e):jm($f(e),t)},defineProperty:Um,defineProperties:jm,getOwnPropertyDescriptor:Nm}),Sf({target:"Object",stat:!0,forced:!Lf},{getOwnPropertyNames:Gm,getOwnPropertySymbols:qm}),Sf({target:"Object",stat:!0,forced:Mf((function(){Xf.f(1)}))},{getOwnPropertySymbols:function(e){return Xf.f(Vf(e))}}),Am)&&Sf({target:"JSON",stat:!0,forced:!Lf||Mf((function(){var e=ym();return"[null]"!=Am([e])||"{}"!=Am({a:e})||"{}"!=Am(Object(e))}))},{stringify:function(e,t,n){var r=nm(arguments),i=t;if((Nf(t)||void 0!==e)&&!qf(e))return jf(t)||(t=function(e,t){if(Bf(i)&&(t=Of(i,this,e,t)),!qf(t))return t}),r[1]=t,If(Am,null,r)}});if(!bm[fm]){var Fm=bm.valueOf;rm(bm,fm,(function(e){return Of(Fm,this)}))}um(ym,"Symbol"),am[pm]=!0;var Vm=Ai,Km=$,Wm=W,zm=de,Hm=_t,$m=ke,Qm=Oe,Ym=jc,Jm=un.f,Xm=ai,Zm=Wm.Symbol,ev=Zm&&Zm.prototype;if(Km&&$m(Zm)&&(!("description"in ev)||void 0!==Zm().description)){var tv={},nv=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:Ym(arguments[0]),t=Qm(ev,this)?new Zm(e):void 0===e?Zm():Zm(e);return""===e&&(tv[t]=!0),t};Xm(nv,Zm),nv.prototype=ev,ev.constructor=nv;var rv="Symbol(test)"==String(Zm("test")),iv=zm(ev.toString),av=zm(ev.valueOf),sv=/^Symbol\((.*)\)[^)]+$/,ov=zm("".replace),dv=zm("".slice);Jm(ev,"description",{configurable:!0,get:function(){var e=av(this),t=iv(e);if(Hm(tv,e))return"";var n=rv?dv(t,7,-1):ov(t,sv,"$1");return""===n?void 0:n}}),Vm({global:!0,forced:!0},{Symbol:nv})}var cv=su,uv=un,lv=Ut("unscopables"),hv=Array.prototype;null==hv[lv]&&uv.f(hv,lv,{configurable:!0,value:cv(null)});var pv=function(e){hv[lv][e]=!0},fv=Br.includes,mv=pv;Ai({target:"Array",proto:!0},{includes:function(e){return fv(this,e,arguments.length>1?arguments[1]:void 0)}}),mv("includes");var vv=Ai,gv=tp,yv=_e,bv=jc,_v=rp,wv=de("".indexOf);vv({target:"String",proto:!0,forced:!_v("includes")},{includes:function(e){return!!~wv(bv(yv(this)),bv(gv(e)),arguments.length>1?arguments[1]:void 0)}});var Av=Ai,Ev=ga.find,kv=pv,xv=!0;"find"in[]&&Array(1).find((function(){xv=!1})),Av({target:"Array",proto:!0,forced:xv},{find:function(e){return Ev(this,e,arguments.length>1?arguments[1]:void 0)}}),kv("find");var Dv="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==Dv&&Dv,Sv="URLSearchParams"in Dv,Tv="Symbol"in Dv&&"iterator"in Symbol,Rv="FileReader"in Dv&&"Blob"in Dv&&function(){try{return new Blob,!0}catch(e){return!1}}(),Iv="FormData"in Dv,Ov="ArrayBuffer"in Dv;if(Ov)var Cv=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Pv=ArrayBuffer.isView||function(e){return e&&Cv.indexOf(Object.prototype.toString.call(e))>-1};function Lv(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 Mv(e){return"string"!=typeof e&&(e=String(e)),e}function Uv(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return Tv&&(t[Symbol.iterator]=function(){return t}),t}function jv(e){this.map={},e instanceof jv?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 Bv(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Nv(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function Gv(e){var t=new FileReader,n=Nv(t);return t.readAsArrayBuffer(e),n}function qv(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Fv(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:Rv&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Iv&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Sv&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Ov&&Rv&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=qv(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Ov&&(ArrayBuffer.prototype.isPrototypeOf(e)||Pv(e))?this._bodyArrayBuffer=qv(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):Sv&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Rv&&(this.blob=function(){var e=Bv(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=Bv(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(Gv)}),this.text=function(){var e=Bv(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=Nv(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)},Iv&&(this.formData=function(){return this.text().then(Wv)}),this.json=function(){return this.text().then(JSON.parse)},this}jv.prototype.append=function(e,t){e=Lv(e),t=Mv(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},jv.prototype.delete=function(e){delete this.map[Lv(e)]},jv.prototype.get=function(e){return e=Lv(e),this.has(e)?this.map[e]:null},jv.prototype.has=function(e){return this.map.hasOwnProperty(Lv(e))},jv.prototype.set=function(e,t){this.map[Lv(e)]=Mv(t)},jv.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},jv.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),Uv(e)},jv.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Uv(e)},jv.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),Uv(e)},Tv&&(jv.prototype[Symbol.iterator]=jv.prototype.entries);var Vv=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Kv(e,t){if(!(this instanceof Kv))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 Kv){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new jv(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 jv(t.headers)),this.method=function(e){var t=e.toUpperCase();return Vv.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 Wv(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 zv(e,t){if(!(this instanceof zv))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 jv(t.headers),this.url=t.url||"",this._initBody(e)}Kv.prototype.clone=function(){return new Kv(this,{body:this._bodyInit})},Fv.call(Kv.prototype),Fv.call(zv.prototype),zv.prototype.clone=function(){return new zv(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new jv(this.headers),url:this.url})},zv.error=function(){var e=new zv(null,{status:0,statusText:""});return e.type="error",e};var Hv=[301,302,303,307,308];zv.redirect=function(e,t){if(-1===Hv.indexOf(t))throw new RangeError("Invalid status code");return new zv(null,{status:t,headers:{location:e}})};var $v=Dv.DOMException;try{new $v}catch(e){$v=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},$v.prototype=Object.create(Error.prototype),$v.prototype.constructor=$v}function Qv(e,t){return new Promise((function(n,r){var i=new Kv(e,t);if(i.signal&&i.signal.aborted)return r(new $v("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 jv,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 zv(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 $v("Aborted","AbortError"))}),0)},a.open(i.method,function(e){try{return""===e&&Dv.location.href?Dv.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&&(Rv?a.responseType="blob":Ov&&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 jv?i.headers.forEach((function(e,t){a.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){a.setRequestHeader(e,Mv(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)}))}Qv.polyfill=!0,Dv.fetch||(Dv.fetch=Qv,Dv.Headers=jv,Dv.Request=Kv,Dv.Response=zv);var Yv={name:"@bygd/gd-sdk-pes",version:"1.22.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":"^20.0.0","@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.3","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",validator:"^13.6.0"}},Jv=Y,Xv=mn,Zv=Or,eg=jc,tg=_e,ng=rt,rg=Dp,ig=Yu;Fu("match",(function(e,t,n){return[function(t){var n=tg(this),r=null==t?void 0:ng(t,e);return r?Jv(r,t,n):new RegExp(t)[e](eg(n))},function(e){var r=Xv(this),i=eg(e),a=n(t,r,i);if(a.done)return a.value;if(!r.global)return ig(r,i);var s=r.unicode;r.lastIndex=0;for(var o,d=[],c=0;null!==(o=ig(r,i));){var u=eg(o[0]);d[c]=u,""===u&&(r.lastIndex=rg(i,Zv(r.lastIndex),s)),c++}return 0===c?null:d}]}));var ag=uo,sg=Y,og=de,dg=Fu,cg=Ul,ug=mn,lg=_e,hg=io,pg=Dp,fg=Or,mg=jc,vg=rt,gg=ho,yg=Yu,bg=Pu,_g=H,wg=Gc.UNSUPPORTED_Y,Ag=Math.min,Eg=[].push,kg=og(/./.exec),xg=og(Eg),Dg=og("".slice);dg("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=mg(lg(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!cg(e))return sg(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=sg(bg,l,r))&&!((s=l.lastIndex)>u&&(xg(d,Dg(r,u,a.index)),a.length>1&&a.index<r.length&&ag(Eg,d,gg(a,1)),o=a[0].length,u=s,d.length>=i));)l.lastIndex===a.index&&l.lastIndex++;return u===r.length?!o&&kg(l,"")||xg(d,""):xg(d,Dg(r,u)),d.length>i?gg(d,0,i):d}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:sg(t,this,e,n)}:t,[function(t,n){var i=lg(this),a=null==t?void 0:vg(t,e);return a?sg(a,t,i,n):sg(r,mg(i),t,n)},function(e,i){var a=ug(this),s=mg(e),o=n(r,a,s,i,r!==t);if(o.done)return o.value;var d=hg(a,RegExp),c=a.unicode,u=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(wg?"g":"y"),l=new d(wg?"^(?:"+a.source+")":a,u),h=void 0===i?4294967295:i>>>0;if(0===h)return[];if(0===s.length)return null===yg(l,s)?[s]:[];for(var p=0,f=0,m=[];f<s.length;){l.lastIndex=wg?0:f;var v,g=yg(l,wg?Dg(s,f):s);if(null===g||(v=Ag(fg(l.lastIndex+(wg?f:0)),s.length))===p)f=pg(s,f,c);else{if(xg(m,Dg(s,p,f)),m.length===h)return m;for(var y=1;y<=g.length-1;y++)if(xg(m,g[y]),m.length===h)return m;f=p=v}}return xg(m,Dg(s,p)),m}]}),!!_g((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]})),wg);var Sg=function(){function t(e){i(this,t),this.gameData=e,this.customParamKeys=["vid","_1ld","_1lp"]}return a(t,[{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 t=this;try{var n={},r=this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled,i=new C(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 e(this,t),this.customParamKeys.some(function(t){return e(this,r),t===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)}}}]),t}(),Tg=function(){function t(e,n){i(this,t),this.adContainer=e,this.onResume=n}return a(t,[{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 t=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(){e(this,t),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)}}}]),t}(),Rg=function(e){if(!e)return!1;var t=Ig.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)},Ig=Object.prototype.toString;function Og(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Og(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Og(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Pg(e){return null!=e&&e.error_url?"<vmap:VASTAdData>".concat(function(e){return e.promo_url?'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),"</vmap:VASTAdData>").trim():'<vmap:AdTagURI templateType="vast3"><![CDATA['.concat(null==e?void 0:e.adtag_url,"]]></vmap:AdTagURI>").trim()}var Lg=["bidFloor","isDfpBidding"];function Mg(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 Ug(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mg(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mg(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var jg=null,Bg=function(){function t(n,r,a){var s=this;if(i(this,t),jg)return jg;jg=this;var o={debug:!1,width:640,height:360,locale:"en"};this.options=r?m(o,r):o,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new v,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=a.parentDomain,this.topDomain=a.topDomain,this.parentURL=a.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=g(),this.atom_display,this.adType_="",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=""!==n?document.getElementById(n):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.gameId="0",this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){e(this,s),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){e(this,s),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var y,b,_,w,A,E,k,x,D,S,T,R,I,O,N,G,q,F,V;return a(t,[{key:"start",value:(V=r(s.mark((function e(){return s.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 V.apply(this,arguments)})},{key:"_getAdVast",value:function(t,i){var a=this;return new Promise(function(){var o=r(s.mark((function r(o){var c,u,l,h,p,f,m,v,g,y,b=this;return s.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(d.available&&d.getBoolean("gd_debug_ex")&&d.getBoolean("gd_tag"))){r.next=6;break}return c=a.IMASampleTags[t],u=Math.floor(Math.random()*c.length),l=c[u],o({url:l}),r.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){r.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return r.prev=8,r.next=11,a._getTunnlKeys(t);case 11:if(h=r.sent,p=h.data,f=p.nsid?p.nsid:"TNL_T-17102571517",m=p.tid?p.tid:"TNL_NS-18101700058",v="".concat(f,"/").concat(m),delete p.nsid,delete p.tid,j(p,{tnl_system:"1",tnl_content_category:a.category.toLowerCase()}),a.eventBus.broadcast("AD_REQUEST",{message:p.tnl_ad_pos}),g=a.options,"preroll"===p.tnl_ad_pos&&L(g.preroll)?g=g.preroll:"midroll"===p.tnl_ad_pos&&L(g.midroll)?g=g.midroll:"rewarded"===p.tnl_ad_pos&&L(g.rewarded)&&(g=g.rewarded),!(i&&i.retry_on_success&&L(g.retry_on_success)&&L(g.retry_on_success.vast))){r.next=26;break}return r.abrupt("return",o(a._createCustomAdVastUrl(g.retry_on_success.vast,{tnl_keys:p})));case 26:if(!(i&&i.retry_on_failure&&a.options.retry_on_failure&&L(g.retry_on_failure.vast))){r.next=30;break}return r.abrupt("return",o(a._createCustomAdVastUrl(g.retry_on_failure.vast,{tnl_keys:p})));case 30:if(!L(g.vast)){r.next=32;break}return r.abrupt("return",o(a._createCustomAdVastUrl(g.vast,{tnl_keys:p})));case 32:return r.next=34,a._create_dp_context(p.tnl_ad_pos,i);case 34:y=r.sent,window.idhb.que.push(function(){var t=this;e(this,b),window.idhb.setRefererUrl(encodeURIComponent(a.parentURL)),window.idhb.allowPersonalizedAds(!!parseInt(a.userAllowedPersonalizedAds));var r="rewarded"===p.tnl_ad_pos?"rewardedVideo":"gdbanner"===p.tnl_ad_pos?"gd__banner":"midroll"===p.tnl_ad_pos?"midroll":"video1";window.idhb.setDfpAdUnitCodeForAdSlot(r,v),window.idhb.setAdserverTargetingForAdSlot(r,p),window.idhb.requestAds({slots:n({},r,{bidFloor:null!=y&&y.floor_price?y.floor_price:void 0}),callback:function(n,r){var i=this;e(this,t),y&&!r.bidFloorApplied&&fetch(y.skip_url).catch(function(t){e(this,i)}.bind(this)),o({tnl_keys:p,url:n,dp:y,hl:r})}.bind(this)})}.bind(this)),r.next=41;break;case 38:throw r.prev=38,r.t0=r.catch(8),new Error(r.t0);case 41:case"end":return r.stop()}}),r,this,[[8,38]])})));return function(e){return o.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:"_getTunnlKeys",value:function(t){var n=this;return new Promise(function(r){var i,a,s=this;e(this,n);var o="";!navigator.userAgent.match(/Crosswalk/i)&&void 0===window.cordova||"m.hopy.com"!==this.parentDomain?("undefined"===this.topDomain&&(this.topDomain=void 0),o="page_url=".concat(encodeURIComponent(this.topDomain||this.parentDomain))):o="bundle=com.hopy.frivgames",function(e,t){try{var n={tp:e,data:t};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(B.encode(JSON.stringify(n)))))}catch(e){console.log("Send Atom Log Error...",e)}}("page_url",{top_domain:this.topDomain,parent_domain:this.parentDomain,game:this.gameId,pageUrl:o});var d=this.nextAdPosition(t);null===(i=this.gameData.pAds)||void 0===i||!i.enabled||null!==(a=this.gameData.loader)&&void 0!==a&&a.enabled||"preroll"!==d||(d="midroll");var c=u("ch",window.location.href),h=u("ch_date",window.location.href),p=c?"&ch=".concat(c):"",f=h?"&ch_date=".concat(h):"",m="https://pub.headerlift.com/opphb?".concat(o,"&player_width=").concat(this.options.width,"&player_height=").concat(this.options.height,"&ad_type=video_image&game_id=").concat(this.gameId,"&ad_position=").concat(d).concat(p).concat(f,"&correlator=").concat(Date.now()),v=new Request(m,{method:"GET"});fetch(v).then(function(t){e(this,s);var n=t.headers.get("content-type");if(n&&-1!==n.indexOf("application/json"))return t.json();throw new TypeError("Oops, we didn't get JSON!")}.bind(this)).then(function(t){e(this,s),l(t)&&(t=this._createTunnlReportingFallbackKeys(d),this.eventBus.broadcast("AD_REQUEST_KEYS_EMPTY",{message:"Tunnl returned empty response.",details:m})),r({data:t,url:m})}.bind(this)).catch(function(t){e(this,s);var n=this._createTunnlReportingFallbackKeys(d);this.eventBus.broadcast("AD_REQUEST_KEYS_FALLBACK",{message:t.message,details:m}),r({data:n,url:m})}.bind(this))}.bind(this))}},{key:"_createTunnlReportingFallbackKeys",value:function(e){return{tid:"TNL_T-17102571517",nsid:"TNL_NS-18101700058",tnl_tid:"T-17102571517",tnl_nsid:"NS-18101700058",tnl_pw:this.options.width,tnl_ph:this.options.height,tnl_pt:"22",tnl_pid:"P-17101800031",tnl_paid:"17",tnl_ad_type:"video_image",tnl_asset_id:this.gameId.toString(),tnl_ad_pos:e,tnl_skippable:"1",tnl_cp1:"",tnl_cp2:"",tnl_cp3:"",tnl_cp4:"",tnl_cp5:"",tnl_cp6:"",tnl_campaign:"2",tnl_gdpr:"0",tnl_gdpr_consent:"1",consent_string:"BOWJjG9OWJjG9CLAAAENBx-AAAAiDAAA",tnl_content_category:this.category.toLowerCase()}}},{key:"_requestAd",value:function(t,n){var r=this;return n=n||{},new Promise(function(i){if(e(this,r),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var a,s=null==t||null===(a=t.tnl_keys)||void 0===a?void 0:a.tnl_ad_pos;this.adSuccess=!1;var o=new google.ima.AdsRequest,d=this._transformVast(t,n),c=Ug(Ug({},n),{},{adTag:d,tnl_ad_pos:s});this.adCounter[s]=this.adCounter[s]||0,this.adCounter[s]++;var u=t.dp,l=t.hl;if(u&&(u.adtag_url=d.url,this._extend_dp_with_adsense(u,l,null==t?void 0:t.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 C(e.adtag_url_1,!0);a.query=Cg(Cg({},a.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:i,output:"xml_vast3"});var s=a.toString(),o=new C(e.adtag_url_2,!0);o.query=Cg(Cg({},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(Pg({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(Pg({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.gameId}})}}},{key:"_checkAutoPlay",value:(F=r(s.mark((function t(){var n=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t,r){var i=this;e(this,n);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?t({autoplayAllowed:!0,autoplayRequiresMute:!0}):P.video({inline:!0,muted:!1}).then(function(n){e(this,i);var r=n.result;n.error,t(!0===r?{autoplayAllowed:!0,autoplayRequiresMute:!1}:{autoplayAllowed:!0,autoplayRequiresMute:!0})}.bind(this))}.bind(this)));case 1:case"end":return t.stop()}}),t,this)}))),function(){return F.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(q=r(s.mark((function e(){var t;return s.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 q.apply(this,arguments)})},{key:"startAd",value:(G=r(s.mark((function e(t){var n,r,i;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.gameData.afg_disabled,r=t.adType,i=t.params,this.adType_=r,r!==c.Interstitial){e.next=23;break}if(!n){e.next=8;break}return e.abrupt("return",this._startInterstitialAd(i));case 8:if("preroll"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=12;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 12:if("start"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=16;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 16:if("next"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=20;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 20:return e.abrupt("return",this._startInterstitialAd(i));case 21:case 29:e.next=32;break;case 23:if(r!==c.Rewarded){e.next=31;break}if(!n){e.next=28;break}return e.abrupt("return",this._startRewardedAd(i));case 28:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 31:throw new Error("Unsupported ad type");case 32:case"end":return e.stop()}}),e,this)}))),function(e){return G.apply(this,arguments)})},{key:"preloadAd",value:(N=r(s.mark((function e(t){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==c.Interstitial){e.next=4;break}return e.abrupt("return",this._preloadInterstitialAd());case 4:if(t!==c.Rewarded){e.next=8;break}return e.abrupt("return",this._preloadRewardedAd());case 8:throw new Error("Unsupported ad type");case 9:case"end":return e.stop()}}),e,this)}))),function(e){return N.apply(this,arguments)})},{key:"addAdResume",value:function(){var t=this,n=function(){e(this,t),this.adsManager.resume()}.bind(this);try{this.adResume=new Tg(this.adContainer,n),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(O=r(s.mark((function t(n){var i=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=r(s.mark((function t(r,a){var o,d,c,u,l,p,f=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,(o=n?n.containerId:null)||a("Container id is not specified"),d=document.getElementById(o),document.getElementById(o)||a("No container is found with this id - ".concat(o)),void 0===window.idhb.requestAds&&a("Prebid.js wrapper script hit an error or didn't exist!"),c=n.slotId?n.slotId:"gd__banner@".concat(o),document.getElementById(c)||(u="\n .gd__banner{\n z-index: ".concat(h.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((l=document.createElement("style")).type="text/css",l.id="gd__banner__style",l.styleSheet?l.styleSheet.cssText=u:l.appendChild(document.createTextNode(u)),d.appendChild(l)),(p=document.createElement("div")).id=c,p.classList.add("gd__banner"),d.appendChild(p)),t.next=10,i._create_dp_display_context();case 10:i.atom_display=t.sent,window.idhb.que.push(function(){var t,n,r=this;e(this,f),window.idhb.setRefererUrl(encodeURIComponent(i.parentURL)),window.idhb.allowPersonalizedAds(!!parseInt(i.userAllowedPersonalizedAds)),window.idhb.setDefaultGdprConsentString("BOWJjG9OWJjG9CLAAAENBx-AAAAiDAAA"),null!==(t=i.atom_display)&&void 0!==t&&t.params&&window.idhb.setAdserverTargeting(null===(n=i.atom_display)||void 0===n?void 0:n.params);var a={};a[c]={maxSize:[d.offsetWidth,d.offsetHeight]},window.idhb.requestAds({slots:a,callback:function(t){e(this,r)}.bind(this)})}.bind(this)),r(),t.next=18;break;case 15:t.prev=15,t.t0=t.catch(0),a(t.t0.message||t.t0);case 18:case"end":return t.stop()}}),t,this,[[0,15]])})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(e){return O.apply(this,arguments)})},{key:"_startInterstitialAd",value:(I=r(s.mark((function e(t){var n;return s.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(Ug(Ug({},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 I.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(R=r(s.mark((function t(n){var r,i,a=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._resetAdsLoader(),t.prev=1,t.t0=this.preloadedInterstitialAdVast,t.t0){t.next=7;break}return t.next=6,this._getAdVast(c.Interstitial,n);case 6:t.t0=t.sent;case 7:return r=t.t0,delete this.preloadedInterstitialAdVast,t.next=11,this._requestAd(r,Ug({adType:c.Interstitial},n));case 11:return i=t.sent,t.next=14,new Promise(function(t,n){var r=this;e(this,a);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var s=function(n){e(this,r),this.eventBus.unsubscribeScope(i),t(n.message)}.bind(this),o=function(t){e(this,r),this.eventBus.unsubscribeScope(i),n(t.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",s,i),this.eventBus.subscribe("AD_SDK_CANCELED",o,i),this.eventBus.subscribe("AD_ERROR",o,i)}.bind(this));case 14:return t.abrupt("return",i);case 17:throw t.prev=17,t.t1=t.catch(1),new Error(t.t1);case 20:case"end":return t.stop()}}),t,this,[[1,17]])}))),function(e){return R.apply(this,arguments)})},{key:"_startRewardedAd",value:(T=r(s.mark((function e(t){var n;return s.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(Ug(Ug({},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 T.apply(this,arguments)})},{key:"_loadRewardedAd",value:(S=r(s.mark((function t(n){var r,i,a=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._resetAdsLoader(),t.prev=1,t.t0=this.preloadedRewardedAdVast,t.t0){t.next=7;break}return t.next=6,this._getAdVast(c.Rewarded,n);case 6:t.t0=t.sent;case 7:return r=t.t0,delete this.preloadedRewardedAdVast,t.next=11,this._requestAd(r,Ug({adType:c.Rewarded},n));case 11:return i=t.sent,t.next=14,new Promise(function(t,n){var r=this;e(this,a);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var s=function(n){e(this,r),this.eventBus.unsubscribeScope(i),t(n.message)}.bind(this),o=function(t){e(this,r),this.eventBus.unsubscribeScope(i),n(t.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",s,i),this.eventBus.subscribe("AD_SDK_CANCELED",o,i),this.eventBus.subscribe("AD_ERROR",o,i)}.bind(this));case 14:return t.abrupt("return",i);case 17:throw t.prev=17,t.t1=t.catch(1),new Error(t.t1);case 20:case"end":return t.stop()}}),t,this,[[1,17]])}))),function(e){return S.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(D=r(s.mark((function e(){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getAdVast(c.Interstitial);case 3:return this.preloadedInterstitialAdVast=e.sent,e.abrupt("return",this.preloadedInterstitialAdVast.url);case 7:throw e.prev=7,e.t0=e.catch(0),new Error(e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return D.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(x=r(s.mark((function e(){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getAdVast(c.Rewarded);case 3:return this.preloadedRewardedAdVast=e.sent,e.abrupt("return",this.preloadedRewardedAdVast.url);case 7:throw e.prev=7,e.t0=e.catch(0),new Error(e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return x.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(t){var n=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var r=null==t?void 0:t.mode,i=this._isT4R(t),a=this._getT4ROptions();"loaded"===r?(this.activeAdContainer.style.opacity=i?.001:1,i&&this.adsManager.setVolume(0),i&&this.eventBus.broadcast("AD_T4R"),i&&setTimeout(function(){e(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))):"click"!==r&&"first_quartile"!==r||(this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1))}}},{key:"_createPlayer",value:function(){var t=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=h.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(){e(this,t);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(t){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=t.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(){e(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=t.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var t,n=new Date,r=n.getHours(),i=n.getDate(),a=n.getMonth(),s=n.getFullYear(),o=p(google.ima.AdEvent.Type,e.type),d=!1,u=(null==e||null===(t=e.getAd())||void 0===t?void 0:t.getContentType())||"",l=!u.startsWith("image")&&!u.startsWith("text");this._sendIMAEventsToHB(e);var h="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:h="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:h="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:d=!0,h="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:h="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()),h="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:h="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:h="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",d=!0;break;case google.ima.AdEvent.Type.DURATION_CHANGE:h="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:h="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:h="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:h="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:h="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();h=v,this._show({mode:"loaded",contentType:v});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(h=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:h="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:l&&this.adResume.show(),h="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:h="Fired when the ad is resumed.",l&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:h="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:d=this._is_completed(e.getAd()),h="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:h="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:h="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:d=this._is_completed(e.getAd()),h="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:h="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:h="Fired when the ad volume has been muted."}""!==o&&""!==h&&this.eventBus.broadcast(o,{name:o,message:h,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}})}catch(e){}}},{key:"_sendIMAEventsToHB",value:function(e){if(window.idhb&&"function"==typeof window.idhb.onImaEvent)try{window.idhb.onImaEvent(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(t,n){var r=this;this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=window.setTimeout(function(){e(this,r),this.cancel(),this._clearSafetyTimer(n)}.bind(this),t)}},{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/gameDistributionV1.3.min.js","http://hb.improvedigital.com/pbw/gameDistributionV1.3.min.js"];return this.options.hb_script?[this.options.hb_script].concat(e):e}},{key:"_getInnerErrorCode",value:function(e){if(Rg(e.getInnerError)){var t=e.getInnerError();if(t)return Rg(t.getErrorCode)&&Rg(t.getVastErrorCode)?t.getErrorCode().toString()||t.getVastErrorCode().toString():t.message}}},{key:"resetForNext",value:function(){this.requestRunning=!1,this._hide("resetForNext")}},{key:"_createCustomAdVastUrl",value:function(t,n){var r=this;if(t){var i=this.macros.transform(t,{get:function(t){if(e(this,r),n&&n.tnl_keys)return n.tnl_keys[t.toLowerCase()]}.bind(this)});for(var a in i.query||{}){var s=i.query[a];L(s)&&(i.query[a]=U.stringify(s))}var o=new C(i.url,!0);return j(o.query,i.query||{}),Ug({url:o.toString()},n)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new C(e.url,!0),i=this._transformQuery(e,t,r);i&&(n.url=r.toString());var a=i?r:new C(e.url,!0);if(a.query.cust_params){var s=U.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(t,n,r){var i=this;if(t&&n&&t.tnl_keys){var a=this.options.vast_query;if(n.retry_on_success&&this.options.retry_on_success&&L(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:n.retry_on_failure&&this.options.retry_on_failure&&L(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=M(a),L(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=U.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 e(this,i),t.tnl_keys[n.toLowerCase()]}.bind(this)});return s.cust_params=d,j(s,u),s.cust_params=U.stringify(s.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,i,a,s,o,d,c,u,l,h=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(null!=e&&null!==(n=e.contentType)&&void 0!==n&&n.startsWith("image/")||"text"===(null==e?void 0:e.contentType))return h&&("preroll"===h&&(null===(r=this.gameData)||void 0===r||null===(i=r.pAds)||void 0===i||null===(a=i.t4r)||void 0===a?void 0:a.enabled)||"midroll"===h&&(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o||null===(d=o.t4r)||void 0===d?void 0:d.enabled)||"rewarded"===h&&(null===(c=this.gameData)||void 0===c||null===(u=c.rAds)||void 0===u||null===(l=u.t4r)||void 0===l?void 0:l.enabled));if(null!=e&&e.contentType.startsWith("video/")){var p,f,m,v,g,y,b,_,w,A="preroll"===h?null===(p=this.gameData)||void 0===p||null===(f=p.pAds)||void 0===f||null===(m=f.t4r)||void 0===m?void 0:m.viper:"midroll"===h?null===(v=this.gameData)||void 0===v||null===(g=v.mAds)||void 0===g||null===(y=g.t4r)||void 0===y?void 0:y.viper:"rewarded"===h?null===(b=this.gameData)||void 0===b||null===(_=b.rAds)||void 0===_||null===(w=_.t4r)||void 0===w?void 0:w.viper:0;if(A>0){var E,k,x,D,S,T,R,I,O,C=Math.random()<A;return h&&C&&("preroll"===h&&(null===(E=this.gameData)||void 0===E||null===(k=E.pAds)||void 0===k||null===(x=k.t4r)||void 0===x?void 0:x.enabled)||"midroll"===h&&(null===(D=this.gameData)||void 0===D||null===(S=D.mAds)||void 0===S||null===(T=S.t4r)||void 0===T?void 0:T.enabled)||"rewarded"===h&&(null===(R=this.gameData)||void 0===R||null===(I=R.rAds)||void 0===I||null===(O=I.t4r)||void 0===O?void 0:O.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),y=this.adCounter[e];return void 0!==(null==g?void 0:g.start)?y>=(null==g?void 0:g.start):v}},{key:"_getT4ROptions",value:function(){var e,t,n,r,i,a,s;switch(null===(e=this._adrequest_user_context)||void 0===e?void 0:e.tnl_ad_pos){case"preroll":return null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.t4r;case"midroll":return null===(r=this.gameData)||void 0===r||null===(i=r.mAds)||void 0===i?void 0:i.t4r;case"rewarded":return null===(a=this.gameData)||void 0===a||null===(s=a.rAds)||void 0===s?void 0:s.t4r}}},{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 t=this;return new Promise(function(n){var r=this;e(this,t);try{var i={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new Sg(this.gameData).checkCustomParams();a&&(i.cp=a);var s=encodeURIComponent(B.encode(JSON.stringify(i)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(s)).then(function(t){return e(this,r),t.json()}.bind(this)).then(function(t){if(e(this,r),!t||!t.p)return this.msgrt.send("dp.na",{message:"atom"}),n();this.msgrt.send("dp.fp",{message:t.p/100}),n({params:{fp:t.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(t){e(this,r),this.msgrt.send("dp.err",{message:(null==t?void 0:t.message)||t}),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(t,n){var i=this;return new Promise(function(){var a=r(s.mark((function r(a){var o,d,c,u,l,h,p=this;return s.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,i._isDP(t)){r.next=5;break}return i.msgrt.send("dp.na",{message:"rule"}),r.abrupt("return",a());case 5:d={id:i.topDomain||i.parentDomain,au:t||"unknown",ty:"video",aid:i.gameData.gameId,pgu:i.parentURL},(c=new Sg(i.gameData).checkCustomParams())&&(d.cp=c),u=encodeURIComponent(B.encode(JSON.stringify(d))),l=null===(o=i.gameData.promo)||void 0===o?void 0:o.rainbow,h=(null==l?void 0:l.enabled)&&!0!==(null==n?void 0:n.fallback_adsense),fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(u)).then(function(t){return e(this,p),t.json()}.bind(this)).then(function(t){if(e(this,p),!t||!t.p)return i.msgrt.send("dp.na",{message:"atom"}),a();var n=t.p/100;a({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(t){e(this,p),i.msgrt.send("dp.err",{message:(null==t?void 0:t.message)||t}),a()}.bind(this)),r.next=18;break;case 14:r.prev=14,r.t0=r.catch(0),i.msgrt.send("dp.err",{message:(null===r.t0||void 0===r.t0?void 0:r.t0.message)||r.t0}),a();case 18:case"end":return r.stop()}}),r,this,[[0,14]])})));return function(e){return a.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t,n){if(e&&t&&n)try{var r,i=new C(t.vastUrl,!0);if(null===(r=i.query)||void 0===r||!r.cust_params)return;if(!U.parse(i.query.cust_params).tnl_asset_id)return;n.bidFloor,n.isDfpBidding;var a=o(n,Lg);i.query.cust_params=U.stringify(Ug(Ug({},a),{},{adsense:1}),!1),e.fallback_url=i.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(k=r(s.mark((function t(n){var r,i,a=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this._getPrebidScripts(),i=r[0],window.HB_OPTIONSgd={gameId:this.gameId},t.next=5,f(i,"gdsdk_prebid",{alternates:r,error_prefix:"Blocked:",exists:function(){return e(this,a),window.idhb}.bind(this)});case 5:window.idhb=window.idhb||{},window.idhb.que=window.idhb.que||[],window.idhb.que.push(function(){var t=this;e(this,a),window.idhb.addEventListener("slotRenderEnded",function(n){var r=this;e(this,t);try{var i,a=n.slotId.split("@");a=1===a.length?a[0]:a[1],n.isEmpty?(null!==(i=this.atom_display)&&void 0!==i&&i.error_url&&(fetch(this.atom_display.error_url).catch(function(t){e(this,r)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_ERROR",{message:a,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(t){e(this,r)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:a,status:"success"}))}catch(e){}}.bind(this))}.bind(this));case 8:case"end":return t.stop()}}),t,this)}))),function(e){return k.apply(this,arguments)})},{key:"_init_ima_script",value:(E=r(s.mark((function t(n){var r,i,a=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=["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"],i=this.options.debug?r[0]:r[1],t.next=4,f(i,"gdsdk_ima",{alternates:r,error_prefix:"Blocked:",exists:function(){return e(this,a),window.google&&window.google.ima}.bind(this)});case 4:case"end":return t.stop()}}),t,this)}))),function(e){return E.apply(this,arguments)})},{key:"_init_afg_script",value:(A=r(s.mark((function t(n){var r,i,a,o,d=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.gameData.afg_disabled){t.next=3;break}return t.abrupt("return");case 3:return(o={}).crossorigin="anonymous",o["data-ad-client"]=(null==n||null===(r=n.adsense_client)||void 0===r?void 0:r.length)>0?n.adsense_client:"ca-pub-2316275586951220",(null==n||null===(i=n.adsense_channel)||void 0===i?void 0:i.length)>0&&(o["data-ad-channel"]=n.adsense_channel),(null==n||null===(a=n.adsense_host)||void 0===a?void 0:a.length)>0&&(o["data-ad-host"]=n.adsense_host),!0===(null==n?void 0:n.adsense_adbreak_test)&&(o["data-adbreak-test"]="on"),t.next=12,f("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return e(this,d),!!window.adsbygoogle}.bind(this),attrs:o});case 12:window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({sound:"on",preloadAdBreaks:"auto"});case 14:case"end":return t.stop()}}),t,this)}))),function(e){return A.apply(this,arguments)})},{key:"_startAdsensePlacementRewardedAd",value:(w=r(s.mark((function t(n){var r,i,a,o,d,c,u=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=1,!this.requestRunning){t.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),t.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),r=function(){e(this,u),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),i=function(){e(this,u),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(){e(this,u),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),o=function(){e(this,u),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(t){e(this,u),t()}.bind(this),c=function(t){e(this,u),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===t.breakStatus?this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this.eventBus.broadcast("AD_ERROR",{message:t.breakStatus,status:"error"}),"dismissed"!==t.breakStatus&&this._send_atom_event("sg.dbg.rw",t))}.bind(this),n={type:"reward",name:"reward-in-game",beforeAd:r,afterAd:i,adDismissed:a,adViewed:o,beforeReward:d,adBreakDone:c},window.adsbygoogle.push(n),t.next=21;break;case 17:throw t.prev=17,t.t0=t.catch(1),this._onError(t.t0),t.t0;case 21:case"end":return t.stop()}var n}),t,this,[[1,17]])}))),function(e){return w.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(_=r(s.mark((function t(n){var r,i=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=1,!this.requestRunning){t.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),t.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),r=function(t){e(this,i),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===t.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:t.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",t))}.bind(this),n={type:"preroll",adBreakDone:r},window.adsbygoogle.push(n),t.next=16;break;case 12:throw t.prev=12,t.t0=t.catch(1),this._onError(t.t0),t.t0;case 16:case"end":return t.stop()}var n}),t,this,[[1,12]])}))),function(e){return _.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(b=r(s.mark((function t(n){var r,i,a,o=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=1,!this.requestRunning){t.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),t.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),r=function(){e(this,o),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),i=function(){e(this,o),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(t){e(this,o),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===t.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:t.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",t))}.bind(this),n={type:"start",name:"start-in-game",beforeAd:r,afterAd:i,adBreakDone:a},window.adsbygoogle.push(n),t.next=18;break;case 14:throw t.prev=14,t.t0=t.catch(1),this._onError(t.t0),t.t0;case 18:case"end":return t.stop()}var n}),t,this,[[1,14]])}))),function(e){return b.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(y=r(s.mark((function t(n){var r,i,a,o=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=1,!this.requestRunning){t.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),t.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),r=function(){e(this,o),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),i=function(){e(this,o),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(t){e(this,o),this.resetForNext(),this.adCounter.midroll=this.adCounter.midroll||0,this.adCounter.midroll++,"viewed"===t.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:t.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",t))}.bind(this),n={type:"next",name:"next-in-game",beforeAd:r,afterAd:i,adBreakDone:a},window.adsbygoogle.push(n),t.next=18;break;case 14:throw t.prev=14,t.t0=t.catch(1),this._onError(t.t0),t.t0;case 18:case"end":return t.stop()}var n}),t,this,[[1,14]])}))),function(e){return y.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(B.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})}},{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}}]),t}(),Ng=Array.isArray,Gg=Object.prototype.toString,qg=Ng||function(e){return!!e&&"[object Array]"==Gg.call(e)},Fg=Ai,Vg=W,Kg=Ci,Wg=ta,zg=De,Hg=Tr,$g=Pr,Qg=Ee,Yg=Ca,Jg=Ut,Xg=ho,Zg=wa("slice"),ey=Jg("species"),ty=Vg.Array,ny=Math.max;Fg({target:"Array",proto:!0,forced:!Zg},{slice:function(e,t){var n,r,i,a=Qg(this),s=$g(a),o=Hg(e,s),d=Hg(void 0===t?s:t,s);if(Kg(a)&&(n=a.constructor,(Wg(n)&&(n===ty||Kg(n.prototype))||zg(n)&&null===(n=n[ey]))&&(n=void 0),n===ty||void 0===n))return Xg(a,o,d);for(r=new(void 0===n?ty:n)(ny(d-o,0)),i=0;o<d;o++,i++)o in a&&Yg(r,i,a[o]);return r.length=i,r}});var ry=mn,iy=Rs,ay=Ii,sy=Y,oy=gt,dy=function(e,t,n,r){try{return r?t(ry(n)[0],n[1]):t(n)}catch(t){iy(e,"throw",t)}},cy=ps,uy=ta,ly=Pr,hy=Ca,py=xs,fy=ys,my=W.Array,vy=function(e){var t=oy(e),n=uy(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=void 0!==i;a&&(i=ay(i,r>2?arguments[2]:void 0));var s,o,d,c,u,l,h=fy(t),p=0;if(!h||this==my&&cy(h))for(s=ly(t),o=n?new this(s):my(s);s>p;p++)l=a?i(t[p],p):t[p],hy(o,p,l);else for(u=(c=py(t,h)).next,o=n?new this:[];!(d=sy(u,c)).done;p++)l=a?dy(c,i,[d.value,p],!0):d.value,hy(o,p,l);return o.length=p,o};Ai({target:"Array",stat:!0,forced:!Js((function(e){Array.from(e)}))},{from:vy});var gy,yy,by,_y=!H((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),wy=W,Ay=_t,Ey=ke,ky=gt,xy=_y,Dy=Gn("IE_PROTO"),Sy=wy.Object,Ty=Sy.prototype,Ry=xy?Sy.getPrototypeOf:function(e){var t=ky(e);if(Ay(t,Dy))return t[Dy];var n=t.constructor;return Ey(n)&&t instanceof n?n.prototype:t instanceof Sy?Ty:null},Iy=H,Oy=ke,Cy=Ry,Py=xn.exports,Ly=Ut("iterator"),My=!1;[].keys&&("next"in(by=[].keys())?(yy=Cy(Cy(by)))!==Object.prototype&&(gy=yy):My=!0);var Uy=null==gy||Iy((function(){var e={};return gy[Ly].call(e)!==e}));Uy&&(gy={}),Oy(gy[Ly])||Py(gy,Ly,(function(){return this}));var jy={IteratorPrototype:gy,BUGGY_SAFARI_ITERATORS:My},By=jy.IteratorPrototype,Ny=su,Gy=re,qy=ts,Fy=cs,Vy=function(){return this},Ky=Ai,Wy=Y,zy=ur,Hy=ke,$y=function(e,t,n){var r=t+" Iterator";return e.prototype=Ny(By,{next:Gy(1,n)}),qy(e,r,!1),Fy[r]=Vy,e},Qy=Ry,Yy=Ja,Jy=ts,Xy=kn,Zy=xn.exports,eb=cs,tb=zy.PROPER,nb=zy.CONFIGURABLE,rb=jy.IteratorPrototype,ib=jy.BUGGY_SAFARI_ITERATORS,ab=Ut("iterator"),sb=function(){return this},ob=function(e,t,n,r,i,a,s){$y(n,t,r);var o,d,c,u=function(e){if(e===i&&m)return m;if(!ib&&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[ab]||p["@@iterator"]||i&&p[i],m=!ib&&f||u(i),v="Array"==t&&p.entries||f;if(v&&(o=Qy(v.call(new e)))!==Object.prototype&&o.next&&(Qy(o)!==rb&&(Yy?Yy(o,rb):Hy(o[ab])||Zy(o,ab,sb)),Jy(o,l,!0)),tb&&"values"==i&&f&&"values"!==f.name&&(nb?Xy(p,"name","values"):(h=!0,m=function(){return Wy(f,this)})),i)if(d={values:u("values"),keys:a?m:u("keys"),entries:u("entries")},s)for(c in d)(ib||h||!(c in p))&&Zy(p,c,d[c]);else Ky({target:t,proto:!0,forced:ib||h},d);return p[ab]!==m&&Zy(p,ab,m,{name:i}),eb[t]=m,d},db=kp.charAt,cb=jc,ub=ir,lb=ob,hb=ub.set,pb=ub.getterFor("String Iterator");lb(String,"String",(function(e){hb(this,{type:"String Iterator",string:cb(e),index:0})}),(function(){var e,t=pb(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=db(n,r),t.index+=e.length,{value:e,done:!1})})),Df("iterator");var fb=Ee,mb=pv,vb=cs,gb=ir,yb=ob,bb=gb.set,_b=gb.getterFor("Array Iterator"),wb=yb(Array,"Array",(function(e,t){bb(this,{type:"Array Iterator",target:fb(e),index:0,kind:t})}),(function(){var e=_b(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");vb.Arguments=vb.Array,mb("keys"),mb("values"),mb("entries");var Ab=W,Eb=vl,kb=bl,xb=wb,Db=kn,Sb=Ut,Tb=Sb("iterator"),Rb=Sb("toStringTag"),Ib=xb.values,Ob=function(e,t){if(e){if(e[Tb]!==Ib)try{Db(e,Tb,Ib)}catch(t){e[Tb]=Ib}if(e[Rb]||Db(e,Rb,t),Eb[t])for(var n in xb)if(e[n]!==xb[n])try{Db(e,n,xb[n])}catch(t){e[n]=xb[n]}}};for(var Cb in Eb)Ob(Ab[Cb]&&Ab[Cb].prototype,Cb);function Pb(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 Lb(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 Lb(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 Lb(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 Mb(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 Ub(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mb(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Ob(kb,"DOMTokenList");var jb={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"}},Bb={},Nb=function(e,t){Bb[e]=Ub(Ub({},t),{},{isLoading:!1})},Gb=function(t){var n=this,r=t.id,i=t.src;return new Promise(function(t,a){if(e(this,n),document.getElementById(r))t();else{var s=document.createElement("script");s.onload=function(){t()},s.id=r,s.setAttribute("crossorigin",!0),s.src=i,document.head.appendChild(s)}}.bind(this))},qb=function(){var e=r(s.mark((function e(t){var n,r,i,a,o,d,c,u;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=window[t])){e.next=3;break}return e.abrupt("return",n);case 3:if(!(r=Bb[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:r.isLoading=!0,i=Pb(r.dependencies),e.prev=8,i.s();case 10:if((a=i.n()).done){e.next=26;break}if(o=a.value,e.prev=12,d=jb[o].name,!window[d]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,Gb({id:o,src:jb[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),i.e(e.t1);case 31:return e.prev=31,i.f(),e.finish(31);case 34:return e.prev=34,e.next=37,Gb({id:t,src:r.source});case 37:n=window[t],e.next=43;break;case 40:e.prev=40,e.t2=e.catch(34),console.log("Could not load module ".concat(t," ").concat(r.source,"."),e.t2);case 43:return r.isLoading=!1,e.abrupt("return",n);case 45:case"end":return e.stop()}}),e,null,[[8,28,31,34],[12,20],[34,40]])})));return function(t){return e.apply(this,arguments)}}(),Fb=function e(t){var a=this;i(this,e),n(this,"load",r(s.mark((function e(){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qb(a.moduleName);case 2:a.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),n(this,"promo",r(s.mark((function e(){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a.module){e.next=3;break}return e.next=3,a.load();case 3:return e.abrupt("return",a.module[a.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var o=t.package||"gd-sdk-stone-dynamic",d=t.package_version||"1.1.1",c=t.template||"puzzle",u=t.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=c.charAt(0).toUpperCase()+c.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(o,"/").concat(d,"/dist/").concat(c.toLowerCase(),"/iife/index.js"),dependencies:u},Nb(this.moduleName,this.moduleConfig)},Vb=function e(t){var a=this;i(this,e),n(this,"load",r(s.mark((function e(){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qb(a.moduleName);case 2:a.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),n(this,"splash",r(s.mark((function e(){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a.module){e.next=3;break}return e.next=3,a.load();case 3:return e.abrupt("return",a.module[a.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var o=t.package||"gd-sdk-air-dynamic",d=t.package_version||"1.2.0",c=t.template||"pluto",u=t.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=c.charAt(0).toUpperCase()+c.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(o,"/").concat(d,"/dist/").concat(c.toLowerCase(),"/iife/index.js"),dependencies:u},Nb(this.moduleName,this.moduleConfig)},Kb=function(e,t){console.log(e,t)},Wb={},zb={},Hb=null;function $b(){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 Wb.version=r,Wb.frame=e,Wb.function=n,Wb.version}function Qb(t){var r=this;return Hb||(Hb=new Promise(function(i){function a(e,n){if(Kb("Received a response from CMP",e),n){var r,a;if(!1!==e.gdprApplies)return"tcloaded"===e.eventStatus||"useractioncomplete"===e.eventStatus?(("boolean"!=typeof(a=(r=e)&&"boolean"==typeof r.gdprApplies?r.gdprApplies:t.defaultGdprScope)||!0===a&&"string"!=typeof r.tcString)&&i({result:"cmpUnexpectedResponse",cmp:Wb,consentData:r}),void i({result:"ok",consentData:e})):void 0;i({result:"ok",consentData:e})}else i({result:"cmpCallFailed"})}e(this,r),$b(),Wb.frame?2===Wb.version?(Kb("TCF v2 CMP found. Fetching the consent."),Wb.function?(Kb("CMP API is directly accessible, calling it now..."),Wb.function("addEventListener",Wb.version,a)):(Kb("CMP API is outside the current iframe, calling it now..."),function(t,r,i){var a=this,s="__tcfapi";function o(e){var t="".concat(s,"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!==zb[r.callId]&&zb[r.callId](r.returnValue,r.success)}}window[s]=function(t,i,o,d){e(this,a);var c=Math.random()+"",u="".concat(s,"Call"),l=n({},u,{command:t,parameter:d,callId:c,version:i});zb[c]=o,r.postMessage(l,"*")}.bind(this),window.addEventListener("message",o,!1),window[s](t,Wb.version,i)}("addEventListener",Wb.frame,a))):i({result:"cmpVersionNotV2",cmp:Wb}):i({result:"cmpNotFound"})}.bind(this)),Hb)}var Yb=new(function(){function e(){i(this,e),this.productName="Game Distribution"}var t;return a(e,[{key:"checkIfExcluded",value:function(e){try{var t,n;return!(null===(t=e.diagnostic)||void 0===t||null===(n=t.gameDock)||void 0===n||!n.excluded)}catch(e){return console.log("Error on checkIfExclude check",e),!1}}},{key:"track",value:(t=r(s.mark((function e(t,n){var r,i,a,o,d,c;return s.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(i=null==t||null===(r=t.visitor)||void 0===r?void 0:r.visitorId){e.next=6;break}return e.abrupt("return");case 6:return a=encodeURIComponent(this.productName),o=encodeURIComponent(i),e.prev=8,d="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(a,"/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(a,"/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,n){return t.apply(this,arguments)})}]),e}());function Jb(t){var n=this,r={},i=(null==t?void 0:t._ancestor_origins)||window.location.ancestorOrigins,a=(null==t?void 0:t.self_url)||window.location.href,s=(null==t?void 0:t.self_origin)||window.location.origin,o=(null==t?void 0:t.referrer_url)||document.referrer;function d(e){return q(r,e)}function c(e,t){return F(r,e,t)}function u(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new C(e,t)}catch(e){console.log(e)}}function l(){for(var e=(null==t?void 0:t.urls)||[a,o],n=0;n<e.length;n++){var r,i=u(e[n]);if(i){var s=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(s&&(s=decodeURIComponent(s),N.isURL(s)))return s}}}return function(){var t;e(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(G(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")}(),t=l(),0===r.depth.value?(c("partner.url.value",a),c("partner.url.from","self-top")):t?G(t)?(c("partner.url.value",a),c("partner.url.from","partner-domain")):(c("partner.url.value",t),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))}}}function Xb(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 Zb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xb(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var e_=null,t_=null,n_=function(){function n(t){var r=this;if(i(this,n),e_)return e_;e_=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,t),this._version=t.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new Jb,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(t){e(this,r),this._sdk_ready=!0}.bind(this)).catch(function(t){e(this,r),this._sdk_ready=!1}.bind(this)).finally(function(){var t=this;e(this,r),this._sendLoaderDataEvent(),this._checkSplashAndPromoScreens(),this._initBlockingExternals(),window.addEventListener("DOMNodeInserted",function(){if(e(this,t),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)),this._checkFullscreen()}.bind(this))}var o,u,l,h,p,g,P,L,j,N;return a(n,[{key:"testConsent",value:function(){console.log("test-consent. Finding CMP");try{var e=$b();console.log("CMP found",e),r(s.mark((function e(){var t;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Qb({});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:"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"}),this._sendEvent("gameplay")}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:(N=r(s.mark((function t(n,r){var i,a=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._getGameData();case 3:this._gameData=t.sent,this._bridge.isCoreSDKMode=!(!0===this._gameData.enableAds||!0===(null===(i=this._gameData.enableAds)||void 0===i?void 0:i.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(t){return e(this,a),console.error(t.message||t)}.bind(this))),this._sendSDKReady(),n(this._gameData),t.next=20;break;case 15:t.prev=15,t.t0=t.catch(0),this._sendSDKError(t.t0),this.onResumeGame(t.t0.message,"warning"),r(t.t0);case 20:case"end":return t.stop()}}),t,this,[[0,15]])}))),function(e,t){return N.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?m(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=Yv.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){"undefined"===this._topDomain&&(this._topDomain=void 0);var t={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(U.stringify(t)))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=y("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,b("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 _({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:w(),version:Yv.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:A(),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 t=this;try{var n=["https://cdn.gamedock.io/gamedock-web-tracker/4.4.0/script/gamedock-sdk.min.js"];f(n[0],"GamedockSDK",{alternates:n}).then(function(){var n,r;e(this,t),t_=this._initGamedockTracker(window.GamedockSDK),this._sendEvent("pageview"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(r=n.gameDock)&&void 0!==r&&r.adViewEvent&&t_.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),Yb.track(t_,this._gameData),this._gameData.loader.enabled||this._sendLoadedEvent()}.bind(this)).catch(function(n){e(this,t),this._sendSDKError(n)}.bind(this))}catch(e){}}},{key:"_initGamedockTracker",value:function(e){if(!this._bridge.isCoreSDKMode)return e.initialize("gd",this._parentDomain)}},{key:"_sendEvent",value:function(e){t_.tracking.trackEvent(e,{pageId:this.options.gameId,pageType:"game"})}},{key:"_loadMiniJuegosGratisTracker",value:function(){var t=this;window.mpConfig={game:this.options.gameId,partner:"game-distribution"};var n=["https://ext.minijuegosgratis.com/external-host/main.js"];f(n[0],"MinijuegosSDK",{alternates:n}).catch(function(n){e(this,t),this._sendSDKError(n)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var t=this,n=["https://www.google-analytics.com/analytics.js"];f(n[0],"gdsdk_google_analytics",{alternates:n,error_prefix:"Blocked:",exists:function(){return e(this,t),window.ga}.bind(this)}).then(function(){e(this,t),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){e(this,t),this._sendSDKError(n)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var t=this;this.eventBus=new v,E.forEach(function(n){var r=this;return e(this,t),this.eventBus.subscribe(n,function(t){return e(this,r),this._onEvent(t)}.bind(this),"sdk")}.bind(this)),k.forEach(function(n){var r=this;return e(this,t),this.eventBus.subscribe(n,function(t){return e(this,r),this._onEvent(t)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(e(this,t),"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 e(this,t),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(n){var r,i;e(this,t),this.msgrt.send("ad.impression"),null!==(r=this._gameData.diagnostic)&&void 0!==r&&null!==(i=r.gameDock)&&void 0!==i&&i.adViewEvent&&Yb.track(t_,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(n){e(this,t),this.msgrt.send("ad.error",{message:n.message,details:n.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(n){e(this,t),this._sendAdRequestContext(n.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(n){e(this,t),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){e(this,t),this.msgrt.send("tunnl.keys.empty",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_FALLBACK",function(n){e(this,t),this.msgrt.send("tunnl.keys.fallback",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_T4R",function(n){return e(this,t),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(Yv.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(j=r(s.mark((function t(){var n,r,i=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=this._gameData,n=void 0===this._gameData.dmain||this._gameData.dmain,(r.bloc_gard&&!0===r.bloc_gard.enabled||!n)&&(this.msgrt.send("blocked"),setTimeout(function(){e(this,i),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(U.stringify({domain:this._parentDomain,id:r.gameId,img:this._get_game_thumbnail_url(),title:r.title}))}.bind(this),100));case 5:case"end":return t.stop()}}),t,this)}))),function(){return j.apply(this,arguments)})},{key:"_checkGameDeleted",value:function(){var t=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(){e(this,t),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:(L=r(s.mark((function e(){var t;return s.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=m(this.options.advertisementSettings,t.sdk)),this.macros=new x({game:t,bridge:this._bridge}),this.adInstance=new Bg(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=Yv,this.adInstance._send("gd.location",this._location.get()),e.next=17,this.adInstance.start();case 17:case"end":return e.stop()}}),e,this)}))),function(){return L.apply(this,arguments)})},{key:"_sendSDKReady",value:function(){var e="Everything is ready.";this.eventBus.broadcast("SDK_READY",{message:e,status:"success"});try{this.options.onInit(e)}catch(e){b("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){b("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){b(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status})}catch(e){b("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:function(){var t=this;return new Promise(function(n){var r=this;e(this,t);var i=this._getDefaultGameData(),a=this._getGameDataUrl();fetch(a).then(function(t){return e(this,r),t.json()}.bind(this)).then(function(t){if(e(this,r),t.success){var a,s,o,d,c=t.result.game,u={gameId:c.gameMd5,slug:c.slug,pname:c.pname,dname:c.dname,status:c.status,description:c.description,enableAds:!0===c.enableAds||!0===(null===(a=c.enableAds)||void 0===a?void 0:a.enabled),preroll:c.preRoll,midroll:6e4*c.timeAds,rewardedAds:c.rewardedAds,title:c.title,tags:c.tags,category:c.category,assets:c.assets,disp_2nd_prer:c.disp_2nd_prer,ctry_vst:c.ctry_vst,ctry:c.ctry,crtv:c.crtv,dmain:c.dmain,block_exts:this._parseAndSelectRandomOne(c.push_cuda),bloc_gard:this._parseAndSelectRandomOne(c.bloc_gard),cookie:this._parseAndSelectRandomOne(c.cookie),gdpr:this._parseAndSelectRandomOne(c.gdpr),diagnostic:this._parseAndSelectRandomOne(c.diagnostic),sdk:this._parseAndSelectRandomOne(c.sdk)||{},loader:this._parseAndSelectRandomOne(c.loader)||{},splash:this._parseAndSelectRandomOne(c.splash)||{},promo:this._parseAndSelectRandomOne(c.promo)||{},dAds:this._parseAndSelectRandomOne(c.dads)||{},pAds:this._parseAndSelectRandomOne(c.pads)||{},mAds:this._parseAndSelectRandomOne(c.mads)||{},rAds:this._parseAndSelectRandomOne(c.rads)||{}},l=m(M(i),u);l.afg_disabled=!1===(null===(s=l.sdk)||void 0===s||null===(o=s.afg)||void 0===o?void 0:o.enabled),null!==(d=l.pAds)&&void 0!==d&&d.enabled&&(l.preroll=!0),this._bridge.noPreroll=(!this._getisMobile()||!1!==l.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(l),D(l.diagnostic),n(l)}else i.failed=!0,n(i)}.bind(this)).catch(function(t){e(this,r),i.failed=!0,n(i)}.bind(this))}.bind(this))}},{key:"_createSplash",value:(P=r(s.mark((function t(n,r){var i,a,o=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._getSplashTemplate(n);case 2:i=t.sent,(a=new i(Zb(Zb({},this.options),{},{isConsentDomain:r,version:Yv.version}),n,this._parentDomain)).on("playClick",function(){var t=this;if(e(this,o),r){var n=new Date;n.setDate(n.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(n.toUTCString(),"; path=/")}this.showAd(c.Interstitial,{position:"preroll"}).catch(function(n){e(this,t)}.bind(this))}.bind(this)),this.onPauseGame("Pause the game and wait for a user gesture","success"),this.eventBus.subscribe("SDK_GAME_PAUSE",function(){e(this,o),a.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){e(this,o),a.hide()}.bind(this));case 8:case"end":return t.stop()}}),t,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(g=r(s.mark((function t(n,r){var i,a,o,d,c=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._createPrerollPromoTemplate(n);case 3:o=t.sent,(d=new o(Zb(Zb({},this.options),{},{isConsentDomain:r,version:Yv.version,template:null===(i=n.promo)||void 0===i||null===(a=i.template)||void 0===a?void 0:a.preroll}),n)).on("done",function(){e(this,c),d.hide(),this._createSplash(n,r)}.bind(this)),t.next=12;break;case 8:t.prev=8,t.t0=t.catch(0),console.log(t.t0),this._createSplash(n,r);case 12:case"end":return t.stop()}}),t,this,[[0,8]])}))),function(e,t){return g.apply(this,arguments)})},{key:"_createPromo",value:(p=r(s.mark((function t(n,r){var i,a,o,d,c=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._createPrerollPromoTemplate(n);case 3:o=t.sent,(d=new o(Zb(Zb({},this.options),{},{isConsentDomain:r,version:Yv.version,template:null===(i=n.promo)||void 0===i||null===(a=i.template)||void 0===a?void 0:a.preroll}),n)).on("done",function(){e(this,c),d.hide(),this.onResumeGame("Resumed after the promo","warning")}.bind(this)),this.onPauseGame("Pause the game for the promo","success"),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),this.onResumeGame("Resumed after the promo","warning");case 12:case"end":return t.stop()}}),t,this,[[0,9]])}))),function(e,t){return p.apply(this,arguments)})},{key:"showBanner",value:function(){var t=this;this.showAd(c.Interstitial).catch(function(){e(this,t)}.bind(this))}},{key:"showAd",value:(h=r(s.mark((function t(n){var i,a=this,o=arguments;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=o.length>1&&void 0!==o[1]?o[1]:{},t.abrupt("return",new Promise(function(){var t=r(s.mark((function t(r,o){var d,c,u,l,h,p,f,m,v,g,y,b,_,w=this;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,m={adType:n,params:i,adTimestamp:a.adRequestTimer},t.next=4,a.sdkReady;case 4:return v=t.sent,t.next=7,a.videoAdReady;case 7:return a._sendLoadedEvent(),a._rejectAdIfGameBlocked({gameData:v,adRequest:m}),a._rejectAdIfAdDisabled({gameData:v,adRequest:m}),a._rejectAdIfUnsupportedType({adRequest:m}),a._rejectAdIfRewardedDisabled({gameData:v,adRequest:m}),(null===(d=v.mAds)||void 0===d||null===(c=d.gift)||void 0===c||!c.enabled||null!==(u=v.mAds)&&void 0!==u&&null!==(l=u.gift)&&void 0!==l&&l.enabled&&(null==v||null===(h=v.mAds)||void 0===h||null===(p=h.gift)||void 0===p||null===(f=p.durations[a._giftCount])||void 0===f?void 0:f.after)!==a.adInstance.adMidrollCount)&&a._rejectAdIfAdRateHits({gameData:v,adRequest:m}),a.adInstance.attachAfgPosition(m),a._attachAfgFallback({gameData:v,adRequest:m}),g="main.showad",y=function(t){var n,r,i,s,d;e(this,w),a.eventBus.unsubscribeScope(g),a.onResumeGame(t.message,"warning"),null!=v&&null!==(n=v.mAds)&&void 0!==n&&null!==(r=n.gift)&&void 0!==r&&r.enabled&&(null==v||null===(i=v.mAds)||void 0===i||null===(s=i.gift)||void 0===s||null===(d=s.durations[a._giftCount])||void 0===d?void 0:d.after)===a.adInstance.adMidrollCount&&a.decideToGiveAGift(),o(t.message)}.bind(this),b=function(t){var n,i,s,o,d;e(this,w),a.eventBus.unsubscribeScope(g),a.adRequestTimer=Date.now(),a.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),null!=v&&null!==(n=v.mAds)&&void 0!==n&&null!==(i=n.gift)&&void 0!==i&&i.enabled&&(null==v||null===(s=v.mAds)||void 0===s||null===(o=s.gift)||void 0===o||null===(d=o.durations[a._giftCount])||void 0===d?void 0:d.after)===a.adInstance.adMidrollCount&&a.decideToGiveAGift(),r(t.message)}.bind(this),_=function(t){var s=this;e(this,w),a.eventBus.unsubscribeScope(g),i.fallback_adsense=!1,a.showAd(n,Zb(Zb({},i),{},{adapter:"adsense"})).then(function(t){e(this,s),r(t)}.bind(this)).catch(function(t){e(this,s),o(t)}.bind(this))}.bind(this),a.eventBus.subscribe("AD_ERROR",null!=i&&i.fallback_adsense?_:y,g),a.eventBus.subscribe("AD_SDK_CANCELED",null!=i&&i.fallback_adsense?_:y,g),a.eventBus.subscribe("AD_SUCCESS",b,g),t.next=24,a.adInstance.startAd(m);case 24:a._post_message({topic:"adrequest.instream"}),t.next=31;break;case 27:t.prev=27,t.t0=t.catch(0),a.onResumeGame(t.t0.message,"warning"),o(t.t0.message);case 31:case"end":return t.stop()}}),t,this,[[0,27]])})));return function(e,n){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}}),t)}))),function(e){return h.apply(this,arguments)})},{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=r(s.mark((function e(t){var n=this;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=r(s.mark((function e(r,i){var a,o;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return a=e.sent,e.next=6,n.videoAdReady;case 6:if(!a.bloc_gard||!0!==a.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(a.enableAds&&!n._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(t){e.next=14;break}t=c.Rewarded,e.next=16;break;case 14:if(t===c.Interstitial||t===c.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+t);case 16:if(t!==c.Rewarded||a.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,n.adInstance.preloadAd(t);case 20:o=e.sent,r(o),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),i(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return l.apply(this,arguments)})},{key:"cancelAd",value:(u=r(s.mark((function e(){var t=this;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=r(s.mark((function e(n,r){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{t.adInstance.cancel(),t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),r()}catch(e){t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),n(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(){return u.apply(this,arguments)})},{key:"showDisplayAd",value:function(e){var t=this;return new Promise(function(){var n=r(s.mark((function n(r,i){var a;return s.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,t.sdkReady;case 3:return a=n.sent,n.next=6,t.videoAdReady;case 6:if(!a.dAds.enabled){n.next=13;break}return n.next=9,t.adInstance.loadDisplayAd(e);case 9:t._post_message({topic:"adrequest.display"}),r(),n.next=14;break;case 13:i("Display-Ads are disabled.");case 14:n.next=19;break;case 16:n.prev=16,n.t0=n.catch(0),i(n.t0.message||n.t0);case 19:case"end":return n.stop()}}),n,null,[[0,16]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){b("DEVELOPER_ERROR",e.message,"warning")}var n="SDK_GAME_START";this.eventBus.broadcast(n,{name:n,message:e,status:t,analytics:{category:"SDK",action:n,label:this.options.gameId+""}})}},{key:"onPauseGame",value:function(e,t){this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){b("DEVELOPER_ERROR",e.message,"warning")}var n="SDK_GAME_PAUSE";this.eventBus.broadcast(n,{name:n,message:e,status:t,analytics:{category:"SDK",action:n,label:this.options.gameId+""}})}},{key:"openConsole",value:function(){try{new S(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 t=this;try{var n=this._gameData;n.sdk.fullscreen&&"auto"===n.sdk.fullscreen&&document.addEventListener("click",function(){if(e(this,t),!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(t){var n=this;void 0!==this.window_open&&(!1===t.enabled?window.open=function(t){e(this,n),this.msgrt.send("external",{message:"C> ".concat(t)}),(t.startsWith("https://play.google.com")||t.startsWith("https://itunes.apple.com"))&&this.window_open.call(null,t)}.bind(this):window.open=this.window_open)}},{key:"_removeExternalsInHtml",value:function(t){var n=this;!1===t.enabled&&window.document.querySelectorAll("a").forEach(function(t){var r=this;e(this,n);var i=!!(t.innerText.toLowerCase().includes("start")||t.innerText.toLowerCase().includes("play")||t.innerText.toLowerCase().includes("continue")),a=t.getAttribute("href");t.removeAttribute("href"),i||(t.onclick=function(t){return e(this,r),t.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:T()),a=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:R()),s=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===w()?a:I()),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:w(),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:"_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 C(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 C(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var i=new C(location.href,!0);if(!i.query.gd_zone_config)return;e=i.query.gd_zone_config}return JSON.parse(B.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new Vb(t).splash()}},{key:"_createPrerollPromoTemplate",value:(o=r(s.mark((function e(t){var n,r,i,a,o;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=null===(n=t.promo)||void 0===n?void 0:n[null===(r=t.promo)||void 0===r||null===(i=r.template)||void 0===i?void 0:i.preroll],o=new Fb(a),e.abrupt("return",o.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(B.encode(JSON.stringify(e)))}catch(e){}try{var n=new C(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(U.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new C(e,!0);return n.query=Zb(Zb({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return B.encode(JSON.stringify(e))}},{key:"_parseAndSelectRandomOne",value:function(e){var n=this._selectRandomOne("object"===t(e)?e:O(e));return n&&n.version?Yv.version>=n.version?n:void 0:n}},{key:"_selectRandomOne",value:function(t){var n=this;if(!qg(t)||0===t.length)return t;if(1===t.length)return t[0];var r=0;t.forEach(function(t){e(this,n),t.weight=t.weight||1,r+=t.weight}.bind(this));var i=Math.floor(Math.random()*Math.floor(r));r=0;for(var a=0;a<t.length;a++){var s=t[a];if(i<(r+=s.weight))return s}}},{key:"session",value:function(){var e=this;return new Promise(function(){var t=r(s.mark((function t(n,r){var i;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.sdkReady;case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:i=e._gameData,n({ads:{display:{enabled:i.dAds.enabled},rewarded:{enabled:i.rewardedAds}},location:{parentDomain:e._bridge.parentDomain,topDomain:e._bridge.topDomain,parentURL:e._bridge.parentURL,depth:e._bridge.depth,loadedByGameZone:e._bridge.isTokenGameURL}});case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e,n){return t.apply(this,arguments)}}())}},{key:"_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 t=this,n=this._gameData,r=n.assets.find(function(n){return e(this,t),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 t=this;try{var n,i,a=null===(n=this._gameData)||void 0===n||null===(i=n.mAds)||void 0===i?void 0:i.gift;this.giftInterval=setInterval(r(s.mark((function n(){var r=this;return s.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t.adInstance.requestRunning?console.log("Advertisement already running..."):(t.showAd(c.Interstitial,{position:"midroll"}).catch(function(t){e(this,r)}.bind(this)),clearInterval(t.giftInterval),t.giftInterval=void 0,t._giftCount++);case 1:case"end":return n.stop()}}),n,this)}))),1e3*a.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}}]),n}(),r_=new function e(){var t=this;i(this,e),n(this,"load",r(s.mark((function e(){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qb("Leaderboard");case 2:t.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),n(this,"showLeaderboard",function(){var e=r(s.mark((function e(n){var r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=window.GD_OPTIONS.gameId,t.leaderboard){e.next=4;break}return e.next=4,t.load();case 4:t.leaderboard.showLeaderBoard(r,n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n(this,"addScore",function(){var e=r(s.mark((function e(n){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.leaderboard){e.next=3;break}return e.next=3,t.load();case 3:t.leaderboard.addScore(n);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.moduleName="Leaderboard",this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/gd-sdk-leaderboard/0.1.43/dist/default/iife/index.js",dependencies:["react","react-dom","redux","react-redux","material-ui-core"]},Nb(this.moduleName,this.moduleConfig)},i_=new n_(function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":t(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===t(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}());function a_(){var t=this;this.AdType=c,this.preloadAd=function(e){return i_.preloadAd(e)},this.showAd=function(e,t){return e===c.Display?i_.showDisplayAd(t):i_.showAd(e)},this.cancelAd=function(){return i_.cancelAd()},this.openConsole=function(){i_.openConsole()},this.getSession=function(){return i_.session()},this.leaderboard={show:function(){e(this,t),r_.showLeaderboard()}.bind(this),addScore:function(n){e(this,t),r_.addScore(n)}.bind(this)}}a_.prototype=new function(){this.showBanner=function(){i_.showBanner()},this.play=function(){},this.customLog=function(){}},window.gdsdk=new a_,window.gdApi=window.gdsdk;
1
+ import e from"@babel/runtime/helpers/newArrowCheck";import t from"@babel/runtime/helpers/typeof";import n from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/asyncToGenerator";import i from"@babel/runtime/helpers/classCallCheck";import a from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/regenerator";import s from"@babel/runtime/helpers/objectWithoutProperties";import{Ls as d,AdType as c,getQueryString as u,isObjectEmpty as l,Layers as h,getKeyByValue as p,getScript as f,extendDefaults as m,EventBus as v,getIMASampleTags as g,getQueryParams as y,dankLog as b,MessageRouter as _,getIframeDepth as w,getMobilePlatform as A,SDKEvents as E,IMAEvents as k,Macros as x,setDankLog as D,ImplementationTest as S,getParentUrl as T,getParentDomain as R,getTopDomain as I,parseJSON as O}from"@bygd/gd-sdk-era/dist/default";import C from"url-parse";import P from"can-autoplay";import{isPlainObject as L}from"is-plain-object";import M from"lodash.clonedeep";import U from"querystringify";import j from"lodash.merge";import{Base64 as B}from"js-base64";import N from"validator";import G from"is-valid-domain";import q from"get-value";import F from"set-value";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=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,oe=ie.call,se=ae&&ae.bind(oe),de=ae?function(e){return e&&se(oe,e)}:function(e){return e&&function(){return oe.apply(e,arguments)}},ce=de,ue=ce({}.toString),le=ce("".slice),he=function(e){return le(ue(e),8,-1)},pe=de,fe=H,me=he,ve=W.Object,ge=pe("".split),ye=fe((function(){return!ve("z").propertyIsEnumerable(0)}))?function(e){return"String"==me(e)?ge(e,""):ve(e)}:ve,be=W.TypeError,_e=function(e){if(null==e)throw be("Can't call method on "+e);return e},we=ye,Ae=_e,Ee=function(e){return we(Ae(e))},ke=function(e){return"function"==typeof e},xe=ke,De=function(e){return"object"==typeof e?null!==e:xe(e)},Se=W,Te=ke,Re=function(e){return Te(e)?e:void 0},Ie=function(e,t){return arguments.length<2?Re(Se[e]):Se[e]&&Se[e][t]},Oe=de({}.isPrototypeOf),Ce=Ie("navigator","userAgent")||"",Pe=W,Le=Ce,Me=Pe.process,Ue=Pe.Deno,je=Me&&Me.versions||Ue&&Ue.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 Ne=ne,Ge=Ne,qe=H,Fe=!!Object.getOwnPropertySymbols&&!qe((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ge&&Ge<41})),Ve=Fe&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ke=Ie,We=ke,ze=Oe,He=Ve,$e=W.Object,Qe=He?function(e){return"symbol"==typeof e}:function(e){var t=Ke("Symbol");return We(t)&&ze(t.prototype,$e(e))},Ye=W.String,Je=function(e){try{return Ye(e)}catch(e){return"Object"}},Xe=ke,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=ke,ot=De,st=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))},yt=gt,bt=de({}.hasOwnProperty),_t=Object.hasOwn||function(e,t){return bt(yt(e),t)},wt=de,At=0,Et=Math.random(),kt=wt(1..toString),xt=function(e){return"Symbol("+(void 0===e?"":e)+")_"+kt(++At+Et,36)},Dt=W,St=dt.exports,Tt=_t,Rt=xt,It=Fe,Ot=Ve,Ct=St("wks"),Pt=Dt.Symbol,Lt=Pt&&Pt.for,Mt=Ot?Pt:Pt&&Pt.withoutSetter||Rt,Ut=function(e){if(!Tt(Ct,e)||!It&&"string"!=typeof Ct[e]){var t="Symbol."+e;It&&Tt(Pt,e)?Ct[e]=Pt[e]:Ct[e]=Ot&&Lt?Lt(t):Mt(t)}return Ct[e]},jt=Y,Bt=De,Nt=Qe,Gt=rt,qt=function(e,t){var n,r;if("string"===t&&at(n=e.toString)&&!ot(r=it(n,e)))return r;if(at(n=e.valueOf)&&!ot(r=it(n,e)))return r;if("string"!==t&&at(n=e.toString)&&!ot(r=it(n,e)))return r;throw st("Can't convert object to primitive value")},Ft=Ut,Vt=W.TypeError,Kt=Ft("toPrimitive"),Wt=function(e,t){if(!Bt(e)||Nt(e))return e;var n,r=Gt(e,Kt);if(r){if(void 0===t&&(t="default"),n=jt(r,e,t),!Bt(n)||Nt(n))return n;throw Vt("Can't convert object to primitive value")}return void 0===t&&(t="number"),qt(e,t)},zt=Qe,Ht=function(e){var t=Wt(e,"string");return zt(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=!$&&!H((function(){return 7!=Object.defineProperty(Xt("div"),"a",{get:function(){return 7}}).a})),en=$,tn=Y,nn=J,rn=re,an=Ee,on=Ht,sn=_t,dn=Zt,cn=Object.getOwnPropertyDescriptor;z.f=en?cn:function(e,t){if(e=an(e),t=on(t),dn)try{return cn(e,t)}catch(e){}if(sn(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,yn=mn,bn=Ht,_n=W.TypeError,wn=Object.defineProperty;un.f=vn?wn:function(e,t,n){if(yn(e),t=bn(t),yn(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,En=re,kn=$?function(e,t,n){return An.f(e,t,En(1,n))}:function(e,t,n){return e[t]=n,e},xn={exports:{}},Dn=ke,Sn=pt,Tn=de(Function.toString);Dn(Sn.inspectSource)||(Sn.inspectSource=function(e){return Tn(e)});var Rn,In,On,Cn=Sn.inspectSource,Pn=ke,Ln=Cn,Mn=W.WeakMap,Un=Pn(Mn)&&/native code/.test(Ln(Mn)),jn=dt.exports,Bn=xt,Nn=jn("keys"),Gn=function(e){return Nn[e]||(Nn[e]=Bn(e))},qn={},Fn=Un,Vn=W,Kn=de,Wn=De,zn=kn,Hn=_t,$n=pt,Qn=Gn,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);Rn=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)||{}},On=function(e){return tr(Zn,e)}}else{var rr=Qn("state");Yn[rr]=!0,Rn=function(e,t){if(Hn(e,rr))throw new Jn("Object already initialized");return t.facade=e,zn(e,rr,t),t},In=function(e){return Hn(e,rr)?e[rr]:{}},On=function(e){return Hn(e,rr)}}var ir={set:Rn,get:In,has:On,enforce:function(e){return On(e)?In(e):Rn(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=$,or=_t,sr=Function.prototype,dr=ar&&Object.getOwnPropertyDescriptor,cr=or(sr,"name"),ur={EXISTS:cr,PROPER:cr&&"something"===function(){}.name,CONFIGURABLE:cr&&(!ar||ar&&dr(sr,"name").configurable)},lr=W,hr=ke,pr=_t,fr=kn,mr=lt,vr=Cn,gr=ur.CONFIGURABLE,yr=ir.get,br=ir.enforce,_r=String(String).split("String");(xn.exports=function(e,t,n,r){var i,a=!!r&&!!r.unsafe,o=!!r&&!!r.enumerable,s=!!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=br(n)).source||(i.source=_r.join("string"==typeof d?d:""))),e!==lr?(a?!s&&e[t]&&(o=!0):delete e[t],o?e[t]=n:fr(e,t,n)):o?e[t]=n:mr(t,n)})(Function.prototype,"toString",(function(){return hr(this)&&yr(this).source||vr(this)}));var wr={},Ar=Math.ceil,Er=Math.floor,kr=function(e){var t=+e;return t!=t||0===t?0:(t>0?Er:Ar)(t)},xr=kr,Dr=Math.max,Sr=Math.min,Tr=function(e,t){var n=xr(e);return n<0?Dr(n+t,0):Sr(n,t)},Rr=kr,Ir=Math.min,Or=function(e){return e>0?Ir(Rr(e),9007199254740991):0},Cr=Or,Pr=function(e){return Cr(e.length)},Lr=Ee,Mr=Tr,Ur=Pr,jr=function(e){return function(t,n,r){var i,a=Lr(t),o=Ur(a),s=Mr(r,o);if(e&&n!=n){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((e||s in a)&&a[s]===n)return e||s||0;return!e&&-1}},Br={includes:jr(!0),indexOf:jr(!1)},Nr=_t,Gr=Ee,qr=Br.indexOf,Fr=qn,Vr=de([].push),Kr=function(e,t){var n,r=Gr(e),i=0,a=[];for(n in r)!Nr(Fr,n)&&Nr(r,n)&&Vr(a,n);for(;t.length>i;)Nr(r,n=t[i++])&&(~qr(a,n)||Vr(a,n));return a},Wr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],zr=Kr,Hr=Wr.concat("length","prototype");wr.f=Object.getOwnPropertyNames||function(e){return zr(e,Hr)};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=z,ii=un,ai=function(e,t){for(var n=ni(t),r=ii.f,i=ri.f,a=0;a<n.length;a++){var o=n[a];ti(e,o)||r(e,o,i(t,o))}},oi=H,si=ke,di=/#|\.prototype\./,ci=function(e,t){var n=li[ui(e)];return n==pi||n!=hi&&(si(t)?oi(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=z.f,gi=kn,yi=xn.exports,bi=lt,_i=ai,wi=fi,Ai=function(e,t){var n,r,i,a,o,s=e.target,d=e.global,c=e.stat;if(n=d?mi:c?mi[s]||bi(s,{}):(mi[s]||{}).prototype)for(r in t){if(a=t[r],i=e.noTargetGet?(o=vi(n,r))&&o.value:n[r],!wi(d?r:s+(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),yi(n,r,a,e)}},Ei=Kr,ki=Wr,xi=Object.keys||function(e){return Ei(e,ki)},Di=gt,Si=xi;Ai({target:"Object",stat:!0,forced:H((function(){Si(1)}))},{keys:function(e){return Si(Di(e))}});var Ti=tt,Ri=de(de.bind),Ii=function(e,t){return Ti(e),void 0===t?e:Ri?Ri(e,t):function(){return e.apply(t,arguments)}},Oi=he,Ci=Array.isArray||function(e){return"Array"==Oi(e)},Pi={};Pi[Ut("toStringTag")]="z";var Li="[object z]"===String(Pi),Mi=W,Ui=Li,ji=ke,Bi=he,Ni=Ut("toStringTag"),Gi=Mi.Object,qi="Arguments"==Bi(function(){return arguments}()),Fi=Ui?Bi: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=Gi(e),Ni))?n:qi?Bi(t):"Object"==(r=Bi(t))&&ji(t.callee)?"Arguments":r},Vi=de,Ki=H,Wi=ke,zi=Fi,Hi=Cn,$i=function(){},Qi=[],Yi=Ie("Reflect","construct"),Ji=/^\s*(?:class|function)\b/,Xi=Vi(Ji.exec),Zi=!Ji.exec($i),ea=function(e){if(!Wi(e))return!1;try{return Yi($i,Qi,e),!0}catch(e){return!1}},ta=!Yi||Ki((function(){var e;return ea(ea.call)||!ea(Object)||!ea((function(){e=!0}))||e}))?function(e){if(!Wi(e))return!1;switch(zi(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Zi||!!Xi(Ji,Hi(e))}:ea,na=W,ra=Ci,ia=ta,aa=De,oa=Ut("species"),sa=na.Array,da=function(e){var t;return ra(e)&&(t=e.constructor,(ia(t)&&(t===sa||ra(t.prototype))||aa(t)&&null===(t=t[oa]))&&(t=void 0)),void 0===t?sa:t},ca=function(e,t){return new(da(e))(0===t?0:t)},ua=Ii,la=ye,ha=gt,pa=Pr,fa=ca,ma=de([].push),va=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,a=6==e,o=7==e,s=5==e||a;return function(d,c,u,l){for(var h,p,f=ha(d),m=la(f),v=ua(c,u),g=pa(m),y=0,b=l||fa,_=t?b(d,g):n||o?b(d,0):void 0;g>y;y++)if((s||y in m)&&(p=v(h=m[y],y,f),e))if(t)_[y]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return y;case 2:ma(_,h)}else switch(e){case 4:return!1;case 7:ma(_,h)}return a?-1:r||i?i:_}},ga={forEach:va(0),map:va(1),filter:va(2),some:va(3),every:va(4),find:va(5),findIndex:va(6),filterReject:va(7)},ya=H,ba=Ne,_a=Ut("species"),wa=function(e){return ba>=51||!ya((function(){var t=[];return(t.constructor={})[_a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Aa=ga.filter;Ai({target:"Array",proto:!0,forced:!wa("filter")},{filter:function(e){return Aa(this,e,arguments.length>1?arguments[1]:void 0)}});var Ea=Ai,ka=H,xa=Ee,Da=z.f,Sa=$,Ta=ka((function(){Da(1)}));Ea({target:"Object",stat:!0,forced:!Sa||Ta,sham:!Sa},{getOwnPropertyDescriptor:function(e,t){return Da(xa(e),t)}});var Ra=Ht,Ia=un,Oa=re,Ca=function(e,t,n){var r=Ra(t);r in e?Ia.f(e,r,Oa(0,n)):e[r]=n},Pa=ei,La=Ee,Ma=z,Ua=Ca;Ai({target:"Object",stat:!0,sham:!$},{getOwnPropertyDescriptors:function(e){for(var t,n,r=La(e),i=Ma.f,a=Pa(r),o={},s=0;a.length>s;)void 0!==(n=i(r,t=a[s++]))&&Ua(o,t,n);return o}});var ja=Fi,Ba=Li?{}.toString:function(){return"[object "+ja(this)+"]"},Na=Li,Ga=xn.exports,qa=Ba;Na||Ga(Object.prototype,"toString",qa,{unsafe:!0});var Fa=W.Promise,Va=xn.exports,Ka=W,Wa=ke,za=Ka.String,Ha=Ka.TypeError,$a=de,Qa=mn,Ya=function(e){if("object"==typeof e||Wa(e))return e;throw Ha("Can't set "+za(e)+" as a prototype")},Ja=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=$a(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return Qa(n),Ya(r),t?e(n,r):n.__proto__=r,n}}():void 0),Xa=un.f,Za=_t,eo=Ut("toStringTag"),to=function(e,t,n){e&&!Za(e=n?e:e.prototype,eo)&&Xa(e,eo,{configurable:!0,value:t})},no=Ie,ro=un,io=$,ao=Ut("species"),oo=function(e){var t=no(e),n=ro.f;io&&t&&!t[ao]&&n(t,ao,{configurable:!0,get:function(){return this}})},so=Oe,co=W.TypeError,uo={},lo=uo,ho=Ut("iterator"),po=Array.prototype,fo=function(e){return void 0!==e&&(lo.Array===e||po[ho]===e)},mo=Fi,vo=rt,go=uo,yo=Ut("iterator"),bo=function(e){if(null!=e)return vo(e,yo)||vo(e,"@@iterator")||go[mo(e)]},_o=Y,wo=tt,Ao=mn,Eo=Je,ko=bo,xo=W.TypeError,Do=function(e,t){var n=arguments.length<2?ko(e):t;if(wo(n))return Ao(_o(n,e));throw xo(Eo(e)+" is not iterable")},So=Y,To=mn,Ro=rt,Io=function(e,t,n){var r,i;To(e);try{if(!(r=Ro(e,"return"))){if("throw"===t)throw n;return n}r=So(r,e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return To(r),n},Oo=Ii,Co=Y,Po=mn,Lo=Je,Mo=fo,Uo=Pr,jo=Oe,Bo=Do,No=bo,Go=Io,qo=W.TypeError,Fo=function(e,t){this.stopped=e,this.result=t},Vo=Fo.prototype,Ko=Ut("iterator"),Wo=!1;try{var zo=0,Ho={next:function(){return{done:!!zo++}},return:function(){Wo=!0}};Ho[Ko]=function(){return this},Array.from(Ho,(function(){throw 2}))}catch(e){}var $o,Qo,Yo,Jo,Xo=function(e,t){if(!t&&!Wo)return!1;var n=!1;try{var r={};r[Ko]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Zo=ta,es=Je,ts=W.TypeError,ns=mn,rs=function(e){if(Zo(e))return e;throw ts(es(e)+" is not a constructor")},is=Ut("species"),as=function(e,t){var n,r=ns(e).constructor;return void 0===r||null==(n=ns(r)[is])?t:rs(n)},os=Function.prototype,ss=os.apply,ds=os.bind,cs=os.call,us="object"==typeof Reflect&&Reflect.apply||(ds?cs.bind(ss):function(){return cs.apply(ss,arguments)}),ls=Ie("document","documentElement"),hs=de([].slice),ps=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ce),fs="process"==he(W.process),ms=W,vs=us,gs=Ii,ys=ke,bs=_t,_s=H,ws=ls,As=hs,Es=Jt,ks=ps,xs=fs,Ds=ms.setImmediate,Ss=ms.clearImmediate,Ts=ms.process,Rs=ms.Dispatch,Is=ms.Function,Os=ms.MessageChannel,Cs=ms.String,Ps=0,Ls={};try{$o=ms.location}catch(e){}var Ms=function(e){if(bs(Ls,e)){var t=Ls[e];delete Ls[e],t()}},Us=function(e){return function(){Ms(e)}},js=function(e){Ms(e.data)},Bs=function(e){ms.postMessage(Cs(e),$o.protocol+"//"+$o.host)};Ds&&Ss||(Ds=function(e){var t=As(arguments,1);return Ls[++Ps]=function(){vs(ys(e)?e:Is(e),void 0,t)},Qo(Ps),Ps},Ss=function(e){delete Ls[e]},xs?Qo=function(e){Ts.nextTick(Us(e))}:Rs&&Rs.now?Qo=function(e){Rs.now(Us(e))}:Os&&!ks?(Jo=(Yo=new Os).port2,Yo.port1.onmessage=js,Qo=gs(Jo.postMessage,Jo)):ms.addEventListener&&ys(ms.postMessage)&&!ms.importScripts&&$o&&"file:"!==$o.protocol&&!_s(Bs)?(Qo=Bs,ms.addEventListener("message",js,!1)):Qo="onreadystatechange"in Es("script")?function(e){ws.appendChild(Es("script")).onreadystatechange=function(){ws.removeChild(this),Ms(e)}}:function(e){setTimeout(Us(e),0)});var Ns,Gs,qs,Fs,Vs,Ks,Ws,zs,Hs={set:Ds,clear:Ss},$s=W,Qs=/ipad|iphone|ipod/i.test(Ce)&&void 0!==$s.Pebble,Ys=/web0s(?!.*chrome)/i.test(Ce),Js=W,Xs=Ii,Zs=z.f,ed=Hs.set,td=ps,nd=Qs,rd=Ys,id=fs,ad=Js.MutationObserver||Js.WebKitMutationObserver,od=Js.document,sd=Js.process,dd=Js.Promise,cd=Zs(Js,"queueMicrotask"),ud=cd&&cd.value;ud||(Ns=function(){var e,t;for(id&&(e=sd.domain)&&e.exit();Gs;){t=Gs.fn,Gs=Gs.next;try{t()}catch(e){throw Gs?Fs():qs=void 0,e}}qs=void 0,e&&e.enter()},td||id||rd||!ad||!od?!nd&&dd&&dd.resolve?((Ws=dd.resolve(void 0)).constructor=dd,zs=Xs(Ws.then,Ws),Fs=function(){zs(Ns)}):id?Fs=function(){sd.nextTick(Ns)}:(ed=Xs(ed,Js),Fs=function(){ed(Ns)}):(Vs=!0,Ks=od.createTextNode(""),new ad(Ns).observe(Ks,{characterData:!0}),Fs=function(){Ks.data=Vs=!Vs}));var ld=ud||function(e){var t={fn:e,next:void 0};qs&&(qs.next=t),Gs||(Gs=t,Fs()),qs=t},hd={},pd=tt,fd=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=pd(t),this.reject=pd(n)};hd.f=function(e){return new fd(e)};var md,vd,gd,yd,bd=mn,_d=De,wd=hd,Ad=function(e,t){if(bd(e),_d(t)&&t.constructor===e)return t;var n=wd.f(e);return(0,n.resolve)(t),n.promise},Ed=W,kd="object"==typeof window,xd=Ai,Dd=W,Sd=Ie,Td=Y,Rd=Fa,Id=xn.exports,Od=function(e,t,n){for(var r in t)Va(e,r,t[r],n);return e},Cd=Ja,Pd=to,Ld=oo,Md=tt,Ud=ke,jd=De,Bd=function(e,t){if(so(t,e))return e;throw co("Incorrect invocation")},Nd=Cn,Gd=function(e,t,n){var r,i,a,o,s,d,c,u=n&&n.that,l=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),f=Oo(t,u),m=function(e){return r&&Go(r,"normal",e),new Fo(!0,e)},v=function(e){return l?(Po(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=No(e)))throw qo(Lo(e)+" is not iterable");if(Mo(i)){for(a=0,o=Uo(e);o>a;a++)if((s=v(e[a]))&&jo(Vo,s))return s;return new Fo(!1)}r=Bo(e,i)}for(d=r.next;!(c=Co(d,r)).done;){try{s=v(c.value)}catch(e){Go(r,"throw",e)}if("object"==typeof s&&s&&jo(Vo,s))return s}return new Fo(!1)},qd=Xo,Fd=as,Vd=Hs.set,Kd=ld,Wd=Ad,zd=function(e,t){var n=Ed.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))},Hd=hd,$d=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Qd=ir,Yd=fi,Jd=kd,Xd=fs,Zd=Ne,ec=Ut("species"),tc=Qd.get,nc=Qd.set,rc=Qd.getterFor("Promise"),ic=Rd&&Rd.prototype,ac=Rd,oc=ic,sc=Dd.TypeError,dc=Dd.document,cc=Dd.process,uc=Hd.f,lc=uc,hc=!!(dc&&dc.createEvent&&Dd.dispatchEvent),pc=Ud(Dd.PromiseRejectionEvent),fc=!1,mc=Yd("Promise",(function(){var e=Nd(ac),t=e!==String(ac);if(!t&&66===Zd)return!0;if(Zd>=51&&/native code/.test(e))return!1;var n=new ac((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[ec]=r,!(fc=n.then((function(){}))instanceof r)||!t&&Jd&&!pc})),vc=mc||!qd((function(e){ac.all(e).catch((function(){}))})),gc=function(e){var t;return!(!jd(e)||!Ud(t=e.then))&&t},yc=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;Kd((function(){for(var r=e.value,i=1==e.state,a=0;n.length>a;){var o,s,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&&Ac(e),e.rejection=1),!0===u?o=r:(p&&p.enter(),o=u(r),p&&(p.exit(),d=!0)),o===c.promise?h(sc("Promise-chain cycle")):(s=gc(o))?Td(s,o,l,h):l(o)):h(r)}catch(e){p&&!d&&p.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&_c(e)}))}},bc=function(e,t,n){var r,i;hc?((r=dc.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Dd.dispatchEvent(r)):r={promise:t,reason:n},!pc&&(i=Dd["on"+e])?i(r):"unhandledrejection"===e&&zd("Unhandled promise rejection",n)},_c=function(e){Td(Vd,Dd,(function(){var t,n=e.facade,r=e.value;if(wc(e)&&(t=$d((function(){Xd?cc.emit("unhandledRejection",r,n):bc("unhandledrejection",n,r)})),e.rejection=Xd||wc(e)?2:1,t.error))throw t.value}))},wc=function(e){return 1!==e.rejection&&!e.parent},Ac=function(e){Td(Vd,Dd,(function(){var t=e.facade;Xd?cc.emit("rejectionHandled",t):bc("rejectionhandled",t,e.value)}))},Ec=function(e,t,n){return function(r){e(t,r,n)}},kc=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,yc(e,!0))},xc=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw sc("Promise can't be resolved itself");var r=gc(t);r?Kd((function(){var n={done:!1};try{Td(r,t,Ec(xc,n,e),Ec(kc,n,e))}catch(t){kc(n,t,e)}})):(e.value=t,e.state=1,yc(e,!1))}catch(t){kc({done:!1},t,e)}}};if(mc&&(oc=(ac=function(e){Bd(this,oc),Md(e),Td(md,this);var t=tc(this);try{e(Ec(xc,t),Ec(kc,t))}catch(e){kc(t,e)}}).prototype,(md=function(e){nc(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Od(oc,{then:function(e,t){var n=rc(this),r=n.reactions,i=uc(Fd(this,ac));return i.ok=!Ud(e)||e,i.fail=Ud(t)&&t,i.domain=Xd?cc.domain:void 0,n.parent=!0,r[r.length]=i,0!=n.state&&yc(n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),vd=function(){var e=new md,t=tc(e);this.promise=e,this.resolve=Ec(xc,t),this.reject=Ec(kc,t)},Hd.f=uc=function(e){return e===ac||e===gd?new vd(e):lc(e)},Ud(Rd)&&ic!==Object.prototype)){yd=ic.then,fc||(Id(ic,"then",(function(e,t){var n=this;return new ac((function(e,t){Td(yd,n,e,t)})).then(e,t)}),{unsafe:!0}),Id(ic,"catch",oc.catch,{unsafe:!0}));try{delete ic.constructor}catch(e){}Cd&&Cd(ic,oc)}xd({global:!0,wrap:!0,forced:mc},{Promise:ac}),Pd(ac,"Promise",!1),Ld("Promise"),gd=Sd("Promise"),xd({target:"Promise",stat:!0,forced:mc},{reject:function(e){var t=uc(this);return Td(t.reject,void 0,e),t.promise}}),xd({target:"Promise",stat:!0,forced:mc},{resolve:function(e){return Wd(this,e)}}),xd({target:"Promise",stat:!0,forced:vc},{all:function(e){var t=this,n=uc(t),r=n.resolve,i=n.reject,a=$d((function(){var n=Md(t.resolve),a=[],o=0,s=1;Gd(e,(function(e){var d=o++,c=!1;s++,Td(n,t,e).then((function(e){c||(c=!0,a[d]=e,--s||r(a))}),i)})),--s||r(a)}));return a.error&&i(a.value),n.promise},race:function(e){var t=this,n=uc(t),r=n.reject,i=$d((function(){var i=Md(t.resolve);Gd(e,(function(e){Td(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Dc=Ai,Sc=Fa,Tc=H,Rc=Ie,Ic=ke,Oc=as,Cc=Ad,Pc=xn.exports;if(Dc({target:"Promise",proto:!0,real:!0,forced:!!Sc&&Tc((function(){Sc.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=Oc(this,Rc("Promise")),n=Ic(e);return this.then(n?function(n){return Cc(t,e()).then((function(){return n}))}:e,n?function(n){return Cc(t,e()).then((function(){throw n}))}:e)}}),Ic(Sc)){var Lc=Rc("Promise").prototype.finally;Sc.prototype.finally!==Lc&&Pc(Sc.prototype,"finally",Lc,{unsafe:!0})}var Mc=Fi,Uc=W.String,jc=function(e){if("Symbol"===Mc(e))throw TypeError("Cannot convert a Symbol value to a string");return Uc(e)},Bc=mn,Nc=function(){var e=Bc(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},Gc={},qc=H,Fc=W.RegExp;Gc.UNSUPPORTED_Y=qc((function(){var e=Fc("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Gc.BROKEN_CARET=qc((function(){var e=Fc("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var Vc,Kc=un,Wc=mn,zc=Ee,Hc=xi,$c=$?Object.defineProperties:function(e,t){Wc(e);for(var n,r=zc(t),i=Hc(t),a=i.length,o=0;a>o;)Kc.f(e,n=i[o++],r[n]);return e},Qc=mn,Yc=$c,Jc=Wr,Xc=qn,Zc=ls,eu=Jt,tu=Gn("IE_PROTO"),nu=function(){},ru=function(e){return"<script>"+e+"<\/script>"},iu=function(e){e.write(ru("")),e.close();var t=e.parentWindow.Object;return e=null,t},au=function(){try{Vc=new ActiveXObject("htmlfile")}catch(e){}var e,t;au="undefined"!=typeof document?document.domain&&Vc?iu(Vc):((t=eu("iframe")).style.display="none",Zc.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(ru("document.F=Object")),e.close(),e.F):iu(Vc);for(var n=Jc.length;n--;)delete au.prototype[Jc[n]];return au()};Xc[tu]=!0;var ou=Object.create||function(e,t){var n;return null!==e?(nu.prototype=Qc(e),n=new nu,nu.prototype=null,n[tu]=e):n=au(),void 0===t?n:Yc(n,t)},su=H,du=W.RegExp,cu=su((function(){var e=du(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),uu=H,lu=W.RegExp,hu=uu((function(){var e=lu("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),pu=Y,fu=de,mu=jc,vu=Nc,gu=Gc,yu=dt.exports,bu=ou,_u=ir.get,wu=cu,Au=hu,Eu=yu("native-string-replace",String.prototype.replace),ku=RegExp.prototype.exec,xu=ku,Du=fu("".charAt),Su=fu("".indexOf),Tu=fu("".replace),Ru=fu("".slice),Iu=function(){var e=/a/,t=/b*/g;return pu(ku,e,"a"),pu(ku,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Ou=gu.UNSUPPORTED_Y||gu.BROKEN_CARET,Cu=void 0!==/()??/.exec("")[1];(Iu||Cu||Ou||wu||Au)&&(xu=function(e){var t,n,r,i,a,o,s,d=this,c=_u(d),u=mu(e),l=c.raw;if(l)return l.lastIndex=d.lastIndex,t=pu(xu,l,u),d.lastIndex=l.lastIndex,t;var h=c.groups,p=Ou&&d.sticky,f=pu(vu,d),m=d.source,v=0,g=u;if(p&&(f=Tu(f,"y",""),-1===Su(f,"g")&&(f+="g"),g=Ru(u,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==Du(u,d.lastIndex-1))&&(m="(?: "+m+")",g=" "+g,v++),n=new RegExp("^(?:"+m+")",f)),Cu&&(n=new RegExp("^"+m+"$(?!\\s)",f)),Iu&&(r=d.lastIndex),i=pu(ku,p?n:d,g),p?i?(i.input=Ru(i.input,v),i[0]=Ru(i[0],v),i.index=d.lastIndex,d.lastIndex+=i[0].length):d.lastIndex=0:Iu&&i&&(d.lastIndex=d.global?i.index+i[0].length:r),Cu&&i&&i.length>1&&pu(Eu,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=o=bu(null),a=0;a<h.length;a++)o[(s=h[a])[0]]=i[s[1]];return i});var Pu=xu;Ai({target:"RegExp",proto:!0,forced:/./.exec!==Pu},{exec:Pu});var Lu=de,Mu=xn.exports,Uu=Pu,ju=H,Bu=Ut,Nu=kn,Gu=Bu("species"),qu=RegExp.prototype,Fu=function(e,t,n,r){var i=Bu(e),a=!ju((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),o=a&&!ju((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Gu]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!a||!o||n){var s=Lu(/./[i]),d=t(i,""[e],(function(e,t,n,r,i){var o=Lu(e),d=t.exec;return d===Uu||d===qu.exec?a&&!i?{done:!0,value:s(t,n,r)}:{done:!0,value:o(n,t,r)}:{done:!1}}));Mu(String.prototype,e,d[0]),Mu(qu,i,d[1])}r&&Nu(qu[i],"sham",!0)},Vu=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},Ku=Y,Wu=mn,zu=ke,Hu=he,$u=Pu,Qu=W.TypeError,Yu=function(e,t){var n=e.exec;if(zu(n)){var r=Ku(n,e,t);return null!==r&&Wu(r),r}if("RegExp"===Hu(e))return Ku($u,e,t);throw Qu("RegExp#exec called on incompatible receiver")},Ju=Y,Xu=mn,Zu=_e,el=Vu,tl=jc,nl=rt,rl=Yu;Fu("search",(function(e,t,n){return[function(t){var n=Zu(this),r=null==t?void 0:nl(t,e);return r?Ju(r,t,n):new RegExp(t)[e](tl(n))},function(e){var r=Xu(this),i=tl(e),a=n(t,r,i);if(a.done)return a.value;var o=r.lastIndex;el(o,0)||(r.lastIndex=0);var s=rl(r,i);return el(r.lastIndex,o)||(r.lastIndex=o),null===s?-1:s.index}]}));var il=_e,al=jc,ol=de("".replace),sl="[\t\n\v\f\r                 \u2028\u2029\ufeff]",dl=RegExp("^"+sl+sl+"*"),cl=RegExp(sl+sl+"*$"),ul=function(e){return function(t){var n=al(il(t));return 1&e&&(n=ol(n,dl,"")),2&e&&(n=ol(n,cl,"")),n}},ll={start:ul(1),end:ul(2),trim:ul(3)},hl=ur.PROPER,pl=H,fl="\t\n\v\f\r                 \u2028\u2029\ufeff",ml=ll.trim;Ai({target:"String",proto:!0,forced:function(e){return pl((function(){return!!fl[e]()||"​…᠎"!=="​…᠎"[e]()||hl&&fl[e].name!==e}))}("trim")},{trim:function(){return ml(this)}});var vl={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},gl=Jt("span").classList,yl=gl&&gl.constructor&&gl.constructor.prototype,bl=yl===Object.prototype?void 0:yl,_l=H,wl=ga.forEach,Al=function(e,t){var n=[][e];return!!n&&_l((function(){n.call(null,t||function(){throw 1},1)}))},El=W,kl=vl,xl=bl,Dl=Al("forEach")?[].forEach:function(e){return wl(this,e,arguments.length>1?arguments[1]:void 0)},Sl=kn,Tl=function(e){if(e&&e.forEach!==Dl)try{Sl(e,"forEach",Dl)}catch(t){e.forEach=Dl}};for(var Rl in kl)kl[Rl]&&Tl(El[Rl]&&El[Rl].prototype);Tl(xl);var Il=ke,Ol=De,Cl=Ja,Pl=De,Ll=he,Ml=Ut("match"),Ul=function(e){var t;return Pl(e)&&(void 0!==(t=e[Ml])?!!t:"RegExp"==Ll(e))},jl=$,Bl=W,Nl=de,Gl=fi,ql=function(e,t,n){var r,i;return Cl&&Il(r=t.constructor)&&r!==n&&Ol(i=r.prototype)&&i!==n.prototype&&Cl(e,i),e},Fl=kn,Vl=un.f,Kl=wr.f,Wl=Oe,zl=Ul,Hl=jc,$l=Nc,Ql=Gc,Yl=xn.exports,Jl=H,Xl=_t,Zl=ir.enforce,eh=oo,th=cu,nh=hu,rh=Ut("match"),ih=Bl.RegExp,ah=ih.prototype,oh=Bl.SyntaxError,sh=Nl($l),dh=Nl(ah.exec),ch=Nl("".charAt),uh=Nl("".replace),lh=Nl("".indexOf),hh=Nl("".slice),ph=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,fh=/a/g,mh=/a/g,vh=new ih(fh)!==fh,gh=Ql.UNSUPPORTED_Y,yh=jl&&(!vh||gh||th||nh||Jl((function(){return mh[rh]=!1,ih(fh)!=fh||ih(mh)==mh||"/a/i"!=ih(fh,"i")})));if(Gl("RegExp",yh)){for(var bh=function(e,t){var n,r,i,a,o,s,d=Wl(ah,this),c=zl(e),u=void 0===t,l=[],h=e;if(!d&&c&&u&&e.constructor===bh)return e;if((c||Wl(ah,e))&&(e=e.source,u&&(t="flags"in h?h.flags:sh(h))),e=void 0===e?"":Hl(e),t=void 0===t?"":Hl(t),h=e,th&&"dotAll"in fh&&(r=!!t&&lh(t,"s")>-1)&&(t=uh(t,/s/g,"")),n=t,gh&&"sticky"in fh&&(i=!!t&&lh(t,"y")>-1)&&(t=uh(t,/y/g,"")),nh&&(a=function(e){for(var t,n=e.length,r=0,i="",a=[],o={},s=!1,d=!1,c=0,u="";r<=n;r++){if("\\"===(t=ch(e,r)))t+=ch(e,++r);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:dh(ph,hh(e,r+1))&&(r+=2,d=!0),i+=t,c++;continue;case">"===t&&d:if(""===u||Xl(o,u))throw new oh("Invalid capture group name");o[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]),o=ql(ih(e,t),d?this:ah,bh),(r||i||l.length)&&(s=Zl(o),r&&(s.dotAll=!0,s.raw=bh(function(e){for(var t,n=e.length,r=0,i="",a=!1;r<=n;r++)"\\"!==(t=ch(e,r))?a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),i+=t):i+="[\\s\\S]":i+=t+ch(e,++r);return i}(e),n)),i&&(s.sticky=!0),l.length&&(s.groups=l)),e!==h)try{Fl(o,"source",""===h?"(?:)":h)}catch(e){}return o},_h=function(e){e in bh||Vl(bh,e,{configurable:!0,get:function(){return ih[e]},set:function(t){ih[e]=t}})},wh=Kl(ih),Ah=0;wh.length>Ah;)_h(wh[Ah++]);ah.constructor=bh,bh.prototype=ah,Yl(Bl,"RegExp",bh)}eh("RegExp");var Eh=de,kh=ur.PROPER,xh=xn.exports,Dh=mn,Sh=Oe,Th=jc,Rh=H,Ih=Nc,Oh=RegExp.prototype,Ch=Oh.toString,Ph=Eh(Ih),Lh=Rh((function(){return"/a/b"!=Ch.call({source:"a",flags:"b"})})),Mh=kh&&"toString"!=Ch.name;(Lh||Mh)&&xh(RegExp.prototype,"toString",(function(){var e=Dh(this),t=Th(e.source),n=e.flags;return"/"+t+"/"+Th(void 0===n&&Sh(Oh,e)&&!("flags"in Oh)?Ph(e):n)}),{unsafe:!0});var Uh=Ai,jh=W,Bh=H,Nh=Ci,Gh=De,qh=gt,Fh=Pr,Vh=Ca,Kh=ca,Wh=wa,zh=Ne,Hh=Ut("isConcatSpreadable"),$h=jh.TypeError,Qh=zh>=51||!Bh((function(){var e=[];return e[Hh]=!1,e.concat()[0]!==e})),Yh=Wh("concat"),Jh=function(e){if(!Gh(e))return!1;var t=e[Hh];return void 0!==t?!!t:Nh(e)};Uh({target:"Array",proto:!0,forced:!Qh||!Yh},{concat:function(e){var t,n,r,i,a,o=qh(this),s=Kh(o,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(Jh(a=-1===t?o:arguments[t])){if(d+(i=Fh(a))>9007199254740991)throw $h("Maximum allowed index exceeded");for(n=0;n<i;n++,d++)n in a&&Vh(s,d,a[n])}else{if(d>=9007199254740991)throw $h("Maximum allowed index exceeded");Vh(s,d++,a)}return s.length=d,s}});var Xh,Zh=Ul,ep=W.TypeError,tp=function(e){if(Zh(e))throw ep("The method doesn't accept regular expressions");return e},np=Ut("match"),rp=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[np]=!1,"/./"[e](t)}catch(e){}}return!1},ip=Ai,ap=de,op=z.f,sp=Or,dp=jc,cp=tp,up=_e,lp=rp,hp=ap("".startsWith),pp=ap("".slice),fp=Math.min,mp=lp("startsWith");ip({target:"String",proto:!0,forced:!!(mp||(Xh=op(String.prototype,"startsWith"),!Xh||Xh.writable))&&!mp},{startsWith:function(e){var t=dp(up(this));cp(e);var n=sp(fp(arguments.length>1?arguments[1]:void 0,t.length)),r=dp(e);return hp?hp(t,r,n):pp(t,n,n+r.length)===r}});var vp=de,gp=kr,yp=jc,bp=_e,_p=vp("".charAt),wp=vp("".charCodeAt),Ap=vp("".slice),Ep=function(e){return function(t,n){var r,i,a=yp(bp(t)),o=gp(n),s=a.length;return o<0||o>=s?e?"":void 0:(r=wp(a,o))<55296||r>56319||o+1===s||(i=wp(a,o+1))<56320||i>57343?e?_p(a,o):r:e?Ap(a,o,o+2):i-56320+(r-55296<<10)+65536}},kp={codeAt:Ep(!1),charAt:Ep(!0)},xp=kp.charAt,Dp=function(e,t,n){return t+(n?xp(e,t).length:1)},Sp=de,Tp=gt,Rp=Math.floor,Ip=Sp("".charAt),Op=Sp("".replace),Cp=Sp("".slice),Pp=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Lp=/\$([$&'`]|\d{1,2})/g,Mp=us,Up=Y,jp=de,Bp=Fu,Np=H,Gp=mn,qp=ke,Fp=kr,Vp=Or,Kp=jc,Wp=_e,zp=Dp,Hp=rt,$p=function(e,t,n,r,i,a){var o=n+e.length,s=r.length,d=Lp;return void 0!==i&&(i=Tp(i),d=Pp),Op(a,d,(function(a,d){var c;switch(Ip(d,0)){case"$":return"$";case"&":return e;case"`":return Cp(t,0,n);case"'":return Cp(t,o);case"<":c=i[Cp(d,1,-1)];break;default:var u=+d;if(0===u)return a;if(u>s){var l=Rp(u/10);return 0===l?a:l<=s?void 0===r[l-1]?Ip(d,1):r[l-1]+Ip(d,1):a}c=r[u-1]}return void 0===c?"":c}))},Qp=Yu,Yp=Ut("replace"),Jp=Math.max,Xp=Math.min,Zp=jp([].concat),ef=jp([].push),tf=jp("".indexOf),nf=jp("".slice),rf="$0"==="a".replace(/./,"$0"),af=!!/./[Yp]&&""===/./[Yp]("a","$0");Bp("replace",(function(e,t,n){var r=af?"$":"$0";return[function(e,n){var r=Wp(this),i=null==e?void 0:Hp(e,Yp);return i?Up(i,e,r,n):Up(t,Kp(r),e,n)},function(e,i){var a=Gp(this),o=Kp(e);if("string"==typeof i&&-1===tf(i,r)&&-1===tf(i,"$<")){var s=n(t,a,o,i);if(s.done)return s.value}var d=qp(i);d||(i=Kp(i));var c=a.global;if(c){var u=a.unicode;a.lastIndex=0}for(var l=[];;){var h=Qp(a,o);if(null===h)break;if(ef(l,h),!c)break;""===Kp(h[0])&&(a.lastIndex=zp(o,Vp(a.lastIndex),u))}for(var p,f="",m=0,v=0;v<l.length;v++){for(var g=Kp((h=l[v])[0]),y=Jp(Xp(Fp(h.index),o.length),0),b=[],_=1;_<h.length;_++)ef(b,void 0===(p=h[_])?p:String(p));var w=h.groups;if(d){var A=Zp([g],b,y,o);void 0!==w&&ef(A,w);var E=Kp(Mp(i,void 0,A))}else E=$p(g,o,y,b,w,i);y>=m&&(f+=nf(o,m,y)+E,m=y+g.length)}return f+nf(o,m)}]}),!!Np((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!rf||af);var of=$,sf=ur.EXISTS,df=de,cf=un.f,uf=Function.prototype,lf=df(uf.toString),hf=/^\s*function ([^ (]*)/,pf=df(hf.exec);of&&!sf&&cf(uf,"name",{configurable:!0,get:function(){try{return pf(hf,lf(this))[1]}catch(e){return""}}});var ff={},mf=he,vf=Ee,gf=wr.f,yf=hs,bf="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];ff.f=function(e){return bf&&"Window"==mf(e)?function(e){try{return gf(e)}catch(e){return yf(bf)}}(e):gf(vf(e))};var _f={},wf=Ut;_f.f=wf;var Af=W,Ef=_t,kf=_f,xf=un.f,Df=function(e){var t=Af.Symbol||(Af.Symbol={});Ef(t,e)||xf(t,e,{value:kf.f(e)})},Sf=Ai,Tf=W,Rf=Ie,If=us,Of=Y,Cf=de,Pf=$,Lf=Fe,Mf=H,Uf=_t,jf=Ci,Bf=ke,Nf=De,Gf=Oe,qf=Qe,Ff=mn,Vf=gt,Kf=Ee,Wf=Ht,zf=jc,Hf=re,$f=ou,Qf=xi,Yf=wr,Jf=ff,Xf=$r,Zf=z,em=un,tm=J,nm=hs,rm=xn.exports,im=dt.exports,am=qn,om=xt,sm=Ut,dm=_f,cm=Df,um=to,lm=ir,hm=ga.forEach,pm=Gn("hidden"),fm=sm("toPrimitive"),mm=lm.set,vm=lm.getterFor("Symbol"),gm=Object.prototype,ym=Tf.Symbol,bm=ym&&ym.prototype,_m=Tf.TypeError,wm=Tf.QObject,Am=Rf("JSON","stringify"),Em=Zf.f,km=em.f,xm=Jf.f,Dm=tm.f,Sm=Cf([].push),Tm=im("symbols"),Rm=im("op-symbols"),Im=im("string-to-symbol-registry"),Om=im("symbol-to-string-registry"),Cm=im("wks"),Pm=!wm||!wm.prototype||!wm.prototype.findChild,Lm=Pf&&Mf((function(){return 7!=$f(km({},"a",{get:function(){return km(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Em(gm,t);r&&delete gm[t],km(e,t,n),r&&e!==gm&&km(gm,t,r)}:km,Mm=function(e,t){var n=Tm[e]=$f(bm);return mm(n,{type:"Symbol",tag:e,description:t}),Pf||(n.description=t),n},Um=function(e,t,n){e===gm&&Um(Rm,t,n),Ff(e);var r=Wf(t);return Ff(n),Uf(Tm,r)?(n.enumerable?(Uf(e,pm)&&e[pm][r]&&(e[pm][r]=!1),n=$f(n,{enumerable:Hf(0,!1)})):(Uf(e,pm)||km(e,pm,Hf(1,{})),e[pm][r]=!0),Lm(e,r,n)):km(e,r,n)},jm=function(e,t){Ff(e);var n=Kf(t),r=Qf(n).concat(qm(n));return hm(r,(function(t){Pf&&!Of(Bm,n,t)||Um(e,t,n[t])})),e},Bm=function(e){var t=Wf(e),n=Of(Dm,this,t);return!(this===gm&&Uf(Tm,t)&&!Uf(Rm,t))&&(!(n||!Uf(this,t)||!Uf(Tm,t)||Uf(this,pm)&&this[pm][t])||n)},Nm=function(e,t){var n=Kf(e),r=Wf(t);if(n!==gm||!Uf(Tm,r)||Uf(Rm,r)){var i=Em(n,r);return!i||!Uf(Tm,r)||Uf(n,pm)&&n[pm][r]||(i.enumerable=!0),i}},Gm=function(e){var t=xm(Kf(e)),n=[];return hm(t,(function(e){Uf(Tm,e)||Uf(am,e)||Sm(n,e)})),n},qm=function(e){var t=e===gm,n=xm(t?Rm:Kf(e)),r=[];return hm(n,(function(e){!Uf(Tm,e)||t&&!Uf(gm,e)||Sm(r,Tm[e])})),r};(Lf||(rm(bm=(ym=function(){if(Gf(bm,this))throw _m("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?zf(arguments[0]):void 0,t=om(e),n=function(e){this===gm&&Of(n,Rm,e),Uf(this,pm)&&Uf(this[pm],t)&&(this[pm][t]=!1),Lm(this,t,Hf(1,e))};return Pf&&Pm&&Lm(gm,t,{configurable:!0,set:n}),Mm(t,e)}).prototype,"toString",(function(){return vm(this).tag})),rm(ym,"withoutSetter",(function(e){return Mm(om(e),e)})),tm.f=Bm,em.f=Um,Zf.f=Nm,Yf.f=Jf.f=Gm,Xf.f=qm,dm.f=function(e){return Mm(sm(e),e)},Pf&&(km(bm,"description",{configurable:!0,get:function(){return vm(this).description}}),rm(gm,"propertyIsEnumerable",Bm,{unsafe:!0}))),Sf({global:!0,wrap:!0,forced:!Lf,sham:!Lf},{Symbol:ym}),hm(Qf(Cm),(function(e){cm(e)})),Sf({target:"Symbol",stat:!0,forced:!Lf},{for:function(e){var t=zf(e);if(Uf(Im,t))return Im[t];var n=ym(t);return Im[t]=n,Om[n]=t,n},keyFor:function(e){if(!qf(e))throw _m(e+" is not a symbol");if(Uf(Om,e))return Om[e]},useSetter:function(){Pm=!0},useSimple:function(){Pm=!1}}),Sf({target:"Object",stat:!0,forced:!Lf,sham:!Pf},{create:function(e,t){return void 0===t?$f(e):jm($f(e),t)},defineProperty:Um,defineProperties:jm,getOwnPropertyDescriptor:Nm}),Sf({target:"Object",stat:!0,forced:!Lf},{getOwnPropertyNames:Gm,getOwnPropertySymbols:qm}),Sf({target:"Object",stat:!0,forced:Mf((function(){Xf.f(1)}))},{getOwnPropertySymbols:function(e){return Xf.f(Vf(e))}}),Am)&&Sf({target:"JSON",stat:!0,forced:!Lf||Mf((function(){var e=ym();return"[null]"!=Am([e])||"{}"!=Am({a:e})||"{}"!=Am(Object(e))}))},{stringify:function(e,t,n){var r=nm(arguments),i=t;if((Nf(t)||void 0!==e)&&!qf(e))return jf(t)||(t=function(e,t){if(Bf(i)&&(t=Of(i,this,e,t)),!qf(t))return t}),r[1]=t,If(Am,null,r)}});if(!bm[fm]){var Fm=bm.valueOf;rm(bm,fm,(function(e){return Of(Fm,this)}))}um(ym,"Symbol"),am[pm]=!0;var Vm=Ai,Km=$,Wm=W,zm=de,Hm=_t,$m=ke,Qm=Oe,Ym=jc,Jm=un.f,Xm=ai,Zm=Wm.Symbol,ev=Zm&&Zm.prototype;if(Km&&$m(Zm)&&(!("description"in ev)||void 0!==Zm().description)){var tv={},nv=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:Ym(arguments[0]),t=Qm(ev,this)?new Zm(e):void 0===e?Zm():Zm(e);return""===e&&(tv[t]=!0),t};Xm(nv,Zm),nv.prototype=ev,ev.constructor=nv;var rv="Symbol(test)"==String(Zm("test")),iv=zm(ev.toString),av=zm(ev.valueOf),ov=/^Symbol\((.*)\)[^)]+$/,sv=zm("".replace),dv=zm("".slice);Jm(ev,"description",{configurable:!0,get:function(){var e=av(this),t=iv(e);if(Hm(tv,e))return"";var n=rv?dv(t,7,-1):sv(t,ov,"$1");return""===n?void 0:n}}),Vm({global:!0,forced:!0},{Symbol:nv})}var cv=ou,uv=un,lv=Ut("unscopables"),hv=Array.prototype;null==hv[lv]&&uv.f(hv,lv,{configurable:!0,value:cv(null)});var pv=function(e){hv[lv][e]=!0},fv=Br.includes,mv=pv;Ai({target:"Array",proto:!0},{includes:function(e){return fv(this,e,arguments.length>1?arguments[1]:void 0)}}),mv("includes");var vv=Ai,gv=tp,yv=_e,bv=jc,_v=rp,wv=de("".indexOf);vv({target:"String",proto:!0,forced:!_v("includes")},{includes:function(e){return!!~wv(bv(yv(this)),bv(gv(e)),arguments.length>1?arguments[1]:void 0)}});var Av=Ai,Ev=ga.find,kv=pv,xv=!0;"find"in[]&&Array(1).find((function(){xv=!1})),Av({target:"Array",proto:!0,forced:xv},{find:function(e){return Ev(this,e,arguments.length>1?arguments[1]:void 0)}}),kv("find");var Dv="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==Dv&&Dv,Sv="URLSearchParams"in Dv,Tv="Symbol"in Dv&&"iterator"in Symbol,Rv="FileReader"in Dv&&"Blob"in Dv&&function(){try{return new Blob,!0}catch(e){return!1}}(),Iv="FormData"in Dv,Ov="ArrayBuffer"in Dv;if(Ov)var Cv=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Pv=ArrayBuffer.isView||function(e){return e&&Cv.indexOf(Object.prototype.toString.call(e))>-1};function Lv(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 Mv(e){return"string"!=typeof e&&(e=String(e)),e}function Uv(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return Tv&&(t[Symbol.iterator]=function(){return t}),t}function jv(e){this.map={},e instanceof jv?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 Bv(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Nv(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function Gv(e){var t=new FileReader,n=Nv(t);return t.readAsArrayBuffer(e),n}function qv(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Fv(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:Rv&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Iv&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Sv&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Ov&&Rv&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=qv(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Ov&&(ArrayBuffer.prototype.isPrototypeOf(e)||Pv(e))?this._bodyArrayBuffer=qv(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):Sv&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Rv&&(this.blob=function(){var e=Bv(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=Bv(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(Gv)}),this.text=function(){var e=Bv(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=Nv(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)},Iv&&(this.formData=function(){return this.text().then(Wv)}),this.json=function(){return this.text().then(JSON.parse)},this}jv.prototype.append=function(e,t){e=Lv(e),t=Mv(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},jv.prototype.delete=function(e){delete this.map[Lv(e)]},jv.prototype.get=function(e){return e=Lv(e),this.has(e)?this.map[e]:null},jv.prototype.has=function(e){return this.map.hasOwnProperty(Lv(e))},jv.prototype.set=function(e,t){this.map[Lv(e)]=Mv(t)},jv.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},jv.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),Uv(e)},jv.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Uv(e)},jv.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),Uv(e)},Tv&&(jv.prototype[Symbol.iterator]=jv.prototype.entries);var Vv=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Kv(e,t){if(!(this instanceof Kv))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 Kv){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new jv(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 jv(t.headers)),this.method=function(e){var t=e.toUpperCase();return Vv.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 Wv(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 zv(e,t){if(!(this instanceof zv))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 jv(t.headers),this.url=t.url||"",this._initBody(e)}Kv.prototype.clone=function(){return new Kv(this,{body:this._bodyInit})},Fv.call(Kv.prototype),Fv.call(zv.prototype),zv.prototype.clone=function(){return new zv(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new jv(this.headers),url:this.url})},zv.error=function(){var e=new zv(null,{status:0,statusText:""});return e.type="error",e};var Hv=[301,302,303,307,308];zv.redirect=function(e,t){if(-1===Hv.indexOf(t))throw new RangeError("Invalid status code");return new zv(null,{status:t,headers:{location:e}})};var $v=Dv.DOMException;try{new $v}catch(e){$v=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},$v.prototype=Object.create(Error.prototype),$v.prototype.constructor=$v}function Qv(e,t){return new Promise((function(n,r){var i=new Kv(e,t);if(i.signal&&i.signal.aborted)return r(new $v("Aborted","AbortError"));var a=new XMLHttpRequest;function o(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new jv,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 zv(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 $v("Aborted","AbortError"))}),0)},a.open(i.method,function(e){try{return""===e&&Dv.location.href?Dv.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&&(Rv?a.responseType="blob":Ov&&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 jv?i.headers.forEach((function(e,t){a.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){a.setRequestHeader(e,Mv(t.headers[e]))})),i.signal&&(i.signal.addEventListener("abort",o),a.onreadystatechange=function(){4===a.readyState&&i.signal.removeEventListener("abort",o)}),a.send(void 0===i._bodyInit?null:i._bodyInit)}))}Qv.polyfill=!0,Dv.fetch||(Dv.fetch=Qv,Dv.Headers=jv,Dv.Request=Kv,Dv.Response=zv);var Yv={name:"@bygd/gd-sdk-pes",version:"1.24.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.3","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",validator:"^13.6.0"}},Jv=Y,Xv=mn,Zv=Or,eg=jc,tg=_e,ng=rt,rg=Dp,ig=Yu;Fu("match",(function(e,t,n){return[function(t){var n=tg(this),r=null==t?void 0:ng(t,e);return r?Jv(r,t,n):new RegExp(t)[e](eg(n))},function(e){var r=Xv(this),i=eg(e),a=n(t,r,i);if(a.done)return a.value;if(!r.global)return ig(r,i);var o=r.unicode;r.lastIndex=0;for(var s,d=[],c=0;null!==(s=ig(r,i));){var u=eg(s[0]);d[c]=u,""===u&&(r.lastIndex=rg(i,Zv(r.lastIndex),o)),c++}return 0===c?null:d}]}));var ag=us,og=Y,sg=de,dg=Fu,cg=Ul,ug=mn,lg=_e,hg=as,pg=Dp,fg=Or,mg=jc,vg=rt,gg=hs,yg=Yu,bg=Pu,_g=H,wg=Gc.UNSUPPORTED_Y,Ag=Math.min,Eg=[].push,kg=sg(/./.exec),xg=sg(Eg),Dg=sg("".slice);dg("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=mg(lg(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!cg(e))return og(t,r,e,i);for(var a,o,s,d=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,l=new RegExp(e.source,c+"g");(a=og(bg,l,r))&&!((o=l.lastIndex)>u&&(xg(d,Dg(r,u,a.index)),a.length>1&&a.index<r.length&&ag(Eg,d,gg(a,1)),s=a[0].length,u=o,d.length>=i));)l.lastIndex===a.index&&l.lastIndex++;return u===r.length?!s&&kg(l,"")||xg(d,""):xg(d,Dg(r,u)),d.length>i?gg(d,0,i):d}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:og(t,this,e,n)}:t,[function(t,n){var i=lg(this),a=null==t?void 0:vg(t,e);return a?og(a,t,i,n):og(r,mg(i),t,n)},function(e,i){var a=ug(this),o=mg(e),s=n(r,a,o,i,r!==t);if(s.done)return s.value;var d=hg(a,RegExp),c=a.unicode,u=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(wg?"g":"y"),l=new d(wg?"^(?:"+a.source+")":a,u),h=void 0===i?4294967295:i>>>0;if(0===h)return[];if(0===o.length)return null===yg(l,o)?[o]:[];for(var p=0,f=0,m=[];f<o.length;){l.lastIndex=wg?0:f;var v,g=yg(l,wg?Dg(o,f):o);if(null===g||(v=Ag(fg(l.lastIndex+(wg?f:0)),o.length))===p)f=pg(o,f,c);else{if(xg(m,Dg(o,p,f)),m.length===h)return m;for(var y=1;y<=g.length-1;y++)if(xg(m,g[y]),m.length===h)return m;f=p=v}}return xg(m,Dg(o,p)),m}]}),!!_g((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]})),wg);var Sg=function(){function t(e){i(this,t),this.gameData=e,this.customParamKeys=["vid","_1ld","_1lp"]}return a(t,[{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 t=this;try{var n={},r=this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled,i=new C(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 e(this,t),this.customParamKeys.some(function(t){return e(this,r),t===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)}}}]),t}(),Tg=function(){function t(e,n){i(this,t),this.adContainer=e,this.onResume=n}return a(t,[{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 t=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(){e(this,t),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)}}}]),t}(),Rg=function(e){if(!e)return!1;var t=Ig.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)},Ig=Object.prototype.toString;function Og(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Og(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Og(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Pg(e){return null!=e&&e.error_url?"<vmap:VASTAdData>".concat(function(e){return e.promo_url?'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),"</vmap:VASTAdData>").trim():'<vmap:AdTagURI templateType="vast3"><![CDATA['.concat(null==e?void 0:e.adtag_url,"]]></vmap:AdTagURI>").trim()}var Lg=["bidFloor","isDfpBidding"];function Mg(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 Ug(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mg(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mg(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var jg=null,Bg=function(){function t(n,r,a){var o=this;if(i(this,t),jg)return jg;jg=this;var s={debug:!1,width:640,height:360,locale:"en"};this.options=r?m(s,r):s,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new v,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=a.parentDomain,this.topDomain=a.topDomain,this.parentURL=a.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=g(),this.atom_display,this.adType_="",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=""!==n?document.getElementById(n):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.gameId="0",this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){e(this,o),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){e(this,o),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var y,b,_,w,A,E,k,x,D,S,T,R,I,O,N,G,q,F,V;return a(t,[{key:"start",value:(V=r(o.mark((function e(){return o.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 V.apply(this,arguments)})},{key:"_getAdVast",value:function(t,i){var a=this;return new Promise(function(){var s=r(o.mark((function r(s){var c,u,l,h,p,f,m,v,g,y,b=this;return o.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(d.available&&d.getBoolean("gd_debug_ex")&&d.getBoolean("gd_tag"))){r.next=6;break}return c=a.IMASampleTags[t],u=Math.floor(Math.random()*c.length),l=c[u],s({url:l}),r.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){r.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return r.prev=8,r.next=11,a._getTunnlKeys(t);case 11:if(h=r.sent,p=h.data,f=p.nsid?p.nsid:"TNL_T-17102571517",m=p.tid?p.tid:"TNL_NS-18101700058",v="".concat(f,"/").concat(m),delete p.nsid,delete p.tid,j(p,{tnl_system:"1",tnl_content_category:a.category.toLowerCase()}),a.eventBus.broadcast("AD_REQUEST",{message:p.tnl_ad_pos}),g=a.options,"preroll"===p.tnl_ad_pos&&L(g.preroll)?g=g.preroll:"midroll"===p.tnl_ad_pos&&L(g.midroll)?g=g.midroll:"rewarded"===p.tnl_ad_pos&&L(g.rewarded)&&(g=g.rewarded),!(i&&i.retry_on_success&&L(g.retry_on_success)&&L(g.retry_on_success.vast))){r.next=26;break}return r.abrupt("return",s(a._createCustomAdVastUrl(g.retry_on_success.vast,{tnl_keys:p})));case 26:if(!(i&&i.retry_on_failure&&a.options.retry_on_failure&&L(g.retry_on_failure.vast))){r.next=30;break}return r.abrupt("return",s(a._createCustomAdVastUrl(g.retry_on_failure.vast,{tnl_keys:p})));case 30:if(!L(g.vast)){r.next=32;break}return r.abrupt("return",s(a._createCustomAdVastUrl(g.vast,{tnl_keys:p})));case 32:return r.next=34,a._create_dp_context(p.tnl_ad_pos,i);case 34:y=r.sent,window.idhb.que.push(function(){var t=this;e(this,b),window.idhb.setRefererUrl(encodeURIComponent(a.parentURL)),window.idhb.allowPersonalizedAds(!!parseInt(a.userAllowedPersonalizedAds));var r="rewarded"===p.tnl_ad_pos?"rewardedVideo":"gdbanner"===p.tnl_ad_pos?"gd__banner":"midroll"===p.tnl_ad_pos?"midroll":"video1";window.idhb.setDfpAdUnitCodeForAdSlot(r,v),window.idhb.setAdserverTargetingForAdSlot(r,p),window.idhb.requestAds({slots:n({},r,{bidFloor:null!=y&&y.floor_price?y.floor_price:void 0}),callback:function(n,r){var i=this;e(this,t),y&&!r.bidFloorApplied&&fetch(y.skip_url).catch(function(t){e(this,i)}.bind(this)),s({tnl_keys:p,url:n,dp:y,hl:r})}.bind(this)})}.bind(this)),r.next=41;break;case 38:throw r.prev=38,r.t0=r.catch(8),new Error(r.t0);case 41:case"end":return r.stop()}}),r,this,[[8,38]])})));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:"_getTunnlKeys",value:function(t){var n=this;return new Promise(function(r){var i,a,o=this;e(this,n);var s="";!navigator.userAgent.match(/Crosswalk/i)&&void 0===window.cordova||"m.hopy.com"!==this.parentDomain?("undefined"===this.topDomain&&(this.topDomain=void 0),s="page_url=".concat(encodeURIComponent(this.topDomain||this.parentDomain))):s="bundle=com.hopy.frivgames",function(e,t){try{var n={tp:e,data:t};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(B.encode(JSON.stringify(n)))))}catch(e){console.log("Send Atom Log Error...",e)}}("page_url",{top_domain:this.topDomain,parent_domain:this.parentDomain,game:this.gameId,pageUrl:s});var d=this.nextAdPosition(t);null===(i=this.gameData.pAds)||void 0===i||!i.enabled||null!==(a=this.gameData.loader)&&void 0!==a&&a.enabled||"preroll"!==d||(d="midroll");var c=u("ch",window.location.href),h=u("ch_date",window.location.href),p=c?"&ch=".concat(c):"",f=h?"&ch_date=".concat(h):"",m="https://pub.headerlift.com/opphb?".concat(s,"&player_width=").concat(this.options.width,"&player_height=").concat(this.options.height,"&ad_type=video_image&game_id=").concat(this.gameId,"&ad_position=").concat(d).concat(p).concat(f,"&correlator=").concat(Date.now()),v=new Request(m,{method:"GET"});fetch(v).then(function(t){e(this,o);var n=t.headers.get("content-type");if(n&&-1!==n.indexOf("application/json"))return t.json();throw new TypeError("Oops, we didn't get JSON!")}.bind(this)).then(function(t){e(this,o),l(t)&&(t=this._createTunnlReportingFallbackKeys(d),this.eventBus.broadcast("AD_REQUEST_KEYS_EMPTY",{message:"Tunnl returned empty response.",details:m})),r({data:t,url:m})}.bind(this)).catch(function(t){e(this,o);var n=this._createTunnlReportingFallbackKeys(d);this.eventBus.broadcast("AD_REQUEST_KEYS_FALLBACK",{message:t.message,details:m}),r({data:n,url:m})}.bind(this))}.bind(this))}},{key:"_createTunnlReportingFallbackKeys",value:function(e){return{tid:"TNL_T-17102571517",nsid:"TNL_NS-18101700058",tnl_tid:"T-17102571517",tnl_nsid:"NS-18101700058",tnl_pw:this.options.width,tnl_ph:this.options.height,tnl_pt:"22",tnl_pid:"P-17101800031",tnl_paid:"17",tnl_ad_type:"video_image",tnl_asset_id:this.gameId.toString(),tnl_ad_pos:e,tnl_skippable:"1",tnl_cp1:"",tnl_cp2:"",tnl_cp3:"",tnl_cp4:"",tnl_cp5:"",tnl_cp6:"",tnl_campaign:"2",tnl_gdpr:"0",tnl_gdpr_consent:"1",consent_string:"BOWJjG9OWJjG9CLAAAENBx-AAAAiDAAA",tnl_content_category:this.category.toLowerCase()}}},{key:"_requestAd",value:function(t,n){var r=this;return n=n||{},new Promise(function(i){if(e(this,r),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var a,o=null==t||null===(a=t.tnl_keys)||void 0===a?void 0:a.tnl_ad_pos;this.adSuccess=!1;var s=new google.ima.AdsRequest,d=this._transformVast(t,n),c=Ug(Ug({},n),{},{adTag:d,tnl_ad_pos:o});this.adCounter[o]=this.adCounter[o]||0,this.adCounter[o]++;var u=t.dp,l=t.hl;if(u&&(u.adtag_url=d.url,this._extend_dp_with_adsense(u,l,null==t?void 0:t.tnl_keys)),this._isVMAP(o)){var h=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,i=Date.now(),a=new C(e.adtag_url_1,!0);a.query=Cg(Cg({},a.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:i,output:"xml_vast3"});var o=a.toString(),s=new C(e.adtag_url_2,!0);s.query=Cg(Cg({},s.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++i,output:"xml_vast3"});var d=s.toString(),c=Date.now();return'<?xml version="1.0" encoding="UTF-8"?>\n<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-1">\n <vmap:AdSource id="'.concat(c++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(Pg({id:c++,adtag_url:o,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(Pg({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(o)}));s.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);s.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);s.adsResponse=f}else s.adTagUrl=d.url;s.linearAdSlotWidth=this.options.width,s.linearAdSlotHeight=this.options.height,s.nonLinearAdSlotWidth=this.options.width,s.nonLinearAdSlotHeight=this.options.height,s.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(s.vastLoadTimeout=this.options.vast_load_timeout),s.setAdWillAutoPlay(n.autoplayAllowed),s.setAdWillPlayMuted(n.autoplayRequiresMute),this.adsLoader.requestAds(s,c);try{this.eventBus.broadcast("AD_SDK_REQUEST",{message:c})}catch(e){}i(s)}catch(e){throw new Error(e)}}.bind(this))}},{key:"cancel",value:function(){if(!1!==this.requestRunning){this.requestRunning=!1,this._resetAdsLoader(),this._hide("cancel");var e="AD_SDK_CANCELED";this.eventBus.broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameId}})}}},{key:"_checkAutoPlay",value:(F=r(o.mark((function t(){var n=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t,r){var i=this;e(this,n);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?t({autoplayAllowed:!0,autoplayRequiresMute:!0}):P.video({inline:!0,muted:!1}).then(function(n){e(this,i);var r=n.result;n.error,t(!0===r?{autoplayAllowed:!0,autoplayRequiresMute:!1}:{autoplayAllowed:!0,autoplayRequiresMute:!0})}.bind(this))}.bind(this)));case 1:case"end":return t.stop()}}),t,this)}))),function(){return F.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(q=r(o.mark((function e(){var t;return o.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 q.apply(this,arguments)})},{key:"startAd",value:(G=r(o.mark((function e(t){var n,r,i;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.gameData.afg_disabled,r=t.adType,i=t.params,this.adType_=r,r!==c.Interstitial){e.next=23;break}if(!n){e.next=8;break}return e.abrupt("return",this._startInterstitialAd(i));case 8:if("preroll"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=12;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 12:if("start"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=16;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 16:if("next"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=20;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 20:return e.abrupt("return",this._startInterstitialAd(i));case 21:case 29:e.next=32;break;case 23:if(r!==c.Rewarded){e.next=31;break}if(!n){e.next=28;break}return e.abrupt("return",this._startRewardedAd(i));case 28:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 31:throw new Error("Unsupported ad type");case 32:case"end":return e.stop()}}),e,this)}))),function(e){return G.apply(this,arguments)})},{key:"preloadAd",value:(N=r(o.mark((function e(t){return o.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 N.apply(this,arguments)})},{key:"addAdResume",value:function(){var t=this,n=function(){e(this,t),this.adsManager.resume()}.bind(this);try{this.adResume=new Tg(this.adContainer,n),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(O=r(o.mark((function t(n){var i=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=r(o.mark((function t(r,a){var s,d,c,u,l,p,f=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,(s=n?n.containerId:null)||a("Container id is not specified"),d=document.getElementById(s),document.getElementById(s)||a("No container is found with this id - ".concat(s)),void 0===window.idhb.requestAds&&a("Prebid.js wrapper script hit an error or didn't exist!"),c=n.slotId?n.slotId:"gd__banner@".concat(s),document.getElementById(c)||(u="\n .gd__banner{\n z-index: ".concat(h.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((l=document.createElement("style")).type="text/css",l.id="gd__banner__style",l.styleSheet?l.styleSheet.cssText=u:l.appendChild(document.createTextNode(u)),d.appendChild(l)),(p=document.createElement("div")).id=c,p.classList.add("gd__banner"),d.appendChild(p)),t.next=10,i._create_dp_display_context();case 10:i.atom_display=t.sent,window.idhb.que.push(function(){var t,n,r=this;e(this,f),window.idhb.setRefererUrl(encodeURIComponent(i.parentURL)),window.idhb.allowPersonalizedAds(!!parseInt(i.userAllowedPersonalizedAds)),window.idhb.setDefaultGdprConsentString("BOWJjG9OWJjG9CLAAAENBx-AAAAiDAAA"),null!==(t=i.atom_display)&&void 0!==t&&t.params&&window.idhb.setAdserverTargeting(null===(n=i.atom_display)||void 0===n?void 0:n.params);var a={};a[c]={maxSize:[d.offsetWidth,d.offsetHeight]},window.idhb.requestAds({slots:a,callback:function(t){e(this,r)}.bind(this)})}.bind(this)),r(),t.next=18;break;case 15:t.prev=15,t.t0=t.catch(0),a(t.t0.message||t.t0);case 18:case"end":return t.stop()}}),t,this,[[0,15]])})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(e){return O.apply(this,arguments)})},{key:"_startInterstitialAd",value:(I=r(o.mark((function e(t){var n;return o.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(Ug(Ug({},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 I.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(R=r(o.mark((function t(n){var r,i,a=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._resetAdsLoader(),t.prev=1,t.t0=this.preloadedInterstitialAdVast,t.t0){t.next=7;break}return t.next=6,this._getAdVast(c.Interstitial,n);case 6:t.t0=t.sent;case 7:return r=t.t0,delete this.preloadedInterstitialAdVast,t.next=11,this._requestAd(r,Ug({adType:c.Interstitial},n));case 11:return i=t.sent,t.next=14,new Promise(function(t,n){var r=this;e(this,a);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var o=function(n){e(this,r),this.eventBus.unsubscribeScope(i),t(n.message)}.bind(this),s=function(t){e(this,r),this.eventBus.unsubscribeScope(i),n(t.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",o,i),this.eventBus.subscribe("AD_SDK_CANCELED",s,i),this.eventBus.subscribe("AD_ERROR",s,i)}.bind(this));case 14:return t.abrupt("return",i);case 17:throw t.prev=17,t.t1=t.catch(1),new Error(t.t1);case 20:case"end":return t.stop()}}),t,this,[[1,17]])}))),function(e){return R.apply(this,arguments)})},{key:"_startRewardedAd",value:(T=r(o.mark((function e(t){var n;return o.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(Ug(Ug({},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 T.apply(this,arguments)})},{key:"_loadRewardedAd",value:(S=r(o.mark((function t(n){var r,i,a=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._resetAdsLoader(),t.prev=1,t.t0=this.preloadedRewardedAdVast,t.t0){t.next=7;break}return t.next=6,this._getAdVast(c.Rewarded,n);case 6:t.t0=t.sent;case 7:return r=t.t0,delete this.preloadedRewardedAdVast,t.next=11,this._requestAd(r,Ug({adType:c.Rewarded},n));case 11:return i=t.sent,t.next=14,new Promise(function(t,n){var r=this;e(this,a);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var o=function(n){e(this,r),this.eventBus.unsubscribeScope(i),t(n.message)}.bind(this),s=function(t){e(this,r),this.eventBus.unsubscribeScope(i),n(t.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",o,i),this.eventBus.subscribe("AD_SDK_CANCELED",s,i),this.eventBus.subscribe("AD_ERROR",s,i)}.bind(this));case 14:return t.abrupt("return",i);case 17:throw t.prev=17,t.t1=t.catch(1),new Error(t.t1);case 20:case"end":return t.stop()}}),t,this,[[1,17]])}))),function(e){return S.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(D=r(o.mark((function e(){return o.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 D.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(x=r(o.mark((function e(){return o.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 x.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(t){var n=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var r=null==t?void 0:t.mode,i=this._isT4R(t),a=this._getT4ROptions();"loaded"===r?(this.activeAdContainer.style.opacity=i?.001:1,i&&this.adsManager.setVolume(0),i&&this.eventBus.broadcast("AD_T4R"),i&&setTimeout(function(){e(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))):"click"!==r&&"first_quartile"!==r||(this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1))}}},{key:"_createPlayer",value:function(){var t=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=h.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(){e(this,t);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(t){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=t.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(){e(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(),o=i.getDate(),s=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(o," m").concat(s," y").concat(d)}}),this._adrequest_user_context=t.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var t,n=new Date,r=n.getHours(),i=n.getDate(),a=n.getMonth(),o=n.getFullYear(),s=p(google.ima.AdEvent.Type,e.type),d=!1,u=(null==e||null===(t=e.getAd())||void 0===t?void 0:t.getContentType())||"",l=!u.startsWith("image")&&!u.startsWith("text");this._sendIMAEventsToHB(e);var h="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:h="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:h="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:d=!0,h="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:h="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()),h="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:h="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:h="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",d=!0;break;case google.ima.AdEvent.Type.DURATION_CHANGE:h="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:h="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:h="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:h="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:h="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();h=v,this._show({mode:"loaded",contentType:v});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(h=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:h="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:l&&this.adResume.show(),h="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:h="Fired when the ad is resumed.",l&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:h="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:d=this._is_completed(e.getAd()),h="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:h="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:h="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:d=this._is_completed(e.getAd()),h="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:h="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:h="Fired when the ad volume has been muted."}""!==s&&""!==h&&this.eventBus.broadcast(s,{name:s,message:h,status:"success",analytics:{category:s,action:this.parentDomain,label:"h".concat(r," d").concat(i," m").concat(a," y").concat(o)}}),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}})}catch(e){}}},{key:"_sendIMAEventsToHB",value:function(e){if(window.idhb&&"function"==typeof window.idhb.onImaEvent)try{window.idhb.onImaEvent(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(t,n){var r=this;this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=window.setTimeout(function(){e(this,r),this.cancel(),this._clearSafetyTimer(n)}.bind(this),t)}},{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/gameDistributionV1.3.min.js","http://hb.improvedigital.com/pbw/gameDistributionV1.3.min.js"];return this.options.hb_script?[this.options.hb_script].concat(e):e}},{key:"_getInnerErrorCode",value:function(e){if(Rg(e.getInnerError)){var t=e.getInnerError();if(t)return Rg(t.getErrorCode)&&Rg(t.getVastErrorCode)?t.getErrorCode().toString()||t.getVastErrorCode().toString():t.message}}},{key:"resetForNext",value:function(){this.requestRunning=!1,this._hide("resetForNext")}},{key:"_createCustomAdVastUrl",value:function(t,n){var r=this;if(t){var i=this.macros.transform(t,{get:function(t){if(e(this,r),n&&n.tnl_keys)return n.tnl_keys[t.toLowerCase()]}.bind(this)});for(var a in i.query||{}){var o=i.query[a];L(o)&&(i.query[a]=U.stringify(o))}var s=new C(i.url,!0);return j(s.query,i.query||{}),Ug({url:s.toString()},n)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new C(e.url,!0),i=this._transformQuery(e,t,r);i&&(n.url=r.toString());var a=i?r:new C(e.url,!0);if(a.query.cust_params){var o=U.parse(a.query.cust_params);n.bidder=o.hb_bidder,n.cust_params=o}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(t,n,r){var i=this;if(t&&n&&t.tnl_keys){var a=this.options.vast_query;if(n.retry_on_success&&this.options.retry_on_success&&L(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:n.retry_on_failure&&this.options.retry_on_failure&&L(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=M(a),L(a)){var o=r.query;if(a.$$remove){for(var s in o){new RegExp(a.$$remove,"i").test(s)&&delete o[s]}delete a.$$remove}var d=U.parse(o.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 e(this,i),t.tnl_keys[n.toLowerCase()]}.bind(this)});return o.cust_params=d,j(o,u),o.cust_params=U.stringify(o.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,i,a,o,s,d,c,u,l,h=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(null!=e&&null!==(n=e.contentType)&&void 0!==n&&n.startsWith("image/")||"text"===(null==e?void 0:e.contentType))return h&&("preroll"===h&&(null===(r=this.gameData)||void 0===r||null===(i=r.pAds)||void 0===i||null===(a=i.t4r)||void 0===a?void 0:a.enabled)||"midroll"===h&&(null===(o=this.gameData)||void 0===o||null===(s=o.mAds)||void 0===s||null===(d=s.t4r)||void 0===d?void 0:d.enabled)||"rewarded"===h&&(null===(c=this.gameData)||void 0===c||null===(u=c.rAds)||void 0===u||null===(l=u.t4r)||void 0===l?void 0:l.enabled));if(null!=e&&e.contentType.startsWith("video/")){var p,f,m,v,g,y,b,_,w,A="preroll"===h?null===(p=this.gameData)||void 0===p||null===(f=p.pAds)||void 0===f||null===(m=f.t4r)||void 0===m?void 0:m.viper:"midroll"===h?null===(v=this.gameData)||void 0===v||null===(g=v.mAds)||void 0===g||null===(y=g.t4r)||void 0===y?void 0:y.viper:"rewarded"===h?null===(b=this.gameData)||void 0===b||null===(_=b.rAds)||void 0===_||null===(w=_.t4r)||void 0===w?void 0:w.viper:0;if(A>0){var E,k,x,D,S,T,R,I,O,C=Math.random()<A;return h&&C&&("preroll"===h&&(null===(E=this.gameData)||void 0===E||null===(k=E.pAds)||void 0===k||null===(x=k.t4r)||void 0===x?void 0:x.enabled)||"midroll"===h&&(null===(D=this.gameData)||void 0===D||null===(S=D.mAds)||void 0===S||null===(T=S.t4r)||void 0===T?void 0:T.enabled)||"rewarded"===h&&(null===(R=this.gameData)||void 0===R||null===(I=R.rAds)||void 0===I||null===(O=I.t4r)||void 0===O?void 0:O.enabled))}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,n,r,i,a,o,s,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===(o=this.gameData)||void 0===o||null===(s=o.mAds)||void 0===s?void 0:s.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),y=this.adCounter[e];return void 0!==(null==g?void 0:g.start)?y>=(null==g?void 0:g.start):v}},{key:"_getT4ROptions",value:function(){var e,t,n,r,i,a,o;switch(null===(e=this._adrequest_user_context)||void 0===e?void 0:e.tnl_ad_pos){case"preroll":return null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.t4r;case"midroll":return null===(r=this.gameData)||void 0===r||null===(i=r.mAds)||void 0===i?void 0:i.t4r;case"rewarded":return null===(a=this.gameData)||void 0===a||null===(o=a.rAds)||void 0===o?void 0:o.t4r}}},{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,o=this._createCustomAdVastUrl(null==r?void 0:r.vast_2)||t,s=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==o?void 0:o.url,position:n,dp_1:s,dp_2:d}}},{key:"_get_vmap_config",value:function(e){var t,n,r,i,a,o,s,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===(o=a.rAds)||void 0===o?void 0:o.vmap;default:return null===(s=this.gameData)||void 0===s||null===(d=s.pAds)||void 0===d?void 0:d.vmap}}},{key:"_isDP",value:function(e){var t,n,r,i,a,o,s,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===(o=this.gameData)||void 0===o||null===(s=o.mAds)||void 0===s?void 0:s.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 t=this;return new Promise(function(n){var r=this;e(this,t);try{var i={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new Sg(this.gameData).checkCustomParams();a&&(i.cp=a);var o=encodeURIComponent(B.encode(JSON.stringify(i)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(o)).then(function(t){return e(this,r),t.json()}.bind(this)).then(function(t){if(e(this,r),!t||!t.p)return this.msgrt.send("dp.na",{message:"atom"}),n();this.msgrt.send("dp.fp",{message:t.p/100}),n({params:{fp:t.p/100},error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(o),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(o)})}.bind(this)).catch(function(t){e(this,r),this.msgrt.send("dp.err",{message:(null==t?void 0:t.message)||t}),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(t,n){var i=this;return new Promise(function(){var a=r(o.mark((function r(a){var s,d,c,u,l,h,p=this;return o.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,i._isDP(t)){r.next=5;break}return i.msgrt.send("dp.na",{message:"rule"}),r.abrupt("return",a());case 5:d={id:i.topDomain||i.parentDomain,au:t||"unknown",ty:"video",aid:i.gameData.gameId,pgu:i.parentURL},(c=new Sg(i.gameData).checkCustomParams())&&(d.cp=c),u=encodeURIComponent(B.encode(JSON.stringify(d))),l=null===(s=i.gameData.promo)||void 0===s?void 0:s.rainbow,h=(null==l?void 0:l.enabled)&&!0!==(null==n?void 0:n.fallback_adsense),fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(u)).then(function(t){return e(this,p),t.json()}.bind(this)).then(function(t){if(e(this,p),!t||!t.p)return i.msgrt.send("dp.na",{message:"atom"}),a();var n=t.p/100;a({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(t){e(this,p),i.msgrt.send("dp.err",{message:(null==t?void 0:t.message)||t}),a()}.bind(this)),r.next=18;break;case 14:r.prev=14,r.t0=r.catch(0),i.msgrt.send("dp.err",{message:(null===r.t0||void 0===r.t0?void 0:r.t0.message)||r.t0}),a();case 18:case"end":return r.stop()}}),r,this,[[0,14]])})));return function(e){return a.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t,n){if(e&&t&&n)try{var r,i=new C(t.vastUrl,!0);if(null===(r=i.query)||void 0===r||!r.cust_params)return;if(!U.parse(i.query.cust_params).tnl_asset_id)return;n.bidFloor,n.isDfpBidding;var a=s(n,Lg);i.query.cust_params=U.stringify(Ug(Ug({},a),{},{adsense:1}),!1),e.fallback_url=i.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(k=r(o.mark((function t(n){var r,i,a=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this._getPrebidScripts(),i=r[0],window.HB_OPTIONSgd={gameId:this.gameId},t.next=5,f(i,"gdsdk_prebid",{alternates:r,error_prefix:"Blocked:",exists:function(){return e(this,a),window.idhb}.bind(this)});case 5:window.idhb=window.idhb||{},window.idhb.que=window.idhb.que||[],window.idhb.que.push(function(){var t=this;e(this,a),window.idhb.addEventListener("slotRenderEnded",function(n){var r=this;e(this,t);try{var i,a=n.slotId.split("@");a=1===a.length?a[0]:a[1],n.isEmpty?(null!==(i=this.atom_display)&&void 0!==i&&i.error_url&&(fetch(this.atom_display.error_url).catch(function(t){e(this,r)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_ERROR",{message:a,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(t){e(this,r)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:a,status:"success"}))}catch(e){}}.bind(this))}.bind(this));case 8:case"end":return t.stop()}}),t,this)}))),function(e){return k.apply(this,arguments)})},{key:"_init_ima_script",value:(E=r(o.mark((function t(n){var r,i,a=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=["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"],i=this.options.debug?r[0]:r[1],t.next=4,f(i,"gdsdk_ima",{alternates:r,error_prefix:"Blocked:",exists:function(){return e(this,a),window.google&&window.google.ima}.bind(this)});case 4:case"end":return t.stop()}}),t,this)}))),function(e){return E.apply(this,arguments)})},{key:"_init_afg_script",value:(A=r(o.mark((function t(n){var r,i,a,s,d=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.gameData.afg_disabled){t.next=3;break}return t.abrupt("return");case 3:return(s={}).crossorigin="anonymous",s["data-ad-client"]=(null==n||null===(r=n.adsense_client)||void 0===r?void 0:r.length)>0?n.adsense_client:"ca-pub-2316275586951220",s["data-ad-frequency-hint"]="30s",(null==n||null===(i=n.adsense_channel)||void 0===i?void 0:i.length)>0&&(s["data-ad-channel"]=n.adsense_channel),(null==n||null===(a=n.adsense_host)||void 0===a?void 0:a.length)>0&&(s["data-ad-host"]=n.adsense_host),!0===(null==n?void 0:n.adsense_adbreak_test)&&(s["data-adbreak-test"]="on"),t.next=13,f("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return e(this,d),!!window.adsbygoogle}.bind(this),attrs:s});case 13:window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({sound:"on",preloadAdBreaks:"on"});case 15:case"end":return t.stop()}}),t,this)}))),function(e){return A.apply(this,arguments)})},{key:"_startAdsensePlacementRewardedAd",value:(w=r(o.mark((function t(n){var r,i,a,s,d,c,u=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=1,!this.requestRunning){t.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),t.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),r=function(){e(this,u),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),i=function(){e(this,u),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(){e(this,u),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),s=function(){e(this,u),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(t){e(this,u),t()}.bind(this),c=function(t){e(this,u),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===t.breakStatus?this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this.eventBus.broadcast("AD_ERROR",{message:t.breakStatus,status:"error"}),"dismissed"!==t.breakStatus&&this._send_atom_event("sg.dbg.rw",t))}.bind(this),n={type:"reward",name:"reward-in-game",beforeAd:r,afterAd:i,adDismissed:a,adViewed:s,beforeReward:d,adBreakDone:c},window.adsbygoogle.push(n),t.next=21;break;case 17:throw t.prev=17,t.t0=t.catch(1),this._onError(t.t0),t.t0;case 21:case"end":return t.stop()}var n}),t,this,[[1,17]])}))),function(e){return w.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(_=r(o.mark((function t(n){var r,i=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=1,!this.requestRunning){t.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),t.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),r=function(t){e(this,i),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===t.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:t.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",t))}.bind(this),n={type:"preroll",adBreakDone:r},window.adsbygoogle.push(n),t.next=16;break;case 12:throw t.prev=12,t.t0=t.catch(1),this._onError(t.t0),t.t0;case 16:case"end":return t.stop()}var n}),t,this,[[1,12]])}))),function(e){return _.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(b=r(o.mark((function t(n){var r,i,a,s=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=1,!this.requestRunning){t.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),t.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),r=function(){e(this,s),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),i=function(){e(this,s),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(t){e(this,s),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===t.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:t.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",t))}.bind(this),n={type:"start",name:"start-in-game",beforeAd:r,afterAd:i,adBreakDone:a},window.adsbygoogle.push(n),t.next=18;break;case 14:throw t.prev=14,t.t0=t.catch(1),this._onError(t.t0),t.t0;case 18:case"end":return t.stop()}var n}),t,this,[[1,14]])}))),function(e){return b.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(y=r(o.mark((function t(n){var r,i,a,s=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=1,!this.requestRunning){t.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),t.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),r=function(){e(this,s),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),i=function(){e(this,s),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(t){e(this,s),this.resetForNext(),this.adCounter.midroll=this.adCounter.midroll||0,this.adCounter.midroll++,"viewed"===t.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:t.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",t))}.bind(this),n={type:"next",name:"next-in-game",beforeAd:r,afterAd:i,adBreakDone:a},window.adsbygoogle.push(n),t.next=18;break;case 14:throw t.prev=14,t.t0=t.catch(1),this._onError(t.t0),t.t0;case 18:case"end":return t.stop()}var n}),t,this,[[1,14]])}))),function(e){return y.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(B.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})}},{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}}]),t}(),Ng=Array.isArray,Gg=Object.prototype.toString,qg=Ng||function(e){return!!e&&"[object Array]"==Gg.call(e)},Fg=Ai,Vg=W,Kg=Ci,Wg=ta,zg=De,Hg=Tr,$g=Pr,Qg=Ee,Yg=Ca,Jg=Ut,Xg=hs,Zg=wa("slice"),ey=Jg("species"),ty=Vg.Array,ny=Math.max;Fg({target:"Array",proto:!0,forced:!Zg},{slice:function(e,t){var n,r,i,a=Qg(this),o=$g(a),s=Hg(e,o),d=Hg(void 0===t?o:t,o);if(Kg(a)&&(n=a.constructor,(Wg(n)&&(n===ty||Kg(n.prototype))||zg(n)&&null===(n=n[ey]))&&(n=void 0),n===ty||void 0===n))return Xg(a,s,d);for(r=new(void 0===n?ty:n)(ny(d-s,0)),i=0;s<d;s++,i++)s in a&&Yg(r,i,a[s]);return r.length=i,r}});var ry=mn,iy=Io,ay=Ii,oy=Y,sy=gt,dy=function(e,t,n,r){try{return r?t(ry(n)[0],n[1]):t(n)}catch(t){iy(e,"throw",t)}},cy=fo,uy=ta,ly=Pr,hy=Ca,py=Do,fy=bo,my=W.Array,vy=function(e){var t=sy(e),n=uy(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=void 0!==i;a&&(i=ay(i,r>2?arguments[2]:void 0));var o,s,d,c,u,l,h=fy(t),p=0;if(!h||this==my&&cy(h))for(o=ly(t),s=n?new this(o):my(o);o>p;p++)l=a?i(t[p],p):t[p],hy(s,p,l);else for(u=(c=py(t,h)).next,s=n?new this:[];!(d=oy(u,c)).done;p++)l=a?dy(c,i,[d.value,p],!0):d.value,hy(s,p,l);return s.length=p,s};Ai({target:"Array",stat:!0,forced:!Xo((function(e){Array.from(e)}))},{from:vy});var gy,yy,by,_y=!H((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),wy=W,Ay=_t,Ey=ke,ky=gt,xy=_y,Dy=Gn("IE_PROTO"),Sy=wy.Object,Ty=Sy.prototype,Ry=xy?Sy.getPrototypeOf:function(e){var t=ky(e);if(Ay(t,Dy))return t[Dy];var n=t.constructor;return Ey(n)&&t instanceof n?n.prototype:t instanceof Sy?Ty:null},Iy=H,Oy=ke,Cy=Ry,Py=xn.exports,Ly=Ut("iterator"),My=!1;[].keys&&("next"in(by=[].keys())?(yy=Cy(Cy(by)))!==Object.prototype&&(gy=yy):My=!0);var Uy=null==gy||Iy((function(){var e={};return gy[Ly].call(e)!==e}));Uy&&(gy={}),Oy(gy[Ly])||Py(gy,Ly,(function(){return this}));var jy={IteratorPrototype:gy,BUGGY_SAFARI_ITERATORS:My},By=jy.IteratorPrototype,Ny=ou,Gy=re,qy=to,Fy=uo,Vy=function(){return this},Ky=Ai,Wy=Y,zy=ur,Hy=ke,$y=function(e,t,n){var r=t+" Iterator";return e.prototype=Ny(By,{next:Gy(1,n)}),qy(e,r,!1),Fy[r]=Vy,e},Qy=Ry,Yy=Ja,Jy=to,Xy=kn,Zy=xn.exports,eb=uo,tb=zy.PROPER,nb=zy.CONFIGURABLE,rb=jy.IteratorPrototype,ib=jy.BUGGY_SAFARI_ITERATORS,ab=Ut("iterator"),ob=function(){return this},sb=function(e,t,n,r,i,a,o){$y(n,t,r);var s,d,c,u=function(e){if(e===i&&m)return m;if(!ib&&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[ab]||p["@@iterator"]||i&&p[i],m=!ib&&f||u(i),v="Array"==t&&p.entries||f;if(v&&(s=Qy(v.call(new e)))!==Object.prototype&&s.next&&(Qy(s)!==rb&&(Yy?Yy(s,rb):Hy(s[ab])||Zy(s,ab,ob)),Jy(s,l,!0)),tb&&"values"==i&&f&&"values"!==f.name&&(nb?Xy(p,"name","values"):(h=!0,m=function(){return Wy(f,this)})),i)if(d={values:u("values"),keys:a?m:u("keys"),entries:u("entries")},o)for(c in d)(ib||h||!(c in p))&&Zy(p,c,d[c]);else Ky({target:t,proto:!0,forced:ib||h},d);return p[ab]!==m&&Zy(p,ab,m,{name:i}),eb[t]=m,d},db=kp.charAt,cb=jc,ub=ir,lb=sb,hb=ub.set,pb=ub.getterFor("String Iterator");lb(String,"String",(function(e){hb(this,{type:"String Iterator",string:cb(e),index:0})}),(function(){var e,t=pb(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=db(n,r),t.index+=e.length,{value:e,done:!1})})),Df("iterator");var fb=Ee,mb=pv,vb=uo,gb=ir,yb=sb,bb=gb.set,_b=gb.getterFor("Array Iterator"),wb=yb(Array,"Array",(function(e,t){bb(this,{type:"Array Iterator",target:fb(e),index:0,kind:t})}),(function(){var e=_b(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");vb.Arguments=vb.Array,mb("keys"),mb("values"),mb("entries");var Ab=W,Eb=vl,kb=bl,xb=wb,Db=kn,Sb=Ut,Tb=Sb("iterator"),Rb=Sb("toStringTag"),Ib=xb.values,Ob=function(e,t){if(e){if(e[Tb]!==Ib)try{Db(e,Tb,Ib)}catch(t){e[Tb]=Ib}if(e[Rb]||Db(e,Rb,t),Eb[t])for(var n in xb)if(e[n]!==xb[n])try{Db(e,n,xb[n])}catch(t){e[n]=xb[n]}}};for(var Cb in Eb)Ob(Ab[Cb]&&Ab[Cb].prototype,Cb);function Pb(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 Lb(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 Lb(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,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Lb(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 Mb(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 Ub(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mb(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Ob(kb,"DOMTokenList");var jb={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"}},Bb={},Nb=function(e,t){Bb[e]=Ub(Ub({},t),{},{isLoading:!1})},Gb=function(t){var n=this,r=t.id,i=t.src;return new Promise(function(t,a){if(e(this,n),document.getElementById(r))t();else{var o=document.createElement("script");o.onload=function(){t()},o.id=r,o.setAttribute("crossorigin",!0),o.src=i,document.head.appendChild(o)}}.bind(this))},qb=function(){var e=r(o.mark((function e(t){var n,r,i,a,s,d,c,u;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=window[t])){e.next=3;break}return e.abrupt("return",n);case 3:if(!(r=Bb[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:r.isLoading=!0,i=Pb(r.dependencies),e.prev=8,i.s();case 10:if((a=i.n()).done){e.next=26;break}if(s=a.value,e.prev=12,d=jb[s].name,!window[d]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,Gb({id:s,src:jb[s].src});case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),c=s.id,u=s.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),i.e(e.t1);case 31:return e.prev=31,i.f(),e.finish(31);case 34:return e.prev=34,e.next=37,Gb({id:t,src:r.source});case 37:n=window[t],e.next=43;break;case 40:e.prev=40,e.t2=e.catch(34),console.log("Could not load module ".concat(t," ").concat(r.source,"."),e.t2);case 43:return r.isLoading=!1,e.abrupt("return",n);case 45:case"end":return e.stop()}}),e,null,[[8,28,31,34],[12,20],[34,40]])})));return function(t){return e.apply(this,arguments)}}(),Fb=function e(t){var a=this;i(this,e),n(this,"load",r(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qb(a.moduleName);case 2:a.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),n(this,"promo",r(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a.module){e.next=3;break}return e.next=3,a.load();case 3:return e.abrupt("return",a.module[a.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var s=t.package||"gd-sdk-stone-dynamic",d=t.package_version||"1.1.1",c=t.template||"puzzle",u=t.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=c.charAt(0).toUpperCase()+c.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(s,"/").concat(d,"/dist/").concat(c.toLowerCase(),"/iife/index.js"),dependencies:u},Nb(this.moduleName,this.moduleConfig)},Vb=function e(t){var a=this;i(this,e),n(this,"load",r(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qb(a.moduleName);case 2:a.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),n(this,"splash",r(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a.module){e.next=3;break}return e.next=3,a.load();case 3:return e.abrupt("return",a.module[a.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var s=t.package||"gd-sdk-air-dynamic",d=t.package_version||"1.2.0",c=t.template||"pluto",u=t.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=c.charAt(0).toUpperCase()+c.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(s,"/").concat(d,"/dist/").concat(c.toLowerCase(),"/iife/index.js"),dependencies:u},Nb(this.moduleName,this.moduleConfig)},Kb=function(e,t){console.log(e,t)},Wb={},zb={},Hb=null;function $b(){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 Wb.version=r,Wb.frame=e,Wb.function=n,Wb.version}function Qb(t){var r=this;return Hb||(Hb=new Promise(function(i){function a(e,n){if(Kb("Received a response from CMP",e),n){var r,a;if(!1!==e.gdprApplies)return"tcloaded"===e.eventStatus||"useractioncomplete"===e.eventStatus?(("boolean"!=typeof(a=(r=e)&&"boolean"==typeof r.gdprApplies?r.gdprApplies:t.defaultGdprScope)||!0===a&&"string"!=typeof r.tcString)&&i({result:"cmpUnexpectedResponse",cmp:Wb,consentData:r}),void i({result:"ok",consentData:e})):void 0;i({result:"ok",consentData:e})}else i({result:"cmpCallFailed"})}e(this,r),$b(),Wb.frame?2===Wb.version?(Kb("TCF v2 CMP found. Fetching the consent."),Wb.function?(Kb("CMP API is directly accessible, calling it now..."),Wb.function("addEventListener",Wb.version,a)):(Kb("CMP API is outside the current iframe, calling it now..."),function(t,r,i){var a=this,o="__tcfapi";function s(e){var t="".concat(o,"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!==zb[r.callId]&&zb[r.callId](r.returnValue,r.success)}}window[o]=function(t,i,s,d){e(this,a);var c=Math.random()+"",u="".concat(o,"Call"),l=n({},u,{command:t,parameter:d,callId:c,version:i});zb[c]=s,r.postMessage(l,"*")}.bind(this),window.addEventListener("message",s,!1),window[o](t,Wb.version,i)}("addEventListener",Wb.frame,a))):i({result:"cmpVersionNotV2",cmp:Wb}):i({result:"cmpNotFound"})}.bind(this)),Hb)}var Yb=new(function(){function e(){i(this,e),this.productName="Game Distribution"}var t;return a(e,[{key:"checkIfExcluded",value:function(e){try{var t,n;return!(null===(t=e.diagnostic)||void 0===t||null===(n=t.gameDock)||void 0===n||!n.excluded)}catch(e){return console.log("Error on checkIfExclude check",e),!1}}},{key:"track",value:(t=r(o.mark((function e(t,n){var r,i,a,s,d,c;return o.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(i=null==t||null===(r=t.visitor)||void 0===r?void 0:r.visitorId){e.next=6;break}return e.abrupt("return");case 6:return a=encodeURIComponent(this.productName),s=encodeURIComponent(i),e.prev=8,d="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(a,"/user_id/").concat(s),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(a,"/user_id/").concat(s),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,n){return t.apply(this,arguments)})}]),e}());function Jb(t){var n=this,r={},i=(null==t?void 0:t._ancestor_origins)||window.location.ancestorOrigins,a=(null==t?void 0:t.self_url)||window.location.href,o=(null==t?void 0:t.self_origin)||window.location.origin,s=(null==t?void 0:t.referrer_url)||document.referrer;function d(e){return q(r,e)}function c(e,t){return F(r,e,t)}function u(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new C(e,t)}catch(e){console.log(e)}}function l(){for(var e=(null==t?void 0:t.urls)||[a,s],n=0;n<e.length;n++){var r,i=u(e[n]);if(i){var o=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(o&&(o=decodeURIComponent(o),N.isURL(o)))return o}}}return function(){var t;e(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=o;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=o,c("top.domain.from","self-top");else if(1===t){var a=u(s);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(G(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")}(),t=l(),0===r.depth.value?(c("partner.url.value",a),c("partner.url.from","self-top")):t?G(t)?(c("partner.url.value",a),c("partner.url.from","partner-domain")):(c("partner.url.value",t),c("partner.url.from","partner-url")):(c("partner.url.value",s),c("partner.url.from","fallback"))}.bind(this)(),{get:d,print:function(e){console.log(d(e))}}}function Xb(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 Zb(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 Zb(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,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Zb(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 e_=function(t){var n=this,r=t.src,i=t.attributes,a=t.target,o=t.isAsync;return new Promise(function(t,s){var d=this;e(this,n);try{var c=document.createElement("script");if(c.async=null==o||o,c.type="text/javascript",c.onload=function(){e(this,d),t()}.bind(this),c.onerror=function(){e(this,d);var t="Error on script load, Error: ".concat(r);console.log(t),s(t)}.bind(this),c.src=r,i){var u,l=Xb(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),s(m)}}.bind(this))},t_=function(){var e=r(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,e_({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,e_({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,e_({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 e.apply(this,arguments)}}();function n_(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 r_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n_(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var i_=null,a_=null,o_=function(){function n(t){var r=this;if(i(this,n),i_)return i_;i_=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,t),this._version=t.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new Jb,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(t){e(this,r),this._sdk_ready=!0}.bind(this)).catch(function(t){e(this,r),this._sdk_ready=!1}.bind(this)).finally(function(){var t=this;e(this,r),this._sendLoaderDataEvent(),this._checkSplashAndPromoScreens(),this._initBlockingExternals(),window.addEventListener("DOMNodeInserted",function(){if(e(this,t),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)),this._checkFullscreen()}.bind(this))}var s,u,l,h,p,g,P,L,j,N,G;return a(n,[{key:"_loadCMP",value:(G=r(o.mark((function e(){var t,n,r,i;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=8;break}if(r=new Jb,i=r.get("depth"),console.log("CMP location.depth",i),0!==(null==i?void 0:i.value)||null===(t=this._gameData)||void 0===t||null===(n=t.cmp)||void 0===n||!n.enabled){e.next=8;break}return e.next=7,t_();case 7:console.log("CMP loaded");case 8:case"end":return e.stop()}}),e,this)}))),function(){return G.apply(this,arguments)})},{key:"testConsent",value:function(){console.log("test-consent. Finding CMP");try{var e=$b();console.log("CMP found",e),r(o.mark((function e(){var t;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Qb({});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:"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"}),this._sendEvent("gameplay")}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:(N=r(o.mark((function t(n,r){var i,a=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._getGameData();case 3:return this._gameData=t.sent,t.next=6,this._loadCMP();case 6:this._bridge.isCoreSDKMode=!(!0===this._gameData.enableAds||!0===(null===(i=this._gameData.enableAds)||void 0===i?void 0:i.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(t){return e(this,a),console.error(t.message||t)}.bind(this))),this._sendSDKReady(),n(this._gameData),t.next=22;break;case 17:t.prev=17,t.t0=t.catch(0),this._sendSDKError(t.t0),this.onResumeGame(t.t0.message,"warning"),r(t.t0);case 22:case"end":return t.stop()}}),t,this,[[0,17]])}))),function(e,t){return N.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?m(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=Yv.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){"undefined"===this._topDomain&&(this._topDomain=void 0);var t={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(U.stringify(t)))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=y("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,b("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 _({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:w(),version:Yv.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:A(),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 t=this;try{var n=["https://cdn.gamedock.io/gamedock-web-tracker/4.4.0/script/gamedock-sdk.min.js"];f(n[0],"GamedockSDK",{alternates:n}).then(function(){var n,r;e(this,t),a_=this._initGamedockTracker(window.GamedockSDK),this._sendEvent("pageview"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(r=n.gameDock)&&void 0!==r&&r.adViewEvent&&a_.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),Yb.track(a_,this._gameData),this._gameData.loader.enabled||this._sendLoadedEvent()}.bind(this)).catch(function(n){e(this,t),this._sendSDKError(n)}.bind(this))}catch(e){}}},{key:"_initGamedockTracker",value:function(e){if(!this._bridge.isCoreSDKMode)return e.initialize("gd",this._parentDomain)}},{key:"_sendEvent",value:function(e){a_.tracking.trackEvent(e,{pageId:this.options.gameId,pageType:"game"})}},{key:"_loadMiniJuegosGratisTracker",value:function(){var t=this;window.mpConfig={game:this.options.gameId,partner:"game-distribution"};var n=["https://ext.minijuegosgratis.com/external-host/main.js"];f(n[0],"MinijuegosSDK",{alternates:n}).catch(function(n){e(this,t),this._sendSDKError(n)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var t=this,n=["https://www.google-analytics.com/analytics.js"];f(n[0],"gdsdk_google_analytics",{alternates:n,error_prefix:"Blocked:",exists:function(){return e(this,t),window.ga}.bind(this)}).then(function(){e(this,t),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){e(this,t),this._sendSDKError(n)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var t=this;this.eventBus=new v,E.forEach(function(n){var r=this;return e(this,t),this.eventBus.subscribe(n,function(t){return e(this,r),this._onEvent(t)}.bind(this),"sdk")}.bind(this)),k.forEach(function(n){var r=this;return e(this,t),this.eventBus.subscribe(n,function(t){return e(this,r),this._onEvent(t)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(e(this,t),"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 e(this,t),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(n){var r,i;e(this,t),this.msgrt.send("ad.impression"),null!==(r=this._gameData.diagnostic)&&void 0!==r&&null!==(i=r.gameDock)&&void 0!==i&&i.adViewEvent&&Yb.track(a_,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(n){e(this,t),this.msgrt.send("ad.error",{message:n.message,details:n.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(n){e(this,t),this._sendAdRequestContext(n.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(n){e(this,t),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){e(this,t),this.msgrt.send("tunnl.keys.empty",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_FALLBACK",function(n){e(this,t),this.msgrt.send("tunnl.keys.fallback",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_T4R",function(n){return e(this,t),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(Yv.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(j=r(o.mark((function t(){var n,r,i=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=this._gameData,n=void 0===this._gameData.dmain||this._gameData.dmain,(r.bloc_gard&&!0===r.bloc_gard.enabled||!n)&&(this.msgrt.send("blocked"),setTimeout(function(){e(this,i),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(U.stringify({domain:this._parentDomain,id:r.gameId,img:this._get_game_thumbnail_url(),title:r.title}))}.bind(this),100));case 5:case"end":return t.stop()}}),t,this)}))),function(){return j.apply(this,arguments)})},{key:"_checkGameDeleted",value:function(){var t=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(){e(this,t),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,o=i.loader,s=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!=s&&s.enabled?this._createPromoBeforeSplash(i,a):o.enabled&&!0!==(null===(r=o.splash)||void 0===r?void 0:r.skip)?this._createSplash(i,a):this.onResumeGame("Skipped splash.","success"):o.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||a?null!=s&&s.enabled?this._createPromoBeforeSplash(i,a):!1!==o.enabled&&this._createSplash(i,a):null!=s&&s.enabled&&this._createPromo(i,a))}},{key:"_initializeVideoAd",value:(L=r(o.mark((function e(){var t;return o.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=m(this.options.advertisementSettings,t.sdk)),this.macros=new x({game:t,bridge:this._bridge}),this.adInstance=new Bg(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=Yv,this.adInstance._send("gd.location",this._location.get()),e.next=17,this.adInstance.start();case 17:case"end":return e.stop()}}),e,this)}))),function(){return L.apply(this,arguments)})},{key:"_sendSDKReady",value:function(){var e="Everything is ready.";this.eventBus.broadcast("SDK_READY",{message:e,status:"success"});try{this.options.onInit(e)}catch(e){b("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){b("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){b(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status})}catch(e){b("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:function(){var t=this;return new Promise(function(n){var r=this;e(this,t);var i=this._getDefaultGameData(),a=this._getGameDataUrl();fetch(a).then(function(t){return e(this,r),t.json()}.bind(this)).then(function(t){if(e(this,r),t.success){var a,o,s,d,c=t.result.game,u={gameId:c.gameMd5,slug:c.slug,pname:c.pname,dname:c.dname,status:c.status,description:c.description,enableAds:!0===c.enableAds||!0===(null===(a=c.enableAds)||void 0===a?void 0:a.enabled),preroll:c.preRoll,midroll:6e4*c.timeAds,rewardedAds:c.rewardedAds,title:c.title,tags:c.tags,category:c.category,assets:c.assets,disp_2nd_prer:c.disp_2nd_prer,ctry_vst:c.ctry_vst,ctry:c.ctry,crtv:c.crtv,dmain:c.dmain,block_exts:this._parseAndSelectRandomOne(c.push_cuda),bloc_gard:this._parseAndSelectRandomOne(c.bloc_gard),cookie:this._parseAndSelectRandomOne(c.cookie),gdpr:this._parseAndSelectRandomOne(c.gdpr),diagnostic:this._parseAndSelectRandomOne(c.diagnostic),cmp:this._parseAndSelectRandomOne(c.cmp),sdk:this._parseAndSelectRandomOne(c.sdk)||{},loader:this._parseAndSelectRandomOne(c.loader)||{},splash:this._parseAndSelectRandomOne(c.splash)||{},promo:this._parseAndSelectRandomOne(c.promo)||{},dAds:this._parseAndSelectRandomOne(c.dads)||{},pAds:this._parseAndSelectRandomOne(c.pads)||{},mAds:this._parseAndSelectRandomOne(c.mads)||{},rAds:this._parseAndSelectRandomOne(c.rads)||{}},l=m(M(i),u);l.afg_disabled=!1===(null===(o=l.sdk)||void 0===o||null===(s=o.afg)||void 0===s?void 0:s.enabled),null!==(d=l.pAds)&&void 0!==d&&d.enabled&&(l.preroll=!0),this._bridge.noPreroll=(!this._getisMobile()||!1!==l.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(l),D(l.diagnostic),n(l)}else i.failed=!0,n(i)}.bind(this)).catch(function(t){e(this,r),i.failed=!0,n(i)}.bind(this))}.bind(this))}},{key:"_createSplash",value:(P=r(o.mark((function t(n,r){var i,a,s=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._getSplashTemplate(n);case 2:i=t.sent,(a=new i(r_(r_({},this.options),{},{isConsentDomain:r,version:Yv.version}),n,this._parentDomain)).on("playClick",function(){var t=this;if(e(this,s),r){var n=new Date;n.setDate(n.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(n.toUTCString(),"; path=/")}this.showAd(c.Interstitial,{position:"preroll"}).catch(function(n){e(this,t)}.bind(this))}.bind(this)),this.onPauseGame("Pause the game and wait for a user gesture","success"),this.eventBus.subscribe("SDK_GAME_PAUSE",function(){e(this,s),a.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){e(this,s),a.hide()}.bind(this));case 8:case"end":return t.stop()}}),t,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(g=r(o.mark((function t(n,r){var i,a,s,d,c=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._createPrerollPromoTemplate(n);case 3:s=t.sent,(d=new s(r_(r_({},this.options),{},{isConsentDomain:r,version:Yv.version,template:null===(i=n.promo)||void 0===i||null===(a=i.template)||void 0===a?void 0:a.preroll}),n)).on("done",function(){e(this,c),d.hide(),this._createSplash(n,r)}.bind(this)),t.next=12;break;case 8:t.prev=8,t.t0=t.catch(0),console.log(t.t0),this._createSplash(n,r);case 12:case"end":return t.stop()}}),t,this,[[0,8]])}))),function(e,t){return g.apply(this,arguments)})},{key:"_createPromo",value:(p=r(o.mark((function t(n,r){var i,a,s,d,c=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._createPrerollPromoTemplate(n);case 3:s=t.sent,(d=new s(r_(r_({},this.options),{},{isConsentDomain:r,version:Yv.version,template:null===(i=n.promo)||void 0===i||null===(a=i.template)||void 0===a?void 0:a.preroll}),n)).on("done",function(){e(this,c),d.hide(),this.onResumeGame("Resumed after the promo","warning")}.bind(this)),this.onPauseGame("Pause the game for the promo","success"),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),this.onResumeGame("Resumed after the promo","warning");case 12:case"end":return t.stop()}}),t,this,[[0,9]])}))),function(e,t){return p.apply(this,arguments)})},{key:"showBanner",value:function(){var t=this;this.showAd(c.Interstitial).catch(function(){e(this,t)}.bind(this))}},{key:"showAd",value:(h=r(o.mark((function t(n){var i,a=this,s=arguments;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=s.length>1&&void 0!==s[1]?s[1]:{},t.abrupt("return",new Promise(function(){var t=r(o.mark((function t(r,s){var d,c,u,l,h,p,f,m,v,g,y,b,_,w=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,m={adType:n,params:i,adTimestamp:a.adRequestTimer},t.next=4,a.sdkReady;case 4:return v=t.sent,t.next=7,a.videoAdReady;case 7:return a._sendLoadedEvent(),a._rejectAdIfGameBlocked({gameData:v,adRequest:m}),a._rejectAdIfAdDisabled({gameData:v,adRequest:m}),a._rejectAdIfUnsupportedType({adRequest:m}),a._rejectAdIfRewardedDisabled({gameData:v,adRequest:m}),(null===(d=v.mAds)||void 0===d||null===(c=d.gift)||void 0===c||!c.enabled||null!==(u=v.mAds)&&void 0!==u&&null!==(l=u.gift)&&void 0!==l&&l.enabled&&(null==v||null===(h=v.mAds)||void 0===h||null===(p=h.gift)||void 0===p||null===(f=p.durations[a._giftCount])||void 0===f?void 0:f.after)!==a.adInstance.adMidrollCount)&&a._rejectAdIfAdRateHits({gameData:v,adRequest:m}),a.adInstance.attachAfgPosition(m),a._attachAfgFallback({gameData:v,adRequest:m}),g="main.showad",y=function(t){var n,r,i,o,d;e(this,w),a.eventBus.unsubscribeScope(g),a.onResumeGame(t.message,"warning"),null!=v&&null!==(n=v.mAds)&&void 0!==n&&null!==(r=n.gift)&&void 0!==r&&r.enabled&&(null==v||null===(i=v.mAds)||void 0===i||null===(o=i.gift)||void 0===o||null===(d=o.durations[a._giftCount])||void 0===d?void 0:d.after)===a.adInstance.adMidrollCount&&a.decideToGiveAGift(),s(t.message)}.bind(this),b=function(t){var n,i,o,s,d;e(this,w),a.eventBus.unsubscribeScope(g),a.adRequestTimer=Date.now(),a.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),null!=v&&null!==(n=v.mAds)&&void 0!==n&&null!==(i=n.gift)&&void 0!==i&&i.enabled&&(null==v||null===(o=v.mAds)||void 0===o||null===(s=o.gift)||void 0===s||null===(d=s.durations[a._giftCount])||void 0===d?void 0:d.after)===a.adInstance.adMidrollCount&&a.decideToGiveAGift(),r(t.message)}.bind(this),_=function(t){var o=this;e(this,w),a.eventBus.unsubscribeScope(g),i.fallback_adsense=!1,a.showAd(n,r_(r_({},i),{},{adapter:"adsense"})).then(function(t){e(this,o),r(t)}.bind(this)).catch(function(t){e(this,o),s(t)}.bind(this))}.bind(this),a.eventBus.subscribe("AD_ERROR",null!=i&&i.fallback_adsense?_:y,g),a.eventBus.subscribe("AD_SDK_CANCELED",null!=i&&i.fallback_adsense?_:y,g),a.eventBus.subscribe("AD_SUCCESS",b,g),t.next=24,a.adInstance.startAd(m);case 24:a._post_message({topic:"adrequest.instream"}),t.next=31;break;case 27:t.prev=27,t.t0=t.catch(0),a.onResumeGame(t.t0.message,"warning"),s(t.t0.message);case 31:case"end":return t.stop()}}),t,this,[[0,27]])})));return function(e,n){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}}),t)}))),function(e){return h.apply(this,arguments)})},{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,o,s=e.gameData,d=e.adRequest,u=null;d.adType===c.Interstitial&&null!==(t=s.diagnostic)&&void 0!==t&&null!==(n=t.useMidrollIndex)&&void 0!==n&&n.enabled&&this.adInstance.noPreroll?this.adInstance.adMidrollCount>(null===(r=s.diagnostic)||void 0===r||null===(i=r.useMidrollIndex)||void 0===i?void 0:i.indexes.length)-1||(u=6e4*(null===(a=s.diagnostic)||void 0===a||null===(o=a.useMidrollIndex)||void 0===o?void 0:o.indexes[this.adInstance.adMidrollCount])):u=s.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=r(o.mark((function e(t){var n=this;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=r(o.mark((function e(r,i){var a,s;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return a=e.sent,e.next=6,n.videoAdReady;case 6:if(!a.bloc_gard||!0!==a.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(a.enableAds&&!n._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(t){e.next=14;break}t=c.Rewarded,e.next=16;break;case 14:if(t===c.Interstitial||t===c.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+t);case 16:if(t!==c.Rewarded||a.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,n.adInstance.preloadAd(t);case 20:s=e.sent,r(s),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),i(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return l.apply(this,arguments)})},{key:"cancelAd",value:(u=r(o.mark((function e(){var t=this;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=r(o.mark((function e(n,r){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{t.adInstance.cancel(),t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),r()}catch(e){t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),n(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(){return u.apply(this,arguments)})},{key:"showDisplayAd",value:function(e){var t=this;return new Promise(function(){var n=r(o.mark((function n(r,i){var a;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,t.sdkReady;case 3:return a=n.sent,n.next=6,t.videoAdReady;case 6:if(!a.dAds.enabled){n.next=13;break}return n.next=9,t.adInstance.loadDisplayAd(e);case 9:t._post_message({topic:"adrequest.display"}),r(),n.next=14;break;case 13:i("Display-Ads are disabled.");case 14:n.next=19;break;case 16:n.prev=16,n.t0=n.catch(0),i(n.t0.message||n.t0);case 19:case"end":return n.stop()}}),n,null,[[0,16]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){b("DEVELOPER_ERROR",e.message,"warning")}var n="SDK_GAME_START";this.eventBus.broadcast(n,{name:n,message:e,status:t,analytics:{category:"SDK",action:n,label:this.options.gameId+""}})}},{key:"onPauseGame",value:function(e,t){this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){b("DEVELOPER_ERROR",e.message,"warning")}var n="SDK_GAME_PAUSE";this.eventBus.broadcast(n,{name:n,message:e,status:t,analytics:{category:"SDK",action:n,label:this.options.gameId+""}})}},{key:"openConsole",value:function(){try{new S(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 t=this;try{var n=this._gameData;n.sdk.fullscreen&&"auto"===n.sdk.fullscreen&&document.addEventListener("click",function(){if(e(this,t),!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(t){var n=this;void 0!==this.window_open&&(!1===t.enabled?window.open=function(t){e(this,n),this.msgrt.send("external",{message:"C> ".concat(t)}),(t.startsWith("https://play.google.com")||t.startsWith("https://itunes.apple.com"))&&this.window_open.call(null,t)}.bind(this):window.open=this.window_open)}},{key:"_removeExternalsInHtml",value:function(t){var n=this;!1===t.enabled&&window.document.querySelectorAll("a").forEach(function(t){var r=this;e(this,n);var i=!!(t.innerText.toLowerCase().includes("start")||t.innerText.toLowerCase().includes("play")||t.innerText.toLowerCase().includes("continue")),a=t.getAttribute("href");t.removeAttribute("href"),i||(t.onclick=function(t){return e(this,r),t.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:T()),a=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:R()),o=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===w()?a:I()),s=(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:s,noLoadedEvent:d,noBlockerEvent:c,noPreroll:f,parentURL:i,parentDomain:a,topDomain:o&&o.length?o:a,noGAPageView:u,noLotamePageView:l,noGamedockSDK:h,noMinijuegosSDK:p,version:r.version,pauseGameOnStartup:m,depth:w(),domainMatched:a===o,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_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 C(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 C(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var i=new C(location.href,!0);if(!i.query.gd_zone_config)return;e=i.query.gd_zone_config}return JSON.parse(B.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new Vb(t).splash()}},{key:"_createPrerollPromoTemplate",value:(s=r(o.mark((function e(t){var n,r,i,a,s;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=null===(n=t.promo)||void 0===n?void 0:n[null===(r=t.promo)||void 0===r||null===(i=r.template)||void 0===i?void 0:i.preroll],s=new Fb(a),e.abrupt("return",s.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return s.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(B.encode(JSON.stringify(e)))}catch(e){}try{var n=new C(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(U.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new C(e,!0);return n.query=r_(r_({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return B.encode(JSON.stringify(e))}},{key:"_parseAndSelectRandomOne",value:function(e){var n=this._selectRandomOne("object"===t(e)?e:O(e));return n&&n.version?Yv.version>=n.version?n:void 0:n}},{key:"_selectRandomOne",value:function(t){var n=this;if(!qg(t)||0===t.length)return t;if(1===t.length)return t[0];var r=0;t.forEach(function(t){e(this,n),t.weight=t.weight||1,r+=t.weight}.bind(this));var i=Math.floor(Math.random()*Math.floor(r));r=0;for(var a=0;a<t.length;a++){var o=t[a];if(i<(r+=o.weight))return o}}},{key:"session",value:function(){var e=this;return new Promise(function(){var t=r(o.mark((function t(n,r){var i;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.sdkReady;case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:i=e._gameData,n({ads:{display:{enabled:i.dAds.enabled},rewarded:{enabled:i.rewardedAds}},location:{parentDomain:e._bridge.parentDomain,topDomain:e._bridge.topDomain,parentURL:e._bridge.parentURL,depth:e._bridge.depth,loadedByGameZone:e._bridge.isTokenGameURL}});case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e,n){return t.apply(this,arguments)}}())}},{key:"_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 t=this,n=this._gameData,r=n.assets.find(function(n){return e(this,t),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 t=this;try{var n,i,a=null===(n=this._gameData)||void 0===n||null===(i=n.mAds)||void 0===i?void 0:i.gift;this.giftInterval=setInterval(r(o.mark((function n(){var r=this;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t.adInstance.requestRunning?console.log("Advertisement already running..."):(t.showAd(c.Interstitial,{position:"midroll"}).catch(function(t){e(this,r)}.bind(this)),clearInterval(t.giftInterval),t.giftInterval=void 0,t._giftCount++);case 1:case"end":return n.stop()}}),n,this)}))),1e3*a.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}}]),n}(),s_=new function e(){var t=this;i(this,e),n(this,"load",r(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qb("Leaderboard");case 2:t.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),n(this,"showLeaderboard",function(){var e=r(o.mark((function e(n){var r;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=window.GD_OPTIONS.gameId,t.leaderboard){e.next=4;break}return e.next=4,t.load();case 4:t.leaderboard.showLeaderBoard(r,n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n(this,"addScore",function(){var e=r(o.mark((function e(n){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.leaderboard){e.next=3;break}return e.next=3,t.load();case 3:t.leaderboard.addScore(n);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.moduleName="Leaderboard",this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/gd-sdk-leaderboard/0.1.43/dist/default/iife/index.js",dependencies:["react","react-dom","redux","react-redux","material-ui-core"]},Nb(this.moduleName,this.moduleConfig)},d_=new o_(function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":t(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===t(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}());function c_(){var t=this;this.AdType=c,this.preloadAd=function(e){return d_.preloadAd(e)},this.showAd=function(e,t){return e===c.Display?d_.showDisplayAd(t):d_.showAd(e)},this.cancelAd=function(){return d_.cancelAd()},this.openConsole=function(){d_.openConsole()},this.getSession=function(){return d_.session()},this.leaderboard={show:function(){e(this,t),s_.showLeaderboard()}.bind(this),addScore:function(n){e(this,t),s_.addScore(n)}.bind(this)}}c_.prototype=new function(){this.showBanner=function(){d_.showBanner()},this.play=function(){},this.customLog=function(){}},window.gdsdk=new c_,window.gdApi=window.gdsdk;