@cuemath/leap 3.3.24 → 3.3.25-af

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/dist/assets/lottie/lottie.js +2 -2
  2. package/dist/assets/lottie/lottie.js.map +1 -1
  3. package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +6 -6
  4. package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
  5. package/dist/features/auth/comps/pill-button/pill-button.js +19 -19
  6. package/dist/features/auth/comps/pill-button/pill-button.js.map +1 -1
  7. package/dist/features/auth/pla-signup/pla-analytics-events.js +4 -5
  8. package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
  9. package/dist/features/auth/pla-signup/signup-header/signup-header.js +1 -1
  10. package/dist/features/auth/pla-signup/signup-header/signup-header.js.map +1 -1
  11. package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js +24 -24
  12. package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js.map +1 -1
  13. package/dist/features/circle-games/hooks/use-circle-sounds/constants.js +5 -7
  14. package/dist/features/circle-games/hooks/use-circle-sounds/constants.js.map +1 -1
  15. package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js +71 -75
  16. package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js.map +1 -1
  17. package/dist/features/circle-games/sign-up/comp/circular-steps/circular-steps.js +12 -12
  18. package/dist/features/circle-games/sign-up/comp/circular-steps/circular-steps.js.map +1 -1
  19. package/dist/features/circle-games/sign-up/sign-up-types.js.map +1 -1
  20. package/dist/features/circle-games/sign-up/sign-up.js +128 -156
  21. package/dist/features/circle-games/sign-up/sign-up.js.map +1 -1
  22. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +29 -23
  23. package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +1 -1
  24. package/dist/features/journey/journey-id/journey-id-student.js +1 -1
  25. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  26. package/dist/features/milestone/create/comps/add-custom-chapter/add-custom-chapter.js +40 -42
  27. package/dist/features/milestone/create/comps/add-custom-chapter/add-custom-chapter.js.map +1 -1
  28. package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js +64 -70
  29. package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js.map +1 -1
  30. package/dist/features/milestone/create/comps/add-custom-chapter/hooks/use-catalog-helpers.js +29 -54
  31. package/dist/features/milestone/create/comps/add-custom-chapter/hooks/use-catalog-helpers.js.map +1 -1
  32. package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapter-category/chapter-category-container.js +28 -48
  33. package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapter-category/chapter-category-container.js.map +1 -1
  34. package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js +76 -79
  35. package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js.map +1 -1
  36. package/dist/features/milestone/create/comps/chapters-selection-step/utils.js +94 -97
  37. package/dist/features/milestone/create/comps/chapters-selection-step/utils.js.map +1 -1
  38. package/dist/features/milestone/create/comps/class-details-step/class-details-step.js +143 -160
  39. package/dist/features/milestone/create/comps/class-details-step/class-details-step.js.map +1 -1
  40. package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js +12 -22
  41. package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js.map +1 -1
  42. package/dist/features/milestone/create/comps/test-type-step/test-type-step.js +59 -64
  43. package/dist/features/milestone/create/comps/test-type-step/test-type-step.js.map +1 -1
  44. package/dist/features/milestone/create/milestone-create-container.js +15 -17
  45. package/dist/features/milestone/create/milestone-create-container.js.map +1 -1
  46. package/dist/features/milestone/create/milestone-create-helpers.js +153 -170
  47. package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
  48. package/dist/features/milestone/create/milestone-create-styled.js +1 -1
  49. package/dist/features/milestone/create/milestone-create-styled.js.map +1 -1
  50. package/dist/features/milestone/create/milestone-create.js +17 -19
  51. package/dist/features/milestone/create/milestone-create.js.map +1 -1
  52. package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +42 -45
  53. package/dist/features/parent-dashboard/hooks/use-parent-home-data.js.map +1 -1
  54. package/dist/features/parent-dashboard/parent-dashboard-types.js +2 -3
  55. package/dist/features/parent-dashboard/parent-dashboard-types.js.map +1 -1
  56. package/dist/features/parent-dashboard/parent-dashboard-view.js +127 -139
  57. package/dist/features/parent-dashboard/parent-dashboard-view.js.map +1 -1
  58. package/dist/features/sentry/constants/ignored.js +6 -10
  59. package/dist/features/sentry/constants/ignored.js.map +1 -1
  60. package/dist/features/trial-session/comps/pla/session-summary/session-summary-constants.js +7 -8
  61. package/dist/features/trial-session/comps/pla/session-summary/session-summary-constants.js.map +1 -1
  62. package/dist/features/trial-session/comps/pla/session-summary/session-summary.js +26 -27
  63. package/dist/features/trial-session/comps/pla/session-summary/session-summary.js.map +1 -1
  64. package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js +16 -16
  65. package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js.map +1 -1
  66. package/dist/features/trial-session/comps/school-goals/school-goals.js +24 -25
  67. package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
  68. package/dist/features/trial-session/comps/session-report/report-information/report-information-styled.js +13 -15
  69. package/dist/features/trial-session/comps/session-report/report-information/report-information-styled.js.map +1 -1
  70. package/dist/features/trial-session/comps/session-report/report-information/report-information.js +1 -1
  71. package/dist/features/trial-session/comps/session-report/report-information/report-information.js.map +1 -1
  72. package/dist/features/trial-session/comps/worksheet/worksheet.js +23 -23
  73. package/dist/features/trial-session/comps/worksheet/worksheet.js.map +1 -1
  74. package/dist/features/trial-session/trial-session-types.js.map +1 -1
  75. package/dist/features/ui/dot-lottie-animations/dot-lottie-animation.js +75 -88
  76. package/dist/features/ui/dot-lottie-animations/dot-lottie-animation.js.map +1 -1
  77. package/dist/features/ui/lottie-animation/lottie-animation.js +46 -55
  78. package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
  79. package/dist/features/ui/modals/modal-styled.js +15 -48
  80. package/dist/features/ui/modals/modal-styled.js.map +1 -1
  81. package/dist/features/ui/modals/modal.js +38 -46
  82. package/dist/features/ui/modals/modal.js.map +1 -1
  83. package/dist/features/{stickers/sticker-selector/comps/sticker/sticker-styled.js → ui/sticker-grid/sticker-grid-styles.js} +45 -15
  84. package/dist/features/ui/sticker-grid/sticker-grid-styles.js.map +1 -0
  85. package/dist/features/ui/sticker-grid/sticker-grid.js +24 -0
  86. package/dist/features/ui/sticker-grid/sticker-grid.js.map +1 -0
  87. package/dist/features/ui/sticker-grid/sticker.js +57 -0
  88. package/dist/features/ui/sticker-grid/sticker.js.map +1 -0
  89. package/dist/features/ui/stickers/constants.js +6 -0
  90. package/dist/features/ui/stickers/constants.js.map +1 -0
  91. package/dist/features/ui/stickers/stickers-effects.js +64 -0
  92. package/dist/features/ui/stickers/stickers-effects.js.map +1 -0
  93. package/dist/features/ui/stickers/stickers-styled.js +29 -0
  94. package/dist/features/ui/stickers/stickers-styled.js.map +1 -0
  95. package/dist/features/ui/stickers/stickers-utils.js +91 -0
  96. package/dist/features/ui/stickers/stickers-utils.js.map +1 -0
  97. package/dist/features/ui/stickers/stickers.js +40 -0
  98. package/dist/features/ui/stickers/stickers.js.map +1 -0
  99. package/dist/index.d.ts +59 -138
  100. package/dist/index.js +467 -485
  101. package/dist/index.js.map +1 -1
  102. package/dist/static/error.cbe1ddde.json +1 -0
  103. package/dist/static/username.9e034d51.json +1 -0
  104. package/package.json +1 -1
  105. package/dist/features/auth/signup-unavailable/signup-unavailable-styled.js +0 -16
  106. package/dist/features/auth/signup-unavailable/signup-unavailable-styled.js.map +0 -1
  107. package/dist/features/auth/signup-unavailable/signup-unavailable-view.js +0 -62
  108. package/dist/features/auth/signup-unavailable/signup-unavailable-view.js.map +0 -1
  109. package/dist/features/auth/signup-unavailable/signup-unavailable.js +0 -17
  110. package/dist/features/auth/signup-unavailable/signup-unavailable.js.map +0 -1
  111. package/dist/features/circle-games/hooks/use-circle-sounds/helper.js +0 -19
  112. package/dist/features/circle-games/hooks/use-circle-sounds/helper.js.map +0 -1
  113. package/dist/features/circle-games/sign-up/api/use-update-username-api/use-update-username-api.js +0 -9
  114. package/dist/features/circle-games/sign-up/api/use-update-username-api/use-update-username-api.js.map +0 -1
  115. package/dist/features/circle-games/sign-up/dal/update-username-dal/update-username-dal.js +0 -38
  116. package/dist/features/circle-games/sign-up/dal/update-username-dal/update-username-dal.js.map +0 -1
  117. package/dist/features/parent-dashboard/api/get-student-profile-summary.js +0 -9
  118. package/dist/features/parent-dashboard/api/get-student-profile-summary.js.map +0 -1
  119. package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction-styled.js +0 -10
  120. package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction-styled.js.map +0 -1
  121. package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js +0 -42
  122. package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js.map +0 -1
  123. package/dist/features/parent-dashboard/hooks/use-student-profile-summary-data.js +0 -24
  124. package/dist/features/parent-dashboard/hooks/use-student-profile-summary-data.js.map +0 -1
  125. package/dist/features/parent-dashboard/hooks/use-switch-user-journey.js +0 -71
  126. package/dist/features/parent-dashboard/hooks/use-switch-user-journey.js.map +0 -1
  127. package/dist/features/parent-dashboard/modals/help-and-support/help-and-support.js +0 -40
  128. package/dist/features/parent-dashboard/modals/help-and-support/help-and-support.js.map +0 -1
  129. package/dist/features/parent-dashboard/modals/student-login-info/student-login-info.js +0 -44
  130. package/dist/features/parent-dashboard/modals/student-login-info/student-login-info.js.map +0 -1
  131. package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-helpers.js +0 -32
  132. package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-helpers.js.map +0 -1
  133. package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-styled.js +0 -12
  134. package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-styled.js.map +0 -1
  135. package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js +0 -44
  136. package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js.map +0 -1
  137. package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js +0 -13
  138. package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js.map +0 -1
  139. package/dist/features/parent-dashboard/modals/trial-report/trial-report.js +0 -28
  140. package/dist/features/parent-dashboard/modals/trial-report/trial-report.js.map +0 -1
  141. package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-constants.js +0 -43
  142. package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-constants.js.map +0 -1
  143. package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js +0 -59
  144. package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js.map +0 -1
  145. package/dist/features/parent-dashboard/modals/tutor-change/tutor-change.js +0 -86
  146. package/dist/features/parent-dashboard/modals/tutor-change/tutor-change.js.map +0 -1
  147. package/dist/features/stickers/constants.js +0 -235
  148. package/dist/features/stickers/constants.js.map +0 -1
  149. package/dist/features/stickers/sticker-selector/comps/sticker/sticker-styled.js.map +0 -1
  150. package/dist/features/stickers/sticker-selector/comps/sticker/sticker.js +0 -49
  151. package/dist/features/stickers/sticker-selector/comps/sticker/sticker.js.map +0 -1
  152. package/dist/features/stickers/sticker-selector/comps/stiker-selector-grid/sticker-selector-grid-styled.js +0 -28
  153. package/dist/features/stickers/sticker-selector/comps/stiker-selector-grid/sticker-selector-grid-styled.js.map +0 -1
  154. package/dist/features/stickers/sticker-selector/comps/stiker-selector-grid/sticker-selector-grid.js +0 -26
  155. package/dist/features/stickers/sticker-selector/comps/stiker-selector-grid/sticker-selector-grid.js.map +0 -1
  156. package/dist/features/stickers/sticker-selector/sticker-selector-styled.js +0 -13
  157. package/dist/features/stickers/sticker-selector/sticker-selector-styled.js.map +0 -1
  158. package/dist/features/stickers/sticker-selector/sticker-selector.js +0 -86
  159. package/dist/features/stickers/sticker-selector/sticker-selector.js.map +0 -1
  160. package/dist/features/stickers/stickers-effects/stickers-effects-animations.js +0 -82
  161. package/dist/features/stickers/stickers-effects/stickers-effects-animations.js.map +0 -1
  162. package/dist/features/stickers/stickers-effects/stickers-effects-cache.js +0 -19
  163. package/dist/features/stickers/stickers-effects/stickers-effects-cache.js.map +0 -1
  164. package/dist/features/stickers/stickers-effects/stickers-effects-helper.js +0 -105
  165. package/dist/features/stickers/stickers-effects/stickers-effects-helper.js.map +0 -1
  166. package/dist/features/stickers/stickers-effects/stickers-effects-styled.js +0 -37
  167. package/dist/features/stickers/stickers-effects/stickers-effects-styled.js.map +0 -1
  168. package/dist/features/stickers/stickers-effects/stickers-effects.js +0 -67
  169. package/dist/features/stickers/stickers-effects/stickers-effects.js.map +0 -1
  170. package/dist/static/error.dd744fa5.json +0 -1
  171. package/dist/static/username.2c755605.json +0 -1
