-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.js
1 lines (1 loc) · 26.3 KB
/
index.js
1
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=6)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("prop-types")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(r(1)),i=o(r(3));function o(e){return e&&e.__esModule?e:{default:e}}t.default=n.default.shape({path:n.default.string,targeting:n.default.object,prebid:n.default.shape({debug:n.default.bool,bidderTimeout:n.default.number,enableSendAllBids:n.default.bool,bidderSequence:n.default.oneOf(["random","fixed"]),publisherDomain:n.default.string,cookieSyncDelay:n.default.number,priceGranularity:n.default.oneOfType([n.default.oneOf(["low","medium","high","auto","dense"]),n.default.shape({buckets:n.default.arrayOf(n.default.shape({precision:n.default.number,min:n.default.number.isRequired,max:n.default.number.isRequired,increment:n.default.number.isRequired})).isRequired})]),mediaTypePriceGranularity:n.default.shape({video:n.default.oneOfType([n.default.oneOf(["low","medium","high","auto","dense"]),n.default.shape({buckets:n.default.arrayOf(n.default.shape({precision:n.default.number,min:n.default.number.isRequired,max:n.default.number.isRequired,increment:n.default.number.isRequired})).isRequired})]),banner:n.default.oneOfType([n.default.oneOf(["low","medium","high","auto","dense"]),n.default.shape({buckets:n.default.arrayOf(n.default.shape({precision:n.default.number,min:n.default.number.isRequired,max:n.default.number.isRequired,increment:n.default.number.isRequired})).isRequired})]),native:n.default.oneOfType([n.default.oneOf(["low","medium","high","auto","dense"]),n.default.shape({buckets:n.default.arrayOf(n.default.shape({precision:n.default.number,min:n.default.number.isRequired,max:n.default.number.isRequired,increment:n.default.number.isRequired})).isRequired})])}),sizeConfig:n.default.arrayOf(n.default.shape({mediaQuery:n.default.string.isRequired,sizesSupported:n.default.arrayOf(n.default.oneOfType([n.default.string,n.default.arrayOf(n.default.number)])),labels:n.default.arrayOf(n.default.string)}))}),sizeMappings:n.default.objectOf(n.default.arrayOf(n.default.shape({viewPortSize:n.default.arrayOf(n.default.number).isRequired,sizes:n.default.arrayOf(n.default.oneOfType([n.default.string,n.default.arrayOf(n.default.number)])).isRequired}))),slots:n.default.arrayOf(i.default),customEvents:n.default.objectOf(n.default.shape({eventMessagePrefix:n.default.string.isRequired,divIdPrefix:n.default.string}))})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(1),o=(n=i)&&n.__esModule?n:{default:n};t.default=o.default.shape({id:o.default.string.isRequired,path:o.default.string,collapseEmptyDiv:o.default.arrayOf(o.default.bool),targeting:o.default.object,sizes:o.default.oneOfType([o.default.oneOfType([o.default.string,o.default.arrayOf(o.default.number)]),o.default.arrayOf(o.default.oneOfType([o.default.string,o.default.arrayOf(o.default.number)]))]),sizeMappingName:o.default.string,prebid:o.default.arrayOf(o.default.shape({mediaTypes:o.default.objectOf(o.default.shape({sizes:o.default.arrayOf(o.default.arrayOf(o.default.number))})).isRequired,bids:o.default.arrayOf(o.default.shape({bidder:o.default.string.isRequired,params:o.default.object,labelAny:o.default.arrayOf(o.default.string),labelAll:o.default.arrayOf(o.default.string)})).isRequired}))})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),o=(n=i)&&n.__esModule?n:{default:n};t.default=o.default.createContext(function(){})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=a(r(0)),o=a(r(4));function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){return function(t){return i.default.createElement(o.default.Consumer,null,function(r){var o=r.activate,a=r.active,u=r.shouldRefresh;return i.default.createElement(e,n({},t,{activate:o,active:a,shouldRefresh:u}))})}}},function(e,t,r){r(7),e.exports=r(9)},function(e,t,r){"use strict";(function(e){var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(r){var n,i=Object.prototype,o=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag",l="object"===t(e),c=r.regeneratorRuntime;if(c)l&&(e.exports=c);else{(c=r.regeneratorRuntime=l?e.exports:{}).wrap=O;var d="suspendedStart",p="suspendedYield",h="executing",v="completed",y={},g={};g[u]=function(){return this};var m=Object.getPrototypeOf,b=m&&m(m(T([])));b&&b!==i&&o.call(b,u)&&(g=b);var w=P.prototype=j.prototype=Object.create(g);k.prototype=w.constructor=P,P.constructor=k,P[f]=k.displayName="GeneratorFunction",c.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===k||"GeneratorFunction"===(t.displayName||t.name))},c.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,P):(e.__proto__=P,f in e||(e[f]="GeneratorFunction")),e.prototype=Object.create(w),e},c.awrap=function(e){return{__await:e}},E(x.prototype),x.prototype[s]=function(){return this},c.AsyncIterator=x,c.async=function(e,t,r,n){var i=new x(O(e,t,r,n));return c.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},E(w),w[f]="Generator",w[u]=function(){return this},w.toString=function(){return"[object Generator]"},c.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},c.values=T,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(q),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,i){return u.type="throw",u.arg=e,t.next=r,i&&(t.method="next",t.arg=n),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=o.call(a,"catchLoc"),f=o.call(a,"finallyLoc");if(s&&f){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),q(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;q(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:T(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),y}}}function O(e,t,r,n){var i=t&&t.prototype instanceof j?t:j,o=Object.create(i.prototype),a=new M(n||[]);return o._invoke=function(e,t,r){var n=d;return function(i,o){if(n===h)throw new Error("Generator is already running");if(n===v){if("throw"===i)throw o;return z()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var u=_(a,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var s=S(e,t,r);if("normal"===s.type){if(n=r.done?v:p,s.arg===y)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=v,r.method="throw",r.arg=s.arg)}}}(e,r,a),o}function S(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}function j(){}function k(){}function P(){}function E(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function x(e){var r;this._invoke=function(n,i){function a(){return new Promise(function(r,a){!function r(n,i,a,u){var s=S(e[n],e,i);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"===(void 0===l?"undefined":t(l))&&o.call(l,"__await")?Promise.resolve(l.__await).then(function(e){r("next",e,a,u)},function(e){r("throw",e,a,u)}):Promise.resolve(l).then(function(e){f.value=e,a(f)},u)}u(s.arg)}(n,i,r,a)})}return r=r?r.then(a,a):a()}}function _(e,t){var r=e.iterator[t.method];if(r===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,_(e,t),"throw"===t.method))return y;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var i=S(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,y;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,y):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,y)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function q(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function T(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(o.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=n,t.done=!0,t};return i.next=i}}return{next:z}}function z(){return{value:n,done:!0}}}(function(){return this}()||Function("return this")())}).call(this,r(8)(e))},function(e,t,r){"use strict";e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(10);Object.defineProperty(t,"AdvertisingProvider",{enumerable:!0,get:function(){return s(n).default}});var i=r(13);Object.defineProperty(t,"AdvertisingSlot",{enumerable:!0,get:function(){return s(i).default}});var o=r(5);Object.defineProperty(t,"connectToAdServer",{enumerable:!0,get:function(){return s(o).default}});var a=r(2);Object.defineProperty(t,"AdvertisingConfigPropType",{enumerable:!0,get:function(){return s(a).default}});var u=r(3);function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"AdvertisingSlotConfigPropType",{enumerable:!0,get:function(){return s(u).default}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=f(i),a=f(r(11)),u=(f(r(1)),f(r(2)),f(r(4))),s=f(r(12));function f(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.initialize(),r.state={shouldRefresh:!1,firstCall:!0,advertising:r.advertising},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.Component),n(t,[{key:"componentDidMount",value:function(){this.advertising.isConfigReady()&&this.props.active&&this.advertising.setup()}},{key:"componentDidUpdate",value:function(){var e=this.props,t=e.config,r=e.active,n=this.state,i=n.advertising,o=n.shouldRefresh,a=i.isConfigReady();!a&&t&&r?(i.setConfig(t),i.setup()):a&&o&&t.singleRequest&&r&&i.setup()}},{key:"componentWillUnmount",value:function(){this.props.config&&this.advertising.teardown()}},{key:"initialize",value:function(){var e=this.props,t=e.config,r=e.plugins;this.advertising=new a.default(t,r)}},{key:"render",value:function(){var e=this.state,t=e.advertising,r=e.shouldRefresh,n={activate:t.activate.bind(this.state.advertising),active:this.props.active,shouldRefresh:r};return o.default.createElement(u.default.Provider,{value:n},this.props.children)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var r=t.firstCall,n=t.advertising;if(!r&&!(0,s.default)(e.config,n.prevConfig)&&e.shouldRefresh){n.teardown();var i=e.config,o=e.plugins,u=e.active,f=new a.default(i,o);return f.isConfigReady()&&!i.singleRequest&&u&&f.setup(),{advertising:f,shouldRefresh:!0}}return r?{firstCall:!1}:{shouldRefresh:!1}}}]),t}();t.default=l,l.defaultProps={active:!0,shouldRefresh:!1}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&u.return&&u.return()}finally{if(i)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function o(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){return function n(i,o){try{var a=t[i](o),u=a.value}catch(e){return void r(e)}if(!a.done)return Promise.resolve(u).then(function(e){n("next",e)},function(e){n("throw",e)});e(u)}("next")})}}var a=Symbol("define GTP size mappings (private method)"),u=Symbol("get GPT size mapping (private method)"),s=Symbol("get Prebid size mapping (private method)"),f=Symbol("define slots (private method)"),l=Symbol("display slots (private method)"),c=Symbol("setup Prebid (private method)"),d=Symbol("teardown Prebid (private method)"),p=Symbol("setup GPT (private method)"),h=Symbol("teardown GPT (private method)"),v=Symbol("call DFP slots in setup (private method)"),y=Symbol("call DFP by activate (private method)"),g=Symbol("setup custom events (private method)"),m=Symbol("setup custom event (private method)"),b=Symbol("teardown custom events (private method)"),w=Symbol("with queue (private method)"),O=Symbol("queue for GPT (private method)"),S=Symbol("queue for Prebid (private method)"),j=Symbol("set default config (private method)"),k=Symbol("execute plugins (private method)"),P=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=t,this.prevConfig={},this.slots={},this.selectedSlots={},this.plugins=r,this.gptSizeMappings={},this.prebidSizeMappings={},this.customEventCallbacks={},this.customEventHandlers={},this.queue=[],t&&0!==Object.keys(t).length&&this[j]()}var t,r;return i(e,[{key:"setup",value:(r=o(regeneratorRuntime.mark(function t(){var r,n,i,o,a,u,s,f,l,d,h=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.slots,n=this.queue,this[g](),t.next=4,Promise.all([e[S](this[c].bind(this)),e[O](this[p].bind(this))]);case 4:if(0!==n.length){t.next=6;break}return t.abrupt("return");case 6:for(i=function(e){var t=e.id,r=e.customEventHandlers;Object.keys(r).forEach(function(e){return h.customEventCallbacks[e]||(h.customEventCallbacks[e]={}),h.customEventCallbacks[e][t]=r[e]})},o=!0,a=!1,u=void 0,t.prev=10,s=n[Symbol.iterator]();!(o=(f=s.next()).done);o=!0)l=f.value,i(l);t.next=18;break;case 14:t.prev=14,t.t0=t.catch(10),a=!0,u=t.t0;case 18:t.prev=18,t.prev=19,!o&&s.return&&s.return();case 21:if(t.prev=21,!a){t.next=24;break}throw u;case 24:return t.finish(21);case 25:return t.finish(18);case 26:d=n.map(function(e){var t=e.id;return r[t]}),e[O](function(){return e[S](function(){return window.pbjs.rp.requestBids({callback:h[v],gptSlotObjects:d,sizeMappings:h.prebidSizeMappings,data:h.config.dataPrebid})})},setTimeout(function(){h[v](d)},2e3));case 28:case"end":return t.stop()}},t,this,[[10,14,18,26],[19,,21,25]])})),function(){return r.apply(this,arguments)})},{key:"teardown",value:(t=o(regeneratorRuntime.mark(function t(){var r,n,i,o,a,u;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this[b](),t.next=3,Promise.all([e[S](this[d].bind(this)),e[O](this[h].bind(this))]);case 3:for(r=!0,n=!1,i=void 0,t.prev=6,o=Object.keys(this.slots)[Symbol.iterator]();!(r=(a=o.next()).done);r=!0)u=a.value,window.pbjs[u]=!1;t.next=14;break;case 10:t.prev=10,t.t0=t.catch(6),n=!0,i=t.t0;case 14:t.prev=14,t.prev=15,!r&&o.return&&o.return();case 17:if(t.prev=17,!n){t.next=20;break}throw i;case 20:return t.finish(17);case 21:return t.finish(14);case 22:window.pbjs.adserverRequestSent=!1,this.slots={},this.gptSizeMappings={},this.prebidSizeMappings={},this.queue={};case 27:case"end":return t.stop()}},t,this,[[6,10,14,22],[15,,17,21]])})),function(){return t.apply(this,arguments)})},{key:"activate",value:function(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.slots;0===Object.values(i).length||this.config.singleRequest?this.queue.push({id:t,customEventHandlers:n}):(Object.keys(n).forEach(function(e){return r.customEventCallbacks[e]||(r.customEventCallbacks[e]={}),r.customEventCallbacks[e][t]=n[e]}),e[O](function(){return e[S](function(){return window.pbjs.rp.requestBids({callback:r[y],gptSlotObjects:[i[t]],sizeMappings:r.prebidSizeMappings,data:r.config.dataPrebid})})},setTimeout(function(){r[y]([i[t]])},2e3)))}},{key:"isConfigReady",value:function(){return Boolean(this.config&&0!==Object.keys(this.config).length)}},{key:"setConfig",value:function(e){this.config=e,this[j]()}},{key:v,value:function(e){window.pbjs.adserverRequestSent||(window.pbjs.adserverRequestSent=!0,window.googletag.pubads().refresh(e))}},{key:y,value:function(e){var t=e[0].getSlotElementId();window.pbjs[t]||(window.pbjs[t]=!0,window.googletag.pubads().refresh(e))}},{key:g,value:function(){var e=this;this.config.customEvents&&Object.keys(this.config.customEvents).forEach(function(t){return e[m](t,e.config.customEvents[t])})}},{key:m,value:function(e,t){var r=t.eventMessagePrefix,n=t.divIdPrefix,i=this.customEventCallbacks;this.customEventHandlers[e]=function(t){var o=t.data;if("string"==typeof o&&o.startsWith(""+r)){var a=""+(n||"")+o.substr(r.length),u=i[e];if(u){var s=u[a];s&&s()}}},window.addEventListener("message",this.customEventHandlers[e])}},{key:b,value:function(){var e=this;this.config.customEvents&&Object.keys(this.config.customEvents).forEach(function(t){return window.removeEventListener("message",e.customEventHandlers[t])})}},{key:a,value:function(){if(this.config.sizeMappings){var e=!0,t=!1,r=void 0;try{for(var i,o=Object.entries(this.config.sizeMappings)[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){var a=i.value,u=n(a,2),s=u[0],f=u[1],l=window.googletag.sizeMapping(),c=!0,d=!1,p=void 0;try{for(var h,v=f[Symbol.iterator]();!(c=(h=v.next()).done);c=!0){var y=h.value,g=y.viewPortSize,m=y.sizes;l.addSize(g,m)}}catch(e){d=!0,p=e}finally{try{!c&&v.return&&v.return()}finally{if(d)throw p}}this.gptSizeMappings[s]=l.build()}}catch(e){t=!0,r=e}finally{try{!e&&o.return&&o.return()}finally{if(t)throw r}}}}},{key:u,value:function(e){return e&&this.gptSizeMappings[e]?this.gptSizeMappings[e]:null}},{key:s,value:function(){var e=this;this.config.slots&&this.config.slots.forEach(function(t){var r=t.id,n=t.sizeMappingName;if(e[u](n)){var i=JSON.parse(JSON.stringify(e.config.sizeMappings[n]));Object.keys(i).forEach(function(e){return i[e].minViewPort=i[e].viewPortSize}),e.prebidSizeMappings[r]=i}})}},{key:f,value:function(){var e=this;this.config.slots.forEach(function(t){var r=t.id,i=t.path,o=t.collapseEmptyDiv,a=t.targeting,s=void 0===a?{}:a,f=t.sizes,l=t.sizeMappingName,c=window.googletag.defineSlot(i||e.config.path,f,r),d=e[u](l);d&&c.defineSizeMapping(d),o&&o.length&&o.length>0&&c.setCollapseEmptyDiv.apply(c,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(o));var p=!0,h=!1,v=void 0;try{for(var y,g=Object.entries(s)[Symbol.iterator]();!(p=(y=g.next()).done);p=!0){var m=y.value,b=n(m,2),w=b[0],O=b[1];c.setTargeting(w,O)}}catch(e){h=!0,v=e}finally{try{!p&&g.return&&g.return()}finally{if(h)throw v}}c.addService(window.googletag.pubads()),e.slots[r]=c})}},{key:l,value:function(){this[k]("displaySlots"),this.config.slots.forEach(function(e){var t=e.id;return window.googletag.display(t)})}},{key:c,value:function(){this[k]("setupPrebid")}},{key:d,value:function(){this[k]("teardownPrebid")}},{key:p,value:function(){this[k]("setupGpt");var e=window.googletag.pubads(),t=this.config.targeting;this[a](),this[f](),this[s]();var r=!0,i=!1,o=void 0;try{for(var u,c=Object.entries(t)[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var d=u.value,p=n(d,2),h=p[0],v=p[1];e.setTargeting(h,v)}}catch(e){i=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}e.disableInitialLoad(),e.enableSingleRequest(),window.googletag.enableServices(),this[l]()}},{key:h,value:function(){this[k]("teardownGpt"),window.googletag.destroySlots()}},{key:j,value:function(){this.config.prebid||(this.config.prebid={}),this.config.metaData||(this.config.metaData={}),this.config.targeting||(this.config.targeting={}),this.prevConfig=JSON.parse(JSON.stringify(this.config))}},{key:k,value:function(e){var t=!0,r=!1,n=void 0;try{for(var i,o=this.plugins[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value[e];a&&a.call(this)}}catch(e){r=!0,n=e}finally{try{!t&&o.return&&o.return()}finally{if(r)throw n}}}}],[{key:O,value:function(t){return e[w](window.googletag.cmd,t)}},{key:S,value:function(t){return e[w](window.pbjs.que,t)}},{key:w,value:function(e,t){return new Promise(function(r){return e.push(function(){t(),r()})})}}]),e}();t.default=P},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=Array.isArray,o=Object.keys,a=Object.prototype.hasOwnProperty;e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==(void 0===t?"undefined":n(t))&&"object"==(void 0===r?"undefined":n(r))){var u,s,f,l=i(t),c=i(r);if(l&&c){if((s=t.length)!=r.length)return!1;for(u=s;0!=u--;)if(!e(t[u],r[u]))return!1;return!0}if(l!=c)return!1;var d=t instanceof Date,p=r instanceof Date;if(d!=p)return!1;if(d&&p)return t.getTime()==r.getTime();var h=t instanceof RegExp,v=r instanceof RegExp;if(h!=v)return!1;if(h&&v)return t.toString()==r.toString();var y=o(t);if((s=y.length)!==o(r).length)return!1;for(u=s;0!=u--;)if(!a.call(r,y[u]))return!1;for(u=s;0!=u--;)if(!e(t[f=y[u]],r[f]))return!1;return!0}return t!=t&&r!=r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),o=u(i),a=u(r(5));u(r(1));function u(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.Component),n(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.activate,r=e.id,n=e.customEventHandlers;e.active&&t(r,n)}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.activate,n=t.id,i=t.customEventHandlers,o=t.active,a=t.shouldRefresh;(e.activate!==r||o)&&a&&r(n,i)}},{key:"render",value:function(){var e=this.props,t=e.id,r=e.style,n=e.className,i=e.children;return o.default.createElement("div",{id:t,style:r,className:n,children:i})}}]),t}();s.defaultProps={customEventHandlers:{},active:!0,shouldRefresh:!1},t.default=(0,a.default)(s)}]);