@brndts/brndts-ads 1.14.19 → 1.14.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -68118,10 +68118,90 @@ var BASIC_SUPPORT = {
68118
68118
  audio: "canPlayType" in document.createElement("audio"),
68119
68119
  video: "canPlayType" in document.createElement("video")
68120
68120
  };
68121
+ function detectAdblock() {
68122
+ var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref_timeoutMs = _ref.timeoutMs, timeoutMs = _ref_timeoutMs === void 0 ? 1500 : _ref_timeoutMs;
68123
+ return new Promise(function(resolve) {
68124
+ var maybeResolve = function maybeResolve() {
68125
+ requestAnimationFrame(function() {
68126
+ checkCSS();
68127
+ var signals = (cssHit ? 1 : 0) + (netHit ? 1 : 0) + (scriptHit ? 1 : 0);
68128
+ if (signals >= 2 || scriptLoaded && (cssHit || netHit)) {
68129
+ done(true);
68130
+ }
68131
+ });
68132
+ };
68133
+ var cleanup = function cleanup() {
68134
+ clearTimeout(t2);
68135
+ try {
68136
+ bait.remove();
68137
+ } catch (e) {}
68138
+ try {
68139
+ s2.remove();
68140
+ } catch (e) {}
68141
+ img.src = "";
68142
+ };
68143
+ var resolved = false;
68144
+ var done = function(v) {
68145
+ if (!resolved) {
68146
+ resolved = true;
68147
+ cleanup();
68148
+ resolve(v);
68149
+ }
68150
+ };
68151
+ var bait = document.createElement("div");
68152
+ bait.className = "ads ad ad-banner ad-unit adzone adsbox pub_300x250";
68153
+ bait.style.cssText = "position:absolute;left:-9999px;width:300px;height:250px;pointer-events:none;";
68154
+ document.addEventListener("DOMContentLoaded", function() {
68155
+ return document.body.appendChild(bait);
68156
+ });
68157
+ var cssHit = false;
68158
+ var checkCSS = function() {
68159
+ if (!bait.isConnected) {
68160
+ cssHit = true;
68161
+ return;
68162
+ }
68163
+ var cs = getComputedStyle(bait);
68164
+ var hidden = cs.display === "none" || cs.visibility === "hidden" || parseInt(cs.height || "0", 10) === 0 || bait.offsetParent === null;
68165
+ if (hidden) cssHit = true;
68166
+ };
68167
+ var img = new Image();
68168
+ var netHit = false;
68169
+ img.onload = function() {};
68170
+ img.onerror = function() {
68171
+ netHit = true;
68172
+ maybeResolve();
68173
+ };
68174
+ img.src = "/ads/px.gif?cb=".concat(Date.now());
68175
+ var s2 = document.createElement("script");
68176
+ var scriptHit = false;
68177
+ var scriptLoaded = false;
68178
+ window.__ab_allow = void 0;
68179
+ s2.async = true;
68180
+ s2.src = "/ads/allow.js?cb=".concat(Date.now());
68181
+ s2.onload = function() {
68182
+ scriptLoaded = true;
68183
+ if (window.__ab_allow !== true) {
68184
+ scriptHit = true;
68185
+ }
68186
+ maybeResolve();
68187
+ };
68188
+ s2.onerror = function() {
68189
+ scriptHit = true;
68190
+ maybeResolve();
68191
+ };
68192
+ document.head.appendChild(s2);
68193
+ var t2 = setTimeout(function() {
68194
+ checkCSS();
68195
+ var blocked = cssHit || netHit || scriptHit;
68196
+ done(blocked);
68197
+ }, timeoutMs);
68198
+ });
68199
+ }
68121
68200
  var Support = /*#__PURE__*/ function() {
68122
68201
  "use strict";
68123
68202
  function _Support(type, provider) {
68124
68203
  _class_call_check(this, _Support);
68204
+ this.supportAds = null;
68125
68205
  this.api = type && BASIC_SUPPORT[type] || provider !== "html5";
68126
68206
  this.ui = this.api && _Support.rangeInput;
68127
68207
  }
@@ -68170,6 +68250,35 @@ var Support = /*#__PURE__*/ function() {
68170
68250
  ui: ui
68171
68251
  };
68172
68252
  }
68253
+ },
68254
+ {
68255
+ key: "ads",
68256
+ value: function ads() {
68257
+ return _async_to_generator(function() {
68258
+ var _;
68259
+ return _ts_generator(this, function(_state) {
68260
+ switch(_state.label){
68261
+ case 0:
68262
+ if (this.supportAds !== null) {
68263
+ this.supportAds;
68264
+ }
68265
+ _ = this;
68266
+ return [
68267
+ 4,
68268
+ detectAdblock().then(function(blocked) {
68269
+ return !blocked;
68270
+ })
68271
+ ];
68272
+ case 1:
68273
+ _.supportAds = _state.sent();
68274
+ return [
68275
+ 2,
68276
+ !!this.supportAds
68277
+ ];
68278
+ }
68279
+ });
68280
+ }).call(this);
68281
+ }
68173
68282
  }
68174
68283
  ], [
68175
68284
  {
@@ -69975,6 +70084,10 @@ var RULES = {
69975
70084
  [
69976
70085
  200,
69977
70086
  200
70087
+ ],
70088
+ [
70089
+ 180,
70090
+ 150
69978
70091
  ]
69979
70092
  ],
69980
70093
  "desktop": [
@@ -69989,6 +70102,10 @@ var RULES = {
69989
70102
  [
69990
70103
  200,
69991
70104
  200
70105
+ ],
70106
+ [
70107
+ 180,
70108
+ 150
69992
70109
  ]
69993
70110
  ],
69994
70111
  "tablet": [
@@ -71225,6 +71342,19 @@ var BRNDTSDefaultProvider = /*#__PURE__*/ function(ContentProvider) {
71225
71342
  });
71226
71343
  }).call(this);
71227
71344
  }
71345
+ },
71346
+ {
71347
+ key: "requestInstream",
71348
+ value: function requestInstream() {
71349
+ return _async_to_generator(function() {
71350
+ return _ts_generator(this, function(_state) {
71351
+ return [
71352
+ 2,
71353
+ Promise.resolve({})
71354
+ ];
71355
+ });
71356
+ })();
71357
+ }
71228
71358
  }
71229
71359
  ]);
71230
71360
  return BRNDTSDefaultProvider;
@@ -71505,6 +71635,22 @@ var SmartyadsProvider = /*#__PURE__*/ function(ContentProvider) {
71505
71635
  });
71506
71636
  }).call(this);
71507
71637
  }
