@bygd/gd-sdk-pes 1.28.13 → 1.28.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/newArrowCheck";import n from"@babel/runtime/helpers/typeof";import r from"@babel/runtime/regenerator";import{getParentUrl as i,getParentDomain as a,getIframeDepth as s,getTopDomain as o,getQueryParams as c,parseJSON as u,getMobilePlatform as d,MessageRouter as l,extendDefaults as h,dankLog as p,getScript as f,Ls as m,AdType as v,Layers as g,getKeyByValue as y,getQueryString as b,EventBus as _,getIMASampleTags as w,SDKEvents as A,IMAEvents as k,Macros as E,setDankLog as x,ImplementationTest as S}from"@bygd/gd-sdk-era/dist/default";import R from"@babel/runtime/helpers/classCallCheck";import D from"@babel/runtime/helpers/defineProperty";import T from"@babel/runtime/helpers/createClass";import I from"url-parse";import{Base64 as C}from"js-base64";import O from"validator";import P from"is-valid-domain";import L from"get-value";import U from"set-value";import M from"lodash.clonedeep";import j from"can-autoplay";import{isPlainObject as B}from"is-plain-object";import G from"querystringify";import N from"lodash.merge";import{EventEmitter as q}from"events";import{v4 as F}from"uuid";var V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},W=function(e){return e&&e.Math==Math&&e},K=W("object"==typeof globalThis&&globalThis)||W("object"==typeof window&&window)||W("object"==typeof self&&self)||W("object"==typeof V&&V)||Function("return this")(),H={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},z=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},$=z,Q=function(e,t,n){if($(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},Y=function(e){try{return!!e()}catch(e){return!0}},J={}.toString,X=function(e){return J.call(e).slice(8,-1)},Z=X,ee="".split,te=Y((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==Z(e)?ee.call(e,""):Object(e)}:Object,ne=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},re=ne,ie=function(e){return Object(re(e))},ae=Math.ceil,se=Math.floor,oe=function(e){return isNaN(e=+e)?0:(e>0?se:ae)(e)},ce=oe,ue=Math.min,de=function(e){return e>0?ue(ce(e),9007199254740991):0},le=function(e){return"object"==typeof e?null!==e:"function"==typeof e},he=X,pe=Array.isArray||function(e){return"Array"==he(e)},fe={exports:{}},me=!Y((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),ve={},ge=le,ye=K.document,be=ge(ye)&&ge(ye.createElement),_e=function(e){return be?ye.createElement(e):{}},we=_e,Ae=!me&&!Y((function(){return 7!=Object.defineProperty(we("div"),"a",{get:function(){return 7}}).a})),ke=le,Ee=function(e){if(!ke(e))throw TypeError(String(e)+" is not an object");return e},xe=le,Se=function(e,t){if(!xe(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!xe(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!xe(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!xe(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},Re=me,De=Ae,Te=Ee,Ie=Se,Ce=Object.defineProperty;ve.f=Re?Ce:function(e,t,n){if(Te(e),t=Ie(t,!0),Te(n),De)try{return Ce(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Oe=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Pe=ve,Le=Oe,Ue=me?function(e,t,n){return Pe.f(e,t,Le(1,n))}:function(e,t,n){return e[t]=n,e},Me=K,je=Ue,Be=function(e,t){try{je(Me,e,t)}catch(n){Me[e]=t}return t},Ge=Be,Ne=K["__core-js_shared__"]||Ge("__core-js_shared__",{}),qe=Ne;(fe.exports=function(e,t){return qe[e]||(qe[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var Fe={}.hasOwnProperty,Ve=function(e,t){return Fe.call(e,t)},We=0,Ke=Math.random(),He=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++We+Ke).toString(36)},ze=Y,$e=!!Object.getOwnPropertySymbols&&!ze((function(){return!String(Symbol())})),Qe=$e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ye=K,Je=fe.exports,Xe=Ve,Ze=He,et=$e,tt=Qe,nt=Je("wks"),rt=Ye.Symbol,it=tt?rt:rt&&rt.withoutSetter||Ze,at=function(e){return Xe(nt,e)||(et&&Xe(rt,e)?nt[e]=rt[e]:nt[e]=it("Symbol."+e)),nt[e]},st=le,ot=pe,ct=at("species"),ut=function(e,t){var n;return ot(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!ot(n.prototype)?st(n)&&null===(n=n[ct])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},dt=Q,lt=te,ht=ie,pt=de,ft=ut,mt=[].push,vt=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,a=6==e,s=5==e||a;return function(o,c,u,d){for(var l,h,p=ht(o),f=lt(p),m=dt(c,u,3),v=pt(f.length),g=0,y=d||ft,b=t?y(o,v):n?y(o,0):void 0;v>g;g++)if((s||g in f)&&(h=m(l=f[g],g,p),e))if(t)b[g]=h;else if(h)switch(e){case 3:return!0;case 5:return l;case 6:return g;case 2:mt.call(b,l)}else if(i)return!1;return a?-1:r||i?i:b}},gt={forEach:vt(0),map:vt(1),filter:vt(2),some:vt(3),every:vt(4),find:vt(5),findIndex:vt(6)},yt=Y,bt=function(e,t){var n=[][e];return!!n&&yt((function(){n.call(null,t||function(){throw 1},1)}))},_t=me,wt=Y,At=Ve,kt=Object.defineProperty,Et={},xt=function(e){throw e},St=function(e,t){if(At(Et,e))return Et[e];t||(t={});var n=[][e],r=!!At(t,"ACCESSORS")&&t.ACCESSORS,i=At(t,0)?t[0]:xt,a=At(t,1)?t[1]:void 0;return Et[e]=!!n&&!wt((function(){if(r&&!_t)return!0;var e={length:-1};r?kt(e,1,{enumerable:!0,get:xt}):e[1]=1,n.call(e,i,a)}))},Rt=gt.forEach,Dt=St,Tt=bt("forEach"),It=Dt("forEach"),Ct=K,Ot=H,Pt=Tt&&It?[].forEach:function(e){return Rt(this,e,arguments.length>1?arguments[1]:void 0)},Lt=Ue;for(var Ut in Ot){var Mt=Ct[Ut],jt=Mt&&Mt.prototype;if(jt&&jt.forEach!==Pt)try{Lt(jt,"forEach",Pt)}catch(e){jt.forEach=Pt}}var Bt={},Gt={},Nt={}.propertyIsEnumerable,qt=Object.getOwnPropertyDescriptor,Ft=qt&&!Nt.call({1:2},1);Gt.f=Ft?function(e){var t=qt(this,e);return!!t&&t.enumerable}:Nt;var Vt=te,Wt=ne,Kt=function(e){return Vt(Wt(e))},Ht=me,zt=Gt,$t=Oe,Qt=Kt,Yt=Se,Jt=Ve,Xt=Ae,Zt=Object.getOwnPropertyDescriptor;Bt.f=Ht?Zt:function(e,t){if(e=Qt(e),t=Yt(t,!0),Xt)try{return Zt(e,t)}catch(e){}if(Jt(e,t))return $t(!zt.f.call(e,t),e[t])};var en={exports:{}},tn=Ne,nn=Function.toString;"function"!=typeof tn.inspectSource&&(tn.inspectSource=function(e){return nn.call(e)});var rn,an,sn,on=tn.inspectSource,cn=on,un=K.WeakMap,dn="function"==typeof un&&/native code/.test(cn(un)),ln=fe.exports,hn=He,pn=ln("keys"),fn=function(e){return pn[e]||(pn[e]=hn(e))},mn={},vn=dn,gn=le,yn=Ue,bn=Ve,_n=fn,wn=mn,An=K.WeakMap;if(vn){var kn=new An,En=kn.get,xn=kn.has,Sn=kn.set;rn=function(e,t){return Sn.call(kn,e,t),t},an=function(e){return En.call(kn,e)||{}},sn=function(e){return xn.call(kn,e)}}else{var Rn=_n("state");wn[Rn]=!0,rn=function(e,t){return yn(e,Rn,t),t},an=function(e){return bn(e,Rn)?e[Rn]:{}},sn=function(e){return bn(e,Rn)}}var Dn={set:rn,get:an,has:sn,enforce:function(e){return sn(e)?an(e):rn(e,{})},getterFor:function(e){return function(t){var n;if(!gn(t)||(n=an(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},Tn=K,In=Ue,Cn=Ve,On=Be,Pn=on,Ln=Dn.get,Un=Dn.enforce,Mn=String(String).split("String");(en.exports=function(e,t,n,r){var i=!!r&&!!r.unsafe,a=!!r&&!!r.enumerable,s=!!r&&!!r.noTargetGet;"function"==typeof n&&("string"!=typeof t||Cn(n,"name")||In(n,"name",t),Un(n).source=Mn.join("string"==typeof t?t:"")),e!==Tn?(i?!s&&e[t]&&(a=!0):delete e[t],a?e[t]=n:In(e,t,n)):a?e[t]=n:On(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&Ln(this).source||Pn(this)}));var jn=K,Bn=jn,Gn=K,Nn=function(e){return"function"==typeof e?e:void 0},qn=function(e,t){return arguments.length<2?Nn(Bn[e])||Nn(Gn[e]):Bn[e]&&Bn[e][t]||Gn[e]&&Gn[e][t]},Fn={},Vn=oe,Wn=Math.max,Kn=Math.min,Hn=function(e,t){var n=Vn(e);return n<0?Wn(n+t,0):Kn(n,t)},zn=Kt,$n=de,Qn=Hn,Yn=function(e){return function(t,n,r){var i,a=zn(t),s=$n(a.length),o=Qn(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}},Jn={includes:Yn(!0),indexOf:Yn(!1)},Xn=Ve,Zn=Kt,er=Jn.indexOf,tr=mn,nr=function(e,t){var n,r=Zn(e),i=0,a=[];for(n in r)!Xn(tr,n)&&Xn(r,n)&&a.push(n);for(;t.length>i;)Xn(r,n=t[i++])&&(~er(a,n)||a.push(n));return a},rr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ir=nr,ar=rr.concat("length","prototype");Fn.f=Object.getOwnPropertyNames||function(e){return ir(e,ar)};var sr={};sr.f=Object.getOwnPropertySymbols;var or=Fn,cr=sr,ur=Ee,dr=qn("Reflect","ownKeys")||function(e){var t=or.f(ur(e)),n=cr.f;return n?t.concat(n(e)):t},lr=Ve,hr=dr,pr=Bt,fr=ve,mr=function(e,t){for(var n=hr(t),r=fr.f,i=pr.f,a=0;a<n.length;a++){var s=n[a];lr(e,s)||r(e,s,i(t,s))}},vr=Y,gr=/#|\.prototype\./,yr=function(e,t){var n=_r[br(e)];return n==Ar||n!=wr&&("function"==typeof t?vr(t):!!t)},br=yr.normalize=function(e){return String(e).replace(gr,".").toLowerCase()},_r=yr.data={},wr=yr.NATIVE="N",Ar=yr.POLYFILL="P",kr=yr,Er=K,xr=Bt.f,Sr=Ue,Rr=en.exports,Dr=Be,Tr=mr,Ir=kr,Cr=function(e,t){var n,r,i,a,s,o=e.target,c=e.global,u=e.stat;if(n=c?Er:u?Er[o]||Dr(o,{}):(Er[o]||{}).prototype)for(r in t){if(a=t[r],i=e.noTargetGet?(s=xr(n,r))&&s.value:n[r],!Ir(c?r:o+(u?".":"#")+r,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;Tr(a,i)}(e.sham||i&&i.sham)&&Sr(a,"sham",!0),Rr(n,r,a,e)}},Or=nr,Pr=rr,Lr=Object.keys||function(e){return Or(e,Pr)},Ur=ie,Mr=Lr;Cr({target:"Object",stat:!0,forced:Y((function(){Mr(1)}))},{keys:function(e){return Mr(Ur(e))}});var jr,Br={},Gr=ve,Nr=Ee,qr=Lr,Fr=me?Object.defineProperties:function(e,t){Nr(e);for(var n,r=qr(t),i=r.length,a=0;i>a;)Gr.f(e,n=r[a++],t[n]);return e},Vr=qn("document","documentElement"),Wr=Ee,Kr=Fr,Hr=rr,zr=mn,$r=Vr,Qr=_e,Yr=fn("IE_PROTO"),Jr=function(){},Xr=function(e){return"<script>"+e+"<\/script>"},Zr=function(){try{jr=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;Zr=jr?function(e){e.write(Xr("")),e.close();var t=e.parentWindow.Object;return e=null,t}(jr):((t=Qr("iframe")).style.display="none",$r.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Xr("document.F=Object")),e.close(),e.F);for(var n=Hr.length;n--;)delete Zr.prototype[Hr[n]];return Zr()};zr[Yr]=!0;var ei=Object.create||function(e,t){var n;return null!==e?(Jr.prototype=Wr(e),n=new Jr,Jr.prototype=null,n[Yr]=e):n=Zr(),void 0===t?n:Kr(n,t)},ti={},ni=Kt,ri=Fn.f,ii={}.toString,ai="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];ti.f=function(e){return ai&&"[object Window]"==ii.call(e)?function(e){try{return ri(e)}catch(e){return ai.slice()}}(e):ri(ni(e))};var si={},oi=at;si.f=oi;var ci=jn,ui=Ve,di=si,li=ve.f,hi=function(e){var t=ci.Symbol||(ci.Symbol={});ui(t,e)||li(t,e,{value:di.f(e)})},pi=ve.f,fi=Ve,mi=at("toStringTag"),vi=function(e,t,n){e&&!fi(e=n?e:e.prototype,mi)&&pi(e,mi,{configurable:!0,value:t})},gi=Cr,yi=K,bi=qn,_i=me,wi=$e,Ai=Qe,ki=Y,Ei=Ve,xi=pe,Si=le,Ri=Ee,Di=ie,Ti=Kt,Ii=Se,Ci=Oe,Oi=ei,Pi=Lr,Li=Fn,Ui=ti,Mi=sr,ji=Bt,Bi=ve,Gi=Gt,Ni=Ue,qi=en.exports,Fi=fe.exports,Vi=mn,Wi=He,Ki=at,Hi=si,zi=hi,$i=vi,Qi=Dn,Yi=gt.forEach,Ji=fn("hidden"),Xi=Ki("toPrimitive"),Zi=Qi.set,ea=Qi.getterFor("Symbol"),ta=Object.prototype,na=yi.Symbol,ra=bi("JSON","stringify"),ia=ji.f,aa=Bi.f,sa=Ui.f,oa=Gi.f,ca=Fi("symbols"),ua=Fi("op-symbols"),da=Fi("string-to-symbol-registry"),la=Fi("symbol-to-string-registry"),ha=Fi("wks"),pa=yi.QObject,fa=!pa||!pa.prototype||!pa.prototype.findChild,ma=_i&&ki((function(){return 7!=Oi(aa({},"a",{get:function(){return aa(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=ia(ta,t);r&&delete ta[t],aa(e,t,n),r&&e!==ta&&aa(ta,t,r)}:aa,va=function(e,t){var n=ca[e]=Oi(na.prototype);return Zi(n,{type:"Symbol",tag:e,description:t}),_i||(n.description=t),n},ga=Ai?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof na},ya=function(e,t,n){e===ta&&ya(ua,t,n),Ri(e);var r=Ii(t,!0);return Ri(n),Ei(ca,r)?(n.enumerable?(Ei(e,Ji)&&e[Ji][r]&&(e[Ji][r]=!1),n=Oi(n,{enumerable:Ci(0,!1)})):(Ei(e,Ji)||aa(e,Ji,Ci(1,{})),e[Ji][r]=!0),ma(e,r,n)):aa(e,r,n)},ba=function(e,t){Ri(e);var n=Ti(t),r=Pi(n).concat(ka(n));return Yi(r,(function(t){_i&&!_a.call(n,t)||ya(e,t,n[t])})),e},_a=function(e){var t=Ii(e,!0),n=oa.call(this,t);return!(this===ta&&Ei(ca,t)&&!Ei(ua,t))&&(!(n||!Ei(this,t)||!Ei(ca,t)||Ei(this,Ji)&&this[Ji][t])||n)},wa=function(e,t){var n=Ti(e),r=Ii(t,!0);if(n!==ta||!Ei(ca,r)||Ei(ua,r)){var i=ia(n,r);return!i||!Ei(ca,r)||Ei(n,Ji)&&n[Ji][r]||(i.enumerable=!0),i}},Aa=function(e){var t=sa(Ti(e)),n=[];return Yi(t,(function(e){Ei(ca,e)||Ei(Vi,e)||n.push(e)})),n},ka=function(e){var t=e===ta,n=sa(t?ua:Ti(e)),r=[];return Yi(n,(function(e){!Ei(ca,e)||t&&!Ei(ta,e)||r.push(ca[e])})),r};(wi||(qi((na=function(){if(this instanceof na)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=Wi(e),n=function(e){this===ta&&n.call(ua,e),Ei(this,Ji)&&Ei(this[Ji],t)&&(this[Ji][t]=!1),ma(this,t,Ci(1,e))};return _i&&fa&&ma(ta,t,{configurable:!0,set:n}),va(t,e)}).prototype,"toString",(function(){return ea(this).tag})),qi(na,"withoutSetter",(function(e){return va(Wi(e),e)})),Gi.f=_a,Bi.f=ya,ji.f=wa,Li.f=Ui.f=Aa,Mi.f=ka,Hi.f=function(e){return va(Ki(e),e)},_i&&(aa(na.prototype,"description",{configurable:!0,get:function(){return ea(this).description}}),qi(ta,"propertyIsEnumerable",_a,{unsafe:!0}))),gi({global:!0,wrap:!0,forced:!wi,sham:!wi},{Symbol:na}),Yi(Pi(ha),(function(e){zi(e)})),gi({target:"Symbol",stat:!0,forced:!wi},{for:function(e){var t=String(e);if(Ei(da,t))return da[t];var n=na(t);return da[t]=n,la[n]=t,n},keyFor:function(e){if(!ga(e))throw TypeError(e+" is not a symbol");if(Ei(la,e))return la[e]},useSetter:function(){fa=!0},useSimple:function(){fa=!1}}),gi({target:"Object",stat:!0,forced:!wi,sham:!_i},{create:function(e,t){return void 0===t?Oi(e):ba(Oi(e),t)},defineProperty:ya,defineProperties:ba,getOwnPropertyDescriptor:wa}),gi({target:"Object",stat:!0,forced:!wi},{getOwnPropertyNames:Aa,getOwnPropertySymbols:ka}),gi({target:"Object",stat:!0,forced:ki((function(){Mi.f(1)}))},{getOwnPropertySymbols:function(e){return Mi.f(Di(e))}}),ra)&&gi({target:"JSON",stat:!0,forced:!wi||ki((function(){var e=na();return"[null]"!=ra([e])||"{}"!=ra({a:e})||"{}"!=ra(Object(e))}))},{stringify:function(e,t,n){for(var r,i=[e],a=1;arguments.length>a;)i.push(arguments[a++]);if(r=t,(Si(t)||void 0!==e)&&!ga(e))return xi(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!ga(t))return t}),i[1]=t,ra.apply(null,i)}});na.prototype[Xi]||Ni(na.prototype,Xi,na.prototype.valueOf),$i(na,"Symbol"),Vi[Ji]=!0;var Ea,xa,Sa=qn("navigator","userAgent")||"",Ra=Sa,Da=K.process,Ta=Da&&Da.versions,Ia=Ta&&Ta.v8;Ia?xa=(Ea=Ia.split("."))[0]+Ea[1]:Ra&&(!(Ea=Ra.match(/Edge\/(\d+)/))||Ea[1]>=74)&&(Ea=Ra.match(/Chrome\/(\d+)/))&&(xa=Ea[1]);var Ca=xa&&+xa,Oa=Y,Pa=Ca,La=at("species"),Ua=function(e){return Pa>=51||!Oa((function(){var t=[];return(t.constructor={})[La]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Ma=Cr,ja=gt.filter,Ba=St,Ga=Ua("filter"),Na=Ba("filter");Ma({target:"Array",proto:!0,forced:!Ga||!Na},{filter:function(e){return ja(this,e,arguments.length>1?arguments[1]:void 0)}});var qa=Cr,Fa=Y,Va=Kt,Wa=Bt.f,Ka=me,Ha=Fa((function(){Wa(1)}));qa({target:"Object",stat:!0,forced:!Ka||Ha,sham:!Ka},{getOwnPropertyDescriptor:function(e,t){return Wa(Va(e),t)}});var za=Se,$a=ve,Qa=Oe,Ya=function(e,t,n){var r=za(t);r in e?$a.f(e,r,Qa(0,n)):e[r]=n},Ja=dr,Xa=Kt,Za=Bt,es=Ya;Cr({target:"Object",stat:!0,sham:!me},{getOwnPropertyDescriptors:function(e){for(var t,n,r=Xa(e),i=Za.f,a=Ja(r),s={},o=0;a.length>o;)void 0!==(n=i(r,t=a[o++]))&&es(s,t,n);return s}});var ts=Cr,ns=le,rs=pe,is=Hn,as=de,ss=Kt,os=Ya,cs=at,us=St,ds=Ua("slice"),ls=us("slice",{ACCESSORS:!0,0:0,1:2}),hs=cs("species"),ps=[].slice,fs=Math.max;ts({target:"Array",proto:!0,forced:!ds||!ls},{slice:function(e,t){var n,r,i,a=ss(this),s=as(a.length),o=is(e,s),c=is(void 0===t?s:t,s);if(rs(a)&&("function"!=typeof(n=a.constructor)||n!==Array&&!rs(n.prototype)?ns(n)&&null===(n=n[hs])&&(n=void 0):n=void 0,n===Array||void 0===n))return ps.call(a,o,c);for(r=new(void 0===n?Array:n)(fs(c-o,0)),i=0;o<c;o++,i++)o in a&&os(r,i,a[o]);return r.length=i,r}});var ms=Ee,vs=function(e,t,n,r){try{return r?t(ms(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&ms(i.call(e)),t}},gs={},ys=gs,bs=at("iterator"),_s=Array.prototype,ws=function(e){return void 0!==e&&(ys.Array===e||_s[bs]===e)},As={};As[at("toStringTag")]="z";var ks="[object z]"===String(As),Es=ks,xs=X,Ss=at("toStringTag"),Rs="Arguments"==xs(function(){return arguments}()),Ds=Es?xs:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Ss))?n:Rs?xs(t):"Object"==(r=xs(t))&&"function"==typeof t.callee?"Arguments":r},Ts=Ds,Is=gs,Cs=at("iterator"),Os=function(e){if(null!=e)return e[Cs]||e["@@iterator"]||Is[Ts(e)]},Ps=Q,Ls=ie,Us=vs,Ms=ws,js=de,Bs=Ya,Gs=Os,Ns=function(e){var t,n,r,i,a,s,o=Ls(e),c="function"==typeof this?this:Array,u=arguments.length,d=u>1?arguments[1]:void 0,l=void 0!==d,h=Gs(o),p=0;if(l&&(d=Ps(d,u>2?arguments[2]:void 0,2)),null==h||c==Array&&Ms(h))for(n=new c(t=js(o.length));t>p;p++)s=l?d(o[p],p):o[p],Bs(n,p,s);else for(a=(i=h.call(o)).next,n=new c;!(r=a.call(i)).done;p++)s=l?Us(i,d,[r.value,p],!0):r.value,Bs(n,p,s);return n.length=p,n},Fs=at("iterator"),Vs=!1;try{var Ws=0,Ks={next:function(){return{done:!!Ws++}},return:function(){Vs=!0}};Ks[Fs]=function(){return this},Array.from(Ks,(function(){throw 2}))}catch(e){}var Hs=function(e,t){if(!t&&!Vs)return!1;var n=!1;try{var r={};r[Fs]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},zs=Ns;Cr({target:"Array",stat:!0,forced:!Hs((function(e){Array.from(e)}))},{from:zs});var $s,Qs,Ys,Js=oe,Xs=ne,Zs=function(e){return function(t,n){var r,i,a=String(Xs(t)),s=Js(n),o=a.length;return s<0||s>=o?e?"":void 0:(r=a.charCodeAt(s))<55296||r>56319||s+1===o||(i=a.charCodeAt(s+1))<56320||i>57343?e?a.charAt(s):r:e?a.slice(s,s+2):i-56320+(r-55296<<10)+65536}},eo={codeAt:Zs(!1),charAt:Zs(!0)},to=!Y((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),no=Ve,ro=ie,io=to,ao=fn("IE_PROTO"),so=Object.prototype,oo=io?Object.getPrototypeOf:function(e){return e=ro(e),no(e,ao)?e[ao]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?so:null},co=oo,uo=Ue,lo=Ve,ho=at("iterator"),po=!1;[].keys&&("next"in(Ys=[].keys())?(Qs=co(co(Ys)))!==Object.prototype&&($s=Qs):po=!0),null==$s&&($s={}),lo($s,ho)||uo($s,ho,(function(){return this}));var fo={IteratorPrototype:$s,BUGGY_SAFARI_ITERATORS:po},mo=fo.IteratorPrototype,vo=ei,go=Oe,yo=vi,bo=gs,_o=function(){return this},wo=function(e,t,n){var r=t+" Iterator";return e.prototype=vo(mo,{next:go(1,n)}),yo(e,r,!1),bo[r]=_o,e},Ao=le,ko=Ee,Eo=function(e){if(!Ao(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},xo=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return ko(n),Eo(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),So=Cr,Ro=wo,Do=oo,To=xo,Io=vi,Co=Ue,Oo=en.exports,Po=gs,Lo=fo.IteratorPrototype,Uo=fo.BUGGY_SAFARI_ITERATORS,Mo=at("iterator"),jo=function(){return this},Bo=function(e,t,n,r,i,a,s){Ro(n,t,r);var o,c,u,d=function(e){if(e===i&&m)return m;if(!Uo&&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[Mo]||p["@@iterator"]||i&&p[i],m=!Uo&&f||d(i),v="Array"==t&&p.entries||f;if(v&&(o=Do(v.call(new e)),Lo!==Object.prototype&&o.next&&(Do(o)!==Lo&&(To?To(o,Lo):"function"!=typeof o[Mo]&&Co(o,Mo,jo)),Io(o,l,!0))),"values"==i&&f&&"values"!==f.name&&(h=!0,m=function(){return f.call(this)}),p[Mo]!==m&&Co(p,Mo,m),Po[t]=m,i)if(c={values:d("values"),keys:a?m:d("keys"),entries:d("entries")},s)for(u in c)(Uo||h||!(u in p))&&Oo(p,u,c[u]);else So({target:t,proto:!0,forced:Uo||h},c);return c},Go=eo.charAt,No=Dn,qo=Bo,Fo=No.set,Vo=No.getterFor("String Iterator");qo(String,"String",(function(e){Fo(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=Vo(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Go(n,r),t.index+=e.length,{value:e,done:!1})}));var Wo=Cr,Ko=me,Ho=K,zo=Ve,$o=le,Qo=ve.f,Yo=mr,Jo=Ho.Symbol;if(Ko&&"function"==typeof Jo&&(!("description"in Jo.prototype)||void 0!==Jo().description)){var Xo={},Zo=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof Zo?new Jo(e):void 0===e?Jo():Jo(e);return""===e&&(Xo[t]=!0),t};Yo(Zo,Jo);var ec=Zo.prototype=Jo.prototype;ec.constructor=Zo;var tc=ec.toString,nc="Symbol(test)"==String(Jo("test")),rc=/^Symbol\((.*)\)[^)]+$/;Qo(ec,"description",{configurable:!0,get:function(){var e=$o(this)?this.valueOf():this,t=tc.call(e);if(zo(Xo,e))return"";var n=nc?t.slice(7,-1):t.replace(rc,"$1");return""===n?void 0:n}}),Wo({global:!0,forced:!0},{Symbol:Zo})}hi("iterator");var ic=ei,ac=ve,sc=at("unscopables"),oc=Array.prototype;null==oc[sc]&&ac.f(oc,sc,{configurable:!0,value:ic(null)});var cc=function(e){oc[sc][e]=!0},uc=Kt,dc=cc,lc=gs,hc=Dn,pc=Bo,fc=hc.set,mc=hc.getterFor("Array Iterator"),vc=pc(Array,"Array",(function(e,t){fc(this,{type:"Array Iterator",target:uc(e),index:0,kind:t})}),(function(){var e=mc(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");lc.Arguments=lc.Array,dc("keys"),dc("values"),dc("entries");var gc=K,yc=H,bc=vc,_c=Ue,wc=at,Ac=wc("iterator"),kc=wc("toStringTag"),Ec=bc.values;for(var xc in yc){var Sc=gc[xc],Rc=Sc&&Sc.prototype;if(Rc){if(Rc[Ac]!==Ec)try{_c(Rc,Ac,Ec)}catch(e){Rc[Ac]=Ec}if(Rc[kc]||_c(Rc,kc,xc),yc[xc])for(var Dc in bc)if(Rc[Dc]!==bc[Dc])try{_c(Rc,Dc,bc[Dc])}catch(e){Rc[Dc]=bc[Dc]}}}var Tc=Ds,Ic=ks?{}.toString:function(){return"[object "+Tc(this)+"]"},Cc=ks,Oc=en.exports,Pc=Ic;Cc||Oc(Object.prototype,"toString",Pc,{unsafe:!0});var Lc=K.Promise,Uc=en.exports,Mc=function(e,t,n){for(var r in t)Uc(e,r,t[r],n);return e},jc=qn,Bc=ve,Gc=me,Nc=at("species"),qc=function(e){var t=jc(e),n=Bc.f;Gc&&t&&!t[Nc]&&n(t,Nc,{configurable:!0,get:function(){return this}})},Fc=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},Vc={exports:{}},Wc=Ee,Kc=ws,Hc=de,zc=Q,$c=Os,Qc=vs,Yc=function(e,t){this.stopped=e,this.result=t};(Vc.exports=function(e,t,n,r,i){var a,s,o,c,u,d,l,h=zc(t,n,r?2:1);if(i)a=e;else{if("function"!=typeof(s=$c(e)))throw TypeError("Target is not iterable");if(Kc(s)){for(o=0,c=Hc(e.length);c>o;o++)if((u=r?h(Wc(l=e[o])[0],l[1]):h(e[o]))&&u instanceof Yc)return u;return new Yc(!1)}a=s.call(e)}for(d=a.next;!(l=d.call(a)).done;)if("object"==typeof(u=Qc(a,h,l.value,r))&&u&&u instanceof Yc)return u;return new Yc(!1)}).stop=function(e){return new Yc(!0,e)};var Jc,Xc,Zc,eu=Ee,tu=z,nu=at("species"),ru=function(e,t){var n,r=eu(e).constructor;return void 0===r||null==(n=eu(r)[nu])?t:tu(n)},iu=/(iphone|ipod|ipad).*applewebkit/i.test(Sa),au=K,su=Y,ou=X,cu=Q,uu=Vr,du=_e,lu=iu,hu=au.location,pu=au.setImmediate,fu=au.clearImmediate,mu=au.process,vu=au.MessageChannel,gu=au.Dispatch,yu=0,bu={},_u=function(e){if(bu.hasOwnProperty(e)){var t=bu[e];delete bu[e],t()}},wu=function(e){return function(){_u(e)}},Au=function(e){_u(e.data)},ku=function(e){au.postMessage(e+"",hu.protocol+"//"+hu.host)};pu&&fu||(pu=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return bu[++yu]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Jc(yu),yu},fu=function(e){delete bu[e]},"process"==ou(mu)?Jc=function(e){mu.nextTick(wu(e))}:gu&&gu.now?Jc=function(e){gu.now(wu(e))}:vu&&!lu?(Zc=(Xc=new vu).port2,Xc.port1.onmessage=Au,Jc=cu(Zc.postMessage,Zc,1)):!au.addEventListener||"function"!=typeof postMessage||au.importScripts||su(ku)||"file:"===hu.protocol?Jc="onreadystatechange"in du("script")?function(e){uu.appendChild(du("script")).onreadystatechange=function(){uu.removeChild(this),_u(e)}}:function(e){setTimeout(wu(e),0)}:(Jc=ku,au.addEventListener("message",Au,!1)));var Eu,xu,Su,Ru,Du,Tu,Iu,Cu,Ou={set:pu,clear:fu},Pu=K,Lu=Bt.f,Uu=X,Mu=Ou.set,ju=iu,Bu=Pu.MutationObserver||Pu.WebKitMutationObserver,Gu=Pu.process,Nu=Pu.Promise,qu="process"==Uu(Gu),Fu=Lu(Pu,"queueMicrotask"),Vu=Fu&&Fu.value;Vu||(Eu=function(){var e,t;for(qu&&(e=Gu.domain)&&e.exit();xu;){t=xu.fn,xu=xu.next;try{t()}catch(e){throw xu?Ru():Su=void 0,e}}Su=void 0,e&&e.enter()},qu?Ru=function(){Gu.nextTick(Eu)}:Bu&&!ju?(Du=!0,Tu=document.createTextNode(""),new Bu(Eu).observe(Tu,{characterData:!0}),Ru=function(){Tu.data=Du=!Du}):Nu&&Nu.resolve?(Iu=Nu.resolve(void 0),Cu=Iu.then,Ru=function(){Cu.call(Iu,Eu)}):Ru=function(){Mu.call(Pu,Eu)});var Wu=Vu||function(e){var t={fn:e,next:void 0};Su&&(Su.next=t),xu||(xu=t,Ru()),Su=t},Ku={},Hu=z,zu=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=Hu(t),this.reject=Hu(n)};Ku.f=function(e){return new zu(e)};var $u,Qu,Yu,Ju,Xu=Ee,Zu=le,ed=Ku,td=function(e,t){if(Xu(e),Zu(t)&&t.constructor===e)return t;var n=ed.f(e);return(0,n.resolve)(t),n.promise},nd=K,rd=Cr,id=K,ad=qn,sd=Lc,od=en.exports,cd=Mc,ud=vi,dd=qc,ld=le,hd=z,pd=Fc,fd=X,md=on,vd=Vc.exports,gd=Hs,yd=ru,bd=Ou.set,_d=Wu,wd=td,Ad=function(e,t){var n=nd.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))},kd=Ku,Ed=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},xd=Dn,Sd=kr,Rd=Ca,Dd=at("species"),Td="Promise",Id=xd.get,Cd=xd.set,Od=xd.getterFor(Td),Pd=sd,Ld=id.TypeError,Ud=id.document,Md=id.process,jd=ad("fetch"),Bd=kd.f,Gd=Bd,Nd="process"==fd(Md),qd=!!(Ud&&Ud.createEvent&&id.dispatchEvent),Fd=Sd(Td,(function(){if(!(md(Pd)!==String(Pd))){if(66===Rd)return!0;if(!Nd&&"function"!=typeof PromiseRejectionEvent)return!0}if(Rd>=51&&/native code/.test(Pd))return!1;var e=Pd.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[Dd]=t,!(e.then((function(){}))instanceof t)})),Vd=Fd||!gd((function(e){Pd.all(e).catch((function(){}))})),Wd=function(e){var t;return!(!ld(e)||"function"!=typeof(t=e.then))&&t},Kd=function(e,t,n){if(!t.notified){t.notified=!0;var r=t.reactions;_d((function(){for(var i=t.value,a=1==t.state,s=0;r.length>s;){var o,c,u,d=r[s++],l=a?d.ok:d.fail,h=d.resolve,p=d.reject,f=d.domain;try{l?(a||(2===t.rejection&&Qd(e,t),t.rejection=1),!0===l?o=i:(f&&f.enter(),o=l(i),f&&(f.exit(),u=!0)),o===d.promise?p(Ld("Promise-chain cycle")):(c=Wd(o))?c.call(o,h,p):h(o)):p(i)}catch(e){f&&!u&&f.exit(),p(e)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&zd(e,t)}))}},Hd=function(e,t,n){var r,i;qd?((r=Ud.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),id.dispatchEvent(r)):r={promise:t,reason:n},(i=id["on"+e])?i(r):"unhandledrejection"===e&&Ad("Unhandled promise rejection",n)},zd=function(e,t){bd.call(id,(function(){var n,r=t.value;if($d(t)&&(n=Ed((function(){Nd?Md.emit("unhandledRejection",r,e):Hd("unhandledrejection",e,r)})),t.rejection=Nd||$d(t)?2:1,n.error))throw n.value}))},$d=function(e){return 1!==e.rejection&&!e.parent},Qd=function(e,t){bd.call(id,(function(){Nd?Md.emit("rejectionHandled",e):Hd("rejectionhandled",e,t.value)}))},Yd=function(e,t,n,r){return function(i){e(t,n,i,r)}},Jd=function(e,t,n,r){t.done||(t.done=!0,r&&(t=r),t.value=n,t.state=2,Kd(e,t,!0))},Xd=function(e,t,n,r){if(!t.done){t.done=!0,r&&(t=r);try{if(e===n)throw Ld("Promise can't be resolved itself");var i=Wd(n);i?_d((function(){var r={done:!1};try{i.call(n,Yd(Xd,e,r,t),Yd(Jd,e,r,t))}catch(n){Jd(e,r,n,t)}})):(t.value=n,t.state=1,Kd(e,t,!1))}catch(n){Jd(e,{done:!1},n,t)}}};Fd&&(Pd=function(e){pd(this,Pd,Td),hd(e),$u.call(this);var t=Id(this);try{e(Yd(Xd,this,t),Yd(Jd,this,t))}catch(e){Jd(this,t,e)}},($u=function(e){Cd(this,{type:Td,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=cd(Pd.prototype,{then:function(e,t){var n=Od(this),r=Bd(yd(this,Pd));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Nd?Md.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Kd(this,n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),Qu=function(){var e=new $u,t=Id(e);this.promise=e,this.resolve=Yd(Xd,e,t),this.reject=Yd(Jd,e,t)},kd.f=Bd=function(e){return e===Pd||e===Yu?new Qu(e):Gd(e)},"function"==typeof sd&&(Ju=sd.prototype.then,od(sd.prototype,"then",(function(e,t){var n=this;return new Pd((function(e,t){Ju.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof jd&&rd({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return wd(Pd,jd.apply(id,arguments))}}))),rd({global:!0,wrap:!0,forced:Fd},{Promise:Pd}),ud(Pd,Td,!1),dd(Td),Yu=ad(Td),rd({target:Td,stat:!0,forced:Fd},{reject:function(e){var t=Bd(this);return t.reject.call(void 0,e),t.promise}}),rd({target:Td,stat:!0,forced:Fd},{resolve:function(e){return wd(this,e)}}),rd({target:Td,stat:!0,forced:Vd},{all:function(e){var t=this,n=Bd(t),r=n.resolve,i=n.reject,a=Ed((function(){var n=hd(t.resolve),a=[],s=0,o=1;vd(e,(function(e){var c=s++,u=!1;a.push(void 0),o++,n.call(t,e).then((function(e){u||(u=!0,a[c]=e,--o||r(a))}),i)})),--o||r(a)}));return a.error&&i(a.value),n.promise},race:function(e){var t=this,n=Bd(t),r=n.reject,i=Ed((function(){var i=hd(t.resolve);vd(e,(function(e){i.call(t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Zd=Cr,el=Y,tl=pe,nl=le,rl=ie,il=de,al=Ya,sl=ut,ol=Ua,cl=Ca,ul=at("isConcatSpreadable"),dl=cl>=51||!el((function(){var e=[];return e[ul]=!1,e.concat()[0]!==e})),ll=ol("concat"),hl=function(e){if(!nl(e))return!1;var t=e[ul];return void 0!==t?!!t:tl(e)};Zd({target:"Array",proto:!0,forced:!dl||!ll},{concat:function(e){var t,n,r,i,a,s=rl(this),o=sl(s,0),c=0;for(t=-1,r=arguments.length;t<r;t++)if(hl(a=-1===t?s:arguments[t])){if(c+(i=il(a.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<i;n++,c++)n in a&&al(o,c,a[n])}else{if(c>=9007199254740991)throw TypeError("Maximum allowed index exceeded");al(o,c++,a)}return o.length=c,o}});var pl=me,fl=ve.f,ml=Function.prototype,vl=ml.toString,gl=/^\s*function ([^ (]*)/;function yl(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 bl(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 bl(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 bl(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 _l(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 wl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_l(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}pl&&!("name"in ml)&&fl(ml,"name",{configurable:!0,get:function(){try{return vl.call(this).match(gl)[1]}catch(e){return""}}});var Al,kl={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"}},El={},xl=function(e,t){El[e]=wl(wl({},t),{},{isLoading:!1})},Sl=function(e){var n=this,r=e.id,i=e.src;return new Promise(function(e,a){if(t(this,n),document.getElementById(r))e();else{var s=document.createElement("script");s.onload=function(){e()},s.id=r,s.setAttribute("crossorigin",!0),s.src=i,document.head.appendChild(s)}}.bind(this))},Rl=function(){var t=e(r.mark((function e(t){var n,i,a,s,o,c,u,d;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=window[t])){e.next=3;break}return e.abrupt("return",n);case 3:if(!(i=El[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:i.isLoading=!0,a=yl(i.dependencies),e.prev=8,a.s();case 10:if((s=a.n()).done){e.next=26;break}if(o=s.value,e.prev=12,c=kl[o].name,!window[c]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,Sl({id:o,src:kl[o].src});case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),u=o.id,d=o.src,console.log("Could not load external script ".concat(u," ").concat(d),e.t0);case 24:e.next=10;break;case 26:e.next=31;break;case 28:e.prev=28,e.t1=e.catch(8),a.e(e.t1);case 31:return e.prev=31,a.f(),e.finish(31);case 34:return e.prev=34,e.next=37,Sl({id:t,src:i.source});case 37:n=window[t],e.next=43;break;case 40:e.prev=40,e.t2=e.catch(34),console.log("Could not load module ".concat(t," ").concat(i.source,"."),e.t2);case 43:return i.isLoading=!1,e.abrupt("return",n);case 45:case"end":return e.stop()}}),e,null,[[8,28,31,34],[12,20],[34,40]])})));return function(e){return t.apply(this,arguments)}}(),Dl=new function t(){var n=this;R(this,t),D(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rl("Leaderboard");case 2:n.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),D(this,"showLeaderboard",function(){var t=e(r.mark((function e(t){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=window.GD_OPTIONS.gameId,n.leaderboard){e.next=4;break}return e.next=4,n.load();case 4:n.leaderboard.showLeaderBoard(i,t);case 5:case"end":return e.stop()}}),e)})));return function(e){return t.apply(this,arguments)}}()),D(this,"addScore",function(){var t=e(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.leaderboard){e.next=3;break}return e.next=3,n.load();case 3:n.leaderboard.addScore(t);case 4:case"end":return e.stop()}}),e)})));return function(e){return t.apply(this,arguments)}}()),this.moduleName="Leaderboard",this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/gd-sdk-leaderboard/0.1.43/dist/default/iife/index.js",dependencies:["react","react-dom","redux","react-redux","material-ui-core"]},xl(this.moduleName,this.moduleConfig)},Tl=le,Il=X,Cl=at("match"),Ol=function(e){var t;return Tl(e)&&(void 0!==(t=e[Cl])?!!t:"RegExp"==Il(e))},Pl=Ol,Ll=function(e){if(Pl(e))throw TypeError("The method doesn't accept regular expressions");return e},Ul=at("match"),Ml=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Ul]=!1,"/./"[e](t)}catch(e){}}return!1},jl=Cr,Bl=Bt.f,Gl=de,Nl=Ll,ql=ne,Fl=Ml,Vl="".startsWith,Wl=Math.min,Kl=Fl("startsWith");jl({target:"String",proto:!0,forced:!!(Kl||(Al=Bl(String.prototype,"startsWith"),!Al||Al.writable))&&!Kl},{startsWith:function(e){var t=String(ql(this));Nl(e);var n=Gl(Wl(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return Vl?Vl.call(t,r,n):t.slice(n,n+r.length)===r}});var Hl=Ee,zl=function(){var e=Hl(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},$l=en.exports,Ql=Ee,Yl=Y,Jl=zl,Xl=RegExp.prototype,Zl=Xl.toString,eh=Yl((function(){return"/a/b"!=Zl.call({source:"a",flags:"b"})})),th="toString"!=Zl.name;(eh||th)&&$l(RegExp.prototype,"toString",(function(){var e=Ql(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in Xl)?Jl.call(e):n)}),{unsafe:!0});var nh={},rh=Y;function ih(e,t){return RegExp(e,t)}nh.UNSUPPORTED_Y=rh((function(){var e=ih("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),nh.BROKEN_CARET=rh((function(){var e=ih("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var ah=zl,sh=nh,oh=RegExp.prototype.exec,ch=String.prototype.replace,uh=oh,dh=function(){var e=/a/,t=/b*/g;return oh.call(e,"a"),oh.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),lh=sh.UNSUPPORTED_Y||sh.BROKEN_CARET,hh=void 0!==/()??/.exec("")[1];(dh||hh||lh)&&(uh=function(e){var t,n,r,i,a=this,s=lh&&a.sticky,o=ah.call(a),c=a.source,u=0,d=e;return s&&(-1===(o=o.replace("y","")).indexOf("g")&&(o+="g"),d=String(e).slice(a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==e[a.lastIndex-1])&&(c="(?: "+c+")",d=" "+d,u++),n=new RegExp("^(?:"+c+")",o)),hh&&(n=new RegExp("^"+c+"$(?!\\s)",o)),dh&&(t=a.lastIndex),r=oh.call(s?n:a,d),s?r?(r.input=r.input.slice(u),r[0]=r[0].slice(u),r.index=a.lastIndex,a.lastIndex+=r[0].length):a.lastIndex=0:dh&&r&&(a.lastIndex=a.global?r.index+r[0].length:t),hh&&r&&r.length>1&&ch.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r});var ph=uh;Cr({target:"RegExp",proto:!0,forced:/./.exec!==ph},{exec:ph});var fh=en.exports,mh=Y,vh=at,gh=ph,yh=Ue,bh=vh("species"),_h=!mh((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),wh="$0"==="a".replace(/./,"$0"),Ah=vh("replace"),kh=!!/./[Ah]&&""===/./[Ah]("a","$0"),Eh=!mh((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]})),xh=function(e,t,n,r){var i=vh(e),a=!mh((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),s=a&&!mh((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[bh]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!a||!s||"replace"===e&&(!_h||!wh||kh)||"split"===e&&!Eh){var o=/./[i],c=n(i,""[e],(function(e,t,n,r,i){return t.exec===gh?a&&!i?{done:!0,value:o.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:wh,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:kh}),u=c[0],d=c[1];fh(String.prototype,e,u),fh(RegExp.prototype,i,2==t?function(e,t){return d.call(e,this,t)}:function(e){return d.call(e,this)})}r&&yh(RegExp.prototype[i],"sham",!0)},Sh=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},Rh=X,Dh=ph,Th=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==Rh(e))throw TypeError("RegExp#exec called on incompatible receiver");return Dh.call(e,t)},Ih=Ee,Ch=ne,Oh=Sh,Ph=Th;function Lh(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 Uh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lh(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}xh("search",1,(function(e,t,n){return[function(t){var n=Ch(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var i=Ih(e),a=String(this),s=i.lastIndex;Oh(s,0)||(i.lastIndex=0);var o=Ph(i,a);return Oh(i.lastIndex,s)||(i.lastIndex=s),null===o?-1:o.index}]}));var Mh,jh,Bh=function(){function e(){R(this,e)}return T(e,[{key:"getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var c=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:i()),u=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:a()),d=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===s()?u:o()),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,v=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled,y=(e||n)&&r.loaderEnabled,b=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:l,noLoadedEvent:h,noBlockerEvent:p,noPreroll:y,parentURL:c,parentDomain:u,topDomain:d&&d.length?d:u,noGAPageView:f,noLotamePageView:m,noGamedockSDK:v,noMinijuegosSDK:g,version:r.version,pauseGameOnStartup:b,depth:s(),domainMatched:u===d,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isLoaderGameURL",value:function(){return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)&&location.href.startsWith("https://html5.gamedistribution.com")}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var n=new I(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new I(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var i=new I(location.href,!0);if(!i.query.gd_zone_config)return;e=i.query.gd_zone_config}return JSON.parse(C.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(C.encode(JSON.stringify(e)))}catch(e){}try{var n=new I(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(qs.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new I(e,!0);return n.query=Uh(Uh({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return C.encode(JSON.stringify(e))}}]),e}(),Gh=function(){try{return(new Bh).getBridgeContext()}catch(e){return{}}}(),Nh={userDeclinedTracking:document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0,whitelabelPartner:(Mh=!1,(jh=c("xanthophyll")).hasOwnProperty("xanthophyll")&&"true"===jh.xanthophyll&&(Mh=!0),Mh)},qh=eo.charAt,Fh=function(e,t,n){return t+(n?qh(e,t).length:1)},Vh=xh,Wh=Ee,Kh=ie,Hh=de,zh=oe,$h=ne,Qh=Fh,Yh=Th,Jh=Math.max,Xh=Math.min,Zh=Math.floor,ep=/\$([$&'`]|\d\d?|<[^>]*>)/g,tp=/\$([$&'`]|\d\d?)/g;Vh("replace",2,(function(e,t,n,r){var i=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,a=r.REPLACE_KEEPS_$0,s=i?"$":"$0";return[function(n,r){var i=$h(this),a=null==n?void 0:n[e];return void 0!==a?a.call(n,i,r):t.call(String(i),n,r)},function(e,r){if(!i&&a||"string"==typeof r&&-1===r.indexOf(s)){var c=n(t,e,this,r);if(c.done)return c.value}var u=Wh(e),d=String(this),l="function"==typeof r;l||(r=String(r));var h=u.global;if(h){var p=u.unicode;u.lastIndex=0}for(var f=[];;){var m=Yh(u,d);if(null===m)break;if(f.push(m),!h)break;""===String(m[0])&&(u.lastIndex=Qh(d,Hh(u.lastIndex),p))}for(var v,g="",y=0,b=0;b<f.length;b++){m=f[b];for(var _=String(m[0]),w=Jh(Xh(zh(m.index),d.length),0),A=[],k=1;k<m.length;k++)A.push(void 0===(v=m[k])?v:String(v));var E=m.groups;if(l){var x=[_].concat(A,w,d);void 0!==E&&x.push(E);var S=String(r.apply(void 0,x))}else S=o(_,d,w,A,E,r);w>=y&&(g+=d.slice(y,w)+S,y=w+_.length)}return g+d.slice(y)}];function o(e,n,r,i,a,s){var o=r+e.length,c=i.length,u=tp;return void 0!==a&&(a=Kh(a),u=ep),t.call(s,u,(function(t,s){var u;switch(s.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,r);case"'":return n.slice(o);case"<":u=a[s.slice(1,-1)];break;default:var d=+s;if(0===d)return t;if(d>c){var l=Zh(d/10);return 0===l?t:l<=c?void 0===i[l-1]?s.charAt(1):i[l-1]+s.charAt(1):t}u=i[d-1]}return void 0===u?"":u}))}}));var np=Y,rp=at("iterator"),ip=!np((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[rp]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),ap=me,sp=Y,op=Lr,cp=sr,up=Gt,dp=ie,lp=te,hp=Object.assign,pp=Object.defineProperty,fp=!hp||sp((function(){if(ap&&1!==hp({b:1},hp(pp({},"a",{enumerable:!0,get:function(){pp(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=hp({},e)[n]||op(hp({},t)).join("")!=r}))?function(e,t){for(var n=dp(e),r=arguments.length,i=1,a=cp.f,s=up.f;r>i;)for(var o,c=lp(arguments[i++]),u=a?op(c).concat(a(c)):op(c),d=u.length,l=0;d>l;)o=u[l++],ap&&!s.call(c,o)||(n[o]=c[o]);return n}:hp,mp=/[^\0-\u007E]/,vp=/[.\u3002\uFF0E\uFF61]/g,gp="Overflow: input needs wider integers to process",yp=Math.floor,bp=String.fromCharCode,_p=function(e){return e+22+75*(e<26)},wp=function(e,t,n){var r=0;for(e=n?yp(e/700):e>>1,e+=yp(e/t);e>455;r+=36)e=yp(e/35);return yp(r+36*e/(e+38))},Ap=function(e){var t,n,r=[],i=(e=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var a=e.charCodeAt(n++);56320==(64512&a)?t.push(((1023&i)<<10)+(1023&a)+65536):(t.push(i),n--)}else t.push(i)}return t}(e)).length,a=128,s=0,o=72;for(t=0;t<e.length;t++)(n=e[t])<128&&r.push(bp(n));var c=r.length,u=c;for(c&&r.push("-");u<i;){var d=2147483647;for(t=0;t<e.length;t++)(n=e[t])>=a&&n<d&&(d=n);var l=u+1;if(d-a>yp((2147483647-s)/l))throw RangeError(gp);for(s+=(d-a)*l,a=d,t=0;t<e.length;t++){if((n=e[t])<a&&++s>2147483647)throw RangeError(gp);if(n==a){for(var h=s,p=36;;p+=36){var f=p<=o?1:p>=o+26?26:p-o;if(h<f)break;var m=h-f,v=36-f;r.push(bp(_p(f+m%v))),h=yp(m/v)}r.push(bp(_p(h))),o=wp(s,l,u==c),s=0,++u}}++s,++a}return r.join("")},kp=Ee,Ep=Os,xp=Cr,Sp=qn,Rp=ip,Dp=en.exports,Tp=Mc,Ip=vi,Cp=wo,Op=Dn,Pp=Fc,Lp=Ve,Up=Q,Mp=Ds,jp=Ee,Bp=le,Gp=ei,Np=Oe,qp=function(e){var t=Ep(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return kp(t.call(e))},Fp=Os,Vp=at,Wp=Sp("fetch"),Kp=Sp("Headers"),Hp=Vp("iterator"),zp=Op.set,$p=Op.getterFor("URLSearchParams"),Qp=Op.getterFor("URLSearchParamsIterator"),Yp=/\+/g,Jp=Array(4),Xp=function(e){return Jp[e-1]||(Jp[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},Zp=function(e){try{return decodeURIComponent(e)}catch(t){return e}},ef=function(e){var t=e.replace(Yp," "),n=4;try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace(Xp(n--),Zp);return t}},tf=/[!'()~]|%20/g,nf={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},rf=function(e){return nf[e]},af=function(e){return encodeURIComponent(e).replace(tf,rf)},sf=function(e,t){if(t)for(var n,r,i=t.split("&"),a=0;a<i.length;)(n=i[a++]).length&&(r=n.split("="),e.push({key:ef(r.shift()),value:ef(r.join("="))}))},of=function(e){this.entries.length=0,sf(this.entries,e)},cf=function(e,t){if(e<t)throw TypeError("Not enough arguments")},uf=Cp((function(e,t){zp(this,{type:"URLSearchParamsIterator",iterator:qp($p(e).entries),kind:t})}),"Iterator",(function(){var e=Qp(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),df=function(){Pp(this,df,"URLSearchParams");var e,t,n,r,i,a,s,o,c,u=arguments.length>0?arguments[0]:void 0,d=this,l=[];if(zp(d,{type:"URLSearchParams",entries:l,updateURL:function(){},updateSearchParams:of}),void 0!==u)if(Bp(u))if("function"==typeof(e=Fp(u)))for(n=(t=e.call(u)).next;!(r=n.call(t)).done;){if((s=(a=(i=qp(jp(r.value))).next).call(i)).done||(o=a.call(i)).done||!a.call(i).done)throw TypeError("Expected sequence with length 2");l.push({key:s.value+"",value:o.value+""})}else for(c in u)Lp(u,c)&&l.push({key:c,value:u[c]+""});else sf(l,"string"==typeof u?"?"===u.charAt(0)?u.slice(1):u:u+"")},lf=df.prototype;Tp(lf,{append:function(e,t){cf(arguments.length,2);var n=$p(this);n.entries.push({key:e+"",value:t+""}),n.updateURL()},delete:function(e){cf(arguments.length,1);for(var t=$p(this),n=t.entries,r=e+"",i=0;i<n.length;)n[i].key===r?n.splice(i,1):i++;t.updateURL()},get:function(e){cf(arguments.length,1);for(var t=$p(this).entries,n=e+"",r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){cf(arguments.length,1);for(var t=$p(this).entries,n=e+"",r=[],i=0;i<t.length;i++)t[i].key===n&&r.push(t[i].value);return r},has:function(e){cf(arguments.length,1);for(var t=$p(this).entries,n=e+"",r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){cf(arguments.length,1);for(var n,r=$p(this),i=r.entries,a=!1,s=e+"",o=t+"",c=0;c<i.length;c++)(n=i[c]).key===s&&(a?i.splice(c--,1):(a=!0,n.value=o));a||i.push({key:s,value:o}),r.updateURL()},sort:function(){var e,t,n,r=$p(this),i=r.entries,a=i.slice();for(i.length=0,n=0;n<a.length;n++){for(e=a[n],t=0;t<n;t++)if(i[t].key>e.key){i.splice(t,0,e);break}t===n&&i.push(e)}r.updateURL()},forEach:function(e){for(var t,n=$p(this).entries,r=Up(e,arguments.length>1?arguments[1]:void 0,3),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new uf(this,"keys")},values:function(){return new uf(this,"values")},entries:function(){return new uf(this,"entries")}},{enumerable:!0}),Dp(lf,Hp,lf.entries),Dp(lf,"toString",(function(){for(var e,t=$p(this).entries,n=[],r=0;r<t.length;)e=t[r++],n.push(af(e.key)+"="+af(e.value));return n.join("&")}),{enumerable:!0}),Ip(df,"URLSearchParams"),xp({global:!0,forced:!Rp},{URLSearchParams:df}),Rp||"function"!=typeof Wp||"function"!=typeof Kp||xp({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,n,r,i=[e];return arguments.length>1&&(Bp(t=arguments[1])&&(n=t.body,"URLSearchParams"===Mp(n)&&((r=t.headers?new Kp(t.headers):new Kp).has("content-type")||r.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=Gp(t,{body:Np(0,String(n)),headers:Np(0,r)}))),i.push(t)),Wp.apply(this,i)}});var hf,pf={URLSearchParams:df,getState:$p},ff=Cr,mf=me,vf=ip,gf=K,yf=Fr,bf=en.exports,_f=Fc,wf=Ve,Af=fp,kf=Ns,Ef=eo.codeAt,xf=function(e){var t,n,r=[],i=e.toLowerCase().replace(vp,".").split(".");for(t=0;t<i.length;t++)n=i[t],r.push(mp.test(n)?"xn--"+Ap(n):n);return r.join(".")},Sf=vi,Rf=pf,Df=Dn,Tf=gf.URL,If=Rf.URLSearchParams,Cf=Rf.getState,Of=Df.set,Pf=Df.getterFor("URL"),Lf=Math.floor,Uf=Math.pow,Mf=/[A-Za-z]/,jf=/[\d+-.A-Za-z]/,Bf=/\d/,Gf=/^(0x|0X)/,Nf=/^[0-7]+$/,qf=/^\d+$/,Ff=/^[\dA-Fa-f]+$/,Vf=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,Wf=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,Kf=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,Hf=/[\u0009\u000A\u000D]/g,zf=function(e,t){var n,r,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return"Invalid host";if(!(n=Qf(t.slice(1,-1))))return"Invalid host";e.host=n}else if(rm(e)){if(t=xf(t),Vf.test(t))return"Invalid host";if(null===(n=$f(t)))return"Invalid host";e.host=n}else{if(Wf.test(t))return"Invalid host";for(n="",r=kf(t),i=0;i<r.length;i++)n+=tm(r[i],Jf);e.host=n}},$f=function(e){var t,n,r,i,a,s,o,c=e.split(".");if(c.length&&""==c[c.length-1]&&c.pop(),(t=c.length)>4)return e;for(n=[],r=0;r<t;r++){if(""==(i=c[r]))return e;if(a=10,i.length>1&&"0"==i.charAt(0)&&(a=Gf.test(i)?16:8,i=i.slice(8==a?1:2)),""===i)s=0;else{if(!(10==a?qf:8==a?Nf:Ff).test(i))return e;s=parseInt(i,a)}n.push(s)}for(r=0;r<t;r++)if(s=n[r],r==t-1){if(s>=Uf(256,5-t))return null}else if(s>255)return null;for(o=n.pop(),r=0;r<n.length;r++)o+=n[r]*Uf(256,3-r);return o},Qf=function(e){var t,n,r,i,a,s,o,c=[0,0,0,0,0,0,0,0],u=0,d=null,l=0,h=function(){return e.charAt(l)};if(":"==h()){if(":"!=e.charAt(1))return;l+=2,d=++u}for(;h();){if(8==u)return;if(":"!=h()){for(t=n=0;n<4&&Ff.test(h());)t=16*t+parseInt(h(),16),l++,n++;if("."==h()){if(0==n)return;if(l-=n,u>6)return;for(r=0;h();){if(i=null,r>0){if(!("."==h()&&r<4))return;l++}if(!Bf.test(h()))return;for(;Bf.test(h());){if(a=parseInt(h(),10),null===i)i=a;else{if(0==i)return;i=10*i+a}if(i>255)return;l++}c[u]=256*c[u]+i,2!=++r&&4!=r||u++}if(4!=r)return;break}if(":"==h()){if(l++,!h())return}else if(h())return;c[u++]=t}else{if(null!==d)return;l++,d=++u}}if(null!==d)for(s=u-d,u=7;0!=u&&s>0;)o=c[u],c[u--]=c[d+s-1],c[d+--s]=o;else if(8!=u)return;return c},Yf=function(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=Lf(e/256);return t.join(".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,a=0;a<8;a++)0!==e[a]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=a),++i);return i>n&&(t=r,n=i),t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},Jf={},Xf=Af({},Jf,{" ":1,'"':1,"<":1,">":1,"`":1}),Zf=Af({},Xf,{"#":1,"?":1,"{":1,"}":1}),em=Af({},Zf,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),tm=function(e,t){var n=Ef(e,0);return n>32&&n<127&&!wf(t,e)?e:encodeURIComponent(e)},nm={ftp:21,file:null,http:80,https:443,ws:80,wss:443},rm=function(e){return wf(nm,e.scheme)},im=function(e){return""!=e.username||""!=e.password},am=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},sm=function(e,t){var n;return 2==e.length&&Mf.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},om=function(e){var t;return e.length>1&&sm(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},cm=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&sm(t[0],!0)||t.pop()},um=function(e){return"."===e||"%2e"===e.toLowerCase()},dm={},lm={},hm={},pm={},fm={},mm={},vm={},gm={},ym={},bm={},_m={},wm={},Am={},km={},Em={},xm={},Sm={},Rm={},Dm={},Tm={},Im={},Cm=function(e,t,n,r){var i,a,s,o,c,u=n||dm,d=0,l="",h=!1,p=!1,f=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(Kf,"")),t=t.replace(Hf,""),i=kf(t);d<=i.length;){switch(a=i[d],u){case dm:if(!a||!Mf.test(a)){if(n)return"Invalid scheme";u=hm;continue}l+=a.toLowerCase(),u=lm;break;case lm:if(a&&(jf.test(a)||"+"==a||"-"==a||"."==a))l+=a.toLowerCase();else{if(":"!=a){if(n)return"Invalid scheme";l="",u=hm,d=0;continue}if(n&&(rm(e)!=wf(nm,l)||"file"==l&&(im(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=l,n)return void(rm(e)&&nm[e.scheme]==e.port&&(e.port=null));l="","file"==e.scheme?u=km:rm(e)&&r&&r.scheme==e.scheme?u=pm:rm(e)?u=gm:"/"==i[d+1]?(u=fm,d++):(e.cannotBeABaseURL=!0,e.path.push(""),u=Dm)}break;case hm:if(!r||r.cannotBeABaseURL&&"#"!=a)return"Invalid scheme";if(r.cannotBeABaseURL&&"#"==a){e.scheme=r.scheme,e.path=r.path.slice(),e.query=r.query,e.fragment="",e.cannotBeABaseURL=!0,u=Im;break}u="file"==r.scheme?km:mm;continue;case pm:if("/"!=a||"/"!=i[d+1]){u=mm;continue}u=ym,d++;break;case fm:if("/"==a){u=bm;break}u=Rm;continue;case mm:if(e.scheme=r.scheme,a==hf)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query;else if("/"==a||"\\"==a&&rm(e))u=vm;else if("?"==a)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query="",u=Tm;else{if("#"!=a){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.path.pop(),u=Rm;continue}e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query,e.fragment="",u=Im}break;case vm:if(!rm(e)||"/"!=a&&"\\"!=a){if("/"!=a){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,u=Rm;continue}u=bm}else u=ym;break;case gm:if(u=ym,"/"!=a||"/"!=l.charAt(d+1))continue;d++;break;case ym:if("/"!=a&&"\\"!=a){u=bm;continue}break;case bm:if("@"==a){h&&(l="%40"+l),h=!0,s=kf(l);for(var m=0;m<s.length;m++){var v=s[m];if(":"!=v||f){var g=tm(v,em);f?e.password+=g:e.username+=g}else f=!0}l=""}else if(a==hf||"/"==a||"?"==a||"#"==a||"\\"==a&&rm(e)){if(h&&""==l)return"Invalid authority";d-=kf(l).length+1,l="",u=_m}else l+=a;break;case _m:case wm:if(n&&"file"==e.scheme){u=xm;continue}if(":"!=a||p){if(a==hf||"/"==a||"?"==a||"#"==a||"\\"==a&&rm(e)){if(rm(e)&&""==l)return"Invalid host";if(n&&""==l&&(im(e)||null!==e.port))return;if(o=zf(e,l))return o;if(l="",u=Sm,n)return;continue}"["==a?p=!0:"]"==a&&(p=!1),l+=a}else{if(""==l)return"Invalid host";if(o=zf(e,l))return o;if(l="",u=Am,n==wm)return}break;case Am:if(!Bf.test(a)){if(a==hf||"/"==a||"?"==a||"#"==a||"\\"==a&&rm(e)||n){if(""!=l){var y=parseInt(l,10);if(y>65535)return"Invalid port";e.port=rm(e)&&y===nm[e.scheme]?null:y,l=""}if(n)return;u=Sm;continue}return"Invalid port"}l+=a;break;case km:if(e.scheme="file","/"==a||"\\"==a)u=Em;else{if(!r||"file"!=r.scheme){u=Rm;continue}if(a==hf)e.host=r.host,e.path=r.path.slice(),e.query=r.query;else if("?"==a)e.host=r.host,e.path=r.path.slice(),e.query="",u=Tm;else{if("#"!=a){om(i.slice(d).join(""))||(e.host=r.host,e.path=r.path.slice(),cm(e)),u=Rm;continue}e.host=r.host,e.path=r.path.slice(),e.query=r.query,e.fragment="",u=Im}}break;case Em:if("/"==a||"\\"==a){u=xm;break}r&&"file"==r.scheme&&!om(i.slice(d).join(""))&&(sm(r.path[0],!0)?e.path.push(r.path[0]):e.host=r.host),u=Rm;continue;case xm:if(a==hf||"/"==a||"\\"==a||"?"==a||"#"==a){if(!n&&sm(l))u=Rm;else if(""==l){if(e.host="",n)return;u=Sm}else{if(o=zf(e,l))return o;if("localhost"==e.host&&(e.host=""),n)return;l="",u=Sm}continue}l+=a;break;case Sm:if(rm(e)){if(u=Rm,"/"!=a&&"\\"!=a)continue}else if(n||"?"!=a)if(n||"#"!=a){if(a!=hf&&(u=Rm,"/"!=a))continue}else e.fragment="",u=Im;else e.query="",u=Tm;break;case Rm:if(a==hf||"/"==a||"\\"==a&&rm(e)||!n&&("?"==a||"#"==a)){if(".."===(c=(c=l).toLowerCase())||"%2e."===c||".%2e"===c||"%2e%2e"===c?(cm(e),"/"==a||"\\"==a&&rm(e)||e.path.push("")):um(l)?"/"==a||"\\"==a&&rm(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&sm(l)&&(e.host&&(e.host=""),l=l.charAt(0)+":"),e.path.push(l)),l="","file"==e.scheme&&(a==hf||"?"==a||"#"==a))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==a?(e.query="",u=Tm):"#"==a&&(e.fragment="",u=Im)}else l+=tm(a,Zf);break;case Dm:"?"==a?(e.query="",u=Tm):"#"==a?(e.fragment="",u=Im):a!=hf&&(e.path[0]+=tm(a,Jf));break;case Tm:n||"#"!=a?a!=hf&&("'"==a&&rm(e)?e.query+="%27":e.query+="#"==a?"%23":tm(a,Jf)):(e.fragment="",u=Im);break;case Im:a!=hf&&(e.fragment+=tm(a,Xf))}d++}},Om=function(e){var t,n,r=_f(this,Om,"URL"),i=arguments.length>1?arguments[1]:void 0,a=String(e),s=Of(r,{type:"URL"});if(void 0!==i)if(i instanceof Om)t=Pf(i);else if(n=Cm(t={},String(i)))throw TypeError(n);if(n=Cm(s,a,null,t))throw TypeError(n);var o=s.searchParams=new If,c=Cf(o);c.updateSearchParams(s.query),c.updateURL=function(){s.query=String(o)||null},mf||(r.href=Lm.call(r),r.origin=Um.call(r),r.protocol=Mm.call(r),r.username=jm.call(r),r.password=Bm.call(r),r.host=Gm.call(r),r.hostname=Nm.call(r),r.port=qm.call(r),r.pathname=Fm.call(r),r.search=Vm.call(r),r.searchParams=Wm.call(r),r.hash=Km.call(r))},Pm=Om.prototype,Lm=function(){var e=Pf(this),t=e.scheme,n=e.username,r=e.password,i=e.host,a=e.port,s=e.path,o=e.query,c=e.fragment,u=t+":";return null!==i?(u+="//",im(e)&&(u+=n+(r?":"+r:"")+"@"),u+=Yf(i),null!==a&&(u+=":"+a)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?s[0]:s.length?"/"+s.join("/"):"",null!==o&&(u+="?"+o),null!==c&&(u+="#"+c),u},Um=function(){var e=Pf(this),t=e.scheme,n=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&rm(e)?t+"://"+Yf(e.host)+(null!==n?":"+n:""):"null"},Mm=function(){return Pf(this).scheme+":"},jm=function(){return Pf(this).username},Bm=function(){return Pf(this).password},Gm=function(){var e=Pf(this),t=e.host,n=e.port;return null===t?"":null===n?Yf(t):Yf(t)+":"+n},Nm=function(){var e=Pf(this).host;return null===e?"":Yf(e)},qm=function(){var e=Pf(this).port;return null===e?"":String(e)},Fm=function(){var e=Pf(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Vm=function(){var e=Pf(this).query;return e?"?"+e:""},Wm=function(){return Pf(this).searchParams},Km=function(){var e=Pf(this).fragment;return e?"#"+e:""},Hm=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(mf&&yf(Pm,{href:Hm(Lm,(function(e){var t=Pf(this),n=String(e),r=Cm(t,n);if(r)throw TypeError(r);Cf(t.searchParams).updateSearchParams(t.query)})),origin:Hm(Um),protocol:Hm(Mm,(function(e){var t=Pf(this);Cm(t,String(e)+":",dm)})),username:Hm(jm,(function(e){var t=Pf(this),n=kf(String(e));if(!am(t)){t.username="";for(var r=0;r<n.length;r++)t.username+=tm(n[r],em)}})),password:Hm(Bm,(function(e){var t=Pf(this),n=kf(String(e));if(!am(t)){t.password="";for(var r=0;r<n.length;r++)t.password+=tm(n[r],em)}})),host:Hm(Gm,(function(e){var t=Pf(this);t.cannotBeABaseURL||Cm(t,String(e),_m)})),hostname:Hm(Nm,(function(e){var t=Pf(this);t.cannotBeABaseURL||Cm(t,String(e),wm)})),port:Hm(qm,(function(e){var t=Pf(this);am(t)||(""==(e=String(e))?t.port=null:Cm(t,e,Am))})),pathname:Hm(Fm,(function(e){var t=Pf(this);t.cannotBeABaseURL||(t.path=[],Cm(t,e+"",Sm))})),search:Hm(Vm,(function(e){var t=Pf(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",Cm(t,e,Tm)),Cf(t.searchParams).updateSearchParams(t.query)})),searchParams:Hm(Wm),hash:Hm(Km,(function(e){var t=Pf(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",Cm(t,e,Im)):t.fragment=null}))}),bf(Pm,"toJSON",(function(){return Lm.call(this)}),{enumerable:!0}),bf(Pm,"toString",(function(){return Lm.call(this)}),{enumerable:!0}),Tf){var zm=Tf.createObjectURL,$m=Tf.revokeObjectURL;zm&&bf(Om,"createObjectURL",(function(e){return zm.apply(Tf,arguments)})),$m&&bf(Om,"revokeObjectURL",(function(e){return $m.apply(Tf,arguments)}))}Sf(Om,"URL"),ff({global:!0,forced:!vf,sham:!mf},{URL:Om});var Qm=Jn.includes,Ym=cc;Cr({target:"Array",proto:!0,forced:!St("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return Qm(this,e,arguments.length>1?arguments[1]:void 0)}}),Ym("includes");var Jm=Ll,Xm=ne;Cr({target:"String",proto:!0,forced:!Ml("includes")},{includes:function(e){return!!~String(Xm(this)).indexOf(Jm(e),arguments.length>1?arguments[1]:void 0)}});var Zm=xh,ev=Ol,tv=Ee,nv=ne,rv=ru,iv=Fh,av=de,sv=Th,ov=ph,cv=Y,uv=[].push,dv=Math.min,lv=!cv((function(){return!RegExp(4294967295,"y")}));function hv(e){var n=this,r={},i=(null==e?void 0:e._ancestor_origins)||window.location.ancestorOrigins,a=(null==e?void 0:e.self_url)||window.location.href,s=(null==e?void 0:e.self_origin)||window.location.origin,o=(null==e?void 0:e.referrer_url)||document.referrer;function c(e){return L(r,e)}function u(e,t){return U(r,e,t)}function d(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new I(e,t)}catch(e){console.log(e)}}function l(){for(var t=(null==e?void 0:e.urls)||[a,o],n=0;n<t.length;n++){var r,i=d(t[n]);if(i){var s=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(s&&(s=decodeURIComponent(s),O.isURL(s)))return s}}}return function(){var e;t(this,n),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){u("depth.error",e.message)}u("depth.value",e)}(),function(){var e=i,t=r.depth.value,n=s;if(u("top.domain.from","fallback"),e&&e.length>0)n=e[e.length-1],u("top.domain.from","origins");else if(0===t)n=s,u("top.domain.from","self-top");else if(1===t){var a=d(o);a&&(n=a.origin,u("top.domain.from","referrer"))}u("top.domain.value",n.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=l();if(e)if(P(e))u("partner.domain.value",e),u("partner.domain.from","partner-domain");else{var t=d(e,!1);if(t)u("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),u("partner.domain.from","partner-url");else u("partner.domain.value",r.top.domain.value),u("partner.domain.from","partner-fallback")}else u("partner.domain.value",r.top.domain.value),u("partner.domain.from","fallback")}(),e=l(),0===r.depth.value?(u("partner.url.value",a),u("partner.url.from","self-top")):e?P(e)?(u("partner.url.value",a),u("partner.url.from","partner-domain")):(u("partner.url.value",e),u("partner.url.from","partner-url")):(u("partner.url.value",o),u("partner.url.from","fallback"))}.bind(this)(),{get:c,print:function(e){console.log(c(e))}}}Zm("split",2,(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=String(nv(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!ev(e))return t.call(r,e,i);for(var a,s,o,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,l=new RegExp(e.source,u+"g");(a=ov.call(l,r))&&!((s=l.lastIndex)>d&&(c.push(r.slice(d,a.index)),a.length>1&&a.index<r.length&&uv.apply(c,a.slice(1)),o=a[0].length,d=s,c.length>=i));)l.lastIndex===a.index&&l.lastIndex++;return d===r.length?!o&&l.test("")||c.push(""):c.push(r.slice(d)),c.length>i?c.slice(0,i):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var i=nv(this),a=null==t?void 0:t[e];return void 0!==a?a.call(t,i,n):r.call(String(i),t,n)},function(e,i){var a=n(r,e,this,i,r!==t);if(a.done)return a.value;var s=tv(e),o=String(this),c=rv(s,RegExp),u=s.unicode,d=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(lv?"y":"g"),l=new c(lv?s:"^(?:"+s.source+")",d),h=void 0===i?4294967295:i>>>0;if(0===h)return[];if(0===o.length)return null===sv(l,o)?[o]:[];for(var p=0,f=0,m=[];f<o.length;){l.lastIndex=lv?f:0;var v,g=sv(l,lv?o:o.slice(f));if(null===g||(v=dv(av(l.lastIndex+(lv?0:f)),o.length))===p)f=iv(o,f,u);else{if(m.push(o.slice(p,f)),m.length===h)return m;for(var y=1;y<=g.length-1;y++)if(m.push(g[y]),m.length===h)return m;f=p=v}}return m.push(o.slice(p)),m}]}),!lv);var pv={name:"@bygd/gd-sdk-pes",version:"1.28.13",files:["dist/*"],scripts:{build:"NODE_ENV=production rollup --config",watch:"rollup --config --watch --sourcemap --environment DEVELOPMENT","deploy-base":"npm install && npm run build && npm publish --access public",deploy:"npm run deploy-base && gdtool pm-upload"},repository:{type:"git",url:"git@gitlab.azerdev.com:gamedistribution/gd-sdk-pes.git"},author:"",license:"ISC",devDependencies:{"@babel/core":"^7.14.6","@babel/plugin-transform-runtime":"^7.14.5","@babel/preset-env":"^7.14.7","@rollup/plugin-babel":"^5.2.3","@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-replace":"^3.0.0",postcss:"^8.3.5",rollup:"^2.52.8","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-browsersync":"^1.3.3","rollup-plugin-delete":"^2.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-postcss":"^4.0.0","rollup-plugin-terser":"^7.0.2"},dependencies:{"@babel/runtime":"^7.14.6","@bygd/gd-sdk-era":"^0.3.6",axios:"^0.26.1","can-autoplay":"^3.0.2",events:"^3.3.0","get-value":"^3.0.1","is-plain-object":"^5.0.0","is-valid-domain":"^0.1.2","js-base64":"^3.6.1","leaderboard-lib":"0.1.11","lodash.clonedeep":"^4.5.0","lodash.merge":"^4.6.2",querystringify:"^2.2.0","set-value":"^4.1.0","url-parse":"^1.4.7",uuid:"^8.3.2",validator:"^13.6.0"}},fv="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==fv&&fv,mv="URLSearchParams"in fv,vv="Symbol"in fv&&"iterator"in Symbol,gv="FileReader"in fv&&"Blob"in fv&&function(){try{return new Blob,!0}catch(e){return!1}}(),yv="FormData"in fv,bv="ArrayBuffer"in fv;if(bv)var _v=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],wv=ArrayBuffer.isView||function(e){return e&&_v.indexOf(Object.prototype.toString.call(e))>-1};function Av(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function kv(e){return"string"!=typeof e&&(e=String(e)),e}function Ev(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return vv&&(t[Symbol.iterator]=function(){return t}),t}function xv(e){this.map={},e instanceof xv?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 Sv(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Rv(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function Dv(e){var t=new FileReader,n=Rv(t);return t.readAsArrayBuffer(e),n}function Tv(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Iv(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:gv&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:yv&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:mv&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():bv&&gv&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=Tv(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):bv&&(ArrayBuffer.prototype.isPrototypeOf(e)||wv(e))?this._bodyArrayBuffer=Tv(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):mv&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},gv&&(this.blob=function(){var e=Sv(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=Sv(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(Dv)}),this.text=function(){var e=Sv(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=Rv(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)},yv&&(this.formData=function(){return this.text().then(Pv)}),this.json=function(){return this.text().then(JSON.parse)},this}xv.prototype.append=function(e,t){e=Av(e),t=kv(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},xv.prototype.delete=function(e){delete this.map[Av(e)]},xv.prototype.get=function(e){return e=Av(e),this.has(e)?this.map[e]:null},xv.prototype.has=function(e){return this.map.hasOwnProperty(Av(e))},xv.prototype.set=function(e,t){this.map[Av(e)]=kv(t)},xv.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},xv.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),Ev(e)},xv.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Ev(e)},xv.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),Ev(e)},vv&&(xv.prototype[Symbol.iterator]=xv.prototype.entries);var Cv=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Ov(e,t){if(!(this instanceof Ov))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,i=(t=t||{}).body;if(e instanceof Ov){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new xv(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=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 xv(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),Cv.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var a=/([?&])_=[^&]*/;if(a.test(this.url))this.url=this.url.replace(a,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Pv(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 Lv(e,t){if(!(this instanceof Lv))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"",this.headers=new xv(t.headers),this.url=t.url||"",this._initBody(e)}Ov.prototype.clone=function(){return new Ov(this,{body:this._bodyInit})},Iv.call(Ov.prototype),Iv.call(Lv.prototype),Lv.prototype.clone=function(){return new Lv(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new xv(this.headers),url:this.url})},Lv.error=function(){var e=new Lv(null,{status:0,statusText:""});return e.type="error",e};var Uv=[301,302,303,307,308];Lv.redirect=function(e,t){if(-1===Uv.indexOf(t))throw new RangeError("Invalid status code");return new Lv(null,{status:t,headers:{location:e}})};var Mv=fv.DOMException;try{new Mv}catch(e){(Mv=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),Mv.prototype.constructor=Mv}function jv(e,t){return new Promise((function(n,r){var i=new Ov(e,t);if(i.signal&&i.signal.aborted)return r(new Mv("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 xv,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).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 Lv(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 Mv("Aborted","AbortError"))}),0)},a.open(i.method,function(e){try{return""===e&&fv.location.href?fv.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&&(gv?a.responseType="blob":bv&&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 xv?i.headers.forEach((function(e,t){a.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){a.setRequestHeader(e,kv(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)}))}jv.polyfill=!0,fv.fetch||(fv.fetch=jv,fv.Headers=xv,fv.Request=Ov,fv.Response=Lv);var Bv,Gv,Nv,qv,Fv=Array.isArray,Vv=Object.prototype.toString,Wv=Fv||function(e){return!!e&&"[object Array]"==Vv.call(e)},Kv=function(e){var t=Hv("object"===n(e)?e:u(e));return t&&t.version?pv.version>=t.version?t:void 0:t},Hv=function(e){var n=this;if(!Wv(e)||0===e.length)return e;if(1===e.length)return e[0];var r=0;e.forEach(function(e){t(this,n),e.weight=e.weight||1,r+=e.weight}.bind(this));var i=Math.floor(Math.random()*Math.floor(r));r=0;for(var a=0;a<e.length;a++){var s=e[a];if(i<(r+=s.weight))return s}},zv=function(e){var n=this;if(!Bv){var r={gameId:e.gameId,hours:(new Date).getHours(),topDomain:Gh.topDomain,domain:Gh.parentDomain,referrer:Gh.parentURL,depth:s(),version:pv.version,byloader:Gh.isTokenGameURL,isTokenGameURL:Gh.isTokenGameURL,isMasterGameURL:Gh.isMasterGameURL,isExtHostedGameURL:Gh.isExtHostedGameURL,byloaderVersion:Gh.version,tracking:Nh.userDeclinedTracking,whitelabel:Nh.whitelabelPartner,platform:d()};console.log("MESSAGE ROUTER ARGS",r),Bv=new l(r)}return Bv||{send:function(){t(this,n)}.bind(this)}},$v=[],Qv=function(e){$v.push(e)},Yv=function(){var t=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Nv){e.next=4;break}return e.next=3,Jv(qv);case 3:Nv=e.sent;case 4:return e.abrupt("return",Nv);case 5:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),Jv=function(e){var n=this;Gv.send("gdfw.loading",{message:"loading"}),$v=[],Qv("1"),Qv("2");var r=new hv;Qv("3");var i=r.get("partner.domain.value");Qv("4");var a=function(){return t(this,n),{gameId:e.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}.bind(this);Qv("5");var s=function(){t(this,n);var r=o(),a=r?"&mode=".concat(r):"";return"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(i).concat(a,"&v=").concat(pv.version,"&localTime=").concat((new Date).getHours())}.bind(this);Qv("6");var o=function(){var e=this;t(this,n);var r=new Proxy(new URLSearchParams(window.location.search),{get:function(n,r){return t(this,e),n.get(r)}.bind(this)});return!r.gd_mode&&window.location.search.includes("gd_mode")?window.location.search.split("gd_mode=")[1]:r.gd_mode}.bind(this);return Qv("7"),new Promise(function(e){var r=this;if(t(this,n),Nv)e(Nv);else{Qv("7.1");var i=a();try{Qv("7.2");var o=s();Qv("7.3"),fetch(o).then(function(e){return t(this,r),Qv("7.4"),e.json()}.bind(this)).then(function(n){var a=this;if(t(this,r),Qv("7.5"),n.success){var s,o,c,u,d=n.result.game;Qv("7.6");var l={gameId:d.gameMd5,slug:d.slug,pname:d.pname,dname:d.dname,status:d.status,description:d.description,enableAds:!0===d.enableAds||!0===(null===(s=d.enableAds)||void 0===s?void 0:s.enabled),preroll:d.preRoll,midroll:6e4*d.timeAds,rewardedAds:d.rewardedAds,title:d.title,tags:d.tags,category:d.category,assets:d.assets,disp_2nd_prer:d.disp_2nd_prer,ctry_vst:d.ctry_vst,ctry:d.ctry,crtv:d.crtv,dmain:d.dmain,__t4r:d.__t4r||{},block_exts:Kv(d.push_cuda),bloc_gard:Kv(d.bloc_gard),cookie:Kv(d.cookie),gdpr:Kv(d.gdpr),diagnostic:Kv(d.diagnostic),cmp:Kv(d.cmp),gft:Kv(d.gft)||{},sdk:Kv(d.sdk)||{},sdkfw:Kv(d.sdkfw)||{},loader:Kv(d.loader)||{},splash:Kv(d.splash)||{},promo:Kv(d.promo)||{},dAds:Kv(d.dads)||{},pAds:Kv(d.pads)||{},mAds:Kv(d.mads)||{},rAds:Kv(d.rads)||{},lp:Kv(d.lp)||{},extsc:Kv(d.extsc)||{},evnts:Kv(d.evnts)||{},dp:Kv(d.dp)||{}};Qv("7.7");var p=h(M(i),l);Qv("7.8"),p.afg_disabled=!1===(null===(o=p.sdk)||void 0===o||null===(c=o.afg)||void 0===c?void 0:c.enabled),function(){t(this,a)}.bind(this),Qv("7.9"),null!==(u=p.pAds)&&void 0!==u&&u.enabled&&(p.preroll=!0),Qv("7.10"),Gv.send("gdfw.success",{message:"success"}),e(p)}else{i.failed=!0;var f=$v[$v.length-1];Gv.send("gdfw.err",{message:"".concat(f,": json error")}),e(i)}}.bind(this)).catch(function(n){t(this,r);var a=$v[$v.length-1];Gv.send("gdfw.err",{message:"".concat(a,": ").concat(n.message?n.message:n)}),i.failed=!0,e(i)}.bind(this))}catch(t){var c=$v[$v.length-1];Gv.send("gdfw.err",{message:"".concat(c,": global ").concat(t.message?t.message:t)}),i.failed=!0,e(i)}}}.bind(this))},Xv=function(){var t=e(r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Yv();case 2:return n=e.sent,e.abrupt("return",!(null==n||null===(t=n.sdkfw)||void 0===t||!t.enabled));case 4:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),Zv=function(){var t=e(r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Yv();case 2:return n=e.sent,e.next=5,Xv();case 5:if(e.t0=e.sent,!e.t0){e.next=8;break}e.t0=!(null==n||null===(t=n.sdkfw)||void 0===t||!t.handshake);case 8:return e.abrupt("return",e.t0);case 9:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),eg=function(){var t=e(r.mark((function e(){var t,n,i,a,s,o,c,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Yv();case 2:return c=e.sent,u=!(null==c||null===(t=c.extsc)||void 0===t||!t.enabled),e.abrupt("return",{enabled:u,path:u?null==c||null===(n=c.extsc)||void 0===n?void 0:n.path:"",name:u?null==c||null===(i=c.extsc)||void 0===i?void 0:i.name:"",ref:u?null==c||null===(a=c.extsc)||void 0===a?void 0:a.ref:"",loadedFlag:u?null==c||null===(s=c.extsc)||void 0===s?void 0:s.loadedFlag:void 0,loadedFlagCheck:!!u&&!(null==c||null===(o=c.extsc)||void 0===o||!o.loadedFlagCheck)});case 5:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),tg=function(){var n=e(r.mark((function e(){var n,i,a,s,o,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,eg();case 2:if((n=e.sent).enabled){e.next=5;break}return e.abrupt("return");case 5:return i=n.path,a=n.name,s=n.ref,e.prev=6,o={},e.next=10,f(i,a,{error_prefix:"Blocked:",exists:function(){return t(this,c),!!s&&!!window[s]}.bind(this),attrs:o});case 10:e.next=16;break;case 12:e.prev=12,e.t0=e.catch(6),console.log("extsc: error on external partner script load",a,e.t0),p("DEVELOPER_ERROR",e.t0,"warning");case 16:case"end":return e.stop()}}),e,this,[[6,12]])})));return function(){return n.apply(this,arguments)}}(),ng=!1,rg=!1,ig=function(){return new Promise(function(){var n=e(r.mark((function e(n,i){var a,s,o,c,u,d=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ng){e.next=4;break}return e.abrupt("return",n(rg));case 4:ng=!0;case 5:return e.next=7,eg();case 7:if((a=e.sent).enabled){e.next=10;break}return e.abrupt("return",n(!1));case 10:if(s=a.loadedFlag,!(o=a.loadedFlagCheck)||s){e.next=13;break}return e.abrupt("return",n(!1));case 13:if(o){e.next=16;break}return rg=!0,e.abrupt("return",n(!0));case 16:c=!0,setTimeout(function(){t(this,d),c&&(c=!1,ng=!0,n(!1))}.bind(this),5e3),u=setInterval(function(){t(this,d),c&&o&&window[s]?(c=!1,ng=!0,rg=!0,clearInterval(u),n(!0)):c||clearInterval(u)}.bind(this),100);case 19:case"end":return e.stop()}}),e,this)})));return function(e,t){return n.apply(this,arguments)}}())},ag=function(e){var n=function(e){var n=this,r=function(e){return t(this,n),l("showAd",{adType:e})}.bind(this),i=function(e){return t(this,n),l("preloadAd",{adType:e})}.bind(this),a=function(e){return t(this,n),l("showDisplayAd",{options:e})}.bind(this),s=function(){return t(this,n),l("cancelAd")}.bind(this),o=function(){return t(this,n),l("openConsole")}.bind(this),c=function(){return t(this,n),l("showBanner")}.bind(this),u=function(){return t(this,n),l("session")}.bind(this),d=function(){t(this,n),console.log("_sendSDKReady")}.bind(this),l=function(e,r){var i=this;return t(this,n),r||(r={}),new Promise(function(n,a){t(this,i);try{var s={type:"gd-sdk",method:e,options:r};window.parent.postMessage(s,"https://html5.gamedistribution.com"),n()}catch(e){console.log("gd:adp:m:s:error",e),n()}}.bind(this))}.bind(this),h=function(){t(this,n),window.addEventListener("message",(function(e){var t=e.data;e.origin,e.source;var n=t.type,r=t.event;"gd-sdk-on-event"===n&&r&&f(r)}),!1)}.bind(this),p=function(){t(this,n),h(),l("init")}.bind(this),f=function(r){t(this,n),e.onEvent&&e.onEvent(r)}.bind(this);return{showBanner:c,showAd:r,preloadAd:i,showDisplayAd:a,cancelAd:s,openConsole:o,getSession:u,onEvent:f,init:p,_sendSDKReady:d}}(e);return n.init(),n},sg=function(){var e=this;return{isMasterGameURL:function(){t(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)}.bind(this),isTokenGameURL:function(){t(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i.test(location.href)}.bind(this),isExtHostedGameURL:function(){t(this,e);return/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i.test(location.href)}.bind(this)}},og=function(e){var n=this;return new Promise(function(r,i){var a=this;t(this,n);var s={type:"gd-sdk-frame-handshake-request"},o=!1;window.addEventListener("message",(function(e){var t=e.data,n=e.origin,i=e.source,a=t.type;if("gd-sdk-frame-handshake-request"===a){var s={type:"gd-sdk-frame-handshake-response"};i.postMessage(s,n)}else"gd-sdk-frame-handshake-response"===a&&(o=!0,r({origin:n,source:i}))})),e?r():(setTimeout(function(){t(this,a),o||r()}.bind(this),200),window.parent!==window?window.parent.postMessage(s,"*"):r())}.bind(this))},cg=function(){var t=e(r.mark((function e(){var t,n,i,a,s,o,c,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xv();case 2:return t=e.sent,n=!t,e.next=6,og(n);case 6:if(i=e.sent,t){e.next=9;break}return e.abrupt("return",!1);case 9:return a=sg(),s=a.isMasterGameURL,o=s(),e.next=13,Zv();case 13:return c=e.sent,u=!1,u=c?!o&&!!i:!o,e.abrupt("return",u);case 17:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),ug=me,dg=Lr,lg=Kt,hg=Gt.f,pg=function(e){return function(t){for(var n,r=lg(t),i=dg(r),a=i.length,s=0,o=[];a>s;)n=i[s++],ug&&!hg.call(r,n)||o.push(e?[n,r[n]]:r[n]);return o}},fg={entries:pg(!0),values:pg(!1)}.values;Cr({target:"Object",stat:!0},{values:function(e){return fg(e)}});var mg=Cr,vg=Lc,gg=Y,yg=qn,bg=ru,_g=td,wg=en.exports;mg({target:"Promise",proto:!0,real:!0,forced:!!vg&&gg((function(){vg.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=bg(this,yg("Promise")),n="function"==typeof e;return this.then(n?function(n){return _g(t,e()).then((function(){return n}))}:e,n?function(n){return _g(t,e()).then((function(){throw n}))}:e)}}),"function"!=typeof vg||vg.prototype.finally||wg(vg.prototype,"finally",yg("Promise").prototype.finally);var Ag=ne,kg="[\t\n\v\f\r \u2028\u2029\ufeff]",Eg=RegExp("^"+kg+kg+"*"),xg=RegExp(kg+kg+"*$"),Sg=function(e){return function(t){var n=String(Ag(t));return 1&e&&(n=n.replace(Eg,"")),2&e&&(n=n.replace(xg,"")),n}},Rg={start:Sg(1),end:Sg(2),trim:Sg(3)},Dg=Y,Tg="\t\n\v\f\r \u2028\u2029\ufeff",Ig=Rg.trim;Cr({target:"String",proto:!0,forced:function(e){return Dg((function(){return!!Tg[e]()||"
"!="
"[e]()||Tg[e].name!==e}))}("trim")},{trim:function(){return Ig(this)}});var Cg=le,Og=xo,Pg=me,Lg=K,Ug=kr,Mg=function(e,t,n){var r,i;return Og&&"function"==typeof(r=t.constructor)&&r!==n&&Cg(i=r.prototype)&&i!==n.prototype&&Og(e,i),e},jg=ve.f,Bg=Fn.f,Gg=Ol,Ng=zl,qg=nh,Fg=en.exports,Vg=Y,Wg=Dn.set,Kg=qc,Hg=at("match"),zg=Lg.RegExp,$g=zg.prototype,Qg=/a/g,Yg=/a/g,Jg=new zg(Qg)!==Qg,Xg=qg.UNSUPPORTED_Y;if(Pg&&Ug("RegExp",!Jg||Xg||Vg((function(){return Yg[Hg]=!1,zg(Qg)!=Qg||zg(Yg)==Yg||"/a/i"!=zg(Qg,"i")})))){for(var Zg=function(e,t){var n,r=this instanceof Zg,i=Gg(e),a=void 0===t;if(!r&&i&&e.constructor===Zg&&a)return e;Jg?i&&!a&&(e=e.source):e instanceof Zg&&(a&&(t=Ng.call(e)),e=e.source),Xg&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var s=Mg(Jg?new zg(e,t):zg(e,t),r?this:$g,Zg);return Xg&&n&&Wg(s,{sticky:n}),s},ey=function(e){e in Zg||jg(Zg,e,{configurable:!0,get:function(){return zg[e]},set:function(t){zg[e]=t}})},ty=Bg(zg),ny=0;ty.length>ny;)ey(ty[ny++]);$g.constructor=Zg,Zg.prototype=$g,Fg(Lg,"RegExp",Zg)}Kg("RegExp");var ry=Cr,iy=gt.find,ay=cc,sy=!0,oy=St("find");"find"in[]&&Array(1).find((function(){sy=!1})),ry({target:"Array",proto:!0,forced:sy||!oy},{find:function(e){return iy(this,e,arguments.length>1?arguments[1]:void 0)}}),ay("find");var cy=Cr,uy=Kt,dy=[].join,ly=te!=Object,hy=bt("join",",");cy({target:"Array",proto:!0,forced:ly||!hy},{join:function(e){return dy.call(uy(this),void 0===e?",":e)}});var py=Cr,fy=gt.map,my=St,vy=Ua("map"),gy=my("map");py({target:"Array",proto:!0,forced:!vy||!gy},{map:function(e){return fy(this,e,arguments.length>1?arguments[1]:void 0)}});var yy=fp;Cr({target:"Object",stat:!0,forced:Object.assign!==yy},{assign:yy});var by=function(){function e(t){R(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return T(e,[{key:"_getFakeCustomParams",value:function(){var e={_vid:["bla_bla1","bla_bla2","bla_bla3"],_1ld:["1ld_1","1ld_2","1ld_3","1ld_4"],_1lp:["1lp_1","1lp_2"]},t={};for(var n in e){var r=e[n];t[n]=r[Math.floor(Math.random()*r.length)]}return t}},{key:"checkCustomParams",value:function(){var e=this;try{var n={},r=this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled,i=new I(location.href,!0);for(var a in i.query)n[a]=i.query[a];return Object.keys(n).filter(function(n){var r=this;return t(this,e),this.customParamKeys.some(function(e){return t(this,r),e===n}.bind(this))}.bind(this)).length>0||r?(console.log("custom-params",n,r),n):void console.log("custom-params, none")}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),_y=function(){function e(t,n){R(this,e),this.adContainer=t,this.onResume=n}return T(e,[{key:"show",value:function(){this.adResumeButton.style.display="block",this.adResumeButtonOverlay.style.display="block"}},{key:"hide",value:function(){this.adResumeButton.style.display="none",this.adResumeButtonOverlay.style.display="none"}},{key:"add",value:function(){var e=this;try{var n=document.createElement("div");this.adResumeButton=n,n.id="gd__resume__button",n.setAttribute("title","Resume"),this.addStyles(),n.classList.add("gd__resume__button"),n.addEventListener("click",function(){t(this,e),this.onResume()}.bind(this)),this.adContainer.appendChild(n);var r=document.createElement("div");this.adResumeButtonOverlay=r,r.id="gd__resume__button__overlay",r.classList.add("gd__resume__button__overlay"),this.adContainer.appendChild(r)}catch(e){console.log("Resume button add error",e)}}},{key:"addStyles",value:function(){var e=document.body||document.getElementsByTagName("body")[0];this.addStylesheet("gd__resume__button__style",e,'\n .gd__resume__button{\n background-image: url("https://img.gamedistribution.com/play-black.svg");\n background-color:white; \n width: 120px;\n height: 120px;\n position: absolute;\n display: none;\n z-index: 2000;\n cursor: pointer;\n top: calc(50% - 60px);\n left: calc(50% - 60px);\n margin: 0;\n border-radius: 50%;\n border: 2px solid white;\n animation: play-button 1s ease-in-out infinite alternate;\n -webkit-animation: play-button 1s ease-in-out infinite alternate;\n }\n \n .gd__resume__button__overlay {\n position: fixed;\n display: none;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0,0,0,0.5);\n z-index: 1999;\n cursor: pointer;\n }\n @keyframes play-button {\n 0% {\n transform: scale(1.0);\n -webkit-transform: scale(1.0);\n }\n 100% {\n transform: scale(1.1);\n -webkit-transform: scale(1.1);\n }\n }\n .gd__resume__button:hover{\n filter: invert(100%) sepia(51%) saturate(0%) hue-rotate(346deg) brightness(104%) contrast(100%); \n }\n ')}},{key:"addStylesheet",value:function(e,t,n){if(!document.getElementById(e)){var r=document.createElement("style");r.type="text/css",r.id=e,r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),t.appendChild(r)}}}]),e}(),wy=function(e){if(!e)return!1;var t=Ay.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)},Ay=Object.prototype.toString;function ky(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 Ey(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ky(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ky(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xy(e){return null!=e&&e.error_url?"<vmap:VASTAdData>".concat(function(e){return e.promo_url?'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),"</vmap:VASTAdData>").trim():'<vmap:AdTagURI templateType="vast3"><![CDATA['.concat(null==e?void 0:e.adtag_url,"]]></vmap:AdTagURI>").trim()}function Sy(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 Ry(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sy(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Dy=new q,Ty=null,Iy=function(){function n(e,r,i){var a=this;if(R(this,n),Ty)return Ty;Ty=this;var s={debug:!1,width:640,height:360,locale:"en"};this.options=r?h(s,r):s,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new _,this.safetyTimer=null,this.containerTransitionSpeed=0,this.adCounter={},this.adPrerollCount=0,this.adMidrollCount=0,this.adRewardedCount=0,this.preloadedAdType=null,this.requestRunning=!1,this.parentDomain=i.parentDomain,this.topDomain=i.topDomain,this.parentURL=i.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=w(),this.atom_display,this.adType_="",this.clickCount={midroll:0,preroll:0,rewarded:0},this.userAllowedPersonalizedAds=document.location.search.indexOf("gdpr-targeting=0")>=0||document.cookie.indexOf("ogdpr_advertisement=0")>=0?"0":"1",this.parentDomain.includes("girlsgogames")&&(this.userAllowedPersonalizedAds=!1),this.thirdPartyContainer=""!==e?document.getElementById(e):null,this.options.width="number"==typeof this.options.width?this.options.width:"100%"===this.options.width?640:this.options.width.replace(/[^0-9]/g,""),this.options.height="number"==typeof this.options.height?this.options.height:"100%"===this.options.height?360:this.options.height.replace(/[^0-9]/g,"");var o=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:o,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:c,this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){t(this,a),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){t(this,a),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var i,a,s,o,c,u,d,l,p,A,k,E,x,S,O,P,L,U,q,F,V;return T(n,[{key:"start",value:(V=e(r.mark((function e(){var n=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._init_afg_script({adsense_channel:"4089988593"});case 3:return e.next=5,this._init_hl_script();case 5:return e.next=7,this._init_ima_script();case 7:this._createPlayer(),this._setUpIMA(),window.eventTest=function(e){t(this,n),this.eventBus.broadcast(e,{message:"",status:"success"})}.bind(this),e.next=15;break;case 12:throw e.prev=12,e.t0=e.catch(0),new Error(e.t0);case 15:case"end":return e.stop()}}),e,this,[[0,12]])}))),function(){return V.apply(this,arguments)})},{key:"_getAdVast",value:function(n,i){var a=this;return new Promise(function(){var s=e(r.mark((function e(s){var o,c,u,d,l,h,p,f,v=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(m.available&&m.getBoolean("gd_debug_ex")&&m.getBoolean("gd_tag"))){e.next=6;break}return o=a.IMASampleTags[n],c=Math.floor(Math.random()*o.length),u=o[c],s({url:u}),e.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){e.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return e.prev=8,d=a.nextAdPosition(n),a.eventBus.broadcast("AD_REQUEST",{message:d}),l=a.options,"preroll"===d&&B(l.preroll)?l=l.preroll:"midroll"===d&&B(l.midroll)?l=l.midroll:"rewarded"===d&&B(l.rewarded)&&(l=l.rewarded),h="rewarded"===d?"rewardedVideo":"gdbanner"===d?"gd__banner":"midroll"===d?"midroll":"video1",e.next=16,window.idhb.isLoaded();case 16:if(p={tnl_keys:Ry(Ry({},window.idhb.getAdserverTargetingForAdSlot(h)),{},{tnl_ad_pos:d,tnl_asset_id:a.gameData.gameId})},!(i&&i.retry_on_success&&B(l.retry_on_success)&&B(l.retry_on_success.vast))){e.next=21;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.retry_on_success.vast,p)));case 21:if(!(i&&i.retry_on_failure&&a.options.retry_on_failure&&B(l.retry_on_failure.vast))){e.next=25;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.retry_on_failure.vast,p)));case 25:if(!B(l.vast)){e.next=27;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.vast,p)));case 27:return e.next=29,a._create_dp_context(d,i);case 29:f=e.sent,window.idhb.requestAds({slots:D({},h,{bidFloor:null!=f&&f.floor_price?f.floor_price:void 0}),callback:function(e,n){var r=this;t(this,v),!f||null!=n&&n.bidFloorApplied||fetch(f.skip_url).catch(function(e){t(this,r)}.bind(this)),s({tnl_keys:Ry(Ry({},window.idhb.getAdserverTargetingForAdSlot(h)),{},{tnl_ad_pos:d,tnl_asset_id:a.gameData.gameId}),url:e,dp:f,hl:n})}.bind(this)}),e.next=36;break;case 33:throw e.prev=33,e.t0=e.catch(8),new Error(e.t0);case 36:case"end":return e.stop()}}),e,this,[[8,33]])})));return function(e){return s.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===v.Rewarded)return this.adRewardedCount++,"rewarded";if(e===v.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===v.Rewarded?"rewarded":e===v.Interstitial?!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_requestPromo",value:function(e,t){var n=new google.ima.AdsRequest;return n.adsResponse=function(e){return'<VAST version="3.0"> \n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA['.concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,"]]></VASTAdTagURI> \n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),n.linearAdSlotWidth=this.options.width,n.linearAdSlotHeight=this.options.height,n.nonLinearAdSlotWidth=this.options.width,n.nonLinearAdSlotHeight=this.options.height,n.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(n.vastLoadTimeout=this.options.vast_load_timeout),n.setAdWillAutoPlay(t.autoplayAllowed),n.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(n),n}},{key:"_requestAd",value:function(e,n){var r=this;return n=n||{},new Promise(function(i){if(t(this,r),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var a,s=null==e||null===(a=e.tnl_keys)||void 0===a?void 0:a.tnl_ad_pos;this.adSuccess=!1;var o=new google.ima.AdsRequest,c=this._transformVast(e,n),u=Ry(Ry({},n),{},{adTag:c,tnl_ad_pos:s});this.adCounter[s]=this.adCounter[s]||0,this.adCounter[s]++;var d=e.dp,l=e.hl;if(d&&(d.adtag_url=c.url,this._extend_dp_with_adsense(d,l,null==e?void 0:e.tnl_keys)),this._isVMAP(s)){var h=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,i=Date.now(),a=new I(e.adtag_url_1,!0);a.query=Ey(Ey({},a.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:i,output:"xml_vast3"});var s=a.toString(),o=new I(e.adtag_url_2,!0);o.query=Ey(Ey({},o.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++i,output:"xml_vast3"});var c=o.toString(),u=Date.now();return'<?xml version="1.0" encoding="UTF-8"?>\n<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-1">\n <vmap:AdSource id="'.concat(u++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(xy({id:u++,adtag_url:s,error_url:null==n?void 0:n.error_url,impression_url:null==n?void 0:n.impression_url}),'\n </vmap:AdSource>\n</vmap:AdBreak>\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-2">\n <vmap:AdSource id="').concat(u++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(xy({id:u++,adtag_url:c,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:d,adtag:c,position:"preroll"===u.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(s)}));o.adsResponse=h}else if(d&&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()}(d);o.adsResponse=p}else if(d&&d.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()}(d);o.adsResponse=f}else o.adTagUrl=c.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,u);try{this.eventBus.broadcast("AD_SDK_REQUEST",{message:u})}catch(e){}i(o)}catch(e){throw new Error(e)}}.bind(this))}},{key:"cancel",value:function(){if(!1!==this.requestRunning){this.requestRunning=!1,this._resetAdsLoader(),this._hide("cancel");var e="AD_SDK_CANCELED";this.eventBus.broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameData.gameId}})}}},{key:"_checkAutoPlay",value:(F=e(r.mark((function e(){var n=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,r){var i=this;t(this,n);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):j.video({inline:!0,muted:!1}).then(function(n){t(this,i);var r=n.result;n.error,e(!0===r?{autoplayAllowed:!0,autoplayRequiresMute:!1}:{autoplayAllowed:!0,autoplayRequiresMute:!0})}.bind(this))}.bind(this)));case 1:case"end":return e.stop()}}),e,this)}))),function(){return F.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(q=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._checkAutoPlay(!1);case 2:return t=e.sent,this._autoplay=t,this.video_ad_player.autoplay=t.autoplayAllowed,this.video_ad_player.volume=t.autoplayRequiresMute?0:1,this.video_ad_player.muted=!!t.autoplayRequiresMute,t.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0),e.abrupt("return",t);case 9:case"end":return e.stop()}}),e,this)}))),function(){return q.apply(this,arguments)})},{key:"startAd",value:(U=e(r.mark((function e(t){var n,i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.gameData.afg_disabled,i=t.adType,a=t.params,this.adType_=i,"promo"!==(null==a?void 0:a.adapter)){e.next=5;break}return e.abrupt("return",this._startPromo(a,i));case 5:if(i!==v.Interstitial){e.next=25;break}if(!n){e.next=10;break}return e.abrupt("return",this._startInterstitialAd(a));case 10:if("preroll"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=14;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 14:if("start"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=18;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 18:if("next"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=22;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 22:return e.abrupt("return",this._startInterstitialAd(a));case 23:e.next=34;break;case 25:if(i!==v.Rewarded){e.next=33;break}if(!n){e.next=30;break}return e.abrupt("return",this._startRewardedAd(a));case 30:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 31:e.next=34;break;case 33:throw new Error("Unsupported ad type");case 34:case"end":return e.stop()}}),e,this)}))),function(e){return U.apply(this,arguments)})},{key:"preloadAd",value:(L=e(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==v.Interstitial){e.next=4;break}return e.abrupt("return","gdsdk://preloaded");case 4:if(t!==v.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 L.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,n=function(){t(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new _y(this.adContainer,n),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(P=e(r.mark((function n(i){var a=this;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise(function(){var n=e(r.mark((function e(n,s){var o,c,u,d,l,h,p,f,m,v=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(c=i?i.containerId:null)||s("Container id is not specified"),u=document.getElementById(c),document.getElementById(c)||s("No container is found with this id - ".concat(c)),void 0===window.idhb.requestAds&&s("Prebid.js wrapper script hit an error or didn't exist!"),d=i.slotId?i.slotId:"gd__banner@".concat(c),document.getElementById(d)||(l="\n .gd__banner{\n z-index: ".concat(g.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((h=document.createElement("style")).type="text/css",h.id="gd__banner__style",h.styleSheet?h.styleSheet.cssText=l:h.appendChild(document.createTextNode(l)),u.appendChild(h)),(p=document.createElement("div")).id=d,p.classList.add("gd__banner"),u.appendChild(p)),e.next=10,a._create_dp_display_context();case 10:a.atom_display=e.sent,null!==(o=a.atom_display)&&void 0!==o&&o.params&&window.idhb.setAdserverTargeting(null===(f=a.atom_display)||void 0===f?void 0:f.params),(m={})[d]={maxSize:[u.offsetWidth,u.offsetHeight]},window.idhb.requestAds({slots:m,callback:function(e){t(this,v)}.bind(this)}),n(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),s(e.t0.message||e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(e,t){return n.apply(this,arguments)}}()));case 1:case"end":return n.stop()}}),n)}))),function(e){return P.apply(this,arguments)})},{key:"_startInterstitialAd",value:(O=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){t(this,a)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return i=e.sent,e.next=13,this._loadInterstitialAd(Ry(Ry({},i),n));case 13:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=22;break;case 18:throw e.prev=18,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(e){return O.apply(this,arguments)})},{key:"_startPromo",value:(S=e(r.mark((function e(t,n){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,this.adSuccess=!1,e.next=8,this._initDisplayContainerWithAutoPlay();case 8:return i=e.sent,e.next=11,this._loadPromo(Ry(Ry({},i),t),n);case 11:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),this.msgrt.send("promo.adsense",{message:"".concat(t.position," success")}),e.next=22;break;case 17:throw e.prev=17,e.t0=e.catch(0),this.msgrt.send("promo.adsense",{message:"".concat(t.position," failure,").concat(e.t0.message?e.t0.message:e.t0)}),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,17]])}))),function(e,t){return S.apply(this,arguments)})},{key:"_loadPromo",value:(x=e(r.mark((function e(n,i){var a,s,o,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._resetAdsLoader(),e.prev=1,a=this.nextAdPosition(i),s=this._create_promo_context(a),o=this._requestPromo(s,Ry({adType:v.Interstitial},n)),e.next=7,new Promise(function(e,n){var r=this;t(this,c);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var a=function(n){t(this,r),this.eventBus.unsubscribeScope(i),e(n.message)}.bind(this),s=function(e){t(this,r),this.eventBus.unsubscribeScope(i),n(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,i),this.eventBus.subscribe("AD_SDK_CANCELED",s,i),this.eventBus.subscribe("AD_ERROR",s,i),Dy.once("AD_ERROR",function(e){t(this,r),s(e)}.bind(this))}.bind(this));case 7:return e.abrupt("return",o);case 10:throw e.prev=10,e.t0=e.catch(1),new Error(e.t0);case 13:case"end":return e.stop()}}),e,this,[[1,10]])}))),function(e,t){return x.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(E=e(r.mark((function e(n){var i,a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(v.Interstitial,n);case 6:e.t0=e.sent;case 7:return i=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(i,Ry({adType:v.Interstitial},n));case 11:return a=e.sent,e.next=14,new Promise(function(e,n){var r=this;t(this,s);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var a=function(n){t(this,r),this.eventBus.unsubscribeScope(i),e(n.message)}.bind(this),o=function(e){t(this,r),this.eventBus.unsubscribeScope(i),n(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,i),this.eventBus.subscribe("AD_SDK_CANCELED",o,i),this.eventBus.subscribe("AD_ERROR",o,i)}.bind(this));case 14:return e.abrupt("return",a);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return E.apply(this,arguments)})},{key:"_startRewardedAd",value:(k=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){t(this,a)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return i=e.sent,e.next=13,this._loadRewardedAd(Ry(Ry({},i),n));case 13:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=22;break;case 18:throw e.prev=18,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(e){return k.apply(this,arguments)})},{key:"_loadRewardedAd",value:(A=e(r.mark((function e(n){var i,a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(v.Rewarded,n);case 6:e.t0=e.sent;case 7:return i=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(i,Ry({adType:v.Rewarded},n));case 11:return a=e.sent,e.next=14,new Promise(function(e,n){var r=this;t(this,s);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var a=function(n){t(this,r),this.eventBus.unsubscribeScope(i),e(n.message)}.bind(this),o=function(e){t(this,r),this.eventBus.unsubscribeScope(i),n(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,i),this.eventBus.subscribe("AD_SDK_CANCELED",o,i),this.eventBus.subscribe("AD_ERROR",o,i)}.bind(this));case 14:return e.abrupt("return",a);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return A.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(p=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(v.Interstitial);case 5:e.t0=e.sent;case 6:return this.preloadedInterstitialAdVast=e.t0,e.abrupt("return",this.preloadedInterstitialAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return p.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(l=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(v.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 l.apply(this,arguments)})},{key:"_onError",value:function(e){this.cancel(),this._clearSafetyTimer("ERROR")}},{key:"_hide",value:function(e){this.video_ad_player.src="",this.activeAdContainer&&(this.activeAdContainer.style.visibility="hidden")}},{key:"_show",value:function(e){var n=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var r=null==e?void 0:e.mode;e.t4r=Kv(this.gameData.__t4r)||{};var i=this._isT4R(e),a=this._getT4ROptions(e);if("loaded"===r)this.activeAdContainer.style.opacity=i?.001:1,i&&this.adsManager.setVolume(0),i&&this.eventBus.broadcast("AD_T4R"),i&&setTimeout(function(){t(this,n),this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}.bind(this),((null==a?void 0:a.min)||1234)+Math.random()*((null==a?void 0:a.max)||3210));else if("click"===r||"first_quartile"===r){if(i&&"click"===r){var s,o=null===(s=this._adrequest_user_context)||void 0===s?void 0:s.tnl_ad_pos;this.clickCount[o]++}this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}}}},{key:"_createPlayer",value:function(){var e=this,n=document.body||document.getElementsByTagName("body")[0];this.adContainer=document.createElement("div"),this.adContainer.id="".concat(this.prefix,"advertisement"),this.adContainer.style.position=this.thirdPartyContainer?"absolute":"fixed",this.adContainer.style.zIndex=g.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,window.activeAdContainer=this.activeAdContainer,this.thirdPartyContainer?(this.adContainer.appendChild(i),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(i),n.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var a=function(){t(this,e);var n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:n,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:a,i.style.width=this.options.width+"px",i.style.height=this.options.height+"px",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px"}.bind(this);window.addEventListener("resize",a),window.document.addEventListener("DOMContentLoaded",a)}},{key:"_setUpIMA",value:function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.adContainerInner,this.video_ad_player),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setDisableCustomPlaybackForIOS10Plus(!0),this.adsLoader.getSettings().setLocale(this.options.locale),this.adsLoader.getSettings().setVpaidMode(this._getVPAIDMode()),this.adsLoader.getSettings().setAutoPlayAdBreaks(!0);var e=this.adsLoader.getSettings().getNumRedirects();this.adsLoader.getSettings().setNumRedirects(2*e),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1,this),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError,!1,this)}},{key:"_onAdsManagerLoaded",value:function(e){var n=this,r=new google.ima.AdsRenderingSettings;r.autoAlign=!1,r.enablePreloading=!1,r.restoreCustomPlaybackStateOnAdBreakComplete=!0,r.useStyledNonLinearAds=!0,r.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(this.video_ad_player,r),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError.bind(this),!1,this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_METADATA,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CLICK,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.DURATION_CHANGE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.FIRST_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.IMPRESSION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.INTERACTION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LINEAR_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.MIDPOINT,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.THIRD_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.USER_CLOSE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_MUTED,this._onAdEvent.bind(this),this),window.addEventListener("resize",function(){t(this,n),this.adsManager&&this.adsManager.resize(this.options.width,this.options.height,google.ima.ViewMode.NORMAL)}.bind(this)),this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0);var i=new Date,a=i.getHours(),s=i.getDate(),o=i.getMonth(),c=i.getFullYear(),u="AD_SDK_MANAGER_READY";this.eventBus.broadcast(u,{name:u,message:"AD SDK is ready",status:"success",analytics:{category:u,action:this.parentDomain,label:"h".concat(a," d").concat(s," m").concat(o," y").concat(c)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var t,n=new Date,r=n.getHours(),i=n.getDate(),a=n.getMonth(),s=n.getFullYear(),o=y(google.ima.AdEvent.Type,e.type),c=!1,u=(null==e||null===(t=e.getAd())||void 0===t?void 0:t.getContentType())||"",d=!u.startsWith("image")&&!u.startsWith("text");this._sendIMAEventsToHB(e);var l="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:l="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:l="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:c=!0,l="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:l="Fired when the ad is clicked.";var h=e.getAd().getContentType();this._show({mode:"click",contentType:h});break;case google.ima.AdEvent.Type.COMPLETE:c=this._is_completed(e.getAd()),l="Fired when the ad completes playing.",this.adType_===v.Rewarded&&this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:l="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:l="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",c=!0,this._hideAddResume();break;case google.ima.AdEvent.Type.DURATION_CHANGE:l="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:l="Fired when the ad playhead crosses first quartile.";var p=e.getAd().getContentType();this._show({mode:"first_quartile",contentType:p});break;case google.ima.AdEvent.Type.IMPRESSION:l="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:l="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:l="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var f=e.getAd().getContentType();l=f,this._show({mode:"loaded",contentType:f});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(l=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:l="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:d&&this.adResume.show(),l="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:l="Fired when the ad is resumed.",d&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:l="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:c=this._is_completed(e.getAd()),l="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:this._hideAddResume(),l="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:l="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:c=this._is_completed(e.getAd()),l="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:l="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:l="Fired when the ad volume has been muted."}""!==o&&""!==l&&this.eventBus.broadcast(o,{name:o,message:l,status:"success",analytics:{category:o,action:this.parentDomain,label:"h".concat(r," d").concat(i," m").concat(a," y").concat(s)}}),c&&!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);Dy.emit("AD_ERROR",r),this.eventBus.broadcast(t,{message:r,details:i,status:"warning",analytics:{category:t,action:i,label:r}}),this._hideAddResume()}catch(e){}}},{key:"_hideAddResume",value:function(){try{this.adResume&&this.adResume.hide()}catch(e){console.log("Error on hide adResume",e)}}},{key:"_sendIMAEventsToHB",value:function(e){if(window.idhb&&"function"==typeof window.idhb.onImaEvent)try{window.idhb.onImaEvent({event:e})}catch(e){}}},{key:"_resetAdsLoader",value:function(){this.adsManager&&(this.adsManager.destroy(),this.adsManager=null,this._adrequest_user_context=null),this.adsLoader&&this.adsLoader.contentComplete()}},{key:"_startSafetyTimer",value:function(e,n){var r=this;this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=window.setTimeout(function(){t(this,r),this.cancel(),this._clearSafetyTimer(n)}.bind(this),e)}},{key:"_clearSafetyTimer",value:function(e){void 0!==this.safetyTimer&&null!==this.safetyTimer&&(clearTimeout(this.safetyTimer),this.safetyTimer=void 0)}},{key:"_getVPAIDMode",value:function(){return google.ima.ImaSdkSettings.VpaidMode.ENABLED}},{key:"_getPrebidScripts",value:function(){var e=["https://hb.improvedigital.com/pbw/headerlift.min.js","http://hb.improvedigital.com/pbw/headerlift.min.js"];return this.options.hb_script?[this.options.hb_script].concat(e):e}},{key:"_getInnerErrorCode",value:function(e){if(wy(e.getInnerError)){var t=e.getInnerError();if(t)return wy(t.getErrorCode)&&wy(t.getVastErrorCode)?t.getErrorCode().toString()||t.getVastErrorCode().toString():t.message}}},{key:"resetForNext",value:function(){this.requestRunning=!1,this._hide("resetForNext")}},{key:"_createCustomAdVastUrl",value:function(e,n){var r=this;if(e){var i=this.macros.transform(e,{get:function(e){if(t(this,r),n&&n.tnl_keys)return n.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in i.query||{}){var s=i.query[a];B(s)&&(i.query[a]=G.stringify(s))}var o=new I(i.url,!0);return N(o.query,i.query||{}),Ry({url:o.toString()},n)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new I(e.url,!0),i=this._transformQuery(e,t,r);i&&(n.url=r.toString());var a=i?r:new I(e.url,!0);if(a.query.cust_params){var s=G.parse(a.query.cust_params);n.bidder=s.hb_bidder,n.cust_params=s}n.url_parsed=a}catch(e){n.hasError=!0,n.message=e.message,n.bidder="error",console.log(e.message)}return n}},{key:"_transformQuery",value:function(e,n,r){var i=this;if(e&&n&&e.tnl_keys){var a=this.options.vast_query;if(n.retry_on_success&&this.options.retry_on_success&&B(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:n.retry_on_failure&&this.options.retry_on_failure&&B(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=M(a),B(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 c=G.parse(s.cust_params);if(a.cust_params&&a.cust_params.$$remove){for(var u in c){new RegExp(a.cust_params.$$remove,"i").test(u)&&delete c[u]}delete a.cust_params.$$remove}var d=this.macros.transform(a,{get:function(n){return t(this,i),e.tnl_keys[n.toLowerCase()]}.bind(this)});return s.cust_params=c,N(s,d),s.cust_params=G.stringify(s.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,i,a=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(this.clickCount[a]>=(null===(n=e.t4r[a])||void 0===n?void 0:n.count))return!1;if(console.log("t4r options.contentType",null==e?void 0:e.contentType,a),null!=e&&null!==(r=e.contentType)&&void 0!==r&&r.startsWith("image/")||"text"===(null==e?void 0:e.contentType))return a&&(null===(i=e.t4r[a])||void 0===i?void 0:i.enabled);if(null!=e&&e.contentType.startsWith("video/")){var s,o=(null===(s=e.t4r[a])||void 0===s?void 0:s.viper)||0;if(o>0){var c,u=Math.random()<o;return a&&u&&(null===(c=e.t4r[a])||void 0===c?void 0:c.enabled)}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,n,r,i,a,s,o,c,u,d,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===(c=this.gameData)||void 0===c||null===(u=c.mAds)||void 0===u||null===(d=u.vmap)||void 0===d?void 0:d.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(e){var t,n=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;switch(n){case"preroll":case"midroll":case"rewarded":return e.t4r[n]}}},{key:"_is_completed",value:function(e){var t=e.getContentType(),n=e.getAdPodInfo();return!(!t.startsWith("image/")&&"text"!==t&&1!==n.getTotalAds())}},{key:"_get_vmap_context",value:function(e){var t=e.adtag,n=e.position,r=e.config,i=e.dp,a=this._createCustomAdVastUrl(null==r?void 0:r.vast_1)||t,s=this._createCustomAdVastUrl(null==r?void 0:r.vast_2)||t,o=null!=r&&r.vast_1?void 0:i,c=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:c}}},{key:"_get_vmap_config",value:function(e){var t,n,r,i,a,s,o,c;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===(c=o.pAds)||void 0===c?void 0:c.vmap}}},{key:"_isDP",value:function(e){var t,n,r;return!!e&&!0===(null===(t=this.gameData)||void 0===t||null===(n=t.dp)||void 0===n||null===(r=n[e])||void 0===r?void 0:r.enabled)}},{key:"_create_dp_display_context",value:function(){var e=this;return new Promise(function(n){var r=this;t(this,e);try{var i={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new by(this.gameData).checkCustomParams();a&&(i.cp=a);var s=encodeURIComponent(C.encode(JSON.stringify(i)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(s)).then(function(e){return t(this,r),e.json()}.bind(this)).then(function(e){if(t(this,r),!e||!e.p)return this.msgrt.send("dp.na",{message:"atom"}),n();this.msgrt.send("dp.fp",{message:e.p/100}),n({params:{fp:e.p/100},error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(s),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(s)})}.bind(this)).catch(function(e){t(this,r),this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),n()}.bind(this))}catch(e){this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),n()}}.bind(this))}},{key:"_create_promo_context",value:function(e){var n,r=this,i={id:this.topDomain||this.parentDomain,au:e||"unknown",ty:"video",aid:this.gameData.gameId,pgu:this.parentURL},a=Object.keys(i).map(function(e){return t(this,r),"".concat(e,"=").concat(encodeURIComponent(i[e]))}.bind(this)).join("&");encodeURIComponent(C.encode(JSON.stringify(i)));var s=null===(n=this.gameData.promo)||void 0===n?void 0:n.rainbow,o=null==s?void 0:s.enabled,c="https://tag.atom.gamedistribution.com/v1/rainbow/?".concat(a),u=o?c:void 0;return function(){t(this,r)}.bind(this),{promo_url:u,promo_imp_blue_url:o?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:o?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0}}},{key:"_create_dp_context",value:function(n,i){var a=this;return new Promise(function(){var s=e(r.mark((function e(s){var o,c,u,d,l,h,p=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,a._isDP(n)){e.next=5;break}return a.msgrt.send("dp.na",{message:"rule"}),e.abrupt("return",s());case 5:c={id:a.topDomain||a.parentDomain,au:n||"unknown",ty:"video",aid:a.gameData.gameId,pgu:a.parentURL},(u=new by(a.gameData).checkCustomParams())&&(c.cp=u),d=encodeURIComponent(C.encode(JSON.stringify(c))),l=null===(o=a.gameData.promo)||void 0===o?void 0:o.rainbow,h=(null==l?void 0:l.enabled)&&!0!==(null==i?void 0:i.fallback_adsense),fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(d)).then(function(e){return t(this,p),e.json()}.bind(this)).then(function(e){if(t(this,p),!e||!e.p)return a.msgrt.send("dp.na",{message:"atom"}),s();var n=e.p/100;s({id:Date.now(),floor_price:n,error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(d,"&ec=[ERRORCODE]"),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(d),skip_url:"https://tag.atom.gamedistribution.com/v1/skp?ar=".concat(d),promo_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(d):void 0,promo_imp_blue_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){t(this,p),a.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),s()}.bind(this)),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(0),a.msgrt.send("dp.err",{message:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0}),s();case 18:case"end":return e.stop()}}),e,this,[[0,14]])})));return function(e){return s.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t){if(e&&t)try{var n,r=new I(t.vastUrl,!0);if(null===(n=r.query)||void 0===n||!n.cust_params)return;var i=G.parse(r.query.cust_params);if(!i.tnl_asset_id)return;i.adsense=1,r.query.cust_params=G.stringify(i,!1),e.fallback_url=r.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(d=e(r.mark((function e(n){var i,a,s,o,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._getPrebidScripts(),a=i[0],window.idhb=window.idhb||{},window.idhb.options=window.idhb.options||{},Object.assign(window.idhb.options,{assetId:this.gameData.gameId,configUrl:this.topDomain||this.parentDomain,parentUrl:this.parentURL,pageType:"gd"}),window.idhb.que=window.idhb.que||[],e.next=8,f(a,"gdsdk_prebid",{alternates:i,error_prefix:"Blocked:",exists:function(){return t(this,u),window.idhb.requestAds}.bind(this)});case 8:s=b("ch",window.location.href),o=b("ch_date",window.location.href),c={tnl_content_category:this.category.toLowerCase()},s&&(c.channel=s),o&&(c.ch_date=o),window.idhb.setAdserverTargeting(c),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var n=this;t(this,u);try{var r,i=e.slotId.split("@");i=1===i.length?i[0]:i[1],e.isEmpty?(null!==(r=this.atom_display)&&void 0!==r&&r.error_url&&(fetch(this.atom_display.error_url).catch(function(e){t(this,n)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_ERROR",{message:i,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){t(this,n)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:i,status:"success"}))}catch(e){}}.bind(this));case 16:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"_init_ima_script",value:(u=e(r.mark((function e(n){var i,a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=["https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","https://imasdk.googleapis.com/js/sdkloader/ima3.js","http://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","http://imasdk.googleapis.com/js/sdkloader/ima3.js"],a=this.options.debug?i[0]:i[1],e.next=4,f(a,"gdsdk_ima",{alternates:i,error_prefix:"Blocked:",exists:function(){return t(this,s),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"_init_afg_script",value:(c=e(r.mark((function e(n){var i,a,s,o,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.gameData.afg_disabled){e.next=3;break}return e.abrupt("return");case 3:return(o={}).crossorigin="anonymous",o["data-ad-client"]=(null==n||null===(i=n.adsense_client)||void 0===i?void 0:i.length)>0?n.adsense_client:"ca-pub-2316275586951220",o["data-ad-frequency-hint"]="30s",o.allow="autoplay",(null==n||null===(a=n.adsense_channel)||void 0===a?void 0:a.length)>0&&(o["data-ad-channel"]=n.adsense_channel),(null==n||null===(s=n.adsense_host)||void 0===s?void 0:s.length)>0&&(o["data-ad-host"]=n.adsense_host),!0===(null==n?void 0:n.adsense_adbreak_test)&&(o["data-adbreak-test"]="on"),e.next=14,f("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return t(this,c),!!window.adsbygoogle}.bind(this),attrs:o});case 14:window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({sound:"on",preloadAdBreaks:"on"});case 16:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"clearSession",value:function(){this.requestRunning=!1}},{key:"_startAdsensePlacementRewardedAd",value:(o=e(r.mark((function e(n){var i,a,s,o,c,u,d=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){t(this,d)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),i=function(){t(this,d),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,d),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(){t(this,d),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),o=function(){t(this,d),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),c=function(e){t(this,d),e()}.bind(this),u=function(e){t(this,d),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===e.breakStatus?this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error",skipForward:!0}),"dismissed"!==e.breakStatus&&this._send_atom_event("sg.dbg.rw",e))}.bind(this),n={type:"reward",name:"reward-in-game",beforeAd:i,afterAd:a,adDismissed:s,adViewed:o,beforeReward:c,adBreakDone:u},window.adsbygoogle.push(n),e.next=24;break;case 20:throw e.prev=20,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 24:case"end":return e.stop()}var n}),e,this,[[1,20]])}))),function(e){return o.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(s=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){t(this,a)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),i=function(e){t(this,a),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"}),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),n={type:"preroll",adBreakDone:i},window.adsbygoogle.push(n),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}var n}),e,this,[[1,15]])}))),function(e){return s.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(a=e(r.mark((function e(n){var i,a,s,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){t(this,o)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),i=function(){t(this,o),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,o),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(e){t(this,o),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),n={type:"start",name:"start-in-game",beforeAd:i,afterAd:a,adBreakDone:s},window.adsbygoogle.push(n),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var n}),e,this,[[1,17]])}))),function(e){return a.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(i=e(r.mark((function e(n){var i,a,s,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){t(this,o)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),i=function(){t(this,o),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,o),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(e){t(this,o),this.resetForNext(),this.adCounter.midroll=this.adCounter.midroll||0,this.adCounter.midroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.mr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",e))}.bind(this),n={type:"next",name:"next-in-game",beforeAd:i,afterAd:a,adBreakDone:s},window.adsbygoogle.push(n),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var n}),e,this,[[1,17]])}))),function(e){return i.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var n=this.msgrt,r=n._layout,i=n._ua,a={tp:e,ct:0,vrs:this.PackageJSON.version,url:this.parentURL,rfr:document.referrer,tdmn:this.topDomain||this.parentDomain,dpth:0,args:t,ua:{brnm:i.browser.name,brvs:i.browser.version,osnm:i.os.name,osvs:i.os.version,dvmd:i.device.model,w:r.w,h:r.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(C.encode(JSON.stringify(a)))))}catch(e){}}},{key:"_send_atom_event",value:function(e,t){this._send(e,{gid:this.gameData.slug,md5:this.gameData.gameId,pid:0,pnm:this.gameData.pname,ctry:this.gameData.ctry,lcl:"en",hle:1,ads:1,args:t,href:window.location.href})}},{key:"_isAfgPositionNext",value:function(e){return void 0!==e.adTimestamp}},{key:"_isAfgPositionStart",value:function(e){if(void 0!==e.adTimestamp)return!1;return this.adCounter.preroll=this.adCounter.preroll||0,0===this.adCounter.preroll}},{key:"attachAfgPosition",value:function(e){var t=e.params.position;switch(t){case"preroll":case"start":case"pause":case"next":case"browse":case"reward":return}var n=e.adType;if(n===v.Rewarded)t="reward";else if(n===v.Interstitial){var r,i;if(this._isAfgPositionStart(e))t=null===(r=this.gameData.pAds)||void 0===r||!r.enabled||null!==(i=this.gameData.loader)&&void 0!==i&&i.enabled?"start":"next";else this._isAfgPositionNext(e)&&(t="next")}e.params.position=t}}]),n}(),Cy=function t(n){var i=this;R(this,t),D(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rl(i.moduleName);case 2:i.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),D(this,"promo",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.module){e.next=3;break}return e.next=3,i.load();case 3:return e.abrupt("return",i.module[i.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var a=n.package||"gd-sdk-stone-dynamic",s=n.package_version||"1.1.1",o=n.template||"puzzle",c=n.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=o.charAt(0).toUpperCase()+o.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(a,"/").concat(s,"/dist/").concat(o.toLowerCase(),"/iife/index.js"),dependencies:c},xl(this.moduleName,this.moduleConfig)},Oy=function t(n){var i=this;R(this,t),D(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rl(i.moduleName);case 2:i.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),D(this,"splash",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.module){e.next=3;break}return e.next=3,i.load();case 3:return e.abrupt("return",i.module[i.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var a=n.package||"gd-sdk-air-dynamic",s=n.package_version||"1.2.0",o=n.template||"pluto",c=n.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=o.charAt(0).toUpperCase()+o.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(a,"/").concat(s,"/dist/").concat(o.toLowerCase(),"/iife/index.js"),dependencies:c},xl(this.moduleName,this.moduleConfig)},Py=function(e,t){console.log(e,t)},Ly={},Uy={},My=null;function jy(){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 Ly.version=r,Ly.frame=e,Ly.function=n,Ly.version}function By(e){var n=this;return My||(My=new Promise(function(r){function i(t,n){if(Py("Received a response from CMP",t),n){var i,a;if(!1!==t.gdprApplies)return"tcloaded"===t.eventStatus||"useractioncomplete"===t.eventStatus?(("boolean"!=typeof(a=(i=t)&&"boolean"==typeof i.gdprApplies?i.gdprApplies:e.defaultGdprScope)||!0===a&&"string"!=typeof i.tcString)&&r({result:"cmpUnexpectedResponse",cmp:Ly,consentData:i}),void r({result:"ok",consentData:t})):void 0;r({result:"ok",consentData:t})}else r({result:"cmpCallFailed"})}t(this,n),jy(),Ly.frame?2===Ly.version?(Py("TCF v2 CMP found. Fetching the consent."),Ly.function?(Py("CMP API is directly accessible, calling it now..."),Ly.function("addEventListener",Ly.version,i)):(Py("CMP API is outside the current iframe, calling it now..."),function(e,n,r){var i=this,a="__tcfapi";function s(e){var t="".concat(a,"Return"),n="string"==typeof e.data&&e.data.indexOf(t)>=0?JSON.parse(e.data):e.data;if(n[t]&&n[t].callId){var r=n[t];void 0!==Uy[r.callId]&&Uy[r.callId](r.returnValue,r.success)}}window[a]=function(e,r,s,o){t(this,i);var c=Math.random()+"",u="".concat(a,"Call"),d=D({},u,{command:e,parameter:o,callId:c,version:r});Uy[c]=s,n.postMessage(d,"*")}.bind(this),window.addEventListener("message",s,!1),window[a](e,Ly.version,r)}("addEventListener",Ly.frame,i))):r({result:"cmpVersionNotV2",cmp:Ly}):r({result:"cmpNotFound"})}.bind(this)))}var Gy=new(function(){function t(){R(this,t),this.productName="Game Distribution"}var n;return T(t,[{key:"checkIfExcluded",value:function(e){try{var t,n;return!(null===(t=e.diagnostic)||void 0===t||null===(n=t.gameDock)||void 0===n||!n.excluded)}catch(e){return console.log("Error on checkIfExclude check",e),!1}}},{key:"track",value:(n=e(r.mark((function e(t,n){var i,a,s,o,c,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.checkIfExcluded(n)){e.next=3;break}return e.abrupt("return");case 3:if(a=null==t||null===(i=t.visitor)||void 0===i?void 0:i.visitorId){e.next=6;break}return e.abrupt("return");case 6:return s=encodeURIComponent(this.productName),o=encodeURIComponent(a),e.prev=8,c="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(s,"/user_id/").concat(o),e.next=12,fetch(c,{method:"POST"});case 12:e.next=28;break;case 15:return e.prev=15,e.t0=e.catch(8),console.log("GAME_DOCK. fail v4",e.t0),e.prev=18,u="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(s,"/user_id/").concat(o),e.next=22,fetch(u,{method:"POST"});case 22:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(18),console.log("GAME_DOCK. fail v6",e.t1);case 28:case"end":return e.stop()}}),e,this,[[8,15],[18,25]])}))),function(e,t){return n.apply(this,arguments)})}]),t}());function Ny(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 qy(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 qy(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 qy(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 Fy=function(e){var n=this,r=e.src,i=e.attributes,a=e.target,s=e.isAsync;return new Promise(function(e,o){var c=this;t(this,n);try{var u=document.createElement("script");if(u.async=null==s||s,u.type="text/javascript",u.onload=function(){t(this,c),e()}.bind(this),u.onerror=function(){t(this,c);var e="Error on script load, Error: ".concat(r);console.log(e),o(e)}.bind(this),u.src=r,i){var d,l=Ny(i);try{for(l.s();!(d=l.n()).done;){var h=d.value,p=h.key,f=h.value;u.setAttribute(p,f)}}catch(e){l.e(e)}finally{l.f()}}a||(a=document.head),a.appendChild(u)}catch(e){var m="Error on script load catch, Error: ".concat(r);console.log(m,e),o(m)}}.bind(this))},Vy=function(){var t=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Fy({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,Fy({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,Fy({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),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("GD: CMP error on load",e.t0);case 13:case"end":return e.stop()}var t,n,r,i}),e,null,[[0,10]])})));return function(){return t.apply(this,arguments)}}(),Wy=new q,Ky={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};function Hy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}window.addEventListener("message",(function(e){var n=this,r=e.data,i=e.origin,a=r.type;if(Object.keys(Ky).some(function(e){return t(this,n),e===i}.bind(this))&&(null==r||!r.__tcfapiCall)&&(window.parent&&!r.type.startsWith("gd-sdk")&&window.parent.postMessage(r,"*"),a)){var s=Ky[i][a];s&&Wy.emit(s,r)}}),!1);var zy=F(),$y=function(e){var n=this;if(!window.__msgr){var r=document.createElement("iframe");if(r.src="https://static.gamedistribution.com/message/index.html",r.style.display="none",r.name="__msgr",document.body.appendChild(r),window!==window.top){var i={gameId:e.gameId,target:e.evnts.domain,token:zy,event_name:"TokenGenerated",timestamp:Date.now()};r.onload=function(){Jy(i)},setInterval(function(){t(this,n),i.timestamp=Date.now(),i.event_name="Heartbeat",Jy(i)}.bind(this),1e3*e.evnts.heartbeatDuration)}}window.addEventListener("message",function(e){t(this,n);try{var r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hy(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.data);if(!r.event_name)return;r.token=zy,Jy(r)}catch(e){console.error("GD Messager Error",e.message)}}.bind(this),!1)},Qy=function(e){try{var t={gameId:e.game.gameId,target:e.game.evnts.domain,event_name:e.event,timestamp:Date.now()},n=Yy(window);n!==window.top&&(null==n||n.postMessage(t,"https://html5.gamedistribution.com"))}catch(e){}},Yy=function e(t){try{var n,r,i=null==t?void 0:t.parent;if("game"===(null===(n=i.document)||void 0===n||null===(r=n.activeElement)||void 0===r?void 0:r.id))return i;e(i)}catch(e){return t}},Jy=function(e){window.__msgr.postMessage(e,"https://static.gamedistribution.com")};function Xy(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 Zy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xy(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var eb,tb=null,nb=null,rb=function(){function n(e){var r=this;if(R(this,n),tb)return tb;tb=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,e),this._version=e.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new hv,this._location.print(),this._parentURL=0===this._bridge.depth?encodeURIComponent(this._bridge.parentURL):this._bridge.parentURL,this._parentDomain=this._bridge.parentDomain,this._topDomain=this._bridge.topDomain,this._isFullScreen=!1,this._giftCount=0,this._setConsoleBanner(),this._initializeMessageRouter(),this._checkConsole(),this._subscribeToEvents(),this.sdkReady=new Promise(this._initializeSDKWithGameData.bind(this)),this.sdkReady.then(function(e){t(this,r),this._sdk_ready=!0}.bind(this)).catch(function(e){t(this,r),this._sdk_ready=!1}.bind(this)).finally(function(){var e,n;t(this,r),!0===(null===(e=this._gameData.lp)||void 0===e?void 0:e.load)&&this._sendLoadedEvent(1),this._sendLoaderDataEvent(),this._checkSplashAndPromoScreens(),this._initBlockingExternals(),this._initUnityHandler(),this._checkFullscreen(),null!==(n=this._gameData.evnts)&&void 0!==n&&n.enabled&&this._isLoaderGameURL()&&$y(this._gameData)}.bind(this)),this._registerSGBridge()}var u,g,y,b,w,D,O,P,L,U,j,B;return T(n,[{key:"_initUnityHandler",value:function(){var e=this;window.addEventListener("DOMNodeInserted",function(){if(t(this,e),this._gameData.block_exts&&this._removeExternalsInHtml({enabled:!1}),document.getElementsByClassName("webgl-content")[0]){var n=document.getElementsByClassName("webgl-content")[0].getElementsByClassName("footer")[0];n&&n.setAttribute("style","display:none")}}.bind(this))}},{key:"_loadCMP",value:(B=e(r.mark((function e(){var t,n,i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=6;break}if(i=new hv,0!==(null==(a=i.get("depth"))?void 0:a.value)||null===(t=this._gameData)||void 0===t||null===(n=t.cmp)||void 0===n||!n.enabled||"html5.gamedistribution.com"!==this._topDomain){e.next=6;break}return e.next=6,Vy();case 6:case"end":return e.stop()}}),e,this)}))),function(){return B.apply(this,arguments)})},{key:"testConsent",value:function(){try{jy();e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,By({});case 2:e.sent;case 3:case"end":return e.stop()}}),e)})))()}catch(e){console.log("find CMP error",e)}}},{key:"_sendLoaderDataEvent",value:function(){try{this.options.onLoaderEvent&&this.options.onLoaderEvent({name:"LOADER_DATA",message:{game:this._gameData,bridge:this._bridge},status:this._sdk_ready?"success":"error"})}catch(e){}}},{key:"_registerSGBridge",value:function(){var e=this;Wy.on("splash-hidden",function(n){t(this,e),this._hideCMPButton()}.bind(this))}},{key:"_hideCMPButton",value:function(){var e=document.getElementById("ot-sdk-btn-floating");e&&(e.style.display="none")}},{key:"isLoaded",value:function(){if(void 0===this._isLoaded){var e=this._isTokenGameURL(),t=this._isExtHostedGameURL(),n=this._isMasterGameURL();this._isLoaded=(e||t&&!n)&&this._gameData.loader.enabled}return this._isLoaded}},{key:"setIsLoaded",value:function(e){this._isLoaded=e}},{key:"_sendLoadedEvent",value:function(){if(!this.isLoaded()){this.setIsLoaded(!0);try{this._sendTunnlEvent(1),this.msgrt.send("loaded",{message:this._hasBlocker?"Has Blocker":"No Blocker"})}catch(e){}}}},{key:"_sendGamedockGamePlay",value:function(){var e=this._isTokenGameURL();if(!(this._gameData.loader.enabled&&e||this._gameDockGamePlaySent))try{this._sendGamedockEvent("gameplay"),this._gameDockGamePlaySent=!0}catch(e){}}},{key:"_safeInit",value:function(){this._checkUserDeclinedTracking(),this._checkWhitelabelPartner();var e=this._gameData.diagnostic;void 0!==e&&void 0!==e.close_ga&&!1!==e.close_ga||!this._bridge.isCoreSDKMode&&this._loadGoogleAnalytics(),void 0!==e&&void 0!==e.close_gamedock&&!1!==e.close_gamedock||!this._bridge.isCoreSDKMode&&!this._bridge.noGamedockSDK&&this._loadGamedockTracker(),void 0!==e&&void 0!==e.close_minijuegos&&!1!==e.close_minijuegos||!this._bridge.isCoreSDKMode&&!this._bridge.noMinijuegosSDK&&document.location.search.indexOf("mp_game_id")>=0&&this._loadMiniJuegosGratisTracker()}},{key:"_initializeSDKWithGameData",value:(j=e(r.mark((function e(n,i){var a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getGameData();case 3:return this._gameData=e.sent,e.next=6,this._loadCMP();case 6:this._bridge.isCoreSDKMode=!(!0===this._gameData.enableAds||!0===(null===(a=this._gameData.enableAds)||void 0===a?void 0:a.enabled)),this._safeInit(),this._checkGameId(),this._checkGameDeleted(),this._checkBlocking(),this._changeMidrollInDebugMode(),void 0!==this._gameData.diagnostic&&void 0!==this._gameData.diagnostic.close_ads&&!1!==this._gameData.diagnostic.close_ads||(this.videoAdReady=this._initializeVideoAd().catch(function(e){return t(this,s),console.error(e.message||e)}.bind(this))),n(this._gameData),e.next=21;break;case 16:e.prev=16,e.t0=e.catch(0),this._sendSDKError(e.t0),this.onResumeGame(e.t0.message,"warning"),i(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e,t){return j.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?h(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=pv.version,t=console.log("%c %c %c GameDistribution.com HTML5 SDK | Version: "+e+" %c %c %c","background: #9854d8","background: #6c2ca7","color: #fff; background: #450f78;","background: #6c2ca7","background: #9854d8","background: #ffffff");console.log.apply(console,t)}}},{key:"_sendTunnlEvent",value:function(e){var n=this;void 0===this._topDomain&&(this._topDomain=void 0);var r={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(G.stringify(r))).catch(function(e){t(this,n)}.bind(this))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=c("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,p("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!m.available)return;"developer.gamedistribution.com"===this._parentDomain?(m.set("gd_debug_ex",!0),m.set("gd_disable_midroll_timer",!0),m.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(m.set("gd_debug_ex",!0),m.set("gd_disable_midroll_timer",!0)),m.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 l({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:s(),version:pv.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:d(),byloader:this._bridge.isTokenGameURL,isTokenGameURL:this._bridge.isTokenGameURL,isMasterGameURL:this._bridge.isMasterGameURL,isExtHostedGameURL:this._bridge.isExtHostedGameURL,byloaderVersion:this._bridge.version})}},{key:"_loadGamedockTracker",value:function(){var e=this;try{var n=["https://cdn.gamedock.io/gamedock-web-tracker/4.4.0/script/gamedock-sdk.min.js"];f(n[0],"GamedockSDK",{alternates:n}).then(function(){var n,r;t(this,e),nb=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(r=n.gameDock)&&void 0!==r&&r.adViewEvent&&nb.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),Gy.track(nb,this._gameData)}.bind(this)).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}catch(e){}}},{key:"_initGamedockTracker",value:function(e){if(!this._bridge.isCoreSDKMode)return e.initialize("gd",this._parentDomain)}},{key:"_sendGamedockEvent",value:function(e){var t,n;null===(t=nb)||void 0===t||null===(n=t.tracking)||void 0===n||n.trackEvent(e,{pageId:this.options.gameId,pageType:"game"})}},{key:"_loadMiniJuegosGratisTracker",value:function(){var e=this;window.mpConfig={game:this.options.gameId,partner:"game-distribution"};var n=["https://ext.minijuegosgratis.com/external-host/main.js"];f(n[0],"MinijuegosSDK",{alternates:n}).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,n=["https://www.google-analytics.com/analytics.js"];f(n[0],"gdsdk_google_analytics",{alternates:n,error_prefix:"Blocked:",exists:function(){return t(this,e),window.ga}.bind(this)}).then(function(){t(this,e),window.ga("create","UA-60359297-49",{name:"gd",cookieExpires:7776e3,sampleRate:5},"auto"),this._bridge.noGAPageView||window.ga("gd.send","pageview"),this._userDeclinedTracking||window.ga("gd.set","anonymizeIp",!0)}.bind(this)).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new _,A.forEach(function(n){var r=this;return t(this,e),this.eventBus.subscribe(n,function(e){return t(this,r),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),k.forEach(function(n){var r=this;return t(this,e),this.eventBus.subscribe(n,function(e){return t(this,r),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(t(this,e),"developer.gamedistribution.com"===this._parentDomain||!0===new RegExp("^localhost").test(this._parentDomain)){fetch("https://game.api.gamedistribution.com/game/v2/hasapi/".concat(this.options.gameId,"?timestamp=").concat((new Date).valueOf()));try{var n=JSON.stringify({type:"GD_SDK_IMPLEMENTED",gameID:this.options.gameId});window.location!==window.top.location?window.top.postMessage(n,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(n,"*")}catch(e){}}}.bind(this),"ima"),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){return t(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(n){var r,i;t(this,e),this.msgrt.send("ad.impression"),null!==(r=this._gameData.diagnostic)&&void 0!==r&&null!==(i=r.gameDock)&&void 0!==i&&i.adViewEvent&&Gy.track(nb,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(n){t(this,e),this.msgrt.send("ad.error",{message:n.message,details:n.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(n){t(this,e),this._sendAdRequestContext(n.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(n){t(this,e),n.message.startsWith("Blocked:")?this._bridge.noBlockerEvent||(this.msgrt.send("error",{message:n.message}),this._hasBlocker||(this._hasBlocker=!0,this._sendTunnlEvent(3))):this.msgrt.send("error",{message:n.message})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_EMPTY",function(n){t(this,e),this.msgrt.send("tunnl.keys.empty",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_FALLBACK",function(n){t(this,e),this.msgrt.send("tunnl.keys.fallback",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_T4R",function(n){return t(this,e),this.msgrt.send("adt4r")}.bind(this),"sdk")}},{key:"_checkGameId",value:function(){this.options.gameId===this._defaults.gameId&&this._sendSDKError("Check correctness of your GAME ID. Otherwise, no revenue will be recorded.")}},{key:"_getDefaultGameData",value:function(){return{gameId:this.options.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}},{key:"_getGameDataUrl",value:function(){var e=void 0!==this._topDomain&&"undefined"!==this._topDomain?this._topDomain:this._parentDomain;return"https://game.api.gamedistribution.com/game/v4/get/".concat(this.options.gameId.replace(/-/g,""),"/?domain=").concat(e,"&v=").concat(pv.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(U=e(r.mark((function e(){var n,i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this._gameData,n=void 0===this._gameData.dmain||this._gameData.dmain,(i.bloc_gard&&!0===i.bloc_gard.enabled||!n)&&(this.msgrt.send("blocked"),setTimeout(function(){t(this,a),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(G.stringify({domain:this._parentDomain,id:i.gameId,img:this._get_game_thumbnail_url(),title:i.title}))}.bind(this),100));case 5:case"end":return e.stop()}}),e,this)}))),function(){return U.apply(this,arguments)})},{key:"_checkGameDeleted",value:function(){var e=this;6===this._gameData.status&&(console.log("%c %c %c This game was deleted, please remove it in your website... ","background: #F2181A","background: #F23818","color: #fff; background: #F23818;","background: #F55E60","background: #F55E60","background: #c4161e; color: #fff;"),setTimeout(function(){t(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;m.available&&m.getBoolean("gd_debug_ex")&&(m.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=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._bridge.isCoreSDKMode){e.next=2;break}return e.abrupt("return");case 2:return(t=this._gameData).sdk.enabled&&(this.options.advertisementSettings=h(this.options.advertisementSettings,t.sdk)),this.macros=new E({game:t,bridge:this._bridge}),this.adInstance=new Iy(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=pv,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){p("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){p("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){p(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status,skipForward:e.skipForward})}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:(P=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Yv();case 2:return t=e.sent,this._bridge.noPreroll=(!this._getisMobile()||!1!==t.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(t),x(t.diagnostic),e.abrupt("return",t);case 8:case"end":return e.stop()}}),e,this)}))),function(){return P.apply(this,arguments)})},{key:"_createSplash",value:(O=e(r.mark((function e(n,i){var a,s,o,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(n);case 2:return a=e.sent,s=new a(Zy(Zy({},this.options),{},{isConsentDomain:i,version:pv.version}),n,this._parentDomain),e.next=6,eg();case 6:o=e.sent,c=o.enabled,s.on("playClick",function(){var e=this;if(t(this,u),i){var n=new Date;n.setDate(n.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(n.toUTCString(),"; path=/")}this._hideCMPButton(),c?window.gdsdk.showAd(v.Interstitial,{position:"preroll"}).catch(function(n){t(this,e),s.hide()}.bind(this)):(function(){t(this,e)}.bind(this),this.showAd(v.Interstitial,{position:"preroll"}).catch(function(n){t(this,e)}.bind(this)))}.bind(this)),this.onPauseGame("Pause the game and wait for a user gesture","success"),this.eventBus.subscribe("SDK_GAME_PAUSE",function(){t(this,u),s.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){t(this,u),s.hide()}.bind(this));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(D=e(r.mark((function e(n,i){var a,s,o,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(n);case 3:o=e.sent,(c=new o(Zy(Zy({},this.options),{},{isConsentDomain:i,version:pv.version,template:null===(a=n.promo)||void 0===a||null===(s=a.template)||void 0===s?void 0:s.preroll}),n)).on("done",function(){t(this,u),c.hide(),this._createSplash(n,i)}.bind(this)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),this._createSplash(n,i);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t){return D.apply(this,arguments)})},{key:"_createPromo",value:(w=e(r.mark((function e(n,i){var a,s,o,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(n);case 3:o=e.sent,(c=new o(Zy(Zy({},this.options),{},{isConsentDomain:i,version:pv.version,template:null===(a=n.promo)||void 0===a||null===(s=a.template)||void 0===s?void 0:s.preroll}),n)).on("done",function(){t(this,u),c.hide(),this.onResumeGame("Resumed after the promo","warning")}.bind(this)),this.onPauseGame("Pause the game for the promo","success"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),this.onResumeGame("Resumed after the promo","warning");case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(e,t){return w.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(v.Interstitial).catch(function(){t(this,e)}.bind(this))}},{key:"showAd",value:(b=e(r.mark((function n(i){var a,s=this,o=arguments;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=o.length>1&&void 0!==o[1]?o[1]:{},n.abrupt("return",new Promise(function(){var n=e(r.mark((function e(n,o){var c,u,d,l,h,p,f,m,v,g,y,b,_,w,A=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p={adType:i,params:a,adTimestamp:s.adRequestTimer},e.next=4,s.sdkReady;case 4:return f=e.sent,e.next=7,s.videoAdReady;case 7:return null!==(c=s._gameData.lp)&&void 0!==c&&c.load||s._sendLoadedEvent(),s._sendGamedockGamePlay(),s._rejectAdIfGameBlocked({gameData:f,adRequest:p}),s._rejectAdIfAdDisabled({gameData:f,adRequest:p}),s._rejectAdIfUnsupportedType({adRequest:p}),s._rejectAdIfRewardedDisabled({gameData:f,adRequest:p}),(null===(u=f.gft)||void 0===u||!u.enabled||null!==(d=f.gft)&&void 0!==d&&d.enabled&&(null==f||null===(l=f.gft)||void 0===l||null===(h=l.durations[s._giftCount])||void 0===h?void 0:h.after)!==s.adInstance.adMidrollCount)&&s._rejectAdIfAdRateHits({gameData:f,adRequest:p}),s.adInstance.attachAfgPosition(p),s._attachAfgFallback({gameData:f,adRequest:p}),m="main.showad",v=function(e){var n,r,i;t(this,A),s.eventBus.unsubscribeScope(m),s.onResumeGame(e.message,"warning"),null!=f&&null!==(n=f.gft)&&void 0!==n&&n.enabled&&(null==f||null===(r=f.gft)||void 0===r||null===(i=r.durations[s._giftCount])||void 0===i?void 0:i.after)===s.adInstance.adMidrollCount&&s.decideToGiveAGift(),o(e.message)}.bind(this),g=function(e){var r,i,a;t(this,A),s.eventBus.unsubscribeScope(m),s.adRequestTimer=Date.now(),s.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),null!=f&&null!==(r=f.gft)&&void 0!==r&&r.enabled&&(null==f||null===(i=f.gft)||void 0===i||null===(a=i.durations[s._giftCount])||void 0===a?void 0:a.after)===s.adInstance.adMidrollCount&&s.decideToGiveAGift(),n(e.message)}.bind(this),y=function(e){var r=this;t(this,A),s.eventBus.unsubscribeScope(m),a.fallback_adsense=!1,s.showAd(i,Zy(Zy({},a),{},{adapter:"adsense"})).then(function(e){t(this,r),n(e)}.bind(this)).catch(function(e){t(this,r),o(e)}.bind(this))}.bind(this),b=function(e){var r=this;t(this,A),s.eventBus.unsubscribeScope(m),a.fallback_adsense=!1,s.showAd(i,Zy(Zy({},a),{},{adapter:"promo"})).then(function(e){t(this,r),n(e)}.bind(this)).catch(function(e){t(this,r),o(e)}.bind(this))}.bind(this),_=function(){var e,n,r;t(this,A);var i=!("promo"===(null==a?void 0:a.adapter)||("reward"!==(null==a?void 0:a.position)||f.afg_disabled)&&"adsense"!==(null==a?void 0:a.adapter)),s=null===(e=f.promo)||void 0===e||null===(n=e.rainbow)||void 0===n?void 0:n.enabled,o=null===(r=f.promo)||void 0===r?void 0:r.onadsense;return i&&s&&o?b:null!=a&&a.fallback_adsense?y:v}.bind(this),w=_(),s.eventBus.subscribe("AD_ERROR",function(e){t(this,A),w(e)}.bind(this),m),s.eventBus.subscribe("AD_SDK_CANCELED",w,m),s.eventBus.subscribe("AD_SUCCESS",g,m),e.next=28,s.adInstance.startAd(p);case 28:s._post_message({topic:"adrequest.instream"}),e.next=35;break;case 31:e.prev=31,e.t0=e.catch(0),s.onResumeGame(e.t0.message,"warning"),o(e.t0.message);case 35:case"end":return e.stop()}}),e,this,[[0,31]])})));return function(e,t){return n.apply(this,arguments)}}()));case 2:case"end":return n.stop()}}),n)}))),function(e){return b.apply(this,arguments)})},{key:"clearSession",value:function(){this.adInstance.clearSession()}},{key:"_attachAfgFallback",value:function(e){var t=e.gameData,n=e.adRequest;if(!t.afg_disabled&&!n.params.hasOwnProperty("fallback_adsense"))switch(n.params.position){case"preroll":case"start":case"next":n.params.fallback_adsense=!0}}},{key:"_rejectAdIfGameBlocked",value:function(e){var t=e.gameData;if(t.bloc_gard&&!0===t.bloc_gard.enabled)throw new Error("Game or domain is blocked.")}},{key:"_rejectAdIfAdDisabled",value:function(e){if(!e.gameData.enableAds||this._whitelabelPartner)throw new Error("Advertisements are disabled.")}},{key:"_rejectAdIfUnsupportedType",value:function(e){var t=e.adRequest;if(t.adType){if(t.adType!==v.Interstitial&&t.adType!==v.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=v.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===v.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,c=e.adRequest,u=null;c.adType===v.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(c.adType===v.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<u)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(y=e(r.mark((function t(n){var i=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,a){var s,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.sdkReady;case 3:return s=e.sent,e.next=6,i.videoAdReady;case 6:if(!s.bloc_gard||!0!==s.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(s.enableAds&&!i._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(n){e.next=14;break}n=v.Rewarded,e.next=16;break;case 14:if(n===v.Interstitial||n===v.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+n);case 16:if(n!==v.Rewarded||s.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,i.adInstance.preloadAd(n);case 20:o=e.sent,t(o),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),a(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(e){return y.apply(this,arguments)})},{key:"cancelAd",value:(g=e(r.mark((function t(){var n=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,i){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{n.adInstance.cancel(),n.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),i()}catch(e){n.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),t(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(){return g.apply(this,arguments)})},{key:"showDisplayAd",value:function(t){var n=this;return new Promise(function(){var i=e(r.mark((function e(i,a){var s;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return s=e.sent,e.next=6,n.videoAdReady;case 6:if(!s.dAds.enabled){e.next=13;break}return e.next=9,n.adInstance.loadDisplayAd(t);case 9:n._post_message({topic:"adrequest.display"}),i(),e.next=14;break;case 13:a("Display-Ads are disabled.");case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(0),a(e.t0.message||e.t0);case 19:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(e,t){return i.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){var n;this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_START";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),this.adInstance&&this.adInstance._hideAddResume(),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||Qy({event:"GameStarted",game:this._gameData})}},{key:"onPauseGame",value:function(e,t){var n;this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_PAUSE";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||Qy({event:"GamePaused",game:this._gameData})}},{key:"openConsole",value:function(){try{new S(this).start(),m.set("gd_debug_ex",!0)}catch(e){console.log(e)}}},{key:"_initBlockingExternals",value:function(){var e=this._gameData;(e.failed||e.block_exts&&e.block_exts.enabled)&&(this.window_open=window.open,this._allowExternals({enabled:!1}),this._removeExternalsInHtml({enabled:!1}))}},{key:"_checkFullscreen",value:function(){var e=this;try{var n=this._gameData;n.sdk.fullscreen&&"auto"===n.sdk.fullscreen&&document.addEventListener("click",function(){if(t(this,e),!this._isFullScreen){var n=document.body,r=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullscreen;if(r)r.call(n);else if(void 0!==window.ActiveXObject){var i=new ActiveXObject("WScript.Shell");null!==i&&i.SendKeys("{F11}")}this._isFullScreen=!0}}.bind(this))}catch(e){console.log("Fullscreen error handled...",e)}}},{key:"_allowExternals",value:function(e){var n=this;void 0!==this.window_open&&(!1===e.enabled?window.open=function(e){t(this,n),this.msgrt.send("external",{message:"C> ".concat(e)}),(e.startsWith("https://play.google.com")||e.startsWith("https://itunes.apple.com"))&&this.window_open.call(null,e)}.bind(this):window.open=this.window_open)}},{key:"_removeExternalsInHtml",value:function(e){var n=this;!1===e.enabled&&window.document.querySelectorAll("a").forEach(function(e){var r=this;t(this,n);var i=!!(e.innerText.toLowerCase().includes("start")||e.innerText.toLowerCase().includes("play")||e.innerText.toLowerCase().includes("continue")),a=e.getAttribute("href");e.removeAttribute("href"),i||(e.onclick=function(e){return t(this,r),e.preventDefault(),this.msgrt.send("external",{message:"H> ".concat(a)}),!1}.bind(this))}.bind(this))}},{key:"_getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var c=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:i()),u=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:a()),d=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===s()?u:o()),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,v=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled,y=(e||n)&&r.loaderEnabled,b=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:l,noLoadedEvent:h,noBlockerEvent:p,noPreroll:y,parentURL:c,parentDomain:u,topDomain:d&&d.length?d:u,noGAPageView:f,noLotamePageView:m,noGamedockSDK:v,noMinijuegosSDK:g,version:r.version,pauseGameOnStartup:b,depth:s(),domainMatched:u===d,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isLoaderGameURL",value:function(){return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)&&location.href.startsWith("https://html5.gamedistribution.com")}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var n=new I(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new I(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var i=new I(location.href,!0);if(!i.query.gd_zone_config)return;e=i.query.gd_zone_config}return JSON.parse(C.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new Oy(t).splash()}},{key:"_createPrerollPromoTemplate",value:(u=e(r.mark((function e(t){var n,i,a,s,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=null===(n=t.promo)||void 0===n?void 0:n[null===(i=t.promo)||void 0===i||null===(a=i.template)||void 0===a?void 0:a.preroll],o=new Cy(s),e.abrupt("return",o.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return u.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(C.encode(JSON.stringify(e)))}catch(e){}try{var n=new I(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(G.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new I(e,!0);return n.query=Zy(Zy({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return C.encode(JSON.stringify(e))}},{key:"session",value:function(){var t=this;return new Promise(function(){var n=e(r.mark((function e(n,i){var a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.sdkReady;case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:a=t._gameData,n({ads:{display:{enabled:a.dAds.enabled},rewarded:{enabled:a.rewardedAds}},location:{parentDomain:t._bridge.parentDomain,topDomain:t._bridge.topDomain,parentURL:t._bridge.parentURL,depth:t._bridge.depth,loadedByGameZone:t._bridge.isTokenGameURL}});case 9:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"_getisMobile",value:function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),!1===t&&window.orientation>-1&&(t=!0),t}},{key:"_get_game_thumbnail_url",value:function(){var e=this,n=this._gameData,r=n.assets.find(function(n){return t(this,e),n.hasOwnProperty("name")&&512===n.width&&512===n.height}.bind(this));return r||(r=n.assets.length>0?n.assets[0]:{name:"logo.svg"}),"https://img.gamedistribution.com/".concat(r.name)}},{key:"_post_message",value:function(e){var t,n=e.topic,r=e.data,i=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var a=window.top||window.parent;a&&a.postMessage({source:"gdsdk",topic:n,data:r},i)}catch(e){console.error((null==e?void 0:e.message)||e)}}},{key:"decideToGiveAGift",value:function(){var n=this;try{var i,a=null===(i=this._gameData)||void 0===i?void 0:i.gft,s=setInterval(e(r.mark((function e(){var i=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.adInstance.requestRunning?console.log("Advertisement already running..."):(n.showAd(v.Interstitial,{position:"midroll"}).catch(function(e){t(this,i)}.bind(this)),clearInterval(s),n._giftCount++);case 1:case"end":return e.stop()}}),e,this)}))),1e3*a.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}}]),n}(),ib={},ab=function(e){try{if(e.skipForward)return;if(ib.source){var t={type:"gd-sdk-on-event",event:e};ib.source.postMessage(t,ib.origin)}}catch(e){console.log("gd-sdk forwardEvent err",e)}},sb=function(){ab({name:"SDK_READY",status:"success",message:"Everything is ready."}),ab({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),ab({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},ob=function(n){window.addEventListener("message",(function(i){var a=i.data,s=i.origin,o=i.source,c=a.type,u=a.method,d=a.options;if("gd-sdk-self"!==c){if("gd-sdk"===c){if(!ib.source&&"init"===u)return function(e){var t=e.source,n=e.origin;ib={source:t,origin:n}}({source:o,origin:s}),void sb();var l=n[u];l&&e(r.mark((function e(){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,function(){t(this,a),"showAd"===u&&Br.firstAdapterModeAdsense&&"rewarded"!==d.adType&&(console.log("promo-test, set first adapter to adssense 3"),d.params=d.params?d.params:{},d.params.adapter="adsense")}.bind(this),!(i=l.apply(n,Object.values(d)))||!i.then){e.next=6;break}return e.next=6,i;case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.log("gd:adp:m:r onFrameMessage error",e.t0);case 11:case"end":return e.stop()}}),e,this,[[0,8]])})))()}}else{var h={type:"gd-sdk",method:u,options:d};window.postMessage(h,"https://html5.gamedistribution.com")}}),!1)},cb=function(e){!function(e){var t=e.onEvent;e.onEvent=function(e){ab(e),t.apply(this,arguments)}}(e);var t=new rb(e);return ob(t),t},ub=function(e){try{var t=zv(e);e.gameId||t.send("nogameid",{message:"".concat(Gh.parentURL)})}catch(e){}},db={create:function(){var t=e(r.mark((function e(t){var n,i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,ub(t),Gv=zv(qv=t),e.next=5,cg();case 5:return n=e.sent,i=n?ag(t):cb(t),tg(),e.abrupt("return",i);case 11:return e.prev=11,e.t0=e.catch(0),console.log("gd:adp: sdk adaptor create failed, fallback to default adapter",e.t0),e.abrupt("return",cb(t));case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(e){return t.apply(this,arguments)}}()};function lb(){return(lb=e(r.mark((function e(t,n){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ig();case 2:if(!e.sent){e.next=7;break}e.t0=window.gdsdk,e.next=10;break;case 7:return e.next=9,pb(t);case 9:e.t0=e.sent;case 10:return i=e.t0,e.abrupt("return",n(i));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var hb=!1;function pb(e){var n=this;return new Promise(function(r,i){var a=this;if(t(this,n),eb)return r(eb);if(hb)var s=setInterval(function(){t(this,a),eb&&(hb=!1,clearInterval(s),r(eb))}.bind(this),100);else hb=!0,db.create(e).then(function(e){t(this,a),eb=e,e._sendSDKReady(),hb=!1,r(eb)}.bind(this))}.bind(this))}var fb,mb=(pb(fb=function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":n(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===n(window.gdApi.q[0][0])&&window.gdApi.q[0][0]&&((e=window.gdApi.q[0][0]).hasOwnProperty("advertisementSettings")||(e.advertisementSettings={autoplay:!0}))}catch(e){console.log("_get_developer_sets failed",e)}return e}()),{invoke:function(e){return function(e,t){return lb.apply(this,arguments)}(fb,e)}});function vb(){var n=this;this.AdType=v,this.preloadAd=function(e){var n=this;return mb.invoke(function(r){return t(this,n),r.preloadAd(e)}.bind(this))},this.showAd=function(){var n=e(r.mark((function e(n,i){var a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",mb.invoke(function(e){var r=this;if(t(this,a),n===v.Display)return e.showDisplayAd(i);return function(){t(this,r)}.bind(this),e.showAd(n,{})}.bind(this)));case 1:case"end":return e.stop()}}),e,this)})));return function(e,t){return n.apply(this,arguments)}}(),this.cancelAd=function(){var e=this;return mb.invoke(function(n){return t(this,e),n.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return mb.invoke(function(n){return t(this,e),n.openConsole()}.bind(this))},this.getSession=function(){var e=this;return mb.invoke(function(n){return t(this,e),n.session()}.bind(this))},this.leaderboard={show:function(){t(this,n),Dl.showLeaderboard()}.bind(this),addScore:function(e){t(this,n),Dl.addScore(e)}.bind(this)}}vb.prototype=new function(){this.showBanner=function(){var e=this;return mb.invoke(function(n){return t(this,e),n.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new vb,window.gdApi=window.gdsdk;
|
|
1
|
+
import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/newArrowCheck";import n from"@babel/runtime/helpers/typeof";import r from"@babel/runtime/regenerator";import{getParentUrl as i,getParentDomain as a,getIframeDepth as s,getTopDomain as o,getQueryParams as c,parseJSON as u,getMobilePlatform as d,MessageRouter as l,extendDefaults as h,dankLog as p,getScript as f,Ls as m,AdType as v,Layers as g,getKeyByValue as y,getQueryString as b,EventBus as _,getIMASampleTags as w,SDKEvents as A,IMAEvents as k,Macros as E,setDankLog as x,ImplementationTest as S}from"@bygd/gd-sdk-era/dist/default";import R from"@babel/runtime/helpers/classCallCheck";import D from"@babel/runtime/helpers/defineProperty";import T from"@babel/runtime/helpers/createClass";import I from"url-parse";import{Base64 as C}from"js-base64";import O from"validator";import P from"is-valid-domain";import L from"get-value";import U from"set-value";import M from"lodash.clonedeep";import j from"can-autoplay";import{isPlainObject as B}from"is-plain-object";import G from"querystringify";import N from"lodash.merge";import{EventEmitter as q}from"events";import{v4 as F}from"uuid";var V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},W=function(e){return e&&e.Math==Math&&e},K=W("object"==typeof globalThis&&globalThis)||W("object"==typeof window&&window)||W("object"==typeof self&&self)||W("object"==typeof V&&V)||Function("return this")(),H={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},z=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},$=z,Q=function(e,t,n){if($(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},Y=function(e){try{return!!e()}catch(e){return!0}},J={}.toString,X=function(e){return J.call(e).slice(8,-1)},Z=X,ee="".split,te=Y((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==Z(e)?ee.call(e,""):Object(e)}:Object,ne=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},re=ne,ie=function(e){return Object(re(e))},ae=Math.ceil,se=Math.floor,oe=function(e){return isNaN(e=+e)?0:(e>0?se:ae)(e)},ce=oe,ue=Math.min,de=function(e){return e>0?ue(ce(e),9007199254740991):0},le=function(e){return"object"==typeof e?null!==e:"function"==typeof e},he=X,pe=Array.isArray||function(e){return"Array"==he(e)},fe={exports:{}},me=!Y((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),ve={},ge=le,ye=K.document,be=ge(ye)&&ge(ye.createElement),_e=function(e){return be?ye.createElement(e):{}},we=_e,Ae=!me&&!Y((function(){return 7!=Object.defineProperty(we("div"),"a",{get:function(){return 7}}).a})),ke=le,Ee=function(e){if(!ke(e))throw TypeError(String(e)+" is not an object");return e},xe=le,Se=function(e,t){if(!xe(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!xe(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!xe(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!xe(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},Re=me,De=Ae,Te=Ee,Ie=Se,Ce=Object.defineProperty;ve.f=Re?Ce:function(e,t,n){if(Te(e),t=Ie(t,!0),Te(n),De)try{return Ce(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Oe=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Pe=ve,Le=Oe,Ue=me?function(e,t,n){return Pe.f(e,t,Le(1,n))}:function(e,t,n){return e[t]=n,e},Me=K,je=Ue,Be=function(e,t){try{je(Me,e,t)}catch(n){Me[e]=t}return t},Ge=Be,Ne=K["__core-js_shared__"]||Ge("__core-js_shared__",{}),qe=Ne;(fe.exports=function(e,t){return qe[e]||(qe[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var Fe={}.hasOwnProperty,Ve=function(e,t){return Fe.call(e,t)},We=0,Ke=Math.random(),He=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++We+Ke).toString(36)},ze=Y,$e=!!Object.getOwnPropertySymbols&&!ze((function(){return!String(Symbol())})),Qe=$e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ye=K,Je=fe.exports,Xe=Ve,Ze=He,et=$e,tt=Qe,nt=Je("wks"),rt=Ye.Symbol,it=tt?rt:rt&&rt.withoutSetter||Ze,at=function(e){return Xe(nt,e)||(et&&Xe(rt,e)?nt[e]=rt[e]:nt[e]=it("Symbol."+e)),nt[e]},st=le,ot=pe,ct=at("species"),ut=function(e,t){var n;return ot(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!ot(n.prototype)?st(n)&&null===(n=n[ct])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},dt=Q,lt=te,ht=ie,pt=de,ft=ut,mt=[].push,vt=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,a=6==e,s=5==e||a;return function(o,c,u,d){for(var l,h,p=ht(o),f=lt(p),m=dt(c,u,3),v=pt(f.length),g=0,y=d||ft,b=t?y(o,v):n?y(o,0):void 0;v>g;g++)if((s||g in f)&&(h=m(l=f[g],g,p),e))if(t)b[g]=h;else if(h)switch(e){case 3:return!0;case 5:return l;case 6:return g;case 2:mt.call(b,l)}else if(i)return!1;return a?-1:r||i?i:b}},gt={forEach:vt(0),map:vt(1),filter:vt(2),some:vt(3),every:vt(4),find:vt(5),findIndex:vt(6)},yt=Y,bt=function(e,t){var n=[][e];return!!n&&yt((function(){n.call(null,t||function(){throw 1},1)}))},_t=me,wt=Y,At=Ve,kt=Object.defineProperty,Et={},xt=function(e){throw e},St=function(e,t){if(At(Et,e))return Et[e];t||(t={});var n=[][e],r=!!At(t,"ACCESSORS")&&t.ACCESSORS,i=At(t,0)?t[0]:xt,a=At(t,1)?t[1]:void 0;return Et[e]=!!n&&!wt((function(){if(r&&!_t)return!0;var e={length:-1};r?kt(e,1,{enumerable:!0,get:xt}):e[1]=1,n.call(e,i,a)}))},Rt=gt.forEach,Dt=St,Tt=bt("forEach"),It=Dt("forEach"),Ct=K,Ot=H,Pt=Tt&&It?[].forEach:function(e){return Rt(this,e,arguments.length>1?arguments[1]:void 0)},Lt=Ue;for(var Ut in Ot){var Mt=Ct[Ut],jt=Mt&&Mt.prototype;if(jt&&jt.forEach!==Pt)try{Lt(jt,"forEach",Pt)}catch(e){jt.forEach=Pt}}var Bt={},Gt={},Nt={}.propertyIsEnumerable,qt=Object.getOwnPropertyDescriptor,Ft=qt&&!Nt.call({1:2},1);Gt.f=Ft?function(e){var t=qt(this,e);return!!t&&t.enumerable}:Nt;var Vt=te,Wt=ne,Kt=function(e){return Vt(Wt(e))},Ht=me,zt=Gt,$t=Oe,Qt=Kt,Yt=Se,Jt=Ve,Xt=Ae,Zt=Object.getOwnPropertyDescriptor;Bt.f=Ht?Zt:function(e,t){if(e=Qt(e),t=Yt(t,!0),Xt)try{return Zt(e,t)}catch(e){}if(Jt(e,t))return $t(!zt.f.call(e,t),e[t])};var en={exports:{}},tn=Ne,nn=Function.toString;"function"!=typeof tn.inspectSource&&(tn.inspectSource=function(e){return nn.call(e)});var rn,an,sn,on=tn.inspectSource,cn=on,un=K.WeakMap,dn="function"==typeof un&&/native code/.test(cn(un)),ln=fe.exports,hn=He,pn=ln("keys"),fn=function(e){return pn[e]||(pn[e]=hn(e))},mn={},vn=dn,gn=le,yn=Ue,bn=Ve,_n=fn,wn=mn,An=K.WeakMap;if(vn){var kn=new An,En=kn.get,xn=kn.has,Sn=kn.set;rn=function(e,t){return Sn.call(kn,e,t),t},an=function(e){return En.call(kn,e)||{}},sn=function(e){return xn.call(kn,e)}}else{var Rn=_n("state");wn[Rn]=!0,rn=function(e,t){return yn(e,Rn,t),t},an=function(e){return bn(e,Rn)?e[Rn]:{}},sn=function(e){return bn(e,Rn)}}var Dn={set:rn,get:an,has:sn,enforce:function(e){return sn(e)?an(e):rn(e,{})},getterFor:function(e){return function(t){var n;if(!gn(t)||(n=an(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},Tn=K,In=Ue,Cn=Ve,On=Be,Pn=on,Ln=Dn.get,Un=Dn.enforce,Mn=String(String).split("String");(en.exports=function(e,t,n,r){var i=!!r&&!!r.unsafe,a=!!r&&!!r.enumerable,s=!!r&&!!r.noTargetGet;"function"==typeof n&&("string"!=typeof t||Cn(n,"name")||In(n,"name",t),Un(n).source=Mn.join("string"==typeof t?t:"")),e!==Tn?(i?!s&&e[t]&&(a=!0):delete e[t],a?e[t]=n:In(e,t,n)):a?e[t]=n:On(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&Ln(this).source||Pn(this)}));var jn=K,Bn=jn,Gn=K,Nn=function(e){return"function"==typeof e?e:void 0},qn=function(e,t){return arguments.length<2?Nn(Bn[e])||Nn(Gn[e]):Bn[e]&&Bn[e][t]||Gn[e]&&Gn[e][t]},Fn={},Vn=oe,Wn=Math.max,Kn=Math.min,Hn=function(e,t){var n=Vn(e);return n<0?Wn(n+t,0):Kn(n,t)},zn=Kt,$n=de,Qn=Hn,Yn=function(e){return function(t,n,r){var i,a=zn(t),s=$n(a.length),o=Qn(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}},Jn={includes:Yn(!0),indexOf:Yn(!1)},Xn=Ve,Zn=Kt,er=Jn.indexOf,tr=mn,nr=function(e,t){var n,r=Zn(e),i=0,a=[];for(n in r)!Xn(tr,n)&&Xn(r,n)&&a.push(n);for(;t.length>i;)Xn(r,n=t[i++])&&(~er(a,n)||a.push(n));return a},rr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ir=nr,ar=rr.concat("length","prototype");Fn.f=Object.getOwnPropertyNames||function(e){return ir(e,ar)};var sr={};sr.f=Object.getOwnPropertySymbols;var or=Fn,cr=sr,ur=Ee,dr=qn("Reflect","ownKeys")||function(e){var t=or.f(ur(e)),n=cr.f;return n?t.concat(n(e)):t},lr=Ve,hr=dr,pr=Bt,fr=ve,mr=function(e,t){for(var n=hr(t),r=fr.f,i=pr.f,a=0;a<n.length;a++){var s=n[a];lr(e,s)||r(e,s,i(t,s))}},vr=Y,gr=/#|\.prototype\./,yr=function(e,t){var n=_r[br(e)];return n==Ar||n!=wr&&("function"==typeof t?vr(t):!!t)},br=yr.normalize=function(e){return String(e).replace(gr,".").toLowerCase()},_r=yr.data={},wr=yr.NATIVE="N",Ar=yr.POLYFILL="P",kr=yr,Er=K,xr=Bt.f,Sr=Ue,Rr=en.exports,Dr=Be,Tr=mr,Ir=kr,Cr=function(e,t){var n,r,i,a,s,o=e.target,c=e.global,u=e.stat;if(n=c?Er:u?Er[o]||Dr(o,{}):(Er[o]||{}).prototype)for(r in t){if(a=t[r],i=e.noTargetGet?(s=xr(n,r))&&s.value:n[r],!Ir(c?r:o+(u?".":"#")+r,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;Tr(a,i)}(e.sham||i&&i.sham)&&Sr(a,"sham",!0),Rr(n,r,a,e)}},Or=nr,Pr=rr,Lr=Object.keys||function(e){return Or(e,Pr)},Ur=ie,Mr=Lr;Cr({target:"Object",stat:!0,forced:Y((function(){Mr(1)}))},{keys:function(e){return Mr(Ur(e))}});var jr,Br={},Gr=ve,Nr=Ee,qr=Lr,Fr=me?Object.defineProperties:function(e,t){Nr(e);for(var n,r=qr(t),i=r.length,a=0;i>a;)Gr.f(e,n=r[a++],t[n]);return e},Vr=qn("document","documentElement"),Wr=Ee,Kr=Fr,Hr=rr,zr=mn,$r=Vr,Qr=_e,Yr=fn("IE_PROTO"),Jr=function(){},Xr=function(e){return"<script>"+e+"<\/script>"},Zr=function(){try{jr=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;Zr=jr?function(e){e.write(Xr("")),e.close();var t=e.parentWindow.Object;return e=null,t}(jr):((t=Qr("iframe")).style.display="none",$r.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Xr("document.F=Object")),e.close(),e.F);for(var n=Hr.length;n--;)delete Zr.prototype[Hr[n]];return Zr()};zr[Yr]=!0;var ei=Object.create||function(e,t){var n;return null!==e?(Jr.prototype=Wr(e),n=new Jr,Jr.prototype=null,n[Yr]=e):n=Zr(),void 0===t?n:Kr(n,t)},ti={},ni=Kt,ri=Fn.f,ii={}.toString,ai="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];ti.f=function(e){return ai&&"[object Window]"==ii.call(e)?function(e){try{return ri(e)}catch(e){return ai.slice()}}(e):ri(ni(e))};var si={},oi=at;si.f=oi;var ci=jn,ui=Ve,di=si,li=ve.f,hi=function(e){var t=ci.Symbol||(ci.Symbol={});ui(t,e)||li(t,e,{value:di.f(e)})},pi=ve.f,fi=Ve,mi=at("toStringTag"),vi=function(e,t,n){e&&!fi(e=n?e:e.prototype,mi)&&pi(e,mi,{configurable:!0,value:t})},gi=Cr,yi=K,bi=qn,_i=me,wi=$e,Ai=Qe,ki=Y,Ei=Ve,xi=pe,Si=le,Ri=Ee,Di=ie,Ti=Kt,Ii=Se,Ci=Oe,Oi=ei,Pi=Lr,Li=Fn,Ui=ti,Mi=sr,ji=Bt,Bi=ve,Gi=Gt,Ni=Ue,qi=en.exports,Fi=fe.exports,Vi=mn,Wi=He,Ki=at,Hi=si,zi=hi,$i=vi,Qi=Dn,Yi=gt.forEach,Ji=fn("hidden"),Xi=Ki("toPrimitive"),Zi=Qi.set,ea=Qi.getterFor("Symbol"),ta=Object.prototype,na=yi.Symbol,ra=bi("JSON","stringify"),ia=ji.f,aa=Bi.f,sa=Ui.f,oa=Gi.f,ca=Fi("symbols"),ua=Fi("op-symbols"),da=Fi("string-to-symbol-registry"),la=Fi("symbol-to-string-registry"),ha=Fi("wks"),pa=yi.QObject,fa=!pa||!pa.prototype||!pa.prototype.findChild,ma=_i&&ki((function(){return 7!=Oi(aa({},"a",{get:function(){return aa(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=ia(ta,t);r&&delete ta[t],aa(e,t,n),r&&e!==ta&&aa(ta,t,r)}:aa,va=function(e,t){var n=ca[e]=Oi(na.prototype);return Zi(n,{type:"Symbol",tag:e,description:t}),_i||(n.description=t),n},ga=Ai?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof na},ya=function(e,t,n){e===ta&&ya(ua,t,n),Ri(e);var r=Ii(t,!0);return Ri(n),Ei(ca,r)?(n.enumerable?(Ei(e,Ji)&&e[Ji][r]&&(e[Ji][r]=!1),n=Oi(n,{enumerable:Ci(0,!1)})):(Ei(e,Ji)||aa(e,Ji,Ci(1,{})),e[Ji][r]=!0),ma(e,r,n)):aa(e,r,n)},ba=function(e,t){Ri(e);var n=Ti(t),r=Pi(n).concat(ka(n));return Yi(r,(function(t){_i&&!_a.call(n,t)||ya(e,t,n[t])})),e},_a=function(e){var t=Ii(e,!0),n=oa.call(this,t);return!(this===ta&&Ei(ca,t)&&!Ei(ua,t))&&(!(n||!Ei(this,t)||!Ei(ca,t)||Ei(this,Ji)&&this[Ji][t])||n)},wa=function(e,t){var n=Ti(e),r=Ii(t,!0);if(n!==ta||!Ei(ca,r)||Ei(ua,r)){var i=ia(n,r);return!i||!Ei(ca,r)||Ei(n,Ji)&&n[Ji][r]||(i.enumerable=!0),i}},Aa=function(e){var t=sa(Ti(e)),n=[];return Yi(t,(function(e){Ei(ca,e)||Ei(Vi,e)||n.push(e)})),n},ka=function(e){var t=e===ta,n=sa(t?ua:Ti(e)),r=[];return Yi(n,(function(e){!Ei(ca,e)||t&&!Ei(ta,e)||r.push(ca[e])})),r};(wi||(qi((na=function(){if(this instanceof na)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=Wi(e),n=function(e){this===ta&&n.call(ua,e),Ei(this,Ji)&&Ei(this[Ji],t)&&(this[Ji][t]=!1),ma(this,t,Ci(1,e))};return _i&&fa&&ma(ta,t,{configurable:!0,set:n}),va(t,e)}).prototype,"toString",(function(){return ea(this).tag})),qi(na,"withoutSetter",(function(e){return va(Wi(e),e)})),Gi.f=_a,Bi.f=ya,ji.f=wa,Li.f=Ui.f=Aa,Mi.f=ka,Hi.f=function(e){return va(Ki(e),e)},_i&&(aa(na.prototype,"description",{configurable:!0,get:function(){return ea(this).description}}),qi(ta,"propertyIsEnumerable",_a,{unsafe:!0}))),gi({global:!0,wrap:!0,forced:!wi,sham:!wi},{Symbol:na}),Yi(Pi(ha),(function(e){zi(e)})),gi({target:"Symbol",stat:!0,forced:!wi},{for:function(e){var t=String(e);if(Ei(da,t))return da[t];var n=na(t);return da[t]=n,la[n]=t,n},keyFor:function(e){if(!ga(e))throw TypeError(e+" is not a symbol");if(Ei(la,e))return la[e]},useSetter:function(){fa=!0},useSimple:function(){fa=!1}}),gi({target:"Object",stat:!0,forced:!wi,sham:!_i},{create:function(e,t){return void 0===t?Oi(e):ba(Oi(e),t)},defineProperty:ya,defineProperties:ba,getOwnPropertyDescriptor:wa}),gi({target:"Object",stat:!0,forced:!wi},{getOwnPropertyNames:Aa,getOwnPropertySymbols:ka}),gi({target:"Object",stat:!0,forced:ki((function(){Mi.f(1)}))},{getOwnPropertySymbols:function(e){return Mi.f(Di(e))}}),ra)&&gi({target:"JSON",stat:!0,forced:!wi||ki((function(){var e=na();return"[null]"!=ra([e])||"{}"!=ra({a:e})||"{}"!=ra(Object(e))}))},{stringify:function(e,t,n){for(var r,i=[e],a=1;arguments.length>a;)i.push(arguments[a++]);if(r=t,(Si(t)||void 0!==e)&&!ga(e))return xi(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!ga(t))return t}),i[1]=t,ra.apply(null,i)}});na.prototype[Xi]||Ni(na.prototype,Xi,na.prototype.valueOf),$i(na,"Symbol"),Vi[Ji]=!0;var Ea,xa,Sa=qn("navigator","userAgent")||"",Ra=Sa,Da=K.process,Ta=Da&&Da.versions,Ia=Ta&&Ta.v8;Ia?xa=(Ea=Ia.split("."))[0]+Ea[1]:Ra&&(!(Ea=Ra.match(/Edge\/(\d+)/))||Ea[1]>=74)&&(Ea=Ra.match(/Chrome\/(\d+)/))&&(xa=Ea[1]);var Ca=xa&&+xa,Oa=Y,Pa=Ca,La=at("species"),Ua=function(e){return Pa>=51||!Oa((function(){var t=[];return(t.constructor={})[La]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Ma=Cr,ja=gt.filter,Ba=St,Ga=Ua("filter"),Na=Ba("filter");Ma({target:"Array",proto:!0,forced:!Ga||!Na},{filter:function(e){return ja(this,e,arguments.length>1?arguments[1]:void 0)}});var qa=Cr,Fa=Y,Va=Kt,Wa=Bt.f,Ka=me,Ha=Fa((function(){Wa(1)}));qa({target:"Object",stat:!0,forced:!Ka||Ha,sham:!Ka},{getOwnPropertyDescriptor:function(e,t){return Wa(Va(e),t)}});var za=Se,$a=ve,Qa=Oe,Ya=function(e,t,n){var r=za(t);r in e?$a.f(e,r,Qa(0,n)):e[r]=n},Ja=dr,Xa=Kt,Za=Bt,es=Ya;Cr({target:"Object",stat:!0,sham:!me},{getOwnPropertyDescriptors:function(e){for(var t,n,r=Xa(e),i=Za.f,a=Ja(r),s={},o=0;a.length>o;)void 0!==(n=i(r,t=a[o++]))&&es(s,t,n);return s}});var ts=Cr,ns=le,rs=pe,is=Hn,as=de,ss=Kt,os=Ya,cs=at,us=St,ds=Ua("slice"),ls=us("slice",{ACCESSORS:!0,0:0,1:2}),hs=cs("species"),ps=[].slice,fs=Math.max;ts({target:"Array",proto:!0,forced:!ds||!ls},{slice:function(e,t){var n,r,i,a=ss(this),s=as(a.length),o=is(e,s),c=is(void 0===t?s:t,s);if(rs(a)&&("function"!=typeof(n=a.constructor)||n!==Array&&!rs(n.prototype)?ns(n)&&null===(n=n[hs])&&(n=void 0):n=void 0,n===Array||void 0===n))return ps.call(a,o,c);for(r=new(void 0===n?Array:n)(fs(c-o,0)),i=0;o<c;o++,i++)o in a&&os(r,i,a[o]);return r.length=i,r}});var ms=Ee,vs=function(e,t,n,r){try{return r?t(ms(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&ms(i.call(e)),t}},gs={},ys=gs,bs=at("iterator"),_s=Array.prototype,ws=function(e){return void 0!==e&&(ys.Array===e||_s[bs]===e)},As={};As[at("toStringTag")]="z";var ks="[object z]"===String(As),Es=ks,xs=X,Ss=at("toStringTag"),Rs="Arguments"==xs(function(){return arguments}()),Ds=Es?xs:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Ss))?n:Rs?xs(t):"Object"==(r=xs(t))&&"function"==typeof t.callee?"Arguments":r},Ts=Ds,Is=gs,Cs=at("iterator"),Os=function(e){if(null!=e)return e[Cs]||e["@@iterator"]||Is[Ts(e)]},Ps=Q,Ls=ie,Us=vs,Ms=ws,js=de,Bs=Ya,Gs=Os,Ns=function(e){var t,n,r,i,a,s,o=Ls(e),c="function"==typeof this?this:Array,u=arguments.length,d=u>1?arguments[1]:void 0,l=void 0!==d,h=Gs(o),p=0;if(l&&(d=Ps(d,u>2?arguments[2]:void 0,2)),null==h||c==Array&&Ms(h))for(n=new c(t=js(o.length));t>p;p++)s=l?d(o[p],p):o[p],Bs(n,p,s);else for(a=(i=h.call(o)).next,n=new c;!(r=a.call(i)).done;p++)s=l?Us(i,d,[r.value,p],!0):r.value,Bs(n,p,s);return n.length=p,n},Fs=at("iterator"),Vs=!1;try{var Ws=0,Ks={next:function(){return{done:!!Ws++}},return:function(){Vs=!0}};Ks[Fs]=function(){return this},Array.from(Ks,(function(){throw 2}))}catch(e){}var Hs=function(e,t){if(!t&&!Vs)return!1;var n=!1;try{var r={};r[Fs]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},zs=Ns;Cr({target:"Array",stat:!0,forced:!Hs((function(e){Array.from(e)}))},{from:zs});var $s,Qs,Ys,Js=oe,Xs=ne,Zs=function(e){return function(t,n){var r,i,a=String(Xs(t)),s=Js(n),o=a.length;return s<0||s>=o?e?"":void 0:(r=a.charCodeAt(s))<55296||r>56319||s+1===o||(i=a.charCodeAt(s+1))<56320||i>57343?e?a.charAt(s):r:e?a.slice(s,s+2):i-56320+(r-55296<<10)+65536}},eo={codeAt:Zs(!1),charAt:Zs(!0)},to=!Y((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),no=Ve,ro=ie,io=to,ao=fn("IE_PROTO"),so=Object.prototype,oo=io?Object.getPrototypeOf:function(e){return e=ro(e),no(e,ao)?e[ao]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?so:null},co=oo,uo=Ue,lo=Ve,ho=at("iterator"),po=!1;[].keys&&("next"in(Ys=[].keys())?(Qs=co(co(Ys)))!==Object.prototype&&($s=Qs):po=!0),null==$s&&($s={}),lo($s,ho)||uo($s,ho,(function(){return this}));var fo={IteratorPrototype:$s,BUGGY_SAFARI_ITERATORS:po},mo=fo.IteratorPrototype,vo=ei,go=Oe,yo=vi,bo=gs,_o=function(){return this},wo=function(e,t,n){var r=t+" Iterator";return e.prototype=vo(mo,{next:go(1,n)}),yo(e,r,!1),bo[r]=_o,e},Ao=le,ko=Ee,Eo=function(e){if(!Ao(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},xo=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return ko(n),Eo(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),So=Cr,Ro=wo,Do=oo,To=xo,Io=vi,Co=Ue,Oo=en.exports,Po=gs,Lo=fo.IteratorPrototype,Uo=fo.BUGGY_SAFARI_ITERATORS,Mo=at("iterator"),jo=function(){return this},Bo=function(e,t,n,r,i,a,s){Ro(n,t,r);var o,c,u,d=function(e){if(e===i&&m)return m;if(!Uo&&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[Mo]||p["@@iterator"]||i&&p[i],m=!Uo&&f||d(i),v="Array"==t&&p.entries||f;if(v&&(o=Do(v.call(new e)),Lo!==Object.prototype&&o.next&&(Do(o)!==Lo&&(To?To(o,Lo):"function"!=typeof o[Mo]&&Co(o,Mo,jo)),Io(o,l,!0))),"values"==i&&f&&"values"!==f.name&&(h=!0,m=function(){return f.call(this)}),p[Mo]!==m&&Co(p,Mo,m),Po[t]=m,i)if(c={values:d("values"),keys:a?m:d("keys"),entries:d("entries")},s)for(u in c)(Uo||h||!(u in p))&&Oo(p,u,c[u]);else So({target:t,proto:!0,forced:Uo||h},c);return c},Go=eo.charAt,No=Dn,qo=Bo,Fo=No.set,Vo=No.getterFor("String Iterator");qo(String,"String",(function(e){Fo(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=Vo(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Go(n,r),t.index+=e.length,{value:e,done:!1})}));var Wo=Cr,Ko=me,Ho=K,zo=Ve,$o=le,Qo=ve.f,Yo=mr,Jo=Ho.Symbol;if(Ko&&"function"==typeof Jo&&(!("description"in Jo.prototype)||void 0!==Jo().description)){var Xo={},Zo=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof Zo?new Jo(e):void 0===e?Jo():Jo(e);return""===e&&(Xo[t]=!0),t};Yo(Zo,Jo);var ec=Zo.prototype=Jo.prototype;ec.constructor=Zo;var tc=ec.toString,nc="Symbol(test)"==String(Jo("test")),rc=/^Symbol\((.*)\)[^)]+$/;Qo(ec,"description",{configurable:!0,get:function(){var e=$o(this)?this.valueOf():this,t=tc.call(e);if(zo(Xo,e))return"";var n=nc?t.slice(7,-1):t.replace(rc,"$1");return""===n?void 0:n}}),Wo({global:!0,forced:!0},{Symbol:Zo})}hi("iterator");var ic=ei,ac=ve,sc=at("unscopables"),oc=Array.prototype;null==oc[sc]&&ac.f(oc,sc,{configurable:!0,value:ic(null)});var cc=function(e){oc[sc][e]=!0},uc=Kt,dc=cc,lc=gs,hc=Dn,pc=Bo,fc=hc.set,mc=hc.getterFor("Array Iterator"),vc=pc(Array,"Array",(function(e,t){fc(this,{type:"Array Iterator",target:uc(e),index:0,kind:t})}),(function(){var e=mc(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");lc.Arguments=lc.Array,dc("keys"),dc("values"),dc("entries");var gc=K,yc=H,bc=vc,_c=Ue,wc=at,Ac=wc("iterator"),kc=wc("toStringTag"),Ec=bc.values;for(var xc in yc){var Sc=gc[xc],Rc=Sc&&Sc.prototype;if(Rc){if(Rc[Ac]!==Ec)try{_c(Rc,Ac,Ec)}catch(e){Rc[Ac]=Ec}if(Rc[kc]||_c(Rc,kc,xc),yc[xc])for(var Dc in bc)if(Rc[Dc]!==bc[Dc])try{_c(Rc,Dc,bc[Dc])}catch(e){Rc[Dc]=bc[Dc]}}}var Tc=Ds,Ic=ks?{}.toString:function(){return"[object "+Tc(this)+"]"},Cc=ks,Oc=en.exports,Pc=Ic;Cc||Oc(Object.prototype,"toString",Pc,{unsafe:!0});var Lc=K.Promise,Uc=en.exports,Mc=function(e,t,n){for(var r in t)Uc(e,r,t[r],n);return e},jc=qn,Bc=ve,Gc=me,Nc=at("species"),qc=function(e){var t=jc(e),n=Bc.f;Gc&&t&&!t[Nc]&&n(t,Nc,{configurable:!0,get:function(){return this}})},Fc=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},Vc={exports:{}},Wc=Ee,Kc=ws,Hc=de,zc=Q,$c=Os,Qc=vs,Yc=function(e,t){this.stopped=e,this.result=t};(Vc.exports=function(e,t,n,r,i){var a,s,o,c,u,d,l,h=zc(t,n,r?2:1);if(i)a=e;else{if("function"!=typeof(s=$c(e)))throw TypeError("Target is not iterable");if(Kc(s)){for(o=0,c=Hc(e.length);c>o;o++)if((u=r?h(Wc(l=e[o])[0],l[1]):h(e[o]))&&u instanceof Yc)return u;return new Yc(!1)}a=s.call(e)}for(d=a.next;!(l=d.call(a)).done;)if("object"==typeof(u=Qc(a,h,l.value,r))&&u&&u instanceof Yc)return u;return new Yc(!1)}).stop=function(e){return new Yc(!0,e)};var Jc,Xc,Zc,eu=Ee,tu=z,nu=at("species"),ru=function(e,t){var n,r=eu(e).constructor;return void 0===r||null==(n=eu(r)[nu])?t:tu(n)},iu=/(iphone|ipod|ipad).*applewebkit/i.test(Sa),au=K,su=Y,ou=X,cu=Q,uu=Vr,du=_e,lu=iu,hu=au.location,pu=au.setImmediate,fu=au.clearImmediate,mu=au.process,vu=au.MessageChannel,gu=au.Dispatch,yu=0,bu={},_u=function(e){if(bu.hasOwnProperty(e)){var t=bu[e];delete bu[e],t()}},wu=function(e){return function(){_u(e)}},Au=function(e){_u(e.data)},ku=function(e){au.postMessage(e+"",hu.protocol+"//"+hu.host)};pu&&fu||(pu=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return bu[++yu]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Jc(yu),yu},fu=function(e){delete bu[e]},"process"==ou(mu)?Jc=function(e){mu.nextTick(wu(e))}:gu&&gu.now?Jc=function(e){gu.now(wu(e))}:vu&&!lu?(Zc=(Xc=new vu).port2,Xc.port1.onmessage=Au,Jc=cu(Zc.postMessage,Zc,1)):!au.addEventListener||"function"!=typeof postMessage||au.importScripts||su(ku)||"file:"===hu.protocol?Jc="onreadystatechange"in du("script")?function(e){uu.appendChild(du("script")).onreadystatechange=function(){uu.removeChild(this),_u(e)}}:function(e){setTimeout(wu(e),0)}:(Jc=ku,au.addEventListener("message",Au,!1)));var Eu,xu,Su,Ru,Du,Tu,Iu,Cu,Ou={set:pu,clear:fu},Pu=K,Lu=Bt.f,Uu=X,Mu=Ou.set,ju=iu,Bu=Pu.MutationObserver||Pu.WebKitMutationObserver,Gu=Pu.process,Nu=Pu.Promise,qu="process"==Uu(Gu),Fu=Lu(Pu,"queueMicrotask"),Vu=Fu&&Fu.value;Vu||(Eu=function(){var e,t;for(qu&&(e=Gu.domain)&&e.exit();xu;){t=xu.fn,xu=xu.next;try{t()}catch(e){throw xu?Ru():Su=void 0,e}}Su=void 0,e&&e.enter()},qu?Ru=function(){Gu.nextTick(Eu)}:Bu&&!ju?(Du=!0,Tu=document.createTextNode(""),new Bu(Eu).observe(Tu,{characterData:!0}),Ru=function(){Tu.data=Du=!Du}):Nu&&Nu.resolve?(Iu=Nu.resolve(void 0),Cu=Iu.then,Ru=function(){Cu.call(Iu,Eu)}):Ru=function(){Mu.call(Pu,Eu)});var Wu=Vu||function(e){var t={fn:e,next:void 0};Su&&(Su.next=t),xu||(xu=t,Ru()),Su=t},Ku={},Hu=z,zu=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=Hu(t),this.reject=Hu(n)};Ku.f=function(e){return new zu(e)};var $u,Qu,Yu,Ju,Xu=Ee,Zu=le,ed=Ku,td=function(e,t){if(Xu(e),Zu(t)&&t.constructor===e)return t;var n=ed.f(e);return(0,n.resolve)(t),n.promise},nd=K,rd=Cr,id=K,ad=qn,sd=Lc,od=en.exports,cd=Mc,ud=vi,dd=qc,ld=le,hd=z,pd=Fc,fd=X,md=on,vd=Vc.exports,gd=Hs,yd=ru,bd=Ou.set,_d=Wu,wd=td,Ad=function(e,t){var n=nd.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))},kd=Ku,Ed=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},xd=Dn,Sd=kr,Rd=Ca,Dd=at("species"),Td="Promise",Id=xd.get,Cd=xd.set,Od=xd.getterFor(Td),Pd=sd,Ld=id.TypeError,Ud=id.document,Md=id.process,jd=ad("fetch"),Bd=kd.f,Gd=Bd,Nd="process"==fd(Md),qd=!!(Ud&&Ud.createEvent&&id.dispatchEvent),Fd=Sd(Td,(function(){if(!(md(Pd)!==String(Pd))){if(66===Rd)return!0;if(!Nd&&"function"!=typeof PromiseRejectionEvent)return!0}if(Rd>=51&&/native code/.test(Pd))return!1;var e=Pd.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[Dd]=t,!(e.then((function(){}))instanceof t)})),Vd=Fd||!gd((function(e){Pd.all(e).catch((function(){}))})),Wd=function(e){var t;return!(!ld(e)||"function"!=typeof(t=e.then))&&t},Kd=function(e,t,n){if(!t.notified){t.notified=!0;var r=t.reactions;_d((function(){for(var i=t.value,a=1==t.state,s=0;r.length>s;){var o,c,u,d=r[s++],l=a?d.ok:d.fail,h=d.resolve,p=d.reject,f=d.domain;try{l?(a||(2===t.rejection&&Qd(e,t),t.rejection=1),!0===l?o=i:(f&&f.enter(),o=l(i),f&&(f.exit(),u=!0)),o===d.promise?p(Ld("Promise-chain cycle")):(c=Wd(o))?c.call(o,h,p):h(o)):p(i)}catch(e){f&&!u&&f.exit(),p(e)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&zd(e,t)}))}},Hd=function(e,t,n){var r,i;qd?((r=Ud.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),id.dispatchEvent(r)):r={promise:t,reason:n},(i=id["on"+e])?i(r):"unhandledrejection"===e&&Ad("Unhandled promise rejection",n)},zd=function(e,t){bd.call(id,(function(){var n,r=t.value;if($d(t)&&(n=Ed((function(){Nd?Md.emit("unhandledRejection",r,e):Hd("unhandledrejection",e,r)})),t.rejection=Nd||$d(t)?2:1,n.error))throw n.value}))},$d=function(e){return 1!==e.rejection&&!e.parent},Qd=function(e,t){bd.call(id,(function(){Nd?Md.emit("rejectionHandled",e):Hd("rejectionhandled",e,t.value)}))},Yd=function(e,t,n,r){return function(i){e(t,n,i,r)}},Jd=function(e,t,n,r){t.done||(t.done=!0,r&&(t=r),t.value=n,t.state=2,Kd(e,t,!0))},Xd=function(e,t,n,r){if(!t.done){t.done=!0,r&&(t=r);try{if(e===n)throw Ld("Promise can't be resolved itself");var i=Wd(n);i?_d((function(){var r={done:!1};try{i.call(n,Yd(Xd,e,r,t),Yd(Jd,e,r,t))}catch(n){Jd(e,r,n,t)}})):(t.value=n,t.state=1,Kd(e,t,!1))}catch(n){Jd(e,{done:!1},n,t)}}};Fd&&(Pd=function(e){pd(this,Pd,Td),hd(e),$u.call(this);var t=Id(this);try{e(Yd(Xd,this,t),Yd(Jd,this,t))}catch(e){Jd(this,t,e)}},($u=function(e){Cd(this,{type:Td,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=cd(Pd.prototype,{then:function(e,t){var n=Od(this),r=Bd(yd(this,Pd));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Nd?Md.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Kd(this,n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),Qu=function(){var e=new $u,t=Id(e);this.promise=e,this.resolve=Yd(Xd,e,t),this.reject=Yd(Jd,e,t)},kd.f=Bd=function(e){return e===Pd||e===Yu?new Qu(e):Gd(e)},"function"==typeof sd&&(Ju=sd.prototype.then,od(sd.prototype,"then",(function(e,t){var n=this;return new Pd((function(e,t){Ju.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof jd&&rd({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return wd(Pd,jd.apply(id,arguments))}}))),rd({global:!0,wrap:!0,forced:Fd},{Promise:Pd}),ud(Pd,Td,!1),dd(Td),Yu=ad(Td),rd({target:Td,stat:!0,forced:Fd},{reject:function(e){var t=Bd(this);return t.reject.call(void 0,e),t.promise}}),rd({target:Td,stat:!0,forced:Fd},{resolve:function(e){return wd(this,e)}}),rd({target:Td,stat:!0,forced:Vd},{all:function(e){var t=this,n=Bd(t),r=n.resolve,i=n.reject,a=Ed((function(){var n=hd(t.resolve),a=[],s=0,o=1;vd(e,(function(e){var c=s++,u=!1;a.push(void 0),o++,n.call(t,e).then((function(e){u||(u=!0,a[c]=e,--o||r(a))}),i)})),--o||r(a)}));return a.error&&i(a.value),n.promise},race:function(e){var t=this,n=Bd(t),r=n.reject,i=Ed((function(){var i=hd(t.resolve);vd(e,(function(e){i.call(t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Zd=Cr,el=Y,tl=pe,nl=le,rl=ie,il=de,al=Ya,sl=ut,ol=Ua,cl=Ca,ul=at("isConcatSpreadable"),dl=cl>=51||!el((function(){var e=[];return e[ul]=!1,e.concat()[0]!==e})),ll=ol("concat"),hl=function(e){if(!nl(e))return!1;var t=e[ul];return void 0!==t?!!t:tl(e)};Zd({target:"Array",proto:!0,forced:!dl||!ll},{concat:function(e){var t,n,r,i,a,s=rl(this),o=sl(s,0),c=0;for(t=-1,r=arguments.length;t<r;t++)if(hl(a=-1===t?s:arguments[t])){if(c+(i=il(a.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<i;n++,c++)n in a&&al(o,c,a[n])}else{if(c>=9007199254740991)throw TypeError("Maximum allowed index exceeded");al(o,c++,a)}return o.length=c,o}});var pl=me,fl=ve.f,ml=Function.prototype,vl=ml.toString,gl=/^\s*function ([^ (]*)/;function yl(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 bl(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 bl(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 bl(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 _l(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 wl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_l(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}pl&&!("name"in ml)&&fl(ml,"name",{configurable:!0,get:function(){try{return vl.call(this).match(gl)[1]}catch(e){return""}}});var Al,kl={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"}},El={},xl=function(e,t){El[e]=wl(wl({},t),{},{isLoading:!1})},Sl=function(e){var n=this,r=e.id,i=e.src;return new Promise(function(e,a){if(t(this,n),document.getElementById(r))e();else{var s=document.createElement("script");s.onload=function(){e()},s.id=r,s.setAttribute("crossorigin",!0),s.src=i,document.head.appendChild(s)}}.bind(this))},Rl=function(){var t=e(r.mark((function e(t){var n,i,a,s,o,c,u,d;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=window[t])){e.next=3;break}return e.abrupt("return",n);case 3:if(!(i=El[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:i.isLoading=!0,a=yl(i.dependencies),e.prev=8,a.s();case 10:if((s=a.n()).done){e.next=26;break}if(o=s.value,e.prev=12,c=kl[o].name,!window[c]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,Sl({id:o,src:kl[o].src});case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),u=o.id,d=o.src,console.log("Could not load external script ".concat(u," ").concat(d),e.t0);case 24:e.next=10;break;case 26:e.next=31;break;case 28:e.prev=28,e.t1=e.catch(8),a.e(e.t1);case 31:return e.prev=31,a.f(),e.finish(31);case 34:return e.prev=34,e.next=37,Sl({id:t,src:i.source});case 37:n=window[t],e.next=43;break;case 40:e.prev=40,e.t2=e.catch(34),console.log("Could not load module ".concat(t," ").concat(i.source,"."),e.t2);case 43:return i.isLoading=!1,e.abrupt("return",n);case 45:case"end":return e.stop()}}),e,null,[[8,28,31,34],[12,20],[34,40]])})));return function(e){return t.apply(this,arguments)}}(),Dl=new function t(){var n=this;R(this,t),D(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rl("Leaderboard");case 2:n.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),D(this,"showLeaderboard",function(){var t=e(r.mark((function e(t){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=window.GD_OPTIONS.gameId,n.leaderboard){e.next=4;break}return e.next=4,n.load();case 4:n.leaderboard.showLeaderBoard(i,t);case 5:case"end":return e.stop()}}),e)})));return function(e){return t.apply(this,arguments)}}()),D(this,"addScore",function(){var t=e(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.leaderboard){e.next=3;break}return e.next=3,n.load();case 3:n.leaderboard.addScore(t);case 4:case"end":return e.stop()}}),e)})));return function(e){return t.apply(this,arguments)}}()),this.moduleName="Leaderboard",this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/gd-sdk-leaderboard/0.1.43/dist/default/iife/index.js",dependencies:["react","react-dom","redux","react-redux","material-ui-core"]},xl(this.moduleName,this.moduleConfig)},Tl=le,Il=X,Cl=at("match"),Ol=function(e){var t;return Tl(e)&&(void 0!==(t=e[Cl])?!!t:"RegExp"==Il(e))},Pl=Ol,Ll=function(e){if(Pl(e))throw TypeError("The method doesn't accept regular expressions");return e},Ul=at("match"),Ml=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Ul]=!1,"/./"[e](t)}catch(e){}}return!1},jl=Cr,Bl=Bt.f,Gl=de,Nl=Ll,ql=ne,Fl=Ml,Vl="".startsWith,Wl=Math.min,Kl=Fl("startsWith");jl({target:"String",proto:!0,forced:!!(Kl||(Al=Bl(String.prototype,"startsWith"),!Al||Al.writable))&&!Kl},{startsWith:function(e){var t=String(ql(this));Nl(e);var n=Gl(Wl(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return Vl?Vl.call(t,r,n):t.slice(n,n+r.length)===r}});var Hl=Ee,zl=function(){var e=Hl(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},$l=en.exports,Ql=Ee,Yl=Y,Jl=zl,Xl=RegExp.prototype,Zl=Xl.toString,eh=Yl((function(){return"/a/b"!=Zl.call({source:"a",flags:"b"})})),th="toString"!=Zl.name;(eh||th)&&$l(RegExp.prototype,"toString",(function(){var e=Ql(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in Xl)?Jl.call(e):n)}),{unsafe:!0});var nh={},rh=Y;function ih(e,t){return RegExp(e,t)}nh.UNSUPPORTED_Y=rh((function(){var e=ih("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),nh.BROKEN_CARET=rh((function(){var e=ih("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var ah=zl,sh=nh,oh=RegExp.prototype.exec,ch=String.prototype.replace,uh=oh,dh=function(){var e=/a/,t=/b*/g;return oh.call(e,"a"),oh.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),lh=sh.UNSUPPORTED_Y||sh.BROKEN_CARET,hh=void 0!==/()??/.exec("")[1];(dh||hh||lh)&&(uh=function(e){var t,n,r,i,a=this,s=lh&&a.sticky,o=ah.call(a),c=a.source,u=0,d=e;return s&&(-1===(o=o.replace("y","")).indexOf("g")&&(o+="g"),d=String(e).slice(a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==e[a.lastIndex-1])&&(c="(?: "+c+")",d=" "+d,u++),n=new RegExp("^(?:"+c+")",o)),hh&&(n=new RegExp("^"+c+"$(?!\\s)",o)),dh&&(t=a.lastIndex),r=oh.call(s?n:a,d),s?r?(r.input=r.input.slice(u),r[0]=r[0].slice(u),r.index=a.lastIndex,a.lastIndex+=r[0].length):a.lastIndex=0:dh&&r&&(a.lastIndex=a.global?r.index+r[0].length:t),hh&&r&&r.length>1&&ch.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r});var ph=uh;Cr({target:"RegExp",proto:!0,forced:/./.exec!==ph},{exec:ph});var fh=en.exports,mh=Y,vh=at,gh=ph,yh=Ue,bh=vh("species"),_h=!mh((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),wh="$0"==="a".replace(/./,"$0"),Ah=vh("replace"),kh=!!/./[Ah]&&""===/./[Ah]("a","$0"),Eh=!mh((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]})),xh=function(e,t,n,r){var i=vh(e),a=!mh((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),s=a&&!mh((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[bh]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!a||!s||"replace"===e&&(!_h||!wh||kh)||"split"===e&&!Eh){var o=/./[i],c=n(i,""[e],(function(e,t,n,r,i){return t.exec===gh?a&&!i?{done:!0,value:o.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:wh,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:kh}),u=c[0],d=c[1];fh(String.prototype,e,u),fh(RegExp.prototype,i,2==t?function(e,t){return d.call(e,this,t)}:function(e){return d.call(e,this)})}r&&yh(RegExp.prototype[i],"sham",!0)},Sh=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},Rh=X,Dh=ph,Th=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==Rh(e))throw TypeError("RegExp#exec called on incompatible receiver");return Dh.call(e,t)},Ih=Ee,Ch=ne,Oh=Sh,Ph=Th;function Lh(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 Uh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lh(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}xh("search",1,(function(e,t,n){return[function(t){var n=Ch(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var i=Ih(e),a=String(this),s=i.lastIndex;Oh(s,0)||(i.lastIndex=0);var o=Ph(i,a);return Oh(i.lastIndex,s)||(i.lastIndex=s),null===o?-1:o.index}]}));var Mh,jh,Bh=function(){function e(){R(this,e)}return T(e,[{key:"getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var c=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:i()),u=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:a()),d=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===s()?u:o()),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,v=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled,y=(e||n)&&r.loaderEnabled,b=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:l,noLoadedEvent:h,noBlockerEvent:p,noPreroll:y,parentURL:c,parentDomain:u,topDomain:d&&d.length?d:u,noGAPageView:f,noLotamePageView:m,noGamedockSDK:v,noMinijuegosSDK:g,version:r.version,pauseGameOnStartup:b,depth:s(),domainMatched:u===d,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isLoaderGameURL",value:function(){return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)&&location.href.startsWith("https://html5.gamedistribution.com")}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var n=new I(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new I(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var i=new I(location.href,!0);if(!i.query.gd_zone_config)return;e=i.query.gd_zone_config}return JSON.parse(C.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(C.encode(JSON.stringify(e)))}catch(e){}try{var n=new I(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(qs.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new I(e,!0);return n.query=Uh(Uh({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return C.encode(JSON.stringify(e))}}]),e}(),Gh=function(){try{return(new Bh).getBridgeContext()}catch(e){return{}}}(),Nh={userDeclinedTracking:document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0,whitelabelPartner:(Mh=!1,(jh=c("xanthophyll")).hasOwnProperty("xanthophyll")&&"true"===jh.xanthophyll&&(Mh=!0),Mh)},qh=eo.charAt,Fh=function(e,t,n){return t+(n?qh(e,t).length:1)},Vh=xh,Wh=Ee,Kh=ie,Hh=de,zh=oe,$h=ne,Qh=Fh,Yh=Th,Jh=Math.max,Xh=Math.min,Zh=Math.floor,ep=/\$([$&'`]|\d\d?|<[^>]*>)/g,tp=/\$([$&'`]|\d\d?)/g;Vh("replace",2,(function(e,t,n,r){var i=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,a=r.REPLACE_KEEPS_$0,s=i?"$":"$0";return[function(n,r){var i=$h(this),a=null==n?void 0:n[e];return void 0!==a?a.call(n,i,r):t.call(String(i),n,r)},function(e,r){if(!i&&a||"string"==typeof r&&-1===r.indexOf(s)){var c=n(t,e,this,r);if(c.done)return c.value}var u=Wh(e),d=String(this),l="function"==typeof r;l||(r=String(r));var h=u.global;if(h){var p=u.unicode;u.lastIndex=0}for(var f=[];;){var m=Yh(u,d);if(null===m)break;if(f.push(m),!h)break;""===String(m[0])&&(u.lastIndex=Qh(d,Hh(u.lastIndex),p))}for(var v,g="",y=0,b=0;b<f.length;b++){m=f[b];for(var _=String(m[0]),w=Jh(Xh(zh(m.index),d.length),0),A=[],k=1;k<m.length;k++)A.push(void 0===(v=m[k])?v:String(v));var E=m.groups;if(l){var x=[_].concat(A,w,d);void 0!==E&&x.push(E);var S=String(r.apply(void 0,x))}else S=o(_,d,w,A,E,r);w>=y&&(g+=d.slice(y,w)+S,y=w+_.length)}return g+d.slice(y)}];function o(e,n,r,i,a,s){var o=r+e.length,c=i.length,u=tp;return void 0!==a&&(a=Kh(a),u=ep),t.call(s,u,(function(t,s){var u;switch(s.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,r);case"'":return n.slice(o);case"<":u=a[s.slice(1,-1)];break;default:var d=+s;if(0===d)return t;if(d>c){var l=Zh(d/10);return 0===l?t:l<=c?void 0===i[l-1]?s.charAt(1):i[l-1]+s.charAt(1):t}u=i[d-1]}return void 0===u?"":u}))}}));var np=Y,rp=at("iterator"),ip=!np((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[rp]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),ap=me,sp=Y,op=Lr,cp=sr,up=Gt,dp=ie,lp=te,hp=Object.assign,pp=Object.defineProperty,fp=!hp||sp((function(){if(ap&&1!==hp({b:1},hp(pp({},"a",{enumerable:!0,get:function(){pp(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=hp({},e)[n]||op(hp({},t)).join("")!=r}))?function(e,t){for(var n=dp(e),r=arguments.length,i=1,a=cp.f,s=up.f;r>i;)for(var o,c=lp(arguments[i++]),u=a?op(c).concat(a(c)):op(c),d=u.length,l=0;d>l;)o=u[l++],ap&&!s.call(c,o)||(n[o]=c[o]);return n}:hp,mp=/[^\0-\u007E]/,vp=/[.\u3002\uFF0E\uFF61]/g,gp="Overflow: input needs wider integers to process",yp=Math.floor,bp=String.fromCharCode,_p=function(e){return e+22+75*(e<26)},wp=function(e,t,n){var r=0;for(e=n?yp(e/700):e>>1,e+=yp(e/t);e>455;r+=36)e=yp(e/35);return yp(r+36*e/(e+38))},Ap=function(e){var t,n,r=[],i=(e=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var a=e.charCodeAt(n++);56320==(64512&a)?t.push(((1023&i)<<10)+(1023&a)+65536):(t.push(i),n--)}else t.push(i)}return t}(e)).length,a=128,s=0,o=72;for(t=0;t<e.length;t++)(n=e[t])<128&&r.push(bp(n));var c=r.length,u=c;for(c&&r.push("-");u<i;){var d=2147483647;for(t=0;t<e.length;t++)(n=e[t])>=a&&n<d&&(d=n);var l=u+1;if(d-a>yp((2147483647-s)/l))throw RangeError(gp);for(s+=(d-a)*l,a=d,t=0;t<e.length;t++){if((n=e[t])<a&&++s>2147483647)throw RangeError(gp);if(n==a){for(var h=s,p=36;;p+=36){var f=p<=o?1:p>=o+26?26:p-o;if(h<f)break;var m=h-f,v=36-f;r.push(bp(_p(f+m%v))),h=yp(m/v)}r.push(bp(_p(h))),o=wp(s,l,u==c),s=0,++u}}++s,++a}return r.join("")},kp=Ee,Ep=Os,xp=Cr,Sp=qn,Rp=ip,Dp=en.exports,Tp=Mc,Ip=vi,Cp=wo,Op=Dn,Pp=Fc,Lp=Ve,Up=Q,Mp=Ds,jp=Ee,Bp=le,Gp=ei,Np=Oe,qp=function(e){var t=Ep(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return kp(t.call(e))},Fp=Os,Vp=at,Wp=Sp("fetch"),Kp=Sp("Headers"),Hp=Vp("iterator"),zp=Op.set,$p=Op.getterFor("URLSearchParams"),Qp=Op.getterFor("URLSearchParamsIterator"),Yp=/\+/g,Jp=Array(4),Xp=function(e){return Jp[e-1]||(Jp[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},Zp=function(e){try{return decodeURIComponent(e)}catch(t){return e}},ef=function(e){var t=e.replace(Yp," "),n=4;try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace(Xp(n--),Zp);return t}},tf=/[!'()~]|%20/g,nf={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},rf=function(e){return nf[e]},af=function(e){return encodeURIComponent(e).replace(tf,rf)},sf=function(e,t){if(t)for(var n,r,i=t.split("&"),a=0;a<i.length;)(n=i[a++]).length&&(r=n.split("="),e.push({key:ef(r.shift()),value:ef(r.join("="))}))},of=function(e){this.entries.length=0,sf(this.entries,e)},cf=function(e,t){if(e<t)throw TypeError("Not enough arguments")},uf=Cp((function(e,t){zp(this,{type:"URLSearchParamsIterator",iterator:qp($p(e).entries),kind:t})}),"Iterator",(function(){var e=Qp(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),df=function(){Pp(this,df,"URLSearchParams");var e,t,n,r,i,a,s,o,c,u=arguments.length>0?arguments[0]:void 0,d=this,l=[];if(zp(d,{type:"URLSearchParams",entries:l,updateURL:function(){},updateSearchParams:of}),void 0!==u)if(Bp(u))if("function"==typeof(e=Fp(u)))for(n=(t=e.call(u)).next;!(r=n.call(t)).done;){if((s=(a=(i=qp(jp(r.value))).next).call(i)).done||(o=a.call(i)).done||!a.call(i).done)throw TypeError("Expected sequence with length 2");l.push({key:s.value+"",value:o.value+""})}else for(c in u)Lp(u,c)&&l.push({key:c,value:u[c]+""});else sf(l,"string"==typeof u?"?"===u.charAt(0)?u.slice(1):u:u+"")},lf=df.prototype;Tp(lf,{append:function(e,t){cf(arguments.length,2);var n=$p(this);n.entries.push({key:e+"",value:t+""}),n.updateURL()},delete:function(e){cf(arguments.length,1);for(var t=$p(this),n=t.entries,r=e+"",i=0;i<n.length;)n[i].key===r?n.splice(i,1):i++;t.updateURL()},get:function(e){cf(arguments.length,1);for(var t=$p(this).entries,n=e+"",r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){cf(arguments.length,1);for(var t=$p(this).entries,n=e+"",r=[],i=0;i<t.length;i++)t[i].key===n&&r.push(t[i].value);return r},has:function(e){cf(arguments.length,1);for(var t=$p(this).entries,n=e+"",r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){cf(arguments.length,1);for(var n,r=$p(this),i=r.entries,a=!1,s=e+"",o=t+"",c=0;c<i.length;c++)(n=i[c]).key===s&&(a?i.splice(c--,1):(a=!0,n.value=o));a||i.push({key:s,value:o}),r.updateURL()},sort:function(){var e,t,n,r=$p(this),i=r.entries,a=i.slice();for(i.length=0,n=0;n<a.length;n++){for(e=a[n],t=0;t<n;t++)if(i[t].key>e.key){i.splice(t,0,e);break}t===n&&i.push(e)}r.updateURL()},forEach:function(e){for(var t,n=$p(this).entries,r=Up(e,arguments.length>1?arguments[1]:void 0,3),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new uf(this,"keys")},values:function(){return new uf(this,"values")},entries:function(){return new uf(this,"entries")}},{enumerable:!0}),Dp(lf,Hp,lf.entries),Dp(lf,"toString",(function(){for(var e,t=$p(this).entries,n=[],r=0;r<t.length;)e=t[r++],n.push(af(e.key)+"="+af(e.value));return n.join("&")}),{enumerable:!0}),Ip(df,"URLSearchParams"),xp({global:!0,forced:!Rp},{URLSearchParams:df}),Rp||"function"!=typeof Wp||"function"!=typeof Kp||xp({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,n,r,i=[e];return arguments.length>1&&(Bp(t=arguments[1])&&(n=t.body,"URLSearchParams"===Mp(n)&&((r=t.headers?new Kp(t.headers):new Kp).has("content-type")||r.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=Gp(t,{body:Np(0,String(n)),headers:Np(0,r)}))),i.push(t)),Wp.apply(this,i)}});var hf,pf={URLSearchParams:df,getState:$p},ff=Cr,mf=me,vf=ip,gf=K,yf=Fr,bf=en.exports,_f=Fc,wf=Ve,Af=fp,kf=Ns,Ef=eo.codeAt,xf=function(e){var t,n,r=[],i=e.toLowerCase().replace(vp,".").split(".");for(t=0;t<i.length;t++)n=i[t],r.push(mp.test(n)?"xn--"+Ap(n):n);return r.join(".")},Sf=vi,Rf=pf,Df=Dn,Tf=gf.URL,If=Rf.URLSearchParams,Cf=Rf.getState,Of=Df.set,Pf=Df.getterFor("URL"),Lf=Math.floor,Uf=Math.pow,Mf=/[A-Za-z]/,jf=/[\d+-.A-Za-z]/,Bf=/\d/,Gf=/^(0x|0X)/,Nf=/^[0-7]+$/,qf=/^\d+$/,Ff=/^[\dA-Fa-f]+$/,Vf=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,Wf=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,Kf=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,Hf=/[\u0009\u000A\u000D]/g,zf=function(e,t){var n,r,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return"Invalid host";if(!(n=Qf(t.slice(1,-1))))return"Invalid host";e.host=n}else if(rm(e)){if(t=xf(t),Vf.test(t))return"Invalid host";if(null===(n=$f(t)))return"Invalid host";e.host=n}else{if(Wf.test(t))return"Invalid host";for(n="",r=kf(t),i=0;i<r.length;i++)n+=tm(r[i],Jf);e.host=n}},$f=function(e){var t,n,r,i,a,s,o,c=e.split(".");if(c.length&&""==c[c.length-1]&&c.pop(),(t=c.length)>4)return e;for(n=[],r=0;r<t;r++){if(""==(i=c[r]))return e;if(a=10,i.length>1&&"0"==i.charAt(0)&&(a=Gf.test(i)?16:8,i=i.slice(8==a?1:2)),""===i)s=0;else{if(!(10==a?qf:8==a?Nf:Ff).test(i))return e;s=parseInt(i,a)}n.push(s)}for(r=0;r<t;r++)if(s=n[r],r==t-1){if(s>=Uf(256,5-t))return null}else if(s>255)return null;for(o=n.pop(),r=0;r<n.length;r++)o+=n[r]*Uf(256,3-r);return o},Qf=function(e){var t,n,r,i,a,s,o,c=[0,0,0,0,0,0,0,0],u=0,d=null,l=0,h=function(){return e.charAt(l)};if(":"==h()){if(":"!=e.charAt(1))return;l+=2,d=++u}for(;h();){if(8==u)return;if(":"!=h()){for(t=n=0;n<4&&Ff.test(h());)t=16*t+parseInt(h(),16),l++,n++;if("."==h()){if(0==n)return;if(l-=n,u>6)return;for(r=0;h();){if(i=null,r>0){if(!("."==h()&&r<4))return;l++}if(!Bf.test(h()))return;for(;Bf.test(h());){if(a=parseInt(h(),10),null===i)i=a;else{if(0==i)return;i=10*i+a}if(i>255)return;l++}c[u]=256*c[u]+i,2!=++r&&4!=r||u++}if(4!=r)return;break}if(":"==h()){if(l++,!h())return}else if(h())return;c[u++]=t}else{if(null!==d)return;l++,d=++u}}if(null!==d)for(s=u-d,u=7;0!=u&&s>0;)o=c[u],c[u--]=c[d+s-1],c[d+--s]=o;else if(8!=u)return;return c},Yf=function(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=Lf(e/256);return t.join(".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,a=0;a<8;a++)0!==e[a]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=a),++i);return i>n&&(t=r,n=i),t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},Jf={},Xf=Af({},Jf,{" ":1,'"':1,"<":1,">":1,"`":1}),Zf=Af({},Xf,{"#":1,"?":1,"{":1,"}":1}),em=Af({},Zf,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),tm=function(e,t){var n=Ef(e,0);return n>32&&n<127&&!wf(t,e)?e:encodeURIComponent(e)},nm={ftp:21,file:null,http:80,https:443,ws:80,wss:443},rm=function(e){return wf(nm,e.scheme)},im=function(e){return""!=e.username||""!=e.password},am=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},sm=function(e,t){var n;return 2==e.length&&Mf.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},om=function(e){var t;return e.length>1&&sm(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},cm=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&sm(t[0],!0)||t.pop()},um=function(e){return"."===e||"%2e"===e.toLowerCase()},dm={},lm={},hm={},pm={},fm={},mm={},vm={},gm={},ym={},bm={},_m={},wm={},Am={},km={},Em={},xm={},Sm={},Rm={},Dm={},Tm={},Im={},Cm=function(e,t,n,r){var i,a,s,o,c,u=n||dm,d=0,l="",h=!1,p=!1,f=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(Kf,"")),t=t.replace(Hf,""),i=kf(t);d<=i.length;){switch(a=i[d],u){case dm:if(!a||!Mf.test(a)){if(n)return"Invalid scheme";u=hm;continue}l+=a.toLowerCase(),u=lm;break;case lm:if(a&&(jf.test(a)||"+"==a||"-"==a||"."==a))l+=a.toLowerCase();else{if(":"!=a){if(n)return"Invalid scheme";l="",u=hm,d=0;continue}if(n&&(rm(e)!=wf(nm,l)||"file"==l&&(im(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=l,n)return void(rm(e)&&nm[e.scheme]==e.port&&(e.port=null));l="","file"==e.scheme?u=km:rm(e)&&r&&r.scheme==e.scheme?u=pm:rm(e)?u=gm:"/"==i[d+1]?(u=fm,d++):(e.cannotBeABaseURL=!0,e.path.push(""),u=Dm)}break;case hm:if(!r||r.cannotBeABaseURL&&"#"!=a)return"Invalid scheme";if(r.cannotBeABaseURL&&"#"==a){e.scheme=r.scheme,e.path=r.path.slice(),e.query=r.query,e.fragment="",e.cannotBeABaseURL=!0,u=Im;break}u="file"==r.scheme?km:mm;continue;case pm:if("/"!=a||"/"!=i[d+1]){u=mm;continue}u=ym,d++;break;case fm:if("/"==a){u=bm;break}u=Rm;continue;case mm:if(e.scheme=r.scheme,a==hf)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query;else if("/"==a||"\\"==a&&rm(e))u=vm;else if("?"==a)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query="",u=Tm;else{if("#"!=a){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.path.pop(),u=Rm;continue}e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query,e.fragment="",u=Im}break;case vm:if(!rm(e)||"/"!=a&&"\\"!=a){if("/"!=a){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,u=Rm;continue}u=bm}else u=ym;break;case gm:if(u=ym,"/"!=a||"/"!=l.charAt(d+1))continue;d++;break;case ym:if("/"!=a&&"\\"!=a){u=bm;continue}break;case bm:if("@"==a){h&&(l="%40"+l),h=!0,s=kf(l);for(var m=0;m<s.length;m++){var v=s[m];if(":"!=v||f){var g=tm(v,em);f?e.password+=g:e.username+=g}else f=!0}l=""}else if(a==hf||"/"==a||"?"==a||"#"==a||"\\"==a&&rm(e)){if(h&&""==l)return"Invalid authority";d-=kf(l).length+1,l="",u=_m}else l+=a;break;case _m:case wm:if(n&&"file"==e.scheme){u=xm;continue}if(":"!=a||p){if(a==hf||"/"==a||"?"==a||"#"==a||"\\"==a&&rm(e)){if(rm(e)&&""==l)return"Invalid host";if(n&&""==l&&(im(e)||null!==e.port))return;if(o=zf(e,l))return o;if(l="",u=Sm,n)return;continue}"["==a?p=!0:"]"==a&&(p=!1),l+=a}else{if(""==l)return"Invalid host";if(o=zf(e,l))return o;if(l="",u=Am,n==wm)return}break;case Am:if(!Bf.test(a)){if(a==hf||"/"==a||"?"==a||"#"==a||"\\"==a&&rm(e)||n){if(""!=l){var y=parseInt(l,10);if(y>65535)return"Invalid port";e.port=rm(e)&&y===nm[e.scheme]?null:y,l=""}if(n)return;u=Sm;continue}return"Invalid port"}l+=a;break;case km:if(e.scheme="file","/"==a||"\\"==a)u=Em;else{if(!r||"file"!=r.scheme){u=Rm;continue}if(a==hf)e.host=r.host,e.path=r.path.slice(),e.query=r.query;else if("?"==a)e.host=r.host,e.path=r.path.slice(),e.query="",u=Tm;else{if("#"!=a){om(i.slice(d).join(""))||(e.host=r.host,e.path=r.path.slice(),cm(e)),u=Rm;continue}e.host=r.host,e.path=r.path.slice(),e.query=r.query,e.fragment="",u=Im}}break;case Em:if("/"==a||"\\"==a){u=xm;break}r&&"file"==r.scheme&&!om(i.slice(d).join(""))&&(sm(r.path[0],!0)?e.path.push(r.path[0]):e.host=r.host),u=Rm;continue;case xm:if(a==hf||"/"==a||"\\"==a||"?"==a||"#"==a){if(!n&&sm(l))u=Rm;else if(""==l){if(e.host="",n)return;u=Sm}else{if(o=zf(e,l))return o;if("localhost"==e.host&&(e.host=""),n)return;l="",u=Sm}continue}l+=a;break;case Sm:if(rm(e)){if(u=Rm,"/"!=a&&"\\"!=a)continue}else if(n||"?"!=a)if(n||"#"!=a){if(a!=hf&&(u=Rm,"/"!=a))continue}else e.fragment="",u=Im;else e.query="",u=Tm;break;case Rm:if(a==hf||"/"==a||"\\"==a&&rm(e)||!n&&("?"==a||"#"==a)){if(".."===(c=(c=l).toLowerCase())||"%2e."===c||".%2e"===c||"%2e%2e"===c?(cm(e),"/"==a||"\\"==a&&rm(e)||e.path.push("")):um(l)?"/"==a||"\\"==a&&rm(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&sm(l)&&(e.host&&(e.host=""),l=l.charAt(0)+":"),e.path.push(l)),l="","file"==e.scheme&&(a==hf||"?"==a||"#"==a))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==a?(e.query="",u=Tm):"#"==a&&(e.fragment="",u=Im)}else l+=tm(a,Zf);break;case Dm:"?"==a?(e.query="",u=Tm):"#"==a?(e.fragment="",u=Im):a!=hf&&(e.path[0]+=tm(a,Jf));break;case Tm:n||"#"!=a?a!=hf&&("'"==a&&rm(e)?e.query+="%27":e.query+="#"==a?"%23":tm(a,Jf)):(e.fragment="",u=Im);break;case Im:a!=hf&&(e.fragment+=tm(a,Xf))}d++}},Om=function(e){var t,n,r=_f(this,Om,"URL"),i=arguments.length>1?arguments[1]:void 0,a=String(e),s=Of(r,{type:"URL"});if(void 0!==i)if(i instanceof Om)t=Pf(i);else if(n=Cm(t={},String(i)))throw TypeError(n);if(n=Cm(s,a,null,t))throw TypeError(n);var o=s.searchParams=new If,c=Cf(o);c.updateSearchParams(s.query),c.updateURL=function(){s.query=String(o)||null},mf||(r.href=Lm.call(r),r.origin=Um.call(r),r.protocol=Mm.call(r),r.username=jm.call(r),r.password=Bm.call(r),r.host=Gm.call(r),r.hostname=Nm.call(r),r.port=qm.call(r),r.pathname=Fm.call(r),r.search=Vm.call(r),r.searchParams=Wm.call(r),r.hash=Km.call(r))},Pm=Om.prototype,Lm=function(){var e=Pf(this),t=e.scheme,n=e.username,r=e.password,i=e.host,a=e.port,s=e.path,o=e.query,c=e.fragment,u=t+":";return null!==i?(u+="//",im(e)&&(u+=n+(r?":"+r:"")+"@"),u+=Yf(i),null!==a&&(u+=":"+a)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?s[0]:s.length?"/"+s.join("/"):"",null!==o&&(u+="?"+o),null!==c&&(u+="#"+c),u},Um=function(){var e=Pf(this),t=e.scheme,n=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&rm(e)?t+"://"+Yf(e.host)+(null!==n?":"+n:""):"null"},Mm=function(){return Pf(this).scheme+":"},jm=function(){return Pf(this).username},Bm=function(){return Pf(this).password},Gm=function(){var e=Pf(this),t=e.host,n=e.port;return null===t?"":null===n?Yf(t):Yf(t)+":"+n},Nm=function(){var e=Pf(this).host;return null===e?"":Yf(e)},qm=function(){var e=Pf(this).port;return null===e?"":String(e)},Fm=function(){var e=Pf(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Vm=function(){var e=Pf(this).query;return e?"?"+e:""},Wm=function(){return Pf(this).searchParams},Km=function(){var e=Pf(this).fragment;return e?"#"+e:""},Hm=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(mf&&yf(Pm,{href:Hm(Lm,(function(e){var t=Pf(this),n=String(e),r=Cm(t,n);if(r)throw TypeError(r);Cf(t.searchParams).updateSearchParams(t.query)})),origin:Hm(Um),protocol:Hm(Mm,(function(e){var t=Pf(this);Cm(t,String(e)+":",dm)})),username:Hm(jm,(function(e){var t=Pf(this),n=kf(String(e));if(!am(t)){t.username="";for(var r=0;r<n.length;r++)t.username+=tm(n[r],em)}})),password:Hm(Bm,(function(e){var t=Pf(this),n=kf(String(e));if(!am(t)){t.password="";for(var r=0;r<n.length;r++)t.password+=tm(n[r],em)}})),host:Hm(Gm,(function(e){var t=Pf(this);t.cannotBeABaseURL||Cm(t,String(e),_m)})),hostname:Hm(Nm,(function(e){var t=Pf(this);t.cannotBeABaseURL||Cm(t,String(e),wm)})),port:Hm(qm,(function(e){var t=Pf(this);am(t)||(""==(e=String(e))?t.port=null:Cm(t,e,Am))})),pathname:Hm(Fm,(function(e){var t=Pf(this);t.cannotBeABaseURL||(t.path=[],Cm(t,e+"",Sm))})),search:Hm(Vm,(function(e){var t=Pf(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",Cm(t,e,Tm)),Cf(t.searchParams).updateSearchParams(t.query)})),searchParams:Hm(Wm),hash:Hm(Km,(function(e){var t=Pf(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",Cm(t,e,Im)):t.fragment=null}))}),bf(Pm,"toJSON",(function(){return Lm.call(this)}),{enumerable:!0}),bf(Pm,"toString",(function(){return Lm.call(this)}),{enumerable:!0}),Tf){var zm=Tf.createObjectURL,$m=Tf.revokeObjectURL;zm&&bf(Om,"createObjectURL",(function(e){return zm.apply(Tf,arguments)})),$m&&bf(Om,"revokeObjectURL",(function(e){return $m.apply(Tf,arguments)}))}Sf(Om,"URL"),ff({global:!0,forced:!vf,sham:!mf},{URL:Om});var Qm=Jn.includes,Ym=cc;Cr({target:"Array",proto:!0,forced:!St("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return Qm(this,e,arguments.length>1?arguments[1]:void 0)}}),Ym("includes");var Jm=Ll,Xm=ne;Cr({target:"String",proto:!0,forced:!Ml("includes")},{includes:function(e){return!!~String(Xm(this)).indexOf(Jm(e),arguments.length>1?arguments[1]:void 0)}});var Zm=xh,ev=Ol,tv=Ee,nv=ne,rv=ru,iv=Fh,av=de,sv=Th,ov=ph,cv=Y,uv=[].push,dv=Math.min,lv=!cv((function(){return!RegExp(4294967295,"y")}));function hv(e){var n=this,r={},i=(null==e?void 0:e._ancestor_origins)||window.location.ancestorOrigins,a=(null==e?void 0:e.self_url)||window.location.href,s=(null==e?void 0:e.self_origin)||window.location.origin,o=(null==e?void 0:e.referrer_url)||document.referrer;function c(e){return L(r,e)}function u(e,t){return U(r,e,t)}function d(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new I(e,t)}catch(e){console.log(e)}}function l(){for(var t=(null==e?void 0:e.urls)||[a,o],n=0;n<t.length;n++){var r,i=d(t[n]);if(i){var s=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(s&&(s=decodeURIComponent(s),O.isURL(s)))return s}}}return function(){var e;t(this,n),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){u("depth.error",e.message)}u("depth.value",e)}(),function(){var e=i,t=r.depth.value,n=s;if(u("top.domain.from","fallback"),e&&e.length>0)n=e[e.length-1],u("top.domain.from","origins");else if(0===t)n=s,u("top.domain.from","self-top");else if(1===t){var a=d(o);a&&(n=a.origin,u("top.domain.from","referrer"))}u("top.domain.value",n.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=l();if(e)if(P(e))u("partner.domain.value",e),u("partner.domain.from","partner-domain");else{var t=d(e,!1);if(t)u("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),u("partner.domain.from","partner-url");else u("partner.domain.value",r.top.domain.value),u("partner.domain.from","partner-fallback")}else u("partner.domain.value",r.top.domain.value),u("partner.domain.from","fallback")}(),e=l(),0===r.depth.value?(u("partner.url.value",a),u("partner.url.from","self-top")):e?P(e)?(u("partner.url.value",a),u("partner.url.from","partner-domain")):(u("partner.url.value",e),u("partner.url.from","partner-url")):(u("partner.url.value",o),u("partner.url.from","fallback"))}.bind(this)(),{get:c,print:function(e){console.log(c(e))}}}Zm("split",2,(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=String(nv(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!ev(e))return t.call(r,e,i);for(var a,s,o,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,l=new RegExp(e.source,u+"g");(a=ov.call(l,r))&&!((s=l.lastIndex)>d&&(c.push(r.slice(d,a.index)),a.length>1&&a.index<r.length&&uv.apply(c,a.slice(1)),o=a[0].length,d=s,c.length>=i));)l.lastIndex===a.index&&l.lastIndex++;return d===r.length?!o&&l.test("")||c.push(""):c.push(r.slice(d)),c.length>i?c.slice(0,i):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var i=nv(this),a=null==t?void 0:t[e];return void 0!==a?a.call(t,i,n):r.call(String(i),t,n)},function(e,i){var a=n(r,e,this,i,r!==t);if(a.done)return a.value;var s=tv(e),o=String(this),c=rv(s,RegExp),u=s.unicode,d=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(lv?"y":"g"),l=new c(lv?s:"^(?:"+s.source+")",d),h=void 0===i?4294967295:i>>>0;if(0===h)return[];if(0===o.length)return null===sv(l,o)?[o]:[];for(var p=0,f=0,m=[];f<o.length;){l.lastIndex=lv?f:0;var v,g=sv(l,lv?o:o.slice(f));if(null===g||(v=dv(av(l.lastIndex+(lv?0:f)),o.length))===p)f=iv(o,f,u);else{if(m.push(o.slice(p,f)),m.length===h)return m;for(var y=1;y<=g.length-1;y++)if(m.push(g[y]),m.length===h)return m;f=p=v}}return m.push(o.slice(p)),m}]}),!lv);var pv={name:"@bygd/gd-sdk-pes",version:"1.28.16",files:["dist/*"],scripts:{build:"NODE_ENV=production rollup --config",watch:"rollup --config --watch --sourcemap --environment DEVELOPMENT","deploy-base":"npm install && npm run build && npm publish --access public",deploy:"npm run deploy-base && gdtool pm-upload"},repository:{type:"git",url:"git@gitlab.azerdev.com:gamedistribution/gd-sdk-pes.git"},author:"",license:"ISC",devDependencies:{"@babel/core":"^7.14.6","@babel/plugin-transform-runtime":"^7.14.5","@babel/preset-env":"^7.14.7","@rollup/plugin-babel":"^5.2.3","@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-replace":"^3.0.0",postcss:"^8.3.5",rollup:"^2.52.8","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-browsersync":"^1.3.3","rollup-plugin-delete":"^2.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-postcss":"^4.0.0","rollup-plugin-terser":"^7.0.2"},dependencies:{"@babel/runtime":"^7.14.6","@bygd/gd-sdk-era":"^0.3.6",axios:"^0.26.1","can-autoplay":"^3.0.2",events:"^3.3.0","get-value":"^3.0.1","is-plain-object":"^5.0.0","is-valid-domain":"^0.1.2","js-base64":"^3.6.1","leaderboard-lib":"0.1.11","lodash.clonedeep":"^4.5.0","lodash.merge":"^4.6.2",querystringify:"^2.2.0","set-value":"^4.1.0","url-parse":"^1.4.7",uuid:"^8.3.2",validator:"^13.6.0"}},fv="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==fv&&fv,mv="URLSearchParams"in fv,vv="Symbol"in fv&&"iterator"in Symbol,gv="FileReader"in fv&&"Blob"in fv&&function(){try{return new Blob,!0}catch(e){return!1}}(),yv="FormData"in fv,bv="ArrayBuffer"in fv;if(bv)var _v=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],wv=ArrayBuffer.isView||function(e){return e&&_v.indexOf(Object.prototype.toString.call(e))>-1};function Av(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function kv(e){return"string"!=typeof e&&(e=String(e)),e}function Ev(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return vv&&(t[Symbol.iterator]=function(){return t}),t}function xv(e){this.map={},e instanceof xv?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 Sv(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Rv(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function Dv(e){var t=new FileReader,n=Rv(t);return t.readAsArrayBuffer(e),n}function Tv(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Iv(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:gv&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:yv&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:mv&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():bv&&gv&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=Tv(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):bv&&(ArrayBuffer.prototype.isPrototypeOf(e)||wv(e))?this._bodyArrayBuffer=Tv(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):mv&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},gv&&(this.blob=function(){var e=Sv(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=Sv(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(Dv)}),this.text=function(){var e=Sv(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=Rv(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)},yv&&(this.formData=function(){return this.text().then(Pv)}),this.json=function(){return this.text().then(JSON.parse)},this}xv.prototype.append=function(e,t){e=Av(e),t=kv(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},xv.prototype.delete=function(e){delete this.map[Av(e)]},xv.prototype.get=function(e){return e=Av(e),this.has(e)?this.map[e]:null},xv.prototype.has=function(e){return this.map.hasOwnProperty(Av(e))},xv.prototype.set=function(e,t){this.map[Av(e)]=kv(t)},xv.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},xv.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),Ev(e)},xv.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Ev(e)},xv.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),Ev(e)},vv&&(xv.prototype[Symbol.iterator]=xv.prototype.entries);var Cv=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Ov(e,t){if(!(this instanceof Ov))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,i=(t=t||{}).body;if(e instanceof Ov){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new xv(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=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 xv(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),Cv.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var a=/([?&])_=[^&]*/;if(a.test(this.url))this.url=this.url.replace(a,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Pv(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 Lv(e,t){if(!(this instanceof Lv))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"",this.headers=new xv(t.headers),this.url=t.url||"",this._initBody(e)}Ov.prototype.clone=function(){return new Ov(this,{body:this._bodyInit})},Iv.call(Ov.prototype),Iv.call(Lv.prototype),Lv.prototype.clone=function(){return new Lv(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new xv(this.headers),url:this.url})},Lv.error=function(){var e=new Lv(null,{status:0,statusText:""});return e.type="error",e};var Uv=[301,302,303,307,308];Lv.redirect=function(e,t){if(-1===Uv.indexOf(t))throw new RangeError("Invalid status code");return new Lv(null,{status:t,headers:{location:e}})};var Mv=fv.DOMException;try{new Mv}catch(e){(Mv=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),Mv.prototype.constructor=Mv}function jv(e,t){return new Promise((function(n,r){var i=new Ov(e,t);if(i.signal&&i.signal.aborted)return r(new Mv("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 xv,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).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 Lv(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 Mv("Aborted","AbortError"))}),0)},a.open(i.method,function(e){try{return""===e&&fv.location.href?fv.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&&(gv?a.responseType="blob":bv&&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 xv?i.headers.forEach((function(e,t){a.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){a.setRequestHeader(e,kv(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)}))}jv.polyfill=!0,fv.fetch||(fv.fetch=jv,fv.Headers=xv,fv.Request=Ov,fv.Response=Lv);var Bv,Gv,Nv,qv,Fv=Array.isArray,Vv=Object.prototype.toString,Wv=Fv||function(e){return!!e&&"[object Array]"==Vv.call(e)},Kv=function(e){var t=Hv("object"===n(e)?e:u(e));return t&&t.version?pv.version>=t.version?t:void 0:t},Hv=function(e){var n=this;if(!Wv(e)||0===e.length)return e;if(1===e.length)return e[0];var r=0;e.forEach(function(e){t(this,n),e.weight=e.weight||1,r+=e.weight}.bind(this));var i=Math.floor(Math.random()*Math.floor(r));r=0;for(var a=0;a<e.length;a++){var s=e[a];if(i<(r+=s.weight))return s}},zv=function(e){var n=this;if(!Bv){var r={gameId:e.gameId,hours:(new Date).getHours(),topDomain:Gh.topDomain,domain:Gh.parentDomain,referrer:Gh.parentURL,depth:s(),version:pv.version,byloader:Gh.isTokenGameURL,isTokenGameURL:Gh.isTokenGameURL,isMasterGameURL:Gh.isMasterGameURL,isExtHostedGameURL:Gh.isExtHostedGameURL,byloaderVersion:Gh.version,tracking:Nh.userDeclinedTracking,whitelabel:Nh.whitelabelPartner,platform:d()};Bv=new l(r)}return Bv||{send:function(){t(this,n)}.bind(this)}},$v=[],Qv=function(e){$v.push(e)},Yv=function(){var t=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Nv){e.next=4;break}return e.next=3,Jv(qv);case 3:Nv=e.sent;case 4:return e.abrupt("return",Nv);case 5:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),Jv=function(e){var n=this;Gv.send("gdfw.loading",{message:"loading"}),$v=[],Qv("1"),Qv("2");var r=new hv;Qv("3");var i=r.get("partner.domain.value");Qv("4");var a=function(){return t(this,n),{gameId:e.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}.bind(this);Qv("5");var s=function(){t(this,n);var r=o(),a=r?"&mode=".concat(r):"";return"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(i).concat(a,"&v=").concat(pv.version,"&localTime=").concat((new Date).getHours())}.bind(this);Qv("6");var o=function(){var e=this;t(this,n);var r=new Proxy(new URLSearchParams(window.location.search),{get:function(n,r){return t(this,e),n.get(r)}.bind(this)});return!r.gd_mode&&window.location.search.includes("gd_mode")?window.location.search.split("gd_mode=")[1]:r.gd_mode}.bind(this);return Qv("7"),new Promise(function(e){var r=this;if(t(this,n),Nv)e(Nv);else{Qv("7.1");var i=a();try{Qv("7.2");var o=s();Qv("7.3"),fetch(o).then(function(e){return t(this,r),Qv("7.4"),e.json()}.bind(this)).then(function(n){var a=this;if(t(this,r),Qv("7.5"),n.success){var s,o,c,u,d=n.result.game;Qv("7.6");var l={gameId:d.gameMd5,slug:d.slug,pname:d.pname,dname:d.dname,status:d.status,description:d.description,enableAds:!0===d.enableAds||!0===(null===(s=d.enableAds)||void 0===s?void 0:s.enabled),preroll:d.preRoll,midroll:6e4*d.timeAds,rewardedAds:d.rewardedAds,title:d.title,tags:d.tags,category:d.category,assets:d.assets,disp_2nd_prer:d.disp_2nd_prer,ctry_vst:d.ctry_vst,ctry:d.ctry,crtv:d.crtv,dmain:d.dmain,__t4r:d.__t4r||{},block_exts:Kv(d.push_cuda),bloc_gard:Kv(d.bloc_gard),cookie:Kv(d.cookie),gdpr:Kv(d.gdpr),diagnostic:Kv(d.diagnostic),cmp:Kv(d.cmp),gft:Kv(d.gft)||{},sdk:Kv(d.sdk)||{},sdkfw:Kv(d.sdkfw)||{},loader:Kv(d.loader)||{},splash:Kv(d.splash)||{},promo:Kv(d.promo)||{},dAds:Kv(d.dads)||{},pAds:Kv(d.pads)||{},mAds:Kv(d.mads)||{},rAds:Kv(d.rads)||{},lp:Kv(d.lp)||{},extsc:Kv(d.extsc)||{},evnts:Kv(d.evnts)||{},dp:Kv(d.dp)||{}};Qv("7.7");var p=h(M(i),l);Qv("7.8"),p.afg_disabled=!1===(null===(o=p.sdk)||void 0===o||null===(c=o.afg)||void 0===c?void 0:c.enabled),function(){t(this,a)}.bind(this),Qv("7.9"),null!==(u=p.pAds)&&void 0!==u&&u.enabled&&(p.preroll=!0),Qv("7.10"),Gv.send("gdfw.success",{message:"success"}),e(p)}else{i.failed=!0;var f=$v[$v.length-1];Gv.send("gdfw.err",{message:"".concat(f,": json error")}),e(i)}}.bind(this)).catch(function(n){t(this,r);var a=$v[$v.length-1];Gv.send("gdfw.err",{message:"".concat(a,": ").concat(n.message?n.message:n)}),i.failed=!0,e(i)}.bind(this))}catch(t){var c=$v[$v.length-1];Gv.send("gdfw.err",{message:"".concat(c,": global ").concat(t.message?t.message:t)}),i.failed=!0,e(i)}}}.bind(this))},Xv=function(){var t=e(r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Yv();case 2:return n=e.sent,e.abrupt("return",!(null==n||null===(t=n.sdkfw)||void 0===t||!t.enabled));case 4:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),Zv=function(){var t=e(r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Yv();case 2:return n=e.sent,e.next=5,Xv();case 5:if(e.t0=e.sent,!e.t0){e.next=8;break}e.t0=!(null==n||null===(t=n.sdkfw)||void 0===t||!t.handshake);case 8:return e.abrupt("return",e.t0);case 9:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),eg=function(){var t=e(r.mark((function e(){var t,n,i,a,s,o,c,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Yv();case 2:return c=e.sent,u=!(null==c||null===(t=c.extsc)||void 0===t||!t.enabled),e.abrupt("return",{enabled:u,path:u?null==c||null===(n=c.extsc)||void 0===n?void 0:n.path:"",name:u?null==c||null===(i=c.extsc)||void 0===i?void 0:i.name:"",ref:u?null==c||null===(a=c.extsc)||void 0===a?void 0:a.ref:"",loadedFlag:u?null==c||null===(s=c.extsc)||void 0===s?void 0:s.loadedFlag:void 0,loadedFlagCheck:!!u&&!(null==c||null===(o=c.extsc)||void 0===o||!o.loadedFlagCheck)});case 5:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),tg=function(){var n=e(r.mark((function e(){var n,i,a,s,o,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,eg();case 2:if((n=e.sent).enabled){e.next=5;break}return e.abrupt("return");case 5:return i=n.path,a=n.name,s=n.ref,e.prev=6,o={},e.next=10,f(i,a,{error_prefix:"Blocked:",exists:function(){return t(this,c),!!s&&!!window[s]}.bind(this),attrs:o});case 10:e.next=16;break;case 12:e.prev=12,e.t0=e.catch(6),console.log("extsc: error on external partner script load",a,e.t0),p("DEVELOPER_ERROR",e.t0,"warning");case 16:case"end":return e.stop()}}),e,this,[[6,12]])})));return function(){return n.apply(this,arguments)}}(),ng=!1,rg=!1,ig=function(){return new Promise(function(){var n=e(r.mark((function e(n,i){var a,s,o,c,u,d=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ng){e.next=4;break}return e.abrupt("return",n(rg));case 4:ng=!0;case 5:return e.next=7,eg();case 7:if((a=e.sent).enabled){e.next=10;break}return e.abrupt("return",n(!1));case 10:if(s=a.loadedFlag,!(o=a.loadedFlagCheck)||s){e.next=13;break}return e.abrupt("return",n(!1));case 13:if(o){e.next=16;break}return rg=!0,e.abrupt("return",n(!0));case 16:c=!0,setTimeout(function(){t(this,d),c&&(c=!1,ng=!0,n(!1))}.bind(this),5e3),u=setInterval(function(){t(this,d),c&&o&&window[s]?(c=!1,ng=!0,rg=!0,clearInterval(u),n(!0)):c||clearInterval(u)}.bind(this),100);case 19:case"end":return e.stop()}}),e,this)})));return function(e,t){return n.apply(this,arguments)}}())},ag=function(e){var n=function(e){var n=this,r=function(e){return t(this,n),h("showAd",{adType:e})}.bind(this),i=function(e){return t(this,n),h("preloadAd",{adType:e})}.bind(this),a=function(e){return t(this,n),h("showDisplayAd",{options:e})}.bind(this),s=function(){return t(this,n),h("cancelAd")}.bind(this),o=function(){return t(this,n),h("openConsole")}.bind(this),c=function(){return t(this,n),h("showBanner")}.bind(this),u=function(){return t(this,n),h("session")}.bind(this),d=function(e){return t(this,n),h("sendGenericEvent",{options:e})}.bind(this),l=function(){t(this,n),console.log("_sendSDKReady")}.bind(this),h=function(e,r){var i=this;return t(this,n),r||(r={}),new Promise(function(n,a){t(this,i);try{var s={type:"gd-sdk",method:e,options:r};window.parent.postMessage(s,"https://html5.gamedistribution.com"),n()}catch(e){console.log("gd:adp:m:s:error",e),n()}}.bind(this))}.bind(this),p=function(){t(this,n),window.addEventListener("message",(function(e){var t=e.data;e.origin,e.source;var n=t.type,r=t.event;"gd-sdk-on-event"===n&&r&&m(r)}),!1)}.bind(this),f=function(){t(this,n),p(),h("init")}.bind(this),m=function(r){t(this,n),e.onEvent&&e.onEvent(r)}.bind(this);return{showBanner:c,showAd:r,preloadAd:i,showDisplayAd:a,cancelAd:s,openConsole:o,getSession:u,onEvent:m,init:f,_sendSDKReady:l,sendGenericEvent:d}}(e);return n.init(),n},sg=function(){var e=this;return{isMasterGameURL:function(){t(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)}.bind(this),isTokenGameURL:function(){t(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i.test(location.href)}.bind(this),isExtHostedGameURL:function(){t(this,e);return/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i.test(location.href)}.bind(this)}},og=function(e){var n=this;return new Promise(function(r,i){var a=this;t(this,n);var s={type:"gd-sdk-frame-handshake-request"},o=!1;window.addEventListener("message",(function(e){var t=e.data,n=e.origin,i=e.source,a=t.type;if("gd-sdk-frame-handshake-request"===a){var s={type:"gd-sdk-frame-handshake-response"};i.postMessage(s,n)}else"gd-sdk-frame-handshake-response"===a&&(o=!0,r({origin:n,source:i}))})),e?r():(setTimeout(function(){t(this,a),o||r()}.bind(this),200),window.parent!==window?window.parent.postMessage(s,"*"):r())}.bind(this))},cg=function(){var t=e(r.mark((function e(){var t,n,i,a,s,o,c,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xv();case 2:return t=e.sent,n=!t,e.next=6,og(n);case 6:if(i=e.sent,t){e.next=9;break}return e.abrupt("return",!1);case 9:return a=sg(),s=a.isMasterGameURL,o=s(),e.next=13,Zv();case 13:return c=e.sent,u=!1,u=c?!o&&!!i:!o,e.abrupt("return",u);case 17:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),ug=me,dg=Lr,lg=Kt,hg=Gt.f,pg=function(e){return function(t){for(var n,r=lg(t),i=dg(r),a=i.length,s=0,o=[];a>s;)n=i[s++],ug&&!hg.call(r,n)||o.push(e?[n,r[n]]:r[n]);return o}},fg={entries:pg(!0),values:pg(!1)}.values;Cr({target:"Object",stat:!0},{values:function(e){return fg(e)}});var mg=Cr,vg=Lc,gg=Y,yg=qn,bg=ru,_g=td,wg=en.exports;mg({target:"Promise",proto:!0,real:!0,forced:!!vg&&gg((function(){vg.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=bg(this,yg("Promise")),n="function"==typeof e;return this.then(n?function(n){return _g(t,e()).then((function(){return n}))}:e,n?function(n){return _g(t,e()).then((function(){throw n}))}:e)}}),"function"!=typeof vg||vg.prototype.finally||wg(vg.prototype,"finally",yg("Promise").prototype.finally);var Ag=ne,kg="[\t\n\v\f\r \u2028\u2029\ufeff]",Eg=RegExp("^"+kg+kg+"*"),xg=RegExp(kg+kg+"*$"),Sg=function(e){return function(t){var n=String(Ag(t));return 1&e&&(n=n.replace(Eg,"")),2&e&&(n=n.replace(xg,"")),n}},Rg={start:Sg(1),end:Sg(2),trim:Sg(3)},Dg=Y,Tg="\t\n\v\f\r \u2028\u2029\ufeff",Ig=Rg.trim;Cr({target:"String",proto:!0,forced:function(e){return Dg((function(){return!!Tg[e]()||"
"!="
"[e]()||Tg[e].name!==e}))}("trim")},{trim:function(){return Ig(this)}});var Cg=le,Og=xo,Pg=me,Lg=K,Ug=kr,Mg=function(e,t,n){var r,i;return Og&&"function"==typeof(r=t.constructor)&&r!==n&&Cg(i=r.prototype)&&i!==n.prototype&&Og(e,i),e},jg=ve.f,Bg=Fn.f,Gg=Ol,Ng=zl,qg=nh,Fg=en.exports,Vg=Y,Wg=Dn.set,Kg=qc,Hg=at("match"),zg=Lg.RegExp,$g=zg.prototype,Qg=/a/g,Yg=/a/g,Jg=new zg(Qg)!==Qg,Xg=qg.UNSUPPORTED_Y;if(Pg&&Ug("RegExp",!Jg||Xg||Vg((function(){return Yg[Hg]=!1,zg(Qg)!=Qg||zg(Yg)==Yg||"/a/i"!=zg(Qg,"i")})))){for(var Zg=function(e,t){var n,r=this instanceof Zg,i=Gg(e),a=void 0===t;if(!r&&i&&e.constructor===Zg&&a)return e;Jg?i&&!a&&(e=e.source):e instanceof Zg&&(a&&(t=Ng.call(e)),e=e.source),Xg&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var s=Mg(Jg?new zg(e,t):zg(e,t),r?this:$g,Zg);return Xg&&n&&Wg(s,{sticky:n}),s},ey=function(e){e in Zg||jg(Zg,e,{configurable:!0,get:function(){return zg[e]},set:function(t){zg[e]=t}})},ty=Bg(zg),ny=0;ty.length>ny;)ey(ty[ny++]);$g.constructor=Zg,Zg.prototype=$g,Fg(Lg,"RegExp",Zg)}Kg("RegExp");var ry=Cr,iy=gt.find,ay=cc,sy=!0,oy=St("find");"find"in[]&&Array(1).find((function(){sy=!1})),ry({target:"Array",proto:!0,forced:sy||!oy},{find:function(e){return iy(this,e,arguments.length>1?arguments[1]:void 0)}}),ay("find");var cy=Cr,uy=Kt,dy=[].join,ly=te!=Object,hy=bt("join",",");cy({target:"Array",proto:!0,forced:ly||!hy},{join:function(e){return dy.call(uy(this),void 0===e?",":e)}});var py=Cr,fy=gt.map,my=St,vy=Ua("map"),gy=my("map");py({target:"Array",proto:!0,forced:!vy||!gy},{map:function(e){return fy(this,e,arguments.length>1?arguments[1]:void 0)}});var yy=fp;Cr({target:"Object",stat:!0,forced:Object.assign!==yy},{assign:yy});var by=function(){function e(t){R(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return T(e,[{key:"_getFakeCustomParams",value:function(){var e={_vid:["bla_bla1","bla_bla2","bla_bla3"],_1ld:["1ld_1","1ld_2","1ld_3","1ld_4"],_1lp:["1lp_1","1lp_2"]},t={};for(var n in e){var r=e[n];t[n]=r[Math.floor(Math.random()*r.length)]}return t}},{key:"checkCustomParams",value:function(){var e=this;try{var n={},r=this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled,i=new I(location.href,!0);for(var a in i.query)n[a]=i.query[a];return Object.keys(n).filter(function(n){var r=this;return t(this,e),this.customParamKeys.some(function(e){return t(this,r),e===n}.bind(this))}.bind(this)).length>0||r?(console.log("custom-params",n,r),n):void console.log("custom-params, none")}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),_y=function(){function e(t,n){R(this,e),this.adContainer=t,this.onResume=n}return T(e,[{key:"show",value:function(){this.adResumeButton.style.display="block",this.adResumeButtonOverlay.style.display="block"}},{key:"hide",value:function(){this.adResumeButton.style.display="none",this.adResumeButtonOverlay.style.display="none"}},{key:"add",value:function(){var e=this;try{var n=document.createElement("div");this.adResumeButton=n,n.id="gd__resume__button",n.setAttribute("title","Resume"),this.addStyles(),n.classList.add("gd__resume__button"),n.addEventListener("click",function(){t(this,e),this.onResume()}.bind(this)),this.adContainer.appendChild(n);var r=document.createElement("div");this.adResumeButtonOverlay=r,r.id="gd__resume__button__overlay",r.classList.add("gd__resume__button__overlay"),this.adContainer.appendChild(r)}catch(e){console.log("Resume button add error",e)}}},{key:"addStyles",value:function(){var e=document.body||document.getElementsByTagName("body")[0];this.addStylesheet("gd__resume__button__style",e,'\n .gd__resume__button{\n background-image: url("https://img.gamedistribution.com/play-black.svg");\n background-color:white; \n width: 120px;\n height: 120px;\n position: absolute;\n display: none;\n z-index: 2000;\n cursor: pointer;\n top: calc(50% - 60px);\n left: calc(50% - 60px);\n margin: 0;\n border-radius: 50%;\n border: 2px solid white;\n animation: play-button 1s ease-in-out infinite alternate;\n -webkit-animation: play-button 1s ease-in-out infinite alternate;\n }\n \n .gd__resume__button__overlay {\n position: fixed;\n display: none;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0,0,0,0.5);\n z-index: 1999;\n cursor: pointer;\n }\n @keyframes play-button {\n 0% {\n transform: scale(1.0);\n -webkit-transform: scale(1.0);\n }\n 100% {\n transform: scale(1.1);\n -webkit-transform: scale(1.1);\n }\n }\n .gd__resume__button:hover{\n filter: invert(100%) sepia(51%) saturate(0%) hue-rotate(346deg) brightness(104%) contrast(100%); \n }\n ')}},{key:"addStylesheet",value:function(e,t,n){if(!document.getElementById(e)){var r=document.createElement("style");r.type="text/css",r.id=e,r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),t.appendChild(r)}}}]),e}(),wy=function(e){if(!e)return!1;var t=Ay.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)},Ay=Object.prototype.toString;function ky(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 Ey(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ky(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ky(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xy(e){return null!=e&&e.error_url?"<vmap:VASTAdData>".concat(function(e){return e.promo_url?'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),"</vmap:VASTAdData>").trim():'<vmap:AdTagURI templateType="vast3"><![CDATA['.concat(null==e?void 0:e.adtag_url,"]]></vmap:AdTagURI>").trim()}function Sy(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 Ry(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sy(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Dy=new q,Ty=null,Iy=function(){function n(e,r,i){var a=this;if(R(this,n),Ty)return Ty;Ty=this;var s={debug:!1,width:640,height:360,locale:"en"};this.options=r?h(s,r):s,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new _,this.safetyTimer=null,this.containerTransitionSpeed=0,this.adCounter={},this.adPrerollCount=0,this.adMidrollCount=0,this.adRewardedCount=0,this.preloadedAdType=null,this.requestRunning=!1,this.parentDomain=i.parentDomain,this.topDomain=i.topDomain,this.parentURL=i.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=w(),this.atom_display,this.adType_="",this.clickCount={midroll:0,preroll:0,rewarded:0},this.userAllowedPersonalizedAds=document.location.search.indexOf("gdpr-targeting=0")>=0||document.cookie.indexOf("ogdpr_advertisement=0")>=0?"0":"1",this.parentDomain.includes("girlsgogames")&&(this.userAllowedPersonalizedAds=!1),this.thirdPartyContainer=""!==e?document.getElementById(e):null,this.options.width="number"==typeof this.options.width?this.options.width:"100%"===this.options.width?640:this.options.width.replace(/[^0-9]/g,""),this.options.height="number"==typeof this.options.height?this.options.height:"100%"===this.options.height?360:this.options.height.replace(/[^0-9]/g,"");var o=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:o,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:c,this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){t(this,a),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){t(this,a),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var i,a,s,o,c,u,d,l,p,A,k,E,x,S,O,P,L,U,q,F,V;return T(n,[{key:"start",value:(V=e(r.mark((function e(){var n=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._init_afg_script({adsense_channel:"4089988593"});case 3:return e.next=5,this._init_hl_script();case 5:return e.next=7,this._init_ima_script();case 7:this._createPlayer(),this._setUpIMA(),window.eventTest=function(e){t(this,n),this.eventBus.broadcast(e,{message:"",status:"success"})}.bind(this),e.next=15;break;case 12:throw e.prev=12,e.t0=e.catch(0),new Error(e.t0);case 15:case"end":return e.stop()}}),e,this,[[0,12]])}))),function(){return V.apply(this,arguments)})},{key:"_getAdVast",value:function(n,i){var a=this;return new Promise(function(){var s=e(r.mark((function e(s){var o,c,u,d,l,h,p,f,v=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(m.available&&m.getBoolean("gd_debug_ex")&&m.getBoolean("gd_tag"))){e.next=6;break}return o=a.IMASampleTags[n],c=Math.floor(Math.random()*o.length),u=o[c],s({url:u}),e.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){e.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return e.prev=8,d=a.nextAdPosition(n),a.eventBus.broadcast("AD_REQUEST",{message:d}),l=a.options,"preroll"===d&&B(l.preroll)?l=l.preroll:"midroll"===d&&B(l.midroll)?l=l.midroll:"rewarded"===d&&B(l.rewarded)&&(l=l.rewarded),h="rewarded"===d?"rewardedVideo":"gdbanner"===d?"gd__banner":"midroll"===d?"midroll":"video1",e.next=16,window.idhb.isLoaded();case 16:if(p={tnl_keys:Ry(Ry({},window.idhb.getAdserverTargetingForAdSlot(h)),{},{tnl_ad_pos:d,tnl_asset_id:a.gameData.gameId})},!(i&&i.retry_on_success&&B(l.retry_on_success)&&B(l.retry_on_success.vast))){e.next=21;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.retry_on_success.vast,p)));case 21:if(!(i&&i.retry_on_failure&&a.options.retry_on_failure&&B(l.retry_on_failure.vast))){e.next=25;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.retry_on_failure.vast,p)));case 25:if(!B(l.vast)){e.next=27;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.vast,p)));case 27:return e.next=29,a._create_dp_context(d,i);case 29:f=e.sent,window.idhb.requestAds({slots:D({},h,{bidFloor:null!=f&&f.floor_price?f.floor_price:void 0}),callback:function(e,n){var r=this;t(this,v),!f||null!=n&&n.bidFloorApplied||fetch(f.skip_url).catch(function(e){t(this,r)}.bind(this)),s({tnl_keys:Ry(Ry({},window.idhb.getAdserverTargetingForAdSlot(h)),{},{tnl_ad_pos:d,tnl_asset_id:a.gameData.gameId}),url:e,dp:f,hl:n})}.bind(this)}),e.next=36;break;case 33:throw e.prev=33,e.t0=e.catch(8),new Error(e.t0);case 36:case"end":return e.stop()}}),e,this,[[8,33]])})));return function(e){return s.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===v.Rewarded)return this.adRewardedCount++,"rewarded";if(e===v.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===v.Rewarded?"rewarded":e===v.Interstitial?!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_requestPromo",value:function(e,t){var n=new google.ima.AdsRequest;return n.adsResponse=function(e){return'<VAST version="3.0"> \n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA['.concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,"]]></VASTAdTagURI> \n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),n.linearAdSlotWidth=this.options.width,n.linearAdSlotHeight=this.options.height,n.nonLinearAdSlotWidth=this.options.width,n.nonLinearAdSlotHeight=this.options.height,n.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(n.vastLoadTimeout=this.options.vast_load_timeout),n.setAdWillAutoPlay(t.autoplayAllowed),n.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(n),n}},{key:"_requestAd",value:function(e,n){var r=this;return n=n||{},new Promise(function(i){if(t(this,r),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var a,s=null==e||null===(a=e.tnl_keys)||void 0===a?void 0:a.tnl_ad_pos;this.adSuccess=!1;var o=new google.ima.AdsRequest,c=this._transformVast(e,n),u=Ry(Ry({},n),{},{adTag:c,tnl_ad_pos:s});this.adCounter[s]=this.adCounter[s]||0,this.adCounter[s]++;var d=e.dp,l=e.hl;if(d&&(d.adtag_url=c.url,this._extend_dp_with_adsense(d,l,null==e?void 0:e.tnl_keys)),this._isVMAP(s)){var h=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,i=Date.now(),a=new I(e.adtag_url_1,!0);a.query=Ey(Ey({},a.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:i,output:"xml_vast3"});var s=a.toString(),o=new I(e.adtag_url_2,!0);o.query=Ey(Ey({},o.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++i,output:"xml_vast3"});var c=o.toString(),u=Date.now();return'<?xml version="1.0" encoding="UTF-8"?>\n<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-1">\n <vmap:AdSource id="'.concat(u++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(xy({id:u++,adtag_url:s,error_url:null==n?void 0:n.error_url,impression_url:null==n?void 0:n.impression_url}),'\n </vmap:AdSource>\n</vmap:AdBreak>\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-2">\n <vmap:AdSource id="').concat(u++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(xy({id:u++,adtag_url:c,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:d,adtag:c,position:"preroll"===u.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(s)}));o.adsResponse=h}else if(d&&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()}(d);o.adsResponse=p}else if(d&&d.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()}(d);o.adsResponse=f}else o.adTagUrl=c.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,u);try{this.eventBus.broadcast("AD_SDK_REQUEST",{message:u})}catch(e){}i(o)}catch(e){throw new Error(e)}}.bind(this))}},{key:"cancel",value:function(){if(!1!==this.requestRunning){this.requestRunning=!1,this._resetAdsLoader(),this._hide("cancel");var e="AD_SDK_CANCELED";this.eventBus.broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameData.gameId}})}}},{key:"_checkAutoPlay",value:(F=e(r.mark((function e(){var n=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,r){var i=this;t(this,n);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):j.video({inline:!0,muted:!1}).then(function(n){t(this,i);var r=n.result;n.error,e(!0===r?{autoplayAllowed:!0,autoplayRequiresMute:!1}:{autoplayAllowed:!0,autoplayRequiresMute:!0})}.bind(this))}.bind(this)));case 1:case"end":return e.stop()}}),e,this)}))),function(){return F.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(q=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._checkAutoPlay(!1);case 2:return t=e.sent,this._autoplay=t,this.video_ad_player.autoplay=t.autoplayAllowed,this.video_ad_player.volume=t.autoplayRequiresMute?0:1,this.video_ad_player.muted=!!t.autoplayRequiresMute,t.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0),e.abrupt("return",t);case 9:case"end":return e.stop()}}),e,this)}))),function(){return q.apply(this,arguments)})},{key:"startAd",value:(U=e(r.mark((function e(t){var n,i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.gameData.afg_disabled,i=t.adType,a=t.params,this.adType_=i,"promo"!==(null==a?void 0:a.adapter)){e.next=5;break}return e.abrupt("return",this._startPromo(a,i));case 5:if(i!==v.Interstitial){e.next=25;break}if(!n){e.next=10;break}return e.abrupt("return",this._startInterstitialAd(a));case 10:if("preroll"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=14;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 14:if("start"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=18;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 18:if("next"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=22;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 22:return e.abrupt("return",this._startInterstitialAd(a));case 23:e.next=34;break;case 25:if(i!==v.Rewarded){e.next=33;break}if(!n){e.next=30;break}return e.abrupt("return",this._startRewardedAd(a));case 30:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 31:e.next=34;break;case 33:throw new Error("Unsupported ad type");case 34:case"end":return e.stop()}}),e,this)}))),function(e){return U.apply(this,arguments)})},{key:"preloadAd",value:(L=e(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==v.Interstitial){e.next=4;break}return e.abrupt("return","gdsdk://preloaded");case 4:if(t!==v.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 L.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,n=function(){t(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new _y(this.adContainer,n),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(P=e(r.mark((function n(i){var a=this;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise(function(){var n=e(r.mark((function e(n,s){var o,c,u,d,l,h,p,f,m,v=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(c=i?i.containerId:null)||s("Container id is not specified"),u=document.getElementById(c),document.getElementById(c)||s("No container is found with this id - ".concat(c)),void 0===window.idhb.requestAds&&s("Prebid.js wrapper script hit an error or didn't exist!"),d=i.slotId?i.slotId:"gd__banner@".concat(c),document.getElementById(d)||(l="\n .gd__banner{\n z-index: ".concat(g.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((h=document.createElement("style")).type="text/css",h.id="gd__banner__style",h.styleSheet?h.styleSheet.cssText=l:h.appendChild(document.createTextNode(l)),u.appendChild(h)),(p=document.createElement("div")).id=d,p.classList.add("gd__banner"),u.appendChild(p)),e.next=10,a._create_dp_display_context();case 10:a.atom_display=e.sent,null!==(o=a.atom_display)&&void 0!==o&&o.params&&window.idhb.setAdserverTargeting(null===(f=a.atom_display)||void 0===f?void 0:f.params),(m={})[d]={maxSize:[u.offsetWidth,u.offsetHeight]},window.idhb.requestAds({slots:m,callback:function(e){t(this,v)}.bind(this)}),n(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),s(e.t0.message||e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(e,t){return n.apply(this,arguments)}}()));case 1:case"end":return n.stop()}}),n)}))),function(e){return P.apply(this,arguments)})},{key:"_startInterstitialAd",value:(O=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){t(this,a)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return i=e.sent,e.next=13,this._loadInterstitialAd(Ry(Ry({},i),n));case 13:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=22;break;case 18:throw e.prev=18,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(e){return O.apply(this,arguments)})},{key:"_startPromo",value:(S=e(r.mark((function e(t,n){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,this.adSuccess=!1,e.next=8,this._initDisplayContainerWithAutoPlay();case 8:return i=e.sent,e.next=11,this._loadPromo(Ry(Ry({},i),t),n);case 11:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),this.msgrt.send("promo.adsense",{message:"".concat(t.position," success")}),e.next=22;break;case 17:throw e.prev=17,e.t0=e.catch(0),this.msgrt.send("promo.adsense.err",{message:"".concat(t.position," failure,").concat(e.t0.message?e.t0.message:e.t0,", [").concat(this.parentURL,"]")}),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,17]])}))),function(e,t){return S.apply(this,arguments)})},{key:"_loadPromo",value:(x=e(r.mark((function e(n,i){var a,s,o,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._resetAdsLoader(),e.prev=1,a=this.nextAdPosition(i),s=this._create_promo_context(a),o=this._requestPromo(s,Ry({adType:v.Interstitial},n)),e.next=7,new Promise(function(e,n){var r=this;t(this,c);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var a=function(n){t(this,r),this.eventBus.unsubscribeScope(i),e(n.message)}.bind(this),s=function(e){t(this,r),this.eventBus.unsubscribeScope(i),n(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,i),this.eventBus.subscribe("AD_SDK_CANCELED",s,i),this.eventBus.subscribe("AD_ERROR",s,i),Dy.once("AD_ERROR",function(e){t(this,r),s(e)}.bind(this))}.bind(this));case 7:return e.abrupt("return",o);case 10:throw e.prev=10,e.t0=e.catch(1),new Error(e.t0);case 13:case"end":return e.stop()}}),e,this,[[1,10]])}))),function(e,t){return x.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(E=e(r.mark((function e(n){var i,a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(v.Interstitial,n);case 6:e.t0=e.sent;case 7:return i=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(i,Ry({adType:v.Interstitial},n));case 11:return a=e.sent,e.next=14,new Promise(function(e,n){var r=this;t(this,s);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var a=function(n){t(this,r),this.eventBus.unsubscribeScope(i),e(n.message)}.bind(this),o=function(e){t(this,r),this.eventBus.unsubscribeScope(i),n(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,i),this.eventBus.subscribe("AD_SDK_CANCELED",o,i),this.eventBus.subscribe("AD_ERROR",o,i)}.bind(this));case 14:return e.abrupt("return",a);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return E.apply(this,arguments)})},{key:"_startRewardedAd",value:(k=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){t(this,a)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return i=e.sent,e.next=13,this._loadRewardedAd(Ry(Ry({},i),n));case 13:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=22;break;case 18:throw e.prev=18,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(e){return k.apply(this,arguments)})},{key:"_loadRewardedAd",value:(A=e(r.mark((function e(n){var i,a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(v.Rewarded,n);case 6:e.t0=e.sent;case 7:return i=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(i,Ry({adType:v.Rewarded},n));case 11:return a=e.sent,e.next=14,new Promise(function(e,n){var r=this;t(this,s);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var a=function(n){t(this,r),this.eventBus.unsubscribeScope(i),e(n.message)}.bind(this),o=function(e){t(this,r),this.eventBus.unsubscribeScope(i),n(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,i),this.eventBus.subscribe("AD_SDK_CANCELED",o,i),this.eventBus.subscribe("AD_ERROR",o,i)}.bind(this));case 14:return e.abrupt("return",a);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return A.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(p=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(v.Interstitial);case 5:e.t0=e.sent;case 6:return this.preloadedInterstitialAdVast=e.t0,e.abrupt("return",this.preloadedInterstitialAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return p.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(l=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(v.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 l.apply(this,arguments)})},{key:"_onError",value:function(e){this.cancel(),this._clearSafetyTimer("ERROR")}},{key:"_hide",value:function(e){this.video_ad_player.src="",this.activeAdContainer&&(this.activeAdContainer.style.visibility="hidden")}},{key:"_show",value:function(e){var n=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var r=null==e?void 0:e.mode;e.t4r=Kv(this.gameData.__t4r)||{};var i=this._isT4R(e),a=this._getT4ROptions(e);if("loaded"===r)this.activeAdContainer.style.opacity=i?.001:1,i&&this.adsManager.setVolume(0),i&&this.eventBus.broadcast("AD_T4R"),i&&setTimeout(function(){t(this,n),this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}.bind(this),((null==a?void 0:a.min)||1234)+Math.random()*((null==a?void 0:a.max)||3210));else if("click"===r||"first_quartile"===r){if(i&&"click"===r){var s,o=null===(s=this._adrequest_user_context)||void 0===s?void 0:s.tnl_ad_pos;this.clickCount[o]++}this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}}}},{key:"_createPlayer",value:function(){var e=this,n=document.body||document.getElementsByTagName("body")[0];this.adContainer=document.createElement("div"),this.adContainer.id="".concat(this.prefix,"advertisement"),this.adContainer.style.position=this.thirdPartyContainer?"absolute":"fixed",this.adContainer.style.zIndex=g.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,window.activeAdContainer=this.activeAdContainer,this.thirdPartyContainer?(this.adContainer.appendChild(i),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(i),n.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var a=function(){t(this,e);var n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:n,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:a,i.style.width=this.options.width+"px",i.style.height=this.options.height+"px",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px"}.bind(this);window.addEventListener("resize",a),window.document.addEventListener("DOMContentLoaded",a)}},{key:"_setUpIMA",value:function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.adContainerInner,this.video_ad_player),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setDisableCustomPlaybackForIOS10Plus(!0),this.adsLoader.getSettings().setLocale(this.options.locale),this.adsLoader.getSettings().setVpaidMode(this._getVPAIDMode()),this.adsLoader.getSettings().setAutoPlayAdBreaks(!0);var e=this.adsLoader.getSettings().getNumRedirects();this.adsLoader.getSettings().setNumRedirects(2*e),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1,this),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError,!1,this)}},{key:"_onAdsManagerLoaded",value:function(e){var n=this,r=new google.ima.AdsRenderingSettings;r.autoAlign=!1,r.enablePreloading=!1,r.restoreCustomPlaybackStateOnAdBreakComplete=!0,r.useStyledNonLinearAds=!0,r.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(this.video_ad_player,r),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError.bind(this),!1,this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_METADATA,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CLICK,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.DURATION_CHANGE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.FIRST_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.IMPRESSION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.INTERACTION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LINEAR_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.MIDPOINT,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.THIRD_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.USER_CLOSE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_MUTED,this._onAdEvent.bind(this),this),window.addEventListener("resize",function(){t(this,n),this.adsManager&&this.adsManager.resize(this.options.width,this.options.height,google.ima.ViewMode.NORMAL)}.bind(this)),this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0);var i=new Date,a=i.getHours(),s=i.getDate(),o=i.getMonth(),c=i.getFullYear(),u="AD_SDK_MANAGER_READY";this.eventBus.broadcast(u,{name:u,message:"AD SDK is ready",status:"success",analytics:{category:u,action:this.parentDomain,label:"h".concat(a," d").concat(s," m").concat(o," y").concat(c)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var t,n=new Date,r=n.getHours(),i=n.getDate(),a=n.getMonth(),s=n.getFullYear(),o=y(google.ima.AdEvent.Type,e.type),c=!1,u=(null==e||null===(t=e.getAd())||void 0===t?void 0:t.getContentType())||"",d=!u.startsWith("image")&&!u.startsWith("text");this._sendIMAEventsToHB(e);var l="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:l="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:l="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:c=!0,l="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:l="Fired when the ad is clicked.";var h=e.getAd().getContentType();this._show({mode:"click",contentType:h});break;case google.ima.AdEvent.Type.COMPLETE:c=this._is_completed(e.getAd()),l="Fired when the ad completes playing.",this.adType_===v.Rewarded&&this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:l="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:l="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",c=!0,this._hideAddResume();break;case google.ima.AdEvent.Type.DURATION_CHANGE:l="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:l="Fired when the ad playhead crosses first quartile.";var p=e.getAd().getContentType();this._show({mode:"first_quartile",contentType:p});break;case google.ima.AdEvent.Type.IMPRESSION:l="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:l="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:l="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var f=e.getAd().getContentType();l=f,this._show({mode:"loaded",contentType:f});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(l=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:l="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:d&&this.adResume.show(),l="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:l="Fired when the ad is resumed.",d&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:l="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:c=this._is_completed(e.getAd()),l="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:this._hideAddResume(),l="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:l="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:c=this._is_completed(e.getAd()),l="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:l="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:l="Fired when the ad volume has been muted."}""!==o&&""!==l&&this.eventBus.broadcast(o,{name:o,message:l,status:"success",analytics:{category:o,action:this.parentDomain,label:"h".concat(r," d").concat(i," m").concat(a," y").concat(s)}}),c&&!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);Dy.emit("AD_ERROR",r),this.eventBus.broadcast(t,{message:r,details:i,status:"warning",analytics:{category:t,action:i,label:r}}),this._hideAddResume()}catch(e){}}},{key:"_hideAddResume",value:function(){try{this.adResume&&this.adResume.hide()}catch(e){console.log("Error on hide adResume",e)}}},{key:"_sendIMAEventsToHB",value:function(e){if(window.idhb&&"function"==typeof window.idhb.onImaEvent)try{window.idhb.onImaEvent({event:e})}catch(e){}}},{key:"_resetAdsLoader",value:function(){this.adsManager&&(this.adsManager.destroy(),this.adsManager=null,this._adrequest_user_context=null),this.adsLoader&&this.adsLoader.contentComplete()}},{key:"_startSafetyTimer",value:function(e,n){var r=this;this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=window.setTimeout(function(){t(this,r),this.cancel(),this._clearSafetyTimer(n)}.bind(this),e)}},{key:"_clearSafetyTimer",value:function(e){void 0!==this.safetyTimer&&null!==this.safetyTimer&&(clearTimeout(this.safetyTimer),this.safetyTimer=void 0)}},{key:"_getVPAIDMode",value:function(){return google.ima.ImaSdkSettings.VpaidMode.ENABLED}},{key:"_getPrebidScripts",value:function(){var e=["https://hb.improvedigital.com/pbw/headerlift.min.js","http://hb.improvedigital.com/pbw/headerlift.min.js"];return this.options.hb_script?[this.options.hb_script].concat(e):e}},{key:"_getInnerErrorCode",value:function(e){if(wy(e.getInnerError)){var t=e.getInnerError();if(t)return wy(t.getErrorCode)&&wy(t.getVastErrorCode)?t.getErrorCode().toString()||t.getVastErrorCode().toString():t.message}}},{key:"resetForNext",value:function(){this.requestRunning=!1,this._hide("resetForNext")}},{key:"_createCustomAdVastUrl",value:function(e,n){var r=this;if(e){var i=this.macros.transform(e,{get:function(e){if(t(this,r),n&&n.tnl_keys)return n.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in i.query||{}){var s=i.query[a];B(s)&&(i.query[a]=G.stringify(s))}var o=new I(i.url,!0);return N(o.query,i.query||{}),Ry({url:o.toString()},n)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new I(e.url,!0),i=this._transformQuery(e,t,r);i&&(n.url=r.toString());var a=i?r:new I(e.url,!0);if(a.query.cust_params){var s=G.parse(a.query.cust_params);n.bidder=s.hb_bidder,n.cust_params=s}n.url_parsed=a}catch(e){n.hasError=!0,n.message=e.message,n.bidder="error",console.log(e.message)}return n}},{key:"_transformQuery",value:function(e,n,r){var i=this;if(e&&n&&e.tnl_keys){var a=this.options.vast_query;if(n.retry_on_success&&this.options.retry_on_success&&B(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:n.retry_on_failure&&this.options.retry_on_failure&&B(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=M(a),B(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 c=G.parse(s.cust_params);if(a.cust_params&&a.cust_params.$$remove){for(var u in c){new RegExp(a.cust_params.$$remove,"i").test(u)&&delete c[u]}delete a.cust_params.$$remove}var d=this.macros.transform(a,{get:function(n){return t(this,i),e.tnl_keys[n.toLowerCase()]}.bind(this)});return s.cust_params=c,N(s,d),s.cust_params=G.stringify(s.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,i,a=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(this.clickCount[a]>=(null===(n=e.t4r[a])||void 0===n?void 0:n.count))return!1;if(null!=e&&null!==(r=e.contentType)&&void 0!==r&&r.startsWith("image/")||"text"===(null==e?void 0:e.contentType))return a&&(null===(i=e.t4r[a])||void 0===i?void 0:i.enabled);if(null!=e&&e.contentType.startsWith("video/")){var s,o=(null===(s=e.t4r[a])||void 0===s?void 0:s.viper)||0;if(o>0){var c,u=Math.random()<o;return a&&u&&(null===(c=e.t4r[a])||void 0===c?void 0:c.enabled)}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,n,r,i,a,s,o,c,u,d,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===(c=this.gameData)||void 0===c||null===(u=c.mAds)||void 0===u||null===(d=u.vmap)||void 0===d?void 0:d.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(e){var t,n=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;switch(n){case"preroll":case"midroll":case"rewarded":return e.t4r[n]}}},{key:"_is_completed",value:function(e){var t=e.getContentType(),n=e.getAdPodInfo();return!(!t.startsWith("image/")&&"text"!==t&&1!==n.getTotalAds())}},{key:"_get_vmap_context",value:function(e){var t=e.adtag,n=e.position,r=e.config,i=e.dp,a=this._createCustomAdVastUrl(null==r?void 0:r.vast_1)||t,s=this._createCustomAdVastUrl(null==r?void 0:r.vast_2)||t,o=null!=r&&r.vast_1?void 0:i,c=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:c}}},{key:"_get_vmap_config",value:function(e){var t,n,r,i,a,s,o,c;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===(c=o.pAds)||void 0===c?void 0:c.vmap}}},{key:"_isDP",value:function(e){var t,n,r;return!!e&&!0===(null===(t=this.gameData)||void 0===t||null===(n=t.dp)||void 0===n||null===(r=n[e])||void 0===r?void 0:r.enabled)}},{key:"_create_dp_display_context",value:function(){var e=this;return new Promise(function(n){var r=this;t(this,e);try{var i={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new by(this.gameData).checkCustomParams();a&&(i.cp=a);var s=encodeURIComponent(C.encode(JSON.stringify(i)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(s)).then(function(e){return t(this,r),e.json()}.bind(this)).then(function(e){if(t(this,r),!e||!e.p)return this.msgrt.send("dp.na",{message:"atom"}),n();this.msgrt.send("dp.fp",{message:e.p/100}),n({params:{fp:e.p/100},error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(s),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(s)})}.bind(this)).catch(function(e){t(this,r),this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),n()}.bind(this))}catch(e){this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),n()}}.bind(this))}},{key:"_create_promo_context",value:function(e){var n,r=this,i={id:this.topDomain||this.parentDomain,au:e||"unknown",ty:"video",aid:this.gameData.gameId,pgu:this.parentURL},a=Object.keys(i).map(function(e){return t(this,r),"".concat(e,"=").concat(encodeURIComponent(i[e]))}.bind(this)).join("&");encodeURIComponent(C.encode(JSON.stringify(i)));var s=null===(n=this.gameData.promo)||void 0===n?void 0:n.rainbow,o=null==s?void 0:s.enabled,c="https://tag.atom.gamedistribution.com/v1/rainbow/?".concat(a),u=o?c:void 0;return function(){t(this,r)}.bind(this),{promo_url:u,promo_imp_blue_url:o?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:o?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0}}},{key:"_create_dp_context",value:function(n,i){var a=this;return new Promise(function(){var s=e(r.mark((function e(s){var o,c,u,d,l,h,p=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,a._isDP(n)){e.next=5;break}return a.msgrt.send("dp.na",{message:"rule"}),e.abrupt("return",s());case 5:c={id:a.topDomain||a.parentDomain,au:n||"unknown",ty:"video",aid:a.gameData.gameId,pgu:a.parentURL},(u=new by(a.gameData).checkCustomParams())&&(c.cp=u),d=encodeURIComponent(C.encode(JSON.stringify(c))),l=null===(o=a.gameData.promo)||void 0===o?void 0:o.rainbow,h=(null==l?void 0:l.enabled)&&!0!==(null==i?void 0:i.fallback_adsense),fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(d)).then(function(e){return t(this,p),e.json()}.bind(this)).then(function(e){if(t(this,p),!e||!e.p)return a.msgrt.send("dp.na",{message:"atom"}),s();var n=e.p/100;s({id:Date.now(),floor_price:n,error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(d,"&ec=[ERRORCODE]"),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(d),skip_url:"https://tag.atom.gamedistribution.com/v1/skp?ar=".concat(d),promo_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(d):void 0,promo_imp_blue_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){t(this,p),a.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),s()}.bind(this)),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(0),a.msgrt.send("dp.err",{message:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0}),s();case 18:case"end":return e.stop()}}),e,this,[[0,14]])})));return function(e){return s.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t){if(e&&t)try{var n,r=new I(t.vastUrl,!0);if(null===(n=r.query)||void 0===n||!n.cust_params)return;var i=G.parse(r.query.cust_params);if(!i.tnl_asset_id)return;i.adsense=1,r.query.cust_params=G.stringify(i,!1),e.fallback_url=r.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(d=e(r.mark((function e(n){var i,a,s,o,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._getPrebidScripts(),a=i[0],window.idhb=window.idhb||{},window.idhb.options=window.idhb.options||{},Object.assign(window.idhb.options,{assetId:this.gameData.gameId,configUrl:this.topDomain||this.parentDomain,parentUrl:this.parentURL,pageType:"gd"}),window.idhb.que=window.idhb.que||[],e.next=8,f(a,"gdsdk_prebid",{alternates:i,error_prefix:"Blocked:",exists:function(){return t(this,u),window.idhb.requestAds}.bind(this)});case 8:s=b("ch",window.location.href),o=b("ch_date",window.location.href),c={tnl_content_category:this.category.toLowerCase()},s&&(c.channel=s),o&&(c.ch_date=o),window.idhb.setAdserverTargeting(c),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var n=this;t(this,u);try{var r,i=e.slotId.split("@");i=1===i.length?i[0]:i[1],e.isEmpty?(null!==(r=this.atom_display)&&void 0!==r&&r.error_url&&(fetch(this.atom_display.error_url).catch(function(e){t(this,n)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_ERROR",{message:i,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){t(this,n)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:i,status:"success"}))}catch(e){}}.bind(this));case 16:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"_init_ima_script",value:(u=e(r.mark((function e(n){var i,a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=["https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","https://imasdk.googleapis.com/js/sdkloader/ima3.js","http://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","http://imasdk.googleapis.com/js/sdkloader/ima3.js"],a=this.options.debug?i[0]:i[1],e.next=4,f(a,"gdsdk_ima",{alternates:i,error_prefix:"Blocked:",exists:function(){return t(this,s),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"_init_afg_script",value:(c=e(r.mark((function e(n){var i,a,s,o,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.gameData.afg_disabled){e.next=3;break}return e.abrupt("return");case 3:return(o={}).crossorigin="anonymous",o["data-ad-client"]=(null==n||null===(i=n.adsense_client)||void 0===i?void 0:i.length)>0?n.adsense_client:"ca-pub-2316275586951220",o["data-ad-frequency-hint"]="30s",o.allow="autoplay",(null==n||null===(a=n.adsense_channel)||void 0===a?void 0:a.length)>0&&(o["data-ad-channel"]=n.adsense_channel),(null==n||null===(s=n.adsense_host)||void 0===s?void 0:s.length)>0&&(o["data-ad-host"]=n.adsense_host),!0===(null==n?void 0:n.adsense_adbreak_test)&&(o["data-adbreak-test"]="on"),e.next=14,f("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return t(this,c),!!window.adsbygoogle}.bind(this),attrs:o});case 14:window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({sound:"on",preloadAdBreaks:"on"});case 16:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"clearSession",value:function(){this.requestRunning=!1}},{key:"_startAdsensePlacementRewardedAd",value:(o=e(r.mark((function e(n){var i,a,s,o,c,u,d=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){t(this,d)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),i=function(){t(this,d),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,d),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(){t(this,d),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),o=function(){t(this,d),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),c=function(e){t(this,d),e()}.bind(this),u=function(e){t(this,d),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===e.breakStatus?this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error",skipForward:!0}),"dismissed"!==e.breakStatus&&this._send_atom_event("sg.dbg.rw",e))}.bind(this),n={type:"reward",name:"reward-in-game",beforeAd:i,afterAd:a,adDismissed:s,adViewed:o,beforeReward:c,adBreakDone:u},window.adsbygoogle.push(n),e.next=24;break;case 20:throw e.prev=20,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 24:case"end":return e.stop()}var n}),e,this,[[1,20]])}))),function(e){return o.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(s=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){t(this,a)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),i=function(e){t(this,a),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"}),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),n={type:"preroll",adBreakDone:i},window.adsbygoogle.push(n),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}var n}),e,this,[[1,15]])}))),function(e){return s.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(a=e(r.mark((function e(n){var i,a,s,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){t(this,o)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),i=function(){t(this,o),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,o),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(e){t(this,o),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),n={type:"start",name:"start-in-game",beforeAd:i,afterAd:a,adBreakDone:s},window.adsbygoogle.push(n),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var n}),e,this,[[1,17]])}))),function(e){return a.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(i=e(r.mark((function e(n){var i,a,s,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){t(this,o)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),i=function(){t(this,o),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,o),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(e){t(this,o),this.resetForNext(),this.adCounter.midroll=this.adCounter.midroll||0,this.adCounter.midroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.mr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",e))}.bind(this),n={type:"next",name:"next-in-game",beforeAd:i,afterAd:a,adBreakDone:s},window.adsbygoogle.push(n),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var n}),e,this,[[1,17]])}))),function(e){return i.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var n=this.msgrt,r=n._layout,i=n._ua,a={tp:e,ct:0,vrs:this.PackageJSON.version,url:this.parentURL,rfr:document.referrer,tdmn:this.topDomain||this.parentDomain,dpth:0,args:t,ua:{brnm:i.browser.name,brvs:i.browser.version,osnm:i.os.name,osvs:i.os.version,dvmd:i.device.model,w:r.w,h:r.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(C.encode(JSON.stringify(a)))))}catch(e){}}},{key:"_send_atom_event",value:function(e,t){this._send(e,{gid:this.gameData.slug,md5:this.gameData.gameId,pid:0,pnm:this.gameData.pname,ctry:this.gameData.ctry,lcl:"en",hle:1,ads:1,args:t,href:window.location.href})}},{key:"_isAfgPositionNext",value:function(e){return void 0!==e.adTimestamp}},{key:"_isAfgPositionStart",value:function(e){if(void 0!==e.adTimestamp)return!1;return this.adCounter.preroll=this.adCounter.preroll||0,0===this.adCounter.preroll}},{key:"attachAfgPosition",value:function(e){var t=e.params.position;switch(t){case"preroll":case"start":case"pause":case"next":case"browse":case"reward":return}var n=e.adType;if(n===v.Rewarded)t="reward";else if(n===v.Interstitial){var r,i;if(this._isAfgPositionStart(e))t=null===(r=this.gameData.pAds)||void 0===r||!r.enabled||null!==(i=this.gameData.loader)&&void 0!==i&&i.enabled?"start":"next";else this._isAfgPositionNext(e)&&(t="next")}e.params.position=t}}]),n}(),Cy=function t(n){var i=this;R(this,t),D(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rl(i.moduleName);case 2:i.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),D(this,"promo",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.module){e.next=3;break}return e.next=3,i.load();case 3:return e.abrupt("return",i.module[i.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var a=n.package||"gd-sdk-stone-dynamic",s=n.package_version||"1.1.1",o=n.template||"puzzle",c=n.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=o.charAt(0).toUpperCase()+o.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(a,"/").concat(s,"/dist/").concat(o.toLowerCase(),"/iife/index.js"),dependencies:c},xl(this.moduleName,this.moduleConfig)},Oy=function t(n){var i=this;R(this,t),D(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rl(i.moduleName);case 2:i.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),D(this,"splash",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.module){e.next=3;break}return e.next=3,i.load();case 3:return e.abrupt("return",i.module[i.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var a=n.package||"gd-sdk-air-dynamic",s=n.package_version||"1.2.0",o=n.template||"pluto",c=n.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=o.charAt(0).toUpperCase()+o.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(a,"/").concat(s,"/dist/").concat(o.toLowerCase(),"/iife/index.js"),dependencies:c},xl(this.moduleName,this.moduleConfig)},Py=function(e,t){console.log(e,t)},Ly={},Uy={},My=null;function jy(){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 Ly.version=r,Ly.frame=e,Ly.function=n,Ly.version}function By(e){var n=this;return My||(My=new Promise(function(r){function i(t,n){if(Py("Received a response from CMP",t),n){var i,a;if(!1!==t.gdprApplies)return"tcloaded"===t.eventStatus||"useractioncomplete"===t.eventStatus?(("boolean"!=typeof(a=(i=t)&&"boolean"==typeof i.gdprApplies?i.gdprApplies:e.defaultGdprScope)||!0===a&&"string"!=typeof i.tcString)&&r({result:"cmpUnexpectedResponse",cmp:Ly,consentData:i}),void r({result:"ok",consentData:t})):void 0;r({result:"ok",consentData:t})}else r({result:"cmpCallFailed"})}t(this,n),jy(),Ly.frame?2===Ly.version?(Py("TCF v2 CMP found. Fetching the consent."),Ly.function?(Py("CMP API is directly accessible, calling it now..."),Ly.function("addEventListener",Ly.version,i)):(Py("CMP API is outside the current iframe, calling it now..."),function(e,n,r){var i=this,a="__tcfapi";function s(e){var t="".concat(a,"Return"),n="string"==typeof e.data&&e.data.indexOf(t)>=0?JSON.parse(e.data):e.data;if(n[t]&&n[t].callId){var r=n[t];void 0!==Uy[r.callId]&&Uy[r.callId](r.returnValue,r.success)}}window[a]=function(e,r,s,o){t(this,i);var c=Math.random()+"",u="".concat(a,"Call"),d=D({},u,{command:e,parameter:o,callId:c,version:r});Uy[c]=s,n.postMessage(d,"*")}.bind(this),window.addEventListener("message",s,!1),window[a](e,Ly.version,r)}("addEventListener",Ly.frame,i))):r({result:"cmpVersionNotV2",cmp:Ly}):r({result:"cmpNotFound"})}.bind(this)))}var Gy=new(function(){function t(){R(this,t),this.productName="Game Distribution"}var n;return T(t,[{key:"checkIfExcluded",value:function(e){try{var t,n;return!(null===(t=e.diagnostic)||void 0===t||null===(n=t.gameDock)||void 0===n||!n.excluded)}catch(e){return console.log("Error on checkIfExclude check",e),!1}}},{key:"track",value:(n=e(r.mark((function e(t,n){var i,a,s,o,c,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.checkIfExcluded(n)){e.next=3;break}return e.abrupt("return");case 3:if(a=null==t||null===(i=t.visitor)||void 0===i?void 0:i.visitorId){e.next=6;break}return e.abrupt("return");case 6:return s=encodeURIComponent(this.productName),o=encodeURIComponent(a),e.prev=8,c="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(s,"/user_id/").concat(o),e.next=12,fetch(c,{method:"POST"});case 12:e.next=28;break;case 15:return e.prev=15,e.t0=e.catch(8),console.log("GAME_DOCK. fail v4",e.t0),e.prev=18,u="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(s,"/user_id/").concat(o),e.next=22,fetch(u,{method:"POST"});case 22:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(18),console.log("GAME_DOCK. fail v6",e.t1);case 28:case"end":return e.stop()}}),e,this,[[8,15],[18,25]])}))),function(e,t){return n.apply(this,arguments)})}]),t}());function Ny(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 qy(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 qy(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 qy(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 Fy=function(e){var n=this,r=e.src,i=e.attributes,a=e.target,s=e.isAsync;return new Promise(function(e,o){var c=this;t(this,n);try{var u=document.createElement("script");if(u.async=null==s||s,u.type="text/javascript",u.onload=function(){t(this,c),e()}.bind(this),u.onerror=function(){t(this,c);var e="Error on script load, Error: ".concat(r);console.log(e),o(e)}.bind(this),u.src=r,i){var d,l=Ny(i);try{for(l.s();!(d=l.n()).done;){var h=d.value,p=h.key,f=h.value;u.setAttribute(p,f)}}catch(e){l.e(e)}finally{l.f()}}a||(a=document.head),a.appendChild(u)}catch(e){var m="Error on script load catch, Error: ".concat(r);console.log(m,e),o(m)}}.bind(this))},Vy=function(){var t=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Fy({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,Fy({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,Fy({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),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("GD: CMP error on load",e.t0);case 13:case"end":return e.stop()}var t,n,r,i}),e,null,[[0,10]])})));return function(){return t.apply(this,arguments)}}(),Wy=new q,Ky={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};function Hy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}window.addEventListener("message",(function(e){var n=this,r=e.data,i=e.origin,a=r.type;if(Object.keys(Ky).some(function(e){return t(this,n),e===i}.bind(this))&&(null==r||!r.__tcfapiCall)&&(window.parent&&!r.type.startsWith("gd-sdk")&&window.parent.postMessage(r,"*"),a)){var s=Ky[i][a];s&&Wy.emit(s,r)}}),!1);var zy=F(),$y=function(e){var n=this;if(!window.__msgr){var r=document.createElement("iframe");if(r.src="https://static.gamedistribution.com/message/index.html",r.style.display="none",r.name="__msgr",document.body.appendChild(r),window!==window.top){var i={gameId:e.gameId,target:e.evnts.domain,token:zy,event_name:"TokenGenerated",timestamp:Date.now()};r.onload=function(){Jy(i)},setInterval(function(){t(this,n),i.timestamp=Date.now(),i.event_name="Heartbeat",Jy(i)}.bind(this),1e3*e.evnts.heartbeatDuration)}}window.addEventListener("message",function(e){t(this,n);try{var r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hy(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.data);if(!r.event_name)return;r.token=zy,Jy(r)}catch(e){console.error("GD Messager Error",e.message)}}.bind(this),!1)},Qy=function(e){try{var t={gameId:e.game.gameId,target:e.game.evnts.domain,event_name:e.event,timestamp:Date.now()},n=Yy(window);n!==window.top&&(null==n||n.postMessage(t,"https://html5.gamedistribution.com"))}catch(e){}},Yy=function e(t){try{var n,r,i=null==t?void 0:t.parent;if("game"===(null===(n=i.document)||void 0===n||null===(r=n.activeElement)||void 0===r?void 0:r.id))return i;e(i)}catch(e){return t}},Jy=function(e){window.__msgr.postMessage(e,"https://static.gamedistribution.com")};function Xy(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 Zy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xy(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var eb,tb=null,nb=null,rb=function(){function n(e){var r=this;if(R(this,n),tb)return tb;tb=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,e),this._version=e.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new hv,this._location.print(),this._parentURL=0===this._bridge.depth?encodeURIComponent(this._bridge.parentURL):this._bridge.parentURL,this._parentDomain=this._bridge.parentDomain,this._topDomain=this._bridge.topDomain,this._isFullScreen=!1,this._giftCount=0,this._setConsoleBanner(),this._initializeMessageRouter(),this._checkConsole(),this._subscribeToEvents(),this.sdkReady=new Promise(this._initializeSDKWithGameData.bind(this)),this.sdkReady.then(function(e){t(this,r),this._sdk_ready=!0}.bind(this)).catch(function(e){t(this,r),this._sdk_ready=!1}.bind(this)).finally(function(){var e,n;t(this,r),!0===(null===(e=this._gameData.lp)||void 0===e?void 0:e.load)&&this._sendLoadedEvent(1),this._sendLoaderDataEvent(),this._checkSplashAndPromoScreens(),this._initBlockingExternals(),this._initUnityHandler(),this._checkFullscreen(),null!==(n=this._gameData.evnts)&&void 0!==n&&n.enabled&&this._isLoaderGameURL()&&$y(this._gameData)}.bind(this)),this._registerSGBridge()}var u,g,y,b,w,D,O,P,L,U,j,B;return T(n,[{key:"_initUnityHandler",value:function(){var e=this;window.addEventListener("DOMNodeInserted",function(){if(t(this,e),this._gameData.block_exts&&this._removeExternalsInHtml({enabled:!1}),document.getElementsByClassName("webgl-content")[0]){var n=document.getElementsByClassName("webgl-content")[0].getElementsByClassName("footer")[0];n&&n.setAttribute("style","display:none")}}.bind(this))}},{key:"_loadCMP",value:(B=e(r.mark((function e(){var t,n,i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=6;break}if(i=new hv,0!==(null==(a=i.get("depth"))?void 0:a.value)||null===(t=this._gameData)||void 0===t||null===(n=t.cmp)||void 0===n||!n.enabled||"html5.gamedistribution.com"!==this._topDomain){e.next=6;break}return e.next=6,Vy();case 6:case"end":return e.stop()}}),e,this)}))),function(){return B.apply(this,arguments)})},{key:"testConsent",value:function(){try{jy();e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,By({});case 2:e.sent;case 3:case"end":return e.stop()}}),e)})))()}catch(e){console.log("find CMP error",e)}}},{key:"_sendLoaderDataEvent",value:function(){try{this.options.onLoaderEvent&&this.options.onLoaderEvent({name:"LOADER_DATA",message:{game:this._gameData,bridge:this._bridge},status:this._sdk_ready?"success":"error"})}catch(e){}}},{key:"_registerSGBridge",value:function(){var e=this;Wy.on("splash-hidden",function(n){t(this,e),this._hideCMPButton()}.bind(this))}},{key:"_hideCMPButton",value:function(){var e=document.getElementById("ot-sdk-btn-floating");e&&(e.style.display="none")}},{key:"isLoaded",value:function(){if(void 0===this._isLoaded){var e=this._isTokenGameURL(),t=this._isExtHostedGameURL(),n=this._isMasterGameURL();this._isLoaded=(e||t&&!n)&&this._gameData.loader.enabled}return this._isLoaded}},{key:"setIsLoaded",value:function(e){this._isLoaded=e}},{key:"_sendLoadedEvent",value:function(){if(!this.isLoaded()){this.setIsLoaded(!0);try{this._sendTunnlEvent(1),this.msgrt.send("loaded",{message:this._hasBlocker?"Has Blocker":"No Blocker"})}catch(e){}}}},{key:"_sendGamedockGamePlay",value:function(){var e=this._isTokenGameURL();if(!(this._gameData.loader.enabled&&e||this._gameDockGamePlaySent))try{this._sendGamedockEvent("gameplay"),this._gameDockGamePlaySent=!0}catch(e){}}},{key:"_safeInit",value:function(){this._checkUserDeclinedTracking(),this._checkWhitelabelPartner();var e=this._gameData.diagnostic;void 0!==e&&void 0!==e.close_ga&&!1!==e.close_ga||!this._bridge.isCoreSDKMode&&this._loadGoogleAnalytics(),void 0!==e&&void 0!==e.close_gamedock&&!1!==e.close_gamedock||!this._bridge.isCoreSDKMode&&!this._bridge.noGamedockSDK&&this._loadGamedockTracker(),void 0!==e&&void 0!==e.close_minijuegos&&!1!==e.close_minijuegos||!this._bridge.isCoreSDKMode&&!this._bridge.noMinijuegosSDK&&document.location.search.indexOf("mp_game_id")>=0&&this._loadMiniJuegosGratisTracker()}},{key:"_initializeSDKWithGameData",value:(j=e(r.mark((function e(n,i){var a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getGameData();case 3:return this._gameData=e.sent,e.next=6,this._loadCMP();case 6:this._bridge.isCoreSDKMode=!(!0===this._gameData.enableAds||!0===(null===(a=this._gameData.enableAds)||void 0===a?void 0:a.enabled)),this._safeInit(),this._checkGameId(),this._checkGameDeleted(),this._checkBlocking(),this._changeMidrollInDebugMode(),void 0!==this._gameData.diagnostic&&void 0!==this._gameData.diagnostic.close_ads&&!1!==this._gameData.diagnostic.close_ads||(this.videoAdReady=this._initializeVideoAd().catch(function(e){return t(this,s),console.error(e.message||e)}.bind(this))),n(this._gameData),e.next=21;break;case 16:e.prev=16,e.t0=e.catch(0),this._sendSDKError(e.t0),this.onResumeGame(e.t0.message,"warning"),i(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e,t){return j.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?h(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=pv.version,t=console.log("%c %c %c GameDistribution.com HTML5 SDK | Version: "+e+" %c %c %c","background: #9854d8","background: #6c2ca7","color: #fff; background: #450f78;","background: #6c2ca7","background: #9854d8","background: #ffffff");console.log.apply(console,t)}}},{key:"_sendTunnlEvent",value:function(e){var n=this;void 0===this._topDomain&&(this._topDomain=void 0);var r={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(G.stringify(r))).catch(function(e){t(this,n)}.bind(this))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=c("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,p("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!m.available)return;"developer.gamedistribution.com"===this._parentDomain?(m.set("gd_debug_ex",!0),m.set("gd_disable_midroll_timer",!0),m.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(m.set("gd_debug_ex",!0),m.set("gd_disable_midroll_timer",!0)),m.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 l({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:s(),version:pv.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:d(),byloader:this._bridge.isTokenGameURL,isTokenGameURL:this._bridge.isTokenGameURL,isMasterGameURL:this._bridge.isMasterGameURL,isExtHostedGameURL:this._bridge.isExtHostedGameURL,byloaderVersion:this._bridge.version})}},{key:"_loadGamedockTracker",value:function(){var e=this;try{var n=["https://cdn.gamedock.io/gamedock-web-tracker/4.4.0/script/gamedock-sdk.min.js"];f(n[0],"GamedockSDK",{alternates:n}).then(function(){var n,r;t(this,e),nb=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(r=n.gameDock)&&void 0!==r&&r.adViewEvent&&nb.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),Gy.track(nb,this._gameData)}.bind(this)).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}catch(e){}}},{key:"_initGamedockTracker",value:function(e){if(!this._bridge.isCoreSDKMode)return e.initialize("gd",this._parentDomain)}},{key:"_sendGamedockEvent",value:function(e){var t,n;null===(t=nb)||void 0===t||null===(n=t.tracking)||void 0===n||n.trackEvent(e,{pageId:this.options.gameId,pageType:"game"})}},{key:"_loadMiniJuegosGratisTracker",value:function(){var e=this;window.mpConfig={game:this.options.gameId,partner:"game-distribution"};var n=["https://ext.minijuegosgratis.com/external-host/main.js"];f(n[0],"MinijuegosSDK",{alternates:n}).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,n=["https://www.google-analytics.com/analytics.js"];f(n[0],"gdsdk_google_analytics",{alternates:n,error_prefix:"Blocked:",exists:function(){return t(this,e),window.ga}.bind(this)}).then(function(){t(this,e),window.ga("create","UA-60359297-49",{name:"gd",cookieExpires:7776e3,sampleRate:5},"auto"),this._bridge.noGAPageView||window.ga("gd.send","pageview"),this._userDeclinedTracking||window.ga("gd.set","anonymizeIp",!0)}.bind(this)).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new _,A.forEach(function(n){var r=this;return t(this,e),this.eventBus.subscribe(n,function(e){return t(this,r),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),k.forEach(function(n){var r=this;return t(this,e),this.eventBus.subscribe(n,function(e){return t(this,r),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(t(this,e),"developer.gamedistribution.com"===this._parentDomain||!0===new RegExp("^localhost").test(this._parentDomain)){fetch("https://game.api.gamedistribution.com/game/v2/hasapi/".concat(this.options.gameId,"?timestamp=").concat((new Date).valueOf()));try{var n=JSON.stringify({type:"GD_SDK_IMPLEMENTED",gameID:this.options.gameId});window.location!==window.top.location?window.top.postMessage(n,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(n,"*")}catch(e){}}}.bind(this),"ima"),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){return t(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(n){var r,i;t(this,e),this.msgrt.send("ad.impression"),null!==(r=this._gameData.diagnostic)&&void 0!==r&&null!==(i=r.gameDock)&&void 0!==i&&i.adViewEvent&&Gy.track(nb,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(n){t(this,e),this.msgrt.send("ad.error",{message:n.message,details:n.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(n){t(this,e),this._sendAdRequestContext(n.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(n){t(this,e),n.message.startsWith("Blocked:")?this._bridge.noBlockerEvent||(this.msgrt.send("error",{message:n.message}),this._hasBlocker||(this._hasBlocker=!0,this._sendTunnlEvent(3))):this.msgrt.send("error",{message:n.message})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_EMPTY",function(n){t(this,e),this.msgrt.send("tunnl.keys.empty",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_FALLBACK",function(n){t(this,e),this.msgrt.send("tunnl.keys.fallback",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_T4R",function(n){return t(this,e),this.msgrt.send("adt4r")}.bind(this),"sdk")}},{key:"_checkGameId",value:function(){this.options.gameId===this._defaults.gameId&&this._sendSDKError("Check correctness of your GAME ID. Otherwise, no revenue will be recorded.")}},{key:"_getDefaultGameData",value:function(){return{gameId:this.options.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}},{key:"_getGameDataUrl",value:function(){var e=void 0!==this._topDomain&&"undefined"!==this._topDomain?this._topDomain:this._parentDomain;return"https://game.api.gamedistribution.com/game/v4/get/".concat(this.options.gameId.replace(/-/g,""),"/?domain=").concat(e,"&v=").concat(pv.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(U=e(r.mark((function e(){var n,i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this._gameData,n=void 0===this._gameData.dmain||this._gameData.dmain,(i.bloc_gard&&!0===i.bloc_gard.enabled||!n)&&(this.msgrt.send("blocked"),setTimeout(function(){t(this,a),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(G.stringify({domain:this._parentDomain,id:i.gameId,img:this._get_game_thumbnail_url(),title:i.title}))}.bind(this),100));case 5:case"end":return e.stop()}}),e,this)}))),function(){return U.apply(this,arguments)})},{key:"_checkGameDeleted",value:function(){var e=this;6===this._gameData.status&&(console.log("%c %c %c This game was deleted, please remove it in your website... ","background: #F2181A","background: #F23818","color: #fff; background: #F23818;","background: #F55E60","background: #F55E60","background: #c4161e; color: #fff;"),setTimeout(function(){t(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;m.available&&m.getBoolean("gd_debug_ex")&&(m.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=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._bridge.isCoreSDKMode){e.next=2;break}return e.abrupt("return");case 2:return(t=this._gameData).sdk.enabled&&(this.options.advertisementSettings=h(this.options.advertisementSettings,t.sdk)),this.macros=new E({game:t,bridge:this._bridge}),this.adInstance=new Iy(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=pv,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){p("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){p("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){p(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status,skipForward:e.skipForward})}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:(P=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Yv();case 2:return t=e.sent,this._bridge.noPreroll=(!this._getisMobile()||!1!==t.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(t),x(t.diagnostic),e.abrupt("return",t);case 8:case"end":return e.stop()}}),e,this)}))),function(){return P.apply(this,arguments)})},{key:"_createSplash",value:(O=e(r.mark((function e(n,i){var a,s,o,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(n);case 2:return a=e.sent,s=new a(Zy(Zy({},this.options),{},{isConsentDomain:i,version:pv.version}),n,this._parentDomain),e.next=6,eg();case 6:o=e.sent,c=o.enabled,s.on("playClick",function(){var e=this;if(t(this,u),i){var n=new Date;n.setDate(n.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(n.toUTCString(),"; path=/")}this._hideCMPButton(),c?window.gdsdk.showAd(v.Interstitial,{position:"preroll"}).catch(function(n){t(this,e),s.hide()}.bind(this)):(function(){t(this,e)}.bind(this),this.showAd(v.Interstitial,{position:"preroll"}).catch(function(n){t(this,e)}.bind(this)))}.bind(this)),this.onPauseGame("Pause the game and wait for a user gesture","success"),this.eventBus.subscribe("SDK_GAME_PAUSE",function(){t(this,u),s.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){t(this,u),s.hide()}.bind(this));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(D=e(r.mark((function e(n,i){var a,s,o,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(n);case 3:o=e.sent,(c=new o(Zy(Zy({},this.options),{},{isConsentDomain:i,version:pv.version,template:null===(a=n.promo)||void 0===a||null===(s=a.template)||void 0===s?void 0:s.preroll}),n)).on("done",function(){t(this,u),c.hide(),this._createSplash(n,i)}.bind(this)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),this._createSplash(n,i);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t){return D.apply(this,arguments)})},{key:"_createPromo",value:(w=e(r.mark((function e(n,i){var a,s,o,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(n);case 3:o=e.sent,(c=new o(Zy(Zy({},this.options),{},{isConsentDomain:i,version:pv.version,template:null===(a=n.promo)||void 0===a||null===(s=a.template)||void 0===s?void 0:s.preroll}),n)).on("done",function(){t(this,u),c.hide(),this.onResumeGame("Resumed after the promo","warning")}.bind(this)),this.onPauseGame("Pause the game for the promo","success"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),this.onResumeGame("Resumed after the promo","warning");case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(e,t){return w.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(v.Interstitial).catch(function(){t(this,e)}.bind(this))}},{key:"showAd",value:(b=e(r.mark((function n(i){var a,s=this,o=arguments;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=o.length>1&&void 0!==o[1]?o[1]:{},n.abrupt("return",new Promise(function(){var n=e(r.mark((function e(n,o){var c,u,d,l,h,p,f,m,v,g,y,b,_,w,A=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p={adType:i,params:a,adTimestamp:s.adRequestTimer},e.next=4,s.sdkReady;case 4:return f=e.sent,e.next=7,s.videoAdReady;case 7:return null!==(c=s._gameData.lp)&&void 0!==c&&c.load||s._sendLoadedEvent(),s._sendGamedockGamePlay(),s._rejectAdIfGameBlocked({gameData:f,adRequest:p}),s._rejectAdIfAdDisabled({gameData:f,adRequest:p}),s._rejectAdIfUnsupportedType({adRequest:p}),s._rejectAdIfRewardedDisabled({gameData:f,adRequest:p}),(null===(u=f.gft)||void 0===u||!u.enabled||null!==(d=f.gft)&&void 0!==d&&d.enabled&&(null==f||null===(l=f.gft)||void 0===l||null===(h=l.durations[s._giftCount])||void 0===h?void 0:h.after)!==s.adInstance.adMidrollCount)&&s._rejectAdIfAdRateHits({gameData:f,adRequest:p}),s.adInstance.attachAfgPosition(p),s._attachAfgFallback({gameData:f,adRequest:p}),m="main.showad",v=function(e){var n,r,i;t(this,A),s.eventBus.unsubscribeScope(m),s.onResumeGame(e.message,"warning"),null!=f&&null!==(n=f.gft)&&void 0!==n&&n.enabled&&(null==f||null===(r=f.gft)||void 0===r||null===(i=r.durations[s._giftCount])||void 0===i?void 0:i.after)===s.adInstance.adMidrollCount&&s.decideToGiveAGift(),o(e.message)}.bind(this),g=function(e){var r,i,a;t(this,A),s.eventBus.unsubscribeScope(m),s.adRequestTimer=Date.now(),s.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),null!=f&&null!==(r=f.gft)&&void 0!==r&&r.enabled&&(null==f||null===(i=f.gft)||void 0===i||null===(a=i.durations[s._giftCount])||void 0===a?void 0:a.after)===s.adInstance.adMidrollCount&&s.decideToGiveAGift(),n(e.message)}.bind(this),y=function(e){var r=this;t(this,A),s.eventBus.unsubscribeScope(m),a.fallback_adsense=!1,s.showAd(i,Zy(Zy({},a),{},{adapter:"adsense"})).then(function(e){t(this,r),n(e)}.bind(this)).catch(function(e){t(this,r),o(e)}.bind(this))}.bind(this),b=function(e){var r=this;t(this,A),s.eventBus.unsubscribeScope(m),a.fallback_adsense=!1,s.showAd(i,Zy(Zy({},a),{},{adapter:"promo"})).then(function(e){t(this,r),n(e)}.bind(this)).catch(function(e){t(this,r),o(e)}.bind(this))}.bind(this),_=function(){var e,n,r;t(this,A);var i=!("promo"===(null==a?void 0:a.adapter)||("reward"!==(null==a?void 0:a.position)||f.afg_disabled)&&"adsense"!==(null==a?void 0:a.adapter)),s=null===(e=f.promo)||void 0===e||null===(n=e.rainbow)||void 0===n?void 0:n.enabled,o=null===(r=f.promo)||void 0===r?void 0:r.onadsense;return i&&s&&o?b:null!=a&&a.fallback_adsense?y:v}.bind(this),w=_(),s.eventBus.subscribe("AD_ERROR",function(e){t(this,A),w(e)}.bind(this),m),s.eventBus.subscribe("AD_SDK_CANCELED",w,m),s.eventBus.subscribe("AD_SUCCESS",g,m),e.next=28,s.adInstance.startAd(p);case 28:s._post_message({topic:"adrequest.instream"}),e.next=35;break;case 31:e.prev=31,e.t0=e.catch(0),s.onResumeGame(e.t0.message,"warning"),o(e.t0.message);case 35:case"end":return e.stop()}}),e,this,[[0,31]])})));return function(e,t){return n.apply(this,arguments)}}()));case 2:case"end":return n.stop()}}),n)}))),function(e){return b.apply(this,arguments)})},{key:"clearSession",value:function(){this.adInstance.clearSession()}},{key:"_attachAfgFallback",value:function(e){var t=e.gameData,n=e.adRequest;if(!t.afg_disabled&&!n.params.hasOwnProperty("fallback_adsense"))switch(n.params.position){case"preroll":case"start":case"next":n.params.fallback_adsense=!0}}},{key:"_rejectAdIfGameBlocked",value:function(e){var t=e.gameData;if(t.bloc_gard&&!0===t.bloc_gard.enabled)throw new Error("Game or domain is blocked.")}},{key:"_rejectAdIfAdDisabled",value:function(e){if(!e.gameData.enableAds||this._whitelabelPartner)throw new Error("Advertisements are disabled.")}},{key:"_rejectAdIfUnsupportedType",value:function(e){var t=e.adRequest;if(t.adType){if(t.adType!==v.Interstitial&&t.adType!==v.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=v.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===v.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,c=e.adRequest,u=null;c.adType===v.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(c.adType===v.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<u)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(y=e(r.mark((function t(n){var i=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,a){var s,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.sdkReady;case 3:return s=e.sent,e.next=6,i.videoAdReady;case 6:if(!s.bloc_gard||!0!==s.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(s.enableAds&&!i._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(n){e.next=14;break}n=v.Rewarded,e.next=16;break;case 14:if(n===v.Interstitial||n===v.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+n);case 16:if(n!==v.Rewarded||s.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,i.adInstance.preloadAd(n);case 20:o=e.sent,t(o),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),a(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(e){return y.apply(this,arguments)})},{key:"cancelAd",value:(g=e(r.mark((function t(){var n=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,i){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{n.adInstance.cancel(),n.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),i()}catch(e){n.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),t(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(){return g.apply(this,arguments)})},{key:"showDisplayAd",value:function(t){var n=this;return new Promise(function(){var i=e(r.mark((function e(i,a){var s;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return s=e.sent,e.next=6,n.videoAdReady;case 6:if(!s.dAds.enabled){e.next=13;break}return e.next=9,n.adInstance.loadDisplayAd(t);case 9:n._post_message({topic:"adrequest.display"}),i(),e.next=14;break;case 13:a("Display-Ads are disabled.");case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(0),a(e.t0.message||e.t0);case 19:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(e,t){return i.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){var n;this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_START";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),this.adInstance&&this.adInstance._hideAddResume(),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||Qy({event:"GameStarted",game:this._gameData})}},{key:"onPauseGame",value:function(e,t){var n;this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_PAUSE";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||Qy({event:"GamePaused",game:this._gameData})}},{key:"openConsole",value:function(){try{new S(this).start(),m.set("gd_debug_ex",!0)}catch(e){console.log(e)}}},{key:"_initBlockingExternals",value:function(){var e=this._gameData;(e.failed||e.block_exts&&e.block_exts.enabled)&&(this.window_open=window.open,this._allowExternals({enabled:!1}),this._removeExternalsInHtml({enabled:!1}))}},{key:"_checkFullscreen",value:function(){var e=this;try{var n=this._gameData;n.sdk.fullscreen&&"auto"===n.sdk.fullscreen&&document.addEventListener("click",function(){if(t(this,e),!this._isFullScreen){var n=document.body,r=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullscreen;if(r)r.call(n);else if(void 0!==window.ActiveXObject){var i=new ActiveXObject("WScript.Shell");null!==i&&i.SendKeys("{F11}")}this._isFullScreen=!0}}.bind(this))}catch(e){console.log("Fullscreen error handled...",e)}}},{key:"_allowExternals",value:function(e){var n=this;void 0!==this.window_open&&(!1===e.enabled?window.open=function(e){t(this,n),this.msgrt.send("external",{message:"C> ".concat(e)}),(e.startsWith("https://play.google.com")||e.startsWith("https://itunes.apple.com"))&&this.window_open.call(null,e)}.bind(this):window.open=this.window_open)}},{key:"_removeExternalsInHtml",value:function(e){var n=this;!1===e.enabled&&window.document.querySelectorAll("a").forEach(function(e){var r=this;t(this,n);var i=!!(e.innerText.toLowerCase().includes("start")||e.innerText.toLowerCase().includes("play")||e.innerText.toLowerCase().includes("continue")),a=e.getAttribute("href");e.removeAttribute("href"),i||(e.onclick=function(e){return t(this,r),e.preventDefault(),this.msgrt.send("external",{message:"H> ".concat(a)}),!1}.bind(this))}.bind(this))}},{key:"_getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var c=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:i()),u=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:a()),d=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===s()?u:o()),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,v=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled,y=(e||n)&&r.loaderEnabled,b=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:l,noLoadedEvent:h,noBlockerEvent:p,noPreroll:y,parentURL:c,parentDomain:u,topDomain:d&&d.length?d:u,noGAPageView:f,noLotamePageView:m,noGamedockSDK:v,noMinijuegosSDK:g,version:r.version,pauseGameOnStartup:b,depth:s(),domainMatched:u===d,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isLoaderGameURL",value:function(){return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)&&location.href.startsWith("https://html5.gamedistribution.com")}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var n=new I(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new I(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var i=new I(location.href,!0);if(!i.query.gd_zone_config)return;e=i.query.gd_zone_config}return JSON.parse(C.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new Oy(t).splash()}},{key:"_createPrerollPromoTemplate",value:(u=e(r.mark((function e(t){var n,i,a,s,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=null===(n=t.promo)||void 0===n?void 0:n[null===(i=t.promo)||void 0===i||null===(a=i.template)||void 0===a?void 0:a.preroll],o=new Cy(s),e.abrupt("return",o.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return u.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(C.encode(JSON.stringify(e)))}catch(e){}try{var n=new I(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(G.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new I(e,!0);return n.query=Zy(Zy({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return C.encode(JSON.stringify(e))}},{key:"session",value:function(){var t=this;return new Promise(function(){var n=e(r.mark((function e(n,i){var a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.sdkReady;case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:a=t._gameData,n({ads:{display:{enabled:a.dAds.enabled},rewarded:{enabled:a.rewardedAds}},location:{parentDomain:t._bridge.parentDomain,topDomain:t._bridge.topDomain,parentURL:t._bridge.parentURL,depth:t._bridge.depth,loadedByGameZone:t._bridge.isTokenGameURL}});case 9:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"sendGenericEvent",value:function(e){console.log("Received generic event",e,this._isMasterGameURL());try{"trackMilestone"==e.eventName&&nb.tracking.trackEvent("milestoneAchieved",{pageId:this.options.gameId,pageType:"game"})}catch(e){console.log(e.message)}}},{key:"_getisMobile",value:function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),!1===t&&window.orientation>-1&&(t=!0),t}},{key:"_get_game_thumbnail_url",value:function(){var e=this,n=this._gameData,r=n.assets.find(function(n){return t(this,e),n.hasOwnProperty("name")&&512===n.width&&512===n.height}.bind(this));return r||(r=n.assets.length>0?n.assets[0]:{name:"logo.svg"}),"https://img.gamedistribution.com/".concat(r.name)}},{key:"_post_message",value:function(e){var t,n=e.topic,r=e.data,i=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var a=window.top||window.parent;a&&a.postMessage({source:"gdsdk",topic:n,data:r},i)}catch(e){console.error((null==e?void 0:e.message)||e)}}},{key:"decideToGiveAGift",value:function(){var n=this;try{var i,a=null===(i=this._gameData)||void 0===i?void 0:i.gft,s=setInterval(e(r.mark((function e(){var i=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.adInstance.requestRunning?console.log("Advertisement already running..."):(n.showAd(v.Interstitial,{position:"midroll"}).catch(function(e){t(this,i)}.bind(this)),clearInterval(s),n._giftCount++);case 1:case"end":return e.stop()}}),e,this)}))),1e3*a.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}}]),n}(),ib={},ab=function(e){try{if(e.skipForward)return;if(ib.source){var t={type:"gd-sdk-on-event",event:e};ib.source.postMessage(t,ib.origin)}}catch(e){console.log("gd-sdk forwardEvent err",e)}},sb=function(){ab({name:"SDK_READY",status:"success",message:"Everything is ready."}),ab({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),ab({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},ob=function(n){window.addEventListener("message",(function(i){var a=i.data,s=i.origin,o=i.source,c=a.type,u=a.method,d=a.options;if("gd-sdk-self"!==c){if("gd-sdk"===c){if(!ib.source&&"init"===u)return function(e){var t=e.source,n=e.origin;ib={source:t,origin:n}}({source:o,origin:s}),void sb();var l=n[u];l&&e(r.mark((function e(){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,function(){t(this,a),"showAd"===u&&Br.firstAdapterModeAdsense&&"rewarded"!==d.adType&&(console.log("promo-test, set first adapter to adssense 3"),d.params=d.params?d.params:{},d.params.adapter="adsense")}.bind(this),!(i=l.apply(n,Object.values(d)))||!i.then){e.next=6;break}return e.next=6,i;case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.log("gd:adp:m:r onFrameMessage error",e.t0);case 11:case"end":return e.stop()}}),e,this,[[0,8]])})))()}}else{var h={type:"gd-sdk",method:u,options:d};window.postMessage(h,"https://html5.gamedistribution.com")}}),!1)},cb=function(e){!function(e){var t=e.onEvent;e.onEvent=function(e){ab(e),t.apply(this,arguments)}}(e);var t=new rb(e);return ob(t),t},ub=function(e){try{var t=zv(e);e.gameId||t.send("nogameid",{message:"".concat(Gh.parentURL)})}catch(e){}},db={create:function(){var t=e(r.mark((function e(t){var n,i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,ub(t),Gv=zv(qv=t),e.next=5,cg();case 5:return n=e.sent,i=n?ag(t):cb(t),tg(),e.abrupt("return",i);case 11:return e.prev=11,e.t0=e.catch(0),console.log("gd:adp: sdk adaptor create failed, fallback to default adapter",e.t0),e.abrupt("return",cb(t));case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(e){return t.apply(this,arguments)}}()};function lb(){return(lb=e(r.mark((function e(t,n){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ig();case 2:if(!e.sent){e.next=7;break}e.t0=window.gdsdk,e.next=10;break;case 7:return e.next=9,pb(t);case 9:e.t0=e.sent;case 10:return i=e.t0,e.abrupt("return",n(i));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var hb=!1;function pb(e){var n=this;return new Promise(function(r,i){var a=this;if(t(this,n),eb)return r(eb);if(hb)var s=setInterval(function(){t(this,a),eb&&(hb=!1,clearInterval(s),r(eb))}.bind(this),100);else hb=!0,db.create(e).then(function(e){t(this,a),eb=e,e._sendSDKReady(),hb=!1,r(eb)}.bind(this))}.bind(this))}var fb,mb=(pb(fb=function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":n(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===n(window.gdApi.q[0][0])&&window.gdApi.q[0][0]&&((e=window.gdApi.q[0][0]).hasOwnProperty("advertisementSettings")||(e.advertisementSettings={autoplay:!0}))}catch(e){console.log("_get_developer_sets failed",e)}return e}()),{invoke:function(e){return function(e,t){return lb.apply(this,arguments)}(fb,e)}});function vb(){var n=this;this.AdType=v,this.preloadAd=function(e){var n=this;return mb.invoke(function(r){return t(this,n),r.preloadAd(e)}.bind(this))},this.showAd=function(){var n=e(r.mark((function e(n,i){var a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",mb.invoke(function(e){var r=this;if(t(this,a),n===v.Display)return e.showDisplayAd(i);return function(){t(this,r)}.bind(this),e.showAd(n,{})}.bind(this)));case 1:case"end":return e.stop()}}),e,this)})));return function(e,t){return n.apply(this,arguments)}}(),this.cancelAd=function(){var e=this;return mb.invoke(function(n){return t(this,e),n.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return mb.invoke(function(n){return t(this,e),n.openConsole()}.bind(this))},this.getSession=function(){var e=this;return mb.invoke(function(n){return t(this,e),n.session()}.bind(this))},this.sendEvent=function(e){var n=this;return mb.invoke(function(r){return t(this,n),r.sendGenericEvent(e)}.bind(this))},this.leaderboard={show:function(){t(this,n),Dl.showLeaderboard()}.bind(this),addScore:function(e){t(this,n),Dl.addScore(e)}.bind(this)}}vb.prototype=new function(){this.showBanner=function(){var e=this;return mb.invoke(function(n){return t(this,e),n.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new vb,window.gdApi=window.gdsdk;
|