@memori.ai/memori-react 9.0.0-alpha.21 → 9.0.0-alpha.22

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 (250) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
  3. package/dist/components/AgeVerificationModal/AgeVerificationModal.js +1 -1
  4. package/dist/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
  5. package/dist/components/Auth/Auth.css +12 -5
  6. package/dist/components/Auth/Auth.d.ts +1 -1
  7. package/dist/components/Auth/Auth.js +46 -32
  8. package/dist/components/Auth/Auth.js.map +1 -1
  9. package/dist/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
  10. package/dist/components/Chat/Chat.css +1 -0
  11. package/dist/components/Chat/Chat.js +1 -1
  12. package/dist/components/Chat/Chat.js.map +1 -1
  13. package/dist/components/ChatBubble/ChatBubble.css +32 -5
  14. package/dist/components/ChatBubble/ChatBubble.js +2 -4
  15. package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
  16. package/dist/components/ChatHistoryDrawer/ChatHistory.d.ts +3 -1
  17. package/dist/components/ChatHistoryDrawer/ChatHistory.js +2 -2
  18. package/dist/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
  19. package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
  20. package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +3 -1
  21. package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js +7 -57
  22. package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -1
  23. package/dist/components/ChatInputs/ChatInputs.js +10 -1
  24. package/dist/components/ChatInputs/ChatInputs.js.map +1 -1
  25. package/dist/components/ChatTextArea/ChatTextArea.css +1 -1
  26. package/dist/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
  27. package/dist/components/ContentPreviewModal/ContentPreviewModal.js +1 -1
  28. package/dist/components/ContentPreviewModal/ContentPreviewModal.js.map +1 -1
  29. package/dist/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
  30. package/dist/components/Header/Header.css +8 -3
  31. package/dist/components/Header/Header.js +15 -18
  32. package/dist/components/Header/Header.js.map +1 -1
  33. package/dist/components/IconButton/IconButton.d.ts +1 -1
  34. package/dist/components/KnownFacts/KnownFacts.css +1 -1
  35. package/dist/components/KnownFacts/KnownFacts.js +2 -5
  36. package/dist/components/KnownFacts/KnownFacts.js.map +1 -1
  37. package/dist/components/LoginDrawer/LoginDrawer.css +16 -14
  38. package/dist/components/LoginDrawer/LoginDrawer.js +19 -11
  39. package/dist/components/LoginDrawer/LoginDrawer.js.map +1 -1
  40. package/dist/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
  41. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
  42. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +2 -2
  43. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
  44. package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +1 -1
  45. package/dist/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -1
  46. package/dist/components/MemoriWidget/MemoriWidget.js +35 -31
  47. package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
  48. package/dist/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
  49. package/dist/components/PositionPopover/PositionPopover.css +3 -3
  50. package/dist/components/PositionPopover/PositionPopover.js +38 -25
  51. package/dist/components/PositionPopover/PositionPopover.js.map +1 -1
  52. package/dist/components/Snippet/Snippet.css +1 -1
  53. package/dist/components/StartPanel/StartPanel.css +19 -3
  54. package/dist/components/StartPanel/StartPanel.js +12 -18
  55. package/dist/components/StartPanel/StartPanel.js.map +1 -1
  56. package/dist/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
  57. package/dist/components/layouts/totem.css +43 -9
  58. package/dist/helpers/positionPopover.d.ts +2 -1
  59. package/dist/helpers/positionPopover.js +10 -2
  60. package/dist/helpers/positionPopover.js.map +1 -1
  61. package/dist/icons/MemoriIcon.js +1 -1
  62. package/dist/icons/MemoriIcon.js.map +1 -1
  63. package/dist/locales/de.json +4 -1
  64. package/dist/locales/en.json +3 -1
  65. package/dist/locales/es.json +3 -1
  66. package/dist/locales/fr.json +3 -1
  67. package/dist/locales/it.json +3 -1
  68. package/dist/styles.css +1 -1
  69. package/dist/version.d.ts +1 -1
  70. package/dist/version.js +1 -1
  71. package/esm/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
  72. package/esm/components/AgeVerificationModal/AgeVerificationModal.js +1 -1
  73. package/esm/components/AgeVerificationModal/AgeVerificationModal.js.map +1 -1
  74. package/esm/components/Auth/Auth.css +12 -5
  75. package/esm/components/Auth/Auth.d.ts +1 -1
  76. package/esm/components/Auth/Auth.js +47 -33
  77. package/esm/components/Auth/Auth.js.map +1 -1
  78. package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
  79. package/esm/components/Chat/Chat.css +1 -0
  80. package/esm/components/Chat/Chat.js +1 -1
  81. package/esm/components/Chat/Chat.js.map +1 -1
  82. package/esm/components/ChatBubble/ChatBubble.css +32 -5
  83. package/esm/components/ChatBubble/ChatBubble.js +2 -4
  84. package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
  85. package/esm/components/ChatHistoryDrawer/ChatHistory.d.ts +3 -1
  86. package/esm/components/ChatHistoryDrawer/ChatHistory.js +2 -2
  87. package/esm/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
  88. package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
  89. package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +3 -1
  90. package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.js +9 -59
  91. package/esm/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -1
  92. package/esm/components/ChatInputs/ChatInputs.js +11 -2
  93. package/esm/components/ChatInputs/ChatInputs.js.map +1 -1
  94. package/esm/components/ChatTextArea/ChatTextArea.css +1 -1
  95. package/esm/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
  96. package/esm/components/ContentPreviewModal/ContentPreviewModal.js +1 -1
  97. package/esm/components/ContentPreviewModal/ContentPreviewModal.js.map +1 -1
  98. package/esm/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
  99. package/esm/components/Header/Header.css +8 -3
  100. package/esm/components/Header/Header.js +15 -18
  101. package/esm/components/Header/Header.js.map +1 -1
  102. package/esm/components/IconButton/IconButton.d.ts +1 -1
  103. package/esm/components/KnownFacts/KnownFacts.css +1 -1
  104. package/esm/components/KnownFacts/KnownFacts.js +2 -5
  105. package/esm/components/KnownFacts/KnownFacts.js.map +1 -1
  106. package/esm/components/LoginDrawer/LoginDrawer.css +16 -14
  107. package/esm/components/LoginDrawer/LoginDrawer.js +20 -12
  108. package/esm/components/LoginDrawer/LoginDrawer.js.map +1 -1
  109. package/esm/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
  110. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
  111. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +2 -2
  112. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
  113. package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js +1 -1
  114. package/esm/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.js.map +1 -1
  115. package/esm/components/MemoriWidget/MemoriWidget.js +36 -32
  116. package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
  117. package/esm/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
  118. package/esm/components/PositionPopover/PositionPopover.css +3 -3
  119. package/esm/components/PositionPopover/PositionPopover.js +39 -26
  120. package/esm/components/PositionPopover/PositionPopover.js.map +1 -1
  121. package/esm/components/Snippet/Snippet.css +1 -1
  122. package/esm/components/StartPanel/StartPanel.css +19 -3
  123. package/esm/components/StartPanel/StartPanel.js +12 -18
  124. package/esm/components/StartPanel/StartPanel.js.map +1 -1
  125. package/esm/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
  126. package/esm/components/layouts/totem.css +43 -9
  127. package/esm/helpers/positionPopover.d.ts +2 -1
  128. package/esm/helpers/positionPopover.js +9 -2
  129. package/esm/helpers/positionPopover.js.map +1 -1
  130. package/esm/icons/MemoriIcon.js +1 -1
  131. package/esm/icons/MemoriIcon.js.map +1 -1
  132. package/esm/locales/de.json +4 -1
  133. package/esm/locales/en.json +3 -1
  134. package/esm/locales/es.json +3 -1
  135. package/esm/locales/fr.json +3 -1
  136. package/esm/locales/it.json +3 -1
  137. package/esm/styles.css +1 -1
  138. package/esm/version.d.ts +1 -1
  139. package/esm/version.js +1 -1
  140. package/package.json +5 -3
  141. package/src/Live/Agents.stories.tsx +49 -0
  142. package/src/Live/KnownFacts.stories.tsx +50 -0
  143. package/src/Showcase.stories.tsx +3 -14
  144. package/src/components/AgeVerificationModal/AgeVerificationModal.css +1 -7
  145. package/src/components/AgeVerificationModal/AgeVerificationModal.stories.tsx +1 -1
  146. package/src/components/AgeVerificationModal/AgeVerificationModal.tsx +1 -0
  147. package/src/components/Auth/Auth.css +12 -5
  148. package/src/components/Auth/Auth.stories.tsx +1 -1
  149. package/src/components/Auth/Auth.test.tsx +68 -1
  150. package/src/components/Auth/Auth.tsx +69 -54
  151. package/src/components/Auth/__snapshots__/Auth.test.tsx.snap +5 -6
  152. package/src/components/Avatar/Avatar.stories.tsx +1 -18
  153. package/src/components/Avatar/AvatarView/AvatarView.stories.tsx +1 -103
  154. package/src/components/Blob/Blob.stories.tsx +1 -1
  155. package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.css +7 -6
  156. package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.tsx +1 -1
  157. package/src/components/ChangeMode/ChangeMode.stories.tsx +1 -1
  158. package/src/components/Chat/Chat.css +1 -0
  159. package/src/components/Chat/Chat.stories.tsx +61 -7
  160. package/src/components/Chat/Chat.tsx +1 -0
  161. package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +80 -80
  162. package/src/components/ChatBubble/ChatBubble.css +32 -5
  163. package/src/components/ChatBubble/ChatBubble.stories.tsx +13 -2
  164. package/src/components/ChatBubble/ChatBubble.test.tsx +21 -1
  165. package/src/components/ChatBubble/ChatBubble.tsx +7 -13
  166. package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +158 -185
  167. package/src/components/ChatHistoryDrawer/ChatHistory.stories.tsx +1 -1
  168. package/src/components/ChatHistoryDrawer/ChatHistory.tsx +6 -0
  169. package/src/components/ChatHistoryDrawer/ChatResumeDrawer.css +1 -1
  170. package/src/components/ChatHistoryDrawer/ChatResumeDrawer.tsx +24 -81
  171. package/src/components/ChatInputs/ChatInputs.stories.tsx +1 -39
  172. package/src/components/ChatInputs/ChatInputs.test.tsx +47 -0
  173. package/src/components/ChatInputs/ChatInputs.tsx +12 -2
  174. package/src/components/ChatTextArea/ChatTextArea.css +1 -1
  175. package/src/components/CompletionProviderStatus/CompletionProviderStatus.stories.tsx +1 -1
  176. package/src/components/ContentPreviewModal/ContentPreviewModal.css +1 -10
  177. package/src/components/ContentPreviewModal/ContentPreviewModal.tsx +1 -1
  178. package/src/components/ExpertsDrawer/ExpertsDrawer.css +0 -6
  179. package/src/components/ExpertsDrawer/ExpertsDrawer.stories.tsx +1 -1
  180. package/src/components/FeedbackButtons/FeedbackButtons.stories.tsx +29 -10
  181. package/src/components/Header/Header.css +8 -3
  182. package/src/components/Header/Header.stories.tsx +1 -1
  183. package/src/components/Header/Header.tsx +146 -117
  184. package/src/components/KnownFacts/KnownFacts.css +1 -1
  185. package/src/components/KnownFacts/KnownFacts.stories.tsx +1 -23
  186. package/src/components/KnownFacts/KnownFacts.tsx +4 -9
  187. package/src/components/LoginDrawer/LoginDrawer.css +16 -14
  188. package/src/components/LoginDrawer/LoginDrawer.stories.tsx +2 -52
  189. package/src/components/LoginDrawer/LoginDrawer.tsx +51 -39
  190. package/src/components/MediaWidget/MediaItemWidget.stories.tsx +1 -15
  191. package/src/components/MediaWidget/MediaWidget.stories.tsx +1 -45
  192. package/src/components/MemoriArtifactSystem/components/ArtifactActions/CopyButton.stories.tsx +1 -1
  193. package/src/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +4 -4
  194. package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +28 -5
  195. package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +4 -6
  196. package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.tsx +1 -1
  197. package/src/components/MemoriArtifactSystem/utils/ArtifactAPI.test.tsx +32 -28
  198. package/src/components/MemoriWidget/MemoriUIProvider.contract.test.tsx +55 -0
  199. package/src/components/MemoriWidget/MemoriWidget.stories.tsx +55 -77
  200. package/src/components/MemoriWidget/MemoriWidget.tsx +49 -44
  201. package/src/components/MemoriWidget/getChatStyles.test.ts +24 -0
  202. package/src/components/MicrophoneButton/MicrophoneButton.stories.tsx +1 -1
  203. package/src/components/MobileSessionPanel/MobileSessionPanel.css +2 -2
  204. package/src/components/PositionPopover/PositionPopover.css +3 -3
  205. package/src/components/PositionPopover/PositionPopover.stories.tsx +1 -1
  206. package/src/components/PositionPopover/PositionPopover.tsx +50 -28
  207. package/src/components/PoweredBy/PoweredBy.stories.tsx +1 -54
  208. package/src/components/PoweredBy/__snapshots__/PoweredBy.test.tsx.snap +2 -2
  209. package/src/components/SendOnEnterMenu/SendOnEnterMenu.stories.tsx +1 -1
  210. package/src/components/SettingsDrawer/SettingsDrawer.stories.tsx +1 -1
  211. package/src/components/ShareButton/ShareButton.stories.tsx +1 -1
  212. package/src/components/Snippet/Snippet.css +1 -1
  213. package/src/components/Snippet/Snippet.stories.tsx +1 -1
  214. package/src/components/StartPanel/StartPanel.css +19 -3
  215. package/src/components/StartPanel/StartPanel.stories.tsx +2 -2
  216. package/src/components/StartPanel/StartPanel.tsx +22 -35
  217. package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +177 -121
  218. package/src/components/Typing/Typing.stories.tsx +1 -1
  219. package/src/components/WhyThisAnswer/WhyThisAnswer.stories.tsx +22 -44
  220. package/src/components/layouts/FullBody/FullBody.stories.tsx +55 -68
  221. package/src/components/layouts/Totem/Totem.stories.tsx +69 -87
  222. package/src/components/layouts/WebsiteAssistant/website-assistant.css +3 -3
  223. package/src/components/layouts/ZoomedFullBody/ZoomedFullBody.stories.tsx +69 -87
  224. package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +19 -41
  225. package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +39 -83
  226. package/src/components/layouts/__snapshots__/HiddenChat.test.tsx.snap +15 -11
  227. package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +116 -42
  228. package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +18 -40
  229. package/src/components/layouts/layouts.stories.tsx +96 -179
  230. package/src/components/layouts/totem.css +43 -9
  231. package/src/helpers/positionPopover.test.ts +36 -1
  232. package/src/helpers/positionPopover.ts +21 -4
  233. package/src/i18n.knownFacts.test.ts +40 -0
  234. package/src/icons/MemoriIcon.tsx +1 -1
  235. package/src/index.stories.tsx +1 -47
  236. package/src/locales/de.json +4 -1
  237. package/src/locales/en.json +3 -1
  238. package/src/locales/es.json +3 -1
  239. package/src/locales/fr.json +3 -1
  240. package/src/locales/it.json +3 -1
  241. package/src/styles.css +13 -27
  242. package/src/version.ts +1 -1
  243. package/src/components/ChatTextArea/ChatTextArea.stories.tsx +0 -55
  244. package/src/components/CustomGLBModelViewer/ModelViewer.stories.tsx +0 -58
  245. package/src/components/DateSelector/DateSelector.stories.tsx +0 -47
  246. package/src/components/FilePreview/FilePreview.stories.tsx +0 -63
  247. package/src/components/MemoriArtifactSystem/ArtifactDrawer.stories.tsx +0 -265
  248. package/src/components/UploadButton/UploadButton.stories.tsx +0 -510
  249. package/src/components/VenueWidget/VenueWidget.stories.tsx +0 -69
  250. package/src/components/layouts/WebsiteAssistant/WebsiteAssistant.stories.tsx +0 -115
