@cuemath/leap 2.8.43-rj-1 → 2.8.43
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/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +13 -16
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js.map +1 -1
- package/dist/features/journey/use-journey/journey-context-provider.js +8 -10
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
@@ -1,17 +1,14 @@
|
|
1
|
-
import { useState as
|
2
|
-
import { useGetCircleHomeAPI as
|
1
|
+
import { useState as R, useCallback as p, useEffect as d } from "react";
|
2
|
+
import { useGetCircleHomeAPI as C } from "../../api/get-content-for-today/get-circle-home-api.js";
|
3
3
|
import { ProjectType as s } from "../../../games/web-view/enums/project-type-enum.js";
|
4
|
-
const
|
5
|
-
const [
|
6
|
-
(
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
},
|
13
|
-
[c, r, o]
|
14
|
-
);
|
4
|
+
const L = (r, o, c) => {
|
5
|
+
const [_, m] = R(null), { data: a, get: n, isProcessed: i, ...l } = C(), E = p(() => {
|
6
|
+
n("", {
|
7
|
+
user_id: r,
|
8
|
+
country_code: o,
|
9
|
+
grade: c
|
10
|
+
});
|
11
|
+
}, [n, r, o, c]);
|
15
12
|
return d(() => {
|
16
13
|
let e = null;
|
17
14
|
i && a && (e = {
|
@@ -87,10 +84,10 @@ const T = (r, o) => {
|
|
87
84
|
stars: t.stars
|
88
85
|
}))
|
89
86
|
}
|
90
|
-
})),
|
91
|
-
}, [a, i]), { data:
|
87
|
+
})), m(e);
|
88
|
+
}, [a, i]), { data: _, isProcessed: i, getCircleHomeDetails: E, ...l };
|
92
89
|
};
|
93
90
|
export {
|
94
|
-
|
91
|
+
L as useGetCircleHomeDetailsDal
|
95
92
|
};
|
96
93
|
//# sourceMappingURL=use-get-circle-home-details-dal.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type {\n ICircleHomeDetails,\n TStreakStatus,\n TTableMode,\n} from './use-get-circle-home-dal-types';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useGetCircleHomeAPI } from '../../api/get-content-for-today/get-circle-home-api';\n\nexport const useGetCircleHomeDetailsDal = (\n userId: string,\n grade: string,\n): Omit<ReturnType<typeof useGetCircleHomeAPI>, 'data' | 'get'> & {\n data: ICircleHomeDetails | null;\n getCircleHomeDetails: (
|
1
|
+
{"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type {\n ICircleHomeDetails,\n TStreakStatus,\n TTableMode,\n} from './use-get-circle-home-dal-types';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useGetCircleHomeAPI } from '../../api/get-content-for-today/get-circle-home-api';\n\nexport const useGetCircleHomeDetailsDal = (\n userId: string,\n countryCode: string,\n grade: string,\n): Omit<ReturnType<typeof useGetCircleHomeAPI>, 'data' | 'get'> & {\n data: ICircleHomeDetails | null;\n getCircleHomeDetails: () => void;\n} => {\n const [contentForToday, setContentForToday] = useState<ICircleHomeDetails | null>(null);\n const { data, get: getHomeDetails, isProcessed, ...rest } = useGetCircleHomeAPI();\n\n const getCircleHomeDetails = useCallback(() => {\n getHomeDetails('', {\n user_id: userId,\n country_code: countryCode,\n grade: grade,\n });\n }, [getHomeDetails, userId, countryCode, grade]);\n\n useEffect(() => {\n let circleHomeDetails: ICircleHomeDetails | null = null;\n\n if (isProcessed && data) {\n circleHomeDetails = {\n points: data.points,\n streakDays: data.streak_days,\n streakStatus: data.streak_status as TStreakStatus,\n tournamentRank: data.tournament_rank,\n projects: {\n games: {\n label: data.projects.games.label,\n type: ProjectType.GAME,\n initialProgressValue: 0,\n data: data.projects.games.data.map(game => ({\n id: game.id,\n name: game.name,\n cardLottie: game.card,\n tutorial: game.tutorial,\n variant: game.variant,\n isPlayed: game.played,\n })),\n },\n puzzles: {\n label: data.projects.puzzles.label,\n type: ProjectType.PUZZLE,\n initialProgressValue: 0,\n data: data.projects.puzzles.data.map(puzzle => ({\n id: puzzle.id,\n name: puzzle.name,\n cardLottie: puzzle.card,\n tutorial: puzzle.tutorial,\n variant: puzzle.variant,\n question: puzzle.question,\n isHintSeen: puzzle.is_hint_seen,\n solved: puzzle.solved,\n })),\n },\n },\n timestamps: {\n startTimestamp: data.timestamps.start_timestamp,\n endTimestamp: data.timestamps.end_timestamp,\n current: data.timestamps.current,\n },\n coachmarkProgress: {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY:\n data.coachmark_completion.CIRCLE_ACTIVITIES_INTRO_JOURNEY,\n CIRCLE_LEADERBOARD_INTRO_JOURNEY:\n data.coachmark_completion.CIRCLE_LEADERBOARD_INTRO_JOURNEY,\n CIRCLE_POINTS_REWARD_JOURNEY: data.coachmark_completion.CIRCLE_POINTS_REWARD_JOURNEY,\n CIRCLE_STREAK_UPDATE_JOURNEY: data.coachmark_completion.CIRCLE_STREAK_UPDATE_JOURNEY,\n CIRCLE_TUTORIAL_JOURNEY: data.coachmark_completion.CIRCLE_TUTORIAL_JOURNEY,\n CIRCLE_TABLES_INTRO_JOURNEY: data.coachmark_completion.CIRCLE_TABLES_INTRO_JOURNEY,\n },\n };\n\n if (data.projects.lessons) {\n circleHomeDetails.projects.lessons = {\n label: data.projects.lessons.label,\n type: ProjectType.LESSON,\n initialProgressValue: 0,\n data: data.projects.lessons.data.map(lesson => ({\n id: lesson.id,\n name: lesson.name,\n cardLottie: lesson.card,\n tutorial: lesson.tutorial,\n variant: lesson.variant,\n sessionId: lesson.session_id,\n miniGameIdentifier: lesson.mini_game_identifier,\n targetQuestions: lesson.target_questions,\n status: lesson.status,\n })),\n };\n }\n\n if (data.projects.tables) {\n circleHomeDetails.projects.tables = {\n label: data.projects.tables.label,\n type: ProjectType.TABLE,\n data: {\n infiniteModeHighScore: data.projects.tables.data.infinite_mode_high_score,\n tableList: data.projects.tables.data.table_wise_details.map(table => ({\n tableNumber: table.table_number,\n stars: table.stars as TTableMode[],\n })),\n },\n };\n }\n }\n setContentForToday(circleHomeDetails);\n }, [data, isProcessed]);\n\n return { data: contentForToday, isProcessed, getCircleHomeDetails, ...rest };\n};\n"],"names":["useGetCircleHomeDetailsDal","userId","countryCode","grade","contentForToday","setContentForToday","useState","data","getHomeDetails","isProcessed","rest","useGetCircleHomeAPI","getCircleHomeDetails","useCallback","useEffect","circleHomeDetails","ProjectType","game","puzzle","lesson","table"],"mappings":";;;AAWO,MAAMA,IAA6B,CACxCC,GACAC,GACAC,MAIG;AACH,QAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAAoC,IAAI,GAChF,EAAE,MAAAC,GAAM,KAAKC,GAAgB,aAAAC,GAAa,GAAGC,EAAA,IAASC,KAEtDC,IAAuBC,EAAY,MAAM;AAC7C,IAAAL,EAAe,IAAI;AAAA,MACjB,SAASP;AAAA,MACT,cAAcC;AAAA,MACd,OAAAC;AAAA,IAAA,CACD;AAAA,KACA,CAACK,GAAgBP,GAAQC,GAAaC,CAAK,CAAC;AAE/C,SAAAW,EAAU,MAAM;AACd,QAAIC,IAA+C;AAEnD,IAAIN,KAAeF,MACGQ,IAAA;AAAA,MAClB,QAAQR,EAAK;AAAA,MACb,YAAYA,EAAK;AAAA,MACjB,cAAcA,EAAK;AAAA,MACnB,gBAAgBA,EAAK;AAAA,M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,MAAMS,EAAY;AAAA,MAClB,sBAAsB;AAAA,MACtB,MAAMT,EAAK,SAAS,QAAQ,KAAK,IAAI,CAAWY,OAAA;AAAA,QAC9C,IAAIA,EAAO;AAAA,QACX,MAAMA,EAAO;AAAA,QACb,YAAYA,EAAO;AAAA,QACnB,UAAUA,EAAO;AAAA,QACjB,SAASA,EAAO;AAAA,QAChB,WAAWA,EAAO;AAAA,QAClB,oBAAoBA,EAAO;AAAA,QAC3B,iBAAiBA,EAAO;AAAA,QACxB,QAAQA,EAAO;AAAA,MAAA,EACf;AAAA,IAAA,IAIFZ,EAAK,SAAS,WAChBQ,EAAkB,SAAS,SAAS;AAAA,MAClC,OAAOR,EAAK,SAAS,OAAO;AAAA,MAC5B,MAAMS,EAAY;AAAA,MAClB,MAAM;AAAA,QACJ,uBAAuBT,EAAK,SAAS,OAAO,KAAK;AAAA,QACjD,WAAWA,EAAK,SAAS,OAAO,KAAK,mBAAmB,IAAI,CAAUa,OAAA;AAAA,UACpE,aAAaA,EAAM;AAAA,UACnB,OAAOA,EAAM;AAAA,QAAA,EACb;AAAA,MACJ;AAAA,IAAA,KAINf,EAAmBU,CAAiB;AAAA,EAAA,GACnC,CAACR,GAAME,CAAW,CAAC,GAEf,EAAE,MAAML,GAAiB,aAAAK,GAAa,sBAAAG,GAAsB,GAAGF;AACxE;"}
|
package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.ts"],"sourcesContent":["export const PUZZLE_CARD_INDEX = 2;\nexport const TABLE_CARD_INDEX = 3;\n\nexport const SHOW_INITIAL_COACHMARK_AFTER_MS = 500;\nexport const SHOW_INITIAL_TOOLTIP_AFTER_MS = 1500;\n\nexport const GO_TO_TABLE_LAUNCHER_DURATION_MS = 1000;\nexport const SHOW_CLICK_TABLE_NUDGE_AFTER_MS = 3000;\nexport const START_ANIMATING_CLONED_ELEM = SHOW_CLICK_TABLE_NUDGE_AFTER_MS + 100;\n\nexport const SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS =
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.ts"],"sourcesContent":["export const PUZZLE_CARD_INDEX = 2;\nexport const TABLE_CARD_INDEX = 3;\n\nexport const SHOW_INITIAL_COACHMARK_AFTER_MS = 500;\nexport const SHOW_INITIAL_TOOLTIP_AFTER_MS = 1500;\n\nexport const GO_TO_TABLE_LAUNCHER_DURATION_MS = 1000;\nexport const SHOW_CLICK_TABLE_NUDGE_AFTER_MS = 3000;\nexport const START_ANIMATING_CLONED_ELEM = SHOW_CLICK_TABLE_NUDGE_AFTER_MS + 100;\n\nexport const SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS = 100;\nexport const SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS = 3000;\n"],"names":["PUZZLE_CARD_INDEX","TABLE_CARD_INDEX","SHOW_INITIAL_COACHMARK_AFTER_MS","SHOW_INITIAL_TOOLTIP_AFTER_MS","GO_TO_TABLE_LAUNCHER_DURATION_MS","SHOW_CLICK_TABLE_NUDGE_AFTER_MS","START_ANIMATING_CLONED_ELEM","SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS","SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS"],"mappings":"AAAO,MAAMA,IAAoB,GACpBC,IAAmB,GAEnBC,IAAkC,KAClCC,IAAgC,MAEhCC,IAAmC,KACnCC,IAAkC,KAClCC,IAA8B,MAE9BC,IAAqC,KACrCC,IAAmC;"}
|
@@ -2,7 +2,7 @@ import { jsxs as v, jsx as J } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as x, useState as $, useRef as f, useCallback as i, useMemo as p } from "react";
|
3
3
|
import { Coachmark as g } from "../comps/coachmark/coachmark.js";
|
4
4
|
import { BlurOverlay as A } from "./journey-styled.js";
|
5
|
-
const
|
5
|
+
const R = x(null), j = ({ children: C }) => {
|
6
6
|
const [o, u] = $([]), c = f(-1), r = f(), l = i(
|
7
7
|
(e, t) => {
|
8
8
|
if (o.length > 0)
|
@@ -22,15 +22,13 @@ const E = x(null), j = ({ children: C }) => {
|
|
22
22
|
u((s) => [...s, t]);
|
23
23
|
}, []), d = i(
|
24
24
|
(e, t = !1, s = 0) => {
|
25
|
-
if (!r.current)
|
26
|
-
throw new Error("nextCoachmark was called before setJourney");
|
27
|
-
if (e !== r.current)
|
25
|
+
if (!r.current || e !== r.current)
|
28
26
|
throw new Error(
|
29
|
-
`A Journey is already active, Current Journey: ${r.current}, New Journey Request: ${e}`
|
27
|
+
r.current ? "nextCoachmark was called before setJourney" : `A Journey is already active, Current Journey: ${r.current}, New Journey Request: ${e}`
|
30
28
|
);
|
31
29
|
s !== 0 && u((n) => n.map((a) => ({ ...a, isActive: !1 })));
|
32
|
-
const
|
33
|
-
clearTimeout(
|
30
|
+
const w = setTimeout(() => {
|
31
|
+
clearTimeout(w);
|
34
32
|
const n = c.current + 1;
|
35
33
|
u((a) => {
|
36
34
|
if (n >= a.length || a.length === 0)
|
@@ -42,7 +40,7 @@ const E = x(null), j = ({ children: C }) => {
|
|
42
40
|
}, s);
|
43
41
|
},
|
44
42
|
[]
|
45
|
-
),
|
43
|
+
), k = p(
|
46
44
|
() => ({
|
47
45
|
nextCoachmark: d,
|
48
46
|
setJourney: l,
|
@@ -52,13 +50,13 @@ const E = x(null), j = ({ children: C }) => {
|
|
52
50
|
}),
|
53
51
|
[d, l, y, h, o]
|
54
52
|
);
|
55
|
-
return /* @__PURE__ */ v(
|
53
|
+
return /* @__PURE__ */ v(R.Provider, { value: k, children: [
|
56
54
|
o.length > 0 && /* @__PURE__ */ J(A, { children: o.map((e, t) => /* @__PURE__ */ J(g, { coachmark: e }, `coachmark-${t}`)) }),
|
57
55
|
C
|
58
56
|
] });
|
59
57
|
};
|
60
58
|
export {
|
61
|
-
|
59
|
+
R as JourneyContext,
|
62
60
|
j as JourneyProvider
|
63
61
|
};
|
64
62
|
//# sourceMappingURL=journey-context-provider.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"journey-context-provider.js","sources":["../../../../src/features/journey/use-journey/journey-context-provider.tsx"],"sourcesContent":["import type { TJourneyId } from '../journey-id/journey-id-types';\nimport type { ICoachmarkProps, IJourneyContext } from './journey-context-types';\nimport type { FC, ReactNode } from 'react';\n\nimport { createContext, useCallback, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport * as S from './journey-styled';\n\nexport const JourneyContext = createContext<IJourneyContext | null>(null);\n\nexport const JourneyProvider: FC<{ children: ReactNode }> = ({ children }) => {\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const currentIndex = useRef(-1);\n const currentJourneyIdStudent = useRef<TJourneyId | undefined>();\n\n const setJourney = useCallback(\n (id: TJourneyId, coachmarks: ICoachmarkProps[]) => {\n if (coachmarkList.length > 0) {\n throw new Error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyIdStudent.current}, New Journey Request: ${id}`,\n );\n }\n currentJourneyIdStudent.current = id;\n currentIndex.current = -1;\n setCoachmarkList([...coachmarks]);\n },\n [coachmarkList.length],\n );\n\n const clearJourney = useCallback(() => {\n currentJourneyIdStudent.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n }, []);\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: ICoachmarkProps) => {\n if (!currentJourneyIdStudent.current || id !== currentJourneyIdStudent.current) {\n throw new Error(\n currentJourneyIdStudent.current\n ? `addCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyIdStudent.current}, New Journey Request: ${id}`,\n );\n }\n\n setCoachmarkList(prev => [...prev, coachmark]);\n }, []);\n\n const nextCoachmark = useCallback(\n (id: TJourneyId, keepPrevActive: boolean = false, delayInMs: number = 0) => {\n if (!currentJourneyIdStudent.current
|
1
|
+
{"version":3,"file":"journey-context-provider.js","sources":["../../../../src/features/journey/use-journey/journey-context-provider.tsx"],"sourcesContent":["import type { TJourneyId } from '../journey-id/journey-id-types';\nimport type { ICoachmarkProps, IJourneyContext } from './journey-context-types';\nimport type { FC, ReactNode } from 'react';\n\nimport { createContext, useCallback, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport * as S from './journey-styled';\n\nexport const JourneyContext = createContext<IJourneyContext | null>(null);\n\nexport const JourneyProvider: FC<{ children: ReactNode }> = ({ children }) => {\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const currentIndex = useRef(-1);\n const currentJourneyIdStudent = useRef<TJourneyId | undefined>();\n\n const setJourney = useCallback(\n (id: TJourneyId, coachmarks: ICoachmarkProps[]) => {\n if (coachmarkList.length > 0) {\n throw new Error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyIdStudent.current}, New Journey Request: ${id}`,\n );\n }\n currentJourneyIdStudent.current = id;\n currentIndex.current = -1;\n setCoachmarkList([...coachmarks]);\n },\n [coachmarkList.length],\n );\n\n const clearJourney = useCallback(() => {\n currentJourneyIdStudent.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n }, []);\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: ICoachmarkProps) => {\n if (!currentJourneyIdStudent.current || id !== currentJourneyIdStudent.current) {\n throw new Error(\n currentJourneyIdStudent.current\n ? `addCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyIdStudent.current}, New Journey Request: ${id}`,\n );\n }\n\n setCoachmarkList(prev => [...prev, coachmark]);\n }, []);\n\n const nextCoachmark = useCallback(\n (id: TJourneyId, keepPrevActive: boolean = false, delayInMs: number = 0) => {\n if (!currentJourneyIdStudent.current || id !== currentJourneyIdStudent.current) {\n throw new Error(\n currentJourneyIdStudent.current\n ? `nextCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyIdStudent.current}, New Journey Request: ${id}`,\n );\n }\n\n if (delayInMs !== 0) {\n // If delay is not 0, we will hide all them coachmarks and reveal only after the delay\n setCoachmarkList(prevList => {\n return prevList.map((item: ICoachmarkProps) => {\n return { ...item, isActive: false };\n });\n });\n }\n\n const timer = setTimeout(() => {\n clearTimeout(timer);\n const currIndex = currentIndex.current + 1;\n\n setCoachmarkList(prevList => {\n // Finish onboarding\n if (currIndex >= prevList.length || prevList.length === 0) {\n currentJourneyIdStudent.current = undefined;\n currentIndex.current = -1;\n\n return [];\n }\n\n currentIndex.current = currIndex;\n const updatedCoachmarkList = [...prevList];\n\n (updatedCoachmarkList[currIndex] as ICoachmarkProps).isActive = true;\n\n if (currIndex > 0) {\n (updatedCoachmarkList[currIndex - 1] as ICoachmarkProps).isActive = keepPrevActive;\n }\n\n return updatedCoachmarkList;\n });\n }, delayInMs);\n },\n [],\n );\n\n const memoizedContextValue = useMemo(\n () => ({\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n coachmarks: coachmarkList,\n }),\n [nextCoachmark, setJourney, addCoachmark, clearJourney, coachmarkList],\n );\n\n return (\n <JourneyContext.Provider value={memoizedContextValue}>\n {coachmarkList.length > 0 && (\n <S.BlurOverlay>\n {coachmarkList.map((coachmark, index) => (\n <Coachmark key={`coachmark-${index}`} coachmark={coachmark} />\n ))}\n </S.BlurOverlay>\n )}\n {children}\n </JourneyContext.Provider>\n );\n};\n"],"names":["JourneyContext","createContext","JourneyProvider","children","coachmarkList","setCoachmarkList","useState","currentIndex","useRef","currentJourneyIdStudent","setJourney","useCallback","id","coachmarks","clearJourney","addCoachmark","coachmark","prev","nextCoachmark","keepPrevActive","delayInMs","prevList","item","timer","currIndex","updatedCoachmarkList","memoizedContextValue","useMemo","jsxs","jsx","S.BlurOverlay","index","Coachmark"],"mappings":";;;;AASa,MAAAA,IAAiBC,EAAsC,IAAI,GAE3DC,IAA+C,CAAC,EAAE,UAAAC,QAAe;AAC5E,QAAM,CAACC,GAAeC,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B,CAAYgB,MAAA;AAE3B,cAAIG,KAAaH,EAAS,UAAUA,EAAS,WAAW;AACtD,mBAAAZ,EAAwB,UAAU,QAClCF,EAAa,UAAU,IAEhB;AAGT,UAAAA,EAAa,UAAUiB;AACjB,gBAAAC,IAAuB,CAAC,GAAGJ,CAAQ;AAExC,iBAAAI,EAAqBD,CAAS,EAAsB,WAAW,IAE5DA,IAAY,MACbC,EAAqBD,IAAY,CAAC,EAAsB,WAAWL,IAG/DM;AAAA,QAAA,CACR;AAAA,SACAL,CAAS;AAAA,IACd;AAAA,IACA,CAAC;AAAA,EAAA,GAGGM,IAAuBC;AAAA,IAC3B,OAAO;AAAA,MACL,eAAAT;AAAA,MACA,YAAAR;AAAA,MACA,cAAAK;AAAA,MACA,cAAAD;AAAA,MACA,YAAYV;AAAA,IAAA;AAAA,IAEd,CAACc,GAAeR,GAAYK,GAAcD,GAAcV,CAAa;AAAA,EAAA;AAGvE,SACG,gBAAAwB,EAAA5B,EAAe,UAAf,EAAwB,OAAO0B,GAC7B,UAAA;AAAA,IAAAtB,EAAc,SAAS,KACtB,gBAAAyB,EAACC,GAAA,EACE,YAAc,IAAI,CAACd,GAAWe,wBAC5BC,GAAqC,EAAA,WAAAhB,EAAA,GAAtB,aAAae,CAAK,EAA0B,CAC7D,GACH;AAAA,IAED5B;AAAA,EACH,EAAA,CAAA;AAEJ;"}
|
package/dist/index.d.ts
CHANGED
@@ -4910,9 +4910,9 @@ declare const useGetCircleHomeAPI: (initialId?: string, initialQuery?: IGetCircl
|
|
4910
4910
|
} & Record<string, unknown>) | undefined;
|
4911
4911
|
};
|
4912
4912
|
|
4913
|
-
export declare const useGetCircleHomeDetailsDal: (userId: string, grade: string) => Omit<ReturnType<typeof useGetCircleHomeAPI>, "data" | "get"> & {
|
4913
|
+
export declare const useGetCircleHomeDetailsDal: (userId: string, countryCode: string, grade: string) => Omit<ReturnType<typeof useGetCircleHomeAPI>, "data" | "get"> & {
|
4914
4914
|
data: ICircleHomeDetails | null;
|
4915
|
-
getCircleHomeDetails: (
|
4915
|
+
getCircleHomeDetails: () => void;
|
4916
4916
|
};
|
4917
4917
|
|
4918
4918
|
declare const useGetLeaderboard: (initialId?: string, initialQuery?: IGetLeaderboardPayloadModel | undefined) => {
|