@brndts/brndts-ads 1.10.4 → 1.11.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 +166 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +166 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -69370,13 +69370,63 @@ var AffiliateProvider = /*#__PURE__*/ function(ContentProvider1) {
|
|
69370
69370
|
},
|
69371
69371
|
{
|
69372
69372
|
key: "getAffiliate",
|
69373
|
-
value: function getAffiliate(regionId, size) {
|
69373
|
+
value: function getAffiliate(regionId, size, adType, regionName) {
|
69374
69374
|
var _this = this;
|
69375
69375
|
if (!regionId) {
|
69376
|
+
if (adType && regionName) {
|
69377
|
+
var sizes = ContentProvider.adSizes[adType];
|
69378
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
69379
|
+
try {
|
69380
|
+
var _this1, _loop = function() {
|
69381
|
+
var _step_value = _sliced_to_array(_step.value, 2), width = _step_value[0], height = _step_value[1];
|
69382
|
+
var identifier = "".concat(width, "x").concat(height);
|
69383
|
+
var aff2 = _this1.manifest.filter(function(a) {
|
69384
|
+
return a.size.w === width && a.size.h === height;
|
69385
|
+
});
|
69386
|
+
if (!aff2.length) {
|
69387
|
+
return "continue";
|
69388
|
+
}
|
69389
|
+
if (!_this1.useByRegion[identifier]) {
|
69390
|
+
_this1.useByRegion[identifier] = /* @__PURE__ */ new Set();
|
69391
|
+
}
|
69392
|
+
if (_this1.useByRegion[identifier].size === aff2.length) {
|
69393
|
+
_this1.useByRegion[identifier].clear();
|
69394
|
+
}
|
69395
|
+
var unused2 = aff2.filter(function(a) {
|
69396
|
+
return !_this.useByRegion[identifier].has(a.id);
|
69397
|
+
});
|
69398
|
+
if (unused2.length) {
|
69399
|
+
var randomIndex2 = Math.floor(Math.random() * unused2.length);
|
69400
|
+
var selected = unused2[randomIndex2];
|
69401
|
+
_this1.useByRegion[identifier].add(selected.id);
|
69402
|
+
return {
|
69403
|
+
v: selected
|
69404
|
+
};
|
69405
|
+
}
|
69406
|
+
};
|
69407
|
+
for(var _iterator = sizes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
69408
|
+
var _ret = (_this1 = this, _loop());
|
69409
|
+
if (_type_of(_ret) === "object") return _ret.v;
|
69410
|
+
}
|
69411
|
+
} catch (err) {
|
69412
|
+
_didIteratorError = true;
|
69413
|
+
_iteratorError = err;
|
69414
|
+
} finally{
|
69415
|
+
try {
|
69416
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
69417
|
+
_iterator.return();
|
69418
|
+
}
|
69419
|
+
} finally{
|
69420
|
+
if (_didIteratorError) {
|
69421
|
+
throw _iteratorError;
|
69422
|
+
}
|
69423
|
+
}
|
69424
|
+
}
|
69425
|
+
}
|
69376
69426
|
if ((size === null || size === void 0 ? void 0 : size.width) && (size === null || size === void 0 ? void 0 : size.height)) {
|
69377
69427
|
var identifier = "".concat(size.width, "x").concat(size.height);
|
69378
69428
|
var aff2 = this.manifest.filter(function(a) {
|
69379
|
-
return a.size.w === size.width && a.size.h === size.height;
|
69429
|
+
return a.size.w === (size === null || size === void 0 ? void 0 : size.width) && a.size.h === size.height;
|
69380
69430
|
});
|
69381
69431
|
if (!aff2.length) {
|
69382
69432
|
return null;
|
@@ -69431,7 +69481,10 @@ var AffiliateProvider = /*#__PURE__*/ function(ContentProvider1) {
|
|
69431
69481
|
case 1:
|
69432
69482
|
_state.sent();
|
69433
69483
|
affiliate = null;
|
69434
|
-
if (params.params.
|
69484
|
+
if (!affiliate && params.params.adType && params.params.regionName) {
|
69485
|
+
affiliate = this.getAffiliate(void 0, params.size, params.params.adType, params.params.regionName);
|
69486
|
+
}
|
69487
|
+
if (!affiliate && params.params.useRatio) {
|
69435
69488
|
regionInfo = ContentProvider.approxRegionByRatio(params.size.width, params.size.height);
|
69436
69489
|
if (regionInfo) {
|
69437
69490
|
affiliate = this.getAffiliate("".concat(regionInfo.id), {
|
@@ -69684,15 +69737,22 @@ var PrebidJS = /*#__PURE__*/ function() {
|
|
69684
69737
|
},
|
69685
69738
|
{
|
69686
69739
|
key: "defineSlot",
|
69687
|
-
value: function defineSlot(options, slotId, containerId) {
|
69740
|
+
value: function defineSlot(options, slotId, containerId, adType) {
|
69688
69741
|
var _window_pbjs;
|
69689
69742
|
var unitDefinition = options.units.find(function(unit) {
|
69690
69743
|
return unit.code === "".concat(slotId);
|
69691
69744
|
});
|
69745
|
+
var sizes = [];
|
69692
69746
|
if (!unitDefinition) {
|
69693
69747
|
console.error("No unit definition found for slotId: ".concat(slotId));
|
69694
69748
|
return;
|
69695
69749
|
}
|
69750
|
+
if (adType) {
|
69751
|
+
sizes = ContentProvider.adSizes[adType];
|
69752
|
+
} else {
|
69753
|
+
var _unitDefinition_mediaTypes_banner;
|
69754
|
+
sizes = ((_unitDefinition_mediaTypes_banner = unitDefinition.mediaTypes.banner) === null || _unitDefinition_mediaTypes_banner === void 0 ? void 0 : _unitDefinition_mediaTypes_banner.sizes) || [];
|
69755
|
+
}
|
69696
69756
|
if (!((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
|
69697
69757
|
return containerId === defUnit.code;
|
69698
69758
|
}))) {
|
@@ -69702,6 +69762,11 @@ var PrebidJS = /*#__PURE__*/ function() {
|
|
69702
69762
|
if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
|
69703
69763
|
window.pbjs.addAdUnits([
|
69704
69764
|
_object_spread_props(_object_spread({}, unitDefinition), {
|
69765
|
+
mediaTypes: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes || {}), {
|
69766
|
+
banner: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes.banner || {}), {
|
69767
|
+
sizes: sizes
|
69768
|
+
})
|
69769
|
+
}),
|
69705
69770
|
code: containerId
|
69706
69771
|
})
|
69707
69772
|
]);
|
@@ -69869,7 +69934,7 @@ var PrebidjsProvider = /*#__PURE__*/ function(ContentProvider1) {
|
|
69869
69934
|
key: "request",
|
69870
69935
|
value: function request(params) {
|
69871
69936
|
return _async_to_generator(function() {
|
69872
|
-
var _this, regionId, regionInfo, regionInfo1;
|
69937
|
+
var _this, adType, regionId, regionInfo, regionInfo1;
|
69873
69938
|
return _ts_generator(this, function(_state) {
|
69874
69939
|
switch(_state.label){
|
69875
69940
|
case 0:
|
@@ -69880,6 +69945,7 @@ var PrebidjsProvider = /*#__PURE__*/ function(ContentProvider1) {
|
|
69880
69945
|
];
|
69881
69946
|
case 1:
|
69882
69947
|
_state.sent();
|
69948
|
+
adType = params.params.adType;
|
69883
69949
|
regionId = params.params.regionId;
|
69884
69950
|
if (params.params.useRatio) {
|
69885
69951
|
regionInfo = ContentProvider.approxRegionByRatio(params.size.width, params.size.height);
|
@@ -69904,7 +69970,7 @@ var PrebidjsProvider = /*#__PURE__*/ function(ContentProvider1) {
|
|
69904
69970
|
];
|
69905
69971
|
case 2:
|
69906
69972
|
_state.sent();
|
69907
|
-
PrebidJS.defineSlot(this.options, regionId, params.params.regionId);
|
69973
|
+
PrebidJS.defineSlot(this.options, regionId, params.params.regionId, adType);
|
69908
69974
|
PrebidJS.request(regionId, params.params.regionId, function(bids) {
|
69909
69975
|
return _this.processBids(params, bids);
|
69910
69976
|
});
|
@@ -70174,18 +70240,25 @@ var PrebidGAM = /*#__PURE__*/ function() {
|
|
70174
70240
|
},
|
70175
70241
|
{
|
70176
70242
|
key: "defineSlot",
|
70177
|
-
value: function defineSlot(options, slotId, containerId) {
|
70178
|
-
var
|
70243
|
+
value: function defineSlot(options, slotId, containerId, adType) {
|
70244
|
+
var adName = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "banner";
|
70245
|
+
var _window_pbjs;
|
70179
70246
|
var gamNetworkId = _PrebidGAM.getProperGAMNetworkId(options);
|
70180
70247
|
var unitDefinition = options.units.find(function(unit) {
|
70181
70248
|
return unit.code === "".concat(slotId);
|
70182
70249
|
});
|
70250
|
+
var sizes = [];
|
70183
70251
|
if (!unitDefinition) {
|
70184
70252
|
console.error("No unit definition found for slotId: ".concat(slotId));
|
70185
70253
|
return;
|
70186
70254
|
}
|
70187
|
-
|
70188
|
-
|
70255
|
+
if (adType) {
|
70256
|
+
sizes = ContentProvider.adSizes[adType];
|
70257
|
+
} else {
|
70258
|
+
var _unitDefinition_mediaTypes_banner;
|
70259
|
+
sizes = ((_unitDefinition_mediaTypes_banner = unitDefinition.mediaTypes.banner) === null || _unitDefinition_mediaTypes_banner === void 0 ? void 0 : _unitDefinition_mediaTypes_banner.sizes) || [];
|
70260
|
+
}
|
70261
|
+
GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), sizes, "".concat(containerId));
|
70189
70262
|
if (!((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
|
70190
70263
|
return "".concat(containerId) === "".concat(defUnit.code);
|
70191
70264
|
}))) {
|
@@ -70195,6 +70268,11 @@ var PrebidGAM = /*#__PURE__*/ function() {
|
|
70195
70268
|
if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
|
70196
70269
|
window.pbjs.addAdUnits([
|
70197
70270
|
_object_spread_props(_object_spread({}, unitDefinition), {
|
70271
|
+
mediaTypes: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes || {}), {
|
70272
|
+
banner: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes.banner || {}), {
|
70273
|
+
sizes: sizes
|
70274
|
+
})
|
70275
|
+
}),
|
70198
70276
|
code: "".concat(containerId)
|
70199
70277
|
})
|
70200
70278
|
]);
|
@@ -70304,7 +70382,7 @@ var PrebidGAMProvider = /*#__PURE__*/ function(ContentProvider1) {
|
|
70304
70382
|
key: "request",
|
70305
70383
|
value: function request(params) {
|
70306
70384
|
return _async_to_generator(function() {
|
70307
|
-
var _this, regionId, regionInfo;
|
70385
|
+
var _this, adType, adName, regionId, regionInfo;
|
70308
70386
|
return _ts_generator(this, function(_state) {
|
70309
70387
|
switch(_state.label){
|
70310
70388
|
case 0:
|
@@ -70315,6 +70393,8 @@ var PrebidGAMProvider = /*#__PURE__*/ function(ContentProvider1) {
|
|
70315
70393
|
];
|
70316
70394
|
case 1:
|
70317
70395
|
_state.sent();
|
70396
|
+
adType = params.params.adType;
|
70397
|
+
adName = params.params.regionName;
|
70318
70398
|
regionId = params.params.regionId;
|
70319
70399
|
if (params.params.useRatio) {
|
70320
70400
|
regionInfo = ContentProvider.approxRegionByRatio(params.size.width, params.size.height);
|
@@ -70342,7 +70422,7 @@ var PrebidGAMProvider = /*#__PURE__*/ function(ContentProvider1) {
|
|
70342
70422
|
];
|
70343
70423
|
case 2:
|
70344
70424
|
_state.sent();
|
70345
|
-
PrebidGAM.defineSlot(this.options, regionId, this.workingSlotId);
|
70425
|
+
PrebidGAM.defineSlot(this.options, regionId, this.workingSlotId, adType, adName);
|
70346
70426
|
PrebidGAM.request(regionId, this.workingSlotId, function(content) {
|
70347
70427
|
content.style.width = "".concat(regionInfo === null || regionInfo === void 0 ? void 0 : regionInfo.w, "px");
|
70348
70428
|
content.style.height = "".concat(regionInfo === null || regionInfo === void 0 ? void 0 : regionInfo.h, "px");
|
@@ -71127,7 +71207,7 @@ var RegionDebugPlugin = /*#__PURE__*/ function() {
|
|
71127
71207
|
}();
|
71128
71208
|
// src/Ads/Regions/Region.ts
|
71129
71209
|
var Region = /*#__PURE__*/ function() {
|
71130
|
-
function Region(id, regionDescriptor, planeDescriptor, deps) {
|
71210
|
+
function Region(id, regionDescriptor, planeDescriptor, options, deps) {
|
71131
71211
|
var _this = this;
|
71132
71212
|
_class_call_check(this, Region);
|
71133
71213
|
this.onScreen = false;
|
@@ -71135,6 +71215,7 @@ var Region = /*#__PURE__*/ function() {
|
|
71135
71215
|
this.plugins = [];
|
71136
71216
|
this.id = id;
|
71137
71217
|
this.regionDescriptor = regionDescriptor;
|
71218
|
+
this.options = options;
|
71138
71219
|
this.contours = new RegionContours(regionDescriptor.contours);
|
71139
71220
|
this.box = new RegionBox(regionDescriptor.box);
|
71140
71221
|
this.plane = new Plane(planeDescriptor);
|
@@ -71576,7 +71657,7 @@ var Region = /*#__PURE__*/ function() {
|
|
71576
71657
|
// src/Ads/Regions/StaticAdRegion.ts
|
71577
71658
|
var StaticAdRegion = /*#__PURE__*/ function(Region) {
|
71578
71659
|
_inherits(StaticAdRegion, Region);
|
71579
|
-
function StaticAdRegion(id, planeDescriptor, deps) {
|
71660
|
+
function StaticAdRegion(id, planeDescriptor, options, deps) {
|
71580
71661
|
_class_call_check(this, StaticAdRegion);
|
71581
71662
|
var _this;
|
71582
71663
|
_this = _call_super(this, StaticAdRegion, [
|
@@ -71592,6 +71673,7 @@ var StaticAdRegion = /*#__PURE__*/ function(Region) {
|
|
71592
71673
|
}
|
71593
71674
|
},
|
71594
71675
|
planeDescriptor,
|
71676
|
+
options,
|
71595
71677
|
deps
|
71596
71678
|
]);
|
71597
71679
|
_this.requestWithSize = true;
|
@@ -71609,12 +71691,15 @@ var StaticAdRegion = /*#__PURE__*/ function(Region) {
|
|
71609
71691
|
value: function requestContent() {
|
71610
71692
|
var box = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.box;
|
71611
71693
|
if (this.deps.provider) {
|
71694
|
+
var _this_options_ad, _this_options, _this_options_ad1, _this_options1;
|
71612
71695
|
this.deps.provider.request({
|
71613
71696
|
size: {
|
71614
71697
|
width: box.width(this.plane.size),
|
71615
71698
|
height: box.height(this.plane.size)
|
71616
71699
|
},
|
71617
71700
|
params: {
|
71701
|
+
adType: (_this_options = this.options) === null || _this_options === void 0 ? void 0 : (_this_options_ad = _this_options.ad) === null || _this_options_ad === void 0 ? void 0 : _this_options_ad.type,
|
71702
|
+
regionName: (_this_options1 = this.options) === null || _this_options1 === void 0 ? void 0 : (_this_options_ad1 = _this_options1.ad) === null || _this_options_ad1 === void 0 ? void 0 : _this_options_ad1.name,
|
71618
71703
|
useSize: true,
|
71619
71704
|
regionId: this.id
|
71620
71705
|
}
|
@@ -71700,25 +71785,57 @@ var StaticAdRegion = /*#__PURE__*/ function(Region) {
|
|
71700
71785
|
return StaticAdRegion;
|
71701
71786
|
}(Region);
|
71702
71787
|
// src/Ads/StaticAds/StaticAds.ts
|
71788
|
+
function debounce2(func) {
|
71789
|
+
var timeout = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100;
|
71790
|
+
var timer;
|
71791
|
+
return function() {
|
71792
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
71793
|
+
args[_key] = arguments[_key];
|
71794
|
+
}
|
71795
|
+
clearTimeout(timer);
|
71796
|
+
timer = setTimeout(function() {
|
71797
|
+
func.apply(void 0, _to_consumable_array(args));
|
71798
|
+
}, timeout);
|
71799
|
+
};
|
71800
|
+
}
|
71801
|
+
function isElementVisible(element) {
|
71802
|
+
if (!element) return false;
|
71803
|
+
if (!document.contains(element)) return false;
|
71804
|
+
var style = window.getComputedStyle(element);
|
71805
|
+
if (style.display === "none" || style.visibility === "hidden" || style.opacity === "0") {
|
71806
|
+
return false;
|
71807
|
+
}
|
71808
|
+
return true;
|
71809
|
+
}
|
71703
71810
|
var StaticAds = /*#__PURE__*/ function() {
|
71704
71811
|
function StaticAds(context) {
|
71705
71812
|
_class_call_check(this, StaticAds);
|
71706
71813
|
this.regions = [];
|
71814
|
+
this.handlePageMutation = this.handlePageMutation.bind(this);
|
71707
71815
|
this.context = context;
|
71708
71816
|
this.recorderFactory = new RecorderFactory(this.context);
|
71817
|
+
this.observer = new MutationObserver(debounce2(this.handlePageMutation));
|
71709
71818
|
}
|
71710
71819
|
_create_class(StaticAds, [
|
71711
71820
|
{
|
71712
|
-
key: "
|
71713
|
-
value: function
|
71821
|
+
key: "handlePageMutation",
|
71822
|
+
value: function handlePageMutation() {
|
71823
|
+
this.handleRegions();
|
71824
|
+
}
|
71825
|
+
},
|
71826
|
+
{
|
71827
|
+
key: "handleRegions",
|
71828
|
+
value: function handleRegions() {
|
71714
71829
|
var _this, _loop = function(index) {
|
71715
71830
|
var element = elements2[index];
|
71716
71831
|
var previousContent = _to_consumable_array(element.childNodes);
|
71717
71832
|
var id = 500 + index;
|
71718
71833
|
var size = null;
|
71834
|
+
var adType = void 0;
|
71835
|
+
var regionName = void 0;
|
71719
71836
|
if (element.hasAttribute("data-b-t") && element.hasAttribute("data-b-n")) {
|
71720
|
-
|
71721
|
-
|
71837
|
+
adType = element.getAttribute("data-b-t");
|
71838
|
+
regionName = element.getAttribute("data-b-n") || void 0;
|
71722
71839
|
var sizes = ContentProvider.adSizes[adType];
|
71723
71840
|
if (sizes && sizes.length > 0) {
|
71724
71841
|
var _sizes_ = _sliced_to_array(sizes[0], 2), w2 = _sizes_[0], h = _sizes_[1];
|
@@ -71729,12 +71846,6 @@ var StaticAds = /*#__PURE__*/ function() {
|
|
71729
71846
|
} else {
|
71730
71847
|
_this.context.logger.error("Invalid attribute or no sizes found for adType: ".concat(adType, " and regionName: ").concat(regionName));
|
71731
71848
|
}
|
71732
|
-
} else if (element.hasAttribute("data-b-w") && element.hasAttribute("data-b-h")) {
|
71733
|
-
size = {
|
71734
|
-
width: Number(element.getAttribute("data-b-w")),
|
71735
|
-
height: Number(element.getAttribute("data-b-h"))
|
71736
|
-
};
|
71737
|
-
_this.context.logger.warn("Using deprecated attributes data-b-w and data-b-h for element: ".concat(element.getAttribute("data-b-n")));
|
71738
71849
|
}
|
71739
71850
|
if (!size) {
|
71740
71851
|
return "continue";
|
@@ -71777,6 +71888,11 @@ var StaticAds = /*#__PURE__*/ function() {
|
|
71777
71888
|
}
|
71778
71889
|
];
|
71779
71890
|
var newRegion = new StaticAdRegion(id, size, {
|
71891
|
+
ad: {
|
71892
|
+
type: adType,
|
71893
|
+
name: regionName
|
71894
|
+
}
|
71895
|
+
}, {
|
71780
71896
|
provider: provider,
|
71781
71897
|
plugins: plugins2,
|
71782
71898
|
recorder: _this.recorderFactory.create()
|
@@ -71785,20 +71901,31 @@ var StaticAds = /*#__PURE__*/ function() {
|
|
71785
71901
|
element.appendChild(newRegion.view);
|
71786
71902
|
_this.regions.push(newRegion);
|
71787
71903
|
};
|
71788
|
-
this.context.logger.log("starting static ads");
|
71789
71904
|
var selector = this.context.config.get("staticRegionsSelector");
|
71790
71905
|
if (!selector) {
|
71791
71906
|
return;
|
71792
71907
|
}
|
71793
71908
|
var elements2 = Array.from(document.querySelectorAll(selector)).filter(function(e2) {
|
71794
|
-
return _instanceof(e2, HTMLElement) &&
|
71909
|
+
return _instanceof(e2, HTMLElement) && e2.hasAttribute("data-b-t") && e2.hasAttribute("data-b-n") && e2.querySelector('[class="BRNDTS_R"]') === null && isElementVisible(e2);
|
71795
71910
|
});
|
71796
71911
|
for(var index = 0; index < elements2.length; index++)_this = this, _loop(index);
|
71797
71912
|
}
|
71798
71913
|
},
|
71914
|
+
{
|
71915
|
+
key: "start",
|
71916
|
+
value: function start() {
|
71917
|
+
this.context.logger.log("starting static ads");
|
71918
|
+
this.handleRegions();
|
71919
|
+
this.observer.observe(document.body, {
|
71920
|
+
childList: true,
|
71921
|
+
subtree: true
|
71922
|
+
});
|
71923
|
+
}
|
71924
|
+
},
|
71799
71925
|
{
|
71800
71926
|
key: "destroy",
|
71801
71927
|
value: function destroy() {
|
71928
|
+
this.observer.disconnect();
|
71802
71929
|
this.context.logger.log("destroying static ads");
|
71803
71930
|
this.regions.forEach(function(region) {
|
71804
71931
|
region.destroy();
|
@@ -74607,12 +74734,13 @@ var MappedCollection = /*#__PURE__*/ function() {
|
|
74607
74734
|
// src/Ads/Regions/AdRegion.ts
|
74608
74735
|
var AdRegion = /*#__PURE__*/ function(Region) {
|
74609
74736
|
_inherits(AdRegion, Region);
|
74610
|
-
function AdRegion(regionDescriptor, planeDescriptor, deps) {
|
74737
|
+
function AdRegion(regionDescriptor, planeDescriptor, options, deps) {
|
74611
74738
|
_class_call_check(this, AdRegion);
|
74612
74739
|
return _call_super(this, AdRegion, [
|
74613
74740
|
"".concat(regionDescriptor.id),
|
74614
74741
|
regionDescriptor,
|
74615
74742
|
planeDescriptor,
|
74743
|
+
options,
|
74616
74744
|
deps
|
74617
74745
|
]);
|
74618
74746
|
}
|
@@ -74635,12 +74763,13 @@ var AdRegion = /*#__PURE__*/ function(Region) {
|
|
74635
74763
|
// src/Ads/Regions/AuxRegion.ts
|
74636
74764
|
var AuxRegion = /*#__PURE__*/ function(Region) {
|
74637
74765
|
_inherits(AuxRegion, Region);
|
74638
|
-
function AuxRegion(regionDescriptor, planeDescriptor, deps) {
|
74766
|
+
function AuxRegion(regionDescriptor, planeDescriptor, options, deps) {
|
74639
74767
|
_class_call_check(this, AuxRegion);
|
74640
74768
|
return _call_super(this, AuxRegion, [
|
74641
74769
|
"".concat(regionDescriptor.id),
|
74642
74770
|
regionDescriptor,
|
74643
74771
|
planeDescriptor,
|
74772
|
+
options,
|
74644
74773
|
_object_spread({}, deps)
|
74645
74774
|
]);
|
74646
74775
|
}
|
@@ -74704,15 +74833,15 @@ var RegionFactory = /*#__PURE__*/ function() {
|
|
74704
74833
|
},
|
74705
74834
|
{
|
74706
74835
|
key: "get",
|
74707
|
-
value: function get(regionDescriptor, planeDescriptor, deps) {
|
74836
|
+
value: function get(regionDescriptor, planeDescriptor, options, deps) {
|
74708
74837
|
if (regionDescriptor && planeDescriptor) {
|
74709
74838
|
var _this_deps;
|
74710
74839
|
if ((_this_deps = this.deps) === null || _this_deps === void 0 ? void 0 : _this_deps.debug) {
|
74711
|
-
return new AuxRegion(regionDescriptor, planeDescriptor, _object_spread_props(_object_spread({}, this.deps || {}, deps || {}), {
|
74840
|
+
return new AuxRegion(regionDescriptor, planeDescriptor, options || {}, _object_spread_props(_object_spread({}, this.deps || {}, deps || {}), {
|
74712
74841
|
plugins: this.getPluginForStrategy()
|
74713
74842
|
}));
|
74714
74843
|
} else {
|
74715
|
-
return new AdRegion(regionDescriptor, planeDescriptor, _object_spread_props(_object_spread({}, this.deps || {}, deps || {}), {
|
74844
|
+
return new AdRegion(regionDescriptor, planeDescriptor, options || {}, _object_spread_props(_object_spread({}, this.deps || {}, deps || {}), {
|
74716
74845
|
plugins: this.getPluginForStrategy()
|
74717
74846
|
}));
|
74718
74847
|
}
|
@@ -74880,7 +75009,7 @@ var RegionRenderer = /*#__PURE__*/ function() {
|
|
74880
75009
|
}, {
|
74881
75010
|
width: this.regionsContainerView.width,
|
74882
75011
|
height: this.regionsContainerView.height
|
74883
|
-
}, {
|
75012
|
+
}, {}, {
|
74884
75013
|
provider: ContentProviderFactory.getProvider(this.context, this.context.config.get("ads").provider)
|
74885
75014
|
});
|
74886
75015
|
this.regionsData.push({
|
@@ -74957,7 +75086,7 @@ var RegionRenderer = /*#__PURE__*/ function() {
|
|
74957
75086
|
var newRegion = this.regionFactory.get(diffRight[index1], {
|
74958
75087
|
width: this.regionsContainerView.width,
|
74959
75088
|
height: this.regionsContainerView.height
|
74960
|
-
}, {
|
75089
|
+
}, {}, {
|
74961
75090
|
provider: ContentProviderFactory.getProvider(this.context, this.context.config.get("ads").provider)
|
74962
75091
|
});
|
74963
75092
|
this.regionsObjects.push(newRegion);
|
@@ -79788,7 +79917,7 @@ var AuxElementsRenderer = /*#__PURE__*/ function() {
|
|
79788
79917
|
}, {
|
79789
79918
|
width: this.regionsContainerView.width,
|
79790
79919
|
height: this.regionsContainerView.height
|
79791
|
-
}, {
|
79920
|
+
}, {}, {
|
79792
79921
|
provider: ContentProviderFactory.getProvider(this.context, this.context.config.get("ads").provider)
|
79793
79922
|
});
|
79794
79923
|
this.auxElementsData.push({
|
@@ -79850,7 +79979,7 @@ var AuxElementsRenderer = /*#__PURE__*/ function() {
|
|
79850
79979
|
}), {
|
79851
79980
|
width: this.regionsContainerView.width,
|
79852
79981
|
height: this.regionsContainerView.height
|
79853
|
-
}, {});
|
79982
|
+
}, {}, {});
|
79854
79983
|
this.regionsObjects.push(oldRegion);
|
79855
79984
|
this.regionsContainerView.append(oldRegion.view);
|
79856
79985
|
}
|
@@ -80142,11 +80271,11 @@ var VideoAd = /*#__PURE__*/ function() {
|
|
80142
80271
|
{
|
80143
80272
|
key: "destroy",
|
80144
80273
|
value: function destroy() {
|
80145
|
-
var _this_adPresentationStrategy, _this_regionsRenderer, _this_videoRegions, _this_videoAdContext_interface;
|
80274
|
+
var _this_adPresentationStrategy, _this_regionsRenderer, _this_videoRegions, _this_videoAdContext_recorder, _this_videoAdContext_interface;
|
80146
80275
|
(_this_adPresentationStrategy = this.adPresentationStrategy) === null || _this_adPresentationStrategy === void 0 ? void 0 : _this_adPresentationStrategy.destroy();
|
80147
80276
|
(_this_regionsRenderer = this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.destroy();
|
80148
80277
|
(_this_videoRegions = this.videoRegions) === null || _this_videoRegions === void 0 ? void 0 : _this_videoRegions.destroy();
|
80149
|
-
this.videoAdContext.recorder.destroy();
|
80278
|
+
(_this_videoAdContext_recorder = this.videoAdContext.recorder) === null || _this_videoAdContext_recorder === void 0 ? void 0 : _this_videoAdContext_recorder.destroy();
|
80150
80279
|
(_this_videoAdContext_interface = this.videoAdContext.interface) === null || _this_videoAdContext_interface === void 0 ? void 0 : _this_videoAdContext_interface.destroy();
|
80151
80280
|
}
|
80152
80281
|
}
|