@@ -187,22 +187,9 @@ function getChatStyles(config) {
187
187
  const primaryContent = (_a = config === null || config === void 0 ? void 0 : config.buttonTextColor) !== null && _a !== void 0 ? _a : '#ffffff';
188
188
  return {
189
189
  '--memori-primary-color': primary,
190
- '--memori-primary': primary,
191
190
  '--memori-primary-content': primaryContent,
192
- '--memori-primary-hover': 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast, black) 15%)',
193
- '--memori-primary-active': 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast, black) 25%)',
194
- '--memori-primary-disabled': 'color-mix(in oklch, var(--memori-primary), transparent 60%)',
195
- '--memori-primary-subtle': 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast-inverse, white) 60%)',
196
- '--memori-primary-subtle-hover': 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast-inverse, white) 50%)',
197
- '--memori-border-primary': 'color-mix(in oklch, var(--memori-primary), transparent 70%)',
198
- '--memori-border-primary-hover': 'color-mix(in oklch, var(--memori-primary), transparent 50%)',
199
- '--memori-focus-ring-color': 'color-mix(in oklch, var(--memori-primary), transparent 80%)',
200
- '--memori-focus-ring': '0 0 0 3px var(--memori-focus-ring-color)',
201
- '--memori-shadow-primary': '0 8px 16px -4px color-mix(in oklch, var(--memori-primary), transparent 70%)',
202
- '--memori-skeleton-base': 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast-inverse, white) 85%)',
203
- '--memori-skeleton-highlight': 'color-mix(in oklch, var(--memori-primary), var(--memori-surface-contrast-inverse, white) 75%)',
204
191
  '--memori-icon-active-bg': 'color-mix(in oklch, var(--memori-primary) 12%, transparent)',
