@streamlayer/react-ui 0.98.0 → 0.99.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 (114) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/hooks/analytics.js +2 -2
  3. package/lib/{index-jRXrW6ie.js → index-Bicco-Aq.js} +1 -1
  4. package/lib/{index-z0QjLiEL.js → index-CZvwzN5o.js} +1 -1
  5. package/lib/index.js +4 -8
  6. package/lib/ui/app/Features/Gamification/Friends.js +10 -23
  7. package/lib/ui/app/Features/Gamification/Leaderboard.js +30 -45
  8. package/lib/ui/app/Features/Gamification/Question.js +31 -63
  9. package/lib/ui/app/Features/Gamification/QuestionsList.js +8 -34
  10. package/lib/ui/app/Features/Gamification/Tabs.js +25 -82
  11. package/lib/ui/app/Features/Gamification/UserSummary.js +12 -21
  12. package/lib/ui/app/Features/Gamification/gamification-feature.js +2 -93
  13. package/lib/ui/app/Features/Gamification/index.js +58 -141
  14. package/lib/ui/app/Features/index.js +21 -109
  15. package/lib/ui/app/Navigation/MastersNavigation/index.js +16 -22
  16. package/lib/ui/app/Navigation/index.js +9 -12
  17. package/lib/ui/app/Notifications/Onboarding/Notification/index.js +13 -16
  18. package/lib/ui/app/Notifications/Onboarding/Notification/styles.js +18 -20
  19. package/lib/ui/app/Notifications/Onboarding/index.js +61 -89
  20. package/lib/ui/app/Notifications/index.js +124 -156
  21. package/lib/ui/app/Notifications/styles.js +10 -15
  22. package/lib/ui/app/Points/index.js +18 -26
  23. package/lib/ui/app/masters.js +74 -195
  24. package/lib/ui/app/useClipboardCopy.js +11 -15
  25. package/lib/ui/app/useMastersApp.js +34 -44
  26. package/lib/ui/app/useSdkResponsive.js +18 -19
  27. package/lib/ui/app/useSdkScroll.js +5 -6
  28. package/lib/ui/button/index.js +3 -4
  29. package/lib/ui/gamification/copyNotification/index.js +5 -7
  30. package/lib/ui/gamification/detail/header/index.js +15 -18
  31. package/lib/ui/gamification/detail/header/styles.js +12 -14
  32. package/lib/ui/gamification/detail/sponsor/index.js +2 -3
  33. package/lib/ui/gamification/insight/index.js +5 -6
  34. package/lib/ui/gamification/insight-list/index.js +3 -6
  35. package/lib/ui/gamification/invite-link/index.js +11 -17
  36. package/lib/ui/gamification/invite-link/styles.js +13 -15
  37. package/lib/ui/gamification/leaderboard/index.js +21 -28
  38. package/lib/ui/gamification/leaderboard/list-item/index.js +19 -22
  39. package/lib/ui/gamification/leaderboard/list-item/styles.js +16 -18
  40. package/lib/ui/gamification/leaderboard/static.js +19 -23
  41. package/lib/ui/gamification/leaderboard/styles.js +1 -1
  42. package/lib/ui/gamification/onboarding/index.js +51 -73
  43. package/lib/ui/gamification/onboarding/invitingUser/index.js +10 -11
  44. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +3 -2
  45. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +17 -20
  46. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +2 -0
  47. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +21 -11
  48. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +21 -30
  49. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.js +22 -24
  50. package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.js +5 -7
  51. package/lib/ui/gamification/onboarding/slides/onboarding-terms/index.js +2 -3
  52. package/lib/ui/gamification/onboarding/styles.js +14 -17
  53. package/lib/ui/gamification/points/index.js +9 -15
  54. package/lib/ui/gamification/points/styles.js +12 -14
  55. package/lib/ui/gamification/question/index.js +22 -26
  56. package/lib/ui/gamification/question/insight/index.js +7 -15
  57. package/lib/ui/gamification/question/list/index.js +33 -54
  58. package/lib/ui/gamification/question/notification/index.js +22 -35
  59. package/lib/ui/gamification/question/notification/insight/index.js +12 -17
  60. package/lib/ui/gamification/question/notification/pill/index.js +7 -9
  61. package/lib/ui/gamification/question/notification/prediction-result/animation-lines/index.js +11 -12
  62. package/lib/ui/gamification/question/notification/prediction-result/index.js +45 -51
  63. package/lib/ui/gamification/question/notification/prediction-result/styles.js +23 -26
  64. package/lib/ui/gamification/question/notification/styles.js +17 -19
  65. package/lib/ui/gamification/question/notification/tweet/index.js +8 -18
  66. package/lib/ui/gamification/question/styles.js +32 -34
  67. package/lib/ui/gamification/question/twitter/index.js +8 -20
  68. package/lib/ui/gamification/question/twitter/styles.js +4 -6
  69. package/lib/ui/gamification/tabs/index.js +6 -7
  70. package/lib/ui/gamification/user-statistics/components/rank/index.js +4 -5
  71. package/lib/ui/gamification/user-statistics/components/statistic/index.js +0 -1
  72. package/lib/ui/gamification/user-statistics/index.js +2 -6
  73. package/lib/ui/gamification/vote/expired-alert/index.js +8 -10
  74. package/lib/ui/gamification/vote/feedback/index.js +35 -39
  75. package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
  76. package/lib/ui/gamification/vote/feedback/styles.js +31 -29
  77. package/lib/ui/gamification/vote/index.js +108 -117
  78. package/lib/ui/gamification/vote/insight-details/index.js +9 -16
  79. package/lib/ui/gamification/vote/twitter-details/index.js +7 -17
  80. package/lib/ui/gamification/vote/vote-option/index.js +33 -34
  81. package/lib/ui/gamification/vote/vote-option/styles.js +24 -26
  82. package/lib/ui/gamification/vote/win-bar/index.js +29 -37
  83. package/lib/ui/gamification/vote/win-bar/styles.js +16 -19
  84. package/lib/ui/login/demo.d.ts +1 -0
  85. package/lib/ui/login/demo.js +5 -17
  86. package/lib/ui/login/index.js +29 -35
  87. package/lib/ui/modal/index.d.ts +0 -1
  88. package/lib/ui/modal/index.js +45 -38
  89. package/lib/ui/navigation/button/Channels.js +5 -8
  90. package/lib/ui/navigation/button/FeaturedGroups.js +3 -6
  91. package/lib/ui/navigation/button/LeaderBoard.js +8 -11
  92. package/lib/ui/navigation/button/index.js +10 -11
  93. package/lib/ui/navigation/masters.js +2 -3
  94. package/lib/ui/questions/insight/index.js +14 -19
  95. package/lib/ui/questions/twitter/account/index.js +13 -15
  96. package/lib/ui/questions/twitter/account/styles.js +14 -16
  97. package/lib/ui/questions/twitter/index.js +31 -38
  98. package/lib/ui/skeleton/index.js +3 -4
  99. package/lib/ui/theme/constants.js +1 -1
  100. package/lib/ui/theme/index.js +3 -5
  101. package/lib/ui/theme/theme.js +16 -14
  102. package/lib/ui/video-player/index.js +44 -38
  103. package/lib/utils/createDemo.js +18 -28
  104. package/lib/utils/debug/components/copyLogs.js +2 -3
  105. package/lib/utils/debug/components/developer.js +20 -24
  106. package/lib/utils/debug/components/eventInput.js +9 -10
  107. package/lib/utils/debug/components/sdkKey.js +9 -10
  108. package/lib/utils/debug/index.js +17 -28
  109. package/lib/utils/debug/storage.js +32 -14
  110. package/lib/utils/decorators/container.js +5 -9
  111. package/lib/utils/storage.js +32 -14
  112. package/package.json +25 -25
  113. /package/lib/{index-uEuzH3jr.js → index-xuotMAFm.js} +0 -0
  114. /package/lib/{styles_z07sl8-w40geAFS.js → styles_z07sl8-l0sNRNKZ.js} +0 -0
