@streamlayer/react 1.23.0 → 1.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/lib/app/pause-ad.d.ts +2 -4
  2. package/lib/app/polymarket.d.ts +7 -0
  3. package/lib/cjs/Question.js +1 -1
  4. package/lib/cjs/advertisement.js +1 -1
  5. package/lib/cjs/auth.js +1 -1
  6. package/lib/cjs/bet-pack.js +1 -1
  7. package/lib/cjs/feature.js +1 -0
  8. package/lib/cjs/hooks-WfHlJH12.js +1 -0
  9. package/lib/cjs/index.js +1 -1
  10. package/lib/cjs/index10.js +1 -4
  11. package/lib/cjs/index11.js +4 -1
  12. package/lib/cjs/index12.js +1 -1
  13. package/lib/cjs/index13.js +1 -1
  14. package/lib/cjs/index14.js +1 -1
  15. package/lib/cjs/index15.js +1 -5
  16. package/lib/cjs/index16.js +5 -0
  17. package/lib/cjs/index2.js +1 -1
  18. package/lib/cjs/index3.js +1 -1
  19. package/lib/cjs/index4.js +1 -1
  20. package/lib/cjs/index7.js +1 -1
  21. package/lib/cjs/index8.js +1 -1
  22. package/lib/cjs/index9.js +1 -1
  23. package/lib/cjs/insight.js +1 -1
  24. package/lib/cjs/masters.js +1 -1
  25. package/lib/cjs/masters2.js +4 -4
  26. package/lib/cjs/notification.js +1 -1
  27. package/lib/cjs/pause-ad.js +1 -1
  28. package/lib/cjs/points.js +1 -1
  29. package/lib/cjs/polymarket.js +19 -0
  30. package/lib/cjs/storage.js +1 -1
  31. package/lib/cjs/useStreamLayerApp2.js +5 -5
  32. package/lib/classic/app/pause-ad.d.ts +2 -4
  33. package/lib/classic/app/polymarket.d.ts +7 -0
  34. package/lib/classic/cjs/Question.js +1 -1
  35. package/lib/classic/cjs/advertisement.js +1 -1
  36. package/lib/classic/cjs/analytics.js +1 -1
  37. package/lib/classic/cjs/auth.js +1 -1
  38. package/lib/classic/cjs/bet-pack.js +3 -3
  39. package/lib/classic/cjs/feature.js +1 -0
  40. package/lib/classic/cjs/hooks-WfHlJH12.js +1 -0
  41. package/lib/classic/cjs/index.js +1 -1
  42. package/lib/classic/cjs/index10.js +1 -1
  43. package/lib/classic/cjs/index11.js +1 -1
  44. package/lib/classic/cjs/index12.js +1 -4
  45. package/lib/classic/cjs/index13.js +4 -0
  46. package/lib/classic/cjs/index2.js +2 -2
  47. package/lib/classic/cjs/index5.js +1 -1
  48. package/lib/classic/cjs/index6.js +1 -1
  49. package/lib/classic/cjs/index7.js +1 -1
  50. package/lib/classic/cjs/index8.js +1 -1
  51. package/lib/classic/cjs/index9.js +1 -1
  52. package/lib/classic/cjs/insight.js +1 -1
  53. package/lib/classic/cjs/notification.js +1 -1
  54. package/lib/classic/cjs/notification2.js +1 -1
  55. package/lib/classic/cjs/pause-ad.js +1 -1
  56. package/lib/classic/cjs/points.js +1 -1
  57. package/lib/classic/cjs/polymarket.js +19 -0
  58. package/lib/classic/cjs/useStreamLayerApp2.js +5 -5
  59. package/lib/classic/es/Question.js +4 -4
  60. package/lib/classic/es/advertisement.js +6 -6
  61. package/lib/classic/es/analytics.js +1 -1
  62. package/lib/classic/es/auth.js +1 -1
  63. package/lib/classic/es/bet-pack.js +18 -17
  64. package/lib/classic/es/feature.js +63 -0
  65. package/lib/classic/es/hooks-WfHlJH12.js +98 -0
  66. package/lib/classic/es/index.js +2 -2
  67. package/lib/classic/es/index10.js +82 -2295
  68. package/lib/classic/es/index11.js +2351 -179
  69. package/lib/classic/es/index12.js +170 -822
  70. package/lib/classic/es/index13.js +835 -0
  71. package/lib/classic/es/index2.js +127 -126
  72. package/lib/classic/es/index5.js +4 -5
  73. package/lib/classic/es/index6.js +5 -11
  74. package/lib/classic/es/index7.js +5 -62
  75. package/lib/classic/es/index8.js +7 -315
  76. package/lib/classic/es/index9.js +313 -81
  77. package/lib/classic/es/insight.js +2 -2
  78. package/lib/classic/es/notification.js +2 -2
  79. package/lib/classic/es/notification2.js +14 -13
  80. package/lib/classic/es/pause-ad.js +20 -20
  81. package/lib/classic/es/points.js +15 -14
  82. package/lib/classic/es/polymarket.js +6670 -0
  83. package/lib/classic/es/useStreamLayerApp2.js +143 -119
  84. package/lib/dist/cjs/masters.js +23 -23
  85. package/lib/dist/es/masters.js +189 -165
  86. package/lib/dist/index.d.ts +17 -6
  87. package/lib/dist/style.css +1 -1
  88. package/lib/es/Question.js +2 -2
  89. package/lib/es/advertisement.js +5 -5
  90. package/lib/es/auth.js +1 -1
  91. package/lib/es/bet-pack.js +1 -1
  92. package/lib/es/feature.js +63 -0
  93. package/lib/es/hooks-WfHlJH12.js +98 -0
  94. package/lib/es/index.js +2 -2
  95. package/lib/es/index10.js +236 -804
  96. package/lib/es/index11.js +822 -170
  97. package/lib/es/index12.js +166 -302
  98. package/lib/es/index13.js +313 -81
  99. package/lib/es/index14.js +82 -2350
  100. package/lib/es/index15.js +2330 -1229
  101. package/lib/es/index16.js +1254 -0
  102. package/lib/es/index2.js +118 -117
  103. package/lib/es/index3.js +3 -61
  104. package/lib/es/index4.js +3 -3
  105. package/lib/es/index7.js +5 -7
  106. package/lib/es/index8.js +5 -9
  107. package/lib/es/index9.js +7 -263
  108. package/lib/es/insight.js +2 -2
  109. package/lib/es/masters.js +1 -1
  110. package/lib/es/masters2.js +25 -24
  111. package/lib/es/notification.js +8 -7
  112. package/lib/es/pause-ad.js +20 -20
  113. package/lib/es/points.js +6 -5
  114. package/lib/es/polymarket.js +6670 -0
  115. package/lib/es/storage.js +2 -2
  116. package/lib/es/useStreamLayerApp2.js +143 -119
  117. package/lib/style.css +1 -1
  118. package/package.json +24 -14
  119. package/lib/cjs/hooks-B0Qttldg.js +0 -1
  120. package/lib/classic/cjs/hooks-B0Qttldg.js +0 -1
  121. package/lib/classic/es/hooks-B0Qttldg.js +0 -98
  122. package/lib/es/hooks-B0Qttldg.js +0 -98
@@ -1,3 +1,4 @@
1
+ import { StreamLayerSDKTvOptions } from '@streamlayer/react-ui/webos';
1
2
  import { Component } from 'react';
2
3
  import { VideoPlayerCallback } from '@streamlayer/react-ui/core/provider';