71638
+ },
71639
+ {
71640
+ key: "requestInstream",
71641
+ value: function requestInstream() {
71642
+ return _async_to_generator(function() {
71643
+ var params;
71644
+ var _arguments = arguments;
71645
+ return _ts_generator(this, function(_state) {
71646
+ params = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {};
71647
+ return [
71648
+ 2,
71649
+ Promise.resolve({})
71650
+ ];
71651
+ });
71652
+ }).apply(this, arguments);
71653
+ }
71508
71654
  }
71509
71655
  ]);
71510
71656
  return SmartyadsProvider;
@@ -71614,6 +71760,22 @@ var SmartyadsTagProvider = /*#__PURE__*/ function(ContentProvider) {
71614
71760
  });
71615
71761
  }).call(this);
71616
71762
  }
71763
+ },
71764
+ {
71765
+ key: "requestInstream",
71766
+ value: function requestInstream() {
71767
+ return _async_to_generator(function() {
71768
+ var params;
71769
+ var _arguments = arguments;
71770
+ return _ts_generator(this, function(_state) {
71771
+ params = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {};
71772
+ return [
71773
+ 2,
71774
+ Promise.resolve({})
71775
+ ];
71776
+ });
71777
+ }).apply(this, arguments);
71778
+ }
71617
71779
  }
71618
71780
  ]);
71619
71781
  return SmartyadsTagProvider;
@@ -71662,6 +71824,19 @@ var StaticImageProvider = /*#__PURE__*/ function(ContentProvider) {
71662
71824
  });
71663
71825
  })();
71664
71826
  }
71827
+ },
71828
+ {
71829
+ key: "requestInstream",
71830
+ value: function requestInstream() {
71831
+ return _async_to_generator(function() {
71832
+ return _ts_generator(this, function(_state) {
71833
+ return [
71834
+ 2,
71835
+ Promise.resolve({})
71836
+ ];
71837
+ });
71838
+ })();
71839
+ }
71665
71840
  }
71666
71841
  ]);
71667
71842
  return StaticImageProvider;
@@ -71877,6 +72052,19 @@ var AffiliateProvider = /*#__PURE__*/ function(ContentProvider) {
71877
72052
  });
71878
72053
  }).call(this);
71879
72054
  }
72055
+ },
72056
+ {
72057
+ key: "requestInstream",
72058
+ value: function requestInstream() {
72059
+ return _async_to_generator(function() {
72060
+ return _ts_generator(this, function(_state) {
72061
+ return [
72062
+ 2,
72063
+ Promise.resolve({})
72064
+ ];
72065
+ });
72066
+ })();
72067
+ }
71880
72068
  }
71881
72069
  ]);
71882
72070
  return AffiliateProvider;
@@ -71890,7 +72078,23 @@ var PrebidConfigBuilder = /*#__PURE__*/ function() {
71890
72078
  debug: false,
71891
72079
  priceGranularity: "high",
71892
72080
  enableSendAllBids: true,
71893
- enableTIDs: true
72081
+ enableTIDs: true,
72082
+ cache: {
72083
+ url: "https://afatv.com/cache",
72084
+ // still required by API; won't be used when useLocal is true
72085
+ useLocal: true
72086
+ },
72087
+ mediaTypePriceGranularity: {
72088
+ video: {
72089
+ buckets: [
72090
+ {
72091
+ min: 0,
72092
+ max: 100,
72093
+ increment: 0.1
72094
+ }
72095
+ ]
72096
+ }
72097
+ }
71894
72098
  };
71895
72099
  }
71896
72100
  _create_class(PrebidConfigBuilder, [
@@ -72437,6 +72641,22 @@ var PrebidjsProvider = /*#__PURE__*/ function(ContentProvider) {
72437
72641
  });
72438
72642
  }).call(this);
72439
72643
  }
72644
+ },
72645
+ {
72646
+ key: "requestInstream",
72647
+ value: function requestInstream() {
72648
+ return _async_to_generator(function() {
72649
+ var params;
72650
+ var _arguments = arguments;
72651
+ return _ts_generator(this, function(_state) {
72652
+ params = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {};
72653
+ return [
72654
+ 2,
72655
+ Promise.resolve({})
72656
+ ];
72657
+ });
72658
+ }).apply(this, arguments);
72659
+ }
72440
72660
  }
72441
72661
  ]);
72442
72662
  return PrebidjsProvider;
@@ -72625,7 +72845,7 @@ var GPT = /*#__PURE__*/ function() {
72625
72845
  }
72626
72846
  mrecmapping = mrecmapping.build();
