@streamlayer/react 1.24.7 → 1.24.8

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.
@@ -135,7 +135,6 @@ var jsxRuntime = require('react/jsx-runtime');
135
135
  var e$2 = require('react');
136
136
  require('core-js/modules/es.reflect.construct.js');
137
137
  require('core-js/modules/es.string.replace-all.js');
138
- require('@storybook/blocks');
139
138
  require('core-js/modules/es.symbol.async-iterator.js');
140
139
  require('core-js/modules/es.symbol.has-instance.js');
141
140
  require('core-js/modules/es.aggregate-error.js');
@@ -746,7 +745,7 @@ function M$1(e, t, n) {
746
745
  r.has(c) && n(o, a, c);
747
746
  });
748
747
  }
749
- var B$1 = function B() {
748
+ var B$2 = function B() {
750
749
  var t = Array.prototype.slice.call(arguments).filter(Boolean),
751
750
  n = {},
752
751
  r = [];
@@ -764,16 +763,16 @@ var B$1 = function B() {
764
763
  for (var a in n) Object.prototype.hasOwnProperty.call(n, a) && o.push(n[a]);
765
764
  return o.push.apply(o, r), o.join(" ");
766
765
  },
767
- T$1 = B$1;
766
+ T$1 = B$2;
768
767
  function D$2(e) {
769
768
  var t = /* @__PURE__ */Object.create(null);
770
769
  return function (n) {
771
770
  return t[n] === void 0 && (t[n] = e(n)), t[n];
772
771
  };
773
772
  }
774
- var H$3 = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,
773
+ var H$4 = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,
775
774
  x$2 = /* @__PURE__ */D$2(function (e) {
776
- return H$3.test(e) || e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && e.charCodeAt(2) < 91;
775
+ return H$4.test(e) || e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && e.charCodeAt(2) < 91;
777
776
  }
778
777
  /* Z+1 */),
779
778
  j$3 = function j(e) {
@@ -850,10 +849,10 @@ var ne = F$2,
850
849
  exports: {}
851
850
  },
852
851
  k$2 = {};
853
- var R$2;
852
+ var R$1;
854
853
  function G$2() {
855
- if (R$2) return k$2;
856
- R$2 = 1;
854
+ if (R$1) return k$2;
855
+ R$1 = 1;
857
856
  var e = e__namespace.default;
858
857
  function t(s, i) {
859
858
  return s === i && (s !== 0 || 1 / s === 1 / i) || s !== s && i !== i;
@@ -1007,10 +1006,10 @@ var P$2;
1007
1006
  e.ORGANIZATION = "ORGANIZATION", e.STREAM = "STREAM";
1008
1007
  })(P$2 || (P$2 = {}));
1009
1008
  be$2.BETTING + "", be$2.GAMES + "", be$2.PUBLIC_CHAT + "", be$2.TWITTER + "";
1010
- var L$2;
1009
+ var L$1;
1011
1010
  (function (e) {
1012
1011
  e.Ready = "ready", e.Suspended = "suspended";
1013
- })(L$2 || (L$2 = {}));
1012
+ })(L$1 || (L$1 = {}));
1014
1013
 
1015
1014
  var r$2 = "ttkj0ah";
1016
1015
 
@@ -4456,7 +4455,7 @@ var a = function a(C) {
4456
4455
  fill: "white"
4457
4456
  }));
4458
4457
  },