205
- '--memori-icon-recording-bg': 'color-mix(in oklch, var(--memori-error, #dc2626) 12%, transparent)',
192
+ '--memori-icon-recording-bg': 'color-mix(in oklch, var(--memori-error) 12%, transparent)',
206
193
  };
207
194
  }
208
195
  const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenantID, memoriLang, uiLang, spokenLang, multilingual, integration, layout, customLayout, showShare, preview = false, embed = false, showCopyButton = true, showTranslationOriginal = false, showInputs = true, showDates = false, showContextPerLine = false, showMessageConsumption = false, showSettings, showTypingText = false, showClear = false, showLogin = false, showUpload, showOnlyLastMessages, showChatHistory, showReasoning, avatar3dHidden, height = '100vh', secret, baseUrl = 'https://aisuru-staging.aclambda.online', apiURL = 'https://backend-staging.memori.ai', engineURL = 'https://engine-staging.memori.ai', initialContextVars, initialQuestion, ttsProvider, ogImage, sessionID: initialSessionID, tenant, personification, authToken, enableAudio, defaultSpeakerActive = true, disableTextEnteredEvents = false, onStateChange, additionalInfo, additionalSettings, customMediaRenderer, userAvatar, __WEBCOMPONENT__ = false, useMathFormatting = false, autoStart = false, applyVarsToRoot = false, showFunctionCache = false, maxTotalMessagePayload, maxTextareaCharacters, }) => {
@@ -826,7 +813,7 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
826
813
  }