72627
72847
  } else {
72628
- window.googletag.sizeMapping().addSize([
72848
+ mrecmapping = window.googletag.sizeMapping().addSize([
72629
72849
  1024,
72630
72850
  0
72631
72851
  ], size).addSize([
@@ -72757,96 +72977,169 @@ var PrebidGAM = /*#__PURE__*/ function() {
72757
72977
  }
72758
72978
  },
72759
72979
  {
72760
- key: "defineSlot",
72761
- value: function defineSlot(options, slotId, containerId, adType) {
72980
+ key: "defineBannerAdUnit",
72981
+ value: function defineBannerAdUnit(unitDefinition, containerId, options, adType) {
72762
72982
  var adName = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "banner";
72763
- var _window_pbjs;
72764
- var gamNetworkId = _PrebidGAM.getProperGAMNetworkId(options);
72765
- var unitDefinition = options.units.find(function(unit) {
72766
- return unit.code === "".concat(slotId);
72767
- });
72768
- var sizes = [];
72769
- var mapping = void 0;
72770
- if (!unitDefinition) {
72771
- console.error("No unit definition found for slotId: ".concat(slotId));
72772
- return;
72773
- }
72774
- if (adType) {
72775
- sizes = RegionDefinitions.TYPE_AND_DIMENSIONS[adType];
72776
- mapping = RegionDefinitions.mapping(adType);
72777
- } else {
72778
- var _unitDefinition_mediaTypes_banner;
72779
- sizes = ((_unitDefinition_mediaTypes_banner = unitDefinition.mediaTypes.banner) === null || _unitDefinition_mediaTypes_banner === void 0 ? void 0 : _unitDefinition_mediaTypes_banner.sizes) || [];
72780
- }
72781
- var targeting = void 0;
72782
- if (unitDefinition.zoneId && options.reviveId) {
72783
- targeting = {
72784
- brndts_rid: options.reviveId,
72785
- brndts_zid: unitDefinition.zoneId
72786
- };
72787
- }
72788
- GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), sizes, "".concat(containerId), {
72789
- targeting: targeting,
72790
- mapping: mapping
72791
- });
72792
- if (!((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
72793
- return "".concat(containerId) === "".concat(defUnit.code);
72794
- }))) {
72795
- var _window_pbjs_que, _window_pbjs1;
72796
- (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs1.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
72797
- var _window_pbjs;
72798
- if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
72799
- var adUnit = _object_spread_props(_object_spread({}, unitDefinition), {
72800
- mediaTypes: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes || {}), {
72801
- banner: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes.banner || {}), {
72802
- sizes: sizes
72803
- })
72804
- }),
72805
- code: "".concat(containerId)
72806
- });
72807
- if (mapping) {
72808
- var mappedSizes = [];
72809
- var sortedBreakpoints = Object.keys(mapping).sort(function(a, b) {
72810
- return parseInt(RegionDefinitions.BREAKPOINTS[b], 10) - parseInt(RegionDefinitions.BREAKPOINTS[a], 10);
72811
- });
72812
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
72813
- try {
72814
- for(var _iterator = sortedBreakpoints[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
72815
- var bp = _step.value;
72816
- mappedSizes.push({
72817
- minViewPort: [
72818
- RegionDefinitions.BREAKPOINTS[bp],
72819
- 0
72820
- ],
72821
- sizes: mapping[bp]
72822
- });
72823
- }
72824
- } catch (err) {
72825
- _didIteratorError = true;
72826
- _iteratorError = err;
72827
- } finally{
72983
+ return new Promise(function(resolve) {
72984
+ var _window_pbjs;
72985
+ var sizes = [];
72986
+ var mapping = void 0;
72987
+ if (adType) {
72988
+ sizes = RegionDefinitions.TYPE_AND_DIMENSIONS[adType];
72989
+ mapping = RegionDefinitions.mapping(adType);
72990
+ } else {
72991
+ var _unitDefinition_mediaTypes_banner;
72992
+ sizes = ((_unitDefinition_mediaTypes_banner = unitDefinition.mediaTypes.banner) === null || _unitDefinition_mediaTypes_banner === void 0 ? void 0 : _unitDefinition_mediaTypes_banner.sizes) || [];
72993
+ }
72994
+ var targeting = void 0;
72995
+ if (unitDefinition.zoneId && options.reviveId) {
72996
+ targeting = {
72997
+ brndts_rid: options.reviveId,
72998
+ brndts_zid: unitDefinition.zoneId
72999
+ };
73000
+ }
73001
+ var gamNetworkId = _PrebidGAM.getProperGAMNetworkId(options);
73002
+ GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), sizes, "".concat(containerId), {
73003
+ targeting: targeting,
73004
+ mapping: mapping
73005
+ });
73006
+ var existingSlot = (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.find(function(defUnit) {
73007
+ return "".concat(containerId) === "".concat(defUnit.code);
73008
+ });
73009
+ if (!existingSlot) {
73010
+ var _window_pbjs_que, _window_pbjs1;
73011
+ (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs1.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
73012
+ var _window_pbjs;
73013
+ if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
73014
+ var adUnit = {
73015
+ code: "".concat(containerId),
73016
+ mediaTypes: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes || {}), {
73017
+ banner: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes.banner || {}), {
73018
+ sizes: sizes
73019
+ })
73020
+ }),
73021
+ bids: unitDefinition.bids,
73022
+ schain: unitDefinition.schain
73023
+ };
73024
+ if (mapping) {
73025
+ var mappedSizes = [];
73026
+ var sortedBreakpoints = Object.keys(mapping).sort(function(a, b) {
73027
+ return parseInt(RegionDefinitions.BREAKPOINTS[b], 10) - parseInt(RegionDefinitions.BREAKPOINTS[a], 10);
73028
+ });
73029
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
72828
73030
  try {
72829
- if (!_iteratorNormalCompletion && _iterator.return != null) {
72830
- _iterator.return();
73031
+ for(var _iterator = sortedBreakpoints[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
73032
+ var bp = _step.value;
73033
+ mappedSizes.push({
73034
+ minViewPort: [
73035
+ RegionDefinitions.BREAKPOINTS[bp],
73036
+ 0
73037
+ ],
73038
+ sizes: mapping[bp]
73039
+ });
72831
73040
  }
73041
+ } catch (err) {
73042
+ _didIteratorError = true;
73043
+ _iteratorError = err;
72832
73044
  } finally{
72833
- if (_didIteratorError) {
72834
- throw _iteratorError;
73045
+ try {
73046
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
73047
+ _iterator.return();
73048
+ }
73049
+ } finally{
73050
+ if (_didIteratorError) {
73051
+ throw _iteratorError;
73052
+ }
72835
73053
  }
72836
73054
  }
73055
+ adUnit.mediaTypes.banner.sizeConfig = mappedSizes;
73056
+ } else {
73057
+ adUnit.mediaTypes.banner.sizes = sizes;
72837
73058
  }
72838
- adUnit.mediaTypes.banner.sizeConfig = mappedSizes;
73059
+ window.pbjs.addAdUnits([
73060
+ adUnit
73061
+ ]);
73062
+ resolve(adUnit);
72839
73063
  } else {
72840
- adUnit.mediaTypes.banner.sizes = sizes;
73064
+ console.error("addAdUnits is not a function.");
73065
+ resolve(void 0);
72841
73066
  }
72842
- window.pbjs.addAdUnits([
72843
- adUnit
72844
- ]);
72845
- } else {
72846
- console.error("addAdUnits is not a function.");
73067
+ });
73068
+ } else {
73069
+ resolve(existingSlot);
73070
+ }
73071
+ });
73072
+ }
73073
+ },
73074
+ {
73075
+ key: "defineVideoAdUnit",
73076
+ value: function defineVideoAdUnit(unitDefinition, containerId) {
73077
+ return new Promise(function(resolve) {
73078
+ var _window_pbjs;
73079
+ var existingSlot = (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.find(function(defUnit) {
73080
+ return "".concat(containerId) === "".concat(defUnit.code);
73081
+ });
73082
+ if (!existingSlot) {
73083
+ var _window_pbjs_que, _window_pbjs1;
73084
+ (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs1.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
73085
+ var _window_pbjs;
73086
+ if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
73087
+ var adUnit = {
73088
+ code: "".concat(containerId),
73089
+ mediaTypes: _object_spread({}, unitDefinition.mediaTypes),
73090
+ bids: unitDefinition.bids,
73091
+ schain: unitDefinition.schain
73092
+ };
73093
+ window.pbjs.addAdUnits([
73094
+ adUnit
73095
+ ]);
73096
+ resolve(adUnit);
73097
+ } else {
73098
+ console.error("addAdUnits is not a function.");
73099
+ resolve(void 0);
73100
+ }
73101
+ });
73102
+ } else {
73103
+ resolve(existingSlot);
73104
+ }
73105
+ });
73106
+ }
73107
+ },
73108
+ {
73109
+ key: "defineSlot",
73110
+ value: function defineSlot(options, slotId, containerId, adType) {
73111
+ var adName = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "banner";
73112
+ return _async_to_generator(function() {
73113
+ var unitDefinition;
73114
+ return _ts_generator(this, function(_state) {
73115
+ unitDefinition = options.units.find(function(unit) {
73116
+ return unit.code === "".concat(slotId);
73117
+ });
73118
+ if (!unitDefinition) {
73119
+ console.error("No unit definition found for slotId: ".concat(slotId));
73120
+ return [
73121
+ 2,
73122
+ unitDefinition
73123
+ ];
72847
73124
  }
73125
+ if (unitDefinition.mediaTypes.video) {
73126
+ return [
73127
+ 2,
73128
+ _PrebidGAM.defineVideoAdUnit(unitDefinition, containerId)
73129
+ ];
73130
+ } else if (unitDefinition.mediaTypes.banner) {
73131
+ return [
73132
+ 2,
73133
+ _PrebidGAM.defineBannerAdUnit(unitDefinition, containerId, options, adType, adName)
73134
+ ];
73135
+ }
73136
+ console.warn("No supported mediaTypes found for unit: ".concat(slotId));
73137
+ return [
73138
+ 2,
73139
+ void 0
73140
+ ];
72848
73141
  });
72849
- }
73142
+ })();
72850
73143
  }
