@streamlayer/react 1.21.3 → 1.22.1

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.
Files changed (168) hide show
  1. package/lib/app/masters.d.ts +2 -5
  2. package/lib/app/pause-ad.d.ts +1 -10
  3. package/lib/app/useStreamLayerApp.d.ts +1 -23
  4. package/lib/cjs/Question.js +1 -0
  5. package/lib/cjs/advertisement.js +40 -40
  6. package/lib/cjs/analytics.js +1 -0
  7. package/lib/cjs/auth.js +1 -1
  8. package/lib/cjs/bet-pack.js +1 -1
  9. package/lib/cjs/gamification-feature.js +1 -1
  10. package/lib/cjs/hooks-B0Qttldg.js +1 -0
  11. package/lib/cjs/index-DSi8Qgfs.js +1 -0
  12. package/lib/cjs/index.js +1 -1
  13. package/lib/cjs/index10.js +1 -0
  14. package/lib/cjs/index11.js +4 -0
  15. package/lib/cjs/index12.js +1 -0
  16. package/lib/cjs/index13.js +1 -0
  17. package/lib/cjs/index14.js +1 -0
  18. package/lib/cjs/index15.js +1 -0
  19. package/lib/cjs/index16.js +5 -0
  20. package/lib/cjs/index2.js +1 -5
  21. package/lib/cjs/index3.js +1 -0
  22. package/lib/cjs/index4.js +5 -0
  23. package/lib/cjs/index5.js +1 -0
  24. package/lib/cjs/index6.js +1 -0
  25. package/lib/cjs/index7.js +5 -0
  26. package/lib/cjs/index8.js +1 -0
  27. package/lib/cjs/index9.js +1 -0
  28. package/lib/cjs/insight.js +1 -1
  29. package/lib/cjs/masters.js +1 -1
  30. package/lib/cjs/masters2.js +6 -6
  31. package/lib/cjs/notification.js +1 -1
  32. package/lib/cjs/pause-ad.js +1 -1
  33. package/lib/cjs/points.js +1 -1
  34. package/lib/cjs/sl-types.js +15 -0
  35. package/lib/cjs/storage.js +1 -0
  36. package/lib/cjs/theme.js +17 -0
  37. package/lib/cjs/useStreamLayerApp.js +1 -1
  38. package/lib/cjs/useStreamLayerApp2.js +17 -16
  39. package/lib/cjs/utils.js +47 -0
  40. package/lib/cjs/vast-client.min.js +1 -0
  41. package/lib/classic/app/masters.d.ts +2 -5
  42. package/lib/classic/app/pause-ad.d.ts +1 -10
  43. package/lib/classic/app/useStreamLayerApp.d.ts +1 -23
  44. package/lib/classic/cjs/Question.js +1 -0
  45. package/lib/classic/cjs/advertisement.js +40 -40
  46. package/lib/classic/cjs/analytics.js +1 -0
  47. package/lib/classic/cjs/auth.js +1 -1
  48. package/lib/classic/cjs/bet-pack.js +4 -4
  49. package/lib/classic/cjs/gamification-feature.js +1 -1
  50. package/lib/classic/cjs/hooks-B0Qttldg.js +1 -0
  51. package/lib/classic/cjs/index-DSi8Qgfs.js +1 -0
  52. package/lib/classic/cjs/index.js +1 -1
  53. package/lib/classic/cjs/index10.js +1 -0
  54. package/lib/classic/cjs/index11.js +1 -0
  55. package/lib/classic/cjs/index12.js +1 -0
  56. package/lib/classic/cjs/index13.js +4 -0
  57. package/lib/classic/cjs/index2.js +5 -0
  58. package/lib/classic/cjs/index3.js +1 -0
  59. package/lib/classic/cjs/index4.js +1 -0
  60. package/lib/classic/cjs/index5.js +1 -0
  61. package/lib/classic/cjs/index6.js +5 -0
  62. package/lib/classic/cjs/index7.js +1 -0
  63. package/lib/classic/cjs/index8.js +1 -0
  64. package/lib/classic/cjs/index9.js +1 -0
  65. package/lib/classic/cjs/insight.js +1 -1
  66. package/lib/classic/cjs/notification.js +1 -1
  67. package/lib/classic/cjs/notification2.js +1 -0
  68. package/lib/classic/cjs/pause-ad.js +1 -1
  69. package/lib/classic/cjs/points.js +1 -1
  70. package/lib/classic/cjs/sl-types.js +15 -0
  71. package/lib/classic/cjs/useStreamLayerApp.js +1 -1
  72. package/lib/classic/cjs/useStreamLayerApp2.js +17 -16
  73. package/lib/classic/cjs/utils.js +47 -0
  74. package/lib/classic/cjs/vast-client.min.js +1 -0
  75. package/lib/classic/es/Question.js +392 -0
  76. package/lib/classic/es/advertisement.js +10375 -10374
  77. package/lib/classic/es/analytics.js +28 -0
  78. package/lib/classic/es/auth.js +4 -4
  79. package/lib/classic/es/bet-pack.js +55 -51
  80. package/lib/classic/es/gamification-feature.js +1 -1
  81. package/lib/classic/es/hooks-B0Qttldg.js +98 -0
  82. package/lib/classic/es/index-DSi8Qgfs.js +65 -0
  83. package/lib/classic/es/index.js +14 -15
  84. package/lib/classic/es/index10.js +87 -0
  85. package/lib/classic/es/index11.js +2355 -0
  86. package/lib/classic/es/index12.js +183 -0
  87. package/lib/classic/es/index13.js +835 -0
  88. package/lib/classic/es/index2.js +2621 -0
  89. package/lib/classic/es/index3.js +64 -0
  90. package/lib/classic/es/index4.js +19 -0
  91. package/lib/classic/es/index5.js +285 -0
  92. package/lib/classic/es/{index-l-eyvmpL.js → index6.js} +937 -937
  93. package/lib/classic/es/index7.js +7 -0
  94. package/lib/classic/es/index8.js +11 -0
  95. package/lib/classic/es/index9.js +319 -0
  96. package/lib/classic/es/insight.js +31 -32
  97. package/lib/classic/es/notification.js +7 -1006
  98. package/lib/classic/es/notification2.js +1117 -0
  99. package/lib/classic/es/pause-ad.js +139 -138
  100. package/lib/classic/es/points.js +39 -38
  101. package/lib/classic/es/sl-types.js +258 -0
  102. package/lib/classic/es/useStreamLayerApp.js +1 -2
  103. package/lib/classic/es/useStreamLayerApp2.js +4798 -2735
  104. package/lib/classic/es/utils.js +76 -0
  105. package/lib/{es/vast-client.min-B0NUra1B.js → classic/es/vast-client.min.js} +338 -338
  106. package/lib/classic/index.d.ts +5 -13
  107. package/lib/classic/masters.d.ts +1 -1
  108. package/lib/dist/cjs/index.js +1 -1
  109. package/lib/dist/cjs/masters.js +34 -33
  110. package/lib/dist/es/index.js +2 -2
  111. package/lib/dist/es/masters.js +10563 -8870
  112. package/lib/dist/index.d.ts +1332 -0
  113. package/lib/dist/style.css +1 -1
  114. package/lib/es/Question.js +136 -0
  115. package/lib/es/advertisement.js +10375 -10374
  116. package/lib/es/analytics.js +28 -0
  117. package/lib/es/auth.js +4 -4
  118. package/lib/es/bet-pack.js +7 -6
  119. package/lib/es/gamification-feature.js +1 -1
  120. package/lib/es/hooks-B0Qttldg.js +98 -0
  121. package/lib/es/index-DSi8Qgfs.js +65 -0
  122. package/lib/es/index.js +13 -14
  123. package/lib/es/index10.js +267 -0
  124. package/lib/es/index11.js +835 -0
  125. package/lib/es/index12.js +183 -0
  126. package/lib/es/index13.js +319 -0
  127. package/lib/es/index14.js +87 -0
  128. package/lib/es/index15.js +2355 -0
  129. package/lib/es/index16.js +1254 -0
  130. package/lib/es/index2.js +1349 -3364
  131. package/lib/es/index3.js +64 -0
  132. package/lib/es/index4.js +3418 -0
  133. package/lib/es/index5.js +19 -0
  134. package/lib/es/index6.js +285 -0
  135. package/lib/es/{index-l-eyvmpL.js → index7.js} +937 -937
  136. package/lib/es/index8.js +7 -0
  137. package/lib/es/index9.js +11 -0
  138. package/lib/es/insight.js +31 -32
  139. package/lib/es/masters.js +6 -5
  140. package/lib/es/masters2.js +189 -176
  141. package/lib/es/notification.js +141 -136
  142. package/lib/es/pause-ad.js +140 -139
  143. package/lib/es/points.js +40 -38
  144. package/lib/es/sl-types.js +277 -0
  145. package/lib/es/storage.js +113 -0
  146. package/lib/es/theme.js +47 -0
  147. package/lib/es/useStreamLayerApp.js +1 -2
  148. package/lib/es/useStreamLayerApp2.js +4798 -2735
  149. package/lib/es/utils.js +76 -0
  150. package/lib/{classic/es/vast-client.min-B0NUra1B.js → es/vast-client.min.js} +338 -338
  151. package/lib/index.d.ts +5 -13
  152. package/lib/masters.d.ts +1 -1
  153. package/lib/style.css +1 -1
  154. package/package.json +16 -51
  155. package/lib/app/event.d.ts +0 -6
  156. package/lib/app/provider.d.ts +0 -49
  157. package/lib/cjs/index-l-eyvmpL.js +0 -5
  158. package/lib/cjs/provider.js +0 -84
  159. package/lib/cjs/vast-client.min-B0NUra1B.js +0 -1
  160. package/lib/classic/app/event.d.ts +0 -6
  161. package/lib/classic/app/provider.d.ts +0 -49
  162. package/lib/classic/cjs/index-l-eyvmpL.js +0 -5
  163. package/lib/classic/cjs/provider.js +0 -68
  164. package/lib/classic/cjs/vast-client.min-B0NUra1B.js +0 -1
  165. package/lib/classic/es/provider.js +0 -7619
  166. package/lib/dist/cjs/gamification-feature2.js +0 -1
  167. package/lib/dist/es/gamification-feature2.js +0 -285
  168. package/lib/es/provider.js +0 -7695
@@ -1,210 +1,210 @@
1
1
  function N() {
2
- let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
3
- return { id: a.id || null, adId: a.adId || null, sequence: a.sequence || null, apiFramework: a.apiFramework || null, universalAdIds: [], creativeExtensions: [] };
2
+ let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
3
+ return { id: i.id || null, adId: i.adId || null, sequence: i.sequence || null, apiFramework: i.apiFramework || null, universalAdIds: [], creativeExtensions: [] };
4
4
  }
5
5
  const G = ["ADCATEGORIES", "ADCOUNT", "ADPLAYHEAD", "ADSERVINGID", "ADTYPE", "APIFRAMEWORKS", "APPBUNDLE", "ASSETURI", "BLOCKEDADCATEGORIES", "BREAKMAXADLENGTH", "BREAKMAXADS", "BREAKMAXDURATION", "BREAKMINADLENGTH", "BREAKMINDURATION", "BREAKPOSITION", "CLICKPOS", "CLICKTYPE", "CLIENTUA", "CONTENTID", "CONTENTPLAYHEAD", "CONTENTURI", "DEVICEIP", "DEVICEUA", "DOMAIN", "EXTENSIONS", "GDPRCONSENT", "IFA", "IFATYPE", "INVENTORYSTATE", "LATLONG", "LIMITADTRACKING", "MEDIAMIME", "MEDIAPLAYHEAD", "OMIDPARTNER", "PAGEURL", "PLACEMENTTYPE", "PLAYERCAPABILITIES", "PLAYERSIZE", "PLAYERSTATE", "PODSEQUENCE", "REGULATIONS", "SERVERSIDE", "SERVERUA", "TRANSACTIONID", "UNIVERSALADID", "VASTVERSIONS", "VERIFICATIONVENDORS"];
