@streamlayer/react 1.22.2 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/lib/cjs/Question.js +1 -1
  2. package/lib/cjs/advertisement.js +44 -40
  3. package/lib/cjs/analytics.js +1 -1
  4. package/lib/cjs/index-eShKGO10.js +5 -0
  5. package/lib/cjs/index.js +1 -1
  6. package/lib/cjs/index10.js +4 -1
  7. package/lib/cjs/index11.js +1 -4
  8. package/lib/cjs/index12.js +1 -1
  9. package/lib/cjs/index13.js +1 -1
  10. package/lib/cjs/index14.js +1 -1
  11. package/lib/cjs/index15.js +5 -1
  12. package/lib/cjs/index2.js +1 -1
  13. package/lib/cjs/index4.js +1 -1
  14. package/lib/cjs/index7.js +1 -5
  15. package/lib/cjs/index8.js +1 -1
  16. package/lib/cjs/index9.js +1 -1
  17. package/lib/cjs/insight.js +1 -1
  18. package/lib/cjs/masters2.js +5 -5
  19. package/lib/cjs/notification.js +1 -1
  20. package/lib/cjs/pause-ad.js +1 -1
  21. package/lib/cjs/points.js +1 -1
  22. package/lib/cjs/storage.js +1 -1
  23. package/lib/cjs/useStreamLayerApp2.js +17 -17
  24. package/lib/classic/cjs/Question.js +1 -1
  25. package/lib/classic/cjs/advertisement.js +44 -40
  26. package/lib/classic/cjs/analytics.js +1 -1
  27. package/lib/classic/cjs/bet-pack.js +1 -1
  28. package/lib/classic/cjs/index-eShKGO10.js +5 -0
  29. package/lib/classic/cjs/index.js +1 -1
  30. package/lib/classic/cjs/index10.js +1 -1
  31. package/lib/classic/cjs/index11.js +1 -1
  32. package/lib/classic/cjs/index12.js +4 -1
  33. package/lib/classic/cjs/index2.js +2 -2
  34. package/lib/classic/cjs/index3.js +1 -1
  35. package/lib/classic/cjs/index4.js +1 -1
  36. package/lib/classic/cjs/index5.js +1 -1
  37. package/lib/classic/cjs/index6.js +1 -5
  38. package/lib/classic/cjs/index7.js +1 -1
  39. package/lib/classic/cjs/index8.js +1 -1
  40. package/lib/classic/cjs/index9.js +1 -1
  41. package/lib/classic/cjs/insight.js +1 -1
  42. package/lib/classic/cjs/notification.js +1 -1
  43. package/lib/classic/cjs/notification2.js +1 -1
  44. package/lib/classic/cjs/pause-ad.js +1 -1
  45. package/lib/classic/cjs/points.js +1 -1
  46. package/lib/classic/cjs/useStreamLayerApp2.js +17 -17
  47. package/lib/classic/es/Question.js +53 -53
  48. package/lib/classic/es/advertisement.js +15547 -10742
  49. package/lib/classic/es/analytics.js +74 -18
  50. package/lib/classic/es/bet-pack.js +4 -4
  51. package/lib/classic/es/index-eShKGO10.js +3757 -0
  52. package/lib/classic/es/index.js +1 -1
  53. package/lib/classic/es/index10.js +2295 -82
  54. package/lib/classic/es/index11.js +179 -2357
  55. package/lib/classic/es/index12.js +822 -170
  56. package/lib/classic/es/index2.js +13 -14
  57. package/lib/classic/es/index3.js +16 -61
  58. package/lib/classic/es/index4.js +282 -16
  59. package/lib/classic/es/index5.js +5 -283
  60. package/lib/classic/es/index6.js +9 -3756
  61. package/lib/classic/es/index7.js +62 -5
  62. package/lib/classic/es/index8.js +315 -7
  63. package/lib/classic/es/index9.js +81 -313
  64. package/lib/classic/es/insight.js +1 -1
  65. package/lib/classic/es/notification.js +1 -1
  66. package/lib/classic/es/notification2.js +476 -452
  67. package/lib/classic/es/pause-ad.js +174 -208
  68. package/lib/classic/es/points.js +4 -4
  69. package/lib/classic/es/useStreamLayerApp2.js +5062 -4028
  70. package/lib/dist/cjs/index-eShKGO10.js +5 -0
  71. package/lib/dist/cjs/masters.js +35 -35
  72. package/lib/dist/es/index-eShKGO10.js +3757 -0
  73. package/lib/dist/es/masters.js +9267 -8240
  74. package/lib/dist/index.d.ts +13 -1
  75. package/lib/dist/style.css +1 -1
  76. package/lib/es/Question.js +4 -4
  77. package/lib/es/advertisement.js +15547 -10742
  78. package/lib/es/analytics.js +74 -18
  79. package/lib/es/index-eShKGO10.js +3757 -0
  80. package/lib/es/index.js +1 -1
  81. package/lib/es/index10.js +804 -236
  82. package/lib/es/index11.js +170 -822
  83. package/lib/es/index12.js +302 -166
  84. package/lib/es/index13.js +81 -313
  85. package/lib/es/index14.js +2350 -82
  86. package/lib/es/index15.js +1229 -2330
  87. package/lib/es/index2.js +10 -11
  88. package/lib/es/index4.js +2 -2
  89. package/lib/es/index7.js +5 -3756
  90. package/lib/es/index8.js +9 -5
  91. package/lib/es/index9.js +263 -7
  92. package/lib/es/insight.js +1 -1
  93. package/lib/es/masters2.js +15 -16
  94. package/lib/es/notification.js +449 -425
  95. package/lib/es/pause-ad.js +174 -208
  96. package/lib/es/points.js +1 -1
  97. package/lib/es/storage.js +2 -2
  98. package/lib/es/useStreamLayerApp2.js +5062 -4028
  99. package/lib/style.css +1 -1
  100. package/package.json +17 -16
  101. package/lib/cjs/index-DSi8Qgfs.js +0 -1
  102. package/lib/cjs/index16.js +0 -5
  103. package/lib/cjs/vast-client.min.js +0 -1
  104. package/lib/classic/cjs/index-DSi8Qgfs.js +0 -1
  105. package/lib/classic/cjs/index13.js +0 -4
  106. package/lib/classic/cjs/vast-client.min.js +0 -1
  107. package/lib/classic/es/index-DSi8Qgfs.js +0 -65
  108. package/lib/classic/es/index13.js +0 -835
  109. package/lib/classic/es/vast-client.min.js +0 -1060
  110. package/lib/es/index-DSi8Qgfs.js +0 -65
  111. package/lib/es/index16.js +0 -1254
  112. package/lib/es/vast-client.min.js +0 -1060
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),cs=require("./index8.js"),x=require("react"),t=require("./sl-types.js"),us=require("./index3.js"),z=require("./storage.js"),A=require("./index12.js"),y=require("./index6.js"),r=require("./useStreamLayerApp2.js"),k=require("./index14.js"),F=require("./index13.js"),ps=require("./index5.js"),b=require("./hooks-B0Qttldg.js"),h=t.styled_default("div")({name:"Media",class:"m1bcvojl",propsAsIs:!1}),ms=()=>h,xs=t.styled_default(ms())({name:"MediaImgBottom",class:"m58gin0",propsAsIs:!0}),ys=()=>h,C=t.styled_default(ys())({name:"MediaImgSolid",class:"m1atm8do",propsAsIs:!0}),vs=()=>h,fs=t.styled_default(vs())({name:"MediaImgRounded",class:"myx3xoi",propsAsIs:!0}),js=()=>h,Is=t.styled_default(js())({name:"MediaImgCentered",class:"m1bwv0gx",propsAsIs:!0}),As=()=>h,hs=t.styled_default(As())({name:"MediaImgInsight",class:"mntjanp",propsAsIs:!0}),$s=t.styled_default("div")({name:"VideoIcon",class:"v1kofb47",propsAsIs:!1}),gs={[r.QuestionImages.UNSET]:C,[r.QuestionImages.NONE]:C,[r.QuestionImages.ROUNDED]:fs,[r.QuestionImages.CENTERED]:Is,[r.QuestionImages.TRANSPARENT]:xs,[r.QuestionImages.SOLID]:C},E=({src:e,imageMode:o=r.QuestionImages.UNSET,withVideo:i,fromInsight:n})=>{if(o===r.QuestionImages.NONE)return null;const l=n?hs:gs[o];return s.jsxs(l,{children:[s.jsx("img",{src:e,alt:""}),i&&s.jsx($s,{children:s.jsx(y.B1,{name:"icon-play"})})]})},_s=t.styled_default("div")({name:"NotificationContent",class:"nuraq9m",propsAsIs:!1}),ws=t.styled_default("div")({name:"NotificationContainer",class:"ns1nzpg",propsAsIs:!1}),V=t.styled_default("div")({name:"Body",class:"b1j59nzs",propsAsIs:!1}),Ts=t.styled_default("div")({name:"Title",class:"t9vmnpp",propsAsIs:!1}),bs=t.styled_default("button")({name:"Button",class:"b14ivj5k",propsAsIs:!1}),Cs=()=>y.B1,Ns=t.styled_default(Cs())({name:"StyledChevronRight",class:"s1atci8n",propsAsIs:!0}),ks=t.styled_default("div")({name:"QuoteWrap",class:"q4w8jgs",propsAsIs:!1}),qs=t.styled_default("blockquote")({name:"Quote",class:"qaa0kez",propsAsIs:!1}),Ss=t.styled_default("div")({name:"Body",class:"b1wvd52w",propsAsIs:!1}),Es=t.styled_default("div")({name:"Container",class:"ccvukea",propsAsIs:!1}),Ls=({image:e,tweet:o,account:i,accountVerified:n,body:l,title:u})=>{var c;return s.jsxs(Es,{children:[u&&s.jsx(ks,{children:s.jsx(qs,{children:u})}),s.jsx(A.D,{image:e,name:(c=o==null?void 0:o.meta)==null?void 0:c.accountName,userName:i,verified:n,createdTweet:o==null?void 0:o.date}),s.jsx(Ss,{children:A.D$1(l)})]})},Ms=({title:e,questionType:o,questionTypeData:i})=>s.jsxs(V,{children:[s.jsx(z.x,{questionTypeData:i,questionType:o,questionStatus:r.QuestionStatus.UNSET}),e&&s.jsx(Ts,{children:e})]}),Ds=({tweet:e})=>e?s.jsx(V,{children:s.jsx(Ls,{...e,controlVideo:()=>{}})}):null,Bs=({action:e,questionType:o,inApp:i,insight:n,tweet:l})=>{var u;const c=A.e[o],a=A.o[o];if(!c||!i||!i.notification)return null;const{title:p,image:m,imageMode:f}=i.notification;let v=m;o===r.QuestionType.TWEET&&l!=null&&l.tweetMedia&&(v=l.tweetMedia.image),f===r.QuestionImages.NONE&&(v="");const j=i.useMediaFromContent&&(n==null?void 0:n.image),d=o===r.QuestionType.TWEET&&((u=l==null?void 0:l.tweetMedia)==null?void 0:u.video)||o===r.QuestionType.FACTOID&&(n==null?void 0:n.video);return s.jsx(ws,{"data-a":"intr",className:"SL_InApp",onClick:e,children:s.jsxs(_s,{style:v?{}:{paddingLeft:"1.5rem"},children:[v&&!j&&s.jsx(E,{src:v,imageMode:f,withVideo:!!d}),j&&s.jsx(E,{src:j,fromInsight:!0,withVideo:!!d}),o===r.QuestionType.TWEET?s.jsx(Ds,{tweet:l}):s.jsx(Ms,{questionTypeData:c,questionType:o,title:p}),s.jsx(bs,{name:"inapp-button",children:a||"Open"}),s.jsx(Ns,{name:"chevronRight"})]})})},Qs=()=>({color:e})=>e||"transparent",L=t.styled_default("div")({name:"MediaComponentWrap",class:"mek728j",propsAsIs:!1,vars:{"mek728j-0":[Qs()]}}),I=t.styled_default("div")({name:"Media",class:"m461t56",propsAsIs:!1}),Rs=()=>I,Os=t.styled_default(Rs())({name:"MediaImgBottom",class:"m22bh04",propsAsIs:!0}),Ps=()=>I,Us=t.styled_default(Ps())({name:"MediaVideo",class:"m17u1e34",propsAsIs:!0}),zs=()=>I,Fs=t.styled_default(zs())({name:"MediaImgContentMedia",class:"m4j3eds",propsAsIs:!0}),Vs=()=>I,Ws=t.styled_default(Vs())({name:"MediaImgSolid",class:"m1lp3swr",propsAsIs:!0}),Ys=()=>I,Ks=t.styled_default(Ys())({name:"MediaImgRounded",class:"mc7lij",propsAsIs:!0}),Gs=()=>I,Hs=t.styled_default(Gs())({name:"MediaImgCentered",class:"mwwaw7o",propsAsIs:!0}),Js=()=>I,N=t.styled_default(Js())({name:"MediaNone",class:"mqfzyyr",propsAsIs:!0}),Xs="v170mtgf",Zs={[r.QuestionImages.UNSET]:N,[r.QuestionImages.NONE]:N,[r.QuestionImages.ROUNDED]:Ks,[r.QuestionImages.CENTERED]:Hs,[r.QuestionImages.TRANSPARENT]:Os,[r.QuestionImages.SOLID]:Ws},M=({src:e,imageMode:o=r.QuestionImages.UNSET,withVideo:i,color:n,useContentMedia:l,thumbnailUrl:u})=>{if(!e)return s.jsx(L,{color:n,children:s.jsx(N,{})});const c=l===r.NotificationUseContentMedia.ENABLED?Fs:Zs[o];return s.jsx(L,{color:n,children:i?s.jsx(Us,{children:s.jsx(F.Et,{className:Xs,source:e,poster:u||""})}):s.jsx(c,{children:s.jsx("img",{src:e,alt:""})})})},se=()=>({withoutPadding:e})=>e?"0px":"1rem",W=t.styled_default("div")({name:"NotificationContent",class:"n1p3bk1c",propsAsIs:!1,vars:{"n1p3bk1c-0":[se()]}}),ee=t.styled_default("div")({name:"MainContent",class:"m1g211mu",propsAsIs:!1}),te=()=>y.B1,ne=t.styled_default(te())({name:"StyledChevronRight",class:"sx1hq4c",propsAsIs:!0}),Y=t.styled_default("div")({name:"NotificationContainer",class:"n1fcriet",propsAsIs:!1}),oe=()=>({questionType:e})=>e===r.QuestionType.FACTOID?"7.3rem":"4.5rem",ie=()=>({webos:e})=>e?"11px 0px 8px 0px":"11px 0px",le=()=>({imageMode:e,webos:o})=>o?"330px":e===r.QuestionImages.SOLID?"310px":e===r.QuestionImages.CENTERED||e===r.QuestionImages.ROUNDED||e===r.QuestionImages.TRANSPARENT?"370px":"430px",ae=t.styled_default("div")({name:"Body",class:"b1byyovs",propsAsIs:!1,vars:{"b1byyovs-0":[oe()],"b1byyovs-1":[ie()],"b1byyovs-2":[le()]}}),de=()=>({webos:e})=>e?"0.85rem":"1.033rem",re=()=>({webos:e})=>e?"0.95rem":"1.25rem",ce=()=>({webos:e})=>e?"4.7rem":"2.25rem",ue=()=>({webos:e})=>e?"pre-wrap":"nowrap",pe=t.styled_default("div")({name:"Title",class:"t1y5k5id",propsAsIs:!1,vars:{"t1y5k5id-0":[de()],"t1y5k5id-1":[re()],"t1y5k5id-2":[ce()],"t1y5k5id-3":[ue()]}}),me=t.styled_default("div")({name:"Description",class:"dw9eb7l",propsAsIs:!1}),xe=t.styled_default("div")({name:"LogoImgContainer",class:"ldu8wgy",propsAsIs:!1}),K=t.styled_default("img")({name:"LogoImg",class:"ln4a3eh",propsAsIs:!1}),ye=()=>Y,ve=t.styled_default(ye())({name:"NotificationInterstitialContainer",class:"no2k63v",propsAsIs:!0}),fe=t.styled_default("div")({name:"TVButtons",class:"th9nn6a",propsAsIs:!1}),G=t.styled_default("button")({name:"TVButton",class:"t1eee77p",propsAsIs:!1}),je=()=>G,Ie=t.styled_default(je())({name:"DismissButton",class:"ds000hw",propsAsIs:!0}),Ae=()=>G,he=t.styled_default(Ae())({name:"AnswerButton",class:"a1nz9hoe",propsAsIs:!0}),$e=({title:e,questionType:o,questionTypeData:i,description:n,imageMode:l,webos:u})=>s.jsxs(ae,{imageMode:l,questionType:o,webos:u,children:[s.jsx(z.x,{questionTypeData:i,questionType:o,questionStatus:r.QuestionStatus.UNSET}),e&&s.jsx(pe,{webos:u,children:e}),n&&s.jsx(me,{children:n})]}),ge=k.O(ve),_e=k.O(Ie),we=k.O(he),Te=({sponsorLogo:e,onClick:o,webos:i})=>s.jsx(ge,{autoFocus:!0,webos:i,onClick:o,"data-webos":i,children:s.jsx(W,{withoutPadding:!0,children:s.jsx(K,{src:e})})}),be=({action:e,close:o,questionType:i,inApp:n,insight:l,color:u,webos:c})=>{var a,p,m;const[f,v]=x.useState(!1),j=x.useRef();x.useEffect(()=>(n!=null&&n.sponsorLogo&&(v(!0),j.current=setTimeout(()=>{v(!1)},5e3)),()=>clearTimeout(j.current)),[n==null?void 0:n.sponsorLogo]);const d=A.e[i];if(!d||!n||!n.notification)return null;const{title:is,image:ls,imageMode:g,useContentMedia:_}=n.notification,as=i===r.QuestionType.FACTOID?l==null?void 0:l.heading:is,ds=i===r.QuestionType.FACTOID?l==null?void 0:l.body:"",rs=ls,w=i===r.QuestionType.FACTOID&&((a=l==null?void 0:l.video)==null?void 0:a.url)&&(n==null?void 0:n.isVideo)&&_===r.NotificationUseContentMedia.ENABLED,T=_===r.NotificationUseContentMedia.ENABLED?w?(p=l==null?void 0:l.video)==null?void 0:p.url:l==null?void 0:l.image:"";return n!=null&&n.sponsorLogo&&f?s.jsx(Te,{sponsorLogo:n==null?void 0:n.sponsorLogo,webos:c,onClick:()=>v(!1)}):s.jsxs(Y,{"data-a":"intr",className:"SL_InApp",onClick:$=>{c||e==null||e($)},"data-is-insight":i===r.QuestionType.FACTOID,"data-webos":c,children:[(n==null?void 0:n.sponsorLogo)&&s.jsx(xe,{children:s.jsx(K,{src:n==null?void 0:n.sponsorLogo})}),s.jsxs(W,{children:[s.jsxs(ee,{children:[!T&&s.jsx(M,{src:rs,imageMode:g,withVideo:!!w,color:u}),T&&s.jsx(M,{src:T,imageMode:g,withVideo:!!w,color:u,useContentMedia:_,thumbnailUrl:(m=l==null?void 0:l.video)==null?void 0:m.thumbnailUrl}),s.jsx($e,{questionTypeData:d,questionType:i,title:as,description:ds,imageMode:g,webos:c})]}),!c&&s.jsx(ne,{name:"chevronRight"}),c&&s.jsxs(fe,{children:[s.jsx(_e,{webos:!0,"data-close-btn":"true",onClick:$=>{$.stopPropagation(),o==null||o($)},children:"Dismiss"}),s.jsx(we,{webos:!0,autoFocus:!0,onClick:e,children:"Answer"})]})]})]})},Ce=t.styled_default("div")({name:"NotificationContainer",class:"n11jcrxe",propsAsIs:!1}),D=t.styled_default("img")({name:"Icon",class:"i1vmpt6u",propsAsIs:!1}),Ne=t.styled_default("div")({name:"IconContainer",class:"i180665s",propsAsIs:!1}),ke=()=>y.B1,qe=t.styled_default(ke())({name:"TitleIcon",class:"t16zzzei",propsAsIs:!0}),Se=()=>F.y,Ee=t.styled_default(Se())({name:"Close",class:"c1sur0q2",propsAsIs:!0}),Le=t.styled_default("div")({name:"Body",class:"bai9j52",propsAsIs:!1}),Me=t.styled_default("div")({name:"Title",class:"t1bnt25p",propsAsIs:!1}),De=t.styled_default("div")({name:"Description",class:"dmixjec",propsAsIs:!1}),Be=t.styled_default("button")({name:"Button",class:"b1ubkw1q",propsAsIs:!1}),Qe=({open:e,close:o,...i})=>{var n,l;return s.jsxs(Ce,{"data-a":"intr",onClick:()=>{e==null||e(),i&&i.markIstantOpen()},children:[s.jsxs(Ne,{children:[s.jsx(D,{className:"on-light",src:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification.png"}),s.jsx(D,{className:"on-dark",src:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification-dark.png"})]}),s.jsxs(Le,{children:[s.jsxs(Me,{children:[s.jsx(qe,{name:"icon-trophy-solid"}),(n=i==null?void 0:i.titleCard)==null?void 0:n.title]}),s.jsxs(De,{children:[s.jsx("span",{children:(l=i==null?void 0:i.titleCard)==null?void 0:l.subtitle}),s.jsx(Be,{name:"inapp-button",children:"Play Now"})]})]}),s.jsx(Ee,{close:u=>{u==null||u.stopPropagation(),o==null||o()}})]})},Re=t.styled_default("div")({name:"Container",class:"cef8huz",propsAsIs:!1}),Oe=()=>y.B1,Pe=t.styled_default(Oe())({name:"CheckIcon",class:"c1mo15kk",propsAsIs:!0}),Ue=()=>y.B1,ze=t.styled_default(Ue())({name:"PredictionIcon",class:"p16zkqnm",propsAsIs:!0}),Fe=t.styled_default("div")({name:"PredictionIconContainer",class:"pjszi7a",propsAsIs:!1}),Ve=t.styled_default("div")({name:"BodyContainer",class:"bftbmo3",propsAsIs:!1}),We=t.styled_default("div")({name:"Body",class:"barrbyu",propsAsIs:!1}),Ye=t.styled_default("div")({name:"Subtitle",class:"sz7237i",propsAsIs:!1}),Ke=({step:e,children:o,answer:i,state:n="pending"})=>{const[l,u]=x.useState(0),[c]=x.useState(()=>new ResizeObserver(p=>{window.requestAnimationFrame(()=>{var m,f;u(((f=(m=p==null?void 0:p[0])==null?void 0:m.contentRect)==null?void 0:f.width)??0)})})),a=x.useCallback(p=>{p?c.observe(p):c.disconnect()},[c]);return x.useEffect(()=>()=>{c.disconnect()},[c]),s.jsxs(Re,{children:[s.jsx(Fe,{children:s.jsx(ze,{name:"icon-prediction"})}),s.jsx(Ve,{style:{minWidth:`${l}px`},children:s.jsx(We,{children:o},e)}),s.jsx(Ye,{ref:a,className:n,children:s.jsxs("div",{children:[s.jsx(Pe,{name:"icon-check"}),"Your Pick: ",i]})})]})},Ge=t.styled_default("div")({name:"Container",class:"ckyzolp",propsAsIs:!1}),q=t.styled_default("div")({name:"Line",class:"l16t1zr7",propsAsIs:!1}),He=()=>q,Je=t.styled_default(He())({name:"Line1",class:"le78kvg",propsAsIs:!0}),Xe=()=>q,Ze=t.styled_default(Xe())({name:"Line2",class:"l1o7966d",propsAsIs:!0}),st=()=>q,et=t.styled_default(st())({name:"Line3",class:"lu9lyxq",propsAsIs:!0}),tt=()=>s.jsxs(Ge,{children:[s.jsx(Je,{children:s.jsx("div",{})}),s.jsx(Ze,{children:s.jsx("div",{})}),s.jsx(et,{children:s.jsx("div",{})})]}),nt=t.styled_default("div")({name:"Container",class:"c10jy6zf",propsAsIs:!1}),ot=()=>y.B1,it=t.styled_default(ot())({name:"CheckIcon",class:"c1c7scay",propsAsIs:!0}),lt=()=>s.jsxs(nt,{children:[s.jsx(it,{name:"icon-check"})," Prediction results are in!"]}),at=t.styled_default("div")({name:"Container",class:"cf6k2yy",propsAsIs:!1}),dt=t.styled_default("div")({name:"Caption",class:"c1c8xjus",propsAsIs:!1}),rt=t.styled_default("div")({name:"Title",class:"t1d1uekn",propsAsIs:!1}),ct=({title:e})=>s.jsxs(at,{children:[s.jsx(dt,{children:"Results for"}),s.jsx(rt,{children:e})]}),H=t.styled_default("div")({name:"Container",class:"c181a1as",propsAsIs:!1}),J=t.styled_default("div")({name:"Title",class:"t1cduox6",propsAsIs:!1}),ut=()=>y.B1,X=t.styled_default(ut())({name:"CorrectIcon",class:"c1onrv6j",propsAsIs:!0}),pt=()=>X,mt=t.styled_default(pt())({name:"InCorrectIcon",class:"i17n9o7e",propsAsIs:!0}),xt=()=>s.jsxs(H,{children:[s.jsxs(J,{children:["Congratulations!",s.jsx("br",{}),"You answered correctly."]}),s.jsx(X,{name:"icon-check"})]}),yt=({title:e})=>s.jsxs(H,{children:[s.jsxs(J,{children:["Better luck next time!",s.jsx("br",{}),"Correct: ",e]}),s.jsx(mt,{name:"icon-cross"})]}),vt=t.styled_default("div")({name:"Container",class:"cnxgcs2",propsAsIs:!1}),ft=t.styled_default("div")({name:"Title",class:"t903f8n",propsAsIs:!1}),jt=()=>y.B1,It=t.styled_default(jt())({name:"CheckIcon",class:"ceyu3qj",propsAsIs:!0}),At=({points:e})=>s.jsxs(vt,{children:[s.jsxs(ft,{children:["You won ",s.jsx(ps.d,{delay:.5,prefix:"+",suffix:" points",value:e})]}),s.jsx(It,{name:"icon-trophy-solid"})]}),B=t.styled_default("div")({name:"Container",class:"cq3agu2",propsAsIs:!1}),Q=t.styled_default("div")({name:"Body",class:"b16qj0do",propsAsIs:!1}),R={1:3e3,2:4e3,3:4e3,4:4e3},ht=({close:e,action:o,setStep:i,votedAnswer:n,correct:l,correctAnswerTitle:u,questionTitle:c,step:a})=>{if(x.useEffect(()=>{if(i){const m=setTimeout(()=>{R[a+1]&&(l||a<3)?i(a+1):e==null||e()},R[a]);return()=>{m&&clearTimeout(m)}}return()=>{}},[i,a,e,l]),a===1)return s.jsx(B,{children:s.jsx(Q,{children:s.jsx(lt,{})})});let p="pending";return(a===3||a===4)&&(p=l?"correct":"incorrect"),s.jsx(B,{"data-a":"intr",onClick:()=>o==null?void 0:o(),children:s.jsxs(Q,{children:[a!==1&&s.jsx(tt,{},a),s.jsxs(Ke,{state:p,step:a,answer:(n==null?void 0:n.title)||"unknown",children:[a===2&&s.jsx(ct,{title:c||"unknown"}),a===3&&l&&s.jsx(xt,{}),a===3&&!l&&s.jsx(yt,{title:u||"unknown"}),a===4&&s.jsx(At,{points:(n==null?void 0:n.points)||0})]})]})})},$t=({close:e,action:o,votedAnswer:i,correct:n,correctAnswerTitle:l,questionTitle:u})=>{const[c,a]=x.useState(1);return s.jsx(ht,{close:e,action:o,votedAnswer:i,correct:n,correctAnswerTitle:l,questionTitle:u,setStep:a,step:c,title:""})},gt=t.styled_default("div")({name:"NotificationContainer",class:"n1i4h28u",propsAsIs:!1}),_t=e=>s.jsx(gt,{children:s.jsx($t,{...e})}),wt=t.styled_default("div")({name:"Container",class:"cwa9tgs",propsAsIs:!1}),Tt=t.styled_default("div")({name:"BodyContainer",class:"b1xx7swj",propsAsIs:!1}),bt=t.styled_default("div")({name:"Body",class:"b1a21en",propsAsIs:!1}),Ct=({step:e,children:o,state:i="pending"})=>{const[n,l]=x.useState(0);return x.useEffect(()=>{const u=new ResizeObserver(c=>{window.requestAnimationFrame(()=>{var a,p;const m=((p=(a=c==null?void 0:c[0])==null?void 0:a.contentRect)==null?void 0:p.width)??0;l(m)})});return()=>{u.disconnect()}},[]),s.jsx(wt,{style:{padding:`${e===3&&i==="incorrect"||e===1?"5px 100px":"5px 40px"}`},children:s.jsx(Tt,{style:{minWidth:`${n}px`},children:s.jsx(bt,{children:o},e)})})},Nt=t.styled_default("div")({name:"Container",class:"c1nd5cu8",propsAsIs:!1}),S=t.styled_default("div")({name:"Line",class:"lgbipw0",propsAsIs:!1}),kt=()=>S,qt=t.styled_default(kt())({name:"Line1",class:"l1anth16",propsAsIs:!0}),St=()=>S,Et=t.styled_default(St())({name:"Line2",class:"l193yd7v",propsAsIs:!0}),Lt=()=>S,Mt=t.styled_default(Lt())({name:"Line3",class:"lhbflsp",propsAsIs:!0}),Dt=()=>s.jsxs(Nt,{children:[s.jsx(qt,{children:s.jsx("div",{})}),s.jsx(Et,{children:s.jsx("div",{})}),s.jsx(Mt,{children:s.jsx("div",{})})]}),Bt=t.styled_default("div")({name:"Container",class:"c1lvd429",propsAsIs:!1}),Qt=()=>y.B1,Rt=t.styled_default(Qt())({name:"PredictionIcon",class:"p1n4m87t",propsAsIs:!0}),Ot=()=>s.jsxs(Bt,{children:[s.jsx(Rt,{name:"icon-prediction"})," Prediction results are in!"]}),Pt=()=>y.B1,Ut=t.styled_default(Pt())({name:"CheckIcon",class:"c126r8f9",propsAsIs:!0}),zt=t.styled_default("div")({name:"Answer",class:"a1o2rpgl",propsAsIs:!1}),Ft=t.styled_default("div")({name:"Container",class:"cej6ci1",propsAsIs:!1}),Vt=t.styled_default("div")({name:"Title",class:"tob24mr",propsAsIs:!1}),Wt=({title:e,answer:o})=>s.jsxs(Ft,{children:[s.jsx(Vt,{children:e}),s.jsxs(zt,{children:[s.jsx(Ut,{name:"icon-prediction"}),"Your Pick: ",o]})]}),Z=t.styled_default("div")({name:"Container",class:"c1lesal4",propsAsIs:!1}),ss=t.styled_default("div")({name:"Title",class:"tv66n4w",propsAsIs:!1}),Yt=()=>y.B1,Kt=t.styled_default(Yt())({name:"CorrectIcon",class:"cx0vlv2",propsAsIs:!0}),es=t.styled_default("div")({name:"Answer",class:"akfh4v5",propsAsIs:!1}),Gt=({answer:e})=>s.jsxs(Z,{children:[s.jsx(ss,{children:"Congratulations! You answered correctly."}),s.jsxs(es,{children:[s.jsx(Kt,{name:"icon-correct"}),"Your Pick: ",e]})]}),Ht=({title:e,answer:o})=>s.jsxs(Z,{children:[s.jsxs(ss,{children:["Better luck next time!",s.jsx("br",{}),"Correct: ",e]}),s.jsxs(es,{children:["Your Pick: ",o]})]}),O=t.styled_default("div")({name:"Container",class:"cmox3ot",propsAsIs:!1}),P=t.styled_default("div")({name:"Body",class:"bqq1ix4",propsAsIs:!1}),U={1:3e3,2:4e3,3:4e3},Jt=({close:e,action:o,setStep:i,votedAnswer:n,correct:l,correctAnswerTitle:u,questionTitle:c,step:a})=>{if(x.useEffect(()=>{if(i){const m=setTimeout(()=>{U[a+1]&&(l||a<3)?i(a+1):e==null||e()},U[a]);return()=>{m&&clearTimeout(m)}}return()=>{}},[i,a,e,l]),a===1)return s.jsx(O,{children:s.jsx(P,{children:s.jsx(Ot,{})})});let p="pending";return a===3&&(p=l?"correct":"incorrect"),s.jsx(O,{"data-a":"intr",onClick:()=>o==null?void 0:o(),children:s.jsxs(P,{children:[a!==1&&s.jsx(Dt,{},a),s.jsxs(Ct,{state:p,step:a,children:[a===2&&s.jsx(Wt,{title:c||"unknown",answer:(n==null?void 0:n.title)||"unknown"}),a===3&&l&&s.jsx(Gt,{answer:(n==null?void 0:n.title)||"unknown"}),a===3&&!l&&s.jsx(Ht,{title:u||"unknown",answer:(n==null?void 0:n.title)||"unknown"})]})]})})},Xt=({close:e,action:o,votedAnswer:i,correct:n,correctAnswerTitle:l,questionTitle:u})=>{const[c,a]=x.useState(1);return s.jsx(Jt,{close:e,action:o,votedAnswer:i,correct:n,correctAnswerTitle:l,questionTitle:u,setStep:a,step:c,title:""})},ts=t.styled_default("div")({name:"NotificationContainer",class:"nn0nqh6",propsAsIs:!1}),Zt=()=>({withoutPadding:e})=>e?"0px":"1rem",sn=t.styled_default("div")({name:"NotificationContent",class:"n1bcdf3j",propsAsIs:!1,vars:{"n1bcdf3j-0":[Zt()]}}),ns=t.styled_default("img")({name:"LogoImg",class:"l8jorbq",propsAsIs:!1}),en=()=>ts,tn=t.styled_default(en())({name:"NotificationInterstitialContainer",class:"nf920y3",propsAsIs:!0}),nn=t.styled_default("div")({name:"LogoImgContainer",class:"lzsmehn",propsAsIs:!1}),on=({sponsorLogo:e,onClick:o})=>s.jsx(tn,{onClick:o,children:s.jsx(sn,{withoutPadding:!0,children:s.jsx(ns,{src:e})})}),ln=e=>{var o,i,n,l,u;const[c,a]=x.useState(!1),p=x.useRef();return x.useEffect(()=>{var m;return(m=e==null?void 0:e.inApp)!=null&&m.sponsorLogo&&(a(!0),p.current=setTimeout(()=>{a(!1)},5e3)),()=>clearTimeout(p.current)},[(o=e==null?void 0:e.inApp)==null?void 0:o.sponsorLogo]),(i=e==null?void 0:e.inApp)!=null&&i.sponsorLogo&&c?s.jsx(on,{sponsorLogo:(n=e.inApp)==null?void 0:n.sponsorLogo,onClick:()=>a(!1)}):s.jsx(ts,{children:s.jsxs("div",{children:[((l=e==null?void 0:e.inApp)==null?void 0:l.sponsorLogo)&&s.jsx(nn,{children:s.jsx(ns,{src:(u=e==null?void 0:e.inApp)==null?void 0:u.sponsorLogo})}),s.jsx(Xt,{...e})]})})},os=({sdk:e,webos:o})=>{var i,n,l,u,c,a,p,m;const[f]=x.useState(e.getNotificationsStore()),v=t.useStore(f),j=e.getFeature(r.SdkOverlayType.GAMES),d=x.useMemo(()=>e.getActiveNotification(),[e,v]);return x.useEffect(()=>{d&&us.eventBus.emit("notification",{action:"rendered",payload:{questionId:d.data.questionId,questionType:d.data.questionType}})},[d]),d&&d.type===t.NotificationType.QUESTION_RESOLVED?d.data.question&&d.data.questionType===r.QuestionType.PREDICTION?d&&((i=d.data.inApp)==null?void 0:i.adUnit)===r.AdUnit.STANDART?s.jsx(ln,{action:d.action,close:d.close,...d.data.question,inApp:d.data.inApp}):s.jsx(_t,{action:d.action,close:d.close,...d.data.question}):null:d&&d.type===t.NotificationType.ONBOARDING?d.data.onboarding?s.jsx(Qe,{open:j==null?void 0:j.openOnboarding,close:d.close,...d.data.onboarding}):null:d&&((n=d.data.inApp)==null?void 0:n.adUnit)===r.AdUnit.STANDART?s.jsx(be,{...d.data,action:d.action,close:d.close,color:((c=(u=(l=d==null?void 0:d.data)==null?void 0:l.inApp)==null?void 0:u.notification)==null?void 0:c.indicatorColor)||((m=(p=(a=d==null?void 0:d.data)==null?void 0:a.inApp)==null?void 0:p.appearance)==null?void 0:m.primaryColor),webos:o}):d&&s.jsx(Bs,{...d.data,action:d.action})},an=({theme:e})=>{const o=b.B(),i=b.z(),n=b.F();return o&&(n.appNotification||n.onboardingNotification)?n.app&&!n.onboardingNotification?null:s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(cs.h,{customTheme:e??i.theme,themeMode:i.themeMode,children:s.jsx(os,{sdk:o})})}):null};exports.StreamLayerSDKNotification=an;exports.StreamLayerSDKNotificationUI=os;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),us=require("./index7.js"),x=require("react"),e=require("./sl-types.js"),ps=require("./index3.js"),F=require("./storage.js"),A=require("./index11.js"),v=require("./index6.js"),r=require("./useStreamLayerApp2.js"),k=require("./index13.js"),V=require("./index12.js"),ms=require("./index5.js"),C=require("./hooks-B0Qttldg.js"),h=e.styled_default("div")({name:"Media",class:"m1bcvojl",propsAsIs:!1}),xs=()=>h,ys=e.styled_default(xs())({name:"MediaImgBottom",class:"m58gin0",propsAsIs:!0}),vs=()=>h,b=e.styled_default(vs())({name:"MediaImgSolid",class:"m1atm8do",propsAsIs:!0}),fs=()=>h,js=e.styled_default(fs())({name:"MediaImgRounded",class:"myx3xoi",propsAsIs:!0}),Is=()=>h,As=e.styled_default(Is())({name:"MediaImgCentered",class:"m1bwv0gx",propsAsIs:!0}),hs=()=>h,$s=e.styled_default(hs())({name:"MediaImgInsight",class:"mntjanp",propsAsIs:!0}),gs=e.styled_default("div")({name:"VideoIcon",class:"v1kofb47",propsAsIs:!1}),_s={[r.QuestionImages.UNSET]:b,[r.QuestionImages.NONE]:b,[r.QuestionImages.ROUNDED]:js,[r.QuestionImages.CENTERED]:As,[r.QuestionImages.TRANSPARENT]:ys,[r.QuestionImages.SOLID]:b},L=({src:t,imageMode:n=r.QuestionImages.UNSET,withVideo:i,fromInsight:o})=>{if(n===r.QuestionImages.NONE)return null;const l=o?$s:_s[n];return s.jsxs(l,{children:[s.jsx("img",{src:t,alt:""}),i&&s.jsx(gs,{children:s.jsx(v.B1,{name:"icon-play"})})]})},ws=e.styled_default("div")({name:"NotificationContent",class:"nuraq9m",propsAsIs:!1}),Ts=e.styled_default("div")({name:"NotificationContainer",class:"ns1nzpg",propsAsIs:!1}),W=e.styled_default("div")({name:"Body",class:"b1j59nzs",propsAsIs:!1}),Cs=e.styled_default("div")({name:"Title",class:"t9vmnpp",propsAsIs:!1}),bs=e.styled_default("button")({name:"Button",class:"b14ivj5k",propsAsIs:!1}),Ns=()=>v.B1,ks=e.styled_default(Ns())({name:"StyledChevronRight",class:"s1atci8n",propsAsIs:!0}),qs=e.styled_default("div")({name:"QuoteWrap",class:"q4w8jgs",propsAsIs:!1}),Ss=e.styled_default("blockquote")({name:"Quote",class:"qaa0kez",propsAsIs:!1}),Es=e.styled_default("div")({name:"Body",class:"b1wvd52w",propsAsIs:!1}),Ls=e.styled_default("div")({name:"Container",class:"ccvukea",propsAsIs:!1}),Ms=({image:t,tweet:n,account:i,accountVerified:o,body:l,title:u})=>{var c;return s.jsxs(Ls,{children:[u&&s.jsx(qs,{children:s.jsx(Ss,{children:u})}),s.jsx(A.D,{image:t,name:(c=n==null?void 0:n.meta)==null?void 0:c.accountName,userName:i,verified:o,createdTweet:n==null?void 0:n.date}),s.jsx(Es,{children:A.D$1(l)})]})},Ds=({title:t,questionType:n,questionTypeData:i})=>s.jsxs(W,{children:[s.jsx(F.x,{questionTypeData:i,questionType:n,questionStatus:r.QuestionStatus.UNSET}),t&&s.jsx(Cs,{children:t})]}),Bs=({tweet:t})=>t?s.jsx(W,{children:s.jsx(Ms,{...t,controlVideo:()=>{}})}):null,Qs=({action:t,questionType:n,inApp:i,insight:o,tweet:l})=>{var u;const c=A.e[n],a=A.o[n];if(!c||!i||!i.notification)return null;const{title:p,image:m,imageMode:y}=i.notification;let j=m;n===r.QuestionType.TWEET&&l!=null&&l.tweetMedia&&(j=l.tweetMedia.image),y===r.QuestionImages.NONE&&(j="");const f=i.useMediaFromContent&&(o==null?void 0:o.image),d=n===r.QuestionType.TWEET&&((u=l==null?void 0:l.tweetMedia)==null?void 0:u.video)||n===r.QuestionType.FACTOID&&(o==null?void 0:o.video);return s.jsx(Ts,{"data-a":"intr",className:"SL_InApp",onClick:t,children:s.jsxs(ws,{style:j?{}:{paddingLeft:"1.5rem"},children:[j&&!f&&s.jsx(L,{src:j,imageMode:y,withVideo:!!d}),f&&s.jsx(L,{src:f,fromInsight:!0,withVideo:!!d}),n===r.QuestionType.TWEET?s.jsx(Bs,{tweet:l}):s.jsx(Ds,{questionTypeData:c,questionType:n,title:p}),s.jsx(bs,{name:"inapp-button",children:a||"Open"}),s.jsx(ks,{name:"chevronRight"})]})})},Rs=()=>({color:t})=>t||"transparent",M=e.styled_default("div")({name:"MediaComponentWrap",class:"mek728j",propsAsIs:!1,vars:{"mek728j-0":[Rs()]}}),I=e.styled_default("div")({name:"Media",class:"m461t56",propsAsIs:!1}),Os=()=>I,Ps=e.styled_default(Os())({name:"MediaImgBottom",class:"m22bh04",propsAsIs:!0}),Us=()=>I,zs=e.styled_default(Us())({name:"MediaVideo",class:"m17u1e34",propsAsIs:!0}),Fs=()=>I,Vs=e.styled_default(Fs())({name:"MediaImgContentMedia",class:"m4j3eds",propsAsIs:!0}),Ws=()=>I,Ys=e.styled_default(Ws())({name:"MediaImgSolid",class:"m1lp3swr",propsAsIs:!0}),Ks=()=>I,Gs=e.styled_default(Ks())({name:"MediaImgRounded",class:"mc7lij",propsAsIs:!0}),Hs=()=>I,Js=e.styled_default(Hs())({name:"MediaImgCentered",class:"mwwaw7o",propsAsIs:!0}),Xs=()=>I,N=e.styled_default(Xs())({name:"MediaNone",class:"mqfzyyr",propsAsIs:!0}),Zs="v170mtgf",se={[r.QuestionImages.UNSET]:N,[r.QuestionImages.NONE]:N,[r.QuestionImages.ROUNDED]:Gs,[r.QuestionImages.CENTERED]:Js,[r.QuestionImages.TRANSPARENT]:Ps,[r.QuestionImages.SOLID]:Ys},D=({src:t,imageMode:n=r.QuestionImages.UNSET,withVideo:i,color:o,useContentMedia:l,thumbnailUrl:u})=>{if(!t)return s.jsx(M,{color:o,children:s.jsx(N,{})});const c=l===r.NotificationUseContentMedia.ENABLED?Vs:se[n];return s.jsx(M,{color:o,children:i?s.jsx(zs,{children:s.jsx(V.Et,{className:Zs,source:t,poster:u||""})}):s.jsx(c,{children:s.jsx("img",{src:t,alt:""})})})},ee=()=>({withoutPadding:t})=>t?"0px":"1rem",Y=e.styled_default("div")({name:"NotificationContent",class:"n1p3bk1c",propsAsIs:!1,vars:{"n1p3bk1c-0":[ee()]}}),te=e.styled_default("div")({name:"MainContent",class:"m1g211mu",propsAsIs:!1}),ne=()=>v.B1,oe=e.styled_default(ne())({name:"StyledChevronRight",class:"sx1hq4c",propsAsIs:!0}),K=e.styled_default("div")({name:"NotificationContainer",class:"n1fcriet",propsAsIs:!1}),ie=()=>({questionType:t})=>t===r.QuestionType.FACTOID?"7.3rem":"4.5rem",le=()=>({webos:t})=>t?"11px 0px 8px 0px":"11px 0px",ae=()=>({imageMode:t,webos:n})=>n?"330px":t===r.QuestionImages.SOLID?"310px":t===r.QuestionImages.CENTERED||t===r.QuestionImages.ROUNDED||t===r.QuestionImages.TRANSPARENT?"370px":"430px",de=e.styled_default("div")({name:"Body",class:"b1byyovs",propsAsIs:!1,vars:{"b1byyovs-0":[ie()],"b1byyovs-1":[le()],"b1byyovs-2":[ae()]}}),re=()=>({webos:t})=>t?"0.85rem":"1.033rem",ce=()=>({webos:t})=>t?"0.95rem":"1.25rem",ue=()=>({webos:t})=>t?"4.7rem":"2.25rem",pe=()=>({webos:t})=>t?"pre-wrap":"nowrap",me=e.styled_default("div")({name:"Title",class:"t1y5k5id",propsAsIs:!1,vars:{"t1y5k5id-0":[re()],"t1y5k5id-1":[ce()],"t1y5k5id-2":[ue()],"t1y5k5id-3":[pe()]}}),xe=e.styled_default("div")({name:"Description",class:"dw9eb7l",propsAsIs:!1}),ye=e.styled_default("div")({name:"LogoImgContainer",class:"ldu8wgy",propsAsIs:!1}),G=e.styled_default("img")({name:"LogoImg",class:"ln4a3eh",propsAsIs:!1}),ve=()=>K,fe=e.styled_default(ve())({name:"NotificationInterstitialContainer",class:"no2k63v",propsAsIs:!0}),je=e.styled_default("div")({name:"TVButtons",class:"th9nn6a",propsAsIs:!1}),H=e.styled_default("button")({name:"TVButton",class:"t1eee77p",propsAsIs:!1}),Ie=()=>H,Ae=e.styled_default(Ie())({name:"DismissButton",class:"ds000hw",propsAsIs:!0}),he=()=>H,$e=e.styled_default(he())({name:"AnswerButton",class:"a1nz9hoe",propsAsIs:!0}),ge=({title:t,questionType:n,questionTypeData:i,description:o,imageMode:l,webos:u})=>s.jsxs(de,{imageMode:l,questionType:n,webos:u,children:[s.jsx(F.x,{questionTypeData:i,questionType:n,questionStatus:r.QuestionStatus.UNSET}),t&&s.jsx(me,{webos:u,children:t}),o&&s.jsx(xe,{children:o})]}),_e=k.O(fe),we=k.O(Ae),Te=k.O($e),Ce=({className:t,sponsorLogo:n,onClick:i,webos:o})=>s.jsx(_e,{className:t,autoFocus:!0,webos:o,onClick:i,"data-webos":o,children:s.jsx(Y,{withoutPadding:!0,children:s.jsx(G,{src:n})})}),be=({action:t,close:n,questionType:i,inApp:o,insight:l,color:u,webos:c,className:a})=>{var p,m,y;const[j,f]=x.useState(!1),d=x.useRef();x.useEffect(()=>(o!=null&&o.sponsorLogo&&(f(!0),d.current=setTimeout(()=>{f(!1)},5e3)),()=>clearTimeout(d.current)),[o==null?void 0:o.sponsorLogo]);const E=A.e[i];if(!E||!o||!o.notification)return null;const{title:ls,image:as,imageMode:g,useContentMedia:_}=o.notification,ds=i===r.QuestionType.FACTOID?l==null?void 0:l.heading:ls,rs=i===r.QuestionType.FACTOID?l==null?void 0:l.body:"",cs=as,w=i===r.QuestionType.FACTOID&&((p=l==null?void 0:l.video)==null?void 0:p.url)&&(o==null?void 0:o.isVideo)&&_===r.NotificationUseContentMedia.ENABLED,T=_===r.NotificationUseContentMedia.ENABLED?w?(m=l==null?void 0:l.video)==null?void 0:m.url:l==null?void 0:l.image:"";return o!=null&&o.sponsorLogo&&j?s.jsx(Ce,{className:a,sponsorLogo:o==null?void 0:o.sponsorLogo,webos:c,onClick:()=>f(!1)}):s.jsxs(K,{"data-a":"intr",className:e.cx_default("SL_InApp",a),onClick:$=>{c||t==null||t($)},"data-is-insight":i===r.QuestionType.FACTOID,"data-webos":c,children:[(o==null?void 0:o.sponsorLogo)&&s.jsx(ye,{children:s.jsx(G,{src:o==null?void 0:o.sponsorLogo})}),s.jsxs(Y,{children:[s.jsxs(te,{children:[!T&&s.jsx(D,{src:cs,imageMode:g,withVideo:!!w,color:u}),T&&s.jsx(D,{src:T,imageMode:g,withVideo:!!w,color:u,useContentMedia:_,thumbnailUrl:(y=l==null?void 0:l.video)==null?void 0:y.thumbnailUrl}),s.jsx(ge,{questionTypeData:E,questionType:i,title:ds,description:rs,imageMode:g,webos:c})]}),!c&&s.jsx(oe,{name:"chevronRight"}),c&&s.jsxs(je,{children:[s.jsx(we,{webos:!0,"data-close-btn":"true",onClick:$=>{$.stopPropagation(),n==null||n($)},children:"Dismiss"}),s.jsx(Te,{webos:!0,autoFocus:!0,onClick:t,children:"Answer"})]})]})]})},Ne=e.styled_default("div")({name:"NotificationContainer",class:"n11jcrxe",propsAsIs:!1}),B=e.styled_default("img")({name:"Icon",class:"i1vmpt6u",propsAsIs:!1}),ke=e.styled_default("div")({name:"IconContainer",class:"i180665s",propsAsIs:!1}),qe=()=>v.B1,Se=e.styled_default(qe())({name:"TitleIcon",class:"t16zzzei",propsAsIs:!0}),Ee=()=>V.y,Le=e.styled_default(Ee())({name:"Close",class:"c1sur0q2",propsAsIs:!0}),Me=e.styled_default("div")({name:"Body",class:"bai9j52",propsAsIs:!1}),De=e.styled_default("div")({name:"Title",class:"t1bnt25p",propsAsIs:!1}),Be=e.styled_default("div")({name:"Description",class:"dmixjec",propsAsIs:!1}),Qe=e.styled_default("button")({name:"Button",class:"b1ubkw1q",propsAsIs:!1}),Re=({open:t,close:n,...i})=>{var o,l;return s.jsxs(Ne,{"data-a":"intr",onClick:()=>{t==null||t(),i&&i.markIstantOpen()},children:[s.jsxs(ke,{children:[s.jsx(B,{className:"on-light",src:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification.png"}),s.jsx(B,{className:"on-dark",src:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification-dark.png"})]}),s.jsxs(Me,{children:[s.jsxs(De,{children:[s.jsx(Se,{name:"icon-trophy-solid"}),(o=i==null?void 0:i.titleCard)==null?void 0:o.title]}),s.jsxs(Be,{children:[s.jsx("span",{children:(l=i==null?void 0:i.titleCard)==null?void 0:l.subtitle}),s.jsx(Qe,{name:"inapp-button",children:"Play Now"})]})]}),s.jsx(Le,{close:u=>{u==null||u.stopPropagation(),n==null||n()}})]})},Oe=e.styled_default("div")({name:"Container",class:"cef8huz",propsAsIs:!1}),Pe=()=>v.B1,Ue=e.styled_default(Pe())({name:"CheckIcon",class:"c1mo15kk",propsAsIs:!0}),ze=()=>v.B1,Fe=e.styled_default(ze())({name:"PredictionIcon",class:"p16zkqnm",propsAsIs:!0}),Ve=e.styled_default("div")({name:"PredictionIconContainer",class:"pjszi7a",propsAsIs:!1}),We=e.styled_default("div")({name:"BodyContainer",class:"bftbmo3",propsAsIs:!1}),Ye=e.styled_default("div")({name:"Body",class:"barrbyu",propsAsIs:!1}),Ke=e.styled_default("div")({name:"Subtitle",class:"sz7237i",propsAsIs:!1}),Ge=({step:t,children:n,answer:i,state:o="pending"})=>{const[l,u]=x.useState(0),[c]=x.useState(()=>new ResizeObserver(p=>{window.requestAnimationFrame(()=>{var m,y;u(((y=(m=p==null?void 0:p[0])==null?void 0:m.contentRect)==null?void 0:y.width)??0)})})),a=x.useCallback(p=>{p?c.observe(p):c.disconnect()},[c]);return x.useEffect(()=>()=>{c.disconnect()},[c]),s.jsxs(Oe,{children:[s.jsx(Ve,{children:s.jsx(Fe,{name:"icon-prediction"})}),s.jsx(We,{style:{minWidth:`${l}px`},children:s.jsx(Ye,{children:n},t)}),s.jsx(Ke,{ref:a,className:o,children:s.jsxs("div",{children:[s.jsx(Ue,{name:"icon-check"}),"Your Pick: ",i]})})]})},He=e.styled_default("div")({name:"Container",class:"ckyzolp",propsAsIs:!1}),q=e.styled_default("div")({name:"Line",class:"l16t1zr7",propsAsIs:!1}),Je=()=>q,Xe=e.styled_default(Je())({name:"Line1",class:"le78kvg",propsAsIs:!0}),Ze=()=>q,st=e.styled_default(Ze())({name:"Line2",class:"l1o7966d",propsAsIs:!0}),et=()=>q,tt=e.styled_default(et())({name:"Line3",class:"lu9lyxq",propsAsIs:!0}),nt=()=>s.jsxs(He,{children:[s.jsx(Xe,{children:s.jsx("div",{})}),s.jsx(st,{children:s.jsx("div",{})}),s.jsx(tt,{children:s.jsx("div",{})})]}),ot=e.styled_default("div")({name:"Container",class:"c10jy6zf",propsAsIs:!1}),it=()=>v.B1,lt=e.styled_default(it())({name:"CheckIcon",class:"c1c7scay",propsAsIs:!0}),at=()=>s.jsxs(ot,{children:[s.jsx(lt,{name:"icon-check"})," Prediction results are in!"]}),dt=e.styled_default("div")({name:"Container",class:"cf6k2yy",propsAsIs:!1}),rt=e.styled_default("div")({name:"Caption",class:"c1c8xjus",propsAsIs:!1}),ct=e.styled_default("div")({name:"Title",class:"t1d1uekn",propsAsIs:!1}),ut=({title:t})=>s.jsxs(dt,{children:[s.jsx(rt,{children:"Results for"}),s.jsx(ct,{children:t})]}),J=e.styled_default("div")({name:"Container",class:"c181a1as",propsAsIs:!1}),X=e.styled_default("div")({name:"Title",class:"t1cduox6",propsAsIs:!1}),pt=()=>v.B1,Z=e.styled_default(pt())({name:"CorrectIcon",class:"c1onrv6j",propsAsIs:!0}),mt=()=>Z,xt=e.styled_default(mt())({name:"InCorrectIcon",class:"i17n9o7e",propsAsIs:!0}),yt=()=>s.jsxs(J,{children:[s.jsxs(X,{children:["Congratulations!",s.jsx("br",{}),"You answered correctly."]}),s.jsx(Z,{name:"icon-check"})]}),vt=({title:t})=>s.jsxs(J,{children:[s.jsxs(X,{children:["Better luck next time!",s.jsx("br",{}),"Correct: ",t]}),s.jsx(xt,{name:"icon-cross"})]}),ft=e.styled_default("div")({name:"Container",class:"cnxgcs2",propsAsIs:!1}),jt=e.styled_default("div")({name:"Title",class:"t903f8n",propsAsIs:!1}),It=()=>v.B1,At=e.styled_default(It())({name:"CheckIcon",class:"ceyu3qj",propsAsIs:!0}),ht=({points:t})=>s.jsxs(ft,{children:[s.jsxs(jt,{children:["You won ",s.jsx(ms.d,{delay:.5,prefix:"+",suffix:" points",value:t})]}),s.jsx(At,{name:"icon-trophy-solid"})]}),Q=e.styled_default("div")({name:"Container",class:"cq3agu2",propsAsIs:!1}),R=e.styled_default("div")({name:"Body",class:"b16qj0do",propsAsIs:!1}),O={1:3e3,2:4e3,3:4e3,4:4e3},$t=({close:t,action:n,setStep:i,votedAnswer:o,correct:l,correctAnswerTitle:u,questionTitle:c,step:a})=>{if(x.useEffect(()=>{if(i){const m=setTimeout(()=>{O[a+1]&&(l||a<3)?i(a+1):t==null||t()},O[a]);return()=>{m&&clearTimeout(m)}}return()=>{}},[i,a,t,l]),a===1)return s.jsx(Q,{children:s.jsx(R,{children:s.jsx(at,{})})});let p="pending";return(a===3||a===4)&&(p=l?"correct":"incorrect"),s.jsx(Q,{"data-a":"intr",onClick:()=>n==null?void 0:n(),children:s.jsxs(R,{children:[a!==1&&s.jsx(nt,{},a),s.jsxs(Ge,{state:p,step:a,answer:(o==null?void 0:o.title)||"unknown",children:[a===2&&s.jsx(ut,{title:c||"unknown"}),a===3&&l&&s.jsx(yt,{}),a===3&&!l&&s.jsx(vt,{title:u||"unknown"}),a===4&&s.jsx(ht,{points:(o==null?void 0:o.points)||0})]})]})})},gt=({close:t,action:n,votedAnswer:i,correct:o,correctAnswerTitle:l,questionTitle:u})=>{const[c,a]=x.useState(1);return s.jsx($t,{close:t,action:n,votedAnswer:i,correct:o,correctAnswerTitle:l,questionTitle:u,setStep:a,step:c,title:""})},_t=e.styled_default("div")({name:"NotificationContainer",class:"n1i4h28u",propsAsIs:!1}),wt=({className:t,...n})=>s.jsx(_t,{className:t,children:s.jsx(gt,{...n})}),Tt=e.styled_default("div")({name:"Container",class:"cwa9tgs",propsAsIs:!1}),Ct=e.styled_default("div")({name:"BodyContainer",class:"b1xx7swj",propsAsIs:!1}),bt=e.styled_default("div")({name:"Body",class:"b1a21en",propsAsIs:!1}),Nt=({step:t,children:n,state:i="pending"})=>{const[o,l]=x.useState(0);return x.useEffect(()=>{const u=new ResizeObserver(c=>{window.requestAnimationFrame(()=>{var a,p;const m=((p=(a=c==null?void 0:c[0])==null?void 0:a.contentRect)==null?void 0:p.width)??0;l(m)})});return()=>{u.disconnect()}},[]),s.jsx(Tt,{style:{padding:`${t===3&&i==="incorrect"||t===1?"5px 100px":"5px 40px"}`},children:s.jsx(Ct,{style:{minWidth:`${o}px`},children:s.jsx(bt,{children:n},t)})})},kt=e.styled_default("div")({name:"Container",class:"c1nd5cu8",propsAsIs:!1}),S=e.styled_default("div")({name:"Line",class:"lgbipw0",propsAsIs:!1}),qt=()=>S,St=e.styled_default(qt())({name:"Line1",class:"l1anth16",propsAsIs:!0}),Et=()=>S,Lt=e.styled_default(Et())({name:"Line2",class:"l193yd7v",propsAsIs:!0}),Mt=()=>S,Dt=e.styled_default(Mt())({name:"Line3",class:"lhbflsp",propsAsIs:!0}),Bt=()=>s.jsxs(kt,{children:[s.jsx(St,{children:s.jsx("div",{})}),s.jsx(Lt,{children:s.jsx("div",{})}),s.jsx(Dt,{children:s.jsx("div",{})})]}),Qt=e.styled_default("div")({name:"Container",class:"c1lvd429",propsAsIs:!1}),Rt=()=>v.B1,Ot=e.styled_default(Rt())({name:"PredictionIcon",class:"p1n4m87t",propsAsIs:!0}),Pt=()=>s.jsxs(Qt,{children:[s.jsx(Ot,{name:"icon-prediction"})," Prediction results are in!"]}),Ut=()=>v.B1,zt=e.styled_default(Ut())({name:"CheckIcon",class:"c126r8f9",propsAsIs:!0}),Ft=e.styled_default("div")({name:"Answer",class:"a1o2rpgl",propsAsIs:!1}),Vt=e.styled_default("div")({name:"Container",class:"cej6ci1",propsAsIs:!1}),Wt=e.styled_default("div")({name:"Title",class:"tob24mr",propsAsIs:!1}),Yt=({title:t,answer:n})=>s.jsxs(Vt,{children:[s.jsx(Wt,{children:t}),s.jsxs(Ft,{children:[s.jsx(zt,{name:"icon-prediction"}),"Your Pick: ",n]})]}),ss=e.styled_default("div")({name:"Container",class:"c1lesal4",propsAsIs:!1}),es=e.styled_default("div")({name:"Title",class:"tv66n4w",propsAsIs:!1}),Kt=()=>v.B1,Gt=e.styled_default(Kt())({name:"CorrectIcon",class:"cx0vlv2",propsAsIs:!0}),ts=e.styled_default("div")({name:"Answer",class:"akfh4v5",propsAsIs:!1}),Ht=({answer:t})=>s.jsxs(ss,{children:[s.jsx(es,{children:"Congratulations! You answered correctly."}),s.jsxs(ts,{children:[s.jsx(Gt,{name:"icon-correct"}),"Your Pick: ",t]})]}),Jt=({title:t,answer:n})=>s.jsxs(ss,{children:[s.jsxs(es,{children:["Better luck next time!",s.jsx("br",{}),"Correct: ",t]}),s.jsxs(ts,{children:["Your Pick: ",n]})]}),P=e.styled_default("div")({name:"Container",class:"cmox3ot",propsAsIs:!1}),U=e.styled_default("div")({name:"Body",class:"bqq1ix4",propsAsIs:!1}),z={1:3e3,2:4e3,3:4e3},Xt=({close:t,action:n,setStep:i,votedAnswer:o,correct:l,correctAnswerTitle:u,questionTitle:c,step:a})=>{if(x.useEffect(()=>{if(i){const m=setTimeout(()=>{z[a+1]&&(l||a<3)?i(a+1):t==null||t()},z[a]);return()=>{m&&clearTimeout(m)}}return()=>{}},[i,a,t,l]),a===1)return s.jsx(P,{children:s.jsx(U,{children:s.jsx(Pt,{})})});let p="pending";return a===3&&(p=l?"correct":"incorrect"),s.jsx(P,{"data-a":"intr",onClick:()=>n==null?void 0:n(),children:s.jsxs(U,{children:[a!==1&&s.jsx(Bt,{},a),s.jsxs(Nt,{state:p,step:a,children:[a===2&&s.jsx(Yt,{title:c||"unknown",answer:(o==null?void 0:o.title)||"unknown"}),a===3&&l&&s.jsx(Ht,{answer:(o==null?void 0:o.title)||"unknown"}),a===3&&!l&&s.jsx(Jt,{title:u||"unknown",answer:(o==null?void 0:o.title)||"unknown"})]})]})})},Zt=({close:t,action:n,votedAnswer:i,correct:o,correctAnswerTitle:l,questionTitle:u})=>{const[c,a]=x.useState(1);return s.jsx(Xt,{close:t,action:n,votedAnswer:i,correct:o,correctAnswerTitle:l,questionTitle:u,setStep:a,step:c,title:""})},ns=e.styled_default("div")({name:"NotificationContainer",class:"nn0nqh6",propsAsIs:!1}),sn=()=>({withoutPadding:t})=>t?"0px":"1rem",en=e.styled_default("div")({name:"NotificationContent",class:"n1bcdf3j",propsAsIs:!1,vars:{"n1bcdf3j-0":[sn()]}}),os=e.styled_default("img")({name:"LogoImg",class:"l8jorbq",propsAsIs:!1}),tn=()=>ns,nn=e.styled_default(tn())({name:"NotificationInterstitialContainer",class:"nf920y3",propsAsIs:!0}),on=e.styled_default("div")({name:"LogoImgContainer",class:"lzsmehn",propsAsIs:!1}),ln=({className:t,sponsorLogo:n,onClick:i})=>s.jsx(nn,{className:t,onClick:i,children:s.jsx(en,{withoutPadding:!0,children:s.jsx(os,{src:n})})}),an=({className:t,...n})=>{var i,o,l,u,c;const[a,p]=x.useState(!1),m=x.useRef();return x.useEffect(()=>{var y;return(y=n==null?void 0:n.inApp)!=null&&y.sponsorLogo&&(p(!0),m.current=setTimeout(()=>{p(!1)},5e3)),()=>clearTimeout(m.current)},[(i=n==null?void 0:n.inApp)==null?void 0:i.sponsorLogo]),(o=n==null?void 0:n.inApp)!=null&&o.sponsorLogo&&a?s.jsx(ln,{className:t,sponsorLogo:(l=n.inApp)==null?void 0:l.sponsorLogo,onClick:()=>p(!1)}):s.jsx(ns,{className:t,children:s.jsxs("div",{children:[((u=n==null?void 0:n.inApp)==null?void 0:u.sponsorLogo)&&s.jsx(on,{children:s.jsx(os,{src:(c=n==null?void 0:n.inApp)==null?void 0:c.sponsorLogo})}),s.jsx(Zt,{...n})]})})},is=({sdk:t,webos:n})=>{var i,o,l,u,c,a,p,m;const[y]=x.useState(t.getNotificationsStore()),j=e.useStore(y),f=t.getFeature(r.SdkOverlayType.GAMES),d=x.useMemo(()=>t.getActiveNotification(),[t,j]);return x.useEffect(()=>{d&&ps.eventBus.emit("notification",{action:"rendered",payload:{questionId:d.data.questionId,questionType:d.data.questionType}})},[d]),d&&d.type===e.NotificationType.QUESTION_RESOLVED?d.data.question&&d.data.questionType===r.QuestionType.PREDICTION?d&&((i=d.data.inApp)==null?void 0:i.adUnit)===r.AdUnit.STANDART?s.jsx(an,{action:d.action,close:d.close,...d.data.question,inApp:d.data.inApp}):s.jsx(wt,{action:d.action,close:d.close,...d.data.question}):null:d&&d.type===e.NotificationType.ONBOARDING?d.data.onboarding?s.jsx(Re,{open:f==null?void 0:f.openOnboarding,close:d.close,...d.data.onboarding}):null:d&&((o=d.data.inApp)==null?void 0:o.adUnit)===r.AdUnit.STANDART?s.jsx(be,{...d.data,action:d.action,close:d.close,color:((c=(u=(l=d==null?void 0:d.data)==null?void 0:l.inApp)==null?void 0:u.notification)==null?void 0:c.indicatorColor)||((m=(p=(a=d==null?void 0:d.data)==null?void 0:a.inApp)==null?void 0:p.appearance)==null?void 0:m.primaryColor),webos:n}):d&&s.jsx(Qs,{...d.data,action:d.action})},dn=({theme:t})=>{const n=C.B(),i=C.z(),o=C.F();return n&&(o.appNotification||o.onboardingNotification)?o.app&&!o.onboardingNotification?null:s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(us.h,{customTheme:t??i.theme,themeMode:i.themeMode,children:s.jsx(is,{sdk:n})})}):null};exports.StreamLayerSDKNotification=dn;exports.StreamLayerSDKNotificationUI=is;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),L=require("./index8.js"),v=require("./sl-types.js"),I=require("./index15.js"),n=require("react"),P=require("./index3.js"),q=require("./vast-client.min.js"),U=require("./index-DSi8Qgfs.js"),R=require("./hooks-B0Qttldg.js"),K={},F=new q._,T=U.i(K),C=P.createLogger("ui:gam-static"),_=e=>new Promise((s,a)=>{const i=new Image;i.onload=()=>s(e),i.onerror=()=>a(),i.src=e}),D=()=>{const e=n.useRef(0);return[n.useCallback(async s=>{var a,i,t,p,d,l,h,u,A,S,g;if((a=T.get()[s])!=null&&a.imageSrc)return{success:!0};const y=Date.now();e.current=y,T.setKey(s,{id:"",url:s});try{P.eventBus.emit("exposedPauseAd",{action:"load",payload:{}});const m=await F.get(s);if(C.debug(m,"parsedVAST"),e.current===y&&T.get()[s].url){const o=m.ads.find(f=>f.creatives.length>0);if(o){C.debug(o,"validAd");const f=o.creatives.find(c=>c.type==="nonlinear");if(f){C.debug(f,"nonlinear");const c=(t=(i=f.variations)==null?void 0:i[0])==null?void 0:t.staticResource,E=(d=(p=f.variations)==null?void 0:p[0])==null?void 0:d.nonlinearClickThroughURLTemplate;if(c)return await _(c),T.setKey(s,{id:o.id||"",url:s,imageSrc:c,adUrl:E}),P.eventBus.emit("exposedPauseAd",{action:"loaded",payload:{id:o.id||""}}),{success:!0}}const x=o.creatives.find(c=>c.type==="companion");C.debug(x,"companion");const k=(A=(u=(h=(l=x==null?void 0:x.variations)==null?void 0:l[0])==null?void 0:h.staticResources)==null?void 0:u[0])==null?void 0:A.url,j=(g=(S=x==null?void 0:x.variations)==null?void 0:S[0])==null?void 0:g.companionClickThroughURLTemplate;if(k)return await _(k),T.setKey(s,{id:o.id||"",url:s,imageSrc:k,adUrl:j}),P.eventBus.emit("exposedPauseAd",{action:"loaded",payload:{id:o.id||""}}),{success:!0}}}}catch(m){console.error("Error parsing VAST",m)}return{success:!1}},[]),T]},M=v.styled_default("div")({name:"PauseAdOverlay",class:"pw9gih8",propsAsIs:!1}),V=v.styled_default("div")({name:"PauseAdContent",class:"p8lpomy",propsAsIs:!1}),N=v.styled_default("div")({name:"PauseAdTopLeft",class:"pv7u167",propsAsIs:!1}),O=v.styled_default("h2")({name:"PauseAdTitle",class:"p1kh2yb0",propsAsIs:!1}),Q=v.styled_default("p")({name:"PauseAdCaption",class:"pl8f94x",propsAsIs:!1}),$=v.styled_default("div")({name:"PauseAdBottomLeft",class:"p1m6zmrt",propsAsIs:!1}),z=v.styled_default("button")({name:"PauseAdPlayButton",class:"pm3vwfa",propsAsIs:!1}),G=v.styled_default("div")({name:"PauseAdSidebarGradient",class:"p1tibuhw",propsAsIs:!1}),W=v.styled_default("div")({name:"PauseAdSidebar",class:"ptqqrqd",propsAsIs:!1}),H=v.styled_default("span")({name:"PauseAdTitleDescription",class:"p14estxv",propsAsIs:!1}),B=v.styled_default("img")({name:"ExternalAdContainer",class:"e1dpvfl1",propsAsIs:!1}),J=({vastUrl:e,isDesktop:s})=>{var a;const[,i]=D(),t=v.useStore(i,{keys:[e]});return n.useEffect(()=>{t&&t[e]&&t[e].imageSrc&&t[e].id&&P.eventBus.emit("exposedPauseAd",{action:"rendered",payload:{id:t[e].id}})},[t,e]),(a=t==null?void 0:t[e])!=null&&a.imageSrc?!t[e].adUrl||!s?r.jsx(B,{src:t[e].imageSrc}):r.jsx("a",{onClick:()=>{P.eventBus.emit("exposedPauseAd",{action:"navigated",payload:{id:t[e].id}})},href:t[e].adUrl,target:"_blank",rel:"noopener noreferrer",children:r.jsx(B,{src:t[e].imageSrc})}):null},X=({isClosing:e,title:s,caption:a,onPlay:i,onClose:t,vastUrl:p,options:d,isDesktop:l})=>{const h=(d==null?void 0:d.showPauseButton)??!0,{ref:u,focusSelf:A}=I.distExports.useFocusable({focusKey:"sl-pause-ad-play",onEnterRelease:i,isFocusBoundary:!0,forceFocus:!0});return n.useEffect(()=>{u.current&&A()},[u,A]),n.useEffect(()=>{if(!t)return()=>{};const S=g=>{const y=g.keyCode;if(y===461||y===10009||y===27||y===8){g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation(),t();return}};return window.addEventListener("keydown",S,{capture:!0}),()=>window.removeEventListener("keydown",S,{capture:!0})},[t]),r.jsx(M,{className:v.cx_default("SL_PauseAdOverlay",e&&"pause-ad-closing"),children:r.jsxs(V,{children:[r.jsxs(N,{children:[r.jsx(O,{children:s}),r.jsx(Q,{children:a})]}),h&&r.jsx($,{children:r.jsx(z,{ref:u,onClick:i,onMouseEnter:()=>u.current.focus(),"aria-label":"Resume playback"})}),r.jsx(G,{className:"SL_PauseAdSidebar",children:r.jsxs(W,{children:[p&&r.jsx(J,{isDesktop:l,vastUrl:p}),r.jsx(H,{children:"ADVERTISEMENT"})]})})]})})},Y=({showPauseAd:e,vastUrls:s,title:a,caption:i,sdk:t,onClose:p,onRender:d,options:l,isDesktop:h})=>{const u=(l==null?void 0:l.pauseAdDelay)??5e3,[A,S]=n.useState(!1),[g,y]=n.useState(!1),m=n.useRef(),o=s==null?void 0:s[0].url,f=n.useRef(o),x=n.useRef("");f.current=o;const[k,j]=D(),c=n.useCallback(()=>{p&&(x.current=f.current,P.eventBus.emit("exposedPauseAd",{action:"closed",payload:{}}),p())},[p]),E=n.useCallback(()=>{t.controlVideoPlayer({play:!0})},[t]);return n.useEffect(()=>{if(e&&o){P.eventBus.emit("exposedPauseAd",{action:"enabled",payload:{}}),k(o).then(b=>{f.current===o&&(b==null?void 0:b.success)!==!0&&(clearTimeout(m.current),c==null||c())}).catch(()=>{f.current===o&&(clearTimeout(m.current),c==null||c())});const w=()=>{const b=j.get()[f.current];b!=null&&b.imageSrc?(clearTimeout(m.current),y(!1),S(!0)):m.current=setTimeout(()=>{w()},200)};m.current=setTimeout(()=>{w()},u)}else x.current!==f.current&&(x.current="",P.eventBus.emit("exposedPauseAd",{action:"disabled",payload:{}})),y(!0),m.current=setTimeout(()=>{S(!1)},400);return()=>{m.current&&clearTimeout(m.current)}},[j,k,c,u,e,o]),n.useEffect(()=>{d==null||d({rendered:A})},[A,d]),n.useEffect(()=>()=>{d==null||d({rendered:!1})},[d]),A?r.jsx(X,{onClose:c,isClosing:g,title:a,caption:i,onPlay:E,vastUrl:o,options:l,isDesktop:h}):null},Z=({showPauseAd:e,pauseAdVastUrl:s,videoPlayerController:a,onRenderPauseAd:i,onClosePauseAd:t,children:p,options:d})=>{const l=R.B(),h=R.z(),u=n.useRef();return n.useEffect(()=>l?(a&&(u.current=a,l.addVideoPlayerController(u.current)),()=>{u.current&&l.removeVideoPlayerController(u.current)}):()=>{},[l,a]),l?r.jsx("div",{className:"StreamLayerSDK",children:r.jsxs(L.h,{style:p?{position:"relative"}:{},customTheme:h.theme,themeMode:h.themeMode,children:[p,s&&r.jsx(Y,{sdk:l,showPauseAd:e,vastUrls:s,onClose:t,onRender:i,options:d,isDesktop:!0})]})}):p};class ee extends n.Component{constructor(s){super(s),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(s,a){console.error(s,a.componentStack)}render(){return this.state.hasError?this.props.children:r.jsx(Z,{...this.props})}}exports.StreamLayerPauseAd=ee;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),L=require("./index7.js"),l=require("./sl-types.js"),q=require("./index14.js"),s=require("react"),j=require("./index3.js"),D=require("./hooks-B0Qttldg.js"),U=l.styled_default("div")({name:"PauseAdOverlay",class:"pw9gih8",propsAsIs:!1}),M=l.styled_default("div")({name:"PauseAdContent",class:"p8lpomy",propsAsIs:!1}),F=l.styled_default("div")({name:"PauseAdTopLeft",class:"pv7u167",propsAsIs:!1}),N=l.styled_default("h2")({name:"PauseAdTitle",class:"p1kh2yb0",propsAsIs:!1}),O=l.styled_default("p")({name:"PauseAdCaption",class:"pl8f94x",propsAsIs:!1}),V=l.styled_default("div")({name:"PauseAdBottomLeft",class:"p1m6zmrt",propsAsIs:!1}),z=l.styled_default("button")({name:"PauseAdPlayButton",class:"pm3vwfa",propsAsIs:!1}),K=l.styled_default("div")({name:"PauseAdSidebarGradient",class:"p1tibuhw",propsAsIs:!1}),G=l.styled_default("div")({name:"PauseAdSidebar",class:"ptqqrqd",propsAsIs:!1}),Q=l.styled_default("span")({name:"PauseAdTitleDescription",class:"p14estxv",propsAsIs:!1}),w=l.styled_default("img")({name:"ExternalAdContainer",class:"e1dpvfl1",propsAsIs:!1}),W=({vastUrl:i,isDesktop:a,content:e})=>(s.useEffect(()=>{e.imageSrc&&e.id&&j.eventBus.emit("exposedPauseAd",{action:"rendered",payload:{id:e.id,parentId:e.parentId}})},[e,i]),e!=null&&e.imageSrc?!e.adUrl||!a?r.jsx(w,{src:e.imageSrc}):r.jsx("a",{onClick:()=>{j.eventBus.emit("exposedPauseAd",{action:"navigated",payload:{id:e.id,parentId:e.parentId}})},href:e.adUrl,target:"_blank",rel:"noopener noreferrer",children:r.jsx(w,{src:e.imageSrc})}):null),X=({isClosing:i,content:a,externalPauseAdStore:e,title:x,caption:m,onPlay:c,onClose:u,vastUrl:n,options:v,isDesktop:d})=>{const k=(v==null?void 0:v.showPauseButton)??!0,{ref:p,focusSelf:P}=q.distExports.useFocusable({focusKey:"sl-pause-ad-play",onEnterRelease:c,isFocusBoundary:!0,forceFocus:!0});return s.useEffect(()=>()=>{e.revalidate()},[e]),s.useEffect(()=>{p.current&&P()},[p,P]),s.useEffect(()=>{if(!u)return()=>{};const b=A=>{const o=A.keyCode;if(o===461||o===10009||o===27||o===8){A.preventDefault(),A.stopPropagation(),A.stopImmediatePropagation(),u();return}};return window.addEventListener("keydown",b,{capture:!0}),()=>window.removeEventListener("keydown",b,{capture:!0})},[u]),r.jsx(U,{className:l.cx_default("SL_PauseAdOverlay",i&&"pause-ad-closing"),children:r.jsxs(M,{children:[r.jsxs(F,{children:[r.jsx(N,{children:x}),r.jsx(O,{children:m})]}),k&&r.jsx(V,{children:r.jsx(z,{ref:p,onClick:c,onMouseEnter:()=>p.current.focus(),"aria-label":"Resume playback"})}),r.jsx(K,{className:"SL_PauseAdSidebar",children:r.jsxs(G,{children:[n&&r.jsx(W,{content:a,isDesktop:d,vastUrl:n}),r.jsx(Q,{children:"ADVERTISEMENT"})]})})]})})},$=({showPauseAd:i,vastUrls:a,title:e,caption:x,sdk:m,onClose:c,onRender:u,options:n,isDesktop:v})=>{const d=(n==null?void 0:n.pauseAdDelay)??0,k=(n==null?void 0:n.pauseAdRefetchInterval)??1e3*60*50,[p,P]=s.useState(!1),[b,A]=s.useState(!1),o=s.useRef(),y=a==null?void 0:a[0].url,h=s.useRef(y),g=s.useRef(""),I=s.useRef("");h.current=y;const[f,R]=m.advertisement.getExternalPauseAd(y,{refetchInterval:k,$enabled:d===0||!!i,prefetch:d===0&&k>0}),S=l.useStore(f),E=s.useCallback(()=>{if(c){I.current=h.current;const t=f.get().data;j.eventBus.emit("exposedPauseAd",{action:"closed",payload:(t==null?void 0:t.url)===I.current?{id:t==null?void 0:t.id,parentId:t==null?void 0:t.parentId}:{}}),c()}},[c,f]),B=s.useCallback(()=>{m.controlVideoPlayer({play:!0})},[m]);return s.useEffect(()=>{R===h.current&&S.error&&(console.log("error",S.error),clearTimeout(o.current),E==null||E())},[S,E,R]),s.useEffect(()=>{if(i&&y){g.current=h.current,I.current="";const t=f.get().data;j.eventBus.emit("exposedPauseAd",{action:"enabled",payload:(t==null?void 0:t.url)===g.current?{id:t==null?void 0:t.id,parentId:t==null?void 0:t.parentId}:{}});const _=()=>{const T=f.get(),C=T.data;(C==null?void 0:C.url)===h.current&&(!T.loading&&C!=null&&C.imageSrc?(clearTimeout(o.current),A(!1),P(!0)):T.loading&&(o.current=setTimeout(()=>{console.log("checkAndAllowRender timeout"),_()},200)))};clearTimeout(o.current),o.current=setTimeout(()=>{_()},d)}else{if(I.current!==h.current){const t=f.get().data;I.current="",g.current!==""&&(j.eventBus.emit("exposedPauseAd",{action:"disabled",payload:g.current===(t==null?void 0:t.url)?{id:t==null?void 0:t.id,parentId:t==null?void 0:t.parentId}:{}}),g.current="")}A(!0),o.current=setTimeout(()=>{P(!1)},400)}return()=>{o.current&&clearTimeout(o.current)}},[f,E,d,i,y]),s.useEffect(()=>{u==null||u({rendered:p})},[p,u]),s.useEffect(()=>()=>{u==null||u({rendered:!1})},[u]),!p||!S.data?null:r.jsx(X,{onClose:E,isClosing:b,title:e,caption:x,onPlay:B,vastUrl:y,options:n,isDesktop:v,externalPauseAdStore:f,content:S.data})},H=({showPauseAd:i,pauseAdVastUrl:a,videoPlayerController:e,onRenderPauseAd:x,onClosePauseAd:m,children:c,options:u})=>{const n=D.B(),v=D.z(),d=s.useRef();return s.useEffect(()=>n?(e&&(d.current=e,n.addVideoPlayerController(d.current)),()=>{d.current&&n.removeVideoPlayerController(d.current)}):()=>{},[n,e]),n?r.jsx("div",{className:"StreamLayerSDK",children:r.jsxs(L.h,{style:c?{position:"relative"}:{},customTheme:v.theme,themeMode:v.themeMode,children:[c,a&&r.jsx($,{sdk:n,showPauseAd:i,vastUrls:a,onClose:m,onRender:x,options:u,isDesktop:!0})]})}):c};class J extends s.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a,e){console.error(a,e.componentStack)}render(){return this.state.hasError?this.props.children:r.jsx(H,{...this.props})}}exports.StreamLayerPauseAd=J;
package/lib/cjs/points.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("./index8.js"),u=require("react"),n=require("./sl-types.js"),r=require("./index3.js"),m=require("./index5.js"),y=require("./theme.js"),S=require("./index6.js"),h=require("./useStreamLayerApp2.js"),c=require("./hooks-B0Qttldg.js"),x=n.styled_default("div")({name:"PointsContainer",class:"psiob9b",propsAsIs:!1}),v=n.styled_default("div")({name:"PointsIcon",class:"p1gqe4lh",propsAsIs:!1}),f=()=>S.B1,j=n.styled_default(f())({name:"PointsSvg",class:"p15syg2y",propsAsIs:!0}),q=n.styled_default("div")({name:"PointsBody",class:"p12n4f2h",propsAsIs:!1}),g=n.styled_default("div")({name:"PointsTitle",class:"poqmx89",propsAsIs:!1}),P=n.styled_default("div")({name:"PointsValue",class:"prj9b3v",propsAsIs:!1}),b=({points:s,onClick:t})=>e.jsxs(x,{className:y.m,onClick:t,children:[e.jsx(v,{children:e.jsx(j,{name:"icon-trophy-solid"})}),e.jsxs(q,{children:[e.jsx(g,{children:"Total points"}),e.jsx(P,{children:e.jsx(m.d,{value:s})})]})]}),k=({gamification:s})=>{const t=s.userSummary.$store,[a,d]=u.useState(0);return u.useEffect(()=>{const o=t.subscribe(i=>{var l;(l=i==null?void 0:i.summary)!=null&&l.points&&d(i.summary.points)});return()=>{o()}},[t]),e.jsx(b,{points:a,onClick:()=>{const o=s.status.get();o===r.FeatureStatus.Suspended?(s.openFeature(),r.eventBus.emit("app",{action:"open",payload:{}}),r.eventBus.emit("interactions",{action:"tap",payload:{}})):o===r.FeatureStatus.Ready&&(s.closeFeature(!1),r.eventBus.emit("app",{action:"close",payload:{}}),r.eventBus.emit("interactions",{action:"tap",payload:{}}))}})},A=({sdk:s})=>{if(!n.useStore(s.featuresList.getStore()))return null;const t=s.getFeature(h.SdkOverlayType.GAMES);return t?e.jsx(k,{gamification:t}):null},B=({theme:s})=>{const t=c.B(),a=c.z();return t?e.jsx("div",{className:"StreamLayerSDK",children:e.jsx(p.h,{customTheme:s??a.theme,themeMode:a.themeMode,children:e.jsx(A,{sdk:t})})}):null};exports.StreamLayerSDKPoints=B;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("./index7.js"),u=require("react"),n=require("./sl-types.js"),r=require("./index3.js"),m=require("./index5.js"),y=require("./theme.js"),S=require("./index6.js"),h=require("./useStreamLayerApp2.js"),c=require("./hooks-B0Qttldg.js"),x=n.styled_default("div")({name:"PointsContainer",class:"psiob9b",propsAsIs:!1}),v=n.styled_default("div")({name:"PointsIcon",class:"p1gqe4lh",propsAsIs:!1}),f=()=>S.B1,j=n.styled_default(f())({name:"PointsSvg",class:"p15syg2y",propsAsIs:!0}),q=n.styled_default("div")({name:"PointsBody",class:"p12n4f2h",propsAsIs:!1}),g=n.styled_default("div")({name:"PointsTitle",class:"poqmx89",propsAsIs:!1}),P=n.styled_default("div")({name:"PointsValue",class:"prj9b3v",propsAsIs:!1}),b=({points:s,onClick:t})=>e.jsxs(x,{className:y.m,onClick:t,children:[e.jsx(v,{children:e.jsx(j,{name:"icon-trophy-solid"})}),e.jsxs(q,{children:[e.jsx(g,{children:"Total points"}),e.jsx(P,{children:e.jsx(m.d,{value:s})})]})]}),k=({gamification:s})=>{const t=s.userSummary.$store,[a,d]=u.useState(0);return u.useEffect(()=>{const o=t.subscribe(i=>{var l;(l=i==null?void 0:i.summary)!=null&&l.points&&d(i.summary.points)});return()=>{o()}},[t]),e.jsx(b,{points:a,onClick:()=>{const o=s.status.get();o===r.FeatureStatus.Suspended?(s.openFeature(),r.eventBus.emit("app",{action:"open",payload:{}}),r.eventBus.emit("interactions",{action:"tap",payload:{}})):o===r.FeatureStatus.Ready&&(s.closeFeature(!1),r.eventBus.emit("app",{action:"close",payload:{}}),r.eventBus.emit("interactions",{action:"tap",payload:{}}))}})},A=({sdk:s})=>{if(!n.useStore(s.featuresList.getStore()))return null;const t=s.getFeature(h.SdkOverlayType.GAMES);return t?e.jsx(k,{gamification:t}):null},B=({theme:s})=>{const t=c.B(),a=c.z();return t?e.jsx("div",{className:"StreamLayerSDK",children:e.jsx(p.h,{customTheme:s??a.theme,themeMode:a.themeMode,children:e.jsx(A,{sdk:t})})}):null};exports.StreamLayerSDKPoints=B;
@@ -1 +1 @@
1
- "use strict";const s=require("react/jsx-runtime"),e=require("./sl-types.js"),j=require("./index12.js"),u=require("./index9.js"),c=require("./index6.js"),t=require("./useStreamLayerApp2.js"),r=e.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),S=e.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),A=e.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Q=e.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),T=()=>c.B1,i=e.styled_default(T())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),f=()=>i,_=e.styled_default(f())({name:"QuestionCheckIcon",class:"qxlt78s",propsAsIs:!0}),h=()=>c.B1,k=e.styled_default(h())({name:"QuestionTypeIcon",class:"qmg0vkx",propsAsIs:!0}),v=e.styled_default("div")({name:"QuestionTypeLabel",class:"q1uz5j1g",propsAsIs:!1}),L=e.styled_default("div")({name:"QuestionContent",class:"qc3icwa",propsAsIs:!1}),p=e.styled_default("button")({name:"PlayButton",class:"p169lohr",propsAsIs:!1}),P=e.styled_default("div")({name:"SkeletonContainer",class:"s1f43z3r",propsAsIs:!1}),E=()=>u.e,N=e.styled_default(E())({name:"SkeletonButton",class:"s16k8geu",propsAsIs:!0}),b={[t.PickHistoryStatus.LOST]:s.jsx(i,{name:"incorrectVoted"}),[t.PickHistoryStatus.WON]:s.jsx(_,{name:"icon-check"}),[t.PickHistoryStatus.UNSET]:s.jsx(i,{name:"icon-arrow"}),[t.PickHistoryStatus.DNP]:s.jsx(i,{name:"icon-arrow"})},g=()=>s.jsxs(P,{children:[s.jsx(u.i,{loading:!0,style:{width:"35%"}}),s.jsx(u.i,{loading:!0,style:{width:"70%"}}),s.jsx(N,{})]}),y=({questionTypeData:a,questionType:n,questionStatus:o})=>s.jsxs(S,{className:"SL_QuestionCaption",children:[s.jsx(k,{className:"SL_QuestionTypeIcon","data-testid":"question-type-icon","data-type-trivia":n===t.QuestionType.TRIVIA,"data-type-poll":n===t.QuestionType.POLL,name:a.iconName}),s.jsxs(v,{className:"SL_QuestionTypeLabel",children:[a.label,n===t.QuestionType.TRIVIA&&o===t.QuestionStatus.RESOLVED&&" • Expired"]})]}),w=({questionId:a,questionType:n,questionStatus:o,subject:m,openForVoting:q,status:x})=>{const l=j.e[n],I=b[x];return l?s.jsxs(r,{"data-a":"intr","data-name":a,children:[s.jsxs(L,{children:[s.jsx(y,{questionTypeData:l,questionType:n,questionStatus:o}),s.jsx(A,{children:m||""})]}),s.jsx(Q,{children:q?s.jsx(p,{"data-a":"intr","data-name":a,children:"Play"}):I})]}):null};var d;(function(a){a.OPENED="opened"})(d||(d={}));exports.D=g;exports.R=w;exports.S=p;exports.r=r;exports.x=y;
1
+ "use strict";const s=require("react/jsx-runtime"),e=require("./sl-types.js"),j=require("./index11.js"),u=require("./index8.js"),c=require("./index6.js"),t=require("./useStreamLayerApp2.js"),r=e.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),S=e.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),A=e.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Q=e.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),T=()=>c.B1,i=e.styled_default(T())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),f=()=>i,_=e.styled_default(f())({name:"QuestionCheckIcon",class:"qxlt78s",propsAsIs:!0}),h=()=>c.B1,k=e.styled_default(h())({name:"QuestionTypeIcon",class:"qmg0vkx",propsAsIs:!0}),v=e.styled_default("div")({name:"QuestionTypeLabel",class:"q1uz5j1g",propsAsIs:!1}),L=e.styled_default("div")({name:"QuestionContent",class:"qc3icwa",propsAsIs:!1}),p=e.styled_default("button")({name:"PlayButton",class:"p169lohr",propsAsIs:!1}),P=e.styled_default("div")({name:"SkeletonContainer",class:"s1f43z3r",propsAsIs:!1}),E=()=>u.e,N=e.styled_default(E())({name:"SkeletonButton",class:"s16k8geu",propsAsIs:!0}),b={[t.PickHistoryStatus.LOST]:s.jsx(i,{name:"incorrectVoted"}),[t.PickHistoryStatus.WON]:s.jsx(_,{name:"icon-check"}),[t.PickHistoryStatus.UNSET]:s.jsx(i,{name:"icon-arrow"}),[t.PickHistoryStatus.DNP]:s.jsx(i,{name:"icon-arrow"})},g=()=>s.jsxs(P,{children:[s.jsx(u.i,{loading:!0,style:{width:"35%"}}),s.jsx(u.i,{loading:!0,style:{width:"70%"}}),s.jsx(N,{})]}),y=({questionTypeData:a,questionType:n,questionStatus:o})=>s.jsxs(S,{className:"SL_QuestionCaption",children:[s.jsx(k,{className:"SL_QuestionTypeIcon","data-testid":"question-type-icon","data-type-trivia":n===t.QuestionType.TRIVIA,"data-type-poll":n===t.QuestionType.POLL,name:a.iconName}),s.jsxs(v,{className:"SL_QuestionTypeLabel",children:[a.label,n===t.QuestionType.TRIVIA&&o===t.QuestionStatus.RESOLVED&&" • Expired"]})]}),w=({questionId:a,questionType:n,questionStatus:o,subject:m,openForVoting:q,status:x})=>{const l=j.e[n],I=b[x];return l?s.jsxs(r,{"data-a":"intr","data-name":a,children:[s.jsxs(L,{children:[s.jsx(y,{questionTypeData:l,questionType:n,questionStatus:o}),s.jsx(A,{children:m||""})]}),s.jsx(Q,{children:q?s.jsx(p,{"data-a":"intr","data-name":a,children:"Play"}):I})]}):null};var d;(function(a){a.OPENED="opened"})(d||(d={}));exports.D=g;exports.R=w;exports.S=p;exports.r=r;exports.x=y;