@@ -139,7 +139,7 @@ const b = C((A) => {
139
139
  $flexGap: 4,
140
140
  $alignItems: "center",
141
141
  $gap: 9,
142
- $gutter: e ? 0 : 8,
142
+ $gutter: 8,
143
143
  children: [
144
144
  /* @__PURE__ */ t(
145
145
  O,
@@ -1 +1 @@
1
- {"version":3,"file":"report-information.js","sources":["../../../../../../src/features/trial-session/comps/session-report/report-information/report-information.tsx"],"sourcesContent":["import type { TSessionReportData } from '../session-report-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport { useUIContext } from '../../../../ui/context/context';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\nimport Report404 from '../report-404/report-404';\nimport ReportCard from './report-card';\nimport * as Styled from './report-information-styled';\n\ninterface IReportInformationProps {\n sessionReports: TSessionReportData;\n studentName: string;\n}\n\nconst ReportInformation: FC<IReportInformationProps> = memo(props => {\n const theme = useTheme();\n const isMobile = theme.device <= EDeviceType.MOBILE;\n const { sessionReports, studentName } = props;\n const {\n next_steps: nextSteps,\n topic_data: topicData,\n solved_with_help: solvedWithHelp,\n problems_attempted: problemsAttempted,\n new_concepts_learnt: newConceptsLearnt,\n solved_independently: solvedIndependently,\n default_topic_image_url: defaultTopicImage,\n } = sessionReports || {};\n\n const { onEvent: trackEvent } = useUIContext();\n\n const renderReportsInfoCard = useMemo(() => {\n if (!problemsAttempted) return null;\n\n if (problemsAttempted === solvedIndependently || (!solvedWithHelp && solvedIndependently)) {\n return (\n <>\n <ReportCard title=\"Problems Attempted\" value={problemsAttempted} widthOnMobile=\"50%\" />\n <ReportCard title=\"Solved without help\" value={solvedIndependently} widthOnMobile=\"50%\" />\n <ReportCard\n title=\"Performance\"\n value={`${Math.round((solvedIndependently / problemsAttempted) * 100)}%`}\n />\n </>\n );\n }\n\n if (!solvedWithHelp && !solvedIndependently) {\n return <ReportCard title=\"Problems Attempted\" value={problemsAttempted} />;\n }\n\n if (solvedWithHelp && newConceptsLearnt) {\n return (\n <>\n <ReportCard title=\"Problems Attempted\" value={problemsAttempted} widthOnMobile=\"50%\" />\n <ReportCard title=\"Needed help in\" value={newConceptsLearnt} widthOnMobile=\"50%\" />\n <ReportCard title=\"Improvement shown in\" value={solvedWithHelp} widthOnMobile=\"50%\" />\n <ReportCard\n title=\"Improvement\"\n value={`${Math.round((solvedWithHelp / newConceptsLearnt) * 100)}%`}\n widthOnMobile=\"50%\"\n />\n </>\n );\n }\n\n return null;\n }, [newConceptsLearnt, problemsAttempted, solvedIndependently, solvedWithHelp]);\n\n if (!renderReportsInfoCard) return <Report404 studentName={studentName} />;\n\n return (\n <FlexView\n $borderColor={isMobile ? 'TRANSPARENT' : 'BLACK_1'}\n $gapX={isMobile ? 1 : 0}\n $background={isMobile ? 'BLACK_2' : 'TRANSPARENT'}\n $gutterX={isMobile ? 1 : 0}\n >\n <Styled.ReportWrapper\n $flexWrap={isMobile}\n $flexDirection=\"row\"\n $height={isMobile ? 'auto' : 100}\n $background={isMobile ? 'BLACK_2' : 'YELLOW_1'}\n >\n {renderReportsInfoCard}\n </Styled.ReportWrapper>\n <Styled.TopicWrapper\n $flexDirection={isMobile ? 'column' : 'row'}\n $background={isMobile ? 'BLACK_2' : 'WHITE_1'}\n $flexRowGapX={isMobile ? 1.25 : 0}\n $gapX={isMobile ? 1.5 : 0}\n >\n {topicData &&\n topicData.length > 0 &&\n topicData.map(topic => {\n const {\n topic_name: topicName,\n topic_image: topicImage,\n summary,\n is_attempted: isAttempted,\n } = topic;\n\n if (!topicImage) {\n trackEvent('TOPIC_THUMBNAIL_NOT_AVAILABLE', topic);\n }\n\n return (\n <FlexView\n key={topicName}\n $gap={isMobile ? 0 : 29}\n $gutter={isMobile ? 0 : 20}\n $flex={1}\n $alignItems={isMobile ? 'center' : 'center'}\n $opacity={isAttempted ? 1 : 0.4}\n $flexDirection={isMobile ? 'row' : 'column'}\n $flexColumnGapX={isMobile ? 1 : 0}\n >\n <FlexView>\n <Styled.TopicImage\n $active={!!isAttempted}\n src={topicImage || defaultTopicImage}\n borderRadius={96}\n height={isMobile ? 84 : 96}\n width={isMobile ? 84 : 96}\n alt=\"topic\"\n withLoader\n />\n </FlexView>\n <FlexView $alignItems={isMobile ? 'flex-start' : 'center'} $gapX={1} $flex={1}>\n {!isMobile && <Separator height={12} />}\n <Text\n $renderAs=\"ab2-bold\"\n $align={isMobile ? 'left' : 'center'}\n $color={isMobile ? 'WHITE' : 'BLACK_1'}\n >\n {topicName}\n </Text>\n <Separator height={2} />\n <Text\n $renderAs=\"ub2\"\n $align={isMobile ? 'left' : 'center'}\n $color={isMobile ? 'WHITE' : 'BLACK_1'}\n >\n {summary}\n </Text>\n </FlexView>\n </FlexView>\n );\n })}\n </Styled.TopicWrapper>\n {isMobile && (\n <FlexView $background=\"BLACK_2\">\n <Text $renderAs=\"ac4-black\" $color=\"WHITE_T_60\">\n Next Steps\n </Text>\n <Separator height={4} />\n </FlexView>\n )}\n <FlexView\n $flexDirection=\"row\"\n $background={isMobile ? 'BLACK_2' : 'YELLOW_3'}\n $flexGap={4}\n $alignItems=\"center\"\n $gap={9}\n $gutter={isMobile ? 0 : 8}\n >\n <Image\n src={isMobile ? ILLUSTRATIONS.COMMUNITY_BULB_YELLOW_2 : ILLUSTRATIONS.COMMUNITY_BULB}\n width={isMobile ? 56 : 80}\n height={isMobile ? 56 : 80}\n withLoader\n alt=\"bulb\"\n />\n <FlexView $flex={1}>\n <Text $renderAs=\"ab2-black\" $color={isMobile ? 'WHITE_1' : 'BLACK_1'}>\n {!isMobile && `Next Steps: `}\n <Styled.InlineText\n $renderAs=\"ab2\"\n $renderOnMobileAs=\"ub2\"\n $color={isMobile ? 'WHITE_1' : 'BLACK_1'}\n >\n {nextSteps}\n </Styled.InlineText>\n </Text>\n </FlexView>\n </FlexView>\n {isMobile && <Separator heightX={1} />}\n </FlexView>\n );\n});\n\nReportInformation.displayName = 'ReportInformation';\n\nexport default ReportInformation;\n"],"names":["ReportInformation","memo","props","isMobile","useTheme","EDeviceType","sessionReports","studentName","nextSteps","topicData","solvedWithHelp","problemsAttempted","newConceptsLearnt","solvedIndependently","defaultTopicImage","trackEvent","useUIContext","renderReportsInfoCard","useMemo","jsxs","Fragment","jsx","ReportCard","FlexView","Styled.ReportWrapper","Styled.TopicWrapper","topic","topicName","topicImage","summary","isAttempted","Styled.TopicImage","Separator","Text","Image","ILLUSTRATIONS","Styled.InlineText","Report404","ReportInformation$1"],"mappings":";;;;;;;;;;;;;AAsBA,MAAMA,IAAiDC,EAAK,CAASC,MAAA;AAE7D,QAAAC,IADQC,IACS,UAAUC,EAAY,QACvC,EAAE,gBAAAC,GAAgB,aAAAC,EAAgB,IAAAL,GACl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A,YAExB,UAAA;AAAA,cAAA,gBAAAkB;AAAA,gBAACa;AAAA,gBAAA;AAAA,kBACC,KAAK/B,IAAWgC,EAAc,0BAA0BA,EAAc;AAAA,kBACtE,OAAOhC,IAAW,KAAK;AAAA,kBACvB,QAAQA,IAAW,KAAK;AAAA,kBACxB,YAAU;AAAA,kBACV,KAAI;AAAA,gBAAA;AAAA,cACN;AAAA,cACA,gBAAAkB,EAACE,GAAS,EAAA,OAAO,GACf,UAAA,gBAAAJ,EAACc,GAAK,EAAA,WAAU,aAAY,QAAQ9B,IAAW,YAAY,WACxD,UAAA;AAAA,gBAAA,CAACA,KAAY;AAAA,gBACd,gBAAAkB;AAAA,kBAACe;AAAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,mBAAkB;AAAA,oBAClB,QAAQjC,IAAW,YAAY;AAAA,oBAE9B,UAAAK;AAAA,kBAAA;AAAA,gBACH;AAAA,cAAA,EAAA,CACF,EACF,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,QACCL,KAAY,gBAAAkB,EAACW,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IArHL,gBAAAX,EAACgB,KAAU,aAAA9B,EAA0B,CAAA;AAwH1E,CAAC;AAEDP,EAAkB,cAAc;AAEhC,MAAAsC,IAAetC;"}
1
+ {"version":3,"file":"report-information.js","sources":["../../../../../../src/features/trial-session/comps/session-report/report-information/report-information.tsx"],"sourcesContent":["import type { TSessionReportData } from '../session-report-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport { useUIContext } from '../../../../ui/context/context';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\nimport Report404 from '../report-404/report-404';\nimport ReportCard from './report-card';\nimport * as Styled from './report-information-styled';\n\ninterface IReportInformationProps {\n sessionReports: TSessionReportData;\n studentName: string;\n}\n\nconst ReportInformation: FC<IReportInformationProps> = memo(props => {\n const theme = useTheme();\n const isMobile = theme.device <= EDeviceType.MOBILE;\n const { sessionReports, studentName } = props;\n const {\n next_steps: nextSteps,\n topic_data: topicData,\n solved_with_help: solvedWithHelp,\n problems_attempted: problemsAttempted,\n new_concepts_learnt: newConceptsLearnt,\n solved_independently: solvedIndependently,\n default_topic_image_url: defaultTopicImage,\n } = sessionReports || {};\n\n const { onEvent: trackEvent } = useUIContext();\n\n const renderReportsInfoCard = useMemo(() => {\n if (!problemsAttempted) return null;\n\n if (problemsAttempted === solvedIndependently || (!solvedWithHelp && solvedIndependently)) {\n return (\n <>\n <ReportCard title=\"Problems Attempted\" value={problemsAttempted} widthOnMobile=\"50%\" />\n <ReportCard title=\"Solved without help\" value={solvedIndependently} widthOnMobile=\"50%\" />\n <ReportCard\n title=\"Performance\"\n value={`${Math.round((solvedIndependently / problemsAttempted) * 100)}%`}\n />\n </>\n );\n }\n\n if (!solvedWithHelp && !solvedIndependently) {\n return <ReportCard title=\"Problems Attempted\" value={problemsAttempted} />;\n }\n\n if (solvedWithHelp && newConceptsLearnt) {\n return (\n <>\n <ReportCard title=\"Problems Attempted\" value={problemsAttempted} widthOnMobile=\"50%\" />\n <ReportCard title=\"Needed help in\" value={newConceptsLearnt} widthOnMobile=\"50%\" />\n <ReportCard title=\"Improvement shown in\" value={solvedWithHelp} widthOnMobile=\"50%\" />\n <ReportCard\n title=\"Improvement\"\n value={`${Math.round((solvedWithHelp / newConceptsLearnt) * 100)}%`}\n widthOnMobile=\"50%\"\n />\n </>\n );\n }\n\n return null;\n }, [newConceptsLearnt, problemsAttempted, solvedIndependently, solvedWithHelp]);\n\n if (!renderReportsInfoCard) return <Report404 studentName={studentName} />;\n\n return (\n <FlexView\n $borderColor={isMobile ? 'TRANSPARENT' : 'BLACK_1'}\n $gapX={isMobile ? 1 : 0}\n $background={isMobile ? 'BLACK_2' : 'TRANSPARENT'}\n $gutterX={isMobile ? 1 : 0}\n >\n <Styled.ReportWrapper\n $flexWrap={isMobile}\n $flexDirection=\"row\"\n $height={isMobile ? 'auto' : 100}\n $background={isMobile ? 'BLACK_2' : 'YELLOW_1'}\n >\n {renderReportsInfoCard}\n </Styled.ReportWrapper>\n <Styled.TopicWrapper\n $flexDirection={isMobile ? 'column' : 'row'}\n $background={isMobile ? 'BLACK_2' : 'WHITE_1'}\n $flexRowGapX={isMobile ? 1.25 : 0}\n $gapX={isMobile ? 1.5 : 0}\n >\n {topicData &&\n topicData.length > 0 &&\n topicData.map(topic => {\n const {\n topic_name: topicName,\n topic_image: topicImage,\n summary,\n is_attempted: isAttempted,\n } = topic;\n\n if (!topicImage) {\n trackEvent('TOPIC_THUMBNAIL_NOT_AVAILABLE', topic);\n }\n\n return (\n <FlexView\n key={topicName}\n $gap={isMobile ? 0 : 29}\n $gutter={isMobile ? 0 : 20}\n $flex={1}\n $alignItems={isMobile ? 'center' : 'center'}\n $opacity={isAttempted ? 1 : 0.4}\n $flexDirection={isMobile ? 'row' : 'column'}\n $flexColumnGapX={isMobile ? 1 : 0}\n >\n <FlexView>\n <Styled.TopicImage\n $active={!!isAttempted}\n src={topicImage || defaultTopicImage}\n borderRadius={96}\n height={isMobile ? 84 : 96}\n width={isMobile ? 84 : 96}\n alt=\"topic\"\n withLoader\n />\n </FlexView>\n <FlexView $alignItems={isMobile ? 'flex-start' : 'center'} $gapX={1} $flex={1}>\n {!isMobile && <Separator height={12} />}\n <Text\n $renderAs=\"ab2-bold\"\n $align={isMobile ? 'left' : 'center'}\n $color={isMobile ? 'WHITE' : 'BLACK_1'}\n >\n {topicName}\n </Text>\n <Separator height={2} />\n <Text\n $renderAs=\"ub2\"\n $align={isMobile ? 'left' : 'center'}\n $color={isMobile ? 'WHITE' : 'BLACK_1'}\n >\n {summary}\n </Text>\n </FlexView>\n </FlexView>\n );\n })}\n </Styled.TopicWrapper>\n {isMobile && (\n <FlexView $background=\"BLACK_2\">\n <Text $renderAs=\"ac4-black\" $color=\"WHITE_T_60\">\n Next Steps\n </Text>\n <Separator height={4} />\n </FlexView>\n )}\n <FlexView\n $flexDirection=\"row\"\n $background={isMobile ? 'BLACK_2' : 'YELLOW_3'}\n $flexGap={4}\n $alignItems=\"center\"\n $gap={9}\n $gutter={8}\n >\n <Image\n src={isMobile ? ILLUSTRATIONS.COMMUNITY_BULB_YELLOW_2 : ILLUSTRATIONS.COMMUNITY_BULB}\n width={isMobile ? 56 : 80}\n height={isMobile ? 56 : 80}\n withLoader\n alt=\"bulb\"\n />\n <FlexView $flex={1}>\n <Text $renderAs=\"ab2-black\" $color={isMobile ? 'WHITE_1' : 'BLACK_1'}>\n {!isMobile && `Next Steps: `}\n <Styled.InlineText\n $renderAs=\"ab2\"\n $renderOnMobileAs=\"ub2\"\n $color={isMobile ? 'WHITE_1' : 'BLACK_1'}\n >\n {nextSteps}\n </Styled.InlineText>\n </Text>\n </FlexView>\n </FlexView>\n {isMobile && <Separator heightX={1} />}\n </FlexView>\n );\n});\n\nReportInformation.displayName = 'ReportInformation';\n\nexport default ReportInformation;\n"],"names":["ReportInformation","memo","props","isMobile","useTheme","EDeviceType","sessionReports","studentName","nextSteps","topicData","solvedWithHelp","problemsAttempted","newConceptsLearnt","solvedIndependently","defaultTopicImage","trackEvent","useUIContext","renderReportsInfoCard","useMemo","jsxs","Fragment","jsx","ReportCard","FlexView","Styled.ReportWrapper","Styled.TopicWrapper","topic","topicName","topicImage","summary","isAttempted","Styled.TopicImage","Separator","Text","Image","ILLUSTRATIONS","Styled.InlineText","Report404","ReportInformation$1"],"mappings":";;;;;;;;;;;;;AAsBA,MAAMA,IAAiDC,EAAK,CAASC,MAAA;AAE7D,QAAAC,IADQC,IACS,UAAUC,EAAY,QACvC,EAAE,gBAAAC,GAAgB,aAAAC,EAAgB,IAAAL,GAClC;AAAA,IACJ,YAAY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kB;AAAA,gBAACa;AAAA,gBAAA;AAAA,kBACC,KAAK/B,IAAWgC,EAAc,0BAA0BA,EAAc;AAAA,kBACtE,OAAOhC,IAAW,KAAK;AAAA,kBACvB,QAAQA,IAAW,KAAK;AAAA,kBACxB,YAAU;AAAA,kBACV,KAAI;AAAA,gBAAA;AAAA,cACN;AAAA,cACA,gBAAAkB,EAACE,GAAS,EAAA,OAAO,GACf,UAAA,gBAAAJ,EAACc,GAAK,EAAA,WAAU,aAAY,QAAQ9B,IAAW,YAAY,WACxD,UAAA;AAAA,gBAAA,CAACA,KAAY;AAAA,gBACd,gBAAAkB;AAAA,kBAACe;AAAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,mBAAkB;AAAA,oBAClB,QAAQjC,IAAW,YAAY;AAAA,oBAE9B,UAAAK;AAAA,kBAAA;AAAA,gBACH;AAAA,cAAA,EAAA,CACF,EACF,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,QACCL,KAAY,gBAAAkB,EAACW,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IArHL,gBAAAX,EAACgB,KAAU,aAAA9B,EAA0B,CAAA;AAwH1E,CAAC;AAEDP,EAAkB,cAAc;AAEhC,MAAAsC,IAAetC;"}
@@ -1,30 +1,30 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { useState as T, useCallback as k, useEffect as x } from "react";
3
- import E from "../../../ui/error/error.js";
4
- import A from "../../../ui/loader/app-loader/app-loader.js";
5
- import { useResumeTrialWorksheet as D } from "../../api/trial-nodes.js";
6
- import { useTrialSessionContext as N } from "../../context/use-trial-session-context.js";
7
- const P = () => {
8
- const { isTeacher: o, studentId: t, worksheet: r, updateSlideConfig: c, trialHomeData: f } = N(), [m, s] = T(!1), { demo_info: p } = f, { region_data: l, course: n } = p || {}, { opportunity_country: i = "US" } = l || {}, _ = (g, a) => {
9
- if (g && s(!0), a) {
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { useState as S, useCallback as T, useEffect as k } from "react";
3
+ import x from "../../../ui/error/error.js";
4
+ import E from "../../../ui/loader/app-loader/app-loader.js";
5
+ import { useResumeTrialWorksheet as A } from "../../api/trial-nodes.js";
6
+ import { useTrialSessionContext as D } from "../../context/use-trial-session-context.js";
7
+ const L = () => {
8
+ const { isTeacher: o, studentId: t, worksheet: r, updateSlideConfig: u, trialHomeData: c } = D(), [f, s] = S(!1), { demo_info: m } = c, { region_data: p } = m || {}, { opportunity_country: n = "US" } = p || {}, l = (h, d) => {
9
+ if (h && s(!0), d) {
10
10
  const {
11
- user_node_id: y,
12
- node_id: I,
13
- user_attempt_id: C,
14
- node_type: S
15
- } = a;
16
- c({ userNodeId: y, nodeId: I, attemptId: C, nodeType: S });
11
+ user_node_id: g,
12
+ node_id: y,
13
+ user_attempt_id: I,
14
+ node_type: C
15
+ } = d;
16
+ u({ userNodeId: g, nodeId: y, attemptId: I, nodeType: C });
17
17
  }
18
- }, { patch: d, isProcessing: h } = D({
19
- onComplete: _
20
- }), e = k(() => {
21
- o && (s(!1), d(t, { country_code: i, course: n }));
22
- }, [i, n, o, d, t]);
23
- return x(() => {
18
+ }, { patch: i, isProcessing: _ } = A({
19
+ onComplete: l
20
+ }), e = T(() => {
21
+ o && (s(!1), i(t, { country_code: n }));
22
+ }, [n, o, i, t]);
23
+ return k(() => {
24
24
  e();
25
- }, [e]), m ? /* @__PURE__ */ u(E, { height: "100%", onTryAgain: e }) : h || !r ? /* @__PURE__ */ u(A, { height: "100%" }) : r;
25
+ }, [e]), f ? /* @__PURE__ */ a(x, { height: "100%", onTryAgain: e }) : _ || !r ? /* @__PURE__ */ a(E, { height: "100%" }) : r;
26
26
  };
27
27
  export {
28
- P as default
28
+ L as default
29
29
  };
30
30
  //# sourceMappingURL=worksheet.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"worksheet.js","sources":["../../../../../src/features/trial-session/comps/worksheet/worksheet.tsx"],"sourcesContent":["import type { IResumeWorksheetModel } from '../../../../types/models/worksheet';\nimport type { FC } from 'react';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport Error from '../../../ui/error/error';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport { useResumeTrialWorksheet } from '../../api/trial-nodes';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\n\nconst SessionWorksheet: FC = () => {\n const { isTeacher, studentId, worksheet, updateSlideConfig, trialHomeData } =\n useTrialSessionContext();\n const [isError, setIserror] = useState<boolean>(false);\n\n const { demo_info: demoInfo } = trialHomeData;\n const { region_data: regionData, course } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const onComplete = (error: string | null, sheetData?: IResumeWorksheetModel) => {\n if (error) {\n setIserror(true);\n }\n\n if (sheetData) {\n const {\n user_node_id: userNodeId,\n node_id: nodeId,\n user_attempt_id: attemptId,\n node_type: nodeType,\n } = sheetData;\n\n updateSlideConfig({ userNodeId, nodeId, attemptId, nodeType });\n }\n };\n\n const { patch: resumeNode, isProcessing } = useResumeTrialWorksheet({\n onComplete,\n });\n\n const fetchData = useCallback(() => {\n if (isTeacher) {\n setIserror(false);\n resumeNode(studentId, { country_code: countryCode, course });\n }\n }, [countryCode, course, isTeacher, resumeNode, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isError) {\n return <Error height=\"100%\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || !worksheet) {\n return <AppLoader height=\"100%\" />;\n }\n\n return worksheet;\n};\n\nexport default SessionWorksheet;\n"],"names":["SessionWorksheet","isTeacher","studentId","worksheet","updateSlideConfig","trialHomeData","useTrialSessionContext","isError","setIserror","useState","demoInfo","regionData","course","countryCode","onComplete","error","sheetData","userNodeId","nodeId","attemptId","nodeType","resumeNode","isProcessing","useResumeTrialWorksheet","fetchData","useCallback","useEffect","jsx","Error","AppLoader"],"mappings":";;;;;;AAUA,MAAMA,IAAuB,MAAM;AACjC,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,WAAAC,GAAW,mBAAAC,GAAmB,eAAAC,EAAA,IAC1DC,KACI,CAACC,GAASC,CAAU,IAAIC,EAAkB,EAAK,GAE/C,EAAE,WAAWC,EAAa,IAAAL,GAC1B,EAAE,aAAaM,GAAY,QAAAC,EAAO,IAAIF,KAAY,CAAA,GAClD,EAAE,qBAAqBG,IAAc,KAAK,IAAIF,KAAc,CAAA,GAE5DG,IAAa,CAACC,GAAsBC,MAAsC;AAK9E,QAJID,KACFP,EAAW,EAAI,GAGbQ,GAAW;AACP,YAAA;AAAA,QACJ,cAAcC;AAAA,QACd,SAASC;AAAA,QACT,iBAAiBC;AAAA,QACjB,WAAWC;AAAA,MACT,IAAAJ;AAEJ,MAAAZ,EAAkB,EAAE,YAAAa,GAAY,QAAAC,GAAQ,WAAAC,GAAW,UAAAC,EAAU,CAAA;AAAA,IAC/D;AAAA,EAAA,GAGI,EAAE,OAAOC,GAAY,cAAAC,EAAA,IAAiBC,EAAwB;AAAA,IAClE,YAAAT;AAAA,EAAA,CACD,GAEKU,IAAYC,EAAY,MAAM;AAClC,IAAIxB,MACFO,EAAW,EAAK,GAChBa,EAAWnB,GAAW,EAAE,cAAcW,GAAa,QAAAD,EAAQ,CAAA;AAAA,EAC7D,GACC,CAACC,GAAaD,GAAQX,GAAWoB,GAAYnB,CAAS,CAAC;AAM1D,SAJAwB,EAAU,MAAM;AACJ,IAAAF;EAAA,GACT,CAACA,CAAS,CAAC,GAEVjB,IACM,gBAAAoB,EAAAC,GAAA,EAAM,QAAO,QAAO,YAAYJ,EAAW,CAAA,IAGjDF,KAAgB,CAACnB,IACZ,gBAAAwB,EAACE,GAAU,EAAA,QAAO,OAAO,CAAA,IAG3B1B;AACT;"}
1
+ {"version":3,"file":"worksheet.js","sources":["../../../../../src/features/trial-session/comps/worksheet/worksheet.tsx"],"sourcesContent":["import type { IResumeWorksheetModel } from '../../../../types/models/worksheet';\nimport type { FC } from 'react';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport Error from '../../../ui/error/error';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport { useResumeTrialWorksheet } from '../../api/trial-nodes';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\n\nconst SessionWorksheet: FC = () => {\n const { isTeacher, studentId, worksheet, updateSlideConfig, trialHomeData } =\n useTrialSessionContext();\n const [isError, setIserror] = useState<boolean>(false);\n\n const { demo_info: demoInfo } = trialHomeData;\n const { region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const onComplete = (error: string | null, sheetData?: IResumeWorksheetModel) => {\n if (error) {\n setIserror(true);\n }\n\n if (sheetData) {\n const {\n user_node_id: userNodeId,\n node_id: nodeId,\n user_attempt_id: attemptId,\n node_type: nodeType,\n } = sheetData;\n\n updateSlideConfig({ userNodeId, nodeId, attemptId, nodeType });\n }\n };\n\n const { patch: resumeNode, isProcessing } = useResumeTrialWorksheet({\n onComplete,\n });\n\n const fetchData = useCallback(() => {\n if (isTeacher) {\n setIserror(false);\n resumeNode(studentId, { country_code: countryCode });\n }\n }, [countryCode, isTeacher, resumeNode, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isError) {\n return <Error height=\"100%\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || !worksheet) {\n return <AppLoader height=\"100%\" />;\n }\n\n return worksheet;\n};\n\nexport default SessionWorksheet;\n"],"names":["SessionWorksheet","isTeacher","studentId","worksheet","updateSlideConfig","trialHomeData","useTrialSessionContext","isError","setIserror","useState","demoInfo","regionData","countryCode","onComplete","error","sheetData","userNodeId","nodeId","attemptId","nodeType","resumeNode","isProcessing","useResumeTrialWorksheet","fetchData","useCallback","useEffect","jsx","Error","AppLoader"],"mappings":";;;;;;AAUA,MAAMA,IAAuB,MAAM;AACjC,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,WAAAC,GAAW,mBAAAC,GAAmB,eAAAC,EAAA,IAC1DC,KACI,CAACC,GAASC,CAAU,IAAIC,EAAkB,EAAK,GAE/C,EAAE,WAAWC,EAAa,IAAAL,GAC1B,EAAE,aAAaM,MAAeD,KAAY,CAAA,GAC1C,EAAE,qBAAqBE,IAAc,KAAK,IAAID,KAAc,CAAA,GAE5DE,IAAa,CAACC,GAAsBC,MAAsC;AAK9E,QAJID,KACFN,EAAW,EAAI,GAGbO,GAAW;AACP,YAAA;AAAA,QACJ,cAAcC;AAAA,QACd,SAASC;AAAA,QACT,iBAAiBC;AAAA,QACjB,WAAWC;AAAA,MACT,IAAAJ;AAEJ,MAAAX,EAAkB,EAAE,YAAAY,GAAY,QAAAC,GAAQ,WAAAC,GAAW,UAAAC,EAAU,CAAA;AAAA,IAC/D;AAAA,EAAA,GAGI,EAAE,OAAOC,GAAY,cAAAC,EAAA,IAAiBC,EAAwB;AAAA,IAClE,YAAAT;AAAA,EAAA,CACD,GAEKU,IAAYC,EAAY,MAAM;AAClC,IAAIvB,MACFO,EAAW,EAAK,GAChBY,EAAWlB,GAAW,EAAE,cAAcU,EAAa,CAAA;AAAA,KAEpD,CAACA,GAAaX,GAAWmB,GAAYlB,CAAS,CAAC;AAMlD,SAJAuB,EAAU,MAAM;AACJ,IAAAF;EAAA,GACT,CAACA,CAAS,CAAC,GAEVhB,IACM,gBAAAmB,EAAAC,GAAA,EAAM,QAAO,QAAO,YAAYJ,EAAW,CAAA,IAGjDF,KAAgB,CAAClB,IACZ,gBAAAuB,EAACE,GAAU,EAAA,QAAO,OAAO,CAAA,IAG3BzB;AACT;"}
@@ -1 +1 @@
1
- {"version":3,"file":"trial-session-types.js","sources":["../../../src/features/trial-session/trial-session-types.ts"],"sourcesContent":["import type { TNodeTypes } from '../../types/models/worksheet';\nimport type { IInfoMessage } from '../circle-games/games/web-view/web-view-types';\nimport type {\n IMilestoneConfig,\n TCourseStream,\n TPreferenceCategory,\n} from '../milestone/create/milestone-create-types';\nimport type { IAvatarLayer } from '../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { TPreference } from './comps/class-preference/class-preference-types';\nimport type {\n ITrialCircleConfig,\n ITrialCircleGameParams,\n} from './comps/trial-circle-game/trial-circle-game-types';\nimport type { TrialPageId } from './trial-session-constants';\nimport type { Dispatch, ReactElement, SetStateAction } from 'react';\n\nexport type { TSessionReportData as TSessionReport } from './comps/session-report/session-report-types';\n\nexport type TSlideId = TrialPageId;\n\nexport type TRegionData = {\n opportunity_country: string;\n};\n\nexport type TPreferenceSchema = {\n preference_code: string;\n preference_name: string;\n preference_category: TPreferenceCategory;\n};\n\nexport enum EClassTimeAlertLevel {\n FIVE_MIN = '5min',\n FIFTEEN_MIN = '15min',\n}\ninterface IButtonConfig {\n buttonLabel: string;\n pageId: string;\n}\n\nexport interface ISolution {\n media?: string;\n media_type?: 'image' | 'video';\n text?: string;\n}\n\nexport type TDegreeInformation = {\n degree_name?: string;\n field_of_study?: string;\n degree_code?: string;\n};\n\nexport interface ITeacherProfileDetails {\n lower_grade: string;\n higher_grade: string;\n header_image: string;\n years_of_experience: number;\n number_of_students_taught: number;\n countries: string[];\n degree: TDegreeInformation;\n first_name: string;\n last_name: string;\n teacher_profile_url?: string;\n}\n\nexport interface ISlide {\n id: TrialPageId;\n renderAs: 'split' | 'full';\n renderAVIn: 'left' | 'right';\n header: string;\n subHeader?: string;\n prevPage?: IButtonConfig;\n nextPage?: IButtonConfig;\n cues?: string[];\n dos?: string[];\n donts?: string[];\n navigationLabel?: string;\n slideTag?: string;\n teacher_profile?: ITeacherProfileDetails;\n solutions?: ISolution[];\n enableSessionPerk?: boolean;\n showProfileHighlights?: boolean;\n}\n\nexport interface TGoals {\n goal_code?: string;\n milestone_date_ts?: number;\n goal_category?: string;\n milestone_name?: string;\n publish?: boolean;\n}\n\nexport interface ITrialSessionFormFields {\n id: string;\n name?: string;\n grade?: string;\n curriculum?: string;\n goals?: TGoals[];\n studentProfile?: {\n profileSummary?: string;\n dummyProfileImageIndex?: number;\n summaryFetched?: boolean;\n summaryFetchFailed?: boolean;\n };\n userNodeId?: string;\n nodeId?: string;\n nodeType?: TNodeTypes;\n attemptId?: string;\n preferences?: TPreference[];\n personalizedLevel?: string[];\n personalizedFocus?: string[];\n personalizedBehaviors?: string[];\n personalizedObjectives?: string[];\n isCircleGamePlayed?: boolean;\n isCirclePuzzleSolved?: boolean;\n isCircleSkillCompleted?: boolean;\n studentTimezone?: string;\n showCircleGameScreen?: boolean;\n accuracyStr?: string;\n totalTimeTaken?: number;\n chapterId?: string;\n matchmakingId?: string;\n numberInNameError?: boolean;\n}\n\nexport interface IButtonState {\n isDisabled: boolean;\n isLoading: boolean;\n}\n\nexport interface ITrialHomeData {\n pages: ISlide[];\n demo_info: {\n student_classroom_id: string;\n stream: TCourseStream;\n region_data: TRegionData;\n course?: string;\n };\n parent: {\n name: string;\n };\n student: {\n grade: string;\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n teacher: {\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n circle_trial_game_config: ITrialCircleConfig;\n}\n\nexport interface IClassTimeAlertConfig {\n alertLevel: EClassTimeAlertLevel | null;\n isVisible: boolean;\n onComplete: () => void;\n}\n\nexport interface ITrialSessionProps {\n countryCode?: string;\n classStartedOn?: Date;\n height?: string | number;\n userType: TUserTypes;\n studentId: string;\n teacherId: string;\n teacherClassroomId: string;\n teacherPanel?: ReactElement;\n studentPanel?: ReactElement;\n formData?: ITrialSessionFormFields;\n onFormDataChange?: Dispatch<SetStateAction<ITrialSessionFormFields | undefined>>;\n worksheet?: ReactElement;\n worksheetNavigationPanel?: ReactElement;\n questionsRatingPanel?: ReactElement;\n studentAbsentInClass?: boolean;\n openEndClassModal?: () => void;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n classTimeAlertConfig?: IClassTimeAlertConfig;\n classDuration?: number;\n}\n\nexport interface ITrialSessionContext\n extends Pick<\n ITrialSessionProps,\n | 'classStartedOn'\n | 'formData'\n | 'teacherPanel'\n | 'studentId'\n | 'teacherId'\n | 'studentPanel'\n | 'worksheet'\n | 'worksheetNavigationPanel'\n | 'questionsRatingPanel'\n | 'openEndClassModal'\n | 'studentAbsentInClass'\n | 'classDuration'\n | 'classTimeAlertConfig'\n > {\n buttonState: { left: IButtonState; right: IButtonState };\n isTeacher: boolean;\n milestoneConfig: IMilestoneConfig;\n slideConfig: ISlide;\n updateButtonState: (\n btnNavDir: 'left' | 'right' | 'both',\n currentState: IButtonState | { left: IButtonState; right: IButtonState },\n ) => void;\n updateSlideConfig: (config: Partial<ITrialSessionFormFields>) => void;\n trialHomeData: ITrialHomeData;\n onTrialInformationUpdate?: () => void;\n circleGames: ITrialCircleGameParams;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n\nexport interface ITrialSessionViewProps extends ITrialSessionProps {\n trialHomeData: ITrialHomeData;\n milestoneConfig: IMilestoneConfig;\n studentTimezone?: string;\n onStudentTimezoneUpdate?: () => void;\n onTrialInformationUpdate?: () => void;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n"],"names":["EClassTimeAlertLevel"],"mappings":"AA+BY,IAAAA,sBAAAA,OACVA,EAAA,WAAW,QACXA,EAAA,cAAc,SAFJA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"trial-session-types.js","sources":["../../../src/features/trial-session/trial-session-types.ts"],"sourcesContent":["import type { TNodeTypes } from '../../types/models/worksheet';\nimport type { IInfoMessage } from '../circle-games/games/web-view/web-view-types';\nimport type {\n IMilestoneConfig,\n TCourseStream,\n TPreferenceCategory,\n} from '../milestone/create/milestone-create-types';\nimport type { IAvatarLayer } from '../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { TPreference } from './comps/class-preference/class-preference-types';\nimport type {\n ITrialCircleConfig,\n ITrialCircleGameParams,\n} from './comps/trial-circle-game/trial-circle-game-types';\nimport type { TrialPageId } from './trial-session-constants';\nimport type { Dispatch, ReactElement, SetStateAction } from 'react';\n\nexport type { TSessionReportData as TSessionReport } from './comps/session-report/session-report-types';\n\nexport type TSlideId = TrialPageId;\n\nexport type TRegionData = {\n opportunity_country: string;\n};\n\nexport type TPreferenceSchema = {\n preference_code: string;\n preference_name: string;\n preference_category: TPreferenceCategory;\n};\n\nexport enum EClassTimeAlertLevel {\n FIVE_MIN = '5min',\n FIFTEEN_MIN = '15min',\n}\ninterface IButtonConfig {\n buttonLabel: string;\n pageId: string;\n}\n\nexport interface ISolution {\n media?: string;\n media_type?: 'image' | 'video';\n text?: string;\n}\n\nexport type TDegreeInformation = {\n degree_name?: string;\n field_of_study?: string;\n degree_code?: string;\n};\n\nexport interface ITeacherProfileDetails {\n lower_grade: string;\n higher_grade: string;\n header_image: string;\n years_of_experience: number;\n number_of_students_taught: number;\n countries: string[];\n degree: TDegreeInformation;\n first_name: string;\n last_name: string;\n teacher_profile_url?: string;\n}\n\nexport interface ISlide {\n id: TrialPageId;\n renderAs: 'split' | 'full';\n renderAVIn: 'left' | 'right';\n header: string;\n subHeader?: string;\n prevPage?: IButtonConfig;\n nextPage?: IButtonConfig;\n cues?: string[];\n dos?: string[];\n donts?: string[];\n navigationLabel?: string;\n slideTag?: string;\n teacher_profile?: ITeacherProfileDetails;\n solutions?: ISolution[];\n enableSessionPerk?: boolean;\n showProfileHighlights?: boolean;\n}\n\nexport interface TGoals {\n goal_code?: string;\n milestone_date_ts?: number;\n goal_category?: string;\n milestone_name?: string;\n publish?: boolean;\n}\n\nexport interface ITrialSessionFormFields {\n id: string;\n name?: string;\n grade?: string;\n curriculum?: string;\n goals?: TGoals[];\n studentProfile?: {\n profileSummary?: string;\n dummyProfileImageIndex?: number;\n summaryFetched?: boolean;\n summaryFetchFailed?: boolean;\n };\n userNodeId?: string;\n nodeId?: string;\n nodeType?: TNodeTypes;\n attemptId?: string;\n preferences?: TPreference[];\n personalizedLevel?: string[];\n personalizedFocus?: string[];\n personalizedBehaviors?: string[];\n personalizedObjectives?: string[];\n isCircleGamePlayed?: boolean;\n isCirclePuzzleSolved?: boolean;\n isCircleSkillCompleted?: boolean;\n studentTimezone?: string;\n showCircleGameScreen?: boolean;\n accuracyStr?: string;\n totalTimeTaken?: number;\n chapterId?: string;\n matchmakingId?: string;\n numberInNameError?: boolean;\n}\n\nexport interface IButtonState {\n isDisabled: boolean;\n isLoading: boolean;\n}\n\nexport interface ITrialHomeData {\n pages: ISlide[];\n demo_info: {\n student_classroom_id: string;\n stream: TCourseStream;\n region_data: TRegionData;\n };\n parent: {\n name: string;\n };\n student: {\n grade: string;\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n teacher: {\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n circle_trial_game_config: ITrialCircleConfig;\n}\n\nexport interface IClassTimeAlertConfig {\n alertLevel: EClassTimeAlertLevel | null;\n isVisible: boolean;\n onComplete: () => void;\n}\n\nexport interface ITrialSessionProps {\n countryCode?: string;\n classStartedOn?: Date;\n height?: string | number;\n userType: TUserTypes;\n studentId: string;\n teacherId: string;\n teacherClassroomId: string;\n teacherPanel?: ReactElement;\n studentPanel?: ReactElement;\n formData?: ITrialSessionFormFields;\n onFormDataChange?: Dispatch<SetStateAction<ITrialSessionFormFields | undefined>>;\n worksheet?: ReactElement;\n worksheetNavigationPanel?: ReactElement;\n questionsRatingPanel?: ReactElement;\n studentAbsentInClass?: boolean;\n openEndClassModal?: () => void;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n classTimeAlertConfig?: IClassTimeAlertConfig;\n classDuration?: number;\n}\n\nexport interface ITrialSessionContext\n extends Pick<\n ITrialSessionProps,\n | 'classStartedOn'\n | 'formData'\n | 'teacherPanel'\n | 'studentId'\n | 'teacherId'\n | 'studentPanel'\n | 'worksheet'\n | 'worksheetNavigationPanel'\n | 'questionsRatingPanel'\n | 'openEndClassModal'\n | 'studentAbsentInClass'\n | 'classDuration'\n | 'classTimeAlertConfig'\n > {\n buttonState: { left: IButtonState; right: IButtonState };\n isTeacher: boolean;\n milestoneConfig: IMilestoneConfig;\n slideConfig: ISlide;\n updateButtonState: (\n btnNavDir: 'left' | 'right' | 'both',\n currentState: IButtonState | { left: IButtonState; right: IButtonState },\n ) => void;\n updateSlideConfig: (config: Partial<ITrialSessionFormFields>) => void;\n trialHomeData: ITrialHomeData;\n onTrialInformationUpdate?: () => void;\n circleGames: ITrialCircleGameParams;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n\nexport interface ITrialSessionViewProps extends ITrialSessionProps {\n trialHomeData: ITrialHomeData;\n milestoneConfig: IMilestoneConfig;\n studentTimezone?: string;\n onStudentTimezoneUpdate?: () => void;\n onTrialInformationUpdate?: () => void;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n"],"names":["EClassTimeAlertLevel"],"mappings":"AA+BY,IAAAA,sBAAAA,OACVA,EAAA,WAAW,QACXA,EAAA,cAAc,SAFJA,IAAAA,KAAA,CAAA,CAAA;"}
@@ -1,93 +1,80 @@
1
- import { jsx as d } from "react/jsx-runtime";
1
+ import { jsx as l } from "react/jsx-runtime";
2
2
  import { DotLottieWorker as v } from "../../../node_modules/@lottiefiles/dotlottie-web/dist/index.js";
3
- import { memo as w, forwardRef as x, useRef as p, useImperativeHandle as A, useEffect as h } from "react";
4
- import R from "../layout/flex-view.js";
5
- import { Canvas as $ } from "./dot-lottie-animation-styled.js";
6
- const E = x(
7
- (y, g) => {
8
- const {
9
- src: s,
10
- data: f,
11
- width: i = "100%",
12
- height: a = "100%",
13
- settings: l,
14
- eventListeners: o,
15
- onRender: u,
16
- onError: c
17
- } = y, m = p(null), t = p(null);
18
- return A(
19
- g,
20
- () => ({
21
- play: () => {
22
- var e;
23
- (e = t.current) == null || e.play();
24
- },
25
- pause: () => {
26
- var e;
27
- (e = t.current) == null || e.pause();
28
- },
29
- playSegments: (e) => {
30
- var r, n;
31
- (r = t.current) == null || r.setSegment(e[0], e[1]), (n = t.current) == null || n.play();
32
- },
33
- setFrame: (e) => {
34
- var r;
35
- (r = t.current) == null || r.setFrame(e);
36
- }
37
- }),
38
- []
39
- ), h(() => {
40
- if (!m.current) return;
41
- let e = !1;
42
- return (() => {
43
- try {
44
- t.current = new v({
45
- src: s,
46
- data: f,
47
- canvas: m.current,
48
- autoplay: !0,
49
- loop: !1,
50
- renderConfig: {
51
- autoResize: !0,
52
- devicePixelRatio: window.devicePixelRatio,
53
- freezeOnOffscreen: !0
54
- },
55
- ...l
56
- }), requestAnimationFrame(() => {
57
- e || u == null || u();
58
- });
59
- } catch (n) {
60
- console.log(n), c == null || c();
61
- }
62
- })(), () => {
63
- e = !0, t.current && (t.current.destroy(), t.current = null);
64
- };
65
- }, [s, l, u, c, f]), h(() => (o == null || o.forEach(
66
- ({ name: e, callback: r }) => {
67
- var n;
68
- return (n = t.current) == null ? void 0 : n.addEventListener(e, r);
69
- }
70
- ), () => {
71
- o == null || o.forEach(
72
- ({ name: e, callback: r }) => {
73
- var n;
74
- return (n = t.current) == null ? void 0 : n.removeEventListener(e, r);
75
- }
76
- );
77
- }), [o]), /* @__PURE__ */ d(R, { $width: i, $height: a, children: /* @__PURE__ */ d(
78
- $,
79
- {
80
- ref: m,
81
- $renderWidth: i,
82
- $renderHeight: a,
83
- width: typeof i == "number" ? i : void 0,
84
- height: typeof a == "number" ? a : void 0
3
+ import { memo as w, forwardRef as x, useRef as p, useImperativeHandle as R, useEffect as h } from "react";
4
+ import E from "../layout/flex-view.js";
5
+ import { Canvas as H } from "./dot-lottie-animation-styled.js";
6
+ const N = x((y, g) => {
7
+ const {
8
+ src: m,
9
+ width: i = "100%",
10
+ height: a = "100%",
11
+ settings: f,
12
+ eventListeners: r,
13
+ onRender: u,
14
+ onError: c
15
+ } = y, s = p(null), t = p(null);
16
+ return R(
17
+ g,
18
+ () => ({
19
+ playSegments: (e) => {
20
+ var n, o;
21
+ (n = t.current) == null || n.setSegment(e[0], e[1]), (o = t.current) == null || o.play();
22
+ },
23
+ play: () => {
24
+ var e;
25
+ (e = t.current) == null || e.play();
85
26
  },
86
- s
87
- ) });
88
- }
89
- ), C = w(E);
27
+ pause: () => {
28
+ var e;
29
+ (e = t.current) == null || e.pause();
30
+ }
31
+ }),
32
+ []
33
+ ), h(() => {
34
+ if (s.current)
35
+ try {
36
+ t.current = new v({
37
+ src: m,
38
+ canvas: s.current,
39
+ autoplay: !0,
40
+ loop: !1,
41
+ renderConfig: {
42
+ autoResize: !0,
43
+ devicePixelRatio: window.devicePixelRatio,
44
+ freezeOnOffscreen: !0
45
+ },
46
+ ...f
47
+ }), requestAnimationFrame(() => {
48
+ u == null || u();
49
+ });
50
+ } catch (e) {
51
+ console.log(e), c == null || c();
52
+ }
53
+ }, [m, f, u, c]), h(() => (r == null || r.forEach(
54
+ ({ name: e, callback: n }) => {
55
+ var o;
56
+ return (o = t.current) == null ? void 0 : o.addEventListener(e, n);
57
+ }
58
+ ), () => {
59
+ var e;
60
+ r == null || r.forEach(
61
+ ({ name: n, callback: o }) => {
62
+ var d;
63
+ return (d = t.current) == null ? void 0 : d.removeEventListener(n, o);
64
+ }
65
+ ), (e = t.current) == null || e.destroy();
66
+ }), [r]), /* @__PURE__ */ l(E, { $width: i, $height: a, children: /* @__PURE__ */ l(
67
+ H,
68
+ {
69
+ ref: s,
70
+ $renderWidth: i,
71
+ $renderHeight: a,
72
+ width: typeof i == "number" ? i : void 0,
73
+ height: typeof a == "number" ? a : void 0
74
+ }
75
+ ) });
76
+ }), F = w(N);
90
77
  export {
91
- C as default
78
+ F as default
92
79
  };
93
80
  //# sourceMappingURL=dot-lottie-animation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dot-lottie-animation.js","sources":["../../../../src/features/ui/dot-lottie-animations/dot-lottie-animation.tsx"],"sourcesContent":["import type {\n AnimationSegment,\n IDotLottieAnimationProps,\n IDotLottieAnimationRef,\n} from './dot-lottie-types';\n\nimport { DotLottieWorker } from '@lottiefiles/dotlottie-web';\nimport { forwardRef, memo, useEffect, useImperativeHandle, useRef } from 'react';\n\nimport FlexView from '../layout/flex-view';\nimport * as Styled from './dot-lottie-animation-styled';\n\nconst DotLottieAnimation = forwardRef<IDotLottieAnimationRef, IDotLottieAnimationProps>(\n (props, ref) => {\n const {\n src,\n data,\n width = '100%',\n height = '100%',\n settings,\n eventListeners,\n onRender,\n onError,\n } = props;\n\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const animationInstance = useRef<DotLottieWorker | null>(null);\n\n useImperativeHandle(\n ref,\n () => ({\n play: () => {\n animationInstance.current?.play();\n },\n pause: () => {\n animationInstance.current?.pause();\n },\n playSegments: (segments: AnimationSegment) => {\n animationInstance.current?.setSegment(segments[0], segments[1]);\n animationInstance.current?.play();\n },\n setFrame: (frame: number) => {\n animationInstance.current?.setFrame(frame);\n },\n }),\n [],\n );\n\n useEffect(() => {\n if (!canvasRef.current) return;\n\n let destroyed = false;\n\n const loadAnimation = () => {\n try {\n animationInstance.current = new DotLottieWorker({\n src,\n data,\n canvas: canvasRef.current!,\n autoplay: true,\n loop: false,\n renderConfig: {\n autoResize: true,\n devicePixelRatio: window.devicePixelRatio,\n freezeOnOffscreen: true,\n },\n ...settings,\n });\n\n requestAnimationFrame(() => {\n if (destroyed) return;\n onRender?.();\n });\n } catch (err) {\n // eslint-disable-next-line no-console\n console.log(err);\n onError?.();\n }\n };\n\n loadAnimation();\n\n return () => {\n destroyed = true;\n if (animationInstance.current) {\n animationInstance.current.destroy();\n animationInstance.current = null;\n }\n };\n }, [src, settings, onRender, onError, data]);\n\n useEffect(() => {\n eventListeners?.forEach(\n ({ name, callback }) => animationInstance.current?.addEventListener(name, callback),\n );\n\n return () => {\n eventListeners?.forEach(\n ({ name, callback }) => animationInstance.current?.removeEventListener(name, callback),\n );\n };\n }, [eventListeners]);\n\n const isNumW = typeof width === 'number';\n const isNumH = typeof height === 'number';\n\n return (\n <FlexView $width={width} $height={height}>\n <Styled.Canvas\n key={src}\n ref={canvasRef}\n $renderWidth={width}\n $renderHeight={height}\n width={isNumW ? width : undefined}\n height={isNumH ? height : undefined}\n />\n </FlexView>\n );\n },\n);\n\nexport default memo(DotLottieAnimation);\n"],"names":["DotLottieAnimation","forwardRef","props","ref","src","data","width","height","settings","eventListeners","onRender","onError","canvasRef","useRef","animationInstance","useImperativeHandle","_a","segments","_b","frame","useEffect","destroyed","DotLottieWorker","err","name","callback","jsx","FlexView","Styled.Canvas","DotLottieAnimation$1","memo"],"mappings":";;;;;AAYA,MAAMA,IAAqBC;AAAA,EACzB,CAACC,GAAOC,MAAQ;AACR,UAAA;AAAA,MACJ,KAAAC;AAAA,MACA,MAAAC;AAAA,MACA,OAAAC,IAAQ;AAAA,MACR,QAAAC,IAAS;AAAA,MACT,UAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,UAAAC;AAAA,MACA,SAAAC;AAAA,IACE,IAAAT,GAEEU,IAAYC,EAA0B,IAAI,GAC1CC,IAAoBD,EAA+B,IAAI;AAE7D,WAAAE;AAAA,MACEZ;AAAA,MACA,OAAO;AAAA,QACL,MAAM,MAAM;;AACV,WAAAa,IAAAF,EAAkB,YAAlB,QAAAE,EAA2B;AAAA,QAC7B;AAAA,QACA,OAAO,MAAM;;AACX,WAAAA,IAAAF,EAAkB,YAAlB,QAAAE,EAA2B;AAAA,QAC7B;AAAA,QACA,cAAc,CAACC,MAA+B;;AAC5C,WAAAD,IAAAF,EAAkB,YAAlB,QAAAE,EAA2B,WAAWC,EAAS,CAAC,GAAGA,EAAS,CAAC,KAC7DC,IAAAJ,EAAkB,YAAlB,QAAAI,EAA2B;AAAA,QAC7B;AAAA,QACA,UAAU,CAACC,MAAkB;;AACT,WAAAH,IAAAF,EAAA,YAAA,QAAAE,EAAS,SAASG;AAAA,QACtC;AAAA,MAAA;AAAA,MAEF,CAAC;AAAA,IAAA,GAGHC,EAAU,MAAM;AACV,UAAA,CAACR,EAAU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U,WAUVA,IAAQ;AAAA,QACxB,QAVS,OAAOC,KAAW,WAUVA,IAAS;AAAA,MAAA;AAAA,MALrBH;AAAA,IAOT,EAAA,CAAA;AAAA,EAEJ;AACF,GAEeyB,IAAAC,EAAK9B,CAAkB;"}
1
+ {"version":3,"file":"dot-lottie-animation.js","sources":["../../../../src/features/ui/dot-lottie-animations/dot-lottie-animation.tsx"],"sourcesContent":["import type {\n AnimationSegment,\n ILottieAnimationProps,\n ILottieAnimationRef,\n} from './dot-lottie-types';\n\nimport { DotLottieWorker } from '@lottiefiles/dotlottie-web';\nimport { forwardRef, memo, useEffect, useImperativeHandle, useRef } from 'react';\n\nimport FlexView from '../layout/flex-view';\nimport * as Styled from './dot-lottie-animation-styled';\n\nconst DotLottieAnimation = forwardRef<ILottieAnimationRef, ILottieAnimationProps>((props, ref) => {\n const {\n src,\n width = '100%',\n height = '100%',\n settings,\n eventListeners,\n onRender,\n onError,\n } = props;\n\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const animationInstance = useRef<DotLottieWorker | null>(null);\n\n useImperativeHandle(\n ref,\n () => ({\n playSegments: (segments: AnimationSegment) => {\n animationInstance.current?.setSegment(segments[0], segments[1]);\n animationInstance.current?.play();\n },\n play: () => {\n animationInstance.current?.play();\n },\n pause: () => {\n animationInstance.current?.pause();\n },\n }),\n [],\n );\n\n useEffect(() => {\n if (!canvasRef.current) return;\n\n try {\n animationInstance.current = new DotLottieWorker({\n src,\n canvas: canvasRef.current,\n autoplay: true,\n loop: false,\n renderConfig: {\n autoResize: true,\n devicePixelRatio: window.devicePixelRatio,\n freezeOnOffscreen: true,\n },\n ...settings,\n });\n\n requestAnimationFrame(() => {\n onRender?.();\n });\n } catch (err) {\n // eslint-disable-next-line no-console\n console.log(err);\n onError?.();\n }\n }, [src, settings, onRender, onError]);\n\n useEffect(() => {\n eventListeners?.forEach(\n ({ name, callback }) => animationInstance.current?.addEventListener(name, callback),\n );\n\n return () => {\n eventListeners?.forEach(\n ({ name, callback }) => animationInstance.current?.removeEventListener(name, callback),\n );\n animationInstance.current?.destroy();\n };\n }, [eventListeners]);\n\n const isNumW = typeof width === 'number';\n const isNumH = typeof height === 'number';\n\n return (\n <FlexView $width={width} $height={height}>\n <Styled.Canvas\n ref={canvasRef}\n $renderWidth={width}\n $renderHeight={height}\n width={isNumW ? width : undefined}\n height={isNumH ? height : undefined}\n />\n </FlexView>\n );\n});\n\nexport default memo(DotLottieAnimation);\n"],"names":["DotLottieAnimation","forwardRef","props","ref","src","width","height","settings","eventListeners","onRender","onError","canvasRef","useRef","animationInstance","useImperativeHandle","segments","_a","_b","useEffect","DotLottieWorker","err","name","callback","jsx","FlexView","Styled.Canvas","dotLottieAnimation","memo"],"mappings":";;;;;AAYA,MAAMA,IAAqBC,EAAuD,CAACC,GAAOC,MAAQ;AAC1F,QAAA;AAAA,IACJ,KAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,QAAAC,IAAS;AAAA,IACT,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,EACE,IAAAR,GAEES,IAAYC,EAA0B,IAAI,GAC1CC,IAAoBD,EAA+B,IAAI;AAE7D,SAAAE;AAAA,IACEX;AAAA,IACA,OAAO;AAAA,MACL,cAAc,CAACY,MAA+B;;AAC5C,SAAAC,IAAAH,EAAkB,YAAlB,QAAAG,EAA2B,WAAWD,EAAS,CAAC,GAAGA,EAAS,CAAC,KAC7DE,IAAAJ,EAAkB,YAAlB,QAAAI,EAA2B;AAAA,MAC7B;AAAA,MACA,MAAM,MAAM;;AACV,SAAAD,IAAAH,EAAkB,YAAlB,QAAAG,EAA2B;AAAA,MAC7B;AAAA,MACA,OAAO,MAAM;;AACX,SAAAA,IAAAH,EAAkB,YAAlB,QAAAG,EAA2B;AAAA,MAC7B;AAAA,IAAA;AAAA,IAEF,CAAC;AAAA,EAAA,GAGHE,EAAU,MAAM;AACV,QAACP,EAAU;AAEX,UAAA;AACgB,QAAAE,EA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- import w from "lottie-web";
3
- import { memo as E, forwardRef as b, useRef as m, useImperativeHandle as I, useEffect as S } from "react";
1
+ import { jsx as E } from "react/jsx-runtime";
2
+ import g from "lottie-web";
3
+ import { memo as w, forwardRef as A, useRef as u, useImperativeHandle as b, useEffect as I } from "react";
4
4
  import $ from "../layout/flex-view.js";
5
5
  import { fetchLottie as x } from "./helper.js";
6
- const O = b((L, h) => {
6
+ const O = A((v, L) => {
7
7
  const {
8
- src: l,
9
- width: g = "100%",
8
+ src: m,
9
+ width: h = "100%",
10
10
  height: y = "100%",
11
- settings: f,
12
- eventListener: o,
13
- onRender: a,
14
- onError: i,
15
- animateOnIntersect: s
16
- } = L, c = m(null), r = m(null), u = m(null);
17
- return I(
18
- h,
11
+ settings: l,
12
+ eventListener: n,
13
+ onRender: i,
14
+ animateOnIntersect: c
15
+ } = v, a = u(null), r = u(null), s = u(null);
16
+ return b(
17
+ L,
19
18
  () => ({
20
- playSegments: (t, n) => {
21
- var e;
22
- return (e = r.current) == null ? void 0 : e.playSegments(t, n);
23
- },
24
- addEventListener: (t, n) => {
25
- var e;
26
- return (e = r.current) == null ? void 0 : e.addEventListener(t, n);
27
- },
28
- removeEventListener: (t, n) => {
29
- var e;
30
- return (e = r.current) == null ? void 0 : e.removeEventListener(t, n);
19
+ playSegments: (e, o) => {
20
+ var t;
21
+ return (t = r.current) == null ? void 0 : t.playSegments(e, o);
31
22
  },
32
- play: () => {
23
+ addEventListener: (e, o) => {
33
24
  var t;
34
- return (t = r.current) == null ? void 0 : t.play();
25
+ return (t = r.current) == null ? void 0 : t.addEventListener(e, o);
35
26
  },
36
- stop: () => {
27
+ removeEventListener: (e, o) => {
37
28
  var t;
38
- return (t = r.current) == null ? void 0 : t.stop();
29
+ return (t = r.current) == null ? void 0 : t.removeEventListener(e, o);
39
30
  },
40
- setLoop: (t) => {
41
- r.current && (r.current.loop = t);
31
+ play: () => {
32
+ var e;
33
+ return (e = r.current) == null ? void 0 : e.play();
42
34
  },
43
- goToAndStop: (t, n) => {
35
+ stop: () => {
44
36
  var e;
45
- return (e = r.current) == null ? void 0 : e.goToAndStop(t, n);
37
+ return (e = r.current) == null ? void 0 : e.stop();
38
+ },
39
+ setLoop: (e) => {
40
+ r.current && (r.current.loop = e);
46
41
  }
47
42
  }),
48
43
  []
49
- ), S(() => {
50
- let t = !1;
44
+ ), I(() => {
45
+ let e = !1;
51
46
  return (async () => {
52
47
  try {
53
- const e = await x(l);
54
- if (!e) {
55
- i == null || i();
56
- return;
57
- }
48
+ const t = await x(m);
58
49
  requestAnimationFrame(() => {
59
- !c.current || t || (r.current = w.loadAnimation({
60
- container: c.current,
61
- animationData: e,
50
+ !a.current || e || (r.current = g.loadAnimation({
51
+ container: a.current,
52
+ animationData: t,
62
53
  loop: !0,
63
54
  autoplay: !0,
64
- ...f
65
- }), s && (u.current = new IntersectionObserver(
66
- ([d]) => {
67
- var p, v;
68
- d && d.isIntersecting ? (p = r.current) == null || p.play() : (v = r.current) == null || v.pause();
55
+ ...l
56
+ }), c && (s.current = new IntersectionObserver(
57
+ ([f]) => {
58
+ var d, p;
59
+ f && f.isIntersecting ? (d = r.current) == null || d.play() : (p = r.current) == null || p.pause();
69
60
  },
70
61
  { threshold: 0 }
71
- ), u.current.observe(c.current)), a == null || a(), o && r.current.addEventListener(o.name, o.callback));
62
+ ), s.current.observe(a.current)), i == null || i(), n && r.current.addEventListener(n.name, n.callback));
72
63
  });
73
- } catch (e) {
74
- throw i == null || i(), Error(`Error loading Lottie animation: ${e}`);
64
+ } catch (t) {
65
+ throw Error(`Error loading Lottie animation: ${t}`);
75
66
  }
76
67
  })(), () => {
77
- var e;
78
- t = !0, r.current && (o && r.current.removeEventListener(o.name, o.callback), s && ((e = u.current) == null || e.disconnect()), r.current.destroy());
68
+ var t;
69
+ e = !0, r.current && (n && r.current.removeEventListener(n.name, n.callback), c && ((t = s.current) == null || t.disconnect()), r.current.destroy());
79
70
  };
80
- }, [l, o, a, s, f, i]), /* @__PURE__ */ A($, { ref: c, $width: g, $height: y });
81
- }), D = E(O);
71
+ }, [m, n, i, c, l]), /* @__PURE__ */ E($, { ref: a, $width: h, $height: y });
72
+ }), D = w(O);
82
73
  export {
83
74
  D as default
84
75
  };
@@ -1 +1 @@
1
- {"version":3,"file":"lottie-animation.js","sources":["../../../../src/features/ui/lottie-animation/lottie-animation.tsx"],"sourcesContent":["import type { ILottieAnimationProps, ILottieAnimationRef } from './types';\nimport type { AnimationEventName, AnimationItem, AnimationSegment } from 'lottie-web';\n\nimport lottie from 'lottie-web';\nimport { forwardRef, memo, useEffect, useImperativeHandle, useRef } from 'react';\n\nimport FlexView from '../layout/flex-view';\nimport { fetchLottie } from './helper';\n\nconst LottieAnimation = forwardRef<ILottieAnimationRef, ILottieAnimationProps>((props, ref) => {\n const {\n src,\n width = '100%',\n height = '100%',\n settings,\n eventListener,\n onRender,\n onError,\n animateOnIntersect,\n } = props;\n\n const container = useRef<HTMLDivElement>(null);\n const animationInstance = useRef<AnimationItem | null>(null);\n const intersectionObserver = useRef<IntersectionObserver | null>(null);\n\n useImperativeHandle(\n ref,\n () => ({\n playSegments: (segments: AnimationSegment, forceFlag?: boolean) =>\n animationInstance.current?.playSegments(segments, forceFlag),\n addEventListener: (eventName: string, callback: () => void) =>\n animationInstance.current?.addEventListener(eventName as AnimationEventName, callback),\n removeEventListener: (eventName: string, callback: () => void) =>\n animationInstance.current?.removeEventListener(eventName as AnimationEventName, callback),\n play: () => animationInstance.current?.play(),\n stop: () => animationInstance.current?.stop(),\n setLoop: (loop: boolean) => {\n if (animationInstance.current) {\n animationInstance.current.loop = loop;\n }\n },\n goToAndStop: (v, f) => animationInstance.current?.goToAndStop(v, f),\n }),\n [],\n );\n\n useEffect(() => {\n let destroyed = false;\n\n const loadAnimation = async () => {\n try {\n const animationData = await fetchLottie(src);\n\n if (!animationData) {\n onError?.();\n\n return;\n }\n\n // Wait for layout\n // NOTE: Do not remove this as this is needed to fix canvas rendering on first layout.\n requestAnimationFrame(() => {\n if (!container.current || destroyed) return;\n\n animationInstance.current = lottie.loadAnimation({\n container: container.current,\n animationData,\n loop: true,\n autoplay: true,\n ...settings,\n });\n\n if (animateOnIntersect) {\n intersectionObserver.current = new IntersectionObserver(\n ([entry]) => {\n if (entry && entry.isIntersecting) {\n animationInstance.current?.play();\n } else {\n animationInstance.current?.pause();\n }\n },\n { threshold: 0 },\n );\n\n intersectionObserver.current.observe(container.current);\n }\n\n onRender?.();\n if (eventListener) {\n animationInstance.current.addEventListener(eventListener.name, eventListener.callback);\n }\n });\n } catch (error) {\n onError?.();\n throw Error(`Error loading Lottie animation: ${error}`);\n }\n };\n\n loadAnimation();\n\n return () => {\n destroyed = true;\n if (animationInstance.current) {\n if (eventListener) {\n animationInstance.current.removeEventListener(eventListener.name, eventListener.callback);\n }\n\n if (animateOnIntersect) {\n intersectionObserver.current?.disconnect();\n }\n animationInstance.current.destroy();\n }\n };\n }, [src, eventListener, onRender, animateOnIntersect, settings, onError]);\n\n return <FlexView ref={container} $width={width} $height={height} />;\n});\n\nexport default memo(LottieAnimation);\n"],"names":["LottieAnimation","forwardRef","props","ref","src","width","height","settings","eventListener","onRender","onError","animateOnIntersect","container","useRef","animationInstance","intersectionObserver","useImperativeHandle","segments","forceFlag","_a","eventName","callback","loop","v","f","useEffect","destroyed","animationData","fetchLottie","lottie","entry","_b","error","FlexView","LottieAnimation$1","memo"],"mappings":";;;;;AASA,MAAMA,IAAkBC,EAAuD,CAACC,GAAOC,MAAQ;AACvF,QAAA;AAAA,IACJ,KAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,QAAAC,IAAS;AAAA,IACT,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,oBAAAC;AAAA,EACE,IAAAT,GAEEU,IAAYC,EAAuB,IAAI,GACvCC,IAAoBD,EAA6B,IAAI,GACrDE,IAAuBF,EAAoC,IAAI;AAErE,SAAAG;AAAA,IACEb;AAAA,IACA,OAAO;AAAA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AM,kBACjBX,IAAAL,EAAkB,YAAlB,QAAAK,EAA2B,UAE3BY,IAAAjB,EAAkB,YAAlB,QAAAiB,EAA2B;AAAA,YAE/B;AAAA,YACA,EAAE,WAAW,EAAE;AAAA,UAAA,GAGIhB,EAAA,QAAQ,QAAQH,EAAU,OAAO,IAG7CH,KAAA,QAAAA,KACPD,KACFM,EAAkB,QAAQ,iBAAiBN,EAAc,MAAMA,EAAc,QAAQ;AAAA,QACvF,CACD;AAAA,eACMwB,GAAO;AACJ,cAAAtB,KAAA,QAAAA,KACJ,MAAM,mCAAmCsB,CAAK,EAAE;AAAA,MACxD;AAAA,IAAA,MAKK,MAAM;;AACC,MAAAN,IAAA,IACRZ,EAAkB,YAChBN,KACFM,EAAkB,QAAQ,oBAAoBN,EAAc,MAAMA,EAAc,QAAQ,GAGtFG,OACFQ,IAAAJ,EAAqB,YAArB,QAAAI,EAA8B,eAEhCL,EAAkB,QAAQ;IAC5B;AAAA,EACF,GACC,CAACV,GAAKI,GAAeC,GAAUE,GAAoBJ,GAAUG,CAAO,CAAC,qBAEhEuB,GAAS,EAAA,KAAKrB,GAAW,QAAQP,GAAO,SAASC,EAAQ,CAAA;AACnE,CAAC,GAEc4B,IAAAC,EAAKnC,CAAe;"}
1
+ {"version":3,"file":"lottie-animation.js","sources":["../../../../src/features/ui/lottie-animation/lottie-animation.tsx"],"sourcesContent":["import type { ILottieAnimationProps, ILottieAnimationRef } from './types';\nimport type { AnimationEventName, AnimationItem, AnimationSegment } from 'lottie-web';\n\nimport lottie from 'lottie-web';\nimport { forwardRef, memo, useEffect, useImperativeHandle, useRef } from 'react';\n\nimport FlexView from '../layout/flex-view';\nimport { fetchLottie } from './helper';\n\nconst LottieAnimation = forwardRef<ILottieAnimationRef, ILottieAnimationProps>((props, ref) => {\n const {\n src,\n width = '100%',\n height = '100%',\n settings,\n eventListener,\n onRender,\n animateOnIntersect,\n } = props;\n\n const container = useRef<HTMLDivElement>(null);\n const animationInstance = useRef<AnimationItem | null>(null);\n const intersectionObserver = useRef<IntersectionObserver | null>(null);\n\n useImperativeHandle(\n ref,\n () => ({\n playSegments: (segments: AnimationSegment, forceFlag?: boolean) =>\n animationInstance.current?.playSegments(segments, forceFlag),\n addEventListener: (eventName: string, callback: () => void) =>\n animationInstance.current?.addEventListener(eventName as AnimationEventName, callback),\n removeEventListener: (eventName: string, callback: () => void) =>\n animationInstance.current?.removeEventListener(eventName as AnimationEventName, callback),\n play: () => animationInstance.current?.play(),\n stop: () => animationInstance.current?.stop(),\n setLoop: (loop: boolean) => {\n if (animationInstance.current) {\n animationInstance.current.loop = loop;\n }\n },\n }),\n [],\n );\n\n useEffect(() => {\n let destroyed = false;\n\n const loadAnimation = async () => {\n try {\n const animationData = await fetchLottie(src);\n\n // Wait for layout\n // NOTE: Do not remove this as this is needed to fix canvas rendering on first layout.\n requestAnimationFrame(() => {\n if (!container.current || destroyed) return;\n\n animationInstance.current = lottie.loadAnimation({\n container: container.current,\n animationData,\n loop: true,\n autoplay: true,\n ...settings,\n });\n\n if (animateOnIntersect) {\n intersectionObserver.current = new IntersectionObserver(\n ([entry]) => {\n if (entry && entry.isIntersecting) {\n animationInstance.current?.play();\n } else {\n animationInstance.current?.pause();\n }\n },\n { threshold: 0 },\n );\n\n intersectionObserver.current.observe(container.current);\n }\n\n onRender?.();\n if (eventListener) {\n animationInstance.current.addEventListener(eventListener.name, eventListener.callback);\n }\n });\n } catch (error) {\n throw Error(`Error loading Lottie animation: ${error}`);\n }\n };\n\n loadAnimation();\n\n return () => {\n destroyed = true;\n if (animationInstance.current) {\n if (eventListener) {\n animationInstance.current.removeEventListener(eventListener.name, eventListener.callback);\n }\n\n if (animateOnIntersect) {\n intersectionObserver.current?.disconnect();\n }\n animationInstance.current.destroy();\n }\n };\n }, [src, eventListener, onRender, animateOnIntersect, settings]);\n\n return <FlexView ref={container} $width={width} $height={height} />;\n});\n\nexport default memo(LottieAnimation);\n"],"names":["LottieAnimation","forwardRef","props","ref","src","width","height","settings","eventListener","onRender","animateOnIntersect","container","useRef","animationInstance","intersectionObserver","useImperativeHandle","segments","forceFlag","_a","eventName","callback","loop","useEffect","destroyed","animationData","fetchLottie","lottie","entry","_b","error","FlexView","LottieAnimation$1","memo"],"mappings":";;;;;AASA,MAAMA,IAAkBC,EAAuD,CAACC,GAAOC,MAAQ;AACvF,QAAA;AAAA,IACJ,KAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,QAAAC,IAAS;AAAA,IACT,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,oBAAAC;AAAA,EACE,IAAAR,GAEES,IAAYC,EAAuB,IAAI,GACvCC,IAAoBD,EAA6B,IAAI,GACrDE,IAAuBF,EAAoC,IAAI;AAErE,SAAAG;AAAA,IACEZ;AAAA,IACA,OAAO;AAAA,MACL,cAAc,CAACa,GAA4BC,MACzC;;AAAA,gBAAAC,IAAAL,EAAkB,YAAlB,gBAAAK,EAA2B,aAAaF,GAAUC;AAAA;AAAA,MACpD,kBAAkB,CAACE,GAAmBC,MACpC;;AAAA,gBAAAF,IAAAL,EAAkB,YAAlB,gBAAAK,EAA2B,iBAAiBC,GAAiCC;AAAA;AAAA,MAC/E,qBAAqB,CAACD,GAAmBC,MACvC;;AAAA,gBAAAF,IAAAL,EAAkB,YAAlB,gBAAAK,EAA2B,oBAAoBC,GAAiCC;AAAA;AAAA,MAClF,MAAM,MAAM;;AAAA,gBAAAF,IAAAL,EAAkB,YAAlB,gBAAAK,EAA2B;AAAA;AAAA,MACvC,MAAM,MAAM;;AAAA,gBAAAA,IAAAL,EAAkB,YAAlB,gBAAAK,EAA2B;AAAA;AAAA,MACvC,SAAS,CAACG,MAAkB;AAC1B,QAAIR,EAAkB,YACpBA,EAAkB,QAAQ,OAAOQ;AAAA,MAErC;AAAA,IAAA;AAAA,IAEF,CAAC;AAAA,EAAA,GAGHC,EAAU,MAAM;AACd,QAAIC,IAAY;AA4CF,YA1CQ,YAAY;AAC5B,UAAA;AACI,cA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