@brndts/brndts-ads 1.12.0 → 1.13.0

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.js CHANGED
@@ -67659,6 +67659,16 @@ var BRNDTSConfig = /*#__PURE__*/ function() {
67659
67659
  }).apply(this, arguments);
67660
67660
  }
67661
67661
  },
67662
+ {
67663
+ key: "refresh",
67664
+ value: function refresh(provided, refetch) {
67665
+ this.provided = provided || this.provided;
67666
+ if ((refetch === null || refetch === void 0 ? void 0 : refetch.host) && (refetch === null || refetch === void 0 ? void 0 : refetch.key)) {
67667
+ this.fetch(refetch);
67668
+ }
67669
+ this.merge();
67670
+ }
67671
+ },
67662
67672
  {
67663
67673
  key: "get",
67664
67674
  value: function get(key) {
@@ -67812,7 +67822,6 @@ var AdsConfigsClass = /*#__PURE__*/ function(BRNDTSConfig) {
67812
67822
  general: _object_spread({}, ((_this_remote = _this.remote) === null || _this_remote === void 0 ? void 0 : _this_remote.general) || {}),
67813
67823
  adStrategies: strategies
67814
67824
  };
67815
- console.log("Ads strategies fetched", _this.remote);
67816
67825
  _this.merge();
67817
67826
  })
67818
67827
  ];
@@ -67835,15 +67844,21 @@ var Config = /*#__PURE__*/ function() {
67835
67844
  var _providedConfigs_auth;
67836
67845
  this.genericConfigs = new GenericConfigsClass(providedConfigs);
67837
67846
  this.adsConfigs = new AdsConfigsClass(providedAdsConfigs || {});
67838
- console.log("BRNDTS Config initialized", providedConfigs, providedAdsConfigs);
67839
67847
  if (!((_providedConfigs_auth = providedConfigs.auth) === null || _providedConfigs_auth === void 0 ? void 0 : _providedConfigs_auth.host)) {
67840
67848
  throw new InternalError("No authority configuration provided!");
67841
67849
  }
67842
67850
  if (!providedConfigs.key) {
67843
- throw new InternalError("No host or key provided!");
67851
+ throw new InternalError("No key provided!");
67844
67852
  }
67845
67853
  }