3
4
  export type StreamLayerPauseAdProps = {
@@ -12,10 +13,7 @@ export type StreamLayerPauseAdProps = {
12
13
  onRenderPauseAd?: (params: {
13
14
  rendered: boolean;
14
15
  }) => void;
15
- options?: {
16
- showPauseButton?: boolean;
17
- pauseAdDelay?: number;
18
- };
16
+ options?: StreamLayerSDKTvOptions;
19
17
  };
20
18
  export declare class StreamLayerPauseAd extends Component<StreamLayerPauseAdProps, {
21
19
  hasError: boolean;
@@ -0,0 +1,7 @@
1
+ import '@streamlayer/sdk-web-core/ui';
2
+ export declare const StreamLayerSDKPolymarketButton: React.FC<{
3
+ theme?: string;
4
+ }>;
5
+ export declare const StreamLayerSDKPolymarket: React.FC<{
6
+ theme?: string;
7
+ }>;
@@ -1 +1 @@
1
- "use strict";const o=require("react/jsx-runtime"),a=require("./sl-types.js"),u=require("react"),v=require("./index9.js"),E=require("./index10.js"),Y=require("./utils.js"),x=require("./useStreamLayerApp2.js"),$=u.createContext({sdk:null,topNavigation:!1}),B=()=>u.useContext($),G=a.styled_default("div")({name:"QuestionAdvertisementContainer",class:"qwludgs",propsAsIs:!1}),J=a.styled_default("div")({name:"QuestionAdvertisementText",class:"qvce6pv",propsAsIs:!1}),K=a.styled_default("div")({name:"QuestionAdvertisementImage",class:"qsid7hx",propsAsIs:!1}),M=({sponsorLogo:e,id:l,hasBanner:r,setAdShowed:n})=>{const i=u.useRef();return u.useEffect(()=>(i.current=setTimeout(()=>{n(!0)},5e3),()=>{clearTimeout(i.current)}),[n,l,r]),o.jsxs(G,{children:[o.jsx(J,{children:"PRESENTED BY"}),o.jsx(K,{children:o.jsx("img",{src:e,alt:"ad-sponsor-logo"})})]})},V=a.styled_default("div")({name:"QuestionContainer",class:"q14ckf9e",propsAsIs:!1}),W=({openedQuestion:e,muted:l,webos:r})=>{var n,i;const{sdk:t}=B();return((n=e==null?void 0:e.attributes)==null?void 0:n.attributes.case)==="insight"?o.jsx(v.u,{...e.attributes.attributes.value,muted:l,controlVideo:t==null?void 0:t.controlVideoPlayer,webos:r}):((i=e==null?void 0:e.attributes)==null?void 0:i.attributes.case)==="tweet"?o.jsx(v.a,{...e.attributes.attributes.value,muted:l,controlVideo:t==null?void 0:t.controlVideoPlayer}):null},X=({extendedQuestion:e,vote:l,close:r,webos:n})=>{const{loading:i,data:t}=e;return t?o.jsx(E.ee,{webos:n,vote:l,close:r,openedQuestion:t,isLoading:!!i}):o.jsx(E.te,{})},Z=({gamification:e,sdk:l,muted:r,skipAutoClose:n,hideSponsor:i,className:t,hideHeader:D,webos:m})=>{var b,g,h,A,j,y,Q,q,w,T,S,f,U,I,N,k;const d=a.useStore(e.openedQuestion.$store),s=a.useStore(e.openedQuestion.$extendedStore),[_,P]=u.useState(!1),H=a.useStore(l.options),C=((b=d==null?void 0:d.attributes)==null?void 0:b.type)===x.QuestionType.FACTOID,c=(g=d==null?void 0:d.attributes)==null?void 0:g.backgroundImage,p=(h=s.data)==null?void 0:h.backgroundImage,O=C?c==null?void 0:c.landscapeUrl:p==null?void 0:p.landscapeUrl,z=C?c==null?void 0:c.portraitUrl:p==null?void 0:p.portraitUrl,L=Y.y({containerId:H.containerId,landscapeUrl:O,portraitUrl:z});if(!d)return null;const R=d.type,F=((j=(A=s.data)==null?void 0:A.options)==null?void 0:j.options.case)==="factoid"?s.data.options.options.value.closeTimer:void 0;return s.data&&s.data.adUnit===x.AdUnit.STANDART&&!_?o.jsxs(V,{className:t,children:[L,o.jsx(M,{id:s.data.id,hasBanner:!!((Q=(y=s.data.promotion)==null?void 0:y.banner)!=null&&Q.imageUrl),setAdShowed:P,sponsorLogo:((w=(q=s.data.promotion)==null?void 0:q.sponsor)==null?void 0:w.logo)||((T=s.data.sponsorship)==null?void 0:T.logo)||""})]}):o.jsxs(V,{className:t,children:[L,!D&&o.jsx(v.y,{closeTimer:n?void 0:F,close:e.closeQuestion,type:((S=d.attributes)==null?void 0:S.type)||x.QuestionType.UNSET,webos:m}),R==="question"&&o.jsx(X,{webos:m,vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:s}),R!=="question"&&o.jsx(W,{muted:r,openedQuestion:d,webos:m}),!i&&o.jsx(v.d,{sponsorLogo:((I=(U=(f=s.data)==null?void 0:f.promotion)==null?void 0:U.sponsor)==null?void 0:I.logo)||((k=(N=s.data)==null?void 0:N.sponsorship)==null?void 0:k.logo)})]})};exports.e=$;exports.ht=Z;exports.p=B;
1
+ "use strict";const o=require("react/jsx-runtime"),a=require("./sl-types.js"),u=require("react"),v=require("./index10.js"),E=require("./index11.js"),Y=require("./utils.js"),x=require("./useStreamLayerApp2.js"),$=u.createContext({sdk:null,topNavigation:!1}),B=()=>u.useContext($),G=a.styled_default("div")({name:"QuestionAdvertisementContainer",class:"qwludgs",propsAsIs:!1}),J=a.styled_default("div")({name:"QuestionAdvertisementText",class:"qvce6pv",propsAsIs:!1}),K=a.styled_default("div")({name:"QuestionAdvertisementImage",class:"qsid7hx",propsAsIs:!1}),M=({sponsorLogo:e,id:l,hasBanner:r,setAdShowed:n})=>{const i=u.useRef();return u.useEffect(()=>(i.current=setTimeout(()=>{n(!0)},5e3),()=>{clearTimeout(i.current)}),[n,l,r]),o.jsxs(G,{children:[o.jsx(J,{children:"PRESENTED BY"}),o.jsx(K,{children:o.jsx("img",{src:e,alt:"ad-sponsor-logo"})})]})},V=a.styled_default("div")({name:"QuestionContainer",class:"q14ckf9e",propsAsIs:!1}),W=({openedQuestion:e,muted:l,webos:r})=>{var n,i;const{sdk:t}=B();return((n=e==null?void 0:e.attributes)==null?void 0:n.attributes.case)==="insight"?o.jsx(v.u,{...e.attributes.attributes.value,muted:l,controlVideo:t==null?void 0:t.controlVideoPlayer,webos:r}):((i=e==null?void 0:e.attributes)==null?void 0:i.attributes.case)==="tweet"?o.jsx(v.a,{...e.attributes.attributes.value,muted:l,controlVideo:t==null?void 0:t.controlVideoPlayer}):null},X=({extendedQuestion:e,vote:l,close:r,webos:n})=>{const{loading:i,data:t}=e;return t?o.jsx(E.ee,{webos:n,vote:l,close:r,openedQuestion:t,isLoading:!!i}):o.jsx(E.te,{})},Z=({gamification:e,sdk:l,muted:r,skipAutoClose:n,hideSponsor:i,className:t,hideHeader:D,webos:m})=>{var b,g,h,A,j,y,Q,q,w,T,S,f,U,I,N,k;const d=a.useStore(e.openedQuestion.$store),s=a.useStore(e.openedQuestion.$extendedStore),[_,P]=u.useState(!1),H=a.useStore(l.options),C=((b=d==null?void 0:d.attributes)==null?void 0:b.type)===x.QuestionType.FACTOID,c=(g=d==null?void 0:d.attributes)==null?void 0:g.backgroundImage,p=(h=s.data)==null?void 0:h.backgroundImage,O=C?c==null?void 0:c.landscapeUrl:p==null?void 0:p.landscapeUrl,z=C?c==null?void 0:c.portraitUrl:p==null?void 0:p.portraitUrl,L=Y.y({containerId:H.containerId,landscapeUrl:O,portraitUrl:z});if(!d)return null;const R=d.type,F=((j=(A=s.data)==null?void 0:A.options)==null?void 0:j.options.case)==="factoid"?s.data.options.options.value.closeTimer:void 0;return s.data&&s.data.adUnit===x.AdUnit.STANDART&&!_?o.jsxs(V,{className:t,children:[L,o.jsx(M,{id:s.data.id,hasBanner:!!((Q=(y=s.data.promotion)==null?void 0:y.banner)!=null&&Q.imageUrl),setAdShowed:P,sponsorLogo:((w=(q=s.data.promotion)==null?void 0:q.sponsor)==null?void 0:w.logo)||((T=s.data.sponsorship)==null?void 0:T.logo)||""})]}):o.jsxs(V,{className:t,children:[L,!D&&o.jsx(v.y,{closeTimer:n?void 0:F,close:e.closeQuestion,type:((S=d.attributes)==null?void 0:S.type)||x.QuestionType.UNSET,webos:m}),R==="question"&&o.jsx(X,{webos:m,vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:s}),R!=="question"&&o.jsx(W,{muted:r,openedQuestion:d,webos:m}),!i&&o.jsx(v.d,{sponsorLogo:((I=(U=(f=s.data)==null?void 0:f.promotion)==null?void 0:U.sponsor)==null?void 0:I.logo)||((k=(N=s.data)==null?void 0:N.sponsorship)==null?void 0:k.logo)})]})};exports.e=$;exports.ht=Z;exports.p=B;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("react/jsx-runtime"),by=require("./index7.js"),J=require("./sl-types.js"),El=require("./analytics.js"),Se=require("react"),ei=require("./index3.js"),oe=require("./useStreamLayerApp2.js"),Aa=require("./index13.js"),xy=require("./index6.js"),Jn=require("./index12.js"),ci=require("./index14.js"),Cs=require("uuid"),Sy=require("./utils.js"),Jt=require("./hooks-B0Qttldg.js");function Ke(){return Ke=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Ke.apply(null,arguments)}const Ey=J.styled_default("div")({name:"Container",class:"c5b6wdg",propsAsIs:!1}),Cy="a1rlj479",Ay="s35f1di",wy="sj4471g",Dy="b12050d8",Iy="b1d5ybek",ky=i=>i==="left"||i==="right"?Ay:Dy,Py=i=>i==="left"||i==="right"?wy:Iy,Ly=i=>i==="left"?"avdxyl3":i==="right"?"a1bisd08":i==="top"?"a1u9y2aj":"a1qqaks",Cl=({children:i,style:e,className:t,enabled:r=!0,hiding:s,direction:n="left",onAnimationEnd:a})=>G.jsx(Ey,{style:e,className:J.cx_default(t,Cy,Ly(n),r&&!s&&ky(n),r&&s&&Py(n)),onAnimationEnd:a,children:i}),Ry=J.styled_default("a")({name:"Link",class:"l1sgte8c",propsAsIs:!1}),Oy=J.styled_default("div")({name:"BannerContainer",class:"b7yfc72",propsAsIs:!1}),Ny=()=>Ry,By=J.styled_default(Ny())({name:"BannerLink",class:"bejjq94",propsAsIs:!0}),_h=({promotion:i,promotionId:e,hiding:t,isEventFired:r,fireEvent:s,direction:n="bottom"})=>{const a=(i==null?void 0:i.adUnit)===oe.AdUnit.STANDART,l=a?i.banner:i.additionalBanner;if(Se.useEffect(()=>{l!=null&&l.imageUrl&&i.type&&e&&(r!=null&&r("banner-showed")||(ei.eventBus.emit("advertisement",{action:"bannerShown",payload:{id:e,type:i.type}}),s==null||s("banner-showed")))},[l==null?void 0:l.imageUrl,s,r,i.type,e]),!(l!=null&&l.imageUrl))return null;let u=l==null?void 0:l.url;return u&&u.indexOf("http")!==0&&(u=`https://${u}`),G.jsx(Cl,{direction:n,hiding:t,children:G.jsx(Oy,{className:"BannerContainer","data-is-ad":a,children:G.jsx(By,{as:u?"a":"span",className:"BannerLink",href:u,style:{backgroundImage:`url(${l.imageUrl})`,cursor:u?"pointer":"default"},"data-promo-id":e,"data-promo-type":i.type,"data-a":"banner",target:"_blank","data-is-ad":a})})})},My=({cardId:i,promotion:e,direction:t="bottom"})=>G.jsx(_h,{promotion:e,promotionId:i,direction:t,hiding:!1}),Uy=J.styled_default("div")({name:"NotificationContent",class:"n18wsqoo",propsAsIs:!1}),Fy=J.styled_default("div")({name:"Body",class:"b1ia90c2",propsAsIs:!1}),$y=J.styled_default("div")({name:"Title",class:"tg2z08v",propsAsIs:!1}),jy=J.styled_default("div")({name:"Text",class:"t59zdk1",propsAsIs:!1}),Cr=J.styled_default("div")({name:"MediaImgBottom",class:"m1ab9fq",propsAsIs:!1}),Vy=()=>Cr,qy=J.styled_default(Vy())({name:"MediaImgMiddle",class:"m9fsr0y",propsAsIs:!0}),yc=J.styled_default("img")({name:"CtaIcon",class:"cvi9y5q",propsAsIs:!1}),Hy=J.styled_default("div")({name:"Logo",class:"l5mq0z",propsAsIs:!1}),zy=J.styled_default("div")({name:"Footer",class:"f1mse0ft",propsAsIs:!1}),Wy=J.styled_default("div")({name:"Vector",class:"v1hcloah",propsAsIs:!1}),Gy=J.styled_default("div")({name:"NotificationContainer",class:"n3n65jf",propsAsIs:!1}),Th=J.styled_default("button")({name:"TVButton",class:"tkkfuqy",propsAsIs:!1}),Ky=()=>Th,Xy=J.styled_default(Ky())({name:"DismissButton",class:"dh9vato",propsAsIs:!0}),Yy=()=>Th,vh=J.styled_default(Yy())({name:"OpenButton",class:"oeah8gv",propsAsIs:!0}),Qy={[oe.NotificationPromotionImagePosition.UNSET]:Cr,[oe.NotificationPromotionImagePosition.FIT]:Cr,[oe.NotificationPromotionImagePosition.CENTERED]:Cr,[oe.NotificationPromotionImagePosition.SOLID]:Cr,[oe.NotificationPromotionImagePosition.BOTTOM]:Cr,[oe.NotificationPromotionImagePosition.MIDDLE]:qy},Jy=({src:i,imagePosition:e})=>{const t=Qy[e];return G.jsx(t,{children:G.jsx("img",{src:i,alt:""})})},Zy=Aa.O(Xy),e_=Aa.O(vh),t_=({notification:i,open:e,close:t,webos:r})=>{if(!i||!i.promotion||i.enabled!==oe.NotificationEnabled.NOTIFICATION_ENABLED)return null;const{title:s,body:n,image:a,promotion:l}=i,{sponsorLogo:u,sponsorLogoMode:f,imagePosition:p,ctaButton:T}=l;return G.jsxs(Gy,{"data-webos":r,className:"SL_Lower_Third_Notification",onClick:r?void 0:e,children:[G.jsxs(Uy,{children:[G.jsx(Jy,{src:a,imagePosition:p}),G.jsxs(Fy,{children:[s&&G.jsx($y,{children:s}),n&&G.jsx(jy,{children:n})]})]}),G.jsxs(zy,{children:[f!==oe.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&G.jsxs(G.Fragment,{children:[G.jsx(Hy,{children:G.jsx("img",{src:u,alt:s})}),G.jsx(Wy,{})]}),r?G.jsxs(G.Fragment,{children:[G.jsx(Zy,{webos:!0,onClick:t,children:"Dismiss"}),G.jsxs(e_,{webos:!0,autoFocus:!0,style:{color:T==null?void 0:T.textColor,backgroundColor:T==null?void 0:T.color},onClick:e,children:[(T==null?void 0:T.ctaIcon)&&(T==null?void 0:T.ctaIconMode)===oe.CtaIconMode.CTA_ICON_TRANSPARENT&&G.jsx(yc,{src:T==null?void 0:T.ctaIcon,alt:"cta-icon"}),(T==null?void 0:T.label)||"Open"]})]}):G.jsxs(vh,{name:"promo-button",style:{color:T==null?void 0:T.textColor,backgroundColor:T==null?void 0:T.color},children:[(T==null?void 0:T.ctaIcon)&&(T==null?void 0:T.ctaIconMode)===oe.CtaIconMode.CTA_ICON_TRANSPARENT&&G.jsx(yc,{src:T==null?void 0:T.ctaIcon,alt:"cta-icon"}),(T==null?void 0:T.label)||"Open"]})]})]})},i_=J.styled_default("div")({name:"NotificationContent",class:"n1ku6hz",propsAsIs:!1}),r_=J.styled_default("div")({name:"NotificationContainer",class:"nbxqmol",propsAsIs:!1}),s_=J.styled_default("div")({name:"Body",class:"b1gu3eml",propsAsIs:!1}),n_=J.styled_default("div")({name:"Title",class:"t1u17zva",propsAsIs:!1}),a_=J.styled_default("div")({name:"Text",class:"t10ko1g",propsAsIs:!1}),wa=J.styled_default("div")({name:"Media",class:"mntc42e",propsAsIs:!1}),o_=()=>wa,_c=J.styled_default(o_())({name:"MediaImgFit",class:"ml060eo",propsAsIs:!0}),l_=()=>wa,bh=J.styled_default(l_())({name:"MediaImgCentered",class:"m1vqlvig",propsAsIs:!0}),u_=()=>bh,c_=J.styled_default(u_())({name:"MediaImgBottom",class:"m1e7tvi5",propsAsIs:!0}),d_=()=>wa,h_=J.styled_default(d_())({name:"MediaImgSolid",class:"mqvntt2",propsAsIs:!0}),f_=()=>wa,p_=J.styled_default(f_())({name:"MediaImgMiddle",class:"m12jtj3u",propsAsIs:!0}),m_=J.styled_default("img")({name:"CtaIcon",class:"ckq1frv",propsAsIs:!1}),g_=()=>xy.B1,y_=J.styled_default(g_())({name:"StyledChevronRight",class:"s9mjmz3",propsAsIs:!0}),__=J.styled_default("div")({name:"Logo",class:"l1cf50a7",propsAsIs:!1}),xh=J.styled_default("button")({name:"TVButton",class:"thdqfl0",propsAsIs:!1}),T_=()=>xh,v_=J.styled_default(T_())({name:"DismissButton",class:"d11pe8bx",propsAsIs:!0}),b_=()=>xh,x_=J.styled_default(b_())({name:"OpenButton",class:"oy9k0kp",propsAsIs:!0}),S_={[oe.NotificationPromotionImagePosition.UNSET]:_c,[oe.NotificationPromotionImagePosition.FIT]:_c,[oe.NotificationPromotionImagePosition.CENTERED]:bh,[oe.NotificationPromotionImagePosition.BOTTOM]:c_,[oe.NotificationPromotionImagePosition.SOLID]:h_,[oe.NotificationPromotionImagePosition.MIDDLE]:p_},E_=({src:i,imagePosition:e})=>{const t=S_[e];return G.jsx(t,{children:G.jsx("img",{src:i,alt:""})})},C_=Aa.O(v_),A_=Aa.O(x_),w_=({notification:i,open:e,promotionId:t,hiding:r,direction:s="left",close:n,webos:a})=>{if(!i||!i.promotion||i.enabled!==oe.NotificationEnabled.NOTIFICATION_ENABLED)return null;if(i.promotion.mode===oe.NotificationPromotionMode.LOWER_THIRD)return G.jsx(t_,{notification:i,open:e,close:n,webos:a});const{title:l,body:u,image:f,promotion:p}=i,{sponsorLogo:T,sponsorLogoMode:b,imagePosition:S,ctaButton:A}=p,v=L=>{L.stopPropagation(),n==null||n()};return G.jsx(Cl,{className:"SL_Rich_Notification",direction:s,hiding:r,children:G.jsxs(r_,{onClick:a?()=>{}:e,children:[b!==oe.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&T&&G.jsx(__,{children:G.jsx("img",{src:T,alt:l})}),G.jsxs(i_,{children:[G.jsx(E_,{src:f,imagePosition:S}),G.jsxs(s_,{children:[l&&G.jsx(n_,{children:l}),u&&G.jsx(a_,{children:u})]}),a&&G.jsx(C_,{webos:!0,onClick:v,children:"Dismiss"}),G.jsxs(A_,{webos:a,autoFocus:a,onClick:a?e:()=>{},name:"promo-button",style:{color:A==null?void 0:A.textColor,backgroundColor:A==null?void 0:A.color},children:[(A==null?void 0:A.ctaIcon)&&(A==null?void 0:A.ctaIconMode)===oe.CtaIconMode.CTA_ICON_TRANSPARENT&&G.jsx(m_,{src:A==null?void 0:A.ctaIcon,alt:"cta-icon"}),(A==null?void 0:A.label)||"Open"]}),G.jsx(y_,{name:"chevronRight"})]})]})})},D_=J.styled_default("div")({name:"OverlayContainer",class:"okzhq2w",propsAsIs:!1}),Sh=J.styled_default("div")({name:"PromoOverlay",class:"pmgz5i",propsAsIs:!1}),Eh=J.styled_default("div")({name:"Header",class:"hyxi3jt",propsAsIs:!1}),Ch=J.styled_default("div")({name:"HeaderContent",class:"h149e3gp",propsAsIs:!1}),Ah="h10toh7",Tc=J.styled_default("img")({name:"SponsorLogo",class:"s1jyea6t",propsAsIs:!1}),I_=J.styled_default("div")({name:"SponsorName",class:"szpfa3h",propsAsIs:!1}),wh=J.styled_default("div")({name:"Media",class:"m1crmu01",propsAsIs:!1}),k_=J.styled_default("img")({name:"PromoImg",class:"p1l37r8s",propsAsIs:!1}),P_="s1nmch9k",vc=J.styled_default("div")({name:"Content",class:"c1er0ljd",propsAsIs:!1}),L_=J.styled_default("div")({name:"Description",class:"dydopmr",propsAsIs:!1}),R_=J.styled_default("div")({name:"Sponsor",class:"s1w6nt04",propsAsIs:!1}),O_=J.styled_default("div")({name:"SponsorText",class:"s1evcmtq",propsAsIs:!1}),Dh=J.styled_default("div")({name:"ADLogo",class:"awodx0x",propsAsIs:!1}),N_=J.styled_default("span")({name:"SponsoredText",class:"s1q3n6oi",propsAsIs:!1}),Ih=J.styled_default("div")({name:"ActionBtnWrap",class:"a8d4xfk",propsAsIs:!1}),kh=J.styled_default("a")({name:"ActionButton",class:"at6oobh",propsAsIs:!1}),B_=J.styled_default("div")({name:"Title",class:"t1gyg7tt",propsAsIs:!1}),M_="h17rwbtk",U_=J.styled_default("div")({name:"Container",class:"c10m2bce",propsAsIs:!1}),bc=J.styled_default("div")({name:"Item",class:"ig23yq5",propsAsIs:!1}),F_=J.styled_default("div")({name:"Dot",class:"d1f6aqua",propsAsIs:!1}),$_=({time:i,adCount:e,adPosition:t})=>{const r=Math.floor(i/60),s=i-r*60;return r===0&&s===0&&e===t?null:G.jsxs(U_,{children:[e>1&&G.jsxs(G.Fragment,{children:[G.jsxs(bc,{children:[t," of ",e]}),G.jsx(F_,{})]}),G.jsxs(bc,{children:[r,":",s<10?`0${s}`:s]})]})},j_=J.styled_default("a")({name:"WhyThisAdLink",class:"w13o8uld",propsAsIs:!1}),V_=({whyThisAd:i})=>{const[e,t]=Se.useState(!1);return!i.iconClickThroughURLTemplate||!i.staticResource?null:G.jsxs(j_,{style:{width:i.width,height:i.height,[i.xPosition]:3,[i.yPosition]:11},href:i.iconClickThroughURLTemplate,target:"_blank",rel:"noreferrer",children:[!e&&G.jsx("img",{alt:"ad choice",src:i.staticResource,onLoad:()=>t(!1),onError:()=>t(!0)}),e&&G.jsx("span",{children:"ad choice"})]})},q_=J.styled_default("div")({name:"VideoControls",class:"v1xzooj9",propsAsIs:!1}),Ph=J.styled_default("button")({name:"ControlBtn",class:"c1bo41vr",propsAsIs:!1}),H_=()=>Ph,z_=J.styled_default(H_())({name:"MuteIcon",class:"m13efyu8",propsAsIs:!0}),W_=()=>Ph,G_=J.styled_default(W_())({name:"PauseIcon",class:"pladkgh",propsAsIs:!0}),K_=J.styled_default("div")({name:"Container",class:"cjnga56",propsAsIs:!1}),X_=J.styled_default("div")({name:"ControlsContainer",class:"c7qs1am",propsAsIs:!1}),xc="m12n261r",Sc="m16vcml8",Ec="m1078nk6";function Al(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{id:i.id||null,adId:i.adId||null,sequence:i.sequence||null,apiFramework:i.apiFramework||null,universalAdIds:[],creativeExtensions:[]}}const Y_=["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 Cc(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=[],s=Rh(i);!e.ERRORCODE||t.isCustomCode||/^[0-9]{3}$/.test(e.ERRORCODE)||(e.ERRORCODE=900),e.CACHEBUSTING=Bh(Math.round(1e8*Math.random())),e.TIMESTAMP=new Date().toISOString(),e.RANDOM=e.random=e.CACHEBUSTING;for(const n in e)e[n]=Nh(e[n]);for(const n in s){const a=s[n];typeof a=="string"&&r.push(Lh(a,e))}return r}function Lh(i,e){const t=(i=Ac(i,e)).match(/[^[\]]+(?=])/g);if(!t)return i;let r=t.filter(s=>Y_.indexOf(s)>-1);return r.length===0?i:(r=r.reduce((s,n)=>(s[n]=-1,s),{}),Ac(i,r))}function Ac(i,e){let t=i;for(const r in e){const s=e[r];t=t.replace(new RegExp("(?:\\[|%%)(".concat(r,")(?:\\]|%%)"),"g"),s)}return t}function Rh(i){return Array.isArray(i)?i.map(e=>e&&e.hasOwnProperty("url")?e.url:e):i}function wc(i){return/^(https?:\/\/|\/\/)/.test(i)}function Dc(i,e){for(let t=0;t<e.length;t++)if(Oh(e[t],i))return!0;return!1}function Oh(i,e){if(i&&e){const t=Object.getOwnPropertyNames(i),r=Object.getOwnPropertyNames(e);return t.length===r.length&&i.id===e.id&&i.url===e.url}return!1}function Nh(i){return encodeURIComponent(i).replace(/[!'()*]/g,e=>"%".concat(e.charCodeAt(0).toString(16)))}function Bh(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8;return i.toString().padStart(e,"0")}const De={track:function(i,e,t){Cc(i,e,t).forEach(r=>{typeof window<"u"&&window!==null&&(new Image().src=r)})},resolveURLTemplates:Cc,extractURLsFromTemplates:Rh,filterUrlTemplates:function(i){return i.reduce((e,t)=>{const r=t.url||t;return wc(r)?e.validUrls.push(r):e.invalidUrls.push(r),e},{validUrls:[],invalidUrls:[]})},containsTemplateObject:Dc,isTemplateObjectEqual:Oh,encodeURIComponentRFC3986:Nh,replaceUrlMacros:Lh,isNumeric:function(i){return!isNaN(parseFloat(i))&&isFinite(i)},flatten:function i(e){return e.reduce((t,r)=>t.concat(Array.isArray(r)?i(r):r),[])},joinArrayOfUniqueTemplateObjs:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const t=Array.isArray(i)?i:[],r=Array.isArray(e)?e:[];return t.concat(r).reduce((s,n)=>(Dc(n,s)||s.push(n),s),[])},isValidTimeValue:function(i){return Number.isFinite(i)&&i>=-2},addLeadingZeros:Bh,isValidUrl:wc,isBrowserEnvironment:function(){return typeof window<"u"},formatMacrosValues:function(i){return typeof i!="object"?i:JSON.stringify(i)}};function Ic(i){return["true","TRUE","True","1"].includes(i)}function Q_(i){if(i==null)return-1;if(De.isNumeric(i))return parseInt(i);const e=i.split(":");if(e.length!==3)return-1;const t=e[2].split(".");let r=parseInt(t[0]);t.length===2&&(r+=parseFloat("0.".concat(t[1])));const s=parseInt(60*e[1]),n=parseInt(60*e[0]*60);return isNaN(n)||isNaN(s)||isNaN(r)||s>3600||r>60?-1:n+s+r}const j={childByName:function(i,e){return Array.from(i.childNodes).find(t=>t.nodeName===e)},childrenByName:function(i,e){return Array.from(i.childNodes).filter(t=>t.nodeName===e)},resolveVastAdTagURI:function(i,e){if(!e)return i;if(i.startsWith("//")){const{protocol:t}=location;return"".concat(t).concat(i)}if(!i.includes("://")){const t=e.slice(0,e.lastIndexOf("/"));return"".concat(t,"/").concat(i)}return i},parseBoolean:Ic,parseNodeText:function(i){return i&&(i.textContent||i.text||"").trim()},copyNodeAttribute:function(i,e,t){const r=e.getAttribute(i);r&&t.setAttribute(i,r)},parseAttributes:function(i){return Array.from(i.attributes).reduce((e,t)=>(e[t.nodeName]=t.nodeValue,e),{})},parseDuration:Q_,getStandAloneAds:function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).filter(i=>!parseInt(i.sequence,10))},getSortedAdPods:function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).filter(i=>parseInt(i.sequence,10)).sort((i,e)=>i.sequence-e.sequence)},assignAttributes:function(i,e){i&&Array.from(i).forEach(t=>{let{nodeName:r,nodeValue:s}=t;if(r&&s&&e.hasOwnProperty(r)){let n=s;typeof e[r]=="boolean"&&(n=Ic(n)),e[r]=n}})},mergeWrapperAdData:function(i,e){var t;i.errorURLTemplates=e.errorURLTemplates.concat(i.errorURLTemplates),i.impressionURLTemplates=e.impressionURLTemplates.concat(i.impressionURLTemplates),i.extensions=e.extensions.concat(i.extensions),e.viewableImpression.length>0&&(i.viewableImpression=[...i.viewableImpression,...e.viewableImpression]),i.followAdditionalWrappers=e.followAdditionalWrappers,i.allowMultipleAds=e.allowMultipleAds,i.fallbackOnNoAd=e.fallbackOnNoAd;const r=(e.creatives||[]).filter(l=>l&&l.type==="companion"),s=r.reduce((l,u)=>((u.variations||[]).forEach(f=>{(f.companionClickTrackingURLTemplates||[]).forEach(p=>{De.containsTemplateObject(p,l)||l.push(p)})}),l),[]);i.creatives=r.concat(i.creatives);const n=e.videoClickTrackingURLTemplates&&e.videoClickTrackingURLTemplates.length,a=e.videoCustomClickURLTemplates&&e.videoCustomClickURLTemplates.length;if(i.creatives.forEach(l=>{if(e.trackingEvents&&e.trackingEvents[l.type])for(const u in e.trackingEvents[l.type]){const f=e.trackingEvents[l.type][u];Array.isArray(l.trackingEvents[u])||(l.trackingEvents[u]=[]),l.trackingEvents[u]=l.trackingEvents[u].concat(f)}l.type==="linear"&&(n&&(l.videoClickTrackingURLTemplates=l.videoClickTrackingURLTemplates.concat(e.videoClickTrackingURLTemplates)),a&&(l.videoCustomClickURLTemplates=l.videoCustomClickURLTemplates.concat(e.videoCustomClickURLTemplates)),!e.videoClickThroughURLTemplate||l.videoClickThroughURLTemplate!==null&&l.videoClickThroughURLTemplate!==void 0||(l.videoClickThroughURLTemplate=e.videoClickThroughURLTemplate)),l.type==="companion"&&s.length&&(l.variations||[]).forEach(u=>{u.companionClickTrackingURLTemplates=De.joinArrayOfUniqueTemplateObjs(u.companionClickTrackingURLTemplates,s)})}),e.adVerifications&&(i.adVerifications=i.adVerifications.concat(e.adVerifications)),e.blockedAdCategories&&(i.blockedAdCategories=i.blockedAdCategories.concat(e.blockedAdCategories)),(t=e.creatives)!==null&&t!==void 0&&t.length){const l=e.creatives.filter(u=>{var f;return((f=u.icons)===null||f===void 0?void 0:f.length)&&!u.mediaFiles.length});l.length&&(i.creatives=i.creatives.concat(l))}}};function J_(i,e){const t=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{id:s,adId:n,sequence:a,apiFramework:l}=Al(r);return{id:s,adId:n,sequence:a,apiFramework:l,type:"companion",required:null,variations:[]}}(e);return t.required=i.getAttribute("required")||null,t.variations=j.childrenByName(i,"Companion").map(r=>{const s=function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{id:l.id||null,adType:"companionAd",width:l.width||0,height:l.height||0,assetWidth:l.assetWidth||null,assetHeight:l.assetHeight||null,expandedWidth:l.expandedWidth||null,expandedHeight:l.expandedHeight||null,apiFramework:l.apiFramework||null,adSlotId:l.adSlotId||null,pxratio:l.pxratio||"1",renderingMode:l.renderingMode||"default",staticResources:[],htmlResources:[],iframeResources:[],adParameters:null,altText:null,companionClickThroughURLTemplate:null,companionClickTrackingURLTemplates:[],trackingEvents:{}}}(j.parseAttributes(r));s.htmlResources=j.childrenByName(r,"HTMLResource").reduce((l,u)=>{const f=j.parseNodeText(u);return f?l.concat(f):l},[]),s.iframeResources=j.childrenByName(r,"IFrameResource").reduce((l,u)=>{const f=j.parseNodeText(u);return f?l.concat(f):l},[]),s.staticResources=j.childrenByName(r,"StaticResource").reduce((l,u)=>{const f=j.parseNodeText(u);return f?l.concat({url:f,creativeType:u.getAttribute("creativeType")||null}):l},[]),s.altText=j.parseNodeText(j.childByName(r,"AltText"))||null;const n=j.childByName(r,"TrackingEvents");n&&j.childrenByName(n,"Tracking").forEach(l=>{const u=l.getAttribute("event"),f=j.parseNodeText(l);u&&f&&(Array.isArray(s.trackingEvents[u])||(s.trackingEvents[u]=[]),s.trackingEvents[u].push(f))}),s.companionClickTrackingURLTemplates=j.childrenByName(r,"CompanionClickTracking").map(l=>({id:l.getAttribute("id")||null,url:j.parseNodeText(l)})),s.companionClickThroughURLTemplate=j.parseNodeText(j.childByName(r,"CompanionClickThrough"))||null;const a=j.childByName(r,"AdParameters");return a&&(s.adParameters={value:j.parseNodeText(a),xmlEncoded:a.getAttribute("xmlEncoded")||null}),s}),t}function Z_(i,e){let t;const r=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{id:f,adId:p,sequence:T,apiFramework:b}=Al(u);return{id:f,adId:p,sequence:T,apiFramework:b,type:"linear",duration:0,skipDelay:null,mediaFiles:[],mezzanine:null,interactiveCreativeFile:null,closedCaptionFiles:[],videoClickThroughURLTemplate:null,videoClickTrackingURLTemplates:[],videoCustomClickURLTemplates:[],adParameters:null,icons:[],trackingEvents:{}}}(e);r.duration=j.parseDuration(j.parseNodeText(j.childByName(i,"Duration")));const s=i.getAttribute("skipoffset");if(s==null)r.skipDelay=null;else if(s.charAt(s.length-1)==="%"&&r.duration!==-1){const u=parseInt(s,10);r.skipDelay=r.duration*(u/100)}else r.skipDelay=j.parseDuration(s);const n=j.childByName(i,"VideoClicks");if(n){const u=j.childByName(n,"ClickThrough");r.videoClickThroughURLTemplate=u?{id:u.getAttribute("id")||null,url:j.parseNodeText(u)}:null,j.childrenByName(n,"ClickTracking").forEach(f=>{r.videoClickTrackingURLTemplates.push({id:f.getAttribute("id")||null,url:j.parseNodeText(f)})}),j.childrenByName(n,"CustomClick").forEach(f=>{r.videoCustomClickURLTemplates.push({id:f.getAttribute("id")||null,url:j.parseNodeText(f)})})}const a=j.childByName(i,"AdParameters");a&&(r.adParameters={value:j.parseNodeText(a),xmlEncoded:a.getAttribute("xmlEncoded")||null}),j.childrenByName(i,"TrackingEvents").forEach(u=>{j.childrenByName(u,"Tracking").forEach(f=>{let p=f.getAttribute("event");const T=j.parseNodeText(f);if(p&&T){if(p==="progress"){if(t=f.getAttribute("offset"),!t)return;p=t.charAt(t.length-1)==="%"?"progress-".concat(t):"progress-".concat(j.parseDuration(t))}Array.isArray(r.trackingEvents[p])||(r.trackingEvents[p]=[]),r.trackingEvents[p].push(T)}})}),j.childrenByName(i,"MediaFiles").forEach(u=>{j.childrenByName(u,"MediaFile").forEach(S=>{r.mediaFiles.push(function(A){const v={id:null,fileURL:null,fileSize:0,deliveryType:"progressive",mimeType:null,mediaType:null,codec:null,bitrate:0,minBitrate:0,maxBitrate:0,width:0,height:0,apiFramework:null,scalable:null,maintainAspectRatio:null};v.id=A.getAttribute("id"),v.fileURL=j.parseNodeText(A),v.deliveryType=A.getAttribute("delivery"),v.codec=A.getAttribute("codec"),v.mimeType=A.getAttribute("type"),v.mediaType=A.getAttribute("mediaType")||"2D",v.apiFramework=A.getAttribute("apiFramework"),v.fileSize=parseInt(A.getAttribute("fileSize")||0),v.bitrate=parseInt(A.getAttribute("bitrate")||0),v.minBitrate=parseInt(A.getAttribute("minBitrate")||0),v.maxBitrate=parseInt(A.getAttribute("maxBitrate")||0),v.width=parseInt(A.getAttribute("width")||0),v.height=parseInt(A.getAttribute("height")||0);const L=A.getAttribute("scalable");L&&typeof L=="string"&&(v.scalable=j.parseBoolean(L));const P=A.getAttribute("maintainAspectRatio");return P&&typeof P=="string"&&(v.maintainAspectRatio=j.parseBoolean(P)),v}(S))});const f=j.childByName(u,"InteractiveCreativeFile");f&&(r.interactiveCreativeFile=function(S){const A=function(){let 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(S));return A.fileURL=j.parseNodeText(S),A}(f));const p=j.childByName(u,"ClosedCaptionFiles");p&&j.childrenByName(p,"ClosedCaptionFile").forEach(S=>{const A=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{type:v.type||null,language:v.language||null,fileURL:null}}(j.parseAttributes(S));A.fileURL=j.parseNodeText(S),r.closedCaptionFiles.push(A)});const T=j.childByName(u,"Mezzanine"),b=function(S,A){const v={};let L=!1;return A.forEach(P=>{S&&S.getAttribute(P)?v[P]=S.getAttribute(P):L=!0}),L?null:v}(T,["delivery","type","width","height"]);if(b){const S={id:null,fileURL:null,delivery:null,codec:null,type:null,width:0,height:0,fileSize:0,mediaType:"2D"};S.id=T.getAttribute("id"),S.fileURL=j.parseNodeText(T),S.delivery=b.delivery,S.codec=T.getAttribute("codec"),S.type=b.type,S.width=parseInt(b.width,10),S.height=parseInt(b.height,10),S.fileSize=parseInt(T.getAttribute("fileSize"),10),S.mediaType=T.getAttribute("mediaType")||"2D",r.mezzanine=S}});const l=j.childByName(i,"Icons");return l&&j.childrenByName(l,"Icon").forEach(u=>{r.icons.push(function(f){const 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=f.getAttribute("program"),p.height=parseInt(f.getAttribute("height")||0),p.width=parseInt(f.getAttribute("width")||0),p.xPosition=function(b){return["left","right"].indexOf(b)!==-1?b:parseInt(b||0)}(f.getAttribute("xPosition")),p.yPosition=function(b){return["top","bottom"].indexOf(b)!==-1?b:parseInt(b||0)}(f.getAttribute("yPosition")),p.apiFramework=f.getAttribute("apiFramework"),p.pxratio=f.getAttribute("pxratio")||"1",p.offset=j.parseDuration(f.getAttribute("offset")),p.duration=j.parseDuration(f.getAttribute("duration")),p.altText=f.getAttribute("altText"),p.hoverText=f.getAttribute("hoverText"),j.childrenByName(f,"HTMLResource").forEach(b=>{p.type=b.getAttribute("creativeType")||"text/html",p.htmlResource=j.parseNodeText(b)}),j.childrenByName(f,"IFrameResource").forEach(b=>{p.type=b.getAttribute("creativeType")||0,p.iframeResource=j.parseNodeText(b)}),j.childrenByName(f,"StaticResource").forEach(b=>{p.type=b.getAttribute("creativeType")||0,p.staticResource=j.parseNodeText(b)});const T=j.childByName(f,"IconClicks");if(T){p.iconClickThroughURLTemplate=j.parseNodeText(j.childByName(T,"IconClickThrough")),j.childrenByName(T,"IconClickTracking").forEach(S=>{p.iconClickTrackingURLTemplates.push({id:S.getAttribute("id")||null,url:j.parseNodeText(S)})});const b=j.childByName(T,"IconClickFallbackImages");b&&j.childrenByName(b,"IconClickFallbackImage").forEach(S=>{p.iconClickFallbackImages.push({url:j.parseNodeText(S)||null,width:S.getAttribute("width")||null,height:S.getAttribute("height")||null})})}return p.iconViewTrackingURLTemplate=j.parseNodeText(j.childByName(f,"IconViewTracking")),p}(u))}),r}function eT(i,e){const t=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{id:s,adId:n,sequence:a,apiFramework:l}=Al(r);return{id:s,adId:n,sequence:a,apiFramework:l,type:"nonlinear",variations:[],trackingEvents:{}}}(e);return j.childrenByName(i,"TrackingEvents").forEach(r=>{let s,n;j.childrenByName(r,"Tracking").forEach(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(i,"NonLinear").forEach(r=>{const s={id:null,width:0,height:0,expandedWidth:0,expandedHeight:0,scalable:!0,maintainAspectRatio:!0,minSuggestedDuration:0,apiFramework:"static",adType:"nonLinearAd",type:null,staticResource:null,htmlResource:null,iframeResource:null,nonlinearClickThroughURLTemplate:null,nonlinearClickTrackingURLTemplates:[],adParameters:null};s.id=r.getAttribute("id")||null,s.width=r.getAttribute("width"),s.height=r.getAttribute("height"),s.expandedWidth=r.getAttribute("expandedWidth"),s.expandedHeight=r.getAttribute("expandedHeight"),s.scalable=j.parseBoolean(r.getAttribute("scalable")),s.maintainAspectRatio=j.parseBoolean(r.getAttribute("maintainAspectRatio")),s.minSuggestedDuration=j.parseDuration(r.getAttribute("minSuggestedDuration")),s.apiFramework=r.getAttribute("apiFramework"),j.childrenByName(r,"HTMLResource").forEach(a=>{s.type=a.getAttribute("creativeType")||"text/html",s.htmlResource=j.parseNodeText(a)}),j.childrenByName(r,"IFrameResource").forEach(a=>{s.type=a.getAttribute("creativeType")||0,s.iframeResource=j.parseNodeText(a)}),j.childrenByName(r,"StaticResource").forEach(a=>{s.type=a.getAttribute("creativeType")||0,s.staticResource=j.parseNodeText(a)});const n=j.childByName(r,"AdParameters");n&&(s.adParameters={value:j.parseNodeText(n),xmlEncoded:n.getAttribute("xmlEncoded")||null}),s.nonlinearClickThroughURLTemplate=j.parseNodeText(j.childByName(r,"NonLinearClickThrough")),j.childrenByName(r,"NonLinearClickTracking").forEach(a=>{s.nonlinearClickTrackingURLTemplates.push({id:a.getAttribute("id")||null,url:j.parseNodeText(a)})}),t.variations.push(s)}),t}function kc(i){const e=[];return i.forEach(t=>{const r=Mh(t);r&&e.push(r)}),e}function Mh(i){if(i.nodeName==="#comment")return null;const e={name:null,value:null,attributes:{},children:[]},t=i.attributes,r=i.childNodes;if(e.name=i.nodeName,i.attributes){for(const n in t)if(t.hasOwnProperty(n)){const a=t[n];a.nodeName&&a.nodeValue&&(e.attributes[a.nodeName]=a.nodeValue)}}for(const n in r)if(r.hasOwnProperty(n)){const a=Mh(r[n]);a&&e.children.push(a)}if(e.children.length===0||e.children.length===1&&["#cdata-section","#text"].indexOf(e.children[0].name)>=0){const n=j.parseNodeText(i);n!==""&&(e.value=n),e.children=[]}return(s=e).value===null&&Object.keys(s.attributes).length===0&&s.children.length===0?null:e;var s}function tT(i){return i.getAttribute("AdID")||i.getAttribute("adID")||i.getAttribute("adId")||null}const Kn={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 Pc(i,e){if(!Kn[i.nodeName]||!Kn[i.nodeName].attributes)return;const t=Kn[i.nodeName].attributes.filter(r=>!i.getAttribute(r));t.length>0&&Gs({name:i.nodeName,parentName:i.parentNode.nodeName,attributes:t},e)}function Lc(i,e,t){const r=Kn[i.nodeName],s=!t&&i.nodeName!=="Wrapper";if(!(!r||s)){if(r.subElements){const n=r.subElements.filter(a=>!j.childByName(i,a));n.length>0&&Gs({name:i.nodeName,parentName:i.parentNode.nodeName,subElements:n},e)}!t||!r.oneOfinLineResources||r.oneOfinLineResources.some(n=>j.childByName(i,n))||Gs({name:i.nodeName,parentName:i.parentNode.nodeName,oneOfResources:r.oneOfinLineResources},e)}}function Rc(i){return i.children&&i.children.length!==0}function Gs(i,e){let{name:t,parentName:r,attributes:s,subElements:n,oneOfResources:a}=i,l="Element '".concat(t,"'");l+=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:l,parentElement:r,specVersion:4.1})}const iT={verifyRequiredValues:function i(e,t,r){if(e&&e.nodeName)if(e.nodeName==="InLine"&&(r=!0),Pc(e,t),Rc(e)){Lc(e,t,r);for(let s=0;s<e.children.length;s++)i(e.children[s],t,r)}else j.parseNodeText(e).length===0&&Gs({name:e.nodeName,parentName:e.parentNode.nodeName},t)},hasSubElements:Rc,emitMissingValueWarning:Gs,verifyRequiredAttributes:Pc,verifyRequiredSubElements:Lc};function rT(i,e){let{allowMultipleAds:t,followAdditionalWrappers:r}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=Array.from(i.childNodes).filter(n=>{const a=n.nodeName.toLowerCase();return a==="inline"||r!==!1&&a==="wrapper"});for(const n of s){if(j.copyNodeAttribute("id",i,n),j.copyNodeAttribute("sequence",i,n),j.copyNodeAttribute("adType",i,n),n.nodeName==="Wrapper")return{ad:nT(n,e),type:"WRAPPER"};if(n.nodeName==="InLine")return{ad:sT(n,e,{allowMultipleAds:t}),type:"INLINE"};const a=n.nodeName.toLowerCase();e("VAST-warning",{message:"<".concat(n.nodeName,a==="inline"?"> must be written <InLine>":"> must be written <Wrapper>"),wrongNode:n})}}function sT(i,e){let{allowMultipleAds:t}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t===!1&&i.getAttribute("sequence")?null:Uh(i,e)}function Uh(i,e){let t=[];e&&iT.verifyRequiredValues(i,e);const r=Array.from(i.childNodes),s=function(){let 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:!0,allowMultipleAds:!1,fallbackOnNoAd:null}}(j.parseAttributes(i));return r.forEach(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){const l=[];return a.forEach(u=>{const f={id:u.getAttribute("id")||null,adId:tT(u),sequence:u.getAttribute("sequence")||null,apiFramework:u.getAttribute("apiFramework")||null},p=[];let T;j.childrenByName(u,"UniversalAdId").forEach(S=>{const A={idRegistry:S.getAttribute("idRegistry")||"unknown",value:j.parseNodeText(S)};p.push(A)});const b=j.childByName(u,"CreativeExtensions");b&&(T=kc(j.childrenByName(b,"CreativeExtension")));for(const S in u.childNodes){const A=u.childNodes[S];let v;switch(A.nodeName){case"Linear":v=Z_(A,f);break;case"NonLinearAds":v=eT(A,f);break;case"CompanionAds":v=J_(A,f)}v&&(p&&(v.universalAdIds=p),T&&(v.creativeExtensions=T),l.push(v))}}),l}(j.childrenByName(n,"Creative"));break;case"Extensions":{const a=j.childrenByName(n,"Extension");s.extensions=kc(a),s.adVerifications.length||(t=function(l){let u=null,f=[];return l.some(p=>u=j.childByName(p,"AdVerifications")),u&&(f=Oc(j.childrenByName(u,"Verification"))),f}(a));break}case"AdVerifications":s.adVerifications=Oc(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){const l=(u,f)=>{const p=j.parseNodeText(f);return p&&u.push(p),u};return{id:a.getAttribute("id")||null,viewable:j.childrenByName(a,"Viewable").reduce(l,[]),notViewable:j.childrenByName(a,"NotViewable").reduce(l,[]),viewUndetermined:j.childrenByName(a,"ViewUndetermined").reduce(l,[])}}(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 nT(i,e){const t=Uh(i,e),r=i.getAttribute("followAdditionalWrappers"),s=i.getAttribute("allowMultipleAds"),n=i.getAttribute("fallbackOnNoAd");t.followAdditionalWrappers=!r||j.parseBoolean(r),t.allowMultipleAds=!!s&&j.parseBoolean(s),t.fallbackOnNoAd=n?j.parseBoolean(n):null;let a=j.childByName(i,"VASTAdTagURI");if(a?t.nextWrapperURL=j.parseNodeText(a):(a=j.childByName(i,"VASTAdTagURL"),a&&(t.nextWrapperURL=j.parseNodeText(j.childByName(a,"URL")))),t.creatives.forEach(l=>{if(["linear","nonlinear"].includes(l.type)){if(l.trackingEvents){t.trackingEvents||(t.trackingEvents={}),t.trackingEvents[l.type]||(t.trackingEvents[l.type]={});for(const u in l.trackingEvents){const f=l.trackingEvents[u];Array.isArray(t.trackingEvents[l.type][u])||(t.trackingEvents[l.type][u]=[]),f.forEach(p=>{t.trackingEvents[l.type][u].push(p)})}}l.videoClickTrackingURLTemplates&&(Array.isArray(t.videoClickTrackingURLTemplates)||(t.videoClickTrackingURLTemplates=[]),l.videoClickTrackingURLTemplates.forEach(u=>{t.videoClickTrackingURLTemplates.push(u)})),l.videoClickThroughURLTemplate&&(t.videoClickThroughURLTemplate=l.videoClickThroughURLTemplate),l.videoCustomClickURLTemplates&&(Array.isArray(t.videoCustomClickURLTemplates)||(t.videoCustomClickURLTemplates=[]),l.videoCustomClickURLTemplates.forEach(u=>{t.videoCustomClickURLTemplates.push(u)}))}}),t.nextWrapperURL)return t}function Oc(i){const e=[];return i.forEach(t=>{const r={resource:null,vendor:null,browserOptional:!1,apiFramework:null,type:null,parameters:null,trackingEvents:{}},s=Array.from(t.childNodes);j.assignAttributes(t.attributes,r),s.forEach(a=>{let{nodeName:l,textContent:u,attributes:f}=a;switch(l){case"JavaScriptResource":case"ExecutableResource":r.resource=u.trim(),j.assignAttributes(f,r);break;case"VerificationParameters":r.parameters=u.trim()}});const n=j.childByName(t,"TrackingEvents");n&&j.childrenByName(n,"Tracking").forEach(a=>{const l=a.getAttribute("event"),u=j.parseNodeText(a);l&&u&&(Array.isArray(r.trackingEvents[l])||(r.trackingEvents[l]=[]),r.trackingEvents[l].push(u))}),e.push(r)}),e}class Fh{constructor(){this._handlers=[]}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}once(e,t){return this.on(e,function(r,s,n){const a={fired:!1,wrapFn:void 0};function l(){a.fired||(r.off(s,a.wrapFn),a.fired=!0,n.bind(r)(...arguments))}return a.wrapFn=l,l}(this,e,t))}off(e,t){return this._handlers=this._handlers.filter(r=>r.event!==e||r.handler!==t),this}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];let n=!1;return this._handlers.forEach(a=>{a.event==="*"&&(n=!0,a.handler(e,...r)),a.event===e&&(n=!0,a.handler(...r))}),n}removeAllListeners(e){return e?(this._handlers=this._handlers.filter(t=>t.event!==e),this):(this._handlers=[],this)}listenerCount(e){return this._handlers.filter(t=>t.event===e).length}listeners(e){return this._handlers.reduce((t,r)=>(r.event===e&&t.push(r.handler),t),[])}eventNames(){return this._handlers.map(e=>e.event)}}let Nc=0,Go=0;const $h=(i,e)=>{!i||!e||i<=0||e<=0||(Go=(Go*Nc+8*i/e)/++Nc)},aT={ERRORCODE:900,extensions:[]},Bc="VAST response version not supported";class oT extends Fh{constructor(){let{fetcher:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this.maxWrapperDepth=null,this.rootErrorURLTemplates=[],this.errorURLTemplates=[],this.remainingAds=[],this.parsingOptions={},this.fetcher=e||null,this.keepFailedAdPod=!1}trackVastError(e,t){for(var r=arguments.length,s=new Array(r>2?r-2:0),n=2;n<r;n++)s[n-2]=arguments[n];this.emit("VAST-error",Object.assign({},aT,t,...s)),De.track(e,t)}getErrorURLTemplates(){return this.rootErrorURLTemplates.concat(this.errorURLTemplates)}getEstimatedBitrate(){return Go}initParsingStatus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.maxWrapperDepth=e.wrapperLimit||10,this.parsingOptions={allowMultipleAds:e.allowMultipleAds},this.keepFailedAdPod=e.keepFailedAdPod||!1,this.rootURL="",this.resetParsingStatus(),$h(e.byteLength,e.requestDuration)}resetParsingStatus(){this.errorURLTemplates=[],this.rootErrorURLTemplates=[],this.vastVersion=null}getRemainingAds(e){if(this.remainingAds.length===0)return Promise.reject(new Error("No more ads are available for the given VAST"));const t=e?this.remainingAds:[this.remainingAds.shift()];return this.errorURLTemplates=[],this.resolveAds(t,{wrapperDepth:0,url:this.rootURL}).then(r=>this.buildVASTResponse(r))}parseVAST(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.initParsingStatus(t),t.isRootVAST=!0,this.parse(e,t).then(r=>this.buildVASTResponse(r))}buildVASTResponse(e){const t=function(r){let{ads:s,errorURLTemplates:n,version:a}=r;return{ads:s||[],errorURLTemplates:n||[],version:a||null}}({ads:e,errorURLTemplates:this.getErrorURLTemplates(),version:this.vastVersion});return this.completeWrapperResolving(t),t}parseVastXml(e,t){let{isRootVAST:r=!1,url:s=null,wrapperDepth:n=0,allowMultipleAds:a,followAdditionalWrappers:l}=t;if(!e||!e.documentElement||e.documentElement.nodeName!=="VAST"){var u;this.emit("VAST-ad-parsed",{type:"ERROR",url:s,wrapperDepth:n});const b=(e==null||(u=e.documentElement)===null||u===void 0?void 0:u.nodeName)==="VideoAdServingTemplate";throw new Error(b?Bc:"Invalid VAST XMLDocument")}const f=[],p=e.documentElement.childNodes,T=e.documentElement.getAttribute("version");r&&T&&(this.vastVersion=T);for(const b in p){const S=p[b];if(S.nodeName==="Error"){const A=j.parseNodeText(S);r?this.rootErrorURLTemplates.push(A):this.errorURLTemplates.push(A)}else if(S.nodeName==="Ad"){if(this.vastVersion&&parseFloat(this.vastVersion)<3)a=!0;else if(a===!1&&f.length>1)break;const A=rT(S,this.emit.bind(this),{allowMultipleAds:a,followAdditionalWrappers:l});A.ad?(f.push(A.ad),this.emit("VAST-ad-parsed",{type:A.type,url:s,wrapperDepth:n,adIndex:f.length-1,vastVersion:T})):this.trackVastError(this.getErrorURLTemplates(),{ERRORCODE:101})}}return f}parse(e){let{url:t=null,resolveAll:r=!0,wrapperSequence:s=null,previousUrl:n=null,wrapperDepth:a=0,isRootVAST:l=!1,followAdditionalWrappers:u,allowMultipleAds:f}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=[];this.vastVersion&&parseFloat(this.vastVersion)<3&&l&&(f=!0);try{p=this.parseVastXml(e,{isRootVAST:l,url:t,wrapperDepth:a,allowMultipleAds:f,followAdditionalWrappers:u})}catch(T){return Promise.reject(T)}if(p.length===1&&s!=null&&(p[0].sequence=s),r===!1){const T=j.getSortedAdPods(p),b=j.getStandAloneAds(p);T.length?p=T:b.length&&(p=[b.shift()]),this.remainingAds=b}return this.resolveAds(p,{wrapperDepth:a,previousUrl:n,url:t})}resolveAds(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{wrapperDepth:t,previousUrl:r,url:s}=arguments.length>1?arguments[1]:void 0;const n=[];return r=s,e.forEach(a=>{const l=this.resolveWrappers(a,t,r);n.push(l)}),Promise.all(n).then(a=>De.flatten(a))}resolveWrappers(e,t,r){const s={...e};return new Promise(n=>{var a;if(t++,!s.nextWrapperURL)return delete s.nextWrapperURL,n(s);if(!this.fetcher)return s.VASTAdTagURI=s.nextWrapperURL,delete s.nextWrapperURL,n(s);if(t>=this.maxWrapperDepth)return s.errorCode=302,delete s.nextWrapperURL,n(s);s.nextWrapperURL=j.resolveVastAdTagURI(s.nextWrapperURL,r);const l=(a=this.parsingOptions.allowMultipleAds)!==null&&a!==void 0?a:s.allowMultipleAds,u=s.sequence;this.fetcher.fetchVAST({url:s.nextWrapperURL,emitter:this.emit.bind(this),maxWrapperDepth:this.maxWrapperDepth}).then(f=>this.parse(f,{url:s.nextWrapperURL,previousUrl:r,wrapperSequence:u,wrapperDepth:t,followAdditionalWrappers:s.followAdditionalWrappers,allowMultipleAds:l}).then(p=>{if(delete s.nextWrapperURL,p.length===0)return s.creatives=[],n(s);p.forEach(T=>{T&&j.mergeWrapperAdData(T,s)}),n(p)})).catch(f=>{s.errorCode=f.message===Bc?102:301,s.errorMessage=f.message,n(s)})})}completeWrapperResolving(e){if(e.ads.length===0)this.trackVastError(e.errorURLTemplates,{ERRORCODE:303});else for(let t=e.ads.length-1;t>=0;t--){const r=e.ads[t],s=!r.creatives.some(n=>{var a,l;return((a=n.mediaFiles)===null||a===void 0?void 0:a.length)>0||((l=n.variations)===null||l===void 0?void 0:l.length)>0});!r.errorCode&&!s||r.VASTAdTagURI||(this.trackVastError(r.errorURLTemplates.concat(e.errorURLTemplates),{ERRORCODE:r.errorCode||303},{ERRORMESSAGE:r.errorMessage||""},{extensions:r.extensions},{system:r.system}),this.keepFailedAdPod&&r.sequence?r.hasFailed=!0:e.ads.splice(t,1))}}}let gi=null;const lT={data:{},length:0,getItem(i){return this.data[i]},setItem(i,e){this.data[i]=e,this.length=Object.keys(this.data).length},removeItem(i){delete this.data[i],this.length=Object.keys(this.data).length},clear(){this.data={},this.length=0}};class uT{constructor(){this.storage=this.initStorage()}initStorage(){if(gi)return gi;try{gi=typeof window<"u"&&window!==null?window.localStorage||window.sessionStorage:null}catch{gi=null}return gi&&!this.isStorageDisabled(gi)||(gi=lT,gi.clear()),gi}isStorageDisabled(e){const t="__VASTStorage__";try{if(e.setItem(t,t),e.getItem(t)!==t)return e.removeItem(t),!0}catch{return!0}return e.removeItem(t),!1}getItem(e){return this.storage.getItem(e)}setItem(e,t){return this.storage.setItem(e,t)}removeItem(e){return this.storage.removeItem(e)}clear(){return this.storage.clear()}}const Ko=12e4,cT={get:async function(i,e){try{const t=new AbortController,r=setTimeout(()=>{throw t.abort(),new Error("URLHandler: Request timed out after ".concat(e.timeout||Ko," ms (408)"))},e.timeout||Ko),s=await fetch(i,{...e,signal:t.signal,credentials:e.withCredentials?"include":"omit"}).finally(()=>{clearTimeout(r)}),n=function(a){return De.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 n?{error:new Error(n),statusCode:s.status}:async function(a){const l=await a.text();let u;return u=De.isBrowserEnvironment()?new DOMParser:new(await Promise.resolve().then(()=>mb)).DOMParser,{xml:u.parseFromString(l,"text/xml"),details:{byteLength:l.length,statusCode:a.status,rawXml:l}}}(s)}catch(t){return{error:t,statusCode:t.name==="AbortError"?408:null}}}};let dT=class{constructor(){this.URLTemplateFilters=[]}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.urlHandler=e.urlHandler||e.urlhandler||cT,this.fetchingOptions={...e.fetchOptions,timeout:e.timeout||Ko,withCredentials:!!e.withCredentials}}addURLTemplateFilter(e){typeof e=="function"&&this.URLTemplateFilters.push(e)}removeLastURLTemplateFilter(){this.URLTemplateFilters.pop()}countURLTemplateFilters(){return this.URLTemplateFilters.length}clearURLTemplateFilters(){this.URLTemplateFilters=[]}async fetchVAST(e){var t;let{url:r,maxWrapperDepth:s,emitter:n,wrapperDepth:a=0,previousUrl:l=null,wrapperAd:u=null}=e;const f=Date.now();this.URLTemplateFilters.forEach(b=>{r=b(r)}),n("VAST-resolving",{url:r,previousUrl:l,wrapperDepth:a,maxWrapperDepth:s,timeout:this.fetchingOptions.timeout,wrapperAd:u});const p=await this.urlHandler.get(r,this.fetchingOptions),T=Math.round(Date.now()-f);if(n("VAST-resolved",{url:r,previousUrl:l,wrapperDepth:a,error:(p==null?void 0:p.error)||null,duration:T,statusCode:(p==null?void 0:p.statusCode)||null,...p==null?void 0:p.details}),$h(p==null||(t=p.details)===null||t===void 0?void 0:t.byteLength,T),p.error)throw new Error(p.error);return p.xml}},hT=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new uT;this.cappingFreeLunch=e,this.cappingMinimumTimeInterval=t,this.fetcher=new dT,this.vastParser=new oT({fetcher:this.fetcher}),this.storage=r,this.lastSuccessfulAd===void 0&&(this.lastSuccessfulAd=0),this.totalCalls===void 0&&(this.totalCalls=0),this.totalCallsTimeout===void 0&&(this.totalCallsTimeout=0)}addURLTemplateFilter(e){this.fetcher.addURLTemplateFilter(e)}removeLastURLTemplateFilter(){this.fetcher.removeLastURLTemplateFilter()}countURLTemplateFilters(){return this.fetcher.countURLTemplateFilters()}clearURLTemplateFilters(){this.fetcher.clearURLTemplateFilters()}getParser(){return this.vastParser}get lastSuccessfulAd(){return this.storage.getItem("vast-client-last-successful-ad")}set lastSuccessfulAd(e){this.storage.setItem("vast-client-last-successful-ad",e)}get totalCalls(){return this.storage.getItem("vast-client-total-calls")}set totalCalls(e){this.storage.setItem("vast-client-total-calls",e)}get totalCallsTimeout(){return this.storage.getItem("vast-client-total-calls-timeout")}set totalCallsTimeout(e){this.storage.setItem("vast-client-total-calls-timeout",e)}hasRemainingAds(){return this.vastParser.remainingAds.length>0}getNextAds(e){return this.vastParser.getRemainingAds(e)}parseVAST(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.fetcher.setOptions(t),this.vastParser.parseVAST(e,t)}get(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=Date.now();return t.hasOwnProperty("resolveAll")||(t.resolveAll=!1),this.totalCallsTimeout<r?(this.totalCalls=1,this.totalCallsTimeout=r+36e5):this.totalCalls++,new Promise((s,n)=>{if(this.cappingFreeLunch>=this.totalCalls)return n(new Error("VAST call canceled – FreeLunch capping not reached yet ".concat(this.totalCalls,"/").concat(this.cappingFreeLunch)));const a=r-this.lastSuccessfulAd;if(a<0)this.lastSuccessfulAd=0;else if(a<this.cappingMinimumTimeInterval)return n(new Error("VAST call canceled – (".concat(this.cappingMinimumTimeInterval,")ms minimum interval reached")));this.vastParser.initParsingStatus(t),this.fetcher.setOptions(t),this.vastParser.rootURL=e,this.fetcher.fetchVAST({url:e,emitter:this.vastParser.emit.bind(this.vastParser),maxWrapperDepth:this.vastParser.maxWrapperDepth}).then(l=>(t.previousUrl=e,t.isRootVAST=!0,t.url=e,this.vastParser.parse(l,t).then(u=>{const f=this.vastParser.buildVASTResponse(u);s(f)}))).catch(l=>n(l))})}};class fT extends Fh{constructor(e,t,r){var s;let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a=arguments.length>4&&arguments[4]!==void 0&&arguments[4];super(),this.ad=t,this.creative=r,this.variation=n,this.muted=a,this.impressed=!1,this.skippable=!1,this.trackingEvents={},this.trackedProgressEvents=[],this.lastPercentage=0,this._alreadyTriggeredQuartiles={},this.emitAlwaysEvents=["creativeView","start","firstQuartile","midpoint","thirdQuartile","complete","resume","pause","rewind","skip","closeLinear","close"];for(const l in this.creative.trackingEvents){const u=this.creative.trackingEvents[l];this.trackingEvents[l]=u.slice(0)}this.viewableImpressionTrackers=((s=this.ad.viewableImpression)===null||s===void 0?void 0:s.reduce((l,u)=>(l.notViewable.push(...u.notViewable),l.viewUndetermined.push(...u.viewUndetermined),l.viewable.push(...u.viewable),l),{notViewable:[],viewUndetermined:[],viewable:[]}))||{},Object.entries(this.viewableImpressionTrackers).forEach(l=>{let[u,f]=l;f.length&&(this.trackingEvents[u]=f)}),function(l){return l.type==="linear"}(this.creative)?this._initLinearTracking():this._initVariationTracking(),e&&this.on("start",()=>{e.lastSuccessfulAd=Date.now()})}_initLinearTracking(){this.linear=!0,this.skipDelay=this.creative.skipDelay,this.setDuration(this.creative.duration),this.clickThroughURLTemplate=this.creative.videoClickThroughURLTemplate,this.clickTrackingURLTemplates=this.creative.videoClickTrackingURLTemplates}_initVariationTracking(){if(this.linear=!1,this.skipDelay=-1,this.variation){for(const e in this.variation.trackingEvents){const 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)}}setDuration(e){De.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)})}setProgress(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(!De.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(De.formatMacrosValues(t))});const s=this.skipDelay||-1;if(s===-1||this.skippable||(s>e?this.emit("skip-countdown",s-e):(this.skippable=!0,this.emit("skip-countdown",0))),this.assetDuration>0){const n=Math.round(e/this.assetDuration*100),a=[];if(e>0){a.push("start");for(let l=this.lastPercentage;l<n;l++)a.push("progress-".concat(l+1,"%"));a.push("progress-".concat(e));for(const l in this.quartiles)this.isQuartileReached(l,this.quartiles[l],e)&&(a.push(l),this._alreadyTriggeredQuartiles[l]=!0);this.lastPercentage=n}a.forEach(l=>{this.track(l,{macros:t,once:r})}),e<this.progress&&(this.track("rewind",{macros:t}),this.trackedProgressEvents&&this.trackedProgressEvents.splice(0))}this.progress=e}isQuartileReached(e,t,r){let s=!1;return t<=r&&!this._alreadyTriggeredQuartiles[e]&&(s=!0),s}setMuted(e){let 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(De.formatMacrosValues(t))})}setPaused(e){let 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(De.formatMacrosValues(t))})}setFullscreen(e){let 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(De.formatMacrosValues(t))})}setExpand(e){let 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(De.formatMacrosValues(t))})}setSkipDelay(e){De.isValidTimeValue(e)?this.skipDelay=e:this.emit("TRACKER-error",{message:"setSkipDelay parameter does not have a valid value. duration: ".concat(e)})}trackImpression(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.impressed||(this.impressed=!0,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)})}trackViewableImpression(){let 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)})}trackNotViewableImpression(){let 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)})}trackUndeterminedImpression(){let 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)})}error(){let 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(De.formatMacrosValues(e),", isCustomCode: ").concat(t)})}errorWithCode(e){let 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)})}complete(){let 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)})}notUsed(){let 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)})}otherAdInteraction(){let 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)})}acceptInvitation(){let 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)})}adExpand(){let 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)})}adCollapse(){let 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)})}minimize(){let 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)})}verificationNotExecuted(e){let 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(De.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");const r=this.ad.adVerifications.find(n=>n.vendor===e);if(!r)throw new Error("No associated verification element found for vendor: ".concat(e));const s=r.trackingEvents;if(s&&s.verificationNotExecuted){const n=s.verificationNotExecuted;this.trackURLs(n,t),this.emit("verificationNotExecuted",{trackingURLTemplates:n})}}overlayViewDuration(e){let 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(De.formatMacrosValues(t))})}close(){let 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)})}skip(){let 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)})}load(){let 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)})}click(){let 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(De.formatMacrosValues(t))});this.clickTrackingURLTemplates&&this.clickTrackingURLTemplates.length&&this.trackURLs(this.clickTrackingURLTemplates,t);const r=this.clickThroughURLTemplate||e,s={...t};if(r){this.progress&&(s.ADPLAYHEAD=this.progressFormatted());const n=De.resolveURLTemplates([r],s)[0];this.emit("clickthrough",n)}}trackProgressEvents(e,t,r){const s=parseFloat(e.split("-")[1]);Object.entries(this.trackingEvents).filter(n=>{let[a]=n;return a.startsWith("progress-")}).map(n=>{let[a,l]=n;return{name:a,time:parseFloat(a.split("-")[1]),urls:l}}).filter(n=>{let{time:a}=n;return a<=s&&a>this.progress}).forEach(n=>{let{name:a,urls:l}=n;!r&&this.trackedProgressEvents.includes(a)||(this.emit(a,{trackingURLTemplates:l}),this.trackURLs(l,t),r?delete this.trackingEvents[a]:this.trackedProgressEvents.push(a))})}track(e){let{macros:t={},once:r=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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,r);const 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),r&&(delete this.trackingEvents[e],n&&this.emitAlwaysEvents.splice(this.emitAlwaysEvents.indexOf(e),1))}trackURLs(e){var t;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{validUrls:n,invalidUrls:a}=De.filterUrlTemplates(e);a.length&&this.emit("TRACKER-error",{message:"Provided urls are malformed. url: ".concat(a)});const l={...r};this.linear&&(this.creative&&this.creative.mediaFiles&&this.creative.mediaFiles[0]&&this.creative.mediaFiles[0].fileURL&&(l.ASSETURI=this.creative.mediaFiles[0].fileURL),this.progress&&(l.ADPLAYHEAD=this.progressFormatted())),(t=this.creative)!==null&&t!==void 0&&(t=t.universalAdIds)!==null&&t!==void 0&&t.length&&(l.UNIVERSALADID=this.creative.universalAdIds.map(u=>u.idRegistry.concat(" ",u.value)).join(",")),this.ad&&(this.ad.sequence&&(l.PODSEQUENCE=this.ad.sequence),this.ad.adType&&(l.ADTYPE=this.ad.adType),this.ad.adServingId&&(l.ADSERVINGID=this.ad.adServingId),this.ad.categories&&this.ad.categories.length&&(l.ADCATEGORIES=this.ad.categories.map(u=>u.value).join(",")),this.ad.blockedAdCategories&&this.ad.blockedAdCategories.length&&(l.BLOCKEDADCATEGORIES=this.ad.blockedAdCategories.map(u=>u.value).join(","))),De.track(n,l,s)}convertToTimecode(e){if(!De.isValidTimeValue(e))return"";const t=1e3*e,r=Math.floor(t/36e5),s=Math.floor(t/6e4%60),n=Math.floor(t/1e3%60),a=Math.floor(t%1e3);return"".concat(De.addLeadingZeros(r,2),":").concat(De.addLeadingZeros(s,2),":").concat(De.addLeadingZeros(n,2),".").concat(De.addLeadingZeros(a,3))}progressFormatted(){return this.convertToTimecode(this.progress)}}var Os;typeof window<"u"?Os=window:typeof ci.commonjsGlobal<"u"?Os=ci.commonjsGlobal:typeof self<"u"?Os=self:Os={};var Da=Os;const k=ci.getDefaultExportFromCjs(Da),pT={},mT=Object.freeze(Object.defineProperty({__proto__:null,default:pT},Symbol.toStringTag,{value:"Module"})),gT=ci.getAugmentedNamespace(mT);var Mc=typeof ci.commonjsGlobal<"u"?ci.commonjsGlobal:typeof window<"u"?window:{},yT=gT,Ns;typeof document<"u"?Ns=document:(Ns=Mc["__GLOBAL_DOCUMENT_CACHE@4"],Ns||(Ns=Mc["__GLOBAL_DOCUMENT_CACHE@4"]=yT));var jh=Ns;const X=ci.getDefaultExportFromCjs(jh);var wl={exports:{}},Vh={exports:{}};(function(i){function e(){return i.exports=e=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var s=arguments[r];for(var n in s)({}).hasOwnProperty.call(s,n)&&(t[n]=s[n])}return t},i.exports.__esModule=!0,i.exports.default=i.exports,e.apply(null,arguments)}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports})(Vh);var _T=Vh.exports,TT=bT,vT=Object.prototype.toString;function bT(i){if(!i)return!1;var e=vT.call(i);return e==="[object Function]"||typeof i=="function"&&e!=="[object RegExp]"||typeof window<"u"&&(i===window.setTimeout||i===window.alert||i===window.confirm||i===window.prompt)}function xT(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t)return(t=t.call(i)).next.bind(t);if(Array.isArray(i)||(t=ST(i))||e){t&&(i=t);var r=0;return function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("react/jsx-runtime"),by=require("./index8.js"),J=require("./sl-types.js"),El=require("./analytics.js"),Se=require("react"),ei=require("./index3.js"),oe=require("./useStreamLayerApp2.js"),Aa=require("./index14.js"),xy=require("./index6.js"),Jn=require("./index13.js"),ci=require("./index15.js"),Cs=require("uuid"),Sy=require("./utils.js"),Jt=require("./hooks-WfHlJH12.js");function Ke(){return Ke=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Ke.apply(null,arguments)}const Ey=J.styled_default("div")({name:"Container",class:"c5b6wdg",propsAsIs:!1}),Cy="a1rlj479",Ay="s35f1di",wy="sj4471g",Dy="b12050d8",Iy="b1d5ybek",ky=i=>i==="left"||i==="right"?Ay:Dy,Py=i=>i==="left"||i==="right"?wy:Iy,Ly=i=>i==="left"?"avdxyl3":i==="right"?"a1bisd08":i==="top"?"a1u9y2aj":"a1qqaks",Cl=({children:i,style:e,className:t,enabled:r=!0,hiding:s,direction:n="left",onAnimationEnd:a})=>G.jsx(Ey,{style:e,className:J.cx_default(t,Cy,Ly(n),r&&!s&&ky(n),r&&s&&Py(n)),onAnimationEnd:a,children:i}),Ry=J.styled_default("a")({name:"Link",class:"l1sgte8c",propsAsIs:!1}),Oy=J.styled_default("div")({name:"BannerContainer",class:"b7yfc72",propsAsIs:!1}),Ny=()=>Ry,By=J.styled_default(Ny())({name:"BannerLink",class:"bejjq94",propsAsIs:!0}),_h=({promotion:i,promotionId:e,hiding:t,isEventFired:r,fireEvent:s,direction:n="bottom"})=>{const a=(i==null?void 0:i.adUnit)===oe.AdUnit.STANDART,l=a?i.banner:i.additionalBanner;if(Se.useEffect(()=>{l!=null&&l.imageUrl&&i.type&&e&&(r!=null&&r("banner-showed")||(ei.eventBus.emit("advertisement",{action:"bannerShown",payload:{id:e,type:i.type}}),s==null||s("banner-showed")))},[l==null?void 0:l.imageUrl,s,r,i.type,e]),!(l!=null&&l.imageUrl))return null;let u=l==null?void 0:l.url;return u&&u.indexOf("http")!==0&&(u=`https://${u}`),G.jsx(Cl,{direction:n,hiding:t,children:G.jsx(Oy,{className:"BannerContainer","data-is-ad":a,children:G.jsx(By,{as:u?"a":"span",className:"BannerLink",href:u,style:{backgroundImage:`url(${l.imageUrl})`,cursor:u?"pointer":"default"},"data-promo-id":e,"data-promo-type":i.type,"data-a":"banner",target:"_blank","data-is-ad":a})})})},My=({cardId:i,promotion:e,direction:t="bottom"})=>G.jsx(_h,{promotion:e,promotionId:i,direction:t,hiding:!1}),Uy=J.styled_default("div")({name:"NotificationContent",class:"n18wsqoo",propsAsIs:!1}),Fy=J.styled_default("div")({name:"Body",class:"b1ia90c2",propsAsIs:!1}),$y=J.styled_default("div")({name:"Title",class:"tg2z08v",propsAsIs:!1}),jy=J.styled_default("div")({name:"Text",class:"t59zdk1",propsAsIs:!1}),Cr=J.styled_default("div")({name:"MediaImgBottom",class:"m1ab9fq",propsAsIs:!1}),Vy=()=>Cr,qy=J.styled_default(Vy())({name:"MediaImgMiddle",class:"m9fsr0y",propsAsIs:!0}),yc=J.styled_default("img")({name:"CtaIcon",class:"cvi9y5q",propsAsIs:!1}),Hy=J.styled_default("div")({name:"Logo",class:"l5mq0z",propsAsIs:!1}),zy=J.styled_default("div")({name:"Footer",class:"f1mse0ft",propsAsIs:!1}),Wy=J.styled_default("div")({name:"Vector",class:"v1hcloah",propsAsIs:!1}),Gy=J.styled_default("div")({name:"NotificationContainer",class:"n3n65jf",propsAsIs:!1}),Th=J.styled_default("button")({name:"TVButton",class:"tkkfuqy",propsAsIs:!1}),Ky=()=>Th,Xy=J.styled_default(Ky())({name:"DismissButton",class:"dh9vato",propsAsIs:!0}),Yy=()=>Th,vh=J.styled_default(Yy())({name:"OpenButton",class:"oeah8gv",propsAsIs:!0}),Qy={[oe.NotificationPromotionImagePosition.UNSET]:Cr,[oe.NotificationPromotionImagePosition.FIT]:Cr,[oe.NotificationPromotionImagePosition.CENTERED]:Cr,[oe.NotificationPromotionImagePosition.SOLID]:Cr,[oe.NotificationPromotionImagePosition.BOTTOM]:Cr,[oe.NotificationPromotionImagePosition.MIDDLE]:qy},Jy=({src:i,imagePosition:e})=>{const t=Qy[e];return G.jsx(t,{children:G.jsx("img",{src:i,alt:""})})},Zy=Aa.O(Xy),e_=Aa.O(vh),t_=({notification:i,open:e,close:t,webos:r})=>{if(!i||!i.promotion||i.enabled!==oe.NotificationEnabled.NOTIFICATION_ENABLED)return null;const{title:s,body:n,image:a,promotion:l}=i,{sponsorLogo:u,sponsorLogoMode:f,imagePosition:p,ctaButton:T}=l;return G.jsxs(Gy,{"data-webos":r,className:"SL_Lower_Third_Notification",onClick:r?void 0:e,children:[G.jsxs(Uy,{children:[G.jsx(Jy,{src:a,imagePosition:p}),G.jsxs(Fy,{children:[s&&G.jsx($y,{children:s}),n&&G.jsx(jy,{children:n})]})]}),G.jsxs(zy,{children:[f!==oe.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&G.jsxs(G.Fragment,{children:[G.jsx(Hy,{children:G.jsx("img",{src:u,alt:s})}),G.jsx(Wy,{})]}),r?G.jsxs(G.Fragment,{children:[G.jsx(Zy,{webos:!0,onClick:t,children:"Dismiss"}),G.jsxs(e_,{webos:!0,autoFocus:!0,style:{color:T==null?void 0:T.textColor,backgroundColor:T==null?void 0:T.color},onClick:e,children:[(T==null?void 0:T.ctaIcon)&&(T==null?void 0:T.ctaIconMode)===oe.CtaIconMode.CTA_ICON_TRANSPARENT&&G.jsx(yc,{src:T==null?void 0:T.ctaIcon,alt:"cta-icon"}),(T==null?void 0:T.label)||"Open"]})]}):G.jsxs(vh,{name:"promo-button",style:{color:T==null?void 0:T.textColor,backgroundColor:T==null?void 0:T.color},children:[(T==null?void 0:T.ctaIcon)&&(T==null?void 0:T.ctaIconMode)===oe.CtaIconMode.CTA_ICON_TRANSPARENT&&G.jsx(yc,{src:T==null?void 0:T.ctaIcon,alt:"cta-icon"}),(T==null?void 0:T.label)||"Open"]})]})]})},i_=J.styled_default("div")({name:"NotificationContent",class:"n1ku6hz",propsAsIs:!1}),r_=J.styled_default("div")({name:"NotificationContainer",class:"nbxqmol",propsAsIs:!1}),s_=J.styled_default("div")({name:"Body",class:"b1gu3eml",propsAsIs:!1}),n_=J.styled_default("div")({name:"Title",class:"t1u17zva",propsAsIs:!1}),a_=J.styled_default("div")({name:"Text",class:"t10ko1g",propsAsIs:!1}),wa=J.styled_default("div")({name:"Media",class:"mntc42e",propsAsIs:!1}),o_=()=>wa,_c=J.styled_default(o_())({name:"MediaImgFit",class:"ml060eo",propsAsIs:!0}),l_=()=>wa,bh=J.styled_default(l_())({name:"MediaImgCentered",class:"m1vqlvig",propsAsIs:!0}),u_=()=>bh,c_=J.styled_default(u_())({name:"MediaImgBottom",class:"m1e7tvi5",propsAsIs:!0}),d_=()=>wa,h_=J.styled_default(d_())({name:"MediaImgSolid",class:"mqvntt2",propsAsIs:!0}),f_=()=>wa,p_=J.styled_default(f_())({name:"MediaImgMiddle",class:"m12jtj3u",propsAsIs:!0}),m_=J.styled_default("img")({name:"CtaIcon",class:"ckq1frv",propsAsIs:!1}),g_=()=>xy.B1,y_=J.styled_default(g_())({name:"StyledChevronRight",class:"s9mjmz3",propsAsIs:!0}),__=J.styled_default("div")({name:"Logo",class:"l1cf50a7",propsAsIs:!1}),xh=J.styled_default("button")({name:"TVButton",class:"thdqfl0",propsAsIs:!1}),T_=()=>xh,v_=J.styled_default(T_())({name:"DismissButton",class:"d11pe8bx",propsAsIs:!0}),b_=()=>xh,x_=J.styled_default(b_())({name:"OpenButton",class:"oy9k0kp",propsAsIs:!0}),S_={[oe.NotificationPromotionImagePosition.UNSET]:_c,[oe.NotificationPromotionImagePosition.FIT]:_c,[oe.NotificationPromotionImagePosition.CENTERED]:bh,[oe.NotificationPromotionImagePosition.BOTTOM]:c_,[oe.NotificationPromotionImagePosition.SOLID]:h_,[oe.NotificationPromotionImagePosition.MIDDLE]:p_},E_=({src:i,imagePosition:e})=>{const t=S_[e];return G.jsx(t,{children:G.jsx("img",{src:i,alt:""})})},C_=Aa.O(v_),A_=Aa.O(x_),w_=({notification:i,open:e,promotionId:t,hiding:r,direction:s="left",close:n,webos:a})=>{if(!i||!i.promotion||i.enabled!==oe.NotificationEnabled.NOTIFICATION_ENABLED)return null;if(i.promotion.mode===oe.NotificationPromotionMode.LOWER_THIRD)return G.jsx(t_,{notification:i,open:e,close:n,webos:a});const{title:l,body:u,image:f,promotion:p}=i,{sponsorLogo:T,sponsorLogoMode:b,imagePosition:S,ctaButton:A}=p,v=L=>{L.stopPropagation(),n==null||n()};return G.jsx(Cl,{className:"SL_Rich_Notification",direction:s,hiding:r,children:G.jsxs(r_,{onClick:a?()=>{}:e,children:[b!==oe.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&T&&G.jsx(__,{children:G.jsx("img",{src:T,alt:l})}),G.jsxs(i_,{children:[G.jsx(E_,{src:f,imagePosition:S}),G.jsxs(s_,{children:[l&&G.jsx(n_,{children:l}),u&&G.jsx(a_,{children:u})]}),a&&G.jsx(C_,{webos:!0,onClick:v,children:"Dismiss"}),G.jsxs(A_,{webos:a,autoFocus:a,onClick:a?e:()=>{},name:"promo-button",style:{color:A==null?void 0:A.textColor,backgroundColor:A==null?void 0:A.color},children:[(A==null?void 0:A.ctaIcon)&&(A==null?void 0:A.ctaIconMode)===oe.CtaIconMode.CTA_ICON_TRANSPARENT&&G.jsx(m_,{src:A==null?void 0:A.ctaIcon,alt:"cta-icon"}),(A==null?void 0:A.label)||"Open"]}),G.jsx(y_,{name:"chevronRight"})]})]})})},D_=J.styled_default("div")({name:"OverlayContainer",class:"okzhq2w",propsAsIs:!1}),Sh=J.styled_default("div")({name:"PromoOverlay",class:"pmgz5i",propsAsIs:!1}),Eh=J.styled_default("div")({name:"Header",class:"hyxi3jt",propsAsIs:!1}),Ch=J.styled_default("div")({name:"HeaderContent",class:"h149e3gp",propsAsIs:!1}),Ah="h10toh7",Tc=J.styled_default("img")({name:"SponsorLogo",class:"s1jyea6t",propsAsIs:!1}),I_=J.styled_default("div")({name:"SponsorName",class:"szpfa3h",propsAsIs:!1}),wh=J.styled_default("div")({name:"Media",class:"m1crmu01",propsAsIs:!1}),k_=J.styled_default("img")({name:"PromoImg",class:"p1l37r8s",propsAsIs:!1}),P_="s1nmch9k",vc=J.styled_default("div")({name:"Content",class:"c1er0ljd",propsAsIs:!1}),L_=J.styled_default("div")({name:"Description",class:"dydopmr",propsAsIs:!1}),R_=J.styled_default("div")({name:"Sponsor",class:"s1w6nt04",propsAsIs:!1}),O_=J.styled_default("div")({name:"SponsorText",class:"s1evcmtq",propsAsIs:!1}),Dh=J.styled_default("div")({name:"ADLogo",class:"awodx0x",propsAsIs:!1}),N_=J.styled_default("span")({name:"SponsoredText",class:"s1q3n6oi",propsAsIs:!1}),Ih=J.styled_default("div")({name:"ActionBtnWrap",class:"a8d4xfk",propsAsIs:!1}),kh=J.styled_default("a")({name:"ActionButton",class:"at6oobh",propsAsIs:!1}),B_=J.styled_default("div")({name:"Title",class:"t1gyg7tt",propsAsIs:!1}),M_="h17rwbtk",U_=J.styled_default("div")({name:"Container",class:"c10m2bce",propsAsIs:!1}),bc=J.styled_default("div")({name:"Item",class:"ig23yq5",propsAsIs:!1}),F_=J.styled_default("div")({name:"Dot",class:"d1f6aqua",propsAsIs:!1}),$_=({time:i,adCount:e,adPosition:t})=>{const r=Math.floor(i/60),s=i-r*60;return r===0&&s===0&&e===t?null:G.jsxs(U_,{children:[e>1&&G.jsxs(G.Fragment,{children:[G.jsxs(bc,{children:[t," of ",e]}),G.jsx(F_,{})]}),G.jsxs(bc,{children:[r,":",s<10?`0${s}`:s]})]})},j_=J.styled_default("a")({name:"WhyThisAdLink",class:"w13o8uld",propsAsIs:!1}),V_=({whyThisAd:i})=>{const[e,t]=Se.useState(!1);return!i.iconClickThroughURLTemplate||!i.staticResource?null:G.jsxs(j_,{style:{width:i.width,height:i.height,[i.xPosition]:3,[i.yPosition]:11},href:i.iconClickThroughURLTemplate,target:"_blank",rel:"noreferrer",children:[!e&&G.jsx("img",{alt:"ad choice",src:i.staticResource,onLoad:()=>t(!1),onError:()=>t(!0)}),e&&G.jsx("span",{children:"ad choice"})]})},q_=J.styled_default("div")({name:"VideoControls",class:"v1xzooj9",propsAsIs:!1}),Ph=J.styled_default("button")({name:"ControlBtn",class:"c1bo41vr",propsAsIs:!1}),H_=()=>Ph,z_=J.styled_default(H_())({name:"MuteIcon",class:"m13efyu8",propsAsIs:!0}),W_=()=>Ph,G_=J.styled_default(W_())({name:"PauseIcon",class:"pladkgh",propsAsIs:!0}),K_=J.styled_default("div")({name:"Container",class:"cjnga56",propsAsIs:!1}),X_=J.styled_default("div")({name:"ControlsContainer",class:"c7qs1am",propsAsIs:!1}),xc="m12n261r",Sc="m16vcml8",Ec="m1078nk6";function Al(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{id:i.id||null,adId:i.adId||null,sequence:i.sequence||null,apiFramework:i.apiFramework||null,universalAdIds:[],creativeExtensions:[]}}const Y_=["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 Cc(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=[],s=Rh(i);!e.ERRORCODE||t.isCustomCode||/^[0-9]{3}$/.test(e.ERRORCODE)||(e.ERRORCODE=900),e.CACHEBUSTING=Bh(Math.round(1e8*Math.random())),e.TIMESTAMP=new Date().toISOString(),e.RANDOM=e.random=e.CACHEBUSTING;for(const n in e)e[n]=Nh(e[n]);for(const n in s){const a=s[n];typeof a=="string"&&r.push(Lh(a,e))}return r}function Lh(i,e){const t=(i=Ac(i,e)).match(/[^[\]]+(?=])/g);if(!t)return i;let r=t.filter(s=>Y_.indexOf(s)>-1);return r.length===0?i:(r=r.reduce((s,n)=>(s[n]=-1,s),{}),Ac(i,r))}function Ac(i,e){let t=i;for(const r in e){const s=e[r];t=t.replace(new RegExp("(?:\\[|%%)(".concat(r,")(?:\\]|%%)"),"g"),s)}return t}function Rh(i){return Array.isArray(i)?i.map(e=>e&&e.hasOwnProperty("url")?e.url:e):i}function wc(i){return/^(https?:\/\/|\/\/)/.test(i)}function Dc(i,e){for(let t=0;t<e.length;t++)if(Oh(e[t],i))return!0;return!1}function Oh(i,e){if(i&&e){const t=Object.getOwnPropertyNames(i),r=Object.getOwnPropertyNames(e);return t.length===r.length&&i.id===e.id&&i.url===e.url}return!1}function Nh(i){return encodeURIComponent(i).replace(/[!'()*]/g,e=>"%".concat(e.charCodeAt(0).toString(16)))}function Bh(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8;return i.toString().padStart(e,"0")}const De={track:function(i,e,t){Cc(i,e,t).forEach(r=>{typeof window<"u"&&window!==null&&(new Image().src=r)})},resolveURLTemplates:Cc,extractURLsFromTemplates:Rh,filterUrlTemplates:function(i){return i.reduce((e,t)=>{const r=t.url||t;return wc(r)?e.validUrls.push(r):e.invalidUrls.push(r),e},{validUrls:[],invalidUrls:[]})},containsTemplateObject:Dc,isTemplateObjectEqual:Oh,encodeURIComponentRFC3986:Nh,replaceUrlMacros:Lh,isNumeric:function(i){return!isNaN(parseFloat(i))&&isFinite(i)},flatten:function i(e){return e.reduce((t,r)=>t.concat(Array.isArray(r)?i(r):r),[])},joinArrayOfUniqueTemplateObjs:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const t=Array.isArray(i)?i:[],r=Array.isArray(e)?e:[];return t.concat(r).reduce((s,n)=>(Dc(n,s)||s.push(n),s),[])},isValidTimeValue:function(i){return Number.isFinite(i)&&i>=-2},addLeadingZeros:Bh,isValidUrl:wc,isBrowserEnvironment:function(){return typeof window<"u"},formatMacrosValues:function(i){return typeof i!="object"?i:JSON.stringify(i)}};function Ic(i){return["true","TRUE","True","1"].includes(i)}function Q_(i){if(i==null)return-1;if(De.isNumeric(i))return parseInt(i);const e=i.split(":");if(e.length!==3)return-1;const t=e[2].split(".");let r=parseInt(t[0]);t.length===2&&(r+=parseFloat("0.".concat(t[1])));const s=parseInt(60*e[1]),n=parseInt(60*e[0]*60);return isNaN(n)||isNaN(s)||isNaN(r)||s>3600||r>60?-1:n+s+r}const j={childByName:function(i,e){return Array.from(i.childNodes).find(t=>t.nodeName===e)},childrenByName:function(i,e){return Array.from(i.childNodes).filter(t=>t.nodeName===e)},resolveVastAdTagURI:function(i,e){if(!e)return i;if(i.startsWith("//")){const{protocol:t}=location;return"".concat(t).concat(i)}if(!i.includes("://")){const t=e.slice(0,e.lastIndexOf("/"));return"".concat(t,"/").concat(i)}return i},parseBoolean:Ic,parseNodeText:function(i){return i&&(i.textContent||i.text||"").trim()},copyNodeAttribute:function(i,e,t){const r=e.getAttribute(i);r&&t.setAttribute(i,r)},parseAttributes:function(i){return Array.from(i.attributes).reduce((e,t)=>(e[t.nodeName]=t.nodeValue,e),{})},parseDuration:Q_,getStandAloneAds:function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).filter(i=>!parseInt(i.sequence,10))},getSortedAdPods:function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).filter(i=>parseInt(i.sequence,10)).sort((i,e)=>i.sequence-e.sequence)},assignAttributes:function(i,e){i&&Array.from(i).forEach(t=>{let{nodeName:r,nodeValue:s}=t;if(r&&s&&e.hasOwnProperty(r)){let n=s;typeof e[r]=="boolean"&&(n=Ic(n)),e[r]=n}})},mergeWrapperAdData:function(i,e){var t;i.errorURLTemplates=e.errorURLTemplates.concat(i.errorURLTemplates),i.impressionURLTemplates=e.impressionURLTemplates.concat(i.impressionURLTemplates),i.extensions=e.extensions.concat(i.extensions),e.viewableImpression.length>0&&(i.viewableImpression=[...i.viewableImpression,...e.viewableImpression]),i.followAdditionalWrappers=e.followAdditionalWrappers,i.allowMultipleAds=e.allowMultipleAds,i.fallbackOnNoAd=e.fallbackOnNoAd;const r=(e.creatives||[]).filter(l=>l&&l.type==="companion"),s=r.reduce((l,u)=>((u.variations||[]).forEach(f=>{(f.companionClickTrackingURLTemplates||[]).forEach(p=>{De.containsTemplateObject(p,l)||l.push(p)})}),l),[]);i.creatives=r.concat(i.creatives);const n=e.videoClickTrackingURLTemplates&&e.videoClickTrackingURLTemplates.length,a=e.videoCustomClickURLTemplates&&e.videoCustomClickURLTemplates.length;if(i.creatives.forEach(l=>{if(e.trackingEvents&&e.trackingEvents[l.type])for(const u in e.trackingEvents[l.type]){const f=e.trackingEvents[l.type][u];Array.isArray(l.trackingEvents[u])||(l.trackingEvents[u]=[]),l.trackingEvents[u]=l.trackingEvents[u].concat(f)}l.type==="linear"&&(n&&(l.videoClickTrackingURLTemplates=l.videoClickTrackingURLTemplates.concat(e.videoClickTrackingURLTemplates)),a&&(l.videoCustomClickURLTemplates=l.videoCustomClickURLTemplates.concat(e.videoCustomClickURLTemplates)),!e.videoClickThroughURLTemplate||l.videoClickThroughURLTemplate!==null&&l.videoClickThroughURLTemplate!==void 0||(l.videoClickThroughURLTemplate=e.videoClickThroughURLTemplate)),l.type==="companion"&&s.length&&(l.variations||[]).forEach(u=>{u.companionClickTrackingURLTemplates=De.joinArrayOfUniqueTemplateObjs(u.companionClickTrackingURLTemplates,s)})}),e.adVerifications&&(i.adVerifications=i.adVerifications.concat(e.adVerifications)),e.blockedAdCategories&&(i.blockedAdCategories=i.blockedAdCategories.concat(e.blockedAdCategories)),(t=e.creatives)!==null&&t!==void 0&&t.length){const l=e.creatives.filter(u=>{var f;return((f=u.icons)===null||f===void 0?void 0:f.length)&&!u.mediaFiles.length});l.length&&(i.creatives=i.creatives.concat(l))}}};function J_(i,e){const t=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{id:s,adId:n,sequence:a,apiFramework:l}=Al(r);return{id:s,adId:n,sequence:a,apiFramework:l,type:"companion",required:null,variations:[]}}(e);return t.required=i.getAttribute("required")||null,t.variations=j.childrenByName(i,"Companion").map(r=>{const s=function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{id:l.id||null,adType:"companionAd",width:l.width||0,height:l.height||0,assetWidth:l.assetWidth||null,assetHeight:l.assetHeight||null,expandedWidth:l.expandedWidth||null,expandedHeight:l.expandedHeight||null,apiFramework:l.apiFramework||null,adSlotId:l.adSlotId||null,pxratio:l.pxratio||"1",renderingMode:l.renderingMode||"default",staticResources:[],htmlResources:[],iframeResources:[],adParameters:null,altText:null,companionClickThroughURLTemplate:null,companionClickTrackingURLTemplates:[],trackingEvents:{}}}(j.parseAttributes(r));s.htmlResources=j.childrenByName(r,"HTMLResource").reduce((l,u)=>{const f=j.parseNodeText(u);return f?l.concat(f):l},[]),s.iframeResources=j.childrenByName(r,"IFrameResource").reduce((l,u)=>{const f=j.parseNodeText(u);return f?l.concat(f):l},[]),s.staticResources=j.childrenByName(r,"StaticResource").reduce((l,u)=>{const f=j.parseNodeText(u);return f?l.concat({url:f,creativeType:u.getAttribute("creativeType")||null}):l},[]),s.altText=j.parseNodeText(j.childByName(r,"AltText"))||null;const n=j.childByName(r,"TrackingEvents");n&&j.childrenByName(n,"Tracking").forEach(l=>{const u=l.getAttribute("event"),f=j.parseNodeText(l);u&&f&&(Array.isArray(s.trackingEvents[u])||(s.trackingEvents[u]=[]),s.trackingEvents[u].push(f))}),s.companionClickTrackingURLTemplates=j.childrenByName(r,"CompanionClickTracking").map(l=>({id:l.getAttribute("id")||null,url:j.parseNodeText(l)})),s.companionClickThroughURLTemplate=j.parseNodeText(j.childByName(r,"CompanionClickThrough"))||null;const a=j.childByName(r,"AdParameters");return a&&(s.adParameters={value:j.parseNodeText(a),xmlEncoded:a.getAttribute("xmlEncoded")||null}),s}),t}function Z_(i,e){let t;const r=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{id:f,adId:p,sequence:T,apiFramework:b}=Al(u);return{id:f,adId:p,sequence:T,apiFramework:b,type:"linear",duration:0,skipDelay:null,mediaFiles:[],mezzanine:null,interactiveCreativeFile:null,closedCaptionFiles:[],videoClickThroughURLTemplate:null,videoClickTrackingURLTemplates:[],videoCustomClickURLTemplates:[],adParameters:null,icons:[],trackingEvents:{}}}(e);r.duration=j.parseDuration(j.parseNodeText(j.childByName(i,"Duration")));const s=i.getAttribute("skipoffset");if(s==null)r.skipDelay=null;else if(s.charAt(s.length-1)==="%"&&r.duration!==-1){const u=parseInt(s,10);r.skipDelay=r.duration*(u/100)}else r.skipDelay=j.parseDuration(s);const n=j.childByName(i,"VideoClicks");if(n){const u=j.childByName(n,"ClickThrough");r.videoClickThroughURLTemplate=u?{id:u.getAttribute("id")||null,url:j.parseNodeText(u)}:null,j.childrenByName(n,"ClickTracking").forEach(f=>{r.videoClickTrackingURLTemplates.push({id:f.getAttribute("id")||null,url:j.parseNodeText(f)})}),j.childrenByName(n,"CustomClick").forEach(f=>{r.videoCustomClickURLTemplates.push({id:f.getAttribute("id")||null,url:j.parseNodeText(f)})})}const a=j.childByName(i,"AdParameters");a&&(r.adParameters={value:j.parseNodeText(a),xmlEncoded:a.getAttribute("xmlEncoded")||null}),j.childrenByName(i,"TrackingEvents").forEach(u=>{j.childrenByName(u,"Tracking").forEach(f=>{let p=f.getAttribute("event");const T=j.parseNodeText(f);if(p&&T){if(p==="progress"){if(t=f.getAttribute("offset"),!t)return;p=t.charAt(t.length-1)==="%"?"progress-".concat(t):"progress-".concat(j.parseDuration(t))}Array.isArray(r.trackingEvents[p])||(r.trackingEvents[p]=[]),r.trackingEvents[p].push(T)}})}),j.childrenByName(i,"MediaFiles").forEach(u=>{j.childrenByName(u,"MediaFile").forEach(S=>{r.mediaFiles.push(function(A){const v={id:null,fileURL:null,fileSize:0,deliveryType:"progressive",mimeType:null,mediaType:null,codec:null,bitrate:0,minBitrate:0,maxBitrate:0,width:0,height:0,apiFramework:null,scalable:null,maintainAspectRatio:null};v.id=A.getAttribute("id"),v.fileURL=j.parseNodeText(A),v.deliveryType=A.getAttribute("delivery"),v.codec=A.getAttribute("codec"),v.mimeType=A.getAttribute("type"),v.mediaType=A.getAttribute("mediaType")||"2D",v.apiFramework=A.getAttribute("apiFramework"),v.fileSize=parseInt(A.getAttribute("fileSize")||0),v.bitrate=parseInt(A.getAttribute("bitrate")||0),v.minBitrate=parseInt(A.getAttribute("minBitrate")||0),v.maxBitrate=parseInt(A.getAttribute("maxBitrate")||0),v.width=parseInt(A.getAttribute("width")||0),v.height=parseInt(A.getAttribute("height")||0);const L=A.getAttribute("scalable");L&&typeof L=="string"&&(v.scalable=j.parseBoolean(L));const P=A.getAttribute("maintainAspectRatio");return P&&typeof P=="string"&&(v.maintainAspectRatio=j.parseBoolean(P)),v}(S))});const f=j.childByName(u,"InteractiveCreativeFile");f&&(r.interactiveCreativeFile=function(S){const A=function(){let 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(S));return A.fileURL=j.parseNodeText(S),A}(f));const p=j.childByName(u,"ClosedCaptionFiles");p&&j.childrenByName(p,"ClosedCaptionFile").forEach(S=>{const A=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{type:v.type||null,language:v.language||null,fileURL:null}}(j.parseAttributes(S));A.fileURL=j.parseNodeText(S),r.closedCaptionFiles.push(A)});const T=j.childByName(u,"Mezzanine"),b=function(S,A){const v={};let L=!1;return A.forEach(P=>{S&&S.getAttribute(P)?v[P]=S.getAttribute(P):L=!0}),L?null:v}(T,["delivery","type","width","height"]);if(b){const S={id:null,fileURL:null,delivery:null,codec:null,type:null,width:0,height:0,fileSize:0,mediaType:"2D"};S.id=T.getAttribute("id"),S.fileURL=j.parseNodeText(T),S.delivery=b.delivery,S.codec=T.getAttribute("codec"),S.type=b.type,S.width=parseInt(b.width,10),S.height=parseInt(b.height,10),S.fileSize=parseInt(T.getAttribute("fileSize"),10),S.mediaType=T.getAttribute("mediaType")||"2D",r.mezzanine=S}});const l=j.childByName(i,"Icons");return l&&j.childrenByName(l,"Icon").forEach(u=>{r.icons.push(function(f){const 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=f.getAttribute("program"),p.height=parseInt(f.getAttribute("height")||0),p.width=parseInt(f.getAttribute("width")||0),p.xPosition=function(b){return["left","right"].indexOf(b)!==-1?b:parseInt(b||0)}(f.getAttribute("xPosition")),p.yPosition=function(b){return["top","bottom"].indexOf(b)!==-1?b:parseInt(b||0)}(f.getAttribute("yPosition")),p.apiFramework=f.getAttribute("apiFramework"),p.pxratio=f.getAttribute("pxratio")||"1",p.offset=j.parseDuration(f.getAttribute("offset")),p.duration=j.parseDuration(f.getAttribute("duration")),p.altText=f.getAttribute("altText"),p.hoverText=f.getAttribute("hoverText"),j.childrenByName(f,"HTMLResource").forEach(b=>{p.type=b.getAttribute("creativeType")||"text/html",p.htmlResource=j.parseNodeText(b)}),j.childrenByName(f,"IFrameResource").forEach(b=>{p.type=b.getAttribute("creativeType")||0,p.iframeResource=j.parseNodeText(b)}),j.childrenByName(f,"StaticResource").forEach(b=>{p.type=b.getAttribute("creativeType")||0,p.staticResource=j.parseNodeText(b)});const T=j.childByName(f,"IconClicks");if(T){p.iconClickThroughURLTemplate=j.parseNodeText(j.childByName(T,"IconClickThrough")),j.childrenByName(T,"IconClickTracking").forEach(S=>{p.iconClickTrackingURLTemplates.push({id:S.getAttribute("id")||null,url:j.parseNodeText(S)})});const b=j.childByName(T,"IconClickFallbackImages");b&&j.childrenByName(b,"IconClickFallbackImage").forEach(S=>{p.iconClickFallbackImages.push({url:j.parseNodeText(S)||null,width:S.getAttribute("width")||null,height:S.getAttribute("height")||null})})}return p.iconViewTrackingURLTemplate=j.parseNodeText(j.childByName(f,"IconViewTracking")),p}(u))}),r}function eT(i,e){const t=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{id:s,adId:n,sequence:a,apiFramework:l}=Al(r);return{id:s,adId:n,sequence:a,apiFramework:l,type:"nonlinear",variations:[],trackingEvents:{}}}(e);return j.childrenByName(i,"TrackingEvents").forEach(r=>{let s,n;j.childrenByName(r,"Tracking").forEach(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(i,"NonLinear").forEach(r=>{const s={id:null,width:0,height:0,expandedWidth:0,expandedHeight:0,scalable:!0,maintainAspectRatio:!0,minSuggestedDuration:0,apiFramework:"static",adType:"nonLinearAd",type:null,staticResource:null,htmlResource:null,iframeResource:null,nonlinearClickThroughURLTemplate:null,nonlinearClickTrackingURLTemplates:[],adParameters:null};s.id=r.getAttribute("id")||null,s.width=r.getAttribute("width"),s.height=r.getAttribute("height"),s.expandedWidth=r.getAttribute("expandedWidth"),s.expandedHeight=r.getAttribute("expandedHeight"),s.scalable=j.parseBoolean(r.getAttribute("scalable")),s.maintainAspectRatio=j.parseBoolean(r.getAttribute("maintainAspectRatio")),s.minSuggestedDuration=j.parseDuration(r.getAttribute("minSuggestedDuration")),s.apiFramework=r.getAttribute("apiFramework"),j.childrenByName(r,"HTMLResource").forEach(a=>{s.type=a.getAttribute("creativeType")||"text/html",s.htmlResource=j.parseNodeText(a)}),j.childrenByName(r,"IFrameResource").forEach(a=>{s.type=a.getAttribute("creativeType")||0,s.iframeResource=j.parseNodeText(a)}),j.childrenByName(r,"StaticResource").forEach(a=>{s.type=a.getAttribute("creativeType")||0,s.staticResource=j.parseNodeText(a)});const n=j.childByName(r,"AdParameters");n&&(s.adParameters={value:j.parseNodeText(n),xmlEncoded:n.getAttribute("xmlEncoded")||null}),s.nonlinearClickThroughURLTemplate=j.parseNodeText(j.childByName(r,"NonLinearClickThrough")),j.childrenByName(r,"NonLinearClickTracking").forEach(a=>{s.nonlinearClickTrackingURLTemplates.push({id:a.getAttribute("id")||null,url:j.parseNodeText(a)})}),t.variations.push(s)}),t}function kc(i){const e=[];return i.forEach(t=>{const r=Mh(t);r&&e.push(r)}),e}function Mh(i){if(i.nodeName==="#comment")return null;const e={name:null,value:null,attributes:{},children:[]},t=i.attributes,r=i.childNodes;if(e.name=i.nodeName,i.attributes){for(const n in t)if(t.hasOwnProperty(n)){const a=t[n];a.nodeName&&a.nodeValue&&(e.attributes[a.nodeName]=a.nodeValue)}}for(const n in r)if(r.hasOwnProperty(n)){const a=Mh(r[n]);a&&e.children.push(a)}if(e.children.length===0||e.children.length===1&&["#cdata-section","#text"].indexOf(e.children[0].name)>=0){const n=j.parseNodeText(i);n!==""&&(e.value=n),e.children=[]}return(s=e).value===null&&Object.keys(s.attributes).length===0&&s.children.length===0?null:e;var s}function tT(i){return i.getAttribute("AdID")||i.getAttribute("adID")||i.getAttribute("adId")||null}const Kn={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 Pc(i,e){if(!Kn[i.nodeName]||!Kn[i.nodeName].attributes)return;const t=Kn[i.nodeName].attributes.filter(r=>!i.getAttribute(r));t.length>0&&Gs({name:i.nodeName,parentName:i.parentNode.nodeName,attributes:t},e)}function Lc(i,e,t){const r=Kn[i.nodeName],s=!t&&i.nodeName!=="Wrapper";if(!(!r||s)){if(r.subElements){const n=r.subElements.filter(a=>!j.childByName(i,a));n.length>0&&Gs({name:i.nodeName,parentName:i.parentNode.nodeName,subElements:n},e)}!t||!r.oneOfinLineResources||r.oneOfinLineResources.some(n=>j.childByName(i,n))||Gs({name:i.nodeName,parentName:i.parentNode.nodeName,oneOfResources:r.oneOfinLineResources},e)}}function Rc(i){return i.children&&i.children.length!==0}function Gs(i,e){let{name:t,parentName:r,attributes:s,subElements:n,oneOfResources:a}=i,l="Element '".concat(t,"'");l+=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:l,parentElement:r,specVersion:4.1})}const iT={verifyRequiredValues:function i(e,t,r){if(e&&e.nodeName)if(e.nodeName==="InLine"&&(r=!0),Pc(e,t),Rc(e)){Lc(e,t,r);for(let s=0;s<e.children.length;s++)i(e.children[s],t,r)}else j.parseNodeText(e).length===0&&Gs({name:e.nodeName,parentName:e.parentNode.nodeName},t)},hasSubElements:Rc,emitMissingValueWarning:Gs,verifyRequiredAttributes:Pc,verifyRequiredSubElements:Lc};function rT(i,e){let{allowMultipleAds:t,followAdditionalWrappers:r}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=Array.from(i.childNodes).filter(n=>{const a=n.nodeName.toLowerCase();return a==="inline"||r!==!1&&a==="wrapper"});for(const n of s){if(j.copyNodeAttribute("id",i,n),j.copyNodeAttribute("sequence",i,n),j.copyNodeAttribute("adType",i,n),n.nodeName==="Wrapper")return{ad:nT(n,e),type:"WRAPPER"};if(n.nodeName==="InLine")return{ad:sT(n,e,{allowMultipleAds:t}),type:"INLINE"};const a=n.nodeName.toLowerCase();e("VAST-warning",{message:"<".concat(n.nodeName,a==="inline"?"> must be written <InLine>":"> must be written <Wrapper>"),wrongNode:n})}}function sT(i,e){let{allowMultipleAds:t}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t===!1&&i.getAttribute("sequence")?null:Uh(i,e)}function Uh(i,e){let t=[];e&&iT.verifyRequiredValues(i,e);const r=Array.from(i.childNodes),s=function(){let 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:!0,allowMultipleAds:!1,fallbackOnNoAd:null}}(j.parseAttributes(i));return r.forEach(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){const l=[];return a.forEach(u=>{const f={id:u.getAttribute("id")||null,adId:tT(u),sequence:u.getAttribute("sequence")||null,apiFramework:u.getAttribute("apiFramework")||null},p=[];let T;j.childrenByName(u,"UniversalAdId").forEach(S=>{const A={idRegistry:S.getAttribute("idRegistry")||"unknown",value:j.parseNodeText(S)};p.push(A)});const b=j.childByName(u,"CreativeExtensions");b&&(T=kc(j.childrenByName(b,"CreativeExtension")));for(const S in u.childNodes){const A=u.childNodes[S];let v;switch(A.nodeName){case"Linear":v=Z_(A,f);break;case"NonLinearAds":v=eT(A,f);break;case"CompanionAds":v=J_(A,f)}v&&(p&&(v.universalAdIds=p),T&&(v.creativeExtensions=T),l.push(v))}}),l}(j.childrenByName(n,"Creative"));break;case"Extensions":{const a=j.childrenByName(n,"Extension");s.extensions=kc(a),s.adVerifications.length||(t=function(l){let u=null,f=[];return l.some(p=>u=j.childByName(p,"AdVerifications")),u&&(f=Oc(j.childrenByName(u,"Verification"))),f}(a));break}case"AdVerifications":s.adVerifications=Oc(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){const l=(u,f)=>{const p=j.parseNodeText(f);return p&&u.push(p),u};return{id:a.getAttribute("id")||null,viewable:j.childrenByName(a,"Viewable").reduce(l,[]),notViewable:j.childrenByName(a,"NotViewable").reduce(l,[]),viewUndetermined:j.childrenByName(a,"ViewUndetermined").reduce(l,[])}}(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 nT(i,e){const t=Uh(i,e),r=i.getAttribute("followAdditionalWrappers"),s=i.getAttribute("allowMultipleAds"),n=i.getAttribute("fallbackOnNoAd");t.followAdditionalWrappers=!r||j.parseBoolean(r),t.allowMultipleAds=!!s&&j.parseBoolean(s),t.fallbackOnNoAd=n?j.parseBoolean(n):null;let a=j.childByName(i,"VASTAdTagURI");if(a?t.nextWrapperURL=j.parseNodeText(a):(a=j.childByName(i,"VASTAdTagURL"),a&&(t.nextWrapperURL=j.parseNodeText(j.childByName(a,"URL")))),t.creatives.forEach(l=>{if(["linear","nonlinear"].includes(l.type)){if(l.trackingEvents){t.trackingEvents||(t.trackingEvents={}),t.trackingEvents[l.type]||(t.trackingEvents[l.type]={});for(const u in l.trackingEvents){const f=l.trackingEvents[u];Array.isArray(t.trackingEvents[l.type][u])||(t.trackingEvents[l.type][u]=[]),f.forEach(p=>{t.trackingEvents[l.type][u].push(p)})}}l.videoClickTrackingURLTemplates&&(Array.isArray(t.videoClickTrackingURLTemplates)||(t.videoClickTrackingURLTemplates=[]),l.videoClickTrackingURLTemplates.forEach(u=>{t.videoClickTrackingURLTemplates.push(u)})),l.videoClickThroughURLTemplate&&(t.videoClickThroughURLTemplate=l.videoClickThroughURLTemplate),l.videoCustomClickURLTemplates&&(Array.isArray(t.videoCustomClickURLTemplates)||(t.videoCustomClickURLTemplates=[]),l.videoCustomClickURLTemplates.forEach(u=>{t.videoCustomClickURLTemplates.push(u)}))}}),t.nextWrapperURL)return t}function Oc(i){const e=[];return i.forEach(t=>{const r={resource:null,vendor:null,browserOptional:!1,apiFramework:null,type:null,parameters:null,trackingEvents:{}},s=Array.from(t.childNodes);j.assignAttributes(t.attributes,r),s.forEach(a=>{let{nodeName:l,textContent:u,attributes:f}=a;switch(l){case"JavaScriptResource":case"ExecutableResource":r.resource=u.trim(),j.assignAttributes(f,r);break;case"VerificationParameters":r.parameters=u.trim()}});const n=j.childByName(t,"TrackingEvents");n&&j.childrenByName(n,"Tracking").forEach(a=>{const l=a.getAttribute("event"),u=j.parseNodeText(a);l&&u&&(Array.isArray(r.trackingEvents[l])||(r.trackingEvents[l]=[]),r.trackingEvents[l].push(u))}),e.push(r)}),e}class Fh{constructor(){this._handlers=[]}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}once(e,t){return this.on(e,function(r,s,n){const a={fired:!1,wrapFn:void 0};function l(){a.fired||(r.off(s,a.wrapFn),a.fired=!0,n.bind(r)(...arguments))}return a.wrapFn=l,l}(this,e,t))}off(e,t){return this._handlers=this._handlers.filter(r=>r.event!==e||r.handler!==t),this}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];let n=!1;return this._handlers.forEach(a=>{a.event==="*"&&(n=!0,a.handler(e,...r)),a.event===e&&(n=!0,a.handler(...r))}),n}removeAllListeners(e){return e?(this._handlers=this._handlers.filter(t=>t.event!==e),this):(this._handlers=[],this)}listenerCount(e){return this._handlers.filter(t=>t.event===e).length}listeners(e){return this._handlers.reduce((t,r)=>(r.event===e&&t.push(r.handler),t),[])}eventNames(){return this._handlers.map(e=>e.event)}}let Nc=0,Go=0;const $h=(i,e)=>{!i||!e||i<=0||e<=0||(Go=(Go*Nc+8*i/e)/++Nc)},aT={ERRORCODE:900,extensions:[]},Bc="VAST response version not supported";class oT extends Fh{constructor(){let{fetcher:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this.maxWrapperDepth=null,this.rootErrorURLTemplates=[],this.errorURLTemplates=[],this.remainingAds=[],this.parsingOptions={},this.fetcher=e||null,this.keepFailedAdPod=!1}trackVastError(e,t){for(var r=arguments.length,s=new Array(r>2?r-2:0),n=2;n<r;n++)s[n-2]=arguments[n];this.emit("VAST-error",Object.assign({},aT,t,...s)),De.track(e,t)}getErrorURLTemplates(){return this.rootErrorURLTemplates.concat(this.errorURLTemplates)}getEstimatedBitrate(){return Go}initParsingStatus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.maxWrapperDepth=e.wrapperLimit||10,this.parsingOptions={allowMultipleAds:e.allowMultipleAds},this.keepFailedAdPod=e.keepFailedAdPod||!1,this.rootURL="",this.resetParsingStatus(),$h(e.byteLength,e.requestDuration)}resetParsingStatus(){this.errorURLTemplates=[],this.rootErrorURLTemplates=[],this.vastVersion=null}getRemainingAds(e){if(this.remainingAds.length===0)return Promise.reject(new Error("No more ads are available for the given VAST"));const t=e?this.remainingAds:[this.remainingAds.shift()];return this.errorURLTemplates=[],this.resolveAds(t,{wrapperDepth:0,url:this.rootURL}).then(r=>this.buildVASTResponse(r))}parseVAST(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.initParsingStatus(t),t.isRootVAST=!0,this.parse(e,t).then(r=>this.buildVASTResponse(r))}buildVASTResponse(e){const t=function(r){let{ads:s,errorURLTemplates:n,version:a}=r;return{ads:s||[],errorURLTemplates:n||[],version:a||null}}({ads:e,errorURLTemplates:this.getErrorURLTemplates(),version:this.vastVersion});return this.completeWrapperResolving(t),t}parseVastXml(e,t){let{isRootVAST:r=!1,url:s=null,wrapperDepth:n=0,allowMultipleAds:a,followAdditionalWrappers:l}=t;if(!e||!e.documentElement||e.documentElement.nodeName!=="VAST"){var u;this.emit("VAST-ad-parsed",{type:"ERROR",url:s,wrapperDepth:n});const b=(e==null||(u=e.documentElement)===null||u===void 0?void 0:u.nodeName)==="VideoAdServingTemplate";throw new Error(b?Bc:"Invalid VAST XMLDocument")}const f=[],p=e.documentElement.childNodes,T=e.documentElement.getAttribute("version");r&&T&&(this.vastVersion=T);for(const b in p){const S=p[b];if(S.nodeName==="Error"){const A=j.parseNodeText(S);r?this.rootErrorURLTemplates.push(A):this.errorURLTemplates.push(A)}else if(S.nodeName==="Ad"){if(this.vastVersion&&parseFloat(this.vastVersion)<3)a=!0;else if(a===!1&&f.length>1)break;const A=rT(S,this.emit.bind(this),{allowMultipleAds:a,followAdditionalWrappers:l});A.ad?(f.push(A.ad),this.emit("VAST-ad-parsed",{type:A.type,url:s,wrapperDepth:n,adIndex:f.length-1,vastVersion:T})):this.trackVastError(this.getErrorURLTemplates(),{ERRORCODE:101})}}return f}parse(e){let{url:t=null,resolveAll:r=!0,wrapperSequence:s=null,previousUrl:n=null,wrapperDepth:a=0,isRootVAST:l=!1,followAdditionalWrappers:u,allowMultipleAds:f}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=[];this.vastVersion&&parseFloat(this.vastVersion)<3&&l&&(f=!0);try{p=this.parseVastXml(e,{isRootVAST:l,url:t,wrapperDepth:a,allowMultipleAds:f,followAdditionalWrappers:u})}catch(T){return Promise.reject(T)}if(p.length===1&&s!=null&&(p[0].sequence=s),r===!1){const T=j.getSortedAdPods(p),b=j.getStandAloneAds(p);T.length?p=T:b.length&&(p=[b.shift()]),this.remainingAds=b}return this.resolveAds(p,{wrapperDepth:a,previousUrl:n,url:t})}resolveAds(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{wrapperDepth:t,previousUrl:r,url:s}=arguments.length>1?arguments[1]:void 0;const n=[];return r=s,e.forEach(a=>{const l=this.resolveWrappers(a,t,r);n.push(l)}),Promise.all(n).then(a=>De.flatten(a))}resolveWrappers(e,t,r){const s={...e};return new Promise(n=>{var a;if(t++,!s.nextWrapperURL)return delete s.nextWrapperURL,n(s);if(!this.fetcher)return s.VASTAdTagURI=s.nextWrapperURL,delete s.nextWrapperURL,n(s);if(t>=this.maxWrapperDepth)return s.errorCode=302,delete s.nextWrapperURL,n(s);s.nextWrapperURL=j.resolveVastAdTagURI(s.nextWrapperURL,r);const l=(a=this.parsingOptions.allowMultipleAds)!==null&&a!==void 0?a:s.allowMultipleAds,u=s.sequence;this.fetcher.fetchVAST({url:s.nextWrapperURL,emitter:this.emit.bind(this),maxWrapperDepth:this.maxWrapperDepth}).then(f=>this.parse(f,{url:s.nextWrapperURL,previousUrl:r,wrapperSequence:u,wrapperDepth:t,followAdditionalWrappers:s.followAdditionalWrappers,allowMultipleAds:l}).then(p=>{if(delete s.nextWrapperURL,p.length===0)return s.creatives=[],n(s);p.forEach(T=>{T&&j.mergeWrapperAdData(T,s)}),n(p)})).catch(f=>{s.errorCode=f.message===Bc?102:301,s.errorMessage=f.message,n(s)})})}completeWrapperResolving(e){if(e.ads.length===0)this.trackVastError(e.errorURLTemplates,{ERRORCODE:303});else for(let t=e.ads.length-1;t>=0;t--){const r=e.ads[t],s=!r.creatives.some(n=>{var a,l;return((a=n.mediaFiles)===null||a===void 0?void 0:a.length)>0||((l=n.variations)===null||l===void 0?void 0:l.length)>0});!r.errorCode&&!s||r.VASTAdTagURI||(this.trackVastError(r.errorURLTemplates.concat(e.errorURLTemplates),{ERRORCODE:r.errorCode||303},{ERRORMESSAGE:r.errorMessage||""},{extensions:r.extensions},{system:r.system}),this.keepFailedAdPod&&r.sequence?r.hasFailed=!0:e.ads.splice(t,1))}}}let gi=null;const lT={data:{},length:0,getItem(i){return this.data[i]},setItem(i,e){this.data[i]=e,this.length=Object.keys(this.data).length},removeItem(i){delete this.data[i],this.length=Object.keys(this.data).length},clear(){this.data={},this.length=0}};class uT{constructor(){this.storage=this.initStorage()}initStorage(){if(gi)return gi;try{gi=typeof window<"u"&&window!==null?window.localStorage||window.sessionStorage:null}catch{gi=null}return gi&&!this.isStorageDisabled(gi)||(gi=lT,gi.clear()),gi}isStorageDisabled(e){const t="__VASTStorage__";try{if(e.setItem(t,t),e.getItem(t)!==t)return e.removeItem(t),!0}catch{return!0}return e.removeItem(t),!1}getItem(e){return this.storage.getItem(e)}setItem(e,t){return this.storage.setItem(e,t)}removeItem(e){return this.storage.removeItem(e)}clear(){return this.storage.clear()}}const Ko=12e4,cT={get:async function(i,e){try{const t=new AbortController,r=setTimeout(()=>{throw t.abort(),new Error("URLHandler: Request timed out after ".concat(e.timeout||Ko," ms (408)"))},e.timeout||Ko),s=await fetch(i,{...e,signal:t.signal,credentials:e.withCredentials?"include":"omit"}).finally(()=>{clearTimeout(r)}),n=function(a){return De.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 n?{error:new Error(n),statusCode:s.status}:async function(a){const l=await a.text();let u;return u=De.isBrowserEnvironment()?new DOMParser:new(await Promise.resolve().then(()=>mb)).DOMParser,{xml:u.parseFromString(l,"text/xml"),details:{byteLength:l.length,statusCode:a.status,rawXml:l}}}(s)}catch(t){return{error:t,statusCode:t.name==="AbortError"?408:null}}}};let dT=class{constructor(){this.URLTemplateFilters=[]}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.urlHandler=e.urlHandler||e.urlhandler||cT,this.fetchingOptions={...e.fetchOptions,timeout:e.timeout||Ko,withCredentials:!!e.withCredentials}}addURLTemplateFilter(e){typeof e=="function"&&this.URLTemplateFilters.push(e)}removeLastURLTemplateFilter(){this.URLTemplateFilters.pop()}countURLTemplateFilters(){return this.URLTemplateFilters.length}clearURLTemplateFilters(){this.URLTemplateFilters=[]}async fetchVAST(e){var t;let{url:r,maxWrapperDepth:s,emitter:n,wrapperDepth:a=0,previousUrl:l=null,wrapperAd:u=null}=e;const f=Date.now();this.URLTemplateFilters.forEach(b=>{r=b(r)}),n("VAST-resolving",{url:r,previousUrl:l,wrapperDepth:a,maxWrapperDepth:s,timeout:this.fetchingOptions.timeout,wrapperAd:u});const p=await this.urlHandler.get(r,this.fetchingOptions),T=Math.round(Date.now()-f);if(n("VAST-resolved",{url:r,previousUrl:l,wrapperDepth:a,error:(p==null?void 0:p.error)||null,duration:T,statusCode:(p==null?void 0:p.statusCode)||null,...p==null?void 0:p.details}),$h(p==null||(t=p.details)===null||t===void 0?void 0:t.byteLength,T),p.error)throw new Error(p.error);return p.xml}},hT=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new uT;this.cappingFreeLunch=e,this.cappingMinimumTimeInterval=t,this.fetcher=new dT,this.vastParser=new oT({fetcher:this.fetcher}),this.storage=r,this.lastSuccessfulAd===void 0&&(this.lastSuccessfulAd=0),this.totalCalls===void 0&&(this.totalCalls=0),this.totalCallsTimeout===void 0&&(this.totalCallsTimeout=0)}addURLTemplateFilter(e){this.fetcher.addURLTemplateFilter(e)}removeLastURLTemplateFilter(){this.fetcher.removeLastURLTemplateFilter()}countURLTemplateFilters(){return this.fetcher.countURLTemplateFilters()}clearURLTemplateFilters(){this.fetcher.clearURLTemplateFilters()}getParser(){return this.vastParser}get lastSuccessfulAd(){return this.storage.getItem("vast-client-last-successful-ad")}set lastSuccessfulAd(e){this.storage.setItem("vast-client-last-successful-ad",e)}get totalCalls(){return this.storage.getItem("vast-client-total-calls")}set totalCalls(e){this.storage.setItem("vast-client-total-calls",e)}get totalCallsTimeout(){return this.storage.getItem("vast-client-total-calls-timeout")}set totalCallsTimeout(e){this.storage.setItem("vast-client-total-calls-timeout",e)}hasRemainingAds(){return this.vastParser.remainingAds.length>0}getNextAds(e){return this.vastParser.getRemainingAds(e)}parseVAST(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.fetcher.setOptions(t),this.vastParser.parseVAST(e,t)}get(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=Date.now();return t.hasOwnProperty("resolveAll")||(t.resolveAll=!1),this.totalCallsTimeout<r?(this.totalCalls=1,this.totalCallsTimeout=r+36e5):this.totalCalls++,new Promise((s,n)=>{if(this.cappingFreeLunch>=this.totalCalls)return n(new Error("VAST call canceled – FreeLunch capping not reached yet ".concat(this.totalCalls,"/").concat(this.cappingFreeLunch)));const a=r-this.lastSuccessfulAd;if(a<0)this.lastSuccessfulAd=0;else if(a<this.cappingMinimumTimeInterval)return n(new Error("VAST call canceled – (".concat(this.cappingMinimumTimeInterval,")ms minimum interval reached")));this.vastParser.initParsingStatus(t),this.fetcher.setOptions(t),this.vastParser.rootURL=e,this.fetcher.fetchVAST({url:e,emitter:this.vastParser.emit.bind(this.vastParser),maxWrapperDepth:this.vastParser.maxWrapperDepth}).then(l=>(t.previousUrl=e,t.isRootVAST=!0,t.url=e,this.vastParser.parse(l,t).then(u=>{const f=this.vastParser.buildVASTResponse(u);s(f)}))).catch(l=>n(l))})}};class fT extends Fh{constructor(e,t,r){var s;let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a=arguments.length>4&&arguments[4]!==void 0&&arguments[4];super(),this.ad=t,this.creative=r,this.variation=n,this.muted=a,this.impressed=!1,this.skippable=!1,this.trackingEvents={},this.trackedProgressEvents=[],this.lastPercentage=0,this._alreadyTriggeredQuartiles={},this.emitAlwaysEvents=["creativeView","start","firstQuartile","midpoint","thirdQuartile","complete","resume","pause","rewind","skip","closeLinear","close"];for(const l in this.creative.trackingEvents){const u=this.creative.trackingEvents[l];this.trackingEvents[l]=u.slice(0)}this.viewableImpressionTrackers=((s=this.ad.viewableImpression)===null||s===void 0?void 0:s.reduce((l,u)=>(l.notViewable.push(...u.notViewable),l.viewUndetermined.push(...u.viewUndetermined),l.viewable.push(...u.viewable),l),{notViewable:[],viewUndetermined:[],viewable:[]}))||{},Object.entries(this.viewableImpressionTrackers).forEach(l=>{let[u,f]=l;f.length&&(this.trackingEvents[u]=f)}),function(l){return l.type==="linear"}(this.creative)?this._initLinearTracking():this._initVariationTracking(),e&&this.on("start",()=>{e.lastSuccessfulAd=Date.now()})}_initLinearTracking(){this.linear=!0,this.skipDelay=this.creative.skipDelay,this.setDuration(this.creative.duration),this.clickThroughURLTemplate=this.creative.videoClickThroughURLTemplate,this.clickTrackingURLTemplates=this.creative.videoClickTrackingURLTemplates}_initVariationTracking(){if(this.linear=!1,this.skipDelay=-1,this.variation){for(const e in this.variation.trackingEvents){const 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)}}setDuration(e){De.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)})}setProgress(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(!De.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(De.formatMacrosValues(t))});const s=this.skipDelay||-1;if(s===-1||this.skippable||(s>e?this.emit("skip-countdown",s-e):(this.skippable=!0,this.emit("skip-countdown",0))),this.assetDuration>0){const n=Math.round(e/this.assetDuration*100),a=[];if(e>0){a.push("start");for(let l=this.lastPercentage;l<n;l++)a.push("progress-".concat(l+1,"%"));a.push("progress-".concat(e));for(const l in this.quartiles)this.isQuartileReached(l,this.quartiles[l],e)&&(a.push(l),this._alreadyTriggeredQuartiles[l]=!0);this.lastPercentage=n}a.forEach(l=>{this.track(l,{macros:t,once:r})}),e<this.progress&&(this.track("rewind",{macros:t}),this.trackedProgressEvents&&this.trackedProgressEvents.splice(0))}this.progress=e}isQuartileReached(e,t,r){let s=!1;return t<=r&&!this._alreadyTriggeredQuartiles[e]&&(s=!0),s}setMuted(e){let 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(De.formatMacrosValues(t))})}setPaused(e){let 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(De.formatMacrosValues(t))})}setFullscreen(e){let 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(De.formatMacrosValues(t))})}setExpand(e){let 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(De.formatMacrosValues(t))})}setSkipDelay(e){De.isValidTimeValue(e)?this.skipDelay=e:this.emit("TRACKER-error",{message:"setSkipDelay parameter does not have a valid value. duration: ".concat(e)})}trackImpression(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.impressed||(this.impressed=!0,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)})}trackViewableImpression(){let 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)})}trackNotViewableImpression(){let 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)})}trackUndeterminedImpression(){let 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)})}error(){let 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(De.formatMacrosValues(e),", isCustomCode: ").concat(t)})}errorWithCode(e){let 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)})}complete(){let 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)})}notUsed(){let 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)})}otherAdInteraction(){let 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)})}acceptInvitation(){let 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)})}adExpand(){let 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)})}adCollapse(){let 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)})}minimize(){let 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)})}verificationNotExecuted(e){let 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(De.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");const r=this.ad.adVerifications.find(n=>n.vendor===e);if(!r)throw new Error("No associated verification element found for vendor: ".concat(e));const s=r.trackingEvents;if(s&&s.verificationNotExecuted){const n=s.verificationNotExecuted;this.trackURLs(n,t),this.emit("verificationNotExecuted",{trackingURLTemplates:n})}}overlayViewDuration(e){let 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(De.formatMacrosValues(t))})}close(){let 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)})}skip(){let 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)})}load(){let 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)})}click(){let 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(De.formatMacrosValues(t))});this.clickTrackingURLTemplates&&this.clickTrackingURLTemplates.length&&this.trackURLs(this.clickTrackingURLTemplates,t);const r=this.clickThroughURLTemplate||e,s={...t};if(r){this.progress&&(s.ADPLAYHEAD=this.progressFormatted());const n=De.resolveURLTemplates([r],s)[0];this.emit("clickthrough",n)}}trackProgressEvents(e,t,r){const s=parseFloat(e.split("-")[1]);Object.entries(this.trackingEvents).filter(n=>{let[a]=n;return a.startsWith("progress-")}).map(n=>{let[a,l]=n;return{name:a,time:parseFloat(a.split("-")[1]),urls:l}}).filter(n=>{let{time:a}=n;return a<=s&&a>this.progress}).forEach(n=>{let{name:a,urls:l}=n;!r&&this.trackedProgressEvents.includes(a)||(this.emit(a,{trackingURLTemplates:l}),this.trackURLs(l,t),r?delete this.trackingEvents[a]:this.trackedProgressEvents.push(a))})}track(e){let{macros:t={},once:r=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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,r);const 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),r&&(delete this.trackingEvents[e],n&&this.emitAlwaysEvents.splice(this.emitAlwaysEvents.indexOf(e),1))}trackURLs(e){var t;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{validUrls:n,invalidUrls:a}=De.filterUrlTemplates(e);a.length&&this.emit("TRACKER-error",{message:"Provided urls are malformed. url: ".concat(a)});const l={...r};this.linear&&(this.creative&&this.creative.mediaFiles&&this.creative.mediaFiles[0]&&this.creative.mediaFiles[0].fileURL&&(l.ASSETURI=this.creative.mediaFiles[0].fileURL),this.progress&&(l.ADPLAYHEAD=this.progressFormatted())),(t=this.creative)!==null&&t!==void 0&&(t=t.universalAdIds)!==null&&t!==void 0&&t.length&&(l.UNIVERSALADID=this.creative.universalAdIds.map(u=>u.idRegistry.concat(" ",u.value)).join(",")),this.ad&&(this.ad.sequence&&(l.PODSEQUENCE=this.ad.sequence),this.ad.adType&&(l.ADTYPE=this.ad.adType),this.ad.adServingId&&(l.ADSERVINGID=this.ad.adServingId),this.ad.categories&&this.ad.categories.length&&(l.ADCATEGORIES=this.ad.categories.map(u=>u.value).join(",")),this.ad.blockedAdCategories&&this.ad.blockedAdCategories.length&&(l.BLOCKEDADCATEGORIES=this.ad.blockedAdCategories.map(u=>u.value).join(","))),De.track(n,l,s)}convertToTimecode(e){if(!De.isValidTimeValue(e))return"";const t=1e3*e,r=Math.floor(t/36e5),s=Math.floor(t/6e4%60),n=Math.floor(t/1e3%60),a=Math.floor(t%1e3);return"".concat(De.addLeadingZeros(r,2),":").concat(De.addLeadingZeros(s,2),":").concat(De.addLeadingZeros(n,2),".").concat(De.addLeadingZeros(a,3))}progressFormatted(){return this.convertToTimecode(this.progress)}}var Os;typeof window<"u"?Os=window:typeof ci.commonjsGlobal<"u"?Os=ci.commonjsGlobal:typeof self<"u"?Os=self:Os={};var Da=Os;const k=ci.getDefaultExportFromCjs(Da),pT={},mT=Object.freeze(Object.defineProperty({__proto__:null,default:pT},Symbol.toStringTag,{value:"Module"})),gT=ci.getAugmentedNamespace(mT);var Mc=typeof ci.commonjsGlobal<"u"?ci.commonjsGlobal:typeof window<"u"?window:{},yT=gT,Ns;typeof document<"u"?Ns=document:(Ns=Mc["__GLOBAL_DOCUMENT_CACHE@4"],Ns||(Ns=Mc["__GLOBAL_DOCUMENT_CACHE@4"]=yT));var jh=Ns;const X=ci.getDefaultExportFromCjs(jh);var wl={exports:{}},Vh={exports:{}};(function(i){function e(){return i.exports=e=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var s=arguments[r];for(var n in s)({}).hasOwnProperty.call(s,n)&&(t[n]=s[n])}return t},i.exports.__esModule=!0,i.exports.default=i.exports,e.apply(null,arguments)}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports})(Vh);var _T=Vh.exports,TT=bT,vT=Object.prototype.toString;function bT(i){if(!i)return!1;var e=vT.call(i);return e==="[object Function]"||typeof i=="function"&&e!=="[object RegExp]"||typeof window<"u"&&(i===window.setTimeout||i===window.alert||i===window.confirm||i===window.prompt)}function xT(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t)return(t=t.call(i)).next.bind(t);if(Array.isArray(i)||(t=ST(i))||e){t&&(i=t);var r=0;return function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ST(i,e){if(i){if(typeof i=="string")return Uc(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Uc(i,e)}}function Uc(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}var ET=function(){function i(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var e=i.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},e.addInterceptor=function(r,s){this.typeToInterceptorsMap_.has(r)||this.typeToInterceptorsMap_.set(r,new Set);var n=this.typeToInterceptorsMap_.get(r);return n.has(s)?!1:(n.add(s),!0)},e.removeInterceptor=function(r,s){var n=this.typeToInterceptorsMap_.get(r);return n&&n.has(s)?(n.delete(s),!0):!1},e.clearInterceptorsByType=function(r){var s=this.typeToInterceptorsMap_.get(r);return s?(this.typeToInterceptorsMap_.delete(r),this.typeToInterceptorsMap_.set(r,new Set),!0):!1},e.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},e.getForType=function(r){return this.typeToInterceptorsMap_.get(r)||new Set},e.execute=function(r,s){for(var n=this.getForType(r),a=xT(n),l;!(l=a()).done;){var u=l.value;try{s=u(s)}catch{}}return s},i}(),CT=ET,AT=function(){function i(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var e=i.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},e.getMaxAttempts=function(){return this.maxAttempts_},e.setMaxAttempts=function(r){this.maxAttempts_=r},e.getDelayFactor=function(){return this.delayFactor_},e.setDelayFactor=function(r){this.delayFactor_=r},e.getFuzzFactor=function(){return this.fuzzFactor_},e.setFuzzFactor=function(r){this.fuzzFactor_=r},e.getInitialDelay=function(){return this.initialDelay_},e.setInitialDelay=function(r){this.initialDelay_=r},e.createRetry=function(r){var s=r===void 0?{}:r,n=s.maxAttempts,a=s.delayFactor,l=s.fuzzFactor,u=s.initialDelay;return new wT({maxAttempts:n||this.maxAttempts_,delayFactor:a||this.delayFactor_,fuzzFactor:l||this.fuzzFactor_,initialDelay:u||this.initialDelay_})},i}(),wT=function(){function i(t){this.maxAttempts_=t.maxAttempts,this.delayFactor_=t.delayFactor,this.fuzzFactor_=t.fuzzFactor,this.currentDelay_=t.initialDelay,this.currentAttempt_=1}var e=i.prototype;return e.moveToNextAttempt=function(){this.currentAttempt_++;var r=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+r},e.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},e.getCurrentDelay=function(){return this.currentDelay_},e.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},e.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},e.getCurrentFuzzedDelay=function(){var r=this.getCurrentMinPossibleDelay(),s=this.getCurrentMaxPossibleDelay();return r+Math.random()*(s-r)},i}(),DT=AT,IT=Da,kT=function(e,t){return t===void 0&&(t=!1),function(r,s,n){if(r){e(r);return}if(s.statusCode>=400&&s.statusCode<=599){var a=n;if(t)if(IT.TextDecoder){var l=PT(s.headers&&s.headers["content-type"]);try{a=new TextDecoder(l).decode(n)}catch{}}else a=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:a});return}e(null,n)}};function PT(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(e,t){var r=t.split("="),s=r[0],n=r[1];return s.trim()==="charset"?n.trim():e},"utf-8")}var LT=kT,qh=Da,RT=_T,OT=TT,Hh=CT,NT=DT;We.httpHandler=LT;We.requestInterceptorsStorage=new Hh;We.responseInterceptorsStorage=new Hh;We.retryManager=new NT;/**
3
3
  * @license
4
4
  * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
package/lib/cjs/auth.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),o=require("./hooks-B0Qttldg.js"),u=({token:e,schema:r})=>{const t=o.B();return i.useEffect(()=>{e&&r&&t&&t.authorizationBypass(r,e),t&&(t.withAuth=!0)},[e,r,t]),null};exports.StreamLayerLogin=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),o=require("./hooks-WfHlJH12.js"),u=({token:e,schema:r})=>{const t=o.B();return i.useEffect(()=>{e&&r&&t&&t.authorizationBypass(r,e),t&&(t.withAuth=!0)},[e,r,t]),null};exports.StreamLayerLogin=u;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("./index3.js"),c=require("./index4.js"),o=require("react"),s=require("./hooks-B0Qttldg.js"),n=e=>{const t=e.target;t instanceof Element&&t.getAttribute("data-a")==="intr"&&i.eventBus.emit("interactions",{action:"tap",payload:{}})},u=()=>{const e=s.B();return o.useEffect(()=>(document==null||document.addEventListener("click",n),()=>{document==null||document.removeEventListener("click",n)}),[]),e?r.jsx(c.Q,{sdk:e}):null};exports.BetPackProvider=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("./index3.js"),c=require("./index4.js"),o=require("react"),s=require("./hooks-WfHlJH12.js"),n=e=>{const t=e.target;t instanceof Element&&t.getAttribute("data-a")==="intr"&&i.eventBus.emit("interactions",{action:"tap",payload:{}})},u=()=>{const e=s.B();return o.useEffect(()=>(document==null||document.addEventListener("click",n),()=>{document==null||document.removeEventListener("click",n)}),[]),e?r.jsx(c.Q,{sdk:e}):null};exports.BetPackProvider=u;
@@ -0,0 +1 @@
1
+ "use strict";var d=Object.defineProperty;var l=(t,e,s)=>e in t?d(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var n=(t,e,s)=>l(t,typeof e!="symbol"?e+"":e,s);const u=require("pino");require("./sl-types.js");require("nanostores");const i=require("./useStreamLayerApp2.js"),c=u.pino({level:"trace",enabled:typeof window<"u"&&!!window.localStorage.getItem("SL_DEBUG"),browser:{write:t=>{console.log(t)}}}),a=(t,e)=>c.child({name:t},e);class v extends Event{constructor(s,r){super(s);n(this,"slEventBus");this.slEventBus=r}}const w=a("event-bus");class E{constructor(e="sl-event-bus"){n(this,"name");n(this,"listeners");n(this,"emit",(e,s)=>{const r=new v(this.name,{...s,type:e});w.debug(r,"Emitting event"),window.dispatchEvent(r)});n(this,"destroy",()=>{this.listeners.forEach(e=>{window.removeEventListener(this.name,e),this.listeners.delete(e)}),this.listeners.clear()});this.name=e,this.listeners=new Set}listen(e){return window.addEventListener(this.name,e),this.listeners.add(e),()=>{this.off(e)}}off(e){window.removeEventListener(this.name,e),this.listeners.delete(e)}}window.slStore=Object.create(null);var o;(function(t){t.ORGANIZATION="ORGANIZATION",t.STREAM="STREAM"})(o||(o={}));i.SdkOverlayType.BETTING+"",i.SdkOverlayType.GAMES+"",i.SdkOverlayType.PUBLIC_CHAT+"",i.SdkOverlayType.TWITTER+"";exports.FeatureStatus=void 0;(function(t){t.Ready="ready",t.Suspended="suspended"})(exports.FeatureStatus||(exports.FeatureStatus={}));exports.EventBus=E;exports.createLogger=a;
@@ -0,0 +1 @@
1
+ "use strict";const n=require("react"),f=require("react/jsx-runtime"),w=require("./useStreamLayerApp2.js"),E=({event:e,internal:r})=>{const s=m(),o=L();return n.useEffect(()=>{s&&(e&&(s.createEventSession(e,r),o&&(o.current=e)),!e&&o!=null&&o.current&&(s.createEventSession("",r),o.current=""))},[e,r,o,s]),null};var h=(e=>(e[e.UNSET=0]="UNSET",e[e.CONNECTED=1]="CONNECTED",e[e.READY=2]="READY",e))(h||{});const x={status:0,sdk:null},i=n.createContext(x),N=({sdkKey:e,theme:r,themeMode:s,plugins:o,children:d,event:p,production:y=!0,autoEnable:C=!0,withAdNotification:S,withAd:D=!0,betPack:a=!1,hideFriends:A,skipOnboarding:c,friendsTab:v="enabled",onDeepLinkHandled:l,videoPlayerController:u,onContentActivate:K,containerId:k,webOS:P})=>{const t=w.$({sdkKey:e,plugins:o,production:y,autoEnable:C,onDeepLinkHandled:l,videoPlayerController:u,onContentActivate:K,hideFriends:A,skipOnboarding:c,withAdNotification:S,withAd:D,friendsTab:v,betPack:a,webOS:P}),b=n.useRef(""),g=n.useMemo(()=>t?{sdk:t,status:2,event:b}:{status:1,sdk:null,event:b},[t]);return n.useEffect(()=>{t&&(t.options.setKey("friendsTab",v),t.options.setKey("theme",r),t.options.setKey("themeMode",s),t.options.setKey("skipOnboarding",c),t.options.setKey("betPack",a),t.options.setKey("containerId",k))},[t,v,r,s,c,a,k]),n.useEffect(()=>()=>{l&&(t==null||t.removeDeepLinkHandler(l)),u&&(t==null||t.removeVideoPlayerController(u))},[t]),n.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!e,onDeepLinkHandled:!!l,videoPlayerController:!!u})},[e,l,u]),f.jsxs(i.Provider,{value:g,children:[p!==void 0&&f.jsx(E,{event:p}),d]})},m=()=>{const{sdk:e}=n.useContext(i);return e},L=()=>{const{event:e}=n.useContext(i);return e},O=()=>{const{sdk:e}=n.useContext(i),[r,s]=n.useState({});return n.useEffect(()=>{var o;return e!=null&&e.options?(o=e==null?void 0:e.options)==null?void 0:o.subscribe(d=>{s({theme:d.theme,themeMode:d.themeMode})}):()=>{}},[e==null?void 0:e.options]),r},T=()=>{const{sdk:e}=n.useContext(i),[r,s]=n.useState({});return n.useEffect(()=>e!=null&&e.uiState?e==null?void 0:e.uiState.subscribe(o=>{s({...o})}):()=>{},[e==null?void 0:e.uiState]),r};exports.B=m;exports.F=T;exports.Y=h;exports.i=i;exports.j=E;exports.q=N;exports.z=O;
package/lib/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react");const e=require("./hooks-B0Qttldg.js");require("react/jsx-runtime");require("./useStreamLayerApp2.js");const t=require("./index7.js"),a=require("./index2.js"),r=require("./notification.js");exports.StreamLayerProvider=e.q;exports.StreamLayerSDKEvent=e.j;exports.useStreamLayer=e.B;exports.useStreamLayerTheme=e.z;exports.useStreamLayerUI=e.F;exports.StreamLayerThemeProvider=t.h;exports.StreamLayerSDKReact=a.b;exports.StreamLayerSDKNotification=r.StreamLayerSDKNotification;exports.StreamLayerSDKNotificationUI=r.StreamLayerSDKNotificationUI;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react");const e=require("./hooks-WfHlJH12.js");require("react/jsx-runtime");require("./useStreamLayerApp2.js");const t=require("./index8.js"),a=require("./index2.js"),r=require("./notification.js");exports.StreamLayerProvider=e.q;exports.StreamLayerSDKEvent=e.j;exports.useStreamLayer=e.B;exports.useStreamLayerTheme=e.z;exports.useStreamLayerUI=e.F;exports.StreamLayerThemeProvider=t.h;exports.StreamLayerSDKReact=a.b;exports.StreamLayerSDKNotification=r.StreamLayerSDKNotification;exports.StreamLayerSDKNotificationUI=r.StreamLayerSDKNotificationUI;
@@ -1,4 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),a=require("react"),s=require("./sl-types.js"),te=require("./index8.js"),$=require("./index6.js"),n=require("./useStreamLayerApp2.js"),xe=require("./index13.js"),Ie=require("./index5.js"),Le=s.styled_default("div")({name:"SDKContainer",class:"sopqfe6",propsAsIs:!1}),je=s.styled_default("div")({name:"SDKScrollContainer",class:"s102vcph",propsAsIs:!1}),ie=s.styled_default("div")({name:"SDKContentContainer",class:"s1meqjjv",propsAsIs:!1}),Be=()=>ie,oe=s.styled_default(Be())({name:"SDKWhiteContainer",class:"s1burm22",propsAsIs:!0}),Fe=()=>oe,We=s.styled_default(Fe())({name:"SDKSummaryContainer",class:"sm5r3j5",propsAsIs:!0}),Me=s.styled_default("div")({name:"TabsContainer",class:"tysxwr6",propsAsIs:!1}),Ye=()=>ie,ze=s.styled_default(Ye())({name:"LeaderboardContainer",class:"l9er3b1",propsAsIs:!0}),Ue=()=>oe,Ke=s.styled_default(Ue())({name:"TabsNavContainer",class:"t19dtrb3",propsAsIs:!0}),He=s.styled_default("div")({name:"UserSummaryContainer",class:"u1552n3j",propsAsIs:!1});var Ge=Object.defineProperty,Je=(t,i,o)=>i in t?Ge(t,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[i]=o,Xe=(t,i,o)=>Je(t,i+"",o);let Ze=class{constructor(){Xe(this,"observers",new Set)}subscribe(i){this.observers.add(i)}unsubscribe(i){this.observers.delete(i)}notify(i){this.observers.forEach(o=>o(i))}};const z=new Ze,es={hiding:!1,finished:!1},ve=()=>{const[t,i]=a.useState(es),o=a.useRef(null);a.useEffect(()=>{const u=m=>{i(m)};return z.subscribe(u),()=>{z.unsubscribe(u)}},[]);const c=a.useCallback(u=>{const m={hiding:!0,finished:!1};o.current&&clearTimeout(o.current),u!=null&&u.delay?o.current=setTimeout(()=>{z.notify(m)},u==null?void 0:u.delay):z.notify(m)},[]),r=a.useCallback(()=>{t.hiding&&(o.current=null,z.notify({hiding:!1,finished:!0}))},[t.hiding]);return{...t,runAnimation:c,onAnimationEnd:r}},ss=s.styled_default("div")({name:"Container",class:"c1pgyo67",propsAsIs:!1}),ts="sx17qu6",ns="h1692c5m",re=({children:t,style:i,className:o,enabled:c=!0,hiding:r,onAnimationEnd:u})=>e.jsx(ss,{style:i,className:s.cx_default(o,c&&ts,c&&r&&ns),onAnimationEnd:u,children:t}),is=()=>re,os=s.styled_default(is())({name:"GrowingContainer",class:"gck55ev",propsAsIs:!0}),Te=({children:t,style:i,enabled:o,animate:c,...r})=>{const u=a.useRef(null);return e.jsx(os,{...r,enabled:o&&c,style:{...i,...(()=>{const m=u==null?void 0:u.current,j=m&&window.getComputedStyle(m),b=j==null?void 0:j.getPropertyValue("height");return o?{height:c?b:0}:{}})()},children:e.jsx("div",{ref:u,children:t})})},rs=s.styled_default("div")({name:"Container",class:"c1gcvmcj",propsAsIs:!1}),as=s.styled_default("div")({name:"Title",class:"tnr592a",propsAsIs:!1}),ds=s.styled_default("div")({name:"Description",class:"d1e8jqpv",propsAsIs:!1}),ls=()=>$.B1,cs=s.styled_default(ls())({name:"Icon",class:"i1vs651k",propsAsIs:!0}),us=({icon:t,title:i,description:o})=>e.jsxs(rs,{children:[e.jsx(cs,{name:t}),e.jsx(as,{children:i}),e.jsx(ds,{children:o})]}),ps=()=>Te,ys=s.styled_default(ps())({name:"ShowInContainer",class:"s16sbdnm",propsAsIs:!0}),L=s.styled_default("div")({name:"FeedbackContainer",class:"fbhorgl",propsAsIs:!1}),pe="s1g20ja7",ms=s.styled_default("div")({name:"Container",class:"c455ozj",propsAsIs:!1}),hs=()=>$.B1,ye=s.styled_default(hs())({name:"IconPrediction",class:"i1913njx",propsAsIs:!0}),U=s.styled_default("div")({name:"FeedbackIconWrap",class:"fzfk69z",propsAsIs:!1}),G=s.styled_default("div")({name:"FeedbackHeader",class:"fx87qaj",propsAsIs:!1}),fs=s.styled_default("span")({name:"FeedbackTitle",class:"fvek9ew",propsAsIs:!1}),B=s.styled_default("span")({name:"FeedbackDescription",class:"f1kbtp09",propsAsIs:!1}),xs=s.styled_default("div")({name:"FeedbackTitleWrap",class:"f4i8rro",propsAsIs:!1}),Is=s.styled_default("div")({name:"FeedbackResultDescriptionWrap",class:"fqyssr",propsAsIs:!1}),js=()=>B,vs=s.styled_default(js())({name:"FeedbackDynamicDescription",class:"fyv794i",propsAsIs:!0}),Ts=()=>B,As=s.styled_default(Ts())({name:"FeedbackResultDescription",class:"f1jkj9vx",propsAsIs:!0}),ne=s.styled_default("div")({name:"FeedbackText",class:"f1pxh3a6",propsAsIs:!1}),Cs=s.styled_default("span")({name:"DynamicWrap",class:"d1afvufn",propsAsIs:!1}),$s=s.styled_default("div")({name:"EarlyFeedbackDescription",class:"eq8u24d",propsAsIs:!1}),me=({feedbackMessages:t,questionVotedCorrectly:i,questionVoted:o,questionType:c,hasCorrectAnswer:r,showExpiredNotification:u,showClosedNotificationTrivia:m,votedInCurrentRender:j,votedAfterQuestionClosed:b,voteErrorMessage:h,enteredAnActiveQuestion:d,marketClosed:g,percentsAnimated:C,votedAnswer:I,isEarlyPrediction:y,correctAnswer:_,onAnimationEnd:P})=>{const E=o&&(c===n.QuestionType.TRIVIA||c===n.QuestionType.PREDICTION),T=c===n.QuestionType.PREDICTION&&!r,q=g&&c===n.QuestionType.PREDICTION&&!o||c===n.QuestionType.PREDICTION&&b&&j&&d,Q=E&&T,S=E&&r,w=c===n.QuestionType.PREDICTION&&o&&j&&r,R=o&&c===n.QuestionType.POLL&&j,f=i?"correct":"incorrect",k=i?t==null?void 0:t.correctFeedback:t==null?void 0:t.incorrectFeedback;return u||m||Q||S||q||R||w||h?e.jsx(ys,{enabled:j,animate:!h&&u?!0:C,onAnimationEnd:P,children:e.jsxs(ms,{"data-prediction":T,children:[h&&!q&&e.jsxs(L,{children:[!y&&e.jsx(ye,{name:"questionExpired"}),e.jsx(B,{children:h})]}),!h&&u&&e.jsxs(L,{children:[!y&&e.jsx(U,{children:e.jsx($.B1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(G,{children:e.jsx(B,{children:"Question Expired"})}),e.jsx(ne,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),!h&&m&&e.jsxs(L,{className:s.cx_default(pe),children:[e.jsx(U,{children:e.jsx($.B1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(G,{children:e.jsx(B,{children:"Question Closed"})}),e.jsx(ne,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),q&&e.jsxs(L,{children:[!y&&e.jsx(U,{children:e.jsx($.B1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(G,{children:e.jsx(B,{children:y?r?"The results are already in!":"Question is Closed":"Question Closed"})}),e.jsx(ne,{children:y?e.jsx($s,{children:r?`Correct: ${_==null?void 0:_.text}`:"Event affecting the outcome has occurred."}):"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),!h&&Q&&e.jsxs(L,{children:[!y&&e.jsx(ye,{name:"icon-prediction"}),e.jsxs(vs,{children:["Your pick has been recorded. ",e.jsx(Cs,{children:"We’ll notify you of the result."})]})]}),!h&&R&&e.jsxs(L,{children:[!y&&e.jsx(U,{"data-feedback-type":"correct",children:e.jsx($.B1,{name:"correct"})}),e.jsx(B,{children:"Thanks for answering. Please stay tuned for the next question."})]}),!h&&(S||w)&&e.jsxs(L,{className:s.cx_default(m&&pe),children:[!y&&e.jsx(U,{"data-feedback-type":f,children:e.jsx($.B1,{name:f})}),e.jsx("div",{children:e.jsxs(G,{children:[y?e.jsx(xs,{children:f==="incorrect"?e.jsxs(e.Fragment,{children:[e.jsx("div",{children:"So close!"}),e.jsx("div",{children:"Better luck next time"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{children:"That’s correct!"}),e.jsx("div",{children:"You chose wisely."})]})}):e.jsx(fs,{"data-feedback-type":f,children:k==null?void 0:k.title}),y?e.jsxs(Is,{children:[e.jsxs("div",{children:["Your pick: ",I==null?void 0:I.text]}),e.jsx("div",{children:f==="incorrect"?`Correct: ${_==null?void 0:_.text}`:""})]}):e.jsx(As,{children:k==null?void 0:k.description})]})})]})]})}):null},Es=s.styled_default("div")({name:"Container",class:"c1hygj0s",propsAsIs:!1}),bs=s.styled_default("div")({name:"Title",class:"t1r84tez",propsAsIs:!1}),gs=s.styled_default("div")({name:"Description",class:"d1aj1a7k",propsAsIs:!1}),ws=s.styled_default("div")({name:"AdditionalDescription",class:"ax09ezs",propsAsIs:!1}),_s=()=>$.B1,Ps=s.styled_default(_s())({name:"Icon",class:"inkrac",propsAsIs:!0}),Qs=({icon:t,title:i,description:o,additionalDescription:c})=>e.jsxs(Es,{children:[t&&e.jsx(Ps,{name:t}),e.jsx(bs,{children:i}),e.jsx(gs,{children:o}),c&&e.jsx(ws,{children:c})]}),Ae=s.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),Rs=()=>je,qs=s.styled_default(Rs())({name:"QuestionScrollContainer",class:"q1tlqx57",propsAsIs:!0}),Ss=s.styled_default("div")({name:"TopShadow",class:"t1hq58md",propsAsIs:!1}),ks=s.styled_default("div")({name:"BottomShadow",class:"b1c8nxcx",propsAsIs:!1}),Ds=s.styled_default("div")({name:"SponsorLogo",class:"siozuc3",propsAsIs:!1}),Ce=s.styled_default("div")({name:"Content",class:"cpnc44r",propsAsIs:!1}),Os=s.styled_default("div")({name:"Title",class:"tq7p3w0",propsAsIs:!1}),Ns=s.styled_default("div")({name:"OptionsWrap",class:"o1jlfj9g",propsAsIs:!1}),$e=s.styled_default("div")({name:"Options",class:"o84pmnd",propsAsIs:!1}),Vs=()=>re,he=s.styled_default(Vs())({name:"AlertContainer",class:"a1dybjw9",propsAsIs:!0}),Ls=s.styled_default("div")({name:"EarlyPrediction",class:"e1l05ict",propsAsIs:!1}),Bs=()=>$.B1,Fs=s.styled_default(Bs())({name:"EarlyPredictionIcon",class:"ez9juex",propsAsIs:!0}),Ws=()=>$.B1,Ms=s.styled_default(Ws())({name:"SponsorIcon",class:"s8p4aob",propsAsIs:!0}),Ys=s.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),zs=s.styled_default("div")({name:"ButtonPctWrap",class:"b4iik8i",propsAsIs:!1}),Us=s.styled_default("div")({name:"ButtonPct",class:"b1gq1lnf",propsAsIs:!1}),Ks=s.styled_default("span")({name:"ButtonBody",class:"b1j65z51",propsAsIs:!1}),Hs=s.styled_default("div")({name:"IconContainer",class:"i19tpfua",propsAsIs:!1}),Gs=s.styled_default("div")({name:"IconWrap",class:"i1tubmma",propsAsIs:!1}),Ee=s.styled_default("img")({name:"Icon",class:"i1grrgwj",propsAsIs:!1}),Js=()=>Ee,Xs=s.styled_default(Js())({name:"IconDefault",class:"ibemyq8",propsAsIs:!0}),Zs=()=>Ee,et=s.styled_default(Zs())({name:"IconCircle",class:"i1dceht",propsAsIs:!0}),st=s.styled_default("span")({name:"Title",class:"t116q4vq",propsAsIs:!1}),tt=s.styled_default("span")({name:"Indicators",class:"i17ajcu2",propsAsIs:!1}),nt=s.styled_default("div")({name:"PtsWrap",class:"pu9kmlb",propsAsIs:!1}),it=s.styled_default("span")({name:"Pts",class:"p1j2j0s0",propsAsIs:!1}),ot=s.styled_default("span")({name:"Percentage",class:"p1mzj1sj",propsAsIs:!1}),rt=()=>$.B1,at=s.styled_default(rt())({name:"CheckIcon",class:"cichgz8",propsAsIs:!0}),fe={[n.QuestionImages.CENTERED]:t=>e.jsx(Xs,{"data-testid":"vote-icon",alt:"option-icon",src:t}),[n.QuestionImages.TRANSPARENT]:t=>e.jsx(Hs,{"data-testid":"vote-icon",children:e.jsx(Gs,{style:{backgroundImage:`url(${t})`}})}),[n.QuestionImages.ROUNDED]:t=>e.jsx(et,{"data-testid":"vote-icon",alt:"option-icon",src:t}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},dt=({questionType:t,hasCorrectAnswer:i,correct:o,youVoted:c,questionVoted:r})=>{if(t===n.QuestionType.POLL&&c)return"voted";if(t===n.QuestionType.PREDICTION){if(!i&&r)return c?"voted":"unset";if(i&&r)return c?o?"correct":"incorrect":"unset";if(c)return"correct"}return t===n.QuestionType.TRIVIA&&r&&c?o?"correct":"incorrect":"unset"},lt=({questionType:t,questionVoted:i,correct:o,hasCorrectAnswer:c,questionStatus:r})=>t===n.QuestionType.TRIVIA?i&&o:t===n.QuestionType.PREDICTION?i&&o&&c||r===n.QuestionStatus.RESOLVED&&o:!1,ct=xe.O(Ys),ut=t=>{var i;const{id:o,icon:c,text:r,percentageDecimal:u,points:m,onVote:j,markThatVoted:b,firstOption:h,onPercentsAnimated:d,youSelected:g,youVoted:C,questionVoted:I,imageMode:y,answerTimeExpired:_,questionStatus:P,isLoading:E,questionType:T,correct:q,hasCorrectAnswer:Q,marketClosed:S,isEarlyPrediction:w,isAd:R,webos:f}=t,[k,F]=a.useState(0),Y=dt(t),K=lt({questionType:T,questionVoted:I,correct:q,hasCorrectAnswer:Q,questionStatus:P}),D=S&&T===n.QuestionType.PREDICTION,O=I||D,J=T===n.QuestionType.PREDICTION&&!I&&!S&&!R,N=I&&!g&&Y!=="incorrect"&&!C;return a.useLayoutEffect(()=>{F(0),requestAnimationFrame(()=>{F(u)})},[u]),e.jsxs(ct,{value:o,webos:f,autoFocus:h,"data-selected":g,"data-answer-state":Y,disabled:I||E||_||D,"data-is-not-checked":N,"data-a":"intr",onClick:H=>{b(T===n.QuestionType.PREDICTION?S:P===n.QuestionStatus.RESOLVED),j(H)},"data-is-ad":R,children:[e.jsx(zs,{children:e.jsx(Us,{"data-answer-state":Y,"data-is-not-checked":N,style:{width:`${O?k:0}%`},onTransitionEnd:()=>{D||d==null||d()},"data-is-ad":R})}),e.jsxs(Ks,{"data-a":"intr",children:[c&&y&&((i=fe[y])==null?void 0:i.call(fe,c)),e.jsx(st,{"data-a":"intr",children:r}),J&&e.jsxs(nt,{children:[m,e.jsx(it,{children:"pts"})]}),O&&e.jsxs(tt,{children:[K&&e.jsx(at,{name:w?"selectedBetPack":"selected"}),e.jsx(ot,{children:e.jsx(Ie.d,{value:u,suffix:"%"})})]})]})]})},pt=()=>Te,yt=s.styled_default(pt())({name:"ShowInContainer",class:"sie6cqo",propsAsIs:!0}),mt=s.styled_default("div")({name:"WinBarContainer",class:"wgizw4u",propsAsIs:!1}),ht=s.styled_default("div")({name:"Content",class:"c1l3ucjp",propsAsIs:!1}),ft=s.styled_default("div")({name:"Title",class:"tx7j799",propsAsIs:!1}),xt=()=>$.B1,It=s.styled_default(xt())({name:"WinIcon",class:"w4lwuj0",propsAsIs:!0}),jt=s.styled_default("div")({name:"Points",class:"po9i64o",propsAsIs:!1}),vt=s.styled_default("span")({name:"PointsCount",class:"pe5g05h",propsAsIs:!1}),Tt=s.styled_default("span")({name:"PointsUnits",class:"p1hdtpmb",propsAsIs:!1}),At=({title:t,points:i,isPlayingTimer:o,isTimer:c,animatePoints:r,questionType:u,timerDuration:m,votedInCurrentRender:j,percentsAnimated:b,onTimerExpired:h})=>e.jsx(yt,{enabled:u===n.QuestionType.PREDICTION&&j,animate:b,children:e.jsxs(mt,{style:{justifyContent:u===n.QuestionType.PREDICTION?"center":"space-between"},children:[e.jsxs(ht,{children:[t&&e.jsx(ft,{children:t}),i!==void 0&&u!==n.QuestionType.POLL&&e.jsxs(e.Fragment,{children:[e.jsx(It,{name:"icon-trophy"}),e.jsxs(jt,{children:[e.jsx(vt,{children:r?e.jsx(Ie.d,{value:i,delay:.3}):i}),e.jsx(Tt,{children:"PTS"})]})]})]}),c&&u!==n.QuestionType.PREDICTION&&e.jsx(xe.L,{isPlaying:o,onTimerExpired:h,duration:m})]})}),Ct=(t,i)=>{switch(t){case"already_voted":return i===n.QuestionType.POLL?"You’ve already answered this question on another device.":"You’ve already answered this question on another device. So the points for this answer won't tally.";default:return"Something went wrong, please try again"}},$t=()=>e.jsx(Ae,{children:e.jsxs(Ce,{children:[e.jsx(te.i,{loading:!0,style:{height:"40px",borderRadius:"100px"}}),e.jsx(te.i,{loading:!0,style:{height:"24px",margin:"16px 0"}}),e.jsx($e,{children:Array.from({length:5}).map((t,i)=>e.jsx(te.i,{loading:!0,style:{height:"44px"}},i))})]})}),Et=({openedQuestion:t,isLoading:i,vote:o,close:c,isEarlyPrediction:r,mastersApp:u,webos:m})=>{var j,b;const h=t.subject,d=t.type,g=t.status,C=(j=t.options)==null?void 0:j.options,I=t.marketClosed,y=t.id,_=a.useRef(),P=a.useRef(),E=u?!1:(t==null?void 0:t.adUnit)===n.AdUnit.STANDART,[T,q]=a.useState(!1),[Q,S]=a.useState(!1),[w,R]=a.useState(!0),[f,k]=a.useState(!1),[F,Y]=a.useState(!1),[K,D]=a.useState(""),[O,J]=a.useState(""),[N,H]=a.useState(!1),[be,ge]=a.useState(!1),[ae,we]=a.useState(!1),{runAnimation:W,finished:de}=ve();a.useEffect(()=>{de&&c(y)},[c,de]),a.useEffect(()=>{d===n.QuestionType.PREDICTION?I&&R(!1):g===n.QuestionStatus.RESOLVED&&R(!1)},[]);const _e=a.useCallback(p=>{S(p),q(!0)},[]),Pe=a.useCallback(()=>{r&&q(!1)},[r]),X=a.useRef(!1),le=a.useCallback(()=>{P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{we(!0),W({delay:5500})},4e3)},[W]),ce=a.useCallback(async p=>{if(!X.current&&(X.current=!0,y)){const A=p.currentTarget.value;D(A);try{await o(y,A),E&&le()}catch(M){J(Ct(M.message,d)),D(""),console.error("Error while voting",M),X.current=!1}}},[d,y,D,o,E,le]),Qe=a.useCallback(()=>{k(!0),W({delay:3500})},[W]),Re=a.useCallback(()=>{Y(!0),W({delay:3500})},[W]),l=t==null?void 0:t.answers.find(p=>p.youVoted===!0),v=a.useMemo(()=>!!(t!=null&&t.answers.find(p=>p.correct===!0)),[t]),x=a.useMemo(()=>t==null?void 0:t.answers.find(p=>p.correct===!0),[t]);a.useEffect(()=>{l&&T&&!be&&(_.current=setTimeout(Re,1e4),ge(!0))},[l]),a.useEffect(()=>()=>{clearTimeout(_.current),clearTimeout(P.current)},[]);const Z=a.useMemo(()=>t?t.answers.map(p=>{var A;return{...p,questionVoted:!!l,youSelected:K===p.id,isLoading:i,hasCorrectAnswer:v,questionType:t.type,answerTimeExpired:f,questionStatus:g,imageMode:(A=t.appearance)==null?void 0:A.images,onVote:ce}}):[],[v,f,i,t,l,g,ce,K]);a.useEffect(()=>{const p=Z.some(({percentageDecimal:M})=>M!==0),A=l&&d===n.QuestionType.PREDICTION;O&&(r||!p||I&&A)&&H(!0)},[Z,O,r,I,d,l]);const ue=C&&(C.case==="trivia"||C.case==="prediction")?C.value:void 0,V=g===n.QuestionStatus.RESOLVED&&d===n.QuestionType.TRIVIA&&!l&&!w,ee=d===n.QuestionType.TRIVIA&&Q,se=a.useMemo(()=>E?!1:d===n.QuestionType.PREDICTION?r?!1:!!(l&&!v||l&&v&&x!=null&&x.youVoted):!0,[d,l,v,x,r,E]),qe=a.useMemo(()=>{if(d===n.QuestionType.PREDICTION&&l&&(!v||v&&x!=null&&x.youVoted))return l.points;if(!(V||f))return l?l.correct?l.pointsEarned:0:x==null?void 0:x.points},[f,l,x,V,d,v]),Se=a.useMemo(()=>d===n.QuestionType.PREDICTION&&l?v?v&&x!=null&&x.youVoted?"You won":"":"To win":V||f?"Time expired":d===n.QuestionType.POLL?"Time remaining":l?"You won":"To win",[f,d,l,V,v,x]),ke=!se||se&&d===n.QuestionType.PREDICTION&&T&&!N,De=(d===n.QuestionType.TRIVIA||d===n.QuestionType.PREDICTION)&&l&&v&&(x==null?void 0:x.youVoted),Oe=l||V||ee||d===n.QuestionType.TRIVIA&&g===n.QuestionStatus.RESOLVED&&w,Ne=!r&&(f||F)||ae,Ve=()=>{const p=()=>d===n.QuestionType.TRIVIA?l!=null&&l.correct?`That's correct!
2
- You chose wisely.`:`So close!
3
- Better luck next time.`:d===n.QuestionType.POLL?`Thanks for answering.
4
- Please stay tuned for the next question.`:d===n.QuestionType.PREDICTION?"Stay tuned to see if your prediction was correct.":"",A=()=>d===n.QuestionType.TRIVIA?`Your Pick: ${x==null?void 0:x.text}`:d===n.QuestionType.POLL||d===n.QuestionType.PREDICTION?`Your Pick: ${l==null?void 0:l.text}`:"",M=()=>d===n.QuestionType.TRIVIA&&(C==null?void 0:C.case)==="trivia"?C==null?void 0:C.value.explanation:d===n.QuestionType.PREDICTION?h:"";return ae?e.jsx(he,{children:e.jsx(Qs,{title:p(),description:A(),...l!=null&&l.correct||d===n.QuestionType.POLL||d===n.QuestionType.PREDICTION?{icon:"icon-correct"}:{},...d===n.QuestionType.TRIVIA||d===n.QuestionType.PREDICTION?{additionalDescription:M()}:{}})}):!r&&(f||F)?e.jsx(he,{children:e.jsx(us,{icon:"icon-check-circle",title:"More to come...",description:F?e.jsxs(e.Fragment,{children:["Stay tuned for more questions ",e.jsx("br",{})," and insights."]}):e.jsxs(e.Fragment,{children:["Watch for additional enhanced stream ",e.jsx("br",{})," interactive experience."]})})}):null};return e.jsxs(qs,{children:[r&&e.jsx(Ss,{}),e.jsx(Ae,{style:r?{marginTop:"-40px"}:{},children:e.jsxs(Ce,{children:[!r&&!E&&e.jsx(me,{feedbackMessages:ue,questionVoted:!!l,questionVotedCorrectly:l==null?void 0:l.correct,questionType:d,hasCorrectAnswer:v,showExpiredNotification:V,showClosedNotificationTrivia:ee,votedInCurrentRender:T,votedAfterQuestionClosed:Q,enteredAnActiveQuestion:w,marketClosed:I,percentsAnimated:N,voteErrorMessage:O,votedAnswer:l}),se&&e.jsx(At,{title:Se,points:qe,onTimerExpired:Qe,questionType:t.type,isTimer:!i,isPlayingTimer:!l,animatePoints:De,timerDuration:Oe?0:Number(((b=t==null?void 0:t.appearance)==null?void 0:b.autoHideInterval)||"30"),votedInCurrentRender:T,percentsAnimated:N}),Ne?Ve():e.jsxs(e.Fragment,{children:[r&&e.jsxs(Ls,{children:[e.jsx(Fs,{name:"iconEarlyPrediction"}),"EARLY PREDICTION"]}),e.jsx(Os,{style:ke?{marginTop:0}:{},children:h}),r&&e.jsx(me,{feedbackMessages:ue,questionVoted:!!l,questionVotedCorrectly:l==null?void 0:l.correct,questionType:d,hasCorrectAnswer:v,showExpiredNotification:V,showClosedNotificationTrivia:ee,votedInCurrentRender:T,votedAfterQuestionClosed:Q,enteredAnActiveQuestion:w,marketClosed:I,percentsAnimated:N,voteErrorMessage:O,isEarlyPrediction:r,correctAnswer:x,votedAnswer:l,onAnimationEnd:Pe}),e.jsxs(Ns,{children:[e.jsx($e,{children:Z.sort((p,A)=>p.id>A.id?1:-1).map((p,A)=>e.jsx(ut,{...p,firstOption:A===0,markThatVoted:_e,onPercentsAnimated:()=>H(!0),votedAfterQuestionClosed:Q,enteredAnActiveQuestion:w,marketClosed:I,isEarlyPrediction:r,isAd:E,webos:m},p.id))}),r&&e.jsxs(e.Fragment,{children:[e.jsx(ks,{}),e.jsx(Ds,{children:e.jsx(Ms,{name:"mastersLogoWhite"})})]})]})]})]})})]})};exports.C=ze;exports.S=ve;exports.S$1=Ke;exports.a=oe;exports.c=je;exports.d=He;exports.ee=Et;exports.f=re;exports.l=Me;exports.m=We;exports.n=ie;exports.p=Le;exports.te=$t;
1
+ "use strict";const s=require("react/jsx-runtime"),D=require("./index14.js"),e=require("./sl-types.js"),h=require("./index13.js"),_=require("./index12.js"),c=require("./index6.js"),C=require("./useStreamLayerApp2.js"),y=require("react"),q=e.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),N=e.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),P=()=>c.B1,T=e.styled_default(P())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),k=e.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),S=e.styled_default("button")({name:"CloseIconWrap",class:"c1ao1jtv",propsAsIs:!1}),Q=()=>c.B1,O=e.styled_default(Q())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),U=D.O(S,{}),R=({webos:l,type:i,closeTimer:t,close:n,label:p,mastersApp:o})=>{const a=i?_.e[i]:{label:p,iconName:void 0};return s.jsxs(q,{children:[s.jsxs(N,{children:[(a==null?void 0:a.iconName)&&s.jsx(T,{"data-type-trivia":i===C.QuestionType.TRIVIA,"data-type-poll":i===C.QuestionType.POLL,"data-type-prediction":i===C.QuestionType.PREDICTION,"data-masters-app":!!o,name:a.iconName}),(a==null?void 0:a.label)&&s.jsx(k,{children:a.label})]}),t!=null&&t.seconds?s.jsx(h.y,{close:n,autoClose:t.auto,duration:t.seconds}):s.jsx(U,{webos:l,"data-a":"intr",onClick:n,type:"button","data-close-btn":"true",children:s.jsx(O,{"data-a":"intr",name:"icon-cross"})})]})},W="data:image/svg+xml,%3csvg%20width='103'%20height='18'%20viewBox='0%200%20103%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_6919_104497)'%3e%3cpath%20d='M9.89618%203.45801C9.91951%203.45801%209.94451%203.46134%209.96784%203.46134C9.97618%203.46134%209.98284%203.46134%209.99118%203.46467H9.99784C10.0095%203.46467%2010.0212%203.46801%2010.0312%203.46801C10.0412%203.46801%2010.0462%203.46801%2010.0545%203.47134C10.0762%203.47467%2010.0962%203.47467%2010.1178%203.47634C10.1412%203.47967%2010.1662%203.48134%2010.1895%203.48467H10.2012C10.2462%203.48967%2010.2945%203.49634%2010.3395%203.50467C10.4512%203.52467%2010.5595%203.54801%2010.6662%203.57801C10.6928%203.58301%2010.7178%203.59301%2010.7445%203.60134H10.7478C10.7745%203.60967%2010.7995%203.61801%2010.8262%203.62467C10.8528%203.63301%2010.8778%203.64134%2010.9045%203.65134C10.9312%203.65967%2010.9562%203.66801%2010.9795%203.67967C11.0012%203.68801%2011.0212%203.69634%2011.0428%203.70634C11.0495%203.70967%2011.0578%203.71134%2011.0645%203.71467C11.0828%203.72301%2011.1012%203.72967%2011.1195%203.73801C11.1262%203.74134%2011.1312%203.74301%2011.1378%203.74634C11.1562%203.75467%2011.1712%203.76134%2011.1895%203.76967C11.1962%203.77301%2011.2045%203.77467%2011.2128%203.78134C11.2345%203.78967%2011.2528%203.79801%2011.2728%203.80967C11.2762%203.80967%2011.2795%203.81301%2011.2812%203.81301C11.3045%203.82467%2011.3295%203.83634%2011.3512%203.84801C11.3695%203.85634%2011.3878%203.86801%2011.4062%203.87634C11.4212%203.88134%2011.4328%203.89134%2011.4462%203.89967C11.4645%203.91134%2011.4828%203.91967%2011.5012%203.93134C11.5045%203.93467%2011.5078%203.93467%2011.5095%203.93634L11.5728%203.97467H11.5762L15.2178%206.18801L15.4412%206.32467C16.3228%206.90801%2016.9028%207.88467%2016.9028%208.99301C16.9028%2010.1013%2016.3262%2011.0763%2015.4445%2011.6613L15.2095%2011.803L11.5745%2014.0113H11.5712L11.5078%2014.0497C11.5078%2014.0497%2011.5012%2014.053%2011.4995%2014.0547C11.4812%2014.0663%2011.4628%2014.0747%2011.4445%2014.0863C11.4595%2014.078%2011.4745%2014.0697%2011.4895%2014.0597L5.94951%2017.433C5.94951%2017.433%205.94618%2017.433%205.94618%2017.4363L5.74451%2017.558H5.74118C5.19784%2017.863%204.55784%2018.0247%203.87784%2017.993C2.73618%2017.938%201.75784%2017.3463%201.19284%2016.4847C0.837844%2015.9413%200.64451%2015.2913%200.681177%2014.6013C0.71451%2013.983%200.922844%2013.4147%201.26118%2012.9397L1.26951%2012.9247L4.04451%208.99634L6.77784%205.12634C6.81118%205.07967%206.84784%205.03301%206.87784%204.98467C6.87451%204.98967%206.86951%204.99967%206.86284%205.00467C6.87118%204.98967%206.88118%204.97634%206.88951%204.96134C6.88951%204.95801%206.89284%204.95801%206.89284%204.95634C6.89618%204.95301%206.89951%204.94801%206.90118%204.94467C6.90118%204.94467%206.90118%204.94134%206.90451%204.94134C6.91951%204.92134%206.93451%204.90134%206.94618%204.87801C6.96118%204.85801%206.97618%204.83801%206.99118%204.81634C7.00618%204.79634%207.02118%204.77634%207.03618%204.75467C7.03951%204.75134%207.03951%204.74967%207.04284%204.74634C7.04618%204.74301%207.04618%204.74134%207.04951%204.74134C7.06451%204.72134%207.07951%204.70134%207.09784%204.67967C7.10951%204.66467%207.12118%204.65134%207.13451%204.63634C7.16784%204.59801%207.20118%204.56134%207.23784%204.52301C7.25284%204.50801%207.26451%204.49467%207.27951%204.47967C7.30118%204.45634%207.32118%204.43634%207.34618%204.41634C7.36451%204.39967%207.38284%204.38134%207.40118%204.36467C7.41951%204.34801%207.43451%204.33301%207.45284%204.31801C7.45618%204.31467%207.45951%204.31301%207.45951%204.31301C7.47118%204.30134%207.48118%204.29301%207.49284%204.28467C7.50451%204.27301%207.51951%204.26134%207.53284%204.25301C7.53618%204.24967%207.53951%204.24801%207.54118%204.24801C7.55951%204.23301%207.57451%204.21967%207.59284%204.20467C7.60784%204.18967%207.62618%204.17801%207.64118%204.16634C7.65618%204.15467%207.66784%204.14634%207.68284%204.13467C7.70118%204.11967%207.71951%204.10801%207.73784%204.09467C7.75284%204.08634%207.76451%204.07467%207.77951%204.06634C7.78618%204.06134%207.79451%204.05467%207.80284%204.05134C7.81784%204.03967%207.83284%204.03134%207.84784%204.02301C7.85118%204.01967%207.85618%204.01801%207.85951%204.01467C7.87784%204.00301%207.89618%203.99134%207.91118%203.98301C7.91784%203.97801%207.92618%203.97467%207.93284%203.96801C7.94784%203.95967%207.95951%203.95134%207.97451%203.94134C7.98284%203.93634%207.99284%203.92967%208.00118%203.92467C8.01618%203.91634%208.03451%203.90801%208.04951%203.89634C8.05284%203.89301%208.05784%203.89134%208.06451%203.88801C8.08618%203.87634%208.10451%203.86467%208.12451%203.85634C8.12784%203.85301%208.13118%203.85301%208.13618%203.85134C8.15784%203.83967%208.17784%203.82801%208.19951%203.81967C8.19951%203.81967%208.20284%203.81967%208.20284%203.81634C8.22618%203.80467%208.24784%203.79301%208.27284%203.78134C8.27284%203.78134%208.27618%203.78134%208.27618%203.77801C8.29451%203.76967%208.31284%203.76134%208.33284%203.75134C8.34118%203.74801%208.35118%203.74301%208.35951%203.73967C8.37118%203.73467%208.38284%203.72801%208.39618%203.72467C8.41118%203.71967%208.42284%203.71301%208.43784%203.70801C8.46118%203.69967%208.48284%203.69134%208.50784%203.68134C8.52284%203.67634%208.53451%203.66967%208.54951%203.66634C8.57118%203.65801%208.59118%203.65134%208.61284%203.64301C8.63118%203.63801%208.65284%203.63134%208.66951%203.62301C8.75451%203.59634%208.83784%203.57134%208.92284%203.54967C8.94118%203.54467%208.96284%203.54134%208.97951%203.53801C9.08451%203.51467%209.19451%203.49467%209.30284%203.48301C9.32951%203.47967%209.35784%203.47801%209.38451%203.47467C9.42118%203.47134%209.45951%203.46967%209.49618%203.46634C9.51118%203.46634%209.52284%203.46301%209.53784%203.46301H9.55951C9.58951%203.46301%209.61618%203.45967%209.64784%203.45967H9.73784C9.79451%203.45967%209.84284%203.45967%209.89451%203.46301L9.89618%203.45801ZM10.6662%2014.413C10.5612%2014.4413%2010.4512%2014.4647%2010.3395%2014.4863C10.4512%2014.4663%2010.5595%2014.443%2010.6662%2014.413ZM9.56118%2014.5313H9.56951C9.56118%2014.5313%209.54784%2014.5313%209.53951%2014.528C9.54618%2014.528%209.55451%2014.5313%209.56118%2014.5313ZM7.08784%2013.293C7.05451%2013.253%207.02451%2013.2147%206.99451%2013.1747C7.02451%2013.2147%207.05784%2013.253%207.08784%2013.293ZM6.90284%2013.043C6.90284%2013.043%206.90618%2013.0463%206.90618%2013.048C6.90284%2013.0447%206.90284%2013.043%206.89951%2013.0363C6.89618%2013.033%206.89618%2013.0297%206.89284%2013.0247C6.86951%2012.9897%206.84784%2012.953%206.82284%2012.918C6.84451%2012.953%206.86784%2012.9913%206.88951%2013.0247C6.89618%2013.0297%206.89784%2013.0363%206.90118%2013.0413L6.90284%2013.043ZM6.89451%2013.0263C6.85784%2012.968%206.81951%2012.913%206.77618%2012.858L6.89451%2013.0263Z'%20fill='%231652A8'%20style='fill:%231652A8;fill:color(display-p3%200.0863%200.3216%200.6588);fill-opacity:1;'/%3e%3cg%20opacity='0.85'%3e%3cpath%20d='M5.77088%200.453306L5.97588%200.578306L5.97921%200.581639L11.5225%203.94997C11.5075%203.94164%2011.4925%203.93331%2011.4775%203.92331C11.4959%203.93497%2011.5142%203.94331%2011.5325%203.95497C11.5359%203.95831%2011.5392%203.95831%2011.5409%203.95997L11.6042%203.99831H11.6075L15.2492%206.21164L15.4725%206.34831C16.3542%206.93164%2016.9342%207.9083%2016.9342%209.01664C16.9342%2010.125%2016.3575%2011.1%2015.4759%2011.685L15.2409%2011.8266L11.6059%2014.035H11.6025L11.5392%2014.0733C11.5392%2014.0733%2011.5325%2014.0766%2011.5309%2014.0783C11.5125%2014.09%2011.4942%2014.0983%2011.4759%2014.11C11.4642%2014.1183%2011.4492%2014.125%2011.4359%2014.1333C11.4175%2014.145%2011.3992%2014.1533%2011.3809%2014.1616C11.3575%2014.1733%2011.3359%2014.185%2011.3109%2014.1966C11.3075%2014.2%2011.3042%2014.2%2011.3025%2014.2C11.2842%2014.2116%2011.2625%2014.22%2011.2425%2014.2283C11.2359%2014.2316%2011.2275%2014.2333%2011.2192%2014.24C11.2009%2014.2483%2011.1859%2014.255%2011.1675%2014.2633C11.1609%2014.2666%2011.1592%2014.2683%2011.1525%2014.2683C11.1309%2014.2766%2011.1109%2014.285%2011.0859%2014.2966C11.0625%2014.3083%2011.0342%2014.3166%2011.0109%2014.325C10.9875%2014.3333%2010.9592%2014.345%2010.9359%2014.3533C10.9092%2014.3616%2010.8842%2014.37%2010.8575%2014.38C10.8309%2014.3883%2010.8059%2014.3966%2010.7792%2014.4033H10.7759C10.7492%2014.4116%2010.7242%2014.4183%2010.6975%2014.4266C10.5925%2014.455%2010.4825%2014.4783%2010.3709%2014.4983C10.3259%2014.5066%2010.2775%2014.5133%2010.2325%2014.5183C10.2259%2014.5183%2010.2242%2014.5183%2010.2209%2014.5216C10.1975%2014.525%2010.1725%2014.5283%2010.1492%2014.53C10.1009%2014.5366%2010.0525%2014.5383%2010.0042%2014.5416C9.92921%2014.5483%209.85254%2014.5483%209.77754%2014.5483H9.68088C9.65421%2014.5483%209.62921%2014.545%209.60254%2014.545C9.59421%2014.545%209.58088%2014.545%209.57254%2014.5416C9.53254%2014.5383%209.49088%2014.5366%209.45254%2014.5333C9.27421%2014.5166%209.09588%2014.4866%208.92754%2014.4466C8.90421%2014.44%208.87921%2014.435%208.85254%2014.4266C8.81921%2014.4183%208.78588%2014.41%208.74921%2014.3983C8.73088%2014.3933%208.70921%2014.3866%208.69254%2014.3816C8.66588%2014.3733%208.64088%2014.365%208.61421%2014.355C8.58754%2014.3466%208.56254%2014.3383%208.53921%2014.3266C8.51588%2014.3183%208.48754%2014.3066%208.46421%2014.2983C8.44088%2014.29%208.41921%2014.2816%208.39754%2014.27C8.38921%2014.2666%208.38254%2014.265%208.37421%2014.2583C8.35588%2014.25%208.33754%2014.2416%208.31754%2014.2316C8.31754%2014.2316%208.31421%2014.2316%208.31421%2014.2283C8.29088%2014.2166%208.26588%2014.205%208.24254%2014.1933C8.21921%2014.1816%208.19421%2014.17%208.17088%2014.155C8.14754%2014.1433%208.12254%2014.1283%208.10088%2014.1166C8.07754%2014.105%208.05254%2014.09%208.03088%2014.0766C8.00754%2014.0616%207.98588%2014.0483%207.96088%2014.0366C7.93754%2014.0216%207.91588%2014.0083%207.89421%2013.9933C7.87254%2013.9783%207.85254%2013.965%207.83088%2013.95C7.82754%2013.95%207.82754%2013.9466%207.82421%2013.945C7.80588%2013.9333%207.78754%2013.9183%207.76754%2013.905C7.76421%2013.9016%207.76088%2013.9016%207.75921%2013.9C7.74088%2013.885%207.72254%2013.8733%207.70421%2013.86C7.70088%2013.8566%207.69588%2013.855%207.69254%2013.8483C7.67421%2013.8333%207.65588%2013.82%207.63754%2013.805C7.63754%2013.805%207.63421%2013.805%207.63421%2013.8016C7.61588%2013.7866%207.59754%2013.7733%207.57754%2013.755C7.57421%2013.7516%207.57088%2013.7516%207.56921%2013.7483C7.55421%2013.7366%207.53921%2013.7216%207.52421%2013.71C7.51754%2013.705%207.51254%2013.6983%207.50588%2013.695C7.49421%2013.6833%207.47921%2013.6716%207.46588%2013.66C7.43921%2013.6366%207.41421%2013.6133%207.39088%2013.5866C7.37254%2013.57%207.35754%2013.5516%207.33921%2013.535C7.32754%2013.5233%207.31754%2013.5116%207.30588%2013.5C7.29421%2013.4883%207.28421%2013.48%207.27588%2013.4683C7.25754%2013.4516%207.24254%2013.43%207.22421%2013.4133C7.19088%2013.375%207.15754%2013.3383%207.12421%2013.2966C7.09088%2013.2566%207.06088%2013.2183%207.03088%2013.1783C7.01588%2013.1583%207.00088%2013.1383%206.98588%2013.1166C6.97088%2013.0966%206.95588%2013.0766%206.94421%2013.0533C6.94088%2013.05%206.94088%2013.0483%206.93754%2013.0416C6.93421%2013.0383%206.93421%2013.0366%206.93088%2013.03C6.90754%2012.995%206.88588%2012.9583%206.86088%2012.9233C6.88254%2012.9583%206.90588%2012.995%206.92754%2013.03C6.89088%2012.9716%206.85254%2012.9166%206.80921%2012.8616L4.07921%208.99664L1.34088%205.12997L1.23254%204.97664L1.22921%204.97164C0.92421%204.51164%200.737543%203.97497%200.707543%203.39497C0.670877%202.70497%200.86421%202.05164%201.22088%201.50997C1.78588%200.648306%202.76588%200.0566391%203.90421%20-2.75556e-05C4.58421%20-0.0150276%205.22421%200.148306%205.77088%200.453306Z'%20fill='url(%23paint0_linear_6919_104497)'%20style=''/%3e%3c/g%3e%3cpath%20d='M32.4132%2012.862C31.2015%2012.862%2030.4482%2012.0503%2030.4482%2010.7203V8.4453H32.6632V7.02697H30.4482V4.72363L28.8548%205.9053V7.0253H27.9648V8.44363H28.8548V10.7053C28.8548%2012.9953%2030.1982%2014.412%2032.4282%2014.412H32.7682V12.862H32.4132Z'%20fill='%23687C8B'%20style='fill:%23687C8B;fill:color(display-p3%200.4078%200.4863%200.5451);fill-opacity:1;'/%3e%3cpath%20d='M19.9812%2012.5767L21.4028%2011.4651C22.0395%2012.4867%2022.8995%2013.0351%2023.9962%2013.0351C25.1962%2013.0351%2025.9512%2012.2651%2025.9512%2011.3017C25.9512%2010.1901%2024.7662%209.83506%2023.5212%209.43506C22.0545%208.96172%2020.4695%208.36839%2020.4695%206.38339C20.4695%204.73839%2021.9362%203.43506%2023.9362%203.43506C25.5812%203.43506%2026.6028%204.07172%2027.4328%205.03506L26.1145%206.01339C25.6262%205.25839%2024.8995%204.85839%2023.9362%204.85839C22.8395%204.85839%2022.1278%205.51006%2022.1278%206.35506C22.1278%207.39172%2023.2695%207.73339%2024.5128%208.14839C25.9945%208.65172%2027.6095%209.29006%2027.6095%2011.3051C27.6095%2012.9651%2026.2462%2014.5501%2024.0095%2014.5501C22.1578%2014.5501%2020.8978%2013.7651%2019.9795%2012.5801L19.9812%2012.5767Z'%20fill='%23687C8B'%20style='fill:%23687C8B;fill:color(display-p3%200.4078%200.4863%200.5451);fill-opacity:1;'/%3e%3cpath%20d='M38.2695%2010.7367C38.2695%208.56503%2039.9379%206.8667%2042.1095%206.8667C44.2812%206.8667%2045.9062%208.4467%2045.9062%2010.6334V11.2534H39.7912C39.9979%2012.39%2040.8845%2013.1434%2042.1695%2013.1434C43.1745%2013.1434%2043.9429%2012.6117%2044.3262%2011.8134L45.6262%2012.5367C44.9762%2013.7484%2043.8095%2014.545%2042.1695%2014.545C39.8362%2014.545%2038.2695%2012.8767%2038.2695%2010.735V10.7367ZM39.8645%209.91003H44.2962C44.0595%208.8467%2043.2479%208.25503%2042.1095%208.25503C40.9712%208.25503%2040.1595%208.93503%2039.8645%209.91003Z'%20fill='%23687C8B'%20style='fill:%23687C8B;fill:color(display-p3%200.4078%200.4863%200.5451);fill-opacity:1;'/%3e%3cpath%20d='M33.7549%2010.72C33.7549%208.42999%2035.0982%207.02832%2037.3282%207.02832H38.0366V8.56499H37.3132C36.1016%208.56499%2035.3199%209.40665%2035.3349%2010.7367V14.415H33.7549V10.7233V10.72Z'%20fill='%23687C8B'%20style='fill:%23687C8B;fill:color(display-p3%200.4078%200.4863%200.5451);fill-opacity:1;'/%3e%3cpath%20d='M46.6882%2010.7218C46.6882%208.56517%2048.3865%206.88184%2050.5132%206.88184C52.6399%206.88184%2054.3082%208.56517%2054.3082%2010.7218V14.4135H52.7582V13.4535C52.2415%2014.1468%2051.4432%2014.5468%2050.4682%2014.5468C48.3565%2014.5468%2046.6865%2012.8935%2046.6865%2010.7218H46.6882ZM52.7882%2010.7218C52.7882%209.40684%2051.7832%208.3585%2050.5132%208.3585C49.2432%208.3585%2048.2382%209.40684%2048.2382%2010.7218C48.2382%2012.0368%2049.2282%2013.0852%2050.5132%2013.0852C51.7982%2013.0852%2052.7882%2012.0218%2052.7882%2010.7218Z'%20fill='%23687C8B'%20style='fill:%23687C8B;fill:color(display-p3%200.4078%200.4863%200.5451);fill-opacity:1;'/%3e%3cpath%20d='M55.3027%2010.2717C55.3027%208.30667%2056.6461%206.875%2058.6411%206.875C59.7777%206.875%2060.6944%207.33333%2061.2694%208.10167C61.8161%207.33333%2062.7027%206.875%2063.8394%206.875C65.8477%206.875%2067.2511%208.27833%2067.2511%2010.2717V14.4067H65.6711V10.2867C65.6711%209.165%2064.9177%208.38167%2063.8394%208.38167C62.7611%208.38167%2062.0527%209.18%2062.0677%2010.2433V14.4083H60.4877V10.2883C60.4877%209.16667%2059.7194%208.38333%2058.6411%208.38333C57.5627%208.38333%2056.8694%209.18167%2056.8827%2010.245V14.41H55.3027V10.275V10.2717Z'%20fill='%23687C8B'%20style='fill:%23687C8B;fill:color(display-p3%200.4078%200.4863%200.5451);fill-opacity:1;'/%3e%3cpath%20d='M68.2646%203.62695H69.8746V12.872H74.2313V14.4086H68.2646V3.62695Z'%20fill='%23687C8B'%20style='fill:%23687C8B;fill:color(display-p3%200.4078%200.4863%200.5451);fill-opacity:1;'/%3e%3cpath%20d='M89.418%2010.7367C89.418%208.56503%2091.0863%206.8667%2093.258%206.8667C95.4296%206.8667%2097.0546%208.4467%2097.0546%2010.6334V11.2534H90.9396C91.1463%2012.39%2092.033%2013.1434%2093.318%2013.1434C94.323%2013.1434%2095.0913%2012.6117%2095.4746%2011.8134L96.7746%2012.5367C96.1246%2013.7484%2094.958%2014.545%2093.318%2014.545C90.9846%2014.545%2089.418%2012.8767%2089.418%2010.735V10.7367ZM91.013%209.91003H95.4446C95.208%208.8467%2094.3963%208.25503%2093.258%208.25503C92.1196%208.25503%2091.308%208.93503%2091.013%209.91003Z'%20fill='%23687C8B'%20style='fill:%23687C8B;fill:color(display-p3%200.4078%200.4863%200.5451);fill-opacity:1;'/%3e%3cpath%20d='M74.4948%2010.7218C74.4948%208.56517%2076.1932%206.88184%2078.3198%206.88184C80.4465%206.88184%2082.1148%208.56517%2082.1148%2010.7218V14.4135H80.5648V13.4535C80.0482%2014.1468%2079.2498%2014.5468%2078.2748%2014.5468C76.1632%2014.5468%2074.4932%2012.8935%2074.4932%2010.7218H74.4948ZM80.5948%2010.7218C80.5948%209.40684%2079.5898%208.3585%2078.3198%208.3585C77.0498%208.3585%2076.0448%209.40684%2076.0448%2010.7218C76.0448%2012.0368%2077.0348%2013.0852%2078.3198%2013.0852C79.6048%2013.0852%2080.5948%2012.0218%2080.5948%2010.7218Z'%20fill='%23687C8B'%20style='fill:%23687C8B;fill:color(display-p3%200.4078%200.4863%200.5451);fill-opacity:1;'/%3e%3cpath%20d='M85.0381%2014.0498L81.9814%207.0498H83.6798L85.8364%2012.1748L87.8748%207.0498H89.5431L85.0831%2017.8465H83.4581L85.0381%2014.0515V14.0498Z'%20fill='%23687C8B'%20style='fill:%23687C8B;fill:color(display-p3%200.4078%200.4863%200.5451);fill-opacity:1;'/%3e%3cpath%20d='M98.041%2010.7151C98.041%208.4251%2099.3843%207.02344%20101.614%207.02344H102.323V8.5601H101.599C100.388%208.5601%2099.606%209.40177%2099.621%2010.7318V14.4101H98.041V10.7184V10.7151Z'%20fill='%23687C8B'%20style='fill:%23687C8B;fill:color(display-p3%200.4078%200.4863%200.5451);fill-opacity:1;'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_6919_104497'%20x1='4.31754'%20y1='8.70664'%20x2='13.6359'%20y2='3.59497'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0.2'%20stop-color='%231589EE'%20style='stop-color:%231589EE;stop-color:color(display-p3%200.0824%200.5373%200.9333);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%235EB4FF'%20style='stop-color:%235EB4FF;stop-color:color(display-p3%200.3686%200.7059%201.0000);stop-opacity:1;'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_6919_104497'%3e%3crect%20width='101.648'%20height='18'%20fill='white'%20style='fill:white;fill-opacity:1;'%20transform='translate(0.675781)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",v=e.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),F=()=>c.B1,z=e.styled_default(F())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),G=e.styled_default("img")({name:"AdSponsorLogo",class:"a1dflj8e",propsAsIs:!1}),J=({mastersApp:l,sponsorLogo:i})=>l?s.jsx(v,{children:s.jsx(z,{name:"mastersLogo"})}):i?s.jsx(v,{children:s.jsx(G,{src:i,alt:"ad-sponsor-logo"})}):s.jsx(v,{children:s.jsx("img",{src:W,alt:"stream-layer-logo"})}),K=e.styled_default("div")({name:"Container",class:"cq8qxhy",propsAsIs:!1}),X=e.styled_default("div")({name:"VideoWrapper",class:"v18kj6dc",propsAsIs:!1}),Y=()=>h.Et,l2=e.styled_default(Y())({name:"FocusableVideo",class:"fv2nwib",propsAsIs:!0}),I=e.styled_default("div")({name:"VideoStatus",class:"v8ptucg",propsAsIs:!1}),A="caip8y5",s2=e.styled_default("div")({name:"Content",class:"ccgc65e",propsAsIs:!1}),e2=e.styled_default("h3")({name:"Title",class:"t1q3iml2",propsAsIs:!1}),i2=e.styled_default("div")({name:"Description",class:"d1y2pxs8",propsAsIs:!1}),t2=e.styled_default("img")({name:"Image",class:"ig2j4fc",propsAsIs:!1}),a2=e.styled_default("div")({name:"ImageContainer",class:"i3dd6iy",propsAsIs:!1}),C2=({instantView:l,isDetail:i,notification:t,controlVideo:n,muted:p})=>{var o,a;const r=y.useRef(null),[u,d]=y.useState(!1),[f,m]=y.useState(void 0),x=(l==null?void 0:l.playVideoMuted)===C.PlayVideoMuted.ENABLED,b=i&&(l==null?void 0:l.autoPlayVideo)===C.AutoPlayVideo.ENABLED,M=x&&b,L=l==null?void 0:l.heading,V=l==null?void 0:l.body,j=L||V,[g,w]=y.useState(!0),$=t==null?void 0:t.title,E=t==null?void 0:t.body;return s.jsxs(K,{children:[((o=l==null?void 0:l.video)==null?void 0:o.url)&&s.jsxs(X,{children:[s.jsx(l2,{className:A,source:l.video.url,poster:l.video.thumbnailUrl,controlVideo:n,muted:p,autoPlay:i&&l.autoPlayVideo===C.AutoPlayVideo.ENABLED,ref:r,onPause:()=>{d==null||d(!0),w(!1)},onMute:Z=>{m(Z)},onPlay:()=>{d==null||d(!1)},playMuted:x,hasNotPausedVideo:g,webos:!0}),u&&!g&&s.jsxs(I,{children:[s.jsx(c.B1,{name:"icon-pause"}),"PAUSED"]}),f&&M&&s.jsxs(I,{children:[s.jsx(c.B1,{name:"iconMute"}),"MUTED"]})]}),(l==null?void 0:l.image)&&!((a=l==null?void 0:l.video)!=null&&a.url)&&s.jsx(a2,{className:A,"data-rounded":l.imageMode===C.QuestionImages.ROUNDED,children:s.jsx(t2,{src:l==null?void 0:l.image})}),s.jsxs(s2,{children:[s.jsx(e2,{children:i&&j?L:$}),s.jsx(i2,{children:i&&j?V:E})]})]})},o2=e.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),H="c1px8nt6",d2=e.styled_default("div")({name:"Content",class:"c5et2jt",propsAsIs:!1}),n2=e.styled_default("h3")({name:"Title",class:"t1i2kpk2",propsAsIs:!1}),c2=e.styled_default("div")({name:"Description",class:"dd3lh3p",propsAsIs:!1}),p2=e.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),r2=e.styled_default("div")({name:"ImageContainer",class:"i58y999",propsAsIs:!1}),B=({instantView:l,isDetail:i,notification:t,controlVideo:n,muted:p})=>{var o,a;const r=l==null?void 0:l.heading,u=l==null?void 0:l.body,d=r||u,f=t==null?void 0:t.title,m=t==null?void 0:t.body;return s.jsxs(o2,{children:[((o=l==null?void 0:l.video)==null?void 0:o.url)&&s.jsx(h.Et,{className:H,source:l.video.url,poster:l.video.thumbnailUrl,controlVideo:n,muted:p,autoPlay:i&&l.autoPlayVideo===C.AutoPlayVideo.ENABLED}),(l==null?void 0:l.image)&&!((a=l==null?void 0:l.video)!=null&&a.url)&&s.jsx(r2,{className:H,"data-rounded":l.imageMode===C.QuestionImages.ROUNDED,children:s.jsx(p2,{src:l==null?void 0:l.image})}),s.jsxs(d2,{children:[s.jsx(n2,{children:i&&d?r:f}),s.jsx(c2,{children:i&&d?u:m})]})]})},u2=e.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),y2=e.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),f2=()=>c.B1,m2=e.styled_default(f2())({name:"WebLinkIcon",class:"wyg5v7z",propsAsIs:!0}),v2=({instantView:l,...i})=>s.jsxs(u2,{children:[i.SL-CardWebOs?s.jsx(C2,{instantView:l,...i,isDetail:!0}):s.jsx(B,{instantView:l,...i,isDetail:!0}),(l==null?void 0:l.webLink)&&s.jsxs(y2,{href:l==null?void 0:l.webLink.url,target:"_blank","data-a":"web-link",children:[l==null?void 0:l.webLink.label,s.jsx(m2,{name:"icon-external-link"})]})]}),h2=e.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),x2=e.styled_default("blockquote")({name:"Quote",class:"qb4q22c",propsAsIs:!1}),L2=l=>s.jsxs(h2,{children:[l.title&&s.jsx(x2,{children:l.title}),s.jsx(_.b,{...l,isDetail:!0})]});exports.O=B;exports.a=L2;exports.d=J;exports.u=v2;exports.y=R;