827
814
  }, [initialSessionID]);
828
815
  const fetchSession = async (params) => {
829
- var _a, _b, _c, _d, _f, _g, _h;
816
+ var _a, _b, _c, _d, _f, _g, _h, _j;
830
817
  let storageBirthDate = (0, configuration_1.getLocalConfig)('birthDate', undefined);
831
818
  let userBirthDate = (_a = birthDate !== null && birthDate !== void 0 ? birthDate : params.birthDate) !== null && _a !== void 0 ? _a : storageBirthDate;
832
819
  if (!userBirthDate && !!minAge) {
@@ -834,8 +821,10 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
834
821
  return;
835
822
  }
836
823
  if (memori.privacyType !== 'PUBLIC' &&
824
+ !params.password &&
837
825
  !memori.secretToken &&
838
826
  !memoriPwd &&
827
+ !((_b = params.recoveryTokens) === null || _b === void 0 ? void 0 : _b.length) &&
839
828
  !memoriTokens) {
840
829
  setAuthModalState('password');
841
830
  return;
@@ -851,17 +840,17 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
851
840
  return window.location.href;
852
841
  })();
853
842
  }
854
- catch (_j) {
843
+ catch (_k) {
855
844
  }
856
845
  const session = await initSession({
857
846
  ...params,
858
847
  birthDate: userBirthDate,
859
- tag: (_b = params.tag) !== null && _b !== void 0 ? _b : personification === null || personification === void 0 ? void 0 : personification.tag,
860
- pin: (_c = params.pin) !== null && _c !== void 0 ? _c : personification === null || personification === void 0 ? void 0 : personification.pin,
848
+ tag: (_c = params.tag) !== null && _c !== void 0 ? _c : personification === null || personification === void 0 ? void 0 : personification.tag,
849
+ pin: (_d = params.pin) !== null && _d !== void 0 ? _d : personification === null || personification === void 0 ? void 0 : personification.pin,
861
850
  additionalInfo: {
862
851
  ...(params.additionalInfo || additionalInfo || {}),
863
- loginToken: resolveLoginToken((_d = params.additionalInfo) === null || _d === void 0 ? void 0 : _d.loginToken),
864
- language: ((_h = userLang !== null && userLang !== void 0 ? userLang : (_g = (_f = memori.culture) === null || _f === void 0 ? void 0 : _f.split('-')) === null || _g === void 0 ? void 0 : _g[0]) !== null && _h !== void 0 ? _h : 'IT').toLowerCase(),
852
+ loginToken: resolveLoginToken((_f = params.additionalInfo) === null || _f === void 0 ? void 0 : _f.loginToken),
853
+ language: ((_j = userLang !== null && userLang !== void 0 ? userLang : (_h = (_g = memori.culture) === null || _g === void 0 ? void 0 : _g.split('-')) === null || _h === void 0 ? void 0 : _h[0]) !== null && _j !== void 0 ? _j : 'IT').toLowerCase(),
865
854
  referral: referral,
866
855
  timeZoneOffset: new Date().getTimezoneOffset().toString(),
867
856
  },
@@ -917,15 +906,17 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
917
906
  try {
918
907
  if (!userBirthDate && !!minAge) {
919
908
  setShowAgeVerification(true);
909
+ setLoading(false);
920
910
  return;
921
911
  }
922
912
  if (memori.privacyType !== 'PUBLIC' &&
923
913
  !password &&
924
914
  !memori.secretToken &&
925
915
  !memoriPwd &&
926
- !recoveryTokens &&
916
+ !(recoveryTokens === null || recoveryTokens === void 0 ? void 0 : recoveryTokens.length) &&
927
917
  !memoriTokens) {
928
918
  setAuthModalState('password');
919
+ setLoading(false);
929
920
  return;
930
921
  }
931
922
  if (!(await checkCredits({ notify: true }))) {
@@ -1552,16 +1543,22 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
1552
1543
  }, []);
1553
1544
  (0, react_1.useEffect)(() => {
1554
1545
  if (!isPlayingAudio &&
1546
+ !memoriTyping &&
1555
1547
  continuousSpeech &&
1556
1548
  (hasUserActivatedListening || !requestedListening) &&
1557
1549
  sessionId &&
1558
1550
  !hasUserTypedMessage) {
1559
1551
  startRecording();
1560
1552
  }
1561
- else if (isPlayingAudio && isListening) {
1553
+ else if ((isPlayingAudio || memoriTyping) && isListening) {
1562
1554
  stopRecording();
1563
1555
  }
1564
- }, [isPlayingAudio, hasUserActivatedListening, hasUserTypedMessage]);
1556
+ }, [
1557
+ isPlayingAudio,
1558
+ hasUserActivatedListening,
1559
+ hasUserTypedMessage,
1560
+ memoriTyping,
1561
+ ]);
1565
1562
  (0, react_1.useEffect)(() => {
1566
1563
  stopRecording();
1567
1564
  }, [language]);
@@ -1611,7 +1608,7 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
1611
1608
  transform: none;
1612
1609
  }`);
1613
1610
  }
1614
- const integrationStylesheet = `@layer integration {
1611
+ const integrationStylesheet = `@layer memori.overrides {
1615
1612
  ${integrationStylesheetParts.join('\n ')}
1616
1613
  }
1617
1614
  `;
@@ -1713,8 +1710,9 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
1713
1710
  if (!birth && autoStart && (initialSessionID || targetSessionID))
1714
1711
  birth = '1970-01-01T10:24:03.845Z';
1715
1712
  const localPosition = (0, configuration_1.getLocalConfig)('position', undefined);
1716
- if (autoStart && !localPosition && memori.needsPosition) {
1717
- setPositionPopoverOpenState(true);
1713
+ if (autoStart &&
1714
+ (0, positionPopover_1.shouldHoldAutoStartForPosition)(!!memori.needsPosition, Boolean(position || localPosition))) {
1715
+ setClickedStart(false);
1718
1716
  return;
1719
1717
  }
1720
1718
  if (!(await checkCredits({ notify: true }))) {
@@ -1991,8 +1989,9 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
1991
1989
  }, [memoriPwd, memori, memoriTokens, birthDate, sessionId, userLang, position]);
1992
1990
  const setPositionPopoverOpen = (0, react_1.useCallback)((open) => {
1993
1991
  const sessionAlreadyStarted = !!(sessionId && hasUserActivatedSpeak);
1992
+ const hasPosition = Boolean(position || (0, configuration_1.getLocalConfig)('position', undefined));
1994
1993
  setPositionPopoverOpenState(wasOpen => {
1995
- if ((0, positionPopover_1.shouldRestartSessionOnPositionPopoverClose)(wasOpen, open, autoStart, sessionAlreadyStarted)) {
1994
+ if ((0, positionPopover_1.shouldRestartSessionOnPositionPopoverClose)(wasOpen, open, autoStart, sessionAlreadyStarted, hasPosition)) {
1996
1995
  queueMicrotask(() => {
1997
1996
  onClickStart();
1998
1997
  });
@@ -2004,14 +2003,17 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
2004
2003
  }
2005
2004
  return open;
2006
2005
  });
2007
- }, [autoStart, onClickStart, sessionId, hasUserActivatedSpeak]);
2006
+ }, [autoStart, onClickStart, sessionId, hasUserActivatedSpeak, position]);
2008
2007
  (0, react_1.useEffect)(() => {
2008
+ const storedPosition = (0, configuration_1.getLocalConfig)('position', undefined);
2009
+ const hasPosition = Boolean(position || storedPosition);
2009
2010
  if (!clickedStart &&
2010
2011
  !sessionStartingRef.current &&
2011
2012
  !sessionId &&
2012
2013
  autoStart &&
2013
2014
  selectedLayout !== 'HIDDEN_CHAT' &&
2014
- (!needsCredits || hasEnoughCredits)) {
2015
+ (!needsCredits || hasEnoughCredits) &&
2016
+ !(0, positionPopover_1.shouldHoldAutoStartForPosition)(!!memori.needsPosition, hasPosition)) {
2015
2017
  onClickStart();
2016
2018
  }
2017
2019
  }, [
@@ -2021,6 +2023,8 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
2021
2023
  sessionId,
2022
2024
  needsCredits,
2023
2025
  hasEnoughCredits,
2026
+ position,
2027
+ memori.needsPosition,
2024
2028
  ]);
2025
2029
  (0, react_1.useEffect)(() => {
2026
2030
  var _a;
@@ -2158,7 +2162,7 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
2158
2162
  };
2159
2163
  }, [sessionId]);