6
- function w(a) {
6
+ function w(i) {
7
7
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
8
- const r = [], s = M(a);
8
+ const r = [], a = M(i);
9
9
  !e.ERRORCODE || t.isCustomCode || /^[0-9]{3}$/.test(e.ERRORCODE) || (e.ERRORCODE = 900), e.CACHEBUSTING = q(Math.round(1e8 * Math.random())), e.TIMESTAMP = (/* @__PURE__ */ new Date()).toISOString(), e.RANDOM = e.random = e.CACHEBUSTING;
10
- for (const i in e) e[i] = j(e[i]);
11
- for (const i in s) {
12
- const o = s[i];
10
+ for (const s in e) e[s] = j(e[s]);
11
+ for (const s in a) {
12
+ const o = a[s];
13
13
  typeof o == "string" && r.push(B(o, e));
14
14
  }
15
15
  return r;
16
16
  }
17
- function B(a, e) {
18
- const t = (a = L(a, e)).match(/[^[\]]+(?=])/g);
19
- if (!t) return a;
20
- let r = t.filter((s) => G.indexOf(s) > -1);
21
- return r.length === 0 ? a : (r = r.reduce((s, i) => (s[i] = -1, s), {}), L(a, r));
17
+ function B(i, e) {
18
+ const t = (i = L(i, e)).match(/[^[\]]+(?=])/g);
19
+ if (!t) return i;
20
+ let r = t.filter((a) => G.indexOf(a) > -1);
21
+ return r.length === 0 ? i : (r = r.reduce((a, s) => (a[s] = -1, a), {}), L(i, r));
22
22
  }
23
- function L(a, e) {
24
- let t = a;
23
+ function L(i, e) {
24
+ let t = i;
25
25
  for (const r in e) {
26
- const s = e[r];
27
- t = t.replace(new RegExp("(?:\\[|%%)(".concat(r, ")(?:\\]|%%)"), "g"), s);
26
+ const a = e[r];
27
+ t = t.replace(new RegExp("(?:\\[|%%)(".concat(r, ")(?:\\]|%%)"), "g"), a);
28
28
  }
29
29
  return t;
30
30
  }
31
- function M(a) {
32
- return Array.isArray(a) ? a.map((e) => e && e.hasOwnProperty("url") ? e.url : e) : a;
31
+ function M(i) {
32
+ return Array.isArray(i) ? i.map((e) => e && e.hasOwnProperty("url") ? e.url : e) : i;
33
33
  }
34
- function C(a) {
35
- return /^(https?:\/\/|\/\/)/.test(a);
34
+ function C(i) {
35
+ return /^(https?:\/\/|\/\/)/.test(i);
36
36
  }
37
- function U(a, e) {
38
- for (let t = 0; t < e.length; t++) if (W(e[t], a)) return !0;
37
+ function U(i, e) {
38
+ for (let t = 0; t < e.length; t++) if (W(e[t], i)) return !0;
39
39
  return !1;
40
40
  }
41
- function W(a, e) {
42
- if (a && e) {
43
- const t = Object.getOwnPropertyNames(a), r = Object.getOwnPropertyNames(e);
44
- return t.length === r.length && a.id === e.id && a.url === e.url;
41
+ function W(i, e) {
42
+ if (i && e) {
43
+ const t = Object.getOwnPropertyNames(i), r = Object.getOwnPropertyNames(e);
44
+ return t.length === r.length && i.id === e.id && i.url === e.url;
45
45
  }
46
46
  return !1;
47
47
  }
48
- function j(a) {
49
- return encodeURIComponent(a).replace(/[!'()*]/g, (e) => "%".concat(e.charCodeAt(0).toString(16)));
48
+ function j(i) {
49
+ return encodeURIComponent(i).replace(/[!'()*]/g, (e) => "%".concat(e.charCodeAt(0).toString(16)));
50
50
  }
51
- function q(a) {
51
+ function q(i) {
52
52
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
53
- return a.toString().padStart(e, "0");
53
+ return i.toString().padStart(e, "0");
54
54
  }
55
- const T = { track: function(a, e, t) {
56
- w(a, e, t).forEach((r) => {
55
+ const f = { track: function(i, e, t) {
56
+ w(i, e, t).forEach((r) => {
57
57
  typeof window < "u" && window !== null && (new Image().src = r);
58
58
  });
59
- }, resolveURLTemplates: w, extractURLsFromTemplates: M, filterUrlTemplates: function(a) {
60
- return a.reduce((e, t) => {
59
+ }, resolveURLTemplates: w, extractURLsFromTemplates: M, filterUrlTemplates: function(i) {
60
+ return i.reduce((e, t) => {
61
61
  const r = t.url || t;
62
62
  return C(r) ? e.validUrls.push(r) : e.invalidUrls.push(r), e;
63
63
  }, { validUrls: [], invalidUrls: [] });
64
- }, containsTemplateObject: U, isTemplateObjectEqual: W, encodeURIComponentRFC3986: j, replaceUrlMacros: B, isNumeric: function(a) {
65
- return !isNaN(parseFloat(a)) && isFinite(a);
66
- }, flatten: function a(e) {
67
- return e.reduce((t, r) => t.concat(Array.isArray(r) ? a(r) : r), []);
64
+ }, containsTemplateObject: U, isTemplateObjectEqual: W, encodeURIComponentRFC3986: j, replaceUrlMacros: B, isNumeric: function(i) {
65
+ return !isNaN(parseFloat(i)) && isFinite(i);
66
+ }, flatten: function i(e) {
67
+ return e.reduce((t, r) => t.concat(Array.isArray(r) ? i(r) : r), []);
68
68
  }, joinArrayOfUniqueTemplateObjs: function() {
69
- let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
70
- const t = Array.isArray(a) ? a : [], r = Array.isArray(e) ? e : [];
71
- return t.concat(r).reduce((s, i) => (U(i, s) || s.push(i), s), []);
72
- }, isValidTimeValue: function(a) {
73
- return Number.isFinite(a) && a >= -2;
69
+ let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
70
+ const t = Array.isArray(i) ? i : [], r = Array.isArray(e) ? e : [];
71
+ return t.concat(r).reduce((a, s) => (U(s, a) || a.push(s), a), []);
72
+ }, isValidTimeValue: function(i) {
73
+ return Number.isFinite(i) && i >= -2;
74
74
  }, addLeadingZeros: q, isValidUrl: C, isBrowserEnvironment: function() {
75
75
  return typeof window < "u";
76
- }, formatMacrosValues: function(a) {
77
- return typeof a != "object" ? a : JSON.stringify(a);
76
+ }, formatMacrosValues: function(i) {
77
+ return typeof i != "object" ? i : JSON.stringify(i);
78
78
  } };
79
- function I(a) {
80
- return ["true", "TRUE", "True", "1"].includes(a);
79
+ function I(i) {
80
+ return ["true", "TRUE", "True", "1"].includes(i);
81
81
  }
82
- function Y(a) {
83
- if (a == null) return -1;
84
- if (T.isNumeric(a)) return parseInt(a);
85
- const e = a.split(":");
82
+ function Y(i) {
83
+ if (i == null) return -1;
84
+ if (f.isNumeric(i)) return parseInt(i);
85
+ const e = i.split(":");
86
86
  if (e.length !== 3) return -1;
87
87
  const t = e[2].split(".");
88
88
  let r = parseInt(t[0]);
89
89
  t.length === 2 && (r += parseFloat("0.".concat(t[1])));
90
- const s = parseInt(60 * e[1]), i = parseInt(60 * e[0] * 60);
91
- return isNaN(i) || isNaN(s) || isNaN(r) || s > 3600 || r > 60 ? -1 : i + s + r;
90
+ const a = parseInt(60 * e[1]), s = parseInt(60 * e[0] * 60);
91
+ return isNaN(s) || isNaN(a) || isNaN(r) || a > 3600 || r > 60 ? -1 : s + a + r;
92
92
  }
93
- const l = { childByName: function(a, e) {
94
- return Array.from(a.childNodes).find((t) => t.nodeName === e);
95
- }, childrenByName: function(a, e) {
96
- return Array.from(a.childNodes).filter((t) => t.nodeName === e);
97
- }, resolveVastAdTagURI: function(a, e) {
98
- if (!e) return a;
99
- if (a.startsWith("//")) {
93
+ const l = { childByName: function(i, e) {
94
+ return Array.from(i.childNodes).find((t) => t.nodeName === e);
95
+ }, childrenByName: function(i, e) {
96
+ return Array.from(i.childNodes).filter((t) => t.nodeName === e);
97
+ }, resolveVastAdTagURI: function(i, e) {
98
+ if (!e) return i;
99
+ if (i.startsWith("//")) {
100
100
  const { protocol: t } = location;
101
- return "".concat(t).concat(a);
101
+ return "".concat(t).concat(i);
102
102
  }
103
- if (!a.includes("://")) {
103
+ if (!i.includes("://")) {
104
104
  const t = e.slice(0, e.lastIndexOf("/"));
105
- return "".concat(t, "/").concat(a);
106
- }
107
- return a;
108
- }, parseBoolean: I, parseNodeText: function(a) {
109
- return a && (a.textContent || a.text || "").trim();
110
- }, copyNodeAttribute: function(a, e, t) {
111
- const r = e.getAttribute(a);
112
- r && t.setAttribute(a, r);
113
- }, parseAttributes: function(a) {
114
- return Array.from(a.attributes).reduce((e, t) => (e[t.nodeName] = t.nodeValue, e), {});
105
+ return "".concat(t, "/").concat(i);
106
+ }
107
+ return i;
108
+ }, parseBoolean: I, parseNodeText: function(i) {
109
+ return i && (i.textContent || i.text || "").trim();
110
+ }, copyNodeAttribute: function(i, e, t) {
111
+ const r = e.getAttribute(i);
112
+ r && t.setAttribute(i, r);
113
+ }, parseAttributes: function(i) {
114
+ return Array.from(i.attributes).reduce((e, t) => (e[t.nodeName] = t.nodeValue, e), {});
115
115
  }, parseDuration: Y, getStandAloneAds: function() {
116
- return (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).filter((a) => !parseInt(a.sequence, 10));
116
+ return (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).filter((i) => !parseInt(i.sequence, 10));
117
117
  }, getSortedAdPods: function() {
118
- return (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).filter((a) => parseInt(a.sequence, 10)).sort((a, e) => a.sequence - e.sequence);
119
- }, assignAttributes: function(a, e) {
120
- a && Array.from(a).forEach((t) => {
121
- let { nodeName: r, nodeValue: s } = t;
122
- if (r && s && e.hasOwnProperty(r)) {
123
- let i = s;
124
- typeof e[r] == "boolean" && (i = I(i)), e[r] = i;
118
+ return (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).filter((i) => parseInt(i.sequence, 10)).sort((i, e) => i.sequence - e.sequence);
119
+ }, assignAttributes: function(i, e) {
120
+ i && Array.from(i).forEach((t) => {
121
+ let { nodeName: r, nodeValue: a } = t;
122
+ if (r && a && e.hasOwnProperty(r)) {
123
+ let s = a;
124
+ typeof e[r] == "boolean" && (s = I(s)), e[r] = s;
125
125
  }
126
126
  });
127
- }, mergeWrapperAdData: function(a, e) {
127
+ }, mergeWrapperAdData: function(i, e) {
128
128
  var t;
129
- a.errorURLTemplates = e.errorURLTemplates.concat(a.errorURLTemplates), a.impressionURLTemplates = e.impressionURLTemplates.concat(a.impressionURLTemplates), a.extensions = e.extensions.concat(a.extensions), e.viewableImpression.length > 0 && (a.viewableImpression = [...a.viewableImpression, ...e.viewableImpression]), a.followAdditionalWrappers = e.followAdditionalWrappers, a.allowMultipleAds = e.allowMultipleAds, a.fallbackOnNoAd = e.fallbackOnNoAd;
130
- const r = (e.creatives || []).filter((n) => n && n.type === "companion"), s = r.reduce((n, c) => ((c.variations || []).forEach((u) => {
129
+ i.errorURLTemplates = e.errorURLTemplates.concat(i.errorURLTemplates), i.impressionURLTemplates = e.impressionURLTemplates.concat(i.impressionURLTemplates), i.extensions = e.extensions.concat(i.extensions), e.viewableImpression.length > 0 && (i.viewableImpression = [...i.viewableImpression, ...e.viewableImpression]), i.followAdditionalWrappers = e.followAdditionalWrappers, i.allowMultipleAds = e.allowMultipleAds, i.fallbackOnNoAd = e.fallbackOnNoAd;
130
+ const r = (e.creatives || []).filter((n) => n && n.type === "companion"), a = r.reduce((n, c) => ((c.variations || []).forEach((u) => {
131
131
  (u.companionClickTrackingURLTemplates || []).forEach((d) => {
132
- T.containsTemplateObject(d, n) || n.push(d);
132
+ f.containsTemplateObject(d, n) || n.push(d);
133
133
  });
134
134
  }), n), []);
135
- a.creatives = r.concat(a.creatives);
136
- const i = e.videoClickTrackingURLTemplates && e.videoClickTrackingURLTemplates.length, o = e.videoCustomClickURLTemplates && e.videoCustomClickURLTemplates.length;
137
- if (a.creatives.forEach((n) => {
135
+ i.creatives = r.concat(i.creatives);
136
+ const s = e.videoClickTrackingURLTemplates && e.videoClickTrackingURLTemplates.length, o = e.videoCustomClickURLTemplates && e.videoCustomClickURLTemplates.length;
137
+ if (i.creatives.forEach((n) => {
138
138
  if (e.trackingEvents && e.trackingEvents[n.type]) for (const c in e.trackingEvents[n.type]) {
139
139
  const u = e.trackingEvents[n.type][c];
140
140
  Array.isArray(n.trackingEvents[c]) || (n.trackingEvents[c] = []), n.trackingEvents[c] = n.trackingEvents[c].concat(u);
141
141
  }
142
- n.type === "linear" && (i && (n.videoClickTrackingURLTemplates = n.videoClickTrackingURLTemplates.concat(e.videoClickTrackingURLTemplates)), o && (n.videoCustomClickURLTemplates = n.videoCustomClickURLTemplates.concat(e.videoCustomClickURLTemplates)), !e.videoClickThroughURLTemplate || n.videoClickThroughURLTemplate !== null && n.videoClickThroughURLTemplate !== void 0 || (n.videoClickThroughURLTemplate = e.videoClickThroughURLTemplate)), n.type === "companion" && s.length && (n.variations || []).forEach((c) => {
143
- c.companionClickTrackingURLTemplates = T.joinArrayOfUniqueTemplateObjs(c.companionClickTrackingURLTemplates, s);
142
+ n.type === "linear" && (s && (n.videoClickTrackingURLTemplates = n.videoClickTrackingURLTemplates.concat(e.videoClickTrackingURLTemplates)), o && (n.videoCustomClickURLTemplates = n.videoCustomClickURLTemplates.concat(e.videoCustomClickURLTemplates)), !e.videoClickThroughURLTemplate || n.videoClickThroughURLTemplate !== null && n.videoClickThroughURLTemplate !== void 0 || (n.videoClickThroughURLTemplate = e.videoClickThroughURLTemplate)), n.type === "companion" && a.length && (n.variations || []).forEach((c) => {
143
+ c.companionClickTrackingURLTemplates = f.joinArrayOfUniqueTemplateObjs(c.companionClickTrackingURLTemplates, a);
144
144
  });
145
- }), e.adVerifications && (a.adVerifications = a.adVerifications.concat(e.adVerifications)), e.blockedAdCategories && (a.blockedAdCategories = a.blockedAdCategories.concat(e.blockedAdCategories)), (t = e.creatives) !== null && t !== void 0 && t.length) {
145
+ }), e.adVerifications && (i.adVerifications = i.adVerifications.concat(e.adVerifications)), e.blockedAdCategories && (i.blockedAdCategories = i.blockedAdCategories.concat(e.blockedAdCategories)), (t = e.creatives) !== null && t !== void 0 && t.length) {
146
146
  const n = e.creatives.filter((c) => {
147
147
  var u;
148
148
  return ((u = c.icons) === null || u === void 0 ? void 0 : u.length) && !c.mediaFiles.length;
149
149
  });
150
- n.length && (a.creatives = a.creatives.concat(n));
150
+ n.length && (i.creatives = i.creatives.concat(n));
151
151
  }
152
152
  } };
153
- function Q(a, e) {
153
+ function Q(i, e) {
154
154
  const t = function() {
155
155
  let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
156
- const { id: s, adId: i, sequence: o, apiFramework: n } = N(r);
157
- return { id: s, adId: i, sequence: o, apiFramework: n, type: "companion", required: null, variations: [] };
156
+ const { id: a, adId: s, sequence: o, apiFramework: n } = N(r);
157
+ return { id: a, adId: s, sequence: o, apiFramework: n, type: "companion", required: null, variations: [] };
158
158
  }(e);
159
- return t.required = a.getAttribute("required") || null, t.variations = l.childrenByName(a, "Companion").map((r) => {
160
- const s = function() {
159
+ return t.required = i.getAttribute("required") || null, t.variations = l.childrenByName(i, "Companion").map((r) => {
160
+ const a = function() {
161
161
  let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
162
162
  return { id: n.id || null, adType: "companionAd", width: n.width || 0, height: n.height || 0, assetWidth: n.assetWidth || null, assetHeight: n.assetHeight || null, expandedWidth: n.expandedWidth || null, expandedHeight: n.expandedHeight || null, apiFramework: n.apiFramework || null, adSlotId: n.adSlotId || null, pxratio: n.pxratio || "1", renderingMode: n.renderingMode || "default", staticResources: [], htmlResources: [], iframeResources: [], adParameters: null, altText: null, companionClickThroughURLTemplate: null, companionClickTrackingURLTemplates: [], trackingEvents: {} };
163
163
  }(l.parseAttributes(r));
164
- s.htmlResources = l.childrenByName(r, "HTMLResource").reduce((n, c) => {
164
+ a.htmlResources = l.childrenByName(r, "HTMLResource").reduce((n, c) => {
165
165
  const u = l.parseNodeText(c);
166
166
  return u ? n.concat(u) : n;
167
- }, []), s.iframeResources = l.childrenByName(r, "IFrameResource").reduce((n, c) => {
167
+ }, []), a.iframeResources = l.childrenByName(r, "IFrameResource").reduce((n, c) => {
168
168
  const u = l.parseNodeText(c);
169
169
  return u ? n.concat(u) : n;
170
- }, []), s.staticResources = l.childrenByName(r, "StaticResource").reduce((n, c) => {
170
+ }, []), a.staticResources = l.childrenByName(r, "StaticResource").reduce((n, c) => {
171
171
  const u = l.parseNodeText(c);
172
172
  return u ? n.concat({ url: u, creativeType: c.getAttribute("creativeType") || null }) : n;
173
- }, []), s.altText = l.parseNodeText(l.childByName(r, "AltText")) || null;
174
- const i = l.childByName(r, "TrackingEvents");
175
- i && l.childrenByName(i, "Tracking").forEach((n) => {
173
+ }, []), a.altText = l.parseNodeText(l.childByName(r, "AltText")) || null;
174
+ const s = l.childByName(r, "TrackingEvents");
175
+ s && l.childrenByName(s, "Tracking").forEach((n) => {
176
176
  const c = n.getAttribute("event"), u = l.parseNodeText(n);
177
- c && u && (Array.isArray(s.trackingEvents[c]) || (s.trackingEvents[c] = []), s.trackingEvents[c].push(u));
178
- }), s.companionClickTrackingURLTemplates = l.childrenByName(r, "CompanionClickTracking").map((n) => ({ id: n.getAttribute("id") || null, url: l.parseNodeText(n) })), s.companionClickThroughURLTemplate = l.parseNodeText(l.childByName(r, "CompanionClickThrough")) || null;
177
+ c && u && (Array.isArray(a.trackingEvents[c]) || (a.trackingEvents[c] = []), a.trackingEvents[c].push(u));
178
+ }), a.companionClickTrackingURLTemplates = l.childrenByName(r, "CompanionClickTracking").map((n) => ({ id: n.getAttribute("id") || null, url: l.parseNodeText(n) })), a.companionClickThroughURLTemplate = l.parseNodeText(l.childByName(r, "CompanionClickThrough")) || null;
179
179
  const o = l.childByName(r, "AdParameters");
180
- return o && (s.adParameters = { value: l.parseNodeText(o), xmlEncoded: o.getAttribute("xmlEncoded") || null }), s;
180
+ return o && (a.adParameters = { value: l.parseNodeText(o), xmlEncoded: o.getAttribute("xmlEncoded") || null }), a;
181
181
  }), t;
182
182
  }
183
- function X(a, e) {
183
+ function X(i, e) {
184
184
  let t;
185
185
  const r = function() {
186
186
  let c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
187
187
  const { id: u, adId: d, sequence: g, apiFramework: m } = N(c);
188
188
  return { id: u, adId: d, sequence: g, apiFramework: m, type: "linear", duration: 0, skipDelay: null, mediaFiles: [], mezzanine: null, interactiveCreativeFile: null, closedCaptionFiles: [], videoClickThroughURLTemplate: null, videoClickTrackingURLTemplates: [], videoCustomClickURLTemplates: [], adParameters: null, icons: [], trackingEvents: {} };
189
189
  }(e);
190
- r.duration = l.parseDuration(l.parseNodeText(l.childByName(a, "Duration")));
191
- const s = a.getAttribute("skipoffset");
192
- if (s == null) r.skipDelay = null;
193
- else if (s.charAt(s.length - 1) === "%" && r.duration !== -1) {
194
- const c = parseInt(s, 10);
190
+ r.duration = l.parseDuration(l.parseNodeText(l.childByName(i, "Duration")));
191
+ const a = i.getAttribute("skipoffset");
192
+ if (a == null) r.skipDelay = null;
193
+ else if (a.charAt(a.length - 1) === "%" && r.duration !== -1) {
194
+ const c = parseInt(a, 10);
195
195
  r.skipDelay = r.duration * (c / 100);
196
- } else r.skipDelay = l.parseDuration(s);
197
- const i = l.childByName(a, "VideoClicks");
198
- if (i) {
199
- const c = l.childByName(i, "ClickThrough");
200
- r.videoClickThroughURLTemplate = c ? { id: c.getAttribute("id") || null, url: l.parseNodeText(c) } : null, l.childrenByName(i, "ClickTracking").forEach((u) => {
196
+ } else r.skipDelay = l.parseDuration(a);
197
+ const s = l.childByName(i, "VideoClicks");
198
+ if (s) {
199
+ const c = l.childByName(s, "ClickThrough");
200
+ r.videoClickThroughURLTemplate = c ? { id: c.getAttribute("id") || null, url: l.parseNodeText(c) } : null, l.childrenByName(s, "ClickTracking").forEach((u) => {
201
201
  r.videoClickTrackingURLTemplates.push({ id: u.getAttribute("id") || null, url: l.parseNodeText(u) });
202
- }), l.childrenByName(i, "CustomClick").forEach((u) => {
202
+ }), l.childrenByName(s, "CustomClick").forEach((u) => {
203
203
  r.videoCustomClickURLTemplates.push({ id: u.getAttribute("id") || null, url: l.parseNodeText(u) });
204
204
  });
205
205
  }
206
- const o = l.childByName(a, "AdParameters");
207
- o && (r.adParameters = { value: l.parseNodeText(o), xmlEncoded: o.getAttribute("xmlEncoded") || null }), l.childrenByName(a, "TrackingEvents").forEach((c) => {
206
+ const o = l.childByName(i, "AdParameters");
207
+ o && (r.adParameters = { value: l.parseNodeText(o), xmlEncoded: o.getAttribute("xmlEncoded") || null }), l.childrenByName(i, "TrackingEvents").forEach((c) => {
208
208
  l.childrenByName(c, "Tracking").forEach((u) => {
209
209
  let d = u.getAttribute("event");
210
210
  const g = l.parseNodeText(u);
@@ -216,7 +216,7 @@ function X(a, e) {
216
216
  Array.isArray(r.trackingEvents[d]) || (r.trackingEvents[d] = []), r.trackingEvents[d].push(g);
217
217
  }
218
218
  });
219
- }), l.childrenByName(a, "MediaFiles").forEach((c) => {
219
+ }), l.childrenByName(i, "MediaFiles").forEach((c) => {
220
220
  l.childrenByName(c, "MediaFile").forEach((h) => {
221
221
  r.mediaFiles.push(function(p) {
222
222
  const v = { id: null, fileURL: null, fileSize: 0, deliveryType: "progressive", mimeType: null, mediaType: null, codec: null, bitrate: 0, minBitrate: 0, maxBitrate: 0, width: 0, height: 0, apiFramework: null, scalable: null, maintainAspectRatio: null };
@@ -255,7 +255,7 @@ function X(a, e) {
255
255
  h.id = g.getAttribute("id"), h.fileURL = l.parseNodeText(g), h.delivery = m.delivery, h.codec = g.getAttribute("codec"), h.type = m.type, h.width = parseInt(m.width, 10), h.height = parseInt(m.height, 10), h.fileSize = parseInt(g.getAttribute("fileSize"), 10), h.mediaType = g.getAttribute("mediaType") || "2D", r.mezzanine = h;
256
256
  }
257
257
  });
258
- const n = l.childByName(a, "Icons");
258
+ const n = l.childByName(i, "Icons");
259
259
  return n && l.childrenByName(n, "Icon").forEach((c) => {
260
260
  r.icons.push(function(u) {
261
261
  const d = { program: null, height: 0, width: 0, xPosition: 0, yPosition: 0, apiFramework: null, offset: null, duration: 0, type: null, staticResource: null, htmlResource: null, iframeResource: null, pxratio: "1", iconClickThroughURLTemplate: null, iconClickTrackingURLTemplates: [], iconViewTrackingURLTemplate: null, iconClickFallbackImages: [], altText: null, hoverText: null };
@@ -284,125 +284,125 @@ function X(a, e) {
284
284
  }(c));
285
285
  }), r;
286
286
  }
287
- function Z(a, e) {
287
+ function Z(i, e) {
288
288
  const t = function() {
289
289
  let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
290
- const { id: s, adId: i, sequence: o, apiFramework: n } = N(r);
291
- return { id: s, adId: i, sequence: o, apiFramework: n, type: "nonlinear", variations: [], trackingEvents: {} };
290
+ const { id: a, adId: s, sequence: o, apiFramework: n } = N(r);
291
+ return { id: a, adId: s, sequence: o, apiFramework: n, type: "nonlinear", variations: [], trackingEvents: {} };
292
292
  }(e);
293
- return l.childrenByName(a, "TrackingEvents").forEach((r) => {
294
- let s, i;
293
+ return l.childrenByName(i, "TrackingEvents").forEach((r) => {
294
+ let a, s;
295
295
  l.childrenByName(r, "Tracking").forEach((o) => {
296
- s = o.getAttribute("event"), i = l.parseNodeText(o), s && i && (Array.isArray(t.trackingEvents[s]) || (t.trackingEvents[s] = []), t.trackingEvents[s].push(i));
296
+ a = o.getAttribute("event"), s = l.parseNodeText(o), a && s && (Array.isArray(t.trackingEvents[a]) || (t.trackingEvents[a] = []), t.trackingEvents[a].push(s));
297
297
  });
298
- }), l.childrenByName(a, "NonLinear").forEach((r) => {
299
- const s = { id: null, width: 0, height: 0, expandedWidth: 0, expandedHeight: 0, scalable: !0, maintainAspectRatio: !0, minSuggestedDuration: 0, apiFramework: "static", adType: "nonLinearAd", type: null, staticResource: null, htmlResource: null, iframeResource: null, nonlinearClickThroughURLTemplate: null, nonlinearClickTrackingURLTemplates: [], adParameters: null };
300
- s.id = r.getAttribute("id") || null, s.width = r.getAttribute("width"), s.height = r.getAttribute("height"), s.expandedWidth = r.getAttribute("expandedWidth"), s.expandedHeight = r.getAttribute("expandedHeight"), s.scalable = l.parseBoolean(r.getAttribute("scalable")), s.maintainAspectRatio = l.parseBoolean(r.getAttribute("maintainAspectRatio")), s.minSuggestedDuration = l.parseDuration(r.getAttribute("minSuggestedDuration")), s.apiFramework = r.getAttribute("apiFramework"), l.childrenByName(r, "HTMLResource").forEach((o) => {
301
- s.type = o.getAttribute("creativeType") || "text/html", s.htmlResource = l.parseNodeText(o);
298
+ }), l.childrenByName(i, "NonLinear").forEach((r) => {
299
+ const a = { id: null, width: 0, height: 0, expandedWidth: 0, expandedHeight: 0, scalable: !0, maintainAspectRatio: !0, minSuggestedDuration: 0, apiFramework: "static", adType: "nonLinearAd", type: null, staticResource: null, htmlResource: null, iframeResource: null, nonlinearClickThroughURLTemplate: null, nonlinearClickTrackingURLTemplates: [], adParameters: null };
300
+ a.id = r.getAttribute("id") || null, a.width = r.getAttribute("width"), a.height = r.getAttribute("height"), a.expandedWidth = r.getAttribute("expandedWidth"), a.expandedHeight = r.getAttribute("expandedHeight"), a.scalable = l.parseBoolean(r.getAttribute("scalable")), a.maintainAspectRatio = l.parseBoolean(r.getAttribute("maintainAspectRatio")), a.minSuggestedDuration = l.parseDuration(r.getAttribute("minSuggestedDuration")), a.apiFramework = r.getAttribute("apiFramework"), l.childrenByName(r, "HTMLResource").forEach((o) => {
301
+ a.type = o.getAttribute("creativeType") || "text/html", a.htmlResource = l.parseNodeText(o);
302
302
  }), l.childrenByName(r, "IFrameResource").forEach((o) => {
303
- s.type = o.getAttribute("creativeType") || 0, s.iframeResource = l.parseNodeText(o);
303
+ a.type = o.getAttribute("creativeType") || 0, a.iframeResource = l.parseNodeText(o);
304
304
  }), l.childrenByName(r, "StaticResource").forEach((o) => {
305
- s.type = o.getAttribute("creativeType") || 0, s.staticResource = l.parseNodeText(o);
305
+ a.type = o.getAttribute("creativeType") || 0, a.staticResource = l.parseNodeText(o);
306
306
  });
307
- const i = l.childByName(r, "AdParameters");
308
- i && (s.adParameters = { value: l.parseNodeText(i), xmlEncoded: i.getAttribute("xmlEncoded") || null }), s.nonlinearClickThroughURLTemplate = l.parseNodeText(l.childByName(r, "NonLinearClickThrough")), l.childrenByName(r, "NonLinearClickTracking").forEach((o) => {
309
- s.nonlinearClickTrackingURLTemplates.push({ id: o.getAttribute("id") || null, url: l.parseNodeText(o) });
310
- }), t.variations.push(s);
307
+ const s = l.childByName(r, "AdParameters");
308
+ s && (a.adParameters = { value: l.parseNodeText(s), xmlEncoded: s.getAttribute("xmlEncoded") || null }), a.nonlinearClickThroughURLTemplate = l.parseNodeText(l.childByName(r, "NonLinearClickThrough")), l.childrenByName(r, "NonLinearClickTracking").forEach((o) => {
309
+ a.nonlinearClickTrackingURLTemplates.push({ id: o.getAttribute("id") || null, url: l.parseNodeText(o) });
310
+ }), t.variations.push(a);
311
311
  }), t;
312
312
  }
313
- function x(a) {
313
+ function x(i) {
314
314
  const e = [];
315
- return a.forEach((t) => {
315
+ return i.forEach((t) => {
316
316
  const r = K(t);
317
317
  r && e.push(r);
318
318
  }), e;
319
319
  }
320
- function K(a) {
321
- if (a.nodeName === "#comment") return null;
322
- const e = { name: null, value: null, attributes: {}, children: [] }, t = a.attributes, r = a.childNodes;
323
- if (e.name = a.nodeName, a.attributes) {
324
- for (const i in t) if (t.hasOwnProperty(i)) {
325
- const o = t[i];
320
+ function K(i) {
321
+ if (i.nodeName === "#comment") return null;
322
+ const e = { name: null, value: null, attributes: {}, children: [] }, t = i.attributes, r = i.childNodes;
323
+ if (e.name = i.nodeName, i.attributes) {
324
+ for (const s in t) if (t.hasOwnProperty(s)) {
325
+ const o = t[s];
326
326
  o.nodeName && o.nodeValue && (e.attributes[o.nodeName] = o.nodeValue);
327
327
  }
328
328
  }
329
- for (const i in r) if (r.hasOwnProperty(i)) {
330
- const o = K(r[i]);
329
+ for (const s in r) if (r.hasOwnProperty(s)) {
330
+ const o = K(r[s]);
331
331
  o && e.children.push(o);
332
332
  }
333
333
  if (e.children.length === 0 || e.children.length === 1 && ["#cdata-section", "#text"].indexOf(e.children[0].name) >= 0) {
334
- const i = l.parseNodeText(a);
335
- i !== "" && (e.value = i), e.children = [];
334
+ const s = l.parseNodeText(i);
335
+ s !== "" && (e.value = s), e.children = [];
336
336
  }
337
- return (s = e).value === null && Object.keys(s.attributes).length === 0 && s.children.length === 0 ? null : e;
338
- var s;
337
+ return (a = e).value === null && Object.keys(a.attributes).length === 0 && a.children.length === 0 ? null : e;
338
+ var a;
339
339
  }
340
- function J(a) {
341
- return a.getAttribute("AdID") || a.getAttribute("adID") || a.getAttribute("adId") || null;
340
+ function J(i) {
341
+ return i.getAttribute("AdID") || i.getAttribute("adID") || i.getAttribute("adId") || null;
342
342
  }
343
343
  const y = { Wrapper: { subElements: ["VASTAdTagURI", "Impression"] }, BlockedAdCategories: { attributes: ["authority"] }, InLine: { subElements: ["AdSystem", "AdTitle", "Impression", "AdServingId", "Creatives"] }, Category: { attributes: ["authority"] }, Pricing: { attributes: ["model", "currency"] }, Verification: { oneOfinLineResources: ["JavaScriptResource", "ExecutableResource"], attributes: ["vendor"] }, UniversalAdId: { attributes: ["idRegistry"] }, JavaScriptResource: { attributes: ["apiFramework", "browserOptional"] }, ExecutableResource: { attributes: ["apiFramework", "type"] }, Tracking: { attributes: ["event"] }, Creatives: { subElements: ["Creative"] }, Creative: { subElements: ["UniversalAdId"] }, Linear: { subElements: ["MediaFiles", "Duration"] }, MediaFiles: { subElements: ["MediaFile"] }, MediaFile: { attributes: ["delivery", "type", "width", "height"] }, Mezzanine: { attributes: ["delivery", "type", "width", "height"] }, NonLinear: { oneOfinLineResources: ["StaticResource", "IFrameResource", "HTMLResource"], attributes: ["width", "height"] }, Companion: { oneOfinLineResources: ["StaticResource", "IFrameResource", "HTMLResource"], attributes: ["width", "height"] }, StaticResource: { attributes: ["creativeType"] }, Icons: { subElements: ["Icon"] }, Icon: { oneOfinLineResources: ["StaticResource", "IFrameResource", "HTMLResource"] } };
344
- function S(a, e) {
345
- if (!y[a.nodeName] || !y[a.nodeName].attributes) return;
346
- const t = y[a.nodeName].attributes.filter((r) => !a.getAttribute(r));
347
- t.length > 0 && k({ name: a.nodeName, parentName: a.parentNode.nodeName, attributes: t }, e);
344
+ function S(i, e) {
345
+ if (!y[i.nodeName] || !y[i.nodeName].attributes) return;
346
+ const t = y[i.nodeName].attributes.filter((r) => !i.getAttribute(r));
347
+ t.length > 0 && k({ name: i.nodeName, parentName: i.parentNode.nodeName, attributes: t }, e);
348
348
  }
349
- function V(a, e, t) {
350
- const r = y[a.nodeName], s = !t && a.nodeName !== "Wrapper";
351
- if (!(!r || s)) {
349
+ function V(i, e, t) {
350
+ const r = y[i.nodeName], a = !t && i.nodeName !== "Wrapper";
351
+ if (!(!r || a)) {
352
352
  if (r.subElements) {
353
- const i = r.subElements.filter((o) => !l.childByName(a, o));
354
- i.length > 0 && k({ name: a.nodeName, parentName: a.parentNode.nodeName, subElements: i }, e);
353
+ const s = r.subElements.filter((o) => !l.childByName(i, o));
354
+ s.length > 0 && k({ name: i.nodeName, parentName: i.parentNode.nodeName, subElements: s }, e);
355
355
  }
356
- !t || !r.oneOfinLineResources || r.oneOfinLineResources.some((i) => l.childByName(a, i)) || k({ name: a.nodeName, parentName: a.parentNode.nodeName, oneOfResources: r.oneOfinLineResources }, e);
356
+ !t || !r.oneOfinLineResources || r.oneOfinLineResources.some((s) => l.childByName(i, s)) || k({ name: i.nodeName, parentName: i.parentNode.nodeName, oneOfResources: r.oneOfinLineResources }, e);
357
357
  }
358
358
  }
359
- function D(a) {
360
- return a.children && a.children.length !== 0;
359
+ function D(i) {
360
+ return i.children && i.children.length !== 0;
361
361
  }
362
- function k(a, e) {
363
- let { name: t, parentName: r, attributes: s, subElements: i, oneOfResources: o } = a, n = "Element '".concat(t, "'");
364
- n += s ? " missing required attribute(s) '".concat(s.join(", "), "' ") : i ? " missing required sub element(s) '".concat(i.join(", "), "' ") : o ? " must provide one of the following '".concat(o.join(", "), "' ") : " is empty", e("VAST-warning", { message: n, parentElement: r, specVersion: 4.1 });
362
+ function k(i, e) {
363
+ let { name: t, parentName: r, attributes: a, subElements: s, oneOfResources: o } = i, n = "Element '".concat(t, "'");
364
+ n += a ? " missing required attribute(s) '".concat(a.join(", "), "' ") : s ? " missing required sub element(s) '".concat(s.join(", "), "' ") : o ? " must provide one of the following '".concat(o.join(", "), "' ") : " is empty", e("VAST-warning", { message: n, parentElement: r, specVersion: 4.1 });
365
365
  }
366
- const $ = { verifyRequiredValues: function a(e, t, r) {
366
+ const $ = { verifyRequiredValues: function i(e, t, r) {
367
367
  if (e && e.nodeName) if (e.nodeName === "InLine" && (r = !0), S(e, t), D(e)) {
368
368
  V(e, t, r);
369
- for (let s = 0; s < e.children.length; s++) a(e.children[s], t, r);
369
+ for (let a = 0; a < e.children.length; a++) i(e.children[a], t, r);
370
370
  } else l.parseNodeText(e).length === 0 && k({ name: e.nodeName, parentName: e.parentNode.nodeName }, t);
371
371
  }, hasSubElements: D, emitMissingValueWarning: k, verifyRequiredAttributes: S, verifyRequiredSubElements: V };
372
- function ee(a, e) {
372
+ function ee(i, e) {
373
373
  let { allowMultipleAds: t, followAdditionalWrappers: r } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
374
- const s = Array.from(a.childNodes).filter((i) => {
375
- const o = i.nodeName.toLowerCase();
374
+ const a = Array.from(i.childNodes).filter((s) => {
375
+ const o = s.nodeName.toLowerCase();
376
376
  return o === "inline" || r !== !1 && o === "wrapper";
377
377
  });
378
- for (const i of s) {
379
- if (l.copyNodeAttribute("id", a, i), l.copyNodeAttribute("sequence", a, i), l.copyNodeAttribute("adType", a, i), i.nodeName === "Wrapper") return { ad: re(i, e), type: "WRAPPER" };
380
- if (i.nodeName === "InLine") return { ad: te(i, e, { allowMultipleAds: t }), type: "INLINE" };
381
- const o = i.nodeName.toLowerCase();
382
- e("VAST-warning", { message: "<".concat(i.nodeName, o === "inline" ? "> must be written <InLine>" : "> must be written <Wrapper>"), wrongNode: i });
378
+ for (const s of a) {
379
+ if (l.copyNodeAttribute("id", i, s), l.copyNodeAttribute("sequence", i, s), l.copyNodeAttribute("adType", i, s), s.nodeName === "Wrapper") return { ad: re(s, e), type: "WRAPPER" };
380
+ if (s.nodeName === "InLine") return { ad: te(s, e, { allowMultipleAds: t }), type: "INLINE" };
381
+ const o = s.nodeName.toLowerCase();
382
+ e("VAST-warning", { message: "<".concat(s.nodeName, o === "inline" ? "> must be written <InLine>" : "> must be written <Wrapper>"), wrongNode: s });
383
383
  }
384
384
  }
385
- function te(a, e) {
385
+ function te(i, e) {
386
386
  let { allowMultipleAds: t } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
387
- return t === !1 && a.getAttribute("sequence") ? null : H(a, e);
387
+ return t === !1 && i.getAttribute("sequence") ? null : H(i, e);
388
388
  }
389
- function H(a, e) {
389
+ function H(i, e) {
390
390
  let t = [];
391
- e && $.verifyRequiredValues(a, e);
392
- const r = Array.from(a.childNodes), s = function() {
393
- let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
394
- return { id: i.id || null, sequence: i.sequence || null, adType: i.adType || null, adServingId: null, categories: [], expires: null, viewableImpression: [], system: null, title: null, description: null, advertiser: null, pricing: null, survey: null, errorURLTemplates: [], impressionURLTemplates: [], creatives: [], extensions: [], adVerifications: [], blockedAdCategories: [], followAdditionalWrappers: !0, allowMultipleAds: !1, fallbackOnNoAd: null };
395
- }(l.parseAttributes(a));
396
- return r.forEach((i) => {
397
- switch (i.nodeName) {
391
+ e && $.verifyRequiredValues(i, e);
392
+ const r = Array.from(i.childNodes), a = function() {
393
+ let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
394
+ return { id: s.id || null, sequence: s.sequence || null, adType: s.adType || null, adServingId: null, categories: [], expires: null, viewableImpression: [], system: null, title: null, description: null, advertiser: null, pricing: null, survey: null, errorURLTemplates: [], impressionURLTemplates: [], creatives: [], extensions: [], adVerifications: [], blockedAdCategories: [], followAdditionalWrappers: !0, allowMultipleAds: !1, fallbackOnNoAd: null };
395
+ }(l.parseAttributes(i));
396
+ return r.forEach((s) => {
397
+ switch (s.nodeName) {
398
398
  case "Error":
399
- s.errorURLTemplates.push(l.parseNodeText(i));
399
+ a.errorURLTemplates.push(l.parseNodeText(s));
400
400
  break;
401
401
  case "Impression":
402
- s.impressionURLTemplates.push({ id: i.getAttribute("id") || null, url: l.parseNodeText(i) });
402
+ a.impressionURLTemplates.push({ id: s.getAttribute("id") || null, url: l.parseNodeText(s) });
403
403
  break;
404
404
  case "Creatives":
405
- s.creatives = function(o) {
405
+ a.creatives = function(o) {
406
406
  const n = [];
407
407
  return o.forEach((c) => {
408
408
  const u = { id: c.getAttribute("id") || null, adId: J(c), sequence: c.getAttribute("sequence") || null, apiFramework: c.getAttribute("apiFramework") || null }, d = [];
@@ -429,65 +429,65 @@ function H(a, e) {
429
429
  v && (d && (v.universalAdIds = d), g && (v.creativeExtensions = g), n.push(v));
430
430
  }
431
431
  }), n;
432
- }(l.childrenByName(i, "Creative"));
432
+ }(l.childrenByName(s, "Creative"));
433
433
  break;
434
434
  case "Extensions": {
435
- const o = l.childrenByName(i, "Extension");
436
- s.extensions = x(o), s.adVerifications.length || (t = function(n) {
435
+ const o = l.childrenByName(s, "Extension");
436
+ a.extensions = x(o), a.adVerifications.length || (t = function(n) {
437
437
  let c = null, u = [];
438
438
  return n.some((d) => c = l.childByName(d, "AdVerifications")), c && (u = O(l.childrenByName(c, "Verification"))), u;
439
439
  }(o));
440
440
  break;
441
441
  }
442
442
  case "AdVerifications":
443
- s.adVerifications = O(l.childrenByName(i, "Verification"));
443
+ a.adVerifications = O(l.childrenByName(s, "Verification"));
444
444
  break;
445
445
  case "AdSystem":
446
- s.system = { value: l.parseNodeText(i), version: i.getAttribute("version") || null };
446
+ a.system = { value: l.parseNodeText(s), version: s.getAttribute("version") || null };
447
447
  break;
448
448
  case "AdTitle":
449
- s.title = l.parseNodeText(i);
449
+ a.title = l.parseNodeText(s);
450
450
  break;
451
451
  case "AdServingId":
452
- s.adServingId = l.parseNodeText(i);
452
+ a.adServingId = l.parseNodeText(s);
453
453
  break;
454
454
  case "Category":
455
- s.categories.push({ authority: i.getAttribute("authority") || null, value: l.parseNodeText(i) });
455
+ a.categories.push({ authority: s.getAttribute("authority") || null, value: l.parseNodeText(s) });
456
456
  break;
457
457
  case "Expires":
458
- s.expires = parseInt(l.parseNodeText(i), 10);
458
+ a.expires = parseInt(l.parseNodeText(s), 10);
459
459
  break;
460
460
  case "ViewableImpression":
461
- s.viewableImpression.push(function(o) {
461
+ a.viewableImpression.push(function(o) {
462
462
  const n = (c, u) => {
463
463
  const d = l.parseNodeText(u);
464
464
  return d && c.push(d), c;
465
465
  };
466
466
  return { id: o.getAttribute("id") || null, viewable: l.childrenByName(o, "Viewable").reduce(n, []), notViewable: l.childrenByName(o, "NotViewable").reduce(n, []), viewUndetermined: l.childrenByName(o, "ViewUndetermined").reduce(n, []) };
467
- }(i));
467
+ }(s));
468
468
  break;
469
469
  case "Description":
470
- s.description = l.parseNodeText(i);
470
+ a.description = l.parseNodeText(s);
471
471
  break;
472
472
  case "Advertiser":
473
- s.advertiser = { id: i.getAttribute("id") || null, value: l.parseNodeText(i) };
473
+ a.advertiser = { id: s.getAttribute("id") || null, value: l.parseNodeText(s) };
474
474
  break;
475
475
  case "Pricing":
476
- s.pricing = { value: l.parseNodeText(i), model: i.getAttribute("model") || null, currency: i.getAttribute("currency") || null };
476
+ a.pricing = { value: l.parseNodeText(s), model: s.getAttribute("model") || null, currency: s.getAttribute("currency") || null };
477
477
  break;
478
478
  case "Survey":
479
- s.survey = { value: l.parseNodeText(i), type: i.getAttribute("type") || null };
479
+ a.survey = { value: l.parseNodeText(s), type: s.getAttribute("type") || null };
480
480
  break;
481
481
  case "BlockedAdCategories":
482
- s.blockedAdCategories.push({ authority: i.getAttribute("authority") || null, value: l.parseNodeText(i) });
482
+ a.blockedAdCategories.push({ authority: s.getAttribute("authority") || null, value: l.parseNodeText(s) });
483
483
  }
484
- }), t.length && (s.adVerifications = s.adVerifications.concat(t)), s;
484
+ }), t.length && (a.adVerifications = a.adVerifications.concat(t)), a;
485
485
  }
486
- function re(a, e) {
487
- const t = H(a, e), r = a.getAttribute("followAdditionalWrappers"), s = a.getAttribute("allowMultipleAds"), i = a.getAttribute("fallbackOnNoAd");
488
- t.followAdditionalWrappers = !r || l.parseBoolean(r), t.allowMultipleAds = !!s && l.parseBoolean(s), t.fallbackOnNoAd = i ? l.parseBoolean(i) : null;
489
- let o = l.childByName(a, "VASTAdTagURI");
490
- if (o ? t.nextWrapperURL = l.parseNodeText(o) : (o = l.childByName(a, "VASTAdTagURL"), o && (t.nextWrapperURL = l.parseNodeText(l.childByName(o, "URL")))), t.creatives.forEach((n) => {
486
+ function re(i, e) {
487
+ const t = H(i, e), r = i.getAttribute("followAdditionalWrappers"), a = i.getAttribute("allowMultipleAds"), s = i.getAttribute("fallbackOnNoAd");
488
+ t.followAdditionalWrappers = !r || l.parseBoolean(r), t.allowMultipleAds = !!a && l.parseBoolean(a), t.fallbackOnNoAd = s ? l.parseBoolean(s) : null;
489
+ let o = l.childByName(i, "VASTAdTagURI");
490
+ if (o ? t.nextWrapperURL = l.parseNodeText(o) : (o = l.childByName(i, "VASTAdTagURL"), o && (t.nextWrapperURL = l.parseNodeText(l.childByName(o, "URL")))), t.creatives.forEach((n) => {
491
491
  if (["linear", "nonlinear"].includes(n.type)) {
492
492
  if (n.trackingEvents) {
493
493
  t.trackingEvents || (t.trackingEvents = {}), t.trackingEvents[n.type] || (t.trackingEvents[n.type] = {});
@@ -506,11 +506,11 @@ function re(a, e) {
506
506
  }
507
507
  }), t.nextWrapperURL) return t;
508
508
  }
509
- function O(a) {
509
+ function O(i) {
510
510
  const e = [];
511
- return a.forEach((t) => {
512
- const r = { resource: null, vendor: null, browserOptional: !1, apiFramework: null, type: null, parameters: null, trackingEvents: {} }, s = Array.from(t.childNodes);
513
- l.assignAttributes(t.attributes, r), s.forEach((o) => {
511
+ return i.forEach((t) => {
512
+ const r = { resource: null, vendor: null, browserOptional: !1, apiFramework: null, type: null, parameters: null, trackingEvents: {} }, a = Array.from(t.childNodes);
513
+ l.assignAttributes(t.attributes, r), a.forEach((o) => {
514
514
  let { nodeName: n, textContent: c, attributes: u } = o;
515
515
  switch (n) {
516
516
  case "JavaScriptResource":
@@ -521,8 +521,8 @@ function O(a) {
521
521
  r.parameters = c.trim();
522
522
  }
523
523
  });
524
- const i = l.childByName(t, "TrackingEvents");
525
- i && l.childrenByName(i, "Tracking").forEach((o) => {
524
+ const s = l.childByName(t, "TrackingEvents");
525
+ s && l.childrenByName(s, "Tracking").forEach((o) => {
526
526
  const n = o.getAttribute("event"), c = l.parseNodeText(o);
527
527
  n && c && (Array.isArray(r.trackingEvents[n]) || (r.trackingEvents[n] = []), r.trackingEvents[n].push(c));
528
528
  }), e.push(r);
@@ -538,10 +538,10 @@ class _ {
538
538
  return this._handlers.push({ event: e, handler: t }), this;
539
539
  }
540
540
  once(e, t) {
541
- return this.on(e, function(r, s, i) {
541
+ return this.on(e, function(r, a, s) {
542
542
  const o = { fired: !1, wrapFn: void 0 };
543
543
  function n() {
544
- o.fired || (r.off(s, o.wrapFn), o.fired = !0, i.bind(r)(...arguments));
544
+ o.fired || (r.off(a, o.wrapFn), o.fired = !0, s.bind(r)(...arguments));
545
545
  }
546
546
  return o.wrapFn = n, n;
547
547
  }(this, e, t));
@@ -550,11 +550,11 @@ class _ {
550
550
  return this._handlers = this._handlers.filter((r) => r.event !== e || r.handler !== t), this;
551
551
  }
552
552
  emit(e) {
553
- for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++) r[s - 1] = arguments[s];
554
- let i = !1;
553
+ for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), a = 1; a < t; a++) r[a - 1] = arguments[a];
554
+ let s = !1;
555
555
  return this._handlers.forEach((o) => {
556
- o.event === "*" && (i = !0, o.handler(e, ...r)), o.event === e && (i = !0, o.handler(...r));
557
- }), i;
556
+ o.event === "*" && (s = !0, o.handler(e, ...r)), o.event === e && (s = !0, o.handler(...r));
557
+ }), s;
558
558
  }
559
559
  removeAllListeners(e) {
560
560
  return e ? (this._handlers = this._handlers.filter((t) => t.event !== e), this) : (this._handlers = [], this);
@@ -570,17 +570,17 @@ class _ {
570
570
  }
571
571
  }
572
572
  let F = 0, E = 0;
573
- const z = (a, e) => {
574
- !a || !e || a <= 0 || e <= 0 || (E = (E * F + 8 * a / e) / ++F);
575
- }, ae = { ERRORCODE: 900, extensions: [] }, P = "VAST response version not supported";
576
- class se extends _ {
573
+ const z = (i, e) => {
574
+ !i || !e || i <= 0 || e <= 0 || (E = (E * F + 8 * i / e) / ++F);
575
+ }, ie = { ERRORCODE: 900, extensions: [] }, P = "VAST response version not supported";
576
+ class ae extends _ {
577
577
  constructor() {
578
578
  let { fetcher: e } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
579
579
  super(), this.maxWrapperDepth = null, this.rootErrorURLTemplates = [], this.errorURLTemplates = [], this.remainingAds = [], this.parsingOptions = {}, this.fetcher = e || null, this.keepFailedAdPod = !1;
580
580
  }
581
581
  trackVastError(e, t) {
582
- for (var r = arguments.length, s = new Array(r > 2 ? r - 2 : 0), i = 2; i < r; i++) s[i - 2] = arguments[i];
583
- this.emit("VAST-error", Object.assign({}, ae, t, ...s)), T.track(e, t);
582
+ for (var r = arguments.length, a = new Array(r > 2 ? r - 2 : 0), s = 2; s < r; s++) a[s - 2] = arguments[s];
583
+ this.emit("VAST-error", Object.assign({}, ie, t, ...a)), f.track(e, t);
584
584
  }
585
585
  getErrorURLTemplates() {
586
586
  return this.rootErrorURLTemplates.concat(this.errorURLTemplates);
@@ -606,16 +606,16 @@ class se extends _ {
606
606
  }
607
607
  buildVASTResponse(e) {
608
608
  const t = function(r) {
609
- let { ads: s, errorURLTemplates: i, version: o } = r;
610
- return { ads: s || [], errorURLTemplates: i || [], version: o || null };
609
+ let { ads: a, errorURLTemplates: s, version: o } = r;
610
+ return { ads: a || [], errorURLTemplates: s || [], version: o || null };
611
611
  }({ ads: e, errorURLTemplates: this.getErrorURLTemplates(), version: this.vastVersion });
612
612
  return this.completeWrapperResolving(t), t;
613
613
  }
614
614
  parseVastXml(e, t) {
615
- let { isRootVAST: r = !1, url: s = null, wrapperDepth: i = 0, allowMultipleAds: o, followAdditionalWrappers: n } = t;
615
+ let { isRootVAST: r = !1, url: a = null, wrapperDepth: s = 0, allowMultipleAds: o, followAdditionalWrappers: n } = t;
616
616
  if (!e || !e.documentElement || e.documentElement.nodeName !== "VAST") {
617
617
  var c;
618
- this.emit("VAST-ad-parsed", { type: "ERROR", url: s, wrapperDepth: i });
618
+ this.emit("VAST-ad-parsed", { type: "ERROR", url: a, wrapperDepth: s });
619
619
  const m = (e == null || (c = e.documentElement) === null || c === void 0 ? void 0 : c.nodeName) === "VideoAdServingTemplate";
620
620
  throw new Error(m ? P : "Invalid VAST XMLDocument");
621
621
  }
@@ -630,70 +630,70 @@ class se extends _ {
630
630
  if (this.vastVersion && parseFloat(this.vastVersion) < 3) o = !0;
631
631
  else if (o === !1 && u.length > 1) break;
632
632
  const p = ee(h, this.emit.bind(this), { allowMultipleAds: o, followAdditionalWrappers: n });
633
- p.ad ? (u.push(p.ad), this.emit("VAST-ad-parsed", { type: p.type, url: s, wrapperDepth: i, adIndex: u.length - 1, vastVersion: g })) : this.trackVastError(this.getErrorURLTemplates(), { ERRORCODE: 101 });
633
+ p.ad ? (u.push(p.ad), this.emit("VAST-ad-parsed", { type: p.type, url: a, wrapperDepth: s, adIndex: u.length - 1, vastVersion: g })) : this.trackVastError(this.getErrorURLTemplates(), { ERRORCODE: 101 });
634
634
  }
635
635
  }
636
636
  return u;
637
637
  }
638
638
  parse(e) {
639
- let { url: t = null, resolveAll: r = !0, wrapperSequence: s = null, previousUrl: i = null, wrapperDepth: o = 0, isRootVAST: n = !1, followAdditionalWrappers: c, allowMultipleAds: u } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, d = [];
639
+ let { url: t = null, resolveAll: r = !0, wrapperSequence: a = null, previousUrl: s = null, wrapperDepth: o = 0, isRootVAST: n = !1, followAdditionalWrappers: c, allowMultipleAds: u } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, d = [];
640
640
  this.vastVersion && parseFloat(this.vastVersion) < 3 && n && (u = !0);
641
641
  try {
642
642
  d = this.parseVastXml(e, { isRootVAST: n, url: t, wrapperDepth: o, allowMultipleAds: u, followAdditionalWrappers: c });
643
643
  } catch (g) {
644
644
  return Promise.reject(g);
645
645
  }
646
- if (d.length === 1 && s != null && (d[0].sequence = s), r === !1) {
646
+ if (d.length === 1 && a != null && (d[0].sequence = a), r === !1) {
647
647
  const g = l.getSortedAdPods(d), m = l.getStandAloneAds(d);
648
648
  g.length ? d = g : m.length && (d = [m.shift()]), this.remainingAds = m;
649
649
  }
650
- return this.resolveAds(d, { wrapperDepth: o, previousUrl: i, url: t });
650
+ return this.resolveAds(d, { wrapperDepth: o, previousUrl: s, url: t });
651
651
  }
652
652
  resolveAds() {
653
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], { wrapperDepth: t, previousUrl: r, url: s } = arguments.length > 1 ? arguments[1] : void 0;
654
- const i = [];
655
- return r = s, e.forEach((o) => {
653
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], { wrapperDepth: t, previousUrl: r, url: a } = arguments.length > 1 ? arguments[1] : void 0;
654
+ const s = [];
655
+ return r = a, e.forEach((o) => {
656
656
  const n = this.resolveWrappers(o, t, r);
657
- i.push(n);
658
- }), Promise.all(i).then((o) => T.flatten(o));
657
+ s.push(n);
658
+ }), Promise.all(s).then((o) => f.flatten(o));
659
659
  }
660
660
  resolveWrappers(e, t, r) {
661
- const s = { ...e };
662
- return new Promise((i) => {
661
+ const a = { ...e };
662
+ return new Promise((s) => {
663
663
  var o;
664
- if (t++, !s.nextWrapperURL) return delete s.nextWrapperURL, i(s);
665
- if (!this.fetcher) return s.VASTAdTagURI = s.nextWrapperURL, delete s.nextWrapperURL, i(s);
666
- if (t >= this.maxWrapperDepth) return s.errorCode = 302, delete s.nextWrapperURL, i(s);
667
- s.nextWrapperURL = l.resolveVastAdTagURI(s.nextWrapperURL, r);
668
- const n = (o = this.parsingOptions.allowMultipleAds) !== null && o !== void 0 ? o : s.allowMultipleAds, c = s.sequence;
669
- this.fetcher.fetchVAST({ url: s.nextWrapperURL, emitter: this.emit.bind(this), maxWrapperDepth: this.maxWrapperDepth }).then((u) => this.parse(u, { url: s.nextWrapperURL, previousUrl: r, wrapperSequence: c, wrapperDepth: t, followAdditionalWrappers: s.followAdditionalWrappers, allowMultipleAds: n }).then((d) => {
670
- if (delete s.nextWrapperURL, d.length === 0) return s.creatives = [], i(s);
664
+ if (t++, !a.nextWrapperURL) return delete a.nextWrapperURL, s(a);
665
+ if (!this.fetcher) return a.VASTAdTagURI = a.nextWrapperURL, delete a.nextWrapperURL, s(a);
666
+ if (t >= this.maxWrapperDepth) return a.errorCode = 302, delete a.nextWrapperURL, s(a);
667
+ a.nextWrapperURL = l.resolveVastAdTagURI(a.nextWrapperURL, r);
668
+ const n = (o = this.parsingOptions.allowMultipleAds) !== null && o !== void 0 ? o : a.allowMultipleAds, c = a.sequence;
669
+ this.fetcher.fetchVAST({ url: a.nextWrapperURL, emitter: this.emit.bind(this), maxWrapperDepth: this.maxWrapperDepth }).then((u) => this.parse(u, { url: a.nextWrapperURL, previousUrl: r, wrapperSequence: c, wrapperDepth: t, followAdditionalWrappers: a.followAdditionalWrappers, allowMultipleAds: n }).then((d) => {
670
+ if (delete a.nextWrapperURL, d.length === 0) return a.creatives = [], s(a);
671
671
  d.forEach((g) => {
672
- g && l.mergeWrapperAdData(g, s);
673
- }), i(d);
672
+ g && l.mergeWrapperAdData(g, a);
673
+ }), s(d);
674
674
  })).catch((u) => {
675
- s.errorCode = u.message === P ? 102 : 301, s.errorMessage = u.message, i(s);
675
+ a.errorCode = u.message === P ? 102 : 301, a.errorMessage = u.message, s(a);
676
676
  });
677
677
  });
678
678
  }
679
679
  completeWrapperResolving(e) {
680
680
  if (e.ads.length === 0) this.trackVastError(e.errorURLTemplates, { ERRORCODE: 303 });
681
681
  else for (let t = e.ads.length - 1; t >= 0; t--) {
682
- const r = e.ads[t], s = !r.creatives.some((i) => {
682
+ const r = e.ads[t], a = !r.creatives.some((s) => {
683
683
  var o, n;
684
- return ((o = i.mediaFiles) === null || o === void 0 ? void 0 : o.length) > 0 || ((n = i.variations) === null || n === void 0 ? void 0 : n.length) > 0;
684
+ return ((o = s.mediaFiles) === null || o === void 0 ? void 0 : o.length) > 0 || ((n = s.variations) === null || n === void 0 ? void 0 : n.length) > 0;
685
685
  });
686
- !r.errorCode && !s || r.VASTAdTagURI || (this.trackVastError(r.errorURLTemplates.concat(e.errorURLTemplates), { ERRORCODE: r.errorCode || 303 }, { ERRORMESSAGE: r.errorMessage || "" }, { extensions: r.extensions }, { system: r.system }), this.keepFailedAdPod && r.sequence ? r.hasFailed = !0 : e.ads.splice(t, 1));
686
+ !r.errorCode && !a || r.VASTAdTagURI || (this.trackVastError(r.errorURLTemplates.concat(e.errorURLTemplates), { ERRORCODE: r.errorCode || 303 }, { ERRORMESSAGE: r.errorMessage || "" }, { extensions: r.extensions }, { system: r.system }), this.keepFailedAdPod && r.sequence ? r.hasFailed = !0 : e.ads.splice(t, 1));
687
687
  }
688
688
  }
689
689
  }
690
- let f = null;
691
- const ie = { data: {}, length: 0, getItem(a) {
692
- return this.data[a];
693
- }, setItem(a, e) {
694
- this.data[a] = e, this.length = Object.keys(this.data).length;
695
- }, removeItem(a) {
696
- delete this.data[a], this.length = Object.keys(this.data).length;
690
+ let T = null;
691
+ const se = { data: {}, length: 0, getItem(i) {
692
+ return this.data[i];
693
+ }, setItem(i, e) {
694
+ this.data[i] = e, this.length = Object.keys(this.data).length;
695
+ }, removeItem(i) {
696
+ delete this.data[i], this.length = Object.keys(this.data).length;
697
697
  }, clear() {
698
698
  this.data = {}, this.length = 0;
699
699
  } };
@@ -702,13 +702,13 @@ class ne {
702
702
  this.storage = this.initStorage();
703
703
  }
704
704
  initStorage() {
705
- if (f) return f;
705
+ if (T) return T;
706
706
  try {
707
- f = typeof window < "u" && window !== null ? window.localStorage || window.sessionStorage : null;
707
+ T = typeof window < "u" && window !== null ? window.localStorage || window.sessionStorage : null;
708
708
  } catch {
709
- f = null;
709
+ T = null;
710
710
  }
711
- return f && !this.isStorageDisabled(f) || (f = ie, f.clear()), f;
711
+ return T && !this.isStorageDisabled(T) || (T = se, T.clear()), T;
712
712
  }
713
713
  isStorageDisabled(e) {
714
714
  const t = "__VASTStorage__";
@@ -732,20 +732,20 @@ class ne {
732
732
  return this.storage.clear();
733
733
  }
734
734
  }
735
- const b = 12e4, oe = { get: async function(a, e) {
735
+ const b = 12e4, oe = { get: async function(i, e) {
736
736
  try {
737
737
  const t = new AbortController(), r = setTimeout(() => {
738
738
  throw t.abort(), new Error("URLHandler: Request timed out after ".concat(e.timeout || b, " ms (408)"));
739
- }, e.timeout || b), s = await fetch(a, { ...e, signal: t.signal, credentials: e.withCredentials ? "include" : "omit" }).finally(() => {
739
+ }, e.timeout || b), a = await fetch(i, { ...e, signal: t.signal, credentials: e.withCredentials ? "include" : "omit" }).finally(() => {
740
740
  clearTimeout(r);
741
- }), i = function(o) {
742
- return T.isBrowserEnvironment() && window.location.protocol === "https:" && o.url.includes("http://") ? "URLHandler: Cannot go from HTTPS to HTTP." : o.status === 200 && o.ok ? null : "URLHandler: ".concat(o.statusText, " (").concat(o.status, ")");
743
- }(s);
744
- return i ? { error: new Error(i), statusCode: s.status } : async function(o) {
741
+ }), s = function(o) {
742
+ return f.isBrowserEnvironment() && window.location.protocol === "https:" && o.url.includes("http://") ? "URLHandler: Cannot go from HTTPS to HTTP." : o.status === 200 && o.ok ? null : "URLHandler: ".concat(o.statusText, " (").concat(o.status, ")");
743
+ }(a);
744
+ return s ? { error: new Error(s), statusCode: a.status } : async function(o) {
745
745
  const n = await o.text();
746
746
  let c;
747
- return c = T.isBrowserEnvironment() ? new DOMParser() : new (await import("./index-l-eyvmpL.js").then((u) => u.i)).DOMParser(), { xml: c.parseFromString(n, "text/xml"), details: { byteLength: n.length, statusCode: o.status, rawXml: n } };
748
- }(s);
747
+ return c = f.isBrowserEnvironment() ? new DOMParser() : new (await import("./index6.js").then((u) => u.i)).DOMParser(), { xml: c.parseFromString(n, "text/xml"), details: { byteLength: n.length, statusCode: o.status, rawXml: n } };
748
+ }(a);
749
749
  } catch (t) {
750
750
  return { error: t, statusCode: t.name === "AbortError" ? 408 : null };
751
751
  }
@@ -772,20 +772,20 @@ class le {
772
772
  }
773
773
  async fetchVAST(e) {
774
774
  var t;
775
- let { url: r, maxWrapperDepth: s, emitter: i, wrapperDepth: o = 0, previousUrl: n = null, wrapperAd: c = null } = e;
775
+ let { url: r, maxWrapperDepth: a, emitter: s, wrapperDepth: o = 0, previousUrl: n = null, wrapperAd: c = null } = e;
776
776
  const u = Date.now();
777
777
  this.URLTemplateFilters.forEach((m) => {
778
778
  r = m(r);
779
- }), i("VAST-resolving", { url: r, previousUrl: n, wrapperDepth: o, maxWrapperDepth: s, timeout: this.fetchingOptions.timeout, wrapperAd: c });
779
+ }), s("VAST-resolving", { url: r, previousUrl: n, wrapperDepth: o, maxWrapperDepth: a, timeout: this.fetchingOptions.timeout, wrapperAd: c });
780
780
  const d = await this.urlHandler.get(r, this.fetchingOptions), g = Math.round(Date.now() - u);
781
- if (i("VAST-resolved", { url: r, previousUrl: n, wrapperDepth: o, error: (d == null ? void 0 : d.error) || null, duration: g, statusCode: (d == null ? void 0 : d.statusCode) || null, ...d == null ? void 0 : d.details }), z(d == null || (t = d.details) === null || t === void 0 ? void 0 : t.byteLength, g), d.error) throw new Error(d.error);
781
+ if (s("VAST-resolved", { url: r, previousUrl: n, wrapperDepth: o, error: (d == null ? void 0 : d.error) || null, duration: g, statusCode: (d == null ? void 0 : d.statusCode) || null, ...d == null ? void 0 : d.details }), z(d == null || (t = d.details) === null || t === void 0 ? void 0 : t.byteLength, g), d.error) throw new Error(d.error);
782
782
  return d.xml;
783
783
  }
784
784
  }
785
785
  class ce {
786
786
  constructor() {
787
787
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : new ne();
788
- this.cappingFreeLunch = e, this.cappingMinimumTimeInterval = t, this.fetcher = new le(), this.vastParser = new se({ fetcher: this.fetcher }), this.storage = r, this.lastSuccessfulAd === void 0 && (this.lastSuccessfulAd = 0), this.totalCalls === void 0 && (this.totalCalls = 0), this.totalCallsTimeout === void 0 && (this.totalCallsTimeout = 0);
788
+ this.cappingFreeLunch = e, this.cappingMinimumTimeInterval = t, this.fetcher = new le(), this.vastParser = new ae({ fetcher: this.fetcher }), this.storage = r, this.lastSuccessfulAd === void 0 && (this.lastSuccessfulAd = 0), this.totalCalls === void 0 && (this.totalCalls = 0), this.totalCallsTimeout === void 0 && (this.totalCallsTimeout = 0);
789
789
  }
790
790
  addURLTemplateFilter(e) {
791
791
  this.fetcher.addURLTemplateFilter(e);
@@ -833,28 +833,28 @@ class ce {
833
833
  get(e) {
834
834
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
835
835
  const r = Date.now();
836
- return t.hasOwnProperty("resolveAll") || (t.resolveAll = !1), this.totalCallsTimeout < r ? (this.totalCalls = 1, this.totalCallsTimeout = r + 36e5) : this.totalCalls++, new Promise((s, i) => {
837
- if (this.cappingFreeLunch >= this.totalCalls) return i(new Error("VAST call canceled – FreeLunch capping not reached yet ".concat(this.totalCalls, "/").concat(this.cappingFreeLunch)));
836
+ return t.hasOwnProperty("resolveAll") || (t.resolveAll = !1), this.totalCallsTimeout < r ? (this.totalCalls = 1, this.totalCallsTimeout = r + 36e5) : this.totalCalls++, new Promise((a, s) => {
837
+ if (this.cappingFreeLunch >= this.totalCalls) return s(new Error("VAST call canceled – FreeLunch capping not reached yet ".concat(this.totalCalls, "/").concat(this.cappingFreeLunch)));
838
838
  const o = r - this.lastSuccessfulAd;
839
839
  if (o < 0) this.lastSuccessfulAd = 0;
840
- else if (o < this.cappingMinimumTimeInterval) return i(new Error("VAST call canceled – (".concat(this.cappingMinimumTimeInterval, ")ms minimum interval reached")));
840
+ else if (o < this.cappingMinimumTimeInterval) return s(new Error("VAST call canceled – (".concat(this.cappingMinimumTimeInterval, ")ms minimum interval reached")));
841
841
  this.vastParser.initParsingStatus(t), this.fetcher.setOptions(t), this.vastParser.rootURL = e, this.fetcher.fetchVAST({ url: e, emitter: this.vastParser.emit.bind(this.vastParser), maxWrapperDepth: this.vastParser.maxWrapperDepth }).then((n) => (t.previousUrl = e, t.isRootVAST = !0, t.url = e, this.vastParser.parse(n, t).then((c) => {
842
842
  const u = this.vastParser.buildVASTResponse(c);
843
- s(u);
844
- }))).catch((n) => i(n));
843
+ a(u);
844
+ }))).catch((n) => s(n));
845
845
  });
846
846
  }
847
847
  }
848
848
  class ue extends _ {
849
849
  constructor(e, t, r) {
850
- var s;
851
- let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null, o = arguments.length > 4 && arguments[4] !== void 0 && arguments[4];
852
- super(), this.ad = t, this.creative = r, this.variation = i, this.muted = o, this.impressed = !1, this.skippable = !1, this.trackingEvents = {}, this.trackedProgressEvents = [], this.lastPercentage = 0, this._alreadyTriggeredQuartiles = {}, this.emitAlwaysEvents = ["creativeView", "start", "firstQuartile", "midpoint", "thirdQuartile", "complete", "resume", "pause", "rewind", "skip", "closeLinear", "close"];
850
+ var a;
851
+ let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null, o = arguments.length > 4 && arguments[4] !== void 0 && arguments[4];
852
+ super(), this.ad = t, this.creative = r, this.variation = s, this.muted = o, this.impressed = !1, this.skippable = !1, this.trackingEvents = {}, this.trackedProgressEvents = [], this.lastPercentage = 0, this._alreadyTriggeredQuartiles = {}, this.emitAlwaysEvents = ["creativeView", "start", "firstQuartile", "midpoint", "thirdQuartile", "complete", "resume", "pause", "rewind", "skip", "closeLinear", "close"];
853
853
  for (const n in this.creative.trackingEvents) {
854
854
  const c = this.creative.trackingEvents[n];
855
855
  this.trackingEvents[n] = c.slice(0);
856
856
  }
857
- this.viewableImpressionTrackers = ((s = this.ad.viewableImpression) === null || s === void 0 ? void 0 : s.reduce((n, c) => (n.notViewable.push(...c.notViewable), n.viewUndetermined.push(...c.viewUndetermined), n.viewable.push(...c.viewable), n), { notViewable: [], viewUndetermined: [], viewable: [] })) || {}, Object.entries(this.viewableImpressionTrackers).forEach((n) => {
857
+ this.viewableImpressionTrackers = ((a = this.ad.viewableImpression) === null || a === void 0 ? void 0 : a.reduce((n, c) => (n.notViewable.push(...c.notViewable), n.viewUndetermined.push(...c.viewUndetermined), n.viewable.push(...c.viewable), n), { notViewable: [], viewUndetermined: [], viewable: [] })) || {}, Object.entries(this.viewableImpressionTrackers).forEach((n) => {
858
858
  let [c, u] = n;
859
859
  u.length && (this.trackingEvents[c] = u);
860
860
  }), function(n) {
@@ -878,20 +878,20 @@ class ue extends _ {
878
878
  }
879
879
  }
880
880
  setDuration(e) {
881
- T.isValidTimeValue(e) ? (this.assetDuration = e, this.quartiles = { firstQuartile: Math.round(25 * this.assetDuration) / 100, midpoint: Math.round(50 * this.assetDuration) / 100, thirdQuartile: Math.round(75 * this.assetDuration) / 100 }) : this.emit("TRACKER-error", { message: "the duration provided is not valid. duration: ".concat(e) });
881
+ f.isValidTimeValue(e) ? (this.assetDuration = e, this.quartiles = { firstQuartile: Math.round(25 * this.assetDuration) / 100, midpoint: Math.round(50 * this.assetDuration) / 100, thirdQuartile: Math.round(75 * this.assetDuration) / 100 }) : this.emit("TRACKER-error", { message: "the duration provided is not valid. duration: ".concat(e) });
882
882
  }
883
883
  setProgress(e) {
884
884
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = !(arguments.length > 2 && arguments[2] !== void 0) || arguments[2];
885
- if (!T.isValidTimeValue(e) || typeof t != "object") return void this.emit("TRACKER-error", { message: "One given setProgress parameter has the wrong type. progress: ".concat(e, ", macros: ").concat(T.formatMacrosValues(t)) });
886
- const s = this.skipDelay || -1;
887
- if (s === -1 || this.skippable || (s > e ? this.emit("skip-countdown", s - e) : (this.skippable = !0, this.emit("skip-countdown", 0))), this.assetDuration > 0) {
888
- const i = Math.round(e / this.assetDuration * 100), o = [];
885
+ if (!f.isValidTimeValue(e) || typeof t != "object") return void this.emit("TRACKER-error", { message: "One given setProgress parameter has the wrong type. progress: ".concat(e, ", macros: ").concat(f.formatMacrosValues(t)) });
886
+ const a = this.skipDelay || -1;
887
+ if (a === -1 || this.skippable || (a > e ? this.emit("skip-countdown", a - e) : (this.skippable = !0, this.emit("skip-countdown", 0))), this.assetDuration > 0) {
888
+ const s = Math.round(e / this.assetDuration * 100), o = [];
889
889
  if (e > 0) {
890
890
  o.push("start");
891
- for (let n = this.lastPercentage; n < i; n++) o.push("progress-".concat(n + 1, "%"));
891
+ for (let n = this.lastPercentage; n < s; n++) o.push("progress-".concat(n + 1, "%"));
892
892
  o.push("progress-".concat(e));
893
893
  for (const n in this.quartiles) this.isQuartileReached(n, this.quartiles[n], e) && (o.push(n), this._alreadyTriggeredQuartiles[n] = !0);
894
- this.lastPercentage = i;
894
+ this.lastPercentage = s;
895
895
  }
896
896
  o.forEach((n) => {
897
897
  this.track(n, { macros: t, once: r });
@@ -900,27 +900,27 @@ class ue extends _ {
900
900
  this.progress = e;
901
901
  }
902
902
  isQuartileReached(e, t, r) {
903
- let s = !1;
904
- return t <= r && !this._alreadyTriggeredQuartiles[e] && (s = !0), s;
903
+ let a = !1;
904
+ return t <= r && !this._alreadyTriggeredQuartiles[e] && (a = !0), a;
905
905
  }
906
906
  setMuted(e) {
907
907
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
908
- typeof e == "boolean" && typeof t == "object" ? (this.muted !== e && this.track(e ? "mute" : "unmute", { macros: t }), this.muted = e) : this.emit("TRACKER-error", { message: "One given setMuted parameter has the wrong type. muted: ".concat(e, ", macros: ").concat(T.formatMacrosValues(t)) });
908
+ typeof e == "boolean" && typeof t == "object" ? (this.muted !== e && this.track(e ? "mute" : "unmute", { macros: t }), this.muted = e) : this.emit("TRACKER-error", { message: "One given setMuted parameter has the wrong type. muted: ".concat(e, ", macros: ").concat(f.formatMacrosValues(t)) });
909
909
  }
910
910
  setPaused(e) {
911
911
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
912
- typeof e == "boolean" && typeof t == "object" ? (this.paused !== e && this.track(e ? "pause" : "resume", { macros: t }), this.paused = e) : this.emit("TRACKER-error", { message: "One given setPaused parameter has the wrong type. paused: ".concat(e, ", macros: ").concat(T.formatMacrosValues(t)) });
912
+ typeof e == "boolean" && typeof t == "object" ? (this.paused !== e && this.track(e ? "pause" : "resume", { macros: t }), this.paused = e) : this.emit("TRACKER-error", { message: "One given setPaused parameter has the wrong type. paused: ".concat(e, ", macros: ").concat(f.formatMacrosValues(t)) });
913
913
  }
914
914
  setFullscreen(e) {
915
915
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
916
- typeof e == "boolean" && typeof t == "object" ? (this.fullscreen !== e && this.track(e ? "fullscreen" : "exitFullscreen", { macros: t }), this.fullscreen = e) : this.emit("TRACKER-error", { message: "One given setFullScreen parameter has the wrong type. fullscreen: ".concat(e, ", macros: ").concat(T.formatMacrosValues(t)) });
916
+ typeof e == "boolean" && typeof t == "object" ? (this.fullscreen !== e && this.track(e ? "fullscreen" : "exitFullscreen", { macros: t }), this.fullscreen = e) : this.emit("TRACKER-error", { message: "One given setFullScreen parameter has the wrong type. fullscreen: ".concat(e, ", macros: ").concat(f.formatMacrosValues(t)) });
917
917
  }
918
918
  setExpand(e) {
919
919
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
920
- typeof e == "boolean" && typeof t == "object" ? (this.expanded !== e && (this.track(e ? "expand" : "collapse", { macros: t }), this.track(e ? "playerExpand" : "playerCollapse", { macros: t })), this.expanded = e) : this.emit("TRACKER-error", { message: "One given setExpand parameter has the wrong type. expanded: ".concat(e, ", macros: ").concat(T.formatMacrosValues(t)) });
920
+ typeof e == "boolean" && typeof t == "object" ? (this.expanded !== e && (this.track(e ? "expand" : "collapse", { macros: t }), this.track(e ? "playerExpand" : "playerCollapse", { macros: t })), this.expanded = e) : this.emit("TRACKER-error", { message: "One given setExpand parameter has the wrong type. expanded: ".concat(e, ", macros: ").concat(f.formatMacrosValues(t)) });
921
921
  }
922
922
  setSkipDelay(e) {
923
- T.isValidTimeValue(e) ? this.skipDelay = e : this.emit("TRACKER-error", { message: "setSkipDelay parameter does not have a valid value. duration: ".concat(e) });
923
+ f.isValidTimeValue(e) ? this.skipDelay = e : this.emit("TRACKER-error", { message: "setSkipDelay parameter does not have a valid value. duration: ".concat(e) });
924
924
  }
925
925
  trackImpression() {
926
926
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
@@ -940,7 +940,7 @@ class ue extends _ {
940
940
  }
941
941
  error() {
942
942
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
943
- typeof e == "object" && typeof t == "boolean" ? this.trackURLs(this.ad.errorURLTemplates, e, { isCustomCode: t }) : this.emit("TRACKER-error", { message: "One given error parameter has the wrong type. macros: ".concat(T.formatMacrosValues(e), ", isCustomCode: ").concat(t) });
943
+ typeof e == "object" && typeof t == "boolean" ? this.trackURLs(this.ad.errorURLTemplates, e, { isCustomCode: t }) : this.emit("TRACKER-error", { message: "One given error parameter has the wrong type. macros: ".concat(f.formatMacrosValues(e), ", isCustomCode: ").concat(t) });
944
944
  }
945
945
  errorWithCode(e) {
946
946
  let t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
@@ -976,20 +976,20 @@ class ue extends _ {
976
976
  }
977
977
  verificationNotExecuted(e) {
978
978
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
979
- if (typeof e != "string" || typeof t != "object") return void this.emit("TRACKER-error", { message: "One given verificationNotExecuted parameter has to wrong type. vendor: ".concat(e, ", macros: ").concat(T.formatMacrosValues(t)) });
979
+ if (typeof e != "string" || typeof t != "object") return void this.emit("TRACKER-error", { message: "One given verificationNotExecuted parameter has to wrong type. vendor: ".concat(e, ", macros: ").concat(f.formatMacrosValues(t)) });
980
980
  if (!this.ad || !this.ad.adVerifications || !this.ad.adVerifications.length) throw new Error("No adVerifications provided");
981
981
  if (!e) throw new Error("No vendor provided, unable to find associated verificationNotExecuted");
982
- const r = this.ad.adVerifications.find((i) => i.vendor === e);
982
+ const r = this.ad.adVerifications.find((s) => s.vendor === e);
983
983
  if (!r) throw new Error("No associated verification element found for vendor: ".concat(e));
984
- const s = r.trackingEvents;
985
- if (s && s.verificationNotExecuted) {
986
- const i = s.verificationNotExecuted;
987
- this.trackURLs(i, t), this.emit("verificationNotExecuted", { trackingURLTemplates: i });
984
+ const a = r.trackingEvents;
985
+ if (a && a.verificationNotExecuted) {
986
+ const s = a.verificationNotExecuted;
987
+ this.trackURLs(s, t), this.emit("verificationNotExecuted", { trackingURLTemplates: s });
988
988
  }
989
989
  }
990
990
  overlayViewDuration(e) {
991
991
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
992
- typeof e == "string" && typeof t == "object" ? (t.ADPLAYHEAD = e, this.track("overlayViewDuration", { macros: t })) : this.emit("TRACKER-error", { message: "One given overlayViewDuration parameters has the wrong type. formattedDuration: ".concat(e, ", macros: ").concat(T.formatMacrosValues(t)) });
992
+ typeof e == "string" && typeof t == "object" ? (t.ADPLAYHEAD = e, this.track("overlayViewDuration", { macros: t })) : this.emit("TRACKER-error", { message: "One given overlayViewDuration parameters has the wrong type. formattedDuration: ".concat(e, ", macros: ").concat(f.formatMacrosValues(t)) });
993
993
  }
994
994
  close() {
995
995
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
@@ -1005,28 +1005,28 @@ class ue extends _ {
1005
1005
  }
1006
1006
  click() {
1007
1007
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1008
- if (e !== null && typeof e != "string" || typeof t != "object") return void this.emit("TRACKER-error", { message: "One given click parameter has the wrong type. fallbackClickThroughURL: ".concat(e, ", macros: ").concat(T.formatMacrosValues(t)) });
1008
+ if (e !== null && typeof e != "string" || typeof t != "object") return void this.emit("TRACKER-error", { message: "One given click parameter has the wrong type. fallbackClickThroughURL: ".concat(e, ", macros: ").concat(f.formatMacrosValues(t)) });
1009
1009
  this.clickTrackingURLTemplates && this.clickTrackingURLTemplates.length && this.trackURLs(this.clickTrackingURLTemplates, t);
1010
- const r = this.clickThroughURLTemplate || e, s = { ...t };
1010
+ const r = this.clickThroughURLTemplate || e, a = { ...t };
1011
1011
  if (r) {
1012
- this.progress && (s.ADPLAYHEAD = this.progressFormatted());
1013
- const i = T.resolveURLTemplates([r], s)[0];
1014
- this.emit("clickthrough", i);
1012
+ this.progress && (a.ADPLAYHEAD = this.progressFormatted());
1013
+ const s = f.resolveURLTemplates([r], a)[0];
1014
+ this.emit("clickthrough", s);
1015
1015
  }
1016
1016
  }
1017
1017
  trackProgressEvents(e, t, r) {
1018
- const s = parseFloat(e.split("-")[1]);
1019
- Object.entries(this.trackingEvents).filter((i) => {
1020
- let [o] = i;
1018
+ const a = parseFloat(e.split("-")[1]);
1019
+ Object.entries(this.trackingEvents).filter((s) => {
1020
+ let [o] = s;
1021
1021
  return o.startsWith("progress-");
1022
- }).map((i) => {
1023
- let [o, n] = i;
1022
+ }).map((s) => {
1023
+ let [o, n] = s;
1024
1024
  return { name: o, time: parseFloat(o.split("-")[1]), urls: n };
1025
- }).filter((i) => {
1026
- let { time: o } = i;
1027
- return o <= s && o > this.progress;
1028
- }).forEach((i) => {
1029
- let { name: o, urls: n } = i;
1025
+ }).filter((s) => {
1026
+ let { time: o } = s;
1027
+ return o <= a && o > this.progress;
1028
+ }).forEach((s) => {
1029
+ let { name: o, urls: n } = s;
1030
1030
  !r && this.trackedProgressEvents.includes(o) || (this.emit(o, { trackingURLTemplates: n }), this.trackURLs(n, t), r ? delete this.trackingEvents[o] : this.trackedProgressEvents.push(o));
1031
1031
  });
1032
1032
  }
@@ -1034,27 +1034,27 @@ class ue extends _ {
1034
1034
  let { macros: t = {}, once: r = !1 } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1035
1035
  if (typeof t != "object") return void this.emit("TRACKER-error", { message: "track given macros has the wrong type. macros: ".concat(t) });
1036
1036
  e === "closeLinear" && !this.trackingEvents[e] && this.trackingEvents.close && (e = "close"), e.startsWith("progress-") && !e.endsWith("%") && this.trackProgressEvents(e, t, r);
1037
- const s = this.trackingEvents[e], i = this.emitAlwaysEvents.indexOf(e) > -1;
1038
- s ? (this.emit(e, { trackingURLTemplates: s }), this.trackURLs(s, t)) : i && this.emit(e, null), r && (delete this.trackingEvents[e], i && this.emitAlwaysEvents.splice(this.emitAlwaysEvents.indexOf(e), 1));
1037
+ const a = this.trackingEvents[e], s = this.emitAlwaysEvents.indexOf(e) > -1;
1038
+ a ? (this.emit(e, { trackingURLTemplates: a }), this.trackURLs(a, t)) : s && this.emit(e, null), r && (delete this.trackingEvents[e], s && this.emitAlwaysEvents.splice(this.emitAlwaysEvents.indexOf(e), 1));
1039
1039
  }
1040
1040
  trackURLs(e) {
1041
1041
  var t;
1042
- let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1043
- const { validUrls: i, invalidUrls: o } = T.filterUrlTemplates(e);
1042
+ let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1043
+ const { validUrls: s, invalidUrls: o } = f.filterUrlTemplates(e);
1044
1044
  o.length && this.emit("TRACKER-error", { message: "Provided urls are malformed. url: ".concat(o) });
1045
1045
  const n = { ...r };
1046
- this.linear && (this.creative && this.creative.mediaFiles && this.creative.mediaFiles[0] && this.creative.mediaFiles[0].fileURL && (n.ASSETURI = this.creative.mediaFiles[0].fileURL), this.progress && (n.ADPLAYHEAD = this.progressFormatted())), (t = this.creative) !== null && t !== void 0 && (t = t.universalAdIds) !== null && t !== void 0 && t.length && (n.UNIVERSALADID = this.creative.universalAdIds.map((c) => c.idRegistry.concat(" ", c.value)).join(",")), this.ad && (this.ad.sequence && (n.PODSEQUENCE = this.ad.sequence), this.ad.adType && (n.ADTYPE = this.ad.adType), this.ad.adServingId && (n.ADSERVINGID = this.ad.adServingId), this.ad.categories && this.ad.categories.length && (n.ADCATEGORIES = this.ad.categories.map((c) => c.value).join(",")), this.ad.blockedAdCategories && this.ad.blockedAdCategories.length && (n.BLOCKEDADCATEGORIES = this.ad.blockedAdCategories.map((c) => c.value).join(","))), T.track(i, n, s);
1046
+ this.linear && (this.creative && this.creative.mediaFiles && this.creative.mediaFiles[0] && this.creative.mediaFiles[0].fileURL && (n.ASSETURI = this.creative.mediaFiles[0].fileURL), this.progress && (n.ADPLAYHEAD = this.progressFormatted())), (t = this.creative) !== null && t !== void 0 && (t = t.universalAdIds) !== null && t !== void 0 && t.length && (n.UNIVERSALADID = this.creative.universalAdIds.map((c) => c.idRegistry.concat(" ", c.value)).join(",")), this.ad && (this.ad.sequence && (n.PODSEQUENCE = this.ad.sequence), this.ad.adType && (n.ADTYPE = this.ad.adType), this.ad.adServingId && (n.ADSERVINGID = this.ad.adServingId), this.ad.categories && this.ad.categories.length && (n.ADCATEGORIES = this.ad.categories.map((c) => c.value).join(",")), this.ad.blockedAdCategories && this.ad.blockedAdCategories.length && (n.BLOCKEDADCATEGORIES = this.ad.blockedAdCategories.map((c) => c.value).join(","))), f.track(s, n, a);
1047
1047
  }
1048
1048
  convertToTimecode(e) {
1049
- if (!T.isValidTimeValue(e)) return "";
1050
- const t = 1e3 * e, r = Math.floor(t / 36e5), s = Math.floor(t / 6e4 % 60), i = Math.floor(t / 1e3 % 60), o = Math.floor(t % 1e3);
1051
- return "".concat(T.addLeadingZeros(r, 2), ":").concat(T.addLeadingZeros(s, 2), ":").concat(T.addLeadingZeros(i, 2), ".").concat(T.addLeadingZeros(o, 3));
1049
+ if (!f.isValidTimeValue(e)) return "";
1050
+ const t = 1e3 * e, r = Math.floor(t / 36e5), a = Math.floor(t / 6e4 % 60), s = Math.floor(t / 1e3 % 60), o = Math.floor(t % 1e3);
1051
+ return "".concat(f.addLeadingZeros(r, 2), ":").concat(f.addLeadingZeros(a, 2), ":").concat(f.addLeadingZeros(s, 2), ".").concat(f.addLeadingZeros(o, 3));
1052
1052
  }
1053
1053
  progressFormatted() {
1054
1054
  return this.convertToTimecode(this.progress);
1055
1055
  }
1056
1056
  }
1057
1057
  export {
1058
- ce as c,
1059
- ue as u
1058
+ ce as _,
1059
+ ue as z
1060
1060
  };