72851
73144
  },
72852
73145
  {
@@ -72888,6 +73181,40 @@ var PrebidGAM = /*#__PURE__*/ function() {
72888
73181
  });
72889
73182
  });
72890
73183
  }
73184
+ },
73185
+ {
73186
+ key: "requestInstream",
73187
+ value: function requestInstream(options, slotId, containerId, callback) {
73188
+ var _window_pbjs;
73189
+ var PREBID_TIMEOUT = 1e3;
73190
+ (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.que.push(function() {
73191
+ var _window_pbjs;
73192
+ (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.requestBids({
73193
+ adUnitCodes: [
73194
+ "".concat(containerId)
73195
+ ],
73196
+ timeout: PREBID_TIMEOUT,
73197
+ bidsBackHandler: function bidsBackHandler() {
73198
+ var _window_pbjs, _window_pbjs_adServers, _window_pbjs1;
73199
+ var existingSlot = (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.find(function(defUnit) {
73200
+ return "".concat(containerId) === "".concat(defUnit.code);
73201
+ });
73202
+ if (!existingSlot) {
73203
+ console.warn("No ad unit found for containerId: ".concat(containerId));
73204
+ return;
73205
+ }
73206
+ var gamNetworkId = _PrebidGAM.getProperGAMNetworkId(options);
73207
+ var vastTagUrl = (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : (_window_pbjs_adServers = _window_pbjs1.adServers) === null || _window_pbjs_adServers === void 0 ? void 0 : _window_pbjs_adServers.dfp.buildVideoUrl({
73208
+ adUnit: existingSlot,
73209
+ params: {
73210
+ iu: "/".concat(gamNetworkId, "/").concat(existingSlot.gamAdUnit)
73211
+ }
73212
+ });
73213
+ callback(vastTagUrl);
73214
+ }
73215
+ });
73216
+ });
73217
+ }
72891
73218
  }
72892
73219
  ]);
72893
73220
  return _PrebidGAM;
@@ -73017,6 +73344,72 @@ var PrebidGAMProvider = /*#__PURE__*/ function(ContentProvider) {
73017
73344
  });
73018
73345
  }).call(this);
73019
73346
  }
73347
+ },
73348
+ {
73349
+ key: "requestInstream",
73350
+ value: function requestInstream(params) {
73351
+ return _async_to_generator(function() {
73352
+ var _this;
73353
+ return _ts_generator(this, function(_state) {
73354
+ _this = this;
73355
+ return [
73356
+ 2,
73357
+ new Promise(function(resolve) {
73358
+ return _async_to_generator(function() {
73359
+ var adSlotId, adSlot, result;
73360
+ return _ts_generator(this, function(_state) {
73361
+ switch(_state.label){
73362
+ case 0:
73363
+ adSlotId = params.adSlot;
73364
+ if (!adSlotId && params.roles && params.roles.length > 0) {
73365
+ adSlot = this.options.units.find(function(unit) {
73366
+ var _params_roles;
73367
+ return unit._brndts_role !== void 0 && ((_params_roles = params.roles) === null || _params_roles === void 0 ? void 0 : _params_roles.includes(unit._brndts_role));
73368
+ });
73369
+ adSlotId = adSlot === null || adSlot === void 0 ? void 0 : adSlot.code;
73370
+ }
73371
+ if (!adSlotId) {
73372
+ console.warn("No adSlot or roles provided for instream ad request.");
73373
+ resolve({});
73374
+ return [
73375
+ 2
73376
+ ];
73377
+ }
73378
+ return [
73379
+ 4,
73380
+ prebidGamReady2.promise
73381
+ ];
73382
+ case 1:
73383
+ _state.sent();
73384
+ return [
73385
+ 4,
73386
+ PrebidGAM.defineSlot(this.options, adSlotId, adSlotId)
73387
+ ];
73388
+ case 2:
73389
+ result = _state.sent();
73390
+ if (!result) {
73391
+ console.warn("No ad unit found for instream adSlot: ".concat(adSlotId));
73392
+ resolve({});
73393
+ return [
73394
+ 2
73395
+ ];
73396
+ }
73397
+ PrebidGAM.requestInstream(this.options, adSlotId, adSlotId, function(content) {
73398
+ resolve({
73399
+ vastTagUrl: content
73400
+ });
73401
+ });
73402
+ return [
73403
+ 2
73404
+ ];
73405
+ }
73406
+ });
73407
+ }).call(_this);
73408
+ })
73409
+ ];
73410
+ });
73411
+ }).call(this);
73412
+ }
73020
73413
  }
73021
73414
  ]);
73022
73415
  return PrebidGAMProvider;
@@ -73113,6 +73506,19 @@ var ReviveProvider = /*#__PURE__*/ function(ContentProvider) {
73113
73506
  });
73114
73507
  }).call(this);
73115
73508
  }
73509
+ },
73510
+ {
73511
+ key: "requestInstream",
73512
+ value: function requestInstream() {
73513
+ return _async_to_generator(function() {
73514
+ return _ts_generator(this, function(_state) {
73515
+ return [
73516
+ 2,
73517
+ Promise.resolve({})
73518
+ ];
73519
+ });
73520
+ })();
73521
+ }
73116
73522
  }
73117
73523
  ]);
73118
73524
  return ReviveProvider;
