@brndts/brndts-ads 1.14.4 → 1.14.5

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
@@ -462,13 +462,13 @@ var __toESM = function(mod, isNodeMode, target) {
462
462
  var require_events = __commonJS({
463
463
  "node_modules/events/events.js": function(exports, module2) {
464
464
  "use strict";
465
- var R = (typeof Reflect === "undefined" ? "undefined" : _type_of(Reflect)) === "object" ? Reflect : null;
466
- var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) {
465
+ var R2 = (typeof Reflect === "undefined" ? "undefined" : _type_of(Reflect)) === "object" ? Reflect : null;
466
+ var ReflectApply = R2 && typeof R2.apply === "function" ? R2.apply : function ReflectApply2(target, receiver, args) {
467
467
  return Function.prototype.apply.call(target, receiver, args);
468
468
  };
469
469
  var ReflectOwnKeys;
470
- if (R && typeof R.ownKeys === "function") {
471
- ReflectOwnKeys = R.ownKeys;
470
+ if (R2 && typeof R2.ownKeys === "function") {
471
+ ReflectOwnKeys = R2.ownKeys;
472
472
  } else if (Object.getOwnPropertySymbols) {
473
473
  ReflectOwnKeys = function ReflectOwnKeys2(target) {
474
474
  return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
@@ -68541,7 +68541,7 @@ var RegionContent = /*#__PURE__*/ function() {
68541
68541
  {
68542
68542
  key: "renderSandboxedContent",
68543
68543
  value: function renderSandboxedContent() {
68544
- var _iframe_contentWindow, _this_content_extra_sz, _this_content_extra, _this_content, _this_content_extra_sz1, _this_content_extra1, _this_content1;
68544
+ var _this_content_extra_sz, _this_content_extra, _this_content, _this_content_extra_sz1, _this_content_extra1, _this_content1, _this_content_extra_sz2, _this_content_extra2, _this_content2, _this_content_extra_sz3, _this_content_extra3, _this_content3, _iframe_contentWindow;
68545
68545
  var iframe = document.createElement("iframe");
68546
68546
  iframe.name = "prebid_ads_iframe_".concat(this.id);
68547
68547
  iframe.title = "3rd party ad content";
@@ -68558,15 +68558,19 @@ var RegionContent = /*#__PURE__*/ function() {
68558
68558
  iframe.style.border = "0";
68559
68559
  iframe.style.margin = "0";
68560
68560
  iframe.style.overflow = "hidden";
68561
- iframe.style.width = "100%";
68562
- iframe.style.height = "100%";
68561
+ iframe.style.width = "".concat(((_this_content = this.content) === null || _this_content === void 0 ? void 0 : (_this_content_extra = _this_content.extra) === null || _this_content_extra === void 0 ? void 0 : (_this_content_extra_sz = _this_content_extra.sz) === null || _this_content_extra_sz === void 0 ? void 0 : _this_content_extra_sz.w) ? this.content.extra.sz.w + "px" : "100%", ";");
68562
+ iframe.style.height = "".concat(((_this_content1 = this.content) === null || _this_content1 === void 0 ? void 0 : (_this_content_extra1 = _this_content1.extra) === null || _this_content_extra1 === void 0 ? void 0 : (_this_content_extra_sz1 = _this_content_extra1.sz) === null || _this_content_extra_sz1 === void 0 ? void 0 : _this_content_extra_sz1.h) ? this.content.extra.sz.h + "px" : "100%", ";");
68563
+ iframe.width = "".concat(((_this_content2 = this.content) === null || _this_content2 === void 0 ? void 0 : (_this_content_extra2 = _this_content2.extra) === null || _this_content_extra2 === void 0 ? void 0 : (_this_content_extra_sz2 = _this_content_extra2.sz) === null || _this_content_extra_sz2 === void 0 ? void 0 : _this_content_extra_sz2.w) ? this.content.extra.sz.w : "100%", ";");
68564
+ iframe.height = "".concat(((_this_content3 = this.content) === null || _this_content3 === void 0 ? void 0 : (_this_content_extra3 = _this_content3.extra) === null || _this_content_extra3 === void 0 ? void 0 : (_this_content_extra_sz3 = _this_content_extra3.sz) === null || _this_content_extra_sz3 === void 0 ? void 0 : _this_content_extra_sz3.h) ? this.content.extra.sz.h : "100%", ";");
68565
+ var scale = this.getScaleValue();
68566
+ iframe.style.transform = "scale(".concat(scale.x, ", ").concat(scale.y, ")");
68567
+ iframe.style.transformOrigin = "top left";
68563
68568
  this.container.appendChild(iframe);
68564
68569
  var iframeDoc = (_iframe_contentWindow = iframe.contentWindow) === null || _iframe_contentWindow === void 0 ? void 0 : _iframe_contentWindow.document;
68565
68570
  if (!iframeDoc) return;
68566
68571
  var stringContent = this.content.asStr;
68567
- var scale = this.getScaleValue();
68568
68572
  iframeDoc.open();
68569
- iframeDoc.write('\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset="utf-8">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <style>\n\n html, body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n overflow: hidden;\n }\n .ad-container {\n width: '.concat(((_this_content = this.content) === null || _this_content === void 0 ? void 0 : (_this_content_extra = _this_content.extra) === null || _this_content_extra === void 0 ? void 0 : (_this_content_extra_sz = _this_content_extra.sz) === null || _this_content_extra_sz === void 0 ? void 0 : _this_content_extra_sz.w) ? this.content.extra.sz.w + "px" : "100%", ";\n height: ").concat(((_this_content1 = this.content) === null || _this_content1 === void 0 ? void 0 : (_this_content_extra1 = _this_content1.extra) === null || _this_content_extra1 === void 0 ? void 0 : (_this_content_extra_sz1 = _this_content_extra1.sz) === null || _this_content_extra_sz1 === void 0 ? void 0 : _this_content_extra_sz1.h) ? this.content.extra.sz.h + "px" : "100%", ";\n transform: scale(").concat(scale.x, ", ").concat(scale.y, ');\n transform-origin: top left;\n }\n .ad-container > * {\n padding: 0 !important;\n }\n </style>\n </head>\n <body>\n <div class="ad-container">').concat(stringContent, "</div>\n </body>\n </html>\n "));
68573
+ iframeDoc.write('\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset="utf-8">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <style>\n\n html, body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n overflow: hidden;\n }\n .ad-container > * {\n padding: 0 !important;\n }\n </style>\n </head>\n <body>\n <div class="ad-container">'.concat(stringContent, "</div>\n </body>\n </html>\n "));
68570
68574
  iframeDoc.close();
68571
68575
  }
68572
68576
  },
@@ -71634,29 +71638,125 @@ var PrebidConfigBuilder = /*#__PURE__*/ function() {
71634
71638
  {
71635
71639
  key: "addConsent",
71636
71640
  value: function addConsent(consent) {
71637
- if (// @ts-expect-error
71638
- window.__tcfapi !== void 0 && // @ts-expect-error
71639
- typeof window.__tcfapi === "function") {
71640
- this.config.consentManagement = {
71641
+ var hasTcfCmp = typeof window.__tcfapi === "function";
71642
+ var hasGppCmp = typeof window.__gpp === "function";
71643
+ var cm = {};
71644
+ if (hasTcfCmp) {
71645
+ cm.gdpr = {
71641
71646
  cmpApi: "iab",
71642
71647
  timeout: 8e3,
71643
- allowAuctionWithoutConsent: true,
71644
- defaultGdprScope: true
71648
+ defaultGdprScope: true,
71649
+ rules: [
71650
+ {
71651
+ purpose: "basicAds",
71652
+ enforcePurpose: true,
71653
+ enforceVendor: true,
71654
+ softVendorExceptions: [
71655
+ "valuad",
71656
+ "improvedigital"
71657
+ ]
71658
+ },
71659
+ {
71660
+ purpose: "storage",
71661
+ enforcePurpose: true,
71662
+ enforceVendor: true,
71663
+ softVendorExceptions: [
71664
+ "valuad",
71665
+ "improvedigital"
71666
+ ]
71667
+ },
71668
+ // add P4 so UFPD can flow when CMP gives consent
71669
+ {
71670
+ purpose: "personalizedAds",
71671
+ enforcePurpose: true,
71672
+ enforceVendor: true
71673
+ },
71674
+ {
71675
+ purpose: "measurement",
71676
+ enforcePurpose: true,
71677
+ enforceVendor: true
71678
+ }
71679
+ ]
71645
71680
  };
71646
71681
  } else {
71647
- this.config.consentManagement = {
71682
+ var _gdpr_purpose_consents, _gdpr_purpose, _gdpr_purpose_consents1, _gdpr_purpose1, _gdpr_purpose_consents2, _gdpr_purpose2, _gdpr_purpose_consents3, _gdpr_purpose3;
71683
+ var gdpr = typeof consent.gdpr === "function" ? consent.gdpr() : void 0;
71684
+ var _gdpr_gdprApplies, _gdpr_purpose_consents_1, _gdpr_purpose_consents_2, _gdpr_purpose_consents_4, _gdpr_purpose_consents_7;
71685
+ cm.gdpr = {
71648
71686
  cmpApi: "static",
71649
71687
  timeout: 8e3,
71650
- allowAuctionWithoutConsent: true,
71651
71688
  defaultGdprScope: true,
71652
71689
  consentData: {
71653
71690
  getTCData: {
71654
- tcString: consent.gdpr().tcString || "",
71655
- gdprApplies: consent.gdpr().gdprApplies || false
71691
+ tcString: (gdpr === null || gdpr === void 0 ? void 0 : gdpr.tcString) || "",
71692
+ gdprApplies: (_gdpr_gdprApplies = gdpr === null || gdpr === void 0 ? void 0 : gdpr.gdprApplies) !== null && _gdpr_gdprApplies !== void 0 ? _gdpr_gdprApplies : true,
71693
+ // Grant P1, P2, P4, P7 so modules won't be denied in static mode
71694
+ purpose: {
71695
+ consents: {
71696
+ "1": (_gdpr_purpose_consents_1 = gdpr === null || gdpr === void 0 ? void 0 : (_gdpr_purpose = gdpr.purpose) === null || _gdpr_purpose === void 0 ? void 0 : (_gdpr_purpose_consents = _gdpr_purpose.consents) === null || _gdpr_purpose_consents === void 0 ? void 0 : _gdpr_purpose_consents["1"]) !== null && _gdpr_purpose_consents_1 !== void 0 ? _gdpr_purpose_consents_1 : true,
71697
+ // storage (accessDevice)
71698
+ "2": (_gdpr_purpose_consents_2 = gdpr === null || gdpr === void 0 ? void 0 : (_gdpr_purpose1 = gdpr.purpose) === null || _gdpr_purpose1 === void 0 ? void 0 : (_gdpr_purpose_consents1 = _gdpr_purpose1.consents) === null || _gdpr_purpose_consents1 === void 0 ? void 0 : _gdpr_purpose_consents1["2"]) !== null && _gdpr_purpose_consents_2 !== void 0 ? _gdpr_purpose_consents_2 : true,
71699
+ // basic ads (fetchBids)
71700
+ "4": (_gdpr_purpose_consents_4 = gdpr === null || gdpr === void 0 ? void 0 : (_gdpr_purpose2 = gdpr.purpose) === null || _gdpr_purpose2 === void 0 ? void 0 : (_gdpr_purpose_consents2 = _gdpr_purpose2.consents) === null || _gdpr_purpose_consents2 === void 0 ? void 0 : _gdpr_purpose_consents2["4"]) !== null && _gdpr_purpose_consents_4 !== void 0 ? _gdpr_purpose_consents_4 : true,
71701
+ // personalized ads (transmitUfpd)
71702
+ "7": (_gdpr_purpose_consents_7 = gdpr === null || gdpr === void 0 ? void 0 : (_gdpr_purpose3 = gdpr.purpose) === null || _gdpr_purpose3 === void 0 ? void 0 : (_gdpr_purpose_consents3 = _gdpr_purpose3.consents) === null || _gdpr_purpose_consents3 === void 0 ? void 0 : _gdpr_purpose_consents3["7"]) !== null && _gdpr_purpose_consents_7 !== void 0 ? _gdpr_purpose_consents_7 : true
71703
+ }
71704
+ }
71705
+ }
71706
+ },
71707
+ rules: [
71708
+ // In static mode: enforce purpose, skip vendor checks
71709
+ {
71710
+ purpose: "basicAds",
71711
+ enforcePurpose: true,
71712
+ enforceVendor: false
71713
+ },
71714
+ {
71715
+ purpose: "storage",
71716
+ enforcePurpose: true,
71717
+ enforceVendor: false
71718
+ },
71719
+ {
71720
+ purpose: "personalizedAds",
71721
+ enforcePurpose: true,
71722
+ enforceVendor: false
71723
+ },
71724
+ // <-- allows transmitUfpd
71725
+ {
71726
+ purpose: "measurement",
71727
+ enforcePurpose: true,
71728
+ enforceVendor: false
71656
71729
  }
71730
+ ]
71731
+ };
71732
+ this.config.allowActivities = _object_spread_props(_object_spread({}, this.config.allowActivities), {
71733
+ accessDevice: {
71734
+ rules: [
71735
+ {
71736
+ allow: true
71737
+ }
71738
+ ]
71739
+ }
71740
+ });
71741
+ }
71742
+ if (hasGppCmp) {
71743
+ cm.gpp = {
71744
+ cmpApi: "iab",
71745
+ timeout: 8e3
71746
+ };
71747
+ } else {
71748
+ var gpp = typeof consent.gpp === "function" ? consent.gpp() : void 0;
71749
+ cm.gpp = {
71750
+ cmpApi: "static",
71751
+ timeout: 8e3,
71752
+ consentData: {
71753
+ gppString: (gpp === null || gpp === void 0 ? void 0 : gpp.gppString) || "",
71754
+ applicableSections: /* gpp?.applicableSections ?? gpp?.sectionList ?? */ [],
71755
+ sectionList: /* gpp?.sectionList ?? gpp?.applicableSections ?? */ []
71657
71756
  }
71658
71757
  };
71659
71758
  }
71759
+ this.config.consentManagement = cm;
71660
71760
  return this;
71661
71761
  }
71662
71762
  },
@@ -73940,25 +74040,15 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
73940
74040
  }
73941
74041
  },
73942
74042
  {
73943
- key: "assurePlaybackState",
73944
- value: function assurePlaybackState(play) {
73945
- if (this.media && this.media.hasPlayed) {
73946
- var _this_instance;
73947
- var newVideoIndex = (_this_instance = this.instance) === null || _this_instance === void 0 ? void 0 : _this_instance.getPlaylistIndex();
73948
- if (newVideoIndex !== this.currentVideoIndex) {
73949
- this.currentVideoIndex = newVideoIndex;
73950
- if (this._source && this._source.type === "playlist") {
73951
- var _this__source;
73952
- this._source.videoId = this.videoId;
73953
- this.emit("UPDATED_SOURCE", (_this__source = this._source) === null || _this__source === void 0 ? void 0 : _this__source.videoId);
73954
- }
73955
- }
74043
+ key: "checkForVideoIdChanges",
74044
+ value: function checkForVideoIdChanges() {
74045
+ if (!this._source || this._source.type !== "playlist") {
74046
+ return;
73956
74047
  }
73957
- if (this.media && play && !this.media.hasPlayed) {
73958
- this.media.hasPlayed = true;
73959
- if (this._source) {
73960
- this._source.videoId = this.videoId;
73961
- }
74048
+ var currentVideoId = this.videoId;
74049
+ if (currentVideoId && currentVideoId.trim() !== "" && currentVideoId !== this._source.videoId) {
74050
+ this._source.videoId = currentVideoId;
74051
+ this.emit("UPDATED_SOURCE", this._source.videoId);
73962
74052
  }
73963
74053
  }
73964
74054
  },
@@ -73987,13 +74077,11 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
73987
74077
  key: "handleYTPlayerReady",
73988
74078
  value: function handleYTPlayerReady(event) {
73989
74079
  var _this = this;
73990
- var _this_instance;
73991
74080
  if (this.instance) {
73992
74081
  this.context.logger.warn("Instance already found!");
73993
74082
  return;
73994
74083
  }
73995
74084
  this.instance = event.target;
73996
- this.currentVideoIndex = (_this_instance = this.instance) === null || _this_instance === void 0 ? void 0 : _this_instance.getPlaylistIndex();
73997
74085
  this.ready = true;
73998
74086
  this.observeResize();
73999
74087
  this.context.store.dispatch({
@@ -74008,6 +74096,7 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74008
74096
  if (newState !== _this.state) {
74009
74097
  _this.handlePlayerStateChange(newState);
74010
74098
  }
74099
+ _this.checkForVideoIdChanges();
74011
74100
  }, 10);
74012
74101
  }
74013
74102
  },
@@ -74029,19 +74118,16 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74029
74118
  case -1:
74030
74119
  break;
74031
74120
  case 0:
74032
- this.assurePlaybackState(false);
74033
74121
  this.context.store.dispatch({
74034
74122
  type: "PAUSE"
74035
74123
  });
74036
74124
  break;
74037
74125
  case 1:
74038
- this.assurePlaybackState(true);
74039
74126
  this.context.store.dispatch({
74040
74127
  type: "PLAY"
74041
74128
  });
74042
74129
  break;
74043
74130
  case 2:
74044
- this.assurePlaybackState(false);
74045
74131
  this.context.store.dispatch({
74046
74132
  type: "PAUSE"
74047
74133
  });
@@ -74298,7 +74384,6 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74298
74384
  key: "play",
74299
74385
  value: function play() {
74300
74386
  var _this_instance;
74301
- this.assurePlaybackState(true);
74302
74387
  (_this_instance = this.instance) === null || _this_instance === void 0 ? void 0 : _this_instance.playVideo();
74303
74388
  return Promise.resolve();
74304
74389
  }
@@ -74307,7 +74392,6 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74307
74392
  key: "pause",
74308
74393
  value: function pause() {
74309
74394
  var _this_instance;
74310
- this.assurePlaybackState(false);
74311
74395
  (_this_instance = this.instance) === null || _this_instance === void 0 ? void 0 : _this_instance.pauseVideo();
74312
74396
  return Promise.resolve();
74313
74397
  }
@@ -76921,6 +77005,22 @@ var VideoRegionsDataCollection = /*#__PURE__*/ function() {
76921
77005
  }
76922
77006
  return this.missingInfo[keys[keys.length - 1]];
76923
77007
  }
77008
+ },
77009
+ {
77010
+ key: "getLoadedPercentage",
77011
+ value: function getLoadedPercentage() {
77012
+ if (this.isComplete) {
77013
+ return 100;
77014
+ }
77015
+ if (this.timestampList.length === 0) {
77016
+ return 0;
77017
+ }
77018
+ ;
77019
+ var firstMissingTimestamp = Object.keys(this.missingInfo).sort(function(a, b) {
77020
+ return parseFloat(a) - parseFloat(b);
77021
+ })[0];
77022
+ return parseFloat(firstMissingTimestamp) / this.totalLengthSeconds * 100;
77023
+ }
76924
77024
  }
76925
77025
  ]);
76926
77026
  return VideoRegionsDataCollection;
@@ -76952,6 +77052,7 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
76952
77052
  value: function handlePredictionResult(data) {
76953
77053
  var _this_cache;
76954
77054
  this.regionsData.append(data);
77055
+ this.emit("UPDATE");
76955
77056
  (_this_cache = this.cache) === null || _this_cache === void 0 ? void 0 : _this_cache.update(data);
76956
77057
  }
76957
77058
  },
@@ -76960,6 +77061,7 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
76960
77061
  value: function handlePredictionCompleted() {
76961
77062
  var _this_logger;
76962
77063
  (_this_logger = this.logger) === null || _this_logger === void 0 ? void 0 : _this_logger.log("Prediction completed!");
77064
+ this.emit("UPDATE");
76963
77065
  }
76964
77066
  },
76965
77067
  {
@@ -77027,6 +77129,12 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
77027
77129
  return this.regionsData.get(timestamp);
77028
77130
  }
77029
77131
  },
77132
+ {
77133
+ key: "progress",
77134
+ value: function progress() {
77135
+ return this.regionsData.getLoadedPercentage();
77136
+ }
77137
+ },
77030
77138
  {
77031
77139
  key: "dumps",
77032
77140
  value: function dumps(from, to) {
@@ -77052,6 +77160,7 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
77052
77160
  this.service.send("stop");
77053
77161
  this.service.destroy();
77054
77162
  this.regionsData.load(data);
77163
+ this.emit("UPDATE");
77055
77164
  return;
77056
77165
  }
77057
77166
  if (typeof window === "undefined") {
@@ -77081,6 +77190,7 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
77081
77190
  _this.service.send("stop");
77082
77191
  _this.service.destroy();
77083
77192
  _this.regionsData.load(parsed);
77193
+ _this.emit("UPDATE");
77084
77194
  } catch (err) {
77085
77195
  var _this_logger;
77086
77196
  (_this_logger = _this.logger) === null || _this_logger === void 0 ? void 0 : _this_logger.error("Failed to load data:", err);
@@ -81076,6 +81186,60 @@ var ProgressBar = /*#__PURE__*/ function() {
81076
81186
  ]);
81077
81187
  return ProgressBar;
81078
81188
  }();
81189
+ // src/Ads/VideoAds/UI/Controls/Components/ProgressIndicator.ts
81190
+ var NS = "http://www.w3.org/2000/svg";
81191
+ var BOX_S = 16;
81192
+ var R = 6;
81193
+ var CIRC = 2 * Math.PI * R;
81194
+ var ProgressBanner = /*#__PURE__*/ function() {
81195
+ "use strict";
81196
+ function ProgressBanner() {
81197
+ _class_call_check(this, ProgressBanner);
81198
+ this.view = document.createElement("div");
81199
+ this.view.classList.add("progress-banner");
81200
+ var circleWrap = document.createElement("div");
81201
+ circleWrap.classList.add("progress-circle");
81202
+ circleWrap.style.width = "".concat(BOX_S, "px");
81203
+ circleWrap.style.height = "".concat(BOX_S, "px");
81204
+ var svg = document.createElementNS(NS, "svg");
81205
+ svg.setAttribute("viewBox", "0 0 ".concat(BOX_S, " ").concat(BOX_S));
81206
+ var bg = document.createElementNS(NS, "circle");
81207
+ bg.setAttribute("cx", "".concat(BOX_S / 2));
81208
+ bg.setAttribute("cy", "".concat(BOX_S / 2));
81209
+ bg.setAttribute("r", R.toString());
81210
+ bg.classList.add("bg");
81211
+ svg.appendChild(bg);
81212
+ this.fg = document.createElementNS(NS, "circle");
81213
+ this.fg.setAttribute("cx", "".concat(BOX_S / 2));
81214
+ this.fg.setAttribute("cy", "".concat(BOX_S / 2));
81215
+ this.fg.setAttribute("r", R.toString());
81216
+ this.fg.classList.add("fg");
81217
+ this.fg.setAttribute("stroke-dasharray", "".concat(CIRC));
81218
+ this.fg.setAttribute("stroke-dashoffset", "".concat(CIRC));
81219
+ svg.setAttribute("tabindex", "0");
81220
+ svg.appendChild(this.fg);
81221
+ circleWrap.appendChild(svg);
81222
+ this.view.appendChild(circleWrap);
81223
+ this.view.setAttribute("aria-label", "Video processing is 0% complete.");
81224
+ this.label = document.createElement("span");
81225
+ this.label.classList.add("progress-label");
81226
+ this.view.appendChild(this.label);
81227
+ this.setValue(0);
81228
+ }
81229
+ _create_class(ProgressBanner, [
81230
+ {
81231
+ /** Update the banner (0 – 100) */ key: "setValue",
81232
+ value: function setValue(value2) {
81233
+ var offset = CIRC - value2 / 100 * CIRC;
81234
+ this.fg.setAttribute("stroke-dashoffset", "".concat(offset));
81235
+ var text2 = "Video processing is ".concat(Math.ceil(value2), "% complete.");
81236
+ this.label.textContent = text2;
81237
+ this.view.setAttribute("aria-label", text2);
81238
+ }
81239
+ }
81240
+ ]);
81241
+ return ProgressBanner;
81242
+ }();
81079
81243
  // src/Ads/VideoAds/UI/Controls/Components/BottomBar/ControlBottomBar.ts
81080
81244
  var ControlBottomBar = /*#__PURE__*/ function() {
81081
81245
  "use strict";
@@ -81215,6 +81379,47 @@ var DailymotionBottomBar = /*#__PURE__*/ function() {
81215
81379
  ]);
81216
81380
  return DailymotionBottomBar;
81217
81381
  }();
81382
+ var NativeBottomBar = /*#__PURE__*/ function() {
81383
+ "use strict";
81384
+ function NativeBottomBar(context, events) {
81385
+ var _this = this;
81386
+ _class_call_check(this, NativeBottomBar);
81387
+ this.buttons = {};
81388
+ this.context = context;
81389
+ this.events = events;
81390
+ this.controlsContainer = document.createElement("div");
81391
+ this.controlsContainer.id = "BRNDTS_CTLBB";
81392
+ this.controlsContainer.dataset.type = "N_CTLBB";
81393
+ var topElement = document.createElement("div");
81394
+ topElement.classList.add("BRNDTS_CTLBB_TOP");
81395
+ this.controlsContainer.appendChild(topElement);
81396
+ var ind = new ProgressBanner();
81397
+ this.context.store.subscribe(this.handleStateChange.bind(this));
81398
+ this.context.data.on("UPDATE", function() {
81399
+ ind.setValue(_this.context.data.progress());
81400
+ });
81401
+ topElement.appendChild(ind.view);
81402
+ }
81403
+ _create_class(NativeBottomBar, [
81404
+ {
81405
+ key: "handleStateChange",
81406
+ value: function handleStateChange(state) {}
81407
+ },
81408
+ {
81409
+ key: "view",
81410
+ get: function get() {
81411
+ return this.controlsContainer;
81412
+ }
81413
+ },
81414
+ {
81415
+ key: "destroy",
81416
+ value: function destroy() {
81417
+ this.view.remove();
81418
+ }
81419
+ }
81420
+ ]);
81421
+ return NativeBottomBar;
81422
+ }();
81218
81423
  // src/Ads/VideoAds/UI/Controls/Controls.ts
81219
81424
  var Controls = /*#__PURE__*/ function() {
81220
81425
  "use strict";
@@ -81257,7 +81462,12 @@ var Controls = /*#__PURE__*/ function() {
81257
81462
  this.container.appendChild(this.controlBottomBar.view);
81258
81463
  }
81259
81464
  if (this.context.media.is("NATIVE")) {
81465
+ var _this_context_config_get_elements, _this_context_config_get1;
81260
81466
  this.setTopBar();
81467
+ if ((_this_context_config_get1 = this.context.config.get("controls")) === null || _this_context_config_get1 === void 0 ? void 0 : (_this_context_config_get_elements = _this_context_config_get1.elements) === null || _this_context_config_get_elements === void 0 ? void 0 : _this_context_config_get_elements.progress_ind) {
81468
+ this.controlBottomBar = new NativeBottomBar(this.context, this.events);
81469
+ this.container.appendChild(this.controlBottomBar.view);
81470
+ }
81261
81471
  }
81262
81472
  }
81263
81473
  }
@@ -83913,6 +84123,12 @@ var VideoRegionsDataManagerDecorator = /*#__PURE__*/ function() {
83913
84123
  return this.component.on(event, handler);
83914
84124
  }
83915
84125
  },
84126
+ {
84127
+ key: "off",
84128
+ value: function off(event, handler) {
84129
+ return this.component.off(event, handler);
84130
+ }
84131
+ },
83916
84132
  {
83917
84133
  key: "fetch",
83918
84134
  value: function fetch1() {
@@ -83931,6 +84147,12 @@ var VideoRegionsDataManagerDecorator = /*#__PURE__*/ function() {
83931
84147
  return this.component.check(timestamp);
83932
84148
  }
83933
84149
  },
84150
+ {
84151
+ key: "progress",
84152
+ value: function progress() {
84153
+ return this.component.progress();
84154
+ }
84155
+ },
83934
84156
  {
83935
84157
  key: "get",
83936
84158
  value: function get(timestamp) {
@@ -83951,8 +84173,8 @@ var VideoRegionsDataManagerDecorator = /*#__PURE__*/ function() {
83951
84173
  },
83952
84174
  {
83953
84175
  key: "loads",
83954
- value: function loads() {
83955
- return this.component.loads();
84176
+ value: function loads(data) {
84177
+ return this.component.loads(data);
83956
84178
  }
83957
84179
  }
83958
84180
  ]);
@@ -84191,7 +84413,7 @@ var VideoRegionsDecoratorFactory = /*#__PURE__*/ function() {
84191
84413
  minDuration: params.minimum_display_time.value
84192
84414
  });
84193
84415
  }
84194
- if ((_params_ad_placements_and_sizes = params.ad_placements_and_sizes) === null || _params_ad_placements_and_sizes === void 0 ? void 0 : _params_ad_placements_and_sizes.value) {
84416
+ if (((_params_ad_placements_and_sizes = params.ad_placements_and_sizes) === null || _params_ad_placements_and_sizes === void 0 ? void 0 : _params_ad_placements_and_sizes.value) !== void 0) {
84195
84417
  target = new VideoRegionsTypeFilterDecorator(target, params.ad_placements_and_sizes);
84196
84418
  }
84197
84419
  return target;