@cuemath/leap 3.3.21 → 3.3.23-j1
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.
- package/dist/features/auth/account-selector/account-selector-styled.js +6 -5
- package/dist/features/auth/account-selector/account-selector-styled.js.map +1 -1
- package/dist/features/auth/account-selector/account-selector.js +51 -57
- package/dist/features/auth/account-selector/account-selector.js.map +1 -1
- package/dist/features/auth/account-selector/comps/compact-header/account-selector-header.js +31 -0
- package/dist/features/auth/account-selector/comps/compact-header/account-selector-header.js.map +1 -0
- package/dist/features/auth/comps/user-list/user-list-styled.js +3 -2
- package/dist/features/auth/comps/user-list/user-list-styled.js.map +1 -1
- package/dist/features/auth/pla-signup/pla-analytics-events.js +9 -3
- package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js.map +1 -1
- package/dist/features/auth/signup/custom-input-field/custom-input-field.js +8 -8
- package/dist/features/auth/signup/custom-input-field/custom-input-field.js.map +1 -1
- package/dist/features/circle-games/sign-up/api/use-update-username-api/use-update-username-api.js +9 -0
- package/dist/features/circle-games/sign-up/api/use-update-username-api/use-update-username-api.js.map +1 -0
- package/dist/features/circle-games/sign-up/comp/circular-steps/circular-steps.js +12 -12
- package/dist/features/circle-games/sign-up/comp/circular-steps/circular-steps.js.map +1 -1
- package/dist/features/circle-games/sign-up/dal/update-username-dal/update-username-dal.js +38 -0
- package/dist/features/circle-games/sign-up/dal/update-username-dal/update-username-dal.js.map +1 -0
- package/dist/features/circle-games/sign-up/sign-up-types.js.map +1 -1
- package/dist/features/circle-games/sign-up/sign-up.js +156 -128
- package/dist/features/circle-games/sign-up/sign-up.js.map +1 -1
- package/dist/features/journey/use-journey/use-journey.js +18 -6
- package/dist/features/journey/use-journey/use-journey.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/add-custom-chapter.js +42 -40
- package/dist/features/milestone/create/comps/add-custom-chapter/add-custom-chapter.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js +70 -64
- package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/hooks/use-catalog-helpers.js +54 -29
- package/dist/features/milestone/create/comps/add-custom-chapter/hooks/use-catalog-helpers.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapter-category/chapter-category-container.js +48 -28
- package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapter-category/chapter-category-container.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js +79 -76
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/utils.js +97 -94
- package/dist/features/milestone/create/comps/chapters-selection-step/utils.js.map +1 -1
- package/dist/features/milestone/create/comps/class-details-step/class-details-step.js +160 -143
- package/dist/features/milestone/create/comps/class-details-step/class-details-step.js.map +1 -1
- package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js +22 -12
- package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js.map +1 -1
- package/dist/features/milestone/create/comps/test-type-step/test-type-step.js +64 -59
- package/dist/features/milestone/create/comps/test-type-step/test-type-step.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-container.js +17 -15
- package/dist/features/milestone/create/milestone-create-container.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-helpers.js +174 -151
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-styled.js +1 -1
- package/dist/features/milestone/create/milestone-create-styled.js.map +1 -1
- package/dist/features/milestone/create/milestone-create.js +19 -17
- package/dist/features/milestone/create/milestone-create.js.map +1 -1
- package/dist/features/student-username/add/add-student-username-constants.js +6 -0
- package/dist/features/student-username/add/add-student-username-constants.js.map +1 -0
- package/dist/features/student-username/add/add-student-username-helpers.js +6 -0
- package/dist/features/student-username/add/add-student-username-helpers.js.map +1 -0
- package/dist/features/student-username/add/add-student-username-styled.js +10 -0
- package/dist/features/student-username/add/add-student-username-styled.js.map +1 -0
- package/dist/features/student-username/add/add-student-username.js +78 -0
- package/dist/features/student-username/add/add-student-username.js.map +1 -0
- package/dist/features/student-username/add/api/update-username.js +9 -0
- package/dist/features/student-username/add/api/update-username.js.map +1 -0
- package/dist/features/student-username/add/api/username-availability.js +10 -0
- package/dist/features/student-username/add/api/username-availability.js.map +1 -0
- package/dist/features/student-username/add/hooks/use-check-username-availability.js +41 -0
- package/dist/features/student-username/add/hooks/use-check-username-availability.js.map +1 -0
- package/dist/features/trial-session/api/teacher-availability.js +9 -0
- package/dist/features/trial-session/api/teacher-availability.js.map +1 -0
- package/dist/features/trial-session/comps/class-preference/class-preference.js +61 -49
- package/dist/features/trial-session/comps/class-preference/class-preference.js.map +1 -1
- package/dist/features/trial-session/comps/class-preference/helpers.js +28 -0
- package/dist/features/trial-session/comps/class-preference/helpers.js.map +1 -0
- package/dist/features/trial-session/comps/session-report/session-report.js +15 -15
- package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js +5 -0
- package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js +96 -51
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js.map +1 -1
- package/dist/features/trial-session/comps/student-profile/student-profile.js +70 -63
- package/dist/features/trial-session/comps/student-profile/student-profile.js.map +1 -1
- package/dist/features/trial-session/helper.js +71 -54
- package/dist/features/trial-session/helper.js.map +1 -1
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js +149 -130
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/dist/features/trial-session/trial-session-view.js +107 -98
- package/dist/features/trial-session/trial-session-view.js.map +1 -1
- package/dist/index.d.ts +31 -8
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
|
|
1
|
+
import o from "styled-components";
|
|
2
|
+
import r from "../../ui/layout/flex-view.js";
|
|
3
|
+
const i = o(r)`
|
|
4
|
+
overflow-y: auto;
|
|
5
|
+
width: 100%;
|
|
5
6
|
`;
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
+
i as UserListWrapper
|
|
8
9
|
};
|
|
9
10
|
//# sourceMappingURL=account-selector-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-selector-styled.js","sources":["../../../../src/features/auth/account-selector/account-selector-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport
|
|
1
|
+
{"version":3,"file":"account-selector-styled.js","sources":["../../../../src/features/auth/account-selector/account-selector-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\n\nexport const UserListWrapper = styled(FlexView)`\n overflow-y: auto;\n width: 100%;\n`;\n"],"names":["UserListWrapper","styled","FlexView"],"mappings":";;AAIa,MAAAA,IAAkBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;"}
|
|
@@ -1,70 +1,64 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
1
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as h } from "react";
|
|
3
3
|
import { useTheme as $ } from "styled-components";
|
|
4
|
-
import { ILLUSTRATIONS as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { EDeviceType as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
4
|
+
import { ILLUSTRATIONS as d } from "../../../assets/illustrations/illustrations.js";
|
|
5
|
+
import u from "../../ui/image/image.js";
|
|
6
|
+
import c from "../../ui/layout/flex-view.js";
|
|
7
|
+
import s from "../../ui/separator/separator.js";
|
|
8
|
+
import g from "../../ui/text/text.js";
|
|
9
|
+
import { EDeviceType as a } from "../../ui/theme/constants.js";
|
|
10
|
+
import x from "../comps/overlay-loader/overlay-loader.js";
|
|
11
|
+
import T from "../comps/user-list/user-list.js";
|
|
12
|
+
import { UserListWrapper as I } from "./account-selector-styled.js";
|
|
13
|
+
import L from "./comps/compact-header/account-selector-header.js";
|
|
14
|
+
const C = ({
|
|
15
|
+
userAccounts: o,
|
|
16
|
+
onSelect: f,
|
|
17
|
+
onAddNew: l,
|
|
18
|
+
isLoading: p,
|
|
19
|
+
onGoBack: i
|
|
18
20
|
}) => {
|
|
19
|
-
const { device:
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
|
|
21
|
+
const { device: n } = $(), t = n <= a.TABLET, r = n === a.MOBILE;
|
|
22
|
+
return /* @__PURE__ */ m(
|
|
23
|
+
c,
|
|
22
24
|
{
|
|
23
|
-
$flex:
|
|
24
|
-
$
|
|
25
|
-
$justifyContent: "center",
|
|
25
|
+
$alignItems: r ? "flex-start" : "center",
|
|
26
|
+
$justifyContent: r ? "flex-start" : "center",
|
|
26
27
|
$width: "100%",
|
|
27
|
-
$height: "
|
|
28
|
-
$gapX: 2,
|
|
28
|
+
$height: "100vh",
|
|
29
|
+
$gapX: t ? 0 : 2,
|
|
29
30
|
children: [
|
|
30
|
-
/* @__PURE__ */ e(
|
|
31
|
-
/* @__PURE__ */ e(
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
i.length > 0 && /* @__PURE__ */ r(s, { children: [
|
|
36
|
-
/* @__PURE__ */ e(u, { users: i, onSelect: c, onAddNew: h }),
|
|
37
|
-
/* @__PURE__ */ e(o, { heightX: a ? 1.5 : 5 }),
|
|
38
|
-
/* @__PURE__ */ r(
|
|
39
|
-
t,
|
|
31
|
+
typeof i == "function" && /* @__PURE__ */ e(L, { onGoBack: i }),
|
|
32
|
+
/* @__PURE__ */ e(x, { isLoading: p }),
|
|
33
|
+
!t && /* @__PURE__ */ m(c, { $justifyContent: "center", $alignItems: "center", children: [
|
|
34
|
+
/* @__PURE__ */ e(
|
|
35
|
+
u,
|
|
40
36
|
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
$borderColor: "BLACK_5",
|
|
46
|
-
$background: "BLACK_3",
|
|
47
|
-
$flexDirection: "row",
|
|
48
|
-
children: [
|
|
49
|
-
/* @__PURE__ */ e(
|
|
50
|
-
w,
|
|
51
|
-
{
|
|
52
|
-
src: m.CUEMATH_APP_QR_CODE,
|
|
53
|
-
width: 80,
|
|
54
|
-
height: 80,
|
|
55
|
-
withLoader: !1
|
|
56
|
-
}
|
|
57
|
-
),
|
|
58
|
-
/* @__PURE__ */ e(t, { $gapX: 0.5, $flex: 1, children: /* @__PURE__ */ e(n, { $color: "WHITE", $renderOnTabletAs: "ab3", $renderAs: "ab2", children: "Download the cuemath app to view your children’s report" }) })
|
|
59
|
-
]
|
|
37
|
+
src: d.CIRCLE_CUEMATH_LOGO_WHITE,
|
|
38
|
+
alt: "Parent Signup",
|
|
39
|
+
withLoader: !1,
|
|
40
|
+
width: 80
|
|
60
41
|
}
|
|
61
|
-
)
|
|
62
|
-
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ e(s, { heightX: 1 }),
|
|
44
|
+
/* @__PURE__ */ e(g, { $renderAs: "ab1", $color: "WHITE_T_60", $align: "center", children: "Switch between accounts" })
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ e(s, { height: t ? 0 : 40 }),
|
|
47
|
+
/* @__PURE__ */ e(
|
|
48
|
+
I,
|
|
49
|
+
{
|
|
50
|
+
$flex: t ? 1 : 0,
|
|
51
|
+
$justifyContent: r ? "flex-start" : "center",
|
|
52
|
+
$alignItems: r ? "flex-start" : "center",
|
|
53
|
+
$width: "100%",
|
|
54
|
+
children: o.length > 0 && /* @__PURE__ */ e(T, { users: o, onSelect: f, onAddNew: l, maxColumns: 3 })
|
|
55
|
+
}
|
|
56
|
+
)
|
|
63
57
|
]
|
|
64
58
|
}
|
|
65
59
|
);
|
|
66
|
-
},
|
|
60
|
+
}, W = h(C);
|
|
67
61
|
export {
|
|
68
|
-
|
|
62
|
+
W as default
|
|
69
63
|
};
|
|
70
64
|
//# sourceMappingURL=account-selector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-selector.js","sources":["../../../../src/features/auth/account-selector/account-selector.tsx"],"sourcesContent":["import type { IAccountSelectorViewProps } from './account-selector-types';\n\nimport { memo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Image from '../../ui/image/image';\nimport FlexView from '../../ui/layout/flex-view';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport { EDeviceType } from '../../ui/theme/constants';\nimport OverlayLoader from '../comps/overlay-loader/overlay-loader';\nimport UserList from '../comps/user-list/user-list';\nimport * as Styled from './account-selector-styled';\n\nconst AccountSelector = ({\n userAccounts,\n onSelect,\n onAddNew,\n isLoading,\n}: IAccountSelectorViewProps) => {\n const { device } = useTheme();\n const isCompact = device <= EDeviceType.TABLET;\n\n return (\n <FlexView\n $
|
|
1
|
+
{"version":3,"file":"account-selector.js","sources":["../../../../src/features/auth/account-selector/account-selector.tsx"],"sourcesContent":["import type { IAccountSelectorViewProps } from './account-selector-types';\n\nimport { memo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Image from '../../ui/image/image';\nimport FlexView from '../../ui/layout/flex-view';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport { EDeviceType } from '../../ui/theme/constants';\nimport OverlayLoader from '../comps/overlay-loader/overlay-loader';\nimport UserList from '../comps/user-list/user-list';\nimport * as Styled from './account-selector-styled';\nimport AccountSelectorHeader from './comps/compact-header/account-selector-header';\n\nconst AccountSelector = ({\n userAccounts,\n onSelect,\n onAddNew,\n isLoading,\n onGoBack,\n}: IAccountSelectorViewProps) => {\n const { device } = useTheme();\n const isCompact = device <= EDeviceType.TABLET;\n const isMobile = device === EDeviceType.MOBILE;\n\n return (\n <FlexView\n $alignItems={isMobile ? 'flex-start' : 'center'}\n $justifyContent={isMobile ? 'flex-start' : 'center'}\n $width=\"100%\"\n $height=\"100vh\"\n $gapX={isCompact ? 0 : 2}\n >\n {typeof onGoBack === 'function' && <AccountSelectorHeader onGoBack={onGoBack} />}\n <OverlayLoader isLoading={isLoading} />\n {!isCompact && (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\">\n <Image\n src={ILLUSTRATIONS.CIRCLE_CUEMATH_LOGO_WHITE}\n alt=\"Parent Signup\"\n withLoader={false}\n width={80}\n />\n <Separator heightX={1} />\n <Text $renderAs=\"ab1\" $color=\"WHITE_T_60\" $align=\"center\">\n Switch between accounts\n </Text>\n </FlexView>\n )}\n <Separator height={isCompact ? 0 : 40} />\n <Styled.UserListWrapper\n $flex={isCompact ? 1 : 0}\n $justifyContent={isMobile ? 'flex-start' : 'center'}\n $alignItems={isMobile ? 'flex-start' : 'center'}\n $width=\"100%\"\n >\n {userAccounts.length > 0 && (\n <UserList users={userAccounts} onSelect={onSelect} onAddNew={onAddNew} maxColumns={3} />\n )}\n </Styled.UserListWrapper>\n </FlexView>\n );\n};\n\nexport default memo(AccountSelector);\n"],"names":["AccountSelector","userAccounts","onSelect","onAddNew","isLoading","onGoBack","device","useTheme","isCompact","EDeviceType","isMobile","jsxs","FlexView","jsx","AccountSelectorHeader","OverlayLoader","Image","ILLUSTRATIONS","Separator","Text","Styled.UserListWrapper","UserList","accountSelector","memo"],"mappings":";;;;;;;;;;;;;AAgBA,MAAMA,IAAkB,CAAC;AAAA,EACv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Y,EAAG,CAAA;AAAA,UAAA;AAAA,QAE1F;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEemB,IAAAC,EAAKvB,CAAe;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { memo as i } from "react";
|
|
3
|
+
import { useTheme as m } from "styled-components";
|
|
4
|
+
import l from "../../../../../assets/line-icons/icons/back2.js";
|
|
5
|
+
import n from "../../../../ui/buttons/clickable/clickable.js";
|
|
6
|
+
import a from "../../../../ui/layout/flex-view.js";
|
|
7
|
+
import p from "../../../../ui/text/text.js";
|
|
8
|
+
import { EDeviceType as s } from "../../../../ui/theme/constants.js";
|
|
9
|
+
const f = ({ onGoBack: e }) => {
|
|
10
|
+
const { device: r, colors: t } = m();
|
|
11
|
+
return r <= s.TABLET ? /* @__PURE__ */ c(
|
|
12
|
+
a,
|
|
13
|
+
{
|
|
14
|
+
$gutterX: 1,
|
|
15
|
+
$gapX: 1,
|
|
16
|
+
$flexDirection: "row",
|
|
17
|
+
$alignItems: "center",
|
|
18
|
+
$background: "WHITE_T_05",
|
|
19
|
+
$width: "100%",
|
|
20
|
+
$flexColumnGapX: 0.5,
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ o(n, { onClick: e, label: "Go back to previous page", children: /* @__PURE__ */ o(l, { color: t.WHITE_1, width: 24, height: 24 }) }),
|
|
23
|
+
/* @__PURE__ */ o(p, { $renderAs: "ab2", $color: "WHITE", children: "Profile Switcher" })
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
) : null;
|
|
27
|
+
}, w = i(f);
|
|
28
|
+
export {
|
|
29
|
+
w as default
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=account-selector-header.js.map
|
package/dist/features/auth/account-selector/comps/compact-header/account-selector-header.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-selector-header.js","sources":["../../../../../../src/features/auth/account-selector/comps/compact-header/account-selector-header.tsx"],"sourcesContent":["import type { IAccountSelectorHeaderProps } from './account-selector-header-types';\n\nimport { type FC, memo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Back2Icon from '../../../../../assets/line-icons/icons/back2';\nimport Clickable from '../../../../ui/buttons/clickable/clickable';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\n\nconst AccountSelectorHeader: FC<IAccountSelectorHeaderProps> = ({ onGoBack }) => {\n const { device, colors } = useTheme();\n const isCompact = device <= EDeviceType.TABLET;\n\n if (!isCompact) return null;\n\n return (\n <FlexView\n $gutterX={1}\n $gapX={1}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $background=\"WHITE_T_05\"\n $width=\"100%\"\n $flexColumnGapX={0.5}\n >\n <Clickable onClick={onGoBack} label=\"Go back to previous page\">\n <Back2Icon color={colors.WHITE_1} width={24} height={24} />\n </Clickable>\n <Text $renderAs=\"ab2\" $color=\"WHITE\">\n Profile Switcher\n </Text>\n </FlexView>\n );\n};\n\nexport default memo(AccountSelectorHeader);\n"],"names":["AccountSelectorHeader","onGoBack","device","colors","useTheme","EDeviceType","jsxs","FlexView","jsx","Clickable","Back2Icon","Text","AccountSelectorHeader$1","memo"],"mappings":";;;;;;;;AAWA,MAAMA,IAAyD,CAAC,EAAE,UAAAC,QAAe;AAC/E,QAAM,EAAE,QAAAC,GAAQ,QAAAC,EAAO,IAAIC,EAAS;AAGhC,SAFcF,KAAUG,EAAY,SAKtC,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,UAAU;AAAA,MACV,OAAO;AAAA,MACP,gBAAe;AAAA,MACf,aAAY;AAAA,MACZ,aAAY;AAAA,MACZ,QAAO;AAAA,MACP,iBAAiB;AAAA,MAEjB,UAAA;AAAA,QAAA,gBAAAC,EAACC,GAAU,EAAA,SAASR,GAAU,OAAM,4BAClC,UAAC,gBAAAO,EAAAE,GAAA,EAAU,OAAOP,EAAO,SAAS,OAAO,IAAI,QAAQ,GAAI,CAAA,GAC3D;AAAA,0BACCQ,GAAK,EAAA,WAAU,OAAM,QAAO,SAAQ,UAErC,oBAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAjBmB;AAoBzB,GAEeC,IAAAC,EAAKb,CAAqB;"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import t from "styled-components";
|
|
2
2
|
import { UserItemCard as e } from "./user-item/user-item-styled.js";
|
|
3
|
-
const
|
|
3
|
+
const p = t.div`
|
|
4
4
|
display: inline-grid;
|
|
5
5
|
grid-template-columns: repeat(
|
|
6
6
|
${({ itemCount: r, maxColumns: o }) => r < o ? r : o},
|
|
7
7
|
${({ cardWidth: r }) => r}px
|
|
8
8
|
);
|
|
9
9
|
grid-auto-rows: ${({ cardWidth: r }) => r}px;
|
|
10
|
+
max-height: 100%;
|
|
10
11
|
`, s = t(e)`
|
|
11
12
|
&:hover {
|
|
12
13
|
background-color: ${({ theme: r }) => r.colors.BLACK_4};
|
|
@@ -14,6 +15,6 @@ const i = t.div`
|
|
|
14
15
|
`;
|
|
15
16
|
export {
|
|
16
17
|
s as AddAccountButton,
|
|
17
|
-
|
|
18
|
+
p as UserListWrapper
|
|
18
19
|
};
|
|
19
20
|
//# sourceMappingURL=user-list-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-list-styled.js","sources":["../../../../../src/features/auth/comps/user-list/user-list-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { UserItemCard } from './user-item/user-item-styled';\n\nexport const UserListWrapper = styled.div<{\n itemCount: number;\n maxColumns: number;\n cardWidth: number;\n}>`\n display: inline-grid;\n grid-template-columns: repeat(\n ${({ itemCount, maxColumns }) => (itemCount < maxColumns ? itemCount : maxColumns)},\n ${({ cardWidth }) => cardWidth}px\n );\n grid-auto-rows: ${({ cardWidth }) => cardWidth}px;\n`;\n\nexport const AddAccountButton = styled(UserItemCard)`\n &:hover {\n background-color: ${({ theme }) => theme.colors.BLACK_4};\n }\n`;\n"],"names":["UserListWrapper","styled","itemCount","maxColumns","cardWidth","AddAccountButton","UserItemCard","theme"],"mappings":";;AAIO,MAAMA,IAAkBC,EAAO;AAAA;AAAA;AAAA,MAOhC,CAAC,EAAE,WAAAC,GAAW,YAAAC,EAAA,MAAkBD,IAAYC,IAAaD,IAAYC,CAAW;AAAA,MAChF,CAAC,EAAE,WAAAC,EAAU,MAAMA,CAAS;AAAA;AAAA,oBAEd,CAAC,EAAE,WAAAA,EAAU,MAAMA,CAAS;AAAA,
|
|
1
|
+
{"version":3,"file":"user-list-styled.js","sources":["../../../../../src/features/auth/comps/user-list/user-list-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { UserItemCard } from './user-item/user-item-styled';\n\nexport const UserListWrapper = styled.div<{\n itemCount: number;\n maxColumns: number;\n cardWidth: number;\n}>`\n display: inline-grid;\n grid-template-columns: repeat(\n ${({ itemCount, maxColumns }) => (itemCount < maxColumns ? itemCount : maxColumns)},\n ${({ cardWidth }) => cardWidth}px\n );\n grid-auto-rows: ${({ cardWidth }) => cardWidth}px;\n max-height: 100%;\n`;\n\nexport const AddAccountButton = styled(UserItemCard)`\n &:hover {\n background-color: ${({ theme }) => theme.colors.BLACK_4};\n }\n`;\n"],"names":["UserListWrapper","styled","itemCount","maxColumns","cardWidth","AddAccountButton","UserItemCard","theme"],"mappings":";;AAIO,MAAMA,IAAkBC,EAAO;AAAA;AAAA;AAAA,MAOhC,CAAC,EAAE,WAAAC,GAAW,YAAAC,EAAA,MAAkBD,IAAYC,IAAaD,IAAYC,CAAW;AAAA,MAChF,CAAC,EAAE,WAAAC,EAAU,MAAMA,CAAS;AAAA;AAAA,oBAEd,CAAC,EAAE,WAAAA,EAAU,MAAMA,CAAS;AAAA;AAAA,GAInCC,IAAmBJ,EAAOK,CAAY;AAAA;AAAA,wBAE3B,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PLUGINS as _ } from "../../../node_modules/@cuemath/analytics-v2/dist/constants.js";
|
|
2
|
-
var
|
|
2
|
+
var t = /* @__PURE__ */ ((e) => (e.START_SIGNUP_CTA_CLICKED = "start_signup_cta_clicked", e.ECNA_STEP_VIEWED = "ecna_step_viewed", e.ECNA_RESPONSE_RECORDED_DEBUG = "ecna_response_recorded_debug", e.PARENT_SIGNUP_CTA_CLICKED = "parent_signup_cta_clicked", e.PARENT_SIGNUP_SUCCESSFUL = "parent_signup_successful", e.PARENT_SIGNUP_FAILED = "parent_signup_failed", e.STUDENT_SIGNUP_SUCCESSFUL = "signup_successful", e.STUDENT_SIGNUP_FAILED = "signup_failed", e.SIGNUP_OTP_ENTERED = "signup_otp_entered", e.SIGNUP_OTP_VERIFIED = "signup_otp_verified", e.SIGNUP_OTP_FAILED = "signup_otp_failed", e.SLOTS_SHOWN = "slots_shown", e.SLOT_DATE_SELECTED = "slot_date_selected", e.SLOT_TIME_SELECTED = "slot_time_selected", e.TUTOR_CHANGE_REASON_SELECTED = "tutor_change_reason_selected", e.SUBSCRIPTION_INTENT_FAILED = "subscription_intent_failed", e.SUBSCRIPTION_INTENT_CREATED = "subscription_intent_created", e.STRIPE_PAYMENT_ELEMENT_READY = "stripe_payment_element_ready", e.STRIPE_PAYMENT_FAILED = "stripe_payment_failed", e.STRIPE_PAYMENT_SUCCESS = "stripe_payment_success", e.PAYMENT_PLAN_SELECTED = "payment_plan_selected", e))(t || {});
|
|
3
3
|
const n = {
|
|
4
4
|
start_signup_cta_clicked: [_.MIXPANEL],
|
|
5
5
|
ecna_step_viewed: [_.MIXPANEL],
|
|
@@ -15,10 +15,16 @@ const n = {
|
|
|
15
15
|
slots_shown: [_.MIXPANEL],
|
|
16
16
|
slot_date_selected: [_.MIXPANEL],
|
|
17
17
|
slot_time_selected: [_.MIXPANEL],
|
|
18
|
-
tutor_change_reason_selected: [_.MIXPANEL]
|
|
18
|
+
tutor_change_reason_selected: [_.MIXPANEL],
|
|
19
|
+
subscription_intent_failed: [_.MIXPANEL],
|
|
20
|
+
subscription_intent_created: [_.MIXPANEL],
|
|
21
|
+
stripe_payment_element_ready: [_.MIXPANEL],
|
|
22
|
+
stripe_payment_failed: [_.MIXPANEL],
|
|
23
|
+
stripe_payment_success: [_.MIXPANEL],
|
|
24
|
+
payment_plan_selected: [_.MIXPANEL]
|
|
19
25
|
};
|
|
20
26
|
export {
|
|
21
|
-
|
|
27
|
+
t as PLA_ANALYTICS_EVENTS,
|
|
22
28
|
n as PLA_ANALYTICS_WHITELIST_EVENTS
|
|
23
29
|
};
|
|
24
30
|
//# sourceMappingURL=pla-analytics-events.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pla-analytics-events.js","sources":["../../../../src/features/auth/pla-signup/pla-analytics-events.ts"],"sourcesContent":["import { PLUGINS } from '@cuemath/analytics-v2/dist/constants';\n\nexport enum PLA_ANALYTICS_EVENTS {\n START_SIGNUP_CTA_CLICKED = 'start_signup_cta_clicked',\n ECNA_STEP_VIEWED = 'ecna_step_viewed',\n ECNA_RESPONSE_RECORDED_DEBUG = 'ecna_response_recorded_debug',\n PARENT_SIGNUP_CTA_CLICKED = 'parent_signup_cta_clicked',\n PARENT_SIGNUP_SUCCESSFUL = 'parent_signup_successful',\n PARENT_SIGNUP_FAILED = 'parent_signup_failed',\n STUDENT_SIGNUP_SUCCESSFUL = 'signup_successful',\n STUDENT_SIGNUP_FAILED = 'signup_failed',\n SIGNUP_OTP_ENTERED = 'signup_otp_entered',\n SIGNUP_OTP_VERIFIED = 'signup_otp_verified',\n SIGNUP_OTP_FAILED = 'signup_otp_failed',\n SLOTS_SHOWN = 'slots_shown',\n SLOT_DATE_SELECTED = 'slot_date_selected',\n SLOT_TIME_SELECTED = 'slot_time_selected',\n TUTOR_CHANGE_REASON_SELECTED = 'tutor_change_reason_selected',\n}\n\nexport const PLA_ANALYTICS_WHITELIST_EVENTS = {\n [PLA_ANALYTICS_EVENTS.START_SIGNUP_CTA_CLICKED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.ECNA_STEP_VIEWED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.ECNA_RESPONSE_RECORDED_DEBUG]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.PARENT_SIGNUP_CTA_CLICKED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.PARENT_SIGNUP_SUCCESSFUL]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.PARENT_SIGNUP_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.STUDENT_SIGNUP_SUCCESSFUL]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.STUDENT_SIGNUP_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SIGNUP_OTP_ENTERED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SIGNUP_OTP_VERIFIED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SIGNUP_OTP_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SLOTS_SHOWN]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SLOT_DATE_SELECTED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SLOT_TIME_SELECTED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.TUTOR_CHANGE_REASON_SELECTED]: [PLUGINS.MIXPANEL],\n};\n"],"names":["PLA_ANALYTICS_EVENTS","PLA_ANALYTICS_WHITELIST_EVENTS","PLUGINS"],"mappings":";AAEY,IAAAA,sBAAAA,OACVA,EAAA,2BAA2B,4BAC3BA,EAAA,mBAAmB,oBACnBA,EAAA,+BAA+B,gCAC/BA,EAAA,4BAA4B,6BAC5BA,EAAA,2BAA2B,4BAC3BA,EAAA,uBAAuB,wBACvBA,EAAA,4BAA4B,qBAC5BA,EAAA,wBAAwB,iBACxBA,EAAA,qBAAqB,sBACrBA,EAAA,sBAAsB,uBACtBA,EAAA,oBAAoB,qBACpBA,EAAA,cAAc,eACdA,EAAA,qBAAqB,sBACrBA,EAAA,qBAAqB,sBACrBA,EAAA,+BAA+B,
|
|
1
|
+
{"version":3,"file":"pla-analytics-events.js","sources":["../../../../src/features/auth/pla-signup/pla-analytics-events.ts"],"sourcesContent":["import { PLUGINS } from '@cuemath/analytics-v2/dist/constants';\n\nexport enum PLA_ANALYTICS_EVENTS {\n START_SIGNUP_CTA_CLICKED = 'start_signup_cta_clicked',\n ECNA_STEP_VIEWED = 'ecna_step_viewed',\n ECNA_RESPONSE_RECORDED_DEBUG = 'ecna_response_recorded_debug',\n PARENT_SIGNUP_CTA_CLICKED = 'parent_signup_cta_clicked',\n PARENT_SIGNUP_SUCCESSFUL = 'parent_signup_successful',\n PARENT_SIGNUP_FAILED = 'parent_signup_failed',\n STUDENT_SIGNUP_SUCCESSFUL = 'signup_successful',\n STUDENT_SIGNUP_FAILED = 'signup_failed',\n SIGNUP_OTP_ENTERED = 'signup_otp_entered',\n SIGNUP_OTP_VERIFIED = 'signup_otp_verified',\n SIGNUP_OTP_FAILED = 'signup_otp_failed',\n SLOTS_SHOWN = 'slots_shown',\n SLOT_DATE_SELECTED = 'slot_date_selected',\n SLOT_TIME_SELECTED = 'slot_time_selected',\n TUTOR_CHANGE_REASON_SELECTED = 'tutor_change_reason_selected',\n SUBSCRIPTION_INTENT_FAILED = 'subscription_intent_failed',\n SUBSCRIPTION_INTENT_CREATED = 'subscription_intent_created',\n STRIPE_PAYMENT_ELEMENT_READY = 'stripe_payment_element_ready',\n STRIPE_PAYMENT_FAILED = 'stripe_payment_failed',\n STRIPE_PAYMENT_SUCCESS = 'stripe_payment_success',\n PAYMENT_PLAN_SELECTED = 'payment_plan_selected',\n}\n\nexport const PLA_ANALYTICS_WHITELIST_EVENTS = {\n [PLA_ANALYTICS_EVENTS.START_SIGNUP_CTA_CLICKED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.ECNA_STEP_VIEWED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.ECNA_RESPONSE_RECORDED_DEBUG]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.PARENT_SIGNUP_CTA_CLICKED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.PARENT_SIGNUP_SUCCESSFUL]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.PARENT_SIGNUP_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.STUDENT_SIGNUP_SUCCESSFUL]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.STUDENT_SIGNUP_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SIGNUP_OTP_ENTERED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SIGNUP_OTP_VERIFIED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SIGNUP_OTP_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SLOTS_SHOWN]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SLOT_DATE_SELECTED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SLOT_TIME_SELECTED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.TUTOR_CHANGE_REASON_SELECTED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SUBSCRIPTION_INTENT_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SUBSCRIPTION_INTENT_CREATED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS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AC9D,oBAA0C,CAACA,EAAQ,QAAQ;AAAA,EAC3D,qBAA2C,CAACA,EAAQ,QAAQ;AAAA,EAC5D,mBAAyC,CAACA,EAAQ,QAAQ;AAAA,EAC1D,aAAmC,CAACA,EAAQ,QAAQ;AAAA,EACpD,oBAA0C,CAACA,EAAQ,QAAQ;AAAA,EAC3D,oBAA0C,CAACA,EAAQ,QAAQ;AAAA,EAC3D,8BAAoD,CAACA,EAAQ,QAAQ;AAAA,EACrE,4BAAkD,CAACA,EAAQ,QAAQ;AAAA,EACnE,6BAAmD,CAACA,EAAQ,QAAQ;AAAA,EACpE,8BAAoD,CAACA,EAAQ,QAAQ;AAAA,EACrE,uBAA6C,CAACA,EAAQ,QAAQ;AAAA,EAC9D,wBAA8C,CAACA,EAAQ,QAAQ;AAAA,EAC/D,uBAA6C,CAACA,EAAQ,QAAQ;AACjE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circular-step-wrapper.js","sources":["../../../../../src/features/auth/signup/circular-step-wrapper/circular-step-wrapper.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../ui/lottie-animation/types';\nimport type { ICircularStepRef, ICircularStepWrapperProps } from './circular-step-wrapper-types';\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n memo,\n type Ref,\n} from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Back2Icon from '../../../../assets/line-icons/icons/back2';\nimport Next2Icon from '../../../../assets/line-icons/icons/next2';\nimport AnimatedArc from '../../../ui/animated-arc/animated-arc';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\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 { EDeviceType } from '../../../ui/theme/constants';\nimport * as Styled from './circular-step-wrapper-styled';\n\nconst animationSettings = {\n autoplay: false,\n loop: false,\n renderer: 'canvas',\n rendererSettings: {\n preserveAspectRatio: 'xMidYMin slice',\n },\n};\n\nconst CircularStepWrapper = forwardRef<ICircularStepRef, ICircularStepWrapperProps>(\n (\n {\n children,\n onGoBack,\n onNext,\n label,\n showNext,\n showPrevious,\n animation,\n introFrames,\n outroFrames,\n isNextLoading,\n progressAngle,\n footerElement,\n isNextDisabled,\n animationSrcMobile,\n },\n ref: Ref<ICircularStepRef>,\n ) => {\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const [containerHeight, setContainerHeight] = useState<number | undefined>();\n const [showContent, setShowContent] = useState(false);\n const timeoutRef = useRef<NodeJS.Timeout | null>(null);\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n\n const onLottieRender = useCallback(() => {\n if (animation && animationRef.current) {\n animationRef.current.playSegments(introFrames, true);\n setShowContent(true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [animation]);\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, [animation]);\n\n useImperativeHandle(ref, () => ({\n playOutroAndFadeOut: async () => {\n return new Promise<void>(resolve => {\n const handleComplete = () => {\n resolve();\n animationRef.current?.removeEventListener('complete', handleComplete);\n };\n\n animationRef.current?.playSegments(outroFrames, true);\n timeoutRef.current = setTimeout(() => setShowContent(false), 400);\n animationRef.current?.addEventListener('complete', handleComplete);\n });\n },\n }));\n\n useLayoutEffect(() => {\n if (containerRef.current) {\n setContainerHeight(containerRef.current.offsetHeight);\n }\n }, []);\n\n return (\n <Styled.Container\n $flex={1}\n $flexDirection=\"column\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $width=\"100%\"\n $height=\"100%\"\n ref={containerRef}\n >\n {containerHeight && (\n <LottieAnimation\n width={1280}\n height={containerHeight}\n src={isMobile ? animationSrcMobile ?? animation : animation}\n ref={animationRef}\n onRender={onLottieRender}\n settings={animationSettings}\n />\n )}\n <Styled.CircularStepContainer\n $width={isMobile ? 290 : 400}\n $height={isMobile ? 290 : 400}\n $background=\"REAL_BLACK\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {progressAngle && (\n <AnimatedArc\n radius={isMobile ? 145 : 200}\n strokeWidth={2}\n color=\"WHITE\"\n targetAngle={progressAngle}\n mode=\"fade\"\n duration={1}\n />\n )}\n <Styled.ContentWrapper $isVisible={showContent} $width=\"100%\">\n {label && (\n <FlexView $gutterX={isMobile ? 1.5 : 3.5}>\n <Text $renderAs=\"ab2\" $color=\"WHITE\" $align=\"center\">\n {label}\n </Text>\n <Separator heightX={1} />\n </FlexView>\n )}\n <Styled.InputContainer>{children}</Styled.InputContainer>\n </Styled.ContentWrapper>\n </Styled.CircularStepContainer>\n {footerElement && (\n <Styled.FooterWrapper $alignItems=\"center\" $justifyContent=\"center\">\n {footerElement}\n </Styled.FooterWrapper>\n )}\n {showPrevious && (\n <Styled.PrevButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"black-dark\"\n analyticsLabel=\"Prev\"\n onClick={onGoBack}\n disabled={isNextLoading}\n size=\"small\"\n />\n </Styled.PrevButtonWrapper>\n )}\n {showNext && (\n <Styled.NextButtonWrapper>\n <IconButton\n size=\"small\"\n Icon={Next2Icon}\n renderAs=\"secondary-dark\"\n analyticsLabel=\"Next\"\n onClick={onNext}\n busy={isNextLoading}\n disabled={isNextLoading || isNextDisabled}\n />\n </Styled.NextButtonWrapper>\n )}\n </Styled.Container>\n );\n },\n);\n\nexport default memo(CircularStepWrapper);\n"],"names":["animationSettings","CircularStepWrapper","forwardRef","children","onGoBack","onNext","label","showNext","showPrevious","animation","introFrames","outroFrames","isNextLoading","progressAngle","footerElement","isNextDisabled","animationSrcMobile","ref","animationRef","useRef","containerRef","containerHeight","setContainerHeight","useState","showContent","setShowContent","timeoutRef","device","useTheme","isMobile","EDeviceType","onLottieRender","useCallback","useEffect","useImperativeHandle","resolve","handleComplete","_a","_b","useLayoutEffect","jsxs","Styled.Container","jsx","LottieAnimation","Styled.CircularStepContainer","AnimatedArc","Styled.ContentWrapper","FlexView","Text","Separator","Styled.InputContainer","Styled.FooterWrapper","Styled.PrevButtonWrapper","IconButton","Back2Icon","Styled.NextButtonWrapper","Next2Icon","
|
|
1
|
+
{"version":3,"file":"circular-step-wrapper.js","sources":["../../../../../src/features/auth/signup/circular-step-wrapper/circular-step-wrapper.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../ui/lottie-animation/types';\nimport type { ICircularStepRef, ICircularStepWrapperProps } from './circular-step-wrapper-types';\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n memo,\n type Ref,\n} from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Back2Icon from '../../../../assets/line-icons/icons/back2';\nimport Next2Icon from '../../../../assets/line-icons/icons/next2';\nimport AnimatedArc from '../../../ui/animated-arc/animated-arc';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\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 { EDeviceType } from '../../../ui/theme/constants';\nimport * as Styled from './circular-step-wrapper-styled';\n\nconst animationSettings = {\n autoplay: false,\n loop: false,\n renderer: 'canvas',\n rendererSettings: {\n preserveAspectRatio: 'xMidYMin slice',\n },\n};\n\nconst CircularStepWrapper = forwardRef<ICircularStepRef, ICircularStepWrapperProps>(\n (\n {\n children,\n onGoBack,\n onNext,\n label,\n showNext,\n showPrevious,\n animation,\n introFrames,\n outroFrames,\n isNextLoading,\n progressAngle,\n footerElement,\n isNextDisabled,\n animationSrcMobile,\n },\n ref: Ref<ICircularStepRef>,\n ) => {\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const [containerHeight, setContainerHeight] = useState<number | undefined>();\n const [showContent, setShowContent] = useState(false);\n const timeoutRef = useRef<NodeJS.Timeout | null>(null);\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n\n const onLottieRender = useCallback(() => {\n if (animation && animationRef.current) {\n animationRef.current.playSegments(introFrames, true);\n setShowContent(true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [animation]);\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, [animation]);\n\n useImperativeHandle(ref, () => ({\n playOutroAndFadeOut: async () => {\n return new Promise<void>(resolve => {\n const handleComplete = () => {\n resolve();\n animationRef.current?.removeEventListener('complete', handleComplete);\n };\n\n animationRef.current?.playSegments(outroFrames, true);\n timeoutRef.current = setTimeout(() => setShowContent(false), 400);\n animationRef.current?.addEventListener('complete', handleComplete);\n });\n },\n }));\n\n useLayoutEffect(() => {\n if (containerRef.current) {\n setContainerHeight(containerRef.current.offsetHeight);\n }\n }, []);\n\n return (\n <Styled.Container\n $flex={1}\n $flexDirection=\"column\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $width=\"100%\"\n $height=\"100%\"\n ref={containerRef}\n >\n {containerHeight && (\n <LottieAnimation\n width={1280}\n height={containerHeight}\n src={isMobile ? animationSrcMobile ?? animation : animation}\n ref={animationRef}\n onRender={onLottieRender}\n settings={animationSettings}\n />\n )}\n <Styled.CircularStepContainer\n $width={isMobile ? 290 : 400}\n $height={isMobile ? 290 : 400}\n $background=\"REAL_BLACK\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {progressAngle && (\n <AnimatedArc\n radius={isMobile ? 145 : 200}\n strokeWidth={2}\n color=\"WHITE\"\n targetAngle={progressAngle}\n mode=\"fade\"\n duration={1}\n />\n )}\n <Styled.ContentWrapper $isVisible={showContent} $width=\"100%\">\n {label && (\n <FlexView $gutterX={isMobile ? 1.5 : 3.5}>\n <Text $renderAs=\"ab2\" $color=\"WHITE\" $align=\"center\">\n {label}\n </Text>\n <Separator heightX={1} />\n </FlexView>\n )}\n <Styled.InputContainer>{children}</Styled.InputContainer>\n </Styled.ContentWrapper>\n </Styled.CircularStepContainer>\n {footerElement && (\n <Styled.FooterWrapper $alignItems=\"center\" $justifyContent=\"center\">\n {footerElement}\n </Styled.FooterWrapper>\n )}\n {showPrevious && (\n <Styled.PrevButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"black-dark\"\n analyticsLabel=\"Prev\"\n onClick={onGoBack}\n disabled={isNextLoading}\n size=\"small\"\n />\n </Styled.PrevButtonWrapper>\n )}\n {showNext && (\n <Styled.NextButtonWrapper>\n <IconButton\n size=\"small\"\n Icon={Next2Icon}\n renderAs=\"secondary-dark\"\n analyticsLabel=\"Next\"\n onClick={onNext}\n busy={isNextLoading}\n disabled={isNextLoading || isNextDisabled}\n />\n </Styled.NextButtonWrapper>\n )}\n </Styled.Container>\n );\n },\n);\n\nexport default memo(CircularStepWrapper);\n"],"names":["animationSettings","CircularStepWrapper","forwardRef","children","onGoBack","onNext","label","showNext","showPrevious","animation","introFrames","outroFrames","isNextLoading","progressAngle","footerElement","isNextDisabled","animationSrcMobile","ref","animationRef","useRef","containerRef","containerHeight","setContainerHeight","useState","showContent","setShowContent","timeoutRef","device","useTheme","isMobile","EDeviceType","onLottieRender","useCallback","useEffect","useImperativeHandle","resolve","handleComplete","_a","_b","useLayoutEffect","jsxs","Styled.Container","jsx","LottieAnimation","Styled.CircularStepContainer","AnimatedArc","Styled.ContentWrapper","FlexView","Text","Separator","Styled.InputContainer","Styled.FooterWrapper","Styled.PrevButtonWrapper","IconButton","Back2Icon","Styled.NextButtonWrapper","Next2Icon","CircularStepWrapper$1","memo"],"mappings":";;;;;;;;;;;;;AA2BA,MAAMA,KAAoB;AAAA,EACxB,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AAAA,EACV,kBAAkB;AAAA,IAChB,qBAAqB;AAAA,EACvB;AACF,GAEMC,KAAsBC;AAAA,EAC1B,CACE;AAAA,IACE,U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AAA,UACF;AAAA,UACCW,uBACEqC,IAAA,EAAqB,aAAY,UAAS,iBAAgB,UACxD,UACHrC,GAAA;AAAA,UAEDN,KACC,gBAAAkC,EAACU,IAAA,EACC,UAAA,gBAAAV;AAAA,YAACW;AAAA,YAAA;AAAA,cACC,MAAMC;AAAA,cACN,UAAS;AAAA,cACT,gBAAe;AAAA,cACf,SAASlD;AAAA,cACT,UAAUQ;AAAA,cACV,MAAK;AAAA,YAAA;AAAA,UAAA,GAET;AAAA,UAEDL,KACC,gBAAAmC,EAACa,IAAA,EACC,UAAA,gBAAAb;AAAA,YAACW;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,MAAMG;AAAA,cACN,UAAS;AAAA,cACT,gBAAe;AAAA,cACf,SAASnD;AAAA,cACT,MAAMO;AAAA,cACN,UAAUA,KAAiBG;AAAA,YAAA;AAAA,UAAA,GAE/B;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF,GAEe0C,KAAAC,EAAKzD,EAAmB;"}
|
|
@@ -13,12 +13,12 @@ const q = ({
|
|
|
13
13
|
error: u,
|
|
14
14
|
helperText: b,
|
|
15
15
|
onEnter: n,
|
|
16
|
-
isLoading:
|
|
16
|
+
isLoading: $,
|
|
17
17
|
isValid: h,
|
|
18
18
|
type: t = "text",
|
|
19
|
-
placeholder:
|
|
20
|
-
actionElement:
|
|
21
|
-
maxLength:
|
|
19
|
+
placeholder: D,
|
|
20
|
+
actionElement: F,
|
|
21
|
+
maxLength: R,
|
|
22
22
|
width: E,
|
|
23
23
|
textTransform: P,
|
|
24
24
|
textAlign: v = "center",
|
|
@@ -56,8 +56,8 @@ const q = ({
|
|
|
56
56
|
X,
|
|
57
57
|
{
|
|
58
58
|
helperText: u || b,
|
|
59
|
-
isLoading:
|
|
60
|
-
actionElement:
|
|
59
|
+
isLoading: $,
|
|
60
|
+
actionElement: F,
|
|
61
61
|
children: /* @__PURE__ */ K(
|
|
62
62
|
B,
|
|
63
63
|
{
|
|
@@ -75,13 +75,13 @@ const q = ({
|
|
|
75
75
|
value: r,
|
|
76
76
|
onChange: G,
|
|
77
77
|
autoFocus: !0,
|
|
78
|
-
placeholder:
|
|
78
|
+
placeholder: D,
|
|
79
79
|
color: z,
|
|
80
80
|
autoCapitalize: "none",
|
|
81
81
|
textTransform: P,
|
|
82
82
|
type: y,
|
|
83
83
|
onKeyDown: k,
|
|
84
|
-
maxLength:
|
|
84
|
+
maxLength: R,
|
|
85
85
|
align: v,
|
|
86
86
|
fontSize: j
|
|
87
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-input-field.js","sources":["../../../../../src/features/auth/signup/custom-input-field/custom-input-field.tsx"],"sourcesContent":["import type { ICustomInputFieldProps } from './custom-input-field-types';\n\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n memo,\n type FC,\n type KeyboardEvent,\n type ChangeEvent,\n} from 'react';\nimport { useTheme } from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport PhoneCountrySelector from './country-selector/country-selector';\nimport * as Styled from './custom-input-field-styled';\nimport InputWrapper from './input-wrapper/input-wrapper';\nimport PasswordToggleIcon from './password-toggle/password-toggle';\n\nconst CustomInputField: FC<ICustomInputFieldProps> = ({\n value,\n onChange,\n error,\n helperText,\n onEnter,\n isLoading,\n isValid,\n type = 'text',\n placeholder,\n actionElement,\n maxLength,\n width,\n textTransform,\n textAlign = 'center',\n selectedCountry,\n onCountryChange,\n autoSize = false,\n}) => {\n const theme = useTheme();\n const isMobile = theme.device <= EDeviceType.MOBILE;\n const [isPasswordVisible, setIsPasswordVisible] = useState(false);\n const [fontSize, setFontSize] = useState(isMobile ? 24 : 32);\n const inputRef = useRef<HTMLInputElement>(null);\n const canvasRef = useRef<HTMLCanvasElement | null>(null);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n onEnter?.();\n }\n },\n [onEnter],\n );\n\n const inputType = useMemo(() => {\n if (type === 'password') return isPasswordVisible ? 'text' : 'password';\n\n if (type === 'phone') return 'number';\n\n return type;\n }, [type, isPasswordVisible]);\n\n const inputColor = useMemo(() => {\n if (error) return theme.colors.RED;\n\n if (isValid) return theme.colors.GREEN_4;\n\n return theme.colors.WHITE;\n }, [error, isValid, theme.colors]);\n\n const measureTextWidth = useCallback((text: string, font: string): number => {\n if (!canvasRef.current) {\n canvasRef.current = document.createElement('canvas');\n }\n\n const context = canvasRef.current.getContext('2d');\n\n if (!context) return 0;\n\n context.font = font;\n\n return context.measureText(text).width;\n }, []);\n\n useEffect(() => {\n if (!inputRef.current || !value || !autoSize) {\n return;\n }\n\n if (isMobile) {\n setFontSize(24);\n\n return;\n }\n\n const inputWidth = inputRef.current.clientWidth;\n\n const font32 = \"32px 'Athletics-Light'\";\n\n const textWidth32 = measureTextWidth(value, font32);\n\n if (textWidth32 > inputWidth) {\n setFontSize(24);\n } else {\n setFontSize(32);\n }\n }, [value, measureTextWidth, autoSize, isMobile]);\n\n useEffect(() => {\n return () => {\n canvasRef.current = null;\n };\n }, []);\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => onChange(event.target.value),\n [onChange],\n );\n\n return (\n <InputWrapper\n helperText={error || helperText}\n isLoading={isLoading}\n actionElement={actionElement}\n >\n <FlexView\n $width={width ?? '100%'}\n $flex={1}\n $alignItems=\"center\"\n $flexDirection=\"row\"\n $flexGapX={0.5}\n >\n {type === 'phone' && (\n <PhoneCountrySelector onChange={onCountryChange} value={selectedCountry} />\n )}\n <Styled.CustomInput\n ref={inputRef}\n value={value}\n onChange={handleChange}\n autoFocus\n placeholder={placeholder}\n color={inputColor}\n autoCapitalize=\"none\"\n textTransform={textTransform}\n type={inputType}\n onKeyDown={handleKeyDown}\n maxLength={maxLength}\n align={textAlign}\n fontSize={fontSize}\n />\n {type === 'password' && (\n <PasswordToggleIcon\n isVisible={isPasswordVisible}\n onToggle={() => setIsPasswordVisible(prev => !prev)}\n />\n )}\n </FlexView>\n </InputWrapper>\n );\n};\n\nexport default memo(CustomInputField);\n"],"names":["CustomInputField","value","onChange","error","helperText","onEnter","isLoading","isValid","type","placeholder","actionElement","maxLength","width","textTransform","textAlign","selectedCountry","onCountryChange","autoSize","theme","useTheme","isMobile","EDeviceType","isPasswordVisible","setIsPasswordVisible","useState","fontSize","setFontSize","inputRef","useRef","canvasRef","handleKeyDown","useCallback","event","inputType","useMemo","inputColor","measureTextWidth","text","font","context","useEffect","inputWidth","handleChange","jsx","InputWrapper","jsxs","FlexView","PhoneCountrySelector","Styled.CustomInput","PasswordToggleIcon","prev","
|
|
1
|
+
{"version":3,"file":"custom-input-field.js","sources":["../../../../../src/features/auth/signup/custom-input-field/custom-input-field.tsx"],"sourcesContent":["import type { ICustomInputFieldProps } from './custom-input-field-types';\n\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n memo,\n type FC,\n type KeyboardEvent,\n type ChangeEvent,\n} from 'react';\nimport { useTheme } from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport PhoneCountrySelector from './country-selector/country-selector';\nimport * as Styled from './custom-input-field-styled';\nimport InputWrapper from './input-wrapper/input-wrapper';\nimport PasswordToggleIcon from './password-toggle/password-toggle';\n\nconst CustomInputField: FC<ICustomInputFieldProps> = ({\n value,\n onChange,\n error,\n helperText,\n onEnter,\n isLoading,\n isValid,\n type = 'text',\n placeholder,\n actionElement,\n maxLength,\n width,\n textTransform,\n textAlign = 'center',\n selectedCountry,\n onCountryChange,\n autoSize = false,\n}) => {\n const theme = useTheme();\n const isMobile = theme.device <= EDeviceType.MOBILE;\n const [isPasswordVisible, setIsPasswordVisible] = useState(false);\n const [fontSize, setFontSize] = useState(isMobile ? 24 : 32);\n const inputRef = useRef<HTMLInputElement>(null);\n const canvasRef = useRef<HTMLCanvasElement | null>(null);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n onEnter?.();\n }\n },\n [onEnter],\n );\n\n const inputType = useMemo(() => {\n if (type === 'password') return isPasswordVisible ? 'text' : 'password';\n\n if (type === 'phone') return 'number';\n\n return type;\n }, [type, isPasswordVisible]);\n\n const inputColor = useMemo(() => {\n if (error) return theme.colors.RED;\n\n if (isValid) return theme.colors.GREEN_4;\n\n return theme.colors.WHITE;\n }, [error, isValid, theme.colors]);\n\n const measureTextWidth = useCallback((text: string, font: string): number => {\n if (!canvasRef.current) {\n canvasRef.current = document.createElement('canvas');\n }\n\n const context = canvasRef.current.getContext('2d');\n\n if (!context) return 0;\n\n context.font = font;\n\n return context.measureText(text).width;\n }, []);\n\n useEffect(() => {\n if (!inputRef.current || !value || !autoSize) {\n return;\n }\n\n if (isMobile) {\n setFontSize(24);\n\n return;\n }\n\n const inputWidth = inputRef.current.clientWidth;\n\n const font32 = \"32px 'Athletics-Light'\";\n\n const textWidth32 = measureTextWidth(value, font32);\n\n if (textWidth32 > inputWidth) {\n setFontSize(24);\n } else {\n setFontSize(32);\n }\n }, [value, measureTextWidth, autoSize, isMobile]);\n\n useEffect(() => {\n return () => {\n canvasRef.current = null;\n };\n }, []);\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => onChange(event.target.value),\n [onChange],\n );\n\n return (\n <InputWrapper\n helperText={error || helperText}\n isLoading={isLoading}\n actionElement={actionElement}\n >\n <FlexView\n $width={width ?? '100%'}\n $flex={1}\n $alignItems=\"center\"\n $flexDirection=\"row\"\n $flexGapX={0.5}\n >\n {type === 'phone' && (\n <PhoneCountrySelector onChange={onCountryChange} value={selectedCountry} />\n )}\n <Styled.CustomInput\n ref={inputRef}\n value={value}\n onChange={handleChange}\n autoFocus\n placeholder={placeholder}\n color={inputColor}\n autoCapitalize=\"none\"\n textTransform={textTransform}\n type={inputType}\n onKeyDown={handleKeyDown}\n maxLength={maxLength}\n align={textAlign}\n fontSize={fontSize}\n />\n {type === 'password' && (\n <PasswordToggleIcon\n isVisible={isPasswordVisible}\n onToggle={() => setIsPasswordVisible(prev => !prev)}\n />\n )}\n </FlexView>\n </InputWrapper>\n );\n};\n\nexport default memo(CustomInputField);\n"],"names":["CustomInputField","value","onChange","error","helperText","onEnter","isLoading","isValid","type","placeholder","actionElement","maxLength","width","textTransform","textAlign","selectedCountry","onCountryChange","autoSize","theme","useTheme","isMobile","EDeviceType","isPasswordVisible","setIsPasswordVisible","useState","fontSize","setFontSize","inputRef","useRef","canvasRef","handleKeyDown","useCallback","event","inputType","useMemo","inputColor","measureTextWidth","text","font","context","useEffect","inputWidth","handleChange","jsx","InputWrapper","jsxs","FlexView","PhoneCountrySelector","Styled.CustomInput","PasswordToggleIcon","prev","CustomInputField$1","memo"],"mappings":";;;;;;;;;AAsBA,MAAMA,IAA+C,CAAC;AAAA,EACpD,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,iBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC,IAAW;AACb,MAAM;AACJ,QAAMC,IAAQC,KACRC,IAAWF,EAAM,UAAUG,EAAY,QACvC,CAACC,GAAmBC,CAAoB,IAAIC,EAAS,EAAK,GAC1D,CAACC,GAAUC,CAAW,IAAIF,EAASJ,IAAW,KAAK,EAAE,GACrDO,IAAWC,EAAyB,IAAI,GACxCC,IAAYD,EAAiC,IAAI,GAEjDE,IAAgBC;AAAA,IACpB,CAACC,MAA2C;AACtC,MAAAA,EAAM,QAAQ,YACN3B,KAAA,QAAAA;AAAA,IAEd;AAAA,IACA,CAACA,CAAO;AAAA,EAAA,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AO;AAAA,UACP,aAAY;AAAA,UACZ,gBAAe;AAAA,UACf,WAAW;AAAA,UAEV,UAAA;AAAA,YAAAJ,MAAS,WACP,gBAAAmC,EAAAI,GAAA,EAAqB,UAAU/B,GAAiB,OAAOD,GAAiB;AAAA,YAE3E,gBAAA4B;AAAA,cAACK;AAAAA,cAAA;AAAA,gBACC,KAAKrB;AAAA,gBACL,OAAA1B;AAAA,gBACA,UAAUyC;AAAA,gBACV,WAAS;AAAA,gBACT,aAAAjC;AAAA,gBACA,OAAO0B;AAAA,gBACP,gBAAe;AAAA,gBACf,eAAAtB;AAAA,gBACA,MAAMoB;AAAA,gBACN,WAAWH;AAAA,gBACX,WAAAnB;AAAA,gBACA,OAAOG;AAAA,gBACP,UAAAW;AAAA,cAAA;AAAA,YACF;AAAA,YACCjB,MAAS,cACR,gBAAAmC;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,WAAW3B;AAAA,gBACX,UAAU,MAAMC,EAAqB,CAAA2B,MAAQ,CAACA,CAAI;AAAA,cAAA;AAAA,YACpD;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeC,KAAAC,EAAKpD,CAAgB;"}
|
package/dist/features/circle-games/sign-up/api/use-update-username-api/use-update-username-api.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createPostAPI as e } from "@cuemath/rest-api";
|
|
2
|
+
import { BASE_URL_V1 as o } from "../../../../../constants/api.js";
|
|
3
|
+
const { usePost: p } = e({
|
|
4
|
+
getURL: (s, { studentId: t }) => `${o}/students/${t}/`
|
|
5
|
+
});
|
|
6
|
+
export {
|
|
7
|
+
p as useUpdateUsernamePost
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=use-update-username-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-update-username-api.js","sources":["../../../../../../src/features/circle-games/sign-up/api/use-update-username-api/use-update-username-api.ts"],"sourcesContent":["import type {\n IUpdateUsernamePayload,\n IUpdateUsernameResponse,\n} from './use-update-username-api-types';\n\nimport { createPostAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../../../constants/api';\n\nconst { usePost: useUpdateUsernamePost } = createPostAPI<\n IUpdateUsernameResponse,\n IUpdateUsernamePayload,\n { studentId: string }\n>({\n getURL: (_, { studentId }) => `${BASE_URL_V1}/students/${studentId}/`,\n});\n\nexport { useUpdateUsernamePost };\n"],"names":["useUpdateUsernamePost","createPostAPI","_","studentId","BASE_URL_V1"],"mappings":";;AASA,MAAM,EAAE,SAASA,EAAsB,IAAIC,EAIzC;AAAA,EACA,QAAQ,CAACC,GAAG,EAAE,WAAAC,EAAgB,MAAA,GAAGC,CAAW,aAAaD,CAAS;AACpE,CAAC;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, Fragment as
|
|
2
|
-
import { useRef as m, useCallback as
|
|
1
|
+
import { jsx as e, Fragment as S, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as m, useCallback as k } from "react";
|
|
3
3
|
import B from "../../../../../assets/line-icons/icons/circle-back.js";
|
|
4
4
|
import { LOTTIE as R } from "../../../../../assets/lottie/lottie.js";
|
|
5
5
|
import A from "../../../../ui/lottie-animation/lottie-animation.js";
|
|
6
6
|
import I from "../../../../ui/text/text.js";
|
|
7
|
-
import { BackgroundImage as P, ScreenWrapper as b, TransparentIconButton as L, CircularStepsContainer as T, CircularStepsWrapper as
|
|
8
|
-
import { TOTAL_FRAMES as
|
|
7
|
+
import { BackgroundImage as P, ScreenWrapper as b, TransparentIconButton as L, CircularStepsContainer as T, CircularStepsWrapper as $, CustEleContainer as q, CircularProgressContainer as v, CircularProgress as w, Label as F, CustomDataContainer as M } from "./circular-steps-styled.js";
|
|
8
|
+
import { TOTAL_FRAMES as W } from "./constants.js";
|
|
9
9
|
const j = ({ img: n }) => /* @__PURE__ */ e(P, { children: n }), x = {
|
|
10
10
|
autoplay: !1,
|
|
11
11
|
loop: !1,
|
|
@@ -14,18 +14,18 @@ const j = ({ img: n }) => /* @__PURE__ */ e(P, { children: n }), x = {
|
|
|
14
14
|
const { width: s, height: u } = d, r = n[t], l = m(null), a = m(-1), g = () => {
|
|
15
15
|
var o, i;
|
|
16
16
|
(i = (o = n[t]) == null ? void 0 : o.onBack) == null || i.call(o);
|
|
17
|
-
}, h =
|
|
17
|
+
}, h = k(() => {
|
|
18
18
|
if (l.current && (r != null && r.isProgressAnimationRequired)) {
|
|
19
|
-
const o = n.filter((E) => E.isProgressAnimationRequired), i =
|
|
19
|
+
const o = n.filter((E) => E.isProgressAnimationRequired), i = W / o.length, p = a.current >= 0 ? a.current : 0, f = Math.round(p * i + 1), C = Math.round(t * i);
|
|
20
20
|
a.current = t, l.current.playSegments([f, C], !0);
|
|
21
21
|
}
|
|
22
22
|
}, [t, r == null ? void 0 : r.isProgressAnimationRequired, n]);
|
|
23
|
-
return /* @__PURE__ */ e(
|
|
23
|
+
return /* @__PURE__ */ e(S, { children: r ? /* @__PURE__ */ c(b, { width: s, height: u, children: [
|
|
24
24
|
r.onBack ? /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(B, { onClick: g }) }) : null,
|
|
25
25
|
r.background ? /* @__PURE__ */ e(j, { img: r.background }) : null,
|
|
26
|
-
/* @__PURE__ */ e(T, { children: /* @__PURE__ */ c(
|
|
27
|
-
r.custEle ? /* @__PURE__ */ e(
|
|
28
|
-
r.custEleInsideStep ? /* @__PURE__ */ c(
|
|
26
|
+
/* @__PURE__ */ e(T, { children: /* @__PURE__ */ c($, { children: [
|
|
27
|
+
r.custEle ? /* @__PURE__ */ e(q, { children: r.custEle }) : null,
|
|
28
|
+
r.custEleInsideStep ? /* @__PURE__ */ c(v, { width: s, height: u, children: [
|
|
29
29
|
r.isProgressAnimationRequired ? /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(
|
|
30
30
|
A,
|
|
31
31
|
{
|
|
@@ -35,11 +35,11 @@ const j = ({ img: n }) => /* @__PURE__ */ e(P, { children: n }), x = {
|
|
|
35
35
|
onRender: h
|
|
36
36
|
}
|
|
37
37
|
) }) : null,
|
|
38
|
-
r.label ? /* @__PURE__ */ e(
|
|
38
|
+
r.label ? /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(I, { $renderAs: "ab2", $align: "center", $color: "WHITE", $whiteSpace: "pre", children: r.label }) }) : null,
|
|
39
39
|
r.custEleInsideStep
|
|
40
40
|
] }) : null
|
|
41
41
|
] }) }),
|
|
42
|
-
r.custEleBelowStep ? /* @__PURE__ */ e(
|
|
42
|
+
r.custEleBelowStep ? /* @__PURE__ */ e(M, { children: r.custEleBelowStep }) : null
|
|
43
43
|
] }) : null });
|
|
44
44
|
};
|
|
45
45
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circular-steps.js","sources":["../../../../../../src/features/circle-games/sign-up/comp/circular-steps/circular-steps.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../../ui/lottie-animation/types';\nimport type { ICircularStepsProps } from './circular-steps-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useRef } from 'react';\n\nimport CircleBackIcon from '../../../../../assets/line-icons/icons/circle-back';\nimport { LOTTIE } from '../../../../../assets/lottie/lottie';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Text from '../../../../ui/text/text';\nimport * as Styled from './circular-steps-styled';\nimport { TOTAL_FRAMES } from './constants';\n\nexport const BackgroundImage = ({ img }: { img: React.ReactNode }) => {\n return <Styled.BackgroundImage>{img}</Styled.BackgroundImage>;\n};\n\nconst animationSettings = {\n autoplay: false,\n loop: false,\n renderer: 'canvas',\n};\n\nexport const CircularSteps: FC<ICircularStepsProps> = ({ steps, currentStepIndex, dimensions }) => {\n const { width, height } = dimensions;\n\n const step = steps[currentStepIndex];\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const previousStepIndex = useRef<number>(-1);\n\n const handleBack = () => {\n steps[currentStepIndex]?.onBack?.();\n };\n\n const onLottieRender = useCallback(() => {\n if (animationRef.current && step?.isProgressAnimationRequired) {\n const actualSteps = steps.filter(_step => _step.isProgressAnimationRequired);\n const stepSize = TOTAL_FRAMES / actualSteps.length;\n\n const validPreviousIndex = previousStepIndex.current >= 0 ? previousStepIndex.current : 0;\n\n const fromFrame = Math.round(validPreviousIndex * stepSize + 1);\n const toFrame = Math.round(currentStepIndex * stepSize);\n\n previousStepIndex.current = currentStepIndex;\n animationRef.current.playSegments([fromFrame, toFrame], true);\n }\n }, [currentStepIndex, step?.isProgressAnimationRequired, steps]);\n\n return (\n <>\n {step ? (\n <Styled.ScreenWrapper width={width} height={height}>\n {step.onBack ? (\n <Styled.TransparentIconButton>\n <CircleBackIcon onClick={handleBack} />\n </Styled.TransparentIconButton>\n ) : null}\n {step.background ? <BackgroundImage img={step.background} /> : null}\n <Styled.CircularStepsContainer>\n <Styled.CircularStepsWrapper>\n {step.custEle ? (\n <Styled.CustEleContainer>{step.custEle}</Styled.CustEleContainer>\n ) : null}\n\n {/*circular data container*/}\n {step.custEleInsideStep ? (\n <Styled.CircularProgressContainer width={width} height={height}>\n {step.isProgressAnimationRequired ? (\n <Styled.CircularProgress>\n <LottieAnimation\n ref={animationRef}\n src={LOTTIE.LEVELUP_RINGS}\n settings={animationSettings}\n onRender={onLottieRender}\n />\n </Styled.CircularProgress>\n ) : null}\n\n {step.label ? (\n <Styled.Label>\n <Text $renderAs=\"ab2\" $color=\"WHITE\">\n {step.label}\n </Text>\n </Styled.Label>\n ) : null}\n {step.custEleInsideStep}\n </Styled.CircularProgressContainer>\n ) : null}\n </Styled.CircularStepsWrapper>\n </Styled.CircularStepsContainer>\n {/* custom data container below circle */}\n {step.custEleBelowStep ? (\n <Styled.CustomDataContainer>{step.custEleBelowStep}</Styled.CustomDataContainer>\n ) : null}\n </Styled.ScreenWrapper>\n ) : null}\n </>\n );\n};\n"],"names":["BackgroundImage","img","jsx","Styled.BackgroundImage","animationSettings","CircularSteps","steps","currentStepIndex","dimensions","width","height","step","animationRef","useRef","previousStepIndex","handleBack","_b","_a","onLottieRender","useCallback","actualSteps","_step","stepSize","TOTAL_FRAMES","validPreviousIndex","fromFrame","toFrame","jsxs","Styled.ScreenWrapper","Styled.TransparentIconButton","CircleBackIcon","Styled.CircularStepsContainer","Styled.CircularStepsWrapper","Styled.CustEleContainer","Styled.CircularProgressContainer","Styled.CircularProgress","LottieAnimation","LOTTIE","Styled.Label","Text","Styled.CustomDataContainer"],"mappings":";;;;;;;;AAaO,MAAMA,IAAkB,CAAC,EAAE,KAAAC,QACxB,gBAAAC,EAAAC,GAAA,EAAwB,UAAIF,EAAA,CAAA,GAGhCG,IAAoB;AAAA,EACxB,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AACZ,GAEaC,IAAyC,CAAC,EAAE,OAAAC,GAAO,kBAAAC,GAAkB,YAAAC,QAAiB;AAC3F,QAAA,EAAE,OAAAC,GAAO,QAAAC,EAAW,IAAAF,GAEpBG,IAAOL,EAAMC,CAAgB,GAC7BK,IAAeC,EAAmC,IAAI,GACtDC,IAAoBD,EAAe,EAAE,GAErCE,IAAa,MAAM;;AACjB,KAAAC,KAAAC,IAAAX,EAAAC,CAAgB,MAAhB,gBAAAU,EAAmB,WAAnB,QAAAD,EAAA,KAAAC;AAAA,EAA4B,GAG9BC,IAAiBC,EAAY,MAAM;AACnC,QAAAP,EAAa,YAAWD,KAAA,QAAAA,EAAM,8BAA6B;AAC7D,YAAMS,IAAcd,EAAM,OAAO,CAAAe,MAASA,EAAM,2BAA2B,GACrEC,IAAWC,IAAeH,EAAY,QAEtCI,IAAqBV,EAAkB,WAAW,IAAIA,EAAkB,UAAU,GAElFW,IAAY,KAAK,MAAMD,IAAqBF,IAAW,CAAC,GACxDI,IAAU,KAAK,MAAMnB,IAAmBe,CAAQ;AAEtD,MAAAR,EAAkB,UAAUP,GAC5BK,EAAa,QAAQ,aAAa,CAACa,GAAWC,CAAO,GAAG,EAAI;AAAA,IAC9D;AAAA,KACC,CAACnB,GAAkBI,KAAA,gBAAAA,EAAM,6BAA6BL,CAAK,CAAC;AAE/D,gCAEK,UACCK,IAAA,gBAAAgB,EAACC,GAAA,EAAqB,OAAAnB,GAAc,QAAAC,GACjC,UAAA;AAAA,IAAKC,EAAA,SACH,gBAAAT,EAAA2B,GAAA,EACC,4BAACC,GAAe,EAAA,SAASf,GAAY,EAAA,CACvC,IACE;AAAA,IACHJ,EAAK,aAAa,gBAAAT,EAACF,KAAgB,KAAKW,EAAK,WAAY,CAAA,IAAK;AAAA,sBAC9DoB,GAAA,EACC,UAAC,gBAAAJ,EAAAK,GAAA,EACE,UAAA;AAAA,MAAArB,EAAK,UACH,gBAAAT,EAAA+B,GAAA,EAAyB,UAAAtB,EAAK,QAAQ,CAAA,IACrC;AAAA,MAGHA,EAAK,oBACJ,gBAAAgB,EAACO,GAAA,EAAiC,OAAAzB,GAAc,QAAAC,GAC7C,UAAA;AAAA,QAAAC,EAAK,8BACJ,gBAAAT,EAACiC,GAAA,EACC,UAAA,gBAAAjC;AAAA,UAACkC;AAAA,UAAA;AAAA,YACC,KAAKxB;AAAA,YACL,KAAKyB,EAAO;AAAA,YACZ,UAAUjC;AAAA,YACV,UAAUc;AAAA,UAAA;AAAA,WAEd,IACE;AAAA,QAEHP,EAAK,
|
|
1
|
+
{"version":3,"file":"circular-steps.js","sources":["../../../../../../src/features/circle-games/sign-up/comp/circular-steps/circular-steps.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../../ui/lottie-animation/types';\nimport type { ICircularStepsProps } from './circular-steps-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useRef } from 'react';\n\nimport CircleBackIcon from '../../../../../assets/line-icons/icons/circle-back';\nimport { LOTTIE } from '../../../../../assets/lottie/lottie';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Text from '../../../../ui/text/text';\nimport * as Styled from './circular-steps-styled';\nimport { TOTAL_FRAMES } from './constants';\n\nexport const BackgroundImage = ({ img }: { img: React.ReactNode }) => {\n return <Styled.BackgroundImage>{img}</Styled.BackgroundImage>;\n};\n\nconst animationSettings = {\n autoplay: false,\n loop: false,\n renderer: 'canvas',\n};\n\nexport const CircularSteps: FC<ICircularStepsProps> = ({ steps, currentStepIndex, dimensions }) => {\n const { width, height } = dimensions;\n\n const step = steps[currentStepIndex];\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const previousStepIndex = useRef<number>(-1);\n\n const handleBack = () => {\n steps[currentStepIndex]?.onBack?.();\n };\n\n const onLottieRender = useCallback(() => {\n if (animationRef.current && step?.isProgressAnimationRequired) {\n const actualSteps = steps.filter(_step => _step.isProgressAnimationRequired);\n const stepSize = TOTAL_FRAMES / actualSteps.length;\n\n const validPreviousIndex = previousStepIndex.current >= 0 ? previousStepIndex.current : 0;\n\n const fromFrame = Math.round(validPreviousIndex * stepSize + 1);\n const toFrame = Math.round(currentStepIndex * stepSize);\n\n previousStepIndex.current = currentStepIndex;\n animationRef.current.playSegments([fromFrame, toFrame], true);\n }\n }, [currentStepIndex, step?.isProgressAnimationRequired, steps]);\n\n return (\n <>\n {step ? (\n <Styled.ScreenWrapper width={width} height={height}>\n {step.onBack ? (\n <Styled.TransparentIconButton>\n <CircleBackIcon onClick={handleBack} />\n </Styled.TransparentIconButton>\n ) : null}\n {step.background ? <BackgroundImage img={step.background} /> : null}\n <Styled.CircularStepsContainer>\n <Styled.CircularStepsWrapper>\n {step.custEle ? (\n <Styled.CustEleContainer>{step.custEle}</Styled.CustEleContainer>\n ) : null}\n\n {/*circular data container*/}\n {step.custEleInsideStep ? (\n <Styled.CircularProgressContainer width={width} height={height}>\n {step.isProgressAnimationRequired ? (\n <Styled.CircularProgress>\n <LottieAnimation\n ref={animationRef}\n src={LOTTIE.LEVELUP_RINGS}\n settings={animationSettings}\n onRender={onLottieRender}\n />\n </Styled.CircularProgress>\n ) : null}\n\n {step.label ? (\n <Styled.Label>\n <Text $renderAs=\"ab2\" $align=\"center\" $color=\"WHITE\" $whiteSpace=\"pre\">\n {step.label}\n </Text>\n </Styled.Label>\n ) : null}\n {step.custEleInsideStep}\n </Styled.CircularProgressContainer>\n ) : null}\n </Styled.CircularStepsWrapper>\n </Styled.CircularStepsContainer>\n {/* custom data container below circle */}\n {step.custEleBelowStep ? (\n <Styled.CustomDataContainer>{step.custEleBelowStep}</Styled.CustomDataContainer>\n ) : null}\n </Styled.ScreenWrapper>\n ) : null}\n </>\n );\n};\n"],"names":["BackgroundImage","img","jsx","Styled.BackgroundImage","animationSettings","CircularSteps","steps","currentStepIndex","dimensions","width","height","step","animationRef","useRef","previousStepIndex","handleBack","_b","_a","onLottieRender","useCallback","actualSteps","_step","stepSize","TOTAL_FRAMES","validPreviousIndex","fromFrame","toFrame","jsxs","Styled.ScreenWrapper","Styled.TransparentIconButton","CircleBackIcon","Styled.CircularStepsContainer","Styled.CircularStepsWrapper","Styled.CustEleContainer","Styled.CircularProgressContainer","Styled.CircularProgress","LottieAnimation","LOTTIE","Styled.Label","Text","Styled.CustomDataContainer"],"mappings":";;;;;;;;AAaO,MAAMA,IAAkB,CAAC,EAAE,KAAAC,QACxB,gBAAAC,EAAAC,GAAA,EAAwB,UAAIF,EAAA,CAAA,GAGhCG,IAAoB;AAAA,EACxB,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AACZ,GAEaC,IAAyC,CAAC,EAAE,OAAAC,GAAO,kBAAAC,GAAkB,YAAAC,QAAiB;AAC3F,QAAA,EAAE,OAAAC,GAAO,QAAAC,EAAW,IAAAF,GAEpBG,IAAOL,EAAMC,CAAgB,GAC7BK,IAAeC,EAAmC,IAAI,GACtDC,IAAoBD,EAAe,EAAE,GAErCE,IAAa,MAAM;;AACjB,KAAAC,KAAAC,IAAAX,EAAAC,CAAgB,MAAhB,gBAAAU,EAAmB,WAAnB,QAAAD,EAAA,KAAAC;AAAA,EAA4B,GAG9BC,IAAiBC,EAAY,MAAM;AACnC,QAAAP,EAAa,YAAWD,KAAA,QAAAA,EAAM,8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,aAAY,OAC9D,UAAK5B,EAAA,MAAA,CACR,EACF,CAAA,IACE;AAAA,QACHA,EAAK;AAAA,MAAA,EAAA,CACR,IACE;AAAA,IAAA,EAAA,CACN,EACF,CAAA;AAAA,IAECA,EAAK,mBACH,gBAAAT,EAAAsC,GAAA,EAA4B,UAAA7B,EAAK,iBAAiB,CAAA,IACjD;AAAA,EAAA,GACN,IACE,KACN,CAAA;AAEJ;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useCallback as l, useMemo as m } from "react";
|
|
2
|
+
import { useUpdateUsernamePost as c } from "../../api/use-update-username-api/use-update-username-api.js";
|
|
3
|
+
const d = (u) => {
|
|
4
|
+
const {
|
|
5
|
+
post: r,
|
|
6
|
+
isProcessing: t,
|
|
7
|
+
...s
|
|
8
|
+
} = c({
|
|
9
|
+
onComplete(n, e) {
|
|
10
|
+
let o = null;
|
|
11
|
+
e && (o = {
|
|
12
|
+
username: e.username
|
|
13
|
+
}), u(o);
|
|
14
|
+
}
|
|
15
|
+
}), a = l(
|
|
16
|
+
({ username: n, studentId: e }) => {
|
|
17
|
+
r(
|
|
18
|
+
{
|
|
19
|
+
username: n,
|
|
20
|
+
create_circle_profile_only: !0
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
studentId: e
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
[r]
|
|
28
|
+
);
|
|
29
|
+
return m(() => ({
|
|
30
|
+
updateUsername: a,
|
|
31
|
+
isProcessing: t,
|
|
32
|
+
...s
|
|
33
|
+
}), [a, t, s]);
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
d as useUpdateUsernameDal
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=update-username-dal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-username-dal.js","sources":["../../../../../../src/features/circle-games/sign-up/dal/update-username-dal/update-username-dal.ts"],"sourcesContent":["import type { IUpdateUsernameResponse } from '../../api/use-update-username-api/use-update-username-api-types';\n\nimport { useCallback, useMemo } from 'react';\n\nimport { useUpdateUsernamePost } from '../../api/use-update-username-api/use-update-username-api';\n\nexport const useUpdateUsernameDal = (\n onCompleted: (data: IUpdateUsernameResponse | null) => void,\n) => {\n const {\n post: updateUsernamePost,\n isProcessing,\n ...rest\n } = useUpdateUsernamePost({\n onComplete(_, response) {\n let data: IUpdateUsernameResponse | null = null;\n\n if (response) {\n data = {\n username: response.username,\n };\n }\n\n onCompleted(data);\n },\n });\n\n const updateUsername = useCallback(\n ({ username, studentId }: { username: string; studentId: string }) => {\n updateUsernamePost(\n {\n username: username,\n create_circle_profile_only: true,\n },\n {\n studentId,\n },\n );\n },\n [updateUsernamePost],\n );\n\n const returnVal = useMemo(() => {\n return {\n updateUsername,\n isProcessing,\n ...rest,\n };\n }, [updateUsername, isProcessing, rest]);\n\n return returnVal;\n};\n"],"names":["useUpdateUsernameDal","onCompleted","updateUsernamePost","isProcessing","rest","useUpdateUsernamePost","_","response","data","updateUsername","useCallback","username","studentId","useMemo"],"mappings":";;AAMa,MAAAA,IAAuB,CAClCC,MACG;AACG,QAAA;AAAA,IACJ,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,GAAGC;AAAA,MACDC,EAAsB;AAAA,IACxB,WAAWC,GAAGC,GAAU;AACtB,UAAIC,IAAuC;AAE3C,MAAID,MACKC,IAAA;AAAA,QACL,UAAUD,EAAS;AAAA,MAAA,IAIvBN,EAAYO,CAAI;AAAA,IAClB;AAAA,EAAA,CACD,GAEKC,IAAiBC;AAAA,IACrB,CAAC,EAAE,UAAAC,GAAU,WAAAC,QAAyD;AACpE,MAAAV;AAAA,QACE;AAAA,UACE,UAAAS;AAAA,UACA,4BAA4B;AAAA,QAC9B;AAAA,QACA;AAAA,UACE,WAAAC;AAAA,QACF;AAAA,MAAA;AAAA,IAEJ;AAAA,IACA,CAACV,CAAkB;AAAA,EAAA;AAWd,SARWW,EAAQ,OACjB;AAAA,IACL,gBAAAJ;AAAA,IACA,cAAAN;AAAA,IACA,GAAGC;AAAA,EAAA,IAEJ,CAACK,GAAgBN,GAAcC,CAAI,CAAC;AAGzC;"}
|