@@ -73120,10 +73526,10 @@ var ReviveProvider = /*#__PURE__*/ function(ContentProvider) {
73120
73526
  // src/Ads/Providers/Prebidjs/PrebidReviveProvider.ts
73121
73527
  var PrebidRevive = /*#__PURE__*/ function() {
73122
73528
  "use strict";
73123
- function PrebidRevive() {
73124
- _class_call_check(this, PrebidRevive);
73529
+ function _PrebidRevive() {
73530
+ _class_call_check(this, _PrebidRevive);
73125
73531
  }
73126
- _create_class(PrebidRevive, null, [
73532
+ _create_class(_PrebidRevive, null, [
73127
73533
  {
73128
73534
  key: "load",
73129
73535
  value: function load() {
@@ -73189,20 +73595,137 @@ var PrebidRevive = /*#__PURE__*/ function() {
73189
73595
  }
73190
73596
  },
73191
73597
  {
73192
- key: "defineSlots",
73193
- value: function defineSlots(options) {
73194
- var _window_pbjs_que, _window_pbjs;
73195
- (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
73598
+ key: "defineSlots",
73599
+ value: function defineSlots(options) {
73600
+ var _window_pbjs_que, _window_pbjs;
73601
+ (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
73602
+ var _window_pbjs;
73603
+ if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
73604
+ window.pbjs.addAdUnits(options.units.filter(function(unit) {
73605
+ var _window_pbjs;
73606
+ return !((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
73607
+ return "".concat(unit.code) === "".concat(defUnit.code);
73608
+ }));
73609
+ }));
73610
+ } else {
73611
+ console.error("addAdUnits is not a function.");
73612
+ }
73613
+ });
73614
+ }
73615
+ },
73616
+ {
73617
+ key: "defineBannerAdUnit",
73618
+ value: function defineBannerAdUnit(unitDefinition, containerId, options, adType) {
73619
+ var adName = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "banner";
73620
+ return new Promise(function(resolve) {
73621
+ var _window_pbjs;
73622
+ var sizes = [];
73623
+ var mapping = void 0;
73624
+ if (adType) {
73625
+ sizes = RegionDefinitions.TYPE_AND_DIMENSIONS[adType];
73626
+ mapping = RegionDefinitions.mapping(adType);
73627
+ } else {
73628
+ var _unitDefinition_mediaTypes_banner;
73629
+ sizes = ((_unitDefinition_mediaTypes_banner = unitDefinition.mediaTypes.banner) === null || _unitDefinition_mediaTypes_banner === void 0 ? void 0 : _unitDefinition_mediaTypes_banner.sizes) || [];
73630
+ }
73631
+ var existingSlot = (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.find(function(defUnit) {
73632
+ return "".concat(containerId) === "".concat(defUnit.code);
73633
+ });
73634
+ if (!existingSlot) {
73635
+ var _window_pbjs_que, _window_pbjs1;
73636
+ (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs1.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
73637
+ var _window_pbjs;
73638
+ if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
73639
+ var adUnit = {
73640
+ code: "".concat(containerId),
73641
+ mediaTypes: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes || {}), {
73642
+ banner: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes.banner || {}), {
73643
+ sizes: sizes
73644
+ })
73645
+ }),
73646
+ bids: unitDefinition.bids,
73647
+ schain: unitDefinition.schain
73648
+ };
73649
+ if (mapping) {
73650
+ var mappedSizes = [];
73651
+ var sortedBreakpoints = Object.keys(mapping).sort(function(a, b) {
73652
+ return parseInt(RegionDefinitions.BREAKPOINTS[b], 10) - parseInt(RegionDefinitions.BREAKPOINTS[a], 10);
73653
+ });
73654
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
73655
+ try {
73656
+ for(var _iterator = sortedBreakpoints[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
73657
+ var bp = _step.value;
73658
+ mappedSizes.push({
73659
+ minViewPort: [
73660
+ RegionDefinitions.BREAKPOINTS[bp],
73661
+ 0
73662
+ ],
73663
+ sizes: mapping[bp]
73664
+ });
73665
+ }
73666
+ } catch (err) {
73667
+ _didIteratorError = true;
73668
+ _iteratorError = err;
73669
+ } finally{
73670
+ try {
73671
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
73672
+ _iterator.return();
73673
+ }
73674
+ } finally{
73675
+ if (_didIteratorError) {
73676
+ throw _iteratorError;
73677
+ }
73678
+ }
73679
+ }
73680
+ adUnit.mediaTypes.banner.sizeConfig = mappedSizes;
73681
+ } else {
73682
+ adUnit.mediaTypes.banner.sizes = sizes;
73683
+ }
73684
+ window.pbjs.addAdUnits([
73685
+ adUnit
73686
+ ]);
73687
+ resolve(adUnit);
73688
+ } else {
73689
+ console.error("addAdUnits is not a function.");
73690
+ resolve(void 0);
73691
+ }
73692
+ });
73693
+ } else {
73694
+ resolve(existingSlot);
73695
+ }
73696
+ });
73697
+ }
73698
+ },
73699
+ {
73700
+ key: "defineVideoAdUnit",
73701
+ value: function defineVideoAdUnit(unitDefinition, containerId) {
73702
+ return new Promise(function(resolve) {
73196
73703
  var _window_pbjs;
73197
- if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
73198
- window.pbjs.addAdUnits(options.units.filter(function(unit) {
73704
+ var existingSlot = (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.find(function(defUnit) {
73705
+ return "".concat(containerId) === "".concat(defUnit.code);
73706
+ });
73707
+ if (!existingSlot) {
73708
+ var _window_pbjs_que, _window_pbjs1;
73709
+ (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs1.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
73199
73710
  var _window_pbjs;
73200
- return !((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
73201
- return "".concat(unit.code) === "".concat(defUnit.code);
73202
- }));
73203
- }));
73711
+ if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
73712
+ var adUnit = {
73713
+ code: "".concat(containerId),
73714
+ mediaTypes: _object_spread({}, unitDefinition.mediaTypes),
73715
+ bids: unitDefinition.bids,
73716
+ schain: unitDefinition.schain
73717
+ };
73718
+ window.pbjs.addAdUnits([
73719
+ adUnit
73720
+ ]);
73721
+ resolve(adUnit);
73722
+ } else {
73723
+ console.error("addAdUnits is not a function.");
73724
+ resolve(void 0);
73725
+ }
73726
+ });
73204
73727
  } else {
73205
- console.error("addAdUnits is not a function.");
73728
+ resolve(existingSlot);
73206
73729
  }
73207
73730
  });
73208
73731
  }
@@ -73211,48 +73734,86 @@ var PrebidRevive = /*#__PURE__*/ function() {
73211
73734
  key: "defineSlot",
73212
73735
  value: function defineSlot(options, slotId, containerId, adType) {
73213
73736
  var adName = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "banner";
73214
- var _window_pbjs;
73215
- var unitDefinition = options.units.find(function(unit) {
73216
- return unit.code === "".concat(slotId);
73217
- });
73218
- var sizes = [];
73219
- if (!unitDefinition) {
73220
- console.error("No unit definition found for slotId: ".concat(slotId));
73221
- return;
73222
- }
73223
- if (adType) {
73224
- sizes = RegionDefinitions.TYPE_AND_DIMENSIONS[adType];
73225
- } else {
73226
- var _unitDefinition_mediaTypes_banner;
73227
- sizes = ((_unitDefinition_mediaTypes_banner = unitDefinition.mediaTypes.banner) === null || _unitDefinition_mediaTypes_banner === void 0 ? void 0 : _unitDefinition_mediaTypes_banner.sizes) || [];
73228
- }
73229
- if (!((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
73230
- return "".concat(containerId) === "".concat(defUnit.code);
73231
- }))) {
73232
- var _window_pbjs_que, _window_pbjs1;
73233
- (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs1.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
73234
- var _window_pbjs;
73235
- if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
73236
- window.pbjs.addAdUnits([
73237
- _object_spread_props(_object_spread({}, unitDefinition), {
73238
- mediaTypes: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes || {}), {
73239
- banner: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes.banner || {}), {
73240
- sizes: sizes
73241
- })
73242
- }),
73243
- code: "".concat(containerId)
73244
- })
73245
- ]);
73246
- } else {
73247
- console.error("addAdUnits is not a function.");
73737
+ return _async_to_generator(function() {
73738
+ var unitDefinition;
73739
+ return _ts_generator(this, function(_state) {
73740
+ unitDefinition = options.units.find(function(unit) {
73741
+ return unit.code === "".concat(slotId);
73742
+ });
73743
+ if (!unitDefinition) {
73744
+ console.error("No unit definition found for slotId: ".concat(slotId));
73745
+ return [
73746
+ 2,
73747
+ unitDefinition
73748
+ ];
73749
+ }
73750
+ if (unitDefinition.mediaTypes.video) {
73751
+ return [
73752
+ 2,
73753
+ _PrebidRevive.defineVideoAdUnit(unitDefinition, containerId)
73754
+ ];
73755
+ } else if (unitDefinition.mediaTypes.banner) {
73756
+ return [
73757
+ 2,
73758
+ _PrebidRevive.defineBannerAdUnit(unitDefinition, containerId, options, adType, adName)
73759
+ ];
73248
73760
  }
73761
+ console.warn("No supported mediaTypes found for unit: ".concat(slotId));
73762
+ return [
73763
+ 2,
73764
+ void 0
73765
+ ];
73249
73766
  });
73250
- }
73767
+ })();
73251
73768
  }
