@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.mjs CHANGED
@@ -67683,6 +67683,16 @@ var BRNDTSConfig = /*#__PURE__*/ function() {
67683
67683
  }).apply(this, arguments);
67684
67684
  }
67685
67685
  },
67686
+ {
67687
+ key: "refresh",
67688
+ value: function refresh(provided, refetch) {
67689
+ this.provided = provided || this.provided;
67690
+ if ((refetch === null || refetch === void 0 ? void 0 : refetch.host) && (refetch === null || refetch === void 0 ? void 0 : refetch.key)) {
67691
+ this.fetch(refetch);
67692
+ }
67693
+ this.merge();
67694
+ }
67695
+ },
67686
67696
  {
67687
67697
  key: "get",
67688
67698
  value: function get(key) {
@@ -67838,7 +67848,6 @@ var AdsConfigsClass = /*#__PURE__*/ function(BRNDTSConfig) {
67838
67848
  general: _object_spread({}, ((_this_remote = _this.remote) === null || _this_remote === void 0 ? void 0 : _this_remote.general) || {}),
67839
67849
  adStrategies: strategies
67840
67850
  };
67841
- console.log("Ads strategies fetched", _this.remote);
67842
67851
  _this.merge();
67843
67852
  })
67844
67853
  ];
@@ -67862,15 +67871,21 @@ var Config = /*#__PURE__*/ function() {
67862
67871
  var _providedConfigs_auth;
67863
67872
  this.genericConfigs = new GenericConfigsClass(providedConfigs);
67864
67873
  this.adsConfigs = new AdsConfigsClass(providedAdsConfigs || {});
67865
- console.log("BRNDTS Config initialized", providedConfigs, providedAdsConfigs);
67866
67874
  if (!((_providedConfigs_auth = providedConfigs.auth) === null || _providedConfigs_auth === void 0 ? void 0 : _providedConfigs_auth.host)) {
67867
67875
  throw new InternalError("No authority configuration provided!");
67868
67876
  }
67869
67877
  if (!providedConfigs.key) {
67870
- throw new InternalError("No host or key provided!");
67878
+ throw new InternalError("No key provided!");
67871
67879
  }
67872
67880
  }
