@cuemath/leap 3.2.17-j1 → 3.2.17-mb

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 (241) hide show
  1. package/dist/assets/illustrations/illustrations.js +0 -5
  2. package/dist/assets/illustrations/illustrations.js.map +1 -1
  3. package/dist/assets/lottie/lottie.js +1 -11
  4. package/dist/assets/lottie/lottie.js.map +1 -1
  5. package/dist/features/auth/account-selector/account-selector.js +25 -26
  6. package/dist/features/auth/account-selector/account-selector.js.map +1 -1
  7. package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +14 -20
  8. package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
  9. package/dist/features/auth/comps/resend-otp/resend-otp.js +47 -54
  10. package/dist/features/auth/comps/resend-otp/resend-otp.js.map +1 -1
  11. package/dist/features/auth/comps/tabs/tab-tem/tab-item.js +17 -29
  12. package/dist/features/auth/comps/tabs/tab-tem/tab-item.js.map +1 -1
  13. package/dist/features/auth/comps/tabs/tabs-styled.js +10 -22
  14. package/dist/features/auth/comps/tabs/tabs-styled.js.map +1 -1
  15. package/dist/features/auth/comps/tabs/tabs.js +5 -5
  16. package/dist/features/auth/comps/tabs/tabs.js.map +1 -1
  17. package/dist/features/auth/comps/user-list/user-item/user-item.js +31 -30
  18. package/dist/features/auth/comps/user-list/user-item/user-item.js.map +1 -1
  19. package/dist/features/auth/comps/user-list/user-list.js +34 -35
  20. package/dist/features/auth/comps/user-list/user-list.js.map +1 -1
  21. package/dist/features/auth/forgot-password/forgot-password-styled.js +15 -14
  22. package/dist/features/auth/forgot-password/forgot-password-styled.js.map +1 -1
  23. package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js +7 -6
  24. package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js.map +1 -1
  25. package/dist/features/auth/login/login-styled.js +9 -8
  26. package/dist/features/auth/login/login-styled.js.map +1 -1
  27. package/dist/features/chapters-v2/utils/node-card-utils.js +7 -7
  28. package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
  29. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +4 -4
  30. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +1 -1
  31. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +85 -85
  32. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
  33. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +98 -121
  34. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
  35. package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js +28 -29
  36. package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js.map +1 -1
  37. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +42 -43
  38. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -1
  39. package/dist/features/circle-games/games/tutorial/tutorial.js +35 -43
  40. package/dist/features/circle-games/games/tutorial/tutorial.js.map +1 -1
  41. package/dist/features/circle-games/sign-up/comp/grade-input/grade-input-styled.js +2 -2
  42. package/dist/features/circle-games/sign-up/comp/grade-input/grade-input-styled.js.map +1 -1
  43. package/dist/features/circle-games/sign-up/comp/grade-input/grade-input.js +1 -1
  44. package/dist/features/circle-games/sign-up/comp/grade-input/grade-input.js.map +1 -1
  45. package/dist/features/circle-games/sign-up/comp/username-input/username-input.js +24 -26
  46. package/dist/features/circle-games/sign-up/comp/username-input/username-input.js.map +1 -1
  47. package/dist/features/circle-games/sign-up/constants.js +1 -3
  48. package/dist/features/circle-games/sign-up/constants.js.map +1 -1
  49. package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js +42 -42
  50. package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js.map +1 -1
  51. package/dist/features/hooks/use-viewport/use-viewport.js +22 -0
  52. package/dist/features/hooks/use-viewport/use-viewport.js.map +1 -0
  53. package/dist/features/journey/comps/coachmark/coachmark.js +27 -29
  54. package/dist/features/journey/comps/coachmark/coachmark.js.map +1 -1
  55. package/dist/features/journey/journey-id/journey-id-student.js +2 -2
  56. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  57. package/dist/features/journey/use-journey/journey-context-provider.js +72 -73
  58. package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
  59. package/dist/features/journey/use-journey/journey-styled.js +4 -6
  60. package/dist/features/journey/use-journey/journey-styled.js.map +1 -1
  61. package/dist/features/stickers/sticker-data.js +234 -0
  62. package/dist/features/stickers/sticker-data.js.map +1 -0
  63. package/dist/features/{ui/sticker-grid/sticker-grid-styles.js → stickers/sticker-selector/sticker-selector-styles.js} +4 -3
  64. package/dist/features/stickers/sticker-selector/sticker-selector-styles.js.map +1 -0
  65. package/dist/features/stickers/sticker-selector/sticker-selector.js +25 -0
  66. package/dist/features/stickers/sticker-selector/sticker-selector.js.map +1 -0
  67. package/dist/features/stickers/sticker-selector/sticker.js +57 -0
  68. package/dist/features/stickers/sticker-selector/sticker.js.map +1 -0
  69. package/dist/features/{ui/stickers/stickers-effects.js → stickers/stickers-effects/effects.js} +6 -6
  70. package/dist/features/stickers/stickers-effects/effects.js.map +1 -0
  71. package/dist/features/{ui/stickers/stickers-styled.js → stickers/stickers-effects/stickers-effects-styled.js} +2 -2
  72. package/dist/features/stickers/stickers-effects/stickers-effects-styled.js.map +1 -0
  73. package/dist/features/{ui/stickers/stickers-utils.js → stickers/stickers-effects/stickers-effects-utils.js} +6 -6
  74. package/dist/features/stickers/stickers-effects/stickers-effects-utils.js.map +1 -0
  75. package/dist/features/stickers/stickers-effects/stickers-effects.js +39 -0
  76. package/dist/features/stickers/stickers-effects/stickers-effects.js.map +1 -0
  77. package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js +60 -12
  78. package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js.map +1 -1
  79. package/dist/features/ui/arrow-tooltip/arrow-tooltip.js +77 -72
  80. package/dist/features/ui/arrow-tooltip/arrow-tooltip.js.map +1 -1
  81. package/dist/features/ui/error/error.js +27 -65
  82. package/dist/features/ui/error/error.js.map +1 -1
  83. package/dist/features/ui/image/image.js +1 -1
  84. package/dist/features/ui/image/image.js.map +1 -1
  85. package/dist/features/ui/lottie-animation/lottie-animation.js +29 -25
  86. package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
  87. package/dist/features/ui/modals/modal-styled.js +58 -34
  88. package/dist/features/ui/modals/modal-styled.js.map +1 -1
  89. package/dist/features/ui/modals/modal.js +14 -40
  90. package/dist/features/ui/modals/modal.js.map +1 -1
  91. package/dist/features/ui/nudge/nudge-styled.js +7 -14
  92. package/dist/features/ui/nudge/nudge-styled.js.map +1 -1
  93. package/dist/features/ui/nudge/nudge.js +12 -13
  94. package/dist/features/ui/nudge/nudge.js.map +1 -1
  95. package/dist/features/ui/streak-icon/streak-icon-styled.js +13 -13
  96. package/dist/features/ui/streak-icon/streak-icon-styled.js.map +1 -1
  97. package/dist/features/ui/streak-icon/streak-icon.js +15 -17
  98. package/dist/features/ui/streak-icon/streak-icon.js.map +1 -1
  99. package/dist/features/ui/text/text.js +36 -40
  100. package/dist/features/ui/text/text.js.map +1 -1
  101. package/dist/features/ui/theme/button.js +78 -78
  102. package/dist/features/ui/theme/button.js.map +1 -1
  103. package/dist/features/ui/theme/constants.js +2 -4
  104. package/dist/features/ui/theme/constants.js.map +1 -1
  105. package/dist/features/ui/theme/get-device.js +3 -3
  106. package/dist/features/ui/theme/get-device.js.map +1 -1
  107. package/dist/features/worksheet/worksheet/constants.js +13 -12
  108. package/dist/features/worksheet/worksheet/constants.js.map +1 -1
  109. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +24 -24
  110. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
  111. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +260 -246
  112. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
  113. package/dist/features/worksheet/worksheet/worksheet-styled.js +28 -37
  114. package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
  115. package/dist/features/worksheet/worksheet/worksheet.js +164 -166
  116. package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
  117. package/dist/index.d.ts +55 -184
  118. package/dist/index.js +541 -579
  119. package/dist/index.js.map +1 -1
  120. package/dist/node_modules/query-string/base.js +1 -1
  121. package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +1 -0
  122. package/dist/node_modules/uuid/dist/esm-browser/regex.js +5 -0
  123. package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +1 -0
  124. package/dist/node_modules/uuid/dist/esm-browser/rng.js +2 -3
  125. package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
  126. package/dist/node_modules/uuid/dist/esm-browser/stringify.js +10 -6
  127. package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
  128. package/dist/node_modules/uuid/dist/esm-browser/v4.js +9 -12
  129. package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
  130. package/dist/node_modules/uuid/dist/esm-browser/validate.js +8 -0
  131. package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +1 -0
  132. package/dist/static/nudge-tap.5cb30093.json +1057 -0
  133. package/package.json +1 -1
  134. package/dist/assets/line-icons/icons/after-noon.js +0 -34
  135. package/dist/assets/line-icons/icons/after-noon.js.map +0 -1
  136. package/dist/assets/line-icons/icons/apple-icon-white.js +0 -42
  137. package/dist/assets/line-icons/icons/apple-icon-white.js.map +0 -1
  138. package/dist/assets/line-icons/icons/cue-board-filled.js +0 -33
  139. package/dist/assets/line-icons/icons/cue-board-filled.js.map +0 -1
  140. package/dist/assets/line-icons/icons/cue-board.js +0 -23
  141. package/dist/assets/line-icons/icons/cue-board.js.map +0 -1
  142. package/dist/assets/line-icons/icons/evening.js +0 -35
  143. package/dist/assets/line-icons/icons/evening.js.map +0 -1
  144. package/dist/assets/line-icons/icons/hint-fill.js +0 -35
  145. package/dist/assets/line-icons/icons/hint-fill.js.map +0 -1
  146. package/dist/assets/line-icons/icons/morning.js +0 -35
  147. package/dist/assets/line-icons/icons/morning.js.map +0 -1
  148. package/dist/assets/line-icons/icons/screen-grab-filled.js +0 -35
  149. package/dist/assets/line-icons/icons/screen-grab-filled.js.map +0 -1
  150. package/dist/assets/line-icons/icons/screen-grab.js +0 -23
  151. package/dist/assets/line-icons/icons/screen-grab.js.map +0 -1
  152. package/dist/assets/line-icons/icons/sticker-filled.js +0 -64
  153. package/dist/assets/line-icons/icons/sticker-filled.js.map +0 -1
  154. package/dist/assets/line-icons/icons/sticker.js +0 -46
  155. package/dist/assets/line-icons/icons/sticker.js.map +0 -1
  156. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js +0 -9
  157. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js.map +0 -1
  158. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js +0 -52
  159. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js.map +0 -1
  160. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js +0 -95
  161. package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js.map +0 -1
  162. package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text-styled.js +0 -10
  163. package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text-styled.js.map +0 -1
  164. package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text.js +0 -17
  165. package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text.js.map +0 -1
  166. package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js +0 -12
  167. package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js.map +0 -1
  168. package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js +0 -34
  169. package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js.map +0 -1
  170. package/dist/features/auth/comps/otp-input/otp-input-styled.js +0 -22
  171. package/dist/features/auth/comps/otp-input/otp-input-styled.js.map +0 -1
  172. package/dist/features/auth/comps/otp-input/otp-input.js +0 -51
  173. package/dist/features/auth/comps/otp-input/otp-input.js.map +0 -1
  174. package/dist/features/auth/comps/pill-button/pill-button-styled.js +0 -44
  175. package/dist/features/auth/comps/pill-button/pill-button-styled.js.map +0 -1
  176. package/dist/features/auth/comps/pill-button/pill-button.js +0 -75
  177. package/dist/features/auth/comps/pill-button/pill-button.js.map +0 -1
  178. package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js +0 -17
  179. package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js.map +0 -1
  180. package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js +0 -67
  181. package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js.map +0 -1
  182. package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-constants.js +0 -19
  183. package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-constants.js.map +0 -1
  184. package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-styled.js +0 -32
  185. package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-styled.js.map +0 -1
  186. package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js +0 -44
  187. package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js.map +0 -1
  188. package/dist/features/auth/pla-signup/signup-header/signup-header.js +0 -54
  189. package/dist/features/auth/pla-signup/signup-header/signup-header.js.map +0 -1
  190. package/dist/features/auth/pla-signup/signup-options/signup-options.js +0 -83
  191. package/dist/features/auth/pla-signup/signup-options/signup-options.js.map +0 -1
  192. package/dist/features/puzzles/app/puzzle-app-styled.js +0 -81
  193. package/dist/features/puzzles/app/puzzle-app-styled.js.map +0 -1
  194. package/dist/features/puzzles/app/puzzle-app-view.js +0 -120
  195. package/dist/features/puzzles/app/puzzle-app-view.js.map +0 -1
  196. package/dist/features/puzzles/app/puzzle-app.js +0 -62
  197. package/dist/features/puzzles/app/puzzle-app.js.map +0 -1
  198. package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js +0 -6
  199. package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js.map +0 -1
  200. package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js +0 -63
  201. package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js.map +0 -1
  202. package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js +0 -21
  203. package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js.map +0 -1
  204. package/dist/features/ui/drawer/drawer-styled.js +0 -34
  205. package/dist/features/ui/drawer/drawer-styled.js.map +0 -1
  206. package/dist/features/ui/drawer/drawer.js +0 -42
  207. package/dist/features/ui/drawer/drawer.js.map +0 -1
  208. package/dist/features/ui/sticker-grid/sticker-grid-styles.js.map +0 -1
  209. package/dist/features/ui/sticker-grid/sticker-grid.js +0 -24
  210. package/dist/features/ui/sticker-grid/sticker-grid.js.map +0 -1
  211. package/dist/features/ui/sticker-grid/sticker.js +0 -57
  212. package/dist/features/ui/sticker-grid/sticker.js.map +0 -1
  213. package/dist/features/ui/stickers/constants.js +0 -6
  214. package/dist/features/ui/stickers/constants.js.map +0 -1
  215. package/dist/features/ui/stickers/stickers-effects.js.map +0 -1
  216. package/dist/features/ui/stickers/stickers-styled.js.map +0 -1
  217. package/dist/features/ui/stickers/stickers-utils.js.map +0 -1
  218. package/dist/features/ui/stickers/stickers.js +0 -40
  219. package/dist/features/ui/stickers/stickers.js.map +0 -1
  220. package/dist/node_modules/decode-uri-component/index.js.map +0 -1
  221. package/dist/node_modules/uuid/dist/esm-browser/native.js +0 -7
  222. package/dist/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
  223. package/dist/static/animated-avatar.1ad58b1d.json +0 -1
  224. package/dist/static/animated-avatar.69b07505.json +0 -1
  225. package/dist/static/animated-avatar.9c560b46.json +0 -1
  226. package/dist/static/calendar-purple.1a840b41.svg +0 -1
  227. package/dist/static/flying-disk.c7f6ed39.json +0 -1
  228. package/dist/static/graduation-cap.3be3340a.json +0 -1
  229. package/dist/static/handshake.287e7dfb.svg +0 -1
  230. package/dist/static/light-bulb.c6db0b23.json +0 -1
  231. package/dist/static/money.332aacf1.svg +0 -1
  232. package/dist/static/muscle.9bcfb8a7.json +0 -1
  233. package/dist/static/nudge-tap.0591aef4.json +0 -1
  234. package/dist/static/parent-avatar.822c7b9b.svg +0 -1
  235. package/dist/static/pencil.23df9da0.json +0 -1
  236. package/dist/static/plus-sign.de6af957.json +0 -1
  237. package/dist/static/racing-car.2cbf864e.json +0 -1
  238. package/dist/static/rocket.0a3ccab0.json +0 -1
  239. package/dist/static/shovel.abeec04c.json +0 -1
  240. package/dist/static/trustpilot.bd3d79e1.svg +0 -1
  241. /package/dist/node_modules/{decode-uri-component → query-string/node_modules/decode-uri-component}/index.js +0 -0
