@cuemath/leap 3.5.63 → 3.5.64
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/timeline/daily-timeline/daily-timeline.js +50 -59
- package/dist/features/timeline/daily-timeline/daily-timeline.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report.js +39 -40
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js +33 -33
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/ptm-report/ptm-report.js +63 -63
- package/dist/features/timeline/monthly-timeline/ptm-report/ptm-report.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +7 -0
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +3 -2
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +6 -10
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +12 -9
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/package.json +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +0 -5
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +0 -8
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +0 -1
|
@@ -1,100 +1,91 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { useDailyTimelineGet as
|
|
4
|
-
import { ScrollWrapper as
|
|
5
|
-
import { USER_TYPE as k, CARD_TYPE as
|
|
1
|
+
import { jsx as n, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import { memo as Y, useState as M, useCallback as u, useMemo as $, useEffect as m, Fragment as F } from "react";
|
|
3
|
+
import { useDailyTimelineGet as P } from "./api/use-daily-timeline-get.js";
|
|
4
|
+
import { ScrollWrapper as V, DailyTimelineContainer as j } from "./daily-timeline-styled.js";
|
|
5
|
+
import { USER_TYPE as k, CARD_TYPE as C } from "./daily-timeline-types.js";
|
|
6
6
|
import { INITIAL_PAGE as G } from "./comps/constants.js";
|
|
7
7
|
import { getTimezone as O } from "../../../helpers/date-time.js";
|
|
8
8
|
import { DAILY_TIMELINE_ANALYTICS_EVENTS as L } from "./daily-timeline-events.js";
|
|
9
9
|
import U from "./daily-timeline-view.js";
|
|
10
10
|
import { useUIContext as W } from "../../ui/context/context.js";
|
|
11
11
|
import b from "../../hooks/use-previous.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
const N = A(
|
|
12
|
+
import H from "../../ui/error/error.js";
|
|
13
|
+
import X from "../../ui/intersection-loader/intersection-loader.js";
|
|
14
|
+
import q from "../../ui/loader/app-loader/app-loader.js";
|
|
15
|
+
const z = Y(
|
|
17
16
|
({
|
|
18
17
|
userType: g,
|
|
19
18
|
studentId: i,
|
|
20
19
|
courseStreams: f,
|
|
21
|
-
onPuzzleClick:
|
|
22
|
-
onReviewClick:
|
|
23
|
-
scrollAreaHeight:
|
|
20
|
+
onPuzzleClick: N,
|
|
21
|
+
onReviewClick: v,
|
|
22
|
+
scrollAreaHeight: x,
|
|
24
23
|
onAPIComplete: l
|
|
25
24
|
}) => {
|
|
26
|
-
const [c, _] = M([]), [p,
|
|
27
|
-
get:
|
|
25
|
+
const [c, _] = M([]), [p, d] = M(!1), { onEvent: s } = W(), {
|
|
26
|
+
get: S,
|
|
28
27
|
data: e,
|
|
29
28
|
isProcessingFailed: E,
|
|
30
|
-
isProcessing:
|
|
31
|
-
isProcessed:
|
|
32
|
-
} =
|
|
29
|
+
isProcessing: A,
|
|
30
|
+
isProcessed: T
|
|
31
|
+
} = P(i), y = b(e == null ? void 0 : e.curr_page), a = u(
|
|
33
32
|
(r = G, o = !1) => {
|
|
34
|
-
o &&
|
|
33
|
+
o && d(!0), S(i, {
|
|
35
34
|
page: r,
|
|
36
35
|
timezone: O(),
|
|
37
36
|
course_stream: g === k.TEACHER ? f : []
|
|
38
37
|
});
|
|
39
38
|
},
|
|
40
|
-
[
|
|
41
|
-
),
|
|
39
|
+
[S, i, g, f]
|
|
40
|
+
), D = $(() => {
|
|
42
41
|
const r = /* @__PURE__ */ new Set();
|
|
43
|
-
c.forEach((
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
c.forEach((t) => {
|
|
43
|
+
t.daily_logs && t.daily_logs.forEach((h) => {
|
|
44
|
+
h.course_stream && h.course_stream !== C.CIRCLE && r.add(h.course_stream);
|
|
46
45
|
});
|
|
47
46
|
});
|
|
48
47
|
const o = new Set(
|
|
49
|
-
(f || []).filter((
|
|
48
|
+
(f || []).filter((t) => String(t) !== C.CIRCLE)
|
|
50
49
|
);
|
|
51
|
-
return o.size > 1 || r.size > 1 || o.size > 0 && r.size > 0 && (o.size !== r.size || !Array.from(o).every((
|
|
52
|
-
}, [c, f]),
|
|
53
|
-
e != null && e.next_page && !p && (
|
|
50
|
+
return o.size > 1 || r.size > 1 || o.size > 0 && r.size > 0 && (o.size !== r.size || !Array.from(o).every((t) => r.has(t)));
|
|
51
|
+
}, [c, f]), I = u(() => {
|
|
52
|
+
e != null && e.next_page && !p && (a(e.next_page, !0), s(L.TIMELINE_SCROLLED, {
|
|
54
53
|
student_id: i
|
|
55
54
|
}));
|
|
56
|
-
}, [e, i,
|
|
57
|
-
|
|
58
|
-
}, [
|
|
55
|
+
}, [e, i, s, p, a]), R = u(() => {
|
|
56
|
+
a(1, !1), _([]);
|
|
57
|
+
}, [a]);
|
|
59
58
|
return m(() => {
|
|
60
|
-
e && (e.curr_page === 1 ? _((e == null ? void 0 : e.user_logs) ?? []) : e.curr_page &&
|
|
61
|
-
}, [e,
|
|
62
|
-
|
|
59
|
+
e && (e.curr_page === 1 ? _((e == null ? void 0 : e.user_logs) ?? []) : e.curr_page && y !== e.curr_page && (_((r) => [...r, ...e.user_logs ?? []]), d(!1)));
|
|
60
|
+
}, [e, y]), m(() => {
|
|
61
|
+
s(L.TIMELINE_VIEWED, {
|
|
63
62
|
student_id: i
|
|
64
63
|
});
|
|
65
|
-
}, [i,
|
|
66
|
-
|
|
64
|
+
}, [i, s]), m(() => () => {
|
|
65
|
+
s(L.TIMELINE_CLOSED, {
|
|
67
66
|
student_id: i
|
|
68
67
|
});
|
|
69
|
-
}, [i,
|
|
70
|
-
|
|
71
|
-
}, [
|
|
72
|
-
(
|
|
73
|
-
}, [
|
|
74
|
-
|
|
75
|
-
{
|
|
76
|
-
$alignItems: "center",
|
|
77
|
-
$justifyContent: "center",
|
|
78
|
-
$height: y || "100vh",
|
|
79
|
-
children: /* @__PURE__ */ s(H, { width: "100%", height: "100%" })
|
|
80
|
-
}
|
|
81
|
-
) : /* @__PURE__ */ s(j, { $alignItems: "center", $gapX: 1, children: /* @__PURE__ */ R(P, { children: [
|
|
82
|
-
c.map((r, o) => /* @__PURE__ */ s(V, { children: /* @__PURE__ */ s(
|
|
68
|
+
}, [i, s]), m(() => {
|
|
69
|
+
a(1, !1);
|
|
70
|
+
}, [a]), m(() => {
|
|
71
|
+
(T || E) && (l == null || l(T && !E));
|
|
72
|
+
}, [T, E, l]), E ? /* @__PURE__ */ n(H, { height: x ?? "100dvh", onTryAgain: R }) : A && !c.length ? /* @__PURE__ */ n(q, { width: "100%", height: "100dvh" }) : /* @__PURE__ */ n(V, { $alignItems: "center", $gapX: 1, children: /* @__PURE__ */ w(j, { children: [
|
|
73
|
+
c.map((r, o) => /* @__PURE__ */ n(F, { children: /* @__PURE__ */ n(
|
|
83
74
|
U,
|
|
84
75
|
{
|
|
85
76
|
entry: r,
|
|
86
77
|
isFirstElement: o === 0,
|
|
87
|
-
shouldShowTag:
|
|
88
|
-
onPuzzleClick:
|
|
89
|
-
onReviewClick:
|
|
78
|
+
shouldShowTag: D,
|
|
79
|
+
onPuzzleClick: N,
|
|
80
|
+
onReviewClick: v,
|
|
90
81
|
userType: g,
|
|
91
82
|
studentId: i
|
|
92
83
|
}
|
|
93
84
|
) }, `timeline-entry-${o}`)),
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
|
|
85
|
+
/* @__PURE__ */ n(
|
|
86
|
+
X,
|
|
96
87
|
{
|
|
97
|
-
onLoadMore:
|
|
88
|
+
onLoadMore: I,
|
|
98
89
|
isLoading: p,
|
|
99
90
|
hasMore: !!(e != null && e.next_page)
|
|
100
91
|
}
|
|
@@ -102,9 +93,9 @@ const N = A(
|
|
|
102
93
|
] }) });
|
|
103
94
|
}
|
|
104
95
|
);
|
|
105
|
-
|
|
106
|
-
const
|
|
96
|
+
z.displayName = "DailyTimeline";
|
|
97
|
+
const fe = z;
|
|
107
98
|
export {
|
|
108
|
-
|
|
99
|
+
fe as default
|
|
109
100
|
};
|
|
110
101
|
//# sourceMappingURL=daily-timeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daily-timeline.js","sources":["../../../../src/features/timeline/daily-timeline/daily-timeline.tsx"],"sourcesContent":["import { Fragment, memo, useCallback, useEffect, useMemo, useState, type FC } from 'react';\n\nimport { type ITimelineData, useDailyTimelineGet } from './api/use-daily-timeline-get';\nimport * as Styled from './daily-timeline-styled';\nimport { CARD_TYPE, USER_TYPE, type IDailyTimelineProps } from './daily-timeline-types';\nimport { INITIAL_PAGE } from './comps/constants';\nimport { getTimezone } from '../../../helpers/date-time';\nimport { DAILY_TIMELINE_ANALYTICS_EVENTS } from './daily-timeline-events';\nimport DailyTimelineView from './daily-timeline-view';\nimport { useUIContext } from '../../ui/context/context';\nimport usePrevious from '../../hooks/use-previous';\nimport Error from '../../ui/error/error';\nimport FlexView from '../../ui/layout/flex-view';\nimport IntersectionLoader from '../../ui/intersection-loader/intersection-loader';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\n\nconst DailyTimeline: FC<IDailyTimelineProps> = memo(\n ({\n userType,\n studentId,\n courseStreams,\n onPuzzleClick,\n onReviewClick,\n scrollAreaHeight,\n onAPIComplete,\n }) => {\n const [allTimelineData, setAllTimelineData] = useState<ITimelineData[]>([]);\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n const { onEvent: trackEvent } = useUIContext();\n const {\n get: getTimeline,\n data: timelineData,\n isProcessingFailed,\n isProcessing,\n isProcessed,\n } = useDailyTimelineGet(studentId);\n\n const prevCurrentPage = usePrevious(timelineData?.curr_page);\n\n const fetchTimeline = useCallback(\n (page = INITIAL_PAGE, append = false) => {\n if (append) {\n setIsLoadingMore(true);\n }\n\n getTimeline(studentId, {\n page,\n timezone: getTimezone(),\n course_stream: userType === USER_TYPE.TEACHER ? courseStreams : [],\n });\n },\n [getTimeline, studentId, userType, courseStreams],\n );\n\n const shouldShowTag = useMemo(() => {\n const allCourseStreams = new Set<string>();\n\n allTimelineData.forEach(entry => {\n if (entry.daily_logs) {\n entry.daily_logs.forEach(log => {\n if (log.course_stream && log.course_stream !== CARD_TYPE.CIRCLE) {\n allCourseStreams.add(log.course_stream);\n }\n });\n }\n });\n\n const courseStreamsSet = new Set(\n (courseStreams || []).filter(stream => String(stream) !== CARD_TYPE.CIRCLE),\n );\n\n return (\n courseStreamsSet.size > 1 ||\n allCourseStreams.size > 1 ||\n (courseStreamsSet.size > 0 &&\n allCourseStreams.size > 0 &&\n (courseStreamsSet.size !== allCourseStreams.size ||\n !Array.from(courseStreamsSet).every(stream => allCourseStreams.has(stream))))\n );\n }, [allTimelineData, courseStreams]);\n\n const handleLoadMore = useCallback(() => {\n if (timelineData?.next_page && !isLoadingMore) {\n fetchTimeline(timelineData.next_page, true);\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_SCROLLED, {\n student_id: studentId,\n });\n }\n }, [timelineData, studentId, trackEvent, isLoadingMore, fetchTimeline]);\n\n const onTryAgain = useCallback(() => {\n fetchTimeline(1, false);\n setAllTimelineData([]);\n }, [fetchTimeline]);\n\n useEffect(() => {\n if (timelineData) {\n if (timelineData.curr_page === 1) {\n setAllTimelineData(timelineData?.user_logs ?? []);\n } else if (timelineData.curr_page && prevCurrentPage !== timelineData.curr_page) {\n setAllTimelineData(prev => [...prev, ...(timelineData.user_logs ?? [])]);\n setIsLoadingMore(false);\n }\n }\n }, [timelineData, prevCurrentPage]);\n\n useEffect(() => {\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_VIEWED, {\n student_id: studentId,\n });\n }, [studentId, trackEvent]);\n\n useEffect(() => {\n return () => {\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_CLOSED, {\n student_id: studentId,\n });\n };\n }, [studentId, trackEvent]);\n\n useEffect(() => {\n fetchTimeline(1, false);\n }, [fetchTimeline]);\n\n useEffect(() => {\n if (isProcessed || isProcessingFailed) {\n onAPIComplete?.(isProcessed && !isProcessingFailed);\n }\n }, [isProcessed, isProcessingFailed, onAPIComplete]);\n\n if (isProcessingFailed) {\n return <Error height={scrollAreaHeight ?? '100vh'} onTryAgain={onTryAgain} />;\n }\n\n if (isProcessing && !allTimelineData.length) {\n return (\n <FlexView\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $height={scrollAreaHeight || '100vh'}\n >\n <AppLoader width=\"100%\" height=\"100%\" />\n </FlexView>\n );\n }\n\n return (\n <Styled.ScrollWrapper $alignItems=\"center\" $gapX={1}>\n <Styled.DailyTimelineContainer>\n {allTimelineData.map((entry, index) => (\n <Fragment key={`timeline-entry-${index}`}>\n <DailyTimelineView\n entry={entry}\n isFirstElement={index === 0}\n shouldShowTag={shouldShowTag}\n onPuzzleClick={onPuzzleClick}\n onReviewClick={onReviewClick}\n userType={userType}\n studentId={studentId}\n />\n </Fragment>\n ))}\n <IntersectionLoader\n onLoadMore={handleLoadMore}\n isLoading={isLoadingMore}\n hasMore={!!timelineData?.next_page}\n />\n </Styled.DailyTimelineContainer>\n </Styled.ScrollWrapper>\n );\n },\n);\n\nDailyTimeline.displayName = 'DailyTimeline';\n\nexport default DailyTimeline;\n"],"names":["DailyTimeline","memo","userType","studentId","courseStreams","onPuzzleClick","onReviewClick","scrollAreaHeight","onAPIComplete","allTimelineData","setAllTimelineData","useState","isLoadingMore","setIsLoadingMore","trackEvent","useUIContext","getTimeline","timelineData","isProcessingFailed","isProcessing","isProcessed","useDailyTimelineGet","prevCurrentPage","usePrevious","fetchTimeline","useCallback","page","INITIAL_PAGE","append","getTimezone","USER_TYPE","shouldShowTag","useMemo","allCourseStreams","entry","log","CARD_TYPE","courseStreamsSet","stream","handleLoadMore","DAILY_TIMELINE_ANALYTICS_EVENTS","onTryAgain","useEffect","prev","jsx","Error","FlexView","AppLoader","Styled.ScrollWrapper","jsxs","Styled.DailyTimelineContainer","index","Fragment","DailyTimelineView","IntersectionLoader","DailyTimeline$1"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAMA,IAAyCC;AAAA,EAC7C,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,eAAAC;AAAA,EAAA,MACI;AACJ,UAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAA0B,CAAE,CAAA,GACpE,CAACC,GAAeC,CAAgB,IAAIF,EAAS,EAAK,GAClD,EAAE,SAASG,EAAW,IAAIC,EAAa,GACvC;AAAA,MACJ,KAAKC;AAAA,MACL,MAAMC;AAAA,MACN,oBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,aAAAC;AAAA,IAAA,IACEC,EAAoBlB,CAAS,GAE3BmB,IAAkBC,EAAYN,KAAA,gBAAAA,EAAc,SAAS,GAErDO,IAAgBC;AAAA,MACpB,CAACC,IAAOC,GAAcC,IAAS,OAAU;AACvC,QAAIA,KACFf,EAAiB,EAAI,GAGvBG,EAAYb,GAAW;AAAA,UACrB,MAAAuB;AAAA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ACS;AAAA,QAAA;AAAA,UACC,OAAAnB;AAAA,UACA,gBAAgBiB,MAAU;AAAA,UAC1B,eAAApB;AAAA,UACA,eAAA1B;AAAA,UACA,eAAAC;AAAA,UACA,UAAAJ;AAAA,UACA,WAAAC;AAAA,QAAA;AAAA,MARW,EAAA,GAAA,kBAAkBgD,CAAK,EAUtC,CACD;AAAA,MACD,gBAAAP;AAAA,QAACU;AAAA,QAAA;AAAA,UACC,YAAYf;AAAA,UACZ,WAAW3B;AAAA,UACX,SAAS,CAAC,EAACK,KAAA,QAAAA,EAAc;AAAA,QAAA;AAAA,MAC3B;AAAA,IAAA,EACF,CAAA,EACF,CAAA;AAAA,EAEJ;AACF;AAEAjB,EAAc,cAAc;AAE5B,MAAAuD,KAAevD;"}
|
|
1
|
+
{"version":3,"file":"daily-timeline.js","sources":["../../../../src/features/timeline/daily-timeline/daily-timeline.tsx"],"sourcesContent":["import { Fragment, memo, useCallback, useEffect, useMemo, useState, type FC } from 'react';\n\nimport { type ITimelineData, useDailyTimelineGet } from './api/use-daily-timeline-get';\nimport * as Styled from './daily-timeline-styled';\nimport { CARD_TYPE, USER_TYPE, type IDailyTimelineProps } from './daily-timeline-types';\nimport { INITIAL_PAGE } from './comps/constants';\nimport { getTimezone } from '../../../helpers/date-time';\nimport { DAILY_TIMELINE_ANALYTICS_EVENTS } from './daily-timeline-events';\nimport DailyTimelineView from './daily-timeline-view';\nimport { useUIContext } from '../../ui/context/context';\nimport usePrevious from '../../hooks/use-previous';\nimport Error from '../../ui/error/error';\nimport IntersectionLoader from '../../ui/intersection-loader/intersection-loader';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\n\nconst DailyTimeline: FC<IDailyTimelineProps> = memo(\n ({\n userType,\n studentId,\n courseStreams,\n onPuzzleClick,\n onReviewClick,\n scrollAreaHeight,\n onAPIComplete,\n }) => {\n const [allTimelineData, setAllTimelineData] = useState<ITimelineData[]>([]);\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n const { onEvent: trackEvent } = useUIContext();\n const {\n get: getTimeline,\n data: timelineData,\n isProcessingFailed,\n isProcessing,\n isProcessed,\n } = useDailyTimelineGet(studentId);\n\n const prevCurrentPage = usePrevious(timelineData?.curr_page);\n\n const fetchTimeline = useCallback(\n (page = INITIAL_PAGE, append = false) => {\n if (append) {\n setIsLoadingMore(true);\n }\n\n getTimeline(studentId, {\n page,\n timezone: getTimezone(),\n course_stream: userType === USER_TYPE.TEACHER ? courseStreams : [],\n });\n },\n [getTimeline, studentId, userType, courseStreams],\n );\n\n const shouldShowTag = useMemo(() => {\n const allCourseStreams = new Set<string>();\n\n allTimelineData.forEach(entry => {\n if (entry.daily_logs) {\n entry.daily_logs.forEach(log => {\n if (log.course_stream && log.course_stream !== CARD_TYPE.CIRCLE) {\n allCourseStreams.add(log.course_stream);\n }\n });\n }\n });\n\n const courseStreamsSet = new Set(\n (courseStreams || []).filter(stream => String(stream) !== CARD_TYPE.CIRCLE),\n );\n\n return (\n courseStreamsSet.size > 1 ||\n allCourseStreams.size > 1 ||\n (courseStreamsSet.size > 0 &&\n allCourseStreams.size > 0 &&\n (courseStreamsSet.size !== allCourseStreams.size ||\n !Array.from(courseStreamsSet).every(stream => allCourseStreams.has(stream))))\n );\n }, [allTimelineData, courseStreams]);\n\n const handleLoadMore = useCallback(() => {\n if (timelineData?.next_page && !isLoadingMore) {\n fetchTimeline(timelineData.next_page, true);\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_SCROLLED, {\n student_id: studentId,\n });\n }\n }, [timelineData, studentId, trackEvent, isLoadingMore, fetchTimeline]);\n\n const onTryAgain = useCallback(() => {\n fetchTimeline(1, false);\n setAllTimelineData([]);\n }, [fetchTimeline]);\n\n useEffect(() => {\n if (timelineData) {\n if (timelineData.curr_page === 1) {\n setAllTimelineData(timelineData?.user_logs ?? []);\n } else if (timelineData.curr_page && prevCurrentPage !== timelineData.curr_page) {\n setAllTimelineData(prev => [...prev, ...(timelineData.user_logs ?? [])]);\n setIsLoadingMore(false);\n }\n }\n }, [timelineData, prevCurrentPage]);\n\n useEffect(() => {\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_VIEWED, {\n student_id: studentId,\n });\n }, [studentId, trackEvent]);\n\n useEffect(() => {\n return () => {\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_CLOSED, {\n student_id: studentId,\n });\n };\n }, [studentId, trackEvent]);\n\n useEffect(() => {\n fetchTimeline(1, false);\n }, [fetchTimeline]);\n\n useEffect(() => {\n if (isProcessed || isProcessingFailed) {\n onAPIComplete?.(isProcessed && !isProcessingFailed);\n }\n }, [isProcessed, isProcessingFailed, onAPIComplete]);\n\n if (isProcessingFailed) {\n return <Error height={scrollAreaHeight ?? '100dvh'} onTryAgain={onTryAgain} />;\n }\n\n if (isProcessing && !allTimelineData.length) {\n return <AppLoader width=\"100%\" height=\"100dvh\" />;\n }\n\n return (\n <Styled.ScrollWrapper $alignItems=\"center\" $gapX={1}>\n <Styled.DailyTimelineContainer>\n {allTimelineData.map((entry, index) => (\n <Fragment key={`timeline-entry-${index}`}>\n <DailyTimelineView\n entry={entry}\n isFirstElement={index === 0}\n shouldShowTag={shouldShowTag}\n onPuzzleClick={onPuzzleClick}\n onReviewClick={onReviewClick}\n userType={userType}\n studentId={studentId}\n />\n </Fragment>\n ))}\n <IntersectionLoader\n onLoadMore={handleLoadMore}\n isLoading={isLoadingMore}\n hasMore={!!timelineData?.next_page}\n />\n </Styled.DailyTimelineContainer>\n </Styled.ScrollWrapper>\n );\n },\n);\n\nDailyTimeline.displayName = 'DailyTimeline';\n\nexport default DailyTimeline;\n"],"names":["DailyTimeline","memo","userType","studentId","courseStreams","onPuzzleClick","onReviewClick","scrollAreaHeight","onAPIComplete","allTimelineData","setAllTimelineData","useState","isLoadingMore","setIsLoadingMore","trackEvent","useUIContext","getTimeline","timelineData","isProcessingFailed","isProcessing","isProcessed","useDailyTimelineGet","prevCurrentPage","usePrevious","fetchTimeline","useCallback","page","INITIAL_PAGE","append","getTimezone","USER_TYPE","shouldShowTag","useMemo","allCourseStreams","entry","log","CARD_TYPE","courseStreamsSet","stream","handleLoadMore","DAILY_TIMELINE_ANALYTICS_EVENTS","onTryAgain","useEffect","prev","jsx","Error","AppLoader","Styled.ScrollWrapper","jsxs","Styled.DailyTimelineContainer","index","Fragment","DailyTimelineView","IntersectionLoader","DailyTimeline$1"],"mappings":";;;;;;;;;;;;;;AAeA,MAAMA,IAAyCC;AAAA,EAC7C,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,eAAAC;AAAA,EAAA,MACI;AACJ,UAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAA0B,CAAE,CAAA,GACpE,CAACC,GAAeC,CAAgB,IAAIF,EAAS,EAAK,GAClD,EAAE,SAASG,EAAW,IAAIC,EAAa,GACvC;AAAA,MACJ,KAAKC;AAAA,MACL,MAAMC;AAAA,MACN,oBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,aAAAC;AAAA,IAAA,IACEC,EAAoBlB,CAAS,GAE3BmB,IAAkBC,EAAYN,KAAA,gBAAAA,EAAc,SAAS,GAErDO,IAAgBC;AAAA,MACpB,CAACC,IAAOC,GAAcC,IAAS,OAAU;AACvC,QAAIA,KACFf,EAAiB,EAAI,GAGvBG,EAAYb,GAAW;AAAA,UACrB,MAAAuB;AAAA,UACA,UAAUG,EAAY;AAAA,UACtB,eAAe3B,MAAa4B,EAAU,UAAU1B,IAAgB,CAAC;AAAA,QAAA,CAClE;AAAA,MACH;AAAA,MACA,CAACY,GAAab,GAAWD,GAAUE,CAAa;AAAA,IAAA,GAG5C2B,IAAgBC,EAAQ,MAAM;AAC5B,YAAAC,wBAAuB;AAE7B,MAAAxB,EAAgB,QAAQ,CAASyB,MAAA;AAC/B,QAAIA,EAAM,cACFA,EAAA,WAAW,QAAQ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jB,EAAc,cAAc;AAE5B,MAAAsD,KAAetD;"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { memo as
|
|
1
|
+
import { jsx as t, jsxs as j } from "react/jsx-runtime";
|
|
2
|
+
import { memo as x, useCallback as N, useEffect as l } from "react";
|
|
3
3
|
import { monthlyReportGet as Y } from "./api/use-monthly-report-api.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { MonthlyReportContainer as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import F from "../../../ui/layout/flex-view.js";
|
|
4
|
+
import E from "../../../ui/loader/app-loader/app-loader.js";
|
|
5
|
+
import G from "../../../ui/error/error.js";
|
|
6
|
+
import { MonthlyReportContainer as w } from "./monthly-report-styled.js";
|
|
7
|
+
import A from "./comps/goals/goals.js";
|
|
8
|
+
import C from "./comps/activities/activities.js";
|
|
10
9
|
import T from "./comps/attendance/attendance.js";
|
|
11
10
|
import U from "./comps/feedback/feedback.js";
|
|
12
|
-
import
|
|
13
|
-
import { IS_APP_RUNNING_IN_RN as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
11
|
+
import X from "./comps/achievements/achievements.js";
|
|
12
|
+
import { IS_APP_RUNNING_IN_RN as q } from "../../../../constants/app-config.js";
|
|
13
|
+
import z from "../../../ui/separator/separator.js";
|
|
14
|
+
const B = ({
|
|
16
15
|
studentName: p,
|
|
17
16
|
reportId: r,
|
|
18
|
-
onPuzzleClick:
|
|
17
|
+
onPuzzleClick: F,
|
|
19
18
|
showSnackbar: u,
|
|
20
|
-
onFeedback:
|
|
19
|
+
onFeedback: k,
|
|
21
20
|
onAPIComplete: o
|
|
22
21
|
}) => {
|
|
23
22
|
const {
|
|
@@ -28,56 +27,56 @@ const z = ({
|
|
|
28
27
|
isStale: M,
|
|
29
28
|
isProcessed: n
|
|
30
29
|
} = Y(r), {
|
|
31
|
-
progress_data:
|
|
32
|
-
calendar_data:
|
|
30
|
+
progress_data: L,
|
|
31
|
+
calendar_data: D,
|
|
33
32
|
report_month: i,
|
|
34
33
|
report_year: c,
|
|
35
|
-
feedback:
|
|
36
|
-
student_course_ids:
|
|
34
|
+
feedback: S,
|
|
35
|
+
student_course_ids: h
|
|
37
36
|
} = _ || {}, {
|
|
38
|
-
user_milestones:
|
|
39
|
-
activities:
|
|
40
|
-
user_achievements:
|
|
41
|
-
} =
|
|
37
|
+
user_milestones: v,
|
|
38
|
+
activities: y,
|
|
39
|
+
user_achievements: R
|
|
40
|
+
} = L || {}, e = N(() => {
|
|
42
41
|
g(r);
|
|
43
42
|
}, [g, r]);
|
|
44
|
-
if (
|
|
43
|
+
if (l(() => {
|
|
45
44
|
e();
|
|
46
|
-
}, [e]),
|
|
45
|
+
}, [e]), l(() => {
|
|
47
46
|
M && !a && e();
|
|
48
|
-
}, [M, a, e]),
|
|
47
|
+
}, [M, a, e]), l(() => {
|
|
49
48
|
(n || s) && (o == null || o(n && !s));
|
|
50
49
|
}, [n, s, o]), a && !_)
|
|
51
|
-
return /* @__PURE__ */ t(
|
|
50
|
+
return /* @__PURE__ */ t(E, { height: "100dvh" });
|
|
52
51
|
if (s)
|
|
53
|
-
return /* @__PURE__ */ t(
|
|
54
|
-
const
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
return /* @__PURE__ */ t(G, { height: "100dvh", onTryAgain: e });
|
|
53
|
+
const m = h == null ? void 0 : h[0], d = /* @__PURE__ */ new Date(), f = d.getMonth(), b = f === 0 ? d.getFullYear() - 1 : d.getFullYear();
|
|
54
|
+
return /* @__PURE__ */ j(w, { children: [
|
|
55
|
+
v && /* @__PURE__ */ t(A, { milestones: v, isExpended: !0 }),
|
|
56
|
+
y && /* @__PURE__ */ t(C, { activities: y, onPuzzleClick: F }),
|
|
57
|
+
R && /* @__PURE__ */ t(X, { achievements: R, studentName: p }),
|
|
58
|
+
D && i && c && /* @__PURE__ */ t(
|
|
60
59
|
T,
|
|
61
60
|
{
|
|
62
|
-
calendarData:
|
|
61
|
+
calendarData: D,
|
|
63
62
|
reportMonth: i,
|
|
64
63
|
reportYear: c,
|
|
65
64
|
onDateClick: u
|
|
66
65
|
}
|
|
67
66
|
),
|
|
68
|
-
|
|
67
|
+
q && !S && m && (i === (f === 0 ? 12 : f) && c === b) && m ? /* @__PURE__ */ t(
|
|
69
68
|
U,
|
|
70
69
|
{
|
|
71
70
|
reportId: r,
|
|
72
71
|
studentName: p,
|
|
73
|
-
onFeedback:
|
|
74
|
-
studentCourseId:
|
|
72
|
+
onFeedback: k,
|
|
73
|
+
studentCourseId: m,
|
|
75
74
|
showSnackbar: u
|
|
76
75
|
}
|
|
77
|
-
) : /* @__PURE__ */ t(
|
|
76
|
+
) : /* @__PURE__ */ t(z, { heightX: 1 })
|
|
78
77
|
] });
|
|
79
|
-
},
|
|
78
|
+
}, nt = x(B);
|
|
80
79
|
export {
|
|
81
|
-
|
|
80
|
+
nt as default
|
|
82
81
|
};
|
|
83
82
|
//# sourceMappingURL=monthly-report.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-report.js","sources":["../../../../../src/features/timeline/monthly-timeline/monthly-report/monthly-report.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect } from 'react';\n\nimport { type IMonthlyReportProps } from './monthly-report-types';\nimport { monthlyReportGet } from './api/use-monthly-report-api';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Error from '../../../ui/error/error';\nimport * as Styled from './monthly-report-styled';\nimport Goals from './comps/goals/goals';\nimport Activities from './comps/activities/activities';\nimport
|
|
1
|
+
{"version":3,"file":"monthly-report.js","sources":["../../../../../src/features/timeline/monthly-timeline/monthly-report/monthly-report.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect } from 'react';\n\nimport { type IMonthlyReportProps } from './monthly-report-types';\nimport { monthlyReportGet } from './api/use-monthly-report-api';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Error from '../../../ui/error/error';\nimport * as Styled from './monthly-report-styled';\nimport Goals from './comps/goals/goals';\nimport Activities from './comps/activities/activities';\nimport Attendance from './comps/attendance/attendance';\nimport Feedback from './comps/feedback/feedback';\nimport Achievements from './comps/achievements/achievements';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../constants/app-config';\nimport Separator from '../../../ui/separator/separator';\n\nconst MonthlyReport: FC<IMonthlyReportProps> = ({\n studentName,\n reportId,\n onPuzzleClick,\n showSnackbar,\n onFeedback,\n onAPIComplete,\n}) => {\n const {\n get: getReport,\n data: reportData,\n isProcessing,\n isProcessingFailed,\n isStale,\n isProcessed,\n } = monthlyReportGet(reportId);\n\n const {\n progress_data: progressData,\n calendar_data: calendarData,\n report_month: month,\n report_year: year,\n feedback,\n student_course_ids: studentCourseIds,\n } = reportData || {};\n\n const {\n user_milestones: userMilestones,\n activities,\n user_achievements: userAchievements,\n } = progressData || {};\n\n const fetchData = useCallback(() => {\n getReport(reportId);\n }, [getReport, reportId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n if (isStale && !isProcessing) {\n fetchData();\n }\n }, [isStale, isProcessing, fetchData]);\n\n useEffect(() => {\n if (isProcessed || isProcessingFailed) {\n onAPIComplete?.(isProcessed && !isProcessingFailed);\n }\n }, [isProcessed, isProcessingFailed, onAPIComplete]);\n\n if (isProcessing && !reportData) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return <Error height=\"100dvh\" onTryAgain={fetchData} />;\n }\n\n const firstStudentCourseId = studentCourseIds?.[0];\n\n // Check if the report is for the last month (previous month)\n const currentDate = new Date();\n const lastMonth = currentDate.getMonth(); // Current month - 1 (getMonth() returns 0-11)\n const lastMonthYear = lastMonth === 0 ? currentDate.getFullYear() - 1 : currentDate.getFullYear();\n const adjustedLastMonth = lastMonth === 0 ? 12 : lastMonth; // Handle January edge case\n const isLastMonth = month === adjustedLastMonth && year === lastMonthYear;\n\n const shouldShowFeedback =\n IS_APP_RUNNING_IN_RN && !feedback && firstStudentCourseId && isLastMonth;\n const hasCalendarData = calendarData && month && year;\n\n return (\n <Styled.MonthlyReportContainer>\n {userMilestones && <Goals milestones={userMilestones} isExpended={true} />}\n\n {activities && <Activities activities={activities} onPuzzleClick={onPuzzleClick} />}\n\n {userAchievements && (\n <Achievements achievements={userAchievements} studentName={studentName} />\n )}\n\n {hasCalendarData && (\n <Attendance\n calendarData={calendarData}\n reportMonth={month}\n reportYear={year}\n onDateClick={showSnackbar}\n />\n )}\n\n {shouldShowFeedback && firstStudentCourseId ? (\n <Feedback\n reportId={reportId}\n studentName={studentName}\n onFeedback={onFeedback}\n studentCourseId={firstStudentCourseId}\n showSnackbar={showSnackbar}\n />\n ) : (\n <Separator heightX={1} />\n )}\n </Styled.MonthlyReportContainer>\n );\n};\n\nexport default memo(MonthlyReport);\n"],"names":["MonthlyReport","studentName","reportId","onPuzzleClick","showSnackbar","onFeedback","onAPIComplete","getReport","reportData","isProcessing","isProcessingFailed","isStale","isProcessed","monthlyReportGet","progressData","calendarData","month","year","feedback","studentCourseIds","userMilestones","activities","userAchievements","fetchData","useCallback","useEffect","jsx","AppLoader","Error","firstStudentCourseId","currentDate","lastMonth","lastMonthYear","jsxs","Styled.MonthlyReportContainer","Goals","Activities","Achievements","Attendance","IS_APP_RUNNING_IN_RN","Feedback","Separator","monthlyReport","memo"],"mappings":";;;;;;;;;;;;;AAeA,MAAMA,IAAyC,CAAC;AAAA,EAC9C,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AACF,MAAM;AACE,QAAA;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,IACA,aAAAC;AAAA,EAAA,IACEC,EAAiBX,CAAQ,GAEvB;AAAA,IACJ,eAAe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C,KAa3C,gBAAAS;AAAA,MAACY;AAAA,MAAA;AAAA,QACC,cAAAvB;AAAA,QACA,aAAaC;AAAA,QACb,YAAYC;AAAA,QACZ,aAAab;AAAA,MAAA;AAAA,IACf;AAAA,IAnBJmC,KAAwB,CAACrB,KAAYW,MAHnBb,OADMe,MAAc,IAAI,KAAKA,MACEd,MAASe,MAyBjCH,IACrB,gBAAAH;AAAA,MAACc;AAAA,MAAA;AAAA,QACC,UAAAtC;AAAA,QACA,aAAAD;AAAA,QACA,YAAAI;AAAA,QACA,iBAAiBwB;AAAA,QACjB,cAAAzB;AAAA,MAAA;AAAA,IAGF,IAAA,gBAAAsB,EAACe,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,EAE3B,EAAA,CAAA;AAEJ,GAEeC,KAAAC,EAAK3C,CAAa;"}
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import { jsx as r, Fragment as w, jsxs as c } from "react/jsx-runtime";
|
|
2
|
-
import { memo as L, useMemo as R, useCallback as X, useEffect as
|
|
3
|
-
import { monthlyTimelineGet as
|
|
2
|
+
import { memo as L, useMemo as R, useCallback as X, useEffect as $ } from "react";
|
|
3
|
+
import { monthlyTimelineGet as v } from "./api/use-monthly-timeline-get.js";
|
|
4
4
|
import F from "./monthly-timeline-view.js";
|
|
5
5
|
import M from "../../ui/loader/app-loader/app-loader.js";
|
|
6
|
-
import
|
|
6
|
+
import n from "../../ui/layout/flex-view.js";
|
|
7
7
|
import S from "../../ui/text/text.js";
|
|
8
8
|
import u from "../../ui/image/image.js";
|
|
9
9
|
import l from "../../ui/separator/separator.js";
|
|
10
|
-
import { yearImages as
|
|
11
|
-
import
|
|
12
|
-
import { ImageContainer as
|
|
13
|
-
import { getTimezone as
|
|
14
|
-
import { ILLUSTRATIONS as
|
|
15
|
-
const
|
|
16
|
-
userType:
|
|
10
|
+
import { yearImages as j, monthNames as A } from "./constants.js";
|
|
11
|
+
import B from "../../ui/error/error.js";
|
|
12
|
+
import { ImageContainer as z, DateText as D } from "./monthly-timeline-styled.js";
|
|
13
|
+
import { getTimezone as I } from "../../../helpers/date-time.js";
|
|
14
|
+
import { ILLUSTRATIONS as K } from "../../../assets/illustrations/illustrations.js";
|
|
15
|
+
const N = ({
|
|
16
|
+
userType: g,
|
|
17
17
|
studentId: m,
|
|
18
|
-
courseStreams:
|
|
18
|
+
courseStreams: f,
|
|
19
19
|
onReportClick: x,
|
|
20
|
-
onAPIComplete:
|
|
20
|
+
onAPIComplete: t
|
|
21
21
|
}) => {
|
|
22
22
|
const a = R(
|
|
23
23
|
() => ({
|
|
24
|
-
course_streams:
|
|
25
|
-
timezone:
|
|
24
|
+
course_streams: g === "TEACHER" ? f : [],
|
|
25
|
+
timezone: I()
|
|
26
26
|
}),
|
|
27
|
-
[
|
|
27
|
+
[f, g]
|
|
28
28
|
), {
|
|
29
29
|
get: p,
|
|
30
|
-
data:
|
|
30
|
+
data: o = [],
|
|
31
31
|
isProcessing: E,
|
|
32
|
-
isProcessingFailed:
|
|
33
|
-
isProcessed:
|
|
34
|
-
} =
|
|
32
|
+
isProcessingFailed: i,
|
|
33
|
+
isProcessed: h
|
|
34
|
+
} = v(m, a), s = X(() => {
|
|
35
35
|
p(m, a);
|
|
36
36
|
}, [p, a, m]);
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
(
|
|
41
|
-
}, [
|
|
42
|
-
const
|
|
43
|
-
return /* @__PURE__ */ c(
|
|
44
|
-
!
|
|
45
|
-
|
|
46
|
-
/* @__PURE__ */ c(
|
|
47
|
-
/* @__PURE__ */ r(
|
|
37
|
+
return $(() => {
|
|
38
|
+
s();
|
|
39
|
+
}, [s]), $(() => {
|
|
40
|
+
(h || i) && (t == null || t(h && !i));
|
|
41
|
+
}, [h, i, t]), E ? /* @__PURE__ */ r(M, { height: "100dvh" }) : i ? /* @__PURE__ */ r(B, { onTryAgain: s, height: "100dvh" }) : /* @__PURE__ */ r(w, { children: (o == null ? void 0 : o.length) > 0 ? /* @__PURE__ */ r(n, { $gapX: 2, children: o.map((e, _) => {
|
|
42
|
+
const d = _ === 0, b = e.month === 12, T = !d && b, y = j[e.year];
|
|
43
|
+
return /* @__PURE__ */ c(n, { $width: "100%", children: [
|
|
44
|
+
!d && !T && /* @__PURE__ */ r(l, { heightX: 2 }),
|
|
45
|
+
T && y && /* @__PURE__ */ r(z, { $marginBottom: -122, children: /* @__PURE__ */ r(u, { src: y, alt: e.year.toString() }) }),
|
|
46
|
+
/* @__PURE__ */ c(n, { $gutterX: 1, children: [
|
|
47
|
+
/* @__PURE__ */ r(D, { $renderAs: "ac4", $color: "BLACK_T_60", children: A[e.month - 1] }),
|
|
48
48
|
/* @__PURE__ */ r(l, { heightX: 1 }),
|
|
49
49
|
/* @__PURE__ */ r(
|
|
50
50
|
F,
|
|
@@ -57,12 +57,12 @@ const K = ({
|
|
|
57
57
|
)
|
|
58
58
|
] })
|
|
59
59
|
] }, `${e.month}-${e.year}`);
|
|
60
|
-
}) }) : /* @__PURE__ */ c(
|
|
61
|
-
/* @__PURE__ */ r(u, { src:
|
|
60
|
+
}) }) : /* @__PURE__ */ c(n, { $justifyContent: "center", $alignItems: "center", $height: "100dvh", children: [
|
|
61
|
+
/* @__PURE__ */ r(u, { src: K.EMPTY_REPORTS }),
|
|
62
62
|
/* @__PURE__ */ r(l, { heightX: 1.5 }),
|
|
63
63
|
/* @__PURE__ */ r(S, { $renderAs: "ab2", color: "BLACK_T_60", children: "Report will be available next month." })
|
|
64
64
|
] }) });
|
|
65
|
-
}, rr = L(
|
|
65
|
+
}, rr = L(N);
|
|
66
66
|
export {
|
|
67
67
|
rr as default
|
|
68
68
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-timeline.js","sources":["../../../../src/features/timeline/monthly-timeline/monthly-timeline.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { type IMonthlyTimelineProps } from './monthly-timeline-types';\nimport { monthlyTimelineGet } from './api/use-monthly-timeline-get';\nimport MonthlyTimelineView from './monthly-timeline-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport Image from '../../ui/image/image';\nimport Separator from '../../ui/separator/separator';\nimport { monthNames, yearImages } from './constants';\nimport Error from '../../ui/error/error';\nimport * as Styled from './monthly-timeline-styled';\nimport { getTimezone } from '../../../helpers/date-time';\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\nconst MonthlyTimeline: FC<IMonthlyTimelineProps> = ({\n userType,\n studentId,\n courseStreams,\n onReportClick,\n onAPIComplete,\n}) => {\n const initialQueryParams = useMemo(\n () => ({\n course_streams: userType === 'TEACHER' ? courseStreams : [],\n timezone: getTimezone(),\n }),\n [courseStreams, userType],\n );\n\n const {\n get: getTimeline,\n data: timelineData = [],\n isProcessing,\n isProcessingFailed,\n isProcessed,\n } = monthlyTimelineGet(studentId, initialQueryParams);\n\n const fetchData = useCallback(() => {\n getTimeline(studentId, initialQueryParams);\n }, [getTimeline, initialQueryParams, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n if (isProcessed || isProcessingFailed) {\n onAPIComplete?.(isProcessed && !isProcessingFailed);\n }\n }, [isProcessed, isProcessingFailed, onAPIComplete]);\n\n if (isProcessing) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return
|
|
1
|
+
{"version":3,"file":"monthly-timeline.js","sources":["../../../../src/features/timeline/monthly-timeline/monthly-timeline.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { type IMonthlyTimelineProps } from './monthly-timeline-types';\nimport { monthlyTimelineGet } from './api/use-monthly-timeline-get';\nimport MonthlyTimelineView from './monthly-timeline-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport Image from '../../ui/image/image';\nimport Separator from '../../ui/separator/separator';\nimport { monthNames, yearImages } from './constants';\nimport Error from '../../ui/error/error';\nimport * as Styled from './monthly-timeline-styled';\nimport { getTimezone } from '../../../helpers/date-time';\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\nconst MonthlyTimeline: FC<IMonthlyTimelineProps> = ({\n userType,\n studentId,\n courseStreams,\n onReportClick,\n onAPIComplete,\n}) => {\n const initialQueryParams = useMemo(\n () => ({\n course_streams: userType === 'TEACHER' ? courseStreams : [],\n timezone: getTimezone(),\n }),\n [courseStreams, userType],\n );\n\n const {\n get: getTimeline,\n data: timelineData = [],\n isProcessing,\n isProcessingFailed,\n isProcessed,\n } = monthlyTimelineGet(studentId, initialQueryParams);\n\n const fetchData = useCallback(() => {\n getTimeline(studentId, initialQueryParams);\n }, [getTimeline, initialQueryParams, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n if (isProcessed || isProcessingFailed) {\n onAPIComplete?.(isProcessed && !isProcessingFailed);\n }\n }, [isProcessed, isProcessingFailed, onAPIComplete]);\n\n if (isProcessing) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return <Error onTryAgain={fetchData} height=\"100dvh\" />;\n }\n\n return (\n <>\n {timelineData?.length > 0 ? (\n <FlexView $gapX={2}>\n {timelineData.map((item, index) => {\n const isFirstItem = index === 0;\n const isDecember = item.month === 12;\n const showYearImage = !isFirstItem && isDecember;\n const yearImage = yearImages[item.year];\n\n return (\n <FlexView key={`${item.month}-${item.year}`} $width=\"100%\">\n {!isFirstItem && !showYearImage && <Separator heightX={2} />}\n {showYearImage && yearImage && (\n <Styled.ImageContainer $marginBottom={-122}>\n <Image src={yearImage} alt={item.year.toString()} />\n </Styled.ImageContainer>\n )}\n <FlexView $gutterX={1}>\n <Styled.DateText $renderAs=\"ac4\" $color=\"BLACK_T_60\">\n {monthNames[item.month - 1]}\n </Styled.DateText>\n <Separator heightX={1} />\n <MonthlyTimelineView\n reports={item.reports}\n month={item.month}\n year={item.year}\n onReportClick={onReportClick}\n />\n </FlexView>\n </FlexView>\n );\n })}\n </FlexView>\n ) : (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $height=\"100dvh\">\n <Image src={ILLUSTRATIONS.EMPTY_REPORTS} />\n <Separator heightX={1.5} />\n <Text $renderAs=\"ab2\" color=\"BLACK_T_60\">\n Report will be available next month.\n </Text>\n </FlexView>\n )}\n </>\n );\n};\n\nexport default memo(MonthlyTimeline);\n"],"names":["MonthlyTimeline","userType","studentId","courseStreams","onReportClick","onAPIComplete","initialQueryParams","useMemo","getTimezone","getTimeline","timelineData","isProcessing","isProcessingFailed","isProcessed","monthlyTimelineGet","fetchData","useCallback","useEffect","jsx","AppLoader","Error","Fragment","FlexView","item","index","isFirstItem","isDecember","showYearImage","yearImage","yearImages","jsxs","Separator","Styled.ImageContainer","Image","Styled.DateText","monthNames","MonthlyTimelineView","ILLUSTRATIONS","Text","monthlyTimeline","memo"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAMA,IAA6C,CAAC;AAAA,EAClD,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AACF,MAAM;AACJ,QAAMC,IAAqBC;AAAA,IACzB,OAAO;AAAA,MACL,gBAAgBN,MAAa,YAAYE,IAAgB,CAAC;AAAA,MAC1D,UAAUK,EAAY;AAAA,IAAA;AAAA,IAExB,CAACL,GAAeF,CAAQ;AAAA,EAAA,GAGpB;AAAA,IACJ,KAAKQ;AAAA,IACL,MAAMC,IAAe,CAAC;AAAA,IACtB,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,EAAA,IACEC,EAAmBZ,GAAWI,CAAkB,GAE9CS,IAAYC,EAAY,MAAM;AAClC,IAAAP,EAAYP,GAAWI,CAAkB;AAAA,EACxC,GAAA,CAACG,GAAaH,GAAoBJ,CAAS,CAAC;AAY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AAK;AAAA,YACX,eAAAnB;AAAA,UAAA;AAAA,QACF;AAAA,MAAA,GACF;AAAA,IAAA,KAlBa,GAAGmB,EAAK,KAAK,IAAIA,EAAK,IAAI,EAmBzC;AAAA,EAEH,CAAA,GACH,IAEC,gBAAAO,EAAAR,GAAA,EAAS,iBAAgB,UAAS,aAAY,UAAS,SAAQ,UAC9D,UAAA;AAAA,IAAC,gBAAAJ,EAAAe,GAAA,EAAM,KAAKI,EAAc,cAAe,CAAA;AAAA,IACzC,gBAAAnB,EAACa,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,sBACxBO,GAAK,EAAA,WAAU,OAAM,OAAM,cAAa,UAEzC,wCAAA;AAAA,EAAA,EACF,CAAA,EAEJ,CAAA;AAEJ,GAEeC,KAAAC,EAAKxC,CAAe;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i, Fragment as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { usePTMReportGet as
|
|
4
|
-
import { EPTMTypes as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as ge } from "react/jsx-runtime";
|
|
2
|
+
import { memo as he, useCallback as fe, useEffect as f } from "react";
|
|
3
|
+
import { usePTMReportGet as le } from "./api/use-ptm-report-get.js";
|
|
4
|
+
import { EPTMTypes as de } from "./ptm-report-types.js";
|
|
5
|
+
import _e from "../../../ui/loader/app-loader/app-loader.js";
|
|
6
|
+
import ue from "./comps/student-info/student-info.js";
|
|
7
7
|
import { Container as Re } from "./ptm-report-styled.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import Ce from "./comps/key-need/key-need.js";
|
|
9
|
+
import ke from "../../../ui/layout/flex-view.js";
|
|
10
10
|
import Te from "./comps/teacher-observations/teacher-observations.js";
|
|
11
11
|
import Se from "./comps/strategies/strategies.js";
|
|
12
12
|
import we from "./comps/parent-support/parent-support.js";
|
|
@@ -18,65 +18,65 @@ const De = ({ ptmId: r, onAPIComplete: t }) => {
|
|
|
18
18
|
const {
|
|
19
19
|
get: m,
|
|
20
20
|
data: g,
|
|
21
|
-
isProcessing:
|
|
21
|
+
isProcessing: l,
|
|
22
22
|
isProcessed: s,
|
|
23
23
|
isProcessingFailed: o
|
|
24
|
-
} =
|
|
24
|
+
} = le(r), a = fe(() => {
|
|
25
25
|
m(r);
|
|
26
26
|
}, [m, r]);
|
|
27
27
|
if (f(() => {
|
|
28
28
|
a();
|
|
29
29
|
}, [a]), f(() => {
|
|
30
30
|
(s || o) && (t == null || t(s && !o));
|
|
31
|
-
}, [s, o, t]),
|
|
32
|
-
return /* @__PURE__ */ e(
|
|
31
|
+
}, [s, o, t]), l || !g)
|
|
32
|
+
return /* @__PURE__ */ e(_e, { height: "100dvh" });
|
|
33
33
|
if (o)
|
|
34
|
-
return /* @__PURE__ */ e(
|
|
35
|
-
const { ptm_config:
|
|
36
|
-
teacher_observation:
|
|
37
|
-
learning_strategy:
|
|
38
|
-
parent_support:
|
|
39
|
-
school_support:
|
|
40
|
-
} = R || {}, { subsections:
|
|
41
|
-
focus_area:
|
|
42
|
-
strengths:
|
|
34
|
+
return /* @__PURE__ */ e(be, { onTryAgain: a, height: "100dvh" });
|
|
35
|
+
const { ptm_config: d, report: _ } = g, { ptm_type: n, config: u } = d || {}, { ptm_report_sections: R, late_if_minutes: C } = u || {}, {
|
|
36
|
+
teacher_observation: k,
|
|
37
|
+
learning_strategy: T,
|
|
38
|
+
parent_support: S,
|
|
39
|
+
school_support: w
|
|
40
|
+
} = R || {}, { subsections: y } = w || {}, { homework_help: M, test_help: P } = y || {}, { options: b } = S || {}, { strategies: D } = T || {}, { subsections: O } = k || {}, {
|
|
41
|
+
focus_area: j,
|
|
42
|
+
strengths: A,
|
|
43
43
|
teacher_remarks: v
|
|
44
|
-
} =
|
|
44
|
+
} = O || {}, { areas: x = [], report_tag: E } = j || {}, { areas: F = [] } = A || {}, { report_tag: N } = v || {}, { report_sections: U, student_data: H } = _, {
|
|
45
45
|
teacher_observation: W,
|
|
46
46
|
parent_support: G,
|
|
47
47
|
strategies: K,
|
|
48
48
|
real_world_project: X,
|
|
49
|
-
school_support:
|
|
50
|
-
upcoming_chapters:
|
|
51
|
-
} =
|
|
52
|
-
strengths:
|
|
53
|
-
focus_area:
|
|
54
|
-
teacher_remarks:
|
|
49
|
+
school_support: $,
|
|
50
|
+
upcoming_chapters: L
|
|
51
|
+
} = U || {}, { homework_help: V, test_help: q } = $ || {}, { upcoming_chapters: z } = L || {}, {
|
|
52
|
+
strengths: B = {},
|
|
53
|
+
focus_area: J,
|
|
54
|
+
teacher_remarks: Q
|
|
55
55
|
} = W || {}, {
|
|
56
|
-
first_name:
|
|
57
|
-
grade:
|
|
56
|
+
first_name: h,
|
|
57
|
+
grade: Y,
|
|
58
58
|
key_need: p,
|
|
59
|
-
attendance_data:
|
|
60
|
-
homework_data:
|
|
61
|
-
late_class_data:
|
|
62
|
-
real_world_project:
|
|
63
|
-
} = H || {}, { classes_completed:
|
|
64
|
-
({ area_key:
|
|
65
|
-
),
|
|
59
|
+
attendance_data: Z,
|
|
60
|
+
homework_data: I,
|
|
61
|
+
late_class_data: ee = [],
|
|
62
|
+
real_world_project: te
|
|
63
|
+
} = H || {}, { classes_completed: oe, weeks_completed: re } = Z || {}, { sheets_assigned: se, sheets_not_completed: ae } = I || {}, ne = x.find(
|
|
64
|
+
({ area_key: me }) => me === J
|
|
65
|
+
), pe = (p == null ? void 0 : p.key_need) ?? "", c = n === de.ON_DEMAND, ce = ee.length, ie = n && n.split("_").includes("UPGRADE");
|
|
66
66
|
return /* @__PURE__ */ i(Re, { children: [
|
|
67
|
-
/* @__PURE__ */ e(
|
|
68
|
-
/* @__PURE__ */ i(
|
|
69
|
-
/* @__PURE__ */ e(
|
|
70
|
-
(c ||
|
|
71
|
-
/* @__PURE__ */ e(Me, { projectReport: X, projectInfo:
|
|
67
|
+
/* @__PURE__ */ e(ue, { name: h, grade: Y }),
|
|
68
|
+
/* @__PURE__ */ i(ke, { $gutterX: 1, $gapX: 1, children: [
|
|
69
|
+
/* @__PURE__ */ e(Ce, { text: pe }),
|
|
70
|
+
(c || ie) && /* @__PURE__ */ i(ge, { children: [
|
|
71
|
+
/* @__PURE__ */ e(Me, { projectReport: X, projectInfo: te }),
|
|
72
72
|
/* @__PURE__ */ e(
|
|
73
73
|
Pe,
|
|
74
74
|
{
|
|
75
|
-
homeworkHelpReport:
|
|
76
|
-
homeworkHelpConfig:
|
|
77
|
-
testHelpReport:
|
|
78
|
-
testHelpConfig:
|
|
79
|
-
studentName:
|
|
75
|
+
homeworkHelpReport: V,
|
|
76
|
+
homeworkHelpConfig: M,
|
|
77
|
+
testHelpReport: q,
|
|
78
|
+
testHelpConfig: P,
|
|
79
|
+
studentName: h,
|
|
80
80
|
isOnDemandPTM: c
|
|
81
81
|
}
|
|
82
82
|
)
|
|
@@ -84,32 +84,32 @@ const De = ({ ptmId: r, onAPIComplete: t }) => {
|
|
|
84
84
|
/* @__PURE__ */ e(
|
|
85
85
|
Te,
|
|
86
86
|
{
|
|
87
|
-
strengthAreas:
|
|
88
|
-
strengthsReport:
|
|
89
|
-
focusArea:
|
|
90
|
-
focusAreaReportTag:
|
|
91
|
-
teacherRemarks:
|
|
92
|
-
teacherRemarkTag:
|
|
87
|
+
strengthAreas: F,
|
|
88
|
+
strengthsReport: B,
|
|
89
|
+
focusArea: ne,
|
|
90
|
+
focusAreaReportTag: E,
|
|
91
|
+
teacherRemarks: Q,
|
|
92
|
+
teacherRemarkTag: N
|
|
93
93
|
}
|
|
94
94
|
),
|
|
95
|
-
/* @__PURE__ */ e(Se, { report: K, strategyConfig:
|
|
95
|
+
/* @__PURE__ */ e(Se, { report: K, strategyConfig: D }),
|
|
96
96
|
/* @__PURE__ */ e(
|
|
97
97
|
we,
|
|
98
98
|
{
|
|
99
99
|
report: G,
|
|
100
|
-
options:
|
|
101
|
-
classesCompleted:
|
|
102
|
-
weeksCompleted:
|
|
103
|
-
sheetsAssigned:
|
|
104
|
-
sheetsNotCompleted:
|
|
105
|
-
lateClassesCount:
|
|
106
|
-
lateIfMinutes:
|
|
100
|
+
options: b,
|
|
101
|
+
classesCompleted: oe,
|
|
102
|
+
weeksCompleted: re,
|
|
103
|
+
sheetsAssigned: se,
|
|
104
|
+
sheetsNotCompleted: ae,
|
|
105
|
+
lateClassesCount: ce,
|
|
106
|
+
lateIfMinutes: C
|
|
107
107
|
}
|
|
108
108
|
),
|
|
109
|
-
c && /* @__PURE__ */ e(ye, { chapters:
|
|
109
|
+
c && /* @__PURE__ */ e(ye, { chapters: z })
|
|
110
110
|
] })
|
|
111
111
|
] });
|
|
112
|
-
}, qe =
|
|
112
|
+
}, qe = he(De);
|
|
113
113
|
export {
|
|
114
114
|
qe as default
|
|
115
115
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ptm-report.js","sources":["../../../../../src/features/timeline/monthly-timeline/ptm-report/ptm-report.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, type FC } from 'react';\n\nimport { usePTMReportGet } from './api/use-ptm-report-get';\nimport { EPTMTypes, type IPTMReportProps } from './ptm-report-types';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport StudentInfo from './comps/student-info/student-info';\nimport * as Styled from './ptm-report-styled';\nimport KeyNeed from './comps/key-need/key-need';\nimport FlexView from '../../../ui/layout/flex-view';\nimport TeacherObservations from './comps/teacher-observations/teacher-observations';\nimport Strategies from './comps/strategies/strategies';\nimport ParentSupport from './comps/parent-support/parent-support';\nimport UpcomingChapters from './comps/upcoming-chapters/upcoming-chapters';\nimport RealWorldProjects from './comps/real-world-projects/real-world-projects';\nimport SchoolSupport from './comps/school-support/school-support';\nimport Error from '../../../ui/error/error';\n\nconst PTMReport: FC<IPTMReportProps> = ({ ptmId, onAPIComplete }) => {\n const {\n get: getPTMReport,\n data: ptmReportData,\n isProcessing,\n isProcessed,\n isProcessingFailed,\n } = usePTMReportGet(ptmId);\n\n const fetchPTMReport = useCallback(() => {\n getPTMReport(ptmId);\n }, [getPTMReport, ptmId]);\n\n useEffect(() => {\n fetchPTMReport();\n }, [fetchPTMReport]);\n\n useEffect(() => {\n if (isProcessed || isProcessingFailed) {\n onAPIComplete?.(isProcessed && !isProcessingFailed);\n }\n }, [isProcessed, isProcessingFailed, onAPIComplete]);\n\n if (isProcessing || !ptmReportData) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <Error onTryAgain={fetchPTMReport} />\n </FlexView>\n );\n }\n\n const { ptm_config: ptmConfig, report } = ptmReportData;\n const { ptm_type: ptmType, config } = ptmConfig || {};\n const { ptm_report_sections: sectionsConfig, late_if_minutes: lateIfMinutes } = config || {};\n\n const {\n teacher_observation: teacherObservationConfig,\n learning_strategy: strategyConfig,\n parent_support: parentSupportConfig,\n school_support: schoolSupportConfig,\n } = sectionsConfig || {};\n\n const { subsections: schoolSubsections } = schoolSupportConfig || {};\n const { homework_help: homeworkConfig, test_help: testConfig } = schoolSubsections || {};\n\n const { options: parentOptions } = parentSupportConfig || {};\n const { strategies: strategiesConfig } = strategyConfig || {};\n const { subsections: teacherSubsections } = teacherObservationConfig || {};\n\n const {\n focus_area: focusAreaConfig,\n strengths: strengthsConfig,\n teacher_remarks: remarksConfig,\n } = teacherSubsections || {};\n\n const { areas: focusAreas = [], report_tag: focusAreaTag } = focusAreaConfig || {};\n const { areas: strengthAreas = [] } = strengthsConfig || {};\n const { report_tag: remarksTag } = remarksConfig || {};\n\n const { report_sections: reportSections, student_data: studentData } = report;\n\n const {\n teacher_observation: teacherObservationReport,\n parent_support: parentSupportReport,\n strategies: strategiesReport,\n real_world_project: realWorldReport,\n school_support: schoolSupportReport,\n upcoming_chapters: upcomingChaptersReport,\n } = reportSections || {};\n\n const { homework_help: homeworkReport, test_help: testReport } = schoolSupportReport || {};\n\n const { upcoming_chapters: upcomingChapters } = upcomingChaptersReport || {};\n\n const {\n strengths: strengthsReport = {},\n focus_area: selectedFocusAreaKey,\n teacher_remarks: teacherRemarks,\n } = teacherObservationReport || {};\n\n const {\n first_name: studentName,\n grade: studentGrade,\n key_need: keyNeedData,\n attendance_data: attendanceData,\n homework_data: homeworkData,\n late_class_data: lateClasses = [],\n real_world_project: realWorldProjectData,\n } = studentData || {};\n\n const { classes_completed: completedClasses, weeks_completed: completedWeeks } =\n attendanceData || {};\n\n const { sheets_assigned: assignedSheets, sheets_not_completed: incompleteSheets } =\n homeworkData || {};\n\n const selectedFocusArea = focusAreas.find(\n ({ area_key: areaKey }) => areaKey === selectedFocusAreaKey,\n );\n\n const keyNeedText = keyNeedData?.key_need ?? '';\n const isOnDemandPTM = ptmType === EPTMTypes.ON_DEMAND;\n const lateClassesCount = lateClasses.length;\n const isUpgradePTM = ptmType && ptmType.split('_').includes('UPGRADE');\n const isUpgradeOrOnDemandPTM = isOnDemandPTM || isUpgradePTM;\n\n return (\n <Styled.Container>\n <StudentInfo name={studentName} grade={studentGrade} />\n <FlexView $gutterX={1} $gapX={1}>\n <KeyNeed text={keyNeedText} />\n {isUpgradeOrOnDemandPTM && (\n <>\n <RealWorldProjects projectReport={realWorldReport} projectInfo={realWorldProjectData} />\n <SchoolSupport\n homeworkHelpReport={homeworkReport}\n homeworkHelpConfig={homeworkConfig}\n testHelpReport={testReport}\n testHelpConfig={testConfig}\n studentName={studentName}\n isOnDemandPTM={isOnDemandPTM}\n />\n </>\n )}\n <TeacherObservations\n strengthAreas={strengthAreas}\n strengthsReport={strengthsReport}\n focusArea={selectedFocusArea}\n focusAreaReportTag={focusAreaTag}\n teacherRemarks={teacherRemarks}\n teacherRemarkTag={remarksTag}\n />\n <Strategies report={strategiesReport} strategyConfig={strategiesConfig} />\n <ParentSupport\n report={parentSupportReport}\n options={parentOptions}\n classesCompleted={completedClasses}\n weeksCompleted={completedWeeks}\n sheetsAssigned={assignedSheets}\n sheetsNotCompleted={incompleteSheets}\n lateClassesCount={lateClassesCount}\n lateIfMinutes={lateIfMinutes}\n />\n {isOnDemandPTM && <UpcomingChapters chapters={upcomingChapters} />}\n </FlexView>\n </Styled.Container>\n );\n};\n\nexport default memo(PTMReport);\n"],"names":["PTMReport","ptmId","onAPIComplete","getPTMReport","ptmReportData","isProcessing","isProcessed","isProcessingFailed","usePTMReportGet","fetchPTMReport","useCallback","useEffect","jsx","AppLoader","FlexView","Error","ptmConfig","report","ptmType","config","sectionsConfig","lateIfMinutes","teacherObservationConfig","strategyConfig","parentSupportConfig","schoolSupportConfig","schoolSubsections","homeworkConfig","testConfig","parentOptions","strategiesConfig","teacherSubsections","focusAreaConfig","strengthsConfig","remarksConfig","focusAreas","focusAreaTag","strengthAreas","remarksTag","reportSections","studentData","teacherObservationReport","parentSupportReport","strategiesReport","realWorldReport","schoolSupportReport","upcomingChaptersReport","homeworkReport","testReport","upcomingChapters","strengthsReport","selectedFocusAreaKey","teacherRemarks","studentName","studentGrade","keyNeedData","attendanceData","homeworkData","lateClasses","realWorldProjectData","completedClasses","completedWeeks","assignedSheets","incompleteSheets","selectedFocusArea","areaKey","keyNeedText","isOnDemandPTM","EPTMTypes","lateClassesCount","isUpgradePTM","jsxs","Styled.Container","StudentInfo","KeyNeed","Fragment","RealWorldProjects","SchoolSupport","TeacherObservations","Strategies","ParentSupport","UpcomingChapters","ptmReport","memo"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAMA,KAAiC,CAAC,EAAE,OAAAC,GAAO,eAAAC,QAAoB;AAC7D,QAAA;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,IACEC,GAAgBP,CAAK,GAEnBQ,IAAiBC,GAAY,MAAM;AACvC,IAAAP,EAAaF,CAAK;AAAA,EAAA,GACjB,CAACE,GAAcF,CAAK,CAAC;AAYpB,MAVJU,EAAU,MAAM;AACC,IAAAF;EAAA,GACd,CAACA,CAAc,CAAC,GAEnBE,EAAU,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C,GAAiB,aAAae,IAAsB;AAAA,QACtF,gBAAA/C;AAAA,UAACiE;AAAA,UAAA;AAAA,YACC,oBAAoB9B;AAAA,YACpB,oBAAoBpB;AAAA,YACpB,gBAAgBqB;AAAA,YAChB,gBAAgBpB;AAAA,YAChB,aAAAyB;AAAA,YACA,eAAAc;AAAA,UAAA;AAAA,QACF;AAAA,MAAA,GACF;AAAA,MAEF,gBAAAvD;AAAA,QAACkE;AAAA,QAAA;AAAA,UACC,eAAAzC;AAAA,UACA,iBAAAa;AAAA,UACA,WAAWc;AAAA,UACX,oBAAoB5B;AAAA,UACpB,gBAAAgB;AAAA,UACA,kBAAkBd;AAAA,QAAA;AAAA,MACpB;AAAA,MACC,gBAAA1B,EAAAmE,IAAA,EAAW,QAAQpC,GAAkB,gBAAgBb,GAAkB;AAAA,MACxE,gBAAAlB;AAAA,QAACoE;AAAA,QAAA;AAAA,UACC,QAAQtC;AAAA,UACR,SAASb;AAAA,UACT,kBAAkB+B;AAAA,UAClB,gBAAgBC;AAAA,UAChB,gBAAgBC;AAAA,UAChB,oBAAoBC;AAAA,UACpB,kBAAAM;AAAA,UACA,eAAAhD;AAAA,QAAA;AAAA,MACF;AAAA,MACC8C,KAAiB,gBAAAvD,EAACqE,IAAiB,EAAA,UAAUhC,EAAkB,CAAA;AAAA,IAAA,GAClE;AAAA,EACF,EAAA,CAAA;AAEJ,GAEeiC,KAAAC,GAAKnF,EAAS;"}
|
|
1
|
+
{"version":3,"file":"ptm-report.js","sources":["../../../../../src/features/timeline/monthly-timeline/ptm-report/ptm-report.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, type FC } from 'react';\n\nimport { usePTMReportGet } from './api/use-ptm-report-get';\nimport { EPTMTypes, type IPTMReportProps } from './ptm-report-types';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport StudentInfo from './comps/student-info/student-info';\nimport * as Styled from './ptm-report-styled';\nimport KeyNeed from './comps/key-need/key-need';\nimport FlexView from '../../../ui/layout/flex-view';\nimport TeacherObservations from './comps/teacher-observations/teacher-observations';\nimport Strategies from './comps/strategies/strategies';\nimport ParentSupport from './comps/parent-support/parent-support';\nimport UpcomingChapters from './comps/upcoming-chapters/upcoming-chapters';\nimport RealWorldProjects from './comps/real-world-projects/real-world-projects';\nimport SchoolSupport from './comps/school-support/school-support';\nimport Error from '../../../ui/error/error';\n\nconst PTMReport: FC<IPTMReportProps> = ({ ptmId, onAPIComplete }) => {\n const {\n get: getPTMReport,\n data: ptmReportData,\n isProcessing,\n isProcessed,\n isProcessingFailed,\n } = usePTMReportGet(ptmId);\n\n const fetchPTMReport = useCallback(() => {\n getPTMReport(ptmId);\n }, [getPTMReport, ptmId]);\n\n useEffect(() => {\n fetchPTMReport();\n }, [fetchPTMReport]);\n\n useEffect(() => {\n if (isProcessed || isProcessingFailed) {\n onAPIComplete?.(isProcessed && !isProcessingFailed);\n }\n }, [isProcessed, isProcessingFailed, onAPIComplete]);\n\n if (isProcessing || !ptmReportData) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return <Error onTryAgain={fetchPTMReport} height=\"100dvh\" />;\n }\n\n const { ptm_config: ptmConfig, report } = ptmReportData;\n const { ptm_type: ptmType, config } = ptmConfig || {};\n const { ptm_report_sections: sectionsConfig, late_if_minutes: lateIfMinutes } = config || {};\n\n const {\n teacher_observation: teacherObservationConfig,\n learning_strategy: strategyConfig,\n parent_support: parentSupportConfig,\n school_support: schoolSupportConfig,\n } = sectionsConfig || {};\n\n const { subsections: schoolSubsections } = schoolSupportConfig || {};\n const { homework_help: homeworkConfig, test_help: testConfig } = schoolSubsections || {};\n\n const { options: parentOptions } = parentSupportConfig || {};\n const { strategies: strategiesConfig } = strategyConfig || {};\n const { subsections: teacherSubsections } = teacherObservationConfig || {};\n\n const {\n focus_area: focusAreaConfig,\n strengths: strengthsConfig,\n teacher_remarks: remarksConfig,\n } = teacherSubsections || {};\n\n const { areas: focusAreas = [], report_tag: focusAreaTag } = focusAreaConfig || {};\n const { areas: strengthAreas = [] } = strengthsConfig || {};\n const { report_tag: remarksTag } = remarksConfig || {};\n\n const { report_sections: reportSections, student_data: studentData } = report;\n\n const {\n teacher_observation: teacherObservationReport,\n parent_support: parentSupportReport,\n strategies: strategiesReport,\n real_world_project: realWorldReport,\n school_support: schoolSupportReport,\n upcoming_chapters: upcomingChaptersReport,\n } = reportSections || {};\n\n const { homework_help: homeworkReport, test_help: testReport } = schoolSupportReport || {};\n\n const { upcoming_chapters: upcomingChapters } = upcomingChaptersReport || {};\n\n const {\n strengths: strengthsReport = {},\n focus_area: selectedFocusAreaKey,\n teacher_remarks: teacherRemarks,\n } = teacherObservationReport || {};\n\n const {\n first_name: studentName,\n grade: studentGrade,\n key_need: keyNeedData,\n attendance_data: attendanceData,\n homework_data: homeworkData,\n late_class_data: lateClasses = [],\n real_world_project: realWorldProjectData,\n } = studentData || {};\n\n const { classes_completed: completedClasses, weeks_completed: completedWeeks } =\n attendanceData || {};\n\n const { sheets_assigned: assignedSheets, sheets_not_completed: incompleteSheets } =\n homeworkData || {};\n\n const selectedFocusArea = focusAreas.find(\n ({ area_key: areaKey }) => areaKey === selectedFocusAreaKey,\n );\n\n const keyNeedText = keyNeedData?.key_need ?? '';\n const isOnDemandPTM = ptmType === EPTMTypes.ON_DEMAND;\n const lateClassesCount = lateClasses.length;\n const isUpgradePTM = ptmType && ptmType.split('_').includes('UPGRADE');\n const isUpgradeOrOnDemandPTM = isOnDemandPTM || isUpgradePTM;\n\n return (\n <Styled.Container>\n <StudentInfo name={studentName} grade={studentGrade} />\n <FlexView $gutterX={1} $gapX={1}>\n <KeyNeed text={keyNeedText} />\n {isUpgradeOrOnDemandPTM && (\n <>\n <RealWorldProjects projectReport={realWorldReport} projectInfo={realWorldProjectData} />\n <SchoolSupport\n homeworkHelpReport={homeworkReport}\n homeworkHelpConfig={homeworkConfig}\n testHelpReport={testReport}\n testHelpConfig={testConfig}\n studentName={studentName}\n isOnDemandPTM={isOnDemandPTM}\n />\n </>\n )}\n <TeacherObservations\n strengthAreas={strengthAreas}\n strengthsReport={strengthsReport}\n focusArea={selectedFocusArea}\n focusAreaReportTag={focusAreaTag}\n teacherRemarks={teacherRemarks}\n teacherRemarkTag={remarksTag}\n />\n <Strategies report={strategiesReport} strategyConfig={strategiesConfig} />\n <ParentSupport\n report={parentSupportReport}\n options={parentOptions}\n classesCompleted={completedClasses}\n weeksCompleted={completedWeeks}\n sheetsAssigned={assignedSheets}\n sheetsNotCompleted={incompleteSheets}\n lateClassesCount={lateClassesCount}\n lateIfMinutes={lateIfMinutes}\n />\n {isOnDemandPTM && <UpcomingChapters chapters={upcomingChapters} />}\n </FlexView>\n </Styled.Container>\n );\n};\n\nexport default memo(PTMReport);\n"],"names":["PTMReport","ptmId","onAPIComplete","getPTMReport","ptmReportData","isProcessing","isProcessed","isProcessingFailed","usePTMReportGet","fetchPTMReport","useCallback","useEffect","jsx","AppLoader","Error","ptmConfig","report","ptmType","config","sectionsConfig","lateIfMinutes","teacherObservationConfig","strategyConfig","parentSupportConfig","schoolSupportConfig","schoolSubsections","homeworkConfig","testConfig","parentOptions","strategiesConfig","teacherSubsections","focusAreaConfig","strengthsConfig","remarksConfig","focusAreas","focusAreaTag","strengthAreas","remarksTag","reportSections","studentData","teacherObservationReport","parentSupportReport","strategiesReport","realWorldReport","schoolSupportReport","upcomingChaptersReport","homeworkReport","testReport","upcomingChapters","strengthsReport","selectedFocusAreaKey","teacherRemarks","studentName","studentGrade","keyNeedData","attendanceData","homeworkData","lateClasses","realWorldProjectData","completedClasses","completedWeeks","assignedSheets","incompleteSheets","selectedFocusArea","areaKey","keyNeedText","isOnDemandPTM","EPTMTypes","lateClassesCount","isUpgradePTM","jsxs","Styled.Container","StudentInfo","FlexView","KeyNeed","Fragment","RealWorldProjects","SchoolSupport","TeacherObservations","Strategies","ParentSupport","UpcomingChapters","ptmReport","memo"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAMA,KAAiC,CAAC,EAAE,OAAAC,GAA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ist/esm-browser/native.js"],"sourcesContent":["const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};"],"names":["randomUUID","native"],"mappings":"AAAA,MAAMA,IAAa,OAAO,SAAW,OAAe,OAAO,cAAc,OAAO,WAAW,KAAK,MAAM,GACvFC,IAAA;AAAA,EACb,YAAAD;AACF;","x_google_ignoreList":[0]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
let t;
|
|
2
|
+
const e = new Uint8Array(16);
|
|
2
3
|
function o() {
|
|
3
|
-
if (!t && (t = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)
|
|
4
|
+
if (!t && (t = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !t))
|
|
4
5
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
5
6
|
return t(e);
|
|
6
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rng.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/rng.js"],"sourcesContent":["// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\
|
|
1
|
+
{"version":3,"file":"rng.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/rng.js"],"sourcesContent":["// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}"],"names":["getRandomValues","rnds8","rng"],"mappings":"AAGA,IAAIA;AACJ,MAAMC,IAAQ,IAAI,WAAW,EAAE;AAChB,SAASC,IAAM;AAE5B,MAAI,CAACF,MAEHA,IAAkB,OAAO,SAAW,OAAe,OAAO,mBAAmB,OAAO,gBAAgB,KAAK,MAAM,GAE3G,CAACA;AACH,UAAM,IAAI,MAAM,0GAA0G;AAI9H,SAAOA,EAAgBC,CAAK;AAC9B;","x_google_ignoreList":[0]}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, o = (t[e[i + 0]] + t[e[i + 1]] + t[e[i + 2]] + t[e[i + 3]] + "-" + t[e[i + 4]] + t[e[i + 5]] + "-" + t[e[i + 6]] + t[e[i + 7]] + "-" + t[e[i + 8]] + t[e[i + 9]] + "-" + t[e[i + 10]] + t[e[i + 11]] + t[e[i + 12]] + t[e[i + 13]] + t[e[i + 14]] + t[e[i + 15]]).toLowerCase();
|
|
7
|
-
if (!s(o))
|
|
8
|
-
throw TypeError("Stringified UUID is invalid");
|
|
9
|
-
return o;
|
|
1
|
+
const i = [];
|
|
2
|
+
for (let n = 0; n < 256; ++n)
|
|
3
|
+
i.push((n + 256).toString(16).slice(1));
|
|
4
|
+
function c(n, u = 0) {
|
|
5
|
+
return (i[n[u + 0]] + i[n[u + 1]] + i[n[u + 2]] + i[n[u + 3]] + "-" + i[n[u + 4]] + i[n[u + 5]] + "-" + i[n[u + 6]] + i[n[u + 7]] + "-" + i[n[u + 8]] + i[n[u + 9]] + "-" + i[n[u + 10]] + i[n[u + 11]] + i[n[u + 12]] + i[n[u + 13]] + i[n[u + 14]] + i[n[u + 15]]).toLowerCase();
|
|
10
6
|
}
|
|
11
7
|
export {
|
|
12
|
-
|
|
8
|
+
c as unsafeStringify
|
|
13
9
|
};
|
|
14
10
|
//# sourceMappingURL=stringify.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringify.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/stringify.js"],"sourcesContent":["import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\
|
|
1
|
+
{"version":3,"file":"stringify.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/stringify.js"],"sourcesContent":["import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;"],"names":["byteToHex","i","unsafeStringify","arr","offset"],"mappings":"AAMA,MAAMA,IAAY,CAAA;AAElB,SAASC,IAAI,GAAGA,IAAI,KAAK,EAAEA;AACzB,EAAAD,EAAU,MAAMC,IAAI,KAAO,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC;AAG3C,SAASC,EAAgBC,GAAKC,IAAS,GAAG;AAG/C,UAAQJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAI,MAAMJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAI,MAAMJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAI,MAAMJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAI,MAAMJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,GAAG;AACvf;","x_google_ignoreList":[0]}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import e from "./native.js";
|
|
2
|
+
import i from "./rng.js";
|
|
3
|
+
import { unsafeStringify as d } from "./stringify.js";
|
|
4
|
+
function g(n, m, t) {
|
|
5
|
+
if (e.randomUUID && !m && !n)
|
|
6
|
+
return e.randomUUID();
|
|
4
7
|
n = n || {};
|
|
5
|
-
|
|
8
|
+
const r = n.random || (n.rng || i)();
|
|
6
9
|
if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, m) {
|
|
7
|
-
|
|
8
|
-
for (
|
|
9
|
-
m[
|
|
10
|
+
t = t || 0;
|
|
11
|
+
for (let a = 0; a < 16; ++a)
|
|
12
|
+
m[t + a] = r[a];
|
|
10
13
|
return m;
|
|
11
14
|
}
|
|
12
|
-
return
|
|
15
|
+
return d(r);
|
|
13
16
|
}
|
|
14
17
|
export {
|
|
15
|
-
|
|
18
|
+
g as default
|
|
16
19
|
};
|
|
17
20
|
//# sourceMappingURL=v4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v4.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/v4.js"],"sourcesContent":["import rng from './rng.js';\nimport
|
|
1
|
+
{"version":3,"file":"v4.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/v4.js"],"sourcesContent":["import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;"],"names":["v4","options","buf","offset","native","rnds","rng","i","unsafeStringify"],"mappings":";;;AAIA,SAASA,EAAGC,GAASC,GAAKC,GAAQ;AAChC,MAAIC,EAAO,cAAc,CAACF,KAAO,CAACD;AAChC,WAAOG,EAAO;AAGhB,EAAAH,IAAUA,KAAW;AACrB,QAAMI,IAAOJ,EAAQ,WAAWA,EAAQ,OAAOK;AAK/C,MAHAD,EAAK,CAAC,IAAIA,EAAK,CAAC,IAAI,KAAO,IAC3BA,EAAK,CAAC,IAAIA,EAAK,CAAC,IAAI,KAAO,KAEvBH,GAAK;AACP,IAAAC,IAASA,KAAU;AAEnB,aAASI,IAAI,GAAGA,IAAI,IAAI,EAAEA;AACxB,MAAAL,EAAIC,IAASI,CAAC,IAAIF,EAAKE,CAAC;AAG1B,WAAOL;AAAA,EACR;AAED,SAAOM,EAAgBH,CAAI;AAC7B;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"regex.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/regex.js"],"sourcesContent":["export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;"],"names":["REGEX"],"mappings":"AAAA,MAAAA,IAAe;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/validate.js"],"sourcesContent":["import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;"],"names":["validate","uuid","REGEX"],"mappings":";AAEA,SAASA,EAASC,GAAM;AACtB,SAAO,OAAOA,KAAS,YAAYC,EAAM,KAAKD,CAAI;AACpD;","x_google_ignoreList":[0]}
|