@streamlayer/react 1.24.5 → 1.24.6

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