@@ -1,22 +1,22 @@
1
- const t = 792, e = 1008, s = 30, T = 32, n = 28, I = 48, a = 42, c = 16, E = 56, _ = 0, o = 52, O = { left: 0, top: 56 }, N = [
1
+ const t = 792, e = 1008, s = 30, T = 32, n = 28, I = 48, E = 42, c = 16, a = 56, _ = 0, o = 360, O = 52, N = { left: 0, top: 56 }, R = [
2
2
  "practice-basic-optional",
3
3
  "practice-regular-optional",
4
4
  "advanced-we-do",
5
5
  "advanced-your-turn",
6
6
  "advanced-explore",
7
7
  "advanced-practice"
8
- ], R = 2e3, S = [
8
+ ], A = 2e3, S = [
9
9
  { name: "CORRECT", url: "https://static.qumath.in/static/intel-student/cmpress/correct-zap.mp3" },
10
10
  {
11
11
  name: "INCORRECT",
12
12
  url: "https://static.qumath.in/static/intel-student/cmpress/incorrect-zap.mp3"
13
13
  }
14
- ], A = [
14
+ ], i = [
15
15
  {
16
16
  name: "VALIDATE",
17
17
  url: "https://wmznlejcfq.s3.ap-southeast-1.amazonaws.com/static/intel-student/cmpress/validate-zap.mp3"
18
18
  }
19
- ], i = [
19
+ ], l = [
20
20
  {
21
21
  label: "Answered all the questions independently.",
22
22
  id: "E"
@@ -31,20 +31,21 @@ const t = 792, e = 1008, s = 30, T = 32, n = 28, I = 48, a = 42, c = 16, E = 56,
31
31
  }
32
32
  ];
33
33
  export {
34
- E as ACTION_BAR_HEIGHT,
35
- R as CLOZE_FORMULA_RESPONSE_LIMIT,
36
- O as DESMOS_CALC_POSITION,
37
- i as EXIT_TICKET_RATING_OPTIONS,
34
+ a as ACTION_BAR_HEIGHT,
35
+ A as CLOZE_FORMULA_RESPONSE_LIMIT,
36
+ N as DESMOS_CALC_POSITION,
37
+ l as EXIT_TICKET_RATING_OPTIONS,
38
38
  s as INTERSECTION_OBSERVER_THRESHOLD_POINTS,
39
39
  T as INTERSECTION_OBSERVER_THROTTLE_TIME,
40
- N as OPTIONAL_ITEM_TYPES,
40
+ o as LEARNOSITY_KEYBOARD_HEIGHT,
41
+ R as OPTIONAL_ITEM_TYPES,
41
42
  c as QUESTIONS_GAP,
42
43
  t as QUESTION_WIDTH,
43
- o as SIDEBAR_WIDTH,
44
+ O as SIDEBAR_WIDTH,
44
45
  e as SPLIT_QUESTION_WIDTH,
45
46
  S as SYSTEM_VALIDATION_AUDIO_LIST,
46
- A as TEACHER_VALIDATION_AUDIO_LIST,
47
- a as TOP_NAVIGATION_ARROW_WIDTH,
47
+ i as TEACHER_VALIDATION_AUDIO_LIST,
48
+ E as TOP_NAVIGATION_ARROW_WIDTH,
48
49
  I as TOP_NAVIGATION_HEIGHT,
49
50
  _ as WORKSHEET_CONTAINER_BORDER_RADIUS,
50
51
  n as WORKSHEET_NUDGE_BANNER_HEIGHT
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../src/features/worksheet/worksheet/constants.ts"],"sourcesContent":["import type { QUESTIONS_RATING, TItemType } from './worksheet-types';\n\nexport const QUESTION_WIDTH = 792;\nexport const SPLIT_QUESTION_WIDTH = 1008; // 1024 - 16\nexport const INTERSECTION_OBSERVER_THRESHOLD_POINTS = 30;\nexport const INTERSECTION_OBSERVER_THROTTLE_TIME = 32; // in ms, 2 frames\nexport const WORKSHEET_NUDGE_BANNER_HEIGHT = 28;\n\nexport const TOP_NAVIGATION_HEIGHT = 48;\nexport const TOP_NAVIGATION_ARROW_WIDTH = 42;\n\nexport const QUESTIONS_GAP = 16;\nexport const ACTION_BAR_HEIGHT = 56;\nexport const WORKSHEET_CONTAINER_BORDER_RADIUS = 0;\nexport const SIDEBAR_WIDTH = 52;\n\nexport const DESMOS_CALC_POSITION = { left: 0, top: 56 };\n\nexport const OPTIONAL_ITEM_TYPES: TItemType[] = [\n 'practice-basic-optional',\n 'practice-regular-optional',\n 'advanced-we-do',\n 'advanced-your-turn',\n 'advanced-explore',\n 'advanced-practice',\n];\nexport const CLOZE_FORMULA_RESPONSE_LIMIT = 2000;\n\nexport const SYSTEM_VALIDATION_AUDIO_LIST = [\n { name: 'CORRECT', url: 'https://static.qumath.in/static/intel-student/cmpress/correct-zap.mp3' },\n {\n name: 'INCORRECT',\n url: 'https://static.qumath.in/static/intel-student/cmpress/incorrect-zap.mp3',\n },\n];\nexport const TEACHER_VALIDATION_AUDIO_LIST = [\n {\n name: 'VALIDATE',\n url: 'https://wmznlejcfq.s3.ap-southeast-1.amazonaws.com/static/intel-student/cmpress/validate-zap.mp3',\n },\n];\n\nexport const EXIT_TICKET_RATING_OPTIONS: Array<{\n label: string;\n id: keyof typeof QUESTIONS_RATING;\n}> = [\n {\n label: 'Answered all the questions independently.',\n id: 'E',\n },\n {\n label: 'Needed some help to answer the questions.',\n id: 'S',\n },\n {\n label: 'Needed a lot of help to answer the questions.',\n id: 'H',\n },\n];\n"],"names":["QUESTION_WIDTH","SPLIT_QUESTION_WIDTH","INTERSECTION_OBSERVER_THRESHOLD_POINTS","INTERSECTION_OBSERVER_THROTTLE_TIME","WORKSHEET_NUDGE_BANNER_HEIGHT","TOP_NAVIGATION_HEIGHT","TOP_NAVIGATION_ARROW_WIDTH","QUESTIONS_GAP","ACTION_BAR_HEIGHT","WORKSHEET_CONTAINER_BORDER_RADIUS","SIDEBAR_WIDTH","DESMOS_CALC_POSITION","OPTIONAL_ITEM_TYPES","CLOZE_FORMULA_RESPONSE_LIMIT","SYSTEM_VALIDATION_AUDIO_LIST","TEACHER_VALIDATION_AUDIO_LIST","EXIT_TICKET_RATING_OPTIONS"],"mappings":"AAEO,MAAMA,IAAiB,KACjBC,IAAuB,MACvBC,IAAyC,IACzCC,IAAsC,IACtCC,IAAgC,IAEhCC,IAAwB,IACxBC,IAA6B,IAE7BC,IAAgB,IAChBC,IAAoB,IACpBC,IAAoC,GACpCC,IAAgB,IAEhBC,IAAuB,EAAE,MAAM,GAAG,KAAK,GAAG,GAE1CC,IAAmC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GACaC,IAA+B,KAE/BC,IAA+B;AAAA,EAC1C,EAAE,MAAM,WAAW,KAAK,wEAAwE;AAAA,EAChG;AAAA,IACE,MAAM;AAAA,IACN,KAAK;AAAA,EACP;AACF,GACaC,IAAgC;AAAA,EAC3C;AAAA,IACE,MAAM;AAAA,IACN,KAAK;AAAA,EACP;AACF,GAEaC,IAGR;AAAA,EACH;AAAA,IACE,OAAO;AAAA,IACP,IAAI;AAAA,EACN;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,IAAI;AAAA,EACN;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,IAAI;AAAA,EACN;AACF;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/features/worksheet/worksheet/constants.ts"],"sourcesContent":["import type { QUESTIONS_RATING, TItemType } from './worksheet-types';\n\nexport const QUESTION_WIDTH = 792;\nexport const SPLIT_QUESTION_WIDTH = 1008; // 1024 - 16\nexport const INTERSECTION_OBSERVER_THRESHOLD_POINTS = 30;\nexport const INTERSECTION_OBSERVER_THROTTLE_TIME = 32; // in ms, 2 frames\nexport const WORKSHEET_NUDGE_BANNER_HEIGHT = 28;\n\nexport const TOP_NAVIGATION_HEIGHT = 48;\nexport const TOP_NAVIGATION_ARROW_WIDTH = 42;\n\nexport const QUESTIONS_GAP = 16;\nexport const ACTION_BAR_HEIGHT = 56;\nexport const WORKSHEET_CONTAINER_BORDER_RADIUS = 0;\nexport const LEARNOSITY_KEYBOARD_HEIGHT = 360;\nexport const SIDEBAR_WIDTH = 52;\n\nexport const DESMOS_CALC_POSITION = { left: 0, top: 56 };\n\nexport const OPTIONAL_ITEM_TYPES: TItemType[] = [\n 'practice-basic-optional',\n 'practice-regular-optional',\n 'advanced-we-do',\n 'advanced-your-turn',\n 'advanced-explore',\n 'advanced-practice',\n];\nexport const CLOZE_FORMULA_RESPONSE_LIMIT = 2000;\n\nexport const SYSTEM_VALIDATION_AUDIO_LIST = [\n { name: 'CORRECT', url: 'https://static.qumath.in/static/intel-student/cmpress/correct-zap.mp3' },\n {\n name: 'INCORRECT',\n url: 'https://static.qumath.in/static/intel-student/cmpress/incorrect-zap.mp3',\n },\n];\nexport const TEACHER_VALIDATION_AUDIO_LIST = [\n {\n name: 'VALIDATE',\n url: 'https://wmznlejcfq.s3.ap-southeast-1.amazonaws.com/static/intel-student/cmpress/validate-zap.mp3',\n },\n];\n\nexport const EXIT_TICKET_RATING_OPTIONS: Array<{\n label: string;\n id: keyof typeof QUESTIONS_RATING;\n}> = [\n {\n label: 'Answered all the questions independently.',\n id: 'E',\n },\n {\n label: 'Needed some help to answer the questions.',\n id: 'S',\n },\n {\n label: 'Needed a lot of help to answer the questions.',\n id: 'H',\n },\n];\n"],"names":["QUESTION_WIDTH","SPLIT_QUESTION_WIDTH","INTERSECTION_OBSERVER_THRESHOLD_POINTS","INTERSECTION_OBSERVER_THROTTLE_TIME","WORKSHEET_NUDGE_BANNER_HEIGHT","TOP_NAVIGATION_HEIGHT","TOP_NAVIGATION_ARROW_WIDTH","QUESTIONS_GAP","ACTION_BAR_HEIGHT","WORKSHEET_CONTAINER_BORDER_RADIUS","LEARNOSITY_KEYBOARD_HEIGHT","SIDEBAR_WIDTH","DESMOS_CALC_POSITION","OPTIONAL_ITEM_TYPES","CLOZE_FORMULA_RESPONSE_LIMIT","SYSTEM_VALIDATION_AUDIO_LIST","TEACHER_VALIDATION_AUDIO_LIST","EXIT_TICKET_RATING_OPTIONS"],"mappings":"AAEO,MAAMA,IAAiB,KACjBC,IAAuB,MACvBC,IAAyC,IACzCC,IAAsC,IACtCC,IAAgC,IAEhCC,IAAwB,IACxBC,IAA6B,IAE7BC,IAAgB,IAChBC,IAAoB,IACpBC,IAAoC,GACpCC,IAA6B,KAC7BC,IAAgB,IAEhBC,IAAuB,EAAE,MAAM,GAAG,KAAK,GAAG,GAE1CC,IAAmC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GACaC,IAA+B,KAE/BC,IAA+B;AAAA,EAC1C,EAAE,MAAM,WAAW,KAAK,wEAAwE;AAAA,EAChG;AAAA,IACE,MAAM;AAAA,IACN,KAAK;AAAA,EACP;AACF,GACaC,IAAgC;AAAA,EAC3C;AAAA,IACE,MAAM;AAAA,IACN,KAAK;AAAA,EACP;AACF,GAEaC,IAGR;AAAA,EACH;AAAA,IACE,OAAO;AAAA,IACP,IAAI;AAAA,EACN;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,IAAI;AAAA,EACN;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,IAAI;AAAA,EACN;AACF;"}
@@ -1,21 +1,21 @@
1
- import { jsx as L } from "react/jsx-runtime";
2
- import { memo as M, useRef as y, useCallback as R, useEffect as m } from "react";
1
+ import { jsx as v } from "react/jsx-runtime";
2
+ import { memo as R, useRef as E, useCallback as A, useEffect as m } from "react";
3
3
  import g from "../hooks/use-learnosity-append.js";
4
- import { LearnosityQuestionContainer as O } from "./worksheet-question-styled.js";
5
- const Q = ["numberline", "imageclozeassociationV2"], $ = M(
4
+ import { LearnosityQuestionContainer as b } from "./worksheet-question-styled.js";
5
+ const N = R(
6
6
  ({
7
- signedRequest: v,
7
+ signedRequest: S,
8
8
  appended: o,
9
9
  canRender: I,
10
10
  canForceAppend: a,
11
11
  question: t,
12
12
  response: s,
13
- learnosity: _,
14
- isConceptIntro: A,
13
+ learnosity: w,
14
+ isConceptIntro: M,
15
15
  simState: c,
16
- onMediaStateChange: w
16
+ onMediaStateChange: _
17
17
  }) => {
18
- const l = y(null), n = y(s), { forceAppend: p } = g(v), d = R(
18
+ const l = E(null), n = E(s), { forceAppend: p } = g(S), d = A(
19
19
  (e) => {
20
20
  const { source: r, data: i } = e, { type: u } = i ?? {};
21
21
  u === "SIM_IS_READY" ? r.postMessage(
@@ -27,10 +27,10 @@ const Q = ["numberline", "imageclozeassociationV2"], $ = M(
27
27
  }
28
28
  },
29
29
  "*"
30
- ) : u === "SIM_STATE_UPDATE" && w(t, "SIMULATION", e.data.payload);
30
+ ) : u === "SIM_STATE_UPDATE" && _(t, "SIMULATION", e.data.payload);
31
31
  },
32
- [a, c, w, t]
33
- ), E = R(
32
+ [a, c, _, t]
33
+ ), y = A(
34
34
  (e) => {
35
35
  window.requestAnimationFrame(() => {
36
36
  var i, u, T;
@@ -40,20 +40,20 @@ const Q = ["numberline", "imageclozeassociationV2"], $ = M(
40
40
  }), (T = l.current) == null || T.append(r), p({
41
41
  question: t,
42
42
  response: e,
43
- removeOldElements: Q.includes(t.type) ? "before" : "after",
43
+ removeOldElements: t.type === "numberline" ? "before" : "after",
44
44
  callback: (f) => {
45
- f || (n.current && n.current !== e ? E(n.current) : n.current = void 0);
45
+ f || (n.current && n.current !== e ? y(n.current) : n.current = void 0);
46
46
  }
47
47
  });
48
48
  });
49
49
  },
50
50
  [p, t]
51
- ), S = y(!1);
51
+ ), L = E(!1);
52
52
  return m(() => {
53
53
  let e;
54
- return I && (S.current || (e = window.requestAnimationFrame(() => {
54
+ return I && (L.current || (e = window.requestAnimationFrame(() => {
55
55
  const r = n.current ?? s;
56
- S.current = !0, _.appendQuestion({
56
+ L.current = !0, w.appendQuestion({
57
57
  questions: [t],
58
58
  ...r ? {
59
59
  responses: {
@@ -67,7 +67,7 @@ const Q = ["numberline", "imageclozeassociationV2"], $ = M(
67
67
  }))), () => {
68
68
  e && window.cancelAnimationFrame(e);
69
69
  };
70
- }, [I, _, t, s]), m(() => {
70
+ }, [I, w, t, s]), m(() => {
71
71
  var e;
72
72
  return o && (n.current = void 0, (e = l.current) != null && e.querySelector("iframe") && window.addEventListener("message", d)), () => {
73
73
  window.removeEventListener("message", d);
@@ -85,19 +85,19 @@ const Q = ["numberline", "imageclozeassociationV2"], $ = M(
85
85
  ));
86
86
  }
87
87
  }, [o, a, c]), m(() => {
88
- o && s && a && s !== n.current && (n.current ? n.current = s : (n.current = s, E(s)));
89
- }, [o, a, s, E]), /* @__PURE__ */ L(
90
- O,
88
+ o && s && a && s !== n.current && (n.current ? n.current = s : (n.current = s, y(s)));
89
+ }, [o, a, s, y]), /* @__PURE__ */ v(
90
+ b,
91
91
  {
92
92
  ref: l,
93
- $isConceptIntro: A,
93
+ $isConceptIntro: M,
94
94
  $isTeacher: a,
95
- children: /* @__PURE__ */ L("div", { className: `learnosity-response question-${t.response_id}` })
95
+ children: /* @__PURE__ */ v("div", { className: `learnosity-response question-${t.response_id}` })
96
96
  }
97
97
  );
98
98
  }
99
99
  );
100
100
  export {
101
- $ as default
101
+ N as default
102
102
  };
103
103
  //# sourceMappingURL=learnosity-question.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"learnosity-question.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-question/learnosity-question.tsx"],"sourcesContent":["import type { ILearnosityQuestionResponse } from '../worksheet-types';\nimport type { ILearnosityQuestionProps } from './worksheet-question-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useRef } from 'react';\n\nimport useLearnosityAppend from '../hooks/use-learnosity-append';\nimport * as Styled from './worksheet-question-styled';\n\nconst REMOVE_BEFORE_QUESTIONS = ['numberline', 'imageclozeassociationV2'];\n\nconst LearnosityQuestion: FC<ILearnosityQuestionProps> = memo(\n ({\n signedRequest,\n appended,\n canRender,\n canForceAppend,\n question,\n response,\n learnosity,\n isConceptIntro,\n simState,\n onMediaStateChange,\n }) => {\n const containerElementRef = useRef<HTMLDivElement>(null);\n const latestQuestionResponseRef = useRef<ILearnosityQuestionResponse | undefined>(response);\n const { forceAppend } = useLearnosityAppend(signedRequest);\n\n const handleSimIframeMessage = useCallback(\n (event: MessageEvent) => {\n const { source, data } = event;\n const { type } = data ?? ({} as { type: string });\n\n if (type === 'SIM_IS_READY') {\n (source as Window).postMessage(\n {\n type: 'SIMULATION_CONFIG',\n payload: {\n userRole: canForceAppend ? 'teacher' : 'student',\n simulationState: simState,\n },\n },\n '*',\n );\n } else if (type === 'SIM_STATE_UPDATE') {\n onMediaStateChange(question, 'SIMULATION', event.data.payload);\n }\n },\n [canForceAppend, simState, onMediaStateChange, question],\n );\n\n const updateResponse = useCallback(\n (newResponse: ILearnosityQuestionResponse) => {\n window.requestAnimationFrame(() => {\n const questionElement = document.createElement('div');\n\n questionElement.classList.add('learnosity-response');\n questionElement.classList.add(`question-${question.response_id}`);\n // Drawing questions looks for already appended path elements with id, if present it will not append the path, to overcome this issue we are adding temp to the id\n containerElementRef.current?.children[0]\n ?.querySelectorAll('.lrn_drawing svg path')\n .forEach(path => {\n path.id = `${path.id} + temp`;\n });\n\n containerElementRef.current?.append(questionElement);\n forceAppend({\n question,\n response: newResponse,\n removeOldElements: REMOVE_BEFORE_QUESTIONS.includes(question.type) ? 'before' : 'after',\n callback: error => {\n if (error) return;\n\n if (\n latestQuestionResponseRef.current &&\n latestQuestionResponseRef.current !== newResponse\n )\n updateResponse(latestQuestionResponseRef.current);\n else latestQuestionResponseRef.current = undefined;\n },\n });\n });\n },\n [forceAppend, question],\n );\n\n const appendQuestionCalledRef = useRef(false);\n\n useEffect(() => {\n let requestId: number;\n\n if (canRender) {\n if (!appendQuestionCalledRef.current) {\n requestId = window.requestAnimationFrame(() => {\n const appenndableResponse = latestQuestionResponseRef.current ?? response;\n\n appendQuestionCalledRef.current = true;\n learnosity.appendQuestion({\n questions: [question],\n ...(appenndableResponse\n ? {\n responses: {\n [question.response_id]: {\n // Learnosity is mutating the response object, so we need to clone it\n ...appenndableResponse,\n },\n },\n }\n : {}),\n });\n });\n }\n }\n\n return () => {\n if (requestId) window.cancelAnimationFrame(requestId);\n };\n }, [canRender, learnosity, question, response]);\n\n useEffect(() => {\n if (appended) {\n latestQuestionResponseRef.current = undefined;\n\n if (containerElementRef.current?.querySelector('iframe')) {\n window.addEventListener('message', handleSimIframeMessage);\n }\n }\n\n return () => {\n window.removeEventListener('message', handleSimIframeMessage);\n };\n }, [appended, handleSimIframeMessage]);\n\n useEffect(() => {\n if (simState && appended) {\n const simIframe = containerElementRef.current?.querySelector('iframe');\n\n if (simIframe) {\n simIframe.contentWindow?.postMessage(\n {\n type: 'SIM_STATE_UPDATE',\n payload: simState,\n },\n '*',\n );\n }\n }\n }, [appended, canForceAppend, simState]);\n\n useEffect(() => {\n if (appended && response && canForceAppend) {\n if (response !== latestQuestionResponseRef.current) {\n if (!latestQuestionResponseRef.current) {\n latestQuestionResponseRef.current = response;\n updateResponse(response);\n } else {\n latestQuestionResponseRef.current = response;\n }\n }\n }\n }, [appended, canForceAppend, response, updateResponse]);\n\n return (\n <Styled.LearnosityQuestionContainer\n ref={containerElementRef}\n $isConceptIntro={isConceptIntro}\n $isTeacher={canForceAppend}\n >\n <div className={`learnosity-response question-${question.response_id}`} />\n </Styled.LearnosityQuestionContainer>\n );\n },\n);\n\nexport default LearnosityQuestion;\n"],"names":["REMOVE_BEFORE_QUESTIONS","LearnosityQuestion","memo","signedRequest","appended","canRender","canForceAppend","question","response","learnosity","isConceptIntro","simState","onMediaStateChange","containerElementRef","useRef","latestQuestionResponseRef","forceAppend","useLearnosityAppend","handleSimIframeMessage","useCallback","event","source","data","type","updateResponse","newResponse","questionElement","_b","_a","path","_c","error","appendQuestionCalledRef","useEffect","requestId","appenndableResponse","simIframe","jsx","Styled.LearnosityQuestionContainer"],"mappings":";;;;AASA,MAAMA,IAA0B,CAAC,cAAc,yBAAyB,GAElEC,IAAmDC;AAAA,EACvD,CAAC;AAAA,IACC,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAsBC,EAAuB,IAAI,GACjDC,IAA4BD,EAAgDN,CAAQ,GACpF,EAAE,aAAAQ,EAAA,IAAgBC,EAAoBd,CAAa,GAEnDe,IAAyBC;AAAA,MAC7B,CAACC,MAAwB;AACjB,cAAA,EAAE,QAAAC,GAAQ,MAAAC,EAAS,IAAAF,GACnB,EAAE,MAAAG,EAAA,IAASD,KAAS;AAE1B,QAAIC,MAAS,iBACVF,EAAkB;AAAA,UACjB;AAAA,YACE,MAAM;AAAA,YACN,SAAS;AAAA,cACP,UAAUf,IAAiB,YAAY;AAAA,cACvC,iBAAiBK;AAAA,YACnB;AAAA,UACF;AAAA,UACA;AAAA,QAAA,IAEOY,MAAS,sBAClBX,EAAmBL,GAAU,cAAca,EAAM,KAAK,OAAO;AAAA,MAEjE;AAAA,MACA,CAACd,GAAgBK,GAAUC,GAAoBL,CAAQ;AAAA,IAAA,GAGnDiB,IAAiBL;AAAA,MACrB,CAACM,MAA6C;AAC5C,eAAO,sBAAsB,MAAM;;AAC3B,gBAAAC,IAAkB,SAAS,cAAc,KAAK;AAEpC,UAAAA,EAAA,UAAU,IAAI,qBAAqB,GACnDA,EAAgB,UAAU,IAAI,YAAYnB,EAAS,WAAW,EAAE,IAE5CoB,KAAAC,IAAAf,EAAA,YAAA,gBAAAe,EAAS,SAAS,OAAlB,QAAAD,EAChB,iBAAiB,yBAClB,QAAQ,C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,GAAUc,CAAsB,CAAC,GAErCe,EAAU,MAAM;;AACd,UAAItB,KAAYP,GAAU;AACxB,cAAMgC,KAAYR,IAAAf,EAAoB,YAApB,gBAAAe,EAA6B,cAAc;AAE7D,QAAIQ,OACFT,IAAAS,EAAU,kBAAV,QAAAT,EAAyB;AAAA,UACvB;AAAA,YACE,MAAM;AAAA,YACN,SAAShB;AAAA,UACX;AAAA,UACA;AAAA;AAAA,MAGN;AAAA,IACC,GAAA,CAACP,GAAUE,GAAgBK,CAAQ,CAAC,GAEvCsB,EAAU,MAAM;AACV,MAAA7B,KAAYI,KAAYF,KACtBE,MAAaO,EAA0B,YACpCA,EAA0B,UAI7BA,EAA0B,UAAUP,KAHpCO,EAA0B,UAAUP,GACpCgB,EAAehB,CAAQ;AAAA,OAM5B,CAACJ,GAAUE,GAAgBE,GAAUgB,CAAc,CAAC,GAGrD,gBAAAa;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,KAAKzB;AAAA,QACL,iBAAiBH;AAAA,QACjB,YAAYJ;AAAA,QAEZ,4BAAC,OAAI,EAAA,WAAW,gCAAgCC,EAAS,WAAW,IAAI;AAAA,MAAA;AAAA,IAAA;AAAA,EAG9E;AACF;"}
1
+ {"version":3,"file":"learnosity-question.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-question/learnosity-question.tsx"],"sourcesContent":["import type { ILearnosityQuestionResponse } from '../worksheet-types';\nimport type { ILearnosityQuestionProps } from './worksheet-question-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useRef } from 'react';\n\nimport useLearnosityAppend from '../hooks/use-learnosity-append';\nimport * as Styled from './worksheet-question-styled';\n\nconst LearnosityQuestion: FC<ILearnosityQuestionProps> = memo(\n ({\n signedRequest,\n appended,\n canRender,\n canForceAppend,\n question,\n response,\n learnosity,\n isConceptIntro,\n simState,\n onMediaStateChange,\n }) => {\n const containerElementRef = useRef<HTMLDivElement>(null);\n const latestQuestionResponseRef = useRef<ILearnosityQuestionResponse | undefined>(response);\n const { forceAppend } = useLearnosityAppend(signedRequest);\n\n const handleSimIframeMessage = useCallback(\n (event: MessageEvent) => {\n const { source, data } = event;\n const { type } = data ?? ({} as { type: string });\n\n if (type === 'SIM_IS_READY') {\n (source as Window).postMessage(\n {\n type: 'SIMULATION_CONFIG',\n payload: {\n userRole: canForceAppend ? 'teacher' : 'student',\n simulationState: simState,\n },\n },\n '*',\n );\n } else if (type === 'SIM_STATE_UPDATE') {\n onMediaStateChange(question, 'SIMULATION', event.data.payload);\n }\n },\n [canForceAppend, simState, onMediaStateChange, question],\n );\n\n const updateResponse = useCallback(\n (newResponse: ILearnosityQuestionResponse) => {\n window.requestAnimationFrame(() => {\n const questionElement = document.createElement('div');\n\n questionElement.classList.add('learnosity-response');\n questionElement.classList.add(`question-${question.response_id}`);\n // Drawing questions looks for already appended path elements with id, if present it will not append the path, to overcome this issue we are adding temp to the id\n containerElementRef.current?.children[0]\n ?.querySelectorAll('.lrn_drawing svg path')\n .forEach(path => {\n path.id = `${path.id} + temp`;\n });\n\n containerElementRef.current?.append(questionElement);\n forceAppend({\n question,\n response: newResponse,\n removeOldElements: question.type === 'numberline' ? 'before' : 'after',\n callback: error => {\n if (error) return;\n\n if (\n latestQuestionResponseRef.current &&\n latestQuestionResponseRef.current !== newResponse\n )\n updateResponse(latestQuestionResponseRef.current);\n else latestQuestionResponseRef.current = undefined;\n },\n });\n });\n },\n [forceAppend, question],\n );\n\n const appendQuestionCalledRef = useRef(false);\n\n useEffect(() => {\n let requestId: number;\n\n if (canRender) {\n if (!appendQuestionCalledRef.current) {\n requestId = window.requestAnimationFrame(() => {\n const appenndableResponse = latestQuestionResponseRef.current ?? response;\n\n appendQuestionCalledRef.current = true;\n learnosity.appendQuestion({\n questions: [question],\n ...(appenndableResponse\n ? {\n responses: {\n [question.response_id]: {\n // Learnosity is mutating the response object, so we need to clone it\n ...appenndableResponse,\n },\n },\n }\n : {}),\n });\n });\n }\n }\n\n return () => {\n if (requestId) window.cancelAnimationFrame(requestId);\n };\n }, [canRender, learnosity, question, response]);\n\n useEffect(() => {\n if (appended) {\n latestQuestionResponseRef.current = undefined;\n\n if (containerElementRef.current?.querySelector('iframe')) {\n window.addEventListener('message', handleSimIframeMessage);\n }\n }\n\n return () => {\n window.removeEventListener('message', handleSimIframeMessage);\n };\n }, [appended, handleSimIframeMessage]);\n\n useEffect(() => {\n if (simState && appended) {\n const simIframe = containerElementRef.current?.querySelector('iframe');\n\n if (simIframe) {\n simIframe.contentWindow?.postMessage(\n {\n type: 'SIM_STATE_UPDATE',\n payload: simState,\n },\n '*',\n );\n }\n }\n }, [appended, canForceAppend, simState]);\n\n useEffect(() => {\n if (appended && response && canForceAppend) {\n if (response !== latestQuestionResponseRef.current) {\n if (!latestQuestionResponseRef.current) {\n latestQuestionResponseRef.current = response;\n updateResponse(response);\n } else {\n latestQuestionResponseRef.current = response;\n }\n }\n }\n }, [appended, canForceAppend, response, updateResponse]);\n\n return (\n <Styled.LearnosityQuestionContainer\n ref={containerElementRef}\n $isConceptIntro={isConceptIntro}\n $isTeacher={canForceAppend}\n >\n <div className={`learnosity-response question-${question.response_id}`} />\n </Styled.LearnosityQuestionContainer>\n );\n },\n);\n\nexport default LearnosityQuestion;\n"],"names":["LearnosityQuestion","memo","signedRequest","appended","canRender","canForceAppend","question","response","learnosity","isConceptIntro","simState","onMediaStateChange","containerElementRef","useRef","latestQuestionResponseRef","forceAppend","useLearnosityAppend","handleSimIframeMessage","useCallback","event","source","data","type","updateResponse","newResponse","questionElement","_b","_a","path","_c","error","appendQuestionCalledRef","useEffect","requestId","appenndableResponse","simIframe","jsx","Styled.LearnosityQuestionContainer"],"mappings":";;;;AASA,MAAMA,IAAmDC;AAAA,EACvD,CAAC;AAAA,IACC,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,UAAA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