73252
73769
  },
73253
73770
  {
73254
73771
  key: "onSlotRenderEnded",
73255
- value: function onSlotRenderEnded(slotId, cb) {}
73772
+ value: // static defineSlot(
73773
+ // options: PrebidjsProviderOptions,
73774
+ // slotId: string,
73775
+ // containerId: string,
73776
+ // adType: Ads.AdSizeType,
73777
+ // adName: string = "banner",
73778
+ // ) {
73779
+ // // let gamNetworkId: string = PrebidGAM.getProperGAMNetworkId(options);
73780
+ // const unitDefinition = options.units.find((unit) => unit.code === `${slotId}`);
73781
+ // let sizes: [number, number][] = [];
73782
+ // if (!unitDefinition) {
73783
+ // console.error(`No unit definition found for slotId: ${slotId}`);
73784
+ // return;
73785
+ // }
73786
+ // if (adType) {
73787
+ // sizes = RegionDefinitions.TYPE_AND_DIMENSIONS[adType];
73788
+ // } else {
73789
+ // sizes = unitDefinition.mediaTypes.banner?.sizes || [];
73790
+ // }
73791
+ // // GPT.defineSlot(`/${gamNetworkId}/${adName}`, [sizes[0] || []], `${containerId}`);
73792
+ // if (
73793
+ // !window.pbjs?.adUnits.some((defUnit) => `${containerId}` === `${defUnit.code}`)
73794
+ // ) {
73795
+ // window.pbjs?.que?.push(() => {
73796
+ // if (window.pbjs?.addAdUnits) {
73797
+ // window.pbjs.addAdUnits([
73798
+ // {
73799
+ // ...unitDefinition,
73800
+ // mediaTypes: {
73801
+ // ...(unitDefinition.mediaTypes || {}),
73802
+ // banner: {
73803
+ // ...(unitDefinition.mediaTypes.banner || {}),
73804
+ // sizes: sizes,
73805
+ // },
73806
+ // },
73807
+ // code: `${containerId}`,
73808
+ // },
73809
+ // ]);
73810
+ // } else {
73811
+ // console.error("addAdUnits is not a function.");
73812
+ // }
73813
+ // });
73814
+ // }
73815
+ // }
73816
+ function onSlotRenderEnded(slotId, cb) {}
73256
73817
  },
73257
73818
  {
73258
73819
  key: "start",
@@ -73303,9 +73864,65 @@ var PrebidRevive = /*#__PURE__*/ function() {
73303
73864
  });
73304
73865
  });
73305
73866
  }
73867
+ },
73868
+ {
73869
+ key: "requestInstream",
73870
+ value: function requestInstream(options, slotId, containerId, callback) {
73871
+ var _window_pbjs;
73872
+ var PREBID_TIMEOUT = 1e3;
73873
+ (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.que.push(function() {
73874
+ var _window_pbjs;
73875
+ (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.requestBids({
73876
+ adUnitCodes: [
73877
+ "".concat(containerId)
73878
+ ],
73879
+ timeout: PREBID_TIMEOUT,
73880
+ bidsBackHandler: function bidsBackHandler(bids) {
73881
+ var winners = Object.values(bids).reduce(function(acc, unit) {
73882
+ if (unit.bids) {
73883
+ var _acc;
73884
+ (_acc = acc).push.apply(_acc, _to_consumable_array(unit.bids));
73885
+ }
73886
+ return acc;
73887
+ }, []).sort(function(a, b) {
73888
+ return b.cpm - a.cpm;
73889
+ });
73890
+ if (winners.length > 0) {
73891
+ var winner = winners[0];
73892
+ var content = {
73893
+ asStr: winner.ad,
73894
+ content: [],
73895
+ extra: {
73896
+ region: winner.adUnitCode,
73897
+ sz: {
73898
+ w: winner.width,
73899
+ h: winner.height
73900
+ },
73901
+ cpm: winner.cpm
73902
+ }
73903
+ };
73904
+ if (winner.vastUrl) {
73905
+ callback(winner.vastUrl);
73906
+ return;
73907
+ }
73908
+ ;
73909
+ if (winner.vastXml) {
73910
+ callback(winner.vastXml);
73911
+ return;
73912
+ }
73913
+ ;
73914
+ }
73915
+ if (winners.length === 0) {
73916
+ callback(null);
73917
+ }
73918
+ callback(null);
73919
+ }
73920
+ });
73921
+ });
73922
+ }
73306
73923
  }
73307
73924
  ]);