@@ -4,11 +4,7 @@ import { abbreviate as v, formatDecimals as L } from "../../../utils/common.js";
4
4
  import { Rank as C } from "./components/rank/index.js";
5
5
  import { Statistic as c } from "./components/statistic/index.js";
6
6
  import { Container as w, TopInfo as V, User as g, UserAccountBtn as k, Avatar as I, AvatarPlaceholder as S, UserInfo as x, UserName as H, UserRating as R, Rts as U, TrophyIcon as b, RtsIndicator as u, RtsLabel as y, Divider as T, BottomInfo as M, Ranks as Z, Statistics as A } from "./styles.js";
7
- import "../../skeleton/styles.js";
8
- import "@linaria/react";
9
- import "./components/rank/styles.js";
10
- import "./components/statistic/styles.js";
11
- const B = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Trophy'%3e%3cpath%20id='Combined%20Shape'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.69197%204.66662C3.69197%205.99705%203.92914%207.17787%204.4035%208.20912C3.49966%208.02451%202.74487%207.66486%202.1391%207.13014C1.53333%206.59542%201.23046%206.0798%201.23046%205.58328V4.66662H3.69197ZM14.7686%204.66662V5.58328C14.7686%206.0798%2014.4658%206.59542%2013.86%207.13014C13.2542%207.66486%2012.4994%208.02451%2011.5956%208.20912C12.0699%207.17787%2012.3071%205.99705%2012.3071%204.66662H14.7686ZM15.9998%205.58329V4.36108C15.9998%204.10645%2015.9101%203.89002%2015.7306%203.71178C15.5511%203.53354%2015.3332%203.44442%2015.0768%203.44442H12.3076V2.52776C12.3076%202.10763%2012.1569%201.74797%2011.8556%201.44878C11.5544%201.14959%2011.1922%201%2010.7691%201H5.23072C4.80764%201%204.44547%201.14959%204.14419%201.44878C3.84291%201.74797%203.69227%202.10763%203.69227%202.52776V3.44442H0.923068C0.666659%203.44442%200.448714%203.53354%200.269228%203.71178C0.0897418%203.89002%200%204.10645%200%204.36108V5.58329C0%206.03525%200.13301%206.49039%200.399034%206.94872C0.665059%207.40705%201.02403%207.82082%201.47595%208.19003C1.92787%208.55924%202.48234%208.86957%203.13939%209.12101C3.79644%209.37246%204.48713%209.51409%205.21149%209.54592C5.48071%209.88967%205.7852%2010.192%206.12494%2010.453C6.36853%2010.6695%206.53679%2010.9002%206.62974%2011.1453C6.72269%2011.3904%206.76916%2011.6752%206.76916%2011.9999C6.76916%2012.3436%206.67141%2012.6333%206.4759%2012.8688C6.28038%2013.1043%205.96789%2013.2221%205.53841%2013.2221C5.05764%2013.2221%204.62976%2013.3669%204.25476%2013.6566C3.87977%2013.9462%203.69227%2014.3106%203.69227%2014.7499V15.361C3.69227%2015.4501%203.72112%2015.5233%203.77881%2015.5806C3.8365%2015.6379%203.91022%2015.6665%203.99996%2015.6665H11.9999C12.0896%2015.6665%2012.1633%2015.6379%2012.221%2015.5806C12.2787%2015.5233%2012.3076%2015.4501%2012.3076%2015.361V14.7499C12.3076%2014.3106%2012.1201%2013.9462%2011.7451%2013.6566C11.3701%2013.3669%2010.9422%2013.2221%2010.4614%2013.2221C10.0319%2013.2221%209.71945%2013.1043%209.52394%2012.8688C9.32843%2012.6333%209.23068%2012.3436%209.23068%2011.9999C9.23068%2011.6752%209.27715%2011.3904%209.3701%2011.1453C9.46305%2010.9002%209.63131%2010.6695%209.8749%2010.453C10.2146%2010.192%2010.5191%209.88967%2010.7884%209.54592C11.5127%209.51409%2012.2034%209.37246%2012.8604%209.12101C13.5175%208.86957%2014.072%208.55924%2014.5239%208.19003C14.9758%207.82082%2015.3348%207.40705%2015.6008%206.94872C15.8668%206.49039%2015.9998%206.03525%2015.9998%205.58329ZM6.76047%207.1798L8.05109%206.49997L9.3417%207.1798L9.09521%205.73989L10.1393%204.72015L8.69639%204.51007L8.05109%203.2L7.40578%204.51007L5.96283%204.72015L7.00696%205.73989L6.76047%207.1798Z'%20fill='%23F2C94C'/%3e%3c/g%3e%3c/svg%3e", z = ({
7
+ const B = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Trophy'%3e%3cpath%20id='Combined%20Shape'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.69197%204.66662C3.69197%205.99705%203.92914%207.17787%204.4035%208.20912C3.49966%208.02451%202.74487%207.66486%202.1391%207.13014C1.53333%206.59542%201.23046%206.0798%201.23046%205.58328V4.66662H3.69197ZM14.7686%204.66662V5.58328C14.7686%206.0798%2014.4658%206.59542%2013.86%207.13014C13.2542%207.66486%2012.4994%208.02451%2011.5956%208.20912C12.0699%207.17787%2012.3071%205.99705%2012.3071%204.66662H14.7686ZM15.9998%205.58329V4.36108C15.9998%204.10645%2015.9101%203.89002%2015.7306%203.71178C15.5511%203.53354%2015.3332%203.44442%2015.0768%203.44442H12.3076V2.52776C12.3076%202.10763%2012.1569%201.74797%2011.8556%201.44878C11.5544%201.14959%2011.1922%201%2010.7691%201H5.23072C4.80764%201%204.44547%201.14959%204.14419%201.44878C3.84291%201.74797%203.69227%202.10763%203.69227%202.52776V3.44442H0.923068C0.666659%203.44442%200.448714%203.53354%200.269228%203.71178C0.0897418%203.89002%200%204.10645%200%204.36108V5.58329C0%206.03525%200.13301%206.49039%200.399034%206.94872C0.665059%207.40705%201.02403%207.82082%201.47595%208.19003C1.92787%208.55924%202.48234%208.86957%203.13939%209.12101C3.79644%209.37246%204.48713%209.51409%205.21149%209.54592C5.48071%209.88967%205.7852%2010.192%206.12494%2010.453C6.36853%2010.6695%206.53679%2010.9002%206.62974%2011.1453C6.72269%2011.3904%206.76916%2011.6752%206.76916%2011.9999C6.76916%2012.3436%206.67141%2012.6333%206.4759%2012.8688C6.28038%2013.1043%205.96789%2013.2221%205.53841%2013.2221C5.05764%2013.2221%204.62976%2013.3669%204.25476%2013.6566C3.87977%2013.9462%203.69227%2014.3106%203.69227%2014.7499V15.361C3.69227%2015.4501%203.72112%2015.5233%203.77881%2015.5806C3.8365%2015.6379%203.91022%2015.6665%203.99996%2015.6665H11.9999C12.0896%2015.6665%2012.1633%2015.6379%2012.221%2015.5806C12.2787%2015.5233%2012.3076%2015.4501%2012.3076%2015.361V14.7499C12.3076%2014.3106%2012.1201%2013.9462%2011.7451%2013.6566C11.3701%2013.3669%2010.9422%2013.2221%2010.4614%2013.2221C10.0319%2013.2221%209.71945%2013.1043%209.52394%2012.8688C9.32843%2012.6333%209.23068%2012.3436%209.23068%2011.9999C9.23068%2011.6752%209.27715%2011.3904%209.3701%2011.1453C9.46305%2010.9002%209.63131%2010.6695%209.8749%2010.453C10.2146%2010.192%2010.5191%209.88967%2010.7884%209.54592C11.5127%209.51409%2012.2034%209.37246%2012.8604%209.12101C13.5175%208.86957%2014.072%208.55924%2014.5239%208.19003C14.9758%207.82082%2015.3348%207.40705%2015.6008%206.94872C15.8668%206.49039%2015.9998%206.03525%2015.9998%205.58329ZM6.76047%207.1798L8.05109%206.49997L9.3417%207.1798L9.09521%205.73989L10.1393%204.72015L8.69639%204.51007L8.05109%203.2L7.40578%204.51007L5.96283%204.72015L7.00696%205.73989L6.76047%207.1798Z'%20fill='%23F2C94C'/%3e%3c/g%3e%3c/svg%3e", O = ({
12
8
  loading: t,
