@cuemath/leap 2.9.7-hg8 → 2.9.7-rj-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 (34) hide show
  1. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +93 -92
  2. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
  3. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +88 -86
  4. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -1
  5. package/dist/features/circle-games/games/tutorial/constants.js +3 -2
  6. package/dist/features/circle-games/games/tutorial/constants.js.map +1 -1
  7. package/dist/features/circle-games/games/tutorial/tutorial-styled.js +23 -19
  8. package/dist/features/circle-games/games/tutorial/tutorial-styled.js.map +1 -1
  9. package/dist/features/circle-games/games/tutorial/tutorial.js +41 -41
  10. package/dist/features/circle-games/games/tutorial/tutorial.js.map +1 -1
  11. package/dist/features/circle-games/games/web-view/web-view.js +46 -55
  12. package/dist/features/circle-games/games/web-view/web-view.js.map +1 -1
  13. package/dist/features/circle-games/leaderboard/comps/banner/banner.js +6 -6
  14. package/dist/features/circle-games/leaderboard/comps/banner/banner.js.map +1 -1
  15. package/dist/features/circle-games/leaderboard/comps/navigation-button/navigation-button-styled.js +1 -1
  16. package/dist/features/circle-games/leaderboard/comps/navigation-button/navigation-button-styled.js.map +1 -1
  17. package/dist/features/circle-games/leaderboard/leaderboard-styled.js +1 -1
  18. package/dist/features/circle-games/leaderboard/leaderboard-styled.js.map +1 -1
  19. package/dist/features/circle-games/leaderboard/leaderboard.js +9 -9
  20. package/dist/features/circle-games/leaderboard/leaderboard.js.map +1 -1
  21. package/dist/features/circle-games/sign-up/comp/circular-steps/circular-steps-styled.js +8 -8
  22. package/dist/features/circle-games/sign-up/comp/circular-steps/circular-steps-styled.js.map +1 -1
  23. package/dist/features/circle-games/sign-up/constants.js +9 -9
  24. package/dist/features/circle-games/sign-up/constants.js.map +1 -1
  25. package/dist/features/hooks/use-breakpoint/constants.js +7 -0
  26. package/dist/features/hooks/use-breakpoint/constants.js.map +1 -0
  27. package/dist/features/hooks/use-breakpoint/use-breakpoint.js +16 -0
  28. package/dist/features/hooks/use-breakpoint/use-breakpoint.js.map +1 -0
  29. package/dist/features/ui/arc-button/constants.js +3 -3
  30. package/dist/features/ui/arc-button/constants.js.map +1 -1
  31. package/dist/index.d.ts +10 -1
  32. package/dist/index.js +135 -133
  33. package/dist/index.js.map +1 -1
  34. package/package.json +4 -2