4459
- L$1 = function L(C) {
4458
+ L = function L(C) {
4460
4459
  return /* @__PURE__ */e__namespace.createElement("svg", _objectSpread2({
4461
4460
  width: 48,
4462
4461
  height: 48,
@@ -4646,7 +4645,7 @@ var a = function a(C) {
4646
4645
  fill: "white"
4647
4646
  })));
4648
4647
  },
4649
- H$2 = function H(C) {
4648
+ H$3 = function H(C) {
4650
4649
  return /* @__PURE__ */e__namespace.createElement("svg", _objectSpread2({
4651
4650
  width: 16,
4652
4651
  height: 17,
@@ -4785,7 +4784,7 @@ var a = function a(C) {
4785
4784
  fill: "#107D57"
4786
4785
  }));
4787
4786
  },
4788
- B = function B(C) {
4787
+ B$1 = function B(C) {
4789
4788
  return /* @__PURE__ */e__namespace.createElement("svg", _objectSpread2({
4790
4789
  width: 35,
4791
4790
  height: 35,
@@ -4800,7 +4799,7 @@ var a = function a(C) {
4800
4799
  fill: "white"
4801
4800
  })));
4802
4801
  },
4803
- R$1 = function R(C) {
4802
+ R = function R(C) {
4804
4803
  return /* @__PURE__ */e__namespace.createElement("svg", _objectSpread2({
4805
4804
  width: 40,
4806
4805
  height: 40,
@@ -6099,21 +6098,21 @@ var a = function a(C) {
6099
6098
  "icon-invite-arrow": _$1,
6100
6099
  "icon-friends": W$1,
6101
6100
  "icon-exit": F$1,
6102
- "icon-default-user-avatar": R$1,
6101
+ "icon-default-user-avatar": R,
6103
6102
  "icon-copy": k$1,
6104
6103
  "icon-cross": w,
6105
6104
  "icon-close": x$1,
6106
6105
  "icon-close-btn-white": y,
6107
6106
  "icon-close-btn-gray": Z$1,
6108
6107
  "icon-circle-arrow-right": M,
6109
- "icon-chevron": H$2,
6108
+ "icon-chevron": H$3,
6110
6109
  "icon-chevron-white-left": E,
6111
6110
  "icon-chevron-left": V$2,
6112
6111
  "icon-check": c,
6113
6112
  "icon-check-white": v,
6114
6113
  "icon-check-green": g$1,
6115
6114
  "icon-check-circle": m$1,
6116
- "icon-correct": L$1,
6115
+ "icon-correct": L,
6117
6116
  "icon-btn-channels": n1$1,
6118
6117
  "icon-btn-feature-groups": o1$1,
6119
6118
  "icon-btn-leaderboard": r1$1,
@@ -6121,7 +6120,7 @@ var a = function a(C) {
6121
6120
  "icon-twitter-verified": Q,
6122
6121
  "icon-trophy-bet-pack": J$2,
6123
6122
  "icon-trivia-transparent": q$1,
6124
- dashboard: B,
6123
+ dashboard: B$1,
6125
6124
  iconMute: S,
6126
6125
  iconUnMute: X$1,
6127
6126
  correct: c1$1,
@@ -6146,7 +6145,7 @@ var a = function a(C) {
6146
6145
  loader: t1$1,
6147
6146
  fgIcon: s
6148
6147
  },
6149
- H1$1 = function H1(_ref) {
6148
+ E1$1 = function E1(_ref) {
6150
6149
  var C = _ref.name,
6151
6150
  i = _ref.style,
6152
6151
  n = _ref.className,
@@ -6295,7 +6294,7 @@ function Te$1(t, e) {
6295
6294
  };
6296
6295
  }
6297
6296
  var U = (typeof window === "undefined" ? "undefined" : _typeof(window)) > "u" ? e$2.useEffect : e$2.useLayoutEffect,
6298
- j$1 = function j(_ref6) {
6297
+ H$2 = function H(_ref6) {
6299
6298
  var t = _ref6.isPlaying,
6300
6299
  e = _ref6.duration,
6301
6300
  _ref6$startAt = _ref6.startAt,
@@ -6323,10 +6322,10 @@ var U = (typeof window === "undefined" ? "undefined" : _typeof(window)) > "u" ?
6323
6322
  var F = u - o.current,
6324
6323
  C = T.current + F;
6325
6324
  o.current = u, T.current = C;
6326
- var O = R.current + (n === 0 ? C : (C / n | 0) * n),
6325
+ var B = R.current + (n === 0 ? C : (C / n | 0) * n),
6327
6326
  D = R.current + C,
6328
6327
  g = typeof e == "number" && D >= e;
6329
- l(g ? e : O), g || (_.current = requestAnimationFrame(_m));
6328
+ l(g ? e : B), g || (_.current = requestAnimationFrame(_m));
6330
6329
  },
6331
6330
  I = function I() {
6332
6331
  _.current && cancelAnimationFrame(_.current), c.current && clearTimeout(c.current), o.current = null;
@@ -6356,7 +6355,7 @@ var U = (typeof window === "undefined" ? "undefined" : _typeof(window)) > "u" ?
6356
6355
  reset: N
6357
6356
  };
6358
6357
  },
6359
- z$1 = function z(t, e, i) {
6358
+ j$1 = function j(t, e, i) {
6360
6359
  var n = t / 2,
6361
6360
  r = e / 2,
6362
6361
  a = n - r,
@@ -6371,7 +6370,7 @@ var U = (typeof window === "undefined" ? "undefined" : _typeof(window)) > "u" ?
6371
6370
  G = function G(t, e) {
6372
6371
  return t === 0 || t === e ? 0 : typeof e == "number" ? t - e : 0;
6373
6372
  },
6374
- H$1 = function H(t) {
6373
+ z$1 = function z(t) {
6375
6374
  return {
6376
6375
  position: "relative",
6377
6376
  width: t,
@@ -6441,10 +6440,10 @@ var U = (typeof window === "undefined" ? "undefined" : _typeof(window)) > "u" ?
6441
6440
  _ = t.onUpdate,
6442
6441
  o = e$2.useRef(),
6443
6442
  c = Math.max(a, E !== null && E !== void 0 ? E : 0),
6444
- _z = z$1(r, c, R),
6445
- m = _z.path,
6446
- I = _z.pathLength,
6447
- _j = j$1({
6443
+ _j = j$1(r, c, R),
6444
+ m = _j.path,
6445
+ I = _j.pathLength,
6446
+ _H = H$2({
6448
6447
  isPlaying: l,
6449
6448
  duration: e,
6450
6449
  startAt: G(e, i),
@@ -6457,16 +6456,16 @@ var U = (typeof window === "undefined" ? "undefined" : _typeof(window)) > "u" ?
6457
6456
  var F;
6458
6457
  var _ref8 = (F = s(u)) != null ? F : {},
6459
6458
  C = _ref8.shouldRepeat,
6460
- O = _ref8.delay,
6459
+ B = _ref8.delay,
6461
6460
  D = _ref8.newInitialRemainingTime;
6462
6461
  if (C) return {
6463
6462
  shouldRepeat: C,
6464
- delay: O,
6463
+ delay: B,
6465
6464
  newStartAt: G(e, D)
6466
6465
  };
6467
6466
  } : void 0
6468
6467
  }),
6469
- N = _j.elapsedTime,
6468
+ N = _H.elapsedTime,
6470
6469
  f = e - N;
6471
6470
  return {
6472
6471
  elapsedTime: N,
@@ -6495,7 +6494,7 @@ var U = (typeof window === "undefined" ? "undefined" : _typeof(window)) > "u" ?
6495
6494
  _ = _Z.size,
6496
6495
  o = _Z.strokeWidth;
6497
6496
  return e__namespace.default.createElement("div", {
6498
- style: H$1(_)
6497
+ style: z$1(_)
6499
6498
  }, e__namespace.default.createElement("svg", {
6500
6499
  viewBox: "0 0 ".concat(_, " ").concat(_),
6501
6500
  width: _,
@@ -6562,7 +6561,7 @@ var re = /* @__PURE__ */ne("div")({
6562
6561
  height: t,
6563
6562
  width: e
6564
6563
  },
6565
- children: /* @__PURE__ */jsxRuntime.jsx(H1$1, {
6564
+ children: /* @__PURE__ */jsxRuntime.jsx(E1$1, {
6566
6565
  name: "loader"
6567
6566
  })
6568
6567
  });
@@ -6643,7 +6642,7 @@ var me = /* @__PURE__ */ne("div")({
6643
6642
  propsAsIs: false
6644
6643
  }),
6645
6644
  ye = function ye() {
6646
- return H1$1;
6645
+ return E1$1;
6647
6646
  },
6648
6647
  ge$1 = /* @__PURE__ */ne(ye())({
6649
6648
  name: "Icon",
@@ -6708,7 +6707,7 @@ var me = /* @__PURE__ */ne("div")({
6708
6707
  class: "p12ow7zo",
6709
6708
  propsAsIs: false
6710
6709
  }),
6711
- R = /* @__PURE__ */ne("div")({
6710
+ H$1 = /* @__PURE__ */ne("div")({
6712
6711
  name: "Control",
6713
6712
  class: "cdpal9o",
6714
6713
  propsAsIs: false
@@ -6757,13 +6756,13 @@ var me = /* @__PURE__ */ne("div")({
6757
6756
  Ee = function Ee() {
6758
6757
  return Y;
6759
6758
  },
6760
- L = /* @__PURE__ */ne(Ee())({
6759
+ B = /* @__PURE__ */ne(Ee())({
6761
6760
  name: "WebOSIconButtonAnimation",
6762
6761
  class: "wdlqvum",
6763
6762
  propsAsIs: true
6764
6763
  }),
6765
6764
  Ne = function Ne() {
6766
- return L;
6765
+ return B;
6767
6766
  },
6768
6767
  Oe$1 = /* @__PURE__ */ne(Ne())({
6769
6768
  name: "WebOSIconButtonPlay",
@@ -6771,30 +6770,30 @@ var me = /* @__PURE__ */ne("div")({
6771
6770
  propsAsIs: true
6772
6771
  }),
6773
6772
  Se$1 = function Se() {
6774
- return L;
6773
+ return B;
6775
6774
  },
6776
6775
  We$1 = /* @__PURE__ */ne(Se$1())({
6777
6776
  name: "WebOSIconButtonPause",
6778
6777
  class: "w1iylt55",
6779
6778
  propsAsIs: true
6780
6779
  }),
6781
- Be = function Be() {
6782
- return L;
6780
+ Re = function Re() {
6781
+ return B;
6783
6782
  },
6784
- Re = /* @__PURE__ */ne(Be())({
6783
+ He = /* @__PURE__ */ne(Re())({
6785
6784
  name: "WebOSIconButtonMute",
6786
6785
  class: "w8h4h7",
6787
6786
  propsAsIs: true
6788
6787
  }),
6789
6788
  Te = function Te() {
6790
- return L;
6789
+ return B;
6791
6790
  },
6792
- Le = /* @__PURE__ */ne(Te())({
6791
+ Be = /* @__PURE__ */ne(Te())({
6793
6792
  name: "WebOSIconButtonUnmute",
6794
6793
  class: "w12l12kt",
6795
6794
  propsAsIs: true
6796
6795
  }),
6797
- Ue$1 = function Ue(t) {
6796
+ Le = function Le(t) {
6798
6797
  var _iterator = _createForOfIteratorHelper(t),
6799
6798
  _step;
6800
6799
  try {
@@ -6808,17 +6807,17 @@ var me = /* @__PURE__ */ne("div")({
6808
6807
  _iterator.f();
6809
6808
  }
6810
6809
  },
6811
- ee$1 = new IntersectionObserver(Ue$1, {
6810
+ ee$1 = new IntersectionObserver(Le, {
6812
6811
  threshold: 0.5
6813
6812
  }),
6814
6813
  F = /* @__PURE__ */new Set(),
6815
- je = function je(t) {
6814
+ Ue$1 = function Ue(t) {
6816
6815
  ee$1.observe(t), F.add(t);
6817
6816
  },
6818
- ze = function ze(t) {
6817
+ je = function je(t) {
6819
6818
  ee$1.unobserve(t), F.delete(t);
6820
6819
  },
6821
- He = function He() {
6820
+ ze = function ze() {
6822
6821
  var _iterator2 = _createForOfIteratorHelper(F),
6823
6822
  _step2;
6824
6823
  try {
@@ -6857,10 +6856,10 @@ var $e = Te$1(he$1),
6857
6856
  c = _ref2.unmute,
6858
6857
  d = _ref2.mute,
6859
6858
  p = _ref2.togglePlaying;
6860
- return !t && !a && !o ? /* @__PURE__ */jsxRuntime.jsx(R, {
6861
- children: l ? /* @__PURE__ */jsxRuntime.jsx(H1$1, {
6859
+ return !t && !a && !o ? /* @__PURE__ */jsxRuntime.jsx(H$1, {
6860
+ children: l ? /* @__PURE__ */jsxRuntime.jsx(E1$1, {
6862
6861
  name: "icon-pause"
6863
- }) : /* @__PURE__ */jsxRuntime.jsx(H1$1, {
6862
+ }) : /* @__PURE__ */jsxRuntime.jsx(E1$1, {
6864
6863
  name: "icon-play"
6865
6864
  })
6866
6865
  }) : o ? /* @__PURE__ */jsxRuntime.jsxs(ve, {
@@ -6886,31 +6885,31 @@ var $e = Te$1(he$1),
6886
6885
  y = _ref3.hasNotPausedVideo,
6887
6886
  C = _ref3.hasInteractedWithAudio;
6888
6887
  return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, {
6889
- children: [!t && !(a && o) && /* @__PURE__ */jsxRuntime.jsx(R, {
6888
+ children: [!t && !(a && o) && /* @__PURE__ */jsxRuntime.jsx(H$1, {
6890
6889
  "data-control-btn": "true",
6891
6890
  children: l ? y ? null : /* @__PURE__ */jsxRuntime.jsx(Oe$1, {
6892
- children: /* @__PURE__ */jsxRuntime.jsx(H1$1, {
6891
+ children: /* @__PURE__ */jsxRuntime.jsx(E1$1, {
6893
6892
  name: "icon-play"
6894
6893
  })
6895
6894
  }) : i ? /* @__PURE__ */jsxRuntime.jsx(We$1, {
6896
- children: /* @__PURE__ */jsxRuntime.jsx(H1$1, {
6895
+ children: /* @__PURE__ */jsxRuntime.jsx(E1$1, {
6897
6896
  name: "icon-pause"
6898
6897
  })
6899
6898
  }) : /* @__PURE__ */jsxRuntime.jsx(Y, {
6900
6899
  "data-control-icon": "true",
6901
- children: /* @__PURE__ */jsxRuntime.jsx(H1$1, {
6900
+ children: /* @__PURE__ */jsxRuntime.jsx(E1$1, {
6902
6901
  name: "icon-play"
6903
6902
  })
6904
6903
  })
6905
- }), !t && a && o && C && /* @__PURE__ */jsxRuntime.jsx(R, {
6906
- children: p ? /* @__PURE__ */jsxRuntime.jsx(Re, {
6904
+ }), !t && a && o && C && /* @__PURE__ */jsxRuntime.jsx(H$1, {
6905
+ children: p ? /* @__PURE__ */jsxRuntime.jsx(He, {
6907
6906
  onClick: c,
6908
- children: /* @__PURE__ */jsxRuntime.jsx(H1$1, {
6907
+ children: /* @__PURE__ */jsxRuntime.jsx(E1$1, {
6909
6908
  name: "iconMute"
6910
6909
  })
6911
- }) : /* @__PURE__ */jsxRuntime.jsx(Le, {
6910
+ }) : /* @__PURE__ */jsxRuntime.jsx(Be, {
6912
6911
  onClick: d,
6913
- children: /* @__PURE__ */jsxRuntime.jsx(H1$1, {
6912
+ children: /* @__PURE__ */jsxRuntime.jsx(E1$1, {
6914
6913
  name: "iconUnMute"
6915
6914
  })
6916
6915
  })
@@ -6929,7 +6928,7 @@ var $e = Te$1(he$1),
6929
6928
  y = _ref4.onRender,
6930
6929
  C = _ref4.onMute,
6931
6930
  x = _ref4.onMuteClick,
6932
- U = _ref4.onQuartile,
6931
+ L = _ref4.onQuartile,
6933
6932
  M = _ref4.autoPlay,
6934
6933
  k = _ref4.playMuted,
6935
6934
  te = _ref4.className,
@@ -6938,8 +6937,8 @@ var $e = Te$1(he$1),
6938
6937
  ae = _ref4.hasNotPausedVideo;
6939
6938
  var u = e$2.useRef(null),
6940
6939
  ne = qe(u, se),
6940
+ U = e$2.useRef(false),
6941
6941
  j = e$2.useRef(false),
6942
- z = e$2.useRef(false),
6943
6942
  m = e$2.useRef(/* @__PURE__ */new Set()),
6944
6943
  _I3 = e$2.useState(false),
6945
6944
  _I4 = _slicedToArray(_I3, 2),
@@ -6951,7 +6950,7 @@ var $e = Te$1(he$1),
6951
6950
  O = _I6[1],
6952
6951
  _I7 = e$2.useState(false),
6953
6952
  _I8 = _slicedToArray(_I7, 2),
6954
- H = _I8[0],
6953
+ z = _I8[0],
6955
6954
  _ = _I8[1],
6956
6955
  _I9 = e$2.useState(true),
6957
6956
  _I0 = _slicedToArray(_I9, 2),
@@ -6994,7 +6993,7 @@ var $e = Te$1(he$1),
6994
6993
  if (r) if (N) r.pause();else {
6995
6994
  var g = u === null || u === void 0 ? void 0 : u.current;
6996
6995
  if (!g) return;
6997
- He(), g.play().catch(function (h) {
6996
+ ze(), g.play().catch(function (h) {
6998
6997
  return console.log(h);
6999
6998
  }), S(false);
7000
6999
  }
@@ -7009,13 +7008,13 @@ var $e = Te$1(he$1),
7009
7008
  };
7010
7009
  }, [P]), e$2.useEffect(function () {
7011
7010
  var s = u.current;
7012
- return s ? (z.current = s.muted, W(s.muted), je(s), function () {
7013
- ze(s);
7011
+ return s ? (j.current = s.muted, W(s.muted), Ue$1(s), function () {
7012
+ je(s);
7014
7013
  }) : function () {};
7015
7014
  }, []), e$2.useEffect(function () {
7016
7015
  y === null || y === void 0 || y();
7017
7016
  }, [y]), e$2.useEffect(function () {
7018
- m.current.clear(), j.current = false;
7017
+ m.current.clear(), U.current = false;
7019
7018
  }, [a]), /* @__PURE__ */jsxRuntime.jsxs($e, {
7020
7019
  webos: E,
7021
7020
  onClick: M && k ? q ? V : A : X,
@@ -7033,19 +7032,19 @@ var $e = Te$1(he$1),
7033
7032
  src: a,
7034
7033
  autoPlay: M,
7035
7034
  onPlay: function onPlay() {
7036
- K(true), j.current && (i !== null && i !== void 0 && i(), m.current.clear()), O(true), S(false), c !== null && c !== void 0 && c(), k ? A() : Q();
7035
+ K(true), U.current && (i !== null && i !== void 0 && i(), m.current.clear()), O(true), S(false), c !== null && c !== void 0 && c(), k ? A() : Q();
7037
7036
  },
7038
7037
  onTimeUpdate: function onTimeUpdate(s) {
7039
7038
  var r = s.target.duration,
7040
7039
  g = s.target.currentTime;
7041
7040
  if (r && g) {
7042
7041
  var h = Math.floor(g / r * 100);
7043
- h >= 25 && h < 50 && !m.current.has(25) ? (U !== null && U !== void 0 && U(25), m.current.add(25)) : h >= 50 && h < 75 && !m.current.has(50) ? (U !== null && U !== void 0 && U(50), m.current.add(50)) : h >= 75 && !m.current.has(75) && (U !== null && U !== void 0 && U(75), m.current.add(75));
7042
+ h >= 25 && h < 50 && !m.current.has(25) ? (L !== null && L !== void 0 && L(25), m.current.add(25)) : h >= 50 && h < 75 && !m.current.has(50) ? (L !== null && L !== void 0 && L(50), m.current.add(50)) : h >= 75 && !m.current.has(75) && (L !== null && L !== void 0 && L(75), m.current.add(75));
7044
7043
  }
7045
7044
  },
7046
7045
  onVolumeChange: function onVolumeChange(s) {
7047
7046
  var r = s.target.muted;
7048
- z.current !== r && (C !== null && C !== void 0 && C(r), z.current = r, (r !== w || w === void 0) && (r ? P() : Q()));
7047
+ j.current !== r && (C !== null && C !== void 0 && C(r), j.current = r, (r !== w || w === void 0) && (r ? P() : Q()));
7049
7048
  },
7050
7049
  onError: function () {
7051
7050
  var _onError = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(s) {
@@ -7093,7 +7092,7 @@ var $e = Te$1(he$1),
7093
7092
  O(false), d !== null && d !== void 0 && d(), P();
7094
7093
  },
7095
7094
  onEnded: function onEnded() {
7096
- O(false), j.current = true, re(), p !== null && p !== void 0 && p(), P();
7095
+ O(false), U.current = true, re(), p !== null && p !== void 0 && p(), P();
7097
7096
  },
7098
7097
  style: {
7099
7098
  visibility: J ? "hidden" : "visible"
@@ -7106,7 +7105,7 @@ var $e = Te$1(he$1),
7106
7105
  visibility: J ? "visible" : "hidden"
7107
7106
  }
7108
7107
  }), !E && /* @__PURE__ */jsxRuntime.jsx(De, {
7109
- loading: H,
7108
+ loading: z,
7110
7109
  autoPlay: M,
7111
7110
  played: G,
7112
7111
  playing: N,
@@ -7115,7 +7114,7 @@ var $e = Te$1(he$1),
7115
7114
  mute: A,
7116
7115
  togglePlaying: X
7117
7116
  }), E && /* @__PURE__ */jsxRuntime.jsx(Fe, {
7118
- loading: H,
7117
+ loading: z,
7119
7118
  autoPlay: M,
7120
7119
  playMuted: k,
7121
7120
  playing: N,
@@ -7125,7 +7124,7 @@ var $e = Te$1(he$1),
7125
7124
  isMuted: q,
7126
7125
  hasNotPausedVideo: ae,
7127
7126
  hasInteractedWithAudio: $
7128
- }), H && /* @__PURE__ */jsxRuntime.jsx(R, {
7127
+ }), z && /* @__PURE__ */jsxRuntime.jsx(H$1, {
7129
7128
  children: /* @__PURE__ */jsxRuntime.jsx(ue, {})
7130
7129
  })]
7131
7130
  });
@@ -7224,7 +7223,7 @@ var H = {
7224
7223
  }, [e === null || e === void 0 ? void 0 : e.uiState]), i;
7225
7224
  };
7226
7225
 
7227
- function Jg(r,e){var _loop=function _loop(){var i=e[t];if(typeof i!="string"&&!Array.isArray(i)){var _loop2=function _loop2(s){if(s!=="default"&&!(s in r)){var n=Object.getOwnPropertyDescriptor(i,s);n&&Object.defineProperty(r,s,n.get?n:{enumerable:true,get:function get(){return i[s];}});}};for(var s in i){_loop2(s);}}};for(var t=0;t<e.length;t++){_loop();}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}));}var Zg=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function Ud(r){return typeof r=="string"&&Zg.test(r);}function Nu(r){if(!Ud(r))throw TypeError("Invalid UUID");var e;return Uint8Array.of((e=parseInt(r.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(r.slice(9,13),16))>>>8,e&255,(e=parseInt(r.slice(14,18),16))>>>8,e&255,(e=parseInt(r.slice(19,23),16))>>>8,e&255,(e=parseInt(r.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255);}function e0(r){r=unescape(encodeURIComponent(r));var e=new Uint8Array(r.length);for(var t=0;t<r.length;++t)e[t]=r.charCodeAt(t);return e;}var t0="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i0="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function r0(r,e,t,i,s,n){var _i2;var a=typeof t=="string"?e0(t):t,o=typeof i=="string"?Nu(i):i;if(typeof i=="string"&&(i=Nu(i)),((_i2=i)===null||_i2===void 0?void 0:_i2.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var u=new Uint8Array(16+a.length);if(u.set(o),u.set(a,o.length),u=e(u),u[6]=u[6]&15|r,u[8]=u[8]&63|128,s){n=n||0;for(var d=0;d<16;++d)s[n+d]=u[d];return s;}return Db$1(u);}function s0(r,e,t,i){switch(r){case 0:return e&t^~e&i;case 1:return e^t^i;case 2:return e&t^e&i^t&i;case 3:return e^t^i;}}function Ma(r,e){return r<<e|r>>>32-e;}function n0(r){var e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520],i=new Uint8Array(r.length+1);i.set(r),i[r.length]=128,r=i;var s=r.length/4+2,n=Math.ceil(s/16),a=new Array(n);for(var o=0;o<n;++o){var u=new Uint32Array(16);for(var d=0;d<16;++d)u[d]=r[o*64+d*4]<<24|r[o*64+d*4+1]<<16|r[o*64+d*4+2]<<8|r[o*64+d*4+3];a[o]=u;}a[n-1][14]=(r.length-1)*8/Math.pow(2,32),a[n-1][14]=Math.floor(a[n-1][14]),a[n-1][15]=(r.length-1)*8&4294967295;for(var _o2=0;_o2<n;++_o2){var _u2=new Uint32Array(80);for(var D=0;D<16;++D)_u2[D]=a[_o2][D];for(var _D=16;_D<80;++_D)_u2[_D]=Ma(_u2[_D-3]^_u2[_D-8]^_u2[_D-14]^_u2[_D-16],1);var _d2=t[0],p=t[1],T=t[2],A=t[3],b=t[4];for(var _D2=0;_D2<80;++_D2){var v=Math.floor(_D2/20),R=Ma(_d2,5)+s0(v,p,T,A)+b+e[v]+_u2[_D2]>>>0;b=A,A=T,T=Ma(p,30)>>>0,p=_d2,_d2=R;}t[0]=t[0]+_d2>>>0,t[1]=t[1]+p>>>0,t[2]=t[2]+T>>>0,t[3]=t[3]+A>>>0,t[4]=t[4]+b>>>0;}return Uint8Array.of(t[0]>>24,t[0]>>16,t[0]>>8,t[0],t[1]>>24,t[1]>>16,t[1]>>8,t[1],t[2]>>24,t[2]>>16,t[2]>>8,t[2],t[3]>>24,t[3]>>16,t[3]>>8,t[3],t[4]>>24,t[4]>>16,t[4]>>8,t[4]);}function Dn(r,e,t,i){return r0(80,n0,r,e,t,i);}Dn.DNS=t0;Dn.URL=i0;function at(){return at=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i]);}return r;},at.apply(null,arguments);}var a0=/* @__PURE__ */ne("div")({name:"Container",class:"c5b6wdg",propsAsIs:false}),o0="a1rlj479",l0="s35f1di",u0="sj4471g",c0="b12050d8",d0="b1d5ybek",h0=function h0(r){return r==="left"||r==="right"?l0:c0;},f0=function f0(r){return r==="left"||r==="right"?u0:d0;},p0=function p0(r){return r==="left"?"avdxyl3":r==="right"?"a1bisd08":r==="top"?"a1u9y2aj":"a1qqaks";},tl=function tl(_ref){var r=_ref.children,e=_ref.style,t=_ref.className,_ref$enabled=_ref.enabled,i=_ref$enabled===void 0?true:_ref$enabled,s=_ref.hiding,_ref$direction=_ref.direction,n=_ref$direction===void 0?"left":_ref$direction,a=_ref.onAnimationEnd;return/* @__PURE__ */jsxRuntime.jsx(a0,{style:e,className:T$1(t,o0,p0(n),i&&!s&&h0(n),i&&s&&f0(n)),onAnimationEnd:a,children:r});},m0=/* @__PURE__ */ne("a")({name:"Link",class:"l1sgte8c",propsAsIs:false}),g0=/* @__PURE__ */ne("div")({name:"BannerContainer",class:"b7yfc72",propsAsIs:false}),y0=function y0(){return m0;},_0=/* @__PURE__ */ne(y0())({name:"BannerLink",class:"bejjq94",propsAsIs:true}),$d=function $d(_ref2){var r=_ref2.promotion,e=_ref2.promotionId,t=_ref2.hiding,i=_ref2.isEventFired,s=_ref2.fireEvent,_ref2$direction=_ref2.direction,n=_ref2$direction===void 0?"bottom":_ref2$direction;var a=(r===null||r===void 0?void 0:r.adUnit)===Se$2.STANDART,o=a?r.banner:r.additionalBanner;if(e$2.useEffect(function(){(o===null||o===void 0?void 0:o.imageUrl)&&e&&((i===null||i===void 0?void 0:i("banner-showed"))||(l$1.emit("advertisement",{action:"bannerShown",payload:{id:e,type:r.type}}),s===null||s===void 0?void 0:s("banner-showed")));},[o===null||o===void 0?void 0:o.imageUrl,s,i,r.type,e]),!(o!==null&&o!==void 0&&o.imageUrl))return null;var u=o===null||o===void 0?void 0:o.url;return u&&u.indexOf("http")!==0&&(u="https://".concat(u)),/* @__PURE__ */jsxRuntime.jsx(tl,{direction:n,hiding:t,children:/* @__PURE__ */jsxRuntime.jsx(g0,{className:"BannerContainer","data-is-ad":a,children:/* @__PURE__ */jsxRuntime.jsx(_0,{as:u?"a":"span",className:"BannerLink",href:u,style:{backgroundImage:"url(".concat(o.imageUrl,")"),cursor:u?"pointer":"default"},"data-promo-id":e,"data-promo-type":r.type,"data-a":"banner",target:"_blank","data-is-ad":a})})});},T0=function T0(_ref3){var r=_ref3.isEventFired,e=_ref3.fireEvent,t=_ref3.cardId,i=_ref3.promotion,_ref3$direction=_ref3.direction,s=_ref3$direction===void 0?"bottom":_ref3$direction;return/* @__PURE__ */jsxRuntime.jsx($d,{isEventFired:r,fireEvent:e,promotion:i,promotionId:t,direction:s,hiding:false});},v0=/* @__PURE__ */ne("div")({name:"NotificationContent",class:"n18wsqoo",propsAsIs:false}),b0=/* @__PURE__ */ne("div")({name:"Body",class:"b1ia90c2",propsAsIs:false}),x0=/* @__PURE__ */ne("div")({name:"Title",class:"tg2z08v",propsAsIs:false}),S0=/* @__PURE__ */ne("div")({name:"Text",class:"t59zdk1",propsAsIs:false}),Sr=/* @__PURE__ */ne("div")({name:"MediaImgBottom",class:"m1ab9fq",propsAsIs:false}),E0=function E0(){return Sr;},C0=/* @__PURE__ */ne(E0())({name:"MediaImgMiddle",class:"m9fsr0y",propsAsIs:true}),Ou=/* @__PURE__ */ne("img")({name:"CtaIcon",class:"cvi9y5q",propsAsIs:false}),A0=/* @__PURE__ */ne("div")({name:"Logo",class:"l5mq0z",propsAsIs:false}),w0=/* @__PURE__ */ne("div")({name:"Footer",class:"f1mse0ft",propsAsIs:false}),D0=/* @__PURE__ */ne("div")({name:"Vector",class:"v1hcloah",propsAsIs:false}),I0=/* @__PURE__ */ne("div")({name:"NotificationContainer",class:"n3n65jf",propsAsIs:false}),qd=/* @__PURE__ */ne("button")({name:"TVButton",class:"tkkfuqy",propsAsIs:false}),k0=function k0(){return qd;},P0=/* @__PURE__ */ne(k0())({name:"DismissButton",class:"dh9vato",propsAsIs:true}),R0=function R0(){return qd;},Vd=/* @__PURE__ */ne(R0())({name:"OpenButton",class:"oeah8gv",propsAsIs:true}),L0=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},DA.UNSET,Sr),DA.FIT,Sr),DA.CENTERED,Sr),DA.SOLID,Sr),DA.BOTTOM,Sr),DA.MIDDLE,C0),N0=function N0(_ref4){var r=_ref4.src,e=_ref4.imagePosition;var t=L0[e];return/* @__PURE__ */jsxRuntime.jsx(t,{children:/* @__PURE__ */jsxRuntime.jsx("img",{src:r,alt:""})});},O0=Te$1(P0),B0=Te$1(Vd),M0=function M0(_ref5){var r=_ref5.notification,e=_ref5.open,t=_ref5.close,i=_ref5.webos;if(!r||!r.promotion||r.enabled!==tn$1.NOTIFICATION_ENABLED)return null;var s=r.title,n=r.body,a=r.image,o=r.promotion,u=o.sponsorLogo,d=o.sponsorLogoMode,p=o.imagePosition,T=o.ctaButton;return/* @__PURE__ */jsxRuntime.jsxs(I0,{"data-webos":i,className:"SL_Lower_Third_Notification",onClick:i?void 0:e,children:[/* @__PURE__ */jsxRuntime.jsxs(v0,{children:[/* @__PURE__ */jsxRuntime.jsx(N0,{src:a,imagePosition:p}),/* @__PURE__ */jsxRuntime.jsxs(b0,{children:[s&&/* @__PURE__ */jsxRuntime.jsx(x0,{children:s}),n&&/* @__PURE__ */jsxRuntime.jsx(S0,{children:n})]})]}),/* @__PURE__ */jsxRuntime.jsxs(w0,{children:[d!==jA.NOTIFICATION_SPONSOR_LOGO_NONE&&/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[/* @__PURE__ */jsxRuntime.jsx(A0,{children:/* @__PURE__ */jsxRuntime.jsx("img",{src:u,alt:s})}),/* @__PURE__ */jsxRuntime.jsx(D0,{})]}),i?/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[/* @__PURE__ */jsxRuntime.jsx(O0,{webos:true,onClick:t,children:"Dismiss"}),/* @__PURE__ */jsxRuntime.jsxs(B0,{webos:true,autoFocus:true,style:{color:T===null||T===void 0?void 0:T.textColor,backgroundColor:T===null||T===void 0?void 0:T.color},onClick:e,children:[(T===null||T===void 0?void 0:T.ctaIcon)&&(T===null||T===void 0?void 0:T.ctaIconMode)===PA.CTA_ICON_TRANSPARENT&&/* @__PURE__ */jsxRuntime.jsx(Ou,{src:T===null||T===void 0?void 0:T.ctaIcon,alt:"cta-icon"}),(T===null||T===void 0?void 0:T.label)||"Open"]})]}):/* @__PURE__ */jsxRuntime.jsxs(Vd,{name:"promo-button",style:{color:T===null||T===void 0?void 0:T.textColor,backgroundColor:T===null||T===void 0?void 0:T.color},children:[(T===null||T===void 0?void 0:T.ctaIcon)&&(T===null||T===void 0?void 0:T.ctaIconMode)===PA.CTA_ICON_TRANSPARENT&&/* @__PURE__ */jsxRuntime.jsx(Ou,{src:T===null||T===void 0?void 0:T.ctaIcon,alt:"cta-icon"}),(T===null||T===void 0?void 0:T.label)||"Open"]})]})]});},F0=/* @__PURE__ */ne("div")({name:"NotificationContent",class:"n1ku6hz",propsAsIs:false}),U0=/* @__PURE__ */ne("div")({name:"NotificationContainer",class:"nbxqmol",propsAsIs:false}),$0=/* @__PURE__ */ne("div")({name:"Body",class:"b1gu3eml",propsAsIs:false}),q0=/* @__PURE__ */ne("div")({name:"Title",class:"t1u17zva",propsAsIs:false}),V0=/* @__PURE__ */ne("div")({name:"Text",class:"t10ko1g",propsAsIs:false}),Jn=/* @__PURE__ */ne("div")({name:"Media",class:"mntc42e",propsAsIs:false}),j0=function j0(){return Jn;},Bu=/* @__PURE__ */ne(j0())({name:"MediaImgFit",class:"ml060eo",propsAsIs:true}),H0=function H0(){return Jn;},jd=/* @__PURE__ */ne(H0())({name:"MediaImgCentered",class:"m1vqlvig",propsAsIs:true}),z0=function z0(){return jd;},W0=/* @__PURE__ */ne(z0())({name:"MediaImgBottom",class:"m1e7tvi5",propsAsIs:true}),G0=function G0(){return Jn;},K0=/* @__PURE__ */ne(G0())({name:"MediaImgSolid",class:"mqvntt2",propsAsIs:true}),X0=function X0(){return Jn;},Y0=/* @__PURE__ */ne(X0())({name:"MediaImgMiddle",class:"m12jtj3u",propsAsIs:true}),Q0=/* @__PURE__ */ne("img")({name:"CtaIcon",class:"ckq1frv",propsAsIs:false}),J0=function J0(){return H1$1;},Z0=/* @__PURE__ */ne(J0())({name:"StyledChevronRight",class:"s9mjmz3",propsAsIs:true}),ey=/* @__PURE__ */ne("div")({name:"Logo",class:"l1cf50a7",propsAsIs:false}),Hd=/* @__PURE__ */ne("button")({name:"TVButton",class:"thdqfl0",propsAsIs:false}),ty=function ty(){return Hd;},iy=/* @__PURE__ */ne(ty())({name:"DismissButton",class:"d11pe8bx",propsAsIs:true}),ry=function ry(){return Hd;},sy=/* @__PURE__ */ne(ry())({name:"OpenButton",class:"oy9k0kp",propsAsIs:true}),ny=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},DA.UNSET,Bu),DA.FIT,Bu),DA.CENTERED,jd),DA.BOTTOM,W0),DA.SOLID,K0),DA.MIDDLE,Y0),ay=function ay(_ref6){var r=_ref6.src,e=_ref6.imagePosition;var t=ny[e];return/* @__PURE__ */jsxRuntime.jsx(t,{children:/* @__PURE__ */jsxRuntime.jsx("img",{src:r,alt:""})});},oy=Te$1(iy),ly=Te$1(sy),uy=function uy(_ref7){var r=_ref7.notification,e=_ref7.open;_ref7.promotionId;var i=_ref7.hiding,_ref7$direction=_ref7.direction,s=_ref7$direction===void 0?"left":_ref7$direction,n=_ref7.close,a=_ref7.webos;if(!r||!r.promotion||r.enabled!==tn$1.NOTIFICATION_ENABLED)return null;if(r.promotion.mode===OA.LOWER_THIRD)return/* @__PURE__ */jsxRuntime.jsx(M0,{notification:r,open:e,close:n,webos:a});var o=r.title,u=r.body,d=r.image,p=r.promotion,T=p.sponsorLogo,A=p.sponsorLogoMode,b=p.imagePosition,D=p.ctaButton,v=function v(R){R.stopPropagation(),n===null||n===void 0?void 0:n();};return/* @__PURE__ */jsxRuntime.jsx(tl,{className:"SL_Rich_Notification",direction:s,hiding:i,children:/* @__PURE__ */jsxRuntime.jsxs(U0,{onClick:a?function(){}:e,children:[A!==jA.NOTIFICATION_SPONSOR_LOGO_NONE&&T&&/* @__PURE__ */jsxRuntime.jsx(ey,{children:/* @__PURE__ */jsxRuntime.jsx("img",{src:T,alt:o})}),/* @__PURE__ */jsxRuntime.jsxs(F0,{children:[/* @__PURE__ */jsxRuntime.jsx(ay,{src:d,imagePosition:b}),/* @__PURE__ */jsxRuntime.jsxs($0,{children:[o&&/* @__PURE__ */jsxRuntime.jsx(q0,{children:o}),u&&/* @__PURE__ */jsxRuntime.jsx(V0,{children:u})]}),a&&/* @__PURE__ */jsxRuntime.jsx(oy,{webos:true,onClick:v,children:"Dismiss"}),/* @__PURE__ */jsxRuntime.jsxs(ly,{webos:a,autoFocus:a,onClick:a?e:function(){},name:"promo-button",style:{color:D===null||D===void 0?void 0:D.textColor,backgroundColor:D===null||D===void 0?void 0:D.color},children:[(D===null||D===void 0?void 0:D.ctaIcon)&&(D===null||D===void 0?void 0:D.ctaIconMode)===PA.CTA_ICON_TRANSPARENT&&/* @__PURE__ */jsxRuntime.jsx(Q0,{src:D===null||D===void 0?void 0:D.ctaIcon,alt:"cta-icon"}),(D===null||D===void 0?void 0:D.label)||"Open"]}),/* @__PURE__ */jsxRuntime.jsx(Z0,{name:"chevronRight"})]})]})});},cy=/* @__PURE__ */ne("div")({name:"OverlayContainer",class:"okzhq2w",propsAsIs:false}),zd=/* @__PURE__ */ne("div")({name:"PromoOverlay",class:"pmgz5i",propsAsIs:false}),Wd=/* @__PURE__ */ne("div")({name:"Header",class:"hyxi3jt",propsAsIs:false}),Gd=/* @__PURE__ */ne("div")({name:"HeaderContent",class:"h149e3gp",propsAsIs:false}),Kd="h10toh7",Mu=/* @__PURE__ */ne("img")({name:"SponsorLogo",class:"s1jyea6t",propsAsIs:false}),dy=/* @__PURE__ */ne("div")({name:"SponsorName",class:"szpfa3h",propsAsIs:false}),Xd=/* @__PURE__ */ne("div")({name:"Media",class:"m1crmu01",propsAsIs:false}),hy=/* @__PURE__ */ne("img")({name:"PromoImg",class:"p1l37r8s",propsAsIs:false}),fy="s1nmch9k",Fu=/* @__PURE__ */ne("div")({name:"Content",class:"c1er0ljd",propsAsIs:false}),py=/* @__PURE__ */ne("div")({name:"Description",class:"dydopmr",propsAsIs:false}),my=/* @__PURE__ */ne("div")({name:"Sponsor",class:"s1w6nt04",propsAsIs:false}),gy=/* @__PURE__ */ne("div")({name:"SponsorText",class:"s1evcmtq",propsAsIs:false}),Yd=/* @__PURE__ */ne("div")({name:"ADLogo",class:"awodx0x",propsAsIs:false}),yy=/* @__PURE__ */ne("span")({name:"SponsoredText",class:"s1q3n6oi",propsAsIs:false}),Eo=/* @__PURE__ */ne("div")({name:"ActionBtnWrap",class:"a8d4xfk",propsAsIs:false}),Co=/* @__PURE__ */ne("a")({name:"ActionButton",class:"at6oobh",propsAsIs:false}),_y=/* @__PURE__ */ne("div")({name:"Title",class:"t1gyg7tt",propsAsIs:false}),Ty="h17rwbtk",vy=/* @__PURE__ */ne("div")({name:"Container",class:"c10m2bce",propsAsIs:false}),Uu=/* @__PURE__ */ne("div")({name:"Item",class:"ig23yq5",propsAsIs:false}),by=/* @__PURE__ */ne("div")({name:"Dot",class:"d1f6aqua",propsAsIs:false}),xy=function xy(_ref8){var r=_ref8.time,e=_ref8.adCount,t=_ref8.adPosition;var i=Math.floor(r/60),s=r-i*60;return i===0&&s===0&&e===t?null:/* @__PURE__ */jsxRuntime.jsxs(vy,{children:[e>1&&/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[/* @__PURE__ */jsxRuntime.jsxs(Uu,{children:[t," of ",e]}),/* @__PURE__ */jsxRuntime.jsx(by,{})]}),/* @__PURE__ */jsxRuntime.jsxs(Uu,{children:[i,":",s<10?"0".concat(s):s]})]});},Sy=/* @__PURE__ */ne("a")({name:"WhyThisAdLink",class:"w13o8uld",propsAsIs:false}),Ey=function Ey(_ref9){var r=_ref9.whyThisAd;var _el=e$2.useState(false),_el2=_slicedToArray(_el,2),e=_el2[0],t=_el2[1];return !r.iconClickThroughURLTemplate||!r.staticResource?null:/* @__PURE__ */jsxRuntime.jsxs(Sy,{style:_defineProperty(_defineProperty({width:r.width,height:r.height},r.xPosition,3),r.yPosition,11),href:r.iconClickThroughURLTemplate,target:"_blank",rel:"noreferrer",children:[!e&&/* @__PURE__ */jsxRuntime.jsx("img",{alt:"ad choice",src:r.staticResource,onLoad:function onLoad(){return t(false);},onError:function onError(){return t(true);}}),e&&/* @__PURE__ */jsxRuntime.jsx("span",{children:"ad choice"})]});},Cy=/* @__PURE__ */ne("div")({name:"VideoControls",class:"v1xzooj9",propsAsIs:false}),Qd=/* @__PURE__ */ne("button")({name:"ControlBtn",class:"c1bo41vr",propsAsIs:false}),Ay=function Ay(){return Qd;},wy=/* @__PURE__ */ne(Ay())({name:"MuteIcon",class:"m13efyu8",propsAsIs:true}),Dy=function Dy(){return Qd;},Iy=/* @__PURE__ */ne(Dy())({name:"PauseIcon",class:"pladkgh",propsAsIs:true}),ky=/* @__PURE__ */ne("div")({name:"Container",class:"cjnga56",propsAsIs:false}),Py=/* @__PURE__ */ne("div")({name:"ControlsContainer",class:"c7qs1am",propsAsIs:false}),$u="m12n261r",qu="m16vcml8",Vu="m1078nk6";function il(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return {id:r.id||null,adId:r.adId||null,sequence:r.sequence||null,apiFramework:r.apiFramework||null,universalAdIds:[],creativeExtensions:[]};}var Ry=["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"];function ju(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var i=[],s=Zd(r);!e.ERRORCODE||t.isCustomCode||/^[0-9]{3}$/.test(e.ERRORCODE)||(e.ERRORCODE=900),e.CACHEBUSTING=ih(Math.round(1e8*Math.random())),e.TIMESTAMP=(/* @__PURE__ */new Date()).toISOString(),e.RANDOM=e.random=e.CACHEBUSTING;for(var n in e)e[n]=th(e[n]);for(var _n2 in s){var a=s[_n2];typeof a=="string"&&i.push(Jd(a,e));}return i;}function Jd(r,e){var t=(r=Hu(r,e)).match(/[^[\]]+(?=])/g);if(!t)return r;var i=t.filter(function(s){return Ry.indexOf(s)>-1;});return i.length===0?r:(i=i.reduce(function(s,n){return s[n]=-1,s;},{}),Hu(r,i));}function Hu(r,e){var t=r;for(var i in e){var s=e[i];t=t.replace(new RegExp("(?:\\[|%%)(".concat(i,")(?:\\]|%%)"),"g"),s);}return t;}function Zd(r){return Array.isArray(r)?r.map(function(e){return e&&e.hasOwnProperty("url")?e.url:e;}):r;}function zu(r){return /^(https?:\/\/|\/\/)/.test(r);}function Wu(r,e){for(var t=0;t<e.length;t++)if(eh(e[t],r))return true;return false;}function eh(r,e){if(r&&e){var t=Object.getOwnPropertyNames(r),i=Object.getOwnPropertyNames(e);return t.length===i.length&&r.id===e.id&&r.url===e.url;}return false;}function th(r){return encodeURIComponent(r).replace(/[!'()*]/g,function(e){return "%".concat(e.charCodeAt(0).toString(16));});}function ih(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8;return r.toString().padStart(e,"0");}var Ve={track:function track(r,e,t){ju(r,e,t).forEach(function(i){(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&window!==null&&(new Image().src=i);});},resolveURLTemplates:ju,extractURLsFromTemplates:Zd,filterUrlTemplates:function filterUrlTemplates(r){return r.reduce(function(e,t){var i=t.url||t;return zu(i)?e.validUrls.push(i):e.invalidUrls.push(i),e;},{validUrls:[],invalidUrls:[]});},containsTemplateObject:Wu,isTemplateObjectEqual:eh,encodeURIComponentRFC3986:th,replaceUrlMacros:Jd,isNumeric:function isNumeric(r){return !isNaN(parseFloat(r))&&isFinite(r);},flatten:function r(e){return e.reduce(function(t,i){return t.concat(Array.isArray(i)?r(i):i);},[]);},joinArrayOfUniqueTemplateObjs:function joinArrayOfUniqueTemplateObjs(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];var t=Array.isArray(r)?r:[],i=Array.isArray(e)?e:[];return t.concat(i).reduce(function(s,n){return Wu(n,s)||s.push(n),s;},[]);},isValidTimeValue:function isValidTimeValue(r){return Number.isFinite(r)&&r>=-2;},addLeadingZeros:ih,isValidUrl:zu,isBrowserEnvironment:function isBrowserEnvironment(){return (typeof window==="undefined"?"undefined":_typeof(window))<"u";},formatMacrosValues:function formatMacrosValues(r){return _typeof(r)!="object"?r:JSON.stringify(r);}};function Gu(r){return ["true","TRUE","True","1"].includes(r);}function Ly(r){if(r==null)return -1;if(Ve.isNumeric(r))return parseInt(r);var e=r.split(":");if(e.length!==3)return -1;var t=e[2].split(".");var i=parseInt(t[0]);t.length===2&&(i+=parseFloat("0.".concat(t[1])));var s=parseInt(60*e[1]),n=parseInt(60*e[0]*60);return isNaN(n)||isNaN(s)||isNaN(i)||s>3600||i>60?-1:n+s+i;}var J={childByName:function childByName(r,e){return Array.from(r.childNodes).find(function(t){return t.nodeName===e;});},childrenByName:function childrenByName(r,e){return Array.from(r.childNodes).filter(function(t){return t.nodeName===e;});},resolveVastAdTagURI:function resolveVastAdTagURI(r,e){if(!e)return r;if(r.startsWith("//")){var _location=location,t=_location.protocol;return "".concat(t).concat(r);}if(!r.includes("://")){var _t2=e.slice(0,e.lastIndexOf("/"));return "".concat(_t2,"/").concat(r);}return r;},parseBoolean:Gu,parseNodeText:function parseNodeText(r){return r&&(r.textContent||r.text||"").trim();},copyNodeAttribute:function copyNodeAttribute(r,e,t){var i=e.getAttribute(r);i&&t.setAttribute(r,i);},parseAttributes:function parseAttributes(r){return Array.from(r.attributes).reduce(function(e,t){return e[t.nodeName]=t.nodeValue,e;},{});},parseDuration:Ly,getStandAloneAds:function getStandAloneAds(){return (arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).filter(function(r){return !parseInt(r.sequence,10);});},getSortedAdPods:function getSortedAdPods(){return (arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).filter(function(r){return parseInt(r.sequence,10);}).sort(function(r,e){return r.sequence-e.sequence;});},assignAttributes:function assignAttributes(r,e){r&&Array.from(r).forEach(function(t){var i=t.nodeName,s=t.nodeValue;if(i&&s&&e.hasOwnProperty(i)){var n=s;typeof e[i]=="boolean"&&(n=Gu(n)),e[i]=n;}});},mergeWrapperAdData:function mergeWrapperAdData(r,e){var t;r.errorURLTemplates=e.errorURLTemplates.concat(r.errorURLTemplates),r.impressionURLTemplates=e.impressionURLTemplates.concat(r.impressionURLTemplates),r.extensions=e.extensions.concat(r.extensions),e.viewableImpression.length>0&&(r.viewableImpression=[].concat(_toConsumableArray(r.viewableImpression),_toConsumableArray(e.viewableImpression))),r.followAdditionalWrappers=e.followAdditionalWrappers,r.allowMultipleAds=e.allowMultipleAds,r.fallbackOnNoAd=e.fallbackOnNoAd;var i=(e.creatives||[]).filter(function(o){return o&&o.type==="companion";}),s=i.reduce(function(o,u){return (u.variations||[]).forEach(function(d){(d.companionClickTrackingURLTemplates||[]).forEach(function(p){Ve.containsTemplateObject(p,o)||o.push(p);});}),o;},[]);r.creatives=i.concat(r.creatives);var n=e.videoClickTrackingURLTemplates&&e.videoClickTrackingURLTemplates.length,a=e.videoCustomClickURLTemplates&&e.videoCustomClickURLTemplates.length;if(r.creatives.forEach(function(o){if(e.trackingEvents&&e.trackingEvents[o.type])for(var u in e.trackingEvents[o.type]){var d=e.trackingEvents[o.type][u];Array.isArray(o.trackingEvents[u])||(o.trackingEvents[u]=[]),o.trackingEvents[u]=o.trackingEvents[u].concat(d);}o.type==="linear"&&(n&&(o.videoClickTrackingURLTemplates=o.videoClickTrackingURLTemplates.concat(e.videoClickTrackingURLTemplates)),a&&(o.videoCustomClickURLTemplates=o.videoCustomClickURLTemplates.concat(e.videoCustomClickURLTemplates)),!e.videoClickThroughURLTemplate||o.videoClickThroughURLTemplate!==null&&o.videoClickThroughURLTemplate!==void 0||(o.videoClickThroughURLTemplate=e.videoClickThroughURLTemplate)),o.type==="companion"&&s.length&&(o.variations||[]).forEach(function(u){u.companionClickTrackingURLTemplates=Ve.joinArrayOfUniqueTemplateObjs(u.companionClickTrackingURLTemplates,s);});}),e.adVerifications&&(r.adVerifications=r.adVerifications.concat(e.adVerifications)),e.blockedAdCategories&&(r.blockedAdCategories=r.blockedAdCategories.concat(e.blockedAdCategories)),(t=e.creatives)!==null&&t!==void 0&&t.length){var o=e.creatives.filter(function(u){var d;return ((d=u.icons)===null||d===void 0?void 0:d.length)&&!u.mediaFiles.length;});o.length&&(r.creatives=r.creatives.concat(o));}}};function Ny(r,e){var t=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var _il=il(i),s=_il.id,n=_il.adId,a=_il.sequence,o=_il.apiFramework;return {id:s,adId:n,sequence:a,apiFramework:o,type:"companion",required:null,variations:[]};}(e);return t.required=r.getAttribute("required")||null,t.variations=J.childrenByName(r,"Companion").map(function(i){var s=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return {id:o.id||null,adType:"companionAd",width:o.width||0,height:o.height||0,assetWidth:o.assetWidth||null,assetHeight:o.assetHeight||null,expandedWidth:o.expandedWidth||null,expandedHeight:o.expandedHeight||null,apiFramework:o.apiFramework||null,adSlotId:o.adSlotId||null,pxratio:o.pxratio||"1",renderingMode:o.renderingMode||"default",staticResources:[],htmlResources:[],iframeResources:[],adParameters:null,altText:null,companionClickThroughURLTemplate:null,companionClickTrackingURLTemplates:[],trackingEvents:{}};}(J.parseAttributes(i));s.htmlResources=J.childrenByName(i,"HTMLResource").reduce(function(o,u){var d=J.parseNodeText(u);return d?o.concat(d):o;},[]),s.iframeResources=J.childrenByName(i,"IFrameResource").reduce(function(o,u){var d=J.parseNodeText(u);return d?o.concat(d):o;},[]),s.staticResources=J.childrenByName(i,"StaticResource").reduce(function(o,u){var d=J.parseNodeText(u);return d?o.concat({url:d,creativeType:u.getAttribute("creativeType")||null}):o;},[]),s.altText=J.parseNodeText(J.childByName(i,"AltText"))||null;var n=J.childByName(i,"TrackingEvents");n&&J.childrenByName(n,"Tracking").forEach(function(o){var u=o.getAttribute("event"),d=J.parseNodeText(o);u&&d&&(Array.isArray(s.trackingEvents[u])||(s.trackingEvents[u]=[]),s.trackingEvents[u].push(d));}),s.companionClickTrackingURLTemplates=J.childrenByName(i,"CompanionClickTracking").map(function(o){return {id:o.getAttribute("id")||null,url:J.parseNodeText(o)};}),s.companionClickThroughURLTemplate=J.parseNodeText(J.childByName(i,"CompanionClickThrough"))||null;var a=J.childByName(i,"AdParameters");return a&&(s.adParameters={value:J.parseNodeText(a),xmlEncoded:a.getAttribute("xmlEncoded")||null}),s;}),t;}function Oy(r,e){var t;var i=function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var _il2=il(u),d=_il2.id,p=_il2.adId,T=_il2.sequence,A=_il2.apiFramework;return {id:d,adId:p,sequence:T,apiFramework:A,type:"linear",duration:0,skipDelay:null,mediaFiles:[],mezzanine:null,interactiveCreativeFile:null,closedCaptionFiles:[],videoClickThroughURLTemplate:null,videoClickTrackingURLTemplates:[],videoCustomClickURLTemplates:[],adParameters:null,icons:[],trackingEvents:{}};}(e);i.duration=J.parseDuration(J.parseNodeText(J.childByName(r,"Duration")));var s=r.getAttribute("skipoffset");if(s==null)i.skipDelay=null;else if(s.charAt(s.length-1)==="%"&&i.duration!==-1){var u=parseInt(s,10);i.skipDelay=i.duration*(u/100);}else i.skipDelay=J.parseDuration(s);var n=J.childByName(r,"VideoClicks");if(n){var _u3=J.childByName(n,"ClickThrough");i.videoClickThroughURLTemplate=_u3?{id:_u3.getAttribute("id")||null,url:J.parseNodeText(_u3)}:null,J.childrenByName(n,"ClickTracking").forEach(function(d){i.videoClickTrackingURLTemplates.push({id:d.getAttribute("id")||null,url:J.parseNodeText(d)});}),J.childrenByName(n,"CustomClick").forEach(function(d){i.videoCustomClickURLTemplates.push({id:d.getAttribute("id")||null,url:J.parseNodeText(d)});});}var a=J.childByName(r,"AdParameters");a&&(i.adParameters={value:J.parseNodeText(a),xmlEncoded:a.getAttribute("xmlEncoded")||null}),J.childrenByName(r,"TrackingEvents").forEach(function(u){J.childrenByName(u,"Tracking").forEach(function(d){var p=d.getAttribute("event");var T=J.parseNodeText(d);if(p&&T){if(p==="progress"){if(t=d.getAttribute("offset"),!t)return;p=t.charAt(t.length-1)==="%"?"progress-".concat(t):"progress-".concat(J.parseDuration(t));}Array.isArray(i.trackingEvents[p])||(i.trackingEvents[p]=[]),i.trackingEvents[p].push(T);}});}),J.childrenByName(r,"MediaFiles").forEach(function(u){J.childrenByName(u,"MediaFile").forEach(function(b){i.mediaFiles.push(function(D){var 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};v.id=D.getAttribute("id"),v.fileURL=J.parseNodeText(D),v.deliveryType=D.getAttribute("delivery"),v.codec=D.getAttribute("codec"),v.mimeType=D.getAttribute("type"),v.mediaType=D.getAttribute("mediaType")||"2D",v.apiFramework=D.getAttribute("apiFramework"),v.fileSize=parseInt(D.getAttribute("fileSize")||0),v.bitrate=parseInt(D.getAttribute("bitrate")||0),v.minBitrate=parseInt(D.getAttribute("minBitrate")||0),v.maxBitrate=parseInt(D.getAttribute("maxBitrate")||0),v.width=parseInt(D.getAttribute("width")||0),v.height=parseInt(D.getAttribute("height")||0);var R=D.getAttribute("scalable");R&&typeof R=="string"&&(v.scalable=J.parseBoolean(R));var U=D.getAttribute("maintainAspectRatio");return U&&typeof U=="string"&&(v.maintainAspectRatio=J.parseBoolean(U)),v;}(b));});var d=J.childByName(u,"InteractiveCreativeFile");d&&(i.interactiveCreativeFile=function(b){var D=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return {type:v.type||null,apiFramework:v.apiFramework||null,variableDuration:J.parseBoolean(v.variableDuration),fileURL:null};}(J.parseAttributes(b));return D.fileURL=J.parseNodeText(b),D;}(d));var p=J.childByName(u,"ClosedCaptionFiles");p&&J.childrenByName(p,"ClosedCaptionFile").forEach(function(b){var D=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return {type:v.type||null,language:v.language||null,fileURL:null};}(J.parseAttributes(b));D.fileURL=J.parseNodeText(b),i.closedCaptionFiles.push(D);});var T=J.childByName(u,"Mezzanine"),A=function(b,D){var v={};var R=false;return D.forEach(function(U){b&&b.getAttribute(U)?v[U]=b.getAttribute(U):R=true;}),R?null:v;}(T,["delivery","type","width","height"]);if(A){var b={id:null,fileURL:null,delivery:null,codec:null,type:null,width:0,height:0,fileSize:0,mediaType:"2D"};b.id=T.getAttribute("id"),b.fileURL=J.parseNodeText(T),b.delivery=A.delivery,b.codec=T.getAttribute("codec"),b.type=A.type,b.width=parseInt(A.width,10),b.height=parseInt(A.height,10),b.fileSize=parseInt(T.getAttribute("fileSize"),10),b.mediaType=T.getAttribute("mediaType")||"2D",i.mezzanine=b;}});var o=J.childByName(r,"Icons");return o&&J.childrenByName(o,"Icon").forEach(function(u){i.icons.push(function(d){var p={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};p.program=d.getAttribute("program"),p.height=parseInt(d.getAttribute("height")||0),p.width=parseInt(d.getAttribute("width")||0),p.xPosition=function(A){return ["left","right"].indexOf(A)!==-1?A:parseInt(A||0);}(d.getAttribute("xPosition")),p.yPosition=function(A){return ["top","bottom"].indexOf(A)!==-1?A:parseInt(A||0);}(d.getAttribute("yPosition")),p.apiFramework=d.getAttribute("apiFramework"),p.pxratio=d.getAttribute("pxratio")||"1",p.offset=J.parseDuration(d.getAttribute("offset")),p.duration=J.parseDuration(d.getAttribute("duration")),p.altText=d.getAttribute("altText"),p.hoverText=d.getAttribute("hoverText"),J.childrenByName(d,"HTMLResource").forEach(function(A){p.type=A.getAttribute("creativeType")||"text/html",p.htmlResource=J.parseNodeText(A);}),J.childrenByName(d,"IFrameResource").forEach(function(A){p.type=A.getAttribute("creativeType")||0,p.iframeResource=J.parseNodeText(A);}),J.childrenByName(d,"StaticResource").forEach(function(A){p.type=A.getAttribute("creativeType")||0,p.staticResource=J.parseNodeText(A);});var T=J.childByName(d,"IconClicks");if(T){p.iconClickThroughURLTemplate=J.parseNodeText(J.childByName(T,"IconClickThrough")),J.childrenByName(T,"IconClickTracking").forEach(function(b){p.iconClickTrackingURLTemplates.push({id:b.getAttribute("id")||null,url:J.parseNodeText(b)});});var A=J.childByName(T,"IconClickFallbackImages");A&&J.childrenByName(A,"IconClickFallbackImage").forEach(function(b){p.iconClickFallbackImages.push({url:J.parseNodeText(b)||null,width:b.getAttribute("width")||null,height:b.getAttribute("height")||null});});}return p.iconViewTrackingURLTemplate=J.parseNodeText(J.childByName(d,"IconViewTracking")),p;}(u));}),i;}function By(r,e){var t=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var _il3=il(i),s=_il3.id,n=_il3.adId,a=_il3.sequence,o=_il3.apiFramework;return {id:s,adId:n,sequence:a,apiFramework:o,type:"nonlinear",variations:[],trackingEvents:{}};}(e);return J.childrenByName(r,"TrackingEvents").forEach(function(i){var s,n;J.childrenByName(i,"Tracking").forEach(function(a){s=a.getAttribute("event"),n=J.parseNodeText(a),s&&n&&(Array.isArray(t.trackingEvents[s])||(t.trackingEvents[s]=[]),t.trackingEvents[s].push(n));});}),J.childrenByName(r,"NonLinear").forEach(function(i){var s={id:null,width:0,height:0,expandedWidth:0,expandedHeight:0,scalable:true,maintainAspectRatio:true,minSuggestedDuration:0,apiFramework:"static",adType:"nonLinearAd",type:null,staticResource:null,htmlResource:null,iframeResource:null,nonlinearClickThroughURLTemplate:null,nonlinearClickTrackingURLTemplates:[],adParameters:null};s.id=i.getAttribute("id")||null,s.width=i.getAttribute("width"),s.height=i.getAttribute("height"),s.expandedWidth=i.getAttribute("expandedWidth"),s.expandedHeight=i.getAttribute("expandedHeight"),s.scalable=J.parseBoolean(i.getAttribute("scalable")),s.maintainAspectRatio=J.parseBoolean(i.getAttribute("maintainAspectRatio")),s.minSuggestedDuration=J.parseDuration(i.getAttribute("minSuggestedDuration")),s.apiFramework=i.getAttribute("apiFramework"),J.childrenByName(i,"HTMLResource").forEach(function(a){s.type=a.getAttribute("creativeType")||"text/html",s.htmlResource=J.parseNodeText(a);}),J.childrenByName(i,"IFrameResource").forEach(function(a){s.type=a.getAttribute("creativeType")||0,s.iframeResource=J.parseNodeText(a);}),J.childrenByName(i,"StaticResource").forEach(function(a){s.type=a.getAttribute("creativeType")||0,s.staticResource=J.parseNodeText(a);});var n=J.childByName(i,"AdParameters");n&&(s.adParameters={value:J.parseNodeText(n),xmlEncoded:n.getAttribute("xmlEncoded")||null}),s.nonlinearClickThroughURLTemplate=J.parseNodeText(J.childByName(i,"NonLinearClickThrough")),J.childrenByName(i,"NonLinearClickTracking").forEach(function(a){s.nonlinearClickTrackingURLTemplates.push({id:a.getAttribute("id")||null,url:J.parseNodeText(a)});}),t.variations.push(s);}),t;}function Ku(r){var e=[];return r.forEach(function(t){var i=rh(t);i&&e.push(i);}),e;}function rh(r){if(r.nodeName==="#comment")return null;var e={name:null,value:null,attributes:{},children:[]},t=r.attributes,i=r.childNodes;if(e.name=r.nodeName,r.attributes){for(var n in t)if(t.hasOwnProperty(n)){var a=t[n];a.nodeName&&a.nodeValue&&(e.attributes[a.nodeName]=a.nodeValue);}}for(var _n3 in i)if(i.hasOwnProperty(_n3)){var _a2=rh(i[_n3]);_a2&&e.children.push(_a2);}if(e.children.length===0||e.children.length===1&&["#cdata-section","#text"].indexOf(e.children[0].name)>=0){var _n4=J.parseNodeText(r);_n4!==""&&(e.value=_n4),e.children=[];}return (s=e).value===null&&Object.keys(s.attributes).length===0&&s.children.length===0?null:e;var s;}function My(r){return r.getAttribute("AdID")||r.getAttribute("adID")||r.getAttribute("adId")||null;}var xn={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"]}};function Xu(r,e){if(!xn[r.nodeName]||!xn[r.nodeName].attributes)return;var t=xn[r.nodeName].attributes.filter(function(i){return !r.getAttribute(i);});t.length>0&&Rs({name:r.nodeName,parentName:r.parentNode.nodeName,attributes:t},e);}function Yu(r,e,t){var i=xn[r.nodeName],s=!t&&r.nodeName!=="Wrapper";if(!(!i||s)){if(i.subElements){var n=i.subElements.filter(function(a){return !J.childByName(r,a);});n.length>0&&Rs({name:r.nodeName,parentName:r.parentNode.nodeName,subElements:n},e);}!t||!i.oneOfinLineResources||i.oneOfinLineResources.some(function(n){return J.childByName(r,n);})||Rs({name:r.nodeName,parentName:r.parentNode.nodeName,oneOfResources:i.oneOfinLineResources},e);}}function Qu(r){return r.children&&r.children.length!==0;}function Rs(r,e){var t=r.name,i=r.parentName,s=r.attributes,n=r.subElements,a=r.oneOfResources,o="Element '".concat(t,"'");o+=s?" missing required attribute(s) '".concat(s.join(", "),"' "):n?" missing required sub element(s) '".concat(n.join(", "),"' "):a?" must provide one of the following '".concat(a.join(", "),"' "):" is empty",e("VAST-warning",{message:o,parentElement:i,specVersion:4.1});}var Fy={verifyRequiredValues:function r(e,t,i){if(e&&e.nodeName)if(e.nodeName==="InLine"&&(i=true),Xu(e,t),Qu(e)){Yu(e,t,i);for(var s=0;s<e.children.length;s++)r(e.children[s],t,i);}else J.parseNodeText(e).length===0&&Rs({name:e.nodeName,parentName:e.parentNode.nodeName},t);},hasSubElements:Qu,emitMissingValueWarning:Rs,verifyRequiredAttributes:Xu,verifyRequiredSubElements:Yu};function Uy(r,e){var _ref0=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},t=_ref0.allowMultipleAds,i=_ref0.followAdditionalWrappers;var s=Array.from(r.childNodes).filter(function(n){var a=n.nodeName.toLowerCase();return a==="inline"||i!==false&&a==="wrapper";});var _iterator=_createForOfIteratorHelper(s),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var n=_step.value;if(J.copyNodeAttribute("id",r,n),J.copyNodeAttribute("sequence",r,n),J.copyNodeAttribute("adType",r,n),n.nodeName==="Wrapper")return {ad:qy(n,e),type:"WRAPPER"};if(n.nodeName==="InLine")return {ad:$y(n,e,{allowMultipleAds:t}),type:"INLINE"};var a=n.nodeName.toLowerCase();e("VAST-warning",{message:"<".concat(n.nodeName,a==="inline"?"> must be written <InLine>":"> must be written <Wrapper>"),wrongNode:n});}}catch(err){_iterator.e(err);}finally{_iterator.f();}}function $y(r,e){var _ref1=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},t=_ref1.allowMultipleAds;return t===false&&r.getAttribute("sequence")?null:sh(r,e);}function sh(r,e){var t=[];e&&Fy.verifyRequiredValues(r,e);var i=Array.from(r.childNodes),s=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return {id:n.id||null,sequence:n.sequence||null,adType:n.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:true,allowMultipleAds:false,fallbackOnNoAd:null};}(J.parseAttributes(r));return i.forEach(function(n){switch(n.nodeName){case "Error":s.errorURLTemplates.push(J.parseNodeText(n));break;case "Impression":s.impressionURLTemplates.push({id:n.getAttribute("id")||null,url:J.parseNodeText(n)});break;case "Creatives":s.creatives=function(a){var o=[];return a.forEach(function(u){var d={id:u.getAttribute("id")||null,adId:My(u),sequence:u.getAttribute("sequence")||null,apiFramework:u.getAttribute("apiFramework")||null},p=[];var T;J.childrenByName(u,"UniversalAdId").forEach(function(b){var D={idRegistry:b.getAttribute("idRegistry")||"unknown",value:J.parseNodeText(b)};p.push(D);});var A=J.childByName(u,"CreativeExtensions");A&&(T=Ku(J.childrenByName(A,"CreativeExtension")));for(var b in u.childNodes){var D=u.childNodes[b];var v=void 0;switch(D.nodeName){case "Linear":v=Oy(D,d);break;case "NonLinearAds":v=By(D,d);break;case "CompanionAds":v=Ny(D,d);}v&&(p&&(v.universalAdIds=p),T&&(v.creativeExtensions=T),o.push(v));}}),o;}(J.childrenByName(n,"Creative"));break;case "Extensions":{var a=J.childrenByName(n,"Extension");s.extensions=Ku(a),s.adVerifications.length||(t=function(o){var u=null,d=[];return o.some(function(p){return u=J.childByName(p,"AdVerifications");}),u&&(d=Ju(J.childrenByName(u,"Verification"))),d;}(a));break;}case "AdVerifications":s.adVerifications=Ju(J.childrenByName(n,"Verification"));break;case "AdSystem":s.system={value:J.parseNodeText(n),version:n.getAttribute("version")||null};break;case "AdTitle":s.title=J.parseNodeText(n);break;case "AdServingId":s.adServingId=J.parseNodeText(n);break;case "Category":s.categories.push({authority:n.getAttribute("authority")||null,value:J.parseNodeText(n)});break;case "Expires":s.expires=parseInt(J.parseNodeText(n),10);break;case "ViewableImpression":s.viewableImpression.push(function(a){var o=function o(u,d){var p=J.parseNodeText(d);return p&&u.push(p),u;};return {id:a.getAttribute("id")||null,viewable:J.childrenByName(a,"Viewable").reduce(o,[]),notViewable:J.childrenByName(a,"NotViewable").reduce(o,[]),viewUndetermined:J.childrenByName(a,"ViewUndetermined").reduce(o,[])};}(n));break;case "Description":s.description=J.parseNodeText(n);break;case "Advertiser":s.advertiser={id:n.getAttribute("id")||null,value:J.parseNodeText(n)};break;case "Pricing":s.pricing={value:J.parseNodeText(n),model:n.getAttribute("model")||null,currency:n.getAttribute("currency")||null};break;case "Survey":s.survey={value:J.parseNodeText(n),type:n.getAttribute("type")||null};break;case "BlockedAdCategories":s.blockedAdCategories.push({authority:n.getAttribute("authority")||null,value:J.parseNodeText(n)});}}),t.length&&(s.adVerifications=s.adVerifications.concat(t)),s;}function qy(r,e){var t=sh(r,e),i=r.getAttribute("followAdditionalWrappers"),s=r.getAttribute("allowMultipleAds"),n=r.getAttribute("fallbackOnNoAd");t.followAdditionalWrappers=!i||J.parseBoolean(i),t.allowMultipleAds=!!s&&J.parseBoolean(s),t.fallbackOnNoAd=n?J.parseBoolean(n):null;var a=J.childByName(r,"VASTAdTagURI");if(a?t.nextWrapperURL=J.parseNodeText(a):(a=J.childByName(r,"VASTAdTagURL"),a&&(t.nextWrapperURL=J.parseNodeText(J.childByName(a,"URL")))),t.creatives.forEach(function(o){if(["linear","nonlinear"].includes(o.type)){if(o.trackingEvents){t.trackingEvents||(t.trackingEvents={}),t.trackingEvents[o.type]||(t.trackingEvents[o.type]={});var _loop3=function _loop3(u){var d=o.trackingEvents[u];Array.isArray(t.trackingEvents[o.type][u])||(t.trackingEvents[o.type][u]=[]),d.forEach(function(p){t.trackingEvents[o.type][u].push(p);});};for(var u in o.trackingEvents){_loop3(u);}}o.videoClickTrackingURLTemplates&&(Array.isArray(t.videoClickTrackingURLTemplates)||(t.videoClickTrackingURLTemplates=[]),o.videoClickTrackingURLTemplates.forEach(function(u){t.videoClickTrackingURLTemplates.push(u);})),o.videoClickThroughURLTemplate&&(t.videoClickThroughURLTemplate=o.videoClickThroughURLTemplate),o.videoCustomClickURLTemplates&&(Array.isArray(t.videoCustomClickURLTemplates)||(t.videoCustomClickURLTemplates=[]),o.videoCustomClickURLTemplates.forEach(function(u){t.videoCustomClickURLTemplates.push(u);}));}}),t.nextWrapperURL)return t;}function Ju(r){var e=[];return r.forEach(function(t){var i={resource:null,vendor:null,browserOptional:false,apiFramework:null,type:null,parameters:null,trackingEvents:{}},s=Array.from(t.childNodes);J.assignAttributes(t.attributes,i),s.forEach(function(a){var o=a.nodeName,u=a.textContent,d=a.attributes;switch(o){case "JavaScriptResource":case "ExecutableResource":i.resource=u.trim(),J.assignAttributes(d,i);break;case "VerificationParameters":i.parameters=u.trim();}});var n=J.childByName(t,"TrackingEvents");n&&J.childrenByName(n,"Tracking").forEach(function(a){var o=a.getAttribute("event"),u=J.parseNodeText(a);o&&u&&(Array.isArray(i.trackingEvents[o])||(i.trackingEvents[o]=[]),i.trackingEvents[o].push(u));}),e.push(i);}),e;}var nh=/*#__PURE__*/function(){function nh(){_classCallCheck(this,nh);this._handlers=[];}return _createClass(nh,[{key:"on",value:function on(e,t){if(typeof t!="function")throw new TypeError("The handler argument must be of type Function. Received type ".concat(_typeof(t)));if(!e)throw new TypeError("The event argument must be of type String. Received type ".concat(_typeof(e)));return this._handlers.push({event:e,handler:t}),this;}},{key:"once",value:function once(e,t){return this.on(e,function(i,s,n){var a={fired:false,wrapFn:void 0};function o(){a.fired||(i.off(s,a.wrapFn),a.fired=true,n.bind(i).apply(void 0,arguments));}return a.wrapFn=o,o;}(this,e,t));}},{key:"off",value:function off(e,t){return this._handlers=this._handlers.filter(function(i){return i.event!==e||i.handler!==t;}),this;}},{key:"emit",value:function emit(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];var n=false;return this._handlers.forEach(function(a){a.event==="*"&&(n=true,a.handler.apply(a,[e].concat(i))),a.event===e&&(n=true,a.handler.apply(a,i));}),n;}},{key:"removeAllListeners",value:function removeAllListeners(e){return e?(this._handlers=this._handlers.filter(function(t){return t.event!==e;}),this):(this._handlers=[],this);}},{key:"listenerCount",value:function listenerCount(e){return this._handlers.filter(function(t){return t.event===e;}).length;}},{key:"listeners",value:function listeners(e){return this._handlers.reduce(function(t,i){return i.event===e&&t.push(i.handler),t;},[]);}},{key:"eventNames",value:function eventNames(){return this._handlers.map(function(e){return e.event;});}}]);}(),Zu=0,Ao=0;var ah=function ah(r,e){!r||!e||r<=0||e<=0||(Ao=(Ao*Zu+8*r/e)/++Zu);},Vy={ERRORCODE:900,extensions:[]},ec="VAST response version not supported";var jy=/*#__PURE__*/function(_nh){function jy(){var _this;_classCallCheck(this,jy);var _ref10=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=_ref10.fetcher;_this=_callSuper(this,jy),_this.maxWrapperDepth=null,_this.rootErrorURLTemplates=[],_this.errorURLTemplates=[],_this.remainingAds=[],_this.parsingOptions={},_this.fetcher=e||null,_this.keepFailedAdPod=false;return _this;}_inherits(jy,_nh);return _createClass(jy,[{key:"trackVastError",value:function trackVastError(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),n=2;n<i;n++)s[n-2]=arguments[n];this.emit("VAST-error",Object.assign.apply(Object,[{},Vy,t].concat(s))),Ve.track(e,t);}},{key:"getErrorURLTemplates",value:function getErrorURLTemplates(){return this.rootErrorURLTemplates.concat(this.errorURLTemplates);}},{key:"getEstimatedBitrate",value:function getEstimatedBitrate(){return Ao;}},{key:"initParsingStatus",value:function initParsingStatus(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.maxWrapperDepth=e.wrapperLimit||10,this.parsingOptions={allowMultipleAds:e.allowMultipleAds},this.keepFailedAdPod=e.keepFailedAdPod||false,this.rootURL="",this.resetParsingStatus(),ah(e.byteLength,e.requestDuration);}},{key:"resetParsingStatus",value:function resetParsingStatus(){this.errorURLTemplates=[],this.rootErrorURLTemplates=[],this.vastVersion=null;}},{key:"getRemainingAds",value:function getRemainingAds(e){var _this2=this;if(this.remainingAds.length===0)return Promise.reject(new Error("No more ads are available for the given VAST"));var t=e?this.remainingAds:[this.remainingAds.shift()];return this.errorURLTemplates=[],this.resolveAds(t,{wrapperDepth:0,url:this.rootURL}).then(function(i){return _this2.buildVASTResponse(i);});}},{key:"parseVAST",value:function parseVAST(e){var _this3=this;var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.initParsingStatus(t),t.isRootVAST=true,this.parse(e,t).then(function(i){return _this3.buildVASTResponse(i);});}},{key:"buildVASTResponse",value:function buildVASTResponse(e){var t=function(i){var s=i.ads,n=i.errorURLTemplates,a=i.version;return {ads:s||[],errorURLTemplates:n||[],version:a||null};}({ads:e,errorURLTemplates:this.getErrorURLTemplates(),version:this.vastVersion});return this.completeWrapperResolving(t),t;}},{key:"parseVastXml",value:function parseVastXml(e,t){var _t$isRootVAST=t.isRootVAST,i=_t$isRootVAST===void 0?false:_t$isRootVAST,_t$url=t.url,s=_t$url===void 0?null:_t$url,_t$wrapperDepth=t.wrapperDepth,n=_t$wrapperDepth===void 0?0:_t$wrapperDepth,a=t.allowMultipleAds,o=t.followAdditionalWrappers;if(!e||!e.documentElement||e.documentElement.nodeName!=="VAST"){var u;this.emit("VAST-ad-parsed",{type:"ERROR",url:s,wrapperDepth:n});var A=(e==null||(u=e.documentElement)===null||u===void 0?void 0:u.nodeName)==="VideoAdServingTemplate";throw new Error(A?ec:"Invalid VAST XMLDocument");}var d=[],p=e.documentElement.childNodes,T=e.documentElement.getAttribute("version");i&&T&&(this.vastVersion=T);for(var _A in p){var b=p[_A];if(b.nodeName==="Error"){var D=J.parseNodeText(b);i?this.rootErrorURLTemplates.push(D):this.errorURLTemplates.push(D);}else if(b.nodeName==="Ad"){if(this.vastVersion&&parseFloat(this.vastVersion)<3)a=true;else if(a===false&&d.length>1)break;var _D3=Uy(b,this.emit.bind(this),{allowMultipleAds:a,followAdditionalWrappers:o});_D3.ad?(d.push(_D3.ad),this.emit("VAST-ad-parsed",{type:_D3.type,url:s,wrapperDepth:n,adIndex:d.length-1,vastVersion:T})):this.trackVastError(this.getErrorURLTemplates(),{ERRORCODE:101});}}return d;}},{key:"parse",value:function parse(e){var _ref11=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_ref11$url=_ref11.url,t=_ref11$url===void 0?null:_ref11$url,_ref11$resolveAll=_ref11.resolveAll,i=_ref11$resolveAll===void 0?true:_ref11$resolveAll,_ref11$wrapperSequenc=_ref11.wrapperSequence,s=_ref11$wrapperSequenc===void 0?null:_ref11$wrapperSequenc,_ref11$previousUrl=_ref11.previousUrl,n=_ref11$previousUrl===void 0?null:_ref11$previousUrl,_ref11$wrapperDepth=_ref11.wrapperDepth,a=_ref11$wrapperDepth===void 0?0:_ref11$wrapperDepth,_ref11$isRootVAST=_ref11.isRootVAST,o=_ref11$isRootVAST===void 0?false:_ref11$isRootVAST,u=_ref11.followAdditionalWrappers,d=_ref11.allowMultipleAds,p=[];this.vastVersion&&parseFloat(this.vastVersion)<3&&o&&(d=true);try{p=this.parseVastXml(e,{isRootVAST:o,url:t,wrapperDepth:a,allowMultipleAds:d,followAdditionalWrappers:u});}catch(T){return Promise.reject(T);}if(p.length===1&&s!=null&&(p[0].sequence=s),i===false){var T=J.getSortedAdPods(p),A=J.getStandAloneAds(p);T.length?p=T:A.length&&(p=[A.shift()]),this.remainingAds=A;}return this.resolveAds(p,{wrapperDepth:a,previousUrl:n,url:t});}},{key:"resolveAds",value:function resolveAds(){var _this4=this;var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],_ref12=arguments.length>1?arguments[1]:void 0,t=_ref12.wrapperDepth,i=_ref12.previousUrl,s=_ref12.url;var n=[];return i=s,e.forEach(function(a){var o=_this4.resolveWrappers(a,t,i);n.push(o);}),Promise.all(n).then(function(a){return Ve.flatten(a);});}},{key:"resolveWrappers",value:function resolveWrappers(e,t,i){var _this5=this;var s=_objectSpread2({},e);return new Promise(function(n){var a;if(t++,!s.nextWrapperURL)return delete s.nextWrapperURL,n(s);if(!_this5.fetcher)return s.VASTAdTagURI=s.nextWrapperURL,delete s.nextWrapperURL,n(s);if(t>=_this5.maxWrapperDepth)return s.errorCode=302,delete s.nextWrapperURL,n(s);s.nextWrapperURL=J.resolveVastAdTagURI(s.nextWrapperURL,i);var o=(a=_this5.parsingOptions.allowMultipleAds)!==null&&a!==void 0?a:s.allowMultipleAds,u=s.sequence;_this5.fetcher.fetchVAST({url:s.nextWrapperURL,emitter:_this5.emit.bind(_this5),maxWrapperDepth:_this5.maxWrapperDepth}).then(function(d){return _this5.parse(d,{url:s.nextWrapperURL,previousUrl:i,wrapperSequence:u,wrapperDepth:t,followAdditionalWrappers:s.followAdditionalWrappers,allowMultipleAds:o}).then(function(p){if(delete s.nextWrapperURL,p.length===0)return s.creatives=[],n(s);p.forEach(function(T){T&&J.mergeWrapperAdData(T,s);}),n(p);});}).catch(function(d){s.errorCode=d.message===ec?102:301,s.errorMessage=d.message,n(s);});});}},{key:"completeWrapperResolving",value:function completeWrapperResolving(e){if(e.ads.length===0)this.trackVastError(e.errorURLTemplates,{ERRORCODE:303});else for(var t=e.ads.length-1;t>=0;t--){var i=e.ads[t],s=!i.creatives.some(function(n){var a,o;return ((a=n.mediaFiles)===null||a===void 0?void 0:a.length)>0||((o=n.variations)===null||o===void 0?void 0:o.length)>0;});!i.errorCode&&!s||i.VASTAdTagURI||(this.trackVastError(i.errorURLTemplates.concat(e.errorURLTemplates),{ERRORCODE:i.errorCode||303},{ERRORMESSAGE:i.errorMessage||""},{extensions:i.extensions},{system:i.system}),this.keepFailedAdPod&&i.sequence?i.hasFailed=true:e.ads.splice(t,1));}}}]);}(nh);var Pi=null;var Hy={data:{},length:0,getItem:function getItem(r){return this.data[r];},setItem:function setItem(r,e){this.data[r]=e,this.length=Object.keys(this.data).length;},removeItem:function removeItem(r){delete this.data[r],this.length=Object.keys(this.data).length;},clear:function clear(){this.data={},this.length=0;}};var zy=/*#__PURE__*/function(){function zy(){_classCallCheck(this,zy);this.storage=this.initStorage();}return _createClass(zy,[{key:"initStorage",value:function initStorage(){if(Pi)return Pi;try{Pi=(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&window!==null?window.localStorage||window.sessionStorage:null;}catch(_unused){Pi=null;}return Pi&&!this.isStorageDisabled(Pi)||(Pi=Hy,Pi.clear()),Pi;}},{key:"isStorageDisabled",value:function isStorageDisabled(e){var t="__VASTStorage__";try{if(e.setItem(t,t),e.getItem(t)!==t)return e.removeItem(t),!0;}catch(_unused2){return true;}return e.removeItem(t),false;}},{key:"getItem",value:function getItem(e){return this.storage.getItem(e);}},{key:"setItem",value:function setItem(e,t){return this.storage.setItem(e,t);}},{key:"removeItem",value:function removeItem(e){return this.storage.removeItem(e);}},{key:"clear",value:function clear(){return this.storage.clear();}}]);}();var wo=12e4,Wy={get:function(){var _get=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(r,e){var t,i,s,n,_t5;return _regenerator().w(function(_context2){while(1)switch(_context2.p=_context2.n){case 0:_context2.p=0;t=new AbortController();i=setTimeout(function(){throw t.abort(),new Error("URLHandler: Request timed out after ".concat(e.timeout||wo," ms (408)"));},e.timeout||wo);_context2.n=1;return fetch(r,_objectSpread2(_objectSpread2({},e),{},{signal:t.signal,credentials:e.withCredentials?"include":"omit"})).finally(function(){clearTimeout(i);});case 1:s=_context2.v;n=function(a){return Ve.isBrowserEnvironment()&&window.location.protocol==="https:"&&a.url.includes("http://")?"URLHandler: Cannot go from HTTPS to HTTP.":a.status===200&&a.ok?null:"URLHandler: ".concat(a.statusText," (").concat(a.status,")");}(s);return _context2.a(2,n?{error:new Error(n),statusCode:s.status}:function(){var _ref13=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(a){var o,u,_t3,_t4;return _regenerator().w(function(_context){while(1)switch(_context.n){case 0:_context.n=1;return a.text();case 1:o=_context.v;if(!Ve.isBrowserEnvironment()){_context.n=2;break;}_t3=new DOMParser();_context.n=4;break;case 2:_context.n=3;return Promise.resolve().then(function(){return G_;});case 3:_t4=_context.v.DOMParser;_t3=new _t4();case 4:u=_t3;return _context.a(2,{xml:u.parseFromString(o,"text/xml"),details:{byteLength:o.length,statusCode:a.status,rawXml:o}});}},_callee);}));return function(_x4){return _ref13.apply(this,arguments);};}()(s));case 2:_context2.p=2;_t5=_context2.v;return _context2.a(2,{error:_t5,statusCode:_t5.name==="AbortError"?408:null});}},_callee2,null,[[0,2]]);}));function get(_x2,_x3){return _get.apply(this,arguments);}return get;}()};var Gy=/*#__PURE__*/function(){function Gy(){_classCallCheck(this,Gy);this.URLTemplateFilters=[];}return _createClass(Gy,[{key:"setOptions",value:function setOptions(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.urlHandler=e.urlHandler||e.urlhandler||Wy,this.fetchingOptions=_objectSpread2(_objectSpread2({},e.fetchOptions),{},{timeout:e.timeout||wo,withCredentials:!!e.withCredentials});}},{key:"addURLTemplateFilter",value:function addURLTemplateFilter(e){typeof e=="function"&&this.URLTemplateFilters.push(e);}},{key:"removeLastURLTemplateFilter",value:function removeLastURLTemplateFilter(){this.URLTemplateFilters.pop();}},{key:"countURLTemplateFilters",value:function countURLTemplateFilters(){return this.URLTemplateFilters.length;}},{key:"clearURLTemplateFilters",value:function clearURLTemplateFilters(){this.URLTemplateFilters=[];}},{key:"fetchVAST",value:function(){var _fetchVAST=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(e){var t,i,s,n,_e$wrapperDepth,a,_e$previousUrl,o,_e$wrapperAd,u,d,p,T;return _regenerator().w(function(_context3){while(1)switch(_context3.n){case 0:i=e.url,s=e.maxWrapperDepth,n=e.emitter,_e$wrapperDepth=e.wrapperDepth,a=_e$wrapperDepth===void 0?0:_e$wrapperDepth,_e$previousUrl=e.previousUrl,o=_e$previousUrl===void 0?null:_e$previousUrl,_e$wrapperAd=e.wrapperAd,u=_e$wrapperAd===void 0?null:_e$wrapperAd;d=Date.now();this.URLTemplateFilters.forEach(function(A){i=A(i);}),n("VAST-resolving",{url:i,previousUrl:o,wrapperDepth:a,maxWrapperDepth:s,timeout:this.fetchingOptions.timeout,wrapperAd:u});_context3.n=1;return this.urlHandler.get(i,this.fetchingOptions);case 1:p=_context3.v;T=Math.round(Date.now()-d);if(!(n("VAST-resolved",_objectSpread2({url:i,previousUrl:o,wrapperDepth:a,error:(p===null||p===void 0?void 0:p.error)||null,duration:T,statusCode:(p===null||p===void 0?void 0:p.statusCode)||null},p===null||p===void 0?void 0:p.details)),ah(p==null||(t=p.details)===null||t===void 0?void 0:t.byteLength,T),p.error)){_context3.n=2;break;}throw new Error(p.error);case 2:return _context3.a(2,p.xml);}},_callee3,this);}));function fetchVAST(_x5){return _fetchVAST.apply(this,arguments);}return fetchVAST;}()}]);}(),Ky=/*#__PURE__*/function(){function Ky(){_classCallCheck(this,Ky);var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new zy();this.cappingFreeLunch=e,this.cappingMinimumTimeInterval=t,this.fetcher=new Gy(),this.vastParser=new jy({fetcher:this.fetcher}),this.storage=i,this.lastSuccessfulAd===void 0&&(this.lastSuccessfulAd=0),this.totalCalls===void 0&&(this.totalCalls=0),this.totalCallsTimeout===void 0&&(this.totalCallsTimeout=0);}return _createClass(Ky,[{key:"addURLTemplateFilter",value:function addURLTemplateFilter(e){this.fetcher.addURLTemplateFilter(e);}},{key:"removeLastURLTemplateFilter",value:function removeLastURLTemplateFilter(){this.fetcher.removeLastURLTemplateFilter();}},{key:"countURLTemplateFilters",value:function countURLTemplateFilters(){return this.fetcher.countURLTemplateFilters();}},{key:"clearURLTemplateFilters",value:function clearURLTemplateFilters(){this.fetcher.clearURLTemplateFilters();}},{key:"getParser",value:function getParser(){return this.vastParser;}},{key:"lastSuccessfulAd",get:function get(){return this.storage.getItem("vast-client-last-successful-ad");},set:function set(e){this.storage.setItem("vast-client-last-successful-ad",e);}},{key:"totalCalls",get:function get(){return this.storage.getItem("vast-client-total-calls");},set:function set(e){this.storage.setItem("vast-client-total-calls",e);}},{key:"totalCallsTimeout",get:function get(){return this.storage.getItem("vast-client-total-calls-timeout");},set:function set(e){this.storage.setItem("vast-client-total-calls-timeout",e);}},{key:"hasRemainingAds",value:function hasRemainingAds(){return this.vastParser.remainingAds.length>0;}},{key:"getNextAds",value:function getNextAds(e){return this.vastParser.getRemainingAds(e);}},{key:"parseVAST",value:function parseVAST(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.fetcher.setOptions(t),this.vastParser.parseVAST(e,t);}},{key:"get",value:function get(e){var _this6=this;var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var i=Date.now();return t.hasOwnProperty("resolveAll")||(t.resolveAll=false),this.totalCallsTimeout<i?(this.totalCalls=1,this.totalCallsTimeout=i+36e5):this.totalCalls++,new Promise(function(s,n){if(_this6.cappingFreeLunch>=_this6.totalCalls)return n(new Error("VAST call canceled – FreeLunch capping not reached yet ".concat(_this6.totalCalls,"/").concat(_this6.cappingFreeLunch)));var a=i-_this6.lastSuccessfulAd;if(a<0)_this6.lastSuccessfulAd=0;else if(a<_this6.cappingMinimumTimeInterval)return n(new Error("VAST call canceled – (".concat(_this6.cappingMinimumTimeInterval,")ms minimum interval reached")));_this6.vastParser.initParsingStatus(t),_this6.fetcher.setOptions(t),_this6.vastParser.rootURL=e,_this6.fetcher.fetchVAST({url:e,emitter:_this6.vastParser.emit.bind(_this6.vastParser),maxWrapperDepth:_this6.vastParser.maxWrapperDepth}).then(function(o){return t.previousUrl=e,t.isRootVAST=true,t.url=e,_this6.vastParser.parse(o,t).then(function(u){var d=_this6.vastParser.buildVASTResponse(u);s(d);});}).catch(function(o){return n(o);});});}}]);}(),Xy=/*#__PURE__*/function(_nh2){function Xy(e,t,i){var _this7;_classCallCheck(this,Xy);var s;var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a=arguments.length>4&&arguments[4]!==void 0&&arguments[4];_this7=_callSuper(this,Xy),_this7.ad=t,_this7.creative=i,_this7.variation=n,_this7.muted=a,_this7.impressed=false,_this7.skippable=false,_this7.trackingEvents={},_this7.trackedProgressEvents=[],_this7.lastPercentage=0,_this7._alreadyTriggeredQuartiles={},_this7.emitAlwaysEvents=["creativeView","start","firstQuartile","midpoint","thirdQuartile","complete","resume","pause","rewind","skip","closeLinear","close"];for(var o in _this7.creative.trackingEvents){var u=_this7.creative.trackingEvents[o];_this7.trackingEvents[o]=u.slice(0);}_this7.viewableImpressionTrackers=((s=_this7.ad.viewableImpression)===null||s===void 0?void 0:s.reduce(function(o,u){var _o$notViewable,_o$viewUndetermined,_o$viewable;return (_o$notViewable=o.notViewable).push.apply(_o$notViewable,_toConsumableArray(u.notViewable)),(_o$viewUndetermined=o.viewUndetermined).push.apply(_o$viewUndetermined,_toConsumableArray(u.viewUndetermined)),(_o$viewable=o.viewable).push.apply(_o$viewable,_toConsumableArray(u.viewable)),o;},{notViewable:[],viewUndetermined:[],viewable:[]}))||{},Object.entries(_this7.viewableImpressionTrackers).forEach(function(o){var _o3=_slicedToArray(o,2),u=_o3[0],d=_o3[1];d.length&&(_this7.trackingEvents[u]=d);}),function(o){return o.type==="linear";}(_this7.creative)?_this7._initLinearTracking():_this7._initVariationTracking(),e&&_this7.on("start",function(){e.lastSuccessfulAd=Date.now();});return _this7;}_inherits(Xy,_nh2);return _createClass(Xy,[{key:"_initLinearTracking",value:function _initLinearTracking(){this.linear=true,this.skipDelay=this.creative.skipDelay,this.setDuration(this.creative.duration),this.clickThroughURLTemplate=this.creative.videoClickThroughURLTemplate,this.clickTrackingURLTemplates=this.creative.videoClickTrackingURLTemplates;}},{key:"_initVariationTracking",value:function _initVariationTracking(){if(this.linear=false,this.skipDelay=-1,this.variation){for(var e in this.variation.trackingEvents){var t=this.variation.trackingEvents[e];this.trackingEvents[e]?this.trackingEvents[e]=this.trackingEvents[e].concat(t.slice(0)):this.trackingEvents[e]=t.slice(0);}this.variation.adType==="nonLinearAd"?(this.clickThroughURLTemplate=this.variation.nonlinearClickThroughURLTemplate,this.clickTrackingURLTemplates=this.variation.nonlinearClickTrackingURLTemplates,this.setDuration(this.variation.minSuggestedDuration)):function(e){return e.adType==="companionAd";}(this.variation)&&(this.clickThroughURLTemplate=this.variation.companionClickThroughURLTemplate,this.clickTrackingURLTemplates=this.variation.companionClickTrackingURLTemplates);}}},{key:"setDuration",value:function setDuration(e){Ve.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)});}},{key:"setProgress",value:function setProgress(e){var _this8=this;var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(!Ve.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(Ve.formatMacrosValues(t))});var s=this.skipDelay||-1;if(s===-1||this.skippable||(s>e?this.emit("skip-countdown",s-e):(this.skippable=true,this.emit("skip-countdown",0))),this.assetDuration>0){var n=Math.round(e/this.assetDuration*100),a=[];if(e>0){a.push("start");for(var o=this.lastPercentage;o<n;o++)a.push("progress-".concat(o+1,"%"));a.push("progress-".concat(e));for(var _o4 in this.quartiles)this.isQuartileReached(_o4,this.quartiles[_o4],e)&&(a.push(_o4),this._alreadyTriggeredQuartiles[_o4]=true);this.lastPercentage=n;}a.forEach(function(o){_this8.track(o,{macros:t,once:i});}),e<this.progress&&(this.track("rewind",{macros:t}),this.trackedProgressEvents&&this.trackedProgressEvents.splice(0));}this.progress=e;}},{key:"isQuartileReached",value:function isQuartileReached(e,t,i){var s=false;return t<=i&&!this._alreadyTriggeredQuartiles[e]&&(s=true),s;}},{key:"setMuted",value:function setMuted(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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(Ve.formatMacrosValues(t))});}},{key:"setPaused",value:function setPaused(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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(Ve.formatMacrosValues(t))});}},{key:"setFullscreen",value:function setFullscreen(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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(Ve.formatMacrosValues(t))});}},{key:"setExpand",value:function setExpand(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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(Ve.formatMacrosValues(t))});}},{key:"setSkipDelay",value:function setSkipDelay(e){Ve.isValidTimeValue(e)?this.skipDelay=e:this.emit("TRACKER-error",{message:"setSkipDelay parameter does not have a valid value. duration: ".concat(e)});}},{key:"trackImpression",value:function trackImpression(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.impressed||(this.impressed=true,this.trackURLs(this.ad.impressionURLTemplates,e),this.track("creativeView",{macros:e})):this.emit("TRACKER-error",{message:"trackImpression parameter has the wrong type. macros: ".concat(e)});}},{key:"trackViewableImpression",value:function trackViewableImpression(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];_typeof(e)=="object"?this.track("viewable",{macros:e,once:t}):this.emit("TRACKER-error",{message:"trackViewableImpression given macros has the wrong type. macros: ".concat(e)});}},{key:"trackNotViewableImpression",value:function trackNotViewableImpression(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];_typeof(e)=="object"?this.track("notViewable",{macros:e,once:t}):this.emit("TRACKER-error",{message:"trackNotViewableImpression given macros has the wrong type. macros: ".concat(e)});}},{key:"trackUndeterminedImpression",value:function trackUndeterminedImpression(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];_typeof(e)=="object"?this.track("viewUndetermined",{macros:e,once:t}):this.emit("TRACKER-error",{message:"trackUndeterminedImpression given macros has the wrong type. macros: ".concat(e)});}},{key:"error",value:function error(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];_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(Ve.formatMacrosValues(e),", isCustomCode: ").concat(t)});}},{key:"errorWithCode",value:function errorWithCode(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];typeof e=="string"&&typeof t=="boolean"?(this.error({ERRORCODE:e},t),console.log("The method errorWithCode is deprecated, please use vast tracker error method instead")):this.emit("TRACKER-error",{message:"One given errorWithCode parameter has the wrong type. errorCode: ".concat(e,", isCustomCode: ").concat(t)});}},{key:"complete",value:function complete(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track("complete",{macros:e}):this.emit("TRACKER-error",{message:"complete given macros has the wrong type. macros: ".concat(e)});}},{key:"notUsed",value:function notUsed(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?(this.track("notUsed",{macros:e}),this.trackingEvents=[]):this.emit("TRACKER-error",{message:"notUsed given macros has the wrong type. macros: ".concat(e)});}},{key:"otherAdInteraction",value:function otherAdInteraction(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track("otherAdInteraction",{macros:e}):this.emit("TRACKER-error",{message:"otherAdInteraction given macros has the wrong type. macros: ".concat(e)});}},{key:"acceptInvitation",value:function acceptInvitation(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track("acceptInvitation",{macros:e}):this.emit("TRACKER-error",{message:"acceptInvitation given macros has the wrong type. macros: ".concat(e)});}},{key:"adExpand",value:function adExpand(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track("adExpand",{macros:e}):this.emit("TRACKER-error",{message:"adExpand given macros has the wrong type. macros: ".concat(e)});}},{key:"adCollapse",value:function adCollapse(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track("adCollapse",{macros:e}):this.emit("TRACKER-error",{message:"adCollapse given macros has the wrong type. macros: ".concat(e)});}},{key:"minimize",value:function minimize(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track("minimize",{macros:e}):this.emit("TRACKER-error",{message:"minimize given macros has the wrong type. macros: ".concat(e)});}},{key:"verificationNotExecuted",value:function verificationNotExecuted(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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(Ve.formatMacrosValues(t))});if(!this.ad||!this.ad.adVerifications||!this.ad.adVerifications.length)throw new Error("No adVerifications provided");if(!e)throw new Error("No vendor provided, unable to find associated verificationNotExecuted");var i=this.ad.adVerifications.find(function(n){return n.vendor===e;});if(!i)throw new Error("No associated verification element found for vendor: ".concat(e));var s=i.trackingEvents;if(s&&s.verificationNotExecuted){var n=s.verificationNotExecuted;this.trackURLs(n,t),this.emit("verificationNotExecuted",{trackingURLTemplates:n});}}},{key:"overlayViewDuration",value:function overlayViewDuration(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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(Ve.formatMacrosValues(t))});}},{key:"close",value:function close(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track(this.linear?"closeLinear":"close",{macros:e}):this.emit("TRACKER-error",{message:"close given macros has the wrong type. macros: ".concat(e)});}},{key:"skip",value:function skip(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track("skip",{macros:e}):this.emit("TRACKER-error",{message:"skip given macros has the wrong type. macros: ".concat(e)});}},{key:"load",value:function load(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track("loaded",{macros:e}):this.emit("TRACKER-error",{message:"load given macros has the wrong type. macros: ".concat(e)});}},{key:"click",value:function click(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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(Ve.formatMacrosValues(t))});this.clickTrackingURLTemplates&&this.clickTrackingURLTemplates.length&&this.trackURLs(this.clickTrackingURLTemplates,t);var i=this.clickThroughURLTemplate||e,s=_objectSpread2({},t);if(i){this.progress&&(s.ADPLAYHEAD=this.progressFormatted());var n=Ve.resolveURLTemplates([i],s)[0];this.emit("clickthrough",n);}}},{key:"trackProgressEvents",value:function trackProgressEvents(e,t,i){var _this9=this;var s=parseFloat(e.split("-")[1]);Object.entries(this.trackingEvents).filter(function(n){var _n5=_slicedToArray(n,1),a=_n5[0];return a.startsWith("progress-");}).map(function(n){var _n6=_slicedToArray(n,2),a=_n6[0],o=_n6[1];return {name:a,time:parseFloat(a.split("-")[1]),urls:o};}).filter(function(n){var a=n.time;return a<=s&&a>_this9.progress;}).forEach(function(n){var a=n.name,o=n.urls;!i&&_this9.trackedProgressEvents.includes(a)||(_this9.emit(a,{trackingURLTemplates:o}),_this9.trackURLs(o,t),i?delete _this9.trackingEvents[a]:_this9.trackedProgressEvents.push(a));});}},{key:"track",value:function track(e){var _ref14=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_ref14$macros=_ref14.macros,t=_ref14$macros===void 0?{}:_ref14$macros,_ref14$once=_ref14.once,i=_ref14$once===void 0?false:_ref14$once;if(_typeof(t)!="object")return void this.emit("TRACKER-error",{message:"track given macros has the wrong type. macros: ".concat(t)});e==="closeLinear"&&!this.trackingEvents[e]&&this.trackingEvents.close&&(e="close"),e.startsWith("progress-")&&!e.endsWith("%")&&this.trackProgressEvents(e,t,i);var s=this.trackingEvents[e],n=this.emitAlwaysEvents.indexOf(e)>-1;s?(this.emit(e,{trackingURLTemplates:s}),this.trackURLs(s,t)):n&&this.emit(e,null),i&&(delete this.trackingEvents[e],n&&this.emitAlwaysEvents.splice(this.emitAlwaysEvents.indexOf(e),1));}},{key:"trackURLs",value:function trackURLs(e){var t;var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var _Ve$filterUrlTemplate=Ve.filterUrlTemplates(e),n=_Ve$filterUrlTemplate.validUrls,a=_Ve$filterUrlTemplate.invalidUrls;a.length&&this.emit("TRACKER-error",{message:"Provided urls are malformed. url: ".concat(a)});var o=_objectSpread2({},i);this.linear&&(this.creative&&this.creative.mediaFiles&&this.creative.mediaFiles[0]&&this.creative.mediaFiles[0].fileURL&&(o.ASSETURI=this.creative.mediaFiles[0].fileURL),this.progress&&(o.ADPLAYHEAD=this.progressFormatted())),(t=this.creative)!==null&&t!==void 0&&(t=t.universalAdIds)!==null&&t!==void 0&&t.length&&(o.UNIVERSALADID=this.creative.universalAdIds.map(function(u){return u.idRegistry.concat(" ",u.value);}).join(",")),this.ad&&(this.ad.sequence&&(o.PODSEQUENCE=this.ad.sequence),this.ad.adType&&(o.ADTYPE=this.ad.adType),this.ad.adServingId&&(o.ADSERVINGID=this.ad.adServingId),this.ad.categories&&this.ad.categories.length&&(o.ADCATEGORIES=this.ad.categories.map(function(u){return u.value;}).join(",")),this.ad.blockedAdCategories&&this.ad.blockedAdCategories.length&&(o.BLOCKEDADCATEGORIES=this.ad.blockedAdCategories.map(function(u){return u.value;}).join(","))),Ve.track(n,o,s);}},{key:"convertToTimecode",value:function convertToTimecode(e){if(!Ve.isValidTimeValue(e))return "";var t=1e3*e,i=Math.floor(t/36e5),s=Math.floor(t/6e4%60),n=Math.floor(t/1e3%60),a=Math.floor(t%1e3);return "".concat(Ve.addLeadingZeros(i,2),":").concat(Ve.addLeadingZeros(s,2),":").concat(Ve.addLeadingZeros(n,2),".").concat(Ve.addLeadingZeros(a,3));}},{key:"progressFormatted",value:function progressFormatted(){return this.convertToTimecode(this.progress);}}]);}(nh);var Fa,tc;function Zn(){if(tc)return Fa;tc=1;var r;return (typeof window==="undefined"?"undefined":_typeof(window))<"u"?r=window:_typeof(a$1)<"u"?r=a$1:(typeof self==="undefined"?"undefined":_typeof(self))<"u"?r=self:r={},Fa=r,Fa;}var Yy=Zn();var N=/* @__PURE__ */f$1(Yy),Qy={},Jy=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:Qy},Symbol.toStringTag,{value:"Module"})),Zy=/* @__PURE__ */c$1(Jy);var Ua,ic;function oh(){if(ic)return Ua;ic=1;var r=_typeof(a$1)<"u"?a$1:(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:{},e=Zy,t;return (typeof document==="undefined"?"undefined":_typeof(document))<"u"?t=document:(t=r["__GLOBAL_DOCUMENT_CACHE@4"],t||(t=r["__GLOBAL_DOCUMENT_CACHE@4"]=e)),Ua=t,Ua;}var e_=oh();var de=/* @__PURE__ */f$1(e_);var pn={exports:{}},$a={exports:{}},rc;function t_(){return rc||(rc=1,function(r){function e(){return r.exports=e=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var n in s)({}).hasOwnProperty.call(s,n)&&(t[n]=s[n]);}return t;},r.exports.__esModule=true,r.exports.default=r.exports,e.apply(null,arguments);}r.exports=e,r.exports.__esModule=true,r.exports.default=r.exports;}($a)),$a.exports;}var qa,sc;function i_(){if(sc)return qa;sc=1,qa=e;var r=Object.prototype.toString;function e(t){if(!t)return false;var i=r.call(t);return i==="[object Function]"||typeof t=="function"&&i!=="[object RegExp]"||(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&(// IE8 and below
7226
+ function Jg(r,e){var _loop=function _loop(){var i=e[t];if(typeof i!="string"&&!Array.isArray(i)){var _loop2=function _loop2(s){if(s!=="default"&&!(s in r)){var n=Object.getOwnPropertyDescriptor(i,s);n&&Object.defineProperty(r,s,n.get?n:{enumerable:true,get:function get(){return i[s];}});}};for(var s in i){_loop2(s);}}};for(var t=0;t<e.length;t++){_loop();}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}));}var Zg=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function Ud(r){return typeof r=="string"&&Zg.test(r);}function Nu(r){if(!Ud(r))throw TypeError("Invalid UUID");var e;return Uint8Array.of((e=parseInt(r.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(r.slice(9,13),16))>>>8,e&255,(e=parseInt(r.slice(14,18),16))>>>8,e&255,(e=parseInt(r.slice(19,23),16))>>>8,e&255,(e=parseInt(r.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255);}function e0(r){r=unescape(encodeURIComponent(r));var e=new Uint8Array(r.length);for(var t=0;t<r.length;++t)e[t]=r.charCodeAt(t);return e;}var t0="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i0="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function r0(r,e,t,i,s,n){var _i2;var a=typeof t=="string"?e0(t):t,o=typeof i=="string"?Nu(i):i;if(typeof i=="string"&&(i=Nu(i)),((_i2=i)===null||_i2===void 0?void 0:_i2.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var u=new Uint8Array(16+a.length);if(u.set(o),u.set(a,o.length),u=e(u),u[6]=u[6]&15|r,u[8]=u[8]&63|128,s){n=n||0;for(var d=0;d<16;++d)s[n+d]=u[d];return s;}return Db$1(u);}function s0(r,e,t,i){switch(r){case 0:return e&t^~e&i;case 1:return e^t^i;case 2:return e&t^e&i^t&i;case 3:return e^t^i;}}function Ma(r,e){return r<<e|r>>>32-e;}function n0(r){var e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520],i=new Uint8Array(r.length+1);i.set(r),i[r.length]=128,r=i;var s=r.length/4+2,n=Math.ceil(s/16),a=new Array(n);for(var o=0;o<n;++o){var u=new Uint32Array(16);for(var d=0;d<16;++d)u[d]=r[o*64+d*4]<<24|r[o*64+d*4+1]<<16|r[o*64+d*4+2]<<8|r[o*64+d*4+3];a[o]=u;}a[n-1][14]=(r.length-1)*8/Math.pow(2,32),a[n-1][14]=Math.floor(a[n-1][14]),a[n-1][15]=(r.length-1)*8&4294967295;for(var _o2=0;_o2<n;++_o2){var _u2=new Uint32Array(80);for(var D=0;D<16;++D)_u2[D]=a[_o2][D];for(var _D=16;_D<80;++_D)_u2[_D]=Ma(_u2[_D-3]^_u2[_D-8]^_u2[_D-14]^_u2[_D-16],1);var _d2=t[0],p=t[1],T=t[2],A=t[3],b=t[4];for(var _D2=0;_D2<80;++_D2){var v=Math.floor(_D2/20),R=Ma(_d2,5)+s0(v,p,T,A)+b+e[v]+_u2[_D2]>>>0;b=A,A=T,T=Ma(p,30)>>>0,p=_d2,_d2=R;}t[0]=t[0]+_d2>>>0,t[1]=t[1]+p>>>0,t[2]=t[2]+T>>>0,t[3]=t[3]+A>>>0,t[4]=t[4]+b>>>0;}return Uint8Array.of(t[0]>>24,t[0]>>16,t[0]>>8,t[0],t[1]>>24,t[1]>>16,t[1]>>8,t[1],t[2]>>24,t[2]>>16,t[2]>>8,t[2],t[3]>>24,t[3]>>16,t[3]>>8,t[3],t[4]>>24,t[4]>>16,t[4]>>8,t[4]);}function Dn(r,e,t,i){return r0(80,n0,r,e,t,i);}Dn.DNS=t0;Dn.URL=i0;function at(){return at=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i]);}return r;},at.apply(null,arguments);}var a0=/* @__PURE__ */ne("div")({name:"Container",class:"c5b6wdg",propsAsIs:false}),o0="a1rlj479",l0="s35f1di",u0="sj4471g",c0="b12050d8",d0="b1d5ybek",h0=function h0(r){return r==="left"||r==="right"?l0:c0;},f0=function f0(r){return r==="left"||r==="right"?u0:d0;},p0=function p0(r){return r==="left"?"avdxyl3":r==="right"?"a1bisd08":r==="top"?"a1u9y2aj":"a1qqaks";},tl=function tl(_ref){var r=_ref.children,e=_ref.style,t=_ref.className,_ref$enabled=_ref.enabled,i=_ref$enabled===void 0?true:_ref$enabled,s=_ref.hiding,_ref$direction=_ref.direction,n=_ref$direction===void 0?"left":_ref$direction,a=_ref.onAnimationEnd;return/* @__PURE__ */jsxRuntime.jsx(a0,{style:e,className:T$1(t,o0,p0(n),i&&!s&&h0(n),i&&s&&f0(n)),onAnimationEnd:a,children:r});},m0=/* @__PURE__ */ne("a")({name:"Link",class:"l1sgte8c",propsAsIs:false}),g0=/* @__PURE__ */ne("div")({name:"BannerContainer",class:"b7yfc72",propsAsIs:false}),y0=function y0(){return m0;},_0=/* @__PURE__ */ne(y0())({name:"BannerLink",class:"bejjq94",propsAsIs:true}),$d=function $d(_ref2){var r=_ref2.promotion,e=_ref2.promotionId,t=_ref2.hiding,i=_ref2.isEventFired,s=_ref2.fireEvent,_ref2$direction=_ref2.direction,n=_ref2$direction===void 0?"bottom":_ref2$direction;var a=(r===null||r===void 0?void 0:r.adUnit)===Se$2.STANDART,o=a?r.banner:r.additionalBanner;if(e$2.useEffect(function(){(o===null||o===void 0?void 0:o.imageUrl)&&e&&((i===null||i===void 0?void 0:i("banner-showed"))||(l$1.emit("advertisement",{action:"bannerShown",payload:{id:e,type:r.type}}),s===null||s===void 0?void 0:s("banner-showed")));},[o===null||o===void 0?void 0:o.imageUrl,s,i,r.type,e]),!(o!==null&&o!==void 0&&o.imageUrl))return null;var u=o===null||o===void 0?void 0:o.url;return u&&u.indexOf("http")!==0&&(u="https://".concat(u)),/* @__PURE__ */jsxRuntime.jsx(tl,{direction:n,hiding:t,children:/* @__PURE__ */jsxRuntime.jsx(g0,{className:"BannerContainer","data-is-ad":a,children:/* @__PURE__ */jsxRuntime.jsx(_0,{as:u?"a":"span",className:"BannerLink",href:u,style:{backgroundImage:"url(".concat(o.imageUrl,")"),cursor:u?"pointer":"default"},"data-promo-id":e,"data-promo-type":r.type,"data-a":"banner",target:"_blank","data-is-ad":a})})});},T0=function T0(_ref3){var r=_ref3.isEventFired,e=_ref3.fireEvent,t=_ref3.cardId,i=_ref3.promotion,_ref3$direction=_ref3.direction,s=_ref3$direction===void 0?"bottom":_ref3$direction;return/* @__PURE__ */jsxRuntime.jsx($d,{isEventFired:r,fireEvent:e,promotion:i,promotionId:t,direction:s,hiding:false});},v0=/* @__PURE__ */ne("div")({name:"NotificationContent",class:"n18wsqoo",propsAsIs:false}),b0=/* @__PURE__ */ne("div")({name:"Body",class:"b1ia90c2",propsAsIs:false}),x0=/* @__PURE__ */ne("div")({name:"Title",class:"tg2z08v",propsAsIs:false}),S0=/* @__PURE__ */ne("div")({name:"Text",class:"t59zdk1",propsAsIs:false}),Sr=/* @__PURE__ */ne("div")({name:"MediaImgBottom",class:"m1ab9fq",propsAsIs:false}),E0=function E0(){return Sr;},C0=/* @__PURE__ */ne(E0())({name:"MediaImgMiddle",class:"m9fsr0y",propsAsIs:true}),Ou=/* @__PURE__ */ne("img")({name:"CtaIcon",class:"cvi9y5q",propsAsIs:false}),A0=/* @__PURE__ */ne("div")({name:"Logo",class:"l5mq0z",propsAsIs:false}),w0=/* @__PURE__ */ne("div")({name:"Footer",class:"f1mse0ft",propsAsIs:false}),D0=/* @__PURE__ */ne("div")({name:"Vector",class:"v1hcloah",propsAsIs:false}),I0=/* @__PURE__ */ne("div")({name:"NotificationContainer",class:"n3n65jf",propsAsIs:false}),qd=/* @__PURE__ */ne("button")({name:"TVButton",class:"tkkfuqy",propsAsIs:false}),k0=function k0(){return qd;},P0=/* @__PURE__ */ne(k0())({name:"DismissButton",class:"dh9vato",propsAsIs:true}),R0=function R0(){return qd;},Vd=/* @__PURE__ */ne(R0())({name:"OpenButton",class:"oeah8gv",propsAsIs:true}),L0=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},DA.UNSET,Sr),DA.FIT,Sr),DA.CENTERED,Sr),DA.SOLID,Sr),DA.BOTTOM,Sr),DA.MIDDLE,C0),N0=function N0(_ref4){var r=_ref4.src,e=_ref4.imagePosition;var t=L0[e];return/* @__PURE__ */jsxRuntime.jsx(t,{children:/* @__PURE__ */jsxRuntime.jsx("img",{src:r,alt:""})});},O0=Te$1(P0),B0=Te$1(Vd),M0=function M0(_ref5){var r=_ref5.notification,e=_ref5.open,t=_ref5.close,i=_ref5.webos;if(!r||!r.promotion||r.enabled!==tn$1.NOTIFICATION_ENABLED)return null;var s=r.title,n=r.body,a=r.image,o=r.promotion,u=o.sponsorLogo,d=o.sponsorLogoMode,p=o.imagePosition,T=o.ctaButton;return/* @__PURE__ */jsxRuntime.jsxs(I0,{"data-webos":i,className:"SL_Lower_Third_Notification",onClick:i?void 0:e,children:[/* @__PURE__ */jsxRuntime.jsxs(v0,{children:[/* @__PURE__ */jsxRuntime.jsx(N0,{src:a,imagePosition:p}),/* @__PURE__ */jsxRuntime.jsxs(b0,{children:[s&&/* @__PURE__ */jsxRuntime.jsx(x0,{children:s}),n&&/* @__PURE__ */jsxRuntime.jsx(S0,{children:n})]})]}),/* @__PURE__ */jsxRuntime.jsxs(w0,{children:[d!==jA.NOTIFICATION_SPONSOR_LOGO_NONE&&/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[/* @__PURE__ */jsxRuntime.jsx(A0,{children:/* @__PURE__ */jsxRuntime.jsx("img",{src:u,alt:s})}),/* @__PURE__ */jsxRuntime.jsx(D0,{})]}),i?/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[/* @__PURE__ */jsxRuntime.jsx(O0,{webos:true,onClick:t,children:"Dismiss"}),/* @__PURE__ */jsxRuntime.jsxs(B0,{webos:true,autoFocus:true,style:{color:T===null||T===void 0?void 0:T.textColor,backgroundColor:T===null||T===void 0?void 0:T.color},onClick:e,children:[(T===null||T===void 0?void 0:T.ctaIcon)&&(T===null||T===void 0?void 0:T.ctaIconMode)===PA.CTA_ICON_TRANSPARENT&&/* @__PURE__ */jsxRuntime.jsx(Ou,{src:T===null||T===void 0?void 0:T.ctaIcon,alt:"cta-icon"}),(T===null||T===void 0?void 0:T.label)||"Open"]})]}):/* @__PURE__ */jsxRuntime.jsxs(Vd,{name:"promo-button",style:{color:T===null||T===void 0?void 0:T.textColor,backgroundColor:T===null||T===void 0?void 0:T.color},children:[(T===null||T===void 0?void 0:T.ctaIcon)&&(T===null||T===void 0?void 0:T.ctaIconMode)===PA.CTA_ICON_TRANSPARENT&&/* @__PURE__ */jsxRuntime.jsx(Ou,{src:T===null||T===void 0?void 0:T.ctaIcon,alt:"cta-icon"}),(T===null||T===void 0?void 0:T.label)||"Open"]})]})]});},F0=/* @__PURE__ */ne("div")({name:"NotificationContent",class:"n1ku6hz",propsAsIs:false}),U0=/* @__PURE__ */ne("div")({name:"NotificationContainer",class:"nbxqmol",propsAsIs:false}),$0=/* @__PURE__ */ne("div")({name:"Body",class:"b1gu3eml",propsAsIs:false}),q0=/* @__PURE__ */ne("div")({name:"Title",class:"t1u17zva",propsAsIs:false}),V0=/* @__PURE__ */ne("div")({name:"Text",class:"t10ko1g",propsAsIs:false}),Jn=/* @__PURE__ */ne("div")({name:"Media",class:"mntc42e",propsAsIs:false}),j0=function j0(){return Jn;},Bu=/* @__PURE__ */ne(j0())({name:"MediaImgFit",class:"ml060eo",propsAsIs:true}),H0=function H0(){return Jn;},jd=/* @__PURE__ */ne(H0())({name:"MediaImgCentered",class:"m1vqlvig",propsAsIs:true}),z0=function z0(){return jd;},W0=/* @__PURE__ */ne(z0())({name:"MediaImgBottom",class:"m1e7tvi5",propsAsIs:true}),G0=function G0(){return Jn;},K0=/* @__PURE__ */ne(G0())({name:"MediaImgSolid",class:"mqvntt2",propsAsIs:true}),X0=function X0(){return Jn;},Y0=/* @__PURE__ */ne(X0())({name:"MediaImgMiddle",class:"m12jtj3u",propsAsIs:true}),Q0=/* @__PURE__ */ne("img")({name:"CtaIcon",class:"ckq1frv",propsAsIs:false}),J0=function J0(){return E1$1;},Z0=/* @__PURE__ */ne(J0())({name:"StyledChevronRight",class:"s9mjmz3",propsAsIs:true}),ey=/* @__PURE__ */ne("div")({name:"Logo",class:"l1cf50a7",propsAsIs:false}),Hd=/* @__PURE__ */ne("button")({name:"TVButton",class:"thdqfl0",propsAsIs:false}),ty=function ty(){return Hd;},iy=/* @__PURE__ */ne(ty())({name:"DismissButton",class:"d11pe8bx",propsAsIs:true}),ry=function ry(){return Hd;},sy=/* @__PURE__ */ne(ry())({name:"OpenButton",class:"oy9k0kp",propsAsIs:true}),ny=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},DA.UNSET,Bu),DA.FIT,Bu),DA.CENTERED,jd),DA.BOTTOM,W0),DA.SOLID,K0),DA.MIDDLE,Y0),ay=function ay(_ref6){var r=_ref6.src,e=_ref6.imagePosition;var t=ny[e];return/* @__PURE__ */jsxRuntime.jsx(t,{children:/* @__PURE__ */jsxRuntime.jsx("img",{src:r,alt:""})});},oy=Te$1(iy),ly=Te$1(sy),uy=function uy(_ref7){var r=_ref7.notification,e=_ref7.open;_ref7.promotionId;var i=_ref7.hiding,_ref7$direction=_ref7.direction,s=_ref7$direction===void 0?"left":_ref7$direction,n=_ref7.close,a=_ref7.webos;if(!r||!r.promotion||r.enabled!==tn$1.NOTIFICATION_ENABLED)return null;if(r.promotion.mode===OA.LOWER_THIRD)return/* @__PURE__ */jsxRuntime.jsx(M0,{notification:r,open:e,close:n,webos:a});var o=r.title,u=r.body,d=r.image,p=r.promotion,T=p.sponsorLogo,A=p.sponsorLogoMode,b=p.imagePosition,D=p.ctaButton,v=function v(R){R.stopPropagation(),n===null||n===void 0?void 0:n();};return/* @__PURE__ */jsxRuntime.jsx(tl,{className:"SL_Rich_Notification",direction:s,hiding:i,children:/* @__PURE__ */jsxRuntime.jsxs(U0,{onClick:a?function(){}:e,children:[A!==jA.NOTIFICATION_SPONSOR_LOGO_NONE&&T&&/* @__PURE__ */jsxRuntime.jsx(ey,{children:/* @__PURE__ */jsxRuntime.jsx("img",{src:T,alt:o})}),/* @__PURE__ */jsxRuntime.jsxs(F0,{children:[/* @__PURE__ */jsxRuntime.jsx(ay,{src:d,imagePosition:b}),/* @__PURE__ */jsxRuntime.jsxs($0,{children:[o&&/* @__PURE__ */jsxRuntime.jsx(q0,{children:o}),u&&/* @__PURE__ */jsxRuntime.jsx(V0,{children:u})]}),a&&/* @__PURE__ */jsxRuntime.jsx(oy,{webos:true,onClick:v,children:"Dismiss"}),/* @__PURE__ */jsxRuntime.jsxs(ly,{webos:a,autoFocus:a,onClick:a?e:function(){},name:"promo-button",style:{color:D===null||D===void 0?void 0:D.textColor,backgroundColor:D===null||D===void 0?void 0:D.color},children:[(D===null||D===void 0?void 0:D.ctaIcon)&&(D===null||D===void 0?void 0:D.ctaIconMode)===PA.CTA_ICON_TRANSPARENT&&/* @__PURE__ */jsxRuntime.jsx(Q0,{src:D===null||D===void 0?void 0:D.ctaIcon,alt:"cta-icon"}),(D===null||D===void 0?void 0:D.label)||"Open"]}),/* @__PURE__ */jsxRuntime.jsx(Z0,{name:"chevronRight"})]})]})});},cy=/* @__PURE__ */ne("div")({name:"OverlayContainer",class:"okzhq2w",propsAsIs:false}),zd=/* @__PURE__ */ne("div")({name:"PromoOverlay",class:"pmgz5i",propsAsIs:false}),Wd=/* @__PURE__ */ne("div")({name:"Header",class:"hyxi3jt",propsAsIs:false}),Gd=/* @__PURE__ */ne("div")({name:"HeaderContent",class:"h149e3gp",propsAsIs:false}),Kd="h10toh7",Mu=/* @__PURE__ */ne("img")({name:"SponsorLogo",class:"s1jyea6t",propsAsIs:false}),dy=/* @__PURE__ */ne("div")({name:"SponsorName",class:"szpfa3h",propsAsIs:false}),Xd=/* @__PURE__ */ne("div")({name:"Media",class:"m1crmu01",propsAsIs:false}),hy=/* @__PURE__ */ne("img")({name:"PromoImg",class:"p1l37r8s",propsAsIs:false}),fy="s1nmch9k",Fu=/* @__PURE__ */ne("div")({name:"Content",class:"c1er0ljd",propsAsIs:false}),py=/* @__PURE__ */ne("div")({name:"Description",class:"dydopmr",propsAsIs:false}),my=/* @__PURE__ */ne("div")({name:"Sponsor",class:"s1w6nt04",propsAsIs:false}),gy=/* @__PURE__ */ne("div")({name:"SponsorText",class:"s1evcmtq",propsAsIs:false}),Yd=/* @__PURE__ */ne("div")({name:"ADLogo",class:"awodx0x",propsAsIs:false}),yy=/* @__PURE__ */ne("span")({name:"SponsoredText",class:"s1q3n6oi",propsAsIs:false}),Eo=/* @__PURE__ */ne("div")({name:"ActionBtnWrap",class:"a8d4xfk",propsAsIs:false}),Co=/* @__PURE__ */ne("a")({name:"ActionButton",class:"at6oobh",propsAsIs:false}),_y=/* @__PURE__ */ne("div")({name:"Title",class:"t1gyg7tt",propsAsIs:false}),Ty="h17rwbtk",vy=/* @__PURE__ */ne("div")({name:"Container",class:"c10m2bce",propsAsIs:false}),Uu=/* @__PURE__ */ne("div")({name:"Item",class:"ig23yq5",propsAsIs:false}),by=/* @__PURE__ */ne("div")({name:"Dot",class:"d1f6aqua",propsAsIs:false}),xy=function xy(_ref8){var r=_ref8.time,e=_ref8.adCount,t=_ref8.adPosition;var i=Math.floor(r/60),s=r-i*60;return i===0&&s===0&&e===t?null:/* @__PURE__ */jsxRuntime.jsxs(vy,{children:[e>1&&/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[/* @__PURE__ */jsxRuntime.jsxs(Uu,{children:[t," of ",e]}),/* @__PURE__ */jsxRuntime.jsx(by,{})]}),/* @__PURE__ */jsxRuntime.jsxs(Uu,{children:[i,":",s<10?"0".concat(s):s]})]});},Sy=/* @__PURE__ */ne("a")({name:"WhyThisAdLink",class:"w13o8uld",propsAsIs:false}),Ey=function Ey(_ref9){var r=_ref9.whyThisAd;var _el=e$2.useState(false),_el2=_slicedToArray(_el,2),e=_el2[0],t=_el2[1];return !r.iconClickThroughURLTemplate||!r.staticResource?null:/* @__PURE__ */jsxRuntime.jsxs(Sy,{style:_defineProperty(_defineProperty({width:r.width,height:r.height},r.xPosition,3),r.yPosition,11),href:r.iconClickThroughURLTemplate,target:"_blank",rel:"noreferrer",children:[!e&&/* @__PURE__ */jsxRuntime.jsx("img",{alt:"ad choice",src:r.staticResource,onLoad:function onLoad(){return t(false);},onError:function onError(){return t(true);}}),e&&/* @__PURE__ */jsxRuntime.jsx("span",{children:"ad choice"})]});},Cy=/* @__PURE__ */ne("div")({name:"VideoControls",class:"v1xzooj9",propsAsIs:false}),Qd=/* @__PURE__ */ne("button")({name:"ControlBtn",class:"c1bo41vr",propsAsIs:false}),Ay=function Ay(){return Qd;},wy=/* @__PURE__ */ne(Ay())({name:"MuteIcon",class:"m13efyu8",propsAsIs:true}),Dy=function Dy(){return Qd;},Iy=/* @__PURE__ */ne(Dy())({name:"PauseIcon",class:"pladkgh",propsAsIs:true}),ky=/* @__PURE__ */ne("div")({name:"Container",class:"cjnga56",propsAsIs:false}),Py=/* @__PURE__ */ne("div")({name:"ControlsContainer",class:"c7qs1am",propsAsIs:false}),$u="m12n261r",qu="m16vcml8",Vu="m1078nk6";function il(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return {id:r.id||null,adId:r.adId||null,sequence:r.sequence||null,apiFramework:r.apiFramework||null,universalAdIds:[],creativeExtensions:[]};}var Ry=["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"];function ju(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var i=[],s=Zd(r);!e.ERRORCODE||t.isCustomCode||/^[0-9]{3}$/.test(e.ERRORCODE)||(e.ERRORCODE=900),e.CACHEBUSTING=ih(Math.round(1e8*Math.random())),e.TIMESTAMP=(/* @__PURE__ */new Date()).toISOString(),e.RANDOM=e.random=e.CACHEBUSTING;for(var n in e)e[n]=th(e[n]);for(var _n2 in s){var a=s[_n2];typeof a=="string"&&i.push(Jd(a,e));}return i;}function Jd(r,e){var t=(r=Hu(r,e)).match(/[^[\]]+(?=])/g);if(!t)return r;var i=t.filter(function(s){return Ry.indexOf(s)>-1;});return i.length===0?r:(i=i.reduce(function(s,n){return s[n]=-1,s;},{}),Hu(r,i));}function Hu(r,e){var t=r;for(var i in e){var s=e[i];t=t.replace(new RegExp("(?:\\[|%%)(".concat(i,")(?:\\]|%%)"),"g"),s);}return t;}function Zd(r){return Array.isArray(r)?r.map(function(e){return e&&e.hasOwnProperty("url")?e.url:e;}):r;}function zu(r){return /^(https?:\/\/|\/\/)/.test(r);}function Wu(r,e){for(var t=0;t<e.length;t++)if(eh(e[t],r))return true;return false;}function eh(r,e){if(r&&e){var t=Object.getOwnPropertyNames(r),i=Object.getOwnPropertyNames(e);return t.length===i.length&&r.id===e.id&&r.url===e.url;}return false;}function th(r){return encodeURIComponent(r).replace(/[!'()*]/g,function(e){return "%".concat(e.charCodeAt(0).toString(16));});}function ih(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8;return r.toString().padStart(e,"0");}var Ve={track:function track(r,e,t){ju(r,e,t).forEach(function(i){(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&window!==null&&(new Image().src=i);});},resolveURLTemplates:ju,extractURLsFromTemplates:Zd,filterUrlTemplates:function filterUrlTemplates(r){return r.reduce(function(e,t){var i=t.url||t;return zu(i)?e.validUrls.push(i):e.invalidUrls.push(i),e;},{validUrls:[],invalidUrls:[]});},containsTemplateObject:Wu,isTemplateObjectEqual:eh,encodeURIComponentRFC3986:th,replaceUrlMacros:Jd,isNumeric:function isNumeric(r){return !isNaN(parseFloat(r))&&isFinite(r);},flatten:function r(e){return e.reduce(function(t,i){return t.concat(Array.isArray(i)?r(i):i);},[]);},joinArrayOfUniqueTemplateObjs:function joinArrayOfUniqueTemplateObjs(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];var t=Array.isArray(r)?r:[],i=Array.isArray(e)?e:[];return t.concat(i).reduce(function(s,n){return Wu(n,s)||s.push(n),s;},[]);},isValidTimeValue:function isValidTimeValue(r){return Number.isFinite(r)&&r>=-2;},addLeadingZeros:ih,isValidUrl:zu,isBrowserEnvironment:function isBrowserEnvironment(){return (typeof window==="undefined"?"undefined":_typeof(window))<"u";},formatMacrosValues:function formatMacrosValues(r){return _typeof(r)!="object"?r:JSON.stringify(r);}};function Gu(r){return ["true","TRUE","True","1"].includes(r);}function Ly(r){if(r==null)return -1;if(Ve.isNumeric(r))return parseInt(r);var e=r.split(":");if(e.length!==3)return -1;var t=e[2].split(".");var i=parseInt(t[0]);t.length===2&&(i+=parseFloat("0.".concat(t[1])));var s=parseInt(60*e[1]),n=parseInt(60*e[0]*60);return isNaN(n)||isNaN(s)||isNaN(i)||s>3600||i>60?-1:n+s+i;}var J={childByName:function childByName(r,e){return Array.from(r.childNodes).find(function(t){return t.nodeName===e;});},childrenByName:function childrenByName(r,e){return Array.from(r.childNodes).filter(function(t){return t.nodeName===e;});},resolveVastAdTagURI:function resolveVastAdTagURI(r,e){if(!e)return r;if(r.startsWith("//")){var _location=location,t=_location.protocol;return "".concat(t).concat(r);}if(!r.includes("://")){var _t2=e.slice(0,e.lastIndexOf("/"));return "".concat(_t2,"/").concat(r);}return r;},parseBoolean:Gu,parseNodeText:function parseNodeText(r){return r&&(r.textContent||r.text||"").trim();},copyNodeAttribute:function copyNodeAttribute(r,e,t){var i=e.getAttribute(r);i&&t.setAttribute(r,i);},parseAttributes:function parseAttributes(r){return Array.from(r.attributes).reduce(function(e,t){return e[t.nodeName]=t.nodeValue,e;},{});},parseDuration:Ly,getStandAloneAds:function getStandAloneAds(){return (arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).filter(function(r){return !parseInt(r.sequence,10);});},getSortedAdPods:function getSortedAdPods(){return (arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).filter(function(r){return parseInt(r.sequence,10);}).sort(function(r,e){return r.sequence-e.sequence;});},assignAttributes:function assignAttributes(r,e){r&&Array.from(r).forEach(function(t){var i=t.nodeName,s=t.nodeValue;if(i&&s&&e.hasOwnProperty(i)){var n=s;typeof e[i]=="boolean"&&(n=Gu(n)),e[i]=n;}});},mergeWrapperAdData:function mergeWrapperAdData(r,e){var t;r.errorURLTemplates=e.errorURLTemplates.concat(r.errorURLTemplates),r.impressionURLTemplates=e.impressionURLTemplates.concat(r.impressionURLTemplates),r.extensions=e.extensions.concat(r.extensions),e.viewableImpression.length>0&&(r.viewableImpression=[].concat(_toConsumableArray(r.viewableImpression),_toConsumableArray(e.viewableImpression))),r.followAdditionalWrappers=e.followAdditionalWrappers,r.allowMultipleAds=e.allowMultipleAds,r.fallbackOnNoAd=e.fallbackOnNoAd;var i=(e.creatives||[]).filter(function(o){return o&&o.type==="companion";}),s=i.reduce(function(o,u){return (u.variations||[]).forEach(function(d){(d.companionClickTrackingURLTemplates||[]).forEach(function(p){Ve.containsTemplateObject(p,o)||o.push(p);});}),o;},[]);r.creatives=i.concat(r.creatives);var n=e.videoClickTrackingURLTemplates&&e.videoClickTrackingURLTemplates.length,a=e.videoCustomClickURLTemplates&&e.videoCustomClickURLTemplates.length;if(r.creatives.forEach(function(o){if(e.trackingEvents&&e.trackingEvents[o.type])for(var u in e.trackingEvents[o.type]){var d=e.trackingEvents[o.type][u];Array.isArray(o.trackingEvents[u])||(o.trackingEvents[u]=[]),o.trackingEvents[u]=o.trackingEvents[u].concat(d);}o.type==="linear"&&(n&&(o.videoClickTrackingURLTemplates=o.videoClickTrackingURLTemplates.concat(e.videoClickTrackingURLTemplates)),a&&(o.videoCustomClickURLTemplates=o.videoCustomClickURLTemplates.concat(e.videoCustomClickURLTemplates)),!e.videoClickThroughURLTemplate||o.videoClickThroughURLTemplate!==null&&o.videoClickThroughURLTemplate!==void 0||(o.videoClickThroughURLTemplate=e.videoClickThroughURLTemplate)),o.type==="companion"&&s.length&&(o.variations||[]).forEach(function(u){u.companionClickTrackingURLTemplates=Ve.joinArrayOfUniqueTemplateObjs(u.companionClickTrackingURLTemplates,s);});}),e.adVerifications&&(r.adVerifications=r.adVerifications.concat(e.adVerifications)),e.blockedAdCategories&&(r.blockedAdCategories=r.blockedAdCategories.concat(e.blockedAdCategories)),(t=e.creatives)!==null&&t!==void 0&&t.length){var o=e.creatives.filter(function(u){var d;return ((d=u.icons)===null||d===void 0?void 0:d.length)&&!u.mediaFiles.length;});o.length&&(r.creatives=r.creatives.concat(o));}}};function Ny(r,e){var t=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var _il=il(i),s=_il.id,n=_il.adId,a=_il.sequence,o=_il.apiFramework;return {id:s,adId:n,sequence:a,apiFramework:o,type:"companion",required:null,variations:[]};}(e);return t.required=r.getAttribute("required")||null,t.variations=J.childrenByName(r,"Companion").map(function(i){var s=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return {id:o.id||null,adType:"companionAd",width:o.width||0,height:o.height||0,assetWidth:o.assetWidth||null,assetHeight:o.assetHeight||null,expandedWidth:o.expandedWidth||null,expandedHeight:o.expandedHeight||null,apiFramework:o.apiFramework||null,adSlotId:o.adSlotId||null,pxratio:o.pxratio||"1",renderingMode:o.renderingMode||"default",staticResources:[],htmlResources:[],iframeResources:[],adParameters:null,altText:null,companionClickThroughURLTemplate:null,companionClickTrackingURLTemplates:[],trackingEvents:{}};}(J.parseAttributes(i));s.htmlResources=J.childrenByName(i,"HTMLResource").reduce(function(o,u){var d=J.parseNodeText(u);return d?o.concat(d):o;},[]),s.iframeResources=J.childrenByName(i,"IFrameResource").reduce(function(o,u){var d=J.parseNodeText(u);return d?o.concat(d):o;},[]),s.staticResources=J.childrenByName(i,"StaticResource").reduce(function(o,u){var d=J.parseNodeText(u);return d?o.concat({url:d,creativeType:u.getAttribute("creativeType")||null}):o;},[]),s.altText=J.parseNodeText(J.childByName(i,"AltText"))||null;var n=J.childByName(i,"TrackingEvents");n&&J.childrenByName(n,"Tracking").forEach(function(o){var u=o.getAttribute("event"),d=J.parseNodeText(o);u&&d&&(Array.isArray(s.trackingEvents[u])||(s.trackingEvents[u]=[]),s.trackingEvents[u].push(d));}),s.companionClickTrackingURLTemplates=J.childrenByName(i,"CompanionClickTracking").map(function(o){return {id:o.getAttribute("id")||null,url:J.parseNodeText(o)};}),s.companionClickThroughURLTemplate=J.parseNodeText(J.childByName(i,"CompanionClickThrough"))||null;var a=J.childByName(i,"AdParameters");return a&&(s.adParameters={value:J.parseNodeText(a),xmlEncoded:a.getAttribute("xmlEncoded")||null}),s;}),t;}function Oy(r,e){var t;var i=function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var _il2=il(u),d=_il2.id,p=_il2.adId,T=_il2.sequence,A=_il2.apiFramework;return {id:d,adId:p,sequence:T,apiFramework:A,type:"linear",duration:0,skipDelay:null,mediaFiles:[],mezzanine:null,interactiveCreativeFile:null,closedCaptionFiles:[],videoClickThroughURLTemplate:null,videoClickTrackingURLTemplates:[],videoCustomClickURLTemplates:[],adParameters:null,icons:[],trackingEvents:{}};}(e);i.duration=J.parseDuration(J.parseNodeText(J.childByName(r,"Duration")));var s=r.getAttribute("skipoffset");if(s==null)i.skipDelay=null;else if(s.charAt(s.length-1)==="%"&&i.duration!==-1){var u=parseInt(s,10);i.skipDelay=i.duration*(u/100);}else i.skipDelay=J.parseDuration(s);var n=J.childByName(r,"VideoClicks");if(n){var _u3=J.childByName(n,"ClickThrough");i.videoClickThroughURLTemplate=_u3?{id:_u3.getAttribute("id")||null,url:J.parseNodeText(_u3)}:null,J.childrenByName(n,"ClickTracking").forEach(function(d){i.videoClickTrackingURLTemplates.push({id:d.getAttribute("id")||null,url:J.parseNodeText(d)});}),J.childrenByName(n,"CustomClick").forEach(function(d){i.videoCustomClickURLTemplates.push({id:d.getAttribute("id")||null,url:J.parseNodeText(d)});});}var a=J.childByName(r,"AdParameters");a&&(i.adParameters={value:J.parseNodeText(a),xmlEncoded:a.getAttribute("xmlEncoded")||null}),J.childrenByName(r,"TrackingEvents").forEach(function(u){J.childrenByName(u,"Tracking").forEach(function(d){var p=d.getAttribute("event");var T=J.parseNodeText(d);if(p&&T){if(p==="progress"){if(t=d.getAttribute("offset"),!t)return;p=t.charAt(t.length-1)==="%"?"progress-".concat(t):"progress-".concat(J.parseDuration(t));}Array.isArray(i.trackingEvents[p])||(i.trackingEvents[p]=[]),i.trackingEvents[p].push(T);}});}),J.childrenByName(r,"MediaFiles").forEach(function(u){J.childrenByName(u,"MediaFile").forEach(function(b){i.mediaFiles.push(function(D){var 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};v.id=D.getAttribute("id"),v.fileURL=J.parseNodeText(D),v.deliveryType=D.getAttribute("delivery"),v.codec=D.getAttribute("codec"),v.mimeType=D.getAttribute("type"),v.mediaType=D.getAttribute("mediaType")||"2D",v.apiFramework=D.getAttribute("apiFramework"),v.fileSize=parseInt(D.getAttribute("fileSize")||0),v.bitrate=parseInt(D.getAttribute("bitrate")||0),v.minBitrate=parseInt(D.getAttribute("minBitrate")||0),v.maxBitrate=parseInt(D.getAttribute("maxBitrate")||0),v.width=parseInt(D.getAttribute("width")||0),v.height=parseInt(D.getAttribute("height")||0);var R=D.getAttribute("scalable");R&&typeof R=="string"&&(v.scalable=J.parseBoolean(R));var U=D.getAttribute("maintainAspectRatio");return U&&typeof U=="string"&&(v.maintainAspectRatio=J.parseBoolean(U)),v;}(b));});var d=J.childByName(u,"InteractiveCreativeFile");d&&(i.interactiveCreativeFile=function(b){var D=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return {type:v.type||null,apiFramework:v.apiFramework||null,variableDuration:J.parseBoolean(v.variableDuration),fileURL:null};}(J.parseAttributes(b));return D.fileURL=J.parseNodeText(b),D;}(d));var p=J.childByName(u,"ClosedCaptionFiles");p&&J.childrenByName(p,"ClosedCaptionFile").forEach(function(b){var D=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return {type:v.type||null,language:v.language||null,fileURL:null};}(J.parseAttributes(b));D.fileURL=J.parseNodeText(b),i.closedCaptionFiles.push(D);});var T=J.childByName(u,"Mezzanine"),A=function(b,D){var v={};var R=false;return D.forEach(function(U){b&&b.getAttribute(U)?v[U]=b.getAttribute(U):R=true;}),R?null:v;}(T,["delivery","type","width","height"]);if(A){var b={id:null,fileURL:null,delivery:null,codec:null,type:null,width:0,height:0,fileSize:0,mediaType:"2D"};b.id=T.getAttribute("id"),b.fileURL=J.parseNodeText(T),b.delivery=A.delivery,b.codec=T.getAttribute("codec"),b.type=A.type,b.width=parseInt(A.width,10),b.height=parseInt(A.height,10),b.fileSize=parseInt(T.getAttribute("fileSize"),10),b.mediaType=T.getAttribute("mediaType")||"2D",i.mezzanine=b;}});var o=J.childByName(r,"Icons");return o&&J.childrenByName(o,"Icon").forEach(function(u){i.icons.push(function(d){var p={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};p.program=d.getAttribute("program"),p.height=parseInt(d.getAttribute("height")||0),p.width=parseInt(d.getAttribute("width")||0),p.xPosition=function(A){return ["left","right"].indexOf(A)!==-1?A:parseInt(A||0);}(d.getAttribute("xPosition")),p.yPosition=function(A){return ["top","bottom"].indexOf(A)!==-1?A:parseInt(A||0);}(d.getAttribute("yPosition")),p.apiFramework=d.getAttribute("apiFramework"),p.pxratio=d.getAttribute("pxratio")||"1",p.offset=J.parseDuration(d.getAttribute("offset")),p.duration=J.parseDuration(d.getAttribute("duration")),p.altText=d.getAttribute("altText"),p.hoverText=d.getAttribute("hoverText"),J.childrenByName(d,"HTMLResource").forEach(function(A){p.type=A.getAttribute("creativeType")||"text/html",p.htmlResource=J.parseNodeText(A);}),J.childrenByName(d,"IFrameResource").forEach(function(A){p.type=A.getAttribute("creativeType")||0,p.iframeResource=J.parseNodeText(A);}),J.childrenByName(d,"StaticResource").forEach(function(A){p.type=A.getAttribute("creativeType")||0,p.staticResource=J.parseNodeText(A);});var T=J.childByName(d,"IconClicks");if(T){p.iconClickThroughURLTemplate=J.parseNodeText(J.childByName(T,"IconClickThrough")),J.childrenByName(T,"IconClickTracking").forEach(function(b){p.iconClickTrackingURLTemplates.push({id:b.getAttribute("id")||null,url:J.parseNodeText(b)});});var A=J.childByName(T,"IconClickFallbackImages");A&&J.childrenByName(A,"IconClickFallbackImage").forEach(function(b){p.iconClickFallbackImages.push({url:J.parseNodeText(b)||null,width:b.getAttribute("width")||null,height:b.getAttribute("height")||null});});}return p.iconViewTrackingURLTemplate=J.parseNodeText(J.childByName(d,"IconViewTracking")),p;}(u));}),i;}function By(r,e){var t=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var _il3=il(i),s=_il3.id,n=_il3.adId,a=_il3.sequence,o=_il3.apiFramework;return {id:s,adId:n,sequence:a,apiFramework:o,type:"nonlinear",variations:[],trackingEvents:{}};}(e);return J.childrenByName(r,"TrackingEvents").forEach(function(i){var s,n;J.childrenByName(i,"Tracking").forEach(function(a){s=a.getAttribute("event"),n=J.parseNodeText(a),s&&n&&(Array.isArray(t.trackingEvents[s])||(t.trackingEvents[s]=[]),t.trackingEvents[s].push(n));});}),J.childrenByName(r,"NonLinear").forEach(function(i){var s={id:null,width:0,height:0,expandedWidth:0,expandedHeight:0,scalable:true,maintainAspectRatio:true,minSuggestedDuration:0,apiFramework:"static",adType:"nonLinearAd",type:null,staticResource:null,htmlResource:null,iframeResource:null,nonlinearClickThroughURLTemplate:null,nonlinearClickTrackingURLTemplates:[],adParameters:null};s.id=i.getAttribute("id")||null,s.width=i.getAttribute("width"),s.height=i.getAttribute("height"),s.expandedWidth=i.getAttribute("expandedWidth"),s.expandedHeight=i.getAttribute("expandedHeight"),s.scalable=J.parseBoolean(i.getAttribute("scalable")),s.maintainAspectRatio=J.parseBoolean(i.getAttribute("maintainAspectRatio")),s.minSuggestedDuration=J.parseDuration(i.getAttribute("minSuggestedDuration")),s.apiFramework=i.getAttribute("apiFramework"),J.childrenByName(i,"HTMLResource").forEach(function(a){s.type=a.getAttribute("creativeType")||"text/html",s.htmlResource=J.parseNodeText(a);}),J.childrenByName(i,"IFrameResource").forEach(function(a){s.type=a.getAttribute("creativeType")||0,s.iframeResource=J.parseNodeText(a);}),J.childrenByName(i,"StaticResource").forEach(function(a){s.type=a.getAttribute("creativeType")||0,s.staticResource=J.parseNodeText(a);});var n=J.childByName(i,"AdParameters");n&&(s.adParameters={value:J.parseNodeText(n),xmlEncoded:n.getAttribute("xmlEncoded")||null}),s.nonlinearClickThroughURLTemplate=J.parseNodeText(J.childByName(i,"NonLinearClickThrough")),J.childrenByName(i,"NonLinearClickTracking").forEach(function(a){s.nonlinearClickTrackingURLTemplates.push({id:a.getAttribute("id")||null,url:J.parseNodeText(a)});}),t.variations.push(s);}),t;}function Ku(r){var e=[];return r.forEach(function(t){var i=rh(t);i&&e.push(i);}),e;}function rh(r){if(r.nodeName==="#comment")return null;var e={name:null,value:null,attributes:{},children:[]},t=r.attributes,i=r.childNodes;if(e.name=r.nodeName,r.attributes){for(var n in t)if(t.hasOwnProperty(n)){var a=t[n];a.nodeName&&a.nodeValue&&(e.attributes[a.nodeName]=a.nodeValue);}}for(var _n3 in i)if(i.hasOwnProperty(_n3)){var _a2=rh(i[_n3]);_a2&&e.children.push(_a2);}if(e.children.length===0||e.children.length===1&&["#cdata-section","#text"].indexOf(e.children[0].name)>=0){var _n4=J.parseNodeText(r);_n4!==""&&(e.value=_n4),e.children=[];}return (s=e).value===null&&Object.keys(s.attributes).length===0&&s.children.length===0?null:e;var s;}function My(r){return r.getAttribute("AdID")||r.getAttribute("adID")||r.getAttribute("adId")||null;}var xn={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"]}};function Xu(r,e){if(!xn[r.nodeName]||!xn[r.nodeName].attributes)return;var t=xn[r.nodeName].attributes.filter(function(i){return !r.getAttribute(i);});t.length>0&&Rs({name:r.nodeName,parentName:r.parentNode.nodeName,attributes:t},e);}function Yu(r,e,t){var i=xn[r.nodeName],s=!t&&r.nodeName!=="Wrapper";if(!(!i||s)){if(i.subElements){var n=i.subElements.filter(function(a){return !J.childByName(r,a);});n.length>0&&Rs({name:r.nodeName,parentName:r.parentNode.nodeName,subElements:n},e);}!t||!i.oneOfinLineResources||i.oneOfinLineResources.some(function(n){return J.childByName(r,n);})||Rs({name:r.nodeName,parentName:r.parentNode.nodeName,oneOfResources:i.oneOfinLineResources},e);}}function Qu(r){return r.children&&r.children.length!==0;}function Rs(r,e){var t=r.name,i=r.parentName,s=r.attributes,n=r.subElements,a=r.oneOfResources,o="Element '".concat(t,"'");o+=s?" missing required attribute(s) '".concat(s.join(", "),"' "):n?" missing required sub element(s) '".concat(n.join(", "),"' "):a?" must provide one of the following '".concat(a.join(", "),"' "):" is empty",e("VAST-warning",{message:o,parentElement:i,specVersion:4.1});}var Fy={verifyRequiredValues:function r(e,t,i){if(e&&e.nodeName)if(e.nodeName==="InLine"&&(i=true),Xu(e,t),Qu(e)){Yu(e,t,i);for(var s=0;s<e.children.length;s++)r(e.children[s],t,i);}else J.parseNodeText(e).length===0&&Rs({name:e.nodeName,parentName:e.parentNode.nodeName},t);},hasSubElements:Qu,emitMissingValueWarning:Rs,verifyRequiredAttributes:Xu,verifyRequiredSubElements:Yu};function Uy(r,e){var _ref0=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},t=_ref0.allowMultipleAds,i=_ref0.followAdditionalWrappers;var s=Array.from(r.childNodes).filter(function(n){var a=n.nodeName.toLowerCase();return a==="inline"||i!==false&&a==="wrapper";});var _iterator=_createForOfIteratorHelper(s),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var n=_step.value;if(J.copyNodeAttribute("id",r,n),J.copyNodeAttribute("sequence",r,n),J.copyNodeAttribute("adType",r,n),n.nodeName==="Wrapper")return {ad:qy(n,e),type:"WRAPPER"};if(n.nodeName==="InLine")return {ad:$y(n,e,{allowMultipleAds:t}),type:"INLINE"};var a=n.nodeName.toLowerCase();e("VAST-warning",{message:"<".concat(n.nodeName,a==="inline"?"> must be written <InLine>":"> must be written <Wrapper>"),wrongNode:n});}}catch(err){_iterator.e(err);}finally{_iterator.f();}}function $y(r,e){var _ref1=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},t=_ref1.allowMultipleAds;return t===false&&r.getAttribute("sequence")?null:sh(r,e);}function sh(r,e){var t=[];e&&Fy.verifyRequiredValues(r,e);var i=Array.from(r.childNodes),s=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return {id:n.id||null,sequence:n.sequence||null,adType:n.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:true,allowMultipleAds:false,fallbackOnNoAd:null};}(J.parseAttributes(r));return i.forEach(function(n){switch(n.nodeName){case "Error":s.errorURLTemplates.push(J.parseNodeText(n));break;case "Impression":s.impressionURLTemplates.push({id:n.getAttribute("id")||null,url:J.parseNodeText(n)});break;case "Creatives":s.creatives=function(a){var o=[];return a.forEach(function(u){var d={id:u.getAttribute("id")||null,adId:My(u),sequence:u.getAttribute("sequence")||null,apiFramework:u.getAttribute("apiFramework")||null},p=[];var T;J.childrenByName(u,"UniversalAdId").forEach(function(b){var D={idRegistry:b.getAttribute("idRegistry")||"unknown",value:J.parseNodeText(b)};p.push(D);});var A=J.childByName(u,"CreativeExtensions");A&&(T=Ku(J.childrenByName(A,"CreativeExtension")));for(var b in u.childNodes){var D=u.childNodes[b];var v=void 0;switch(D.nodeName){case "Linear":v=Oy(D,d);break;case "NonLinearAds":v=By(D,d);break;case "CompanionAds":v=Ny(D,d);}v&&(p&&(v.universalAdIds=p),T&&(v.creativeExtensions=T),o.push(v));}}),o;}(J.childrenByName(n,"Creative"));break;case "Extensions":{var a=J.childrenByName(n,"Extension");s.extensions=Ku(a),s.adVerifications.length||(t=function(o){var u=null,d=[];return o.some(function(p){return u=J.childByName(p,"AdVerifications");}),u&&(d=Ju(J.childrenByName(u,"Verification"))),d;}(a));break;}case "AdVerifications":s.adVerifications=Ju(J.childrenByName(n,"Verification"));break;case "AdSystem":s.system={value:J.parseNodeText(n),version:n.getAttribute("version")||null};break;case "AdTitle":s.title=J.parseNodeText(n);break;case "AdServingId":s.adServingId=J.parseNodeText(n);break;case "Category":s.categories.push({authority:n.getAttribute("authority")||null,value:J.parseNodeText(n)});break;case "Expires":s.expires=parseInt(J.parseNodeText(n),10);break;case "ViewableImpression":s.viewableImpression.push(function(a){var o=function o(u,d){var p=J.parseNodeText(d);return p&&u.push(p),u;};return {id:a.getAttribute("id")||null,viewable:J.childrenByName(a,"Viewable").reduce(o,[]),notViewable:J.childrenByName(a,"NotViewable").reduce(o,[]),viewUndetermined:J.childrenByName(a,"ViewUndetermined").reduce(o,[])};}(n));break;case "Description":s.description=J.parseNodeText(n);break;case "Advertiser":s.advertiser={id:n.getAttribute("id")||null,value:J.parseNodeText(n)};break;case "Pricing":s.pricing={value:J.parseNodeText(n),model:n.getAttribute("model")||null,currency:n.getAttribute("currency")||null};break;case "Survey":s.survey={value:J.parseNodeText(n),type:n.getAttribute("type")||null};break;case "BlockedAdCategories":s.blockedAdCategories.push({authority:n.getAttribute("authority")||null,value:J.parseNodeText(n)});}}),t.length&&(s.adVerifications=s.adVerifications.concat(t)),s;}function qy(r,e){var t=sh(r,e),i=r.getAttribute("followAdditionalWrappers"),s=r.getAttribute("allowMultipleAds"),n=r.getAttribute("fallbackOnNoAd");t.followAdditionalWrappers=!i||J.parseBoolean(i),t.allowMultipleAds=!!s&&J.parseBoolean(s),t.fallbackOnNoAd=n?J.parseBoolean(n):null;var a=J.childByName(r,"VASTAdTagURI");if(a?t.nextWrapperURL=J.parseNodeText(a):(a=J.childByName(r,"VASTAdTagURL"),a&&(t.nextWrapperURL=J.parseNodeText(J.childByName(a,"URL")))),t.creatives.forEach(function(o){if(["linear","nonlinear"].includes(o.type)){if(o.trackingEvents){t.trackingEvents||(t.trackingEvents={}),t.trackingEvents[o.type]||(t.trackingEvents[o.type]={});var _loop3=function _loop3(u){var d=o.trackingEvents[u];Array.isArray(t.trackingEvents[o.type][u])||(t.trackingEvents[o.type][u]=[]),d.forEach(function(p){t.trackingEvents[o.type][u].push(p);});};for(var u in o.trackingEvents){_loop3(u);}}o.videoClickTrackingURLTemplates&&(Array.isArray(t.videoClickTrackingURLTemplates)||(t.videoClickTrackingURLTemplates=[]),o.videoClickTrackingURLTemplates.forEach(function(u){t.videoClickTrackingURLTemplates.push(u);})),o.videoClickThroughURLTemplate&&(t.videoClickThroughURLTemplate=o.videoClickThroughURLTemplate),o.videoCustomClickURLTemplates&&(Array.isArray(t.videoCustomClickURLTemplates)||(t.videoCustomClickURLTemplates=[]),o.videoCustomClickURLTemplates.forEach(function(u){t.videoCustomClickURLTemplates.push(u);}));}}),t.nextWrapperURL)return t;}function Ju(r){var e=[];return r.forEach(function(t){var i={resource:null,vendor:null,browserOptional:false,apiFramework:null,type:null,parameters:null,trackingEvents:{}},s=Array.from(t.childNodes);J.assignAttributes(t.attributes,i),s.forEach(function(a){var o=a.nodeName,u=a.textContent,d=a.attributes;switch(o){case "JavaScriptResource":case "ExecutableResource":i.resource=u.trim(),J.assignAttributes(d,i);break;case "VerificationParameters":i.parameters=u.trim();}});var n=J.childByName(t,"TrackingEvents");n&&J.childrenByName(n,"Tracking").forEach(function(a){var o=a.getAttribute("event"),u=J.parseNodeText(a);o&&u&&(Array.isArray(i.trackingEvents[o])||(i.trackingEvents[o]=[]),i.trackingEvents[o].push(u));}),e.push(i);}),e;}var nh=/*#__PURE__*/function(){function nh(){_classCallCheck(this,nh);this._handlers=[];}return _createClass(nh,[{key:"on",value:function on(e,t){if(typeof t!="function")throw new TypeError("The handler argument must be of type Function. Received type ".concat(_typeof(t)));if(!e)throw new TypeError("The event argument must be of type String. Received type ".concat(_typeof(e)));return this._handlers.push({event:e,handler:t}),this;}},{key:"once",value:function once(e,t){return this.on(e,function(i,s,n){var a={fired:false,wrapFn:void 0};function o(){a.fired||(i.off(s,a.wrapFn),a.fired=true,n.bind(i).apply(void 0,arguments));}return a.wrapFn=o,o;}(this,e,t));}},{key:"off",value:function off(e,t){return this._handlers=this._handlers.filter(function(i){return i.event!==e||i.handler!==t;}),this;}},{key:"emit",value:function emit(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];var n=false;return this._handlers.forEach(function(a){a.event==="*"&&(n=true,a.handler.apply(a,[e].concat(i))),a.event===e&&(n=true,a.handler.apply(a,i));}),n;}},{key:"removeAllListeners",value:function removeAllListeners(e){return e?(this._handlers=this._handlers.filter(function(t){return t.event!==e;}),this):(this._handlers=[],this);}},{key:"listenerCount",value:function listenerCount(e){return this._handlers.filter(function(t){return t.event===e;}).length;}},{key:"listeners",value:function listeners(e){return this._handlers.reduce(function(t,i){return i.event===e&&t.push(i.handler),t;},[]);}},{key:"eventNames",value:function eventNames(){return this._handlers.map(function(e){return e.event;});}}]);}(),Zu=0,Ao=0;var ah=function ah(r,e){!r||!e||r<=0||e<=0||(Ao=(Ao*Zu+8*r/e)/++Zu);},Vy={ERRORCODE:900,extensions:[]},ec="VAST response version not supported";var jy=/*#__PURE__*/function(_nh){function jy(){var _this;_classCallCheck(this,jy);var _ref10=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=_ref10.fetcher;_this=_callSuper(this,jy),_this.maxWrapperDepth=null,_this.rootErrorURLTemplates=[],_this.errorURLTemplates=[],_this.remainingAds=[],_this.parsingOptions={},_this.fetcher=e||null,_this.keepFailedAdPod=false;return _this;}_inherits(jy,_nh);return _createClass(jy,[{key:"trackVastError",value:function trackVastError(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),n=2;n<i;n++)s[n-2]=arguments[n];this.emit("VAST-error",Object.assign.apply(Object,[{},Vy,t].concat(s))),Ve.track(e,t);}},{key:"getErrorURLTemplates",value:function getErrorURLTemplates(){return this.rootErrorURLTemplates.concat(this.errorURLTemplates);}},{key:"getEstimatedBitrate",value:function getEstimatedBitrate(){return Ao;}},{key:"initParsingStatus",value:function initParsingStatus(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.maxWrapperDepth=e.wrapperLimit||10,this.parsingOptions={allowMultipleAds:e.allowMultipleAds},this.keepFailedAdPod=e.keepFailedAdPod||false,this.rootURL="",this.resetParsingStatus(),ah(e.byteLength,e.requestDuration);}},{key:"resetParsingStatus",value:function resetParsingStatus(){this.errorURLTemplates=[],this.rootErrorURLTemplates=[],this.vastVersion=null;}},{key:"getRemainingAds",value:function getRemainingAds(e){var _this2=this;if(this.remainingAds.length===0)return Promise.reject(new Error("No more ads are available for the given VAST"));var t=e?this.remainingAds:[this.remainingAds.shift()];return this.errorURLTemplates=[],this.resolveAds(t,{wrapperDepth:0,url:this.rootURL}).then(function(i){return _this2.buildVASTResponse(i);});}},{key:"parseVAST",value:function parseVAST(e){var _this3=this;var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.initParsingStatus(t),t.isRootVAST=true,this.parse(e,t).then(function(i){return _this3.buildVASTResponse(i);});}},{key:"buildVASTResponse",value:function buildVASTResponse(e){var t=function(i){var s=i.ads,n=i.errorURLTemplates,a=i.version;return {ads:s||[],errorURLTemplates:n||[],version:a||null};}({ads:e,errorURLTemplates:this.getErrorURLTemplates(),version:this.vastVersion});return this.completeWrapperResolving(t),t;}},{key:"parseVastXml",value:function parseVastXml(e,t){var _t$isRootVAST=t.isRootVAST,i=_t$isRootVAST===void 0?false:_t$isRootVAST,_t$url=t.url,s=_t$url===void 0?null:_t$url,_t$wrapperDepth=t.wrapperDepth,n=_t$wrapperDepth===void 0?0:_t$wrapperDepth,a=t.allowMultipleAds,o=t.followAdditionalWrappers;if(!e||!e.documentElement||e.documentElement.nodeName!=="VAST"){var u;this.emit("VAST-ad-parsed",{type:"ERROR",url:s,wrapperDepth:n});var A=(e==null||(u=e.documentElement)===null||u===void 0?void 0:u.nodeName)==="VideoAdServingTemplate";throw new Error(A?ec:"Invalid VAST XMLDocument");}var d=[],p=e.documentElement.childNodes,T=e.documentElement.getAttribute("version");i&&T&&(this.vastVersion=T);for(var _A in p){var b=p[_A];if(b.nodeName==="Error"){var D=J.parseNodeText(b);i?this.rootErrorURLTemplates.push(D):this.errorURLTemplates.push(D);}else if(b.nodeName==="Ad"){if(this.vastVersion&&parseFloat(this.vastVersion)<3)a=true;else if(a===false&&d.length>1)break;var _D3=Uy(b,this.emit.bind(this),{allowMultipleAds:a,followAdditionalWrappers:o});_D3.ad?(d.push(_D3.ad),this.emit("VAST-ad-parsed",{type:_D3.type,url:s,wrapperDepth:n,adIndex:d.length-1,vastVersion:T})):this.trackVastError(this.getErrorURLTemplates(),{ERRORCODE:101});}}return d;}},{key:"parse",value:function parse(e){var _ref11=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_ref11$url=_ref11.url,t=_ref11$url===void 0?null:_ref11$url,_ref11$resolveAll=_ref11.resolveAll,i=_ref11$resolveAll===void 0?true:_ref11$resolveAll,_ref11$wrapperSequenc=_ref11.wrapperSequence,s=_ref11$wrapperSequenc===void 0?null:_ref11$wrapperSequenc,_ref11$previousUrl=_ref11.previousUrl,n=_ref11$previousUrl===void 0?null:_ref11$previousUrl,_ref11$wrapperDepth=_ref11.wrapperDepth,a=_ref11$wrapperDepth===void 0?0:_ref11$wrapperDepth,_ref11$isRootVAST=_ref11.isRootVAST,o=_ref11$isRootVAST===void 0?false:_ref11$isRootVAST,u=_ref11.followAdditionalWrappers,d=_ref11.allowMultipleAds,p=[];this.vastVersion&&parseFloat(this.vastVersion)<3&&o&&(d=true);try{p=this.parseVastXml(e,{isRootVAST:o,url:t,wrapperDepth:a,allowMultipleAds:d,followAdditionalWrappers:u});}catch(T){return Promise.reject(T);}if(p.length===1&&s!=null&&(p[0].sequence=s),i===false){var T=J.getSortedAdPods(p),A=J.getStandAloneAds(p);T.length?p=T:A.length&&(p=[A.shift()]),this.remainingAds=A;}return this.resolveAds(p,{wrapperDepth:a,previousUrl:n,url:t});}},{key:"resolveAds",value:function resolveAds(){var _this4=this;var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],_ref12=arguments.length>1?arguments[1]:void 0,t=_ref12.wrapperDepth,i=_ref12.previousUrl,s=_ref12.url;var n=[];return i=s,e.forEach(function(a){var o=_this4.resolveWrappers(a,t,i);n.push(o);}),Promise.all(n).then(function(a){return Ve.flatten(a);});}},{key:"resolveWrappers",value:function resolveWrappers(e,t,i){var _this5=this;var s=_objectSpread2({},e);return new Promise(function(n){var a;if(t++,!s.nextWrapperURL)return delete s.nextWrapperURL,n(s);if(!_this5.fetcher)return s.VASTAdTagURI=s.nextWrapperURL,delete s.nextWrapperURL,n(s);if(t>=_this5.maxWrapperDepth)return s.errorCode=302,delete s.nextWrapperURL,n(s);s.nextWrapperURL=J.resolveVastAdTagURI(s.nextWrapperURL,i);var o=(a=_this5.parsingOptions.allowMultipleAds)!==null&&a!==void 0?a:s.allowMultipleAds,u=s.sequence;_this5.fetcher.fetchVAST({url:s.nextWrapperURL,emitter:_this5.emit.bind(_this5),maxWrapperDepth:_this5.maxWrapperDepth}).then(function(d){return _this5.parse(d,{url:s.nextWrapperURL,previousUrl:i,wrapperSequence:u,wrapperDepth:t,followAdditionalWrappers:s.followAdditionalWrappers,allowMultipleAds:o}).then(function(p){if(delete s.nextWrapperURL,p.length===0)return s.creatives=[],n(s);p.forEach(function(T){T&&J.mergeWrapperAdData(T,s);}),n(p);});}).catch(function(d){s.errorCode=d.message===ec?102:301,s.errorMessage=d.message,n(s);});});}},{key:"completeWrapperResolving",value:function completeWrapperResolving(e){if(e.ads.length===0)this.trackVastError(e.errorURLTemplates,{ERRORCODE:303});else for(var t=e.ads.length-1;t>=0;t--){var i=e.ads[t],s=!i.creatives.some(function(n){var a,o;return ((a=n.mediaFiles)===null||a===void 0?void 0:a.length)>0||((o=n.variations)===null||o===void 0?void 0:o.length)>0;});!i.errorCode&&!s||i.VASTAdTagURI||(this.trackVastError(i.errorURLTemplates.concat(e.errorURLTemplates),{ERRORCODE:i.errorCode||303},{ERRORMESSAGE:i.errorMessage||""},{extensions:i.extensions},{system:i.system}),this.keepFailedAdPod&&i.sequence?i.hasFailed=true:e.ads.splice(t,1));}}}]);}(nh);var Pi=null;var Hy={data:{},length:0,getItem:function getItem(r){return this.data[r];},setItem:function setItem(r,e){this.data[r]=e,this.length=Object.keys(this.data).length;},removeItem:function removeItem(r){delete this.data[r],this.length=Object.keys(this.data).length;},clear:function clear(){this.data={},this.length=0;}};var zy=/*#__PURE__*/function(){function zy(){_classCallCheck(this,zy);this.storage=this.initStorage();}return _createClass(zy,[{key:"initStorage",value:function initStorage(){if(Pi)return Pi;try{Pi=(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&window!==null?window.localStorage||window.sessionStorage:null;}catch(_unused){Pi=null;}return Pi&&!this.isStorageDisabled(Pi)||(Pi=Hy,Pi.clear()),Pi;}},{key:"isStorageDisabled",value:function isStorageDisabled(e){var t="__VASTStorage__";try{if(e.setItem(t,t),e.getItem(t)!==t)return e.removeItem(t),!0;}catch(_unused2){return true;}return e.removeItem(t),false;}},{key:"getItem",value:function getItem(e){return this.storage.getItem(e);}},{key:"setItem",value:function setItem(e,t){return this.storage.setItem(e,t);}},{key:"removeItem",value:function removeItem(e){return this.storage.removeItem(e);}},{key:"clear",value:function clear(){return this.storage.clear();}}]);}();var wo=12e4,Wy={get:function(){var _get=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(r,e){var t,i,s,n,_t5;return _regenerator().w(function(_context2){while(1)switch(_context2.p=_context2.n){case 0:_context2.p=0;t=new AbortController();i=setTimeout(function(){throw t.abort(),new Error("URLHandler: Request timed out after ".concat(e.timeout||wo," ms (408)"));},e.timeout||wo);_context2.n=1;return fetch(r,_objectSpread2(_objectSpread2({},e),{},{signal:t.signal,credentials:e.withCredentials?"include":"omit"})).finally(function(){clearTimeout(i);});case 1:s=_context2.v;n=function(a){return Ve.isBrowserEnvironment()&&window.location.protocol==="https:"&&a.url.includes("http://")?"URLHandler: Cannot go from HTTPS to HTTP.":a.status===200&&a.ok?null:"URLHandler: ".concat(a.statusText," (").concat(a.status,")");}(s);return _context2.a(2,n?{error:new Error(n),statusCode:s.status}:function(){var _ref13=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(a){var o,u,_t3,_t4;return _regenerator().w(function(_context){while(1)switch(_context.n){case 0:_context.n=1;return a.text();case 1:o=_context.v;if(!Ve.isBrowserEnvironment()){_context.n=2;break;}_t3=new DOMParser();_context.n=4;break;case 2:_context.n=3;return Promise.resolve().then(function(){return G_;});case 3:_t4=_context.v.DOMParser;_t3=new _t4();case 4:u=_t3;return _context.a(2,{xml:u.parseFromString(o,"text/xml"),details:{byteLength:o.length,statusCode:a.status,rawXml:o}});}},_callee);}));return function(_x4){return _ref13.apply(this,arguments);};}()(s));case 2:_context2.p=2;_t5=_context2.v;return _context2.a(2,{error:_t5,statusCode:_t5.name==="AbortError"?408:null});}},_callee2,null,[[0,2]]);}));function get(_x2,_x3){return _get.apply(this,arguments);}return get;}()};var Gy=/*#__PURE__*/function(){function Gy(){_classCallCheck(this,Gy);this.URLTemplateFilters=[];}return _createClass(Gy,[{key:"setOptions",value:function setOptions(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.urlHandler=e.urlHandler||e.urlhandler||Wy,this.fetchingOptions=_objectSpread2(_objectSpread2({},e.fetchOptions),{},{timeout:e.timeout||wo,withCredentials:!!e.withCredentials});}},{key:"addURLTemplateFilter",value:function addURLTemplateFilter(e){typeof e=="function"&&this.URLTemplateFilters.push(e);}},{key:"removeLastURLTemplateFilter",value:function removeLastURLTemplateFilter(){this.URLTemplateFilters.pop();}},{key:"countURLTemplateFilters",value:function countURLTemplateFilters(){return this.URLTemplateFilters.length;}},{key:"clearURLTemplateFilters",value:function clearURLTemplateFilters(){this.URLTemplateFilters=[];}},{key:"fetchVAST",value:function(){var _fetchVAST=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(e){var t,i,s,n,_e$wrapperDepth,a,_e$previousUrl,o,_e$wrapperAd,u,d,p,T;return _regenerator().w(function(_context3){while(1)switch(_context3.n){case 0:i=e.url,s=e.maxWrapperDepth,n=e.emitter,_e$wrapperDepth=e.wrapperDepth,a=_e$wrapperDepth===void 0?0:_e$wrapperDepth,_e$previousUrl=e.previousUrl,o=_e$previousUrl===void 0?null:_e$previousUrl,_e$wrapperAd=e.wrapperAd,u=_e$wrapperAd===void 0?null:_e$wrapperAd;d=Date.now();this.URLTemplateFilters.forEach(function(A){i=A(i);}),n("VAST-resolving",{url:i,previousUrl:o,wrapperDepth:a,maxWrapperDepth:s,timeout:this.fetchingOptions.timeout,wrapperAd:u});_context3.n=1;return this.urlHandler.get(i,this.fetchingOptions);case 1:p=_context3.v;T=Math.round(Date.now()-d);if(!(n("VAST-resolved",_objectSpread2({url:i,previousUrl:o,wrapperDepth:a,error:(p===null||p===void 0?void 0:p.error)||null,duration:T,statusCode:(p===null||p===void 0?void 0:p.statusCode)||null},p===null||p===void 0?void 0:p.details)),ah(p==null||(t=p.details)===null||t===void 0?void 0:t.byteLength,T),p.error)){_context3.n=2;break;}throw new Error(p.error);case 2:return _context3.a(2,p.xml);}},_callee3,this);}));function fetchVAST(_x5){return _fetchVAST.apply(this,arguments);}return fetchVAST;}()}]);}(),Ky=/*#__PURE__*/function(){function Ky(){_classCallCheck(this,Ky);var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new zy();this.cappingFreeLunch=e,this.cappingMinimumTimeInterval=t,this.fetcher=new Gy(),this.vastParser=new jy({fetcher:this.fetcher}),this.storage=i,this.lastSuccessfulAd===void 0&&(this.lastSuccessfulAd=0),this.totalCalls===void 0&&(this.totalCalls=0),this.totalCallsTimeout===void 0&&(this.totalCallsTimeout=0);}return _createClass(Ky,[{key:"addURLTemplateFilter",value:function addURLTemplateFilter(e){this.fetcher.addURLTemplateFilter(e);}},{key:"removeLastURLTemplateFilter",value:function removeLastURLTemplateFilter(){this.fetcher.removeLastURLTemplateFilter();}},{key:"countURLTemplateFilters",value:function countURLTemplateFilters(){return this.fetcher.countURLTemplateFilters();}},{key:"clearURLTemplateFilters",value:function clearURLTemplateFilters(){this.fetcher.clearURLTemplateFilters();}},{key:"getParser",value:function getParser(){return this.vastParser;}},{key:"lastSuccessfulAd",get:function get(){return this.storage.getItem("vast-client-last-successful-ad");},set:function set(e){this.storage.setItem("vast-client-last-successful-ad",e);}},{key:"totalCalls",get:function get(){return this.storage.getItem("vast-client-total-calls");},set:function set(e){this.storage.setItem("vast-client-total-calls",e);}},{key:"totalCallsTimeout",get:function get(){return this.storage.getItem("vast-client-total-calls-timeout");},set:function set(e){this.storage.setItem("vast-client-total-calls-timeout",e);}},{key:"hasRemainingAds",value:function hasRemainingAds(){return this.vastParser.remainingAds.length>0;}},{key:"getNextAds",value:function getNextAds(e){return this.vastParser.getRemainingAds(e);}},{key:"parseVAST",value:function parseVAST(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.fetcher.setOptions(t),this.vastParser.parseVAST(e,t);}},{key:"get",value:function get(e){var _this6=this;var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var i=Date.now();return t.hasOwnProperty("resolveAll")||(t.resolveAll=false),this.totalCallsTimeout<i?(this.totalCalls=1,this.totalCallsTimeout=i+36e5):this.totalCalls++,new Promise(function(s,n){if(_this6.cappingFreeLunch>=_this6.totalCalls)return n(new Error("VAST call canceled – FreeLunch capping not reached yet ".concat(_this6.totalCalls,"/").concat(_this6.cappingFreeLunch)));var a=i-_this6.lastSuccessfulAd;if(a<0)_this6.lastSuccessfulAd=0;else if(a<_this6.cappingMinimumTimeInterval)return n(new Error("VAST call canceled – (".concat(_this6.cappingMinimumTimeInterval,")ms minimum interval reached")));_this6.vastParser.initParsingStatus(t),_this6.fetcher.setOptions(t),_this6.vastParser.rootURL=e,_this6.fetcher.fetchVAST({url:e,emitter:_this6.vastParser.emit.bind(_this6.vastParser),maxWrapperDepth:_this6.vastParser.maxWrapperDepth}).then(function(o){return t.previousUrl=e,t.isRootVAST=true,t.url=e,_this6.vastParser.parse(o,t).then(function(u){var d=_this6.vastParser.buildVASTResponse(u);s(d);});}).catch(function(o){return n(o);});});}}]);}(),Xy=/*#__PURE__*/function(_nh2){function Xy(e,t,i){var _this7;_classCallCheck(this,Xy);var s;var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a=arguments.length>4&&arguments[4]!==void 0&&arguments[4];_this7=_callSuper(this,Xy),_this7.ad=t,_this7.creative=i,_this7.variation=n,_this7.muted=a,_this7.impressed=false,_this7.skippable=false,_this7.trackingEvents={},_this7.trackedProgressEvents=[],_this7.lastPercentage=0,_this7._alreadyTriggeredQuartiles={},_this7.emitAlwaysEvents=["creativeView","start","firstQuartile","midpoint","thirdQuartile","complete","resume","pause","rewind","skip","closeLinear","close"];for(var o in _this7.creative.trackingEvents){var u=_this7.creative.trackingEvents[o];_this7.trackingEvents[o]=u.slice(0);}_this7.viewableImpressionTrackers=((s=_this7.ad.viewableImpression)===null||s===void 0?void 0:s.reduce(function(o,u){var _o$notViewable,_o$viewUndetermined,_o$viewable;return (_o$notViewable=o.notViewable).push.apply(_o$notViewable,_toConsumableArray(u.notViewable)),(_o$viewUndetermined=o.viewUndetermined).push.apply(_o$viewUndetermined,_toConsumableArray(u.viewUndetermined)),(_o$viewable=o.viewable).push.apply(_o$viewable,_toConsumableArray(u.viewable)),o;},{notViewable:[],viewUndetermined:[],viewable:[]}))||{},Object.entries(_this7.viewableImpressionTrackers).forEach(function(o){var _o3=_slicedToArray(o,2),u=_o3[0],d=_o3[1];d.length&&(_this7.trackingEvents[u]=d);}),function(o){return o.type==="linear";}(_this7.creative)?_this7._initLinearTracking():_this7._initVariationTracking(),e&&_this7.on("start",function(){e.lastSuccessfulAd=Date.now();});return _this7;}_inherits(Xy,_nh2);return _createClass(Xy,[{key:"_initLinearTracking",value:function _initLinearTracking(){this.linear=true,this.skipDelay=this.creative.skipDelay,this.setDuration(this.creative.duration),this.clickThroughURLTemplate=this.creative.videoClickThroughURLTemplate,this.clickTrackingURLTemplates=this.creative.videoClickTrackingURLTemplates;}},{key:"_initVariationTracking",value:function _initVariationTracking(){if(this.linear=false,this.skipDelay=-1,this.variation){for(var e in this.variation.trackingEvents){var t=this.variation.trackingEvents[e];this.trackingEvents[e]?this.trackingEvents[e]=this.trackingEvents[e].concat(t.slice(0)):this.trackingEvents[e]=t.slice(0);}this.variation.adType==="nonLinearAd"?(this.clickThroughURLTemplate=this.variation.nonlinearClickThroughURLTemplate,this.clickTrackingURLTemplates=this.variation.nonlinearClickTrackingURLTemplates,this.setDuration(this.variation.minSuggestedDuration)):function(e){return e.adType==="companionAd";}(this.variation)&&(this.clickThroughURLTemplate=this.variation.companionClickThroughURLTemplate,this.clickTrackingURLTemplates=this.variation.companionClickTrackingURLTemplates);}}},{key:"setDuration",value:function setDuration(e){Ve.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)});}},{key:"setProgress",value:function setProgress(e){var _this8=this;var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(!Ve.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(Ve.formatMacrosValues(t))});var s=this.skipDelay||-1;if(s===-1||this.skippable||(s>e?this.emit("skip-countdown",s-e):(this.skippable=true,this.emit("skip-countdown",0))),this.assetDuration>0){var n=Math.round(e/this.assetDuration*100),a=[];if(e>0){a.push("start");for(var o=this.lastPercentage;o<n;o++)a.push("progress-".concat(o+1,"%"));a.push("progress-".concat(e));for(var _o4 in this.quartiles)this.isQuartileReached(_o4,this.quartiles[_o4],e)&&(a.push(_o4),this._alreadyTriggeredQuartiles[_o4]=true);this.lastPercentage=n;}a.forEach(function(o){_this8.track(o,{macros:t,once:i});}),e<this.progress&&(this.track("rewind",{macros:t}),this.trackedProgressEvents&&this.trackedProgressEvents.splice(0));}this.progress=e;}},{key:"isQuartileReached",value:function isQuartileReached(e,t,i){var s=false;return t<=i&&!this._alreadyTriggeredQuartiles[e]&&(s=true),s;}},{key:"setMuted",value:function setMuted(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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(Ve.formatMacrosValues(t))});}},{key:"setPaused",value:function setPaused(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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(Ve.formatMacrosValues(t))});}},{key:"setFullscreen",value:function setFullscreen(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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(Ve.formatMacrosValues(t))});}},{key:"setExpand",value:function setExpand(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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(Ve.formatMacrosValues(t))});}},{key:"setSkipDelay",value:function setSkipDelay(e){Ve.isValidTimeValue(e)?this.skipDelay=e:this.emit("TRACKER-error",{message:"setSkipDelay parameter does not have a valid value. duration: ".concat(e)});}},{key:"trackImpression",value:function trackImpression(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.impressed||(this.impressed=true,this.trackURLs(this.ad.impressionURLTemplates,e),this.track("creativeView",{macros:e})):this.emit("TRACKER-error",{message:"trackImpression parameter has the wrong type. macros: ".concat(e)});}},{key:"trackViewableImpression",value:function trackViewableImpression(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];_typeof(e)=="object"?this.track("viewable",{macros:e,once:t}):this.emit("TRACKER-error",{message:"trackViewableImpression given macros has the wrong type. macros: ".concat(e)});}},{key:"trackNotViewableImpression",value:function trackNotViewableImpression(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];_typeof(e)=="object"?this.track("notViewable",{macros:e,once:t}):this.emit("TRACKER-error",{message:"trackNotViewableImpression given macros has the wrong type. macros: ".concat(e)});}},{key:"trackUndeterminedImpression",value:function trackUndeterminedImpression(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];_typeof(e)=="object"?this.track("viewUndetermined",{macros:e,once:t}):this.emit("TRACKER-error",{message:"trackUndeterminedImpression given macros has the wrong type. macros: ".concat(e)});}},{key:"error",value:function error(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];_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(Ve.formatMacrosValues(e),", isCustomCode: ").concat(t)});}},{key:"errorWithCode",value:function errorWithCode(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];typeof e=="string"&&typeof t=="boolean"?(this.error({ERRORCODE:e},t),console.log("The method errorWithCode is deprecated, please use vast tracker error method instead")):this.emit("TRACKER-error",{message:"One given errorWithCode parameter has the wrong type. errorCode: ".concat(e,", isCustomCode: ").concat(t)});}},{key:"complete",value:function complete(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track("complete",{macros:e}):this.emit("TRACKER-error",{message:"complete given macros has the wrong type. macros: ".concat(e)});}},{key:"notUsed",value:function notUsed(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?(this.track("notUsed",{macros:e}),this.trackingEvents=[]):this.emit("TRACKER-error",{message:"notUsed given macros has the wrong type. macros: ".concat(e)});}},{key:"otherAdInteraction",value:function otherAdInteraction(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track("otherAdInteraction",{macros:e}):this.emit("TRACKER-error",{message:"otherAdInteraction given macros has the wrong type. macros: ".concat(e)});}},{key:"acceptInvitation",value:function acceptInvitation(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track("acceptInvitation",{macros:e}):this.emit("TRACKER-error",{message:"acceptInvitation given macros has the wrong type. macros: ".concat(e)});}},{key:"adExpand",value:function adExpand(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track("adExpand",{macros:e}):this.emit("TRACKER-error",{message:"adExpand given macros has the wrong type. macros: ".concat(e)});}},{key:"adCollapse",value:function adCollapse(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track("adCollapse",{macros:e}):this.emit("TRACKER-error",{message:"adCollapse given macros has the wrong type. macros: ".concat(e)});}},{key:"minimize",value:function minimize(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track("minimize",{macros:e}):this.emit("TRACKER-error",{message:"minimize given macros has the wrong type. macros: ".concat(e)});}},{key:"verificationNotExecuted",value:function verificationNotExecuted(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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(Ve.formatMacrosValues(t))});if(!this.ad||!this.ad.adVerifications||!this.ad.adVerifications.length)throw new Error("No adVerifications provided");if(!e)throw new Error("No vendor provided, unable to find associated verificationNotExecuted");var i=this.ad.adVerifications.find(function(n){return n.vendor===e;});if(!i)throw new Error("No associated verification element found for vendor: ".concat(e));var s=i.trackingEvents;if(s&&s.verificationNotExecuted){var n=s.verificationNotExecuted;this.trackURLs(n,t),this.emit("verificationNotExecuted",{trackingURLTemplates:n});}}},{key:"overlayViewDuration",value:function overlayViewDuration(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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(Ve.formatMacrosValues(t))});}},{key:"close",value:function close(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track(this.linear?"closeLinear":"close",{macros:e}):this.emit("TRACKER-error",{message:"close given macros has the wrong type. macros: ".concat(e)});}},{key:"skip",value:function skip(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track("skip",{macros:e}):this.emit("TRACKER-error",{message:"skip given macros has the wrong type. macros: ".concat(e)});}},{key:"load",value:function load(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_typeof(e)=="object"?this.track("loaded",{macros:e}):this.emit("TRACKER-error",{message:"load given macros has the wrong type. macros: ".concat(e)});}},{key:"click",value:function click(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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(Ve.formatMacrosValues(t))});this.clickTrackingURLTemplates&&this.clickTrackingURLTemplates.length&&this.trackURLs(this.clickTrackingURLTemplates,t);var i=this.clickThroughURLTemplate||e,s=_objectSpread2({},t);if(i){this.progress&&(s.ADPLAYHEAD=this.progressFormatted());var n=Ve.resolveURLTemplates([i],s)[0];this.emit("clickthrough",n);}}},{key:"trackProgressEvents",value:function trackProgressEvents(e,t,i){var _this9=this;var s=parseFloat(e.split("-")[1]);Object.entries(this.trackingEvents).filter(function(n){var _n5=_slicedToArray(n,1),a=_n5[0];return a.startsWith("progress-");}).map(function(n){var _n6=_slicedToArray(n,2),a=_n6[0],o=_n6[1];return {name:a,time:parseFloat(a.split("-")[1]),urls:o};}).filter(function(n){var a=n.time;return a<=s&&a>_this9.progress;}).forEach(function(n){var a=n.name,o=n.urls;!i&&_this9.trackedProgressEvents.includes(a)||(_this9.emit(a,{trackingURLTemplates:o}),_this9.trackURLs(o,t),i?delete _this9.trackingEvents[a]:_this9.trackedProgressEvents.push(a));});}},{key:"track",value:function track(e){var _ref14=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_ref14$macros=_ref14.macros,t=_ref14$macros===void 0?{}:_ref14$macros,_ref14$once=_ref14.once,i=_ref14$once===void 0?false:_ref14$once;if(_typeof(t)!="object")return void this.emit("TRACKER-error",{message:"track given macros has the wrong type. macros: ".concat(t)});e==="closeLinear"&&!this.trackingEvents[e]&&this.trackingEvents.close&&(e="close"),e.startsWith("progress-")&&!e.endsWith("%")&&this.trackProgressEvents(e,t,i);var s=this.trackingEvents[e],n=this.emitAlwaysEvents.indexOf(e)>-1;s?(this.emit(e,{trackingURLTemplates:s}),this.trackURLs(s,t)):n&&this.emit(e,null),i&&(delete this.trackingEvents[e],n&&this.emitAlwaysEvents.splice(this.emitAlwaysEvents.indexOf(e),1));}},{key:"trackURLs",value:function trackURLs(e){var t;var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var _Ve$filterUrlTemplate=Ve.filterUrlTemplates(e),n=_Ve$filterUrlTemplate.validUrls,a=_Ve$filterUrlTemplate.invalidUrls;a.length&&this.emit("TRACKER-error",{message:"Provided urls are malformed. url: ".concat(a)});var o=_objectSpread2({},i);this.linear&&(this.creative&&this.creative.mediaFiles&&this.creative.mediaFiles[0]&&this.creative.mediaFiles[0].fileURL&&(o.ASSETURI=this.creative.mediaFiles[0].fileURL),this.progress&&(o.ADPLAYHEAD=this.progressFormatted())),(t=this.creative)!==null&&t!==void 0&&(t=t.universalAdIds)!==null&&t!==void 0&&t.length&&(o.UNIVERSALADID=this.creative.universalAdIds.map(function(u){return u.idRegistry.concat(" ",u.value);}).join(",")),this.ad&&(this.ad.sequence&&(o.PODSEQUENCE=this.ad.sequence),this.ad.adType&&(o.ADTYPE=this.ad.adType),this.ad.adServingId&&(o.ADSERVINGID=this.ad.adServingId),this.ad.categories&&this.ad.categories.length&&(o.ADCATEGORIES=this.ad.categories.map(function(u){return u.value;}).join(",")),this.ad.blockedAdCategories&&this.ad.blockedAdCategories.length&&(o.BLOCKEDADCATEGORIES=this.ad.blockedAdCategories.map(function(u){return u.value;}).join(","))),Ve.track(n,o,s);}},{key:"convertToTimecode",value:function convertToTimecode(e){if(!Ve.isValidTimeValue(e))return "";var t=1e3*e,i=Math.floor(t/36e5),s=Math.floor(t/6e4%60),n=Math.floor(t/1e3%60),a=Math.floor(t%1e3);return "".concat(Ve.addLeadingZeros(i,2),":").concat(Ve.addLeadingZeros(s,2),":").concat(Ve.addLeadingZeros(n,2),".").concat(Ve.addLeadingZeros(a,3));}},{key:"progressFormatted",value:function progressFormatted(){return this.convertToTimecode(this.progress);}}]);}(nh);var Fa,tc;function Zn(){if(tc)return Fa;tc=1;var r;return (typeof window==="undefined"?"undefined":_typeof(window))<"u"?r=window:_typeof(a$1)<"u"?r=a$1:(typeof self==="undefined"?"undefined":_typeof(self))<"u"?r=self:r={},Fa=r,Fa;}var Yy=Zn();var N=/* @__PURE__ */f$1(Yy),Qy={},Jy=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,default:Qy},Symbol.toStringTag,{value:"Module"})),Zy=/* @__PURE__ */c$1(Jy);var Ua,ic;function oh(){if(ic)return Ua;ic=1;var r=_typeof(a$1)<"u"?a$1:(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:{},e=Zy,t;return (typeof document==="undefined"?"undefined":_typeof(document))<"u"?t=document:(t=r["__GLOBAL_DOCUMENT_CACHE@4"],t||(t=r["__GLOBAL_DOCUMENT_CACHE@4"]=e)),Ua=t,Ua;}var e_=oh();var de=/* @__PURE__ */f$1(e_);var pn={exports:{}},$a={exports:{}},rc;function t_(){return rc||(rc=1,function(r){function e(){return r.exports=e=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var n in s)({}).hasOwnProperty.call(s,n)&&(t[n]=s[n]);}return t;},r.exports.__esModule=true,r.exports.default=r.exports,e.apply(null,arguments);}r.exports=e,r.exports.__esModule=true,r.exports.default=r.exports;}($a)),$a.exports;}var qa,sc;function i_(){if(sc)return qa;sc=1,qa=e;var r=Object.prototype.toString;function e(t){if(!t)return false;var i=r.call(t);return i==="[object Function]"||typeof t=="function"&&i!=="[object RegExp]"||(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&(// IE8 and below
7228
7227
  t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt);}return qa;}var Va,nc;function r_(){if(nc)return Va;nc=1;function r(s,n){var a=(typeof Symbol==="undefined"?"undefined":_typeof(Symbol))<"u"&&s[Symbol.iterator]||s["@@iterator"];if(a)return (a=a.call(s)).next.bind(a);if(Array.isArray(s)||(a=e(s))||n){a&&(s=a);var o=0;return function(){return o>=s.length?{done:true}:{done:false,value:s[o++]};};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function e(s,n){if(s){if(typeof s=="string")return t(s,n);var a=Object.prototype.toString.call(s).slice(8,-1);if(a==="Object"&&s.constructor&&(a=s.constructor.name),a==="Map"||a==="Set")return Array.from(s);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return t(s,n);}}function t(s,n){(n==null||n>s.length)&&(n=s.length);for(var a=0,o=new Array(n);a<n;a++)o[a]=s[a];return o;}var i=/* @__PURE__ */function(){function s(){this.typeToInterceptorsMap_=/* @__PURE__ */new Map(),this.enabled_=false;}var n=s.prototype;return n.getIsEnabled=function(){return this.enabled_;},n.enable=function(){this.enabled_=true;},n.disable=function(){this.enabled_=false;},n.reset=function(){this.typeToInterceptorsMap_=/* @__PURE__ */new Map(),this.enabled_=false;},n.addInterceptor=function(o,u){this.typeToInterceptorsMap_.has(o)||this.typeToInterceptorsMap_.set(o,/* @__PURE__ */new Set());var d=this.typeToInterceptorsMap_.get(o);return d.has(u)?false:(d.add(u),true);},n.removeInterceptor=function(o,u){var d=this.typeToInterceptorsMap_.get(o);return d&&d.has(u)?(d.delete(u),true):false;},n.clearInterceptorsByType=function(o){var u=this.typeToInterceptorsMap_.get(o);return u?(this.typeToInterceptorsMap_.delete(o),this.typeToInterceptorsMap_.set(o,/* @__PURE__ */new Set()),true):false;},n.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=/* @__PURE__ */new Map(),true):false;},n.getForType=function(o){return this.typeToInterceptorsMap_.get(o)||/* @__PURE__ */new Set();},n.execute=function(o,u){for(var d=this.getForType(o),p=r(d),T;!(T=p()).done;){var A=T.value;try{u=A(u);}catch(_unused3){}}return u;},s;}();return Va=i,Va;}var ja,ac;function s_(){if(ac)return ja;ac=1;var r=/* @__PURE__ */function(){function t(){this.maxAttempts_=1,this.delayFactor_=0.1,this.fuzzFactor_=0.1,this.initialDelay_=1e3,this.enabled_=false;}var i=t.prototype;return i.getIsEnabled=function(){return this.enabled_;},i.enable=function(){this.enabled_=true;},i.disable=function(){this.enabled_=false;},i.reset=function(){this.maxAttempts_=1,this.delayFactor_=0.1,this.fuzzFactor_=0.1,this.initialDelay_=1e3,this.enabled_=false;},i.getMaxAttempts=function(){return this.maxAttempts_;},i.setMaxAttempts=function(n){this.maxAttempts_=n;},i.getDelayFactor=function(){return this.delayFactor_;},i.setDelayFactor=function(n){this.delayFactor_=n;},i.getFuzzFactor=function(){return this.fuzzFactor_;},i.setFuzzFactor=function(n){this.fuzzFactor_=n;},i.getInitialDelay=function(){return this.initialDelay_;},i.setInitialDelay=function(n){this.initialDelay_=n;},i.createRetry=function(n){var a=n===void 0?{}:n,o=a.maxAttempts,u=a.delayFactor,d=a.fuzzFactor,p=a.initialDelay;return new e({maxAttempts:o||this.maxAttempts_,delayFactor:u||this.delayFactor_,fuzzFactor:d||this.fuzzFactor_,initialDelay:p||this.initialDelay_});},t;}(),e=/* @__PURE__ */function(){function t(s){this.maxAttempts_=s.maxAttempts,this.delayFactor_=s.delayFactor,this.fuzzFactor_=s.fuzzFactor,this.currentDelay_=s.initialDelay,this.currentAttempt_=1;}var i=t.prototype;return i.moveToNextAttempt=function(){this.currentAttempt_++;var n=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+n;},i.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_;},i.getCurrentDelay=function(){return this.currentDelay_;},i.getCurrentMinPossibleDelay=function(){return (1-this.fuzzFactor_)*this.currentDelay_;},i.getCurrentMaxPossibleDelay=function(){return (1+this.fuzzFactor_)*this.currentDelay_;},i.getCurrentFuzzedDelay=function(){var n=this.getCurrentMinPossibleDelay(),a=this.getCurrentMaxPossibleDelay();return n+Math.random()*(a-n);},t;}();return ja=r,ja;}var Ha,oc;function n_(){if(oc)return Ha;oc=1;var r=Zn(),e=function e(s,n){return n===void 0&&(n=false),function(a,o,u){if(a){s(a);return;}if(o.statusCode>=400&&o.statusCode<=599){var d=u;if(n)if(r.TextDecoder){var p=t(o.headers&&o.headers["content-type"]);try{d=new TextDecoder(p).decode(u);}catch(_unused4){}}else d=String.fromCharCode.apply(null,new Uint8Array(u));s({cause:d});return;}s(null,u);};};function t(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(s,n){var a=n.split("="),o=a[0],u=a[1];return o.trim()==="charset"?u.trim():s;},"utf-8");}return Ha=e,Ha;}var lc;function a_(){if(lc)return pn.exports;lc=1;var r=Zn(),e=t_(),t=i_(),i=r_(),s=s_();d.httpHandler=n_(),d.requestInterceptorsStorage=new i(),d.responseInterceptorsStorage=new i(),d.retryManager=new s();var n=function n(D){var v={};return D&&D.trim().split("\n").forEach(function(R){var U=R.indexOf(":"),$=R.slice(0,U).trim().toLowerCase(),F=R.slice(U+1).trim();_typeof(v[$])>"u"?v[$]=F:Array.isArray(v[$])?v[$].push(F):v[$]=[v[$],F];}),v;};pn.exports=d,pn.exports.default=d,d.XMLHttpRequest=r.XMLHttpRequest||A,d.XDomainRequest="withCredentials"in new d.XMLHttpRequest()?d.XMLHttpRequest:r.XDomainRequest,a(["get","put","post","patch","head","delete"],function(b){d[b==="delete"?"del":b]=function(D,v,R){return v=u(D,v,R),v.method=b.toUpperCase(),p(v);};});function a(b,D){for(var v=0;v<b.length;v++)D(b[v]);}function o(b){for(var D in b)if(b.hasOwnProperty(D))return false;return true;}function u(b,D,v){var R=b;return t(D)?(v=D,typeof b=="string"&&(R={uri:b})):R=e({},D,{uri:b}),R.callback=v,R;}function d(b,D,v){return D=u(b,D,v),p(D);}function p(b){if(_typeof(b.callback)>"u")throw new Error("callback argument missing");if(b.requestType&&d.requestInterceptorsStorage.getIsEnabled()){var D={uri:b.uri||b.url,headers:b.headers||{},body:b.body,metadata:b.metadata||{},retry:b.retry,timeout:b.timeout},v=d.requestInterceptorsStorage.execute(b.requestType,D);b.uri=v.uri,b.headers=v.headers,b.body=v.body,b.metadata=v.metadata,b.retry=v.retry,b.timeout=v.timeout;}var R=false,U=function U(oe,ae,ue){R||(R=true,b.callback(oe,ae,ue));};function $(){j.readyState===4&&!d.responseInterceptorsStorage.getIsEnabled()&&setTimeout(M,0);}function F(){var te=void 0;if(j.response?te=j.response:te=j.responseText||T(j),ne)try{te=JSON.parse(te);}catch(_unused5){}return te;}function H(te){if(clearTimeout(ce),clearTimeout(b.retryTimeout),te instanceof Error||(te=new Error(""+(te||"Unknown XMLHttpRequest Error"))),te.statusCode=0,!ie&&d.retryManager.getIsEnabled()&&b.retry&&b.retry.shouldRetry()){b.retryTimeout=setTimeout(function(){b.retry.moveToNextAttempt(),b.xhr=j,p(b);},b.retry.getCurrentFuzzedDelay());return;}if(b.requestType&&d.responseInterceptorsStorage.getIsEnabled()){var oe={headers:he.headers||{},body:he.body,responseUrl:j.responseURL,responseType:j.responseType},ae=d.responseInterceptorsStorage.execute(b.requestType,oe);he.body=ae.body,he.headers=ae.headers;}return U(te,he);}function M(){if(!ie){var te;clearTimeout(ce),clearTimeout(b.retryTimeout),b.useXDR&&j.status===void 0?te=200:te=j.status===1223?204:j.status;var oe=he,ae=null;if(te!==0?(oe={body:F(),statusCode:te,method:k,headers:{},url:C,rawRequest:j},j.getAllResponseHeaders&&(oe.headers=n(j.getAllResponseHeaders()))):ae=new Error("Internal XMLHttpRequest Error"),b.requestType&&d.responseInterceptorsStorage.getIsEnabled()){var ue={headers:oe.headers||{},body:oe.body,responseUrl:j.responseURL,responseType:j.responseType},le=d.responseInterceptorsStorage.execute(b.requestType,ue);oe.body=le.body,oe.headers=le.headers;}return U(ae,oe,oe.body);}}var j=b.xhr||null;j||(b.cors||b.useXDR?j=new d.XDomainRequest():j=new d.XMLHttpRequest());var G,ie,C=j.url=b.uri||b.url,k=j.method=b.method||"GET",W=b.body||b.data,Y=j.headers=b.headers||{},X=!!b.sync,ne=false,ce,he={body:void 0,headers:{},statusCode:0,method:k,url:C,rawRequest:j};if("json"in b&&b.json!==false&&(ne=true,Y.accept||Y.Accept||(Y.Accept="application/json"),k!=="GET"&&k!=="HEAD"&&(Y["content-type"]||Y["Content-Type"]||(Y["Content-Type"]="application/json"),W=JSON.stringify(b.json===true?W:b.json))),j.onreadystatechange=$,j.onload=M,j.onerror=H,j.onprogress=function(){},j.onabort=function(){ie=true,clearTimeout(b.retryTimeout);},j.ontimeout=H,j.open(k,C,!X,b.username,b.password),X||(j.withCredentials=!!b.withCredentials),!X&&b.timeout>0&&(ce=setTimeout(function(){if(!ie){ie=true,j.abort("timeout");var te=new Error("XMLHttpRequest timeout");te.code="ETIMEDOUT",H(te);}},b.timeout)),j.setRequestHeader)for(G in Y)Y.hasOwnProperty(G)&&j.setRequestHeader(G,Y[G]);else if(b.headers&&!o(b.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return "responseType"in b&&(j.responseType=b.responseType),"beforeSend"in b&&typeof b.beforeSend=="function"&&b.beforeSend(j),j.send(W||null),j;}function T(b){try{if(b.responseType==="document")return b.responseXML;var D=b.responseXML&&b.responseXML.documentElement.nodeName==="parsererror";if(b.responseType===""&&!D)return b.responseXML;}catch(_unused6){}return null;}function A(){}return pn.exports;}var o_=a_();var lh=/* @__PURE__ */f$1(o_);var za={exports:{}},Wa,uc;function l_(){if(uc)return Wa;uc=1;var r=oh(),e=Object.create||/* @__PURE__ */function(){function C(){}return function(k){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return C.prototype=k,new C();};}();function t(C,k){this.name="ParsingError",this.code=C.code,this.message=k||C.message;}t.prototype=e(Error.prototype),t.prototype.constructor=t,t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function i(C){function k(Y,X,ne,ce){return (Y|0)*3600+(X|0)*60+(ne|0)+(ce|0)/1e3;}var W=C.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return W?W[3]?k(W[1],W[2],W[3].replace(":",""),W[4]):W[1]>59?k(W[1],W[2],0,W[4]):k(0,W[1],W[2],W[4]):null;}function s(){this.values=e(null);}s.prototype={// Only accept the first assignment to any key.
7229
7228
  set:function set(C,k){!this.get(C)&&k!==""&&(this.values[C]=k);},// Return the value for a key, or a default value.
7230
7229
  // If 'defaultKey' is passed then 'dflt' is assumed to be an object with