73308
- return PrebidRevive;
73925
+ return _PrebidRevive;
73309
73926
  }();
73310
73927
  var prebidReviveConfig = false;
73311
73928
  var prebidReviveReady = new Awaitable(false);
@@ -73366,7 +73983,7 @@ var PrebidReviveProvider = /*#__PURE__*/ function(ContentProvider) {
73366
73983
  key: "request",
73367
73984
  value: function request(params) {
73368
73985
  return _async_to_generator(function() {
73369
- var _this, adType, adName, regionId, regionInfo;
73986
+ var _this, adType, adName, regionId, regionInfo, result;
73370
73987
  return _ts_generator(this, function(_state) {
73371
73988
  switch(_state.label){
73372
73989
  case 0:
@@ -73402,7 +74019,19 @@ var PrebidReviveProvider = /*#__PURE__*/ function(ContentProvider) {
73402
74019
  ];
73403
74020
  case 2:
73404
74021
  _state.sent();
73405
- PrebidRevive.defineSlot(this.options, regionId, this.workingSlotId, adType, adName);
74022
+ return [
74023
+ 4,
74024
+ PrebidRevive.defineSlot(this.options, regionId, this.workingSlotId, adType, adName)
74025
+ ];
74026
+ case 3:
74027
+ result = _state.sent();
74028
+ if (!result) {
74029
+ this.context.logger.warn("No ad unit found for regionId: ".concat(regionId));
74030
+ this.notify();
74031
+ return [
74032
+ 2
74033
+ ];
74034
+ }
73406
74035
  PrebidRevive.request(regionId, this.workingSlotId, function(content) {
73407
74036
  return _async_to_generator(function() {
73408
74037
  var content2;
@@ -73467,6 +74096,76 @@ var PrebidReviveProvider = /*#__PURE__*/ function(ContentProvider) {
73467
74096
  });
73468
74097
  }).call(this);
73469
74098
  }
74099
+ },
74100
+ {
74101
+ key: "requestInstream",
74102
+ value: function requestInstream(params) {
74103
+ return _async_to_generator(function() {
74104
+ var _this;
74105
+ return _ts_generator(this, function(_state) {
74106
+ _this = this;
74107
+ return [
74108
+ 2,
74109
+ new Promise(function(resolve) {
74110
+ return _async_to_generator(function() {
74111
+ var adSlotId, adSlot, result;
74112
+ return _ts_generator(this, function(_state) {
74113
+ switch(_state.label){
74114
+ case 0:
74115
+ adSlotId = params.adSlot;
74116
+ if (!adSlotId && params.roles && params.roles.length > 0) {
74117
+ adSlot = this.options.units.find(function(unit) {
74118
+ var _params_roles;
74119
+ return unit._brndts_role !== void 0 && ((_params_roles = params.roles) === null || _params_roles === void 0 ? void 0 : _params_roles.includes(unit._brndts_role));
74120
+ });
74121
+ adSlotId = adSlot === null || adSlot === void 0 ? void 0 : adSlot.code;
74122
+ }
74123
+ if (!adSlotId) {
74124
+ console.warn("No adSlot or roles provided for instream ad request.");
74125
+ resolve({});
74126
+ return [
74127
+ 2
74128
+ ];
74129
+ }
74130
+ return [
74131
+ 4,
74132
+ prebidReviveReady.promise
74133
+ ];
74134
+ case 1:
74135
+ _state.sent();
74136
+ return [
74137
+ 4,
74138
+ PrebidRevive.defineSlot(this.options, adSlotId, adSlotId)
74139
+ ];
74140
+ case 2:
74141
+ result = _state.sent();
74142
+ if (!result) {
74143
+ console.warn("No ad unit found for instream adSlot: ".concat(adSlotId));
74144
+ resolve({});
74145
+ return [
74146
+ 2
74147
+ ];
74148
+ }
74149
+ PrebidRevive.requestInstream(this.options, adSlotId, adSlotId, function(content) {
74150
+ if (content === null) {
74151
+ resolve({});
74152
+ return;
74153
+ }
74154
+ resolve({
74155
+ vastTagUrl: content
74156
+ });
74157
+ });
74158
+ return [
74159
+ 2
74160
+ ];
74161
+ }
74162
+ });
74163
+ }).call(_this);
74164
+ })
74165
+ ];
74166
+ });
74167
+ }).call(this);
74168
+ }
73470
74169
  }
73471
74170
  ]);
73472
74171
  return PrebidReviveProvider;
@@ -73520,6 +74219,22 @@ var GPTProvider = /*#__PURE__*/ function(ContentProvider) {
73520
74219
  });
73521
74220
  }).call(this);
73522
74221
  }
74222
+ },
74223
+ {
74224
+ key: "requestInstream",
74225
+ value: function requestInstream() {
74226
+ return _async_to_generator(function() {
74227
+ var params;
74228
+ var _arguments = arguments;
74229
+ return _ts_generator(this, function(_state) {
74230
+ params = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {};
74231
+ return [
74232
+ 2,
74233
+ Promise.resolve({})
74234
+ ];
74235
+ });
74236
+ }).apply(this, arguments);
74237
+ }
73523
74238
  }
73524
74239
  ]);
73525
74240
  return GPTProvider;
@@ -73594,6 +74309,22 @@ var DebugProvider = /*#__PURE__*/ function(ContentProvider) {
73594
74309
  });
73595
74310
  }).call(this);
73596
74311
  }
74312
+ },
74313
+ {
74314
+ key: "requestInstream",
74315
+ value: function requestInstream() {
74316
+ return _async_to_generator(function() {
74317
+ var params;
74318
+ var _arguments = arguments;
74319
+ return _ts_generator(this, function(_state) {
74320
+ params = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {};
74321
+ return [
74322
+ 2,
74323
+ Promise.resolve({})
74324
+ ];
74325
+ });
74326
+ }).apply(this, arguments);
74327
+ }
73597
74328
  }
73598
74329
  ]);
73599
74330
  return DebugProvider;