2160
2164
  const showFullHistory = showOnlyLastMessages === undefined
2161
- ? selectedLayout !== 'TOTEM' && selectedLayout !== 'WEBSITE_ASSISTANT'
2165
+ ? selectedLayout !== 'WEBSITE_ASSISTANT'
2162
2166
  : !showOnlyLastMessages;
2163
2167
  const canShowLoginButton = !(tenant === null || tenant === void 0 ? void 0 : tenant.ssoLogin) &&
2164
2168
  ((_y = showLogin !== null && showLogin !== void 0 ? showLogin : integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.showLogin) !== null && _y !== void 0 ? _y : memori.requireLoginToken);
@@ -2442,7 +2446,7 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
2442
2446
  setChatLogID(chatLog.chatLogID);
2443
2447
  onClickStart(undefined, false, chatLog);
2444
2448
  setShowChatHistoryDrawer(false);
2445
- }, apiClient: client, sessionId: sessionId || '', memori: memori, baseUrl: baseUrl, history: history, apiUrl: client.constants.BACKEND_URL, loginToken: loginToken, language: language, userLang: userLang, isMultilanguageEnabled: isMultilanguageEnabled })), showKnownFactsDrawer && sessionId && ((0, jsx_runtime_1.jsx)(KnownFacts_1.default, { apiClient: client, memori: memori, sessionID: sessionId, visible: showKnownFactsDrawer, closeDrawer: () => setShowKnownFactsDrawer(false) })), showExpertsDrawer && !!experts && ((0, jsx_runtime_1.jsx)(ExpertsDrawer_1.default, { apiUrl: client.constants.BACKEND_URL, baseUrl: baseUrl, tenant: tenant, experts: experts, open: showExpertsDrawer, onClose: () => setShowExpertsDrawer(false) })), showLoginDrawer && (tenant === null || tenant === void 0 ? void 0 : tenant.name) && ((0, jsx_runtime_1.jsx)(LoginDrawer_1.default, { tenant: tenant, apiClient: client, open: !!showLoginDrawer, user: user, loginToken: loginToken, onClose: () => setShowLoginDrawer(false), drawerClassName: selectedLayout === 'WEBSITE_ASSISTANT'
2449
+ }, apiClient: client, sessionId: sessionId || '', memori: memori, baseUrl: baseUrl, history: history, apiUrl: client.constants.BACKEND_URL, loginToken: loginToken, language: language, userLang: userLang, isMultilanguageEnabled: isMultilanguageEnabled, showFunctionCache: showFunctionCache, showMessageConsumption: enableMessageConsumption })), showKnownFactsDrawer && sessionId && ((0, jsx_runtime_1.jsx)(KnownFacts_1.default, { apiClient: client, memori: memori, sessionID: sessionId, visible: showKnownFactsDrawer, closeDrawer: () => setShowKnownFactsDrawer(false) })), showExpertsDrawer && !!experts && ((0, jsx_runtime_1.jsx)(ExpertsDrawer_1.default, { apiUrl: client.constants.BACKEND_URL, baseUrl: baseUrl, tenant: tenant, experts: experts, open: showExpertsDrawer, onClose: () => setShowExpertsDrawer(false) })), showLoginDrawer && (tenant === null || tenant === void 0 ? void 0 : tenant.name) && ((0, jsx_runtime_1.jsx)(LoginDrawer_1.default, { tenant: tenant, apiClient: client, open: !!showLoginDrawer, user: user, loginToken: loginToken, onClose: () => setShowLoginDrawer(false), drawerClassName: selectedLayout === 'WEBSITE_ASSISTANT'
2446
2450
  ? 'memori-drawer--above-website-assistant'
2447
2451
  : undefined, onLogin: (user, token) => {
2448
2452
  var _a, _b, _c, _d;