13
9
  avatar: n,
14
10
  name: o,
@@ -59,5 +55,5 @@ const B = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200
59
55
  ] })
60
56
  ] });
61
57
  export {
62
- z as UserStatistics
58
+ O as UserStatistics
63
59
  };
@@ -1,13 +1,11 @@
1
- import { jsxs as e, jsx as r } from "react/jsx-runtime";
2
- import { SvgIcon as t } from "../../../icons/index.js";
3
- import { Container as c, Title as n, Description as m } from "./styles.js";
4
- import "@linaria/react";
5
- import "react";
6
- const x = ({ title: i, description: o }) => /* @__PURE__ */ e(c, { children: [
7
- /* @__PURE__ */ r(t, { name: "icon-check-circle" }),
8
- /* @__PURE__ */ r(n, { children: i }),
9
- /* @__PURE__ */ r(m, { children: o })
1
+ import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
+ import { SvgIcon as c } from "../../../icons/index.js";
3
+ import { Container as n, Title as t, Description as m } from "./styles.js";
4
+ const d = ({ title: e, description: i }) => /* @__PURE__ */ o(n, { children: [
5
+ /* @__PURE__ */ r(c, { name: "icon-check-circle" }),
6
+ /* @__PURE__ */ r(t, { children: e }),
7
+ /* @__PURE__ */ r(m, { children: i })
10
8
  ] });
11
9
  export {
12
- x as ExpiredAlert
10
+ d as ExpiredAlert
13
11
  };
@@ -1,73 +1,69 @@
1
- import { jsx as i, jsxs as n, Fragment as e } from "react/jsx-runtime";
2
- import { QuestionType as r } from "@streamlayer/sdk-web-types";
1
+ import { jsx as i, jsxs as n } from "react/jsx-runtime";
2
+ import { QuestionType as e } from "@streamlayer/sdk-web-types";
3
3
  import { SvgIcon as h } from "../../../icons/index.js";
4
- import { ShowInContainer as C, Container as L, IconPrediction as W, FeedbackDescription as l, FeedbackIconWrap as a, FeedbackHeader as F, FeedbackText as k, DynamicWrap as Y, FeedbackTitle as E } from "./styles.js";
5
- import "@linaria/react";
6
- import "react";
7
- import "../../../show-in/index.js";
8
- import "@linaria/core";
9
- const _ = ({
4
+ import { ShowInContainer as j, Container as L, FeedbackContainer as l, IconPrediction as C, FeedbackDescription as r, FeedbackIconWrap as a, FeedbackHeader as F, FeedbackText as I, DynamicWrap as Y, FeedbackTitle as E } from "./styles.js";
5
+ const K = ({
10
6
  feedbackMessages: t,
11
- questionVotedCorrectly: u,
7
+ questionVotedCorrectly: P,
12
8
  questionVoted: m,
13
9
  questionType: d,
14
10
  hasCorrectAnswer: b,
15
- showExpiredNotification: x,
16
- showClosedNotificationTrivia: I,
11
+ showExpiredNotification: u,
12
+ showClosedNotificationTrivia: w,
17
13
  votedInCurrentRender: p,
18
- votedAfterQuestionClosed: f,
14
+ votedAfterQuestionClosed: S,
19
15
  voteErrorMessage: c,
20
- enteredAnActiveQuestion: w,
21
- marketClosed: Q,
22
- percentsAnimated: j
16
+ enteredAnActiveQuestion: x,
17
+ marketClosed: W,
18
+ percentsAnimated: Q
23
19
  }) => {
24
- const D = m && (d === r.TRIVIA || d === r.PREDICTION), y = d === r.PREDICTION && !b, O = Q && d === r.PREDICTION && !m && !w || d === r.PREDICTION && f && p && w, R = D && y, T = D && b, N = d === r.PREDICTION && m && p && b, S = m && d === r.POLL && p, P = u ? "correct" : "incorrect", o = u ? t == null ? void 0 : t.correctFeedback : t == null ? void 0 : t.incorrectFeedback;
25
- return x || I || R || T || O || S || N || c ? /* @__PURE__ */ i(C, { enabled: p, animate: j, children: /* @__PURE__ */ n(L, { "data-prediction": y, children: [
26
- c && /* @__PURE__ */ n(e, { children: [
27
- /* @__PURE__ */ i(W, { name: "questionExpired" }),
28
- /* @__PURE__ */ i(l, { children: c })
20
+ const D = m && (d === e.TRIVIA || d === e.PREDICTION), y = d === e.PREDICTION && !b, O = W && d === e.PREDICTION && !m && !x || d === e.PREDICTION && S && p && x, T = D && y, N = D && b, R = d === e.PREDICTION && m && p && b, f = m && d === e.POLL && p, k = P ? "correct" : "incorrect", o = P ? t == null ? void 0 : t.correctFeedback : t == null ? void 0 : t.incorrectFeedback;
21
+ return u || w || T || N || O || f || R || c ? /* @__PURE__ */ i(j, { enabled: p, animate: Q, children: /* @__PURE__ */ n(L, { "data-prediction": y, children: [
22
+ c && /* @__PURE__ */ n(l, { children: [
23
+ /* @__PURE__ */ i(C, { name: "questionExpired" }),
24
+ /* @__PURE__ */ i(r, { children: c })
29
25
  ] }),
30
- !c && x && /* @__PURE__ */ n(e, { children: [
26
+ !c && u && /* @__PURE__ */ n(l, { children: [
31
27
  /* @__PURE__ */ i(a, { children: /* @__PURE__ */ i(h, { name: "questionExpired" }) }),
32
28
  /* @__PURE__ */ n("div", { children: [
33
- /* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(l, { children: "Question Expired" }) }),
34
- /* @__PURE__ */ i(k, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
29
+ /* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(r, { children: "Question Expired" }) }),
30
+ /* @__PURE__ */ i(I, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
35
31
  ] })
36
32
  ] }),
37
- !c && I && /* @__PURE__ */ n(e, { children: [
33
+ !c && w && /* @__PURE__ */ n(l, { children: [
38
34
  /* @__PURE__ */ i(a, { children: /* @__PURE__ */ i(h, { name: "questionExpired" }) }),
39
35
  /* @__PURE__ */ n("div", { children: [
40
- /* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(l, { children: "Question Closed" }) }),
41
- /* @__PURE__ */ i(k, { children: "This question was answered after the moderator closed the question. So the points for this answer won’t tally." })
36
+ /* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(r, { children: "Question Closed" }) }),
37
+ /* @__PURE__ */ i(I, { children: "This question was answered after the moderator closed the question. So the points for this answer won’t tally." })
42
38
  ] })
43
39
  ] }),
44
- !c && O && /* @__PURE__ */ n(e, { children: [
40
+ !c && O && /* @__PURE__ */ n(l, { children: [
45
41
  /* @__PURE__ */ i(a, { children: /* @__PURE__ */ i(h, { name: "questionExpired" }) }),
46
42
  /* @__PURE__ */ n("div", { children: [
47
- /* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(l, { children: "Question Closed" }) }),
48
- /* @__PURE__ */ i(k, { children: "This event has already taken place, so the ability to make a prediction on its outcome is no longer available." })
43
+ /* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(r, { children: "Question Closed" }) }),
44
+ /* @__PURE__ */ i(I, { children: "This event has already taken place, so the ability to make a prediction on its outcome is no longer available." })
49
45
  ] })
50
46
  ] }),
51
- !c && R && /* @__PURE__ */ n(e, { children: [
52
- /* @__PURE__ */ i(W, { name: "icon-prediction" }),
53
- /* @__PURE__ */ n(l, { children: [
47
+ !c && T && /* @__PURE__ */ n(l, { children: [
48
+ /* @__PURE__ */ i(C, { name: "icon-prediction" }),
49
+ /* @__PURE__ */ n(r, { children: [
54
50
  "Your pick has been recorded. ",
55
51
  /* @__PURE__ */ i(Y, { children: "We’ll notify you of the result." })
56
52
  ] })
57
53
  ] }),
58
- !c && S && /* @__PURE__ */ n(e, { children: [
54
+ !c && f && /* @__PURE__ */ n(l, { children: [
59
55
  /* @__PURE__ */ i(a, { "data-feedback-type": "correct", children: /* @__PURE__ */ i(h, { name: "correct" }) }),
60
- /* @__PURE__ */ i(l, { children: "Thanks for answering. Please stay tuned for the next question." })
56
+ /* @__PURE__ */ i(r, { children: "Thanks for answering. Please stay tuned for the next question." })
61
57
  ] }),
62
- !c && (T || N) && !I && /* @__PURE__ */ n(e, { children: [
63
- /* @__PURE__ */ i(a, { "data-feedback-type": P, children: /* @__PURE__ */ i(h, { name: P }) }),
58
+ !c && (N || R) && /* @__PURE__ */ n(l, { children: [
59
+ /* @__PURE__ */ i(a, { "data-feedback-type": k, children: /* @__PURE__ */ i(h, { name: k }) }),
64
60
  /* @__PURE__ */ i("div", { children: /* @__PURE__ */ n(F, { children: [
65
- /* @__PURE__ */ i(E, { "data-feedback-type": P, children: o == null ? void 0 : o.title }),
66
- /* @__PURE__ */ i(l, { children: o == null ? void 0 : o.description })
61
+ /* @__PURE__ */ i(E, { "data-feedback-type": k, children: o == null ? void 0 : o.title }),
62
+ /* @__PURE__ */ i(r, { children: o == null ? void 0 : o.description })
67
63
  ] }) })
68
64
  ] })
69
65
  ] }) }) : null;
70
66
  };
71
67
  export {
72
- _ as Feedback
68
+ K as Feedback
73
69
  };
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export declare const ShowInContainer: any;
3
+ export declare const FeedbackContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
4
  export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
5
  export declare const IconPrediction: any;
5
6
  export declare const FeedbackIconWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -1,54 +1,56 @@
1
1
  import { styled as s } from "@linaria/react";
2
2
  import { SvgIcon as e } from "../../../icons/index.js";
3
3
  import { GrowingShowIn as a } from "../../../show-in/index.js";
4
- import "react/jsx-runtime";
5
- import "react";
6
- import "@linaria/core";
7
- const o = () => a, m = /* @__PURE__ */ s(o())({
4
+ const n = () => a, t = /* @__PURE__ */ s(n())({
8
5
  name: "ShowInContainer",
9
6
  class: "s16sbdnm",
10
7
  propsAsIs: !0
11
- }), l = /* @__PURE__ */ s("div")({
8
+ }), i = /* @__PURE__ */ s("div")({
9
+ name: "FeedbackContainer",
10
+ class: "fbhorgl",
11
+ propsAsIs: !1
12
+ }), d = /* @__PURE__ */ s("div")({
12
13
  name: "Container",
13
- class: "cbhorgl",
14
+ class: "c1g20ja7",
14
15
  propsAsIs: !1
15
- }), n = () => e, I = /* @__PURE__ */ s(n())({
16
+ }), o = () => e, l = /* @__PURE__ */ s(o())({
16
17
  name: "IconPrediction",
17
- class: "i1g20ja7",
18
+ class: "i455ozj",
18
19
  propsAsIs: !0
19
- }), f = /* @__PURE__ */ s("div")({
20
+ }), m = /* @__PURE__ */ s("div")({
20
21
  name: "FeedbackIconWrap",
21
- class: "f455ozj",
22
+ class: "f1913njx",
22
23
  propsAsIs: !1
23
- }), b = /* @__PURE__ */ s("div")({
24
+ }), f = /* @__PURE__ */ s("div")({
24
25
  name: "FeedbackHeader",
25
- class: "f1913njx",
26
+ class: "fzfk69z",
26
27
  propsAsIs: !1
27
- }), k = /* @__PURE__ */ s("span")({
28
+ }), I = /* @__PURE__ */ s("span")({
28
29
  name: "FeedbackTitle",
29
- class: "fzfk69z",
30
+ class: "fx87qaj",
30
31
  propsAsIs: !1
31
- }), F = /* @__PURE__ */ s("span")({
32
+ }), b = /* @__PURE__ */ s("span")({
32
33
  name: "FeedbackDescription",
33
- class: "fx87qaj",
34
+ class: "fvek9ew",
34
35
  propsAsIs: !1
35
- }), A = /* @__PURE__ */ s("div")({
36
+ }), k = /* @__PURE__ */ s("div")({
36
37
  name: "FeedbackText",
37
- class: "fvek9ew",
38
+ class: "f1kbtp09",
38
39
  propsAsIs: !1
39
- }), x = /* @__PURE__ */ s("span")({
40
+ }), F = /* @__PURE__ */ s("span")({
40
41
  name: "DynamicWrap",
41
- class: "d1kbtp09",
42
+ class: "d4i8rro",
42
43
  propsAsIs: !1
43
44
  });
44
45
  export {
45
- l as Container,
46
- x as DynamicWrap,
47
- F as FeedbackDescription,
48
- b as FeedbackHeader,
49
- f as FeedbackIconWrap,
50
- A as FeedbackText,
51
- k as FeedbackTitle,
52
- I as IconPrediction,
53
- m as ShowInContainer
46
+ d as Container,
47
+ F as DynamicWrap,
48
+ i as FeedbackContainer,
49
+ b as FeedbackDescription,
50
+ f as FeedbackHeader,
51
+ m as FeedbackIconWrap,
52
+ k as FeedbackText,
53
+ I as FeedbackTitle,
54
+ l as IconPrediction,
55
+ t as ShowInContainer
54
56
  };
@@ -1,156 +1,147 @@
1
- import { jsx as a, jsxs as L, Fragment as rt } from "react/jsx-runtime";
2
- import { useState as l, useEffect as x, useCallback as D, useRef as et, useMemo as f } from "react";
3
- import { QuestionType as n, QuestionStatus as q } from "@streamlayer/sdk-web-types";
4
- import { ExpiredAlert as it } from "./expired-alert/index.js";
1
+ import { jsx as a, jsxs as j, Fragment as it } from "react/jsx-runtime";
2
+ import { useRef as F, useState as c, useEffect as y, useCallback as x, useMemo as u } from "react";
3
+ import { QuestionType as n, QuestionStatus as N } from "@streamlayer/sdk-web-types";
4
+ import { ExpiredAlert as nt } from "./expired-alert/index.js";
5
5
  import { Feedback as ot } from "./feedback/index.js";
6
- import { QuestionScrollContainer as st, Container as nt, Content as at, Title as ct, Options as mt } from "./styles.js";
7
- import { VotingOption as lt } from "./vote-option/index.js";
8
- import { WinBar as ft } from "./win-bar/index.js";
9
- import "../../icons/index.js";
10
- import "@linaria/react";
11
- import "./expired-alert/styles.js";
12
- import "./feedback/styles.js";
13
- import "../../show-in/index.js";
14
- import "@linaria/core";
15
- import "../../app/styles.js";
16
- import "../../animated-counter/index.js";
17
- import "react-countup";
18
- import "./vote-option/styles.js";
19
- import "../../timer/index.js";
20
- import "react-countdown-circle-timer";
21
- import "../../theme/constants.js";
22
- import "./win-bar/styles.js";
23
- const kt = ({ openedQuestion: t, isLoading: h, vote: A, close: p }) => {
24
- var B, W;
25
- const Y = t.subject, o = t.type, d = t.status, E = (B = t.options) == null ? void 0 : B.options, y = t.marketClosed, C = t.id, [T, F] = l(!1), [V, H] = l(!1), [I, N] = l(!0), [c, _] = l(!1), [S, v] = l(""), [w, z] = l(""), [R, k] = l(!1);
26
- x(() => {
27
- o === n.PREDICTION ? y && N(!1) : d === q.RESOLVED && N(!1);
6
+ import { QuestionScrollContainer as at, Container as ct, Content as lt, Title as mt, Options as ut } from "./styles.js";
7
+ import { VotingOption as ft } from "./vote-option/index.js";
8
+ import { WinBar as dt } from "./win-bar/index.js";
9
+ const Tt = (t, d) => {
10
+ switch (t) {
11
+ case "already_voted":
12
+ return d === n.POLL ? "You’ve already answered this question on another device." : "You’ve already answered this question on another device. So the points for this answer won't tally.";
13
+ default:
14
+ return "Something went wrong, please try again";
15
+ }
16
+ }, Rt = ({ openedQuestion: t, isLoading: d, vote: p, close: V }) => {
17
+ var W, Y;
18
+ const H = t.subject, r = t.type, T = t.status, E = (W = t.options) == null ? void 0 : W.options, I = t.marketClosed, w = t.id, S = F(), [h, _] = c(!1), [R, z] = c(!1), [C, k] = c(!0), [l, G] = c(!1), [M, g] = c(""), [O, J] = c(""), [P, b] = c(!1), [K, U] = c(!1);
19
+ y(() => {
20
+ r === n.PREDICTION ? I && k(!1) : T === N.RESOLVED && k(!1);
28
21
  }, []);
29
- const G = D((e) => {
30
- H(e), F(!0);
31
- }, []), g = et(!1), M = D(
32
- async (e) => {
33
- if (!g.current && (g.current = !0, C)) {
34
- const m = e.currentTarget.value;
35
- v(m);
22
+ const X = x((i) => {
23
+ z(i), _(!0);
24
+ }, []), A = F(!1), L = x(
25
+ async (i) => {
26
+ if (!A.current && (A.current = !0, w)) {
27
+ const m = i.currentTarget.value;
28
+ g(m);
36
29
  try {
37
- await A(C, m);
38
- } catch (j) {
39
- const tt = j.message === "already_voted" ? "You’ve already answered this question on other device. So the points for this answer won't tally." : "Something went wrong, please try again";
40
- z(tt), v(""), console.error("Error while voting", j), g.current = !1;
30
+ await p(w, m);
31
+ } catch (v) {
32
+ J(Tt(v.message, r)), g(""), console.error("Error while voting", v), A.current = !1;
41
33
  }
42
34
  }
43
35
  },
44
- [C, v, A]
45
- ), J = D(() => {
46
- _(!0), setTimeout(p, 3e3);
47
- }, [p]), r = f(
48
- () => t == null ? void 0 : t.answers.find((e) => e.youVoted === !0),
36
+ [r, w, g, p]
37
+ ), Z = x(() => {
38
+ G(!0), setTimeout(V, 3e3);
39
+ }, [V]), e = u(
40
+ () => t == null ? void 0 : t.answers.find((i) => i.youVoted === !0),
49
41
  [t]
50
- ), s = f(
51
- () => !!(t != null && t.answers.find((e) => e.correct === !0)),
42
+ ), o = u(
43
+ () => !!(t != null && t.answers.find((i) => i.correct === !0)),
52
44
  [t]
53
- ), i = f(
54
- () => t == null ? void 0 : t.answers.find((e) => e.correct === !0),
45
+ ), s = u(
46
+ () => t == null ? void 0 : t.answers.find((i) => i.correct === !0),
55
47
  [t]
56
48
  );
57
- x(() => {
58
- let e;
59
- return o === n.PREDICTION && r && T && (e = setTimeout(p, 1e4)), () => {
60
- clearTimeout(e);
61
- };
62
- }, [r]);
63
- const O = f(() => t ? t.answers.map((e) => {
49
+ y(() => {
50
+ r === n.PREDICTION && e && h && !K && (S.current = setTimeout(V, 1e4), U(!0));
51
+ }, [e]), y(() => () => {
52
+ clearTimeout(S.current);
53
+ }, []);
54
+ const D = u(() => t ? t.answers.map((i) => {
64
55
  var m;
65
56
  return {
66
- ...e,
67
- questionVoted: !!r,
68
- youSelected: S === e.id,
69
- isLoading: h,
70
- hasCorrectAnswer: s,
57
+ ...i,
58
+ questionVoted: !!e,
59
+ youSelected: M === i.id,
60
+ isLoading: d,
61
+ hasCorrectAnswer: o,
71
62
  questionType: t.type,
72
- answerTimeExpired: c,
73
- questionStatus: d,
63
+ answerTimeExpired: l,
64
+ questionStatus: T,
74
65
  imageMode: (m = t.appearance) == null ? void 0 : m.images,
75
- onVote: M
66
+ onVote: L
76
67
  };
77
68
  }) : [], [
78
- s,
79
- c,
80
- h,
81
- t,
82
- r,
69
+ o,
70
+ l,
83
71
  d,
84
- M,
85
- S
72
+ t,
73
+ e,
74
+ T,
75
+ L,
76
+ M
86
77
  ]);
87
- x(() => {
88
- const e = O.some(({ percentageDecimal: m }) => m !== 0);
89
- w && !e && k(!0);
90
- }, [O, w]);
91
- const K = E && (E.case === "trivia" || E.case === "prediction") ? E.value : void 0, u = d === q.RESOLVED && o === n.TRIVIA && !r && !I, b = o === n.TRIVIA && V && T && I, P = f(() => o === n.PREDICTION ? !!(r && !s || r && s && (i != null && i.youVoted)) : !0, [o, r, s, i]), U = f(() => {
92
- if (o === n.PREDICTION && r && (!s || s && (i != null && i.youVoted)))
93
- return r.points;
94
- if (!(u || c))
95
- return r ? r.correct ? r.pointsEarned : 0 : i == null ? void 0 : i.points;
96
- }, [c, r, i, u, o, s]), X = f(() => o === n.PREDICTION && r ? s ? s && (i != null && i.youVoted) ? "You won" : "" : "To win" : u || c ? "Time expired" : o === n.POLL ? "Time remaining" : r ? "You won" : "To win", [c, o, r, u, s, i]), Z = !P || P && o === n.PREDICTION && T && !R, $ = (o === n.TRIVIA || o === n.PREDICTION) && r && s && (i == null ? void 0 : i.youVoted), Q = r || u || b || o === n.TRIVIA && d === q.RESOLVED && I;
97
- return /* @__PURE__ */ a(st, { children: /* @__PURE__ */ a(nt, { children: /* @__PURE__ */ L(at, { children: [
78
+ y(() => {
79
+ const i = D.some(({ percentageDecimal: v }) => v !== 0), m = e && r === n.PREDICTION;
80
+ O && (!i || I && m) && b(!0);
81
+ }, [D, O, I, r, e]);
82
+ const $ = E && (E.case === "trivia" || E.case === "prediction") ? E.value : void 0, f = T === N.RESOLVED && r === n.TRIVIA && !e && !C, B = r === n.TRIVIA && R, q = u(() => r === n.PREDICTION ? !!(e && !o || e && o && (s != null && s.youVoted)) : !0, [r, e, o, s]), Q = u(() => {
83
+ if (r === n.PREDICTION && e && (!o || o && (s != null && s.youVoted)))
84
+ return e.points;
85
+ if (!(f || l))
86
+ return e ? e.correct ? e.pointsEarned : 0 : s == null ? void 0 : s.points;
87
+ }, [l, e, s, f, r, o]), tt = u(() => r === n.PREDICTION && e ? o ? o && (s != null && s.youVoted) ? "You won" : "" : "To win" : f || l ? "Time expired" : r === n.POLL ? "Time remaining" : e ? "You won" : "To win", [l, r, e, f, o, s]), et = !q || q && r === n.PREDICTION && h && !P, rt = (r === n.TRIVIA || r === n.PREDICTION) && e && o && (s == null ? void 0 : s.youVoted), st = e || f || B || r === n.TRIVIA && T === N.RESOLVED && C;
88
+ return /* @__PURE__ */ a(at, { children: /* @__PURE__ */ a(ct, { children: /* @__PURE__ */ j(lt, { children: [
98
89
  /* @__PURE__ */ a(
99
90
  ot,
100
91
  {
101
- feedbackMessages: K,
102
- questionVoted: !!r,
103
- questionVotedCorrectly: r == null ? void 0 : r.correct,
104
- questionType: o,
105
- hasCorrectAnswer: s,
106
- showExpiredNotification: u,
107
- showClosedNotificationTrivia: b,
108
- votedInCurrentRender: T,
109
- votedAfterQuestionClosed: V,
110
- enteredAnActiveQuestion: I,
111
- marketClosed: y,
112
- percentsAnimated: R,
113
- voteErrorMessage: w
92
+ feedbackMessages: $,
93
+ questionVoted: !!e,
94
+ questionVotedCorrectly: e == null ? void 0 : e.correct,
95
+ questionType: r,
96
+ hasCorrectAnswer: o,
97
+ showExpiredNotification: f,
98
+ showClosedNotificationTrivia: B,
99
+ votedInCurrentRender: h,
100
+ votedAfterQuestionClosed: R,
101
+ enteredAnActiveQuestion: C,
102
+ marketClosed: I,
103
+ percentsAnimated: P,
104
+ voteErrorMessage: O
114
105
  }
115
106
  ),
116
- P && /* @__PURE__ */ a(
117
- ft,
107
+ q && /* @__PURE__ */ a(
108
+ dt,
118
109
  {
119
- title: X,
120
- points: U,
121
- onTimerExpired: J,
110
+ title: tt,
111
+ points: Q,
112
+ onTimerExpired: Z,
122
113
  questionType: t.type,
123
- isTimer: !h,
124
- isPlayingTimer: !r,
125
- animatePoints: $,
126
- timerDuration: Q ? 0 : Number(((W = t == null ? void 0 : t.appearance) == null ? void 0 : W.autoHideInterval) || "30"),
127
- votedInCurrentRender: T,
128
- percentsAnimated: R
114
+ isTimer: !d,
115
+ isPlayingTimer: !e,
116
+ animatePoints: rt,
117
+ timerDuration: st ? 0 : Number(((Y = t == null ? void 0 : t.appearance) == null ? void 0 : Y.autoHideInterval) || "30"),
118
+ votedInCurrentRender: h,
119
+ percentsAnimated: P
129
120
  }
130
121
  ),
131
- c ? /* @__PURE__ */ a(
132
- it,
122
+ l ? /* @__PURE__ */ a(
123
+ nt,
133
124
  {
134
125
  title: "More to come...",
135
126
  description: "Watch for additional enhanced stream interactive experience."
136
127
  }
137
- ) : /* @__PURE__ */ L(rt, { children: [
138
- /* @__PURE__ */ a(ct, { style: Z ? { marginTop: 0 } : {}, children: Y }),
139
- /* @__PURE__ */ a(mt, { children: O.map((e) => /* @__PURE__ */ a(
140
- lt,
128
+ ) : /* @__PURE__ */ j(it, { children: [
129
+ /* @__PURE__ */ a(mt, { style: et ? { marginTop: 0 } : {}, children: H }),
130
+ /* @__PURE__ */ a(ut, { children: D.map((i) => /* @__PURE__ */ a(
131
+ ft,
141
132
  {
142
- ...e,
143
- markThatVoted: G,
144
- onPercentsAnimated: () => k(!0),
145
- votedAfterQuestionClosed: V,
146
- enteredAnActiveQuestion: I,
147
- marketClosed: y
133
+ ...i,
134
+ markThatVoted: X,
135
+ onPercentsAnimated: () => b(!0),
136
+ votedAfterQuestionClosed: R,
137
+ enteredAnActiveQuestion: C,
138
+ marketClosed: I
148
139
  },
149
- e.id
140
+ i.id
150
141
  )) })
151
142
  ] })
152
143
  ] }) }) });
153
144
  };
154
145
  export {
155
- kt as Vote
146
+ Rt as Vote
156
147
  };
@@ -1,21 +1,14 @@
1
- import { jsxs as o, jsx as m } from "react/jsx-runtime";
2
- import { SvgIcon as p } from "../../../icons/index.js";
3
- import { InsightContent as b } from "../../../questions/insight/index.js";
4
- import { Container as k, WebLinkBtn as c } from "./styles.js";
5
- import "@linaria/react";
6
- import "react";
7
- import "@streamlayer/sdk-web-types";
8
- import "../../../video-player/index.js";
9
- import "@linaria/core";
10
- import "../../../video-player/styles.js";
11
- import "../../../questions/insight/styles.js";
12
- const D = ({ instantView: r, ...l }) => /* @__PURE__ */ o(k, { children: [
13
- /* @__PURE__ */ m(b, { instantView: r, ...l, isDetail: !0 }),
14
- (r == null ? void 0 : r.webLink) && /* @__PURE__ */ o(c, { href: r == null ? void 0 : r.webLink.url, target: "_blank", "data-analytics": "web-link", children: [
1
+ import { jsxs as o, jsx as l } from "react/jsx-runtime";
2
+ import { SvgIcon as b } from "../../../icons/index.js";
3
+ import { InsightContent as k } from "../../../questions/insight/index.js";
4
+ import { Container as c, WebLinkBtn as e } from "./styles.js";
5
+ const x = ({ instantView: r, ...m }) => /* @__PURE__ */ o(c, { children: [
6
+ /* @__PURE__ */ l(k, { instantView: r, ...m, isDetail: !0 }),
7
+ (r == null ? void 0 : r.webLink) && /* @__PURE__ */ o(e, { href: r == null ? void 0 : r.webLink.url, target: "_blank", "data-analytics": "web-link", children: [
15
8
  r == null ? void 0 : r.webLink.label,
16
- /* @__PURE__ */ m(p, { name: "icon-external-link" })
9
+ /* @__PURE__ */ l(b, { name: "icon-external-link" })
17
10
  ] })
18
11
  ] });
19
12
  export {
20
- D as InsightDetails
13
+ x as InsightDetails
21
14
  };
@@ -1,20 +1,10 @@
1
- import { jsxs as r, jsx as i } from "react/jsx-runtime";
2
- import { TwitterContent as o } from "../../../questions/twitter/index.js";
3
- import { Container as m, Quote as e } from "./styles.js";
4
- import "../../../video-player/index.js";
5
- import "@linaria/core";
6
- import "react";
7
- import "../../../icons/index.js";
8
- import "@linaria/react";
9
- import "../../../video-player/styles.js";
10
- import "../../../questions/twitter/account/index.js";
11
- import "../../../../utils/common.js";
12
- import "../../../questions/twitter/account/styles.js";
13
- import "../../../questions/twitter/styles.js";
14
- const C = (t) => /* @__PURE__ */ r(m, { children: [
15
- t.title && /* @__PURE__ */ i(e, { children: t.title }),
16
- /* @__PURE__ */ i(o, { ...t, isDetail: !0 })
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import { TwitterContent as r } from "../../../questions/twitter/index.js";
3
+ import { Container as o, Quote as n } from "./styles.js";
4
+ const a = (t) => /* @__PURE__ */ i(o, { children: [
5
+ t.title && /* @__PURE__ */ e(n, { children: t.title }),
6
+ /* @__PURE__ */ e(r, { ...t, isDetail: !0 })
17
7
  ] });
18
8
  export {
19
- C as TwitterDetails
9
+ a as TwitterDetails
20
10
  };