67873
67881
  _create_class(Config, [
67882
+ {
67883
+ key: "refresh",
67884
+ value: function refresh(providedConfigs, providedAdsConfigs) {
67885
+ this.genericConfigs.refresh(providedConfigs);
67886
+ this.adsConfigs.refresh(providedAdsConfigs);
67887
+ }
67888
+ },
67874
67889
  {
67875
67890
  key: "fetch",
67876
67891
  value: function fetch1() {
@@ -69082,6 +69097,22 @@ var RecorderFactory = /*#__PURE__*/ function() {
69082
69097
  }();
69083
69098
  // src/Ads/Providers/BRNDTSDefault/BRNDTSDefaultProvider.ts
69084
69099
  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>';
69100
+ function getContentFromTemplate(w2, h) {
69101
+ var container = document.createElement("div");
69102
+ container.classList.add("BRNDTS_default_content");
69103
+ container.style.width = "100%";
69104
+ container.style.height = "100%";
69105
+ var box = document.createElement("div");
69106
+ box.classList.add("box");
69107
+ box.style.width = "".concat(w2, "px");
69108
+ box.style.height = "".concat(h, "px");
69109
+ var iconBox = document.createElement("div");
69110
+ iconBox.classList.add("icon");
69111
+ iconBox.innerHTML = icon;
69112
+ box.appendChild(iconBox);
69113
+ container.appendChild(box);
69114
+ return container;
69115
+ }
69085
69116
  var BRNDTSDefaultProvider = /*#__PURE__*/ function(ContentProvider) {
69086
69117
  "use strict";
69087
69118
  _inherits(BRNDTSDefaultProvider, ContentProvider);
@@ -69092,21 +69123,8 @@ var BRNDTSDefaultProvider = /*#__PURE__*/ function(ContentProvider) {
69092
69123
  context,
69093
69124
  void 0
69094
69125
  ]);
69095
- var container = document.createElement("div");
69096
- container.classList.add("BRNDTS_default_content");
69097
- container.style.width = "100%";
69098
- container.style.height = "100%";
69099
- var box = document.createElement("div");
69100
- box.classList.add("box");
69101
- var iconBox = document.createElement("div");
69102
- iconBox.classList.add("icon");
69103
- iconBox.innerHTML = icon;
69104
- box.appendChild(iconBox);
69105
- container.appendChild(box);
69106
69126
  _this.content = {
69107
- content: [
69108
- container
69109
- ],
69127
+ content: [],
69110
69128
  type: "brndts_placeholder"
69111
69129
  };
69112
69130
  return _this;
@@ -69114,14 +69132,26 @@ var BRNDTSDefaultProvider = /*#__PURE__*/ function(ContentProvider) {
69114
69132
  _create_class(BRNDTSDefaultProvider, [
69115
69133
  {
69116
69134
  key: "request",
69117
- value: function request() {
69135
+ value: function request(params) {
69118
69136
  return _async_to_generator(function() {
69119
69137
  return _ts_generator(this, function(_state) {
69138
+ this.content = _object_spread_props(_object_spread({}, this.content), {
69139
+ content: [
69140
+ getContentFromTemplate(params.size.width, params.size.height)
69141
+ ],
69142
+ extra: _object_spread_props(_object_spread({}, this.content.extra || {}), {
69143
+ sz: {
69144
+ w: params.size.width,
69145
+ h: params.size.height
69146
+ }
69147
+ })
69148
+ });
69149
+ this.notify();
69120
69150
  return [
69121
69151
  2
69122
69152
  ];
69123
69153
  });
69124
- })();
69154
+ }).call(this);
69125
69155
  }
69126
69156
  }
69127
69157
  ]);
@@ -69920,7 +69950,7 @@ var PrebidJS = /*#__PURE__*/ function() {
69920
69950
  value: function configure(context, options) {
69921
69951
  var _window_pbjs_que, _window_pbjs;
69922
69952
  (_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() {
69923
- var _context_config_getAdsConfig_general_debug_mode, _context_config_getAdsConfig_general, _window_pbjs, _window_pbjs1;
69953
+ var _context_config_getAdsConfig_general_debug_mode, _context_config_getAdsConfig_general, _window_pbjs, _window_pbjs1, _window_pbjs2;
69924
69954
  var configBuilder = new PrebidConfigBuilder();
69925
69955
  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({
69926
69956
  userIds: [
@@ -69939,8 +69969,11 @@ var PrebidJS = /*#__PURE__*/ function() {
69939
69969
  ]
69940
69970
  }).addConsent(context.consent);
69941
69971
  (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.setConfig(configBuilder.build());
69972
+ (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : _window_pbjs1.enableAnalytics({
69973
+ provider: "smartyads"
69974
+ });
69942
69975
  context.logger.log("Prebid.js configuration set.");
69943
- (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : _window_pbjs1.setBidderConfig({
69976
+ (_window_pbjs2 = window.pbjs) === null || _window_pbjs2 === void 0 ? void 0 : _window_pbjs2.setBidderConfig({
69944
69977
  bidders: [
69945
69978
  "bidderA"
69946
69979
  ],
@@ -69956,9 +69989,9 @@ var PrebidJS = /*#__PURE__*/ function() {
69956
69989
  }
69957
69990
  });
69958
69991
  for(var bidderName in options.bidders){
69959
- var _window_pbjs2;
69992
+ var _window_pbjs3;
69960
69993
  var bidderConfig = options.bidders[bidderName];
69961
- (_window_pbjs2 = window.pbjs) === null || _window_pbjs2 === void 0 ? void 0 : _window_pbjs2.setBidderConfig({
69994
+ (_window_pbjs3 = window.pbjs) === null || _window_pbjs3 === void 0 ? void 0 : _window_pbjs3.setBidderConfig({
69962
69995
  bidders: [
69963
69996
  bidderName.toLowerCase()
69964
69997
  ],
@@ -70409,7 +70442,7 @@ var PrebidGAM = /*#__PURE__*/ function() {
70409
70442
  value: function configure(context, options) {
70410
70443
  var _window_pbjs_que, _window_pbjs;
70411
70444
  (_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() {
70412
- var _context_config_getAdsConfig_general_debug_mode, _context_config_getAdsConfig_general, _window_pbjs, _window_pbjs1;
70445
+ var _context_config_getAdsConfig_general_debug_mode, _context_config_getAdsConfig_general, _window_pbjs, _window_pbjs1, _window_pbjs2;
70413
70446
  var configBuilder = new PrebidConfigBuilder();
70414
70447
  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({
70415
70448
  userIds: [
@@ -70428,8 +70461,11 @@ var PrebidGAM = /*#__PURE__*/ function() {
70428
70461
  ]
70429
70462
  }).addConsent(context.consent);
70430
70463
  (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.setConfig(configBuilder.build());
70464
+ (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : _window_pbjs1.enableAnalytics({
70465
+ provider: "smartyads"
70466
+ });
70431
70467
  context.logger.log("Prebid.js configuration set.");
70432
- (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : _window_pbjs1.setBidderConfig({
70468
+ (_window_pbjs2 = window.pbjs) === null || _window_pbjs2 === void 0 ? void 0 : _window_pbjs2.setBidderConfig({
70433
70469
  bidders: [
70434
70470
  "bidderA"
70435
70471
  ],
@@ -70445,9 +70481,9 @@ var PrebidGAM = /*#__PURE__*/ function() {
70445
70481
  }
70446
70482
  });
70447
70483
  for(var bidderName in options.bidders){
70448
- var _window_pbjs2;
70484
+ var _window_pbjs3;
70449
70485
  var bidderConfig = options.bidders[bidderName];
70450
- (_window_pbjs2 = window.pbjs) === null || _window_pbjs2 === void 0 ? void 0 : _window_pbjs2.setBidderConfig({
70486
+ (_window_pbjs3 = window.pbjs) === null || _window_pbjs3 === void 0 ? void 0 : _window_pbjs3.setBidderConfig({
70451
70487
  bidders: [
70452
70488
  bidderName.toLowerCase()
70453
70489
  ],
@@ -70515,7 +70551,9 @@ var PrebidGAM = /*#__PURE__*/ function() {
70515
70551
  var _unitDefinition_mediaTypes_banner;
70516
70552
  sizes = ((_unitDefinition_mediaTypes_banner = unitDefinition.mediaTypes.banner) === null || _unitDefinition_mediaTypes_banner === void 0 ? void 0 : _unitDefinition_mediaTypes_banner.sizes) || [];
70517
70553
  }
70518
- GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), sizes, "".concat(containerId));
70554
+ GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), [
70555
+ sizes[0] || []
70556
+ ], "".concat(containerId));
70519
70557
  if (!((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
70520
70558
  return "".concat(containerId) === "".concat(defUnit.code);
70521
70559
  }))) {
@@ -70688,7 +70726,6 @@ var PrebidGAMProvider = /*#__PURE__*/ function(ContentProvider1) {
70688
70726
  ];
70689
70727
  case 2:
70690
70728
  _state.sent();
70691
- console.log("Requesting ad for region ".concat(regionId, " with size ").concat(params.size.width, "x").concat(params.size.height));
70692
70729
  PrebidGAM.defineSlot(this.options, regionId, this.workingSlotId, adType, adName);
70693
70730
  PrebidGAM.request(regionId, this.workingSlotId, function(content) {
70694
70731
  content.style.width = "".concat(regionInfo === null || regionInfo === void 0 ? void 0 : regionInfo.w, "px");
@@ -71100,7 +71137,6 @@ var RegionContent = /*#__PURE__*/ function() {
71100
71137
  "use strict";
71101
71138
  function RegionContent(id, plane, box, ctx) {
71102
71139
  _class_call_check(this, RegionContent);
71103
- var _this_ctx;
71104
71140
  this.scale = null;
71105
71141
  this.id = id;
71106
71142
  this.plane = plane;
@@ -71110,9 +71146,6 @@ var RegionContent = /*#__PURE__*/ function() {
71110
71146
  this.container.id = "BRNDTS_RB_".concat(this.id);
71111
71147
  this.container.classList.add("BRNDTS_RB");
71112
71148
  this.container.dataset.state = "hidden";
71113
- if ((_this_ctx = this.ctx) === null || _this_ctx === void 0 ? void 0 : _this_ctx.color) {
71114
- this.container.style.backgroundColor = "#".concat(this.ctx.color, "73");
71115
- }
71116
71149
  this.render();
71117
71150
  }
71118
71151
  _create_class(RegionContent, [
@@ -71434,7 +71467,6 @@ var RegionDebugPlugin = /*#__PURE__*/ function() {
71434
71467
  region.content.view.classList.toggle("BRNDTS_AUXR_B", true);
71435
71468
  if (region.content.view) {
71436
71469
  region.content.view.style.borderColor = "#".concat(color, "73");
71437
- region.content.view.style.backgroundColor = "#".concat(color, "73");
71438
71470
  region.content.view.style.borderStyle = "solid";
71439
71471
  region.content.view.style.borderWidth = "2px";
71440
71472
  }
@@ -71446,7 +71478,6 @@ var RegionDebugPlugin = /*#__PURE__*/ function() {
71446
71478
  value: function afterShow(region) {
71447
71479
  var _region_regionDescriptor_ctx, _region_regionDescriptor_ctx1, _region_regionDescriptor_ctx2;
71448
71480
  if (!region.regionDescriptor) {
71449
- console.log("No region descriptor", region);
71450
71481
  this.csLabel.remove();
71451
71482
  return Promise.resolve();
71452
71483
  }
@@ -71538,7 +71569,7 @@ var Region = /*#__PURE__*/ function() {
71538
71569
  function Region(id, regionDescriptor, planeDescriptor, options, deps) {
71539
71570
  var _this = this;
71540
71571
  _class_call_check(this, Region);
71541
- 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;
71572
+ 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;
71542
71573
  this.onScreen = false;
71543
71574
  this.visible = false;
71544
71575
  this.plugins = [];
@@ -71555,12 +71586,13 @@ var Region = /*#__PURE__*/ function() {
71555
71586
  this.container.classList.add("BRNDTS_R");
71556
71587
  this.container.style.position = "absolute";
71557
71588
  this.container.style.display = "none";
71558
- 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)) {
71559
- this.container.style.pointerEvents = "none";
71560
- } else {
71589
+ 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) {
71561
71590
  this.container.style.pointerEvents = "all";
71562
71591
  }
71563
- 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);
71592
+ 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) {
71593
+ this.container.style.pointerEvents = "none";
71594
+ }
71595
+ 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);
71564
71596
  this.container.appendChild(this.content.view);
71565
71597
  this.handleClick = this.handleClick.bind(this);
71566
71598
  this.handleMouseEnter = this.handleMouseEnter.bind(this);
@@ -71874,7 +71906,7 @@ var Region = /*#__PURE__*/ function() {
71874
71906
  key: "render",
71875
71907
  value: function render(contours, box) {
71876
71908
  return _async_to_generator(function() {
71877
- var newBox, _this_deps_recorder, _this_deps_recorder1;
71909
+ var newBox, _this_deps_recorder, _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general, _this_deps_config, _this_deps_recorder1, debugMode;
71878
71910
  return _ts_generator(this, function(_state) {
71879
71911
  switch(_state.label){
71880
71912
  case 0:
@@ -71901,13 +71933,14 @@ var Region = /*#__PURE__*/ function() {
71901
71933
  (_this_deps_recorder = this.deps.recorder) === null || _this_deps_recorder === void 0 ? void 0 : _this_deps_recorder.presentationStateChanged(this);
71902
71934
  return [
71903
71935
  3,
71904
- 4
71936
+ 5
71905
71937
  ];
71906
71938
  case 1:
71907
71939
  if (!this.shouldHide()) return [
71908
71940
  3,
71909
- 3
71941
+ 4
71910
71942
  ];
71943
+ 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;
71911
71944
  this.content.clear();
71912
71945
  return [
71913
71946
  4,
@@ -71920,15 +71953,20 @@ var Region = /*#__PURE__*/ function() {
71920
71953
  this.container.style.height = "0px";
71921
71954
  this.container.style.left = "0px";
71922
71955
  this.container.style.top = "0px";
71923
- this.applyPlugins("afterHide");
71956
+ return [
71957
+ 4,
71958
+ this.applyPlugins("afterHide")
71959
+ ];
71960
+ case 3:
71961
+ _state.sent();
71924
71962
  this.visible = false;
71925
71963
  this.content.destroy();
71926
71964
  (_this_deps_recorder1 = this.deps.recorder) === null || _this_deps_recorder1 === void 0 ? void 0 : _this_deps_recorder1.presentationStateChanged(this);
71927
71965
  return [
71928
71966
  3,
71929
- 4
71967
+ 5
71930
71968
  ];
71931
- case 3:
71969
+ case 4:
71932
71970
  if (this.visible) {
71933
71971
  this.container.style.width = "".concat(this.box.width(this.plane.size), "px");
71934
71972
  this.container.style.height = "".concat(this.box.height(this.plane.size), "px");
@@ -71937,8 +71975,8 @@ var Region = /*#__PURE__*/ function() {
71937
71975
  this.content.render();
71938
71976
  this.applyPlugins("reRender");
71939
71977
  }
71940
- _state.label = 4;
71941
- case 4:
71978
+ _state.label = 5;
71979
+ case 5:
71942
71980
  this.applyPlugins("afterRender");
71943
71981
  return [
71944
71982
  2
@@ -72030,9 +72068,9 @@ var StaticAdRegion = /*#__PURE__*/ function(Region) {
72030
72068
  function StaticAdRegion(id, planeDescriptor, options, deps) {
72031
72069
  _class_call_check(this, StaticAdRegion);
72032
72070
  var _this;
72033
- var _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general, _this_deps_config;
72071
+ var _options_ad, _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general, _this_deps_config;
72034
72072
  _this = _call_super(this, StaticAdRegion, [
72035
- "".concat(id),
72073
+ "".concat((options === null || options === void 0 ? void 0 : (_options_ad = options.ad) === null || _options_ad === void 0 ? void 0 : _options_ad.name) || id),
72036
72074
  {
72037
72075
  id: id,
72038
72076
  contours: [],
@@ -72051,6 +72089,9 @@ var StaticAdRegion = /*#__PURE__*/ function(Region) {
72051
72089
  _this.content.view.remove();
72052
72090
  _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);
72053
72091
  _this.container.appendChild(_this.content.view);
72092
+ if (_this.deps.provider) {
72093
+ _this.content.addContent(_this.deps.provider.contents());
72094
+ }
72054
72095
  return _this;
72055
72096
  }
72056
72097
  _create_class(StaticAdRegion, [
@@ -74490,7 +74531,6 @@ var VideoJSMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74490
74531
  _this.emit("SEEKED");
74491
74532
  });
74492
74533
  (_this_instance4 = this.instance) === null || _this_instance4 === void 0 ? void 0 : _this_instance4.ready(function() {
74493
- console.log("VideoJS media is ready");
74494
74534
  _this.mediaIsReady();
74495
74535
  });
74496
74536
  }
@@ -74520,7 +74560,6 @@ var VideoJSMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74520
74560
  clone.autoplay = false;
74521
74561
  this.context.elements.original = clone;
74522
74562
  this.instance = this.media.player;
74523
- console.log("VideoJS media instance set", this.instance);
74524
74563
  if (this.instance) {
74525
74564
  this.instance.fluid(false);
74526
74565
  }
@@ -74607,15 +74646,15 @@ var VideoJSMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74607
74646
  {
74608
74647
  key: "currentTime",
74609
74648
  get: function get() {
74610
- var _this_media;
74611
- var _this_media_currentTime;
74612
- 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;
74649
+ var _this_instance;
74650
+ var _this_instance_currentTime;
74651
+ 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;
74613
74652
  },
74614
74653
  set: function set(value2) {
74615
74654
  if (!this.duration) return;
74616
74655
  var validTime = is_default.number(value2) && value2 > 0 ? Math.min(value2, this.duration) : 0;
74617
- if (this.media) {
74618
- this.media.currentTime = validTime;
74656
+ if (this.instance) {
74657
+ this.instance.currentTime(validTime);
74619
74658
  this.context.logger.log("Seeking to ".concat(this.currentTime, " seconds"));
74620
74659
  }
74621
74660
  }
@@ -74623,10 +74662,10 @@ var VideoJSMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74623
74662
  {
74624
74663
  key: "duration",
74625
74664
  get: function get() {
74626
- var _this_media;
74665
+ var _this_instance;
74627
74666
  var fauxDuration = /* this.context.config.duration */ void 0;
74628
- var _this_media_duration;
74629
- 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;
74667
+ var _this_instance_duration;
74668
+ 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;
74630
74669
  return fauxDuration || realDuration;
74631
74670
  }
74632
74671
  },
@@ -74766,7 +74805,7 @@ var VideoJSMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74766
74805
  key: "forward",
74767
74806
  value: function forward() {
74768
74807
  var seekTime = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : DEFAULT_SEEK_INTERVAL5;
74769
- this.currentTime += seekTime;
74808
+ this.currentTime = this.currentTime + seekTime;
74770
74809
  }
74771
74810
  },
74772
74811
  {
@@ -74863,6 +74902,10 @@ var MediaElementFactory = /*#__PURE__*/ function() {
74863
74902
  var _hasBradMaxPID = _sliced_to_array(hasBradMaxPID, 2), el1 = _hasBradMaxPID[0], value21 = _hasBradMaxPID[1];
74864
74903
  return el1;
74865
74904
  }
74905
+ var isVideoJS = element.querySelector("video-js");
74906
+ if (isVideoJS) {
74907
+ return isVideoJS;
74908
+ }
74866
74909
  return null;
74867
74910
  case "IFRAME":
74868
74911
  var url2 = element.getAttribute("src");
@@ -75113,7 +75156,6 @@ var VideoRegionsDataCollection = /*#__PURE__*/ function() {
75113
75156
  if (!to) {
75114
75157
  to = this.totalLengthSeconds;
75115
75158
  }
75116
- console.log("from : ", from, " to : ", to);
75117
75159
  var result = {};
75118
75160
  for(var index = 0; index < this.timestampList.length; index++){
75119
75161
  var element = +this.timestampList[index];
@@ -75277,7 +75319,6 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
75277
75319
  this.service.send("stop");
75278
75320
  this.service.destroy();
75279
75321
  this.regionsData.load(data);
75280
- console.log("loaded data");
75281
75322
  }
75282
75323
  var input = document.createElement("input");
75283
75324
  input.type = "file";
@@ -75297,7 +75338,6 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
75297
75338
  _this.service.send("stop");
75298
75339
  _this.service.destroy();
75299
75340
  _this.regionsData.load(parsedData);
75300
- console.log("loaded data");
75301
75341
  }
75302
75342
  };
75303
75343
  reader.readAsText(file);
@@ -75409,17 +75449,19 @@ var VideoRegionsDurationDecorator = /*#__PURE__*/ function(VideoRegionsDataManag
75409
75449
  if (!regions2 || !regions2.regions) {
75410
75450
  return null;
75411
75451
  }
75412
- var validRegions = regions2.regions.filter(function(reg, _, array) {
75413
- if (!last) {
75414
- last = array.map(function(r3) {
75415
- return r3.id;
75416
- });
75417
- result = _to_consumable_array(array);
75418
- }
75419
- if (last.includes(reg.id)) {
75420
- return true;
75421
- }
75422
- return false;
75452
+ if (!last) {
75453
+ last = regions2.regions.map(function(r3) {
75454
+ return r3.id;
75455
+ });
75456
+ result = _to_consumable_array(regions2.regions);
75457
+ return {
75458
+ timestamp_start: timestamp,
75459
+ timestamp_end: timestamp + totalDuration,
75460
+ regions: result
75461
+ };
75462
+ }
75463
+ var validRegions = regions2.regions.filter(function(reg) {
75464
+ return last === null || last === void 0 ? void 0 : last.includes(reg.id);
75423
75465
  });
75424
75466
  if (validRegions.length <= 0) {
75425
75467
  return null;
@@ -75431,7 +75473,7 @@ var VideoRegionsDurationDecorator = /*#__PURE__*/ function(VideoRegionsDataManag
75431
75473
  duration = regions2.timestamp_end - regions2.timestamp_start;
75432
75474
  }
75433
75475
  totalDuration += duration;
75434
- workingTimestamp = regions2.timestamp_end + 1e-3;
75476
+ workingTimestamp = regions2.timestamp_end + 1e-3 + 1e3;
75435
75477
  last = validRegions.map(function(r3) {
75436
75478
  return r3.id;
75437
75479
  });
@@ -75499,7 +75541,7 @@ var VideoRegionsMaxDurationDecorator = /*#__PURE__*/ function(VideoRegionsDataMa
75499
75541
  duration = regions2.timestamp_end - regions2.timestamp_start;
75500
75542
  }
75501
75543
  totalDuration += duration;
75502
- workingTimestamp = regions2.timestamp_end + 1e-3;
75544
+ workingTimestamp = regions2.timestamp_end + 1e-3 + 1e3;
75503
75545
  last = filteredRegions.map(function(r3) {
75504
75546
  return r3.id;
75505
75547
  });
@@ -75634,6 +75676,8 @@ var Store = /*#__PURE__*/ function() {
75634
75676
  ]);
75635
75677
  return Store;
75636
75678
  }();
75679
+ // src/Ads/VideoAds/PresentationMode/Basic/BasicMode.ts
75680
+ var import_events9 = __toESM(require_events());
75637
75681
  // src/Ads/VideoAds/PresentationStrategy/AbstractPresentation.ts
75638
75682
  var import_events5 = __toESM(require_events());
75639
75683
  var AbstractPresentation = /*#__PURE__*/ function(_import_events5_default) {
@@ -76141,12 +76185,14 @@ var PresentationStrategyFactory = /*#__PURE__*/ function() {
76141
76185
  _create_class(PresentationStrategyFactory, null, [
76142
76186
  {
76143
76187
  key: "get",
76144
- value: function get(settings) {
76145
- if (!settings) {
76188
+ value: function get(config2) {
76189
+ var _config2_getAdsConfig_general_debug_mode, _config2_getAdsConfig_general;
76190
+ 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") {
76146
76191
  return new PacedPresentation({
76147
76192
  paceMS: 10
76148
76193
  });
76149
76194
  }
76195
+ var settings = config2.getStrategySettings();
76150
76196
  if (settings.cooldown_time && settings.minimum_display_time) {
76151
76197
  return new DynamicDurationPresentation({
76152
76198
  cooldownTimeMS: settings.cooldown_time.value * 1e3,
@@ -79639,10 +79685,6 @@ var Controls = /*#__PURE__*/ function() {
79639
79685
  }
79640
79686
  if (this.context.media.is("NATIVE")) {
79641
79687
  this.setTopBar();
79642
- if (this.context.config.get("debug")) {
79643
- this.controlBottomBar = new ControlBottomBar(this.context, this.events);
79644
- this.container.appendChild(this.controlBottomBar.view);
79645
- }
79646
79688
  }
79647
79689
  }
79648
79690
  }
@@ -80013,7 +80055,6 @@ var Interface = /*#__PURE__*/ function(_import_events7_default) {
80013
80055
  _this.media = _this.context.media;
80014
80056
  _this.container = document.createElement("div");
80015
80057
  _this.container.id = "BRNDTS";
80016
- _this.setDebug(_this.context.config.get("debug"));
80017
80058
  _this.wrapMedia();
80018
80059
  _this.fullscreen = new Fullscreen(_this.context);
80019
80060
  _this.setupControls();
@@ -80513,6 +80554,9 @@ var BasicAdRegion = /*#__PURE__*/ function(Region) {
80513
80554
  _this.content.view.remove();
80514
80555
  _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);
80515
80556
  _this.container.appendChild(_this.content.view);
80557
+ if (_this.deps.provider) {
80558
+ _this.content.addContent(_this.deps.provider.contents());
80559
+ }
80516
80560
  return _this;
80517
80561
  }
80518
80562
  _create_class(BasicAdRegion, [
@@ -80526,7 +80570,6 @@ var BasicAdRegion = /*#__PURE__*/ function(Region) {
80526
80570
  key: "requestContent",
80527
80571
  value: function requestContent() {
80528
80572
  var box = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.box;
80529
- console.log("Requesting content for region ".concat(this.id, " with box:"), this.deps.provider);
80530
80573
  if (this.deps.provider) {
80531
80574
  var _this_options_ad, _this_options, _this_options_ad1, _this_options1;
80532
80575
  this.deps.provider.request({
@@ -80730,7 +80773,6 @@ var RegionsContainerView = /*#__PURE__*/ function() {
80730
80773
  this.contentLayer.style.position = "absolute";
80731
80774
  this.contentLayer.style.top = "".concat(this.position.y, "px");
80732
80775
  this.contentLayer.style.left = "".concat(this.position.x, "px");
80733
- this.contentLayer.style.pointerEvents = "none";
80734
80776
  this.contentLayer.style.width = "".concat(this.size.width, "px");
80735
80777
  this.contentLayer.style.height = "".concat(this.size.height, "px");
80736
80778
  }
@@ -80817,6 +80859,7 @@ var AdRegionsArea = /*#__PURE__*/ function() {
80817
80859
  "use strict";
80818
80860
  function AdRegionsArea(context, position, size, id) {
80819
80861
  _class_call_check(this, AdRegionsArea);
80862
+ var _this_context_config_getAdsConfig_general_debug_mode, _this_context_config_getAdsConfig_general;
80820
80863
  this.position = {
80821
80864
  x: 0,
80822
80865
  y: 0
@@ -80827,7 +80870,7 @@ var AdRegionsArea = /*#__PURE__*/ function() {
80827
80870
  };
80828
80871
  this.id = id;
80829
80872
  this.context = context;
80830
- this.maxRegions = MAX_REGIONS;
80873
+ 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;
80831
80874
  this.position = position;
80832
80875
  this.size = size;
80833
80876
  this.handleIntersectionChange = this.handleIntersectionChange.bind(this);
@@ -80965,12 +81008,18 @@ var RegionRenderer = /*#__PURE__*/ function() {
80965
81008
  "use strict";
80966
81009
  function RegionRenderer(context, size) {
80967
81010
  _class_call_check(this, RegionRenderer);
81011
+ var _this_context_config_getAdsConfig_general_clickability, _this_context_config_getAdsConfig_general, _this_context_config;
80968
81012
  this.regionAreas = {};
80969
81013
  this.context = context;
80970
81014
  this.regionsContainerView = new RegionsContainerView({
80971
81015
  x: 0,
80972
81016
  y: 0
80973
81017
  }, size);
81018
+ 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) {
81019
+ this.regionsContainerView.view.style.pointerEvents = "all";
81020
+ } else {
81021
+ this.regionsContainerView.view.style.pointerEvents = "none";
81022
+ }
80974
81023
  }
80975
81024
  _create_class(RegionRenderer, [
80976
81025
  {
@@ -81051,7 +81100,6 @@ var RegionRenderer = /*#__PURE__*/ function() {
81051
81100
  return RegionRenderer;
81052
81101
  }();
81053
81102
  // src/Ads/VideoAds/PresentationMode/Basic/BasicMode.ts
81054
- var import_events9 = __toESM(require_events());
81055
81103
  function adjustSizeWithAspectRatio(maxWidth, maxHeight, aspectRatio) {
81056
81104
  var width = maxWidth;
81057
81105
  var height = maxHeight;
@@ -81293,9 +81341,14 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
81293
81341
  var _this_adPresentationStrategy;
81294
81342
  (_this_adPresentationStrategy = _this.adPresentationStrategy) === null || _this_adPresentationStrategy === void 0 ? void 0 : _this_adPresentationStrategy.start();
81295
81343
  } else {
81296
- var _this_adPresentationStrategy1;
81344
+ var _this_adPresentationStrategy1, _adsConfigs_general_visibility_on_pause, _adsConfigs_general;
81297
81345
  var adsConfigs = _this.context.config.getAdsConfig();
81298
81346
  (_this_adPresentationStrategy1 = _this.adPresentationStrategy) === null || _this_adPresentationStrategy1 === void 0 ? void 0 : _this_adPresentationStrategy1.stop();
81347
+ 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)) {
81348
+ var _this_mediaElementSizeController, _this_regionsRenderer;
81349
+ (_this_mediaElementSizeController = _this.mediaElementSizeController) === null || _this_mediaElementSizeController === void 0 ? void 0 : _this_mediaElementSizeController.restore();
81350
+ (_this_regionsRenderer = _this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.clear();
81351
+ }
81299
81352
  }
81300
81353
  }
81301
81354
  if (oldState.fullscreen !== newState.fullscreen) {
@@ -81312,10 +81365,9 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
81312
81365
  height: this.context.media.viewHeight
81313
81366
  });
81314
81367
  if (this.context.elements.container) {
81315
- var _this_regionsRenderer;
81316
- (_this_regionsRenderer = this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.attach(this.context.elements.container, this.context.media.view);
81368
+ this.regionsRenderer.attach(this.context.elements.container, this.context.media.view);
81317
81369
  }
81318
- this.adPresentationStrategy = PresentationStrategyFactory.get(this.context.config.getStrategySettings());
81370
+ this.adPresentationStrategy = PresentationStrategyFactory.get(this.context.config);
81319
81371
  (_this_adPresentationStrategy = this.adPresentationStrategy) === null || _this_adPresentationStrategy === void 0 ? void 0 : _this_adPresentationStrategy.on("presentation", function() {
81320
81372
  var _this_mediaElementSizeController;
81321
81373
  var expected = (_this_mediaElementSizeController = _this.mediaElementSizeController) === null || _this_mediaElementSizeController === void 0 ? void 0 : _this_mediaElementSizeController.expectedDimensions(70, _this.context.store.getState().fullscreen ? 10 : 0);
@@ -81335,7 +81387,6 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
81335
81387
  }
81336
81388
  }).on("pace", function() {}).on("cooldown", function() {
81337
81389
  var _this_regionsRenderer;
81338
- console.log("Cooldown");
81339
81390
  (_this_regionsRenderer = _this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.clear();
81340
81391
  _this.packer.reset();
81341
81392
  setTimeout(function() {
@@ -81506,12 +81557,10 @@ var RegionFactory = /*#__PURE__*/ function() {
81506
81557
  {
81507
81558
  key: "getPluginForStrategy",
81508
81559
  value: function getPluginForStrategy() {
81509
- var _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general, _this_deps_config, _this_deps, _this_deps1;
81560
+ 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;
81510
81561
  var plugins2 = [];
81511
81562
  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) {
81512
81563
  plugins2.push(new RegionDebugPlugin());
81513
- } else {
81514
- plugins2.push(new RegionBorderPlugin());
81515
81564
  }
81516
81565
  if (!((_this_deps1 = this.deps) === null || _this_deps1 === void 0 ? void 0 : _this_deps1.strategy)) {
81517
81566
  return [
@@ -81531,10 +81580,10 @@ var RegionFactory = /*#__PURE__*/ function() {
81531
81580
  })
81532
81581
  ];
81533
81582
  }
81534
- if (this.deps.strategy === "banner" || this.deps.strategy === "bannerv2" || this.deps.strategy === "bannerv2_ocr" || this.deps.strategy === "test") {
81535
- plugins2.push(new RegionAnimationPlugin());
81536
- return plugins2;
81583
+ 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")) {
81584
+ plugins2.push(new RegionBorderPlugin(), new RegionAnimationPlugin());
81537
81585
  }
81586
+ return plugins2;
81538
81587
  }
81539
81588
  },
81540
81589
  {
@@ -81923,10 +81972,11 @@ var RegionRenderer2 = /*#__PURE__*/ function() {
81923
81972
  "use strict";
81924
81973
  function RegionRenderer2(context, width, height) {
81925
81974
  _class_call_check(this, RegionRenderer2);
81975
+ var _this_context_config_getAdsConfig_general_debug_mode, _this_context_config_getAdsConfig_general;
81926
81976
  this.regionsData = [];
81927
81977
  this.context = context;
81928
81978
  this.regionsObjects = new AdRegionsCollection3();
81929
- this.maxRegions = MAX_REGIONS2;
81979
+ 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;
81930
81980
  this.regionsContainerView = new RegionsContainerView3(width, height);
81931
81981
  this.regionFactory = new RegionFactory({
81932
81982
  recorder: this.context.recorder,
@@ -82087,10 +82137,10 @@ var NotBasicPresentationMode = /*#__PURE__*/ function() {
82087
82137
  var _this_adPresentationStrategy;
82088
82138
  (_this_adPresentationStrategy = _this.adPresentationStrategy) === null || _this_adPresentationStrategy === void 0 ? void 0 : _this_adPresentationStrategy.start();
82089
82139
  } else {
82090
- var _this_adPresentationStrategy1, _adsConfigs_general;
82140
+ var _this_adPresentationStrategy1, _adsConfigs_general_visibility_on_pause, _adsConfigs_general;
82091
82141
  var adsConfigs = _this.context.config.getAdsConfig();
82092
82142
  (_this_adPresentationStrategy1 = _this.adPresentationStrategy) === null || _this_adPresentationStrategy1 === void 0 ? void 0 : _this_adPresentationStrategy1.stop();
82093
- if (!((_adsConfigs_general = adsConfigs.general) === null || _adsConfigs_general === void 0 ? void 0 : _adsConfigs_general.visibility_on_pause)) {
82143
+ 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)) {
82094
82144
  var _this_regionsRenderer, _this_auxElementsRenderer;
82095
82145
  (_this_regionsRenderer = _this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.clear();
82096
82146
  (_this_auxElementsRenderer = _this.auxElementsRenderer) === null || _this_auxElementsRenderer === void 0 ? void 0 : _this_auxElementsRenderer.clear();
@@ -82108,7 +82158,7 @@ var NotBasicPresentationMode = /*#__PURE__*/ function() {
82108
82158
  (_this_auxElementsRenderer = this.auxElementsRenderer) === null || _this_auxElementsRenderer === void 0 ? void 0 : _this_auxElementsRenderer.attach(this.context.elements.container);
82109
82159
  (_this_regionsRenderer = this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.attach(this.context.elements.container);
82110
82160
  }
82111
- this.adPresentationStrategy = PresentationStrategyFactory.get(this.context.config.getStrategySettings());
82161
+ this.adPresentationStrategy = PresentationStrategyFactory.get(this.context.config);
82112
82162
  (_this_adPresentationStrategy = this.adPresentationStrategy) === null || _this_adPresentationStrategy === void 0 ? void 0 : _this_adPresentationStrategy.on("presentation", function() {
82113
82163
  var _this_context_data;
82114
82164
  var regions2 = (_this_context_data = _this.context.data) === null || _this_context_data === void 0 ? void 0 : _this_context_data.check(_this.context.media.currentTime);
@@ -82343,6 +82393,12 @@ var VideoAd = /*#__PURE__*/ function() {
82343
82393
  }
82344
82394
  }
82345
82395
  },
82396
+ {
82397
+ key: "media",
82398
+ get: function get() {
82399
+ return this.videoAdContext.media;
82400
+ }
82401
+ },
82346
82402
  {
82347
82403
  key: "updateRegionData",
82348
82404
  value: function updateRegionData() {
@@ -82489,6 +82545,15 @@ var VideoAds = /*#__PURE__*/ function() {
82489
82545
  }
82490
82546
  }
82491
82547
  },
82548
+ {
82549
+ key: "getVideoAd",
82550
+ value: function getVideoAd(index) {
82551
+ if (index === void 0) {
82552
+ return this.videoAdElements[0];
82553
+ }
82554
+ return this.videoAdElements[index];
82555
+ }
82556
+ },
82492
82557
  {
82493
82558
  key: "destroy",
82494
82559
  value: function destroy() {
@@ -82832,7 +82897,7 @@ var User = /*#__PURE__*/ function() {
82832
82897
  if (this.info.buyerUID) {
82833
82898
  return Promise.resolve(this);
82834
82899
  }
82835
- 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) {
82900
+ 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) {
82836
82901
  return response.json();
82837
82902
  }).then(function(data) {
82838
82903
  _this.info.buyerUID = data.remote_user_id;
@@ -86858,8 +86923,7 @@ var BrndtsAds = /*#__PURE__*/ function() {
86858
86923
  try {
86859
86924
  var config2 = new Config(options || {}, adsOptions || {});
86860
86925
  config2.fetch().then(function() {
86861
- var _config2_getAdsConfig_general_debug_mode, _config2_getAdsConfig_general;
86862
- 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);
86926
+ var logger3 = new Logger(true);
86863
86927
  _this.context = {
86864
86928
  config: config2,
86865
86929
  timers: {},
@@ -86979,6 +87043,21 @@ var BrndtsAds = /*#__PURE__*/ function() {
86979
87043
  }
86980
87044
  }
86981
87045
  },
87046
+ {
87047
+ key: "refreshConfigs",
87048
+ value: function refreshConfigs(options, adsOptions) {
87049
+ if (!this.ready.value) {
87050
+ return;
87051
+ }
87052
+ this.context.config.refresh(options, adsOptions);
87053
+ if (this.context.ads) {
87054
+ var _this_context_ads;
87055
+ (_this_context_ads = this.context.ads) === null || _this_context_ads === void 0 ? void 0 : _this_context_ads.destroy();
87056
+ this.context.ads = new Ads_default(this.context);
87057
+ this.context.ads.start();
87058
+ }
87059
+ }
87060
+ },
86982
87061
  {
86983
87062
  key: "restartControls",
86984
87063
  value: function restartControls(controlsConfig) {
@@ -86986,6 +87065,26 @@ var BrndtsAds = /*#__PURE__*/ function() {
86986
87065
  this.context.config.set("controls", controlsConfig);
86987
87066
  }
86988
87067
  },
87068
+ {
87069
+ key: "rewind",
87070
+ value: function rewind(value2) {
87071
+ var _this_context_ads_videoAds_getVideoAd, _this_context_ads_videoAds, _this_context_ads;
87072
+ if (!this.ready.value) {
87073
+ return;
87074
+ }
87075
+ (_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);
87076
+ }
87077
+ },
87078
+ {
87079
+ key: "forward",
87080
+ value: function forward(value2) {
87081
+ var _this_context_ads_videoAds_getVideoAd, _this_context_ads_videoAds, _this_context_ads;
87082
+ if (!this.ready.value) {
87083
+ return;
87084
+ }
87085
+ (_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);
87086
+ }
87087
+ },
86989
87088
  {
86990
87089
  key: "destroy",
86991
87090
  value: function destroy() {