@brndts/brndts-ads 1.14.9 → 1.14.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -72241,7 +72241,7 @@ var PrebidGAM = /*#__PURE__*/ function() {
72241
72241
  key: "configure",
72242
72242
  value: function configure(context, options) {
72243
72243
  var _window_pbjs_que, _window_pbjs;
72244
- if (window.__tcfApi) {
72244
+ if (typeof window.__tcfapi === "function") {
72245
72245
  var _window___tcfapi, _window, _window___tcfapi1, _window1;
72246
72246
  (_window___tcfapi = (_window = window).__tcfapi) === null || _window___tcfapi === void 0 ? void 0 : _window___tcfapi.call(_window, "getTCData", 2, handleTCFApiEvent);
72247
72247
  (_window___tcfapi1 = (_window1 = window).__tcfapi) === null || _window___tcfapi1 === void 0 ? void 0 : _window___tcfapi1.call(_window1, "addEventListener", 2, handleTCFApiEvent);
@@ -72400,6 +72400,16 @@ var PrebidGAM = /*#__PURE__*/ function() {
72400
72400
  value: function request(slotId, containerId, callback) {
72401
72401
  var _window_pbjs;
72402
72402
  var PREBID_TIMEOUT = 1e3;
72403
+ if (!tcf_ready) {
72404
+ console.warn("TCF not ready, waiting for consent data.");
72405
+ var container = document.createElement("div");
72406
+ container.id = containerId;
72407
+ var script = document.createElement("script");
72408
+ script.innerHTML = '\n window.googletag.cmd.push(function() {\n googletag.pubads().refresh(googletag.pubads().getSlots().filter(slot => slot.getSlotElementId() === "'.concat(containerId, '"));\n });');
72409
+ container.appendChild(script);
72410
+ callback(container);
72411
+ return;
72412
+ }
72403
72413
  (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.que.push(function() {
72404
72414
  var _window_pbjs;
72405
72415
  (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.requestBids({