@@ -79648,9 +80379,7 @@ var AuxElementsRenderer = /*#__PURE__*/ function() {
79648
80379
  }, {
79649
80380
  width: this.regionsContainerView.width,
79650
80381
  height: this.regionsContainerView.height
79651
- }, {}, {
79652
- provider: ContentProviderFactory.getProvider(this.context, this.context.config.get("ads").provider)
79653
- });
80382
+ }, {}, {});
79654
80383
  this.auxElementsData.push({
79655
80384
  box: {
79656
80385
  x1: 0,
@@ -84334,6 +85063,7 @@ var ControlTopBar = /*#__PURE__*/ function() {
84334
85063
  });
84335
85064
  this.context.store.subscribe(this.handleStateChange.bind(this));
84336
85065
  if ((_this_context_config_get = this.context.config.get("controls")) === null || _this_context_config_get === void 0 ? void 0 : (_this_context_config_get_elements = _this_context_config_get.elements) === null || _this_context_config_get_elements === void 0 ? void 0 : _this_context_config_get_elements.progress_ind) {
85066
+ var _this_context_data, _this_context_media;
84337
85067
  var ind = new ProgressBanner({
84338
85068
  indicators: [
84339
85069
  {
@@ -84346,10 +85076,10 @@ var ControlTopBar = /*#__PURE__*/ function() {
84346
85076
  }
84347
85077
  ]
84348
85078
  });
84349
- this.context.data.on("UPDATE", function() {
85079
+ (_this_context_data = this.context.data) === null || _this_context_data === void 0 ? void 0 : _this_context_data.on("UPDATE", function() {
84350
85080
  ind.setValue("BRNDTS_LOADING", _this.context.data.progress());
84351
85081
  });
84352
- this.context.media.on("TIME_UPDATE", function(param) {
85082
+ (_this_context_media = this.context.media) === null || _this_context_media === void 0 ? void 0 : _this_context_media.on("TIME_UPDATE", function(param) {
84353
85083
  var time = param.time, duration = param.duration;
84354
85084
  ind.setValue("PLAYER_TIME", time / duration * 100);
84355
85085
  });
@@ -85804,6 +86534,64 @@ var VideoAds = /*#__PURE__*/ function() {
85804
86534
  return entry.inst;
85805
86535
  }
85806
86536
  },
86537
+ {
86538
+ key: "getDetachedInstreamAds",
86539
+ value: function getDetachedInstreamAds() {
86540
+ return _async_to_generator(function() {
86541
+ var provider, instreamInfo, e2;
86542
+ return _ts_generator(this, function(_state) {
86543
+ switch(_state.label){
86544
+ case 0:
86545
+ provider = ContentProviderFactory.getProvider(this.context, this.context.config.get("ads").provider);
86546
+ _state.label = 1;
86547
+ case 1:
86548
+ _state.trys.push([
86549
+ 1,
86550
+ 3,
86551
+ ,
86552
+ 4
86553
+ ]);
86554
+ return [
86555
+ 4,
86556
+ provider.requestInstream({
86557
+ roles: [
86558
+ "pre-roll"
86559
+ ]
86560
+ })
86561
+ ];
86562
+ case 2:
86563
+ instreamInfo = _state.sent();
86564
+ if (!instreamInfo.vastTagUrl) {
86565
+ return [
86566
+ 2,
86567
+ []
86568
+ ];
86569
+ }
86570
+ return [
86571
+ 2,
86572
+ [
86573
+ {
86574
+ timeOffset: "00:00:00",
86575
+ vast: instreamInfo.vastTagUrl
86576
+ }
86577
+ ]
86578
+ ];
86579
+ case 3:
86580
+ e2 = _state.sent();
86581
+ ErrorHandler.handle(e2);
86582
+ return [
86583
+ 2,
86584
+ []
86585
+ ];
86586
+ case 4:
86587
+ return [
86588
+ 2
86589
+ ];
86590
+ }
86591
+ });
86592
+ }).call(this);
86593
+ }
86594
+ },
85807
86595
  {
85808
86596
  key: "destroy",
85809
86597
  value: function destroy() {
@@ -85858,6 +86646,12 @@ var Ads = /*#__PURE__*/ function() {
85858
86646
  });
85859
86647
  }
85860
86648
  },
86649
+ {
86650
+ key: "getDetachedInstreamAds",
86651
+ value: function getDetachedInstreamAds() {
86652
+ return this.videoAds.getDetachedInstreamAds();
86653
+ }
86654
+ },
85861
86655
  {
85862
86656
  key: "updateSize",
85863
86657
  value: function updateSize() {
@@ -90466,10 +91260,17 @@ var BrndtsAds = /*#__PURE__*/ function() {
90466
91260
  {
90467
91261
  key: "handleConnected",
90468
91262
  value: function handleConnected() {
90469
- this.ready.resolve(true);
90470
- this.context.logger.log("connected to service");
90471
- this.context.ads = new Ads_default(this.context);
90472
- this.context.ads.start();
91263
+ return _async_to_generator(function() {
91264
+ return _ts_generator(this, function(_state) {
91265
+ this.context.logger.log("connected to service");
91266
+ this.context.ads = new Ads_default(this.context);
91267
+ this.context.ads.start();
91268
+ this.ready.resolve(true);
91269
+ return [
91270
+ 2
91271
+ ];
91272
+ });
91273
+ }).call(this);
90473
91274
  }
90474
91275
  },
90475
91276
  {
@@ -90517,6 +91318,16 @@ var BrndtsAds = /*#__PURE__*/ function() {
90517
91318
  this.context.config.set("controls", controlsConfig);
90518
91319
  }
90519
91320
  },
91321
+ {
91322
+ key: "getDetachedInstreamAds",
91323
+ value: function getDetachedInstreamAds() {
91324
+ if (!this.ready.value || this.context.ads === void 0) {
91325
+ console.warn("Ads not ready yet!");
91326
+ return Promise.resolve([]);
91327
+ }
91328
+ return this.context.ads.getDetachedInstreamAds();
91329
+ }
91330
+ },
90520
91331
  {
90521
91332
  key: "rewind",
90522
91333
  value: function rewind(value2) {
@@ -90549,7 +91360,9 @@ var BrndtsAds = /*#__PURE__*/ function() {
90549
91360
  ]);
90550
91361
  return BrndtsAds;
90551
91362
  }();
90552
- export { BrndtsAds as default }; /*! Bundled license information:
91363
+ export { BrndtsAds as default }; //! TEST
91364
+ //!
91365
+ /*! Bundled license information:
90553
91366
 
90554
91367
  @fortawesome/fontawesome-svg-core/index.mjs:
90555
91368
  @fortawesome/free-solid-svg-icons/index.mjs: