@magmamath/students-features 0.4.5 → 0.5.0-rc.1

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 (806) hide show
  1. package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js +2 -1
  2. package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
  4. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.js +41 -0
  5. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +1 -0
  6. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +30 -47
  7. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
  8. package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +32 -32
  9. package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
  10. package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js +11 -13
  11. package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js.map +1 -1
  12. package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js +8 -28
  13. package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
  14. package/dist/commonjs/features/chatbot/components/Chatbot.js +5 -7
  15. package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
  16. package/dist/commonjs/features/chatbot/context/ChatBotModelContext.js +17 -0
  17. package/dist/commonjs/features/chatbot/context/ChatBotModelContext.js.map +1 -0
  18. package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.js +57 -0
  19. package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.js.map +1 -0
  20. package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.js +130 -0
  21. package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.js.map +1 -0
  22. package/dist/commonjs/features/chatbot/index.js +0 -7
  23. package/dist/commonjs/features/chatbot/index.js.map +1 -1
  24. package/dist/commonjs/features/chatbot/model/ChatBotModel.js +147 -122
  25. package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
  26. package/dist/commonjs/features/chatbot/model/{ChatBotMessageHandler.js → ChatBotThreadManager.js} +44 -22
  27. package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js.map +1 -0
  28. package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js +22 -0
  29. package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js.map +1 -0
  30. package/dist/commonjs/features/chatbot/model/{api.js → ChatbotApi.js} +15 -1
  31. package/dist/commonjs/features/chatbot/model/ChatbotApi.js.map +1 -0
  32. package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js +110 -0
  33. package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js.map +1 -0
  34. package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js +12 -12
  35. package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
  36. package/dist/commonjs/features/chatbot/model/ThreadItem.js +16 -8
  37. package/dist/commonjs/features/chatbot/model/ThreadItem.js.map +1 -1
  38. package/dist/commonjs/features/chatbot/model/constants.js.map +1 -1
  39. package/dist/commonjs/features/chatbot/model/messagesHelper.js +7 -7
  40. package/dist/commonjs/features/chatbot/model/messagesHelper.js.map +1 -1
  41. package/dist/commonjs/features/chatbot/model/t2s.js +18 -13
  42. package/dist/commonjs/features/chatbot/model/t2s.js.map +1 -1
  43. package/dist/commonjs/features/chatbot/model/translation.helpers.js.map +1 -1
  44. package/dist/commonjs/features/chatbot/model/translation.js +54 -45
  45. package/dist/commonjs/features/chatbot/model/translation.js.map +1 -1
  46. package/dist/commonjs/features/chatbot/types/api.types.js +4 -0
  47. package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
  48. package/dist/commonjs/features/chatbot/types/units.types.js +2 -0
  49. package/dist/commonjs/features/chatbot/types/units.types.js.map +1 -0
  50. package/dist/commonjs/index.js +0 -24
  51. package/dist/commonjs/index.js.map +1 -1
  52. package/dist/commonjs/lib/effector/createEntityFieldStore.js +4 -0
  53. package/dist/commonjs/lib/effector/createEntityFieldStore.js.map +1 -1
  54. package/dist/commonjs/lib/effector/withEvent.js +13 -0
  55. package/dist/commonjs/lib/effector/withEvent.js.map +1 -0
  56. package/dist/commonjs/lib/helpers/helpers.js +1 -3
  57. package/dist/commonjs/lib/helpers/helpers.js.map +1 -1
  58. package/dist/commonjs/lib/helpers/randomElements.js +24 -0
  59. package/dist/commonjs/lib/helpers/randomElements.js.map +1 -0
  60. package/dist/commonjs/lib/types/keys.js +2 -0
  61. package/dist/commonjs/lib/types/keys.js.map +1 -0
  62. package/dist/commonjs/shared/icons/HighlighterIcon.js +36 -0
  63. package/dist/commonjs/shared/icons/HighlighterIcon.js.map +1 -0
  64. package/dist/commonjs/shared/icons/{Valentine.js → StopIcon.js} +12 -9
  65. package/dist/commonjs/shared/icons/StopIcon.js.map +1 -0
  66. package/dist/commonjs/shared/icons/icon.types.js +4 -0
  67. package/dist/commonjs/shared/translation/constants.js +3 -3
  68. package/dist/commonjs/shared/translation/constants.js.map +1 -1
  69. package/dist/commonjs/shared/translation/helpers.js +22 -6
  70. package/dist/commonjs/shared/translation/helpers.js.map +1 -1
  71. package/dist/commonjs/shared/translation/hooks.js +3 -5
  72. package/dist/commonjs/shared/translation/hooks.js.map +1 -1
  73. package/{src/lib → dist/commonjs/shared/translation}/localization/en.json +8 -1
  74. package/dist/{module/lib → commonjs/shared/translation}/localization/gb.json +8 -1
  75. package/dist/commonjs/{lib → shared/translation}/localization/sw.json +8 -1
  76. package/dist/commonjs/shared/translation/model.js +1 -1
  77. package/dist/commonjs/shared/translation/model.js.map +1 -1
  78. package/dist/commonjs/shared/translation/types.js +1 -1
  79. package/dist/commonjs/shared/translation/types.js.map +1 -1
  80. package/dist/commonjs/shared/translation/validation.types.js +6 -0
  81. package/dist/commonjs/shared/translation/validation.types.js.map +1 -0
  82. package/dist/module/features/chatbot/components/Alternatives/Alternatives.js +2 -1
  83. package/dist/module/features/chatbot/components/Alternatives/Alternatives.js.map +1 -1
  84. package/dist/module/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
  85. package/dist/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.js +35 -0
  86. package/dist/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +1 -0
  87. package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +31 -48
  88. package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
  89. package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +32 -32
  90. package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
  91. package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js +11 -13
  92. package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js.map +1 -1
  93. package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js +8 -28
  94. package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
  95. package/dist/module/features/chatbot/components/Chatbot.js +6 -8
  96. package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
  97. package/dist/module/features/chatbot/context/ChatBotModelContext.js +12 -0
  98. package/dist/module/features/chatbot/context/ChatBotModelContext.js.map +1 -0
  99. package/dist/module/features/chatbot/errorSpotting/ErrorSpottingButton.js +51 -0
  100. package/dist/module/features/chatbot/errorSpotting/ErrorSpottingButton.js.map +1 -0
  101. package/dist/module/features/chatbot/errorSpotting/ErrorSpottingModel.js +125 -0
  102. package/dist/module/features/chatbot/errorSpotting/ErrorSpottingModel.js.map +1 -0
  103. package/dist/module/features/chatbot/index.js +0 -1
  104. package/dist/module/features/chatbot/index.js.map +1 -1
  105. package/dist/module/features/chatbot/model/ChatBotModel.js +149 -124
  106. package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
  107. package/dist/module/features/chatbot/model/{ChatBotMessageHandler.js → ChatBotThreadManager.js} +42 -20
  108. package/dist/module/features/chatbot/model/ChatBotThreadManager.js.map +1 -0
  109. package/dist/module/features/chatbot/model/ChatBoxTextManager.js +17 -0
  110. package/dist/module/features/chatbot/model/ChatBoxTextManager.js.map +1 -0
  111. package/dist/module/features/chatbot/model/{api.js → ChatbotApi.js} +15 -1
  112. package/dist/module/features/chatbot/model/ChatbotApi.js.map +1 -0
  113. package/dist/module/features/chatbot/model/ChatsCacheModel.js +104 -0
  114. package/dist/module/features/chatbot/model/ChatsCacheModel.js.map +1 -0
  115. package/dist/module/features/chatbot/model/DefaultMessageCreator.js +12 -12
  116. package/dist/module/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
  117. package/dist/module/features/chatbot/model/ThreadItem.js +16 -8
  118. package/dist/module/features/chatbot/model/ThreadItem.js.map +1 -1
  119. package/dist/module/features/chatbot/model/constants.js.map +1 -1
  120. package/dist/module/features/chatbot/model/messagesHelper.js +7 -7
  121. package/dist/module/features/chatbot/model/messagesHelper.js.map +1 -1
  122. package/dist/module/features/chatbot/model/t2s.js +19 -14
  123. package/dist/module/features/chatbot/model/t2s.js.map +1 -1
  124. package/dist/module/features/chatbot/model/translation.helpers.js.map +1 -1
  125. package/dist/module/features/chatbot/model/translation.js +54 -45
  126. package/dist/module/features/chatbot/model/translation.js.map +1 -1
  127. package/dist/module/features/chatbot/types/api.types.js +2 -0
  128. package/dist/module/features/chatbot/types/model.types.js.map +1 -1
  129. package/dist/module/features/chatbot/types/units.types.js +2 -0
  130. package/dist/module/features/chatbot/types/units.types.js.map +1 -0
  131. package/dist/module/index.js +0 -2
  132. package/dist/module/index.js.map +1 -1
  133. package/dist/module/lib/effector/createEntityFieldStore.js +4 -0
  134. package/dist/module/lib/effector/createEntityFieldStore.js.map +1 -1
  135. package/dist/module/lib/effector/withEvent.js +9 -0
  136. package/dist/module/lib/effector/withEvent.js.map +1 -0
  137. package/dist/module/lib/helpers/helpers.js +0 -1
  138. package/dist/module/lib/helpers/helpers.js.map +1 -1
  139. package/dist/module/lib/helpers/randomElements.js +20 -0
  140. package/dist/module/lib/helpers/randomElements.js.map +1 -0
  141. package/dist/module/lib/types/keys.js +2 -0
  142. package/dist/module/lib/types/keys.js.map +1 -0
  143. package/dist/module/shared/icons/HighlighterIcon.js +29 -0
  144. package/dist/module/shared/icons/HighlighterIcon.js.map +1 -0
  145. package/dist/module/shared/icons/StopIcon.js +26 -0
  146. package/dist/module/shared/icons/StopIcon.js.map +1 -0
  147. package/dist/module/shared/icons/icon.types.js +2 -0
  148. package/dist/module/shared/translation/constants.js +3 -3
  149. package/dist/module/shared/translation/constants.js.map +1 -1
  150. package/dist/module/shared/translation/helpers.js +19 -5
  151. package/dist/module/shared/translation/helpers.js.map +1 -1
  152. package/dist/module/shared/translation/hooks.js +4 -6
  153. package/dist/module/shared/translation/hooks.js.map +1 -1
  154. package/dist/{commonjs/lib → module/shared/translation}/localization/en.json +8 -1
  155. package/{src/lib → dist/module/shared/translation}/localization/gb.json +8 -1
  156. package/dist/module/{lib → shared/translation}/localization/sw.json +8 -1
  157. package/dist/module/shared/translation/model.js +1 -1
  158. package/dist/module/shared/translation/model.js.map +1 -1
  159. package/dist/module/shared/translation/types.js +2 -0
  160. package/dist/module/shared/translation/types.js.map +1 -1
  161. package/dist/module/shared/translation/validation.types.js +4 -0
  162. package/dist/module/shared/translation/validation.types.js.map +1 -0
  163. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts +1 -3
  164. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -1
  165. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts +5 -5
  166. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
  167. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts +11 -0
  168. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +1 -0
  169. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +7 -3
  170. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -1
  171. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +1 -1
  172. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
  173. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/SentMessage.d.ts +1 -1
  174. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/SentMessage.d.ts.map +1 -1
  175. package/dist/typescript/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts +2 -10
  176. package/dist/typescript/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +1 -1
  177. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts +2 -5
  178. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
  179. package/dist/typescript/commonjs/features/chatbot/context/ChatBotModelContext.d.ts +4 -0
  180. package/dist/typescript/commonjs/features/chatbot/context/ChatBotModelContext.d.ts.map +1 -0
  181. package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts +8 -0
  182. package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts.map +1 -0
  183. package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts +35 -0
  184. package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts.map +1 -0
  185. package/dist/typescript/commonjs/features/chatbot/index.d.ts +4 -3
  186. package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
  187. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +24 -18
  188. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  189. package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts +33 -0
  190. package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -0
  191. package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts +6 -0
  192. package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -0
  193. package/dist/typescript/commonjs/features/chatbot/model/{api.d.ts → ChatbotApi.d.ts} +4 -3
  194. package/dist/typescript/commonjs/features/chatbot/model/ChatbotApi.d.ts.map +1 -0
  195. package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts +27 -0
  196. package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -0
  197. package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts +5 -3
  198. package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
  199. package/dist/typescript/commonjs/features/chatbot/model/ThreadItem.d.ts +13 -7
  200. package/dist/typescript/commonjs/features/chatbot/model/ThreadItem.d.ts.map +1 -1
  201. package/dist/typescript/commonjs/features/chatbot/model/constants.d.ts.map +1 -1
  202. package/dist/typescript/commonjs/features/chatbot/model/messagesHelper.d.ts +7 -5
  203. package/dist/typescript/commonjs/features/chatbot/model/messagesHelper.d.ts.map +1 -1
  204. package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts +16 -6
  205. package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts.map +1 -1
  206. package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts +7 -8
  207. package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts.map +1 -1
  208. package/dist/typescript/commonjs/features/chatbot/model/translation.helpers.d.ts +2 -1
  209. package/dist/typescript/commonjs/features/chatbot/model/translation.helpers.d.ts.map +1 -1
  210. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +12 -11
  211. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
  212. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +19 -24
  213. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
  214. package/dist/typescript/commonjs/features/chatbot/types/t2s.types.d.ts +2 -7
  215. package/dist/typescript/commonjs/features/chatbot/types/t2s.types.d.ts.map +1 -1
  216. package/dist/typescript/commonjs/features/chatbot/types/translation.types.d.ts +2 -1
  217. package/dist/typescript/commonjs/features/chatbot/types/translation.types.d.ts.map +1 -1
  218. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts +34 -0
  219. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts.map +1 -0
  220. package/dist/typescript/commonjs/index.d.ts +0 -3
  221. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  222. package/dist/typescript/commonjs/lib/effector/createEntityFieldStore.d.ts +2 -0
  223. package/dist/typescript/commonjs/lib/effector/createEntityFieldStore.d.ts.map +1 -1
  224. package/dist/typescript/commonjs/lib/effector/withEvent.d.ts +2 -0
  225. package/dist/typescript/commonjs/lib/effector/withEvent.d.ts.map +1 -0
  226. package/dist/typescript/commonjs/lib/helpers/helpers.d.ts +0 -1
  227. package/dist/typescript/commonjs/lib/helpers/helpers.d.ts.map +1 -1
  228. package/dist/typescript/commonjs/lib/helpers/randomElements.d.ts +2 -0
  229. package/dist/typescript/commonjs/lib/helpers/randomElements.d.ts.map +1 -0
  230. package/dist/typescript/commonjs/lib/types/keys.d.ts +8 -0
  231. package/dist/typescript/commonjs/lib/types/keys.d.ts.map +1 -0
  232. package/dist/typescript/commonjs/shared/icons/HighlighterIcon.d.ts +4 -0
  233. package/dist/typescript/commonjs/shared/icons/HighlighterIcon.d.ts.map +1 -0
  234. package/dist/typescript/commonjs/shared/icons/StopIcon.d.ts +4 -0
  235. package/dist/typescript/commonjs/shared/icons/StopIcon.d.ts.map +1 -0
  236. package/dist/typescript/commonjs/shared/icons/icon.types.d.ts +2 -0
  237. package/dist/typescript/commonjs/shared/icons/icon.types.d.ts.map +1 -1
  238. package/dist/typescript/commonjs/shared/translation/constants.d.ts +21 -0
  239. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  240. package/dist/typescript/commonjs/shared/translation/helpers.d.ts +3 -2
  241. package/dist/typescript/commonjs/shared/translation/helpers.d.ts.map +1 -1
  242. package/dist/typescript/commonjs/shared/translation/hooks.d.ts +2 -2
  243. package/dist/typescript/commonjs/shared/translation/hooks.d.ts.map +1 -1
  244. package/dist/typescript/commonjs/shared/translation/index.d.ts +0 -1
  245. package/dist/typescript/commonjs/shared/translation/index.d.ts.map +1 -1
  246. package/dist/typescript/commonjs/shared/translation/model.d.ts +43 -3
  247. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  248. package/dist/typescript/commonjs/shared/translation/types.d.ts +4 -4
  249. package/dist/typescript/commonjs/shared/translation/types.d.ts.map +1 -1
  250. package/dist/typescript/commonjs/shared/translation/validation.types.d.ts +17 -0
  251. package/dist/typescript/commonjs/shared/translation/validation.types.d.ts.map +1 -0
  252. package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts +1 -3
  253. package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -1
  254. package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts +5 -5
  255. package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
  256. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts +11 -0
  257. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +1 -0
  258. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +7 -3
  259. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -1
  260. package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +1 -1
  261. package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
  262. package/dist/typescript/module/features/chatbot/components/ChatMessage/SentMessage.d.ts +1 -1
  263. package/dist/typescript/module/features/chatbot/components/ChatMessage/SentMessage.d.ts.map +1 -1
  264. package/dist/typescript/module/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts +2 -10
  265. package/dist/typescript/module/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +1 -1
  266. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts +2 -5
  267. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
  268. package/dist/typescript/module/features/chatbot/context/ChatBotModelContext.d.ts +4 -0
  269. package/dist/typescript/module/features/chatbot/context/ChatBotModelContext.d.ts.map +1 -0
  270. package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts +8 -0
  271. package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts.map +1 -0
  272. package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts +35 -0
  273. package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts.map +1 -0
  274. package/dist/typescript/module/features/chatbot/index.d.ts +4 -3
  275. package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
  276. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +24 -18
  277. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  278. package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts +33 -0
  279. package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -0
  280. package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts +6 -0
  281. package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -0
  282. package/dist/typescript/module/features/chatbot/model/{api.d.ts → ChatbotApi.d.ts} +4 -3
  283. package/dist/typescript/module/features/chatbot/model/ChatbotApi.d.ts.map +1 -0
  284. package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts +27 -0
  285. package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -0
  286. package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts +5 -3
  287. package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
  288. package/dist/typescript/module/features/chatbot/model/ThreadItem.d.ts +13 -7
  289. package/dist/typescript/module/features/chatbot/model/ThreadItem.d.ts.map +1 -1
  290. package/dist/typescript/module/features/chatbot/model/constants.d.ts.map +1 -1
  291. package/dist/typescript/module/features/chatbot/model/messagesHelper.d.ts +7 -5
  292. package/dist/typescript/module/features/chatbot/model/messagesHelper.d.ts.map +1 -1
  293. package/dist/typescript/module/features/chatbot/model/t2s.d.ts +16 -6
  294. package/dist/typescript/module/features/chatbot/model/t2s.d.ts.map +1 -1
  295. package/dist/typescript/module/features/chatbot/model/translation.d.ts +7 -8
  296. package/dist/typescript/module/features/chatbot/model/translation.d.ts.map +1 -1
  297. package/dist/typescript/module/features/chatbot/model/translation.helpers.d.ts +2 -1
  298. package/dist/typescript/module/features/chatbot/model/translation.helpers.d.ts.map +1 -1
  299. package/dist/typescript/module/features/chatbot/types/api.types.d.ts +12 -11
  300. package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
  301. package/dist/typescript/module/features/chatbot/types/model.types.d.ts +19 -24
  302. package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
  303. package/dist/typescript/module/features/chatbot/types/t2s.types.d.ts +2 -7
  304. package/dist/typescript/module/features/chatbot/types/t2s.types.d.ts.map +1 -1
  305. package/dist/typescript/module/features/chatbot/types/translation.types.d.ts +2 -1
  306. package/dist/typescript/module/features/chatbot/types/translation.types.d.ts.map +1 -1
  307. package/dist/typescript/module/features/chatbot/types/units.types.d.ts +34 -0
  308. package/dist/typescript/module/features/chatbot/types/units.types.d.ts.map +1 -0
  309. package/dist/typescript/module/index.d.ts +0 -3
  310. package/dist/typescript/module/index.d.ts.map +1 -1
  311. package/dist/typescript/module/lib/effector/createEntityFieldStore.d.ts +2 -0
  312. package/dist/typescript/module/lib/effector/createEntityFieldStore.d.ts.map +1 -1
  313. package/dist/typescript/module/lib/effector/withEvent.d.ts +2 -0
  314. package/dist/typescript/module/lib/effector/withEvent.d.ts.map +1 -0
  315. package/dist/typescript/module/lib/helpers/helpers.d.ts +0 -1
  316. package/dist/typescript/module/lib/helpers/helpers.d.ts.map +1 -1
  317. package/dist/typescript/module/lib/helpers/randomElements.d.ts +2 -0
  318. package/dist/typescript/module/lib/helpers/randomElements.d.ts.map +1 -0
  319. package/dist/typescript/module/lib/types/keys.d.ts +8 -0
  320. package/dist/typescript/module/lib/types/keys.d.ts.map +1 -0
  321. package/dist/typescript/module/shared/icons/HighlighterIcon.d.ts +4 -0
  322. package/dist/typescript/module/shared/icons/HighlighterIcon.d.ts.map +1 -0
  323. package/dist/typescript/module/shared/icons/StopIcon.d.ts +4 -0
  324. package/dist/typescript/module/shared/icons/StopIcon.d.ts.map +1 -0
  325. package/dist/typescript/module/shared/icons/icon.types.d.ts +2 -0
  326. package/dist/typescript/module/shared/icons/icon.types.d.ts.map +1 -1
  327. package/dist/typescript/module/shared/translation/constants.d.ts +21 -0
  328. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  329. package/dist/typescript/module/shared/translation/helpers.d.ts +3 -2
  330. package/dist/typescript/module/shared/translation/helpers.d.ts.map +1 -1
  331. package/dist/typescript/module/shared/translation/hooks.d.ts +2 -2
  332. package/dist/typescript/module/shared/translation/hooks.d.ts.map +1 -1
  333. package/dist/typescript/module/shared/translation/index.d.ts +0 -1
  334. package/dist/typescript/module/shared/translation/index.d.ts.map +1 -1
  335. package/dist/typescript/module/shared/translation/model.d.ts +43 -3
  336. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  337. package/dist/typescript/module/shared/translation/types.d.ts +4 -4
  338. package/dist/typescript/module/shared/translation/types.d.ts.map +1 -1
  339. package/dist/typescript/module/shared/translation/validation.types.d.ts +17 -0
  340. package/dist/typescript/module/shared/translation/validation.types.d.ts.map +1 -0
  341. package/package.json +3 -6
  342. package/src/features/chatbot/components/Alternatives/Alternatives.tsx +2 -4
  343. package/src/features/chatbot/components/ChatMessage/ChatMessage.tsx +5 -5
  344. package/src/features/chatbot/components/ChatMessage/MessageButtonsBlock.tsx +36 -0
  345. package/src/features/chatbot/components/ChatMessage/MessageTextToSpeech.tsx +37 -47
  346. package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +27 -26
  347. package/src/features/chatbot/components/ChatMessage/SentMessage.tsx +9 -9
  348. package/src/features/chatbot/components/ChatMessages/ChatbotMessages.tsx +9 -31
  349. package/src/features/chatbot/components/Chatbot.tsx +5 -11
  350. package/src/features/chatbot/context/ChatBotModelContext.ts +14 -0
  351. package/src/features/chatbot/errorSpotting/ErrorSpottingButton.tsx +53 -0
  352. package/src/features/chatbot/errorSpotting/ErrorSpottingModel.ts +150 -0
  353. package/src/features/chatbot/index.ts +3 -4
  354. package/src/features/chatbot/model/ChatBotModel.ts +141 -133
  355. package/src/features/chatbot/model/{ChatBotMessageHandler.ts → ChatBotThreadManager.ts} +53 -27
  356. package/src/features/chatbot/model/ChatBoxTextManager.ts +18 -0
  357. package/src/features/chatbot/model/{api.ts → ChatbotApi.ts} +18 -2
  358. package/src/features/chatbot/model/ChatsCacheModel.ts +95 -0
  359. package/src/features/chatbot/model/DefaultMessageCreator.ts +17 -16
  360. package/src/features/chatbot/model/ThreadItem.ts +15 -10
  361. package/src/features/chatbot/model/constants.ts +2 -0
  362. package/src/features/chatbot/model/messagesHelper.ts +12 -7
  363. package/src/features/chatbot/model/t2s.ts +28 -13
  364. package/src/features/chatbot/model/translation.helpers.ts +2 -1
  365. package/src/features/chatbot/model/translation.ts +52 -46
  366. package/src/features/chatbot/types/api.types.ts +12 -12
  367. package/src/features/chatbot/types/model.types.ts +31 -32
  368. package/src/features/chatbot/types/t2s.types.ts +10 -15
  369. package/src/features/chatbot/types/translation.types.ts +2 -1
  370. package/src/features/chatbot/types/units.types.ts +37 -0
  371. package/src/index.ts +0 -3
  372. package/src/lib/effector/createEntityFieldStore.ts +9 -1
  373. package/src/lib/effector/withEvent.ts +7 -0
  374. package/src/lib/helpers/helpers.ts +0 -2
  375. package/src/lib/helpers/randomElements.ts +22 -0
  376. package/src/lib/types/keys.ts +18 -0
  377. package/src/shared/icons/HighlighterIcon.tsx +21 -0
  378. package/src/shared/icons/StopIcon.tsx +17 -0
  379. package/src/shared/icons/icon.types.ts +9 -6
  380. package/src/shared/translation/constants.ts +3 -3
  381. package/src/shared/translation/helpers.ts +22 -9
  382. package/src/shared/translation/hooks.ts +12 -16
  383. package/src/shared/translation/index.ts +0 -1
  384. package/{dist/module/lib → src/shared/translation}/localization/en.json +8 -1
  385. package/{dist/commonjs/lib → src/shared/translation}/localization/gb.json +8 -1
  386. package/src/{lib → shared/translation}/localization/sw.json +8 -1
  387. package/src/shared/translation/model.ts +8 -8
  388. package/src/shared/translation/types.ts +11 -8
  389. package/src/shared/translation/validation.types.ts +26 -0
  390. package/dist/commonjs/features/celebrations/components/Celebrations.js +0 -51
  391. package/dist/commonjs/features/celebrations/components/Celebrations.js.map +0 -1
  392. package/dist/commonjs/features/celebrations/components/Particle.js +0 -85
  393. package/dist/commonjs/features/celebrations/components/Particle.js.map +0 -1
  394. package/dist/commonjs/features/celebrations/components/ParticleBatch.js +0 -47
  395. package/dist/commonjs/features/celebrations/components/ParticleBatch.js.map +0 -1
  396. package/dist/commonjs/features/celebrations/components/Spark.js +0 -23
  397. package/dist/commonjs/features/celebrations/components/Spark.js.map +0 -1
  398. package/dist/commonjs/features/celebrations/config.js +0 -224
  399. package/dist/commonjs/features/celebrations/config.js.map +0 -1
  400. package/dist/commonjs/features/celebrations/helpers.js +0 -99
  401. package/dist/commonjs/features/celebrations/helpers.js.map +0 -1
  402. package/dist/commonjs/features/celebrations/index.js +0 -28
  403. package/dist/commonjs/features/celebrations/index.js.map +0 -1
  404. package/dist/commonjs/features/celebrations/types.js +0 -15
  405. package/dist/commonjs/features/celebrations/types.js.map +0 -1
  406. package/dist/commonjs/features/chatbot/model/ChatBotMessageHandler.js.map +0 -1
  407. package/dist/commonjs/features/chatbot/model/api.js.map +0 -1
  408. package/dist/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.js +0 -65
  409. package/dist/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.js.map +0 -1
  410. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js +0 -255
  411. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js.map +0 -1
  412. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +0 -133
  413. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +0 -1
  414. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js +0 -56
  415. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js.map +0 -1
  416. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js +0 -68
  417. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js.map +0 -1
  418. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.js +0 -53
  419. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.js.map +0 -1
  420. package/dist/commonjs/features/endOfAssignment/components/EOAModal.js +0 -47
  421. package/dist/commonjs/features/endOfAssignment/components/EOAModal.js.map +0 -1
  422. package/dist/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.js +0 -76
  423. package/dist/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.js.map +0 -1
  424. package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js +0 -62
  425. package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +0 -1
  426. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +0 -109
  427. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +0 -1
  428. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js +0 -83
  429. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js.map +0 -1
  430. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/blurred-card.png +0 -0
  431. package/dist/commonjs/features/endOfAssignment/components/Modal/Modal.js +0 -96
  432. package/dist/commonjs/features/endOfAssignment/components/Modal/Modal.js.map +0 -1
  433. package/dist/commonjs/features/endOfAssignment/components/Modal/ModalBackground.js +0 -44
  434. package/dist/commonjs/features/endOfAssignment/components/Modal/ModalBackground.js.map +0 -1
  435. package/dist/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js +0 -233
  436. package/dist/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js.map +0 -1
  437. package/dist/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.js +0 -63
  438. package/dist/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.js.map +0 -1
  439. package/dist/commonjs/features/endOfAssignment/components/Modal/model.js +0 -34
  440. package/dist/commonjs/features/endOfAssignment/components/Modal/model.js.map +0 -1
  441. package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js +0 -108
  442. package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +0 -1
  443. package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js +0 -107
  444. package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js.map +0 -1
  445. package/dist/commonjs/features/endOfAssignment/constants.js +0 -55
  446. package/dist/commonjs/features/endOfAssignment/constants.js.map +0 -1
  447. package/dist/commonjs/features/endOfAssignment/helpers.js +0 -64
  448. package/dist/commonjs/features/endOfAssignment/helpers.js.map +0 -1
  449. package/dist/commonjs/features/endOfAssignment/hooks/useSparkAnimation.js +0 -51
  450. package/dist/commonjs/features/endOfAssignment/hooks/useSparkAnimation.js.map +0 -1
  451. package/dist/commonjs/features/endOfAssignment/index.js +0 -40
  452. package/dist/commonjs/features/endOfAssignment/index.js.map +0 -1
  453. package/dist/commonjs/features/endOfAssignment/model/model.js +0 -53
  454. package/dist/commonjs/features/endOfAssignment/model/model.js.map +0 -1
  455. package/dist/commonjs/features/endOfAssignment/types.js +0 -33
  456. package/dist/commonjs/features/endOfAssignment/types.js.map +0 -1
  457. package/dist/commonjs/features/endOfAssignment/ui/EOABadge.js +0 -43
  458. package/dist/commonjs/features/endOfAssignment/ui/EOABadge.js.map +0 -1
  459. package/dist/commonjs/features/endOfAssignment/ui/PracticeButton.js +0 -30
  460. package/dist/commonjs/features/endOfAssignment/ui/PracticeButton.js.map +0 -1
  461. package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js +0 -64
  462. package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js.map +0 -1
  463. package/dist/commonjs/features/endOfAssignment/ui/SparkIcon.js +0 -29
  464. package/dist/commonjs/features/endOfAssignment/ui/SparkIcon.js.map +0 -1
  465. package/dist/commonjs/features/endOfAssignment/ui/ThumbUpIcon.js +0 -32
  466. package/dist/commonjs/features/endOfAssignment/ui/ThumbUpIcon.js.map +0 -1
  467. package/dist/commonjs/lib/constants.js +0 -11
  468. package/dist/commonjs/lib/constants.js.map +0 -1
  469. package/dist/commonjs/shared/hooks/useKeyDownListener.js +0 -27
  470. package/dist/commonjs/shared/hooks/useKeyDownListener.js.map +0 -1
  471. package/dist/commonjs/shared/hooks/useKeyboard.js +0 -23
  472. package/dist/commonjs/shared/hooks/useKeyboard.js.map +0 -1
  473. package/dist/commonjs/shared/icons/Halloween.js +0 -54
  474. package/dist/commonjs/shared/icons/Halloween.js.map +0 -1
  475. package/dist/commonjs/shared/icons/Pi.js +0 -30
  476. package/dist/commonjs/shared/icons/Pi.js.map +0 -1
  477. package/dist/commonjs/shared/icons/Star.js +0 -30
  478. package/dist/commonjs/shared/icons/Star.js.map +0 -1
  479. package/dist/commonjs/shared/icons/Valentine.js.map +0 -1
  480. package/dist/commonjs/shared/icons/Winter.js +0 -32
  481. package/dist/commonjs/shared/icons/Winter.js.map +0 -1
  482. package/dist/module/features/celebrations/components/Celebrations.js +0 -45
  483. package/dist/module/features/celebrations/components/Celebrations.js.map +0 -1
  484. package/dist/module/features/celebrations/components/Particle.js +0 -77
  485. package/dist/module/features/celebrations/components/Particle.js.map +0 -1
  486. package/dist/module/features/celebrations/components/ParticleBatch.js +0 -40
  487. package/dist/module/features/celebrations/components/ParticleBatch.js.map +0 -1
  488. package/dist/module/features/celebrations/components/Spark.js +0 -17
  489. package/dist/module/features/celebrations/components/Spark.js.map +0 -1
  490. package/dist/module/features/celebrations/config.js +0 -219
  491. package/dist/module/features/celebrations/config.js.map +0 -1
  492. package/dist/module/features/celebrations/helpers.js +0 -92
  493. package/dist/module/features/celebrations/helpers.js.map +0 -1
  494. package/dist/module/features/celebrations/index.js +0 -5
  495. package/dist/module/features/celebrations/index.js.map +0 -1
  496. package/dist/module/features/celebrations/types.js +0 -11
  497. package/dist/module/features/celebrations/types.js.map +0 -1
  498. package/dist/module/features/chatbot/model/ChatBotMessageHandler.js.map +0 -1
  499. package/dist/module/features/chatbot/model/api.js.map +0 -1
  500. package/dist/module/features/endOfAssignment/components/CheatDetected/CheatDetected.js +0 -59
  501. package/dist/module/features/endOfAssignment/components/CheatDetected/CheatDetected.js.map +0 -1
  502. package/dist/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js +0 -249
  503. package/dist/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js.map +0 -1
  504. package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +0 -126
  505. package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +0 -1
  506. package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js +0 -50
  507. package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js.map +0 -1
  508. package/dist/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js +0 -62
  509. package/dist/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js.map +0 -1
  510. package/dist/module/features/endOfAssignment/components/CorrectAnswer/Spark.js +0 -47
  511. package/dist/module/features/endOfAssignment/components/CorrectAnswer/Spark.js.map +0 -1
  512. package/dist/module/features/endOfAssignment/components/EOAModal.js +0 -41
  513. package/dist/module/features/endOfAssignment/components/EOAModal.js.map +0 -1
  514. package/dist/module/features/endOfAssignment/components/ExamLeave/ExamLeave.js +0 -70
  515. package/dist/module/features/endOfAssignment/components/ExamLeave/ExamLeave.js.map +0 -1
  516. package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js +0 -56
  517. package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +0 -1
  518. package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +0 -103
  519. package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +0 -1
  520. package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js +0 -77
  521. package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js.map +0 -1
  522. package/dist/module/features/endOfAssignment/components/ExamSubmit/blurred-card.png +0 -0
  523. package/dist/module/features/endOfAssignment/components/Modal/Modal.js +0 -89
  524. package/dist/module/features/endOfAssignment/components/Modal/Modal.js.map +0 -1
  525. package/dist/module/features/endOfAssignment/components/Modal/ModalBackground.js +0 -38
  526. package/dist/module/features/endOfAssignment/components/Modal/ModalBackground.js.map +0 -1
  527. package/dist/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js +0 -226
  528. package/dist/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js.map +0 -1
  529. package/dist/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.js +0 -56
  530. package/dist/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.js.map +0 -1
  531. package/dist/module/features/endOfAssignment/components/Modal/model.js +0 -29
  532. package/dist/module/features/endOfAssignment/components/Modal/model.js.map +0 -1
  533. package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js +0 -102
  534. package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +0 -1
  535. package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js +0 -100
  536. package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js.map +0 -1
  537. package/dist/module/features/endOfAssignment/constants.js +0 -51
  538. package/dist/module/features/endOfAssignment/constants.js.map +0 -1
  539. package/dist/module/features/endOfAssignment/helpers.js +0 -58
  540. package/dist/module/features/endOfAssignment/helpers.js.map +0 -1
  541. package/dist/module/features/endOfAssignment/hooks/useSparkAnimation.js +0 -46
  542. package/dist/module/features/endOfAssignment/hooks/useSparkAnimation.js.map +0 -1
  543. package/dist/module/features/endOfAssignment/index.js +0 -6
  544. package/dist/module/features/endOfAssignment/index.js.map +0 -1
  545. package/dist/module/features/endOfAssignment/model/model.js +0 -48
  546. package/dist/module/features/endOfAssignment/model/model.js.map +0 -1
  547. package/dist/module/features/endOfAssignment/types.js +0 -29
  548. package/dist/module/features/endOfAssignment/types.js.map +0 -1
  549. package/dist/module/features/endOfAssignment/ui/EOABadge.js +0 -37
  550. package/dist/module/features/endOfAssignment/ui/EOABadge.js.map +0 -1
  551. package/dist/module/features/endOfAssignment/ui/PracticeButton.js +0 -24
  552. package/dist/module/features/endOfAssignment/ui/PracticeButton.js.map +0 -1
  553. package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js +0 -57
  554. package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js.map +0 -1
  555. package/dist/module/features/endOfAssignment/ui/SparkIcon.js +0 -21
  556. package/dist/module/features/endOfAssignment/ui/SparkIcon.js.map +0 -1
  557. package/dist/module/features/endOfAssignment/ui/ThumbUpIcon.js +0 -24
  558. package/dist/module/features/endOfAssignment/ui/ThumbUpIcon.js.map +0 -1
  559. package/dist/module/lib/constants.js +0 -7
  560. package/dist/module/lib/constants.js.map +0 -1
  561. package/dist/module/shared/hooks/useKeyDownListener.js +0 -22
  562. package/dist/module/shared/hooks/useKeyDownListener.js.map +0 -1
  563. package/dist/module/shared/hooks/useKeyboard.js +0 -20
  564. package/dist/module/shared/hooks/useKeyboard.js.map +0 -1
  565. package/dist/module/shared/icons/Halloween.js +0 -47
  566. package/dist/module/shared/icons/Halloween.js.map +0 -1
  567. package/dist/module/shared/icons/Pi.js +0 -23
  568. package/dist/module/shared/icons/Pi.js.map +0 -1
  569. package/dist/module/shared/icons/Star.js +0 -23
  570. package/dist/module/shared/icons/Star.js.map +0 -1
  571. package/dist/module/shared/icons/Valentine.js +0 -23
  572. package/dist/module/shared/icons/Valentine.js.map +0 -1
  573. package/dist/module/shared/icons/Winter.js +0 -25
  574. package/dist/module/shared/icons/Winter.js.map +0 -1
  575. package/dist/typescript/commonjs/features/celebrations/components/Celebrations.d.ts +0 -10
  576. package/dist/typescript/commonjs/features/celebrations/components/Celebrations.d.ts.map +0 -1
  577. package/dist/typescript/commonjs/features/celebrations/components/Particle.d.ts +0 -20
  578. package/dist/typescript/commonjs/features/celebrations/components/Particle.d.ts.map +0 -1
  579. package/dist/typescript/commonjs/features/celebrations/components/ParticleBatch.d.ts +0 -26
  580. package/dist/typescript/commonjs/features/celebrations/components/ParticleBatch.d.ts.map +0 -1
  581. package/dist/typescript/commonjs/features/celebrations/components/Spark.d.ts +0 -4
  582. package/dist/typescript/commonjs/features/celebrations/components/Spark.d.ts.map +0 -1
  583. package/dist/typescript/commonjs/features/celebrations/config.d.ts +0 -192
  584. package/dist/typescript/commonjs/features/celebrations/config.d.ts.map +0 -1
  585. package/dist/typescript/commonjs/features/celebrations/helpers.d.ts +0 -6
  586. package/dist/typescript/commonjs/features/celebrations/helpers.d.ts.map +0 -1
  587. package/dist/typescript/commonjs/features/celebrations/index.d.ts +0 -3
  588. package/dist/typescript/commonjs/features/celebrations/index.d.ts.map +0 -1
  589. package/dist/typescript/commonjs/features/celebrations/types.d.ts +0 -11
  590. package/dist/typescript/commonjs/features/celebrations/types.d.ts.map +0 -1
  591. package/dist/typescript/commonjs/features/chatbot/model/ChatBotMessageHandler.d.ts +0 -31
  592. package/dist/typescript/commonjs/features/chatbot/model/ChatBotMessageHandler.d.ts.map +0 -1
  593. package/dist/typescript/commonjs/features/chatbot/model/api.d.ts.map +0 -1
  594. package/dist/typescript/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts +0 -4
  595. package/dist/typescript/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts.map +0 -1
  596. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts +0 -15
  597. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts.map +0 -1
  598. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts +0 -4
  599. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +0 -1
  600. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts +0 -8
  601. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts.map +0 -1
  602. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts +0 -8
  603. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts.map +0 -1
  604. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts +0 -12
  605. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts.map +0 -1
  606. package/dist/typescript/commonjs/features/endOfAssignment/components/EOAModal.d.ts +0 -11
  607. package/dist/typescript/commonjs/features/endOfAssignment/components/EOAModal.d.ts.map +0 -1
  608. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts +0 -4
  609. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts.map +0 -1
  610. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts +0 -4
  611. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +0 -1
  612. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts +0 -4
  613. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +0 -1
  614. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts +0 -8
  615. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts.map +0 -1
  616. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/Modal.d.ts +0 -20
  617. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/Modal.d.ts.map +0 -1
  618. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/ModalBackground.d.ts +0 -3
  619. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/ModalBackground.d.ts.map +0 -1
  620. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts +0 -4
  621. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts.map +0 -1
  622. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts +0 -4
  623. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts.map +0 -1
  624. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/model.d.ts +0 -14
  625. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/model.d.ts.map +0 -1
  626. package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts +0 -4
  627. package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +0 -1
  628. package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts +0 -8
  629. package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts.map +0 -1
  630. package/dist/typescript/commonjs/features/endOfAssignment/constants.d.ts +0 -41
  631. package/dist/typescript/commonjs/features/endOfAssignment/constants.d.ts.map +0 -1
  632. package/dist/typescript/commonjs/features/endOfAssignment/helpers.d.ts +0 -9
  633. package/dist/typescript/commonjs/features/endOfAssignment/helpers.d.ts.map +0 -1
  634. package/dist/typescript/commonjs/features/endOfAssignment/hooks/useSparkAnimation.d.ts +0 -27
  635. package/dist/typescript/commonjs/features/endOfAssignment/hooks/useSparkAnimation.d.ts.map +0 -1
  636. package/dist/typescript/commonjs/features/endOfAssignment/index.d.ts +0 -4
  637. package/dist/typescript/commonjs/features/endOfAssignment/index.d.ts.map +0 -1
  638. package/dist/typescript/commonjs/features/endOfAssignment/model/model.d.ts +0 -14
  639. package/dist/typescript/commonjs/features/endOfAssignment/model/model.d.ts.map +0 -1
  640. package/dist/typescript/commonjs/features/endOfAssignment/types.d.ts +0 -60
  641. package/dist/typescript/commonjs/features/endOfAssignment/types.d.ts.map +0 -1
  642. package/dist/typescript/commonjs/features/endOfAssignment/ui/EOABadge.d.ts +0 -11
  643. package/dist/typescript/commonjs/features/endOfAssignment/ui/EOABadge.d.ts.map +0 -1
  644. package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButton.d.ts +0 -10
  645. package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButton.d.ts.map +0 -1
  646. package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts +0 -14
  647. package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +0 -1
  648. package/dist/typescript/commonjs/features/endOfAssignment/ui/SparkIcon.d.ts +0 -4
  649. package/dist/typescript/commonjs/features/endOfAssignment/ui/SparkIcon.d.ts.map +0 -1
  650. package/dist/typescript/commonjs/features/endOfAssignment/ui/ThumbUpIcon.d.ts +0 -4
  651. package/dist/typescript/commonjs/features/endOfAssignment/ui/ThumbUpIcon.d.ts.map +0 -1
  652. package/dist/typescript/commonjs/lib/constants.d.ts +0 -4
  653. package/dist/typescript/commonjs/lib/constants.d.ts.map +0 -1
  654. package/dist/typescript/commonjs/shared/hooks/useKeyDownListener.d.ts +0 -3
  655. package/dist/typescript/commonjs/shared/hooks/useKeyDownListener.d.ts.map +0 -1
  656. package/dist/typescript/commonjs/shared/hooks/useKeyboard.d.ts +0 -11
  657. package/dist/typescript/commonjs/shared/hooks/useKeyboard.d.ts.map +0 -1
  658. package/dist/typescript/commonjs/shared/icons/Halloween.d.ts +0 -5
  659. package/dist/typescript/commonjs/shared/icons/Halloween.d.ts.map +0 -1
  660. package/dist/typescript/commonjs/shared/icons/Pi.d.ts +0 -5
  661. package/dist/typescript/commonjs/shared/icons/Pi.d.ts.map +0 -1
  662. package/dist/typescript/commonjs/shared/icons/Star.d.ts +0 -5
  663. package/dist/typescript/commonjs/shared/icons/Star.d.ts.map +0 -1
  664. package/dist/typescript/commonjs/shared/icons/Valentine.d.ts +0 -5
  665. package/dist/typescript/commonjs/shared/icons/Valentine.d.ts.map +0 -1
  666. package/dist/typescript/commonjs/shared/icons/Winter.d.ts +0 -5
  667. package/dist/typescript/commonjs/shared/icons/Winter.d.ts.map +0 -1
  668. package/dist/typescript/module/features/celebrations/components/Celebrations.d.ts +0 -10
  669. package/dist/typescript/module/features/celebrations/components/Celebrations.d.ts.map +0 -1
  670. package/dist/typescript/module/features/celebrations/components/Particle.d.ts +0 -20
  671. package/dist/typescript/module/features/celebrations/components/Particle.d.ts.map +0 -1
  672. package/dist/typescript/module/features/celebrations/components/ParticleBatch.d.ts +0 -26
  673. package/dist/typescript/module/features/celebrations/components/ParticleBatch.d.ts.map +0 -1
  674. package/dist/typescript/module/features/celebrations/components/Spark.d.ts +0 -4
  675. package/dist/typescript/module/features/celebrations/components/Spark.d.ts.map +0 -1
  676. package/dist/typescript/module/features/celebrations/config.d.ts +0 -192
  677. package/dist/typescript/module/features/celebrations/config.d.ts.map +0 -1
  678. package/dist/typescript/module/features/celebrations/helpers.d.ts +0 -6
  679. package/dist/typescript/module/features/celebrations/helpers.d.ts.map +0 -1
  680. package/dist/typescript/module/features/celebrations/index.d.ts +0 -3
  681. package/dist/typescript/module/features/celebrations/index.d.ts.map +0 -1
  682. package/dist/typescript/module/features/celebrations/types.d.ts +0 -11
  683. package/dist/typescript/module/features/celebrations/types.d.ts.map +0 -1
  684. package/dist/typescript/module/features/chatbot/model/ChatBotMessageHandler.d.ts +0 -31
  685. package/dist/typescript/module/features/chatbot/model/ChatBotMessageHandler.d.ts.map +0 -1
  686. package/dist/typescript/module/features/chatbot/model/api.d.ts.map +0 -1
  687. package/dist/typescript/module/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts +0 -4
  688. package/dist/typescript/module/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts.map +0 -1
  689. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts +0 -15
  690. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts.map +0 -1
  691. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts +0 -4
  692. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +0 -1
  693. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts +0 -8
  694. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts.map +0 -1
  695. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts +0 -8
  696. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts.map +0 -1
  697. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts +0 -12
  698. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts.map +0 -1
  699. package/dist/typescript/module/features/endOfAssignment/components/EOAModal.d.ts +0 -11
  700. package/dist/typescript/module/features/endOfAssignment/components/EOAModal.d.ts.map +0 -1
  701. package/dist/typescript/module/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts +0 -4
  702. package/dist/typescript/module/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts.map +0 -1
  703. package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts +0 -4
  704. package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +0 -1
  705. package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts +0 -4
  706. package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +0 -1
  707. package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts +0 -8
  708. package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts.map +0 -1
  709. package/dist/typescript/module/features/endOfAssignment/components/Modal/Modal.d.ts +0 -20
  710. package/dist/typescript/module/features/endOfAssignment/components/Modal/Modal.d.ts.map +0 -1
  711. package/dist/typescript/module/features/endOfAssignment/components/Modal/ModalBackground.d.ts +0 -3
  712. package/dist/typescript/module/features/endOfAssignment/components/Modal/ModalBackground.d.ts.map +0 -1
  713. package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts +0 -4
  714. package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts.map +0 -1
  715. package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts +0 -4
  716. package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts.map +0 -1
  717. package/dist/typescript/module/features/endOfAssignment/components/Modal/model.d.ts +0 -14
  718. package/dist/typescript/module/features/endOfAssignment/components/Modal/model.d.ts.map +0 -1
  719. package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts +0 -4
  720. package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +0 -1
  721. package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts +0 -8
  722. package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts.map +0 -1
  723. package/dist/typescript/module/features/endOfAssignment/constants.d.ts +0 -41
  724. package/dist/typescript/module/features/endOfAssignment/constants.d.ts.map +0 -1
  725. package/dist/typescript/module/features/endOfAssignment/helpers.d.ts +0 -9
  726. package/dist/typescript/module/features/endOfAssignment/helpers.d.ts.map +0 -1
  727. package/dist/typescript/module/features/endOfAssignment/hooks/useSparkAnimation.d.ts +0 -27
  728. package/dist/typescript/module/features/endOfAssignment/hooks/useSparkAnimation.d.ts.map +0 -1
  729. package/dist/typescript/module/features/endOfAssignment/index.d.ts +0 -4
  730. package/dist/typescript/module/features/endOfAssignment/index.d.ts.map +0 -1
  731. package/dist/typescript/module/features/endOfAssignment/model/model.d.ts +0 -14
  732. package/dist/typescript/module/features/endOfAssignment/model/model.d.ts.map +0 -1
  733. package/dist/typescript/module/features/endOfAssignment/types.d.ts +0 -60
  734. package/dist/typescript/module/features/endOfAssignment/types.d.ts.map +0 -1
  735. package/dist/typescript/module/features/endOfAssignment/ui/EOABadge.d.ts +0 -11
  736. package/dist/typescript/module/features/endOfAssignment/ui/EOABadge.d.ts.map +0 -1
  737. package/dist/typescript/module/features/endOfAssignment/ui/PracticeButton.d.ts +0 -10
  738. package/dist/typescript/module/features/endOfAssignment/ui/PracticeButton.d.ts.map +0 -1
  739. package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts +0 -14
  740. package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +0 -1
  741. package/dist/typescript/module/features/endOfAssignment/ui/SparkIcon.d.ts +0 -4
  742. package/dist/typescript/module/features/endOfAssignment/ui/SparkIcon.d.ts.map +0 -1
  743. package/dist/typescript/module/features/endOfAssignment/ui/ThumbUpIcon.d.ts +0 -4
  744. package/dist/typescript/module/features/endOfAssignment/ui/ThumbUpIcon.d.ts.map +0 -1
  745. package/dist/typescript/module/lib/constants.d.ts +0 -4
  746. package/dist/typescript/module/lib/constants.d.ts.map +0 -1
  747. package/dist/typescript/module/shared/hooks/useKeyDownListener.d.ts +0 -3
  748. package/dist/typescript/module/shared/hooks/useKeyDownListener.d.ts.map +0 -1
  749. package/dist/typescript/module/shared/hooks/useKeyboard.d.ts +0 -11
  750. package/dist/typescript/module/shared/hooks/useKeyboard.d.ts.map +0 -1
  751. package/dist/typescript/module/shared/icons/Halloween.d.ts +0 -5
  752. package/dist/typescript/module/shared/icons/Halloween.d.ts.map +0 -1
  753. package/dist/typescript/module/shared/icons/Pi.d.ts +0 -5
  754. package/dist/typescript/module/shared/icons/Pi.d.ts.map +0 -1
  755. package/dist/typescript/module/shared/icons/Star.d.ts +0 -5
  756. package/dist/typescript/module/shared/icons/Star.d.ts.map +0 -1
  757. package/dist/typescript/module/shared/icons/Valentine.d.ts +0 -5
  758. package/dist/typescript/module/shared/icons/Valentine.d.ts.map +0 -1
  759. package/dist/typescript/module/shared/icons/Winter.d.ts +0 -5
  760. package/dist/typescript/module/shared/icons/Winter.d.ts.map +0 -1
  761. package/src/features/celebrations/components/Celebrations.tsx +0 -62
  762. package/src/features/celebrations/components/Particle.tsx +0 -101
  763. package/src/features/celebrations/components/ParticleBatch.tsx +0 -57
  764. package/src/features/celebrations/components/Spark.tsx +0 -14
  765. package/src/features/celebrations/config.ts +0 -224
  766. package/src/features/celebrations/helpers.ts +0 -103
  767. package/src/features/celebrations/index.ts +0 -2
  768. package/src/features/celebrations/types.ts +0 -11
  769. package/src/features/endOfAssignment/components/CheatDetected/CheatDetected.tsx +0 -65
  770. package/src/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.tsx +0 -298
  771. package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx +0 -141
  772. package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.tsx +0 -39
  773. package/src/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.tsx +0 -40
  774. package/src/features/endOfAssignment/components/CorrectAnswer/Spark.tsx +0 -45
  775. package/src/features/endOfAssignment/components/EOAModal.tsx +0 -64
  776. package/src/features/endOfAssignment/components/ExamLeave/ExamLeave.tsx +0 -77
  777. package/src/features/endOfAssignment/components/ExamPaused/ExamPaused.tsx +0 -62
  778. package/src/features/endOfAssignment/components/ExamSubmit/ExamSubmit.tsx +0 -110
  779. package/src/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.tsx +0 -69
  780. package/src/features/endOfAssignment/components/ExamSubmit/blurred-card.png +0 -0
  781. package/src/features/endOfAssignment/components/Modal/Modal.tsx +0 -121
  782. package/src/features/endOfAssignment/components/Modal/ModalBackground.tsx +0 -33
  783. package/src/features/endOfAssignment/components/Modal/assets/SunrisingIcon.tsx +0 -196
  784. package/src/features/endOfAssignment/components/Modal/assets/TrophyIcon.tsx +0 -62
  785. package/src/features/endOfAssignment/components/Modal/model.ts +0 -34
  786. package/src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx +0 -103
  787. package/src/features/endOfAssignment/components/NoAnswer/NoAnswerContent.tsx +0 -107
  788. package/src/features/endOfAssignment/constants.ts +0 -53
  789. package/src/features/endOfAssignment/helpers.ts +0 -28
  790. package/src/features/endOfAssignment/hooks/useSparkAnimation.tsx +0 -78
  791. package/src/features/endOfAssignment/index.ts +0 -3
  792. package/src/features/endOfAssignment/model/model.ts +0 -57
  793. package/src/features/endOfAssignment/types.ts +0 -65
  794. package/src/features/endOfAssignment/ui/EOABadge.tsx +0 -47
  795. package/src/features/endOfAssignment/ui/PracticeButton.tsx +0 -27
  796. package/src/features/endOfAssignment/ui/PracticeButtonGroup.tsx +0 -73
  797. package/src/features/endOfAssignment/ui/SparkIcon.tsx +0 -15
  798. package/src/features/endOfAssignment/ui/ThumbUpIcon.tsx +0 -17
  799. package/src/lib/constants.ts +0 -3
  800. package/src/shared/hooks/useKeyDownListener.ts +0 -27
  801. package/src/shared/hooks/useKeyboard.ts +0 -18
  802. package/src/shared/icons/Halloween.tsx +0 -33
  803. package/src/shared/icons/Pi.tsx +0 -16
  804. package/src/shared/icons/Star.tsx +0 -16
  805. package/src/shared/icons/Valentine.tsx +0 -16
  806. package/src/shared/icons/Winter.tsx +0 -19
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
 