67846
67854
  _create_class(Config, [
67855
+ {
67856
+ key: "refresh",
67857
+ value: function refresh(providedConfigs, providedAdsConfigs) {
67858
+ this.genericConfigs.refresh(providedConfigs);
67859
+ this.adsConfigs.refresh(providedAdsConfigs);
67860
+ }
67861
+ },
67847
67862
  {
67848
67863
  key: "fetch",
67849
67864
  value: function fetch1() {
@@ -69042,6 +69057,22 @@ var RecorderFactory = /*#__PURE__*/ function() {
69042
69057
  }();
69043
69058
  // src/Ads/Providers/BRNDTSDefault/BRNDTSDefaultProvider.ts
69044
69059
  var icon = '\n<?xml version="1.0" encoding="UTF-8"?>\n<svg id="Camada_1" data-name="Camada 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 875 245">\n <defs>\n <style>\n .cls-1 {\n fill: #fff;\n }\n </style>\n </defs>\n <g>\n <path class="cls-1" d="M279.16,182.12v-116.12h48.13c12.5,0,21.49,2.76,26.96,8.28,5.47,5.52,8.2,13.08,8.2,22.66,0,4.48-.6,8.41-1.8,11.8-1.2,3.39-2.97,6.2-5.31,8.44-2.34,2.24-5.29,3.78-8.83,4.61,2.71.73,5.26,1.82,7.66,3.28,2.4,1.46,4.48,3.39,6.25,5.78,1.77,2.4,3.15,5.21,4.14,8.44.99,3.23,1.48,6.88,1.48,10.94,0,7.61-1.36,13.75-4.06,18.44-2.71,4.69-6.77,8.1-12.19,10.24-5.42,2.14-12.14,3.2-20.16,3.2h-50.48ZM309.48,111.64h17.5c2.29,0,3.98-.88,5.08-2.66,1.09-1.77,1.64-3.96,1.64-6.56,0-3.54-.7-5.96-2.11-7.27-1.41-1.3-2.94-1.95-4.61-1.95h-17.5v18.44ZM309.48,154.93h19.22c1.88,0,3.44-.42,4.69-1.25,1.25-.83,2.21-2,2.89-3.52.68-1.51,1.02-3.31,1.02-5.39s-.34-3.88-1.02-5.39c-.68-1.51-1.64-2.68-2.89-3.52-1.25-.83-2.81-1.25-4.69-1.25h-19.22v20.32Z"/>\n <path class="cls-1" d="M379.65,182.12v-116.12h49.54c5.1,0,9.79.63,14.07,1.88,4.27,1.25,7.97,3.36,11.1,6.33,3.13,2.97,5.55,6.95,7.27,11.96s2.58,11.31,2.58,18.91c0,4.79-.42,8.96-1.25,12.5-.84,3.54-1.95,6.54-3.36,8.99-1.41,2.45-3.07,4.51-5,6.17-1.93,1.67-3.99,3.13-6.17,4.38l20.16,45.01h-30.79l-16.25-40.01h-11.57v40.01h-30.32ZM409.97,118.05h13.75c1.67,0,3.13-.23,4.38-.7s2.32-1.22,3.2-2.27c.88-1.04,1.54-2.37,1.95-3.98.41-1.61.62-3.57.62-5.86s-.21-4.22-.62-5.78c-.42-1.56-1.07-2.79-1.95-3.67-.89-.88-1.95-1.54-3.2-1.95-1.25-.42-2.71-.62-4.38-.62h-13.75v24.85Z"/>\n <path class="cls-1" d="M479.67,182.12v-116.12h24.07l40.79,64.7v-64.7h30.32v116.12h-24.07l-40.79-64.7v64.7h-30.32Z"/>\n <path class="cls-1" d="M592.03,182.12v-116.12h51.26c8.44,0,15.37,1.48,20.79,4.45,5.42,2.97,9.69,7.11,12.81,12.42,3.13,5.31,5.31,11.49,6.56,18.52,1.25,7.03,1.88,14.61,1.88,22.74,0,13.65-1.54,24.72-4.61,33.21-3.07,8.49-7.71,14.74-13.91,18.75-6.2,4.01-14.04,6.02-23.52,6.02h-51.26ZM622.35,154.93h17.82c3.85,0,6.85-1.04,8.99-3.13,2.13-2.08,3.65-5.39,4.53-9.92.88-4.53,1.33-10.44,1.33-17.74,0-6.88-.34-12.37-1.02-16.49-.68-4.11-1.67-7.21-2.97-9.3-1.3-2.08-2.87-3.46-4.69-4.14-1.82-.68-3.88-1.02-6.17-1.02h-17.82v61.73Z"/>\n <path class="cls-1" d="M721.9,182.12v-88.92h-29.22v-27.19h88.77v27.19h-29.22v88.92h-30.32Z"/>\n <path class="cls-1" d="M828.95,183.06c-3.44,0-6.8-.11-10.08-.31-3.28-.21-6.51-.52-9.69-.94-3.18-.42-6.23-.88-9.14-1.41-2.92-.52-5.73-1.15-8.44-1.88v-24.07c3.54.31,7.37.57,11.49.78,4.11.21,8.28.37,12.5.47,4.22.1,8.15.16,11.8.16,3.44,0,6.3-.26,8.6-.78,2.29-.52,4.01-1.35,5.16-2.5,1.15-1.15,1.72-2.71,1.72-4.69v-1.88c0-2.29-.81-4.01-2.42-5.16-1.62-1.15-3.52-1.72-5.7-1.72h-8.28c-12.09,0-21.25-2.66-27.51-7.97-6.25-5.31-9.38-14.22-9.38-26.72v-5.16c0-11.46,3.44-20.03,10.31-25.71,6.88-5.68,16.77-8.52,29.69-8.52,4.9,0,9.51.23,13.83.7,4.32.47,8.39,1.04,12.19,1.72,3.8.68,7.21,1.38,10.24,2.11v24.07c-4.79-.42-10.18-.75-16.17-1.02-5.99-.26-11.44-.39-16.33-.39-2.92,0-5.52.21-7.81.63-2.29.42-4.06,1.25-5.31,2.5-1.25,1.25-1.88,3.07-1.88,5.47v1.56c0,2.61.83,4.59,2.5,5.94,1.67,1.36,4.22,2.03,7.66,2.03h10.31c7.29,0,13.36,1.38,18.21,4.14,4.84,2.76,8.49,6.51,10.94,11.25,2.45,4.74,3.67,10.13,3.67,16.17v5.16c0,9.9-1.72,17.45-5.16,22.66-3.44,5.21-8.34,8.73-14.69,10.55-6.36,1.82-13.96,2.74-22.82,2.74Z"/>\n </g>\n <path class="cls-1" d="M193.77,2.19H53.62C25.87,2.19,3.39,24.68,3.39,52.42v140.15c0,27.75,22.49,50.23,50.23,50.23h140.15c27.75,0,50.23-22.49,50.23-50.23V52.42c0-27.74-22.49-50.23-50.23-50.23ZM127.13,65.24c0-9.25,7.5-16.74,16.74-16.74h53.45v53.45c0,9.25-7.5,16.74-16.74,16.74h-53.45v-53.45ZM120.23,179.77c0,9.25-7.5,16.74-16.74,16.74h-36.71c-9.25,0-16.74-7.5-16.74-16.74v-114.53c0-9.25,7.5-16.74,16.74-16.74h36.71c9.25,0,16.74,7.5,16.74,16.74v114.53ZM197.33,162.19c-.55,18.26-16.3,33.95-34.45,34.31-17.61.35-33.5-12.89-35.21-30.88-1.15-12.1-.22-24.4-.22-38.93,14.98,0,27.35-.98,39.49.23,18.36,1.83,30.93,17.24,30.38,35.27Z"/>\n</svg>';
69060
+ function getContentFromTemplate(w2, h) {
69061
+ var container = document.createElement("div");
69062
+ container.classList.add("BRNDTS_default_content");
69063
+ container.style.width = "100%";
69064
+ container.style.height = "100%";
69065
+ var box = document.createElement("div");
69066
+ box.classList.add("box");
69067
+ box.style.width = "".concat(w2, "px");
69068
+ box.style.height = "".concat(h, "px");
69069
+ var iconBox = document.createElement("div");
69070
+ iconBox.classList.add("icon");
69071
+ iconBox.innerHTML = icon;
69072
+ box.appendChild(iconBox);
69073
+ container.appendChild(box);
69074
+ return container;
69075
+ }
69045
69076
  var BRNDTSDefaultProvider = /*#__PURE__*/ function(ContentProvider) {
69046
69077
  _inherits(BRNDTSDefaultProvider, ContentProvider);
69047
69078
  function BRNDTSDefaultProvider(context) {
@@ -69051,21 +69082,8 @@ var BRNDTSDefaultProvider = /*#__PURE__*/ function(ContentProvider) {
69051
69082
  context,
69052
69083
  void 0
69053
69084
  ]);
69054
- var container = document.createElement("div");
69055
- container.classList.add("BRNDTS_default_content");
69056
- container.style.width = "100%";
69057
- container.style.height = "100%";
69058
- var box = document.createElement("div");
69059
- box.classList.add("box");
69060
- var iconBox = document.createElement("div");
69061
- iconBox.classList.add("icon");
69062
- iconBox.innerHTML = icon;
69063
- box.appendChild(iconBox);
69064
- container.appendChild(box);
69065
69085
  _this.content = {
69066
- content: [
69067
- container
69068
- ],
69086
+ content: [],
69069
69087
  type: "brndts_placeholder"
69070
69088
  };
69071
69089
  return _this;
@@ -69073,14 +69091,26 @@ var BRNDTSDefaultProvider = /*#__PURE__*/ function(ContentProvider) {
69073
69091
  _create_class(BRNDTSDefaultProvider, [
69074
69092
  {
69075
69093
  key: "request",
69076
- value: function request() {
69094
+ value: function request(params) {
69077
69095
  return _async_to_generator(function() {
69078
69096
  return _ts_generator(this, function(_state) {
69097
+ this.content = _object_spread_props(_object_spread({}, this.content), {
69098
+ content: [
69099
+ getContentFromTemplate(params.size.width, params.size.height)
69100
+ ],
69101
+ extra: _object_spread_props(_object_spread({}, this.content.extra || {}), {
69102
+ sz: {
69103
+ w: params.size.width,
69104
+ h: params.size.height
69105
+ }
69106
+ })
69107
+ });
69108
+ this.notify();
69079
69109
  return [
69080
69110
  2
69081
69111
  ];
69082
69112
  });
69083
- })();
69113
+ }).call(this);
69084
69114
  }
69085
69115
  }
69086
69116
  ]);
@@ -69872,7 +69902,7 @@ var PrebidJS = /*#__PURE__*/ function() {
69872
69902
  value: function configure(context, options) {
69873
69903
  var _window_pbjs_que, _window_pbjs;
69874
69904
  (_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() {
69875
- var _context_config_getAdsConfig_general_debug_mode, _context_config_getAdsConfig_general, _window_pbjs, _window_pbjs1;
69905
+ var _context_config_getAdsConfig_general_debug_mode, _context_config_getAdsConfig_general, _window_pbjs, _window_pbjs1, _window_pbjs2;
69876
69906
  var configBuilder = new PrebidConfigBuilder();
69877
69907
  configBuilder.setDebug((_context_config_getAdsConfig_general = context.config.getAdsConfig().general) === null || _context_config_getAdsConfig_general === void 0 ? void 0 : (_context_config_getAdsConfig_general_debug_mode = _context_config_getAdsConfig_general.debug_mode) === null || _context_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _context_config_getAdsConfig_general_debug_mode.value).setGAMConfiguration().setUserConfig({
69878
69908
  userIds: [
@@ -69891,8 +69921,11 @@ var PrebidJS = /*#__PURE__*/ function() {
69891
69921
  ]
69892
69922
  }).addConsent(context.consent);
69893
69923
  (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.setConfig(configBuilder.build());
69924
+ (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : _window_pbjs1.enableAnalytics({
69925
+ provider: "smartyads"
69926
+ });
69894
69927
  context.logger.log("Prebid.js configuration set.");
69895
- (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : _window_pbjs1.setBidderConfig({
69928
+ (_window_pbjs2 = window.pbjs) === null || _window_pbjs2 === void 0 ? void 0 : _window_pbjs2.setBidderConfig({
69896
69929
  bidders: [
69897
69930
  "bidderA"
69898
69931
  ],
@@ -69908,9 +69941,9 @@ var PrebidJS = /*#__PURE__*/ function() {
69908
69941
  }
69909
69942
  });
69910
69943
  for(var bidderName in options.bidders){
69911
- var _window_pbjs2;
69944
+ var _window_pbjs3;
69912
69945
  var bidderConfig = options.bidders[bidderName];
69913
- (_window_pbjs2 = window.pbjs) === null || _window_pbjs2 === void 0 ? void 0 : _window_pbjs2.setBidderConfig({
69946
+ (_window_pbjs3 = window.pbjs) === null || _window_pbjs3 === void 0 ? void 0 : _window_pbjs3.setBidderConfig({
69914
69947
  bidders: [
69915
69948
  bidderName.toLowerCase()
69916
69949
  ],
@@ -70356,7 +70389,7 @@ var PrebidGAM = /*#__PURE__*/ function() {
70356
70389
  value: function configure(context, options) {
70357
70390
  var _window_pbjs_que, _window_pbjs;
70358
70391
  (_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() {
70359
- var _context_config_getAdsConfig_general_debug_mode, _context_config_getAdsConfig_general, _window_pbjs, _window_pbjs1;
70392
+ var _context_config_getAdsConfig_general_debug_mode, _context_config_getAdsConfig_general, _window_pbjs, _window_pbjs1, _window_pbjs2;
70360
70393
  var configBuilder = new PrebidConfigBuilder();
70361
70394
  configBuilder.setDebug((_context_config_getAdsConfig_general = context.config.getAdsConfig().general) === null || _context_config_getAdsConfig_general === void 0 ? void 0 : (_context_config_getAdsConfig_general_debug_mode = _context_config_getAdsConfig_general.debug_mode) === null || _context_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _context_config_getAdsConfig_general_debug_mode.value).setGAMConfiguration().setUserConfig({
70362
70395
  userIds: [
@@ -70375,8 +70408,11 @@ var PrebidGAM = /*#__PURE__*/ function() {
70375
70408
  ]
70376
70409
  }).addConsent(context.consent);
70377
70410
  (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.setConfig(configBuilder.build());
70411
+ (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : _window_pbjs1.enableAnalytics({
70412
+ provider: "smartyads"
70413
+ });
70378
70414
  context.logger.log("Prebid.js configuration set.");
70379
- (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : _window_pbjs1.setBidderConfig({
70415
+ (_window_pbjs2 = window.pbjs) === null || _window_pbjs2 === void 0 ? void 0 : _window_pbjs2.setBidderConfig({
70380
70416
  bidders: [
70381
70417
  "bidderA"
70382
70418
  ],
@@ -70392,9 +70428,9 @@ var PrebidGAM = /*#__PURE__*/ function() {
70392
70428
  }
70393
70429
  });
70394
70430
  for(var bidderName in options.bidders){
70395
- var _window_pbjs2;
70431
+ var _window_pbjs3;
70396
70432
  var bidderConfig = options.bidders[bidderName];
70397
- (_window_pbjs2 = window.pbjs) === null || _window_pbjs2 === void 0 ? void 0 : _window_pbjs2.setBidderConfig({
70433
+ (_window_pbjs3 = window.pbjs) === null || _window_pbjs3 === void 0 ? void 0 : _window_pbjs3.setBidderConfig({
70398
70434
  bidders: [
70399
70435
  bidderName.toLowerCase()
70400
70436
  ],
@@ -70462,7 +70498,9 @@ var PrebidGAM = /*#__PURE__*/ function() {
70462
70498
  var _unitDefinition_mediaTypes_banner;
70463
70499
  sizes = ((_unitDefinition_mediaTypes_banner = unitDefinition.mediaTypes.banner) === null || _unitDefinition_mediaTypes_banner === void 0 ? void 0 : _unitDefinition_mediaTypes_banner.sizes) || [];
70464
70500
  }
70465
- GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), sizes, "".concat(containerId));
70501
+ GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), [
70502
+ sizes[0] || []
70503
+ ], "".concat(containerId));
70466
70504
  if (!((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
70467
70505
  return "".concat(containerId) === "".concat(defUnit.code);
70468
70506
  }))) {
@@ -70634,7 +70672,6 @@ var PrebidGAMProvider = /*#__PURE__*/ function(ContentProvider1) {
70634
70672
  ];
70635
70673
  case 2:
70636
70674
  _state.sent();
70637
- console.log("Requesting ad for region ".concat(regionId, " with size ").concat(params.size.width, "x").concat(params.size.height));
70638
70675
  PrebidGAM.defineSlot(this.options, regionId, this.workingSlotId, adType, adName);
70639
70676
  PrebidGAM.request(regionId, this.workingSlotId, function(content) {
70640
70677
  content.style.width = "".concat(regionInfo === null || regionInfo === void 0 ? void 0 : regionInfo.w, "px");
@@ -71039,7 +71076,6 @@ var RegionBox = /*#__PURE__*/ function(_import_events_default) {
71039
71076
  var RegionContent = /*#__PURE__*/ function() {
71040
71077
  function RegionContent(id, plane, box, ctx) {
71041
71078
  _class_call_check(this, RegionContent);
71042
- var _this_ctx;
71043
71079
  this.scale = null;
71044
71080
  this.id = id;
71045
71081
  this.plane = plane;
@@ -71049,9 +71085,6 @@ var RegionContent = /*#__PURE__*/ function() {
71049
71085
  this.container.id = "BRNDTS_RB_".concat(this.id);
71050
71086
  this.container.classList.add("BRNDTS_RB");
71051
71087
  this.container.dataset.state = "hidden";
71052
- if ((_this_ctx = this.ctx) === null || _this_ctx === void 0 ? void 0 : _this_ctx.color) {
71053
- this.container.style.backgroundColor = "#".concat(this.ctx.color, "73");
71054
- }
71055
71088
  this.render();
71056
71089
  }
71057
71090
  _create_class(RegionContent, [
@@ -71369,7 +71402,6 @@ var RegionDebugPlugin = /*#__PURE__*/ function() {
71369
71402
  region.content.view.classList.toggle("BRNDTS_AUXR_B", true);
71370
71403
  if (region.content.view) {
71371
71404
  region.content.view.style.borderColor = "#".concat(color, "73");
71372
- region.content.view.style.backgroundColor = "#".concat(color, "73");
71373
71405
  region.content.view.style.borderStyle = "solid";
71374
71406
  region.content.view.style.borderWidth = "2px";
71375
71407
  }
@@ -71381,7 +71413,6 @@ var RegionDebugPlugin = /*#__PURE__*/ function() {
71381
71413
  value: function afterShow(region) {
71382
71414
  var _region_regionDescriptor_ctx, _region_regionDescriptor_ctx1, _region_regionDescriptor_ctx2;
71383
71415
  if (!region.regionDescriptor) {
71384
- console.log("No region descriptor", region);
71385
71416
  this.csLabel.remove();
71386
71417
  return Promise.resolve();
71387
71418
  }
@@ -71470,7 +71501,7 @@ var Region = /*#__PURE__*/ function() {
71470
71501
  function Region(id, regionDescriptor, planeDescriptor, options, deps) {
71471
71502
  var _this = this;
71472
71503
  _class_call_check(this, Region);
71473
- var _this_deps_config_getAdsConfig_general, _this_deps_config, _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general1, _this_deps_config_getAdsConfig_general_debug_mode1, _this_deps_config_getAdsConfig_general2, _this_deps_config1;
71504
+ var _this_deps_config_getAdsConfig_general_clickability, _this_deps_config_getAdsConfig_general, _this_deps_config, _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general1, _this_deps_config1, _this_deps_config_getAdsConfig_general_debug_mode1, _this_deps_config_getAdsConfig_general2, _this_deps_config2;
71474
71505
  this.onScreen = false;
71475
71506
  this.visible = false;
71476
71507
  this.plugins = [];
@@ -71487,12 +71518,13 @@ var Region = /*#__PURE__*/ function() {
71487
71518
  this.container.classList.add("BRNDTS_R");
71488
71519
  this.container.style.position = "absolute";
71489
71520
  this.container.style.display = "none";
71490
- if (!((_this_deps_config = this.deps.config) === null || _this_deps_config === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general = _this_deps_config.getAdsConfig().general) === null || _this_deps_config_getAdsConfig_general === void 0 ? void 0 : _this_deps_config_getAdsConfig_general.clickability) || ((_this_deps_config_getAdsConfig_general1 = this.deps.config.getAdsConfig().general) === null || _this_deps_config_getAdsConfig_general1 === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general_debug_mode = _this_deps_config_getAdsConfig_general1.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode.value)) {
71491
- this.container.style.pointerEvents = "none";
71492
- } else {
71521
+ if ((_this_deps_config = this.deps.config) === null || _this_deps_config === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general = _this_deps_config.getAdsConfig().general) === null || _this_deps_config_getAdsConfig_general === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general_clickability = _this_deps_config_getAdsConfig_general.clickability) === null || _this_deps_config_getAdsConfig_general_clickability === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_clickability.value) {
71493
71522
  this.container.style.pointerEvents = "all";
71494
71523
  }
71495
- this.content = new RegionContent(this.id, this.plane, this.box, ((_this_deps_config1 = this.deps.config) === null || _this_deps_config1 === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general2 = _this_deps_config1.getAdsConfig().general) === null || _this_deps_config_getAdsConfig_general2 === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general_debug_mode1 = _this_deps_config_getAdsConfig_general2.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode1 === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode1.value) ? this.regionDescriptor.ctx : void 0);
71524
+ if ((_this_deps_config1 = this.deps.config) === null || _this_deps_config1 === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general1 = _this_deps_config1.getAdsConfig().general) === null || _this_deps_config_getAdsConfig_general1 === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general_debug_mode = _this_deps_config_getAdsConfig_general1.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode.value) {
71525
+ this.container.style.pointerEvents = "none";
71526
+ }
71527
+ this.content = new RegionContent(this.id, this.plane, this.box, ((_this_deps_config2 = this.deps.config) === null || _this_deps_config2 === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general2 = _this_deps_config2.getAdsConfig().general) === null || _this_deps_config_getAdsConfig_general2 === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general_debug_mode1 = _this_deps_config_getAdsConfig_general2.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode1 === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode1.value) ? this.regionDescriptor.ctx : void 0);
71496
71528
  this.container.appendChild(this.content.view);
71497
71529
  this.handleClick = this.handleClick.bind(this);
71498
71530
  this.handleMouseEnter = this.handleMouseEnter.bind(this);
@@ -71806,7 +71838,7 @@ var Region = /*#__PURE__*/ function() {
71806
71838
  key: "render",
71807
71839
  value: function render(contours, box) {
71808
71840
  return _async_to_generator(function() {
71809
- var newBox, _this_deps_recorder, _this_deps_recorder1;
71841
+ var newBox, _this_deps_recorder, _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general, _this_deps_config, _this_deps_recorder1, debugMode;
71810
71842
  return _ts_generator(this, function(_state) {
71811
71843
  switch(_state.label){
71812
71844
  case 0:
@@ -71833,13 +71865,14 @@ var Region = /*#__PURE__*/ function() {
71833
71865
  (_this_deps_recorder = this.deps.recorder) === null || _this_deps_recorder === void 0 ? void 0 : _this_deps_recorder.presentationStateChanged(this);
71834
71866
  return [
71835
71867
  3,
71836
- 4
71868
+ 5
71837
71869
  ];
71838
71870
  case 1:
71839
71871
  if (!this.shouldHide()) return [
71840
71872
  3,
71841
- 3
71873
+ 4
71842
71874
  ];
71875
+ debugMode = (_this_deps_config = this.deps.config) === null || _this_deps_config === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general = _this_deps_config.getAdsConfig().general) === null || _this_deps_config_getAdsConfig_general === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general_debug_mode = _this_deps_config_getAdsConfig_general.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode.value;
71843
71876
  this.content.clear();
71844
71877
  return [
71845
71878
  4,
@@ -71852,15 +71885,20 @@ var Region = /*#__PURE__*/ function() {
71852
71885
  this.container.style.height = "0px";
71853
71886
  this.container.style.left = "0px";
71854
71887
  this.container.style.top = "0px";
71855
- this.applyPlugins("afterHide");
71888
+ return [
71889
+ 4,
71890
+ this.applyPlugins("afterHide")
71891
+ ];
71892
+ case 3:
71893
+ _state.sent();
71856
71894
  this.visible = false;
71857
71895
  this.content.destroy();
71858
71896
  (_this_deps_recorder1 = this.deps.recorder) === null || _this_deps_recorder1 === void 0 ? void 0 : _this_deps_recorder1.presentationStateChanged(this);
71859
71897
  return [
71860
71898
  3,
71861
- 4
71899
+ 5
71862
71900
  ];
71863
- case 3:
71901
+ case 4:
71864
71902
  if (this.visible) {
71865
71903
  this.container.style.width = "".concat(this.box.width(this.plane.size), "px");
71866
71904
  this.container.style.height = "".concat(this.box.height(this.plane.size), "px");
@@ -71869,8 +71907,8 @@ var Region = /*#__PURE__*/ function() {
71869
71907
  this.content.render();
71870
71908
  this.applyPlugins("reRender");
71871
71909
  }
71872
- _state.label = 4;
71873
- case 4:
71910
+ _state.label = 5;
71911
+ case 5:
71874
71912
  this.applyPlugins("afterRender");
71875
71913
  return [
71876
71914
  2
@@ -71960,9 +71998,9 @@ var StaticAdRegion = /*#__PURE__*/ function(Region) {
71960
71998
  function StaticAdRegion(id, planeDescriptor, options, deps) {
71961
71999
  _class_call_check(this, StaticAdRegion);
71962
72000
  var _this;
71963
- var _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general, _this_deps_config;
72001
+ var _options_ad, _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general, _this_deps_config;
71964
72002
  _this = _call_super(this, StaticAdRegion, [
71965
- "".concat(id),
72003
+ "".concat((options === null || options === void 0 ? void 0 : (_options_ad = options.ad) === null || _options_ad === void 0 ? void 0 : _options_ad.name) || id),
71966
72004
  {
71967
72005
  id: id,
71968
72006
  contours: [],
@@ -71981,6 +72019,9 @@ var StaticAdRegion = /*#__PURE__*/ function(Region) {
71981
72019
  _this.content.view.remove();
71982
72020
  _this.content = new StaticRegionContent(_this.id, _this.plane, _this.box, ((_this_deps_config = _this.deps.config) === null || _this_deps_config === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general = _this_deps_config.getAdsConfig().general) === null || _this_deps_config_getAdsConfig_general === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general_debug_mode = _this_deps_config_getAdsConfig_general.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode.value) ? _this.regionDescriptor.ctx : void 0);
71983
72021
  _this.container.appendChild(_this.content.view);
72022
+ if (_this.deps.provider) {
72023
+ _this.content.addContent(_this.deps.provider.contents());
72024
+ }
71984
72025
  return _this;
71985
72026
  }
71986
72027
  _create_class(StaticAdRegion, [
@@ -74413,7 +74454,6 @@ var VideoJSMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74413
74454
  _this.emit("SEEKED");
74414
74455
  });
74415
74456
  (_this_instance4 = this.instance) === null || _this_instance4 === void 0 ? void 0 : _this_instance4.ready(function() {
74416
- console.log("VideoJS media is ready");
74417
74457
  _this.mediaIsReady();
74418
74458
  });
74419
74459
  }
@@ -74443,7 +74483,6 @@ var VideoJSMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74443
74483
  clone.autoplay = false;
74444
74484
  this.context.elements.original = clone;
74445
74485
  this.instance = this.media.player;
74446
- console.log("VideoJS media instance set", this.instance);
74447
74486
  if (this.instance) {
74448
74487
  this.instance.fluid(false);
74449
74488
  }
@@ -74530,15 +74569,15 @@ var VideoJSMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74530
74569
  {
74531
74570
  key: "currentTime",
74532
74571
  get: function get() {
74533
- var _this_media;
74534
- var _this_media_currentTime;
74535
- return (_this_media_currentTime = (_this_media = this.media) === null || _this_media === void 0 ? void 0 : _this_media.currentTime) !== null && _this_media_currentTime !== void 0 ? _this_media_currentTime : 0;
74572
+ var _this_instance;
74573
+ var _this_instance_currentTime;
74574
+ return (_this_instance_currentTime = (_this_instance = this.instance) === null || _this_instance === void 0 ? void 0 : _this_instance.currentTime()) !== null && _this_instance_currentTime !== void 0 ? _this_instance_currentTime : 0;
74536
74575
  },
74537
74576
  set: function set(value2) {
74538
74577
  if (!this.duration) return;
74539
74578
  var validTime = is_default.number(value2) && value2 > 0 ? Math.min(value2, this.duration) : 0;
74540
- if (this.media) {
74541
- this.media.currentTime = validTime;
74579
+ if (this.instance) {
74580
+ this.instance.currentTime(validTime);
74542
74581
  this.context.logger.log("Seeking to ".concat(this.currentTime, " seconds"));
74543
74582
  }
74544
74583
  }
@@ -74546,10 +74585,10 @@ var VideoJSMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74546
74585
  {
74547
74586
  key: "duration",
74548
74587
  get: function get() {
74549
- var _this_media;
74588
+ var _this_instance;
74550
74589
  var fauxDuration = /* this.context.config.duration */ void 0;
74551
- var _this_media_duration;
74552
- var realDuration = (_this_media_duration = (_this_media = this.media) === null || _this_media === void 0 ? void 0 : _this_media.duration) !== null && _this_media_duration !== void 0 ? _this_media_duration : 0;
74590
+ var _this_instance_duration;
74591
+ var realDuration = (_this_instance_duration = (_this_instance = this.instance) === null || _this_instance === void 0 ? void 0 : _this_instance.duration()) !== null && _this_instance_duration !== void 0 ? _this_instance_duration : 0;
74553
74592
  return fauxDuration || realDuration;
74554
74593
  }
74555
74594
  },
@@ -74689,7 +74728,7 @@ var VideoJSMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74689
74728
  key: "forward",
74690
74729
  value: function forward() {
74691
74730
  var seekTime = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : DEFAULT_SEEK_INTERVAL5;
74692
- this.currentTime += seekTime;
74731
+ this.currentTime = this.currentTime + seekTime;
74693
74732
  }
74694
74733
  },
74695
74734
  {
@@ -74785,6 +74824,10 @@ var MediaElementFactory = /*#__PURE__*/ function() {
74785
74824
  var _hasBradMaxPID = _sliced_to_array(hasBradMaxPID, 2), el1 = _hasBradMaxPID[0], value21 = _hasBradMaxPID[1];
74786
74825
  return el1;
74787
74826
  }
74827
+ var isVideoJS = element.querySelector("video-js");
74828
+ if (isVideoJS) {
74829
+ return isVideoJS;
74830
+ }
74788
74831
  return null;
74789
74832
  case "IFRAME":
74790
74833
  var url2 = element.getAttribute("src");
@@ -75034,7 +75077,6 @@ var VideoRegionsDataCollection = /*#__PURE__*/ function() {
75034
75077
  if (!to) {
75035
75078
  to = this.totalLengthSeconds;
75036
75079
  }
75037
- console.log("from : ", from, " to : ", to);
75038
75080
  var result = {};
75039
75081
  for(var index = 0; index < this.timestampList.length; index++){
75040
75082
  var element = +this.timestampList[index];
@@ -75197,7 +75239,6 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
75197
75239
  this.service.send("stop");
75198
75240
  this.service.destroy();
75199
75241
  this.regionsData.load(data);
75200
- console.log("loaded data");
75201
75242
  }
75202
75243
  var input = document.createElement("input");
75203
75244
  input.type = "file";
@@ -75217,7 +75258,6 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
75217
75258
  _this.service.send("stop");
75218
75259
  _this.service.destroy();
75219
75260
  _this.regionsData.load(parsedData);
75220
- console.log("loaded data");
75221
75261
  }
75222
75262
  };
75223
75263
  reader.readAsText(file);
@@ -75327,17 +75367,19 @@ var VideoRegionsDurationDecorator = /*#__PURE__*/ function(VideoRegionsDataManag
75327
75367
  if (!regions2 || !regions2.regions) {
75328
75368
  return null;
75329
75369
  }
75330
- var validRegions = regions2.regions.filter(function(reg, _, array) {
75331
- if (!last) {
75332
- last = array.map(function(r3) {
75333
- return r3.id;
75334
- });
75335
- result = _to_consumable_array(array);
75336
- }
75337
- if (last.includes(reg.id)) {
75338
- return true;
75339
- }
75340
- return false;
75370
+ if (!last) {
75371
+ last = regions2.regions.map(function(r3) {
75372
+ return r3.id;
75373
+ });
75374
+ result = _to_consumable_array(regions2.regions);
75375
+ return {
75376
+ timestamp_start: timestamp,
75377
+ timestamp_end: timestamp + totalDuration,
75378
+ regions: result
75379
+ };
75380
+ }
75381
+ var validRegions = regions2.regions.filter(function(reg) {
75382
+ return last === null || last === void 0 ? void 0 : last.includes(reg.id);
75341
75383
  });
75342
75384
  if (validRegions.length <= 0) {
75343
75385
  return null;
@@ -75349,7 +75391,7 @@ var VideoRegionsDurationDecorator = /*#__PURE__*/ function(VideoRegionsDataManag
75349
75391
  duration = regions2.timestamp_end - regions2.timestamp_start;
75350
75392
  }
75351
75393
  totalDuration += duration;
75352
- workingTimestamp = regions2.timestamp_end + 1e-3;
75394
+ workingTimestamp = regions2.timestamp_end + 1e-3 + 1e3;
75353
75395
  last = validRegions.map(function(r3) {
75354
75396
  return r3.id;
75355
75397
  });
@@ -75416,7 +75458,7 @@ var VideoRegionsMaxDurationDecorator = /*#__PURE__*/ function(VideoRegionsDataMa
75416
75458
  duration = regions2.timestamp_end - regions2.timestamp_start;
75417
75459
  }
75418
75460
  totalDuration += duration;
75419
- workingTimestamp = regions2.timestamp_end + 1e-3;
75461
+ workingTimestamp = regions2.timestamp_end + 1e-3 + 1e3;
75420
75462
  last = filteredRegions.map(function(r3) {
75421
75463
  return r3.id;
75422
75464
  });
@@ -75549,6 +75591,8 @@ var Store = /*#__PURE__*/ function() {
75549
75591
  ]);
75550
75592
  return Store;
75551
75593
  }();
75594
+ // src/Ads/VideoAds/PresentationMode/Basic/BasicMode.ts
75595
+ var import_events9 = __toESM(require_events());
75552
75596
  // src/Ads/VideoAds/PresentationStrategy/AbstractPresentation.ts
75553
75597
  var import_events5 = __toESM(require_events());
75554
75598
  var AbstractPresentation = /*#__PURE__*/ function(_import_events5_default) {
@@ -76050,12 +76094,14 @@ var PresentationStrategyFactory = /*#__PURE__*/ function() {
76050
76094
  _create_class(PresentationStrategyFactory, null, [
76051
76095
  {
76052
76096
  key: "get",
76053
- value: function get(settings) {
76054
- if (!settings) {
76097
+ value: function get(config2) {
76098
+ var _config2_getAdsConfig_general_debug_mode, _config2_getAdsConfig_general;
76099
+ if (!config2 || (config2 === null || config2 === void 0 ? void 0 : (_config2_getAdsConfig_general = config2.getAdsConfig().general) === null || _config2_getAdsConfig_general === void 0 ? void 0 : (_config2_getAdsConfig_general_debug_mode = _config2_getAdsConfig_general.debug_mode) === null || _config2_getAdsConfig_general_debug_mode === void 0 ? void 0 : _config2_getAdsConfig_general_debug_mode.value) && (config2 === null || config2 === void 0 ? void 0 : config2.getStrategy().code) !== "basic") {
76055
76100
  return new PacedPresentation({
76056
76101
  paceMS: 10
76057
76102
  });
76058
76103
  }
76104
+ var settings = config2.getStrategySettings();
76059
76105
  if (settings.cooldown_time && settings.minimum_display_time) {
76060
76106
  return new DynamicDurationPresentation({
76061
76107
  cooldownTimeMS: settings.cooldown_time.value * 1e3,
@@ -79537,10 +79583,6 @@ var Controls = /*#__PURE__*/ function() {
79537
79583
  }
79538
79584
  if (this.context.media.is("NATIVE")) {
79539
79585
  this.setTopBar();
79540
- if (this.context.config.get("debug")) {
79541
- this.controlBottomBar = new ControlBottomBar(this.context, this.events);
79542
- this.container.appendChild(this.controlBottomBar.view);
79543
- }
79544
79586
  }
79545
79587
  }
79546
79588
  }
@@ -79908,7 +79950,6 @@ var Interface = /*#__PURE__*/ function(_import_events7_default) {
79908
79950
  _this.media = _this.context.media;
79909
79951
  _this.container = document.createElement("div");
79910
79952
  _this.container.id = "BRNDTS";
79911
- _this.setDebug(_this.context.config.get("debug"));
79912
79953
  _this.wrapMedia();
79913
79954
  _this.fullscreen = new Fullscreen(_this.context);
79914
79955
  _this.setupControls();
@@ -80404,6 +80445,9 @@ var BasicAdRegion = /*#__PURE__*/ function(Region) {
80404
80445
  _this.content.view.remove();
80405
80446
  _this.content = new StaticRegionContent2(_this.id, _this.plane, _this.box, ((_this_deps_config = _this.deps.config) === null || _this_deps_config === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general = _this_deps_config.getAdsConfig().general) === null || _this_deps_config_getAdsConfig_general === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general_debug_mode = _this_deps_config_getAdsConfig_general.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode.value) ? _this.regionDescriptor.ctx : void 0);
80406
80447
  _this.container.appendChild(_this.content.view);
80448
+ if (_this.deps.provider) {
80449
+ _this.content.addContent(_this.deps.provider.contents());
80450
+ }
80407
80451
  return _this;
80408
80452
  }
80409
80453
  _create_class(BasicAdRegion, [
@@ -80417,7 +80461,6 @@ var BasicAdRegion = /*#__PURE__*/ function(Region) {
80417
80461
  key: "requestContent",
80418
80462
  value: function requestContent() {
80419
80463
  var box = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.box;
80420
- console.log("Requesting content for region ".concat(this.id, " with box:"), this.deps.provider);
80421
80464
  if (this.deps.provider) {
80422
80465
  var _this_options_ad, _this_options, _this_options_ad1, _this_options1;
80423
80466
  this.deps.provider.request({
@@ -80620,7 +80663,6 @@ var RegionsContainerView = /*#__PURE__*/ function() {
80620
80663
  this.contentLayer.style.position = "absolute";
80621
80664
  this.contentLayer.style.top = "".concat(this.position.y, "px");
80622
80665
  this.contentLayer.style.left = "".concat(this.position.x, "px");
80623
- this.contentLayer.style.pointerEvents = "none";
80624
80666
  this.contentLayer.style.width = "".concat(this.size.width, "px");
80625
80667
  this.contentLayer.style.height = "".concat(this.size.height, "px");
80626
80668
  }
@@ -80705,6 +80747,7 @@ var AdRegionsCollection = /*#__PURE__*/ function(MappedCollection) {
80705
80747
  var AdRegionsArea = /*#__PURE__*/ function() {
80706
80748
  function AdRegionsArea(context, position, size, id) {
80707
80749
  _class_call_check(this, AdRegionsArea);
80750
+ var _this_context_config_getAdsConfig_general_debug_mode, _this_context_config_getAdsConfig_general;
80708
80751
  this.position = {
80709
80752
  x: 0,
80710
80753
  y: 0
@@ -80715,7 +80758,7 @@ var AdRegionsArea = /*#__PURE__*/ function() {
80715
80758
  };
80716
80759
  this.id = id;
80717
80760
  this.context = context;
80718
- this.maxRegions = MAX_REGIONS;
80761
+ this.maxRegions = ((_this_context_config_getAdsConfig_general = this.context.config.getAdsConfig().general) === null || _this_context_config_getAdsConfig_general === void 0 ? void 0 : (_this_context_config_getAdsConfig_general_debug_mode = _this_context_config_getAdsConfig_general.debug_mode) === null || _this_context_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _this_context_config_getAdsConfig_general_debug_mode.value) ? Number.MAX_SAFE_INTEGER : MAX_REGIONS;
80719
80762
  this.position = position;
80720
80763
  this.size = size;
80721
80764
  this.handleIntersectionChange = this.handleIntersectionChange.bind(this);
@@ -80852,12 +80895,18 @@ var AdRegionsArea = /*#__PURE__*/ function() {
80852
80895
  var RegionRenderer = /*#__PURE__*/ function() {
80853
80896
  function RegionRenderer(context, size) {
80854
80897
  _class_call_check(this, RegionRenderer);
80898
+ var _this_context_config_getAdsConfig_general_clickability, _this_context_config_getAdsConfig_general, _this_context_config;
80855
80899
  this.regionAreas = {};
80856
80900
  this.context = context;
80857
80901
  this.regionsContainerView = new RegionsContainerView({
80858
80902
  x: 0,
80859
80903
  y: 0
80860
80904
  }, size);
80905
+ if ((_this_context_config = this.context.config) === null || _this_context_config === void 0 ? void 0 : (_this_context_config_getAdsConfig_general = _this_context_config.getAdsConfig().general) === null || _this_context_config_getAdsConfig_general === void 0 ? void 0 : (_this_context_config_getAdsConfig_general_clickability = _this_context_config_getAdsConfig_general.clickability) === null || _this_context_config_getAdsConfig_general_clickability === void 0 ? void 0 : _this_context_config_getAdsConfig_general_clickability.value) {
80906
+ this.regionsContainerView.view.style.pointerEvents = "all";
80907
+ } else {
80908
+ this.regionsContainerView.view.style.pointerEvents = "none";
80909
+ }
80861
80910
  }
80862
80911
  _create_class(RegionRenderer, [
80863
80912
  {
@@ -80938,7 +80987,6 @@ var RegionRenderer = /*#__PURE__*/ function() {
80938
80987
  return RegionRenderer;
80939
80988
  }();
80940
80989
  // src/Ads/VideoAds/PresentationMode/Basic/BasicMode.ts
80941
- var import_events9 = __toESM(require_events());
80942
80990
  function adjustSizeWithAspectRatio(maxWidth, maxHeight, aspectRatio) {
80943
80991
  var width = maxWidth;
80944
80992
  var height = maxHeight;
@@ -81178,9 +81226,14 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
81178
81226
  var _this_adPresentationStrategy;
81179
81227
  (_this_adPresentationStrategy = _this.adPresentationStrategy) === null || _this_adPresentationStrategy === void 0 ? void 0 : _this_adPresentationStrategy.start();
81180
81228
  } else {
81181
- var _this_adPresentationStrategy1;
81229
+ var _this_adPresentationStrategy1, _adsConfigs_general_visibility_on_pause, _adsConfigs_general;
81182
81230
  var adsConfigs = _this.context.config.getAdsConfig();
81183
81231
  (_this_adPresentationStrategy1 = _this.adPresentationStrategy) === null || _this_adPresentationStrategy1 === void 0 ? void 0 : _this_adPresentationStrategy1.stop();
81232
+ if (!((_adsConfigs_general = adsConfigs.general) === null || _adsConfigs_general === void 0 ? void 0 : (_adsConfigs_general_visibility_on_pause = _adsConfigs_general.visibility_on_pause) === null || _adsConfigs_general_visibility_on_pause === void 0 ? void 0 : _adsConfigs_general_visibility_on_pause.value)) {
81233
+ var _this_mediaElementSizeController, _this_regionsRenderer;
81234
+ (_this_mediaElementSizeController = _this.mediaElementSizeController) === null || _this_mediaElementSizeController === void 0 ? void 0 : _this_mediaElementSizeController.restore();
81235
+ (_this_regionsRenderer = _this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.clear();
81236
+ }
81184
81237
  }
81185
81238
  }
81186
81239
  if (oldState.fullscreen !== newState.fullscreen) {
@@ -81197,10 +81250,9 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
81197
81250
  height: this.context.media.viewHeight
81198
81251
  });
81199
81252
  if (this.context.elements.container) {
81200
- var _this_regionsRenderer;
81201
- (_this_regionsRenderer = this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.attach(this.context.elements.container, this.context.media.view);
81253
+ this.regionsRenderer.attach(this.context.elements.container, this.context.media.view);
81202
81254
  }
81203
- this.adPresentationStrategy = PresentationStrategyFactory.get(this.context.config.getStrategySettings());
81255
+ this.adPresentationStrategy = PresentationStrategyFactory.get(this.context.config);
81204
81256
  (_this_adPresentationStrategy = this.adPresentationStrategy) === null || _this_adPresentationStrategy === void 0 ? void 0 : _this_adPresentationStrategy.on("presentation", function() {
81205
81257
  var _this_mediaElementSizeController;
81206
81258
  var expected = (_this_mediaElementSizeController = _this.mediaElementSizeController) === null || _this_mediaElementSizeController === void 0 ? void 0 : _this_mediaElementSizeController.expectedDimensions(70, _this.context.store.getState().fullscreen ? 10 : 0);
@@ -81220,7 +81272,6 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
81220
81272
  }
81221
81273
  }).on("pace", function() {}).on("cooldown", function() {
81222
81274
  var _this_regionsRenderer;
81223
- console.log("Cooldown");
81224
81275
  (_this_regionsRenderer = _this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.clear();
81225
81276
  _this.packer.reset();
81226
81277
  setTimeout(function() {
@@ -81388,12 +81439,10 @@ var RegionFactory = /*#__PURE__*/ function() {
81388
81439
  {
81389
81440
  key: "getPluginForStrategy",
81390
81441
  value: function getPluginForStrategy() {
81391
- var _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general, _this_deps_config, _this_deps, _this_deps1;
81442
+ var _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general, _this_deps_config, _this_deps, _this_deps1, _this_deps_config_getAdsConfig_general_debug_mode1, _this_deps_config_getAdsConfig_general1, _this_deps_config1, _this_deps2;
81392
81443
  var plugins2 = [];
81393
81444
  if ((_this_deps = this.deps) === null || _this_deps === void 0 ? void 0 : (_this_deps_config = _this_deps.config) === null || _this_deps_config === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general = _this_deps_config.getAdsConfig().general) === null || _this_deps_config_getAdsConfig_general === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general_debug_mode = _this_deps_config_getAdsConfig_general.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode.value) {
81394
81445
  plugins2.push(new RegionDebugPlugin());
81395
- } else {
81396
- plugins2.push(new RegionBorderPlugin());
81397
81446
  }
81398
81447
  if (!((_this_deps1 = this.deps) === null || _this_deps1 === void 0 ? void 0 : _this_deps1.strategy)) {
81399
81448
  return [
@@ -81413,10 +81462,10 @@ var RegionFactory = /*#__PURE__*/ function() {
81413
81462
  })
81414
81463
  ];
81415
81464
  }
81416
- if (this.deps.strategy === "banner" || this.deps.strategy === "bannerv2" || this.deps.strategy === "bannerv2_ocr" || this.deps.strategy === "test") {
81417
- plugins2.push(new RegionAnimationPlugin());
81418
- return plugins2;
81465
+ if (!((_this_deps2 = this.deps) === null || _this_deps2 === void 0 ? void 0 : (_this_deps_config1 = _this_deps2.config) === null || _this_deps_config1 === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general1 = _this_deps_config1.getAdsConfig().general) === null || _this_deps_config_getAdsConfig_general1 === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general_debug_mode1 = _this_deps_config_getAdsConfig_general1.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode1 === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode1.value) && (this.deps.strategy === "banner" || this.deps.strategy === "bannerv2" || this.deps.strategy === "bannerv2_ocr" || this.deps.strategy === "test")) {
81466
+ plugins2.push(new RegionBorderPlugin(), new RegionAnimationPlugin());
81419
81467
  }
81468
+ return plugins2;
81420
81469
  }
81421
81470
  },
81422
81471
  {
@@ -81799,10 +81848,11 @@ var AdRegionsCollection3 = /*#__PURE__*/ function(MappedCollection) {
81799
81848
  var RegionRenderer2 = /*#__PURE__*/ function() {
81800
81849
  function RegionRenderer2(context, width, height) {
81801
81850
  _class_call_check(this, RegionRenderer2);
81851
+ var _this_context_config_getAdsConfig_general_debug_mode, _this_context_config_getAdsConfig_general;
81802
81852
  this.regionsData = [];
81803
81853
  this.context = context;
81804
81854
  this.regionsObjects = new AdRegionsCollection3();
81805
- this.maxRegions = MAX_REGIONS2;
81855
+ this.maxRegions = ((_this_context_config_getAdsConfig_general = this.context.config.getAdsConfig().general) === null || _this_context_config_getAdsConfig_general === void 0 ? void 0 : (_this_context_config_getAdsConfig_general_debug_mode = _this_context_config_getAdsConfig_general.debug_mode) === null || _this_context_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _this_context_config_getAdsConfig_general_debug_mode.value) ? Number.MAX_SAFE_INTEGER : MAX_REGIONS2;
81806
81856
  this.regionsContainerView = new RegionsContainerView3(width, height);
81807
81857
  this.regionFactory = new RegionFactory({
81808
81858
  recorder: this.context.recorder,
@@ -81962,10 +82012,10 @@ var NotBasicPresentationMode = /*#__PURE__*/ function() {
81962
82012
  var _this_adPresentationStrategy;
81963
82013
  (_this_adPresentationStrategy = _this.adPresentationStrategy) === null || _this_adPresentationStrategy === void 0 ? void 0 : _this_adPresentationStrategy.start();
81964
82014
  } else {
81965
- var _this_adPresentationStrategy1, _adsConfigs_general;
82015
+ var _this_adPresentationStrategy1, _adsConfigs_general_visibility_on_pause, _adsConfigs_general;
81966
82016
  var adsConfigs = _this.context.config.getAdsConfig();
81967
82017
  (_this_adPresentationStrategy1 = _this.adPresentationStrategy) === null || _this_adPresentationStrategy1 === void 0 ? void 0 : _this_adPresentationStrategy1.stop();
81968
- if (!((_adsConfigs_general = adsConfigs.general) === null || _adsConfigs_general === void 0 ? void 0 : _adsConfigs_general.visibility_on_pause)) {
82018
+ if (!((_adsConfigs_general = adsConfigs.general) === null || _adsConfigs_general === void 0 ? void 0 : (_adsConfigs_general_visibility_on_pause = _adsConfigs_general.visibility_on_pause) === null || _adsConfigs_general_visibility_on_pause === void 0 ? void 0 : _adsConfigs_general_visibility_on_pause.value)) {
81969
82019
  var _this_regionsRenderer, _this_auxElementsRenderer;
81970
82020
  (_this_regionsRenderer = _this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.clear();
81971
82021
  (_this_auxElementsRenderer = _this.auxElementsRenderer) === null || _this_auxElementsRenderer === void 0 ? void 0 : _this_auxElementsRenderer.clear();
@@ -81983,7 +82033,7 @@ var NotBasicPresentationMode = /*#__PURE__*/ function() {
81983
82033
  (_this_auxElementsRenderer = this.auxElementsRenderer) === null || _this_auxElementsRenderer === void 0 ? void 0 : _this_auxElementsRenderer.attach(this.context.elements.container);
81984
82034
  (_this_regionsRenderer = this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.attach(this.context.elements.container);
81985
82035
  }
81986
- this.adPresentationStrategy = PresentationStrategyFactory.get(this.context.config.getStrategySettings());
82036
+ this.adPresentationStrategy = PresentationStrategyFactory.get(this.context.config);
81987
82037
  (_this_adPresentationStrategy = this.adPresentationStrategy) === null || _this_adPresentationStrategy === void 0 ? void 0 : _this_adPresentationStrategy.on("presentation", function() {
81988
82038
  var _this_context_data;
81989
82039
  var regions2 = (_this_context_data = _this.context.data) === null || _this_context_data === void 0 ? void 0 : _this_context_data.check(_this.context.media.currentTime);
@@ -82216,6 +82266,12 @@ var VideoAd = /*#__PURE__*/ function() {
82216
82266
  }
82217
82267
  }
82218
82268
  },
82269
+ {
82270
+ key: "media",
82271
+ get: function get() {
82272
+ return this.videoAdContext.media;
82273
+ }
82274
+ },
82219
82275
  {
82220
82276
  key: "updateRegionData",
82221
82277
  value: function updateRegionData() {
@@ -82361,6 +82417,15 @@ var VideoAds = /*#__PURE__*/ function() {
82361
82417
  }
82362
82418
  }
82363
82419
  },
82420
+ {
82421
+ key: "getVideoAd",
82422
+ value: function getVideoAd(index) {
82423
+ if (index === void 0) {
82424
+ return this.videoAdElements[0];
82425
+ }
82426
+ return this.videoAdElements[index];
82427
+ }
82428
+ },
82364
82429
  {
82365
82430
  key: "destroy",
82366
82431
  value: function destroy() {
@@ -82698,7 +82763,7 @@ var User = /*#__PURE__*/ function() {
82698
82763
  if (this.info.buyerUID) {
82699
82764
  return Promise.resolve(this);
82700
82765
  }
82701
- return fetch("".concat(this.config.get("auth").host, "/authority/tp/user-matching?partner_id=").concat(publisherId, "&pub_user_id=").concat(this.info.id, "&gdpr=").concat(this.consent.gdpr().active ? 1 : 0, "&gdpr_consent=").concat(this.consent.gdpr().tcString)).then(function(response) {
82766
+ return fetch("".concat(this.config.get("auth").host, "/authority/tp/user-matching?partner_id=").concat(publisherId, "&pub_user_id=").concat(this.info.id, "&gdpr=").concat(this.consent.gdpr().gdprApplies ? 1 : 0, "&gdpr_consent=").concat(this.consent.gdpr().tcString)).then(function(response) {
82702
82767
  return response.json();
82703
82768
  }).then(function(data) {
82704
82769
  _this.info.buyerUID = data.remote_user_id;
@@ -86704,8 +86769,7 @@ var BrndtsAds = /*#__PURE__*/ function() {
86704
86769
  try {
86705
86770
  var config2 = new Config(options || {}, adsOptions || {});
86706
86771
  config2.fetch().then(function() {
86707
- var _config2_getAdsConfig_general_debug_mode, _config2_getAdsConfig_general;
86708
- var logger3 = new Logger((_config2_getAdsConfig_general = config2.getAdsConfig().general) === null || _config2_getAdsConfig_general === void 0 ? void 0 : (_config2_getAdsConfig_general_debug_mode = _config2_getAdsConfig_general.debug_mode) === null || _config2_getAdsConfig_general_debug_mode === void 0 ? void 0 : _config2_getAdsConfig_general_debug_mode.value);
86772
+ var logger3 = new Logger(true);
86709
86773
  _this.context = {
86710
86774
  config: config2,
86711
86775
  timers: {},
@@ -86825,6 +86889,21 @@ var BrndtsAds = /*#__PURE__*/ function() {
86825
86889
  }
86826
86890
  }
86827
86891
  },
86892
+ {
86893
+ key: "refreshConfigs",
86894
+ value: function refreshConfigs(options, adsOptions) {
86895
+ if (!this.ready.value) {
86896
+ return;
86897
+ }
86898
+ this.context.config.refresh(options, adsOptions);
86899
+ if (this.context.ads) {
86900
+ var _this_context_ads;
86901
+ (_this_context_ads = this.context.ads) === null || _this_context_ads === void 0 ? void 0 : _this_context_ads.destroy();
86902
+ this.context.ads = new Ads_default(this.context);
86903
+ this.context.ads.start();
86904
+ }
86905
+ }
86906
+ },
86828
86907
  {
86829
86908
  key: "restartControls",
86830
86909
  value: function restartControls(controlsConfig) {
@@ -86832,6 +86911,26 @@ var BrndtsAds = /*#__PURE__*/ function() {
86832
86911
  this.context.config.set("controls", controlsConfig);
86833
86912
  }
86834
86913
  },
86914
+ {
86915
+ key: "rewind",
86916
+ value: function rewind(value2) {
86917
+ var _this_context_ads_videoAds_getVideoAd, _this_context_ads_videoAds, _this_context_ads;
86918
+ if (!this.ready.value) {
86919
+ return;
86920
+ }
86921
+ (_this_context_ads = this.context.ads) === null || _this_context_ads === void 0 ? void 0 : (_this_context_ads_videoAds = _this_context_ads.videoAds) === null || _this_context_ads_videoAds === void 0 ? void 0 : (_this_context_ads_videoAds_getVideoAd = _this_context_ads_videoAds.getVideoAd()) === null || _this_context_ads_videoAds_getVideoAd === void 0 ? void 0 : _this_context_ads_videoAds_getVideoAd.media.rewind(value2);
86922
+ }
86923
+ },
86924
+ {
86925
+ key: "forward",
86926
+ value: function forward(value2) {
86927
+ var _this_context_ads_videoAds_getVideoAd, _this_context_ads_videoAds, _this_context_ads;
86928
+ if (!this.ready.value) {
86929
+ return;
86930
+ }
86931
+ (_this_context_ads = this.context.ads) === null || _this_context_ads === void 0 ? void 0 : (_this_context_ads_videoAds = _this_context_ads.videoAds) === null || _this_context_ads_videoAds === void 0 ? void 0 : (_this_context_ads_videoAds_getVideoAd = _this_context_ads_videoAds.getVideoAd()) === null || _this_context_ads_videoAds_getVideoAd === void 0 ? void 0 : _this_context_ads_videoAds_getVideoAd.media.forward(value2);
86932
+ }
86933
+ },
86835
86934
  {
86836
86935
  key: "destroy",
86837
86936
  value: function destroy() {