@@ -1 +1 @@
1
- {"version":3,"file":"tutorial.js","sources":["../../../../../src/features/circle-games/games/tutorial/tutorial.tsx"],"sourcesContent":["import type { ITutorialProps } from './tutorial-types';\nimport type { ChangeEvent } from 'react';\n\nimport { useCallback, useRef, useState } from 'react';\n\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport Text from '../../../ui/text/text';\nimport * as Styled from './tutorial-styled';\n\nexport const Tutorial = ({\n src,\n title,\n onCross,\n showProgress = true,\n onTutorialPlayedOnce,\n}: ITutorialProps) => {\n const [progress, setProgress] = useState(0);\n const hasVideoEnded = useRef(false);\n\n const onProgress = useCallback(\n (e: ChangeEvent<HTMLVideoElement>) => {\n const p = ((e.target.currentTime || 0) / (e.target.duration || 1)) * 100;\n\n if (p >= 90 && !hasVideoEnded.current) {\n hasVideoEnded.current = true;\n onTutorialPlayedOnce?.();\n }\n\n setProgress(p);\n },\n [onTutorialPlayedOnce],\n );\n\n return (\n <Styled.GameTutorialWrapper>\n {(title || onCross) && (\n <Styled.GameTutorialHeader>\n {title && (\n <Text $renderAs=\"ac3\" $color=\"WHITE\" $align=\"center\">\n {title}\n </Text>\n )}\n {onCross && (\n <Styled.HeaderIconContainer>\n <CrossIcon color=\"#fff\" onClick={onCross} />\n </Styled.HeaderIconContainer>\n )}\n </Styled.GameTutorialHeader>\n )}\n\n <Styled.GameTutorialContainer>\n <Styled.VideoContainer>\n <video\n loop={true}\n autoPlay={true}\n muted={true}\n src={src}\n onTimeUpdate={onProgress}\n disablePictureInPicture={true}\n itemType=\"video/mp4\"\n playsInline\n />\n </Styled.VideoContainer>\n </Styled.GameTutorialContainer>\n\n {showProgress && (\n <Styled.VideoProgressWrapper>\n <Styled.VideoProgressContainer>\n {progress > 0 && <Styled.VideoProgress $width={progress} />}\n </Styled.VideoProgressContainer>\n </Styled.VideoProgressWrapper>\n )}\n </Styled.GameTutorialWrapper>\n );\n};\n"],"names":["Tutorial","src","title","onCross","showProgress","onTutorialPlayedOnce","progress","setProgress","useState","hasVideoEnded","useRef","onProgress","useCallback","e","p","jsxs","Styled.GameTutorialWrapper","Styled.GameTutorialHeader","jsx","Text","Styled.HeaderIconContainer","CrossIcon","Styled.GameTutorialContainer","Styled.VideoContainer","Styled.VideoProgressWrapper","Styled.VideoProgressContainer","Styled.VideoProgress"],"mappings":";;;;;AASO,MAAMA,IAAW,CAAC;AAAA,EACvB,KAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,sBAAAC;AACF,MAAsB;AACpB,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS,CAAC,GACpCC,IAAgBC,EAAO,EAAK,GAE5BC,IAAaC;AAAA,IACjB,CAACC,MAAqC;AAC9B,YAAAC,KAAMD,EAAE,OAAO,eAAe,MAAMA,EAAE,OAAO,YAAY,KAAM;AAErE,MAAIC,KAAK,MAAM,CAACL,EAAc,YAC5BA,EAAc,UAAU,IACDJ,KAAA,QAAAA,MAGzBE,EAAYO,CAAC;AAAA,IACf;AAAA,IACA,CAACT,CAAoB;AAAA,EAAA;AAIrB,SAAA,gBAAAU,EAACC,GAAA,EACG,UAAA;AAAA,KAAAd,KAASC,MACT,gBAAAY,EAACE,GAAA,EACE,UAAA;AAAA,MACCf,KAAA,gBAAAgB,EAACC,KAAK,WAAU,OAAM,QAAO,SAAQ,QAAO,UACzC,UACHjB,EAAA,CAAA;AAAA,MAEDC,KACE,gBAAAe,EAAAE,GAAA,EACC,UAAC,gBAAAF,EAAAG,GAAA,EAAU,OAAM,QAAO,SAASlB,EAAA,CAAS,EAC5C,CAAA;AAAA,IAAA,GAEJ;AAAA,sBAGDmB,GAAA,EACC,UAAC,gBAAAJ,EAAAK,GAAA,EACC,UAAA,gBAAAL;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAM;AAAA,QACN,UAAU;AAAA,QACV,OAAO;AAAA,QACP,KAAAjB;AAAA,QACA,cAAcU;AAAA,QACd,yBAAyB;AAAA,QACzB,UAAS;AAAA,QACT,aAAW;AAAA,MAAA;AAAA,OAEf,EACF,CAAA;AAAA,IAECP,KACE,gBAAAc,EAAAM,GAAA,EACC,UAAA,gBAAAN,EAACO,GAAA,EACE,UAAWnB,IAAA,uBAAMoB,GAAA,EAAqB,QAAQpB,EAAU,CAAA,EAC3D,CAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"tutorial.js","sources":["../../../../../src/features/circle-games/games/tutorial/tutorial.tsx"],"sourcesContent":["import type { ITutorialProps, ITutorialRef } from './tutorial-types';\nimport type { ChangeEvent } from 'react';\n\nimport { forwardRef, useCallback, useImperativeHandle, useRef, useState } from 'react';\n\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport { useJourney } from '../../../journey/use-journey/use-journey';\nimport Text from '../../../ui/text/text';\nimport * as Styled from './tutorial-styled';\n\nexport const Tutorial = forwardRef<ITutorialRef, ITutorialProps>(\n ({ src, title, onCross, showProgress = true, onTutorialPlayedOnce }: ITutorialProps, ref) => {\n const [progress, setProgress] = useState(0);\n const hasVideoEnded = useRef(false);\n const videoRef = useRef<HTMLVideoElement>(null);\n\n const { isJourneyActive } = useJourney();\n\n const onProgress = useCallback(\n (e: ChangeEvent<HTMLVideoElement>) => {\n const p = ((e.target.currentTime || 0) / (e.target.duration || 1)) * 100;\n\n if (p >= 90 && !hasVideoEnded.current) {\n hasVideoEnded.current = true;\n onTutorialPlayedOnce?.();\n }\n\n setProgress(p);\n },\n [onTutorialPlayedOnce],\n );\n\n useImperativeHandle(ref, () => ({\n videoRef,\n }));\n\n return (\n <Styled.GameTutorialWrapper>\n {(title || onCross) && (\n <Styled.GameTutorialHeader>\n {title && (\n <Text $renderAs=\"ac3\" $color=\"WHITE\" $align=\"center\">\n {title}\n </Text>\n )}\n {onCross && (\n <Styled.HeaderIconContainer>\n <CrossIcon color=\"#fff\" onClick={onCross} />\n </Styled.HeaderIconContainer>\n )}\n </Styled.GameTutorialHeader>\n )}\n <Styled.GameTutorialContainer>\n <Styled.VideoContainer isJourneyActive={isJourneyActive}>\n <video\n ref={videoRef}\n loop={true}\n autoPlay={true}\n muted={true}\n src={src}\n onTimeUpdate={onProgress}\n disablePictureInPicture={true}\n itemType=\"video/mp4\"\n playsInline\n />\n </Styled.VideoContainer>\n </Styled.GameTutorialContainer>\n\n {showProgress && (\n <Styled.VideoProgressWrapper>\n <Styled.VideoProgressContainer>\n {progress > 0 && <Styled.VideoProgress $width={progress} />}\n </Styled.VideoProgressContainer>\n </Styled.VideoProgressWrapper>\n )}\n </Styled.GameTutorialWrapper>\n );\n },\n);\n"],"names":["Tutorial","forwardRef","src","title","onCross","showProgress","onTutorialPlayedOnce","ref","progress","setProgress","useState","hasVideoEnded","useRef","videoRef","isJourneyActive","useJourney","onProgress","useCallback","e","p","useImperativeHandle","jsxs","Styled.GameTutorialWrapper","Styled.GameTutorialHeader","jsx","Text","Styled.HeaderIconContainer","CrossIcon","Styled.GameTutorialContainer","Styled.VideoContainer","Styled.VideoProgressWrapper","Styled.VideoProgressContainer","Styled.VideoProgress"],"mappings":";;;;;;AAUO,MAAMA,IAAWC;AAAA,EACtB,CAAC,EAAE,KAAAC,GAAK,OAAAC,GAAO,SAAAC,GAAS,cAAAC,IAAe,IAAM,sBAAAC,EAAqB,GAAmBC,MAAQ;AAC3F,UAAM,CAACC,GAA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,GACF;AAAA,IAEJ,EAAA,CAAA;AAAA,EAEJ;AACF;"}
@@ -1,30 +1,28 @@
1
- import { jsxs as h, jsx as g } from "react/jsx-runtime";
2
- import { forwardRef as P, useRef as G, useMemo as _, useCallback as v, useImperativeHandle as x, useEffect as B } from "react";
1
+ import { jsx as P } from "react/jsx-runtime";
2
+ import { forwardRef as V, useRef as G, useMemo as R, useCallback as v, useImperativeHandle as $, useEffect as B } from "react";
3
3
  import { useUIContext as J } from "../../../ui/context/context.js";
4
- import { ALLOWED_ORIGIN as R } from "./constants.js";
5
- import C from "../../../ui/separator/separator.js";
6
- import U from "../../../ui/layout/flex-view.js";
4
+ import { ALLOWED_ORIGIN as C } from "./constants.js";
7
5
  import { ProjectType as s } from "./enums/project-type-enum.js";
8
6
  import { WebViewEvent as o } from "./enums/web-view-events-enum.js";
9
- const X = P((L, M) => {
7
+ const Z = V((I, b) => {
10
8
  const {
11
9
  baseUrl: y,
12
10
  projectDetails: T,
13
- playerDetails: E,
11
+ playerDetails: w,
14
12
  onGameLoad: a,
15
- onGamePlayFinish: p,
16
- handleInfoMessage: c,
13
+ onGamePlayFinish: c,
14
+ handleInfoMessage: p,
17
15
  onBack: f,
18
- parentDomain: I,
19
- ...V
20
- } = L, m = G(null), N = _(() => E, [E]), t = _(() => T, [T]);
16
+ parentDomain: g,
17
+ ...L
18
+ } = I, l = G(null), N = R(() => w, [w]), t = R(() => T, [T]);
21
19
  let A = "";
22
20
  const { onEvent: O } = J();
23
21
  t.projectType === s.LESSON && (A = t.miniGameIdentifier);
24
- const l = v(() => {
25
- const { enableCloseButton: n = !0 } = t;
22
+ const m = v(() => {
23
+ const { enableCloseButton: i = !0 } = t;
26
24
  let e = {
27
- enableCloseButton: n
25
+ enableCloseButton: i
28
26
  };
29
27
  return t.projectType === s.GAME && (e = {
30
28
  ...e,
@@ -39,67 +37,60 @@ const X = P((L, M) => {
39
37
  ...e,
40
38
  ...t
41
39
  }), e;
42
- }, [t]), w = v(() => {
43
- var e, i;
44
- const n = l();
45
- (i = (e = m.current) == null ? void 0 : e.contentWindow) == null || i.postMessage(
40
+ }, [t]), d = v(() => {
41
+ var e, r;
42
+ const i = m();
43
+ (r = (e = l.current) == null ? void 0 : e.contentWindow) == null || r.postMessage(
46
44
  JSON.stringify({
47
45
  event: o.GAME_DATA,
48
- payload: n
46
+ payload: i
49
47
  }),
50
- R
48
+ C
51
49
  );
52
- }, [l]), S = v(() => {
53
- var e, i;
54
- const n = l();
55
- (i = (e = m.current) == null ? void 0 : e.contentWindow) == null || i.postMessage(
50
+ }, [m]), D = v(() => {
51
+ var e, r;
52
+ const i = m();
53
+ (r = (e = l.current) == null ? void 0 : e.contentWindow) == null || r.postMessage(
56
54
  JSON.stringify({
57
55
  event: o.SET_CONFIG,
58
56
  payload: {
59
57
  user: N,
60
- projectConfig: n,
61
- parentDomain: I,
62
- topInset: window.topInset || 0,
63
- bottomInset: window.bottomInset || 0
58
+ projectConfig: i,
59
+ parentDomain: g
64
60
  }
65
61
  }),
66
- R
62
+ C
67
63
  );
68
- }, [N, l, I]);
69
- x(M, () => m.current, []), B(() => {
70
- const n = (e) => {
71
- var D, b;
72
- const i = e.data, j = typeof i == "string" ? JSON.parse(i) : i, { event: r, payload: d = null } = j;
73
- if (r === o.VIBRATE) {
74
- const { pattern: u } = d;
75
- window.ReactNativeWebView ? window.ReactNativeWebView.postMessage(JSON.stringify(j)) : (b = (D = window.navigator).vibrate) == null || b.call(D, u);
64
+ }, [N, m, g]);
65
+ $(b, () => l.current, []), B(() => {
66
+ const i = (e) => {
67
+ var j, _;
68
+ const r = e.data, S = typeof r == "string" ? JSON.parse(r) : r, { event: n, payload: E = null } = S;
69
+ if (n === o.VIBRATE) {
70
+ const { pattern: u } = E;
71
+ window.ReactNativeWebView ? window.ReactNativeWebView.postMessage(JSON.stringify(S)) : (_ = (j = window.navigator).vibrate) == null || _.call(j, u);
76
72
  }
77
- if (r === o.GAME_BACK && (f == null || f()), r === o.HIDE_LOADER && (a == null || a()), r === o.LOAD_DATA_FROM_APP && (w == null || w()), r === o.GET_CONFIG && S(), r === o.UPDATE_STATS && (p == null || p(d)), r === o.SHOW_SNACKBAR && (c == null || c(d)), r === o.TRACK_EVENT) {
78
- const { eventName: u, properties: $ } = d;
79
- O(u, $);
73
+ if (n === o.GAME_BACK && (f == null || f()), n === o.HIDE_LOADER && (a == null || a()), n === o.LOAD_DATA_FROM_APP && (d == null || d()), n === o.GET_CONFIG && D(), n === o.UPDATE_STATS && (c == null || c(E)), n === o.SHOW_SNACKBAR && (p == null || p(E)), n === o.TRACK_EVENT) {
74
+ const { eventName: u, properties: W } = E;
75
+ O(u, W);
80
76
  }
81
77
  };
82
- return window.addEventListener("message", n), () => {
83
- window.removeEventListener("message", n);
78
+ return window.addEventListener("message", i), () => {
79
+ window.removeEventListener("message", i);
84
80
  };
85
81
  }, [
86
- c,
87
- f,
88
82
  p,
83
+ f,
84
+ c,
89
85
  a,
90
- S,
91
- w,
86
+ D,
87
+ d,
92
88
  O
93
89
  ]);
94
- const W = E.isAdmin ? y : `${y}/play-game/${t.projectId}/${t.variant}${A ? `/${A}` : ""}`;
95
- return /* @__PURE__ */ h(U, { $height: "100%", $width: "100%", children: [
96
- /* @__PURE__ */ g(C, { height: window.topInset || 0 }),
97
- /* @__PURE__ */ g("iframe", { ...V, ref: m, src: `${W}?version=2`, allow: "autoplay" }),
98
- ";",
99
- /* @__PURE__ */ g(C, { height: window.bottomInset || 0 })
100
- ] });
90
+ const M = w.isAdmin ? y : `${y}/play-game/${t.projectId}/${t.variant}${A ? `/${A}` : ""}`;
91
+ return /* @__PURE__ */ P("iframe", { ...L, ref: l, src: `${M}?version=2`, allow: "autoplay" });
101
92
  });
102
93
  export {
103
- X as WebView
94
+ Z as WebView
104
95
  };
105
96
  //# sourceMappingURL=web-view.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web-view.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view.tsx"],"sourcesContent":["import type {\n IInfoMessage,\n ILessonWebGameProps,\n IMessageProps,\n IMultiplayerWebGameProps,\n IPlayerStats,\n IPuzzleWebGameProps,\n ITableWebGameProps,\n IVibrationPattern,\n IWebViewProps,\n} from './web-view-types';\nimport type { ForwardedRef } from 'react';\n\nimport { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\n\nimport { useUIContext } from '../../../ui/context/context';\nimport { ALLOWED_ORIGIN } from './constants';\nimport { ProjectType, WebViewEvent } from './enums';\nimport Separator from '../../../ui/separator/separator';\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const WebView = forwardRef((props: IWebViewProps, ref: ForwardedRef<HTMLIFrameElement>) => {\n const {\n baseUrl,\n projectDetails,\n playerDetails,\n onGameLoad,\n onGamePlayFinish,\n handleInfoMessage,\n onBack,\n parentDomain,\n ...rest\n } = props;\n const webViewRef = useRef<HTMLIFrameElement>(null);\n const memoizedPlayerDetails = useMemo(() => playerDetails, [playerDetails]);\n const memoizedProjectDetails = useMemo(() => projectDetails, [projectDetails]);\n\n let miniGameIdentifier = '';\n const { onEvent: trackEvent } = useUIContext();\n\n if (memoizedProjectDetails.projectType === ProjectType.LESSON) {\n miniGameIdentifier = (memoizedProjectDetails as ILessonWebGameProps).miniGameIdentifier;\n }\n\n const getProjectDetails = useCallback(() => {\n const { enableCloseButton = true } = memoizedProjectDetails;\n\n let payload = {\n enableCloseButton,\n } as IMultiplayerWebGameProps | IPuzzleWebGameProps | ILessonWebGameProps;\n\n if (memoizedProjectDetails.projectType === ProjectType.GAME) {\n payload = {\n ...payload,\n ...memoizedProjectDetails,\n } as IMultiplayerWebGameProps;\n }\n\n if (memoizedProjectDetails.projectType === ProjectType.PUZZLE) {\n payload = {\n ...payload,\n ...memoizedProjectDetails,\n } as IPuzzleWebGameProps;\n }\n\n if (memoizedProjectDetails.projectType === ProjectType.LESSON) {\n payload = {\n ...payload,\n ...memoizedProjectDetails,\n } as ILessonWebGameProps;\n }\n\n if (memoizedProjectDetails.projectType === ProjectType.TABLE) {\n payload = {\n ...payload,\n ...memoizedProjectDetails,\n } as ITableWebGameProps;\n }\n\n return payload;\n }, [memoizedProjectDetails]);\n\n const sendGamesData = useCallback(() => {\n const payload = getProjectDetails();\n\n webViewRef.current?.contentWindow?.postMessage(\n JSON.stringify({\n event: WebViewEvent.GAME_DATA,\n payload,\n }),\n ALLOWED_ORIGIN,\n );\n }, [getProjectDetails]);\n\n const setConfig = useCallback(() => {\n const projectConfig = getProjectDetails();\n\n webViewRef.current?.contentWindow?.postMessage(\n JSON.stringify({\n event: WebViewEvent.SET_CONFIG,\n payload: {\n user: memoizedPlayerDetails,\n projectConfig,\n parentDomain,\n topInset: window.topInset || 0,\n bottomInset: window.bottomInset || 0,\n },\n }),\n ALLOWED_ORIGIN,\n );\n }, [memoizedPlayerDetails, getProjectDetails, parentDomain]);\n\n useImperativeHandle(ref, () => webViewRef.current as HTMLIFrameElement, []);\n\n useEffect(() => {\n const handleMessage = (e: MessageEvent) => {\n const data: string = e.data;\n const parsedData = typeof data === 'string' ? JSON.parse(data) : (data as IMessageProps);\n\n const { event, payload = null } = parsedData;\n\n if (event === WebViewEvent.VIBRATE) {\n const { pattern } = payload as IVibrationPattern;\n\n if (window.ReactNativeWebView) {\n window.ReactNativeWebView.postMessage(JSON.stringify(parsedData));\n } else {\n window.navigator.vibrate?.(pattern);\n }\n }\n\n if (event === WebViewEvent.GAME_BACK) {\n onBack?.();\n }\n\n if (event === WebViewEvent.HIDE_LOADER) {\n onGameLoad?.();\n }\n\n if (event === WebViewEvent.LOAD_DATA_FROM_APP) {\n sendGamesData?.();\n }\n\n if (event === WebViewEvent.GET_CONFIG) {\n setConfig();\n }\n\n if (event === WebViewEvent.UPDATE_STATS) {\n onGamePlayFinish?.(payload as IPlayerStats);\n }\n\n if (event === WebViewEvent.SHOW_SNACKBAR) {\n handleInfoMessage?.(payload as IInfoMessage);\n }\n\n if (event === WebViewEvent.TRACK_EVENT) {\n const { eventName, properties } = payload;\n\n trackEvent(eventName, properties);\n }\n };\n\n window.addEventListener('message', handleMessage);\n\n return () => {\n window.removeEventListener('message', handleMessage);\n };\n }, [\n handleInfoMessage,\n onBack,\n onGamePlayFinish,\n onGameLoad,\n setConfig,\n sendGamesData,\n trackEvent,\n ]);\n\n const url = playerDetails.isAdmin\n ? baseUrl\n : `${baseUrl}/play-game/${memoizedProjectDetails.projectId}/${memoizedProjectDetails.variant}${\n miniGameIdentifier ? `/${miniGameIdentifier}` : ''\n }`;\n\n return (\n <FlexView $height='100%' $width='100%'>\n <Separator height={window.topInset || 0} />\n <iframe {...rest} ref={webViewRef} src={`${url}?version=2`} allow=\"autoplay\" />;\n <Separator height={window.bottomInset || 0} />\n </FlexView>\n );\n});\n"],"names":["WebView","forwardRef","props","ref","baseUrl","projectDetails","playerDetails","onGameLoad","onGamePlayFinish","handleInfoMessage","onBack","parentDomain","rest","webViewRef","useRef","memoizedPlayerDetails","useMemo","memoizedProjectDetails","miniGameIdentifier","trackEvent","useUIContext","ProjectType","getProjectDetails","useCallback","enableCloseButton","payload","sendGamesData","_b","_a","WebViewEvent","ALLOWED_ORIGIN","setConfig","projectConfig","useImperativeHandle","useEffect","handleMessage","data","parsedData","event","pattern","eventName","properties","url","jsxs","FlexView","jsx","Separator"],"mappings":";;;;;;;;AAqBO,MAAMA,IAAUC,EAAW,CAACC,GAAsBC,MAAyC;AAC1F,QAAA;AAAA,IACJ,SAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,cAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAV,GACEW,IAAaC,EAA0B,IAAI,GAC3CC,IAAwBC,EAAQ,MAAMV,GAAe,CAACA,CAAa,CAAC,GACpEW,IAAyBD,EAAQ,MAAMX,GAAgB,CAACA,CAAc,CAAC;AAE7E,MAAIa,IAAqB;AACzB,QAAM,EAAE,SAASC,EAAW,IAAIC,EAAa;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AS,IAAIA,EAAuB,OAAO,GACxFC,IAAqB,IAAIA,CAAkB,KAAK,EAClD;AAEJ,SACG,gBAAAyB,EAAAC,GAAA,EAAS,SAAQ,QAAO,QAAO,QAC9B,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAU,EAAA,QAAQ,OAAO,YAAY,GAAG;AAAA,IACzC,gBAAAD,EAAC,UAAQ,EAAA,GAAGjC,GAAM,KAAKC,GAAY,KAAK,GAAG6B,CAAG,cAAc,OAAM,WAAW,CAAA;AAAA,IAAE;AAAA,IAC9E,gBAAAG,EAAAC,GAAA,EAAU,QAAQ,OAAO,eAAe,GAAG;AAAA,EAC9C,EAAA,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"web-view.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view.tsx"],"sourcesContent":["declare global {\n interface IReactNativeWebview {\n postMessage: (data: string) => void;\n }\n\n interface Window {\n ReactNativeWebView?: IReactNativeWebview;\n }\n}\n\nimport type {\n IInfoMessage,\n ILessonWebGameProps,\n IMessageProps,\n IMultiplayerWebGameProps,\n IPlayerStats,\n IPuzzleWebGameProps,\n ITableWebGameProps,\n IVibrationPattern,\n IWebViewProps,\n} from './web-view-types';\nimport type { ForwardedRef } from 'react';\n\nimport { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\n\nimport { useUIContext } from '../../../ui/context/context';\nimport { ALLOWED_ORIGIN } from './constants';\nimport { ProjectType, WebViewEvent } from './enums';\n\nexport const WebView = forwardRef((props: IWebViewProps, ref: ForwardedRef<HTMLIFrameElement>) => {\n const {\n baseUrl,\n projectDetails,\n playerDetails,\n onGameLoad,\n onGamePlayFinish,\n handleInfoMessage,\n onBack,\n parentDomain,\n ...rest\n } = props;\n const webViewRef = useRef<HTMLIFrameElement>(null);\n const memoizedPlayerDetails = useMemo(() => playerDetails, [playerDetails]);\n const memoizedProjectDetails = useMemo(() => projectDetails, [projectDetails]);\n\n let miniGameIdentifier = '';\n const { onEvent: trackEvent } = useUIContext();\n\n if (memoizedProjectDetails.projectType === ProjectType.LESSON) {\n miniGameIdentifier = (memoizedProjectDetails as ILessonWebGameProps).miniGameIdentifier;\n }\n\n const getProjectDetails = useCallback(() => {\n const { enableCloseButton = true } = memoizedProjectDetails;\n\n let payload = {\n enableCloseButton,\n } as IMultiplayerWebGameProps | IPuzzleWebGameProps | ILessonWebGameProps;\n\n if (memoizedProjectDetails.projectType === ProjectType.GAME) {\n payload = {\n ...payload,\n ...memoizedProjectDetails,\n } as IMultiplayerWebGameProps;\n }\n\n if (memoizedProjectDetails.projectType === ProjectType.PUZZLE) {\n payload = {\n ...payload,\n ...memoizedProjectDetails,\n } as IPuzzleWebGameProps;\n }\n\n if (memoizedProjectDetails.projectType === ProjectType.LESSON) {\n payload = {\n ...payload,\n ...memoizedProjectDetails,\n } as ILessonWebGameProps;\n }\n\n if (memoizedProjectDetails.projectType === ProjectType.TABLE) {\n payload = {\n ...payload,\n ...memoizedProjectDetails,\n } as ITableWebGameProps;\n }\n\n return payload;\n }, [memoizedProjectDetails]);\n\n const sendGamesData = useCallback(() => {\n const payload = getProjectDetails();\n\n webViewRef.current?.contentWindow?.postMessage(\n JSON.stringify({\n event: WebViewEvent.GAME_DATA,\n payload,\n }),\n ALLOWED_ORIGIN,\n );\n }, [getProjectDetails]);\n\n const setConfig = useCallback(() => {\n const projectConfig = getProjectDetails();\n\n webViewRef.current?.contentWindow?.postMessage(\n JSON.stringify({\n event: WebViewEvent.SET_CONFIG,\n payload: {\n user: memoizedPlayerDetails,\n projectConfig,\n parentDomain,\n },\n }),\n ALLOWED_ORIGIN,\n );\n }, [memoizedPlayerDetails, getProjectDetails, parentDomain]);\n\n useImperativeHandle(ref, () => webViewRef.current as HTMLIFrameElement, []);\n\n useEffect(() => {\n const handleMessage = (e: MessageEvent) => {\n const data: string = e.data;\n const parsedData = typeof data === 'string' ? JSON.parse(data) : (data as IMessageProps);\n\n const { event, payload = null } = parsedData;\n\n if (event === WebViewEvent.VIBRATE) {\n const { pattern } = payload as IVibrationPattern;\n\n if (window.ReactNativeWebView) {\n window.ReactNativeWebView.postMessage(JSON.stringify(parsedData));\n } else {\n window.navigator.vibrate?.(pattern);\n }\n }\n\n if (event === WebViewEvent.GAME_BACK) {\n onBack?.();\n }\n\n if (event === WebViewEvent.HIDE_LOADER) {\n onGameLoad?.();\n }\n\n if (event === WebViewEvent.LOAD_DATA_FROM_APP) {\n sendGamesData?.();\n }\n\n if (event === WebViewEvent.GET_CONFIG) {\n setConfig();\n }\n\n if (event === WebViewEvent.UPDATE_STATS) {\n onGamePlayFinish?.(payload as IPlayerStats);\n }\n\n if (event === WebViewEvent.SHOW_SNACKBAR) {\n handleInfoMessage?.(payload as IInfoMessage);\n }\n\n if (event === WebViewEvent.TRACK_EVENT) {\n const { eventName, properties } = payload;\n\n trackEvent(eventName, properties);\n }\n };\n\n window.addEventListener('message', handleMessage);\n\n return () => {\n window.removeEventListener('message', handleMessage);\n };\n }, [\n handleInfoMessage,\n onBack,\n onGamePlayFinish,\n onGameLoad,\n setConfig,\n sendGamesData,\n trackEvent,\n ]);\n\n const url = playerDetails.isAdmin\n ? baseUrl\n : `${baseUrl}/play-game/${memoizedProjectDetails.projectId}/${memoizedProjectDetails.variant}${\n miniGameIdentifier ? `/${miniGameIdentifier}` : ''\n }`;\n\n return <iframe {...rest} ref={webViewRef} src={`${url}?version=2`} allow=\"autoplay\" />;\n});\n"],"names":["WebView","forwardRef","props","ref","baseUrl","projectDetails","playerDetails","onGameLoad","onGamePlayFinish","handleInfoMessage","onBack","parentDomain","rest","webViewRef","useRef","memoizedPlayerDetails","useMemo","memoizedProjectDetails","miniGameIdentifier","trackEvent","useUIContext","ProjectType","getProjectDetails","useCallback","enableCloseButton","payload","sendGamesData","_b","_a","WebViewEvent","ALLOWED_ORIGIN","setConfig","projectConfig","useImperativeHandle","useEffect","handleMessage","data","parsedData","event","pattern","eventName","properties","url","jsx"],"mappings":";;;;;;AA6BO,MAAMA,IAAUC,EAAW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AAAC,EAAe,IAAAhB;AAElC,QAAAN,EAAWqB,GAAWC,CAAU;AAAA,MAClC;AAAA,IAAA;AAGK,kBAAA,iBAAiB,WAAWN,CAAa,GAEzC,MAAM;AACJ,aAAA,oBAAoB,WAAWA,CAAa;AAAA,IAAA;AAAA,EACrD,GACC;AAAA,IACD1B;AAAA,IACAC;AAAA,IACAF;AAAA,IACAD;AAAA,IACAwB;AAAA,IACAL;AAAA,IACAP;AAAA,EAAA,CACD;AAED,QAAMuB,IAAMpC,EAAc,UACtBF,IACA,GAAGA,CAAO,cAAca,EAAuB,SAAS,IAAIA,EAAuB,OAAO,GACxFC,IAAqB,IAAIA,CAAkB,KAAK,EAClD;AAEG,SAAA,gBAAAyB,EAAC,UAAQ,EAAA,GAAG/B,GAAM,KAAKC,GAAY,KAAK,GAAG6B,CAAG,cAAc,OAAM,WAAW,CAAA;AACtF,CAAC;"}
@@ -1,19 +1,19 @@
1
1
  import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
- import { memo as l } from "react";
2
+ import { memo as d } from "react";
3
3
  import h from "../../../../ui/lottie-animation/lottie-animation.js";
4
4
  import p from "../../../../ui/separator/separator.js";
5
5
  import o from "../../../../ui/text/text.js";
6
6
  import { BannerContainer as f, CircleLottieView as x, BannerTextContainer as T, CountTextWrapper as C } from "./banner-styled.js";
7
- const $ = { renderer: "canvas" }, E = l(
7
+ const $ = { renderer: "canvas" }, H = d(
8
8
  ({
9
9
  primaryText: i,
10
10
  secondaryText: t,
11
- topInset: e = window.topInset || 0,
11
+ topInset: e = 0,
12
12
  isLoading: a = !1,
13
13
  lottiePath: m,
14
14
  bgFromTopPosition: c = 0,
15
15
  bgFromRightPosition: s = 0,
16
- custEle: d
16
+ custEle: l
17
17
  }) => /* @__PURE__ */ n(f, { topInset: e, children: [
18
18
  /* @__PURE__ */ r(
19
19
  x,
@@ -30,11 +30,11 @@ const $ = { renderer: "canvas" }, E = l(
30
30
  /* @__PURE__ */ r(p, { height: 4 }),
31
31
  /* @__PURE__ */ r(o, { $renderAs: "ah4", $color: "WHITE", children: a ? "__" : t })
32
32
  ] }),
33
- d
33
+ l
34
34
  ] })
35
35
  ] })
36
36
  );
37
37
  export {
38
- E as Banner
38
+ H as Banner
39
39
  };
40
40
  //# sourceMappingURL=banner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"banner.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/banner/banner.tsx"],"sourcesContent":["import type { IBannerProps } from './banner-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport * as Styled from './banner-styled';\n\nconst animationSettings = { renderer: 'canvas' };\n\nexport const Banner: FC<IBannerProps> = memo(\n ({\n primaryText,\n secondaryText,\n topInset = window.topInset || 0,\n isLoading = false,\n lottiePath,\n bgFromTopPosition = 0,\n bgFromRightPosition = 0,\n custEle,\n }) => (\n <Styled.BannerContainer topInset={topInset}>\n <Styled.CircleLottieView\n topInset={topInset}\n bgFromTopPosition={bgFromTopPosition}\n bgFromRightPosition={bgFromRightPosition}\n >\n <LottieAnimation src={lottiePath} settings={animationSettings} />\n </Styled.CircleLottieView>\n\n <Styled.BannerTextContainer>\n <Styled.CountTextWrapper topInset={topInset}>\n <Text $renderAs=\"ac4\" $color=\"WHITE\">\n {primaryText}\n </Text>\n <Separator height={4} />\n <Text $renderAs=\"ah4\" $color=\"WHITE\">\n {isLoading ? '__' : secondaryText}\n </Text>\n </Styled.CountTextWrapper>\n\n {custEle}\n </Styled.BannerTextContainer>\n </Styled.BannerContainer>\n ),\n);\n"],"names":["animationSettings","Banner","memo","primaryText","secondaryText","topInset","isLoading","lottiePath","bgFromTopPosition","bgFromRightPosition","custEle","jsxs","Styled.BannerContainer","jsx","Styled.CircleLottieView","LottieAnimation","Styled.BannerTextContainer","Styled.CountTextWrapper","Text","Separator"],"mappings":";;;;;;AAUA,MAAMA,IAAoB,EAAE,UAAU,YAEzBC,IAA2BC;AAAA,EACtC,CAAC;AAAA,IACC,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC,IAAW,OAAO,YAAY;AAAA,IAC9B,WAAAC,IAAY;AAAA,IACZ,YAAAC;AAAA,IACA,mBAAAC,IAAoB;AAAA,IACpB,qBAAAC,IAAsB;AAAA,IACtB,SAAAC;AAAA,EAEA,MAAA,gBAAAC,EAACC,GAAA,EAAuB,UAAAP,GACtB,UAAA;AAAA,IAAA,gBAAAQ;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,UAAAT;AAAA,QACA,mBAAAG;AAAA,QACA,qBAAAC;AAAA,QAEA,UAAC,gBAAAI,EAAAE,GAAA,EAAgB,KAAKR,GAAY,UAAUP,GAAmB;AAAA,MAAA;AAAA,IACjE;AAAA,IAEA,gBAAAW,EAACK,GAAA,EACC,UAAA;AAAA,MAAC,gBAAAL,EAAAM,GAAA,EAAwB,UAAAZ,GACvB,UAAA;AAAA,QAAA,gBAAAQ,EAACK,GAAK,EAAA,WAAU,OAAM,QAAO,SAC1B,UACHf,GAAA;AAAA,QACA,gBAAAU,EAACM,GAAU,EAAA,QAAQ,EAAG,CAAA;AAAA,QACtB,gBAAAN,EAACK,KAAK,WAAU,OAAM,QAAO,SAC1B,UAAAZ,IAAY,OAAOF,EACtB,CAAA;AAAA,MAAA,GACF;AAAA,MAECM;AAAA,IAAA,GACH;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"banner.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/banner/banner.tsx"],"sourcesContent":["import type { IBannerProps } from './banner-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport * as Styled from './banner-styled';\n\nconst animationSettings = { renderer: 'canvas' };\n\nexport const Banner: FC<IBannerProps> = memo(\n ({\n primaryText,\n secondaryText,\n topInset = 0,\n isLoading = false,\n lottiePath,\n bgFromTopPosition = 0,\n bgFromRightPosition = 0,\n custEle,\n }) => (\n <Styled.BannerContainer topInset={topInset}>\n <Styled.CircleLottieView\n topInset={topInset}\n bgFromTopPosition={bgFromTopPosition}\n bgFromRightPosition={bgFromRightPosition}\n >\n <LottieAnimation src={lottiePath} settings={animationSettings} />\n </Styled.CircleLottieView>\n\n <Styled.BannerTextContainer>\n <Styled.CountTextWrapper topInset={topInset}>\n <Text $renderAs=\"ac4\" $color=\"WHITE\">\n {primaryText}\n </Text>\n <Separator height={4} />\n <Text $renderAs=\"ah4\" $color=\"WHITE\">\n {isLoading ? '__' : secondaryText}\n </Text>\n </Styled.CountTextWrapper>\n\n {custEle}\n </Styled.BannerTextContainer>\n </Styled.BannerContainer>\n ),\n);\n"],"names":["animationSettings","Banner","memo","primaryText","secondaryText","topInset","isLoading","lottiePath","bgFromTopPosition","bgFromRightPosition","custEle","jsxs","Styled.BannerContainer","jsx","Styled.CircleLottieView","LottieAnimation","Styled.BannerTextContainer","Styled.CountTextWrapper","Text","Separator"],"mappings":";;;;;;AAUA,MAAMA,IAAoB,EAAE,UAAU,YAEzBC,IAA2BC;AAAA,EACtC,CAAC;AAAA,IACC,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,WAAAC,IAAY;AAAA,IACZ,YAAAC;AAAA,IACA,mBAAAC,IAAoB;AAAA,IACpB,qBAAAC,IAAsB;AAAA,IACtB,SAAAC;AAAA,EAEA,MAAA,gBAAAC,EAACC,GAAA,EAAuB,UAAAP,GACtB,UAAA;AAAA,IAAA,gBAAAQ;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,UAAAT;AAAA,QACA,mBAAAG;AAAA,QACA,qBAAAC;AAAA,QAEA,UAAC,gBAAAI,EAAAE,GAAA,EAAgB,KAAKR,GAAY,UAAUP,GAAmB;AAAA,MAAA;AAAA,IACjE;AAAA,IAEA,gBAAAW,EAACK,GAAA,EACC,UAAA;AAAA,MAAC,gBAAAL,EAAAM,GAAA,EAAwB,UAAAZ,GACvB,UAAA;AAAA,QAAA,gBAAAQ,EAACK,GAAK,EAAA,WAAU,OAAM,QAAO,SAC1B,UACHf,GAAA;AAAA,QACA,gBAAAU,EAACM,GAAU,EAAA,QAAQ,EAAG,CAAA;AAAA,QACtB,gBAAAN,EAACK,KAAK,WAAU,OAAM,QAAO,SAC1B,UAAAZ,IAAY,OAAOF,EACtB,CAAA;AAAA,MAAA,GACF;AAAA,MAECM;AAAA,IAAA,GACH;AAAA,EAAA,GACF;AAEJ;"}
@@ -7,7 +7,7 @@ const i = o.div`
7
7
  left: ${({ align: t = "left" }) => t === "left" ? "20px" : "unset"};
8
8
  right: ${({ align: t = "left" }) => t === "right" ? "20px" : "unset"};
9
9
  z-index: 10;
10
- bottom: ${(window.bottomInset || 0) + 50}px;
10
+ bottom: 50px;
11
11
  `;
12
12
  export {
13
13
  n as ExtendedIconButton,
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-button-styled.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/navigation-button/navigation-button-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nexport const NavigationActionWrapper = styled.div`\n position: relative;\n width: 100%;\n`;\n\nexport const ExtendedIconButton = styled.div<{ align?: 'left' | 'right' }>`\n position: absolute;\n left: ${({ align = 'left' }) => (align === 'left' ? '20px' : 'unset')};\n right: ${({ align = 'left' }) => (align === 'right' ? '20px' : 'unset')};\n z-index: 10;\n bottom: ${(window.bottomInset || 0) + 50}px;\n`;\n"],"names":["NavigationActionWrapper","styled","ExtendedIconButton","align"],"mappings":";AAEO,MAAMA,IAA0BC,EAAO;AAAA;AAAA;AAAA,GAKjCC,IAAqBD,EAAO;AAAA;AAAA,UAE/B,CAAC,EAAE,OAAAE,IAAQ,OAAA,MAAcA,MAAU,SAAS,SAAS,OAAQ;AAAA,WAC5D,CAAC,EAAE,OAAAA,IAAQ,OAAA,MAAcA,MAAU,UAAU,SAAS,OAAQ;AAAA;AAAA,aAE5D,OAAO,eAAe,KAAK,EAAE;AAAA;"}
1
+ {"version":3,"file":"navigation-button-styled.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/navigation-button/navigation-button-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nexport const NavigationActionWrapper = styled.div`\n position: relative;\n width: 100%;\n`;\n\nexport const ExtendedIconButton = styled.div<{ align?: 'left' | 'right' }>`\n position: absolute;\n left: ${({ align = 'left' }) => (align === 'left' ? '20px' : 'unset')};\n right: ${({ align = 'left' }) => (align === 'right' ? '20px' : 'unset')};\n z-index: 10;\n bottom: 50px;\n`;\n"],"names":["NavigationActionWrapper","styled","ExtendedIconButton","align"],"mappings":";AAEO,MAAMA,IAA0BC,EAAO;AAAA;AAAA;AAAA,GAKjCC,IAAqBD,EAAO;AAAA;AAAA,UAE/B,CAAC,EAAE,OAAAE,IAAQ,OAAA,MAAcA,MAAU,SAAS,SAAS,OAAQ;AAAA,WAC5D,CAAC,EAAE,OAAAA,IAAQ,OAAA,MAAcA,MAAU,UAAU,SAAS,OAAQ;AAAA;AAAA;AAAA;"}
@@ -25,7 +25,7 @@ const s = t.div`
25
25
  width: 100%;
26
26
  flex: 1;
27
27
  height: 100%;
28
- padding-top: ${(window.topInset || 0) + n}px;
28
+ padding-top: ${n}px;
29
29
  padding-bottom: ${i}px;
30
30
  `, m = t.div`
31
31
  position: absolute;
@@ -1 +1 @@
1
- {"version":3,"file":"leaderboard-styled.js","sources":["../../../../src/features/circle-games/leaderboard/leaderboard-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { ARC_BUTTON_BOTTOM_OFFSET } from '../../ui/arc-button/constants';\nimport FlexView from '../../ui/layout/flex-view';\nimport { BANNER_HEIGHT } from './comps/banner/constants';\n\nexport const Leaderboard = styled.div`\n flex-direction: column;\n overflow: hidden;\n height: 100vh;\n max-height: 100%;\n position: relative;\n`;\n\nexport const LeaderboardContainer = styled.div`\n background: ${({ theme }) => theme.colors.BLACK_1};\n height: 100%;\n position: relative;\n width: 100%;\n`;\n\nexport const BannerWrapper = styled.div`\n position: absolute;\n top: 0;\n width: 100%;\n z-index: 10;\n`;\n\nexport const ItemsWrapper = styled.div`\n background: transparent;\n position: absolute;\n overflow: auto;\n width: 100%;\n flex: 1;\n height: 100%;\n padding-top: ${(window.topInset || 0) + BANNER_HEIGHT}px;\n padding-bottom: ${ARC_BUTTON_BOTTOM_OFFSET}px;\n`;\n\nexport const TournamentBannerCustContainer = styled.div`\n position: absolute;\n display: flex;\n top: 5px;\n right: -2px;\n width: 200px;\n height: 100%;\n align-items: center;\n justify-content: center;\n`;\n\nexport const ActionButtonWrapper = styled.div`\n position: absolute;\n bottom: 0;\n width: 100%;\n`;\n\nexport const TrophyWrapper = styled.div`\n display: flex;\n justify-content: center;\n width: 150%;\n height: 150%;\n`;\n\nexport const Banner = styled.div`\n background: ${({ theme }) => theme.colors.YELLOW_6};\n min-height: 32px;\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n`;\n\nexport const InfoContainer = styled(FlexView)`\n padding: 16px;\n`;\n"],"names":["Leaderboard","styled","LeaderboardContainer","theme","BannerWrapper","ItemsWrapper","BANNER_HEIGHT","ARC_BUTTON_BOTTOM_OFFSET","TournamentBannerCustContainer","ActionButtonWrapper","TrophyWrapper","Banner","FlexView"],"mappings":";;;;AAMO,MAAMA,IAAcC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQrBC,IAAuBD,EAAO;AAAA,gBAC3B,CAAC,EAAE,OAAAE,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA,GAMtCC,IAAgBH,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOvBI,IAAeJ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAOjB,OAAO,YAAY,KAAKK,CAAa;AAAA,oBACnCC,CAAwB;AAAA,GAG/BC,IAAgCP,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAWvCQ,IAAsBR,EAAO;AAAA;AAAA;AAAA;AAAA,GAM7BS,IAAgBT,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOvBU,IAASV,EAAO;AAAA,gBACb,CAAC,EAAE,OAAAE,EAAA,MAAYA,EAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASvBF,EAAOW,CAAQ;AAAA;AAAA;"}
1
+ {"version":3,"file":"leaderboard-styled.js","sources":["../../../../src/features/circle-games/leaderboard/leaderboard-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { ARC_BUTTON_BOTTOM_OFFSET } from '../../ui/arc-button/constants';\nimport FlexView from '../../ui/layout/flex-view';\nimport { BANNER_HEIGHT } from './comps/banner/constants';\n\nexport const Leaderboard = styled.div`\n flex-direction: column;\n overflow: hidden;\n height: 100vh;\n max-height: 100%;\n position: relative;\n`;\n\nexport const LeaderboardContainer = styled.div`\n background: ${({ theme }) => theme.colors.BLACK_1};\n height: 100%;\n position: relative;\n width: 100%;\n`;\n\nexport const BannerWrapper = styled.div`\n position: absolute;\n top: 0;\n width: 100%;\n z-index: 10;\n`;\n\nexport const ItemsWrapper = styled.div<{ topInset: number }>`\n background: transparent;\n position: absolute;\n overflow: auto;\n width: 100%;\n flex: 1;\n height: 100%;\n padding-top: ${BANNER_HEIGHT}px;\n padding-bottom: ${ARC_BUTTON_BOTTOM_OFFSET}px;\n`;\n\nexport const TournamentBannerCustContainer = styled.div`\n position: absolute;\n display: flex;\n top: 5px;\n right: -2px;\n width: 200px;\n height: 100%;\n align-items: center;\n justify-content: center;\n`;\n\nexport const ActionButtonWrapper = styled.div`\n position: absolute;\n bottom: 0;\n width: 100%;\n`;\n\nexport const TrophyWrapper = styled.div`\n display: flex;\n justify-content: center;\n width: 150%;\n height: 150%;\n`;\n\nexport const Banner = styled.div`\n background: ${({ theme }) => theme.colors.YELLOW_6};\n min-height: 32px;\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n`;\n\nexport const InfoContainer = styled(FlexView)`\n padding: 16px;\n`;\n"],"names":["Leaderboard","styled","LeaderboardContainer","theme","BannerWrapper","ItemsWrapper","BANNER_HEIGHT","ARC_BUTTON_BOTTOM_OFFSET","TournamentBannerCustContainer","ActionButtonWrapper","TrophyWrapper","Banner","FlexView"],"mappings":";;;;AAMO,MAAMA,IAAcC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQrBC,IAAuBD,EAAO;AAAA,gBAC3B,CAAC,EAAE,OAAAE,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA,GAMtCC,IAAgBH,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOvBI,IAAeJ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAOlBK,CAAa;AAAA,oBACVC,CAAwB;AAAA,GAG/BC,IAAgCP,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAWvCQ,IAAsBR,EAAO;AAAA;AAAA;AAAA;AAAA,GAM7BS,IAAgBT,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOvBU,IAASV,EAAO;AAAA,gBACb,CAAC,EAAE,OAAAE,EAAA,MAAYA,EAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASvBF,EAAOW,CAAQ;AAAA;AAAA;"}
@@ -1,5 +1,5 @@
1
- import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
- import { useState as p, useEffect as K } from "react";
1
+ import { jsx as e, jsxs as p } from "react/jsx-runtime";
2
+ import { useState as a, useEffect as K } from "react";
3
3
  import { ILLUSTRATIONS as w } from "../../../assets/illustrations/illustrations.js";
4
4
  import { LOTTIE as d } from "../../../assets/lottie/lottie.js";
5
5
  import { CircularLoader as U } from "../../ui/loader/circular-loader/circular-loader.js";
@@ -39,12 +39,12 @@ const L = {
39
39
  streakInfo: l
40
40
  }) => {
41
41
  var y, A, R, S, B, C, x, P;
42
- const [i, I] = p(
42
+ const [i, I] = a(
43
43
  o.findIndex((t) => u === t.type)
44
- ), [n, k] = p(((y = m == null ? void 0 : m[u]) == null ? void 0 : y.leaderboardPlayers) || []), [h, N] = p({
44
+ ), [n, k] = a(((y = m == null ? void 0 : m[u]) == null ? void 0 : y.leaderboardPlayers) || []), [h, N] = a({
45
45
  current: 0,
46
46
  end: 0
47
- }), [O, f] = V(0), [c, Y] = p(!1), F = (A = n == null ? void 0 : n[0]) == null ? void 0 : A.points, $ = ((R = n == null ? void 0 : n[0]) == null ? void 0 : R.streakDays) || 0, { playButtonSound: _ } = q(), j = () => {
47
+ }), [O, f] = V(0), [c, Y] = a(!1), F = (A = n == null ? void 0 : n[0]) == null ? void 0 : A.points, $ = ((R = n == null ? void 0 : n[0]) == null ? void 0 : R.streakDays) || 0, { playButtonSound: _ } = q(), j = () => {
48
48
  _(), I((t) => t - 1 < 0 ? o.length - 1 : t - 1);
49
49
  }, v = () => {
50
50
  _(), I((t) => t + 1 === o.length ? 0 : t + 1);
@@ -61,8 +61,8 @@ const L = {
61
61
  end: s.endTimestamp
62
62
  }), s.currentTimestamp > s.endTimestamp && (g.splice(10), Y(!0))), k([...g]);
63
63
  }
64
- }, [i, m]), /* @__PURE__ */ e(X, { children: /* @__PURE__ */ a(Z, { children: [
65
- /* @__PURE__ */ a(D, { children: [
64
+ }, [i, m]), /* @__PURE__ */ e(X, { children: /* @__PURE__ */ p(Z, { children: [
65
+ /* @__PURE__ */ p(D, { children: [
66
66
  ((S = o[i]) == null ? void 0 : S.type) === r.BI_WEEKLY && /* @__PURE__ */ e(
67
67
  E,
68
68
  {
@@ -70,7 +70,7 @@ const L = {
70
70
  bgFromTopPosition: -120,
71
71
  bgFromRightPosition: -110,
72
72
  primaryText: c ? /* @__PURE__ */ e("span", { children: "New Tournament" }) : /* @__PURE__ */ e("span", { children: "Tournament" }),
73
- secondaryText: c ? /* @__PURE__ */ e("span", { children: "Starts Soon" }) : /* @__PURE__ */ a("span", { children: [
73
+ secondaryText: c ? /* @__PURE__ */ e("span", { children: "Starts Soon" }) : /* @__PURE__ */ p("span", { children: [
74
74
  " ",
75
75
  /* @__PURE__ */ e(
76
76
  Q,
@@ -110,7 +110,7 @@ const L = {
110
110
  )
111
111
  ] }),
112
112
  T && /* @__PURE__ */ e(U, {}),
113
- !T && n && /* @__PURE__ */ a(te, { children: [
113
+ !T && n && /* @__PURE__ */ p(te, { topInset: 0, children: [
114
114
  ((x = o[i]) == null ? void 0 : x.type) === r.ALL_TIME_STREAK && /* @__PURE__ */ e(
115
115
  J,
116
116
  {
@@ -1 +1 @@
1
- {"version":3,"file":"leaderboard.js","sources":["../../../../src/features/circle-games/leaderboard/leaderboard.tsx"],"sourcesContent":["import type {\n ILeaderboardPlayerWithPoints,\n ILeaderboardPlayerWithStreak,\n} from './dal/use-get-leaderboard-dal/use-get-leaderboard-dal-types';\nimport type { ILeaderboardProps } from './leaderboard-types';\n\nimport { useEffect, useState } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport Text from '../../ui/text/text';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\nimport { Banner } from './comps/banner/banner';\nimport { LeaderboardItemWithObserver } from './comps/leaderboard-item/leaderboard-item';\nimport { NavigationButton } from './comps/navigation-button/navigation-button';\nimport { StreakReductionInfoBar } from './comps/streak-reduction-infobar/streak-reduction-infobar';\nimport { Timer } from './comps/timer/timer';\nimport { ELeaderboardType } from './enums/leaderboard-type-enum';\nimport { useTimer } from './hooks/use-timer/use-timer';\nimport * as Styled from './leaderboard-styled';\n\nconst BANNER_LOTTIES: Record<ELeaderboardType, string> = {\n [ELeaderboardType.ALL_TIME_STREAK]: LOTTIE.ELITE_CIRCLE,\n [ELeaderboardType.ALL_TIME]: LOTTIE.ELITE_CIRCLE,\n [ELeaderboardType.BI_WEEKLY]: LOTTIE.TOURNAMENT_RIPPLE,\n};\n\nconst leaderboards = [\n {\n name: 'TOURNAMENT',\n type: ELeaderboardType.BI_WEEKLY,\n },\n {\n name: 'STREAK STARS',\n type: ELeaderboardType.ALL_TIME_STREAK,\n },\n {\n name: 'ALL TIME',\n type: ELeaderboardType.ALL_TIME,\n },\n];\n\nexport const Leaderboard = ({\n leaderboardData,\n type = ELeaderboardType.BI_WEEKLY,\n userId,\n onClose,\n isLoading,\n streakInfo,\n}: ILeaderboardProps) => {\n const [currentLeaderBoardIndex, setCurrentLeaderboardIndex] = useState(\n leaderboards.findIndex(leaderboard => type === leaderboard.type),\n );\n\n const [currLeaderboardData, setCurrLeaderboardData] = useState<\n (ILeaderboardPlayerWithPoints | ILeaderboardPlayerWithStreak)[] | []\n >(leaderboardData?.[type]?.leaderboardPlayers || []);\n\n const [currLeaderboardTimeStamps, setCurrLeaderboardTimeStamps] = useState<{\n current: number;\n end: number;\n }>({\n current: 0,\n end: 0,\n });\n\n const [time, setTimer] = useTimer(0);\n const [isTournamentEnded, setIsTournamentEnded] = useState(false);\n const maxPoints = (currLeaderboardData?.[0] as ILeaderboardPlayerWithPoints)?.points;\n const maxStreakDays = (currLeaderboardData?.[0] as ILeaderboardPlayerWithStreak)?.streakDays || 0;\n const { playButtonSound } = useCircleSounds();\n\n const handlePrevious = () => {\n playButtonSound();\n setCurrentLeaderboardIndex(prev => {\n if (prev - 1 < 0) {\n return leaderboards.length - 1;\n }\n\n return prev - 1;\n });\n };\n\n const handleNext = () => {\n playButtonSound();\n setCurrentLeaderboardIndex(prev => {\n if (prev + 1 === leaderboards.length) {\n return 0;\n }\n\n return prev + 1;\n });\n };\n\n useEffect(() => {\n setTimer(0);\n }, [setTimer]);\n\n useEffect(() => {\n const currType = leaderboards[currentLeaderBoardIndex]?.type;\n const currLeaderboard = currType && leaderboardData?.[currType];\n\n if (currLeaderboard) {\n const leaderboardList = currLeaderboard.leaderboardPlayers || [];\n\n if (currType === ELeaderboardType.BI_WEEKLY) {\n setCurrLeaderboardTimeStamps({\n current: currLeaderboard.currentTimestamp,\n end: currLeaderboard.endTimestamp,\n });\n\n if (currLeaderboard.currentTimestamp > currLeaderboard.endTimestamp) {\n leaderboardList.splice(10);\n setIsTournamentEnded(true);\n }\n }\n\n setCurrLeaderboardData([...leaderboardList]);\n }\n }, [currentLeaderBoardIndex, leaderboardData]);\n\n return (\n <Styled.Leaderboard>\n <Styled.LeaderboardContainer>\n <Styled.BannerWrapper>\n {/* tournament banner */}\n {leaderboards[currentLeaderBoardIndex]?.type === ELeaderboardType.BI_WEEKLY && (\n <Banner\n isLoading={isLoading || currLeaderboardData.length === 0}\n bgFromTopPosition={-120}\n bgFromRightPosition={-110}\n primaryText={\n isTournamentEnded ? <span>New Tournament</span> : <span>Tournament</span>\n }\n secondaryText={\n isTournamentEnded ? (\n <span>Starts Soon</span>\n ) : (\n <span>\n {' '}\n <Timer\n fromTimestamp={(time as number) + currLeaderboardTimeStamps.current}\n endTimestamp={currLeaderboardTimeStamps.end}\n />{' '}\n {'left'}\n </span>\n )\n }\n lottiePath={BANNER_LOTTIES[ELeaderboardType.BI_WEEKLY]}\n custEle={\n <Styled.TournamentBannerCustContainer>\n <Styled.TrophyWrapper>\n <img src={ILLUSTRATIONS.TROPHY_CIRCLE} />\n </Styled.TrophyWrapper>\n </Styled.TournamentBannerCustContainer>\n }\n />\n )}\n\n {/* top streak banner */}\n {leaderboards[currentLeaderBoardIndex]?.type === ELeaderboardType.ALL_TIME_STREAK && (\n <Banner\n isLoading={isLoading}\n bgFromTopPosition={-140}\n bgFromRightPosition={-90}\n primaryText={<span>Streak Stars</span>}\n secondaryText={<span>Top 50</span>}\n lottiePath={BANNER_LOTTIES[ELeaderboardType.ALL_TIME_STREAK]}\n />\n )}\n\n {/* elite circle banner */}\n {leaderboards[currentLeaderBoardIndex]?.type === ELeaderboardType.ALL_TIME && (\n <Banner\n isLoading={isLoading}\n bgFromTopPosition={-140}\n bgFromRightPosition={-90}\n primaryText={<span>Elite Circle</span>}\n secondaryText={<span>Top 50</span>}\n lottiePath={BANNER_LOTTIES[ELeaderboardType.ALL_TIME]}\n />\n )}\n </Styled.BannerWrapper>\n\n {isLoading && <CircularLoader />}\n\n {!isLoading && currLeaderboardData && (\n <Styled.ItemsWrapper>\n {leaderboards[currentLeaderBoardIndex]?.type === ELeaderboardType.ALL_TIME_STREAK && (\n <StreakReductionInfoBar\n startTimestampToday={streakInfo.startTimestampToday}\n streakReduction={streakInfo.streakReduction}\n />\n )}\n {isTournamentEnded &&\n leaderboards[currentLeaderBoardIndex]?.type === ELeaderboardType.BI_WEEKLY && (\n <Styled.Banner>\n <Text $renderAs=\"ab3\" $color=\"WHITE\">\n Congratulating winners of the last tournament!\n </Text>\n </Styled.Banner>\n )}\n {currLeaderboardData.map(player => {\n return (\n <LeaderboardItemWithObserver\n key={player.rank}\n player={player}\n rank={player.rank}\n maxStreakDays={maxStreakDays}\n maxPoints={maxPoints}\n leaderboardType={leaderboards[currentLeaderBoardIndex]?.type}\n isActive={player.userId === userId}\n />\n );\n })}\n </Styled.ItemsWrapper>\n )}\n\n <Styled.ActionButtonWrapper>\n <NavigationButton\n labels={Object.values(ELeaderboardType)}\n onLeftClick={handlePrevious}\n onRightClick={handleNext}\n currIndex={currentLeaderBoardIndex}\n onClose={onClose}\n disableSwipe={isLoading || currLeaderboardData.length === 0}\n />\n </Styled.ActionButtonWrapper>\n </Styled.LeaderboardContainer>\n </Styled.Leaderboard>\n );\n};\n"],"names":["BANNER_LOTTIES","ELeaderboardType","LOTTIE","leaderboards","Leaderboard","leaderboardData","type","userId","onClose","isLoading","streakInfo","currentLeaderBoardIndex","setCurrentLeaderboardIndex","useState","leaderboard","currLeaderboardData","setCurrLeaderboardData","_a","currLeaderboardTimeStamps","setCurrLeaderboardTimeStamps","time","setTimer","useTimer","isTournamentEnded","setIsTournamentEnded","maxPoints","_b","maxStreakDays","_c","playButtonSound","useCircleSounds","handlePrevious","prev","handleNext","useEffect","currType","currLeaderboard","leaderboardList","Styled.Leaderboard","jsxs","Styled.LeaderboardContainer","Styled.BannerWrapper","_d","jsx","Banner","Timer","Styled.TournamentBannerCustContainer","Styled.TrophyWrapper","ILLUSTRATIONS","_e","_f","CircularLoader","Styled.ItemsWrapper","_g","StreakReductionInfoBar","_h","Styled.Banner","Text","player","LeaderboardItemWithObserver","Styled.ActionButtonWrapper","NavigationButton"],"mappings":";;;;;;;;;;;;;;;AAsBA,MAAMA,IAAmD;AAAA,EACvD,CAACC,EAAiB,eAAe,GAAGC,EAAO;AAAA,EAC3C,CAACD,EAAiB,QAAQ,GAAGC,EAAO;AAAA,EACpC,CAACD,EAAiB,SAAS,GAAGC,EAAO;AACvC,GAEMC,IAAe;AAAA,EACnB;AAAA,IACE,MAAM;AAAA,IACN,MAAMF,EAAiB;AAAA,EACzB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAMA,EAAiB;AAAA,EACzB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAMA,EAAiB;AAAA,EACzB;AACF,GAEaG,KAAc,CAAC;AAAA,EAC1B,iBAAAC;AAAA,EACA,MAAAC,IAAOL,EAAiB;AAAA,EACxB,QAAAM;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AACF,MAAyB;;AACjB,QAAA,CAACC,GAAyBC,CAA0B,IAAIC;AAAA,IAC5DV,EAAa,UAAU,CAAeW,MAAAR,MAASQ,EAAY,IAAI;AAAA,EAAA,GAG3D,CAACC,GAAqBC,CAAsB,IAAIH,IAEpDI,IAAAZ,KAAA,gBAAAA,EAAkBC,OAAlB,gBAAAW,EAAyB,uBAAsB,CAAA,CAAE,GAE7C,CAACC,GAA2BC,CAA4B,IAAIN,EAG/D;AAAA,IACD,SAAS;AAAA,IACT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,CAAgB;AAAA,QACtC,aAAa8B;AAAA,QACb,cAAcE;AAAA,QACd,WAAWtB;AAAA,QACX,SAAAH;AAAA,QACA,cAAcC,KAAaM,EAAoB,WAAW;AAAA,MAAA;AAAA,IAAA,GAE9D;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAEJ;"}
1
+ {"version":3,"file":"leaderboard.js","sources":["../../../../src/features/circle-games/leaderboard/leaderboard.tsx"],"sourcesContent":["import type {\n ILeaderboardPlayerWithPoints,\n ILeaderboardPlayerWithStreak,\n} from './dal/use-get-leaderboard-dal/use-get-leaderboard-dal-types';\nimport type { ILeaderboardProps } from './leaderboard-types';\n\nimport { useEffect, useState } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport Text from '../../ui/text/text';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\nimport { Banner } from './comps/banner/banner';\nimport { LeaderboardItemWithObserver } from './comps/leaderboard-item/leaderboard-item';\nimport { NavigationButton } from './comps/navigation-button/navigation-button';\nimport { StreakReductionInfoBar } from './comps/streak-reduction-infobar/streak-reduction-infobar';\nimport { Timer } from './comps/timer/timer';\nimport { ELeaderboardType } from './enums/leaderboard-type-enum';\nimport { useTimer } from './hooks/use-timer/use-timer';\nimport * as Styled from './leaderboard-styled';\n\nconst BANNER_LOTTIES: Record<ELeaderboardType, string> = {\n [ELeaderboardType.ALL_TIME_STREAK]: LOTTIE.ELITE_CIRCLE,\n [ELeaderboardType.ALL_TIME]: LOTTIE.ELITE_CIRCLE,\n [ELeaderboardType.BI_WEEKLY]: LOTTIE.TOURNAMENT_RIPPLE,\n};\n\nconst leaderboards = [\n {\n name: 'TOURNAMENT',\n type: ELeaderboardType.BI_WEEKLY,\n },\n {\n name: 'STREAK STARS',\n type: ELeaderboardType.ALL_TIME_STREAK,\n },\n {\n name: 'ALL TIME',\n type: ELeaderboardType.ALL_TIME,\n },\n];\n\nexport const Leaderboard = ({\n leaderboardData,\n type = ELeaderboardType.BI_WEEKLY,\n userId,\n onClose,\n isLoading,\n streakInfo,\n}: ILeaderboardProps) => {\n const [currentLeaderBoardIndex, setCurrentLeaderboardIndex] = useState(\n leaderboards.findIndex(leaderboard => type === leaderboard.type),\n );\n\n const [currLeaderboardData, setCurrLeaderboardData] = useState<\n (ILeaderboardPlayerWithPoints | ILeaderboardPlayerWithStreak)[] | []\n >(leaderboardData?.[type]?.leaderboardPlayers || []);\n\n const [currLeaderboardTimeStamps, setCurrLeaderboardTimeStamps] = useState<{\n current: number;\n end: number;\n }>({\n current: 0,\n end: 0,\n });\n\n const [time, setTimer] = useTimer(0);\n const [isTournamentEnded, setIsTournamentEnded] = useState(false);\n const maxPoints = (currLeaderboardData?.[0] as ILeaderboardPlayerWithPoints)?.points;\n const maxStreakDays = (currLeaderboardData?.[0] as ILeaderboardPlayerWithStreak)?.streakDays || 0;\n const { playButtonSound } = useCircleSounds();\n\n const handlePrevious = () => {\n playButtonSound();\n setCurrentLeaderboardIndex(prev => {\n if (prev - 1 < 0) {\n return leaderboards.length - 1;\n }\n\n return prev - 1;\n });\n };\n\n const handleNext = () => {\n playButtonSound();\n setCurrentLeaderboardIndex(prev => {\n if (prev + 1 === leaderboards.length) {\n return 0;\n }\n\n return prev + 1;\n });\n };\n\n useEffect(() => {\n setTimer(0);\n }, [setTimer]);\n\n useEffect(() => {\n const currType = leaderboards[currentLeaderBoardIndex]?.type;\n const currLeaderboard = currType && leaderboardData?.[currType];\n\n if (currLeaderboard) {\n const leaderboardList = currLeaderboard.leaderboardPlayers || [];\n\n if (currType === ELeaderboardType.BI_WEEKLY) {\n setCurrLeaderboardTimeStamps({\n current: currLeaderboard.currentTimestamp,\n end: currLeaderboard.endTimestamp,\n });\n\n if (currLeaderboard.currentTimestamp > currLeaderboard.endTimestamp) {\n leaderboardList.splice(10);\n setIsTournamentEnded(true);\n }\n }\n\n setCurrLeaderboardData([...leaderboardList]);\n }\n }, [currentLeaderBoardIndex, leaderboardData]);\n\n return (\n <Styled.Leaderboard>\n <Styled.LeaderboardContainer>\n <Styled.BannerWrapper>\n {/* tournament banner */}\n {leaderboards[currentLeaderBoardIndex]?.type === ELeaderboardType.BI_WEEKLY && (\n <Banner\n isLoading={isLoading || currLeaderboardData.length === 0}\n bgFromTopPosition={-120}\n bgFromRightPosition={-110}\n primaryText={\n isTournamentEnded ? <span>New Tournament</span> : <span>Tournament</span>\n }\n secondaryText={\n isTournamentEnded ? (\n <span>Starts Soon</span>\n ) : (\n <span>\n {' '}\n <Timer\n fromTimestamp={(time as number) + currLeaderboardTimeStamps.current}\n endTimestamp={currLeaderboardTimeStamps.end}\n />{' '}\n {'left'}\n </span>\n )\n }\n lottiePath={BANNER_LOTTIES[ELeaderboardType.BI_WEEKLY]}\n custEle={\n <Styled.TournamentBannerCustContainer>\n <Styled.TrophyWrapper>\n <img src={ILLUSTRATIONS.TROPHY_CIRCLE} />\n </Styled.TrophyWrapper>\n </Styled.TournamentBannerCustContainer>\n }\n />\n )}\n\n {/* top streak banner */}\n {leaderboards[currentLeaderBoardIndex]?.type === ELeaderboardType.ALL_TIME_STREAK && (\n <Banner\n isLoading={isLoading}\n bgFromTopPosition={-140}\n bgFromRightPosition={-90}\n primaryText={<span>Streak Stars</span>}\n secondaryText={<span>Top 50</span>}\n lottiePath={BANNER_LOTTIES[ELeaderboardType.ALL_TIME_STREAK]}\n />\n )}\n\n {/* elite circle banner */}\n {leaderboards[currentLeaderBoardIndex]?.type === ELeaderboardType.ALL_TIME && (\n <Banner\n isLoading={isLoading}\n bgFromTopPosition={-140}\n bgFromRightPosition={-90}\n primaryText={<span>Elite Circle</span>}\n secondaryText={<span>Top 50</span>}\n lottiePath={BANNER_LOTTIES[ELeaderboardType.ALL_TIME]}\n />\n )}\n </Styled.BannerWrapper>\n\n {isLoading && <CircularLoader />}\n\n {!isLoading && currLeaderboardData && (\n <Styled.ItemsWrapper topInset={0}>\n {leaderboards[currentLeaderBoardIndex]?.type === ELeaderboardType.ALL_TIME_STREAK && (\n <StreakReductionInfoBar\n startTimestampToday={streakInfo.startTimestampToday}\n streakReduction={streakInfo.streakReduction}\n />\n )}\n {isTournamentEnded &&\n leaderboards[currentLeaderBoardIndex]?.type === ELeaderboardType.BI_WEEKLY && (\n <Styled.Banner>\n <Text $renderAs=\"ab3\" $color=\"WHITE\">\n Congratulating winners of the last tournament!\n </Text>\n </Styled.Banner>\n )}\n {currLeaderboardData.map(player => {\n return (\n <LeaderboardItemWithObserver\n key={player.rank}\n player={player}\n rank={player.rank}\n maxStreakDays={maxStreakDays}\n maxPoints={maxPoints}\n leaderboardType={leaderboards[currentLeaderBoardIndex]?.type}\n isActive={player.userId === userId}\n />\n );\n })}\n </Styled.ItemsWrapper>\n )}\n\n <Styled.ActionButtonWrapper>\n <NavigationButton\n labels={Object.values(ELeaderboardType)}\n onLeftClick={handlePrevious}\n onRightClick={handleNext}\n currIndex={currentLeaderBoardIndex}\n onClose={onClose}\n disableSwipe={isLoading || currLeaderboardData.length === 0}\n />\n </Styled.ActionButtonWrapper>\n </Styled.LeaderboardContainer>\n </Styled.Leaderboard>\n );\n};\n"],"names":["BANNER_LOTTIES","ELeaderboardType","LOTTIE","leaderboards","Leaderboard","leaderboardData","type","userId","onClose","isLoading","streakInfo","currentLeaderBoardIndex","setCurrentLeaderboardIndex","useState","leaderboard","currLeaderboardData","setCurrLeaderboardData","_a","currLeaderboardTimeStamps","setCurrLeaderboardTimeStamps","time","setTimer","useTimer","isTournamentEnded","setIsTournamentEnded","maxPoints","_b","maxStreakDays","_c","playButtonSound","useCircleSounds","handlePrevious","prev","handleNext","useEffect","currType","currLeaderboard","leaderboardList","Styled.Leaderboard","jsxs","Styled.LeaderboardContainer","Styled.BannerWrapper","_d","jsx","Banner","Timer","Styled.TournamentBannerCustContainer","Styled.TrophyWrapper","ILLUSTRATIONS","_e","_f","CircularLoader","Styled.ItemsWrapper","_g","StreakReductionInfoBar","_h","Styled.Banner","Text","player","LeaderboardItemWithObserver","Styled.ActionButtonWrapper","NavigationButton"],"mappings":";;;;;;;;;;;;;;;AAsBA,MAAMA,IAAmD;AAAA,EACvD,CAACC,EAAiB,eAAe,GAAGC,EAAO;AAAA,EAC3C,CAACD,EAAiB,QAAQ,GAAGC,EAAO;AAAA,EACpC,CAACD,EAAiB,SAAS,GAAGC,EAAO;AACvC,GAEMC,IAAe;AAAA,EACnB;AAAA,IACE,MAAM;AAAA,IACN,MAAMF,EAAiB;AAAA,EACzB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAMA,EAAiB;AAAA,EACzB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAMA,EAAiB;AAAA,EACzB;AACF,GAEaG,KAAc,CAAC;AAAA,EAC1B,iBAAAC;AAAA,EACA,MAAAC,IAAOL,EAAiB;AAAA,EACxB,QAAAM;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AACF,MAAyB;;AACjB,QAAA,CAACC,GAAyBC,CAA0B,IAAIC;AAAA,IAC5DV,EAAa,UAAU,CAAeW,MAAAR,MAASQ,EAAY,IAAI;AAAA,EAAA,GAG3D,CAACC,GAAqBC,CAAsB,IAAIH,IAEpDI,IAAAZ,KAAA,gBAAAA,EAAkBC,OAAlB,gBAAAW,EAAyB,uBAAsB,CAAA,CAAE,GAE7C,CAACC,GAA2BC,CAA4B,IAAIN,EAG/D;AAAA,IACD,SAAS;AAAA,IACT,KAAK;AAAA,EAAA,CACN,GAEK,CAACO,GAAMC,CAAQ,IAAIC,EAAS,CAAC,GAC7B,CAACC,GAAmBC,CAAoB,IAAIX,EAAS,EAAK,GAC1DY,KAAaC,IAAAX,KAAA,gBAAAA,EAAsB,OAAtB,gBAAAW,EAA2D,QACxEC,MAAiBC,IAAAb,KAAA,gBAAAA,EAAsB,OAAtB,gBAAAa,EAA2D,eAAc,GAC1F,EAAE,iBAAAC,MAAoBC,K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) => t.colors.WHITE};
62
- `, x = i.div`
62
+ `, u = i.div`
63
63
  position: absolute;
64
64
  transform: translateY(-55px);
65
65
  z-index: 3;
66
- `, u = i.div`
66
+ `, x = i.div`
67
67
  position: absolute;
68
68
  width: 100%;
69
69
  height: 100%;
@@ -77,10 +77,10 @@ const c = i.div`
77
77
  align-items: center;
78
78
  left: 0;
79
79
  right: 0;
80
- bottom: ${window.bottomInset || 0}px;
81
- `, b = i.button`
80
+ bottom: 0;
81
+ `, f = i.button`
82
82
  position: absolute;
83
- top: ${(window.topInset || 0) + 20}px;
83
+ top: 20px;
84
84
  left: 16px;
85
85
  outline: none;
86
86
  border: none;
@@ -90,14 +90,14 @@ const c = i.div`
90
90
  `;
91
91
  export {
92
92
  d as BackgroundImage,
93
- u as CircularProgress,
93
+ x as CircularProgress,
94
94
  h as CircularProgressContainer,
95
95
  l as CircularStepsContainer,
96
96
  p as CircularStepsWrapper,
97
97
  c as CustEleContainer,
98
98
  g as CustomDataContainer,
99
- x as Label,
99
+ u as Label,
100
100
  a as ScreenWrapper,
101
- b as TransparentIconButton
101
+ f as TransparentIconButton
102
102
  };
103
103
  //# sourceMappingURL=circular-steps-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"circular-steps-styled.js","sources":["../../../../../../src/features/circle-games/sign-up/comp/circular-steps/circular-steps-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { CIRCLE_SIZE_GUTTER, CIRCULAR_STEP_TOP_DISTANCE } from './constants';\n\ninterface ICircularStepsContainerProps {\n width: number;\n height: number;\n}\n\ninterface IBlurGameContainerProps {\n blurType: 'light' | 'dark';\n blurAmount: number;\n}\n\nexport const ScreenWrapper = styled.div<ICircularStepsContainerProps>`\n position: relative;\n width: ${({ width }) => `${width}px`};\n height: ${({ height }) => `${height}px`};\n`;\n\nexport const CircularStepsContainer = styled.div`\n display: flex;\n position: relative;\n height: inherit;\n width: inherit;\n margin: 0px auto;\n`;\n\nexport const CircularStepsWrapper = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: center;\n width: 100%;\n height: 100%;\n position: relative;\n`;\n\nexport const BackgroundImage = styled.div`\n position: absolute;\n z-index: -1;\n top: 0;\n left: 0;\n bottom: 0px;\n right: 0;\n background-size: contain;\n`;\n\nexport const BlurredContainerWrapper = styled.div`\n position: absolute;\n width: 100%;\n height: 100%;\n overflow: hidden;\n`;\n\nexport const BlurredGameContainer = styled.div<IBlurGameContainerProps>`\n height: 100%;\n width: 100%;\n background-color: ${({ blurType }) =>\n blurType === 'dark' ? 'rgba(0, 0, 0, 0.5)' : ({ theme }) => theme.colors.WHITE};\n backdrop-filter: ${({ blurAmount }) => `blur(${blurAmount}px)`};\n`;\n\nexport const CustEleContainer = styled.div`\n position: relative;\n top: 10px;\n left: 0;\n right: 0;\n z-index: 2;\n margin: 16px;\n`;\n\nexport const CircularProgressContainer = styled.div<{\n isVerticallyCentered?: boolean;\n width: number;\n height: number;\n}>`\n margin-top: ${({ height }) => (height * CIRCULAR_STEP_TOP_DISTANCE) / 100}px;\n width: ${({ width }) => width * CIRCLE_SIZE_GUTTER}px;\n height: ${({ width }) => width * CIRCLE_SIZE_GUTTER}px;\n position: relative;\n overflow: hidden;\n background: ${({ theme }) => theme.colors.BLACK_2};\n border-radius: 100%;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ${({ theme }) => theme.colors.WHITE};\n`;\n\nexport const Label = styled.div`\n position: absolute;\n transform: translateY(-55px);\n z-index: 3;\n`;\n\nexport const CircularProgress = styled.div`\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 2;\n transform: scale(1.175);\n pointer-events: none;\n`;\n\nexport const CustomDataContainer = styled.div`\n position: absolute;\n display: flex;\n flex-direction: column;\n align-items: center;\n left: 0;\n right: 0;\n bottom: ${window.bottomInset || 0}px;\n`;\n\nexport const TransparentIconButton = styled.button`\n position: absolute;\n top: ${(window.topInset || 0) + 20}px;\n left: 16px;\n outline: none;\n border: none;\n background: transparent;\n cursor: pointer;\n z-index: 1;\n`;\n"],"names":["ScreenWrapper","styled","width","height","CircularStepsContainer","CircularStepsWrapper","BackgroundImage","blurType","theme","blurAmount","CustEleContainer","CircularProgressContainer","CIRCULAR_STEP_TOP_DISTANCE","CIRCLE_SIZE_GUTTER","Label","CircularProgress","CustomDataContainer","TransparentIconButton"],"mappings":";;AAcO,MAAMA,IAAgBC,EAAO;AAAA;AAAA,WAEzB,CAAC,EAAE,OAAAC,EAAY,MAAA,GAAGA,CAAK,IAAI;AAAA,YAC1B,CAAC,EAAE,QAAAC,EAAa,MAAA,GAAGA,CAAM,IAAI;AAAA,GAG5BC,IAAyBH,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQhCI,IAAuBJ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAU9BK,IAAkBL,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUCA,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOVA,EAAO;AAAA;AAAA;AAAA,sBAGrB,CAAC,EAAE,UAAAM,QACrBA,MAAa,SAAS,uBAAuB,CAAC,EAAE,OAAAC,EAAY,MAAAA,EAAM,OAAO,KAAK;AAAA,qBAC7D,CAAC,EAAE,YAAAC,EAAiB,MAAA,QAAQA,CAAU,KAAK;AAAA;AAGzD,MAAMC,IAAmBT,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAS1BU,IAA4BV,EAAO;AAAA,gBAKhC,CAAC,EAAE,QAAAE,EAAA,MAAcA,IAASS,IAA8B,GAAG;AAAA,WAChE,CAAC,EAAE,OAAAV,QAAYA,IAAQW,CAAkB;AAAA,YACxC,CAAC,EAAE,OAAAX,QAAYA,IAAQW,CAAkB;AAAA;AAAA;AAAA,gBAGrC,CAAC,EAAE,OAAAL,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAMxC,CAAC,EAAE,OAAAA,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA,GAG/BM,IAAQb,EAAO;AAAA;AAAA;AAAA;AAAA,GAMfc,IAAmBd,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAS1Be,IAAsBf,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAO9B,OAAO,eAAe,CAAC;AAAA,GAGtBgB,IAAwBhB,EAAO;AAAA;AAAA,UAElC,OAAO,YAAY,KAAK,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"circular-steps-styled.js","sources":["../../../../../../src/features/circle-games/sign-up/comp/circular-steps/circular-steps-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { CIRCLE_SIZE_GUTTER, CIRCULAR_STEP_TOP_DISTANCE } from './constants';\n\ninterface ICircularStepsContainerProps {\n width: number;\n height: number;\n}\n\ninterface IBlurGameContainerProps {\n blurType: 'light' | 'dark';\n blurAmount: number;\n}\n\nexport const ScreenWrapper = styled.div<ICircularStepsContainerProps>`\n position: relative;\n width: ${({ width }) => `${width}px`};\n height: ${({ height }) => `${height}px`};\n`;\n\nexport const CircularStepsContainer = styled.div`\n display: flex;\n position: relative;\n height: inherit;\n width: inherit;\n margin: 0px auto;\n`;\n\nexport const CircularStepsWrapper = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: center;\n width: 100%;\n height: 100%;\n position: relative;\n`;\n\nexport const BackgroundImage = styled.div`\n position: absolute;\n z-index: -1;\n top: 0;\n left: 0;\n bottom: 0px;\n right: 0;\n background-size: contain;\n`;\n\nexport const BlurredContainerWrapper = styled.div`\n position: absolute;\n width: 100%;\n height: 100%;\n overflow: hidden;\n`;\n\nexport const BlurredGameContainer = styled.div<IBlurGameContainerProps>`\n height: 100%;\n width: 100%;\n background-color: ${({ blurType }) =>\n blurType === 'dark' ? 'rgba(0, 0, 0, 0.5)' : ({ theme }) => theme.colors.WHITE};\n backdrop-filter: ${({ blurAmount }) => `blur(${blurAmount}px)`};\n`;\n\nexport const CustEleContainer = styled.div`\n position: relative;\n top: 10px;\n left: 0;\n right: 0;\n z-index: 2;\n margin: 16px;\n`;\n\nexport const CircularProgressContainer = styled.div<{\n isVerticallyCentered?: boolean;\n width: number;\n height: number;\n}>`\n margin-top: ${({ height }) => (height * CIRCULAR_STEP_TOP_DISTANCE) / 100}px;\n width: ${({ width }) => width * CIRCLE_SIZE_GUTTER}px;\n height: ${({ width }) => width * CIRCLE_SIZE_GUTTER}px;\n position: relative;\n overflow: hidden;\n background: ${({ theme }) => theme.colors.BLACK_2};\n border-radius: 100%;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ${({ theme }) => theme.colors.WHITE};\n`;\n\nexport const Label = styled.div`\n position: absolute;\n transform: translateY(-55px);\n z-index: 3;\n`;\n\nexport const CircularProgress = styled.div`\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 2;\n transform: scale(1.175);\n pointer-events: none;\n`;\n\nexport const CustomDataContainer = styled.div`\n position: absolute;\n display: flex;\n flex-direction: column;\n align-items: center;\n left: 0;\n right: 0;\n bottom: 0;\n`;\n\nexport const TransparentIconButton = styled.button`\n position: absolute;\n top: 20px;\n left: 16px;\n outline: none;\n border: none;\n background: transparent;\n cursor: pointer;\n z-index: 1;\n`;\n"],"names":["ScreenWrapper","styled","width","height","CircularStepsContainer","CircularStepsWrapper","BackgroundImage","blurType","theme","blurAmount","CustEleContainer","CircularProgressContainer","CIRCULAR_STEP_TOP_DISTANCE","CIRCLE_SIZE_GUTTER","Label","CircularProgress","CustomDataContainer","TransparentIconButton"],"mappings":";;AAcO,MAAMA,IAAgBC,EAAO;AAAA;AAAA,WAEzB,CAAC,EAAE,OAAAC,EAAY,MAAA,GAAGA,CAAK,IAAI;AAAA,YAC1B,CAAC,EAAE,QAAAC,EAAa,MAAA,GAAGA,CAAM,IAAI;AAAA,GAG5BC,IAAy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i = [e.TRIAL, e.DEMO], o = [
2
+ const n = [e.ACTIVE, e.PAUSED, e.PAID], o = [e.TRIAL, e.DEMO], p = [
3
3
  { label: "2", key: "2", sup: "nd" },
4
4
  { label: "3", key: "3", sup: "rd" },
5
5
  { label: "4", key: "4", sup: "th" },
@@ -11,14 +11,14 @@ const a = [e.ACTIVE, e.PAUSED, e.PAID], i = [e.TRIAL, e.DEMO], o = [
11
11
  { label: "10", key: "10", sup: "th" },
12
12
  { label: "11", key: "11", sup: "th" },
13
13
  { label: "12", key: "12", sup: "th" }
14
- ], s = 440, t = 640, l = window.innerHeight / t, h = window.ReactNativeWebView ? window.innerHeight : Math.min(t * l, t), b = window.ReactNativeWebView ? window.innerWidth : Math.min(s * l, s);
14
+ ], l = 440, s = 640, t = window.innerHeight / s, u = Math.min(s * t, s), h = Math.min(l * t, l);
15
15
  export {
16
- t as ACTUAL_HEIGHT,
17
- s as ACTUAL_WIDTH,
18
- h as CONTAINER_HEIGHT,
19
- b as CONTAINER_WIDTH,
20
- o as GRADES,
21
- a as userIsEnrolledCases,
22
- i as userIsOnTrialCases
16
+ s as ACTUAL_HEIGHT,
17
+ l as ACTUAL_WIDTH,
18
+ u as CONTAINER_HEIGHT,
19
+ h as CONTAINER_WIDTH,
20
+ p as GRADES,
21
+ n as userIsEnrolledCases,
22
+ o as userIsOnTrialCases
23
23
  };
24
24
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../src/features/circle-games/sign-up/constants.ts"],"sourcesContent":["import type { Grade } from './comp/grade-input/grade-input-types';\n\nimport { State } from './sign-up-types';\n\nexport const userIsEnrolledCases = [State.ACTIVE, State.PAUSED, State.PAID];\nexport const userIsOnTrialCases = [State.TRIAL, State.DEMO];\n\nexport const GRADES: Grade[] = [\n { label: '2', key: '2', sup: 'nd' },\n { label: '3', key: '3', sup: 'rd' },\n { label: '4', key: '4', sup: 'th' },\n { label: '5', key: '5', sup: 'th' },\n { label: '6', key: '6', sup: 'th' },\n { label: '7', key: '7', sup: 'th' },\n { label: '8', key: '8', sup: 'th' },\n { label: '9', key: '9', sup: 'th' },\n { label: '10', key: '10', sup: 'th' },\n { label: '11', key: '11', sup: 'th' },\n { label: '12', key: '12', sup: 'th' },\n];\n\nexport const MIN_HEIGHT_TO_SUPPORT = 540;\nexport const ACTUAL_WIDTH = 440;\nexport const ACTUAL_HEIGHT = 640;\n\nconst ratio = window.innerHeight / ACTUAL_HEIGHT;\n\nexport const CONTAINER_HEIGHT = window.ReactNativeWebView\n ? window.innerHeight\n : Math.min(ACTUAL_HEIGHT * ratio, ACTUAL_HEIGHT);\nexport const CONTAINER_WIDTH = window.ReactNativeWebView\n ? window.innerWidth\n : Math.min(ACTUAL_WIDTH * ratio, ACTUAL_WIDTH);\n"],"names":["userIsEnrolledCases","State","userIsOnTrialCases","GRADES","ACTUAL_WIDTH","ACTUAL_HEIGHT","ratio","CONTAINER_HEIGHT","CONTAINER_WIDTH"],"mappings":";AAIO,MAAMA,IAAsB,CAACC,EAAM,QAAQA,EAAM,QAAQA,EAAM,IAAI,GAC7DC,IAAqB,CAACD,EAAM,OAAOA,EAAM,IAAI,GAE7CE,IAAkB;AAAA,EAC7B,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,MAAM,KAAK,MAAM,KAAK,KAAK;AAAA,EACpC,EAAE,OAAO,MAAM,KAAK,MAAM,KAAK,KAAK;AAAA,EACpC,EAAE,OAAO,MAAM,KAAK,MAAM,KAAK,KAAK;AACtC,GAGaC,IAAe,KACfC,IAAgB,KAEvBC,IAAQ,OAAO,cAAcD,GAEtBE,IAAmB,OAAO,qBACnC,OAAO,cACP,KAAK,IAAIF,IAAgBC,GAAOD,CAAa,GACpCG,IAAkB,OAAO,qBAClC,OAAO,aACP,KAAK,IAAIJ,IAAeE,GAAOF,CAAY;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/features/circle-games/sign-up/constants.ts"],"sourcesContent":["import type { Grade } from './comp/grade-input/grade-input-types';\n\nimport { State } from './sign-up-types';\n\nexport const userIsEnrolledCases = [State.ACTIVE, State.PAUSED, State.PAID];\nexport const userIsOnTrialCases = [State.TRIAL, State.DEMO];\n\nexport const GRADES: Grade[] = [\n { label: '2', key: '2', sup: 'nd' },\n { label: '3', key: '3', sup: 'rd' },\n { label: '4', key: '4', sup: 'th' },\n { label: '5', key: '5', sup: 'th' },\n { label: '6', key: '6', sup: 'th' },\n { label: '7', key: '7', sup: 'th' },\n { label: '8', key: '8', sup: 'th' },\n { label: '9', key: '9', sup: 'th' },\n { label: '10', key: '10', sup: 'th' },\n { label: '11', key: '11', sup: 'th' },\n { label: '12', key: '12', sup: 'th' },\n];\n\nexport const MIN_HEIGHT_TO_SUPPORT = 540;\nexport const ACTUAL_WIDTH = 440;\nexport const ACTUAL_HEIGHT = 640;\n\nconst ratio = window.innerHeight / ACTUAL_HEIGHT;\n\nexport const CONTAINER_HEIGHT = Math.min(ACTUAL_HEIGHT * ratio, ACTUAL_HEIGHT);\nexport const CONTAINER_WIDTH = Math.min(ACTUAL_WIDTH * ratio, ACTUAL_WIDTH);\n"],"names":["userIsEnrolledCases","State","userIsOnTrialCases","GRADES","ACTUAL_WIDTH","ACTUAL_HEIGHT","ratio","CONTAINER_HEIGHT","CONTAINER_WIDTH"],"mappings":";AAIO,MAAMA,IAAsB,CAACC,EAAM,QAAQA,EAAM,QAAQA,EAAM,IAAI,GAC7DC,IAAqB,CAACD,EAAM,OAAOA,EAAM,IAAI,GAE7CE,IAAkB;AAAA,EAC7B,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,MAAM,KAAK,MAAM,KAAK,KAAK;AAAA,EACpC,EAAE,OAAO,MAAM,KAAK,MAAM,KAAK,KAAK;AAAA,EACpC,EAAE,OAAO,MAAM,KAAK,MAAM,KAAK,KAAK;AACtC,GAGaC,IAAe,KACfC,IAAgB,KAEvBC,IAAQ,OAAO,cAAcD,GAEtBE,IAAmB,KAAK,IAAIF,IAAgBC,GAAOD,CAAa,GAChEG,IAAkB,KAAK,IAAIJ,IAAeE,GAAOF,CAAY;"}
@@ -0,0 +1,7 @@
1
+ const o = {
2
+ MOBILE: 600
3
+ };
4
+ export {
5
+ o as BREAKPOINTS
6
+ };
7
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/features/hooks/use-breakpoint/constants.ts"],"sourcesContent":["export const BREAKPOINTS = {\n MOBILE: 600,\n};\n"],"names":["BREAKPOINTS"],"mappings":"AAAO,MAAMA,IAAc;AAAA,EACzB,QAAQ;AACV;"}
@@ -0,0 +1,16 @@
1
+ import { useState as t, useEffect as o } from "react";
2
+ import { BREAKPOINTS as r } from "./constants.js";
3
+ const w = () => {
4
+ const [e, n] = t(typeof window < "u" ? window.innerWidth : 0);
5
+ return o(() => {
6
+ const i = () => n(window.innerWidth);
7
+ return window.addEventListener("resize", i), () => window.removeEventListener("resize", i);
8
+ }, []), {
9
+ isMobile: e < r.MOBILE,
10
+ width: e
11
+ };
12
+ };
13
+ export {
14
+ w as useBreakpoint
15
+ };
16
+ //# sourceMappingURL=use-breakpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-breakpoint.js","sources":["../../../../src/features/hooks/use-breakpoint/use-breakpoint.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { BREAKPOINTS } from './constants';\n\nexport const useBreakpoint = () => {\n const [width, setWidth] = useState<number>(typeof window !== 'undefined' ? window.innerWidth : 0);\n\n useEffect(() => {\n const handleResize = () => setWidth(window.innerWidth);\n\n window.addEventListener('resize', handleResize);\n\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n\n return {\n isMobile: width < BREAKPOINTS.MOBILE,\n width,\n };\n};\n"],"names":["useBreakpoint","width","setWidth","useState","useEffect","handleResize","BREAKPOINTS"],"mappings":";;AAIO,MAAMA,IAAgB,MAAM;AAC3B,QAAA,CAACC,GAAOC,CAAQ,IAAIC,EAAiB,OAAO,SAAW,MAAc,OAAO,aAAa,CAAC;AAEhG,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAe,MAAMH,EAAS,OAAO,UAAU;AAE9C,kBAAA,iBAAiB,UAAUG,CAAY,GAEvC,MAAM,OAAO,oBAAoB,UAAUA,CAAY;AAAA,EAChE,GAAG,CAAE,CAAA,GAEE;AAAA,IACL,UAAUJ,IAAQK,EAAY;AAAA,IAC9B,OAAAL;AAAA,EAAA;AAEJ;"}