@cuemath/leap 2.8.36-rj-0 → 2.8.36-rj-beta.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 (86) hide show
  1. package/dist/assets/lottie/lottie.js +6 -0
  2. package/dist/assets/lottie/lottie.js.map +1 -1
  3. package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js +11 -20
  4. package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js.map +1 -1
  5. package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js +47 -53
  6. package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js.map +1 -1
  7. package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode-styled.js +3 -3
  8. package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode-styled.js.map +1 -1
  9. package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js +29 -35
  10. package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js.map +1 -1
  11. package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star-styled.js +25 -0
  12. package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star-styled.js.map +1 -0
  13. package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star.js +57 -0
  14. package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star.js.map +1 -0
  15. package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star-styled.js +27 -0
  16. package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star-styled.js.map +1 -0
  17. package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star.js +37 -0
  18. package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star.js.map +1 -0
  19. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +35 -42
  20. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +1 -1
  21. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +135 -144
  22. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
  23. package/dist/features/circle-games/game-launcher/game-launcher-analytics-events.js +8 -7
  24. package/dist/features/circle-games/game-launcher/game-launcher-analytics-events.js.map +1 -1
  25. package/dist/features/circle-games/game-launcher/game-launcher.js +71 -80
  26. package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
  27. package/dist/features/circle-games/game-launcher/use-game-launcher-journey/constants.js +7 -0
  28. package/dist/features/circle-games/game-launcher/use-game-launcher-journey/constants.js.map +1 -0
  29. package/dist/features/circle-games/game-launcher/use-game-launcher-journey/use-game-launcher-journey.js +213 -0
  30. package/dist/features/circle-games/game-launcher/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -0
  31. package/dist/features/circle-games/games/web-view/web-view-types.js.map +1 -1
  32. package/dist/features/journey/journey-id/journey-id-student.js +1 -1
  33. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  34. package/dist/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc-styled.js +17 -0
  35. package/dist/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc-styled.js.map +1 -0
  36. package/dist/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc.js +47 -0
  37. package/dist/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc.js.map +1 -0
  38. package/dist/features/post-game-stats/digital-meter/comp/animated-arc/constants.js +6 -0
  39. package/dist/features/post-game-stats/digital-meter/comp/animated-arc/constants.js.map +1 -0
  40. package/dist/features/post-game-stats/digital-meter/constants.js +16 -0
  41. package/dist/features/post-game-stats/digital-meter/constants.js.map +1 -0
  42. package/dist/features/post-game-stats/digital-meter/digital-meter-styled.js +87 -0
  43. package/dist/features/post-game-stats/digital-meter/digital-meter-styled.js.map +1 -0
  44. package/dist/features/post-game-stats/digital-meter/digital-meter.js +185 -0
  45. package/dist/features/post-game-stats/digital-meter/digital-meter.js.map +1 -0
  46. package/dist/features/post-game-stats/digital-meter/helper.js +33 -0
  47. package/dist/features/post-game-stats/digital-meter/helper.js.map +1 -0
  48. package/dist/features/post-game-stats/enums/post-game-stats-enum.js +1 -1
  49. package/dist/features/post-game-stats/enums/post-game-stats-enum.js.map +1 -1
  50. package/dist/features/post-game-stats/number-count-animation/number-count-animation-styled.js +29 -0
  51. package/dist/features/post-game-stats/number-count-animation/number-count-animation-styled.js.map +1 -0
  52. package/dist/features/post-game-stats/number-count-animation/number-count-animation.js +20 -0
  53. package/dist/features/post-game-stats/number-count-animation/number-count-animation.js.map +1 -0
  54. package/dist/features/post-game-stats/points/points.js +15 -10
  55. package/dist/features/post-game-stats/points/points.js.map +1 -1
  56. package/dist/features/post-game-stats/post-game-stats.js +83 -61
  57. package/dist/features/post-game-stats/post-game-stats.js.map +1 -1
  58. package/dist/index.d.ts +45 -4
  59. package/dist/index.js +69 -67
  60. package/dist/index.js.map +1 -1
  61. package/dist/static/point2.7cec6e24.json +1 -0
  62. package/dist/static/point3.f96fe7aa.json +1 -0
  63. package/dist/static/point4.fe04fb83.json +1 -0
  64. package/dist/static/table-mode-star.b8a1d762.json +1 -0
  65. package/dist/static/table-segment-star.78e851d6.json +1 -0
  66. package/dist/static/target-achieved-text.053bd142.json +2830 -0
  67. package/dist/static/target-achieved-text.10db8475.json +1 -0
  68. package/package.json +1 -1
  69. package/dist/assets/line-icons/icons/carat-left.js +0 -26
  70. package/dist/assets/line-icons/icons/carat-left.js.map +0 -1
  71. package/dist/assets/line-icons/icons/carat-right.js +0 -26
  72. package/dist/assets/line-icons/icons/carat-right.js.map +0 -1
  73. package/dist/features/circle-games/game-launcher/comps/tables-card/table-star/table-star-styled.js +0 -11
  74. package/dist/features/circle-games/game-launcher/comps/tables-card/table-star/table-star-styled.js.map +0 -1
  75. package/dist/features/circle-games/game-launcher/comps/tables-card/table-star/table-star.js +0 -16
  76. package/dist/features/circle-games/game-launcher/comps/tables-card/table-star/table-star.js.map +0 -1
  77. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js +0 -8
  78. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js.map +0 -1
  79. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +0 -217
  80. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +0 -1
  81. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js +0 -6
  82. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js.map +0 -1
  83. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js +0 -13
  84. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js.map +0 -1
  85. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +0 -197
  86. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +0 -1
