!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).VmaxGoogleIMA=t()}(this,(function(){"use strict";function e(e,t,i,n){return new(i||(i=Promise))((function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))}function t(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}function i(e,t,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,i):s?s.value=i:t.set(e,i),i}function n(...e){console.log.apply(console,e)}function s(...e){console.error.apply(console,e)}"function"==typeof SuppressedError&&SuppressedError;const r=e=>"string"==typeof e&&e.length>0;var o,a,l,d,h,c,f,u,v,E,p,m,g,A,T,w,y,I,k,S,R,D,O,_,b;class L{constructor(e){var n;(o.add(this),a.set(this,void 0),l.set(this,void 0),d.set(this,[]),h.set(this,[]),c.set(this,[]),f.set(this,[]),u.set(this,"hidden"),v.set(this,null),E.set(this,null),p.set(this,!0),m.set(this,null),e instanceof HTMLElement)?(i(this,a,(n=t(this,o,"m",g).bind(this),new IntersectionObserver(n,{root:null,rootMargin:"0px",threshold:.5})),"f"),i(this,l,e,"f"),t(this,a,"f").observe(e),i(this,u,function(e){let t="hidden",i="visibilitychange";const n=window.document;return void 0!==n[t]?(t="hidden",i="visibilitychange"):void 0!==n.msHidden?(t="msHidden",i="msvisibilitychange"):void 0!==n.webkitHidden?(t="webkitHidden",i="webkitvisibilitychange"):void 0!==n.oHidden?(t="oHidden",i="ovisibilitychange"):void 0!==n.mozHidden?(t="mozHidden",i="mozvisibilitychange"):void 0!==n.khtmlHidden&&(t="khtmlHidden",i="khtmlvisibilitychange"),n.addEventListener(i,e,!0),t}(t(this,o,"m",A).bind(this)),"f"),function(e){window.addEventListener("focus",e),window.addEventListener("pageshow",e)}(t(this,o,"m",T).bind(this)),function(e){window.addEventListener("blur",e),window.addEventListener("pagehide",e)}(t(this,o,"m",w).bind(this)),this.check()):function(...e){console.warn.apply(console,e)}("Container must be a valid HTMLElement")}destroy(){var e;null===(e=t(this,a,"f"))||void 0===e||e.unobserve(t(this,l,"f")),i(this,d,[],"f"),i(this,h,[],"f"),i(this,c,[],"f"),i(this,f,[],"f"),i(this,v,null,"f"),i(this,E,null,"f"),i(this,p,null,"f"),clearInterval(t(this,m,"f"))}check(){t(this,o,"m",A).call(this)}enter(e){if("function"!=typeof e)throw new Error("Callback must be a function");return t(this,d,"f").push(e),this}exit(e){if("function"!=typeof e)throw new Error("Callback must be a function");return t(this,h,"f").push(e),this}enterOnce(e){if("function"!=typeof e)throw new Error("Callback must be a function");return t(this,c,"f").push(e),this}exitOnce(e){if("function"!=typeof e)throw new Error("Callback must be a function");return t(this,f,"f").push(e),this}}a=new WeakMap,l=new WeakMap,d=new WeakMap,h=new WeakMap,c=new WeakMap,f=new WeakMap,u=new WeakMap,v=new WeakMap,E=new WeakMap,p=new WeakMap,m=new WeakMap,o=new WeakSet,g=function(e){var n;const s=null===(n=null==e?void 0:e[0])||void 0===n?void 0:n.isIntersecting;"boolean"==typeof s&&(i(this,v,!0===s,"f"),t(this,o,"m",y).call(this))},A=function(){const e=window.document;i(this,E,!1===(null==e?void 0:e[t(this,u,"f")])||"visible"===(null==e?void 0:e.visibilityState),"f"),t(this,o,"m",y).call(this)},T=function(){i(this,E,!0,"f"),t(this,o,"m",y).call(this)},w=function(){const e=window.document;clearInterval(t(this,m,"f")),i(this,m,setTimeout((()=>{!1===(!1===(null==e?void 0:e[t(this,u,"f")])||"visible"===(null==e?void 0:e.visibilityState))&&(i(this,E,!1,"f"),t(this,o,"m",y).call(this))}),1),"f")},y=function(){const e=t(this,v,"f")&&t(this,E,"f");if(t(this,p,"f")===e)return;const n=t(this,v,"f")&&t(this,E,"f"),s=t(this,n?d:h,"f"),r=t(this,n?c:f,"f");s.forEach((e=>e())),r.forEach((e=>e())),i(this,n?c:f,[],"f"),i(this,p,e,"f")},function(e){e.errorCode="{errorcode}",e.noFill="",e.noFillError="[nofill.error]",e.demandPartnerSDKVersion="[demand.partner.sdkversion]",e.eventName="[event.name]",e.vastErrorCode="[vast.error]",e.OmidSDKVersion="[omid.partner.sdkversion]",e.eventAttribute1="[event.attribute1]",e.eventAttribute2="[event.attribute2]",e.eventAttribute3="[event.attribute3]",e.randomCcb="[random.ccb]",e.deviceIFA="[device.ifa]"}(I||(I={})),function(e){e.AD_READY="adReady",e.AD_IMPRESSION="adImpression",e.AD_RENDERED="adRendered",e.AD_REFRESHED="adRefreshed",e.AD_ERROR="adError",e.AD_CLOSED="adClosed",e.AD_CLICKED="adClicked",e.AD_SKIPPED="adSkipped",e.AD_SKIPPABLE_STATE_CHANGE="adSkippableStateChange",e.AD_PAUSED="adPaused",e.AD_RESUMED="adResumed",e.AD_VIDEO_START="adVideoStart",e.AD_VIDEO_FIRST_QUARTILE="adVideoFirstQuartile",e.AD_VIDEO_MIDPOINT="adVideoMidpoint",e.AD_VIDEO_THIRD_QUARTILE="adVideoThirdQuartile",e.AD_VIDEO_COMPLETE="adVideoComplete",e.AD_VOLUME_CHANGED="adVolumeChanged",e.AD_MUTED="adMuted",e.AD_UNMUTED="adUnmuted",e.AD_PROGRESS="adProgress",e.AD_USER_CLOSE="adUserClose",e.AD_INSERTION_START="adInsertionStart",e.AD_INSERTION_END="adInsertionEnd",e.AD_MEDIA_EXPAND="onFullScreen",e.AD_MEDIA_COLLAPSE="onExitFullScreen"}(k||(k={})),function(e){e.PERSONAL_COMPUTER="2",e.CONNECTED_TV="3",e.PHONE="4",e.TABLET="5",e.CONNECTED_DEVICE="6",e.SET_TOP_BOX="7"}(S||(S={})),function(e){e.GEO_PROFILE="geoProfile",e.USER_PROFILE="userProfile"}(R||(R={})),function(e){e.APP_ID="appId",e.ACCOUNT_KEY="accountKey",e.SECRET_KEY="secretKey",e.SDK_INITIALIZED="sdkInitialized",e.GEO_PROFILE="geoProfile",e.USER_PROFILE="userProfile",e.IS_APP="isApp"}(D||(D={})),function(e){e.UID="uid",e.GENDER="gender",e.AGE="age",e.COUNTRY="country",e.REGION="region",e.CITY="city",e.ZIPCODE="zip",e.KEYWORDS="keywords"}(O||(O={})),function(e){e.PLAY_ONCE="play_once",e.REPEAT="repeat"}(_||(_={}));class P{constructor(){b.set(this,new Map)}static getInstance(){return P.instance}set(e,i){"object"!=typeof e?t(this,b,"f").set(e,i):Object.entries(e).forEach((([e,i])=>{const n=r(i)||(e=>"number"==typeof e)(i)||(e=>"boolean"==typeof e)(i);n&&t(this,b,"f").set(e,i)}))}get(e){var i;return"string"!=typeof e||0==e.length?t(this,b,"f"):null!==(i=t(this,b,"f").get(e))&&void 0!==i?i:null}get isSDKInitialized(){return Boolean(t(this,b,"f").get(D.SDK_INITIALIZED))}}b=new WeakMap,P.instance=new P;const C=P.getInstance();var M,N,U,W;class x{static post(t){return e(this,void 0,void 0,(function*(){const{url:e,payload:i,headers:s={},credentials:r}=t||{};let o={method:"POST",body:JSON.stringify(i)};return r&&(o.credentials=r),s&&(o.headers=s),fetch(e,o).then((e=>e.json())).catch((e=>(n("Error in Fetch.post",e),Promise.reject(e))))}))}static get(t){return e(this,arguments,void 0,(function*(e,t={}){return fetch(e,t).then((e=>e.json()))}))}static DeviceGeoService(){const e=C.get(D.ACCOUNT_KEY),t="https://dgs.vmax.com/ACCOUNT_KEY".replace("ACCOUNT_KEY",e);return M.get(t)}static UserProfileService(e,t){const i=C.get(D.ACCOUNT_KEY),n="https://ups.vmax.com/ACCOUNT_KEY/".replace("ACCOUNT_KEY",i);return M.post({url:n,headers:{"X-AUTH":t},payload:e})}static AdQuery(e){const{ACCOUNT_KEY:t}=D,i=C.get(t)||"";return M.post({url:"https://as.vmax.com/account-key/adspot/1.0.1/query/".replace("account-key",i),payload:e,credentials:"include"})}static replaceAllMacros(e,t){const i=Object.keys(I);if(0===i.length)return e;const{ifa:n=""}=window.VmaxAdManager.getDevice().getPayload();return i.forEach((i=>{var s;const r=I[i];let o;o=r===I.randomCcb?Date.now().toString():r===I.deviceIFA?n:t&&(null===(s=t[r])||void 0===s?void 0:s.toString())||"";const a=new RegExp(this.escapeRegExp(r),"g");e=e.replace(a,o)})),t||i.forEach((t=>{const i=I[t],n=new RegExp(this.escapeRegExp(i),"g");e=e.replace(n,"")})),e}static escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static FireTracker(i,n){return e(this,void 0,void 0,(function*(){if(!r(i)&&(e=i,!Array.isArray(e)))return Promise.reject("No url to fire tracker");var e;for(let e of i)e=this.replaceAllMacros(e,n),yield t(M,M,"m",N).call(M,e)}))}}M=x,N=function(t){return e(this,void 0,void 0,(function*(){try{const e=window.VmaxAdManager.getSite().getPayload(),{pageUrl:i,referrerUrl:r}=e,o=yield fetch(t,{method:"GET",headers:{Connection:"keep-alive","X-Requested-with":`${i}`},credentials:"include"});o.ok?n("Tracker fired successfully."):s("Tracker request failed:",o.status,o.statusText)}catch(e){s("Error while firing the tracker:",e)}}))};class F{constructor(e=new Map){U.set(this,new Map),i(this,U,e,"f")}fireTracker(e,i){const n=t(this,U,"f").get(e);n&&x.FireTracker(n,i)}}U=new WeakMap,function(e){e.IMPRESSION="impression",e.NO_FILL="nofill",e.FILL="fill",e.CLICK="click",e.ERROR="error",e.START="start",e.FIRST_QUARTILE="firstQuartile",e.MIDPOINT="midpoint",e.THIRD_QUARTILE="thirdQuartile",e.COMPLETE="complete",e.PAUSE="pause",e.RESUME="resume",e.SKIP="skip",e.MUTE="mute",e.UNMUTE="unmute",e.SKIPPABLE_STATE_CHANGE="skippableStateChange"}(W||(W={}));var K,V,H,j,G,Q,Y,z,B,q,$,X,Z,J,ee,te,ie,ne,se,re,oe,ae,le,de,he,ce,fe,ue,ve,Ee,pe,me,ge,Ae,Te,we=W;return V=new WeakMap,H=new WeakMap,j=new WeakMap,G=new WeakMap,Q=new WeakMap,Y=new WeakMap,z=new WeakMap,B=new WeakMap,q=new WeakMap,$=new WeakMap,X=new WeakMap,Z=new WeakMap,J=new WeakMap,ee=new WeakMap,te=new WeakMap,ie=new WeakMap,ne=new WeakMap,se=new WeakMap,K=new WeakSet,re=function(e){const n=document.createElement("style");n.textContent="\n .vmax-gam-circular-loader {\n border: 4px solid rgba(0, 0, 0, 0.1); /* Light gray background */\n border-top: 4px solid grey; /* Blue spinner */\n border-radius: 50%;\n width: 30px;\n height: 30px;\n animation: spin 1s linear infinite;\n\n /* Positioning to center within the container */\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n /* Spin Animation */\n @keyframes spin {\n to { transform: translate(-50%, -50%) rotate(360deg); }\n }\n ",document.head.appendChild(n);const s=document.createElement("div");s.classList.add("vmax-gam-circular-loader"),t(this,H,"f").style.position="relative",t(this,H,"f").appendChild(s),i(this,se,s,"f"),t(this,K,"m",ae).call(this)},oe=function(){t(this,se,"f")&&(console.log("Showing Loader"),t(this,se,"f").style.display="block")},ae=function(){t(this,se,"f")&&(t(this,se,"f").style.display="none")},le=function(){t(this,K,"m",de).call(this,"7")},de=function(e){t(this,J,"f").fireTracker(we.NO_FILL,{[I.noFill]:e,[I.noFillError]:e}),this.cleanup()},he=function(){i(this,X,new L(t(this,H,"f")),"f"),t(this,X,"f").enter(t(this,K,"m",fe).bind(this)),t(this,X,"f").exit(t(this,K,"m",ce).bind(this))},ce=function(){var e;t(this,ie,"f")||(i(this,ne,!0,"f"),null===(e=t(this,z,"f"))||void 0===e||e.pause())},fe=function(){var e;t(this,ie,"f")||(i(this,ne,!1,"f"),null===(e=t(this,z,"f"))||void 0===e||e.resume())},ue=function(){const{IMPRESSION:e,NO_FILL:n,FILL:s}=we,{burl:r="",nurl:o="",lurl:a=""}=t(this,V,"f")||{};r&&t(this,B,"f").set(e,[r]),a&&t(this,B,"f").set(n,[a]),o&&t(this,B,"f").set(s,[o]),t(this,te,"f")&&t(this,B,"f").set(we.CLICK,t(this,te,"f")),i(this,J,new F(t(this,B,"f")),"f")},ve=function(){i(this,Q,new google.ima.AdDisplayContainer(t(this,H,"f")),"f"),t(this,Q,"f").initialize()},Ee=function(){i(this,Y,new google.ima.AdsLoader(t(this,Q,"f")),"f")},pe=function(){const e=new google.ima.AdsRequest,i=function(e,t){const i=Object.keys(I);return 0===i.length||i.forEach((i=>{var n;const s=I[i],r=s===I.randomCcb?Date.now().toString():t&&(null===(n=t[s])||void 0===n?void 0:n.toString())||"",o=new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g");e=e.replace(o,r)})),e}(t(this,G,"f"),{[I.demandPartnerSDKVersion]:t(this,ee,"f")});e.adTagUrl=i,e.linearAdSlotWidth=t(this,H,"f").offsetWidth||640,e.linearAdSlotHeight=t(this,H,"f").offsetHeight||400,t(this,Y,"f").requestAds(e)},me=function(e,n){const s=new google.ima.AdsRenderingSettings;s.enablePreloading=!0,i(this,z,e.getAdsManager(null,s),"f"),t(this,z,"f").addEventListener(google.ima.AdEvent.Type.LOADED,t(this,K,"m",Ae).bind(this)),t(this,z,"f").addEventListener(google.ima.AdEvent.Type.IMPRESSION,(e=>{var i;const n=t(this,K,"m",ge).call(this,e);t(this,J,"f").fireTracker(we.FILL),t(this,J,"f").fireTracker(we.IMPRESSION),null===(i=t(this,Z,"f"))||void 0===i||i.AdImpression(n)})),t(this,z,"f").addEventListener(google.ima.AdEvent.Type.STARTED,(e=>{var i,n;t(this,K,"m",ae).call(this);const s=t(this,K,"m",ge).call(this,e);t(this,J,"f").fireTracker(we.START),null===(n=null===(i=t(this,Z,"f"))||void 0===i?void 0:i.AdVideoStart)||void 0===n||n.call(i,s)})),t(this,z,"f").addEventListener(google.ima.AdEvent.Type.COMPLETE,(e=>{var i,n;const s=t(this,K,"m",ge).call(this,e);t(this,J,"f").fireTracker(we.COMPLETE),null===(n=null===(i=t(this,Z,"f"))||void 0===i?void 0:i.AdVideoComplete)||void 0===n||n.call(i,s)})),t(this,z,"f").addEventListener(google.ima.AdEvent.Type.PAUSED,(e=>{var i,n;const s=t(this,K,"m",ge).call(this,e);t(this,J,"f").fireTracker(we.PAUSE),null===(n=null===(i=t(this,Z,"f"))||void 0===i?void 0:i.AdPaused)||void 0===n||n.call(i,s)})),t(this,z,"f").addEventListener(google.ima.AdEvent.Type.RESUMED,(e=>{var i,n;const s=t(this,K,"m",ge).call(this,e);t(this,J,"f").fireTracker(we.RESUME),null===(n=null===(i=t(this,Z,"f"))||void 0===i?void 0:i.AdResumed)||void 0===n||n.call(i,s)})),t(this,z,"f").addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,(e=>{this.cleanupAndCloseAd(e)})),t(this,z,"f").addEventListener(google.ima.AdEvent.Type.CLICK,(e=>{var i,n;const s=t(this,K,"m",ge).call(this,e);t(this,J,"f").fireTracker(we.CLICK),null===(n=null===(i=t(this,Z,"f"))||void 0===i?void 0:i.AdClicked)||void 0===n||n.call(i,s)})),t(this,z,"f").addEventListener(google.ima.AdEvent.Type.FIRST_QUARTILE,(e=>{var i,n;const s=t(this,K,"m",ge).call(this,e);t(this,J,"f").fireTracker(we.FIRST_QUARTILE),null===(n=null===(i=t(this,Z,"f"))||void 0===i?void 0:i.AdVideoFirstQuartile)||void 0===n||n.call(i,s)})),t(this,z,"f").addEventListener(google.ima.AdEvent.Type.MIDPOINT,(e=>{var i,n;const s=t(this,K,"m",ge).call(this,e);t(this,J,"f").fireTracker(we.MIDPOINT),null===(n=null===(i=t(this,Z,"f"))||void 0===i?void 0:i.AdVideoMidpoint)||void 0===n||n.call(i,s)})),t(this,z,"f").addEventListener(google.ima.AdEvent.Type.THIRD_QUARTILE,(e=>{var i,n;const s=t(this,K,"m",ge).call(this,e);t(this,J,"f").fireTracker(we.THIRD_QUARTILE),null===(n=null===(i=t(this,Z,"f"))||void 0===i?void 0:i.AdVideoThirdQuartile)||void 0===n||n.call(i,s)})),t(this,z,"f").addEventListener(google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,(e=>{var i,n;const s=t(this,K,"m",ge).call(this,e);t(this,J,"f").fireTracker(we.SKIPPABLE_STATE_CHANGE),null===(n=null===(i=t(this,Z,"f"))||void 0===i?void 0:i.AdSkippableStateChange)||void 0===n||n.call(i,s)})),t(this,z,"f").addEventListener(google.ima.AdEvent.Type.SKIPPED,(e=>{var i,n;const s=t(this,K,"m",ge).call(this,e);t(this,J,"f").fireTracker(we.SKIP),null===(n=null===(i=t(this,Z,"f"))||void 0===i?void 0:i.AdSkipped)||void 0===n||n.call(i,s)})),t(this,z,"f").addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>{t(this,K,"m",Te).bind(this,e,n)}))},ge=function(e){var t;const{currentTime:i=null,duration:n=null}=e&&e.getAdData()||{},s=(null===(t=null==e?void 0:e.getAd())||void 0===t?void 0:t.data)||{},{skipTimeOffset:r=null}=s,o=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s{})),$.set(this,(()=>{})),X.set(this,void 0),Z.set(this,void 0),J.set(this,void 0),this.shouldProcessRefresh=!1,ee.set(this,void 0),this.canRefresh=!1,te.set(this,void 0),ie.set(this,void 0),ne.set(this,void 0),se.set(this,void 0)}getAllSignatures(){return"nw.imavideo"}prepare(e){return new Promise(((n,s)=>{var r;try{const{bid:o,container:a,listeners:l}=e||{};i(this,H,a,"f"),t(this,K,"m",re).call(this,t(this,H,"f")),i(this,V,o,"f"),i(this,Z,l,"f");const d=(null===(r=t(this,V,"f"))||void 0===r?void 0:r.adm)||"";if(!d)return s("No ad object found");const h=JSON.parse(d),{ad_tag_url:c}=null==h?void 0:h.adnetwork_params;if(i(this,te,(null==h?void 0:h.adnetwork_params["click-url"])||"","f"),t(this,K,"m",ue).call(this),!c)return t(this,K,"m",de).call(this,"7"),s("No Ad Tag URL");i(this,G,c+"?"+Date.now(),"f");const{AdPaused:f,AdResumed:u}=l||{};"function"==typeof f&&i(this,$,f,"f"),"function"==typeof u&&i(this,q,u,"f"),t(this,K,"m",ve).call(this),t(this,K,"m",Ee).call(this),t(this,K,"m",he).call(this),i(this,ee,t(this,Y,"f").getVersion(),"f"),t(this,Y,"f").addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(e=>{t(this,K,"m",me).call(this,e,s),n()}),!1),t(this,Y,"f").addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>{t(this,K,"m",le).call(this),s(e.getError())}),!1),t(this,K,"m",pe).call(this)}catch(e){console.warn("VmaxGoogleIMA: Error in prepare",e),t(this,K,"m",de).call(this,"2"),s(e)}}))}render(e){if(!t(this,z,"f"))return Promise.reject("Ads Manager not initialized");try{t(this,K,"m",oe).call(this),t(this,z,"f").init(t(this,H,"f").offsetWidth||640,t(this,H,"f").offsetHeight||400,google.ima.ViewMode.NORMAL),t(this,z,"f").start()}catch(e){return console.debug("Error during Ad Manager initialization:",e),t(this,J,"f").fireTracker(we.ERROR),t(this,K,"m",de).call(this,"6"),t(this,K,"m",ae).call(this),Promise.reject("Failed to start ads")}return Promise.resolve()}cleanupAndCloseAd(e){var i,n,s;null===(i=t(this,Q,"f"))||void 0===i||i.destroy(),t(this,K,"m",ae).call(this);const r=t(this,K,"m",ge).call(this,e);null===(s=null===(n=t(this,Z,"f"))||void 0===n?void 0:n.AdClosed)||void 0===s||s.call(n,r),setTimeout((()=>{this.destroy()}),1e3)}cleanup(){var e;null===(e=t(this,Q,"f"))||void 0===e||e.destroy(),setTimeout((()=>{this.destroy()}),1e3)}destroy(){var e;return t(this,z,"f")&&t(this,z,"f").destroy(),null===(e=t(this,X,"f"))||void 0===e||e.destroy(),i(this,X,null,"f"),Promise.resolve()}closeAd(){this.destroy(),this.canRefresh=!1}getVmaxAdInfo(){const e=function(e){var t,i,n;const{ext:s}=e||{},r=s&&s["ad-meta"]||{},{id:o="",name:a=""}=r,l=r["campaign-meta"]||{},{id:d="",name:h="",marketer:c={},order:f={}}=l,{id:u="",name:v="",agency:E="",brand:p=""}=c||{},{id:m="",name:g=""}=f;return{adId:o,adName:a,campaignId:d,campaignName:h,marketerId:u,marketerName:v,brand:p,agency:E,orderId:m,orderName:g,signature:(null===(n=null===(i=null===(t=null==e?void 0:e.ext)||void 0===t?void 0:t.modules)||void 0===i?void 0:i.render)||void 0===n?void 0:n.signature)||""}}(t(this,V,"f"));return Object.assign({},e)}pauseAd(){var e;return t(this,z,"f")&&(t(this,z,"f").pause(),i(this,ie,!0,"f")),null===(e=t(this,J,"f"))||void 0===e||e.fireTracker(we.PAUSE),Promise.resolve()}resumeAd(){var e;if(t(this,ie,"f"))return t(this,z,"f")&&(t(this,z,"f").resume(),i(this,ie,!1,"f")),null===(e=t(this,J,"f"))||void 0===e||e.fireTracker(we.RESUME),Promise.resolve()}}}));