sdk.beesads.com Open in urlscan Pro
18.173.205.120  Public Scan

URL: https://sdk.beesads.com/v1/ads-tag.js?v=0.0.5
Submission: On June 16 via manual from VN — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

(()=>{"use strict";var __webpack_modules__={677:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Fs:()=>getUUID,HD:()=>isString,Kn:()=>isObject,Oq:()=>parseBase64,Os:()=>getSystem,SB:()=>checkIsMobile,dK:()=>sdkLog,hj:()=>isNumber,k5:()=>toFormData,mf:()=>isFunction});const type=e=>({"[object String]":"string","[object Number]":"number","[object Object]":"object","[object Function]":"function"}[Object.prototype.toString.call(e)]),isNumber=e=>"number"===type(e),isString=e=>"string"===type(e),isFunction=e=>"function"===type(e),isObject=e=>"object"===type(e),toFormData=e=>e.replace(/^\?/,"").split("&").reduce(((e,t)=>{let[n,a=""]=t.split("=");return Object.assign(Object.assign({},e),{[n]:a})}),{});let system;const getSystem=()=>{if(system)return system;const e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,a=/(?:Android)/.test(e),i=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||a&&!/(?:Mobile)/.test(e)||i&&/(?:Tablet)/.test(e),r=/(?:iPhone)/.test(e)&&!o,d=/(?:GameApp)/.test(e),s=/(?:GameNativeAd)/.test(e),c=/(?:MiuiBrowser)/.test(e)||/(?:HeyTapBrowser)/.test(e)||/(?:SogouSearch)/.test(e);return system={isTablet:o,isPhone:r,isAndroid:a,isGameApp:d,isNativeAdGameApp:s,isXiaoMiModel:c,supportFullscreen:window.document.exitFullscreen&&!d&&!c,isPC:!(r||a||n||o||d)},system},checkIsMobile=()=>{const e=getSystem();return!e.isPC&&!e.isTablet},BASE_A="a",BASE_T="t",BASE_O="o",BASE_B="b",parseBase64=str=>eval(BASE_A+BASE_T+BASE_O+BASE_B)(str),isDebug=()=>{try{return"true"===localStorage.getItem("sdk-yeah")}catch(e){return!1}},sdkLog=(e,t)=>{if(!isDebug()&&3!==t)return;let n;n=2===t?console.warn:3===t?console.error:console.log,n("[SDK debug]",...e)},getUUID=()=>{let e=Date.now();return isObject(performance)&&isFunction(performance.now)&&(e+=performance.now()),"xxxxxxxx-xxxx-beesads-xxxx-xxxxxxxxxxxx".replace(/[x]/g,(function(t){const n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))}},44:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(476),i=n.n(a)()((function(e){return e[1]}));i.push([e.id,'#fake-ads-dom {\n  display: none;\n  inset: 0 auto auto 0 !important;\n  clear: none !important;\n  float: none !important;\n  margin: 0 !important;\n  max-height: none !important;\n  max-width: none !important;\n  opacity: 1 !important;\n  overflow: visible !important;\n  padding: 0 !important;\n  vertical-align: baseline !important;\n  visibility: visible !important;\n  z-index: 2147483647 !important;\n  background: #262626 !important;\n  left: 0;\n  top: 0;\n}\n#fake-ads-dom[data-use-loading="false"] .ads-bg,\n#fake-ads-dom[data-use-loading="false"] .fake-ads-loading {\n  display: none !important;\n}\n#fake-ads-dom .ads-main {\n  visibility: hidden;\n  width: 100%;\n  height: 100%;\n}\n#fake-ads-dom[data-banner-theme="black"] .ads-bg {\n  display: none;\n}\n#fake-ads-dom[data-banner-theme="black"][data-module="banner"] .reward-ads-title .ads-title {\n  display: none !important;\n}\n#fake-ads-dom[data-banner-theme="black"][data-module="banner"] .reward-ads-title .close-ad-action {\n  border-radius: 15px;\n  background: rgba(0, 0, 0, 0.3);\n}\n#fake-ads-dom[data-banner-theme="black"][data-module="banner"] .reward-ads-title .close-ad-action .reward-close-timer {\n  font-size: 14px;\n  color: #fff;\n}\n#fake-ads-dom[data-banner-theme="black"] .ad-reward-confirm .close-confirmation-dialog {\n  width: 292px;\n}\n#fake-ads-dom[data-banner-theme="black"] .ad-reward-confirm .close-confirmation-dialog .confirmation-title {\n  font-size: 20px;\n}\n#fake-ads-dom[data-banner-theme="black"] .ad-reward-confirm .close-confirmation-dialog .confirmation-message {\n  font-size: 16px;\n}\n#fake-ads-dom[data-banner-theme="white"] {\n  background: none!important;\n}\n#fake-ads-dom[data-banner-theme="white"] .ads-bg {\n  content: " ";\n  display: block;\n  width: 100%;\n  height: 100%;\n  position: absolute;\n  left: 0;\n  top: 0;\n  background: rgba(250, 250, 250, 0.3);\n  backdrop-filter: blur(24px);\n}\n#fake-ads-dom[data-banner-theme="white"][data-module="banner"] .ads-main {\n  position: absolute;\n  background-color: #fff !important;\n  border-radius: 6px;\n  padding: 0 12px 10px 12px;\n  box-shadow: 0 8px 12px rgba(60, 64, 67, 0.15), 0 4px 4px rgba(60, 64, 67, 0.3);\n}\n#fake-ads-dom[data-banner-theme="white"][data-module="banner"] .ads-main .header-panel {\n  width: 100%;\n  height: 56px;\n  background-color: #fff !important;\n  justify-content: left;\n}\n#fake-ads-dom[data-banner-theme="white"][data-module="banner"] .ads-main .header-panel .ads-title {\n  color: #202124 !important;\n  font-size: 12px;\n  font-weight: 600;\n  padding: 0 16px;\n}\n#fake-ads-dom[data-banner-theme="white"][data-module="banner"] .ads-main .header-panel .close-ad-action {\n  margin-right: 0;\n}\n#fake-ads-dom[data-banner-theme="white"][data-module="banner"] .ads-main .header-panel .close-ad-action .reward-close-timer {\n  color: #5F6368;\n  font-size: 12px;\n  font-weight: 500;\n}\n#fake-ads-dom[data-banner-theme="white"][data-module="banner"] .ads-main .header-panel .close-ad-action svg {\n  fill: #5F6368;\n}\n#fake-ads-dom[data-banner-theme="white"][data-module="banner"] .ads-main .container {\n  width: 100% !important;\n  height: calc(100% - 56px - 10px) !important;\n  box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);\n}\n#fake-ads-dom[data-banner-theme="white"][data-module="banner"] .ads-main .container .gpt-banner-wrap {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n#fake-ads-dom[data-module="banner"] .header-panel {\n  display: flex;\n}\n#fake-ads-dom[data-module="video"] .video-skip {\n  width: 100px;\n  height: 40px;\n  line-height: 40px;\n  background: #000;\n  border: 1px solid #fff;\n  text-align: center;\n  position: absolute;\n  top: 15px;\n  color: #fff;\n  right: 0;\n  z-index: 2;\n  pointer-events: none;\n}\n#fake-ads-dom[data-module="video"] .container {\n  height: 100%;\n  max-height: 100%;\n  overflow: hidden;\n}\n#fake-ads-dom[data-module="video"] .fake-progress {\n  display: block;\n  width: 100%;\n  height: 5px;\n  position: absolute;\n  bottom: 0;\n  left: 0;\n  background: rgba(59, 213, 247, 0.4);\n}\n#fake-ads-dom[data-module="video"] .fake-progress p {\n  width: 0;\n  height: 100%;\n  background: #3bd5f7;\n  margin: 0;\n  border-radius: 0 5px 5px 0;\n}\n#fake-ads-dom .header-panel {\n  display: none;\n  width: 100%;\n  height: 8%;\n  min-height: 55px;\n  justify-content: center;\n  align-items: center;\n  text-align: center;\n  background-color: #424242;\n  border: 1px solid transparent;\n  border-radius: 4px;\n  color: #f5f5f5 !important;\n  font-family: "Google Sans", Roboto, sans-serif !important;\n  font-size: 20px!important;\n  font-weight: 600!important;\n}\n#fake-ads-dom .header-panel .ads-title {\n  color: #f5f5f5;\n}\n#fake-ads-dom .header-panel .close-ad-action {\n  display: flex;\n  height: 30px;\n  flex-direction: row;\n  align-items: center;\n  margin-right: 10px;\n  cursor: pointer;\n  position: absolute;\n  right: 0;\n  vertical-align: middle;\n  padding: 0 10px;\n  font-size: 12px;\n}\n#fake-ads-dom .header-panel .close-ad-action[disable="true"] {\n  cursor: default;\n  pointer-events: none;\n  opacity: 0.6;\n}\n#fake-ads-dom .header-panel .close-ad-action .close-ad-button {\n  display: flex;\n  position: relative;\n  flex-direction: row;\n  height: inherit;\n  align-items: center;\n}\n#fake-ads-dom .header-panel .close-ad-action .close-ad-button svg {\n  fill: #fff;\n}\n#fake-ads-dom .header-panel.reward-ads-title .close-ad-action .reward-close-timer {\n  margin-right: 5px;\n  font-size: 20px;\n  color: #fff;\n}\n#fake-ads-dom .header-panel.reward-ads-title .close-ad-action[adf-played="true"] {\n  background: none;\n}\n#fake-ads-dom .video-skip {\n  display: none;\n}\n#fake-ads-dom .container {\n  display: flex;\n  width: 100%;\n  height: 92%;\n  max-height: calc(100% - 55px);\n  position: relative;\n  flex-direction: column;\n  justify-content: center;\n  align-items: center;\n  overflow: hidden;\n}\n#fake-ads-dom .ad-reward-confirm {\n  width: 100%;\n  height: 100%;\n  position: absolute;\n  top: 0;\n  left: 0;\n  background: rgba(0, 0, 0, 0.4);\n  opacity: 1;\n  pointer-events: auto;\n  transition: opacity 0.15s ease-out;\n  -webkit-transition: opacity 0.15s ease-out;\n  will-change: opacity;\n  z-index: 2147483647;\n}\n#fake-ads-dom .ad-reward-confirm .close-confirmation-dialog {\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  background: #fff;\n  box-shadow: 0 16px 24px 2px rgba(0, 0, 0, 0.14), 0 6px 30px 5px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2);\n  font-family: Roboto, sans-serif;\n  transform: translate(-50%, -50%);\n  -webkit-transform: translate(-50%, -50%);\n}\n#fake-ads-dom .ad-reward-confirm .close-confirmation-dialog .confirmation-title {\n  color: #000;\n  font-size: 22px;\n  margin-top: 27px;\n  margin-left: 15px;\n  margin-right: 15px;\n}\n#fake-ads-dom .ad-reward-confirm .close-confirmation-dialog .confirmation-message {\n  color: #757575;\n  font-size: 18px;\n  margin: 27px 15px;\n}\n#fake-ads-dom .ad-reward-confirm .close-confirmation-dialog .confirmation-buttons {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: flex;\n  font-size: 15px;\n  line-height: 40px;\n  margin-right: 9px;\n  margin-bottom: 9px;\n  -webkit-box-align: center;\n  -webkit-align-items: center;\n  align-items: center;\n  -webkit-justify-content: flex-end;\n  justify-content: flex-end;\n}\n#fake-ads-dom .ad-reward-confirm .close-confirmation-dialog .close-ad-button,\n#fake-ads-dom .ad-reward-confirm .close-confirmation-dialog .resume-ad-button {\n  color: #fff;\n  cursor: pointer;\n  font-weight: 500;\n  text-align: center;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: flex;\n  padding-left: 10px;\n  padding-right: 10px;\n}\n#fake-ads-dom .ad-reward-confirm .close-confirmation-dialog .close-ad-button {\n  color: #3e82f7;\n}\n#fake-ads-dom .ad-reward-confirm .close-confirmation-dialog .resume-ad-button {\n  background: #3e82f7;\n  border-radius: 2px;\n  box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.24);\n}\n#fake-ads-dom .fake-ads-loading {\n  width: 20px;\n  height: 30px;\n  position: absolute;\n  top: 50%;\n  left: calc(50% - 10px);\n  perspective: 200px;\n  overflow: visible;\n}\n#fake-ads-dom .fake-ads-loading:before,\n#fake-ads-dom .fake-ads-loading :after {\n  position: absolute;\n  width: 20px;\n  height: 20px;\n  content: "";\n  animation: jumping 0.5s infinite alternate;\n  background: rgba(0, 0, 0, 0);\n  overflow: visible;\n}\n#fake-ads-dom .fake-ads-loading:before {\n  left: 0;\n}\n#fake-ads-dom .fake-ads-loading:after {\n  right: 0;\n  animation-delay: 0.15s;\n}\n@keyframes jumping {\n  0% {\n    transform: scale(1) translateY(0px) rotateX(0deg);\n    box-shadow: 0 0 0 rgba(0, 0, 0, 0);\n  }\n  100% {\n    transform: scale(1.2) translateY(-25px) rotateX(45deg);\n    background: #3bd5f7;\n    box-shadow: 0 25px 40px #3bd5f7;\n  }\n}\n',""]);const o=i},476:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,a){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(a)for(var o=0;o<this.length;o++){var r=this[o][0];null!=r&&(i[r]=!0)}for(var d=0;d<e.length;d++){var s=[].concat(e[d]);a&&i[s[0]]||(n&&(s[2]?s[2]="".concat(n," and ").concat(s[2]):s[2]=n),t.push(s))}},t}},892:e=>{var t=[];function n(e){for(var n=-1,a=0;a<t.length;a++)if(t[a].identifier===e){n=a;break}return n}function a(e,a){for(var o={},r=[],d=0;d<e.length;d++){var s=e[d],c=a.base?s[0]+a.base:s[0],l=o[c]||0,p="".concat(c," ").concat(l);o[c]=l+1;var u=n(p),m={css:s[1],media:s[2],sourceMap:s[3],supports:s[4],layer:s[5]};if(-1!==u)t[u].references++,t[u].updater(m);else{var g=i(m,a);a.byIndex=d,t.splice(d,0,{identifier:p,updater:g,references:1})}r.push(p)}return r}function i(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var o=a(e=e||[],i=i||{});return function(e){e=e||[];for(var r=0;r<o.length;r++){var d=n(o[r]);t[d].references--}for(var s=a(e,i),c=0;c<o.length;c++){var l=n(o[c]);0===t[l].references&&(t[l].updater(),t.splice(l,1))}o=s}}},362:e=>{var t={};e.exports=function(e,n){var a=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(n)}},60:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},192:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},760:e=>{e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var a="";n.supports&&(a+="@supports (".concat(n.supports,") {")),n.media&&(a+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(a+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),a+=n.css,i&&(a+="}"),n.media&&(a+="}"),n.supports&&(a+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(a,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},865:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.nc=void 0;var __webpack_exports__={};(()=>{var e=__webpack_require__(677);const t="1.57.5",n="aHR0cHM6Ly9hcGkuZ2FtZWJyaWRnZS5nYW1lcy9nYW1lYnJpZGdlL3Yx",a="ads-tag-sdk",i="google-sdk",o="sdk-cache-flag",r="1702534620056",d={1:"Display",2:"Interstitial",3:"Reward",4:"WebInterstitial",5:"Anchor"},s=-1,c=0,l=1,p=10,u=11,m=12,g=2,h=3,f=31,b="gamebridge-sdk-ima",w="fake-ads-dom",y="gamebridge-ads-content",v="vast-client-browser-sdk",_="video",I="siteInfoConfig",x="vast-cache",S="aHR0cHM6Ly9hZHMuZW5qb3k0ZnVuLmNvbQ==",k="aHR0cHM6Ly9hZHMuYmVlc2Fkcy5jb20=",C="sdk-date",A="ads-tag-uid",E="ads-tag-dom",T=(t,n)=>{window.adsTag&&window.adsTag.parentHaveAdsTag?window.parent.postMessage({name:"send-gtm",params:{name:t,data:n}},document.referrer):((0,e.dK)(["sendGTM",t]),(0,e.Os)().isGameApp?window.bridge&&(0,e.mf)(window.bridge.webMessage)&&window.bridge.webMessage(JSON.stringify({m:"firebase_event",d:{event_name:t,event_data:n}})):window.dataLayer&&window.dataLayer.push(Object.assign({event:t},n)))},M=!(0,e.Os)().isGameApp,z=(e,t)=>fetch(e,{method:"GET",credentials:t?"omit":"include",keepalive:M}).then((e=>{try{const t=e.headers.get("Content-Type");return t&&-1!==t.indexOf("json")?e.json():e}catch(t){return e}})),$=(e,t)=>fetch(e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"include",referrerPolicy:"no-referrer",keepalive:!t&&M,body:t?JSON.stringify(t):void 0}).then((e=>e.text())).then((e=>e.length>0?JSON.parse(e):e)),L=(e=[])=>{const t=Date.now();return e.filter((e=>t<e.cacheLocationTime+1e3*(e.ttl-5)))},O=(e=[])=>e.filter((e=>!e.adManagerBiding)),B=(e=[],t=[])=>((e=(e=L(e)).concat(t)).sort(((e,t)=>t.cpm-e.cpm)),e.splice(0,20)),R=(e,t)=>{const n=K();n[e]=t,sessionStorage.setItem(x,JSON.stringify(n))},K=e=>{const t=JSON.parse(sessionStorage.getItem(x)||"{}");return e?t[e]:t},D=async(t,n)=>{await new Promise((e=>{let t=document.getElementById(v);t?e(null):(t=document.createElement("script"),t.async=!0,t.src="https://cdn.beesads.com/vast-client/4.0.0/vast-client-browser.min.js",t.id=v,t.onload=()=>{e(null)},document.head.append(t))}));const{VASTClient:a,VASTTracker:i}=window.VAST||{};let o=t.url,r=n?11:1;if(!a||!i)return;const d=new a;o=-1!==o.indexOf("?")?`${o}&make=${r}`:`${o}?make=${r}`,d.get(o).then((n=>{if(!(n&&n.ads&&n.ads[0]&&n.ads[0].creatives&&n.ads[0].creatives[0]))return;(0,e.dK)(["make",r.toString(),o]),_t({zoneId:11===r?"autoVideoHot":"autoVideo",adFormat:"video",channel:t.adapterCode,cpm:t.cpm,currency:t.currency});const a=new i(d,n.ads[0],n.ads[0].creatives[0]);a.trackImpression();const s=a.assetDuration;let c=1;a.setProgress(c++);let l=setInterval((()=>{a.setProgress(c++),(c>=45||c>s)&&clearInterval(l)}),1e3)}))};class P{constructor(t,n,a,i,o,r,d,s,c){this.onAdsManagerLoaded=(t,n,a,i)=>{const{google:o}=window,{adContainer:r}=this,d=new o.ima.AdsRenderingSettings;d.restoreCustomPlaybackStateOnAdBreakComplete=!0,d.enablePreloading=!0,d.loadVideoTimeout=1500,this.adsManager=t.getAdsManager(r,d);const{adsManager:s,renderProgressCb:c,adLoadedCb:l,onAdError:p,onAdEvent:u,adDoneCb:m}=this;if(s.addEventListener(o.ima.AdErrorEvent.Type.AD_ERROR,p),(0,e.mf)(c)){let e=!0;s.addEventListener(o.ima.AdEvent.Type.AD_PROGRESS,(t=>{const{currentTime:n,duration:a}=t.getAdData();c(n,a,e),e=!1}))}s.addEventListener(o.ima.AdEvent.Type.PAUSED,(()=>{this.pauseStatus=!0})),s.addEventListener(o.ima.AdEvent.Type.RESUMED,(()=>{this.pauseStatus=!1})),s.addEventListener(o.ima.AdEvent.Type.LOADED,(function(e){l(!0,e.getAdData())})),s.addEventListener(o.ima.AdEvent.Type.SKIPPED,u),s.addEventListener(o.ima.AdEvent.Type.CLICK,u),s.addEventListener(o.ima.AdEvent.Type.ALL_ADS_COMPLETED,u),s.addEventListener(o.ima.AdEvent.Type.USER_CLOSE,u);try{s.init(a,i,o.ima.ViewMode.NORMAL),s.setVolume(n),s.start()}catch(e){l(!1),m("ERROR")}},this.resizeAds=(e,t)=>{const{google:n}=window,{adsManager:a,adDoneCb:i}=this;try{a.resize(e,t,n.ima.ViewMode.NORMAL)}catch(e){i("LOAD_ERROR")}},this.pauseAds=()=>{const{adsManager:e}=this;e&&e.pause()},this.resumeAds=()=>{const{adsManager:e}=this;e&&e.resume()},this.onAdEvent=e=>{const{google:t}=window,{adsManager:n,adDoneCb:a}=this;switch(e.type){case t.ima.AdEvent.Type.CLICK:n.resume(),setTimeout((()=>{a("CLICK")}),1500);break;case t.ima.AdEvent.Type.SKIPPED:a("SKIPPED");break;case t.ima.AdEvent.Type.ALL_ADS_COMPLETED:a("ALL_ADS_COMPLETED");break;case t.ima.AdEvent.Type.USER_CLOSE:a("USER_CLOSE")}},this.onAdError=e=>{var t,n;const{adsManager:a,adDoneCb:i,adLoadedCb:o}=this;o(!1),a&&a.destroy();try{i("ERROR",null===(n=null===(t=null==e?void 0:e.error)||void 0===t?void 0:t.data)||void 0===n?void 0:n.errorMessage)}catch(e){console.log("onAdError",e)}},this.adLoadedCb=(e,t)=>{d(e,t),this.adLoadedCb=()=>{}},this.adDoneCb=(e,t)=>{s(e,t),this.adDoneCb=()=>{}},this.renderProgressCb=c,this.adContainer=i;const{google:l,adsTag:p}=window,u=new l.ima.AdDisplayContainer(i);u.initialize(),this.adsLoader=new l.ima.AdsLoader(u);const{adsLoader:m,onAdsManagerLoaded:g,onAdError:h}=this;m.addEventListener(l.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(a=>{"preroll"!==t&&"display"!==t||(n=0),p.hasInteracted||((0,e.dK)(["ima set volume=0"],2),n=0),g(a,n,o,r)}),!1),m.addEventListener(l.ima.AdErrorEvent.Type.AD_ERROR,h,!1);var f=new l.ima.AdsRequest;f.adTagUrl=a,"display"===t?(f.nonLinearAdSlotWidth=o,f.nonLinearAdSlotHeight=r):(f.linearAdSlotWidth=o,f.linearAdSlotHeight=r),m.requestAds(f)}}const q={brideCacheList:K("video")||[],usable:!1,disableRequest:!1,ready:!0,minCpm:0},j={video:{context:"instream",playerSize:[640,480],plcmt:1,mimes:["video/mp4","video/webm","video/ogg","application/javascript"],minduration:0,maxduration:15,protocols:[2,3,5,6,7,8,11,12,13,14],w:640,h:480,placement:1,linearity:1,playbackmethod:[1,5],skip:1,skipafter:5,boxingallowed:1,pos:1,api:[2,7,8]}},U=()=>{const e=window.adsTagIframe;e&&e.window.postMessage({name:"send-prebid-video-list",cache:q.brideCacheList},e.origin)},N=(t,n)=>(t||(t=[]),t=(t=t.filter((e=>e.cpm>0))).map((e=>{return{adId:(t=e).adId,adapterCode:t.adapterCode,cpm:t.cpm,cpm_code:t.cpm_code,ttl:t.ttl,vastUrl:t.vastUrl,videoCacheKey:t.videoCacheKey,videoClickKey:t.videoClickKey||"0",adUnitCode:t.adUnitCode,requestId:t.requestId,auctionID:t.auctionID,transactionId:t.transactionId,currency:t.currency,cacheLocationTime:Date.now()};var t})),new Promise((a=>{if(!t.length)return a(!1);t=t.map((e=>(e.cpm<q.minCpm&&delete e.ad,e)));const i=()=>{t=(t=t.filter((e=>e.cpm>=q.minCpm))).sort(((e,t)=>t.cpm-e.cpm)),q.brideCacheList=B(q.brideCacheList,t),R("video",q.brideCacheList),U(),a(!0)};n?i():(t=>{const n=encodeURIComponent(window.location.href),a=nt(),i=encodeURIComponent(rt());return $(`${(0,e.Oq)(S)}/prebid/video?si=${a}&u=${n}&d=${i}&cid=${mt()}`,t)})(t).then((e=>{const n=e.data||{};t.forEach((e=>{const t=n[e.adId]||{};e.videoCacheKey=t.key,e.videoClickKey=t.ck,e.cpm_code=t.cpm_code})),i()}))}))),F=(e,t)=>{(q.brideCacheList||[]).some((n=>n.adId===e&&(n.adManagerBiding=t,!0))),U()},H=(t,n)=>{const{siteId:a,url:i,domain:o,cid:r}=V();return`${(0,e.Oq)(S)}/pbc/v1/cache?uuid=${t}&zi=${n}&si=${a}&u=${i}&d=${o}&cid=${r}`},V=()=>({siteId:nt(),url:encodeURIComponent(window.location.href),domain:encodeURIComponent(rt()),cid:mt()}),G=(t,n)=>{const{index:a,zoneId:i="",bidingAdId:o}=t||{};return new Promise((r=>{if(q.disableRequest){const e=function(t){const{name:n,bride:a}=t.data||{};"send-prebid-video"===n&&(window.removeEventListener("message",e),r(a))};return window.addEventListener("message",e,!1),void window.parent.postMessage({name:"get-prebid-video",params:t,isMarkUsed:n},document.referrer)}let d={cpm:0,adId:""};if(!window.pbjs)return r(d);if(q.brideCacheList=L(q.brideCacheList),o&&q.brideCacheList.some((e=>e.adId===o&&(d=e,!0))),!o){const t=O(q.brideCacheList);if(0===t.length)return r(d);d=(0,e.hj)(a)?t.splice(a,1)[0]:t.shift()}if(0===d.cpm)return r(d);n&&W(d.adId),r(((e,t)=>{const{adId:n,cpm:a,adapterCode:i,videoCacheKey:o,videoClickKey:r,currency:d,cpm_code:s}=e;return{adId:n,url:H(o,t),cpm:a,adapterCode:i,videoCacheKey:o,videoClickKey:r,currency:d,cpm_code:s}})(d,i))}))},Y=[],W=e=>{if(!e)return;if(q.disableRequest)return void window.parent.postMessage({name:"send-mark-prebid-video-bid-as-used",params:{adId:e}},document.referrer);if(!window.pbjs)return;let t;q.brideCacheList=q.brideCacheList.filter((n=>(n.adId===e&&(t=n),n.adId!==e))),window.pbjs.markWinningBidAsUsed({adUnitCode:t.adUnitCode,adId:e}),-1!==Y.indexOf(e)&&xt(t),Y.push(e),R("video",q.brideCacheList),U()},Z=e=>{const t=e.dom.querySelector(".prebid-video-wrap");t&&t.remove()},J=(e,t,n,a,i,o,r,d,s)=>{n.module="video";const{zoneId:c,bidingAdId:l}=n;Promise.all([G({zoneId:c,bidingAdId:l},!0),tt()]).then((l=>{const p=l[0];if(!p||!p.url)return r(null,"loading error");if("display"===t){const e=p.url;-1!==e.indexOf("?")?p.url=`${e}&make=2`:p.url=`${e}?make=2`}const u=(e=>{Z(e);const t=document.createElement("div");return t.className="prebid-video-wrap",t.style.display="none",t.style.width="100%",t.style.height="100%",t.style.overflow="hidden",t.style.border="none",e.dom.append(t),t})(n),m=n.dom;let g=m.offsetWidth,h=m.offsetHeight;g&&h||(g=a,h=i),n.ima3=new P(t,n.volume,p.url,u,g,h,(t=>{t&&_t({adId:e,zoneId:c,zoneType:o,adFormat:"video",channel:p.adapterCode,cpm:p.cpm,currency:p.currency}),p&&(u.style.display="block"),r(p)}),((e,t)=>{Z(n),d("ERROR"!==e,t)}),s)}))};let X=!1;const Q=[],ee=[],te=(e,t)=>{"video"===e&&-1===Q.indexOf(t)&&Q.push(t),"banner"===e&&-1===ee.indexOf(t)&&ee.push(t)},ne=t=>new Promise((n=>{if(-1===window.location.origin.indexOf("enjoy4fun.com"))return n(null);X||n(null),t&&te("banner",t),(()=>{const t=encodeURIComponent(window.location.origin+window.location.pathname),n=encodeURIComponent(window.location.href),a=nt(),i=encodeURIComponent(rt());return z(`${(0,e.Oq)(S)}/prebid/v2?page=${t}&si=${a}&u=${n}&d=${i}&cid=${mt()}&video=${Q.join(",")}&banner=${ee.join(",")}`)})().then((e=>{const{bannerResponseBidList:t,videoResponseBidList:a}=e||{};a&&a.length&&N(a,!0),t&&t.length&&de(t,!0),n(null)}))})),ae={bannerCacheMap:K("banner")||{},disableRequest:!1,minCpm:0},ie={"336x280":["300x250","300x200"],"300x250":["300x200"],"300x600":["300x250","160x600"],"580x400":["480x320","336x280","300x250","300x200"],"320x100":["300x100","300x50"]},oe=()=>{const e=window.adsTagIframe;e&&e.window.postMessage({name:"send-prebid-banner-cache",cache:ae.bannerCacheMap},e.origin)},re=(e,t,n)=>{let a=ae.bannerCacheMap[e]||[];const i=ie[e];Array.isArray(i)&&i.forEach((e=>{a=a.concat(ae.bannerCacheMap[e]||[])})),a.some((e=>e.adId===t&&(e.adManagerBiding=n,!0))),oe()},de=(t,n)=>(t||(t=[]),t=(t=t.filter((e=>e.cpm>0))).map((e=>{return{ad:`<style>html,body{overflow: hidden}</style>${(t=e).ad}`,bannerCacheKey:t.bannerCacheKey,adId:t.adId,adapterCode:t.adapterCode,cpm:t.cpm,cpm_code:t.cpm_code,ttl:t.ttl,adUnitCode:t.adUnitCode,requestId:t.requestId,auctionID:t.auctionID,transactionId:t.transactionId,currency:t.currency,size:t.size||`${t.width}x${t.height}`,height:t.height,width:t.width,cacheLocationTime:Date.now()};var t})),new Promise((a=>{if(!t.length)return a(!1);t=t.map((e=>(e.cpm<ae.minCpm&&delete e.ad,e)));const i=()=>{t=t.filter((e=>e.cpm>=ae.minCpm));const e={};t.forEach((t=>{const{size:n,width:a,height:i}=t,o=n||`${a}x${i}`;e[o]||(e[o]=[]),e[o].push(t)})),Object.keys(ae.bannerCacheMap).forEach((t=>{ae.bannerCacheMap[t]=B(ae.bannerCacheMap[t],e[t]||[])})),R("banner",ae.bannerCacheMap),oe(),a(!0)};n?i():(t=>{const n=encodeURIComponent(window.location.href),a=nt(),i=encodeURIComponent(rt());return $(`${(0,e.Oq)(S)}/prebid/banner?si=${a}&u=${n}&d=${i}&cid=${mt()}`,t)})(t).then((e=>{const n=e.data||{};t.forEach((e=>{delete e.ad;const t=n[e.adId]||{};e.bannerCacheKey=t.key,e.cpm_code=t.cpm_code})),i()}))}))),se=[],ce=(e,t)=>{if(!e||!t)return;if(ae.disableRequest)return void window.parent.postMessage({name:"send-mark-prebid-banner-bid-as-used",params:{adId:e,size:t}},document.referrer);if(!window.pbjs)return;let n;ae.bannerCacheMap[t]=ae.bannerCacheMap[t].filter((t=>(t.adId===e&&(n=t),t.adId!==e))),window.pbjs.markWinningBidAsUsed({adUnitCode:n.adUnitCode,adId:e}),-1!==se.indexOf(e)&&xt(n),se.push(e),R("banner",ae.bannerCacheMap),oe()},le=(t,n)=>{let{size:a,zoneId:i="",bidingAdId:o}=t;return new Promise((r=>{if(ae.disableRequest){const e=function(t){const{name:n,bride:a}=t.data||{};"send-prebid-banner"===n&&(window.removeEventListener("message",e),r(a))};return window.addEventListener("message",e,!1),void window.parent.postMessage({name:"get-prebid-banner",params:t,isMarkUsed:n},document.referrer)}let d={cpm:0,adId:""};if(!window.pbjs||!a)return r(d);if(o){let e=[];for(let t in ae.bannerCacheMap)e=e.concat(ae.bannerCacheMap[t]||[]);e=L(e),e.some((e=>e.adId===o&&(d=e,!0)))}if(!o){ae.bannerCacheMap[a]=L(ae.bannerCacheMap[a]);let e=ae.bannerCacheMap[a];const t=ie[a];Array.isArray(t)&&t.forEach((t=>{ae.bannerCacheMap[t]=L(ae.bannerCacheMap[t]||[]),e=e.concat(ae.bannerCacheMap[t]||[])})),e=O(e),e&&e.length&&(d=e[0])}if(0===d.cpm)return r(d);n&&ce(d.adId,d.size);const s=nt(),c=encodeURIComponent(window.location.href),l=encodeURIComponent(rt());r({adId:d.adId,url:`${(0,e.Oq)(S)}/banner/cache?uuid=${d.bannerCacheKey}&zi=${i}&si=${s}&u=${c}&d=${l}&cid=${mt()}`,cpm:d.cpm,cpm_code:d.cpm_code,adapterCode:d.adapterCode,currency:d.currency,width:d.width,height:d.height})}))},pe=e=>{const t=e.dom.querySelector(".prebid-banner-iframe");t&&t.remove()},ue=(e,t,n,a,i,o)=>{const{zoneId:r,bidingAdId:d}=t,s=`${n}x${a}`;t.module="banner",le({size:s,zoneId:r,bidingAdId:d},!0).then((d=>{if(!d||0===d.cpm||!d.url)return o(null);((e,t,n,a)=>{pe(e);const i=document.createElement("iframe");return i.className="prebid-banner-iframe",i.src=t,i.marginWidth="0",i.marginHeight="0",i.style.width=`${n}px`,i.style.height=`${a}px`,i.style.overflow="hidden",i.style.border="none",new Promise((t=>{i.onload=()=>{t(!0)},i.onerror=()=>{t(!1)},e.dom.append(i)}))})(t,d.url,d.width||n,d.height||a).then((t=>{t?(_t({adId:e,zoneId:r,zoneType:i,adFormat:"banner",channel:d.adapterCode,cpm:d.cpm,currency:d.currency}),o(d)):o(null)}))}))},me=(e,t,n)=>new Promise((async a=>{if(ae.disableRequest){const i=function(e){const{name:t}=e.data||{};"send-first-request-prebid-banner-bids"===t&&(window.removeEventListener("message",i),a(null))};return window.addEventListener("message",i,!1),void window.parent.postMessage({name:"first-request-prebid-banner-bids",params:{domId:t,zoneConf:e,size:n}},document.referrer)}const{prebidConf:i}=window.__siteConf,{open:o,adUnitsMap:r}=i;if(!o)return a(null);const{enableBannerStatus:d}=e;if(!d)return a(null);const s=r.banner[n];((e,t)=>{const n=window.pbjs;n&&t&&t.mediaTypes&&t.bids&&(n.adUnits.some((t=>t.code===e))||(t.code=e,n.que.push((function(){n.addAdUnits([t])}))))})(t,s);if((await le({size:n},!1)).adId)return a(null);new Promise((e=>{const t=setTimeout((()=>{clearTimeout(t),e(null)}),3e3);Promise.all([he(s),ne(n)]).finally((()=>{clearTimeout(t),e(null)}))})).then((()=>{a(null)}))})),ge=(t,n)=>{const a=K("video")||[];R("video",L(a));const i=K("banner")||{};Object.keys(i).forEach((e=>{i[e]=L(i[e]||[])})),R("banner",i);let o=window.pbjs;o||(o=window.pbjs={}),o.que=o.que||[],o.bidderSettings={standard:{storageAllowed:!0}},o.que.push((function(){t.video&&t.video.instream&&o.addAdUnits([t.video.instream]),o.setConfig({cache:{url:`${(0,e.Oq)(S)}/pbc/v1/cache`},useBidCache:!0,userSync:{userIds:[{name:"sharedId",storage:{type:"cookie",name:"_sharedid",expires:365}}],filterSettings:{iframe:{bidders:"*",filter:"include"}},syncsPerBidder:1e3}}),he(),setInterval((()=>{he()}),15e3),n.enable&&(e=>{const{min_queue_len:t,video_freq:n,min_ecpm:a,exclude_channel:i}=e;if(!(t&&n&&a&&i))return;let o=1;const r=Number(a);setInterval((()=>{let e=q.brideCacheList,n=e.length;o=n>15?3:n>10?2:1;for(let a=0;a<o;a++){if(e=q.brideCacheList,n=e.length,0===n)return;let a=t;const o=e[0];if(Date.now()>o.cacheLocationTime+1e3*(o.ttl-30)&&(a=0),e.length<a+1)return;if(-1!==i.indexOf(e[a].adapterCode))return;G({index:a},!0).then((e=>{e&&e.cpm>=r&&D(e)}))}}),1e3*n)})(n)}))},he=e=>{const t=window.pbjs;return new Promise((n=>{if(!t)return n(!1);t.que.push((function(){t.requestBids({adUnits:e,timeout:1500,bidsBackHandler:function(e){if(!e)return n(!1);const t=[];if(e[_]){const n=e[_].bids||[];t.push(N(n))}Object.keys(e).filter((e=>e!==_)).forEach((n=>{if(e[n]){const a=e[n].bids||[];t.push(de(a))}})),Promise.all(t).then((e=>{n(!0)})).catch((()=>{n(!1)}))}})}))}))};class fe{constructor(e,t){switch(typeof e){case"number":if(13===e.toString().length)return void this.parseDate(new Date(e),t);this.parseStr(e.toString(),t);break;case"string":this.parseStr(e,t);break;case"object":this.parseDate(e.constructor===Date?e:new Date,t);break;default:this.parseDate(new Date,t)}}parseStr(e,t){const n=e.replace(/\D/g,""),a=n.substr(0,4),i=(n.substr(2,4),n.substr(4,2)),o=n.substr(6,2),r=n.substr(8,2),d=n.substr(10,2),s=n.substr(12,2);if(!a||!i||!o)return void this.parseDate(new Date,t);const c=`${a}/${i}/${o} ${r||"00"}:${d||"00"}:${s||"00"}`;this.parseDate(new Date(c),t)}parseDate(t,n){if((0,e.hj)(n)){const e=(new Date).getTimezoneOffset(),a=t.getTime();t=new Date(a+60*e*1e3+60*n*60*1e3)}this.fullYear=t.getFullYear(),this.year=parseInt(t.getFullYear().toString().substr(2,2)),this.month=t.getMonth()+1,this.date=t.getDate(),this.hour=t.getHours(),this.minute=t.getMinutes(),this.second=t.getSeconds(),this.day=t.getDay()}format(e){return e.replace(/YYYY/i,this.fullYear).replace(/YY/i,this.year<10?`0${this.year}`:this.year).replace(/MM/,this.month<10?`0${this.month}`:this.month).replace(/DD/i,this.date<10?`0${this.date}`:this.date).replace(/HH/i,this.hour<10?`0${this.hour}`:this.hour).replace(/mm/,this.minute<10?`0${this.minute}`:this.minute).replace(/ss/i,this.second<10?`0${this.second}`:this.second)}}const be=(e,t)=>new fe(e,t),we=t=>{const n=encodeURIComponent(window.location.href),a=encodeURIComponent(rt()),i=`${(0,e.Oq)(k)}/beesads/outbrain/banner?size=${t}&uid=${Ne()}&si=${nt()}&u=${n}&d=${a}&cid=${mt()}`;return new Promise((e=>{const t=setTimeout((()=>{e([])}),1500);z(i).then((t=>{e(t)})).catch((()=>{e([])})).finally((()=>{clearTimeout(t)}))}))},ye="ob-banner-wrap",ve={},_e=(t,n,a,i,o,r)=>{xe(`${a}x${i}`).then((d=>{if(!d||!d.widget||!d.install_key)return r(null);r(d),((t,n,a,i)=>{const{widget:o,install_key:r,adId:d}=i;return new Promise((i=>{let s=t.dom.querySelector(`.${ye}`);s&&s.remove(),s=document.createElement("iframe"),s.className=ye,s.style.width=`${n}px`,s.style.height=`${a}px`,s.style.border="0",s.onload=()=>{const t=s.contentWindow.document,c=document.createElement("script");c.src="https://widgets.outbrain.com/outbrain.js",t.head.innerHTML=`<style>html,body{margin:0;padding:0;width:${n}px;height:${a}px;overflow:hidden;}</style>`,t.body.innerHTML=`<div class="OUTBRAIN" data-ob-contentUrl="${location.origin}" data-widget-id="${o}" data-ob-installation-key="${r}"></div>`,t.body.appendChild(c),t.body.uuid=`${d}_${(0,e.Fs)()}`;const l=setInterval((()=>{t.body.childNodes.length>2&&(clearInterval(l),i(t.body))}),500)},t.dom.appendChild(s)}))})(n,a,i,d).then((a=>{_t({adId:t,zoneId:n.zoneId,zoneType:o,adFormat:"banner",channel:"outbrain",cpm:d.cpm,currency:"USD"}),setTimeout((()=>{((t,n)=>{const a=encodeURIComponent(window.location.href),i=encodeURIComponent(rt()),o=`${(0,e.Oq)(k)}/beesads/imp?uuid=${t}&si=${nt()}&zi=${n}&u=${a}&d=${i}`;z(o)})(a.uuid,n.zoneId),a.addEventListener("click",(()=>{(t=>{const n=`${(0,e.Oq)(k)}/beesads/click?uuid=${t}`;z(n)})(a.uuid)}))}),1500)}))}))},Ie=()=>-1===window.location.origin.indexOf("enjoy4fun.com")&&-1===window.location.origin.indexOf("bilibili.tv")&&-1===window.location.origin.indexOf("loveh5game.com"),xe=e=>new Promise((t=>{let n=ve[e];return n&&n.cpm?t(n):(n={adId:"",cpm:0},Ie()?t(n):void we(e).then((a=>{a&&a[0]&&a[0].cpm?(n=a[0],ve[e]=n,t(n)):t(n)})))})),Se=()=>{const e=["728x90","336x280","320x50","320x100","300x600","300x250","160x600","160x90","300x100","400x300","640x480"];return new Promise((t=>{if(Ie())return t(null);we(e.join(",")).then((t=>{t&&0!==t.length&&t.forEach(((t,n)=>{const a=e[n];t.cpm&&a&&(ve[a]=t)}))})).finally((()=>{t(null)}))}))},ke=e=>`gpt-video-${e.id}`,Ce=e=>{const{enableVideoStatus:t,gptVideoAdUnitCode:n,gptVideoAvgCpm:a,gptVideoErrorNum:i}=e;return t&&!!n&&a>0&&i<1},Ae=e=>{const t=e.dom.querySelector(".gpt-video-wrap");t&&t.remove()},Ee=async(t,n,a,i)=>{if(!a)return"";const o={iu:encodeURIComponent(a),description_url:encodeURIComponent(window.location.origin),url:encodeURIComponent(window.location.href),tfcd:0,npa:0,sz:"640x480|400x300",pod:1,pmad:1,pmnd:0,pmxd:6e4,lip:!0,ad_rule:0,gdfp_req:1,output:"xml_vast4",unviewed_position_start:1,env:"vp"};if("display"===n?(o.vad_type="nonlinear",o.ad_type="standardvideo",o.afvsz="300x250,336x280"):(o.vad_type="linear",o.ad_type="skippablevideo",o.vpos="preroll"===n?"preroll":"midroll"),i){const e=[];for(let t in i)e.push(`${t}=${i[t]}`);o.cust_params=encodeURIComponent(e.join("&"))}else{const i=await((t,n)=>{const{apstag:a}=window;return new Promise((i=>{if(!a)return i(null);(0,e.dK)(["fetchAmazonVideo:",t,n]),a.fetchBids({timeout:1500,slots:[{slotID:"game_inter",slotName:n,mediaType:"video"}]},(function(t){t.length>0&&((0,e.dK)(["fetchAmazonVideo encodedQsParams:",t[0].encodedQsParams]),i(t[0].encodedQsParams)),i(null)}))}))})(ke(t),a);i&&(o.cust_params=i,o.vad_type="linear",o.vpos="preroll"===n?"preroll":"midroll",o.ad_type="standardvideo",o.sz="640x480")}let r="https://pubads.g.doubleclick.net/gampad/ads";return Object.keys(o).forEach(((e,t)=>{r=0===t?`${r}?${e}=${o[e]}`:`${r}&${e}=${o[e]}`})),(0,e.dK)(["getGptVideoUrl: ",r]),r},Te=(e,t,n,a,i,o,r,d,s,c)=>{let{zoneId:l,gptVideoAvgCpm:p,gptVideoAdUnitCode:u,zoneType:m}=i;a.module="video",tt().then((async()=>{const g=((e,t)=>{Ae(e);const n=document.createElement("div");return n.id=ke(e),n.className="gpt-video-wrap",n.style.visibility="hidden",n.style.position="relative",n.style.width="100%",n.style.height=`${t}px`,n.style.overflow="hidden",n.style.border="none",e.dom.append(n),n})(a,r),h=await Ee(a,n,u,t);let f=g.offsetWidth,b=g.offsetHeight;f&&b||(f=o,b=r),a.ima3=new P(n,a.volume,h,g,f,b,((t,n)=>{t&&(_t({adId:e,zoneId:l,zoneType:m,adFormat:"video",channel:"gpt",cpm:p,currency:"USD"}),g.style.visibility="visible"),d(t,n)}),((e,t)=>{Ae(a),"ERROR"===e&&(i.gptVideoErrorNum=i.gptVideoErrorNum+1),s("ERROR"!==e,t)}),c)}))},Me="prebid-video",ze="prebid-banner",$e="gpt-video",Le="outBrain-banner",Oe="gam-banner-bidding",Be=async(t,n,a,i,o)=>{let{zoneId:r,gptBannerAvgCpm:d,gptVideoAvgCpm:s,enableBannerStatus:c,enableVideoStatus:l,zoneType:p,videoFirst:u}=t;const m=`bidding[zoneId: ${r}, disableFakeAfg:${o}]:`,g=[G(),le({size:`${a}x${i}`},!1),xe(`${a}x${i}`)],h=await Promise.all(g),f=h[0].cpm,b=h[1].cpm,w=h[2].cpm,y=d;let v=Ce(t)?s:0;const _=l&&We(a,i,p);if(!_&&!c)return(0,e.dK)([m,"all no support"]),{key:"",cpm:0};let I=[];c&&(I.push(y),I.push(b),I.push(w)),_&&(I.push(f),I.push(v));const x=[],S=[];if(o||S.push({key:Oe,cpm:I.sort(((e,t)=>t-e))[0]||0}),c&&o&&(S.push({key:ze,cpm:b}),S.push({key:Le,cpm:w})),c||(u=!0),(u||o)&&_&&f>0&&x.push({key:Me,cpm:f}),(u||o)&&_&&v>0&&x.push({key:$e,cpm:v}),u&&x.length>0){const t=x.sort(((e,t)=>t.cpm-e.cpm))[0];return(0,e.dK)([m,t.key]),t}const k=S.concat(x);if(k.length>0){const t=k.sort(((e,t)=>t.cpm-e.cpm))[0];return(0,e.dK)([m,t.key]),t}return o?((0,e.dK)([m,"all no support"]),{key:"",cpm:0}):((0,e.dK)([m,Oe]),{key:Oe,cpm:y})},Re="gpt-sdk",Ke=async(t,n,a,i,o,r,d,s,c)=>{const{enableVideoStatus:g,enableBannerStatus:h,zoneType:f,zoneId:b,gptVideoAvgCpm:w,gptVideoCpmCode:y}=a,{slot:v}=t;if(dt())return v.setTargeting("adstag_mode","test"),t.adManagerCBRuning=!1,void(t.status=p);const _=`${i}x${o}`,I=[le({size:_},!1),G(),xe(_)],x=await Promise.all(I),S=x[0],k=x[1],C=x[2],A=[];h&&(A.push({type:ze,cpm:S.cpm,code:S.cpm_code}),d&&A.push({type:Le,cpm:C.cpm,code:C.cpm_code})),g&&We(i,o,f)&&(s&&A.push({type:Me,cpm:k.cpm,code:k.cpm_code}),Ce(a)&&c&&A.push({type:$e,cpm:w,code:y}));const E=A.sort(((e,t)=>t.cpm-e.cpm))[0],T=E.cpm,M=E.type,z=E.code;if(delete t.adManagerCB,delete t.adManagerCBRuning,!z||0===T)return v.setTargeting("adstag_bid","no-bid"),void(0,e.dK)(["adstag_bid","no-bid"]);(0,e.dK)(["adstag_bid banner:",T.toString(),z,b,M]),t.status=l,v.setTargeting("adstag_bid",z),M===ze&&(t.adManagerCB=r,t.adManagerCBRuning=!1,t.status=u,t.bidingAdId=S.adId,re(_,t.bidingAdId,!0)),M===Me&&(t.adManagerCB=s,t.adManagerCBRuning=!1,t.status=m,t.bidingAdId=k.adId,F(t.bidingAdId,!0)),M===$e&&(t.adManagerCB=c,t.adManagerCBRuning=!1,t.status=m),M===Le&&(t.adManagerCB=d,t.adManagerCBRuning=!1,t.status=m)},De=()=>{const e="abcdefghijklmnopqrstuvwxyz";let t="",n=Math.floor(10*Math.random());n<5&&(n=5);for(let a=0;a<n;a++){t+=e[Math.floor(26*Math.random())]}return t},Pe=(e,t)=>{const n=e.getBoundingClientRect();let a,i;t&&(a=t.clientX,i=t.clientY);const{x:o,y:r,width:d,height:s}=n;return{xStar:o,xEnd:o+d,yStar:r,yEnd:r+s,clickX:a,clickY:i}},qe=e=>{const t=document.createElement("div"),n=De();t.id=n;const a=document.createElement("div"),i=De();a.id=i,t.append(a);const o=document.createElement("p");o.innerText="I am not a robot!",a.appendChild(o);const{dom:r,domStyle:d,type:s}=je();a.appendChild(r);const c=window.innerWidth,l=window.innerHeight,{width:p,height:u}=Ue(),m=p,g=u,h=Math.floor(Math.random()*(c-m)),f=Math.floor(Math.random()*(l-g));a.style.width=`${m}px`,a.style.height=`${g}px`,a.style.left=`${h}px`,a.style.top=`${f}px`,document.querySelector("html").appendChild(t);const b=De();((e,t,n,a,i)=>{const o=document.createElement("style");o.id=t,o.innerHTML=`#${n} {\n            position: fixed;\n            width: 100vw;\n            height: 100vh;\n            top: 0;\n            left: 0;\n            background-color: rgba(0, 0, 0, 0.8);\n            z-index: 3147941250;\n        }\n        #${a} {\n            position: relative;\n            background-color: white;\n            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n            border-radius: 5%;\n            overflow: hidden;\n            background: linear-gradient(150.72deg, #A9BCFF -11.92%, #FFFFFF 50.12%);\n\n        }\n         #${a} p{\n\t\t\theight: ${e+"px"};\n\t\t\tline-height: ${e+"px"};\n\t\t\ttext-align: center;\n\t\t\tjustify-content: center;\n\t\t\t-webkit-justify-content: center;\n\t\t\tmargin: 0;\n\t\t}\n        ${i}`,document.head.appendChild(o)})(1===s?u:u-50,b,n,i,d),yt("verifyAd",{zoneId:e.zoneId,verify:Pe(r)}),r.addEventListener("click",(function(n){const{clickX:a,clickY:i,xStar:o,xEnd:d,yStar:s,yEnd:c}=Pe(r,n);yt("verifyAdClick",{status:a>=o&&a<=d&&i>=s&&i<=c,zoneId:e.zoneId,verify:{clickX:a,clickY:i,xStar:o,xEnd:d,yStar:s,yEnd:c}}),t.remove(),document.querySelector(`#${b}`).remove()}))},je=()=>{let e="",t=document.createElement("div");const n=De();let a;return t.id=n,Math.floor(10*Math.random())>=5?(a=1,t.innerHTML="X",e=`\n            #${n} {\n               position: absolute;\n               top: 15px;\n               ${Math.floor(10*Math.random())>=5?"left":"right"}: 15px;\n               color: #000;\n               cursor: pointer;\n            }`):(a=2,t.innerText="Confirm",e=`\n            #${n} {\n                width: 100%;\n                position: absolute;\n                left: 0;\n                bottom: 0;\n                cursor: pointer;\n                font-size: 14px;\n                height: 50px;\n                line-height: 50px;\n                color: #fff;\n                text-align: center;\n                background: rgba(44, 90, 255, 1);\n            }`),{dom:t,domStyle:e,type:a}},Ue=()=>{const e=200,t=100;let n=Math.floor(76*Math.random())+e,a=Math.floor(101*Math.random())+t;for(;n/a<.5||n/a>2;)n=Math.floor(76*Math.random())+e,a=Math.floor(101*Math.random())+t;return{width:n,height:a}},Ne=()=>localStorage.getItem(A),Fe=e=>{if(!e)return;e!==localStorage.getItem(A)&&localStorage.setItem(A,e)},He=()=>new Promise((e=>{let t=Ne();if(t)return e(t);const n=setInterval((()=>{t=Ne(),t&&(clearInterval(n),e(t))}),50)})),Ve=()=>{window.addEventListener("message",(function(e){const{name:t,cache:n}=e.data||{};"send-prebid-video-list"===t&&window.adsTag.cmd.push((()=>{(e=>{q.brideCacheList=e,R("video",q.brideCacheList)})(n)})),"send-prebid-banner-cache"===t&&window.adsTag.cmd.push((()=>{(e=>{ae.bannerCacheMap=e,R("banner",ae.bannerCacheMap)})(n)}))}),!1),window.addEventListener("message",(function(e){const{name:t,params:n,isMarkUsed:a}=e.data||{},i=e.source;"send-bi"===t&&window.adsTag.cmd.push((()=>{yt(n.eventName,n.customData)})),"send-gtm"===t&&window.adsTag.cmd.push((()=>{T(n.name,n.data)})),"get-prebid-video"===t&&window.adsTag.cmd.push((()=>{G(n,a).then((t=>{i.postMessage({name:"send-prebid-video",bride:t},e.origin)}))})),"get-prebid-banner"===t&&window.adsTag.cmd.push((()=>{le(n,a).then((t=>{i.postMessage({name:"send-prebid-banner",bride:t},e.origin)}))})),"send-mark-prebid-video-bid-as-used"===t&&window.adsTag.cmd.push((()=>{W(n.adId)})),"send-mark-prebid-banner-bid-as-used"===t&&window.adsTag.cmd.push((()=>{ce(n.adId,n.size)})),"tag-ad-impressions-num"===t&&window.adsTag.cmd.push((()=>{It()})),"first-request-prebid-banner-bids"===t&&window.adsTag.cmd.push((()=>{me(n.zoneConf,n.domId,n.size).then((()=>{i.postMessage({name:"send-first-request-prebid-banner-bids"},e.origin)}))}))}),!1)},Ge=async t=>{var a,o;if(!t)return void(0,e.dK)(["init adsTag error #1"],3);Ve();let{parentHaveAdsTag:r,parentGtmId:s,siteInfo:c}=await(async()=>{const e={parentHaveAdsTag:!1,parentGtmId:""};return new Promise((t=>{if(window.addEventListener("message",(function(e){const{name:t}=e.data||{},n=e.source;if("find-parent-adsTag"===t){window.adsTagIframe={origin:e.origin,window:e.source};const t=()=>{let a=sessionStorage.getItem(I);a?He().then((t=>{U(),oe(),n.postMessage({name:"inform-iframe-adsTag-found",siteInfo:a,cid:mt(),uid:t,session:ht(),title:bt(),gtmId:it()},e.origin)})):setTimeout((()=>{t()}),300)};t()}})),window.parent===window)return t(e);{const n=function(n){const{name:i,siteInfo:o,session:r,title:d,cid:s,uid:c,gtmId:l,prebidBidMapping:p}=n.data||{};if("inform-iframe-adsTag-found"===i)return clearTimeout(a),o&&(e.siteInfo=JSON.parse(o)),r&&ft(r),c&&Fe(c),s&&gt(s),d&&wt(d),e.parentHaveAdsTag=!0,e.parentGtmId=l,t(e)},a=setTimeout((()=>(window.removeEventListener("message",n),e.parentHaveAdsTag=!1,t(e))),1e3);window.addEventListener("message",n),window.parent.postMessage({name:"find-parent-adsTag"},document.referrer)}}))})();((t,n)=>{if(window.dataLayer=window.dataLayer||[],!t&&window.templateFlag)return void(0,e.dK)(["insertGTM:","false"]);let a="GTM-5R4D28N";n&&(a=n),function(e,t,n,a,i){e[a]=e[a]||[],e[a].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});const o=t.getElementsByTagName(n)[0],r=t.createElement(n);r.async=!0,r.src="https://www.googletagmanager.com/gtm.js?id="+i,o.parentNode.insertBefore(r,o)}(window,document,"script","dataLayer",a),(0,e.dK)(["insertGTM:","true"])})(r,s),r||(c=await(t=>new Promise((a=>{let i=JSON.parse(sessionStorage.getItem(I)||"{}");if(i&&i.site_id===t&&i.channel_info&&i.zones&&i.uid&&i.sessionConfStatus&&i.siteConfStatus)return Fe(i.uid),i.siteConfStatus=!0,i.sessionConfStatus=!0,a(i);const o=encodeURIComponent(window.location.pathname),r=Ne()||"";if(z(`${(0,e.Oq)(n)}/site/${t}/session-config?pn=${o}&uid=${r}`).then((t=>{const{uid:n,zoneMap:a,banner_min_ecpm:o,video_min_ecpm:r,va:d,error:s,twice_confirm_flag:c}=t||{};if(!n||s)return(0,e.dK)(["Config Error: ",s],3);const l=()=>{i=JSON.parse(sessionStorage.getItem(I)||"{}"),i&&i.zones&&Array.isArray(i.zones)&&(clearInterval(p),i.zones.forEach((e=>{Object.assign(e,a[e.id])})),i.uid=n,i.banner_min_ecpm=o,i.video_min_ecpm=r,i.twice_confirm_flag=c,i.va=d,i.sessionConfStatus=!0,sessionStorage.setItem(I,JSON.stringify(i)),Fe(n))},p=setInterval((()=>{l()}),50);l()})),i.siteConfStatus&&i.site_id===t&&i.channel_info&&i.zones)i.siteConfStatus=!0,a(i);else if(window.APP_PROPS&&window.APP_PROPS.seoEnvMap&&window.APP_PROPS.seoEnvMap.sdkSiteConfig&&window.APP_PROPS.seoEnvMap.sdkSiteConfig.site_id===t){const e=Object.assign(i,window.APP_PROPS.seoEnvMap.sdkSiteConfig);e.siteConfStatus=!0,sessionStorage.setItem(I,JSON.stringify(e)),a(e)}else z(`${(0,e.Oq)(n)}/site/${t}/site-config`,!0).then((e=>{const n=Object.assign(i,e||{});n&&n.site_id===t&&n.channel_info&&(n.siteConfStatus=!0,sessionStorage.setItem(I,JSON.stringify(n))),a(n)}))})))(t));const{channel_info:l,o:p,bi:u,subscribe:m,pub_id:g}=c||{};if(1!==p||!l)return void(0,e.dK)(["site config error #2"],3);const h=l.Gpt,f=l.Headbiding,b=l.Amazon,w=h&&Array.isArray(h)&&h.length>0,y=f&&Array.isArray(f)&&f.length>0,v=w&&b&&Array.isArray(b)&&b.length>0;let x={id:t,pubId:g,useVerify:!1,gptConf:{open:!1},prebidConf:{open:!1},amazonConf:{open:!1},bi:{enable:1===u.o,account_id:u.account_id,app_id:u.app_id},subscribe:{enable:1===m.o}};w?x.gptConf.open=!0:(0,e.dK)(["GPT open status:","false"],3);const S=[He(),Se()];r||(S.push(new Promise((e=>{let t=JSON.parse(sessionStorage.getItem(I)||"{}");if(t.siteConfStatus&&t.sessionConfStatus)return e(null);const n=setInterval((()=>{t=JSON.parse(sessionStorage.getItem(I)||"{}"),t.siteConfStatus&&t.sessionConfStatus&&(clearInterval(n),e(null))}),50)}))),S.push((async e=>new Promise((t=>{if(!e)return t(null);if(document.getElementById(i)||document.querySelector('[src*="pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"]'))return t(null);const n=document.createElement("script");n.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-${e}`,n.async=!0,n.id=i,n.crossOrigin="anonymous",n.onload=()=>{t(null)},document.head.append(n)})))(g))),w&&S.push((async()=>new Promise((t=>{let n=document.querySelector(`#${Re}`);if(n)return t(null);n=document.createElement("script"),n.async=!0,n.src="https://securepubads.g.doubleclick.net/tag/js/gpt.js",n.id=Re,n.onload=function(){window.googletag=window.googletag||{cmd:[]},(0,e.dK)(["gpt settings: ","cid"]),window.googletag.cmd.push((function(){window.googletag.pubads().setTargeting("cid",mt()),window.googletag.pubads().setCentering(!0),window.googletag.enableServices()}));const n=at();n&&((0,e.dK)(["user first time: ",`day_${be(n,8).format("YYYYMMDD")}`]),window.googletag.cmd.push((function(){window.googletag.pubads().setTargeting("user_day",`day_${be(n,8).format("YYYYMMDD")}`)}))),t(null)},n.onerror=()=>{(0,e.dK)(["Script Error:","gpt"],3),t(null)},document.head.append(n)})))()),y&&!r&&S.push((async()=>new Promise((e=>{const t=document.createElement("script");t.async=!0,t.src="https://cdn.beesads.com/prebid/8.48.0/prebid.js",t.onload=()=>{e(null)},t.onerror=()=>{e(null)},document.head.append(t)})))()),v&&S.push(new Promise((t=>{const n=document.createElement("script");n.async=!0,n.src="https://c.amazon-adsystem.com/aax2/apstag.js",n.onload=()=>{t(null)},n.onerror=()=>{(0,e.dK)(["Script Error:","amazon"],3),t(null)},document.head.append(n)}))),await Promise.all(S),r||(c=JSON.parse(sessionStorage.getItem(I)||"{}"));const{banner_min_ecpm:k,video_min_ecpm:C,zones:A,va:E,twice_confirm_flag:T}=c;if(x.useVerify=!!T,!A||!Array.isArray(A))return void(0,e.dK)(["site config error #3"],3);let M;if(r||(M={enable:1===E.o,exclude_channel:[],min_ecpm:E.min_ecpm,min_queue_len:E.min_queue_len,video_freq:E.video_freq}),y&&!r){const e={video:{},banner:{}};(f||[]).forEach((t=>{const{name:n,vo:a,banner:i,video:o}=t||{};(i||[]).forEach((t=>{const{params:a,sizes:i}=t||{};i&&Array.isArray(i)&&i.forEach((t=>{if(2===t.length){const i=t.join("x");e.banner[i]||(e.banner[i]={mediaTypes:{banner:{sizes:[t]}},sizes:[t],bids:[]}),e.banner[i].bids.push({bidder:n,params:a,floorData:{skipped:!1,skipRate:0},getFloor:()=>({floor:k,currency:"USD"})})}}))})),(o||[]).forEach((t=>{const{params:a}=t;if(a){const t="instream";e.video[t]||(e.video[t]={mediaTypes:j,bids:[],code:_}),e.video[t].bids.push({bidder:n,params:a,floorData:{skipped:!1,skipRate:0},getFloor:()=>({floor:C,currency:"USD"})})}})),1!==a&&M&&M.exclude_channel.push(n)})),x.prebidConf={open:y,bannerMinECpm:k,videoMinECpm:C,adUnitsMap:e}}v&&(x.amazonConf={open:v,pubId:null===(o=null===(a=b[0])||void 0===a?void 0:a.banner)||void 0===o?void 0:o.pubId,bannerMinECpm:k,videoMinECpm:C});let $={};A.forEach((e=>{var t,n,a,i;let o,{id:r,channel_info:s,ad_format:c,gpt_banner_ecpm:l,gpt_video_ecpm:p,type:u,refresh_config:m,afg_ecpm:g,pre_ad:f,fake_afg:b,video_first:w,lazy_load:y,no_ad_hide:v,gpt_video_cpm_code:_}=e;if(!s||!c)return;o=m?{status:m.o,refreshInterval:m.interval,refreshNum:m.max+1}:{status:!1,refreshInterval:90,refreshNum:0};const I=(null===(t=null==s?void 0:s.Gpt)||void 0===t?void 0:t.banner_code)||(null===(n=h[0])||void 0===n?void 0:n.banner_code),x=(null===(a=null==s?void 0:s.Gpt)||void 0===a?void 0:a.video_code)||(null===(i=h[0])||void 0===i?void 0:i.video_code),S={zoneId:r,enableVideoStatus:-1!==c.indexOf("video")&&"Anchor"!==d[u],enableBannerStatus:-1!==c.indexOf("banner"),videoFirst:1===w,gptBannerAdUnitCode:I,gptVideoAdUnitCode:x,gptBannerAvgCpm:I?Number(l||"0"):0,gptVideoAvgCpm:x?Number(p||"0"):0,gptVideoCpmCode:_||"",gptVideoErrorNum:0,afgAvgCpm:Number(g||"0"),usablePrerollAds:1===f,usableFakeAFG:1===b,zoneType:u,enableLazyLoad:1===y,refreshConfig:o,enableEmptyAdHide:1===v};$[r]=S})),((e,t,n)=>{q.usable=e,q.minCpm=Number(t||"0"),q.disableRequest=n})(y,C,r),((e,t)=>{ae.minCpm=Number(e||"0"),ae.disableRequest=t})(k,r);const L=Ne();if(v&&window.apstag&&((0,e.dK)(["amazon settings: ","pubId",x.amazonConf.pubId]),(e=>{const{apstag:t}=window;t&&t.init({pubID:e,adServer:"googletag",videoAdServer:"DFP",bidTimeout:2e3})})(x.amazonConf.pubId)),y&&!r&&window.pbjs){(0,e.dK)(["prebid settings: ","init"]);const{adUnitsMap:t}=x.prebidConf;ge(t,M)}return r||(X=!0,te("video","instream"),setTimeout((()=>{ne(),setInterval((()=>{ne()}),15e3)}),5e3)),{uid:L,siteConfig:x,zoneConfigMap:$,parentHaveAdsTag:r}},Ye=e=>{const t=e.refreshNum;0!==t&&(e.refreshNum=t-1)},We=(e,t,n)=>2===n||e>=t&&e/t<=2,Ze=(t,n,a)=>{const{id:i,width:o,height:r}=t;let d;try{d=parseInt(window.getComputedStyle(n).height)||0}catch(e){d=0}const s=document.createElement("div");s.id=i,s.setAttribute(i,""),s.style.position="relative",n.appendChild(s),2===a?(s.style.display="flex",s.style.width="100%",s.style.height="100%",s.style.justifyContent="center",s.style.alignItems="center"):4===a?(n.style.height="100vh",s.style.display="flex",s.style.width="100%",s.style.height="100%",s.style.justifyContent="center",s.style.alignItems="center"):5===a?(n.style.display="flex",n.style.justifyContent="center",n.style.alignItems="center",s.style.minWidth=`${o}px`,s.style.minHeight=`${r}px`):(s.style.display="flex",s.style.minWidth=`${o}px`,s.style.minHeight=`${r}px`,s.style.justifyContent="center",s.style.height=`${d>r?d:r}px`,s.style.alignItems="center"),Qe(n,i),t.dom=s,(t=>{const n=nt(),{useVerify:a}=window.__siteConf;if(!a)return;(0,e.dK)(["init verify",n],2);const i=De(),o=document.createElement("div");o.id=i,o.style.position="absolute",o.style.width="100%",o.style.height="100%",o.style.left="0",o.style.right="0",o.style.zIndex="941250",t.dom.appendChild(o),o.addEventListener("mousedown",(()=>{o.remove(),qe(t)}))})(t)},Je=(t,n,a,i,o,r,d,s)=>{(0,e.hj)(window.__tagIndex)||(window.__tagIndex=0);const{zoneId:l,refreshConfig:p,zoneType:u}=n,m=`tag-code-${window.__tagIndex}`,g={id:m,domId:m,status:c,width:o,height:r,zoneId:l,adBreakDone:s,gptFinishDisplay:!1,refreshStatus:p.status,refreshInterval:p.refreshInterval,refreshNum:p.refreshNum,volume:a||0,videoFirst:d};return i&&Ze(g,i,u),window.__tagIndex++,t[m]=g,Array.isArray(n.tagList)?n.tagList.push(m):n.tagList=[m],g},Xe=e=>e[E],Qe=(e,t)=>{e[E]=t},et=(e,t,n)=>{if(n&&n.removeAttribute&&(n.removeAttribute(t),delete n[E]),e[t]){const n=e[t].refreshSto;n&&clearTimeout(n),delete e[t]}},tt=()=>new Promise((t=>{let n=document.getElementById(b);if(n){const e=setInterval((()=>{window.google&&window.google.ima&&(clearInterval(e),t(null))}),50)}else n=document.createElement("script"),n.async=!0,n.src="//imasdk.googleapis.com/js/sdkloader/ima3.js",n.id=b,n.onload=function(){const n=window.onerror;window.onerror=function(t,a,i,o,r){return"ResizeObserver loop limit exceeded"!==t&&(!!(0,e.mf)(n)&&n(t,a,i,o,r))};const a=window.google.ima;a.settings.setDisableCustomPlaybackForIOS10Plus(!0),a.settings.setPlayerType("google/codepen-demo-countdown-timer"),a.settings.setPlayerVersion("1.0.0"),a.settings.setVpaidMode(a.ImaSdkSettings.VpaidMode.INSECURE),t(null)},n.onerror=()=>{(0,e.dK)(["ima3 error"],3),t(null)},document.head.append(n)})),nt=()=>{var e;try{return(null===(e=window.__siteConf)||void 0===e?void 0:e.id)||document.getElementById(a).getAttribute("data-site-id")}catch(e){return"undefined"}},at=()=>{const e=localStorage.getItem(C);if(e)return parseInt(e)},it=()=>{const t=document.querySelector('script[src*="www.googletagmanager.com/gtm.js"]');if(!t)return;return(0,e.k5)((t.getAttribute("src")||"?").split("?")[1]).id},ot=e=>{if(!e)return!1;const{top:t,height:n}=e.getBoundingClientRect(),a=window.innerHeight;return!(!e||document.hidden)&&(!(t>a)&&!(t+n<=0))},rt=()=>{let e="";return e=window.top===window?window.location.origin:document.referrer,e},dt=()=>{const e=document.getElementById(a);if(!e)return!1;const t=e.getAttribute("data-test");return t&&"on"===t},st="ads-tag-session-id",ct="ads-tag-session-ads-num",lt=!(0,e.Os)().isGameApp,pt=e=>{try{const t=document.cookie.split("; "),n={};return t.forEach((e=>{const t=e.split("=");n[t[0]]=t[1]})),n[e]||""}catch(e){return console.error("cookie error",e),""}},ut=e=>{function t(e){return e<10?"0"+e:e}let n;return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+" "+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+"."+((n=e.getMilliseconds())<10?"00"+n:n<100?"0"+n:n)},mt=()=>localStorage.getItem("sdk-cid")||"default",gt=t=>{t&&((0,e.dK)(["setCid",t]),localStorage.setItem("sdk-cid",t))},ht=()=>{let t=sessionStorage.getItem(st);return t||(t=`${(new Date).getTime()}-${(0,e.Fs)()}`,ft(t),t)},ft=e=>{sessionStorage.setItem(st,e)},bt=()=>sessionStorage.getItem("ads-tag-title"),wt=e=>sessionStorage.setItem("ads-tag-title",e),yt=(n,a)=>{if(!(0,e.HD)(n))return void(0,e.dK)(["sendBI","eventName error"]);a||(a={});const{enable:i,app_id:o,account_id:r}=window.__siteConf.bi,d=nt();if(!i||!o||!r)return void(0,e.dK)(["sendBI","domain not enabled",d],2);if(window.adsTag&&window.adsTag.parentHaveAdsTag)return void window.parent.postMessage({name:"send-bi",params:{eventName:n,customData:a}},document.referrer);let s;s=window.top===window?window.location.href:document.referrer;const c=new Date;(0,e.dK)(["sendBI",n,a]);const l={"#app_id":o,automaticData:{"#lib":"js","#system_language":navigator.language},data:[{"#type":"track","#time":ut(c),"#timestamp":c.getTime(),"#account_id":r,"#event_name":n,"#uuid":(0,e.Fs)(),properties:{event_name:n,page_url:window.location.href,custom_data:Object.assign({cid:mt(),sessionId:ht(),version:t,referrer:s,_fbp:pt("_fbp"),_fbc:pt("_fbc")},a),title:a.title||bt(),game_name:a.title||bt(),uid:Ne(),site_id:d,"#zone_offset":0-(new Date).getTimezoneOffset()/60}}]};fetch("https://deapi.funsdata.com/v1/wgt/report/json",{method:"POST",mode:"cors",cache:"no-cache",keepalive:lt,body:JSON.stringify(l)})},vt=t=>{t.zoneType=d[t.zoneType];const n=(0,e.Fs)();return t.adId=n,yt("adRequest",t),n},_t=e=>{e.zoneType=d[e.zoneType],yt("adImpressions",e),T("tag_ad_impressions",{event_category:"ads",event_label:e.channel,value:e.cpm/1e3,event_currency:e.currency}),It()},It=()=>{if(window.adsTag&&window.adsTag.parentHaveAdsTag)return void window.parent.postMessage({name:"tag-ad-impressions-num"},document.referrer);let e=parseInt(localStorage.getItem(ct)||"0");e+=1,-1!==[1,3,5,7,10,12,15,20,25,30,40,50,100].indexOf(e)&&T("tag_ad_impressions_num",{event_category:"ads",event_label:"number",value:e}),localStorage.setItem(ct,e.toString())},xt=e=>{yt("adRepeat",e)},St="_lsv_",kt="__lsv__",Ct=()=>parseInt(sessionStorage.getItem(St)||"0"),At=(e,t)=>new Promise((n=>{const{gptBannerAdUnitCode:a,refreshConfig:i}=t,{refreshInterval:o,refreshNum:r}=i;let d=parseInt(sessionStorage.getItem("ads-tag-rgi")||"0");if(d+=1,d>r)return n(!1);const s=()=>{window.googletag=window.googletag||{cmd:[]};const t=window.googletag;t.cmd.push((function(){const i=t.defineOutOfPageSlot(a,t.enums.OutOfPageFormat.INTERSTITIAL);e.slot=i,n(!!i)}))};let c=Ct();const l=1e3*o;if(0===c||Date.now()-c>l)localStorage.removeItem(kt),s();else{const e=setInterval((()=>{c=Ct(),Date.now()-c>l&&(clearInterval(e),localStorage.removeItem(kt),s())}),1e3)}})),Et=(t,n)=>{const a="ads-tag-rgi";let i=parseInt(sessionStorage.getItem(a)||"0");const o=window.googletag,r=t.slot;r.addService(o.pubads()),o.pubads().addEventListener("slotOnload",(function(t){r===t.slot&&((0,e.dK)(["Interstitial:","slotOnload"]),sessionStorage.setItem(a,i.toString()),sessionStorage.setItem(St,Date.now().toString()))})),o.pubads().addEventListener("impressionViewable",(e=>{r===e.slot&&n()})),o.enableServices(),o.display(r)},Tt=(e,t,n)=>{const{gptBannerAdUnitCode:a}=t;return new Promise((t=>{window.googletag=window.googletag||{cmd:[]};const i=window.googletag;i.cmd.push((()=>{const o="top"===n?i.enums.OutOfPageFormat.TOP_ANCHOR:i.enums.OutOfPageFormat.BOTTOM_ANCHOR,r=i.defineOutOfPageSlot(a,o);e.slot=r,t(!!r)}))}))},Mt="gpt-banner-wrap",zt=(t,n,a,i,o)=>{const r=window.googletag,d=n.dom,s=(e=>`gpt-banner-${e.id}`)(n);return new Promise((n=>{const c=`display:none;width:${a}px;height:${i}px;overflow: hidden;`,l=document.createElement("div");if(l.id=s,l.className=Mt,!r)return(0,e.dK)(["createGptBannerSlot error:","not found googletag"]),n(null);o&&l.setAttribute("style",c),d.appendChild(l),r.cmd.push((()=>{const e=r.defineSlot(t,[a,i],s).addService(r.pubads());n(e)}))}))},$t=(e,t)=>{const n=window.googletag,a=t.dom.querySelector(`.${Mt}`);n&&e&&a&&(n.pubads().clear([e]),a.style.display="none")},Lt=(t,n,a)=>{const i=window.googletag,o=n.querySelector(`.${Mt}`);return new Promise((n=>{if(!i||!t||!o)return n(!1);i.cmd.push((function(){const a=setTimeout((()=>{i.pubads().removeEventListener("slotRenderEnded",o),(0,e.dK)(["slotRenderEnded timeout"]),n(!1)}),3e3),o=function(e){t===e.slot&&(clearTimeout(a),i.pubads().removeEventListener("slotRenderEnded",o),n(!e.isEmpty))};i.pubads().addEventListener("slotRenderEnded",o)})),o.style.display="block",i.cmd.push((()=>{a?i.pubads().refresh([t]):i.display(t)}))}))},Ot=(t,n,a,i,o,r,d)=>{const{amazonConf:s}=n,{zoneId:c,gptBannerAdUnitCode:l}=a;let{slot:p,gptFinishDisplay:u}=t;const m=t.dom;t.module="banner",Lt(p,m,u).then((n=>{if(n)return void d(n);const{apstag:a}=window;if(!s.open||!a)return(0,e.dK)(["gpt empty:",c]),void d(n);(0,e.dK)(["gpt empty, try amazon:",c,(100*Number(s.bannerMinECpm)).toString()]),((t,n,a,i)=>{const{apstag:o}=window,{bannerMinECpm:r}=i;return new Promise((i=>{if(!o)return i(null);(0,e.dK)(["fetchAmazonBanner",t,n]),o.fetchBids({timeout:1500,slots:[{slotID:t,slotName:n,sizes:a,floor:{value:100*Number(r),currency:"USD"}}]},(function(){o.setDisplayBids(),i(null)}))}))})(t.slot.getSlotId().getDomId(),l,[[i,o]],s).then((()=>{Lt(p,m,u).then((t=>{t||(0,e.dK)(["gpt and amazon empty:",c]),d(t)}))}))})),t.gptFinishDisplay=!0,r()};var Bt=__webpack_require__(892),Rt=__webpack_require__.n(Bt),Kt=__webpack_require__(760),Dt=__webpack_require__.n(Kt),Pt=__webpack_require__(362),qt=__webpack_require__.n(Pt),jt=__webpack_require__(192),Ut=__webpack_require__.n(jt),Nt=__webpack_require__(60),Ft=__webpack_require__.n(Nt),Ht=__webpack_require__(865),Vt=__webpack_require__.n(Ht),Gt=__webpack_require__(44),Yt={};Yt.styleTagTransform=Vt(),Yt.setAttributes=Ut(),Yt.insert=qt().bind(null,"head"),Yt.domAPI=Dt(),Yt.insertStyleElement=Ft();Rt()(Gt.Z,Yt);Gt.Z&&Gt.Z.locals&&Gt.Z.locals;const Wt='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path><path fill="none" d="M0 0h24v24H0V0z"></path></svg>';let Zt,Jt;const Xt=.03,Qt=(e,t,n,a)=>{const i=document.querySelector(".fake-progress");if(!i)return;const o=i.querySelector("p");Jt=t+Xt,a&&(Zt&&clearInterval(Zt),Zt=setInterval((()=>{let t=Jt/n*100;t>100&&(t=100),o.style.width=`${t}%`,Jt>=n?clearInterval(Zt):e.ima3.pauseStatus||(Jt+=Xt)}),30))},en=(e,t,n,a)=>{const i=document.querySelector(`#${w}`),o=document.querySelector(".ads-main"),r=document.querySelector(`#${y}`);let d="",c="",l=0;if("reward"===t){l=n||5,d=Wt,c=`<div class="reward-close-timer">Reward in <span class="reward-close-timer-num">${l}</span> seconds</div>`;const t=setInterval((()=>{if(!i.querySelector(".fake-ads-loading")){if(e.status===g&&l--,0===l)return clearInterval(t),i.querySelector(".reward-close-timer").innerHTML="",void i.querySelector(".close-ad-action").setAttribute("adf-played","true");i.querySelector(".reward-close-timer-num").innerHTML=l.toString()}}),1e3)}else{d=Wt;const e=setInterval((()=>{if(!i.querySelector(".fake-ads-loading"))return clearInterval(e),void i.querySelector(".close-ad-action").removeAttribute("disable")}),1e3)}let p=`<span class="ads-title">Ad</span><div class="close-ad-action" disable="${"reward"!==t}">${c}<div class="close-ad-button">${d}</div></div>`;const u=document.createElement("div");u.className="header-panel"+(c?" reward-ads-title":""),u.innerHTML=p,o.insertBefore(u,r);const m=document.querySelector(".close-ad-action");e.close=()=>{if(e.status!==f){var n;if(e.status!==s)return"reward"===t&&l>0?(e.status=f,"video"===e.module&&e.ima3.pauseAds(),void(n=o,new Promise(((e,t)=>{const a=document.createElement("div");a.className="ad-reward-confirm",a.innerHTML='<div class="close-confirmation-dialog" id="close-confirmation-dialog"><div class="confirmation-title">Close Ad?</div><div class="confirmation-message">You will lose your reward</div><div class="confirmation-buttons"><div class="close-ad-button">CLOSE</div><div class="resume-ad-button">RESUME</div></div></div>',n.appendChild(a),a.querySelector(".resume-ad-button").addEventListener("click",(function(){a.remove(),e("RESUMED")})),a.querySelector(".close-ad-button").addEventListener("click",(function(){t("USER_CLOSE")}))}))).then((()=>{e.status=g,"video"===e.module&&e.ima3.resumeAds()})).catch((e=>{a(!1,{breakStatus:e})}))):void a(!0);a(!1)}},m.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation(),e.close()}),!0)},tn=e=>{const t=document.querySelector(`#${w}`);t&&t.setAttribute("data-module",e)};let nn={};const an=(t,n,a,i,o)=>{const r=document.querySelector(`#${w}`),d=document.getElementById(y);if(!r||!d)return;const s=r.querySelector(".fake-ads-loading");s&&s.remove(),r.removeAttribute("data-use-loading");const c=r.querySelector(".ads-main");if("video"===n){const n=document.createElement("div");n.className="fake-progress",n.innerHTML="<p></p>",r.append(n);try{ResizeObserver?((0,e.mf)(nn[t.id])&&nn[t.id].unobserve(),nn[t.id]=new ResizeObserver((()=>{t.ima3.resizeAds(d.clientWidth,d.clientHeight)})),nn[t.id].observe(d)):((0,e.mf)(nn[t.id])&&window.removeEventListener("resize",nn[t.id]),nn[t.id]=function(){t.ima3.resizeAds(d.clientWidth,d.clientHeight)},window.addEventListener("resize",nn[t.id]))}catch(t){(0,e.dK)(["video resize error"],2)}a&&"1"===a&&setTimeout((()=>{const e=document.querySelector(".video-skip");e&&(e.style.display="block")}),5e3)}"banner"===n&&"white"===r.getAttribute("data-banner-theme")&&(c.style.width=i+"px",c.style.height=`calc(56px + ${o}px + 10px)`,c.style.left=`calc(50% - (${i}px + 12px * 2) / 2)`,c.style.top=`calc(50% - (56px + ${o}px + 10px) / 2)`),c.style.visibility="visible"},on=async(t,n,a,i,o,r)=>{const{gptConf:d,prebidConf:c}=i,{zoneId:l,zoneType:p,gptBannerAdUnitCode:h,usableFakeAFG:f,enableBannerStatus:b,enableVideoStatus:v}=n,{type:_,useLoading:I,theme:x,dom:S,volume:k,uesVideoClickKey:C,beforeAd:A,rewardSkipSecond:E}=t;2!==p&&3!==p&&(0,e.dK)(["invalid zoneType"],2),((e,t,n,a)=>{let i=(e||document).querySelector(`#${w}`);i&&i.remove(),i=document.createElement("section"),i.id=w,e?(i.style.width="100%",i.style.height="100%",i.style.position="absolute",-1===["absolute","fixed","relative"].indexOf(window.getComputedStyle(e).position)&&(e.style.position="relative")):(i.style.width="100vw",i.style.height="100vh",i.style.position="fixed"),e?e.appendChild(i):document.querySelector("html").appendChild(i);let o="";a&&(o='<div class="video-skip">Skip Ads</div>'),i.innerHTML=`<div class="ads-bg"></div><div class="fake-ads-loading"></div><div class="ads-main">${o}<div id="${y}" class="container"></div></div>`,i.setAttribute("data-banner-theme",t),i.setAttribute("data-use-loading",n.toString()),i.style.display="block"})(S,x,I,C);const T=document.getElementById(w),M=document.getElementById(y);M.style.display="flex";let z=300,$=250,L=300,O=250;const B=T.clientWidth,R=T.clientHeight,K=M.clientWidth,D=M.clientHeight,P=(0,e.SB)();P||(L=300,O=250,K<=600||D<400?(z=300,$=250):D<500?(z=480,$=320,L=336,O=280):(z=580,$=400,L=336,O=280)),P&&(z=300,L=300,D<680?($=250,O=250):($=600,O=600));const q=Je(o,n,k,M,z,$);q.slot=await zt(h,q,z,$,r),q.slot.setTargeting("adstag_id",q.id);const j=e=>{e||(q.status=s),A(e)},U=(e,t)=>{a(e,t),et(o,N,M),(()=>{const e=document.querySelector(`#${w}`);setTimeout((()=>{e&&e.remove()})),window.focus()})()};en(q,_,E,((e,t)=>{U(e,t)}));let{id:N,slot:H}=q;Z(q),pe(q),Ae(q);const Y=e=>{tn("video"),$t(H,q),J(e,_,q,B,R,p,(e=>{j(!!e),e?an(q,"video",e.videoClickKey):U(!1)}),(e=>{U(e)}),((e,t,n)=>{Qt(q,e,t,n)}))},X=e=>{tn("banner"),$t(H,q),ue(e,q,L,O,p,(e=>{j(!!e),e?an(q,"banner",null,L,O):U(!1)}))},Q=(t,a,i)=>{tn("video"),$t(H,q),Te(t,a,_,q,n,B,R,((t,n)=>{j(t),q.bidingAdId?n&&Array.isArray(n.adWrapperSystems)&&-1!==n.adWrapperSystems.indexOf("BeesAds")?((0,e.dK)(["GAM VAST: prebid winner"]),W(q.bidingAdId),t&&an(q,"video",i)):((0,e.dK)(["GAM VAST: gpt winner"]),F(q.bidingAdId,!1),t&&an(q,"video")):t&&an(q,"video")}),((t,n)=>{(0,e.dK)(["video played(linear):",`[status:${t}, message: ${n}]`]),U(t)}),((e,t,n)=>{Qt(q,e,t,n)}))},ee=e=>{tn("banner"),$t(H,q),_e(e,q,L,O,p,(e=>{j(!!e),e?an(q,"banner",null,L,O):U(!1)}))};if(!b&&v){(0,e.dK)(["bidding: GAM VAST",l]);const t=vt({zoneId:l,zoneType:p});return void((e,t,n,a,i,o)=>new Promise((async n=>{const{open:a}=t;if(!a)return n(null);const{enableVideoStatus:r}=e;return r?(await G()).adId?n(null):void new Promise((e=>{const t=setTimeout((()=>{clearTimeout(t),e(null)}),3e3);Promise.all([i(),o()]).finally((()=>{clearTimeout(t),e(null)}))})).then((()=>{n(null)})):n(null)})))(n,c,0,0,he,ne).then((async()=>{const a=await G();let i;a.cpm>0&&(i=await(async(t,n,a,i)=>{const{zoneId:o}=a,r=await G(),d=r.cpm_code;if(!d)return void(0,e.dK)(["adstag_bid","no-bid"]);(0,e.dK)(["adstag_bid video:",r.cpm.toString(),d,o]),t.status=m,t.bidingAdId=r.adId,F(t.bidingAdId,!0);const{siteId:s,url:c,domain:l,cid:p}=V();return{adstag_vast_bid:d,adstag_vast_uuid:i,adstag_vast_zoneid:o,adstag_vast_siteid:s,adstag_vast_url:c,adstag_vast_domain:l,adstag_vast_cid:p}})(q,0,n,a.videoCacheKey)),q.status=g,Q(t,i,a.videoClickKey)}))}const te={[Me]:e=>{q.status=g,Y(e)},[ze]:e=>{q.status=g,X(e)},[Le]:e=>{q.status=g,ee(e)},[$e]:e=>{q.status=g,Q(e)},[Oe]:async e=>{await Ke(q,0,n,L,O,(()=>{X(e)}),(()=>{ee(e)}),(()=>{Y(e)}),(()=>{Q(e)})),Ot(q,i,n,z,$,(()=>{}),(t=>{q.bidingAdId&&(q.status===u?re(`${z}x${$}`,q.bidingAdId,!1):q.status===m&&F(q.bidingAdId,!1),delete q.bidingAdId),q.adManagerCBRuning||(j(t),t?(_t({adId:e,zoneId:l,zoneType:p,adFormat:"banner",channel:"gpt",cpm:n.gptBannerAvgCpm,currency:"USD"}),tn("banner"),an(q,"banner",void 0,z,$)):U(!1)),delete q.adManagerCB,delete q.adManagerCBRuning,q.status=g}))}};me(n,"interstitial",`${L}x${O}`).then((()=>{Be(n,0,L,O,!f).then((t=>{if(t.key&&0!==t.cpm&&te[t.key]){const e=vt({zoneId:l,zoneType:p});te[t.key](e)}else j(!1),U(!1);(0,e.dK)([`winnerAds: {key: ${t.key}, cpm: ${t.cpm}, zoneId: ${l}}`])}))}))};class rn{get mode(){return dt()?"test":"production"}get uid(){return Ne()}get cid(){return mt()}get session(){return ht()}get system(){return(0,e.Os)()}get title(){return bt()}constructor(n,a,i,o){this.version=t,this.tagMap={},this.interstitialStatus="",this.anchorStatus="",this.fixedWidth=!1,this.hasInteracted=!1,this.refreshBefore=e=>!0,this.setTargeting=(e,t)=>{window.googletag=window.googletag||{cmd:[]},window.googletag.cmd.push((function(){window.googletag.pubads().setTargeting(e,t)}))},this.sendGTM=T,this.sendBI=yt,this.sendAdRequest=vt,this.sendAdImpressions=_t,this.cmd=[],this.debug=()=>{window.googletag&&window.googletag.openConsole()},this.ready=!0,this.siteConf=n,this.zoneConfMap=a,this.defaultZoneId=i,this.parentHaveAdsTag=o,window.__siteConf=n;const r=()=>{(0,e.dK)(["User Has Interacted"]),this.hasInteracted=!0,window.removeEventListener("mousedown",r),window.removeEventListener("touchstart",r)};window.addEventListener("mousedown",r),window.addEventListener("touchstart",r),this.cmd.push=e=>{const t=this.cmd.length;return e(),t}}init(t){const{fixedWidth:n,refreshBefore:a}=t;this.fixedWidth=!!n,(0,e.mf)(a)&&(this.refreshBefore=a)}registerTimedRefresh(e,t){const n=this.tagMap[e];if(!n)return;let{refreshStatus:a,refreshNum:i,refreshInterval:o,zoneId:r,videoFirst:d}=n;const{enableBannerStatus:s,enableLazyLoad:c}=this.zoneConfMap[r];if(t&&s&&!d&&(!a||i<1))return;!(n.dom&&ot(n.dom))&&c&&(o=.05),clearTimeout(n.refreshSto),n.refreshSto=setTimeout((()=>{clearTimeout(n.refreshSto),e&&this.tagMap[e]&&this.refreshAds(e)}),1e3*o)}refreshAds(t){const n=this.tagMap[t];let{slot:a,width:i,height:o,zoneId:r,adBreakDone:d}=n;const s={zoneId:r,width:i,height:o},c=document.querySelector(`[${t}]`);if(!c)return void et(this.tagMap,t);if(!this.refreshBefore(s))return void this.registerTimedRefresh(t,!1);const{zoneConfMap:l,siteConf:p}=this,h=l[r],{zoneType:f,enableLazyLoad:b}=h;if(!ot(c)&&b)return void this.registerTimedRefresh(t,!1);Z(n),pe(n),Ae(n),(e=>{const t=e.dom.querySelector(`.${ye}`);t&&t.remove()})(n),delete n.module;const w=e=>{$t(a,n),J(e,"display",n,i,o,f,(e=>{if(!e)return clearTimeout(n.refreshSto),void this.refreshAds(n.id);Ye(n),this.registerTimedRefresh(n.id,!1)}),(()=>{clearTimeout(n.refreshSto),this.refreshAds(n.id)}))},y=e=>{$t(a,n),ue(e,n,i,o,f,(e=>{e||(clearTimeout(n.refreshSto),this.refreshAds(n.id)),Ye(n),this.registerTimedRefresh(n.id,!0)}))},v=(t,r)=>{$t(a,n),Te(t,r,"display",n,h,i,o,(()=>{Ye(n),this.registerTimedRefresh(n.id,!1)}),((t,a)=>{(0,e.dK)(["video played(nonlinear):",`[status:${t}, message: ${a}]`]),clearTimeout(n.refreshSto),this.refreshAds(n.id)}))},_=e=>{$t(a,n),_e(e,n,i,o,f,(e=>{e||(clearTimeout(n.refreshSto),this.refreshAds(n.id)),Ye(n),this.registerTimedRefresh(n.id,!0)}))},I={[Me]:e=>{n.status=g,w(e)},[ze]:e=>{n.status=g,y(e)},[Le]:e=>{n.status=g,_(e)},[$e]:e=>{n.status=g,v(e)},[Oe]:async a=>{await Ke(n,this.tagMap,h,i,o,(()=>{y(a)}),(()=>{_(a)}),(()=>{w(a)}),(()=>{v(a)})),Ot(n,p,h,i,o,(()=>{}),(s=>{n.bidingAdId?(n.status===u&&re(`${i}x${o}`,n.bidingAdId,!1),n.status===m&&F(n.bidingAdId,!1),delete n.bidingAdId):(Ye(n),this.registerTimedRefresh(t,!0)),n.status=g,!n.adManagerCBRuning&&s&&_t({adId:a,zoneId:r,zoneType:f,adFormat:"banner",channel:"gpt",cpm:h.gptBannerAvgCpm,currency:"USD"}),s||((0,e.dK)(["Non-GAM empty",r]),h.enableEmptyAdHide&&(n.dom.parentElement.style.display="none",clearTimeout(n.refreshSto))),delete n.adManagerCB,delete n.adManagerCBRuning,(0,e.mf)(d)&&d(s)}))}};Be(h,this.tagMap,i,o,!1).then((t=>{const n=vt({zoneId:r,zoneType:f});I[t.key](n),(0,e.dK)([t.key,r])}))}adManagerCb(t,n,a,i,o){const r=this.tagMap[t],d=r.adManagerCB;(0,e.dK)(["adManagerCb",t]),(0,e.mf)(d)&&(r.adManagerCBRuning=!0,d(n,a,i,o))}getZoneInfo(e){return this.zoneConfMap[e]||{}}async getBiddingInfo(t,n){const a="getBiddingInfo: ",i=this.defaultZoneId;t&&n||(t=300,n=250,(0,e.SB)()&&window.innerHeight>680&&(n=600));const o={key:"",cpm:0};if(!i)return(0,e.dK)([a,"zoneId undefined"],3),o;const r=this.zoneConfMap[i];if(!r)return(0,e.dK)([a,`invalid parameter zoneId ${i}`],3),o;const{zoneType:d,usableFakeAFG:s}=r;return 2!==d?((0,e.dK)([a,"type error",i],3),o):await Be(r,this.tagMap,t,n,!s)}adBreak(t){let{type:n,beforeAd:a,adBreakDone:i,zoneId:o,volume:r,theme:d,useLoading:s}=t;if(o||(o=this.defaultZoneId),(0,e.mf)(a)||(a=t.beforeAd=()=>{}),(0,e.mf)(i)||(i=()=>{}),!o)return(0,e.dK)(["invalid zoneId #1"],3),a(!1),void i(!1);const{siteConf:c,tagMap:l,zoneConfMap:p,fixedWidth:u}=this,m=p[o];if(!m)return(0,e.dK)(["invalid zoneId #2"],3),a(!1),void i(!1);if(this.adBreakStatus)return(0,e.dK)(["repeated calls"]),a(!1),void i(!1);this.adBreakStatus=!0;let g=(e,t)=>{i(e,t),this.adBreakStatus=!1,g=()=>{}};if("reward"!==n||dt()||(g=(t,n)=>{t||"USER_CLOSE"===(null==n?void 0:n.breakStatus)?(i(t,n),this.adBreakStatus=!1):((t,n)=>{const a="registerGptReward: ",{zoneId:i,gptBannerAdUnitCode:o,gptBannerAvgCpm:r,zoneType:d}=t;if(!o)return(0,e.dK)([a,"invalid zone id",i],3),void n(!1);(0,e.dK)([a,"register"]);const s=vt({zoneId:i,zoneType:d});window.googletag=window.googletag||{cmd:[]};const c=window.googletag;c.cmd.push((()=>{const t=c.defineOutOfPageSlot(o,c.enums.OutOfPageFormat.REWARDED);let l=!1;if(t){let o=!1;const p=t=>{clearTimeout(f),o?(0,e.dK)([a,"timeout 2"]):((0,e.dK)([a,"ready"]),t.makeRewardedVisible())},u=()=>{(0,e.dK)([a,"closed"]),h(),_t({adId:s,zoneId:i,zoneType:d,adFormat:"banner",channel:"gpt",cpm:r,currency:"USD"}),n(l)},m=t=>{(0,e.dK)([a,"success"]),l=!!t.payload},g=function(i){t===i.slot&&i.isEmpty&&((0,e.dK)([a,"empty"]),o=!0,h(),n(!1))},h=()=>{clearTimeout(f),c.pubads().removeEventListener("slotRenderEnded",g),c.pubads().removeEventListener("rewardedSlotReady",p),c.pubads().removeEventListener("rewardedSlotClosed",u),c.pubads().removeEventListener("rewardedSlotGranted",m)},f=setTimeout((()=>{(0,e.dK)([a,"timeout"]),o=!0,h(),n(l)}),3e3);c.pubads().addEventListener("slotRenderEnded",g),c.pubads().addEventListener("rewardedSlotReady",p),c.pubads().addEventListener("rewardedSlotClosed",u),c.pubads().addEventListener("rewardedSlotGranted",m),t.addService(c.pubads()),c.display(t)}else(0,e.dK)([a,"no slot"]),n(l)}))})(m,(e=>{i(e,n),this.adBreakStatus=!1})),g=()=>{}}),(0,e.hj)(r)||(t.volume=1),!d){const n=(0,e.SB)();t.theme="black",n||(t.theme="white"),n&&Math.random()>.8&&(t.theme="white")}t.useLoading=!!s,on(t,m,g,c,l,u)}closeAdBreak(t){const{zoneId:n}=t,a=this.zoneConfMap[n];if(!a)return void(0,e.dK)(["invalid zoneId"],3);const i=a.tagList;Array.isArray(i)&&i.forEach((t=>{var n;(n=this.tagMap[t])&&(0,e.mf)(n.close)&&n.close()}))}pauseAdBreak(t){const{zoneId:n}=t,a=this.zoneConfMap[n].tagList;Array.isArray(a)&&a.forEach((t=>{var n;(n=this.tagMap[t])&&(0,e.mf)(n.close)&&(0,e.Kn)(n.ima3)&&"video"===n.module&&(n.ima3.pauseAds(),n.status=h)}))}resumeAdBreak(t){const{zoneId:n}=t,a=this.zoneConfMap[n].tagList;Array.isArray(a)&&a.forEach((t=>{var n;(n=this.tagMap[t])&&(0,e.mf)(n.close)&&(0,e.Kn)(n.ima3)&&"video"===n.module&&(n.ima3.resumeAds(),n.status=g)}))}renderReward(e,t){this.adBreak({zoneId:e,type:"reward",adBreakDone:t,useLoading:!1})}renderFixed(t,n=300,a=250){const i="renderFixed: ",o="ads-tag-fixed";if(!t)return void(0,e.dK)([i,"invalid parameter zoneId"],3);if(document.getElementById(o))return void(0,e.dK)([i,"repeated calls"]);const r=document.createElement("section");r.id=o,r.style.position="fixed",r.style.bottom="15px",r.style.right="15px",r.style.width=n+"px",r.style.height=a+"px",r.style.zIndex="9999",r.style.background="rgba(250, 250, 250, 0.3)",r.style["backdrop-filter"]="blur(24px)",r.innerHTML='<span class="ad-close" style="display:none;width: 14px;height: 14px;background:#fff;text-align: center;line-height:14px;position:absolute;right:0;top:-14px;z-index:9999;color: #bbb; cursor: pointer">x</span><div class="ad-wrap" style="height: 100%;"></div>',document.body.append(r);const d=r.querySelector(".ad-close"),s=r.querySelector(".ad-wrap");d.addEventListener("click",(()=>{this.stopAds(s),setTimeout((()=>{r.remove()}))}),!1),this.renderAds(s,n,a,t),setTimeout((()=>{d.style.display="block"}),5e3)}renderSidewall(t){const n="renderSidewall: ",a="ads-tag-sidewall-left",i="ads-tag-sidewall-right";if(innerWidth<2200||innerHeight<800)return void(0,e.dK)([n,"width < 2000 or height < 800"]);if(!t)return void(0,e.dK)([n,"invalid parameter zoneId"],3);if(document.getElementById(a)||document.getElementById(i))return void(0,e.dK)([n,"repeated calls"]);const o=document.createElement("section");o.id=a,o.style.position="fixed",o.style.top=(innerHeight-600)/2+"px",o.style.left="15px",o.style.width="160px",o.style.height="600px",o.style.zIndex="9999",document.body.append(o),this.renderAds(o,160,600,t);const r=document.createElement("section");r.id=i,r.style.position="fixed",r.style.top=(innerHeight-600)/2+"px",r.style.right="15px",r.style.width="160px",r.style.height="600px",r.style.zIndex="9999",document.body.append(r),this.renderAds(r,160,600,t)}renderAnchor(t,n){const a="renderAnchor: ";if(!t)return void(0,e.dK)([a,"invalid parameter zoneId"],3);const i=this.zoneConfMap[t]||{},{gptBannerAdUnitCode:o,zoneType:r,gptBannerAvgCpm:d}=i;if(5!==r||!o)return void(0,e.dK)([a,"invalid zone id",t],3);if(this.anchorStatus)return void(0,e.dK)([a,"repeated calls"]);const s=vt({zoneId:t,zoneType:r});let c=728,l=90;(0,e.SB)()&&(c=300,l=100),(0,e.dK)([a,"register"]);const p=Je(this.tagMap,i,0),m=[Tt(p,i,n),me(i,"anchor",`${c}x${l}`)];Promise.all(m).then((async n=>{if(!n[0])return(0,e.dK)([a,"register error"],3),void(this.anchorStatus="error");this.anchorStatus="padding",p.slot.setTargeting("adstag_id",p.id),await Ke(p,this.tagMap,i,c,l,((e,t,n)=>{Ze(p,e.body,r),ue(s,p,c,l,r,(e=>{}))}),((e,t,n)=>{Ze(p,e.body,r),_e(s,p,c,l,r,(e=>{}))})),((e,t)=>{const n=window.googletag,a=e.slot,i=function(e){a===e.slot&&(n.pubads().removeEventListener("slotRenderEnded",i),t(!e.isEmpty))};n.pubads().addEventListener("slotRenderEnded",i),a.addService(n.pubads()),n.display(a)})(p,(n=>{p.bidingAdId&&(p.status===u&&re(`${c}x${l}`,p.bidingAdId,!1),delete p.bidingAdId),p.status=g,!p.adManagerCBRuning&&n&&_t({adId:s,zoneId:t,zoneType:r,adFormat:"banner",channel:"gpt",cpm:d,currency:"USD"}),n||(0,e.dK)([a,"Non-GAM empty",t]),this.anchorStatus=n?"success":"error",(0,e.dK)([a,"play status",this.anchorStatus]),delete p.adManagerCB,delete p.adManagerCBRuning}))}))}renderInterstitial(t,n){const a="renderInterstitial: ";if((0,e.dK)([a,"register"]),!t)return void(0,e.dK)([a,"invalid parameter zoneId:"],3);const i=this.zoneConfMap[t]||{},{gptBannerAdUnitCode:o,zoneType:r,gptBannerAvgCpm:d}=i;if(4!==r||!o)return void(0,e.dK)([a,"invalid zone id",t],3);if(this.interstitialStatus)return void(0,e.dK)([a,"repeated calls"]);if(n){const e=document.querySelectorAll(n),t=document.querySelectorAll("a");[].forEach.call(t,(t=>{-1===[].indexOf.call(e,t)&&t.setAttribute("data-google-interstitial","false")}))}const s=vt({zoneId:t,zoneType:r}),c=300,l=250,p=Je(this.tagMap,i,0),u=[At(p,i),me(i,"webInterstitial","300x250")];this.interstitialStatus="padding",Promise.all(u).then((async n=>{if(!n[0])return(0,e.dK)([a,"register error"],3),void(this.interstitialStatus="error");let o;p.slot.setTargeting("adstag_id",p.id),await Ke(p,this.tagMap,i,c,l,((e,t,n)=>{Ze(p,e.body,r),this.interstitialStatus="success",ue(s,p,c,l,r,(()=>{o=()=>{p.status=g}}))}),((e,t,n)=>{Ze(p,e.body,r),this.interstitialStatus="success",_e(s,p,c,l,r,(()=>{o=()=>{p.status=g}}))}),((e,t,n)=>{Ze(p,e.body,r),this.interstitialStatus="success",J(s,"webInterstitial",p,t,n,r,(e=>{e&&(p.status=h,p.ima3.pauseAds()),o=()=>{p.status=g,p.ima3.resumeAds()}}),(()=>{}),((e,t)=>{p.status!==g&&(p.status=h,p.ima3.pauseAds()),e+1.5>=t&&(p.status=h,p.ima3.pauseAds())}))})),Et(p,(()=>{o?o():_t({adId:s,zoneId:t,zoneType:r,adFormat:"banner",channel:"gpt",cpm:d,currency:"USD"})}))}))}async renderAds(t,n,a,i,o){const r="renderAds: ";if((0,e.mf)(o)||(o=()=>{}),!t||!t.nodeName)return(0,e.dK)([r,"invalid parameter ads container ",i],3),void o(!1);if(Xe(t))return(0,e.dK)(["element already used",i],2),void o(!1);if(i||(i=this.defaultZoneId),!i)return(0,e.dK)([r,"invalid parameter zoneId"],3),void o(!1);const d=this.zoneConfMap[i];if(!(n&&(0,e.hj)(n)&&a&&(0,e.hj)(a)))return(0,e.dK)([r,"invalid parameter width or height ",i],3),void o(!1);const s=this.zoneConfMap[i]||{};let{gptBannerAdUnitCode:c,refreshConfig:l,videoFirst:p}=s;const{gptConf:u}=this.siteConf;if(!c||!l)return(0,e.dK)([r,"invalid zone id ",i],3),void o(!1);const m=Je(this.tagMap,d,0,t,n,a,p,o),g=[];g.push(zt(c,m,n,a,this.fixedWidth)),g.push(me(d,m.domId,`${n}x${a}`)),await Promise.all(g).then((e=>{m.slot=e[0],m.slot.setTargeting("adstag_id",m.id)})),this.refreshAds(m.id),p&&setInterval((()=>{(()=>{if(!q.usable)return!1;q.brideCacheList=L(q.brideCacheList);const e=O(q.brideCacheList);return q.ready&&e.length>0})()&&"video"!==m.module&&this.refreshAds(m.id)}),1500)}stopAds(t){if(!t)return void(0,e.dK)(["invalid parameter dom"],3);const{tagMap:n}=this;Object.keys(n).forEach((e=>{const a=n[e];Xe(t)===a.id&&(et(this.tagMap,a.id,t),t.innerHTML="")}))}}const dn={apiKey:"AIzaSyBdYwdqSPEwZWU4cH6_PlGOewsx-hksZzA",authDomain:"gamebridge-1e035.firebaseapp.com",projectId:"gamebridge-1e035",storageBucket:"gamebridge-1e035.appspot.com",messagingSenderId:"686727150019",appId:"1:686727150019:web:2ca3e188f14d3d9c592576",measurementId:"G-1XSLWP0GSQ"},sn=[];(async()=>{try{window.sessionStorage}catch(e){console.error("Storage is not available, please open Storage 2")}at()||localStorage.setItem(C,(new Date).getTime().toString()),function(){const n=["init","renderAds","renderInterstitial","renderAnchor","renderReward","getPrebidVideoBride","adBreak","stopAds","getZoneInfo","sendBI","sendGTM","setTargeting","debug","renderFixed","renderSidewall","closeAdBreak","pauseAdBreak","resumeAdBreak"];if(window.adsTag=window.adsTag||{cmd:[]},!window.adsTag.init){const a={version:t,ready:!1,cmd:window.adsTag&&window.adsTag.cmd,system:(0,e.Os)()};n.forEach((e=>{a[e]=function(){sn.push({fn:e,arguments})}})),window.adsTag=a}}();localStorage.getItem(o)!==r&&((0,e.dK)(["sdk flag change, clear cache"],2),localStorage.setItem(o,r),sessionStorage.removeItem(I));try{const t=(0,e.k5)(window.location.search),i=document.getElementById(a);if(!i)return void(0,e.dK)(["adsTag script not found"],3);const o=i.getAttribute("data-site-id"),r=i.getAttribute("data-zone-id"),d=i.getAttribute("data-utm-source")||t.utm_source||t["channel-id"];d&&gt(d);const s=i.getAttribute("data-title")||t.title;s&&wt(s);const{siteConfig:c,zoneConfigMap:l,parentHaveAdsTag:p,uid:u}=await Ge(o)||{};if(!c||!l||!u)return void(0,e.dK)(["adsTag init error"],3);const m=window.adsTag.cmd||[];window.adsTag=new rn(c,l,r,p),yt("sdk_ready",{}),(0,e.dK)(["adsTag","ready"]),m.forEach((e=>{window.adsTag.cmd.push(e)})),sn.length&&sn.forEach((e=>{window.adsTag[e.fn](...e.arguments)})),(e=>{if(e)return;const t="ads-tag-user-time-second";let n=parseInt(sessionStorage.getItem(t)||"0");const a=setInterval((()=>{document.hidden||(n+=10,n<=120?(T(`user_time_second_${n.toString()}`,{event_category:"time",event_label:n.toString()}),sessionStorage.setItem(t,n.toString())):clearInterval(a))}),1e4)})(p),(e=>{if(e)return;const t="ads-tag-user-first-day",n="ads-tag-user-last-day",a=Date.now(),i=localStorage.getItem(t),o=localStorage.getItem(n);if(!i)return localStorage.setItem(t,a.toString()),localStorage.setItem(n,"0"),void T("user_day_0",{event_category:"day",event_label:"0"});let r=parseInt(i),d=parseInt(o);const s=Math.floor((a-r)/864e5);if(-1!==[0,1,3,5,7,10,15,20,30].indexOf(s)&&s>d){const e=s.toString();localStorage.setItem(n,e),T(`user_day_${e}`,{event_category:"day",event_label:e})}})(p),(e=>{if(e)return;const t="game-bridge-session-begin-time",n="game-bridge-session-send-time-num";let a=parseInt(sessionStorage.getItem(t)||"0");a||(a=Date.now(),sessionStorage.setItem(t,a.toString())),setInterval((()=>{if(!document.hidden){const e=parseInt(sessionStorage.getItem(n)||"0")+1;a+60*e*1e3<=Date.now()&&(-1!==[1,2,3,5,7,10,15,20,30].indexOf(e)&&T(`user_time_${e.toString()}`,{event_category:"time",event_label:e.toString()}),sessionStorage.setItem(n,e.toString()))}}),1e4)})(p),(t=>{const a="registerSubscription";if(window!==window.top)return void(0,e.dK)([a,"window not top",nt()],2);const{enable:i}=window.__siteConf.subscribe;if(!i)return void(0,e.dK)([a,"domain error",nt()],2);if(!navigator.serviceWorker||!window.Notification||"default"!==window.Notification.permission)return void(0,e.dK)([a,"rejected"]);new Promise((e=>{const t=document.createElement("script");t.async=!0,t.src="https://cdn.beesads.com/firebase/9.22.2/firebase-app-compat.js",t.type="module",t.onload=function(){const t=document.createElement("script");t.async=!0,t.src="https://cdn.beesads.com/firebase/9.22.2/firebase-messaging-compat.js",t.type="module",t.onload=function(){e(null)},document.head.append(t)},document.head.append(t)})).then((()=>{const i=window.firebase.initializeApp(dn),o=window.firebase.messaging(i);Notification.requestPermission((function(i){o.getToken(o,{vapidKey:"BLVnNA_3gu4gTe9DjU4EJmbXYELwEDfeFo_QvD280hqH3ecZiAdHYDIbgTyP_54Koq7BfG0IgsObiNBJ8YPRpeI"}).then((i=>{i&&fetch(`${(0,e.Oq)(n)}/register?token=${i}&uid=${t}`,{method:"POST",mode:"cors",cache:"no-cache",credentials:"include"}).then((()=>{(0,e.dK)([a,"success"])}))})).catch((t=>{(0,e.dK)([a,"error"])}))}))}))})(u),(e=>{e||(yt("heartbeat",{}),setInterval((()=>{document.hidden||yt("heartbeat",{})}),1e4))})(p)}catch(e){console.error("adsTag request config error!",e)}})()})()})();