@@ -0,0 +1,185 @@
1
+ import { jsxs as c, jsx as r, Fragment as E } from "react/jsx-runtime";
2
+ import { memo as M, useState as O, useEffect as W } from "react";
3
+ import { LOTTIE as y } from "../../../assets/lottie/lottie.js";
4
+ import { GAME_LAUNCHER_SIZE as i, GAME_LAUNCHER_SIZE_LARGE as l } from "../../circle-games/game-launcher/comps/card-container/constants.js";
5
+ import _ from "../../ui/layout/flex-view.js";
6
+ import w from "../../ui/lottie-animation/lottie-animation.js";
7
+ import $ from "../../ui/separator/separator.js";
8
+ import L from "../../ui/text/text.js";
9
+ import { NumberCountAnimation as B } from "../number-count-animation/number-count-animation.js";
10
+ import { AnimatedArc as f } from "./comp/animated-arc/animated-arc.js";
11
+ import { TARGET_ACHIEVED_DELAY as b, TOTAL_ARC_AVAILABLE as m, BORDER_OFFSET as g, PROGRESS_FILL_DURATION as s, PROGRESS_FILL_DELAY as I, TOTAL_ANIMATION_DURATION as U } from "./constants.js";
12
+ import { DigitalMeter as u, ContentContainer as P, NumberCountContainer as j, RainboxColorText as R, LineMarking as k, MarkingContainer as C, MarkingText as D, BottomAbsoluteView as N, HelperTextPrimary as Y, HelperTextSecondary as Z } from "./digital-meter-styled.js";
13
+ const tr = M(
14
+ ({
15
+ show: T,
16
+ value: a,
17
+ maxValue: n,
18
+ targetValue: o = 0,
19
+ displayText: S,
20
+ progressType: d,
21
+ helperTextPrimary: G,
22
+ helperTextSecondary: H,
23
+ onComplete: p
24
+ }) => {
25
+ const [h, F] = O(!1);
26
+ return W(() => {
27
+ let t, e;
28
+ const A = !!(o && a >= o);
29
+ return T && (A && (t = setTimeout(() => {
30
+ F(!0);
31
+ }, b * 1e3)), e = setTimeout(() => {
32
+ p();
33
+ }, (A ? U : b) * 1e3)), () => {
34
+ t && clearTimeout(t), e && clearTimeout(e);
35
+ };
36
+ }, [T, a, o, p]), T ? /* @__PURE__ */ c(u, { $isTargetAchieved: h, children: [
37
+ /* @__PURE__ */ r(
38
+ f,
39
+ {
40
+ targetAngle: m,
41
+ strokeWidth: i === l ? 16 : 12,
42
+ color: "BLACK_5",
43
+ radius: (i - g) / 2,
44
+ duration: 0
45
+ }
46
+ ),
47
+ /* @__PURE__ */ r(P, { children: /* @__PURE__ */ c(_, { $flexDirection: "column", $alignItems: "center", children: [
48
+ /* @__PURE__ */ c(_, { $flexDirection: "row", $alignItems: "flex-end", children: [
49
+ /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(
50
+ R,
51
+ {
52
+ $renderAs: i === l ? "ah1" : "ah2",
53
+ $color: "GREEN_4",
54
+ $isTargetAchieved: h,
55
+ children: /* @__PURE__ */ r(
56
+ B,
57
+ {
58
+ initialValue: 0,
59
+ targetValue: Math.floor(a),
60
+ durationInSec: s,
61
+ delayInSec: I
62
+ }
63
+ )
64
+ }
65
+ ) }),
66
+ d === "stepper" && /* @__PURE__ */ c(
67
+ L,
68
+ {
69
+ $renderAs: i === l ? "ah4" : "ab1",
70
+ $color: "WHITE",
71
+ children: [
72
+ "/",
73
+ n
74
+ ]
75
+ }
76
+ )
77
+ ] }),
78
+ /* @__PURE__ */ r($, { height: 8 }),
79
+ /* @__PURE__ */ r(
80
+ L,
81
+ {
82
+ $renderAs: i === l ? "ac3-black" : "ac4-black",
83
+ $color: "WHITE_T_60",
84
+ children: S
85
+ }
86
+ )
87
+ ] }) }),
88
+ d === "stepper" && Array.from({ length: a }, (t, e) => {
89
+ const A = m / n;
90
+ return /* @__PURE__ */ r(
91
+ f,
92
+ {
93
+ startAngle: A * e,
94
+ targetAngle: A,
95
+ strokeWidth: i === l ? 16 : 12,
96
+ color: "GREEN_4",
97
+ radius: (i - g) / 2,
98
+ mode: "fade",
99
+ duration: s / n,
100
+ delay: I + s / n * e,
101
+ playRainbowColors: h
102
+ },
103
+ e
104
+ );
105
+ }),
106
+ d === "stepper" && Array.from({ length: n + 1 }, (t, e) => {
107
+ const A = m / n;
108
+ return /* @__PURE__ */ c(E, { children: [
109
+ /* @__PURE__ */ r(k, { $angle: A * e }, e + "linemarking"),
110
+ /* @__PURE__ */ r(C, { $angle: A * e, children: /* @__PURE__ */ r(D, { $angle: A * e, children: /* @__PURE__ */ r(
111
+ R,
112
+ {
113
+ $renderAs: i === l ? "ac3-black" : "ac4-black",
114
+ $isTargetAchieved: e === o && h,
115
+ $color: o && e === o ? "GREEN_4" : "WHITE_T_60",
116
+ children: e
117
+ }
118
+ ) }) }, e)
119
+ ] });
120
+ }),
121
+ d === "linear" && /* @__PURE__ */ c(E, { children: [
122
+ /* @__PURE__ */ r(
123
+ f,
124
+ {
125
+ targetAngle: a * m / n,
126
+ strokeWidth: i === l ? 16 : 12,
127
+ color: "GREEN_4",
128
+ radius: (i - g) / 2,
129
+ duration: s,
130
+ delay: I,
131
+ playRainbowColors: h
132
+ }
133
+ ),
134
+ /* @__PURE__ */ c(E, { children: [
135
+ o && /* @__PURE__ */ r(k, { $angle: o * m / n }),
136
+ Array.from(/* @__PURE__ */ new Set([0, o, n])).map((t, e) => /* @__PURE__ */ r(
137
+ C,
138
+ {
139
+ $angle: t * m / n,
140
+ children: /* @__PURE__ */ r(D, { $angle: t * m / n, children: /* @__PURE__ */ r(
141
+ R,
142
+ {
143
+ $renderAs: i === l ? "ac3-black" : "ac4-black",
144
+ $color: o && t === o ? "GREEN_4" : "WHITE_T_60",
145
+ $isTargetAchieved: a >= t && h && t === o,
146
+ children: t
147
+ }
148
+ ) })
149
+ },
150
+ e
151
+ ))
152
+ ] })
153
+ ] }),
154
+ h && /* @__PURE__ */ r(N, { top: i, children: /* @__PURE__ */ r(w, { src: y.TARGET_ACHIEVED_TEXT }) }),
155
+ !h && /* @__PURE__ */ c(N, { top: i, children: [
156
+ /* @__PURE__ */ r($, { height: 25 }),
157
+ /* @__PURE__ */ c(_, { $flexDirection: "column", $alignItems: "center", children: [
158
+ /* @__PURE__ */ c(
159
+ Y,
160
+ {
161
+ $renderAs: i === l ? "ac3-black" : "ac4-black",
162
+ $color: "WHITE_T_60",
163
+ children: [
164
+ G,
165
+ /* @__PURE__ */ r($, { height: i * 0.03 })
166
+ ]
167
+ }
168
+ ),
169
+ /* @__PURE__ */ r(
170
+ Z,
171
+ {
172
+ $renderAs: i === l ? "ah4" : "ab1",
173
+ $color: "WHITE",
174
+ children: H
175
+ }
176
+ )
177
+ ] })
178
+ ] })
179
+ ] }) : null;
180
+ }
181
+ );
182
+ export {
183
+ tr as DigitalMeter
184
+ };
185
+ //# sourceMappingURL=digital-meter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"digital-meter.js","sources":["../../../../src/features/post-game-stats/digital-meter/digital-meter.tsx"],"sourcesContent":["import type { IDigitalMeterProps } from './digital-meter-types';\nimport type { FC } from 'react';\n\nimport { memo, useEffect, useState } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport {\n GAME_LAUNCHER_SIZE,\n GAME_LAUNCHER_SIZE_LARGE,\n} from '../../circle-games/game-launcher/comps/card-container/constants';\nimport FlexView from '../../ui/layout/flex-view';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport { NumberCountAnimation } from '../number-count-animation/number-count-animation';\nimport { AnimatedArc } from './comp/animated-arc/animated-arc';\nimport {\n BORDER_OFFSET,\n PROGRESS_FILL_DELAY,\n PROGRESS_FILL_DURATION,\n TARGET_ACHIEVED_DELAY,\n TOTAL_ANIMATION_DURATION,\n TOTAL_ARC_AVAILABLE,\n} from './constants';\nimport * as Styled from './digital-meter-styled';\n\nexport const DigitalMeter: FC<IDigitalMeterProps> = memo(\n ({\n show,\n value,\n maxValue,\n targetValue = 0,\n displayText,\n progressType,\n helperTextPrimary,\n helperTextSecondary,\n onComplete,\n }) => {\n const [isTargetAchieved, setIsTargetAchieved] = useState(false);\n\n useEffect(() => {\n let timer: ReturnType<typeof setTimeout>;\n let timerForAnimationComplete: ReturnType<typeof setTimeout>;\n const isTargetAchievedFlag = !!(targetValue && value >= targetValue);\n\n if (show) {\n if (isTargetAchievedFlag) {\n timer = setTimeout(() => {\n setIsTargetAchieved(true);\n }, TARGET_ACHIEVED_DELAY * 1000);\n }\n\n const timeToFinishAnimation = isTargetAchievedFlag\n ? TOTAL_ANIMATION_DURATION\n : TARGET_ACHIEVED_DELAY;\n\n timerForAnimationComplete = setTimeout(() => {\n onComplete();\n }, timeToFinishAnimation * 1000);\n }\n\n return () => {\n timer && clearTimeout(timer);\n timerForAnimationComplete && clearTimeout(timerForAnimationComplete);\n };\n }, [show, value, targetValue, onComplete]);\n\n if (show) {\n return (\n <Styled.DigitalMeter $isTargetAchieved={isTargetAchieved}>\n {/* complete arc area to be filled */}\n <AnimatedArc\n targetAngle={TOTAL_ARC_AVAILABLE}\n strokeWidth={GAME_LAUNCHER_SIZE === GAME_LAUNCHER_SIZE_LARGE ? 16 : 12}\n color=\"BLACK_5\"\n radius={(GAME_LAUNCHER_SIZE - BORDER_OFFSET) / 2}\n duration={0}\n />\n\n {/* center area for the content */}\n <Styled.ContentContainer>\n <FlexView $flexDirection=\"column\" $alignItems=\"center\">\n <FlexView $flexDirection=\"row\" $alignItems=\"flex-end\">\n <Styled.NumberCountContainer>\n <Styled.RainboxColorText\n $renderAs={GAME_LAUNCHER_SIZE === GAME_LAUNCHER_SIZE_LARGE ? 'ah1' : 'ah2'}\n $color=\"GREEN_4\"\n $isTargetAchieved={isTargetAchieved}\n >\n <NumberCountAnimation\n initialValue={0}\n targetValue={Math.floor(value)}\n durationInSec={PROGRESS_FILL_DURATION}\n delayInSec={PROGRESS_FILL_DELAY}\n />\n </Styled.RainboxColorText>\n </Styled.NumberCountContainer>\n {progressType === 'stepper' && (\n <Text\n $renderAs={GAME_LAUNCHER_SIZE === GAME_LAUNCHER_SIZE_LARGE ? 'ah4' : 'ab1'}\n $color=\"WHITE\"\n >\n /{maxValue}\n </Text>\n )}\n </FlexView>\n <Separator height={8} />\n <Text\n $renderAs={\n GAME_LAUNCHER_SIZE === GAME_LAUNCHER_SIZE_LARGE ? 'ac3-black' : 'ac4-black'\n }\n $color=\"WHITE_T_60\"\n >\n {displayText}\n </Text>\n </FlexView>\n </Styled.ContentContainer>\n\n {/* stepper animation */}\n {progressType === 'stepper' &&\n Array.from({ length: value }, (_, index) => {\n const arcLength = TOTAL_ARC_AVAILABLE / maxValue;\n\n return (\n <AnimatedArc\n key={index}\n startAngle={arcLength * index}\n targetAngle={arcLength}\n strokeWidth={GAME_LAUNCHER_SIZE === GAME_LAUNCHER_SIZE_LARGE ? 16 : 12}\n color=\"GREEN_4\"\n radius={(GAME_LAUNCHER_SIZE - BORDER_OFFSET) / 2}\n mode=\"fade\"\n duration={PROGRESS_FILL_DURATION / maxValue}\n delay={PROGRESS_FILL_DELAY + (PROGRESS_FILL_DURATION / maxValue) * index}\n playRainbowColors={isTargetAchieved}\n />\n );\n })}\n\n {/* numbers with markings */}\n {progressType === 'stepper' &&\n Array.from({ length: maxValue + 1 }, (_, index) => {\n const arcLength = TOTAL_ARC_AVAILABLE / maxValue;\n\n return (\n <>\n <Styled.LineMarking key={index + 'linemarking'} $angle={arcLength * index} />\n\n <Styled.MarkingContainer key={index} $angle={arcLength * index}>\n <Styled.MarkingText $angle={arcLength * index}>\n <Styled.RainboxColorText\n $renderAs={\n GAME_LAUNCHER_SIZE === GAME_LAUNCHER_SIZE_LARGE\n ? 'ac3-black'\n : 'ac4-black'\n }\n $isTargetAchieved={index === targetValue && isTargetAchieved}\n $color={targetValue && index === targetValue ? 'GREEN_4' : 'WHITE_T_60'}\n >\n {index}\n </Styled.RainboxColorText>\n </Styled.MarkingText>\n </Styled.MarkingContainer>\n </>\n );\n })}\n\n {/* progress of linear */}\n {progressType === 'linear' && (\n <>\n <AnimatedArc\n targetAngle={(value * TOTAL_ARC_AVAILABLE) / maxValue}\n strokeWidth={GAME_LAUNCHER_SIZE === GAME_LAUNCHER_SIZE_LARGE ? 16 : 12}\n color=\"GREEN_4\"\n radius={(GAME_LAUNCHER_SIZE - BORDER_OFFSET) / 2}\n duration={PROGRESS_FILL_DURATION}\n delay={PROGRESS_FILL_DELAY}\n playRainbowColors={isTargetAchieved}\n />\n <>\n {/* target line marking */}\n {targetValue && (\n <Styled.LineMarking $angle={(targetValue * TOTAL_ARC_AVAILABLE) / maxValue} />\n )}\n\n {/* all markings */}\n {Array.from(new Set([0, targetValue, maxValue])).map((val, index) => (\n <Styled.MarkingContainer\n key={index}\n $angle={(val * TOTAL_ARC_AVAILABLE) / maxValue}\n >\n <Styled.MarkingText $angle={(val * TOTAL_ARC_AVAILABLE) / maxValue}>\n <Styled.RainboxColorText\n $renderAs={\n GAME_LAUNCHER_SIZE === GAME_LAUNCHER_SIZE_LARGE\n ? 'ac3-black'\n : 'ac4-black'\n }\n $color={targetValue && val === targetValue ? 'GREEN_4' : 'WHITE_T_60'}\n $isTargetAchieved={value >= val && isTargetAchieved && val === targetValue}\n >\n {val}\n </Styled.RainboxColorText>\n </Styled.MarkingText>\n </Styled.MarkingContainer>\n ))}\n </>\n </>\n )}\n\n {/* helper text below the animation */}\n {isTargetAchieved && (\n <Styled.BottomAbsoluteView top={GAME_LAUNCHER_SIZE}>\n <LottieAnimation src={LOTTIE.TARGET_ACHIEVED_TEXT} />\n </Styled.BottomAbsoluteView>\n )}\n {!isTargetAchieved && (\n <Styled.BottomAbsoluteView top={GAME_LAUNCHER_SIZE}>\n <Separator height={25} />\n <FlexView $flexDirection=\"column\" $alignItems=\"center\">\n <Styled.HelperTextPrimary\n $renderAs={\n GAME_LAUNCHER_SIZE === GAME_LAUNCHER_SIZE_LARGE ? 'ac3-black' : 'ac4-black'\n }\n $color=\"WHITE_T_60\"\n >\n {helperTextPrimary}\n <Separator height={GAME_LAUNCHER_SIZE * 0.03} />\n </Styled.HelperTextPrimary>\n <Styled.HelperTextSecondary\n $renderAs={GAME_LAUNCHER_SIZE === GAME_LAUNCHER_SIZE_LARGE ? 'ah4' : 'ab1'}\n $color=\"WHITE\"\n >\n {helperTextSecondary}\n </Styled.HelperTextSecondary>\n </FlexView>\n </Styled.BottomAbsoluteView>\n )}\n </Styled.DigitalMeter>\n );\n }\n\n return null;\n },\n);\n"],"names":["DigitalMeter","memo","show","value","maxValue","targetValue","displayText","progressType","helperTextPrimary","helperTextSecondary","onComplete","isTargetAchieved","setIsTargetAchieved","useState","useEffect","timer","timerForAnimationComplete","isTargetAchievedFlag","TARGET_ACHIEVED_DELAY","TOTAL_ANIMATION_DURATION","jsxs","Styled.DigitalMeter","jsx","AnimatedArc","TOTAL_ARC_AVAILABLE","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_SIZE_LARGE","BORDER_OFFSET","Styled.ContentContainer","FlexView","Styled.NumberCountContainer","Styled.RainboxColorText","NumberCountAnimation","PROGRESS_FILL_DURATION","PROGRESS_FILL_DELAY","Text","Separator","_","index","arcLength","Fragment","Styled.LineMarking","Styled.MarkingContainer","Styled.MarkingText","val","Styled.BottomAbsoluteView","LottieAnimation","LOTTIE","Styled.HelperTextPrimary","Styled.HelperTextSecondary"],"mappings":";;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+ import { keyframes as C } from "styled-components";
2
+ const a = (r, F, o, n) => {
3
+ const t = (n - 90) * (Math.PI / 180);
4
+ return {
5
+ x: r + o * Math.cos(t),
6
+ y: F + o * Math.sin(t)
7
+ };
8
+ }, $ = (r, F, o, n, t) => {
9
+ const e = n + t, s = a(r, F, o, n), c = a(r, F, o, e), l = t > 180 ? 1 : 0;
10
+ return `M ${s.x} ${s.y} A ${o} ${o} 0 ${l} 1 ${c.x} ${c.y}`;
11
+ }, k = C`
12
+ 0% {
13
+ stroke: #FFB700;
14
+ color: #FFB700;
15
+ }
16
+ 33% {
17
+ stroke: #FF884C;
18
+ color: #FF884C;
19
+ }
20
+ 66% {
21
+ stroke: #FF80F4;
22
+ color: #FF80F4;
23
+ }
24
+ 100% {
25
+ stroke: #33CCFF;
26
+ color: #33CCFF;
27
+ }
28
+ `;
29
+ export {
30
+ $ as describeArc,
31
+ k as rainbowColorAnimation
32
+ };
33
+ //# sourceMappingURL=helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.js","sources":["../../../../src/features/post-game-stats/digital-meter/helper.ts"],"sourcesContent":["import { keyframes } from 'styled-components';\n\nconst polarToCartesian = (cx: number, cy: number, r: number, angleDeg: number) => {\n const angleRad = (angleDeg - 90) * (Math.PI / 180);\n\n return {\n x: cx + r * Math.cos(angleRad),\n y: cy + r * Math.sin(angleRad),\n };\n};\n\nexport const describeArc = (\n cx: number,\n cy: number,\n r: number,\n startAngle: number,\n sweepAngle: number,\n) => {\n const endAngle = startAngle + sweepAngle;\n const start = polarToCartesian(cx, cy, r, startAngle);\n const end = polarToCartesian(cx, cy, r, endAngle);\n const largeArcFlag = sweepAngle > 180 ? 1 : 0;\n\n return `M ${start.x} ${start.y} A ${r} ${r} 0 ${largeArcFlag} 1 ${end.x} ${end.y}`;\n};\n\nexport const rainbowColorAnimation = keyframes`\n 0% {\n stroke: #FFB700;\n color: #FFB700;\n }\n 33% {\n stroke: #FF884C;\n color: #FF884C;\n }\n 66% {\n stroke: #FF80F4;\n color: #FF80F4;\n }\n 100% {\n stroke: #33CCFF;\n color: #33CCFF;\n }\n`;\n"],"names":["polarToCartesian","cx","cy","r","angleDeg","angleRad","describeArc","startAngle","sweepAngle","endAngle","start","end","largeArcFlag","rainbowColorAnimation","keyframes"],"mappings":";AAEA,MAAMA,IAAmB,CAACC,GAAYC,GAAYC,GAAWC,MAAqB;AAChF,QAAMC,KAAYD,IAAW,OAAO,KAAK,KAAK;AAEvC,SAAA;AAAA,IACL,GAAGH,IAAKE,IAAI,KAAK,IAAIE,CAAQ;AAAA,IAC7B,GAAGH,IAAKC,IAAI,KAAK,IAAIE,CAAQ;AAAA,EAAA;AAEjC,GAEaC,IAAc,CACzBL,GACAC,GACAC,GACAI,GACAC,MACG;AACH,QAAMC,IAAWF,IAAaC,GACxBE,IAAQV,EAAiBC,GAAIC,GAAIC,GAAGI,CAAU,GAC9CI,IAAMX,EAAiBC,GAAIC,GAAIC,GAAGM,CAAQ,GAC1CG,IAAeJ,IAAa,MAAM,IAAI;AAE5C,SAAO,KAAKE,EAAM,CAAC,IAAIA,EAAM,CAAC,MAAMP,CAAC,IAAIA,CAAC,MAAMS,CAAY,MAAMD,EAAI,CAAC,IAAIA,EAAI,CAAC;AAClF,GAEaE,IAAwBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
@@ -1,4 +1,4 @@
1
- var c = /* @__PURE__ */ ((r) => (r.STREAK = "streak", r.ACCURACY = "accuracy", r.CLOCK = "clock", r.POINT = "point", r))(c || {});
1
+ var c = /* @__PURE__ */ ((r) => (r.STREAK = "streak", r.ACCURACY = "accuracy", r.CLOCK = "clock", r.POINT = "point", r.DIGITAL_METER = "digital-meter", r))(c || {});
2
2
  export {
3
3
  c as EPostGameStat
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"post-game-stats-enum.js","sources":["../../../../src/features/post-game-stats/enums/post-game-stats-enum.ts"],"sourcesContent":["export enum EPostGameStat {\n STREAK = 'streak',\n ACCURACY = 'accuracy',\n CLOCK = 'clock',\n POINT = 'point',\n}\n"],"names":["EPostGameStat"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,WAAW,YACXA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SAJEA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"post-game-stats-enum.js","sources":["../../../../src/features/post-game-stats/enums/post-game-stats-enum.ts"],"sourcesContent":["export enum EPostGameStat {\n STREAK = 'streak',\n ACCURACY = 'accuracy',\n CLOCK = 'clock',\n POINT = 'point',\n DIGITAL_METER = 'digital-meter',\n}\n"],"names":["EPostGameStat"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,WAAW,YACXA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SACRA,EAAA,gBAAgB,iBALNA,IAAAA,KAAA,CAAA,CAAA;"}
@@ -0,0 +1,29 @@
1
+ import e from "styled-components";
2
+ const r = e.div`
3
+ @property --num {
4
+ syntax: '<integer>';
5
+ initial-value: ${({ $initialValue: n }) => n};
6
+ inherits: false;
7
+ }
8
+
9
+ counter-set: num var(--num);
10
+ animation: changeNum ${({ $durationInSec: n = 0 }) => n}s linear
11
+ ${({ $delayInSec: n = 0 }) => n}s forwards;
12
+
13
+ &::after {
14
+ content: counter(num);
15
+ }
16
+
17
+ @keyframes changeNum {
18
+ from {
19
+ --num: ${({ $initialValue: n }) => n};
20
+ }
21
+ to {
22
+ --num: ${({ $targetValue: n }) => n};
23
+ }
24
+ }
25
+ `;
26
+ export {
27
+ r as AnimatedNumberCount
28
+ };
29
+ //# sourceMappingURL=number-count-animation-styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-count-animation-styled.js","sources":["../../../../src/features/post-game-stats/number-count-animation/number-count-animation-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nexport const AnimatedNumberCount = styled.div<{\n $initialValue: number;\n $targetValue: number;\n $durationInSec?: number;\n $delayInSec?: number;\n}>`\n @property --num {\n syntax: '<integer>';\n initial-value: ${({ $initialValue }) => $initialValue};\n inherits: false;\n }\n\n counter-set: num var(--num);\n animation: changeNum ${({ $durationInSec = 0 }) => $durationInSec}s linear\n ${({ $delayInSec = 0 }) => $delayInSec}s forwards;\n\n &::after {\n content: counter(num);\n }\n\n @keyframes changeNum {\n from {\n --num: ${({ $initialValue }) => $initialValue};\n }\n to {\n --num: ${({ $targetValue }) => $targetValue};\n }\n }\n`;\n"],"names":["AnimatedNumberCount","styled","$initialValue","$durationInSec","$delayInSec","$targetValue"],"mappings":";AAEO,MAAMA,IAAsBC,EAAO;AAAA;AAAA;AAAA,qBAQrB,CAAC,EAAE,eAAAC,EAAc,MAAMA,CAAa;AAAA;AAAA;AAAA;AAAA;AAAA,yBAKhC,CAAC,EAAE,gBAAAC,IAAiB,EAAA,MAAQA,CAAc;AAAA,MAC7D,CAAC,EAAE,aAAAC,IAAc,EAAA,MAAQA,CAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAQ3B,CAAC,EAAE,eAAAF,EAAc,MAAMA,CAAa;AAAA;AAAA;AAAA,eAGpC,CAAC,EAAE,cAAAG,EAAa,MAAMA,CAAY;AAAA;AAAA;AAAA;"}
@@ -0,0 +1,20 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { AnimatedNumberCount as i } from "./number-count-animation-styled.js";
3
+ const u = ({
4
+ initialValue: t,
5
+ targetValue: e,
6
+ durationInSec: n,
7
+ delayInSec: r
8
+ }) => /* @__PURE__ */ o(
9
+ i,
10
+ {
11
+ $initialValue: t,
12
+ $targetValue: e,
13
+ $durationInSec: n,
14
+ $delayInSec: r
15
+ }
16
+ );
17
+ export {
18
+ u as NumberCountAnimation
19
+ };
20
+ //# sourceMappingURL=number-count-animation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-count-animation.js","sources":["../../../../src/features/post-game-stats/number-count-animation/number-count-animation.tsx"],"sourcesContent":["import type { INumberCountAnimationProps } from './number-count-animation-types';\nimport type { FC } from 'react';\n\nimport * as Styled from './number-count-animation-styled';\n\nexport const NumberCountAnimation: FC<INumberCountAnimationProps> = ({\n initialValue,\n targetValue,\n durationInSec,\n delayInSec,\n}) => {\n return (\n <Styled.AnimatedNumberCount\n $initialValue={initialValue}\n $targetValue={targetValue}\n $durationInSec={durationInSec}\n $delayInSec={delayInSec}\n />\n );\n};\n"],"names":["NumberCountAnimation","initialValue","targetValue","durationInSec","delayInSec","jsx","Styled.AnimatedNumberCount"],"mappings":";;AAKO,MAAMA,IAAuD,CAAC;AAAA,EACnE,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AACF,MAEI,gBAAAC;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC,eAAeL;AAAA,IACf,cAAcC;AAAA,IACd,gBAAgBC;AAAA,IAChB,aAAaC;AAAA,EAAA;AAAA;"}
@@ -1,13 +1,16 @@
1
1
  import { jsx as N } from "react/jsx-runtime";
2
2
  import { memo as P, useEffect as T } from "react";
3
3
  import { LOTTIE as o } from "../../../assets/lottie/lottie.js";
4
- import { GAME_LAUNCHER_SIZE as a } from "../../circle-games/game-launcher/comps/card-container/constants.js";
5
- import { GAME_LAUNCHER_ASSET_PADDING as O, GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH as c } from "../../circle-games/game-launcher/comps/segmented-game-card/constants.js";
4
+ import { GAME_LAUNCHER_SIZE as O } from "../../circle-games/game-launcher/comps/card-container/constants.js";
5
+ import { GAME_LAUNCHER_ASSET_PADDING as a, GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH as c } from "../../circle-games/game-launcher/comps/segmented-game-card/constants.js";
6
6
  import { useCircleSounds as f } from "../../circle-games/hooks/use-circle-sounds/use-circle-sounds.js";
7
7
  import { CircleSoundKey as E } from "../../circle-games/hooks/use-circle-sounds/use-circle-sounds-enums.js";
8
8
  import A from "../../ui/lottie-animation/lottie-animation.js";
9
9
  const _ = {
10
10
  point1: o.POINT1,
11
+ point2: o.POINT2,
12
+ point3: o.POINT3,
13
+ point4: o.POINT4,
11
14
  point5: o.POINT5,
12
15
  point10: o.POINT10,
13
16
  point15: o.POINT15,
@@ -20,22 +23,24 @@ const _ = {
20
23
  point50: o.POINT50,
21
24
  point60: o.POINT60,
22
25
  point100: o.POINT100
23
- }, r = a + O - c, l = {
26
+ }, e = O + a - c, l = {
24
27
  loop: !1,
25
28
  autoplay: !0,
26
29
  renderer: "canvas"
27
- }, h = P((p) => {
28
- const { point: m = 0, onReveal: n, onComplete: i, show: e } = p, { play: s } = f(), t = _[`point${m}`], I = {
30
+ }, G = P((p) => {
31
+ const { point: m = 0, onReveal: n, onComplete: i, show: r } = p, { play: s } = f(), t = _[`point${m}`], I = {
29
32
  name: "complete",
30
33
  callback: i
31
34
  };
32
35
  return T(() => {
33
- t || i(), e && t && (n == null || n());
34
- }, [t, i, n, e]), e && t ? /* @__PURE__ */ N(
36
+ if (!t)
37
+ throw i(), new Error(`Animation path not found for ${t}`);
38
+ r && t && (n == null || n());
39
+ }, [t, i, n, r]), r && t ? /* @__PURE__ */ N(
35
40
  A,
36
41
  {
37
- width: r,
38
- height: r,
42
+ width: e,
43
+ height: e,
39
44
  src: t,
40
45
  settings: l,
41
46
  eventListener: I,
@@ -44,6 +49,6 @@ const _ = {
44
49
  ) : null;
45
50
  });
46
51
  export {
47
- h as Points
52
+ G as Points
48
53
  };
49
54
  //# sourceMappingURL=points.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"points.js","sources":["../../../../src/features/post-game-stats/points/points.tsx"],"sourcesContent":["import type { IPointsProps } from './points-types';\nimport type { AnimationEventName } from 'lottie-web';\nimport type { FC } from 'react';\n\nimport { memo, useEffect } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { GAME_LAUNCHER_SIZE } from '../../circle-games/game-launcher/comps/card-container/constants';\nimport {\n GAME_LAUNCHER_ASSET_PADDING,\n GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH,\n} from '../../circle-games/game-launcher/comps/segmented-game-card/constants';\nimport { useCircleSounds } from '../../circle-games/hooks/use-circle-sounds/use-circle-sounds';\nimport { CircleSoundKey } from '../../circle-games/hooks/use-circle-sounds/use-circle-sounds-enums';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\n\nconst POINTS_MAP: Record<string, string> = {\n point1: LOTTIE.POINT1,\n point5: LOTTIE.POINT5,\n point10: LOTTIE.POINT10,\n point15: LOTTIE.POINT15,\n point20: LOTTIE.POINT20,\n point25: LOTTIE.POINT25,\n point30: LOTTIE.POINT30,\n point35: LOTTIE.POINT35,\n point40: LOTTIE.POINT40,\n point45: LOTTIE.POINT45,\n point50: LOTTIE.POINT50,\n point60: LOTTIE.POINT60,\n point100: LOTTIE.POINT100,\n};\nconst animationDimension =\n GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING - GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH;\nconst animationSettings = {\n loop: false,\n autoplay: true,\n renderer: 'canvas',\n};\n\nexport const Points: FC<IPointsProps> = memo(props => {\n const { point = 0, onReveal, onComplete, show } = props;\n\n const { play } = useCircleSounds();\n\n const animationPath = POINTS_MAP[`point${point}`];\n const animationEventListener = {\n name: 'complete' as AnimationEventName,\n callback: onComplete,\n };\n\n useEffect(() => {\n if (!animationPath) onComplete();\n\n if (show && animationPath) onReveal?.();\n }, [animationPath, onComplete, onReveal, show]);\n\n if (show && animationPath) {\n return (\n <LottieAnimation\n width={animationDimension}\n height={animationDimension}\n src={animationPath}\n settings={animationSettings}\n eventListener={animationEventListener}\n onRender={() => play(CircleSoundKey.POINTS_AWARDED)}\n />\n );\n }\n\n return null;\n});\n"],"names":["POINTS_MAP","LOTTIE","animationDimension","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING","GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH","animationSettings","Points","memo","props","point","onReveal","onComplete","show","play","useCircleSounds","animationPath","animationEventListener","useEffect","jsx","LottieAnimation","CircleSoundKey"],"mappings":";;;;;;;;AAgBA,MAAMA,IAAqC;AAAA,EACzC,QAAQC,EAAO;AAAA,EACf,QAAQA,EAAO;AAAA,EACf,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,UAAUA,EAAO;AACnB,GACMC,IACJC,IAAqBC,IAA8BC,GAC/CC,IAAoB;AAAA,EACxB,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AACZ,GAEaC,IAA2BC,EAAK,CAASC,MAAA;AACpD,QAAM,EAAE,OAAAC,IAAQ,GAAG,UAAAC,GAAU,YAAAC,GAAY,MAAAC,EAAS,IAAAJ,GAE5C,EAAE,MAAAK,MAASC,KAEXC,IAAgBhB,EAAW,QAAQU,CAAK,EAAE,GAC1CO,IAAyB;AAAA,IAC7B,MAAM;AAAA,IACN,UAAUL;AAAA,EAAA;AASZ,SANAM,EAAU,MAAM;AACV,IAACF,KAA0BJ,KAE3BC,KAAQG,MAA0BL,KAAA,QAAAA;AAAA,KACrC,CAACK,GAAeJ,GAAYD,GAAUE,CAAI,CAAC,GAE1CA,KAAQG,IAER,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAOlB;AAAA,MACP,QAAQA;AAAA,MACR,KAAKc;AAAA,MACL,UAAUV;AAAA,MACV,eAAeW;AAAA,MACf,UAAU,MAAMH,EAAKO,EAAe,cAAc;AAAA,IAAA;AAAA,EAAA,IAKjD;AACT,CAAC;"}
1
+ {"version":3,"file":"points.js","sources":["../../../../src/features/post-game-stats/points/points.tsx"],"sourcesContent":["import type { IPointsProps } from './points-types';\nimport type { AnimationEventName } from 'lottie-web';\nimport type { FC } from 'react';\n\nimport { memo, useEffect } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { GAME_LAUNCHER_SIZE } from '../../circle-games/game-launcher/comps/card-container/constants';\nimport {\n GAME_LAUNCHER_ASSET_PADDING,\n GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH,\n} from '../../circle-games/game-launcher/comps/segmented-game-card/constants';\nimport { useCircleSounds } from '../../circle-games/hooks/use-circle-sounds/use-circle-sounds';\nimport { CircleSoundKey } from '../../circle-games/hooks/use-circle-sounds/use-circle-sounds-enums';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\n\nconst POINTS_MAP: Record<string, string> = {\n point1: LOTTIE.POINT1,\n point2: LOTTIE.POINT2,\n point3: LOTTIE.POINT3,\n point4: LOTTIE.POINT4,\n point5: LOTTIE.POINT5,\n point10: LOTTIE.POINT10,\n point15: LOTTIE.POINT15,\n point20: LOTTIE.POINT20,\n point25: LOTTIE.POINT25,\n point30: LOTTIE.POINT30,\n point35: LOTTIE.POINT35,\n point40: LOTTIE.POINT40,\n point45: LOTTIE.POINT45,\n point50: LOTTIE.POINT50,\n point60: LOTTIE.POINT60,\n point100: LOTTIE.POINT100,\n};\nconst animationDimension =\n GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING - GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH;\nconst animationSettings = {\n loop: false,\n autoplay: true,\n renderer: 'canvas',\n};\n\nexport const Points: FC<IPointsProps> = memo(props => {\n const { point = 0, onReveal, onComplete, show } = props;\n\n const { play } = useCircleSounds();\n\n const animationPath = POINTS_MAP[`point${point}`];\n const animationEventListener = {\n name: 'complete' as AnimationEventName,\n callback: onComplete,\n };\n\n useEffect(() => {\n if (!animationPath) {\n onComplete();\n throw new Error(`Animation path not found for ${animationPath}`);\n }\n\n if (show && animationPath) onReveal?.();\n }, [animationPath, onComplete, onReveal, show]);\n\n if (show && animationPath) {\n return (\n <LottieAnimation\n width={animationDimension}\n height={animationDimension}\n src={animationPath}\n settings={animationSettings}\n eventListener={animationEventListener}\n onRender={() => play(CircleSoundKey.POINTS_AWARDED)}\n />\n );\n }\n\n return null;\n});\n"],"names":["POINTS_MAP","LOTTIE","animationDimension","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING","GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH","animationSettings","Points","memo","props","point","onReveal","onComplete","show","play","useCircleSounds","animationPath","animationEventListener","useEffect","jsx","LottieAnimation","CircleSoundKey"],"mappings":";;;;;;;;AAgBA,MAAMA,IAAqC;AAAA,EACzC,QAAQC,EAAO;AAAA,EACf,QAAQA,EAAO;AAAA,EACf,QAAQA,EAAO;AAAA,EACf,QAAQA,EAAO;AAAA,EACf,QAAQA,EAAO;AAAA,EACf,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,UAAUA,EAAO;AACnB,GACMC,IACJC,IAAqBC,IAA8BC,GAC/CC,IAAoB;AAAA,EACxB,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AACZ,GAEaC,IAA2BC,EAAK,CAASC,MAAA;AACpD,QAAM,EAAE,OAAAC,IAAQ,GAAG,UAAAC,GAAU,YAAAC,GAAY,MAAAC,EAAS,IAAAJ,GAE5C,EAAE,MAAAK,MAASC,KAEXC,IAAgBhB,EAAW,QAAQU,CAAK,EAAE,GAC1CO,IAAyB;AAAA,IAC7B,MAAM;AAAA,IACN,UAAUL;AAAA,EAAA;AAYZ,SATAM,EAAU,MAAM;AACd,QAAI,CAACF;AACQ,YAAAJ,KACL,IAAI,MAAM,gCAAgCI,CAAa,EAAE;AAG7D,IAAAH,KAAQG,MAA0BL,KAAA,QAAAA;AAAA,KACrC,CAACK,GAAeJ,GAAYD,GAAUE,CAAI,CAAC,GAE1CA,KAAQG,IAER,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAOlB;AAAA,MACP,QAAQA;AAAA,MACR,KAAKc;AAAA,MACL,UAAUV;AAAA,MACV,eAAeW;AAAA,MACf,UAAU,MAAMH,EAAKO,EAAe,cAAc;AAAA,IAAA;AAAA,EAAA,IAKjD;AACT,CAAC;"}
@@ -1,70 +1,92 @@
1
- import { jsxs as S, jsx as n } from "react/jsx-runtime";
2
- import { memo as C, forwardRef as T, useState as d, useCallback as h, useImperativeHandle as y } from "react";
3
- import { Accuracy as A } from "./accuracy/accuracy.js";
4
- import { Clock as R } from "./clock/clock.js";
1
+ import { jsx as n, jsxs as y } from "react/jsx-runtime";
2
+ import { memo as c, forwardRef as v, useState as d, useMemo as i, useCallback as a, useImperativeHandle as g } from "react";
3
+ import { Accuracy as C } from "./accuracy/accuracy.js";
4
+ import { Clock as A } from "./clock/clock.js";
5
+ import { DigitalMeter as I } from "./digital-meter/digital-meter.js";
5
6
  import { EPostGameStat as p } from "./enums/post-game-stats-enum.js";
6
- import { Points as k } from "./points/points.js";
7
- import { StatsWrapper as w, BlackBg as I } from "./post-game-stats-styled.js";
8
- import { Streak as P } from "./streak/streak.js";
9
- const b = C(
10
- T(({ stats: e, show: f, onComplete: l }, a) => {
11
- var i, u;
12
- const [r, x] = d(0), t = h(() => {
13
- var o, c;
14
- if ((c = (o = e[r]) == null ? void 0 : o.onComplete) == null || c.call(o), r === e.length - 1) {
15
- l == null || l();
7
+ import { Points as P } from "./points/points.js";
8
+ import { StatsWrapper as R, BlackBg as S } from "./post-game-stats-styled.js";
9
+ import { Streak as k } from "./streak/streak.js";
10
+ const K = c(
11
+ v(({ stats: o, show: s, onComplete: m }, f) => {
12
+ const [t, h] = d(0), e = i(() => o[t], [t, o]), u = a(() => {
13
+ var r;
14
+ if ((r = e == null ? void 0 : e.onComplete) == null || r.call(e), t === o.length - 1) {
15
+ m == null || m();
16
16
  return;
17
17
  }
18
- x((v) => v + 1);
19
- }, [r, l, e]), m = h(() => {
20
- var o;
21
- (o = e[r]) != null && o.stopAtEnd || t();
22
- }, [e, r, t]);
23
- return y(a, () => ({
24
- moveToNextAndPlay: t
25
- })), !f || e.length === 0 || r >= e.length ? null : /* @__PURE__ */ S(w, { children: [
26
- /* @__PURE__ */ n(I, {}),
27
- /* @__PURE__ */ n(
28
- k,
29
- {
30
- point: e[r].value,
31
- show: e[r].type === p.POINT,
32
- onComplete: m,
33
- onReveal: (i = e[r]) == null ? void 0 : i.onReveal
34
- }
35
- ),
36
- /* @__PURE__ */ n(
37
- P,
38
- {
39
- currStreak: e[r].value,
40
- show: e[r].type === p.STREAK,
41
- onComplete: m,
42
- helperText: e[r].helperText,
43
- onReveal: (u = e[r]) == null ? void 0 : u.onReveal
44
- }
45
- ),
46
- /* @__PURE__ */ n(
47
- A,
48
- {
49
- accuracy: e[r].value,
50
- show: e[r].type === p.ACCURACY,
51
- onComplete: m,
52
- helperText: e[r].helperText
53
- }
54
- ),
55
- /* @__PURE__ */ n(
56
- R,
57
- {
58
- timeInMs: e[r].value,
59
- show: e[r].type === p.CLOCK,
60
- onComplete: m,
61
- helperText: e[r].helperText
62
- }
63
- )
18
+ h((T) => T + 1);
19
+ }, [t, m, o.length, e]), l = a(() => {
20
+ e != null && e.stopAtEnd || u();
21
+ }, [e, u]);
22
+ g(f, () => ({
23
+ moveToNextAndPlay: u
24
+ }));
25
+ const x = i(() => {
26
+ if (e) {
27
+ const r = `${e.type}-${t}`;
28
+ return e.type === p.POINT ? /* @__PURE__ */ n(
29
+ P,
30
+ {
31
+ point: e.value,
32
+ show: e.type === p.POINT,
33
+ onComplete: l,
34
+ onReveal: e.onReveal
35
+ },
36
+ r
37
+ ) : e.type === p.DIGITAL_METER ? /* @__PURE__ */ n(
38
+ I,
39
+ {
40
+ value: e.value,
41
+ maxValue: e.maxValue ?? 1,
42
+ targetValue: e.targetValue,
43
+ displayText: e.displayText ?? "",
44
+ progressType: e.progressType ?? "linear",
45
+ helperTextPrimary: e.helperTextPrimary ?? "",
46
+ helperTextSecondary: e.helperTextSecondary ?? "",
47
+ show: !0,
48
+ onComplete: l
49
+ },
50
+ r
51
+ ) : e.type === p.STREAK ? /* @__PURE__ */ n(
52
+ k,
53
+ {
54
+ currStreak: e.value,
55
+ show: !0,
56
+ onComplete: l,
57
+ helperText: e.helperText,
58
+ onReveal: e.onReveal
59
+ },
60
+ r
61
+ ) : e.type === p.ACCURACY ? /* @__PURE__ */ n(
62
+ C,
63
+ {
64
+ accuracy: e.value,
65
+ show: !0,
66
+ onComplete: l,
67
+ helperText: e.helperText
68
+ },
69
+ r
70
+ ) : e.type === p.CLOCK ? /* @__PURE__ */ n(
71
+ A,
72
+ {
73
+ timeInMs: e.value,
74
+ show: !0,
75
+ onComplete: l,
76
+ helperText: e.helperText
77
+ },
78
+ r
79
+ ) : null;
80
+ }
81
+ return null;
82
+ }, [e, l, t]);
83
+ return !s || o.length === 0 || t >= o.length ? null : /* @__PURE__ */ y(R, { children: [
84
+ /* @__PURE__ */ n(S, {}),
85
+ x
64
86
  ] });
65
87
  })
66
88
  );
67
89
  export {
68
- b as PostGameStats
90
+ K as PostGameStats
69
91
  };
70
92
  //# sourceMappingURL=post-game-stats.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"post-game-stats.js","sources":["../../../src/features/post-game-stats/post-game-stats.tsx"],"sourcesContent":["import type { IPostGameStatsProps, IPostGameStatsRef } from './post-game-stats-types';\n\nimport { useState, memo, useCallback, forwardRef, useImperativeHandle } from 'react';\n\nimport { Accuracy } from './accuracy/accuracy';\nimport { Clock } from './clock/clock';\nimport { EPostGameStat } from './enums/post-game-stats-enum';\nimport { Points } from './points/points';\nimport * as Styled from './post-game-stats-styled';\nimport { Streak } from './streak/streak';\n\nexport const PostGameStats = memo(\n forwardRef<IPostGameStatsRef, IPostGameStatsProps>(({ stats, show, onComplete }, ref) => {\n const [currStatIndex, setCurrentStatIndex] = useState(0);\n\n const moveToNextAndPlay = useCallback(() => {\n stats[currStatIndex]?.onComplete?.();\n\n if (currStatIndex === stats.length - 1) {\n onComplete?.();\n\n return;\n }\n setCurrentStatIndex(prev => prev + 1);\n }, [currStatIndex, onComplete, stats]);\n\n const onStatAnimationComplete = useCallback(() => {\n if (stats[currStatIndex]?.stopAtEnd) {\n return;\n }\n moveToNextAndPlay(); // Autoplay since stopAtEnd is false\n }, [stats, currStatIndex, moveToNextAndPlay]);\n\n useImperativeHandle(ref, () => ({\n moveToNextAndPlay,\n }));\n\n if (!show || stats.length === 0 || currStatIndex >= stats.length) {\n return null;\n }\n\n return (\n <Styled.StatsWrapper>\n <Styled.BlackBg />\n <Points\n point={stats[currStatIndex]!.value}\n show={stats[currStatIndex]!.type === EPostGameStat.POINT}\n onComplete={onStatAnimationComplete}\n onReveal={stats[currStatIndex]?.onReveal}\n />\n <Streak\n currStreak={stats[currStatIndex]!.value}\n show={stats[currStatIndex]!.type === EPostGameStat.STREAK}\n onComplete={onStatAnimationComplete}\n helperText={stats[currStatIndex]!.helperText}\n onReveal={stats[currStatIndex]?.onReveal}\n />\n <Accuracy\n accuracy={stats[currStatIndex]!.value}\n show={stats[currStatIndex]!.type === EPostGameStat.ACCURACY}\n onComplete={onStatAnimationComplete}\n helperText={stats[currStatIndex]!.helperText}\n />\n <Clock\n timeInMs={stats[currStatIndex]!.value}\n show={stats[currStatIndex]!.type === EPostGameStat.CLOCK}\n onComplete={onStatAnimationComplete}\n helperText={stats[currStatIndex]!.helperText}\n />\n </Styled.StatsWrapper>\n );\n }),\n);\n"],"names":["PostGameStats","memo","forwardRef","stats","show","onComplete","ref","currStatIndex","setCurrentStatIndex","useState","moveToNextAndPlay","useCallback","_b","_a","prev","onStatAnimationComplete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AA,UAClC,MAAMJ,EAAMI,CAAa,EAAG,SAASe,EAAc;AAAA,UACnD,YAAYP;AAAA,UACZ,YAAYZ,EAAMI,CAAa,EAAG;AAAA,UAClC,WAAUK,IAAAT,EAAMI,CAAa,MAAnB,gBAAAK,EAAsB;AAAA,QAAA;AAAA,MAClC;AAAA,MACA,gBAAAO;AAAA,QAACK;AAAA,QAAA;AAAA,UACC,UAAUrB,EAAMI,CAAa,EAAG;AAAA,UAChC,MAAMJ,EAAMI,CAAa,EAAG,SAASe,EAAc;AAAA,UACnD,YAAYP;AAAA,UACZ,YAAYZ,EAAMI,CAAa,EAAG;AAAA,QAAA;AAAA,MACpC;AAAA,MACA,gBAAAY;AAAA,QAACM;AAAA,QAAA;AAAA,UACC,UAAUtB,EAAMI,CAAa,EAAG;AAAA,UAChC,MAAMJ,EAAMI,CAAa,EAAG,SAASe,EAAc;AAAA,UACnD,YAAYP;AAAA,UACZ,YAAYZ,EAAMI,CAAa,EAAG;AAAA,QAAA;AAAA,MACpC;AAAA,IACF,EAAA,CAAA;AAAA,EAAA,CAEH;AACH;"}
1
+ {"version":3,"file":"post-game-stats.js","sources":["../../../src/features/post-game-stats/post-game-stats.tsx"],"sourcesContent":["import type { IPostGameStatsProps, IPostGameStatsRef } from './post-game-stats-types';\n\nimport { useState, memo, useCallback, forwardRef, useImperativeHandle, useMemo } from 'react';\n\nimport { Accuracy } from './accuracy/accuracy';\nimport { Clock } from './clock/clock';\nimport { DigitalMeter } from './digital-meter/digital-meter';\nimport { EPostGameStat } from './enums/post-game-stats-enum';\nimport { Points } from './points/points';\nimport * as Styled from './post-game-stats-styled';\nimport { Streak } from './streak/streak';\n\nexport const PostGameStats = memo(\n forwardRef<IPostGameStatsRef, IPostGameStatsProps>(({ stats, show, onComplete }, ref) => {\n const [currStatIndex, setCurrentStatIndex] = useState(0);\n const currStatData = useMemo(() => stats[currStatIndex], [currStatIndex, stats]);\n\n const moveToNextAndPlay = useCallback(() => {\n currStatData?.onComplete?.();\n\n if (currStatIndex === stats.length - 1) {\n onComplete?.();\n\n return;\n }\n setCurrentStatIndex(prev => prev + 1);\n }, [currStatIndex, onComplete, stats.length, currStatData]);\n\n const onStatAnimationComplete = useCallback(() => {\n if (currStatData?.stopAtEnd) {\n return;\n }\n moveToNextAndPlay(); // Autoplay since stopAtEnd is false\n }, [currStatData, moveToNextAndPlay]);\n\n useImperativeHandle(ref, () => ({\n moveToNextAndPlay,\n }));\n\n const currentStat = useMemo(() => {\n if (currStatData) {\n const key = `${currStatData.type}-${currStatIndex}`;\n\n if (currStatData.type === EPostGameStat.POINT) {\n return (\n <Points\n key={key}\n point={currStatData.value}\n show={currStatData.type === EPostGameStat.POINT}\n onComplete={onStatAnimationComplete}\n onReveal={currStatData.onReveal}\n />\n );\n }\n\n if (currStatData.type === EPostGameStat.DIGITAL_METER) {\n return (\n <DigitalMeter\n key={key}\n value={currStatData.value}\n maxValue={currStatData.maxValue ?? 1}\n targetValue={currStatData.targetValue}\n displayText={currStatData.displayText ?? ''}\n progressType={currStatData.progressType ?? 'linear'}\n helperTextPrimary={currStatData.helperTextPrimary ?? ''}\n helperTextSecondary={currStatData.helperTextSecondary ?? ''}\n show={true}\n onComplete={onStatAnimationComplete}\n />\n );\n }\n\n if (currStatData.type === EPostGameStat.STREAK) {\n return (\n <Streak\n key={key}\n currStreak={currStatData.value}\n show={true}\n onComplete={onStatAnimationComplete}\n helperText={currStatData.helperText}\n onReveal={currStatData.onReveal}\n />\n );\n }\n\n if (currStatData.type === EPostGameStat.ACCURACY) {\n return (\n <Accuracy\n key={key}\n accuracy={currStatData.value}\n show={true}\n onComplete={onStatAnimationComplete}\n helperText={currStatData.helperText}\n />\n );\n }\n\n if (currStatData.type === EPostGameStat.CLOCK) {\n return (\n <Clock\n key={key}\n timeInMs={currStatData.value}\n show={true}\n onComplete={onStatAnimationComplete}\n helperText={currStatData.helperText}\n />\n );\n }\n\n return null;\n }\n\n return null;\n }, [currStatData, onStatAnimationComplete, currStatIndex]);\n\n if (!show || stats.length === 0 || currStatIndex >= stats.length) {\n return null;\n }\n\n return (\n <Styled.StatsWrapper>\n <Styled.BlackBg />\n\n {currentStat}\n </Styled.StatsWrapper>\n );\n }),\n);\n"],"names":["PostGameStats","memo","forwardRef","stats","show","onComplete","ref","currStatIndex","setCurrentStatIndex","useState","currStatData","useMemo","moveToNextAndPlay","useCallback","_a","prev","onStatAnimationComplete","useImperativeHandle","currentStat","key","EPostGameStat","jsx","Points","DigitalMeter","Streak","Accuracy","Clock","jsxs","Styled.StatsWrapper","Styled.BlackBg"],"mappings":";;;;;;;;;AAYO,MAAMA,IAAgBC;AAAA,EAC3BC,EAAmD,CAAC,EAAE,OAAAC,GAAO,MAAAC,GAAM,YAAAC,EAAA,GAAcC,MAAQ;AACvF,UAAM,CAACC,GAAeC,CAAmB,IAAIC,EAAS,CAAC,GACjDC,IAAeC,EAAQ,MAAMR,EAAMI,CAAa,GAAG,CAACA,GAAeJ,CAAK,CAAC,GAEzES,IAAoBC,EAAY,MAAM;;AAGtC,WAFJC,IAAAJ,KAAA,gBAAAA,EAAc,eAAd,QAAAI,EAAA,KAAAJ,IAEIH,MAAkBJ,EAAM,SAAS,GAAG;AACzB,QAAAE,KAAA,QAAAA;AAEb;AAAA,MACF;AACoB,MAAAG,EAAA,CAAAO,MAAQA,IAAO,CAAC;AAAA,IAAA,GACnC,CAACR,GAAeF,GAAYF,EAAM,QAAQO,CAAY,CAAC,GAEpDM,IAA0BH,EAAY,MAAM;AAChD,MAAIH,KAAA,QAAAA,EAAc,aAGAE;IAAA,GACjB,CAACF,GAAcE,CAAiB,CAAC;AAEpC,IAAAK,EAAoBX,GAAK,OAAO;AAAA,MAC9B,mBAAAM;AAAA,IACA,EAAA;AAEI,UAAAM,IAAcP,EAAQ,MAAM;AAChC,UAAID,GAAc;AAChB,cAAMS,IAAM,GAAGT,EAAa,IAAI,IAAIH,CAAa;AAE7C,eAAAG,EAAa,SAASU,EAAc,QAEpC,gBAAAC;AAAA,UAACC;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