3
3
  import { ThreadItem } from "./ThreadItem.js";
4
- import { createEffect } from 'effector/effector.umd';
5
4
  import { CHAT_BOT_MODEL_DEFAULTS } from "./constants.js";
6
- export class ChatMessageHandler {
5
+ export class ChatBotThreadManager {
6
+ api = null;
7
+ drawBoardAdapter = null;
7
8
  threads = new Map();
8
9
  currentKey = '';
9
10
  currentBinding = null;
@@ -13,8 +14,8 @@ export class ChatMessageHandler {
13
14
  messagesLimit = CHAT_BOT_MODEL_DEFAULTS.THREAD_MESSAGES_LIMIT,
14
15
  messages
15
16
  }) {
16
- this.api = api;
17
- this.drawBoardAdapter = drawBoardAdapter;
17
+ if (api) this.api = api;
18
+ this.drawBoardAdapter = drawBoardAdapter ?? null;
18
19
  this.messagesLimit = messagesLimit;
19
20
  this.defaultMessages = messages;
20
21
  }
@@ -29,24 +30,36 @@ export class ChatMessageHandler {
29
30
  const key = this.currentKey;
30
31
  let threadItem = this.threads.get(key);
31
32
  if (threadItem) return threadItem;
33
+ if (!this.drawBoardAdapter) {
34
+ threadItem = new ThreadItem();
35
+ this.threads.set(key, threadItem);
36
+ return threadItem;
37
+ }
32
38
  try {
33
- const strokes = await this.drawBoardAdapter.getVisibleStrokes();
34
- threadItem = new ThreadItem({
35
- strokes
36
- });
39
+ const result = await this.drawBoardAdapter.getVisibleStrokes();
40
+ threadItem = new ThreadItem(result ? {
41
+ strokes: result.strokes,
42
+ key: result.validationKey
43
+ } : null);
37
44
  } catch {
38
45
  threadItem = new ThreadItem();
39
46
  }
40
47
  this.threads.set(key, threadItem);
41
48
  return threadItem;
42
49
  }
43
- postMessageFx = async ({
50
+ setDrawBoardAdapter(adapter) {
51
+ this.drawBoardAdapter = adapter;
52
+ }
53
+ postMessage = async ({
44
54
  problemAnswer,
45
55
  problem,
46
56
  answer,
47
57
  language,
48
58
  imageAltText
49
59
  }) => {
60
+ if (!this.api) {
61
+ throw new Error('API is not set in ThreadManagersApi, pls provide API before sending requests');
62
+ }
50
63
  const threadItem = await this.getThreadItem();
51
64
  const result = await this.api.getHint({
52
65
  ...threadItem.getNextHintProps(),
@@ -56,22 +69,31 @@ export class ChatMessageHandler {
56
69
  language,
57
70
  imageAltText
58
71
  });
59
- threadItem.hints.push(result.message);
60
- const nextOptions = threadItem.hints.length < this.messagesLimit ? [this.defaultMessages.anotherHintOption] : [];
72
+ threadItem.history.push(result.message);
73
+ const nextOptions = threadItem.history.length < this.messagesLimit ? [this.defaultMessages.anotherHintOption] : [];
61
74
  return {
62
75
  message: result.message,
63
76
  options: nextOptions,
64
- threadId: '',
65
- endMessage: !nextOptions.length
77
+ endMessage: !nextOptions.length,
78
+ threadId: threadItem.id
66
79
  };
67
80
  };
68
- resetThread = createEffect(({
69
- key
70
- }) => {
71
- this.threads.delete(key);
72
- });
73
- resetAll() {
81
+ get(key) {
82
+ return this.threads.get(key);
83
+ }
84
+ reset(key) {
85
+ if (typeof key === 'string') {
86
+ this.threads.delete(key);
87
+ return;
88
+ }
74
89
  this.threads.clear();
75
90
  }
91
+ setMessagesLimit(limit) {
92
+ this.messagesLimit = limit;
93
+ }
94
+ setApi(api) {
95
+ this.api = api;
96
+ return this;
97
+ }
76
98
  }
77
- //# sourceMappingURL=ChatBotMessageHandler.js.map
99
+ //# sourceMappingURL=ChatBotThreadManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ThreadItem","CHAT_BOT_MODEL_DEFAULTS","ChatBotThreadManager","api","drawBoardAdapter","threads","Map","currentKey","currentBinding","constructor","messagesLimit","THREAD_MESSAGES_LIMIT","messages","defaultMessages","bindKeyStore","$store","watch","value","getThreadItem","key","threadItem","get","set","result","getVisibleStrokes","strokes","validationKey","setDrawBoardAdapter","adapter","postMessage","problemAnswer","problem","answer","language","imageAltText","Error","getHint","getNextHintProps","correctAnswer","problemDescription","userAnswer","history","push","message","nextOptions","length","anotherHintOption","options","endMessage","threadId","id","reset","delete","clear","setMessagesLimit","limit","setApi"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/ChatBotThreadManager.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,iBAAc;AASzC,SAASC,uBAAuB,QAAQ,gBAAa;AAarD,OAAO,MAAMC,oBAAoB,CAAC;EACxBC,GAAG,GAA4B,IAAI;EACnCC,gBAAgB,GAAiC,IAAI;EAC5CC,OAAO,GAAG,IAAIC,GAAG,CAAqB,CAAC;EAGhDC,UAAU,GAAG,EAAE;EACfC,cAAc,GAAwB,IAAI;EAI3CC,WAAWA,CAAC;IACjBL,gBAAgB;IAChBD,GAAG;IACHO,aAAa,GAAGT,uBAAuB,CAACU,qBAAqB;IAC7DC;EACyB,CAAC,EAAE;IAC5B,IAAIT,GAAG,EAAE,IAAI,CAACA,GAAG,GAAGA,GAAG;IACvB,IAAI,CAACC,gBAAgB,GAAGA,gBAAgB,IAAI,IAAI;IAChD,IAAI,CAACM,aAAa,GAAGA,aAAa;IAClC,IAAI,CAACG,eAAe,GAAGD,QAAQ;EACjC;EAEOE,YAAYA,CAACC,MAAqB,EAAE;IACzC,IAAI,CAACP,cAAc,GAAG,CAAC;IACvB,IAAI,CAACA,cAAc,GAAGO,MAAM,CAACC,KAAK,CAAEC,KAAK,IAAK;MAC5C,IAAI,CAACV,UAAU,GAAGU,KAAK;IACzB,CAAC,CAAC;IACF,OAAO,IAAI;EACb;EAEA,MAAcC,aAAaA,CAAA,EAAG;IAC5B,MAAMC,GAAG,GAAG,IAAI,CAACZ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EAAER,OAAO;MAC3BS,UAAU,EAAER,MAAM;MAClBC,QAAQ;MACRC;IACF,CAAC,CAAC;IAEFd,UAAU,CAACqB,OAAO,CAACC,IAAI,CAACnB,MAAM,CAACoB,OAAO,CAAC;IACvC,MAAMC,WAAW,GACfxB,UAAU,CAACqB,OAAO,CAACI,MAAM,GAAG,IAAI,CAACnC,aAAa,GAAG,CAAC,IAAI,CAACG,eAAe,CAACiC,iBAAiB,CAAC,GAAG,EAAE;IAEhG,OAAO;MACLH,OAAO,EAAEpB,MAAM,CAACoB,OAAO;MACvBI,OAAO,EAAEH,WAAW;MACpBI,UAAU,EAAE,CAACJ,WAAW,CAACC,MAAM;MAC/BI,QAAQ,EAAE7B,UAAU,CAAC8B;IACvB,CAAC;EACH,CAAC;EAEM7B,GAAGA,CAACF,GAAW,EAAE;IACtB,OAAO,IAAI,CAACd,OAAO,CAACgB,GAAG,CAACF,GAAG,CAAC;EAC9B;EAEOgC,KAAKA,CAAChC,GAAY,EAAE;IACzB,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE;MAC3B,IAAI,CAACd,OAAO,CAAC+C,MAAM,CAACjC,GAAG,CAAC;MACxB;IACF;IACA,IAAI,CAACd,OAAO,CAACgD,KAAK,CAAC,CAAC;EACtB;EAEOC,gBAAgBA,CAACC,KAAa,EAAE;IACrC,IAAI,CAAC7C,aAAa,GAAG6C,KAAK;EAC5B;EAEOC,MAAMA,CAACrD,GAAqB,EAAE;IACnC,IAAI,CAACA,GAAG,GAAGA,GAAG;IACd,OAAO,IAAI;EACb;AACF","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ import { DefaultMessagesCreator } from "./DefaultMessageCreator.js";
4
+ import { getText } from "../../../shared/translation/helpers.js";
5
+ import { $localization } from "../../../shared/translation/index.js";
6
+ export class ChatBotTextManager {
7
+ messagesCreator = new DefaultMessagesCreator({
8
+ textGetter: getText
9
+ }).bindToLanguageChanged($localization.updates);
10
+ messages = {
11
+ error: this.messagesCreator.createMessage('chat.errorMessage'),
12
+ start: this.messagesCreator.createMessage('chat.howCanIHelp'),
13
+ endMessage: this.messagesCreator.createMessage('chat.answerAgain'),
14
+ anotherHintOption: this.messagesCreator.createOption('chat.anotherHint')
15
+ };
16
+ }
17
+ //# sourceMappingURL=ChatBoxTextManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DefaultMessagesCreator","getText","$localization","ChatBotTextManager","messagesCreator","textGetter","bindToLanguageChanged","updates","messages","error","createMessage","start","endMessage","anotherHintOption","createOption"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/ChatBoxTextManager.ts"],"mappings":";;AAAA,SAASA,sBAAsB,QAAQ,4BAAyB;AAEhE,SAASC,OAAO,QAAQ,wCAAqC;AAE7D,SAASC,aAAa,QAAQ,sCAA6B;AAE3D,OAAO,MAAMC,kBAAkB,CAAC;EACbC,eAAe,GAAG,IAAIJ,sBAAsB,CAAkB;IAC7EK,UAAU,EAAEJ;EACd,CAAC,CAAC,CAACK,qBAAqB,CAACJ,aAAa,CAACK,OAAO,CAAC;EAE/BC,QAAQ,GAAoB;IAC1CC,KAAK,EAAE,IAAI,CAACL,eAAe,CAACM,aAAa,CAAC,mBAAmB,CAAC;IAC9DC,KAAK,EAAE,IAAI,CAACP,eAAe,CAACM,aAAa,CAAC,kBAAkB,CAAC;IAC7DE,UAAU,EAAE,IAAI,CAACR,eAAe,CAACM,aAAa,CAAC,kBAAkB,CAAC;IAClEG,iBAAiB,EAAE,IAAI,CAACT,eAAe,CAACU,YAAY,CAAC,kBAAkB;EACzE,CAAC;AACH","ignoreList":[]}
@@ -5,6 +5,20 @@ import { createControllerEffect } from "../../../lib/effector/index.js";
5
5
  import { replaceKatexSyntax } from "../helpers.js";
6
6
  export class ChatbotAPI {
7
7
  constructor(api) {
8
+ // this.spotErrorFx = createControllerEffect(
9
+ // (props: SpotErrorPayload): Promise<SpotErrorResponse> => {
10
+ // return new Promise<SpotErrorResponse>((res) => {
11
+ // if (props.strokes.length <= 3) return res({ strokesIds: [] })
12
+ // setTimeout(() => {
13
+ // const randomStrokes = getRandomElements(props.strokes, 4)
14
+ // res({
15
+ // strokesIds: randomStrokes.map((stroke) => stroke.id ?? ''),
16
+ // })
17
+ // }, 1000)
18
+ // })
19
+ // },
20
+ // )
21
+ this.spotErrorFx = createControllerEffect(api.spotError);
8
22
  this.postMessageFx = createControllerEffect(api.postMessage);
9
23
  this.getAlternativesFx = createEffect(api.getAlternatives);
10
24
  this.translateTextFx = createEffect(async payload => {
@@ -26,4 +40,4 @@ export class ChatbotAPI {
26
40
  this.textToSpeechTextFx = createEffect(api.postTextToSpeech);
27
41
  }
28
42
  }
29
- //# sourceMappingURL=api.js.map
43
+ //# sourceMappingURL=ChatbotApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createEffect","createControllerEffect","replaceKatexSyntax","ChatbotAPI","constructor","api","spotErrorFx","spotError","postMessageFx","postMessage","getAlternativesFx","getAlternatives","translateTextFx","payload","response","postTranslateText","text","data","translations","map","translation","translatedText","textToSpeechTextFx","postTextToSpeech"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/ChatbotApi.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,UAAU;AACvC,SAASC,sBAAsB,QAAQ,gCAAuB;AAG9D,SAASC,kBAAkB,QAAQ,eAAY;AAE/C,OAAO,MAAMC,UAAU,CAAC;EAQtBC,WAAWA,CAACC,GAAuB,EAAE;IACnC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,CAACC,WAAW,GAAGL,sBAAsB,CAACI,GAAG,CAACE,SAAS,CAAC;IACxD,IAAI,CAACC,aAAa,GAAGP,sBAAsB,CAACI,GAAG,CAACI,WAAW,CAAC;IAC5D,IAAI,CAACC,iBAAiB,GAAGV,YAAY,CAACK,GAAG,CAACM,eAAe,CAAC;IAC1D,IAAI,CAACC,eAAe,GAAGZ,YAAY,CACjC,MAAOa,OAA+B,IAAuC;MAC3E,MAAMC,QAAQ,GAAG,MAAMT,GAAG,CAACU,iBAAiB,CAAC;QAC3C,GAAGF,OAAO;QACVG,IAAI,EAAEd,kBAAkB,CAACW,OAAO,CAACG,IAAI;MACvC,CAAC,CAAC;MAEF,OAAO;QACL,GAAGF,QAAQ;QACXG,IAAI,EAAE;UACJ,GAAGH,QAAQ,CAACG,IAAI;UAChBC,YAAY,EAAEJ,QAAQ,CAACG,IAAI,CAACC,YAAY,CAACC,GAAG,CAAEC,WAAW,KAAM;YAC7D,GAAGA,WAAW;YACdC,cAAc,EAAEnB,kBAAkB,CAAC,CAACkB,WAAW,CAACC,cAAc,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;UAC1E,CAAC,CAAC;QACJ;MACF,CAAC;IACH,CACF,CAAC;IACD,IAAI,CAACC,kBAAkB,GAAGtB,YAAY,CAACK,GAAG,CAACkB,gBAAgB,CAAC;EAC9D;AACF","ignoreList":[]}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+
3
+ import { createEvent } from 'effector';
4
+ import { createEntityFieldStore } from "../../../lib/effector/index.js";
5
+ export function defaultChatData(props = {}) {
6
+ return {
7
+ messages: [],
8
+ isAvailable: false,
9
+ currentThread: null,
10
+ ...props
11
+ };
12
+ }
13
+ export class ChatsCacheModel {
14
+ update = createEvent();
15
+ cache = createEntityFieldStore().on(this.update, (state, {
16
+ key,
17
+ data
18
+ }) => {
19
+ const currentData = state[key] ?? defaultChatData();
20
+ return {
21
+ ...state,
22
+ [key]: {
23
+ ...currentData,
24
+ ...data
25
+ }
26
+ };
27
+ });
28
+ $data = this.cache.$state;
29
+ reset = this.cache.reset;
30
+ disableChat(key) {
31
+ this.cache.setField({
32
+ key,
33
+ fn: current => current ? {
34
+ ...current,
35
+ isAvailable: false
36
+ } : defaultChatData({
37
+ isAvailable: false
38
+ })
39
+ });
40
+ }
41
+ reinitChatThread(key, {
42
+ initialOption
43
+ }) {
44
+ this.cache.setField({
45
+ key,
46
+ fn: current => {
47
+ if (!current || current.messages.length <= 1) return;
48
+ const copy = [...current.messages];
49
+ while (copy.at(-1)?.endMessage) {
50
+ copy.pop();
51
+ }
52
+ const lastMessage = copy.at(-1);
53
+ if (!lastMessage) return;
54
+ copy.splice(copy.length - 1, 1, {
55
+ ...lastMessage,
56
+ options: [initialOption]
57
+ });
58
+ return {
59
+ ...current,
60
+ messages: copy
61
+ };
62
+ }
63
+ });
64
+ }
65
+ setSingleMessage(key, message) {
66
+ this.cache.setField({
67
+ key,
68
+ fn: current => {
69
+ if (!current || current.messages.length > 1) return;
70
+ return {
71
+ ...current,
72
+ messages: [message]
73
+ };
74
+ }
75
+ });
76
+ }
77
+ addMessages(key, {
78
+ messages,
79
+ thread = null
80
+ }) {
81
+ this.cache.setField({
82
+ key,
83
+ fn: current => {
84
+ if (!current) return defaultChatData({
85
+ messages,
86
+ currentThread: thread
87
+ });
88
+ const result = {
89
+ ...current,
90
+ messages: [...current.messages, ...messages]
91
+ };
92
+ if (thread) result.currentThread = thread;
93
+ return result;
94
+ }
95
+ });
96
+ }
97
+ add(key, data) {
98
+ this.cache.setField({
99
+ key,
100
+ data
101
+ });
102
+ }
103
+ }
104
+ //# sourceMappingURL=ChatsCacheModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createEvent","createEntityFieldStore","defaultChatData","props","messages","isAvailable","currentThread","ChatsCacheModel","update","cache","on","state","key","data","currentData","$data","$state","reset","disableChat","setField","fn","current","reinitChatThread","initialOption","length","copy","at","endMessage","pop","lastMessage","splice","options","setSingleMessage","message","addMessages","thread","result","add"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/ChatsCacheModel.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,UAAU;AACtC,SAASC,sBAAsB,QAAQ,gCAAuB;AAkB9D,OAAO,SAASC,eAAeA,CAACC,KAAwB,GAAG,CAAC,CAAC,EAAY;EACvE,OAAO;IACLC,QAAQ,EAAE,EAAE;IACZC,WAAW,EAAE,KAAK;IA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ACzB,GAAW,EAAEC,IAAc,EAAE;IACtC,IAAI,CAACJ,KAAK,CAACU,QAAQ,CAAC;MAAEP,GAAG;MAAEC;IAAK,CAAC,CAAC;EACpC;AACF","ignoreList":[]}
@@ -1,22 +1,11 @@
1
1
  "use strict";
2
2
 
3
- import { createEvent } from 'effector';
4
3
  export class DefaultMessagesCreator {
5
- languageChanged = createEvent();
6
4
  list = new Map();
7
5
  constructor({
8
6
  textGetter
9
7
  }) {
10
8
  this.getter = textGetter;
11
- this.languageChanged.watch(() => {
12
- this.list.forEach((key, chatMessage) => {
13
- if ('message' in chatMessage) {
14
- chatMessage.message = this.getter(key);
15
- return;
16
- }
17
- chatMessage.text = this.getter(key);
18
- });
19
- });
20
9
  }
21
10
  createMessage(key, {
22
11
  isOwn = false
@@ -24,7 +13,6 @@ export class DefaultMessagesCreator {
24
13
  const message = {
25
14
  id: this.list.size.toString(),
26
15
  message: this.getter(key),
27
- threadId: '',
28
16
  options: [],
29
17
  isOwnMessage: isOwn
30
18
  };
@@ -39,5 +27,17 @@ export class DefaultMessagesCreator {
39
27
  this.list.set(option, key);
40
28
  return option;
41
29
  }
30
+ bindToLanguageChanged(event) {
31
+ event.watch(() => {
32
+ this.list.forEach((key, chatMessage) => {
33
+ if ('message' in chatMessage) {
34
+ chatMessage.message = this.getter(key);
35
+ return;
36
+ }
37
+ chatMessage.text = this.getter(key);
38
+ });
39
+ });
40
+ return this;
41
+ }
42
42
  }
43
43
  //# sourceMappingURL=DefaultMessageCreator.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createEvent","DefaultMessagesCreator","languageChanged","list","Map","constructor","textGetter","getter","watch","forEach","key","chatMessage","message","text","createMessage","isOwn","id","size","toString","threadId","options","isOwnMessage","set","createOption","option","promptKey"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/DefaultMessageCreator.ts"],"mappings":";;AACA,SAASA,WAAW,QAAQ,UAAU;AAetC,OAAO,MAAMC,sBAAsB,CAAmB;EACpCC,eAAe,GAA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ter","getter","createMessage","key","isOwn","message","id","size","toString","options","isOwnMessage","set","createOption","option","text","promptKey","bindToLanguageChanged","event","watch","forEach","chatMessage"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/DefaultMessageCreator.ts"],"mappings":";;AAiBA,OAAO,MAAMA,sBAAsB,CAAmB;EACnCC,IAAI,GAAG,IAAIC,GAAG,CAA8B,CAAC;EAG9DC,WAAWA,CAAC;IAAEC;EAA0C,CAAC,EAAE;IACzD,IAAI,CAACC,MAAM,GAAGD,UAAU;EAC1B;EAEOE,aAAaA,CAACC,GAAM,EAAE;IAAEC,KAAK,GAAG;EAA8B,CAAC,GAAG,CAAC,CAAC,EAAE;IAC3E,MAAMC,OAAoB,GAAG;MAC3BC,EAAE,EAAE,IAAI,CAACT,IAAI,CAACU,IAAI,CAACC,QAAQ,CAAC,CAAC;MAC7BH,OAAO,EAAE,IAAI,CAACJ,MAAM,CAACE,GAAG,CAAC;MACzBM,OAAO,EAAE,EAAE;MACXC,YAAY,EAAEN;IAChB,CAAC;IACD,IAAI,CAACP,IAAI,CAACc,GAAG,CAACN,OAAO,EAAEF,GAAG,CAAC;IAC3B,OAAOE,OAAO;EAChB;EAEOO,YAAYA,CAACT,GAAM,EAAE;IAC1B,MAAMU,MAAkB,GAAG;MACzBC,IAAI,EAAE,IAAI,CAACb,MAAM,CAACE,GAAG,CAAC;MACtBY,SAAS,EAAE;IACb,CAAC;IACD,IAAI,CAAClB,IAAI,CAACc,GAAG,CAACE,MAAM,EAAEV,GAAG,CAAC;IAC1B,OAAOU,MAAM;EACf;EAEOG,qBAAqBA,CAACC,KAAqB,EAAE;IAClDA,KAAK,CAACC,KAAK,CAAC,MAAM;MAChB,IAAI,CAACrB,IAAI,CAACsB,OAAO,CAAC,CAAChB,GAAG,EAAEiB,WAAW,KAAK;QACtC,IAAI,SAAS,IAAIA,WAAW,EAAE;UAC5BA,WAAW,CAACf,OAAO,GAAG,IAAI,CAACJ,MAAM,CAACE,GAAG,CAAC;UACtC;QACF;QACAiB,WAAW,CAACN,IAAI,GAAG,IAAI,CAACb,MAAM,CAACE,GAAG,CAAC;MACrC,CAAC,CAAC;IACJ,CAAC,CAAC;IACF,OAAO,IAAI;EACb;AACF","ignoreList":[]}
@@ -1,21 +1,29 @@
1
1
  "use strict";
2
2
 
3
+ import { generateRandomId } from "../../../lib/helpers/helpers.js";
3
4
  export class ThreadItem {
4
- hints = [];
5
- constructor({
6
- strokes
7
- } = {}) {
8
- this.strokes = strokes ?? null;
5
+ id = generateRandomId();
6
+ strokesValidationKey = null;
7
+ history = [];
8
+ constructor(props) {
9
+ this.strokes = props?.strokes ?? null;
10
+ this.strokesValidationKey = props?.key ?? null;
9
11
  }
10
12
  getNextHintProps() {
11
- if (this.hints.length) {
13
+ if (this.history.length) {
12
14
  return {
13
- previousHint: this.hints[this.hints.length - 1]
15
+ previousHint: this.history[this.history.length - 1]
14
16
  };
15
17
  }
16
18
  if (this.strokes) {
17
19
  return {
18
- stroke: this.strokes
20
+ stroke: this.strokes.map(({
21
+ x,
22
+ y
23
+ }) => ({
24
+ x,
25
+ y
26
+ }))
19
27
  };
20
28
  }
21
29
  return {};
@@ -1 +1 @@
1
- {"version":3,"names":["ThreadItem","hints","constructor","strokes","getNextHintProps","length","previousHint","stroke"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/ThreadItem.ts"],"mappings":";;AAMA,OAAO,MAAMA,UAAU,CAAC;EAENC,KAAK,GAAa,EAAE;EAE7BC,WAAWA,CAAC;IAAEC;EAAyB,CAAC,GAAG,CAAC,CAAC,EAAE;IACpD,IAAI,CAACA,OAAO,GAAGA,OAAO,IAAI,IAAI;EAChC;EAEOC,gBAAgBA,CAAA,EAAG;IACxB,IAAI,IAAI,CAACH,KAAK,CAACI,MAAM,EAAE;MACrB,OAAO;QACLC,YAAY,EAAE,IAAI,CAACL,KAAK,CAAC,IAAI,CAACA,KAAK,CAACI,MAAM,GAAG,CAAC;MAChD,CAAC;IACH;IAEA,IAAI,IAAI,CAACF,OAAO,EAAE;MAChB,OAAO;QAAEI,MAAM,EAAE,IAAI,CAACJ;MAAQ,CAAC;IACjC;IAEA,OAAO,CAAC,CAAC;EACX;AACF","ignoreList":[]}
1
+ {"version":3,"names":["generateRandomId","ThreadItem","id","strokesValidationKey","history","constructor","props","strokes","key","getNextHintProps","length","previousHint","stroke","map","x","y"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/ThreadItem.ts"],"mappings":";;AACA,SAASA,gBAAgB,QAAQ,iCAA8B;AAO/D,OAAO,MAAMC,UAAU,CAAwB;EAC7BC,EAAE,GAAGF,gBAAgB,CAAC,CAAC;EACvBG,oBAAoB,GAAkB,IAAI;EAE1CC,OAAO,GAAa,EAAE;EAE/BC,WAAWA,CAACC,KAA8B,EAAE;IACjD,IAAI,CAACC,OAAO,GAAGD,KAAK,EAAEC,OAAO,IAAI,IAAI;IACrC,IAAI,CAACJ,oBAAoB,GAAGG,KAAK,EAAEE,GAAG,IAAI,IAAI;EAChD;EAEOC,gBAAgBA,CAAA,EAAG;IACxB,IAAI,IAAI,CAACL,OAAO,CAACM,MAAM,EAAE;MACvB,OAAO;QACLC,YAAY,EAAE,IAAI,CAACP,OAAO,CAAC,IAAI,CAACA,OAAO,CAACM,MAAM,GAAG,CAAC;MACpD,CAAC;IACH;IAEA,IAAI,IAAI,CAACH,OAAO,EAAE;MAChB,OAAO;QAAEK,MAAM,EAAE,IAAI,CAACL,OAAO,CAACM,GAAG,CAAC,CAAC;UAAEC,CAAC;UAAEC;QAAE,CAAC,MAAM;UAAED,CAAC;UAAEC;QAAE,CAAC,CAAC;MAAE,CAAC;IAC/D;IAEA,OAAO,CAAC,CAAC;EACX;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["CHAT_BOT_MODEL_DEFAULTS","THREAD_MESSAGES_LIMIT"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/constants.ts"],"mappings":";;AAAA,OAAO,MAAMA,uBAAuB,GAAG;EACrCC,qBAAqB,EAAE;AACzB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["CHAT_BOT_MODEL_DEFAULTS","THREAD_MESSAGES_LIMIT"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/constants.ts"],"mappings":";;AAEA,OAAO,MAAMA,uBAAuB,GAAG;EACrCC,qBAAqB,EAAE;AACzB,CAAC","ignoreList":[]}
@@ -2,14 +2,17 @@
2
2
 
3
3
  import { generateRandomId } from "../../../lib/helpers/helpers.js";
4
4
  export class messagesHelper {
5
- static createAnswer(data) {
5
+ static createAnswer(data, {
6
+ isInitial
7
+ } = {}) {
6
8
  return {
7
9
  id: generateRandomId(),
8
10
  isOwnMessage: false,
9
11
  message: data.message,
10
- threadId: data.threadId,
11
12
  options: data.options,
12
- translatedMessage: data.translatedMessage
13
+ threadId: data.threadId,
14
+ translatedMessage: data.translatedMessage,
15
+ isInitial
13
16
  };
14
17
  }
15
18
  static createLast(data) {
@@ -19,20 +22,17 @@ export class messagesHelper {
19
22
  translatedMessage: data.translatedMessage,
20
23
  isOwnMessage: false,
21
24
  options: [],
22
- threadId: '',
23
25
  endMessage: true
24
26
  };
25
27
  }
26
28
  static createOwn({
27
29
  message = '',
28
- translatedMessage,
29
- threadId
30
+ translatedMessage
30
31
  }) {
31
32
  return {
32
33
  id: generateRandomId(),
33
34
  message,
34
35
  translatedMessage,
35
- threadId: threadId || '',
36
36
  isOwnMessage: true,
37
37
  options: []
38
38
  };
@@ -1 +1 @@
1
- {"version":3,"names":["generateRandomId","messagesHelper","createAnswer","data","id","isOwnMessage","message","threadId","options","translatedMessage","createLast","endMessage","createOwn"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/messagesHelper.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,iCAA8B;AAS/D,OAAO,MAAMC,cAAc,CAAC;EAC1B,OAAcC,YAAYA,CAACC,IAA2B,EAAuB;IAC3E,OAAO;MACLC,EAAE,EAAEJ,gBAAgB,CAAC,CAAC;MACtBK,YAAY,EAAE,KAAK;MACnBC,OAAO,EAAEH,IAAI,CAACG,OAAO;MACrBC,QAAQ,EAAEJ,IAAI,CAACI,QAAQ;MACvBC,OAAO,EAAEL,IAAI,CAACK,OAAO;MACrBC,iBAAiB,EAAEN,IAAI,CAACM;IAC1B,CAAC;EACH;EAEA,OAAcC,UAAUA,CAACP,IAA2B,EAAE;IACpD,OAAO;MACLC,EAAE,EAAEJ,gBAAgB,CAAC,CAAC;MACtBM,OAAO,EAAEH,IAAI,CAACG,OAAO;MACrBG,iBAAiB,EAAEN,IAAI,CAACM,iBAAiB;MACzCJ,YAAY,EAAE,KAAK;MACnBG,OAAO,EAAE,EAAE;MACXD,QAAQ,EAAE,EAAE;MACZI,UAAU,EAAE;IACd,CAAC;EACH;EAEA,OAAcC,SAASA,CAAC;IACtBN,OAAO,GAAG,EAAE;IACZG,iBAAiB;IACjBF;EACe,CAAC,EAAuB;IACvC,OAAO;MACLH,EAAE,EAAEJ,gBAAgB,CAAC,CAAC;MACtBM,OAAO;MACPG,iBAAiB;MACjBF,QAAQ,EAAEA,QAAQ,IAAI,EAAE;MACxBF,YAAY,EAAE,IAAI;MAClBG,OAAO,EAAE;IACX,CAAC;EACH;AACF","ignoreList":[]}
1
+ {"version":3,"names":["generateRandomId","messagesHelper","createAnswer","data","isInitial","id","isOwnMessage","message","options","threadId","translatedMessage","createLast","endMessage","createOwn"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/messagesHelper.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,iCAA8B;AAa/D,OAAO,MAAMC,cAAc,CAAC;EAC1B,OAAcC,YAAYA,CACxBC,IAA2B,EAC3B;IAAEC;EAAgC,CAAC,GAAG,CAAC,CAAC,EACnB;IACrB,OAAO;MACLC,EAAE,EAAEL,gBAAgB,CAAC,CAAC;MACtBM,YAAY,EAAE,KAAK;MACnBC,OAAO,EAAEJ,IAAI,CAACI,OAAO;MACrBC,OAAO,EAAEL,IAAI,CAACK,OAAO;MACrBC,QAAQ,EAAEN,IAAI,CAACM,QAAQ;MACvBC,iBAAiB,EAAEP,IAAI,CAACO,iBAAiB;MACzCN;IACF,CAAC;EACH;EAEA,OAAcO,UAAUA,CAACR,IAA2B,EAAE;IACpD,OAAO;MACLE,EAAE,EAAEL,gBAAgB,CAAC,CAAC;MACtBO,OAAO,EAAEJ,IAAI,CAACI,OAAO;MACrBG,iBAAiB,EAAEP,IAAI,CAACO,iBAAiB;MACzCJ,YAAY,EAAE,KAAK;MACnBE,OAAO,EAAE,EAAE;MACXI,UAAU,EAAE;IACd,CAAC;EACH;EAEA,OAAcC,SAASA,CAAC;IACtBN,OAAO,GAAG,EAAE;IACZG;EACe,CAAC,EAAuB;IACvC,OAAO;MACLL,EAAE,EAAEL,gBAAgB,CAAC,CAAC;MACtBO,OAAO;MACPG,iBAAiB;MACjBJ,YAAY,EAAE,IAAI;MAClBE,OAAO,EAAE;IACX,CAAC;EACH;AACF","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- import { restore, createEvent, sample, createEffect } from 'effector';
3
+ import { restore, createEvent, createEffect } from 'effector';
4
4
  import { AUDIO_CONFIG, DEFAULT_VOICE } from "../constants.js";
5
5
  import { AudioStatus } from "../types/t2s.types.js";
6
6
  export class ChatTextToSpeechModel {
@@ -10,30 +10,34 @@ export class ChatTextToSpeechModel {
10
10
  $currentPlayingId = restore(this.setCurrentPlayingId, null);
11
11
  setStatus = createEvent();
12
12
  $status = restore(this.setStatus, AudioStatus.STOPPED);
13
+ audioConfig = null;
14
+ textSanitizer = value => value;
13
15
  constructor({
14
- $isOpen,
15
16
  api
16
17
  }) {
17
18
  this.api = api;
18
- sample({
19
- source: $isOpen.updates,
20
- filter: isOpen => !isOpen,
21
- target: this.reset
22
- });
23
19
  }
24
- setAudioProvider(audioProvider) {
25
- this.audioProvider = audioProvider;
20
+ setAudioConfig(config) {
21
+ this.audioConfig = config;
22
+ }
23
+ setConfig({
24
+ audioProvider,
25
+ textSanitizer
26
+ }) {
27
+ if (audioProvider) this.audioProvider = audioProvider;
28
+ if (textSanitizer) this.textSanitizer = textSanitizer;
26
29
  }
27
30
  getCacheKey = (messageId, isTranslated) => {
28
31
  return `${messageId}-${isTranslated ? 'translated' : 'original'}`;
29
32
  };
30
33
  async play({
31
- text,
32
- messageId,
33
- isTranslated,
34
- config
34
+ message,
35
+ isTranslated
35
36
  }) {
36
- if (!this.audioProvider) throw new Error('Audio provider is not set. Use setAudioProvider.');
37
+ if (!this.audioProvider) throw new Error('Audio provider is not set. Use setConfig.');
38
+ const messageText = isTranslated ? message.translatedMessage : message.message;
39
+ const messageId = message.id;
40
+ const text = this.textSanitizer(messageText);
37
41
  try {
38
42
  const status = this.$status.getState();
39
43
  const playingId = this.$currentPlayingId.getState();
@@ -57,6 +61,7 @@ export class ChatTextToSpeechModel {
57
61
  let audioPath = this.audioCache[cacheKey];
58
62
  this.setCurrentPlayingId(messageId);
59
63
  if (!audioPath) {
64
+ const config = this.audioConfig;
60
65
  const response = await this.api.textToSpeechTextFx({
61
66
  input: {
62
67
  text
@@ -1 +1 @@
1
- {"version":3,"names":["restore","createEvent","sample","createEffect","AUDIO_CONFIG","DEFAULT_VOICE","AudioStatus","ChatTextToSpeechModel","audioCache","audioProvider","setCurrentPlayingId","$currentPlayingId","setStatus","$status","STOPPED","constructor","$isOpen","api","source","updates","filter","isOpen","target","reset","setAudioProvider","getCacheKey","messageId","isTranslated","play","text","config","Error","status","getState","playingId","isPlaying","PLAYING","isPaused","PAUSED","isCurrentMessage","pause","resume","stop","cacheKey","audioPath","response","textToSpeechTextFx","input","voice","audioConfig","audioContent","error","console"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/t2s.ts"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,WAAW,EAASC,MAAM,EAAEC,YAAY,QAAQ,UAAU;AAC5E,SAASC,YAAY,EAAEC,aAAa,QAAQ,iBAAc;AAC1D,SAAwBC,WAAW,QAA+B,uBAAoB;AAQtF,OAAO,MAA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AAC8B,OAAO,CAAC;MACnC,MAAM,IAAI,CAAC3B,aAAa,CAACmB,IAAI,CAACgB,SAAS,EAAE,MAAM;QAC7C,IAAI,CAAChC,SAAS,CAACN,WAAW,CAACQ,OAAO,CAAC;QACnC,IAAI,CAACJ,mBAAmB,CAAC,IAAI,CAAC;MAChC,CAAC,CAAC;IACJ,CAAC,CAAC,OAAOyC,KAAK,EAAE;MACd,IAAI,CAAC5B,KAAK,CAAC,CAAC;MACZ6B,OAAO,CAACD,KAAK,CAAC,gCAAgC,EAAEA,KAAK,CAAC;IACxD;EACF;EAEOT,IAAIA,CAAA,EAAG;IACZ,IAAI,CAAC,IAAI,CAACjC,aAAa,EAAE,MAAM,IAAIsB,KAAK,CAAC,kDAAkD,CAAC;IAC5F,IAAI,CAACtB,aAAa,CAACiC,IAAI,CAAC,CAAC;EAC3B;EAEgBnB,KAAK,GAAGpB,YAAY,CAAC,MAAM;IACzC,IAAI,CAACuC,IAAI,CAAC,CAAC;IACX,IAAI,CAAC9B,SAAS,CAACN,WAAW,CAACQ,OAAO,CAAC;IACnC,IAAI,CAACJ,mBAAmB,CAAC,IAAI,CAAC;EAChC,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["restore","createEvent","createEffect","AUDIO_CONFIG","DEFAULT_VOICE","AudioStatus","ChatTextToSpeechModel","audioCache","audioProvider","setCurrentPlayingId","$currentPlayingId","setStatus","$status","STOPPED","audioConfig","textSanitizer","value","constructor","api","setAudioConfig","config","setConfig","getCacheKey","messageId","isTranslated","play","message","Error","messageText","translatedMessage","id","text","status","getState","playingId","isPlaying","PLAYING","isPaused","PAUSED","isCurrentMessage","pause","resume","stop","cacheKey","audioPath","response","textToSpeechTextFx","input","voice","audioContent","error","reset","console"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/t2s.ts"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,WAAW,EAAEC,YAAY,QAAQ,UAAU;AAC7D,SAASC,YAAY,EAAEC,aAAa,QA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AAK,IAAI5C,aAAa;UACrCU,WAAW,EAAEM,MAAM,EAAEN,WAAW,IAAIX;QACtC,CAAC,CAAC;;QAEF;QACA,IAAI,OAAO0C,QAAQ,KAAK,QAAQ,EAAE;UAChCD,SAAS,GAAG,0BAA0BC,QAAQ,EAAE;QAClD,CAAC,MAAM;UACLD,SAAS,GAAGC,QAAQ,EAAEI,YAAY,IAAI,EAAE;QAC1C;QAEA,IAAI,CAAC1C,UAAU,CAACoC,QAAQ,CAAC,GAAGC,SAAS;MACvC;MAEA,IAAI,CAACjC,SAAS,CAACN,WAAW,CAAC+B,OAAO,CAAC;MACnC,MAAM,IAAI,CAAC5B,aAAa,CAACiB,IAAI,CAACmB,SAAS,EAAE,MAAM;QAC7C,IAAI,CAACjC,SAAS,CAACN,WAAW,CAACQ,OAAO,CAAC;QACnC,IAAI,CAACJ,mBAAmB,CAAC,IAAI,CAAC;MAChC,CAAC,CAAC;IACJ,CAAC,CAAC,OAAOyC,KAAK,EAAE;MACd,IAAI,CAACC,KAAK,CAAC,CAAC;MACZC,OAAO,CAACF,KAAK,CAAC,gCAAgC,EAAEA,KAAK,CAAC;IACxD;EACF;EAEOR,IAAIA,CAAA,EAAG;IACZ,IAAI,CAAC,IAAI,CAAClC,aAAa,EAAE,MAAM,IAAImB,KAAK,CAAC,kDAAkD,CAAC;IAC5F,IAAI,CAACnB,aAAa,CAACkC,IAAI,CAAC,CAAC;EAC3B;EAEgBS,KAAK,GAAGjD,YAAY,CAAC,MAAM;IACzC,IAAI,CAACwC,IAAI,CAAC,CAAC;IACX,IAAI,CAAC/B,SAAS,CAACN,WAAW,CAACQ,OAAO,CAAC;IACnC,IAAI,CAACJ,mBAAmB,CAAC,IAAI,CAAC;EAChC,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["getOptionsForTranslation","lastMessage","alternatives","options","length","hintAlternatives","hints","defaultAlternatives","default","map","text","addTranslationsToAlternative","translatedHints","translatedDefaults","translatedText","index","addTranslationToOptions","translations","option"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/translation.helpers.ts"],"mappings":";;AAOA,OAAO,SAASA,wBAAwBA,CAAC;EACvCC,WAAW;EACXC;AACe,CAAC,EAAoB;EACpC,IAAI,CAACD,WAAW,EAAE,OAAO;IAAEA,WAAW,EAAE,IAAI;IAAEC,YAAY,EAAE;EAAK,CAAC;EAClE,IAAI,CAACD,WAAW,CAACE,OAAO,CAACC,MAAM,EAAE;IAC/B,IAAI,CAACF,YAAY,EAAE,OAAO;MAAED,WAAW,EAAE,IAAI;MAAEC,YAAY,EAAE;IAAK,CAAC;IACnE,MAAMG,gBAAgB,GAAGH,YAAY,CAACC,OAAO,CAACG,KAAK,IAAI,EAAE;IACzD,MAAMC,mBAAmB,GAAGL,YAAY,CAACC,OAAO,CAACK,OAAO,IAAI,EAAE;IAC9D,OAAO;MACLP,WAAW,EAAE,IAAI;MACjBC,YAAY,EAAE;QACZI,KAAK,EAAED,gBAAgB,CAACI,GAAG,CAAC,CAAC;UAAEC;QAAK,CAAC,KAAKA,IAAI,CAAC;QAC/CF,OAAO,EAAED,mBAAmB,CAACE,GAAG,CAAC,CAAC;UAAEC;QAAK,CAAC,KAAKA,IAAI;MACrD;IACF,CAAC;EACH;EAEA,OAAO;IACLT,WAAW,EAAEA,WAAW,CAACE,OAAO,CAACM,GAAG,CAAC,CAAC;MAAEC;IAAK,CAAC,KAAKA,IAAI,CAAC;IACxDR,YAAY,EAAE;EAChB,CAAC;AACH;AAEA,OAAO,SAASS,4BAA4BA,CAAC;EAC3CT,YAAY;EACZU,eAAe;EACfC;AACiC,CAAC,EAA2B;EAC7D,OAAO;IACL,GAAGX,YAAY;IACfC,OAAO,EAAE;MACP,GAAGD,YAAY,CAACC,OAAO;MACvBG,KAAK,EAAEM,eAAe,CAACH,GAAG,CAAC,CAACK,cAAc,EAAEC,KAAK,MAAM;QACrD,GAAGb,YAAY,CAACC,OAAO,CAACG,KAAK,CAACS,KAAK,CAAC;QACpCD;MACF,CAAC,CAAC,CAAC;MACHN,OAAO,EAAEK,kBAAkB,CAACJ,GAAG,CAAC,CAACK,cAAc,EAAEC,KAAK,MAAM;QAC1D,GAAGb,YAAY,CAACC,OAAO,CAACK,OAAO,CAACO,KAAK,CAAC;QACtCD;MACF,CAAC,CAAC;IACJ;EACF,CAAC;AACH;AAEA,OAAO,SAASE,uBAAuBA,CAACb,OAAqB,EAAEc,YAAsB,EAAE;EACrF,OAAOd,OAAO,CAACM,GAAG,CAAC,CAACS,MAAM,EAAEH,KAAK,MAAM;IACrC,GAAGG,MAAM;IACTJ,cAAc,EAAEG,YAAY,CAACF,KAAK;EACpC,CAAC,CAAC,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"names":["getOptionsForTranslation","lastMessage","alternatives","options","length","hintAlternatives","hints","defaultAlternatives","default","map","text","addTranslationsToAlternative","translatedHints","translatedDefaults","translatedText","index","addTranslationToOptions","translations","option"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/translation.helpers.ts"],"mappings":";;AAQA,OAAO,SAASA,wBAAwBA,CAAC;EACvCC,WAAW;EACXC;AACe,CAAC,EAAoB;EACpC,IAAI,CAACD,WAAW,EAAE,OAAO;IAAEA,WAAW,EAAE,IAAI;IAAEC,YAAY,EAAE;EAAK,CAAC;EAClE,IAAI,CAACD,WAAW,CAACE,OAAO,CAACC,MAAM,EAAE;IAC/B,IAAI,CAACF,YAAY,EAAE,OAAO;MAAED,WAAW,EAAE,IAAI;MAAEC,YAAY,EAAE;IAAK,CAAC;IACnE,MAAMG,gBAAgB,GAAGH,YAAY,CAACC,OAAO,CAACG,KAAK,IAAI,EAAE;IACzD,MAAMC,mBAAmB,GAAGL,YAAY,CAACC,OAAO,CAACK,OAAO,IAAI,EAAE;IAC9D,OAAO;MACLP,WAAW,EAAE,IAAI;MACjBC,YAAY,EAAE;QACZI,KAAK,EAAED,gBAAgB,CAACI,GAAG,CAAC,CAAC;UAAEC;QAAK,CAAC,KAAKA,IAAI,C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